toolroll 0.9.130 → 0.9.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/agent-state.js +1 -1
- package/dist/browser/manifest.json +14 -14
- package/dist/browser/{terminal.2a682d0b91a35288271c73b7ee253e524cca0917d17fbaf6733e80b7a767a37c.js → terminal.8978c8cbb268e1006f4b0be371c2401b58078e6d9f1380f4a5c2a12da843909f.js} +1 -1
- package/dist/browser/terminal.8978c8cbb268e1006f4b0be371c2401b58078e6d9f1380f4a5c2a12da843909f.js.br +0 -0
- package/dist/browser/{terminal.2a682d0b91a35288271c73b7ee253e524cca0917d17fbaf6733e80b7a767a37c.js.gz → terminal.8978c8cbb268e1006f4b0be371c2401b58078e6d9f1380f4a5c2a12da843909f.js.gz} +0 -0
- package/dist/browser/{workspace.9bd1db81d3c897045a5d82d4804e374e41e78b1b2cfd05d37b982a4ea0d02626.js → workspace.4f5935dc80574baadf1adafd39a08c567fb1fac1323052ca355546622f9b06d2.js} +1 -1
- package/dist/browser/workspace.4f5935dc80574baadf1adafd39a08c567fb1fac1323052ca355546622f9b06d2.js.br +0 -0
- package/dist/browser/workspace.4f5935dc80574baadf1adafd39a08c567fb1fac1323052ca355546622f9b06d2.js.gz +0 -0
- package/dist/builder-restart.js +13 -4
- package/dist/builder.js +4 -1
- package/dist/central-recovery-stage.js +2 -2
- package/dist/chat-follow.js +4 -0
- package/dist/db-tuning.js +16 -0
- package/dist/discord.js +9 -3
- package/dist/dispatch.js +32 -4
- package/dist/doctor.js +30 -0
- package/dist/evidence.js +49 -3
- package/dist/exec.js +3 -0
- package/dist/git-views.js +7 -1
- package/dist/invoke.js +12 -2
- package/dist/lead-queue-runtime.js +8 -5
- package/dist/lead-status.js +3 -3
- package/dist/loop-recovery.js +40 -0
- package/dist/maintenance.js +29 -1
- package/dist/needs-you.js +2 -0
- package/dist/operate.js +376 -52
- package/dist/planner.js +4 -1
- package/dist/query-index-schema.js +10 -0
- package/dist/read-executor-worker.js +9 -7
- package/dist/read-executor.js +18 -1
- package/dist/read-worker-connection.js +7 -0
- package/dist/release-adapters.js +51 -6
- package/dist/release-cli.js +24 -11
- package/dist/release-next.js +1 -1
- package/dist/release-stops.js +71 -0
- package/dist/release-supersede.js +125 -0
- package/dist/release-supervise.js +90 -0
- package/dist/release.js +252 -40
- package/dist/runner.js +36 -1
- package/dist/scout.js +4 -1
- package/dist/serve.js +92 -6
- package/dist/shutdown-proof.js +29 -0
- package/dist/slack.js +9 -3
- package/dist/sqlite-telemetry.js +26 -14
- package/dist/statement-cache.js +137 -0
- package/dist/store.js +70 -13
- package/dist/task-status.js +1 -1
- package/dist/teams.js +9 -3
- package/dist/teardown-git.js +10 -1
- package/dist/telegram.js +4 -1
- package/dist/up-processes.js +16 -1
- package/dist/up-role-child.js +2 -0
- package/dist/wake-hub.js +15 -6
- package/dist/work-index.js +101 -44
- package/dist/work-reads.js +53 -9
- package/dist/work-snapshots.js +185 -0
- package/dist/worker-statement-cache.js +83 -0
- package/dist/workspace-revision.js +145 -21
- package/package.json +1 -1
- package/dist/browser/terminal.2a682d0b91a35288271c73b7ee253e524cca0917d17fbaf6733e80b7a767a37c.js.br +0 -0
- package/dist/browser/workspace.9bd1db81d3c897045a5d82d4804e374e41e78b1b2cfd05d37b982a4ea0d02626.js.br +0 -0
- package/dist/browser/workspace.9bd1db81d3c897045a5d82d4804e374e41e78b1b2cfd05d37b982a4ea0d02626.js.gz +0 -0
|
@@ -49,7 +49,7 @@ Error generating stack: `+n.message+`
|
|
|
49
49
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
50
50
|
`)},sW=0,Qc=[];function nM(e){var t=Kt.useRef([]),a=Kt.useRef([0,0]),n=Kt.useRef(),o=Kt.useState(sW++)[0],r=Kt.useState(gp)[0],s=Kt.useRef(e);Kt.useEffect(function(){s.current=e},[e]),Kt.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=q2([e.lockRef.current],(e.shards||[]).map(aM),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=Kt.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var v=gv(y),x=a.current,g="deltaX"in y?y.deltaX:x[0]-v[0],b="deltaY"in y?y.deltaY:x[1]-v[1],k,C=y.target,N=Math.abs(g)>Math.abs(b)?"h":"v";if("touches"in y&&N==="h"&&C.type==="range")return!1;var L=window.getSelection(),A=L&&L.anchorNode,P=A?A===C||A.contains(C):!1;if(P)return!1;var F=jk(N,C);if(!F)return!0;if(F?k=N:(k=N==="v"?"h":"v",F=jk(N,C)),!F)return!1;if(!n.current&&"changedTouches"in y&&(g||b)&&(n.current=k),!k)return!0;var B=n.current||k;return eM(B,w,y,B==="h"?g:b,!0)},[]),l=Kt.useCallback(function(y){var w=y;if(!(!Qc.length||Qc[Qc.length-1]!==r)){var v="deltaY"in w?tM(w):gv(w),x=t.current.filter(function(k){return k.name===w.type&&(k.target===w.target||w.target===k.shadowParent)&&oW(k.delta,v)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}if(!x){var g=(s.current.shards||[]).map(aM).filter(Boolean).filter(function(k){return k.contains(w.target)}),b=g.length>0?i(w,g[0]):!s.current.noIsolation;b&&w.cancelable&&w.preventDefault()}}},[]),u=Kt.useCallback(function(y,w,v,x){var g={name:y,delta:w,target:v,should:x,shadowParent:iW(v)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(b){return b!==g})},1)},[]),c=Kt.useCallback(function(y){a.current=gv(y),n.current=void 0},[]),f=Kt.useCallback(function(y){u(y.type,tM(y),y.target,i(y,e.lockRef.current))},[]),d=Kt.useCallback(function(y){u(y.type,gv(y),y.target,i(y,e.lockRef.current))},[]);Kt.useEffect(function(){return Qc.push(r),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Jl),document.addEventListener("touchmove",l,Jl),document.addEventListener("touchstart",c,Jl),function(){Qc=Qc.filter(function(y){return y!==r}),document.removeEventListener("wheel",l,Jl),document.removeEventListener("touchmove",l,Jl),document.removeEventListener("touchstart",c,Jl)}},[]);var m=e.removeScrollBar,h=e.inert;return Kt.createElement(Kt.Fragment,null,h?Kt.createElement(r,{styles:rW(o)}):null,m?Kt.createElement(Uk,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function iW(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var oM=Bk(hv,nM);var rM=vv.forwardRef(function(e,t){return vv.createElement(hp,to({},e,{ref:t,sideCar:oM}))});rM.classNames=hp.classNames;var yp=rM;var lW=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jc=new WeakMap,yv=new WeakMap,wv={},Wk=0,sM=function(e){return e&&(e.host||sM(e.parentNode))},uW=function(e,t){return t.map(function(a){if(e.contains(a))return a;var n=sM(a);return n&&e.contains(n)?n:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},cW=function(e,t,a,n){var o=uW(t,Array.isArray(e)?e:[e]);wv[a]||(wv[a]=new WeakMap);var r=wv[a],s=[],i=new Set,l=new Set(o),u=function(f){!f||i.has(f)||(i.add(f),u(f.parentNode))};o.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(d){if(i.has(d))c(d);else try{var m=d.getAttribute(n),h=m!==null&&m!=="false",y=(Jc.get(d)||0)+1,w=(r.get(d)||0)+1;Jc.set(d,y),r.set(d,w),s.push(d),y===1&&h&&yv.set(d,!0),w===1&&d.setAttribute(a,"true"),h||d.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",d,v)}})};return c(t),i.clear(),Wk++,function(){s.forEach(function(f){var d=Jc.get(f)-1,m=r.get(f)-1;Jc.set(f,d),r.set(f,m),d||(yv.has(f)||f.removeAttribute(n),yv.delete(f)),m||f.removeAttribute(a)}),Wk--,Wk||(Jc=new WeakMap,Jc=new WeakMap,yv=new WeakMap,wv={})}},xv=function(e,t,a){a===void 0&&(a="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||lW(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),cW(n,o,a,"aria-hidden")):function(){return null}};var wa=O(Z(),1),dW=Object.defineProperty,mr=(e,t)=>dW(e,"name",{value:t,configurable:!0}),Gk="Dialog",[iM,Rie]=An(Gk),[fW,Fs]=iM(Gk),Yk=mr(e=>{let{__scopeDialog:t,children:a,open:n,defaultOpen:o,onOpenChange:r,modal:s=!0}=e,i=aa.useRef(null),l=aa.useRef(null),[u,c]=Yl({prop:n,defaultProp:o??!1,onChange:r,caller:Gk}),[f,d]=aa.useState(0),[m,h]=aa.useState(0);return(0,wa.jsx)(fW,{scope:t,triggerRef:i,contentRef:l,contentId:Zr(),titleId:Zr(),descriptionId:Zr(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:d,setDescriptionCount:h,open:u,onOpenChange:c,onOpenToggle:aa.useCallback(()=>c(y=>!y),[c]),modal:s,children:a})},"Dialog");var lM="DialogPortal",[pW,uM]=iM(lM,{forceMount:void 0}),Xk=mr(e=>{let{__scopeDialog:t,forceMount:a,children:n,container:o}=e,r=Fs(lM,t);return(0,wa.jsx)(pW,{scope:t,forceMount:a,children:aa.Children.map(n,s=>(0,wa.jsx)(Xl,{present:a||r.open,children:(0,wa.jsx)(cv,{asChild:!0,container:o,children:s})}))})},"DialogPortal"),Kk="DialogOverlay",Zk=aa.forwardRef(mr(function(t,a){let n=uM(Kk,t.__scopeDialog),{forceMount:o=n.forceMount,...r}=t,s=Fs(Kk,t.__scopeDialog);return s.modal?(0,wa.jsx)(Xl,{present:o||s.open,children:(0,wa.jsx)(hW,{...r,ref:a})}):null},"DialogOverlay")),mW=Jn("DialogOverlay.RemoveScroll"),hW=aa.forwardRef(mr(function(t,a){let{__scopeDialog:n,...o}=t,r=Fs(Kk,n),s=Sk(),i=At(a,s);return(0,wa.jsx)(yp,{as:mW,allowPinchZoom:!0,shards:[r.contentRef],children:(0,wa.jsx)(ta.div,{"data-state":tS(r.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),wp="DialogContent",Qk=aa.forwardRef(mr(function(t,a){let n=uM(wp,t.__scopeDialog),{forceMount:o=n.forceMount,...r}=t,s=Fs(wp,t.__scopeDialog);return(0,wa.jsx)(Xl,{present:o||s.open,children:s.modal?(0,wa.jsx)(gW,{...r,ref:a}):(0,wa.jsx)(vW,{...r,ref:a})})},"DialogContent")),gW=aa.forwardRef(mr(function(t,a){let n=Fs(wp,t.__scopeDialog),o=aa.useRef(null),r=At(a,n.contentRef,o);return aa.useEffect(()=>{let s=o.current;if(s)return xv(s)},[]),(0,wa.jsx)(cM,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ct(t.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ct(t.onPointerDownOutside,s=>{let i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:ct(t.onFocusOutside,s=>s.preventDefault())})},"DialogContentModal")),vW=aa.forwardRef(mr(function(t,a){let n=Fs(wp,t.__scopeDialog),o=aa.useRef(!1),r=aa.useRef(!1);return(0,wa.jsx)(cM,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(o.current||n.triggerRef.current?.focus(),s.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(r.current=!0));let i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&r.current&&s.preventDefault()}})},"DialogContentNonModal")),cM=aa.forwardRef(mr(function(t,a){let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=t,l=Fs(wp,n);return Yc(),(0,wa.jsx)(wa.Fragment,{children:(0,wa.jsx)(lv,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:(0,wa.jsx)(iv,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":tS(l.open),...i,ref:a,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),yW="DialogTitle",Jk=aa.forwardRef(mr(function(t,a){let{__scopeDialog:n,...o}=t,r=Fs(yW,n),{setTitleCount:s}=r;return ya(()=>(s(i=>i+1),()=>s(i=>i-1)),[s]),(0,wa.jsx)(ta.h2,{id:r.titleId,...o,ref:a})},"DialogTitle"));var wW="DialogClose",eS=aa.forwardRef(mr(function(t,a){let{__scopeDialog:n,...o}=t,r=Fs(wW,n);return(0,wa.jsx)(ta.button,{type:"button",...o,ref:a,onClick:ct(t.onClick,()=>r.onOpenChange(!1))})},"DialogClose"));function tS(e){return e?"open":"closed"}mr(tS,"getState");var ed=O(Z(),1);function hr(...e){return e.filter(Boolean).join(" ")}function gr({summary:e,className:t,children:a,...n}){return(0,ed.jsxs)("details",{className:hr("ui-disclosure",t),...n,children:[(0,ed.jsx)("summary",{className:"ui-disclosure-trigger",children:e}),(0,ed.jsx)("div",{className:"ui-disclosure-content",children:a})]})}function Mn({className:e,tone:t="info",...a}){return(0,ed.jsx)("div",{role:t==="error"?"alert":"status","data-tone":t,className:hr("ui-alert",`ui-alert--${t}`,e),...a})}var kv=O(ve(),1);var sn=O(ve(),1);var bW={damping:.7,stiffness:.05,mass:1.25},kW=70,SW=1e3/60,CW=350,bv=!1;globalThis.document?.addEventListener("mousedown",()=>{bv=!0});globalThis.document?.addEventListener("mouseup",()=>{bv=!1});globalThis.document?.addEventListener("click",()=>{bv=!1});var fM=(e={})=>{let[t,a]=(0,sn.useState)(!1),[n,o]=(0,sn.useState)(e.initial!==!1),[r,s]=(0,sn.useState)(!1),i=(0,sn.useRef)(null);i.current=e;let l=(0,sn.useCallback)(()=>{if(!bv)return!1;let x=window.getSelection();if(!x||!x.rangeCount)return!1;let g=x.getRangeAt(0);return g.commonAncestorContainer.contains(w.current)||w.current?.contains(g.commonAncestorContainer)},[]),u=(0,sn.useCallback)(x=>{f.isAtBottom=x,o(x)},[]),c=(0,sn.useCallback)(x=>{f.escapedFromLock=x,a(x)},[]),f=(0,sn.useMemo)(()=>{let x;return{escapedFromLock:t,isAtBottom:n,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return w.current?.scrollTop??0},set scrollTop(g){if(w.current){let{scrollBehavior:b}=getComputedStyle(w.current);b!=="auto"&&(w.current.style.scrollBehavior="auto"),w.current.scrollTop=g,f.ignoreScrollToTop=w.current.scrollTop,b!=="auto"&&(w.current.style.scrollBehavior=b)}},get targetScrollTop(){return!w.current||!v.current?0:w.current.scrollHeight-1-w.current.clientHeight},get calculatedTargetScrollTop(){if(!w.current||!v.current)return 0;let{targetScrollTop:g}=this;if(!e.targetScrollTop)return g;if(x?.targetScrollTop===g)return x.calculatedScrollTop;let b=Math.max(Math.min(e.targetScrollTop(g,{scrollElement:w.current,contentElement:v.current}),g),0);return x={targetScrollTop:g,calculatedScrollTop:b},requestAnimationFrame(()=>{x=void 0}),b},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=kW}}},[]),d=(0,sn.useCallback)((x={})=>{typeof x=="string"&&(x={animation:x}),x.preserveScrollPosition||u(!0);let g=Date.now()+(Number(x.wait)||0),b=nS(i.current,x.animation),{ignoreEscapes:k=!1}=x,C,N=f.calculatedTargetScrollTop;x.duration instanceof Promise?x.duration.finally(()=>{C=Date.now()}):C=g+(x.duration??0);let L=async()=>{let A=new Promise(requestAnimationFrame).then(()=>{if(!f.isAtBottom)return f.animation=void 0,!1;let{scrollTop:P}=f,F=performance.now(),B=(F-(f.lastTick??F))/SW;if(f.animation||(f.animation={behavior:b,promise:A,ignoreEscapes:k}),f.animation.behavior===b&&(f.lastTick=F),l()||g>Date.now())return L();if(P<Math.min(N,f.calculatedTargetScrollTop)){if(f.animation?.behavior===b){if(b==="instant")return f.scrollTop=f.calculatedTargetScrollTop,L();f.velocity=(b.damping*f.velocity+b.stiffness*f.scrollDifference)/b.mass,f.accumulated+=f.velocity*B,f.scrollTop+=f.accumulated,f.scrollTop!==P&&(f.accumulated=0)}return L()}return C>Date.now()?(N=f.calculatedTargetScrollTop,L()):(f.animation=void 0,f.scrollTop<f.calculatedTargetScrollTop?d({animation:nS(i.current,i.current.resize),ignoreEscapes:k,duration:Math.max(0,C-Date.now())||void 0}):f.isAtBottom)});return A.then(P=>(requestAnimationFrame(()=>{f.animation||(f.lastTick=void 0,f.velocity=0)}),P))};return x.wait!==!0&&(f.animation=void 0),f.animation?.behavior===b?f.animation.promise:L()},[u,l,f]),m=(0,sn.useCallback)(()=>{c(!0),u(!1)},[c,u]),h=(0,sn.useCallback)(({target:x})=>{if(x!==w.current)return;let{scrollTop:g,ignoreScrollToTop:b}=f,{lastScrollTop:k=g}=f;f.lastScrollTop=g,f.ignoreScrollToTop=void 0,b&&b>g&&(k=b),s(f.isNearBottom),setTimeout(()=>{if(f.resizeDifference||g===b)return;if(l()){c(!0),u(!1);return}let C=g>k,N=g<k;if(f.animation?.ignoreEscapes){f.scrollTop=k;return}N&&(c(!0),u(!1)),C&&c(!1),!f.escapedFromLock&&f.isNearBottom&&u(!0)},1)},[c,u,l,f]),y=(0,sn.useCallback)(({target:x,deltaY:g})=>{let b=x;for(;!["scroll","auto"].includes(getComputedStyle(b).overflow);){if(!b.parentElement)return;b=b.parentElement}b===w.current&&g<0&&w.current.scrollHeight>w.current.clientHeight&&!f.animation?.ignoreEscapes&&(c(!0),u(!1))},[c,u,f]),w=dM(x=>{w.current?.removeEventListener("scroll",h),w.current?.removeEventListener("wheel",y),x?.addEventListener("scroll",h,{passive:!0}),x?.addEventListener("wheel",y,{passive:!0})},[]),v=dM(x=>{if(f.resizeObserver?.disconnect(),f.resizeObserver=void 0,!x)return;let g;f.resizeObserver=new ResizeObserver(([b])=>{let{height:k}=b.contentRect,C=k-(g??k);if(f.resizeDifference=C,f.scrollTop>f.targetScrollTop&&(f.scrollTop=f.targetScrollTop),s(f.isNearBottom),C>=0){let N=nS(i.current,g?i.current.resize:i.current.initial);d({animation:N,wait:!0,preserveScrollPosition:!0,duration:N==="instant"?void 0:CW})}else f.isNearBottom&&(c(!1),u(!0));g=k,requestAnimationFrame(()=>{setTimeout(()=>{f.resizeDifference===C&&(f.resizeDifference=0)},1)})}),f.resizeObserver?.observe(x)},[]);return{contentRef:v,scrollRef:w,scrollToBottom:d,stopScroll:m,isAtBottom:n||r,isNearBottom:r,escapedFromLock:t,state:f}};function dM(e,t){let a=(0,sn.useCallback)(n=>(a.current=n,e(n)),t);return a}var aS=new Map;function nS(...e){let t={...bW},a=!1;for(let o of e){if(o==="instant"){a=!0;continue}typeof o=="object"&&(a=!1,t.damping=o.damping??t.damping,t.stiffness=o.stiffness??t.stiffness,t.mass=o.mass??t.mass)}let n=JSON.stringify(t);return aS.has(n)||aS.set(n,Object.freeze(t)),a?"instant":aS.get(n)}var eu=O(ve(),1),ao=O(ve(),1);var pM=(0,ao.createContext)(null),LW=typeof window<"u"?ao.useLayoutEffect:ao.useEffect;function xp({instance:e,children:t,resize:a,initial:n,mass:o,damping:r,stiffness:s,targetScrollTop:i,contextRef:l,...u}){let c=(0,ao.useRef)(null),f=eu.useCallback((k,C)=>(b?.targetScrollTop??i)?.(k,C)??k,[i]),d=fM({mass:o,damping:r,stiffness:s,resize:a,initial:n,targetScrollTop:f}),{scrollRef:m,contentRef:h,scrollToBottom:y,stopScroll:w,isAtBottom:v,escapedFromLock:x,state:g}=e??d,b=(0,ao.useMemo)(()=>({scrollToBottom:y,stopScroll:w,scrollRef:m,isAtBottom:v,escapedFromLock:x,contentRef:h,state:g,get targetScrollTop(){return c.current},set targetScrollTop(k){c.current=k}}),[y,v,h,m,w,x,g]);return(0,ao.useImperativeHandle)(l,()=>b,[b]),LW(()=>{m.current&&getComputedStyle(m.current).overflow==="visible"&&(m.current.style.overflow="auto")},[]),eu.createElement(pM.Provider,{value:b},eu.createElement("div",{...u},typeof t=="function"?t(b):t))}(function(e){function t({children:a,scrollClassName:n,...o}){let r=bp();return eu.createElement("div",{ref:r.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:n},eu.createElement("div",{...o,ref:r.contentRef},typeof a=="function"?a(r):a))}e.Content=t})(xp||(xp={}));function bp(){let e=(0,ao.useContext)(pM);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}var mM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,hM=mh,td=(e,t)=>a=>{var n;if(t?.variants==null)return hM(e,a?.class,a?.className);let{variants:o,defaultVariants:r}=t,s=Object.keys(o).map(u=>{let c=a?.[u],f=r?.[u];if(c===null)return null;let d=mM(c)||mM(f);return o[u][d]}),i=a&&Object.entries(a).reduce((u,c)=>{let[f,d]=c;return d===void 0||(u[f]=d),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:f,className:d,...m}=c;return Object.entries(m).every(h=>{let[y,w]=h;return Array.isArray(w)?w.includes({...r,...i}[y]):{...r,...i}[y]===w})?[...u,f,d]:u},[]);return hM(e,s,l,a?.class,a?.className)};var gM=O(Z(),1),NW=td("inline-flex shrink-0 items-center justify-center gap-2 border-0 whitespace-nowrap rounded-md text-[13px] font-medium transition-[color,background-color,box-shadow,transform] duration-150 ease-out active:[transform:scale(.985)] motion-reduce:transition-colors motion-reduce:active:[transform:none] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",attention:"bg-attention text-on-attention hover:bg-[var(--so-signal-hover)]",destructive:"bg-destructive-soft text-destructive hover:bg-destructive/15",outline:"bg-card text-foreground shadow-[var(--so-pill-shadow)] hover:bg-accent",secondary:"bg-secondary text-secondary-foreground hover:bg-accent",ghost:"bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground",link:"bg-transparent text-foreground underline underline-offset-4 decoration-border hover:decoration-muted-foreground"},size:{default:"h-8 min-h-8 px-3 phone:h-11 phone:px-4",sm:"h-7 min-h-7 px-2.5 text-[12.5px] phone:h-11 phone:px-3 phone:text-[13px]",lg:"h-10 min-h-10 px-5",icon:"size-8 min-h-8 phone:size-11"}},defaultVariants:{variant:"default",size:"default"}});function pe({className:e,variant:t,size:a,asChild:n=!1,type:o,...r}){return(0,gM.jsx)(n?c2:"button",{"data-slot":"button",className:ye(NW({variant:t,size:a}),e),...n?{}:{type:o??"button"},...r})}var Lo=O(Z(),1);function yM({className:e,children:t,...a}){return(0,Lo.jsx)(xp,{className:hr("ui-conversation",e),initial:"instant",resize:"instant",role:"log","aria-label":"Conversation",...a,children:typeof t=="function"?n=>(0,Lo.jsxs)(Lo.Fragment,{children:[t(n),(0,Lo.jsx)(vM,{})]}):(0,Lo.jsxs)(Lo.Fragment,{children:[t,(0,Lo.jsx)(vM,{})]})})}function vM(){let{scrollRef:e,state:t,scrollToBottom:a}=bp(),n=(0,kv.useRef)(()=>t.isAtBottom&&!t.escapedFromLock);return n.current=()=>t.isAtBottom&&!t.escapedFromLock,(0,kv.useEffect)(()=>{let o=e.current;if(o===null||typeof ResizeObserver>"u")return;let r=o.clientHeight,s=new ResizeObserver(()=>{let i=o.clientHeight;i<r&&n.current()&&a({animation:"instant"}),r=i});return s.observe(o),()=>s.disconnect()},[e,a]),null}function wM({className:e,...t}){return(0,Lo.jsx)(xp.Content,{className:hr("ui-conversation-content",e),...t})}function xM({className:e,from:t,...a}){return(0,Lo.jsx)("article",{className:hr("ui-message",`ui-message--${t}`,e),"data-from":t,...a})}function Sv({className:e,...t}){return(0,Lo.jsx)("div",{className:hr("ui-message-content",e),...t})}var oS=O(ve(),1);var rS=O(Z(),1);var Wie=(0,oS.createContext)(null);function bM({className:e,...t}){return(0,rS.jsx)("section",{className:hr("ui-artifact",e),...t})}function kM({className:e,...t}){return(0,rS.jsx)("div",{className:hr("ui-artifact-content",e),...t})}var SM=O(Z(),1);var tu=O(ve(),1),kp=O(Z(),1),yn=(0,tu.createContext)(""),Vi=(0,tu.createContext)(!1);var Fe=(0,tu.forwardRef)(function({children:t,...a},n){let o=(0,tu.useContext)(yn);return(0,kp.jsxs)("form",{ref:n,method:"post",...a,children:[(0,kp.jsx)("input",{type:"hidden",name:"csrf",value:o}),t]})});var CM="x-toolroll-work";var IW="toolroll.key",TW="x-toolroll-key",RW=/^[0-9a-f]{64}$/;function AW(){try{let e=globalThis.localStorage?.getItem(IW)??null;if(e===null)return null;let t=JSON.parse(e),a=typeof t=="object"&&t!==null?t.key:null;return typeof a=="string"&&RW.test(a)?a:null}catch{return null}}function yt(e){let t=AW();return t===null?e:{...e,[TW]:t}}function Cv(e,t){t===""||!Number.isSafeInteger(e)||e<=0||fetch("/agents/seen",{method:"POST",credentials:"same-origin",headers:yt({accept:"application/json"}),body:new URLSearchParams({csrf:t,run:String(e)})}).catch(()=>{})}function LM(e,t,a=15e3){if(t===""||!Number.isSafeInteger(e)||e<=0)return()=>{};let n=Array.from(crypto.getRandomValues(new Uint8Array(12)),l=>l.toString(16).padStart(2,"0")).join(""),o=l=>fetch("/agents/watch",{method:"POST",credentials:"same-origin",keepalive:l,headers:yt({accept:"application/json"}),body:new URLSearchParams({csrf:t,run:String(e),view:n,op:l?"release":"hold"})}).catch(()=>{});o(!1);let r=setInterval(()=>{o(!1)},a),s=!1,i=()=>{s||(s=!0,clearInterval(r),window.removeEventListener("pagehide",i),o(!0))};return window.addEventListener("pagehide",i),i}var NM=864e5,sS="standing-orders:workspace-draft:",TM="standing-orders:workspace-carry:",iS=/^[a-f0-9]{32}$/;function lS(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("")}function Lv(e,t){return`${e}${encodeURIComponent(t.user)}:${e===sS?`${t.session}:`:""}${encodeURIComponent(t.task??"")}`}function ad(e,t=Date.now()){return{text:"",request:e,submitted:!1,pending:null,at:t}}function Vt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function MW(e,t){return Vt(e)&&typeof e.request=="string"&&iS.test(e.request)&&typeof e.text=="string"&&e.text.length<=t}function RM(e,t,a,n,o=Date.now()){let r=ad(a,o);try{let s=Lv(sS,t),i=JSON.parse(e.getItem(s)??"null");if(Vt(i)&&i.user===t.user&&i.session===t.session&&i.task===t.task&&typeof i.at=="number"&&i.at>o-NM&&i.at<=o&&typeof i.text=="string"&&i.text.length<=n&&typeof i.request=="string"&&iS.test(i.request)&&typeof i.submitted=="boolean"&&(i.pending===null||MW(i.pending,n)))return{text:i.text,request:i.request,submitted:i.submitted,pending:i.pending,at:i.at};e.removeItem(s);let l=Lv(TM,t),u=JSON.parse(e.getItem(l)??"null");if(e.removeItem(l),Vt(u)&&u.user===t.user&&u.task===t.task&&typeof u.at=="number"&&u.at>o-NM&&u.at<=o&&typeof u.text=="string"&&u.text.length<=n)return{...r,text:u.text}}catch{}return r}function uS(e,t,a){try{let n=Lv(sS,t);return a.text||a.pending?e.setItem(n,JSON.stringify({...t,...a})):e.removeItem(n),!0}catch{return!1}}function AM(e,t,a,n=Date.now()){try{return t.user&&a.trim()&&e.setItem(Lv(TM,t),JSON.stringify({user:t.user,task:t.task,text:a,at:n})),!0}catch{return!1}}function Nv(e,t,a=lS,n=Date.now()){return{...e,text:t,request:e.submitted?a():e.request,submitted:!1,at:n}}function EM(e,t=Date.now()){return e.pending||!e.text.trim()?e:{...e,submitted:!0,pending:{request:e.request,text:e.text},at:t}}function MM(e,t,a,n=lS,o=Date.now()){return!t||!a?.received||a.request!==t||e.pending?.request!==t?e:e.submitted&&e.request===t&&e.text===e.pending.text?ad(n(),o):{...e,pending:null,at:o}}function DM(e,t,a=lS,n=Date.now()){return e.pending?.request!==t?e:e.submitted&&e.request===t&&e.text===e.pending.text?ad(a(),n):{...e,pending:null,at:n}}function _M(e,t){return e.pending?.request===t?{...e,pending:null,submitted:!1}:e}var DW=0;function PM(e,t,a=null){let n=e.conversation?.sessionId===DW&&t.conversation!=null&&t.conversation.sessionId>0&&t.conversation.sessionId===a;return e.user===t.user&&(n||e.conversation?.sessionId===t.conversation?.sessionId)&&e.conversation?.taskId===t.conversation?.taskId&&e.conversation?.resultRunId===t.conversation?.resultRunId&&(e.conversation?.project??null)===(t.conversation?.project??null)}function Iv(e){if(!e.startsWith("/")||e.startsWith("//"))throw new Error("Unexpected workspace address");return e}function _W(e){return Vt(e)&&(e.sandbox===null||typeof e.sandbox=="string")&&Array.isArray(e.steps)&&e.steps.every(t=>Vt(t)&&typeof t.key=="string"&&typeof t.title=="string"&&typeof t.done=="boolean"&&(t.action===null||Vt(t.action)&&(t.action.kind==="command"?typeof t.action.command=="string":t.action.kind==="link"&&typeof t.action.label=="string"&&typeof t.action.href=="string"&&t.action.href.startsWith("/"))))&&Array.isArray(e.suggestions)&&e.suggestions.every(t=>Vt(t)&&typeof t.label=="string"&&typeof t.draft=="string"&&typeof t.source=="string")}function nd(e){if(!Vt(e)||e.version!==1||typeof e.path!="string"||typeof e.title!="string"||typeof e.user!="string"||typeof e.csrf!="string"||typeof e.refreshUrl!="string"||typeof e.sensitive!="boolean"||typeof e.crewTruncated!="boolean"||typeof e.catchUpHtml!="string"||typeof e.controlsHtml!="string"||!Array.isArray(e.notices)||!e.notices.every(a=>typeof a=="string")||!(e.pageHtml===null||typeof e.pageHtml=="string")||!Array.isArray(e.navigation)||!e.navigation.every(a=>Vt(a)&&typeof a.label=="string"&&typeof a.href=="string"&&typeof a.active=="boolean"&&(a.count===void 0||typeof a.count=="number"))||e.view!==void 0&&e.view!==null&&!(Vt(e.view)&&typeof e.view.kind=="string")||e.work!==void 0&&!(Array.isArray(e.work)&&e.work.every(a=>Vt(a)&&typeof a.kind=="string"))||e.scripted!==void 0&&typeof e.scripted!="boolean"||e.signIn!==void 0&&!(Array.isArray(e.signIn)&&e.signIn.every(a=>Vt(a)&&[a.provider,a.title,a.command,a.detail,a.resumeLabel,a.resumeHref].every(n=>typeof n=="string")&&String(a.resumeHref).startsWith("/")))||e.firstRun!==void 0&&!_W(e.firstRun)||e.refreshSeconds!==void 0&&!(typeof e.refreshSeconds=="number"&&Number.isFinite(e.refreshSeconds)&&e.refreshSeconds>=5)||e.chats!==void 0&&!(Array.isArray(e.chats)&&e.chats.every(a=>Vt(a)&&(a.kind==="project"||a.kind==="task")&&typeof a.title=="string"&&typeof a.href=="string"&&a.href.startsWith("/")&&typeof a.active=="boolean"&&(a.at===null||typeof a.at=="string")))||!Array.isArray(e.projects)||!e.projects.every(a=>Vt(a)&&[a.name,a.path,a.href,a.knowledgeHref].every(n=>typeof n=="string"))||!Array.isArray(e.crew)||!e.crew.every(a=>Vt(a)&&[a.id,a.title,a.state,a.label,a.tone,a.href].every(n=>typeof n=="string")&&(a.project===null||typeof a.project=="string")&&(a.resultHref===null||typeof a.resultHref=="string")&&(a.action===null||Vt(a.action)&&typeof a.action.label=="string"&&typeof a.action.href=="string"))||!(e.focus===null||Vt(e.focus)&&typeof e.focus.id=="string"&&typeof e.focus.title=="string"&&typeof e.focus.html=="string")||!(e.result===null||Vt(e.result)&&typeof e.result.runId=="number"&&typeof e.result.html=="string")||!(e.receipt===null||Vt(e.receipt)&&typeof e.receipt.request=="string"&&typeof e.receipt.received=="boolean"))return!1;let t=e.conversation;return t===null||Vt(t)&&typeof t.sessionId=="number"&&typeof t.user=="string"&&typeof t.version=="string"&&typeof t.requestId=="string"&&iS.test(t.requestId)&&typeof t.maxChars=="number"&&t.maxChars>0&&(t.taskId===null||typeof t.taskId=="string")&&(t.resultRunId===null||typeof t.resultRunId=="number")&&(t.project===void 0||t.project===null||typeof t.project=="string")&&(t.pendingTurnId===null||typeof t.pendingTurnId=="number")&&Array.isArray(t.messages)&&t.messages.every(IM)&&(t.previous===void 0||t.previous===null||Vt(t.previous)&&Array.isArray(t.previous.messages)&&t.previous.messages.every(IM))&&(t.failure===void 0||t.failure===null||typeof t.failure=="string")}function IM(e){return Vt(e)&&typeof e.id=="number"&&(e.role==="operator"||e.role==="assistant")&&typeof e.text=="string"&&typeof e.html=="string"&&typeof e.cardsHtml=="string"&&typeof e.createdAt=="string"&&(e.activity===null||typeof e.activity=="string")&&(e.cards===void 0||Array.isArray(e.cards)&&e.cards.every(t=>Vt(t)&&typeof t.id=="number"&&typeof t.kind=="string"&&typeof t.label=="string"&&typeof t.state=="string"&&typeof t.body=="string"&&Array.isArray(t.links)&&typeof t.dismissable=="boolean"))}var Qr=class extends Error{},OM={[CM]:String(2)};async function BM(e,t,a=fetch,n={}){let o=new URL(Iv(e.refreshUrl),window.location.origin);o.searchParams.set("format","workspace"),t?o.searchParams.set("request",t):o.searchParams.delete("request");let r=t||n.force?null:n.etag,s=await a(o.pathname+o.search,{credentials:"same-origin",cache:"no-store",headers:{accept:"application/json",...OM,...r?{"if-none-match":r}:{}},signal:AbortSignal.timeout(12e3)});if(s.status===401||s.status===403||s.redirected)throw new Qr("Sign in again to reconnect. Your draft stays in this tab.");if(s.status===304){if(!r)throw new Error("The update was incomplete. Your current view is preserved.");return{kind:"unchanged",etag:s.headers.get("etag")??r}}if(!s.ok)throw new Error("Updates are unavailable. Your work is still saved.");let i=await s.json();if(!nd(i))throw new Error("The update was incomplete. Your current view is preserved.");return{kind:"changed",workspace:i,etag:s.headers.get("etag")}}async function zM(e,t,a=fetch,n=null){let o=e.conversation;if(!o)throw new Qr("Reconnect to the conversation before sending.");let r=new URLSearchParams({csrf:e.csrf,message:t.text,request:t.request,"request-session":String(o.sessionId)});n!==null&&o.taskId&&r.set("mode",n),o.taskId?r.set("task",o.taskId):o.project&&r.set("project",o.project),o.resultRunId!==null&&r.set("result",String(o.resultRunId));let s=await a("/chat",{method:"POST",credentials:"same-origin",body:r,headers:yt({accept:"application/json"}),signal:AbortSignal.timeout(15e3)});if(s.status===401||s.status===403)throw new Qr("Sign in again to reconnect. Your draft stays in this tab.");if(s.status===409&&!s.headers.get("content-type")?.includes("application/json"))throw new Qr("Toolroll restarted. Reconnect to send; your draft stays in this tab.");if(s.headers.get("content-type")?.includes("application/json")){let i=await s.json();if(Vt(i)&&i.ok===!1)return{refused:!0,message:typeof i.said=="string"?i.said:"Message not sent. Your draft is saved."};let l=Vt(i)&&i.ok===!0&&i.request===t.request&&typeof i.session=="number"&&Number.isSafeInteger(i.session)&&i.session>0?{session:i.session}:{};return Vt(i)&&i.ok===!0&&i.queued===!0&&i.request===t.request?{refused:!1,message:null,queued:!0,...l}:{refused:!1,message:null,...l}}return{refused:!1,message:null}}async function HM(e,t,a,n=15,o=r=>new Promise(s=>setTimeout(s,r))){for(let r=0;r<n;r++){if(e()!==t)return!0;await o(r===0?300:1e3),await a()}return e()!==t}var PW=8e3;async function od(e,t,a=fetch,n){let o;try{o=new URL(Iv(e),window.location.origin)}catch{return null}if(o.origin!==window.location.origin)return null;o.hash="",o.searchParams.set("format","workspace"),o.searchParams.delete("request");let r=new AbortController,s=()=>r.abort(),i=setTimeout(s,PW);n?.aborted?s():n?.addEventListener("abort",s,{once:!0});try{let l=await a(o.pathname+o.search,{credentials:"same-origin",cache:"no-store",redirect:"manual",signal:r.signal,headers:{accept:"application/json","x-toolroll-read":t,...OM}});if(l.status!==200||l.redirected||l.type==="opaqueredirect"||!(l.headers.get("content-type")??"").includes("application/json"))return null;let u=await l.json();return nd(u)?u:null}catch{return null}finally{clearTimeout(i),n?.removeEventListener("abort",s)}}var sa=O(ve(),1);var sd=O(ve(),1);var OW="x-toolroll-live";var BW=/^[0-9a-f]{24}$/;function cS(e,t){let a=Math.min(6e4,1e3*2**(Math.min(e,30)+1));return a/2+t*(a/2)}var fS=class{buffer="";event="";data=[];push(t){this.buffer+=t;let a=[];for(;;){let n=this.buffer.search(/\r\n|\n|\r/);if(n<0||this.buffer[n]==="\r"&&n===this.buffer.length-1)break;let o=this.buffer.slice(0,n);if(this.buffer=this.buffer.slice(n+(this.buffer.startsWith(`\r
|
|
51
51
|
`,n)?2:1)),o===""){this.data.length>0&&a.push({event:this.event===""?"message":this.event,data:this.data.join(`
|
|
52
|
-
`)}),this.event="",this.data=[];continue}if(o.startsWith(":"))continue;let r=o.indexOf(":"),s=r<0?o:o.slice(0,r),i=r<0?"":o.slice(r+1);i.startsWith(" ")&&(i=i.slice(1)),s==="event"?this.event=i:s==="data"&&this.data.push(i)}return a}},FM=()=>({fetch:(e,t)=>fetch(e,t),now:()=>Date.now(),random:()=>Math.random(),setTimeout:(e,t)=>window.setTimeout(e,t),clearTimeout:e=>window.clearTimeout(e),setInterval:(e,t)=>window.setInterval(e,t),clearInterval:e=>window.clearInterval(e),online:()=>typeof navigator>"u"||navigator.onLine!==!1,near:()=>typeof location>"u"||zW(location.hostname)});function zW(e){let t=e.replace(/^\[|\]$/g,"").toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t.endsWith(".local")||t==="::1"||/^fe80:/.test(t)||/^f[cd][0-9a-f]{2}:/.test(t)||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t)||/^169\.254\./.test(t)}function qM(){return typeof fetch=="function"&&typeof ReadableStream=="function"&&typeof TextDecoder=="function"&&typeof AbortController=="function"}function dS(e){try{let t=JSON.parse(e.data);if(t===null||typeof t!="object"||Array.isArray(t))return null;let{room:a,at:n,seq:o}=t;if(typeof a!="string")return null;let r={...t};return delete r.seq,{slot:`${a}\0${e.event}`,same:e.event==="change"&&n!==void 0?JSON.stringify(n):JSON.stringify(r),seq:typeof o=="number"&&Number.isSafeInteger(o)&&o>0?o:null}}catch{return null}}var Tv=class{constructor(t,a){this.deps=t;this.events=a}deps;events;target="";current=null;candidate=null;handoverDue=null;helloDue=null;probing=null;pings=0;heard=new Map;pingQuietUntil=0;status="idle";attempt=0;retry=null;retryAt=Number.POSITIVE_INFINITY;waiting=null;lastAttemptAt=Number.NEGATIVE_INFINITY;said=null;beat=null;lastBeatAt=0;suspendedAt=null;disposed=!1;get state(){return this.status}get wanted(){return this.target}get live(){return this.status==="live"&&this.current?.reading===!0}want(t,a=!1){if(!(this.disposed||t===this.target)){if(this.target=t,t===""){this.stop();return}if(!a&&this.candidate!==null&&this.current?.reading===!0&&!this.current.suspect&&this.current.url===t){this.dropCandidate();return}this.waiting==="refused"||this.suspendedAt!==null||this.open(a)}}retarget(t){this.disposed||t===""||(this.target=t,!(this.candidate===null||this.candidate.url===t)&&(this.dropCandidate(),this.current?.suspect===!0&&this.open(!1,!0)))}dropCandidate(){let t=this.candidate;this.candidate=null,this.endHandover(),this.abort(t)}wake(t=!1){if(this.disposed||this.target==="")return;if(this.suspendedAt!==null){this.suspendedAt=null,this.open();return}if(this.waiting!==null){let n=this.lastAttemptAt+1e3-this.deps.now();n<=0?this.open():n<this.retryAt-this.deps.now()&&this.schedule(n);return}let a=this.current;if(a===null){this.open();return}if(!(!a.reading||this.candidate!==null)){if(a.conn!==null&&this.deps.now()>=this.pingQuietUntil){this.probe(a,t);return}this.deps.now()-a.lastByteAt>a.tickMs+5e3&&this.open(!1,!0)}}offline(){this.disposed||this.target===""||this.suspendedAt!==null||this.current!==null&&this.open(!1,!0)}suspend(){this.disposed||(this.retireAll(),this.cancelRetry(),this.waiting=null,this.heard.clear(),this.suspendedAt=this.deps.now())}resume(){this.disposed||this.suspendedAt===null||(this.suspendedAt=null,this.target!==""&&this.open())}dispose(){this.stop(),this.disposed=!0}setState(t){this.status!==t&&(this.status=t,this.events.state(t))}active(t){return t===this.current||t===this.candidate}abort(t){try{t?.controller.abort()}catch{}}endHandover(){this.handoverDue!==null&&this.deps.clearTimeout(this.handoverDue),this.helloDue!==null&&this.deps.clearTimeout(this.helloDue),this.handoverDue=this.helloDue=null}retireAll(){this.endHandover(),this.endProbe();let t=[this.current,this.candidate];this.current=this.candidate=null;for(let a of t)this.abort(a)}cancelRetry(){this.retry!==null&&this.deps.clearTimeout(this.retry),this.retry=null,this.retryAt=Number.POSITIVE_INFINITY}schedule(t){this.cancelRetry(),this.retryAt=this.deps.now()+t,this.retry=this.deps.setTimeout(()=>{this.retry=null,this.retryAt=Number.POSITIVE_INFINITY,this.open()},t)}stop(){this.retireAll(),this.cancelRetry(),this.waiting=null,this.attempt=0,this.said=null,this.suspendedAt=null,this.heard.clear(),this.beat!==null&&this.deps.clearInterval(this.beat),this.beat=null,this.setState("idle")}ensureBeat(){this.beat===null&&(this.lastBeatAt=this.deps.now(),this.beat=this.deps.setInterval(()=>this.onBeat(),1e3))}onBeat(){let t=this.deps.now(),a=t-this.lastBeatAt;if(this.lastBeatAt=t,this.target==="")return;if(this.suspendedAt!==null){t-this.suspendedAt>2e3&&this.resume();return}if(a>5e3){this.wake(!0);return}let n=this.current;n?.reading===!0&&this.candidate===null&&t-n.lastByteAt>n.tickMs*2+5e3&&this.open(!1,!0)}open(t=!1,a=!1){if(this.disposed||this.target==="")return;a&&this.current!==null&&(this.current.suspect=!0),this.cancelRetry(),this.waiting=null,this.suspendedAt=null,this.endProbe(),this.lastAttemptAt=this.deps.now(),this.ensureBeat();let n={url:this.target,controller:new AbortController,reading:!1,openedAt:0,lastByteAt:0,tickMs:15e3,conn:null,helloAt:null,held:[],incarnation:null,synced:!1,suspect:!1};t||this.current===null||!this.current.reading?(this.retireAll(),this.current=n,this.setState(this.said===null&&this.attempt===0?"connecting":"reconnecting")):(this.abort(this.candidate),this.candidate=n,this.handoverDue??=this.deps.setTimeout(()=>{this.handoverDue=null,this.takeOver()},3e3),this.helloDue!==null&&this.deps.clearTimeout(this.helloDue),this.helloDue=this.deps.setTimeout(()=>{this.helloDue=null,this.candidate===n&&n.helloAt===null&&this.takeOver()},1500)),this.read(n).catch(()=>{this.active(n)&&!this.disposed&&this.events.unusable()})}takeOver(){let t=this.candidate;if(t===null)return!1;if(t.url!==this.target)return this.dropCandidate(),!1;this.endHandover(),this.endProbe();let a=this.current;return this.candidate=null,this.current=t,this.abort(a),t.reading?this.up(t):this.setState(this.said===null&&this.attempt===0?"connecting":"reconnecting"),!0}promoteIfCaughtUp(t){if(t!==this.candidate||!t.synced)return;let a=new Map;for(let o of t.held){let r=dS(o);if(r===null)continue;let s=a.get(r.slot);a.set(r.slot,r.seq===null?s??null:Math.max(s??0,r.seq))}let n=new Set(new URLSearchParams(t.url.slice(t.url.indexOf("?")+1)).getAll("room"));for(let[o,r]of this.heard){let[s="",i=""]=o.split("\0");if(!n.has(s)||i==="gone")continue;if(!a.has(o))return;let l=a.get(o)??null;if(l!==null&&r.seq!==null&&r.incarnation===t.incarnation&&l<r.seq)return}this.takeOver()}up(t){this.said=null,this.setState("live"),this.events.opened(t.url);let a=t.held;t.held=[];let n=a.map(dS),o=new Map;n.forEach((r,s)=>{if(r===null)return;let i=o.get(r.slot),l=i===void 0?null:n[i]?.seq??null;(i===void 0||r.seq===null||l===null||r.seq>=l)&&o.set(r.slot,s)});for(let[r,s]of a.entries()){if(this.current!==t)return;let i=n[r]??null;i!==null&&o.get(i.slot)!==r||this.apply(t,s)}}apply(t,a){let n=dS(a);if(n!==null){let o=this.heard.get(n.slot);if(o!==void 0&&(n.seq!==null&&o.seq!==null&&o.incarnation===t.incarnation&&n.seq<=o.seq||o.same===n.same))return;this.heard.set(n.slot,{same:n.same,incarnation:t.incarnation,seq:n.seq})}try{this.events.frame(a.event,a.data)}catch(o){queueMicrotask(()=>{throw o})}}async read(t){let a;try{a=await this.deps.fetch(t.url,{headers:{accept:"text/event-stream",[OW]:"1"},credentials:"same-origin",cache:"no-store",redirect:"manual",signal:t.controller.signal})}catch{this.active(t)&&this.failed(t,"network");return}if(!this.active(t)){a.body?.cancel().catch(()=>{});return}if(a.type==="opaqueredirect"||a.status===401||a.status===403){a.body?.cancel().catch(()=>{}),this.failed(t,"refused");return}if(!a.ok||!(a.headers.get("content-type")??"").startsWith("text/event-stream")){a.body?.cancel().catch(()=>{}),this.failed(t,"error");return}let n=a.body;if(n===null||typeof n.getReader!="function"){this.events.unusable();return}let o=n.getReader(),r=new fS,s=new TextDecoder;t.reading=!0,t.openedAt=t.lastByteAt=this.deps.now(),t===this.current&&this.up(t);try{for(;;){if(!this.active(t)){o.cancel().catch(()=>{});return}let{done:i,value:l}=await o.read();if(!this.active(t)){o.cancel().catch(()=>{});return}if(i)break;let u=this.deps.now();t.lastByteAt=u,t===this.current&&(u-t.openedAt>=3e4&&(this.attempt=0),this.probing?.stream===t&&this.endProbe());for(let c of r.push(s.decode(l,{stream:!0})))if(!this.active(t)||!this.take(t,c))return}}catch{this.active(t)&&this.failed(t,"network");return}this.active(t)&&this.failed(t,"dropped")}take(t,a){switch(a.event){case"hello":return this.hello(t,a.data),!0;case"tick":case"pong":return!0;case"synced":return t===this.candidate&&(t.synced=!0,this.promoteIfCaughtUp(t)),!0;case"ended":return this.failed(t,"refused"),!1}return t===this.current?(this.apply(t,a),!0):(t.held.push(a),t.held.length>64?this.takeOver():this.promoteIfCaughtUp(t),!0)}hello(t,a){t.helloAt=this.deps.now();try{let n=JSON.parse(a),o=n.tick,r=n.conn,s=n.incarnation;typeof s=="string"&&s.length<=64&&(t.incarnation=s),typeof o=="number"&&Number.isFinite(o)&&o>=1e3&&o<=12e4&&(t.tickMs=o),typeof r=="string"&&BW.test(r)&&(t.conn=r)}catch{}}failed(t,a){t===this.current&&this.candidate!==null&&a!=="refused"&&this.takeOver()||this.fail(a)}probe(t,a){if(this.probing!==null)return;let n=this.deps.near(),o={stream:t,controller:new AbortController,silence:null,deadline:null};this.probing=o;let r=()=>{this.probing===o&&(this.endProbe(),this.current===t&&this.candidate===null&&this.open(!1,!0))};o.deadline=this.deps.setTimeout(r,n||a?3e3:15e3),this.pings+=1;let s;try{s=this.deps.fetch(`/live/ping?conn=${t.conn??""}&n=${this.pings}`,{credentials:"same-origin",cache:"no-store",redirect:"manual",signal:o.controller.signal})}catch{r();return}s.then(i=>{if(i.body?.cancel().catch(()=>{}),this.probing===o)if(i.status===204)o.silence=this.deps.setTimeout(r,n?500:2500);else if(i.status===429){let l=i.headers.get("retry-after"),u=l!==null&&/^[0-9]{1,6}$/.test(l.trim())?Number(l.trim()):10;this.pingQuietUntil=this.deps.now()+Math.min(60,Math.max(1,u))*1e3,o.deadline!==null&&this.deps.clearTimeout(o.deadline),o.deadline=null,o.silence=this.deps.setTimeout(r,Math.max(0,t.lastByteAt+t.tickMs+5e3-this.deps.now()))}else r()},r)}endProbe(){let t=this.probing;if(t!==null){this.probing=null,t.silence!==null&&this.deps.clearTimeout(t.silence),t.deadline!==null&&this.deps.clearTimeout(t.deadline);try{t.controller.abort()}catch{}}}fail(t){this.retireAll(),this.heard.clear();let a=t==="error"||t==="refused"?"lost":"retrying";(a==="lost"?this.said!=="lost":this.said===null)&&(this.said=a,this.events.trouble(a));let n;t==="refused"?(this.waiting="refused",n=cS(Number.POSITIVE_INFINITY,this.deps.random())):this.deps.online()?(this.waiting="backoff",n=cS(this.attempt,this.deps.random()),this.attempt+=1):(this.waiting="offline",n=cS(Number.POSITIVE_INFINITY,this.deps.random())),this.setState(this.waiting==="backoff"?"reconnecting":this.waiting==="offline"?"offline":"signed-out"),this.schedule(n)}};var Mv="so:live",UM=["change","here","gone","turn"],Rv=3e4,Av=2e3,id=(e,t,a)=>{let n=new URLSearchParams;for(let[r,s]of Object.entries(a??{}))s!=null&&s!==!1&&n.set(r,s===!0?"1":String(s));let o=n.toString();return`${e}${t==null?"":`:${encodeURIComponent(String(t))}`}${o===""?"":`?${o}`}`},HW=new Set(["workspace","summary","chat","team"]),FW=e=>e.split(/[:?]/,1)[0]??"",Ev=e=>e===""?[]:new URLSearchParams(e.slice(e.indexOf("?")+1)).getAll("room");function qW(){return typeof document>"u"?"eventsource":document.getElementById("standing-orders-workspace")?.dataset.liveReader==="stream"&&qM()?"stream":"eventsource"}var pS=class{subscriptions=new Map;next=0;source=null;url="";held=new Set;refusedAt=0;settling=null;quietUntil=0;scheduled=!1;watching=!1;quiet=!1;reader;supervisor=null;deps;connection="idle";stateListeners=new Set;hiddenSince=null;graceTimer=null;constructor(t={}){this.reader=t.reader??null,this.deps=t.deps??{}}connectionState=()=>this.connection;onConnectionState=t=>(this.stateListeners.add(t),()=>{this.stateListeners.delete(t)});setQuiet(t){this.quiet!==t&&(this.quiet=t,this.schedule())}subscribe(t,a,n=!1){let o=this.next++;return this.subscriptions.set(o,{room:t,listener:a,hidden:n}),this.schedule(),()=>{this.subscriptions.delete(o),this.schedule()}}schedule(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.reconcile()}))}wanted(t){if(this.quiet)return"";let a=this.reader==="stream";if(a&&t&&this.hiddenSince!==null&&Date.now()-this.hiddenSince>=6e4)return"";let n=r=>!t||(a?HW.has(FW(r.room)):r.hidden),o=[...new Set([...this.subscriptions.values()].filter(n).map(r=>r.room))].sort();return o.length===0?"":`/live?${o.map(r=>`room=${encodeURIComponent(r)}`).join("&")}`}unsettle(){this.settling!==null&&window.clearTimeout(this.settling),this.settling=null}deliver(t,a){let n={};try{let r=JSON.parse(a);r!==null&&typeof r=="object"&&!Array.isArray(r)&&(n=r)}catch{}let o=typeof n.room=="string"?n.room:null;for(let r of[...this.subscriptions.values()])(o===null||r.room===o)&&r.listener(t,n);window.dispatchEvent(new CustomEvent(Mv,{detail:{room:o,event:t,data:n}}))}setConnection(t){if(this.connection!==t){this.connection=t,t==="idle"?delete document.documentElement.dataset.liveState:document.documentElement.dataset.liveState=t;for(let a of[...this.stateListeners])a()}}reconcile(){if(typeof document>"u")return;if(this.reader??=qW(),this.reader==="stream"){this.reconcileStream();return}if(typeof EventSource>"u")return;this.watching||(this.watching=!0,document.addEventListener("visibilitychange",()=>this.reconcile()),window.addEventListener("online",()=>{this.quietUntil=0,this.reconcile()}));let t=this.wanted(document.hidden);if(t===this.url&&(t===""||this.source!==null))return;let a=Ev(t);if(this.source!==null&&a.length>0&&a.length===this.held.size&&a.every(r=>this.held.has(r))){this.url=t;return}if(t!==""&&Date.now()<this.quietUntil)return;let n=Date.now()-this.refusedAt;if(this.source!==null&&t!==""&&n<Av){this.settling===null&&(this.settling=window.setTimeout(()=>{this.settling=null,this.reconcile()},Av-n));return}if(this.unsettle(),this.source?.close(),this.source=null,this.url=t,t===""){delete document.documentElement.dataset.live;return}document.documentElement.dataset.live="1";let o=new EventSource(t);this.source=o,this.held=new Set(Ev(t)),this.refusedAt=0;for(let r of UM)o.addEventListener(r,s=>{let i=s.data;r==="gone"&&this.source===o&&this.heardGone(i),this.deliver(r,i)});o.addEventListener("reload",()=>this.deliver("reload","{}")),o.addEventListener("ended",()=>{this.source===o&&(this.unsettle(),o.close(),this.source=null,this.url="",this.deliver("lost","{}"),this.quietUntil=Date.now()+Rv,window.setTimeout(()=>this.reconcile(),Rv))}),o.addEventListener("error",()=>{if(this.source===o){if(o.readyState!==EventSource.CLOSED){this.deliver("retrying","{}");return}this.source=null,this.url="",this.deliver("lost","{}"),this.quietUntil=Date.now()+Rv,window.setTimeout(()=>this.reconcile(),Rv)}})}heardGone(t){this.refusedAt=Date.now();try{let a=JSON.parse(t).room;typeof a=="string"&&this.held.delete(a)}catch{}}reconcileStream(){let t=this.supervisor??this.startSupervisor(),a=this.wanted(document.hidden);if(a===t.wanted)return;let n=Ev(a);if(t.live&&n.length>0&&n.length===this.held.size&&n.every(r=>this.held.has(r))){t.retarget(a);return}let o=Date.now()-this.refusedAt;if(t.live&&a!==""&&o<Av){this.settling===null&&(this.settling=window.setTimeout(()=>{this.settling=null,this.reconcile()},Av-o));return}this.unsettle(),a===""?delete document.documentElement.dataset.live:document.documentElement.dataset.live="1",t.want(a,document.hidden)}startSupervisor(){let t=new Tv({...FM(),...this.deps},{opened:n=>{this.held=new Set(Ev(n)),this.refusedAt=0},frame:(n,o)=>{if(n==="reload"){this.deliver("reload","{}");return}UM.includes(n)&&(n==="gone"&&this.heardGone(o),this.deliver(n,o))},trouble:n=>{this.unsettle(),this.deliver(n,"{}")},state:n=>this.setConnection(n),unusable:()=>this.fallBack()});this.supervisor=t;let a=()=>t.wake();return document.addEventListener("visibilitychange",()=>{document.hidden?(this.hiddenSince??=Date.now(),this.graceTimer===null&&(this.graceTimer=window.setTimeout(()=>{this.graceTimer=null,this.reconcile()},6e4))):(this.hiddenSince=null,this.graceTimer!==null&&window.clearTimeout(this.graceTimer),this.graceTimer=null),this.reconcile(),document.hidden||a()}),window.addEventListener("online",a),window.addEventListener("offline",()=>t.offline()),window.addEventListener("focus",a),window.addEventListener("pageshow",n=>{n.persisted?t.resume():a()}),window.addEventListener("pagehide",()=>t.suspend()),document.addEventListener("resume",a),navigator.connection?.addEventListener?.("change",a),t}fallBack(){this.reader==="stream"&&(this.supervisor?.dispose(),this.reader="eventsource",this.setConnection("idle"),this.reconcile())}},rd=new pS,$W=new Set(["workspace"]);if(typeof window<"u"){let e=window,t=n=>(typeof n=="string"&&$W.has(n)&&rd.subscribe(n,()=>{}),0),a=e.__soLiveRooms;if(Array.isArray(a))for(let n of a)t(n);e.__soLiveRooms={push:t}}function mS(e){rd.setQuiet(e)}function Dn(e,t,a=!1){let n=(0,sd.useRef)(t);n.current=t,(0,sd.useEffect)(()=>{if(e!==null)return rd.subscribe(e,(o,r)=>n.current(o,r),a)},[e,a])}function VM(e,t){return rd.subscribe(e,t)}function jM(){return(0,sd.useSyncExternalStore)(rd.onConnectionState,rd.connectionState,()=>"idle")}var Dv=O(Z(),1),UW=td("inline-flex w-fit shrink-0 items-center whitespace-nowrap font-medium [&_svg]:size-3",{variants:{tone:{neutral:"bg-neutral-soft text-neutral-ink",success:"bg-success-soft text-success",warning:"bg-neutral-soft text-foreground",attention:"bg-attention-soft text-attention",needs:"bg-wait text-on-attention",danger:"bg-destructive-soft text-destructive",info:"bg-info-soft text-info"},size:{fact:"gap-1 rounded-badge px-1.5 py-px text-[11.5px] leading-[18px]",chip:"h-5 gap-1.5 rounded-sm px-1.5 text-[11.5px] leading-none"}},compoundVariants:[{size:"chip",tone:["neutral","success","warning","attention","danger","info"],className:"text-foreground"}],defaultVariants:{tone:"neutral",size:"fact"}}),VW={neutral:"text-neutral-ink",success:"text-success",warning:"text-neutral-ink",attention:"text-attention",needs:"text-on-attention",danger:"text-danger",info:"text-info"};function Jr({className:e,tone:t,size:a,dot:n=!1,children:o,...r}){return(0,Dv.jsxs)("span",{"data-slot":"badge",className:ye(UW({tone:t,size:a}),e),...r,children:[n&&t!=="needs"&&(0,Dv.jsx)("span",{"aria-hidden":"true","data-badge-dot":!0,className:ye("size-1.5 shrink-0 rounded-full bg-current",VW[t??"neutral"])}),o]})}var WM=O(ve(),1);var KM=O(Z(),1),jW=Object.defineProperty,WW=(e,t)=>jW(e,"name",{value:t,configurable:!0}),KW=WM.forwardRef(WW(function(t,a){return(0,KM.jsx)(ta.label,{...t,ref:a,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}})},"Label")),GM=KW;var YM=O(ve(),1);var Je=(...e)=>e.filter(Boolean).join(" ");var ji=O(Z(),1);function _v({label:e,hint:t,error:a,children:n}){let o=(0,YM.useId)(),r=Je(t&&`${o}-hint`,`${o}-err`);return(0,ji.jsxs)("div",{className:"k-field",children:[(0,ji.jsx)("label",{className:"k-label",htmlFor:o,children:e}),n({id:o,describedBy:r,invalid:!!a}),t&&(0,ji.jsx)("p",{className:"k-hint",id:`${o}-hint`,children:t}),(0,ji.jsx)("span",{className:"k-err",id:`${o}-err`,role:"alert",children:a??""})]})}var _n=({className:e,...t})=>(0,ji.jsx)("input",{className:Je("k-input",e),...t}),ld=({className:e,...t})=>(0,ji.jsx)("textarea",{className:Je("k-textarea",e),...t});var Pv=O(Z(),1);function au({className:e,...t}){return(0,Pv.jsx)(GM,{"data-slot":"label",className:ye("flex items-center gap-2 text-sm font-medium leading-none",e),...t})}function ze({className:e,...t}){return(0,Pv.jsx)(_n,{"data-slot":"input",className:e,...t})}function Gt({className:e,...t}){return(0,Pv.jsx)(ld,{"data-slot":"textarea",className:e,...t})}var Ov=O(ve(),1);var XM=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function ZM(e,t,a=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:XM(e),size:24,node:t,...a.length>0?{aliases:a}:{}}}var QM=e=>{let t="",a=!1;for(let n of e){if(n==="-"||n==="_"||n<=" "){a=t.length>0;continue}t.length===0?t+=n.toLowerCase():t+=a?n.toUpperCase():n,a=!1}return t};var JM=e=>{let t=QM(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Cp=O(ve(),1);var Sp=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var Wi={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"};function hS(e){return e!=null}function eD(e,t={}){let a=t.attributeNames??{},n=d=>a[d]??d,o=e.size??e.width??Wi.width,r=e.size??e.height??Wi.height,s=e.aliases?.filter(d=>typeof d=="string"&&d.trim()!=="").map(d=>`lucide-${d}`)??[],i=[...e.name?[`lucide-${e.name}`]:[],...s],l=t.className?.split(" ").filter(Boolean)??[],u=t.includeDefaultClasses===!1?Sp(...l):Sp("lucide",...i,...l),c=t.absoluteStrokeWidth?Number(t.strokeWidth??Wi["stroke-width"])*Number(e.size??e.width??Wi.width)/Number(t.size??t.width??Wi.width):t.strokeWidth??Wi["stroke-width"];return["svg",{...Object.entries(Wi).reduce((d,[m,h])=>(d[n(m)]=h,d),{}),..."color"in t&&t.color&&{[n("stroke")]:t.color},..."size"in t&&hS(t.size)&&{[n("width")]:t.size,[n("height")]:t.size},..."width"in t&&hS(t.width)&&{[n("width")]:t.width},..."height"in t&&hS(t.height)&&{[n("height")]:t.height},[n("stroke-width")]:c,...u&&{[n("class")]:u},[n("viewBox")]:`0 0 ${o} ${r}`,...t.hasA11yProp===!1?{[n("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(d=>{let[m,h,y]=d,w=t.nonScalingStroke?{[n("vector-effect")]:"non-scaling-stroke",...h}:h;return y?[m,w,y]:[m,w]})]}function tD(e,t={}){return eD(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var aD=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var ud=O(ve(),1);var YW=(0,ud.createContext)({});var nD=()=>(0,ud.useContext)(YW);var oD=(0,Cp.forwardRef)(({color:e,size:t,width:a,height:n,strokeWidth:o,absoluteStrokeWidth:r,nonScalingStroke:s,className:i="",children:l,iconNode:u=[],icon:c={node:u,aliases:[],size:24},...f},d)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:y=!1,nonScalingStroke:w=!1,color:v="currentColor",className:x=""}=nD()??{},g=!!l||aD(f),[b,k,C=[]]=tD(c,{color:e??v,width:a??t??m,height:n??t??m,strokeWidth:o??h,absoluteStrokeWidth:r??y,nonScalingStroke:s??w,className:Sp(x,i),hasA11yProp:g,attributes:f});return(0,Cp.createElement)(b,{ref:d,...k},[...C.map(([N,L])=>(0,Cp.createElement)(N,L)),...Array.isArray(l)?l:[l]])});function Ie(e,t=[],a=[]){let n=typeof e=="string"?ZM(e,t,a):e,o=(0,Ov.forwardRef)(({className:r,...s},i)=>(0,Ov.createElement)(oD,{ref:i,icon:n,className:r,...s}));return n.name&&(o.displayName=JM(n.name)),o}var rD={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};rD.node;var Lp=Ie(rD);var sD={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};sD.node;var Np=Ie(sD);var iD={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};iD.node;var Ip=Ie(iD);var lD={name:"calendar-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v3",key:"otl347"}],["path",{d:"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338",key:"7hb8p4"}],["path",{d:"M3 9h5.859",key:"numkqi"}],["path",{d:"M8 2v3",key:"1ioesn"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};lD.node;var Tp=Ie(lD);var uD={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};uD.node;var qs=Ie(uD);var cD={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};cD.node;var Rp=Ie(cD);var dD={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};dD.node;var Ap=Ie(dD);var fD={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};fD.node;var Ep=Ie(fD);var pD={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};pD.node;var Mp=Ie(pD);var mD={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};mD.node;var Dp=Ie(mD);var hD={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};hD.node;var _p=Ie(hD);var gD={name:"git-pull-request",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]};gD.node;var cd=Ie(gD);var vD={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};vD.node;var Pp=Ie(vD);var yD={name:"hammer",size:24,node:[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]};yD.node;var Op=Ie(yD);var wD={name:"hourglass",size:24,node:[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]};wD.node;var Bp=Ie(wD);var xD={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};xD.node;var zp=Ie(xD);var bD={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};bD.node;var dd=Ie(bD);var kD={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};kD.node;var fd=Ie(kD);var SD={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};SD.node;var Hp=Ie(SD);var CD={name:"message-square-reply",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m10 8-3 3 3 3",key:"fp6dz7"}],["path",{d:"M17 14v-1a2 2 0 0 0-2-2H7",key:"1tkjnz"}]]};CD.node;var Fp=Ie(CD);var LD={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};LD.node;var pd=Ie(LD);var ND={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};ND.node;var qp=Ie(ND);var ID={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],aliases:["edit-3"]};ID.node;var Ki=Ie(ID);var TD={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};TD.node;var vr=Ie(TD);var RD={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};RD.node;var $p=Ie(RD);var AD={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};AD.node;var Up=Ie(AD);var ED={name:"signpost",size:24,node:[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M2.354 10.354a1.207 1.207 0 0 1 0-1.708l2.06-2.06A2 2 0 0 1 5.828 6h12.344a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H5.828a2 2 0 0 1-1.414-.586z",key:"1tm261"}]]};ED.node;var Vp=Ie(ED);var MD={name:"split",size:24,node:[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]};MD.node;var md=Ie(MD);var DD={name:"square-kanban",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]],aliases:["kanban-square"]};DD.node;var Gi=Ie(DD);var _D={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};_D.node;var Pn=Ie(_D);var PD={name:"user-check",size:24,node:[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};PD.node;var jp=Ie(PD);var OD={name:"webhook",size:24,node:[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]};OD.node;var Wp=Ie(OD);var BD={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};BD.node;var Kp=Ie(BD);var zD={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};zD.node;var Gp=Ie(zD);var HD={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};HD.node;var no=Ie(HD);var FD={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};FD.node;var hd=Ie(FD);var Zs=O(ve(),1);var Yo=O(ve(),1);var UD=Symbol("html"),Yp=class{#e;constructor(t,a){if(t!==UD)throw new TypeError("Html is made by html`…`");this.#e=a}static markupOf(t){return t.#e}toString(){if(qD)throw new Error("Html coerced to a string: interpolate it with html`…` or hand it to a sink");return this.#e}toJSON(){if(qD)throw new Error("Html serialized as JSON: convert it with htmlString() first");return this.#e}},qD=typeof process<"u"&&process.env.VITEST!==void 0,XW=e=>new Yp(UD,e);var ZW={"&":"&","<":"<",">":">",'"':""","'":"'"},QW=e=>e.replace(/[&<>"']/g,t=>ZW[t]);function VD(e){if(e==null||typeof e=="boolean")return"";if(e instanceof Yp)return Yp.markupOf(e);if(Array.isArray(e))return e.map(VD).join("");if(typeof e=="string")return QW(e);if(typeof e=="number"||typeof e=="bigint")return String(e);throw new TypeError(`html: cannot interpolate ${typeof e}`)}var $D=new WeakSet,JW=/<form\b[^>]*\bmethod\s*=\s*["']?post\b/i,eK=/\bname\s*=\s*["']?csrf\b/i;function tK(e){if($D.has(e))return;let t=e.join("\0");if(JW.test(t))throw new Error("html: write POST forms with postForm, which adds the CSRF field");if(eK.test(t))throw new Error("html: postForm adds the CSRF field; don't write one");$D.add(e)}function Yi(e,...t){tK(e);let a=e[0];for(let n=0;n<t.length;n++)a+=VD(t[n])+e[n+1];return XW(a)}var aK=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nK=864e5,jD=new Map;function oK(e){let t=jD.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),jD.set(e,t)),t}function gS(e,t){let a=o=>Object.fromEntries(oK(o).formatToParts(e).map(r=>[r.type,r.value])),n;try{n=a(t)}catch{n=a("UTC")}return{year:Number(n.year),month:Number(n.month),day:Number(n.day),clock:`${n.hour}:${n.minute}`}}var WD=e=>Math.floor(Date.UTC(e.year,e.month-1,e.day)/nK);function No(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function yr(e,t=new Date,a="UTC",n=!1){let o=new Date(e);if(Number.isNaN(o.getTime()))return e;let r=gS(o,a),s=gS(t,a),i=WD(r)-WD(s);if(i===0)return r.clock;if(i===-1)return`Yesterday ${r.clock}`;if(i===1)return`Tomorrow ${r.clock}`;let l=`${aK[r.month-1]} ${r.day}`;return`${r.year===s.year?l:`${l} ${r.year}`}${n?` ${r.clock}`:""}`}function Bv(e,t=new Date,a=No()){if(Number.isNaN(new Date(e.at).getTime()))return e.label;let n=yr(e.at,t,a,!0);return/^(?:\d|Tomorrow|Yesterday)/.test(n)?`${e.label} ${n}`:`${e.label.replace(/ at$/,"")} ${n}`}function KD(e,t=new Date){let a=new Date(e).getTime();if(Number.isNaN(a))return"";let n=Math.max(0,Math.floor((t.getTime()-a)/6e4));if(n<1)return"now";if(n<60)return`${n}m`;let o=Math.floor(n/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}function nu(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=gS(a,t);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")} ${n.clock}${t==="UTC"?" UTC":""}`}function GD(e,t=new Date,a=No()){e.querySelectorAll("time[data-when][datetime]").forEach(n=>{let o=n.getAttribute("datetime")??"";if(o===""||Number.isNaN(new Date(o).getTime()))return;if(n.getAttribute("data-when")==="exact"){let i=rK(o,a);n.textContent!==i&&(n.textContent=i);return}let r=yr(o,t,a),s=nu(o,a);n.title!==s&&(n.title=s),n.textContent!==r&&(n.textContent=r)})}function rK(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=String(a.getUTCSeconds()).padStart(2,"0"),o=nu(e,t);return t==="UTC"?o.replace(/ UTC$/,`:${n} UTC`):`${o}:${n}`}var Xi=O(Z(),1),vS=!1;function wS(){vS||(vS=!0,queueMicrotask(()=>{vS=!1,GD(document),window.dispatchEvent(new CustomEvent("standing-orders:workspace-rendered"))}))}var yS="form.approve-form, form.k-approve",sK=["form.approve-form","form.k-approve"].flatMap(e=>[`${e} button[type="submit"]`,`${e} input[type="submit"]`]).join(", ");function YD(e){return e.contains(document.activeElement)&&document.activeElement?.matches("input, textarea, select, [contenteditable=true]")===!0||e.querySelector(`${yS}, details[open] form`)!==null}function Ct({html:e,immutable:t=!1,className:a=""}){let n=(0,Yo.useRef)(null),o=(0,Yo.useRef)(null),r=(0,Yo.useRef)(!1),[s,i]=(0,Yo.useState)(0),[l,u]=(0,Yo.useState)(!1),[c,f]=(0,Yo.useState)(!1);return(0,Yo.useEffect)(()=>{let d=n.current,m=()=>i(h=>h+1);return d?.addEventListener("toggle",m,!0),()=>d?.removeEventListener("toggle",m,!0)},[]),(0,Yo.useLayoutEffect)(()=>{let d=n.current;if(!d||o.current===e||t&&o.current!==null)return;if(o.current!==null&&(r.current||YD(d))){let y=d.querySelector("[data-approval]"),w=new DOMParser().parseFromString(e,"text/html").querySelector("[data-approval]");!!d.querySelector(yS)&&y?.dataset.approval!==w?.dataset.approval?(u(!0),d.querySelectorAll(sK).forEach(x=>{x.disabled=!0})):d.querySelector(yS)||f(!0);return}let m=o.current===null;d.innerHTML=e,o.current=e;let h=m?d.querySelector("[autofocus]"):null;h!==null&&(document.activeElement===null||document.activeElement===document.body)&&h.focus(),f(!1),wS()},[e,t,s]),(0,Xi.jsxs)("div",{className:`so-native-region ${a}`,"data-workspace-native":!0,children:[l&&(0,Xi.jsxs)(Mn,{tone:"error",children:["The plan changed. ",(0,Xi.jsx)("a",{href:window.location.href,children:"Review the current plan"})," before approving."]}),c&&(0,Xi.jsxs)("p",{className:"so-deferred",role:"status",children:["Updates are available. Your form is preserved. ",(0,Xi.jsx)("a",{href:window.location.href,children:"Reload"})]}),(0,Xi.jsx)("div",{ref:n,onInput:()=>{r.current=!0},onChange:()=>{r.current=!0},onBlur:()=>i(d=>d+1)})]})}var XD=O(Z(),1);function ou({className:e,...t}){return(0,XD.jsx)("section",{"data-slot":"card",className:ye("flex flex-col gap-4 rounded-card border border-border bg-card p-5 text-card-foreground phone:gap-3 phone:p-3.5",e),...t})}var Wa=O(ve(),1);var wr=O(ve(),1);var zv=O(Z(),1),oo=O(ve(),1);var ru=O(Z(),1),iK=Object.defineProperty,ja=(e,t)=>iK(e,"name",{value:t,configurable:!0});function Xp(e){let t=e+"CollectionProvider",[a,n]=An(t),[o,r]=a(t,{collectionRef:{current:null},itemMap:new Map}),s=ja(y=>{let{scope:w,children:v}=y,x=wr.useRef(null),g=wr.useRef(new Map).current;return(0,zv.jsx)(o,{scope:w,itemMap:g,collectionRef:x,children:v})},"CollectionProvider");s.displayName=t;let i=e+"CollectionSlot",l=Jn(i),u=wr.forwardRef((y,w)=>{let{scope:v,children:x}=y,g=r(i,v),b=At(w,g.collectionRef);return(0,zv.jsx)(l,{ref:b,children:x})});u.displayName=i;let c=e+"CollectionItemSlot",f="data-radix-collection-item",d=Jn(c),m=wr.forwardRef((y,w)=>{let{scope:v,children:x,...g}=y,b=wr.useRef(null),k=At(w,b),C=r(c,v);return wr.useEffect(()=>(C.itemMap.set(b,{ref:b,...g}),()=>{C.itemMap.delete(b)})),(0,zv.jsx)(d,{[f]:"",ref:k,children:x})});m.displayName=c;function h(y){let w=r(e+"CollectionConsumer",y);return wr.useCallback(()=>{let x=w.collectionRef.current;if(!x)return[];let g=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(w.itemMap.values()).sort((C,N)=>g.indexOf(C.ref.current)-g.indexOf(N.ref.current))},[w.collectionRef,w.itemMap])}return ja(h,"useCollection"),[{Provider:s,Slot:u,ItemSlot:m},h,n]}ja(Xp,"createCollection");var ZD=new WeakMap,xS=class Zi extends Map{static{ja(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],ZD.set(this,!0)}set(t,a){return ZD.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,a),this}insert(t,a,n){let o=this.has(a),r=this.#e.length,s=kS(t),i=s>=0?s:r+s,l=i<0||i>=r?-1:i;if(l===this.size||o&&l===this.size-1||l===-1)return this.set(a,n),this;let u=this.size+(o?0:1);s<0&&i++;let c=[...this.#e],f,d=!1;for(let m=i;m<u;m++)if(i===m){let h=c[m];c[m]===a&&(h=c[m+1]),o&&this.delete(a),f=this.get(h),this.set(a,n)}else{!d&&c[m-1]===a&&(d=!0);let h=c[d?m:m-1],y=f;f=this.get(h),this.delete(h),this.set(h,y)}return this}with(t,a,n){let o=new Zi(this);return o.insert(t,a,n),o}before(t){let a=this.#e.indexOf(t)-1;if(!(a<0))return this.entryAt(a)}setBefore(t,a,n){let o=this.#e.indexOf(t);return o===-1?this:this.insert(o,a,n)}after(t){let a=this.#e.indexOf(t);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(t,a,n){let o=this.#e.indexOf(t);return o===-1?this:this.insert(o+1,a,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let a=super.delete(t);return a&&this.#e.splice(this.#e.indexOf(t),1),a}deleteAt(t){let a=this.keyAt(t);return a!==void 0?this.delete(a):!1}at(t){let a=Hv(this.#e,t);if(a!==void 0)return this.get(a)}entryAt(t){let a=Hv(this.#e,t);if(a!==void 0)return[a,this.get(a)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Hv(this.#e,t)}from(t,a){let n=this.indexOf(t);if(n===-1)return;let o=n+a;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.at(o)}keyFrom(t,a){let n=this.indexOf(t);if(n===-1)return;let o=n+a;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.keyAt(o)}find(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return o;n++}}findIndex(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return n;n++}return-1}filter(t,a){let n=[],o=0;for(let r of this)Reflect.apply(t,a,[r,o,this])&&n.push(r),o++;return new Zi(n)}map(t,a){let n=[],o=0;for(let r of this)n.push([r[0],Reflect.apply(t,a,[r,o,this])]),o++;return new Zi(n)}reduce(...t){let[a,n]=t,o=0,r=n??this.at(0);for(let s of this)o===0&&t.length===1?r=s:r=Reflect.apply(a,this,[r,s,o,this]),o++;return r}reduceRight(...t){let[a,n]=t,o=n??this.at(-1);for(let r=this.size-1;r>=0;r--){let s=this.at(r);r===this.size-1&&t.length===1?o=s:o=Reflect.apply(a,this,[o,s,r,this])}return o}toSorted(t){let a=[...this.entries()].sort(t);return new Zi(a)}toReversed(){let t=new Zi;for(let a=this.size-1;a>=0;a--){let n=this.keyAt(a),o=this.get(n);t.set(n,o)}return t}toSpliced(...t){let a=[...this.entries()];return a.splice(...t),new Zi(a)}slice(t,a){let n=new Zi,o=this.size-1;if(t===void 0)return n;t<0&&(t=t+this.size),a!==void 0&&a>0&&(o=a-1);for(let r=t;r<=o;r++){let s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}every(t,a){let n=0;for(let o of this){if(!Reflect.apply(t,a,[o,n,this]))return!1;n++}return!0}some(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return!0;n++}return!1}};function Hv(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=QD(e,t);return a===-1?void 0:e[a]}ja(Hv,"at");function QD(e,t){let a=e.length,n=kS(t),o=n>=0?n:a+n;return o<0||o>=a?-1:o}ja(QD,"toSafeIndex");function kS(e){return e!==e||e===0?0:Math.trunc(e)}ja(kS,"toSafeInteger");function lK(e){let t=e+"CollectionProvider",[a,n]=An(t),[o,r]=a(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new xS,setItemMap:ja(()=>{},"setItemMap")}),s=ja(({state:g,...b})=>g?(0,ru.jsx)(l,{...b,state:g}):(0,ru.jsx)(i,{...b}),"CollectionProvider");s.displayName=t;let i=ja(g=>{let b=w();return(0,ru.jsx)(l,{...g,state:b})},"CollectionInit");i.displayName=t+"Init";let l=ja(g=>{let{scope:b,children:k,state:C}=g,N=oo.useRef(null),[L,A]=oo.useState(null),P=At(N,A),[F,B]=C;return oo.useEffect(()=>{if(!L)return;let H=t_(()=>{});return H.observe(L,{childList:!0,subtree:!0}),()=>{H.disconnect()}},[L]),(0,ru.jsx)(o,{scope:b,itemMap:F,setItemMap:B,collectionRef:P,collectionRefObject:N,collectionElement:L,children:k})},"CollectionProviderImpl");l.displayName=t+"Impl";let u=e+"CollectionSlot",c=Jn(u),f=oo.forwardRef((g,b)=>{let{scope:k,children:C}=g,N=r(u,k),L=At(b,N.collectionRef);return(0,ru.jsx)(c,{ref:L,children:C})});f.displayName=u;let d=e+"CollectionItemSlot",m="data-radix-collection-item",h=Jn(d),y=oo.forwardRef((g,b)=>{let{scope:k,children:C,...N}=g,L=oo.useRef(null),[A,P]=oo.useState(null),F=At(b,L,P),B=r(d,k),{setItemMap:H}=B,S=oo.useRef(N);JD(S.current,N)||(S.current=N);let I=S.current;return oo.useEffect(()=>{let R=I;return H(E=>A?E.has(A)?E.set(A,{...R,element:A}).toSorted(bS):(E.set(A,{...R,element:A}),E.toSorted(bS)):E),()=>{H(E=>!A||!E.has(A)?E:(E.delete(A),new xS(E)))}},[A,I,H]),(0,ru.jsx)(h,{[m]:"",ref:F,children:C})});y.displayName=d;function w(){return oo.useState(new xS)}ja(w,"useInitCollection");function v(g){let{itemMap:b}=r(e+"CollectionConsumer",g);return b}return ja(v,"useCollection"),[{Provider:s,Slot:f,ItemSlot:y},{createCollectionScope:n,useCollection:v,useInitCollection:w}]}ja(lK,"createCollection");function JD(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;let a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(let o of a)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}ja(JD,"shallowEqual");function e_(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ja(e_,"isElementPreceding");function bS(e,t){return!e[1].element||!t[1].element?0:e_(e[1].element,t[1].element)?-1:1}ja(bS,"sortByDocumentPosition");function t_(e){return new MutationObserver(a=>{for(let n of a)if(n.type==="childList"){e();return}})}ja(t_,"getChildListObserver");var Fv=O(ve(),1),dK=O(Z(),1),uK=Object.defineProperty,cK=(e,t)=>uK(e,"name",{value:t,configurable:!0}),fK=Fv.createContext(void 0);function Zp(e){let t=Fv.useContext(fK);return e||t||"ltr"}cK(Zp,"useDirection");var mK=O(ve(),1),qv=O(ve(),1),pK=Object.defineProperty,CS=(e,t)=>pK(e,"name",{value:t,configurable:!0}),SS=!1;function a_(){let[e,t]=qv.useState(SS);return qv.useEffect(()=>{SS||(SS=!0,t(!0))},[]),e}CS(a_,"useIsHydrated");var n_=mK[" useSyncExternalStore ".trim().toString()];function o_(){return()=>{}}CS(o_,"subscribe");function r_(){return n_(o_,()=>!0,()=>!1)}CS(r_,"useIsHydratedModern");var s_=typeof n_=="function"?r_:a_;var Qi=O(Z(),1),hK=Object.defineProperty,su=(e,t)=>hK(e,"name",{value:t,configurable:!0}),LS="rovingFocusGroup.onEntryFocus",gK={bubbles:!1,cancelable:!0},$v="RovingFocusGroup",[NS,i_,vK]=Xp($v),[yK,IS]=An($v,[vK]),[wK,xK]=yK($v),bK=Wa.forwardRef(su(function(t,a){return(0,Qi.jsx)(NS.Provider,{scope:t.__scopeRovingFocusGroup,children:(0,Qi.jsx)(NS.Slot,{scope:t.__scopeRovingFocusGroup,children:(0,Qi.jsx)(kK,{...t,ref:a})})})},"RovingFocusGroup")),kK=Wa.forwardRef(su(function(t,a){let{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...d}=t,m=Wa.useRef(null),h=At(a,m),y=Zp(s),[w,v]=Yl({prop:i,defaultProp:l??null,onChange:u,caller:$v}),[x,g]=Wa.useState(!1),b=eo(c),k=i_(n),C=Wa.useRef(!1),[N,L]=Wa.useState(0);return Wa.useEffect(()=>{let A=m.current;if(A)return A.addEventListener(LS,b),()=>A.removeEventListener(LS,b)},[b]),(0,Qi.jsx)(wK,{scope:n,orientation:o,dir:y,loop:r,currentTabStopId:w,onItemFocus:Wa.useCallback(A=>v(A),[v]),onItemShiftTab:Wa.useCallback(()=>g(!0),[]),onFocusableItemAdd:Wa.useCallback(()=>L(A=>A+1),[]),onFocusableItemRemove:Wa.useCallback(()=>L(A=>A-1),[]),children:(0,Qi.jsx)(ta.div,{tabIndex:x||N===0?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:ct(t.onMouseDown,()=>{C.current=!0}),onFocus:ct(t.onFocus,A=>{let P=!C.current;if(A.target===A.currentTarget&&P&&!x){let F=new CustomEvent(LS,gK);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){let B=k().filter(E=>E.focusable),H=B.find(E=>E.active),S=B.find(E=>E.id===w),R=[H,S,...B].filter(Boolean).map(E=>E.ref.current);TS(R,f)}}C.current=!1}),onBlur:ct(t.onBlur,()=>g(!1))})})},"RovingFocusGroupImpl")),SK="RovingFocusGroupItem",CK=Wa.forwardRef(su(function(t,a){let{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...l}=t,u=Zr(),c=s||u,f=xK(SK,n),d=f.currentTabStopId===c,m=i_(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:w}=f,v=s_();return ya(()=>{if(!(!v||!o))return h(),()=>y()},[v,o,h,y]),Wa.useEffect(()=>{if(!(v||!o))return h(),()=>y()},[v,o,h,y]),(0,Qi.jsx)(NS.ItemSlot,{scope:n,id:c,focusable:o,active:r,children:(0,Qi.jsx)(ta.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...l,ref:a,onMouseDown:ct(t.onMouseDown,x=>{o?f.onItemFocus(c):x.preventDefault()}),onFocus:ct(t.onFocus,()=>f.onItemFocus(c)),onKeyDown:ct(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;let g=u_(x,f.orientation,f.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=m().filter(C=>C.focusable).map(C=>C.ref.current);if(g==="last")k.reverse();else if(g==="prev"||g==="next"){g==="prev"&&k.reverse();let C=k.indexOf(x.currentTarget);k=f.loop?c_(k,C+1):k.slice(C+1)}setTimeout(()=>TS(k))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:w!=null}):i})})},"RovingFocusGroupItem")),LK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}su(l_,"getDirectionAwareKey");function u_(e,t,a){let n=l_(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return LK[n]}su(u_,"getFocusIntent");function TS(e,t=!1){let a=document.activeElement;for(let n of e)if(n===a||(n.focus({preventScroll:t}),document.activeElement!==a))return}su(TS,"focusFirst");function c_(e,t){return e.map((a,n)=>e[(t+n)%e.length])}su(c_,"wrapArray");var d_=bK,f_=CK;var IK=O(Z(),1);var p_=O(ve(),1);var TK=Object.defineProperty,RK=(e,t)=>TK(e,"name",{value:t,configurable:!0});function RS(e){let[t,a]=p_.useState(void 0);return ya(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;let r=o[0],s,i;if("borderBoxSize"in r){let l=r.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,i=u.blockSize}else s=e.offsetWidth,i=e.offsetHeight;a({width:s,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else a(void 0)},[e]),t}RK(RS,"useSize");var m_=O(Z(),1);var wn=O(ve(),1);var v_=["top","right","bottom","left"];var es=Math.min,xr=Math.max,Jp=Math.round,em=Math.floor,ts=e=>({x:e,y:e}),AK={left:"right",right:"left",bottom:"top",top:"bottom"};function AS(e,t,a){return xr(e,es(t,a))}function as(e,t){return typeof e=="function"?e(t):e}function $s(e){return e.split("-")[0]}function iu(e){return e.split("-")[1]}function Vv(e){return e==="x"?"y":"x"}function jv(e){return e==="y"?"height":"width"}function br(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Wv(e){return Vv(br(e))}function y_(e,t,a){a===void 0&&(a=!1);let n=iu(e),o=Wv(e),r=jv(o),s=o==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Qp(s)),[s,Qp(s)]}function w_(e){let t=Qp(e);return[Uv(e),t,Uv(t)]}function Uv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var h_=["left","right"],g_=["right","left"],EK=["top","bottom"],MK=["bottom","top"];function DK(e,t,a){switch(e){case"top":case"bottom":return a?t?g_:h_:t?h_:g_;case"left":case"right":return t?EK:MK;default:return[]}}function x_(e,t,a,n){let o=iu(e),r=DK($s(e),a==="start",n);return o&&(r=r.map(s=>s+"-"+o),t&&(r=r.concat(r.map(Uv)))),r}function Qp(e){let t=$s(e);return AK[t]+e.slice(t.length)}function _K(e){var t,a,n,o;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(n=e.bottom)!=null?n:0,left:(o=e.left)!=null?o:0}}function ES(e){return typeof e!="number"?_K(e):{top:e,right:e,bottom:e,left:e}}function lu(e){let{x:t,y:a,width:n,height:o}=e;return{width:n,height:o,top:a,left:t,right:t+n,bottom:a+o,x:t,y:a}}function b_(e,t,a){let{reference:n,floating:o}=e,r=br(t),s=Wv(t),i=jv(s),l=$s(t),u=r==="y",c=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,d=n[i]/2-o[i]/2,m;switch(l){case"top":m={x:c,y:n.y-o.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-o.width,y:f};break;default:m={x:n.x,y:n.y}}let h=iu(t);return h&&(m[s]+=d*(h==="end"?1:-1)*(a&&u?-1:1)),m}async function C_(e,t){var a;t===void 0&&(t={});let{x:n,y:o,platform:r,rects:s,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=as(t,e),h=ES(m),w=i[d?f==="floating"?"reference":"floating":f],v=lu(await r.getClippingRect({element:(a=await(r.isElement==null?void 0:r.isElement(w)))==null||a?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(i.floating)),boundary:u,rootBoundary:c,strategy:l})),x=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,g=await(r.getOffsetParent==null?void 0:r.getOffsetParent(i.floating)),b=await(r.isElement==null?void 0:r.isElement(g))&&await(r.getScale==null?void 0:r.getScale(g))||{x:1,y:1},k=lu(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:x,offsetParent:g,strategy:l}):x);return{top:(v.top-k.top+h.top)/b.y,bottom:(k.bottom-v.bottom+h.bottom)/b.y,left:(v.left-k.left+h.left)/b.x,right:(k.right-v.right+h.right)/b.x}}var PK=50,L_=async(e,t,a)=>{let{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:s}=a,i=s.detectOverflow?s:{...s,detectOverflow:C_},l=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=b_(u,n,l),d=n,m=0,h={};for(let y=0;y<r.length;y++){let w=r[y];if(!w)continue;let{name:v,fn:x}=w,{x:g,y:b,data:k,reset:C}=await x({x:c,y:f,initialPlacement:n,placement:d,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});c=g??c,f=b??f,h[v]={...h[v],...k},C&&m<PK&&(m++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(u=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:c,y:f}=b_(u,d,l)),y=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:h}},N_=e=>({name:"arrow",options:e,async fn(t){let{x:a,y:n,placement:o,rects:r,platform:s,elements:i,middlewareData:l}=t,{element:u,padding:c=0}=as(e,t)||{};if(u==null)return{};let f=ES(c),d={x:a,y:n},m=Wv(o),h=jv(m),y=await s.getDimensions(u),w=m==="y",v=w?"top":"left",x=w?"bottom":"right",g=w?"clientHeight":"clientWidth",b=r.reference[h]+r.reference[m]-d[m]-r.floating[h],k=d[m]-r.reference[m],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u)),N=C?C[g]:0;(!N||!await(s.isElement==null?void 0:s.isElement(C)))&&(N=i.floating[g]||r.floating[h]);let L=b/2-k/2,A=N/2-y[h]/2-1,P=es(f[v],A),F=es(f[x],A),B=N-y[h]-F,H=N/2-y[h]/2+L,S=AS(P,H,B),I=!l.arrow&&iu(o)!=null&&H!==S&&r.reference[h]/2-(H<P?P:F)-y[h]/2<0,R=I?H<P?H-P:H-B:0;return{[m]:d[m]+R,data:{[m]:S,centerOffset:H-S-R,...I&&{alignmentOffset:R}},reset:I}}});var I_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,n;let{placement:o,middlewareData:r,rects:s,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...w}=as(e,t);if((a=r.arrow)!=null&&a.alignmentOffset)return{};let v=$s(o),x=br(i),g=$s(i)===i,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),k=d||(g||!y?[Qp(i)]:w_(i)),C=h!=="none";!d&&C&&k.push(...x_(i,y,h,b));let N=[i,...k],L=await l.detectOverflow(t,w),A=[],P=((n=r.flip)==null?void 0:n.overflows)||[];if(c&&A.push(L[v]),f){let S=y_(o,s,b);A.push(L[S[0]],L[S[1]])}if(P=[...P,{placement:o,overflows:A}],!A.every(S=>S<=0)){var F,B;let S=(((F=r.flip)==null?void 0:F.index)||0)+1,I=N[S];if(I&&(!(f==="alignment"?x!==br(I):!1)||P.every(q=>br(q.placement)===x?q.overflows[0]>0:!0)))return{data:{index:S,overflows:P},reset:{placement:I}};let R=(B=P.filter(E=>E.overflows[0]<=0).sort((E,q)=>E.overflows[1]-q.overflows[1])[0])==null?void 0:B.placement;if(!R)switch(m){case"bestFit":{var H;let E=(H=P.filter(q=>{if(C){let M=br(q.placement);return M===x||M==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(M=>M>0).reduce((M,_)=>M+_,0)]).sort((q,M)=>q[1]-M[1])[0])==null?void 0:H[0];E&&(R=E);break}case"initialPlacement":R=i;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function k_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function S_(e){return v_.some(t=>e[t]>=0)}var T_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:a,platform:n}=t,{strategy:o="referenceHidden",...r}=as(e,t);switch(o){case"referenceHidden":{let s=await n.detectOverflow(t,{...r,elementContext:"reference"}),i=k_(s,a.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:S_(i)}}}case"escaped":{let s=await n.detectOverflow(t,{...r,altBoundary:!0}),i=k_(s,a.floating);return{data:{escapedOffsets:i,escaped:S_(i)}}}default:return{}}}}};var R_=new Set(["left","top"]);async function OK(e,t){let{placement:a,platform:n,elements:o}=e,r=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$s(a),i=iu(a),l=br(a)==="y",u=R_.has(s)?-1:1,c=r&&l?-1:1,f=as(t,e),{mainAxis:d,crossAxis:m,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof h=="number"&&(m=i==="end"?h*-1:h),l?{x:m*c,y:d*u}:{x:d*u,y:m*c}}var A_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,n;let{x:o,y:r,placement:s,middlewareData:i}=t,l=await OK(t,e);return s===((a=i.offset)==null?void 0:a.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}},E_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:a,y:n,placement:o,platform:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:x=>{let{x:g,y:b}=x;return{x:g,y:b}}},...u}=as(e,t),c={x:a,y:n},f=await r.detectOverflow(t,u),d=br(o),m=Vv(d),h=c[m],y=c[d],w=(x,g)=>AS(g+f[x==="y"?"top":"left"],g,g-f[x==="y"?"bottom":"right"]);s&&(h=w(m,h)),i&&(y=w(d,y));let v=l.fn({...t,[m]:h,[d]:y});return{...v,data:{x:v.x-a,y:v.y-n,enabled:{[m]:s,[d]:i}}}}}},M_=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,n;let{x:o,y:r,placement:s,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=as(e,t),d={x:o,y:r},m=br(s),h=Vv(m),y=d[h],w=d[m],v=as(u,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(a=v.mainAxis)!=null?a:0,crossAxis:(n=v.crossAxis)!=null?n:0};if(c){let k=h==="y"?"height":"width",C=i.reference[h]-i.floating[k]+x.mainAxis,N=i.reference[h]+i.reference[k]-x.mainAxis;y<C?y=C:y>N&&(y=N)}if(f){var g,b;let k=h==="y"?"width":"height",C=R_.has($s(s)),N=i.reference[m]-i.floating[k]+(C&&((g=l.offset)==null?void 0:g[m])||0)+(C?0:x.crossAxis),L=i.reference[m]+i.reference[k]+(C?0:((b=l.offset)==null?void 0:b[m])||0)-(C?x.crossAxis:0);w<N?w=N:w>L&&(w=L)}return{[h]:y,[m]:w}}}},D_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:a,rects:n,platform:o,elements:r}=t,{apply:s=()=>{},...i}=as(e,t),l=await o.detectOverflow(t,i),u=$s(a),c=iu(a),f=br(a)==="y",{width:d,height:m}=n.floating,h,y;u==="top"||u==="bottom"?(h=u,y=c===(await(o.isRTL==null?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(y=u,h=c==="end"?"top":"bottom");let w=m-l.top-l.bottom,v=d-l.left-l.right,x=es(m-l[h],w),g=es(d-l[y],v),b=t.middlewareData.shift,k=!b,C=x,N=g;b!=null&&b.enabled.x&&(N=v),b!=null&&b.enabled.y&&(C=w),k&&!c&&(f?N=d-2*xr(l.left,l.right):C=m-2*xr(l.top,l.bottom)),await s({...t,availableWidth:N,availableHeight:C});let L=await o.getDimensions(r.floating);return d!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function Kv(){return typeof window<"u"}function du(e){return P_(e)?(e.nodeName||"").toLowerCase():"#document"}function On(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ns(e){var t;return(t=(P_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function P_(e){return Kv()?e instanceof Node||e instanceof On(e).Node:!1}function kr(e){return Kv()?e instanceof Element||e instanceof On(e).Element:!1}function Us(e){return Kv()?e instanceof HTMLElement||e instanceof On(e).HTMLElement:!1}function __(e){return!Kv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof On(e).ShadowRoot}function tm(e){let{overflow:t,overflowX:a,overflowY:n,display:o}=Sr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&o!=="inline"&&o!=="contents"}function O_(e){return/^(table|td|th)$/.test(du(e))}function am(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var BK=/transform|translate|scale|rotate|perspective|filter/,zK=/paint|layout|strict|content/,uu=e=>!!e&&e!=="none",MS;function Gv(e){let t=kr(e)?Sr(e):e;return uu(t.transform)||uu(t.translate)||uu(t.scale)||uu(t.rotate)||uu(t.perspective)||!Yv()&&(uu(t.backdropFilter)||uu(t.filter))||BK.test(t.willChange||"")||zK.test(t.contain||"")}function B_(e){let t=Ji(e);for(;Us(t)&&!gd(t);){if(Gv(t))return t;if(am(t))return null;t=Ji(t)}return null}function Yv(){return MS==null&&(MS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),MS}function gd(e){return/^(html|body|#document)$/.test(du(e))}function Sr(e){return On(e).getComputedStyle(e)}function nm(e){return kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ji(e){if(du(e)==="html")return e;let t=e.assignedSlot||e.parentNode||__(e)&&e.host||ns(e);return __(t)?t.host:t}function z_(e){let t=Ji(e);return gd(t)?(e.ownerDocument||e).body:Us(t)&&tm(t)?t:z_(t)}function cu(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);let o=z_(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),s=On(o);if(r){let i=Xv(s);return t.concat(s,s.visualViewport||[],tm(o)?o:[],i&&a?cu(i):[])}else return t.concat(o,cu(o,[],a))}function Xv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q_(e){let t=Sr(e),a=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=Us(e),r=o?e.offsetWidth:a,s=o?e.offsetHeight:n,i=Jp(a)!==r||Jp(n)!==s;return i&&(a=r,n=s),{width:a,height:n,$:i}}function _S(e){return kr(e)?e:e.contextElement}function vd(e){let t=_S(e);if(!Us(t))return ts(1);let a=t.getBoundingClientRect(),{width:n,height:o,$:r}=q_(t),s=(r?Jp(a.width):a.width)/n,i=(r?Jp(a.height):a.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var HK=ts(0);function $_(e){let t=On(e);return!Yv()||!t.visualViewport?HK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FK(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===On(e)}function fu(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);let o=e.getBoundingClientRect(),r=_S(e),s=ts(1);t&&(n?kr(n)&&(s=vd(n)):s=vd(e));let i=FK(r,a,n)?$_(r):ts(0),l=(o.left+i.x)/s.x,u=(o.top+i.y)/s.y,c=o.width/s.x,f=o.height/s.y;if(r&&n){let d=On(r),m=kr(n)?On(n):n,h=d,y=Xv(h);for(;y&&m!==h;){let w=vd(y),v=y.getBoundingClientRect(),x=Sr(y),g=v.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,b=v.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,u*=w.y,c*=w.x,f*=w.y,l+=g,u+=b,h=On(y),y=Xv(h)}}return lu({width:c,height:f,x:l,y:u})}function Zv(e,t){let a=nm(e).scrollLeft;return t?t.left+a:fu(ns(e)).left+a}function U_(e,t){let a=e.getBoundingClientRect(),n=a.left+t.scrollLeft-Zv(e,a),o=a.top+t.scrollTop;return{x:n,y:o}}function qK(e){let{elements:t,rect:a,offsetParent:n,strategy:o}=e,r=o==="fixed",s=ns(n),i=t?am(t.floating):!1;if(n===s||i&&r)return a;let l={scrollLeft:0,scrollTop:0},u=ts(1),c=ts(0),f=Us(n);if((f||!r)&&((du(n)!=="body"||tm(s))&&(l=nm(n)),f)){let m=fu(n);u=vd(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}let d=s&&!f&&!r?U_(s,l):ts(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:a.y*u.y-l.scrollTop*u.y+c.y+d.y}}function $K(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function UK(e){let t=nm(e),a=e.ownerDocument.body,n=xr(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),o=xr(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight),r=-t.scrollLeft+Zv(e),s=-t.scrollTop;return Sr(a).direction==="rtl"&&(r+=xr(e.clientWidth,a.clientWidth)-n),{width:n,height:o,x:r,y:s}}var VK=25;function jK(e,t,a){a===void 0&&(a="viewport");let n=a==="layoutViewport",o=On(e),r=ns(e),s=o.visualViewport,i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(s){let d=!Yv()||t==="fixed";n?d||(u=-s.offsetLeft,c=-s.offsetTop):(i=s.width,l=s.height,d&&(u=s.offsetLeft,c=s.offsetTop))}if(Zv(r)<=0){let d=r.ownerDocument,m=d.body,h=getComputedStyle(m),y=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(r.clientWidth-m.clientWidth-y),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?w/2:w;v<=VK&&(i-=v)}return{width:i,height:l,x:u,y:c}}function WK(e,t){let a=fu(e,!0,t==="fixed"),n=a.top+e.clientTop,o=a.left+e.clientLeft,r=vd(e),s=e.clientWidth*r.x,i=e.clientHeight*r.y,l=o*r.x,u=n*r.y;return{width:s,height:i,x:l,y:u}}function H_(e,t,a){let n;if(t==="viewport"||t==="layoutViewport")n=jK(e,a,t);else if(t==="document")n=UK(ns(e));else if(kr(t))n=WK(t,a);else{let o=$_(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return lu(n)}function KK(e,t){let a=t.get(e);if(a)return a;let n=cu(e,[],!1).filter(i=>kr(i)&&du(i)!=="body"),o=null,r=Sr(e).position==="fixed",s=r?Ji(e):e;for(;kr(s)&&!gd(s);){let i=Sr(s),l=Gv(s),u=o?o.position:r?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&i.position==="static")?n=n.filter(f=>f!==s):o=i,s=Ji(s)}return t.set(e,n),n}function GK(e){let{element:t,boundary:a,rootBoundary:n,strategy:o}=e,s=[...a==="clippingAncestors"?am(t)?[]:KK(t,this._c):[].concat(a),n],i=H_(t,s[0],o),l=i.top,u=i.right,c=i.bottom,f=i.left;for(let d=1;d<s.length;d++){let m=H_(t,s[d],o);l=xr(m.top,l),u=es(m.right,u),c=es(m.bottom,c),f=xr(m.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function YK(e){let{width:t,height:a}=q_(e);return{width:t,height:a}}function XK(e,t,a){let n=Us(t),o=ns(t),r=a==="fixed",s=fu(e,!0,r,t),i={scrollLeft:0,scrollTop:0},l=ts(0);if((n||!r)&&((du(t)!=="body"||tm(o))&&(i=nm(t)),n)){let d=fu(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}!n&&o&&(l.x=Zv(o));let u=o&&!n&&!r?U_(o,i):ts(0),c=s.left+i.scrollLeft-l.x-u.x,f=s.top+i.scrollTop-l.y-u.y;return{x:c,y:f,width:s.width,height:s.height}}function DS(e){return Sr(e).position==="static"}function F_(e,t){if(!Us(e)||Sr(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return ns(e)===a&&(a=a.ownerDocument.body),a}function V_(e,t){let a=On(e);if(am(e))return a;if(!Us(e)){let o=Ji(e);for(;o&&!gd(o);){if(kr(o)&&!DS(o))return o;o=Ji(o)}return a}let n=F_(e,t);for(;n&&O_(n)&&DS(n);)n=F_(n,t);return n&&gd(n)&&DS(n)&&!Gv(n)?a:n||B_(e)||a}var ZK=async function(e){let t=this.getOffsetParent||V_,a=this.getDimensions,n=await a(e.floating);return{reference:XK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function QK(e){return Sr(e).direction==="rtl"}var j_={convertOffsetParentRelativeRectToViewportRelativeRect:qK,getDocumentElement:ns,getClippingRect:GK,getOffsetParent:V_,getElementRects:ZK,getClientRects:$K,getDimensions:YK,getScale:vd,isElement:kr,isRTL:QK};function W_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function JK(e,t,a){let n=null,o,r=ns(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();let d=e.getBoundingClientRect(),{left:m,top:h,width:y,height:w}=d;if(c||t(),!y||!w)return;let v=em(h),x=em(r.clientWidth-(m+y)),g=em(r.clientHeight-(h+w)),b=em(m),C={rootMargin:-v+"px "+-x+"px "+-g+"px "+-b+"px",threshold:xr(0,es(1,f))||1},N=!0;function L(A){let P=A[0].intersectionRatio;if(!W_(d,e.getBoundingClientRect()))return i();if(P!==f){if(!N)return i();P?i(!1,P):o=setTimeout(()=>{i(!1,1e-7)},1e3)}N=!1}try{n=new IntersectionObserver(L,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(L,C)}n.observe(e)}let l=On(e),u=()=>i(a);return l.addEventListener("resize",u),i(!0),()=>{l.removeEventListener("resize",u),s()}}function PS(e,t,a,n){n===void 0&&(n={});let{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=_S(e),c=o||r?[...u?cu(u):[],...t?cu(t):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",a),r&&v.addEventListener("resize",a)});let f=u&&i?JK(u,a,r):null,d=-1,m=null;s&&(m=new ResizeObserver(v=>{let[x]=v;x&&x.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),a()}),u&&!l&&m.observe(u),t&&m.observe(t));let h,y=l?fu(e):null;l&&w();function w(){let v=fu(e);y&&!W_(y,v)&&a(),y=v,h=requestAnimationFrame(w)}return a(),()=>{var v;c.forEach(x=>{o&&x.removeEventListener("scroll",a),r&&x.removeEventListener("resize",a)}),f?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(h)}}var K_=A_;var G_=E_,Y_=I_,X_=D_,Z_=T_,OS=N_;var Q_=M_,BS=(e,t,a)=>{let n=new Map,o=a??{},r={...j_,...o.platform,_c:n};return L_(e,t,{...o,platform:r})};var La=O(ve(),1),eP=O(ve(),1),tP=O(_o(),1),e7=typeof document<"u",t7=function(){},Qv=e7?eP.useLayoutEffect:t7;function Jv(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 a,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(n=a;n--!==0;)if(!Jv(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),a=o.length,a!==Object.keys(t).length)return!1;for(n=a;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=a;n--!==0;){let r=o[n];if(!(r==="_owner"&&e.$$typeof)&&!Jv(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function aP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function J_(e,t){let a=aP(e);return Math.round(t*a)/a}function zS(e){let t=La.useRef(e);return Qv(()=>{t.current=e}),t}function nP(e){e===void 0&&(e={});let{placement:t="bottom",strategy:a="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:s}={},transform:i=!0,whileElementsMounted:l,open:u}=e,[c,f]=La.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=La.useState(n);Jv(d,n)||m(n);let[h,y]=La.useState(null),[w,v]=La.useState(null),x=La.useCallback(q=>{q!==C.current&&(C.current=q,y(q))},[]),g=La.useCallback(q=>{q!==N.current&&(N.current=q,v(q))},[]),b=r||h,k=s||w,C=La.useRef(null),N=La.useRef(null),L=La.useRef(c),A=l!=null,P=zS(l),F=zS(o),B=zS(u),H=La.useCallback(()=>{if(!C.current||!N.current)return;let q={placement:t,strategy:a,middleware:d};F.current&&(q.platform=F.current),BS(C.current,N.current,q).then(M=>{let _={...M,isPositioned:B.current!==!1};S.current&&!Jv(L.current,_)&&(L.current=_,tP.flushSync(()=>{f(_)}))})},[d,t,a,F,B]);Qv(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[u]);let S=La.useRef(!1);Qv(()=>(S.current=!0,()=>{S.current=!1}),[]),Qv(()=>{if(b&&(C.current=b),k&&(N.current=k),b&&k){if(P.current)return P.current(b,k,H);H()}},[b,k,H,P,A]);let I=La.useMemo(()=>({reference:C,floating:N,setReference:x,setFloating:g}),[x,g]),R=La.useMemo(()=>({reference:b,floating:k}),[b,k]),E=La.useMemo(()=>{let q={position:a,left:0,top:0};if(!R.floating)return q;let M=J_(R.floating,c.x),_=J_(R.floating,c.y);return i?{...q,transform:"translate("+M+"px, "+_+"px)",...aP(R.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:M,top:_}},[a,i,R.floating,c.x,c.y]);return La.useMemo(()=>({...c,update:H,refs:I,elements:R,floatingStyles:E}),[c,H,I,R,E])}var a7=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){let{element:n,padding:o}=typeof e=="function"?e(a):e;return n&&t(n)?n.current!=null?OS({element:n.current,padding:o}).fn(a):{}:n?OS({element:n,padding:o}).fn(a):{}}}},oP=(e,t)=>{let a=K_(e);return{name:a.name,fn:a.fn,options:[e,t]}},rP=(e,t)=>{let a=G_(e);return{name:a.name,fn:a.fn,options:[e,t]}},sP=(e,t)=>({fn:Q_(e).fn,options:[e,t]}),iP=(e,t)=>{let a=Y_(e);return{name:a.name,fn:a.fn,options:[e,t]}},lP=(e,t)=>{let a=X_(e);return{name:a.name,fn:a.fn,options:[e,t]}};var uP=(e,t)=>{let a=Z_(e);return{name:a.name,fn:a.fn,options:[e,t]}};var cP=(e,t)=>{let a=a7(e);return{name:a.name,fn:a.fn,options:[e,t]}};var yd=O(Z(),1),n7=Object.defineProperty,el=(e,t)=>n7(e,"name",{value:t,configurable:!0});var dP="Popper",[fP,HS]=An(dP),[o7,pP]=fP(dP),r7=el(e=>{let{__scopePopper:t,children:a}=e,[n,o]=wn.useState(null),[r,s]=wn.useState(void 0);return(0,yd.jsx)(o7,{scope:t,anchor:n,onAnchorChange:o,placementState:r,setPlacementState:s,children:a})},"Popper"),s7="PopperAnchor",i7=wn.forwardRef(el(function(t,a){let{__scopePopper:n,virtualRef:o,...r}=t,s=pP(s7,n),i=wn.useRef(null),l=s.onAnchorChange,u=wn.useCallback(y=>{i.current=y,y&&l(y)},[l]),c=At(a,u),f=wn.useRef(null);wn.useEffect(()=>{if(!o)return;let y=f.current;f.current=o.current,y!==f.current&&l(f.current)});let d=s.placementState&&ey(s.placementState),m=d?.[0],h=d?.[1];return o?null:(0,yd.jsx)(ta.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...r,ref:c})},"PopperAnchor")),mP="PopperContent",[l7,Zde]=fP(mP),u7=wn.forwardRef(el(function(t,a){let{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:y,...w}=t,v=pP(mP,n),[x,g]=wn.useState(null),b=At(a,g),[k,C]=wn.useState(null),N=RS(k),L=N?.width??0,A=N?.height??0,P=o+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(c)?c:[c],H=B.length>0,S={padding:F,boundary:B.filter(hP),altBoundary:H},{refs:I,floatingStyles:R,placement:E,isPositioned:q,middlewareData:M}=nP({strategy:"fixed",placement:P,whileElementsMounted:el((...z)=>PS(...z,{animationFrame:h==="always"}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[oP({mainAxis:r+A,alignmentAxis:i}),u&&rP({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?sP():void 0,...S}),u&&iP({...S}),lP({...S,apply:el(({elements:z,rects:Y,availableWidth:me,availableHeight:X})=>{let{width:te,height:ge}=Y.reference,be=z.floating.style;be.setProperty("--radix-popper-available-width",`${me}px`),be.setProperty("--radix-popper-available-height",`${X}px`),be.setProperty("--radix-popper-anchor-width",`${te}px`),be.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),k&&cP({element:k,padding:l}),c7({arrowWidth:L,arrowHeight:A}),m&&uP({strategy:"referenceHidden",...S,boundary:H?S.boundary:void 0})]}),_=v.setPlacementState;ya(()=>(_(E),()=>{_(void 0)}),[E,_]);let[G,re]=ey(E),oe=eo(y);ya(()=>{q&&oe?.()},[q,oe]);let $=M.arrow?.x,W=M.arrow?.y,Q=M.arrow?.centerOffset!==0,[ne,V]=wn.useState();return ya(()=>{x&&V(window.getComputedStyle(x).zIndex)},[x]),(0,yd.jsx)("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:q?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:(0,yd.jsx)(l7,{scope:n,placedSide:G,placedAlign:re,onArrowChange:C,arrowX:$,arrowY:W,shouldHideArrow:Q,children:(0,yd.jsx)(ta.div,{"data-side":G,"data-align":re,...w,ref:b,style:{...w.style,animation:q?w.style?.animation:"none"}})})})},"PopperContent"));function hP(e){return e!==null}el(hP,"isNotNull");var c7=el(e=>({name:"transformOrigin",options:e,fn(t){let{placement:a,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,i=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,c]=ey(a),f={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,m=(o.arrow?.y??0)+l/2,h="",y="";return u==="bottom"?(h=s?f:`${d}px`,y=`${-l}px`):u==="top"?(h=s?f:`${d}px`,y=`${n.floating.height+l}px`):u==="right"?(h=`${-l}px`,y=s?f:`${m}px`):u==="left"&&(h=`${n.floating.width+l}px`,y=s?f:`${m}px`),{data:{x:h,y}}}}),"transformOrigin");function ey(e){let[t,a="center"]=e.split("-");return[t,a]}el(ey,"getSideAndAlignFromPlacement");var gP=r7,vP=i7,yP=u7;var wP=O(Z(),1);var f7=O(Z(),1);var xe=O(ve(),1),SP=O(_o(),1);function p7(e){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}var m7=e=>{switch(e){case"success":return v7;case"info":return w7;case"warning":return y7;case"error":return x7;default:return null}},h7=Array(12).fill(0),g7=({visible:e,className:t})=>xe.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},xe.default.createElement("div",{className:"sonner-spinner"},h7.map((a,n)=>xe.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),v7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),y7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),w7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),x7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),b7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},xe.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),xe.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),k7=()=>{let[e,t]=xe.default.useState(document.hidden);return xe.default.useEffect(()=>{let a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},[]),e},S7=1,C7=100,xP=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:S7++},FS=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(a=>t(a)),()=>{let a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-C7;t<=0||(this.toasts=this.toasts.filter(a=>t>0&&this.dismissedToasts.has(a.id)?(this.dismissedToasts.delete(a.id),t--,!1):!0))},this.create=t=>{let{message:a,...n}=t,o=xP(t),r=this.pendingDismissals.get(o);r!==void 0&&(cancelAnimationFrame(r),this.pendingDismissals.delete(o),this.dismissedToasts.delete(o));let s=this.dismissedToasts.has(o),i=t.dismissible===void 0?!0:t.dismissible;return s&&(this.dismissedToasts.delete(o),this.toasts=this.toasts.filter(u=>u.id!==o)),(s?void 0:this.toasts.find(u=>u.id===o))?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...t,id:o,title:a}),{...u,...t,id:o,dismissible:i,title:a}):u):this.addToast({title:a,...n,dismissible:i,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(n=>{this.dismissedToasts.add(n.id),this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);let a=this.pendingDismissals.get(t);return a!==void 0&&cancelAnimationFrame(a),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(n=>n({id:t,dismiss:!0}))})),t},this.message=(t,a)=>this.create({...a,message:t,type:void 0}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let n;a.loading!==void 0&&(n=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let o=Promise.resolve(t instanceof Function?t():t),r=n!==void 0,s,i=o.then(async u=>{if(s=["resolve",u],xe.default.isValidElement(u))r=!1,this.create({id:n,type:"default",message:u});else if(N7(u)&&!u.ok){r=!1;let f=typeof a.error=="function"?await a.error(`HTTP error! status: ${u.status}`):a.error,d=typeof a.description=="function"?await a.description(`HTTP error! status: ${u.status}`):a.description,h=typeof f=="object"&&!xe.default.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...h})}else if(u instanceof Error){r=!1;let f=typeof a.error=="function"?await a.error(u):a.error,d=typeof a.description=="function"?await a.description(u):a.description,h=typeof f=="object"&&!xe.default.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...h})}else if(a.success!==void 0){r=!1;let f=typeof a.success=="function"?await a.success(u):a.success,d=typeof a.description=="function"?await a.description(u):a.description,h=typeof f=="object"&&!xe.default.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:d,...h})}}).catch(async u=>{if(s=["reject",u],a.error!==void 0){r=!1;let c=typeof a.error=="function"?await a.error(u):a.error,f=typeof a.description=="function"?await a.description(u):a.description,m=typeof c=="object"&&!xe.default.isValidElement(c)?c:{message:c};this.create({id:n,type:"error",description:f,...m})}}).finally(()=>{r&&(this.dismiss(n),n=void 0),a.finally==null||a.finally.call(a)}),l=()=>new Promise((u,c)=>i.then(()=>s[0]==="reject"?c(s[1]):u(s[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,a)=>{let n=xP(a);return this.create({...a,jsx:t(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},ro=new FS,L7=(e,t)=>ro.message(e,t),N7=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",I7=L7,T7=()=>ro.toasts,R7=()=>ro.getActiveToasts(),om=Object.assign(I7,{success:ro.success,info:ro.info,warning:ro.warning,error:ro.error,custom:ro.custom,message:ro.message,promise:ro.promise,dismiss:ro.dismiss,loading:ro.loading},{getHistory:T7,getToasts:R7});p7("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ty(e){return e.label!==void 0}var A7=3,E7="24px",M7="16px",bP=4e3,D7=356,_7=14,P7=45,O7=200;function os(...e){return e.filter(Boolean).join(" ")}function B7(e){let[t,a]=e.split("-"),n=[];return t&&n.push(t),a&&n.push(a),n}var z7=e=>{var t,a,n,o,r,s,i,l,u;let{invert:c,toast:f,unstyled:d,interacting:m,setHeights:h,visibleToasts:y,heights:w,index:v,toasts:x,expanded:g,removeToast:b,defaultRichColors:k,closeButton:C,style:N,cancelButtonStyle:L,actionButtonStyle:A,className:P="",descriptionClassName:F="",duration:B,position:H,gap:S,expandByDefault:I,classNames:R,icons:E,closeButtonAriaLabel:q="Close toast"}=e,[M,_]=xe.default.useState(null),[G,re]=xe.default.useState(null),[oe,$]=xe.default.useState(!1),[W,Q]=xe.default.useState(!1),[ne,V]=xe.default.useState(!1),[z,Y]=xe.default.useState(!1),[me,X]=xe.default.useState(!1),[te,ge]=xe.default.useState(0),[be,_e]=xe.default.useState(0),ee=xe.default.useRef(f.duration||B||bP),Te=xe.default.useRef(null),je=xe.default.useRef(null),Ye=v===0,tt=v+1<=y,Xe=f.type,Oa=Xe??"default",Dt=f.dismissible!==!1,Ba=f.className||"",pn=f.descriptionClassName||"",ba=xe.default.useMemo(()=>w.findIndex(Ve=>Ve.toastId===f.id)||0,[w,f.id]),ha=xe.default.useMemo(()=>{var Ve;return(Ve=f.closeButton)!=null?Ve:C},[f.closeButton,C]),or=xe.default.useMemo(()=>f.duration||B||bP,[f.duration,B]),Ao=xe.default.useRef(0),le=xe.default.useRef(0),$e=xe.default.useRef(0),Ue=xe.default.useRef(null),[Zt,Ra]=H.split("-"),rr=xe.default.useMemo(()=>w.reduce((Ve,Qt,J)=>J>=ba?Ve:Ve+Qt.height,0),[w,ba]),Un=k7(),za=xe.default.useMemo(()=>{var Ve;return(Ve=e.swipeDirections)!=null?Ve:B7(H)},[e.swipeDirections,H]),Eo=f.invert||c,ga=Xe==="loading";le.current=xe.default.useMemo(()=>ba*S+rr,[ba,rr]),xe.default.useEffect(()=>{ee.current=or},[or]),xe.default.useEffect(()=>{$(!0)},[]),xe.default.useEffect(()=>{let Ve=je.current;if(Ve){let Qt=Ve.getBoundingClientRect().height;return _e(Qt),h(J=>[{toastId:f.id,height:Qt,position:f.position},...J]),()=>h(J=>J.filter(Le=>Le.toastId!==f.id))}},[h,f.id]),xe.default.useLayoutEffect(()=>{if(!oe)return;let Ve=je.current,Qt=Ve.style.height;Ve.style.height="auto";let J=Ve.getBoundingClientRect().height;Ve.style.height=Qt,_e(J),h(Le=>Le.find(kt=>kt.toastId===f.id)?Le.map(kt=>kt.toastId===f.id?{...kt,height:J}:kt):[{toastId:f.id,height:J,position:f.position},...Le])},[oe,f.title,f.description,h,f.id,f.jsx,f.action,f.cancel]);let Aa=xe.default.useCallback(()=>{Q(!0),ge(le.current),h(Ve=>Ve.filter(Qt=>Qt.toastId!==f.id)),setTimeout(()=>{b(f)},O7)},[f,b,h,le]);xe.default.useEffect(()=>{if(f.promise&&Xe==="loading"||f.duration===1/0||f.type==="loading")return;let Ve;return g||m||Un?(()=>{if($e.current<Ao.current){let Le=new Date().getTime()-Ao.current;ee.current=ee.current-Le}$e.current=new Date().getTime()})():ee.current!==1/0&&(Ao.current=new Date().getTime(),Ve=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Aa()},ee.current)),()=>clearTimeout(Ve)},[g,m,f,Xe,Un,Aa]),xe.default.useEffect(()=>{f.delete&&(Aa(),f.onDismiss==null||f.onDismiss.call(f,f))},[Aa,f.delete]);function xs(){var Ve;if(E?.loading){var Qt;return xe.default.createElement("div",{className:os(R?.loader,f==null||(Qt=f.classNames)==null?void 0:Qt.loader,"sonner-loader"),"data-visible":Xe==="loading"},E.loading)}return xe.default.createElement(g7,{className:os(R?.loader,f==null||(Ve=f.classNames)==null?void 0:Ve.loader),visible:Xe==="loading"})}let rf=f.icon||E?.[Xe]||m7(Xe);var Vu,ui;return xe.default.createElement("li",{tabIndex:0,ref:je,className:os(P,Ba,R?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,R?.[Oa],f==null||(a=f.classNames)==null?void 0:a[Oa]),"data-sonner-toast":"","data-rich-colors":(Vu=f.richColors)!=null?Vu:k,"data-styled":!(f.jsx||f.unstyled||d),"data-mounted":oe,"data-promise":!!f.promise,"data-swiped":me,"data-removed":W,"data-visible":tt,"data-y-position":Zt,"data-x-position":Ra,"data-index":v,"data-front":Ye,"data-swiping":ne,"data-dismissible":Dt,"data-type":Xe,"data-invert":Eo,"data-swipe-out":z,"data-swipe-direction":G,"data-expanded":!!(g||I&&oe),"data-testid":f.testId,style:{"--index":v,"--toasts-before":v,"--z-index":x.length-v,"--offset":`${W?te:le.current}px`,"--initial-height":I?"auto":`${be}px`,...N,...f.style},onDragEnd:()=>{V(!1),_(null),Ue.current=null},onPointerDown:Ve=>{Ve.button!==2&&(ga||!Dt||(Te.current=new Date,ge(le.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(V(!0),Ue.current={x:Ve.clientX,y:Ve.clientY})))},onPointerUp:()=>{var Ve,Qt,J;if(z||!Dt)return;Ue.current=null;let Le=Number(((Ve=je.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),qe=Number(((Qt=je.current)==null?void 0:Qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),kt=new Date().getTime()-((J=Te.current)==null?void 0:J.getTime()),Vn=M==="x"?Le:qe,Mo=Math.abs(Vn)/kt;if((M==="x"?za.includes(Le>0?"right":"left"):za.includes(qe>0?"bottom":"top"))&&(Math.abs(Vn)>=P7||Mo>.11)){ge(le.current),f.onDismiss==null||f.onDismiss.call(f,f),re(M==="x"?Le>0?"right":"left":qe>0?"down":"up"),Aa(),Y(!0);return}else{var Do,lf;(Do=je.current)==null||Do.style.setProperty("--swipe-amount-x","0px"),(lf=je.current)==null||lf.style.setProperty("--swipe-amount-y","0px")}X(!1),V(!1),_(null)},onPointerMove:Ve=>{var Qt,J,Le;if(!Ue.current||!Dt||((Qt=window.getSelection())==null?void 0:Qt.toString().length)>0)return;let kt=Ve.clientY-Ue.current.y,Vn=Ve.clientX-Ue.current.x;!M&&(Math.abs(Vn)>1||Math.abs(kt)>1)&&_(Math.abs(Vn)>Math.abs(kt)?"x":"y");let Mo={x:0,y:0},sf=Do=>1/(1.5+Math.abs(Do)/20);if(M==="y"){if(za.includes("top")||za.includes("bottom"))if(za.includes("top")&&kt<0||za.includes("bottom")&&kt>0)Mo.y=kt;else{let Do=kt*sf(kt);Mo.y=Math.abs(Do)<Math.abs(kt)?Do:kt}}else if(M==="x"&&(za.includes("left")||za.includes("right")))if(za.includes("left")&&Vn<0||za.includes("right")&&Vn>0)Mo.x=Vn;else{let Do=Vn*sf(Vn);Mo.x=Math.abs(Do)<Math.abs(Vn)?Do:Vn}(Math.abs(Mo.x)>0||Math.abs(Mo.y)>0)&&X(!0),(J=je.current)==null||J.style.setProperty("--swipe-amount-x",`${Mo.x}px`),(Le=je.current)==null||Le.style.setProperty("--swipe-amount-y",`${Mo.y}px`)}},ha&&!f.jsx&&Xe!=="loading"?xe.default.createElement("button",{"aria-label":q,"data-disabled":ga,"data-close-button":!0,onClick:ga||!Dt?()=>{}:()=>{Aa(),f.onDismiss==null||f.onDismiss.call(f,f)},className:os(R?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(ui=E?.close)!=null?ui:b7):null,(Xe||f.icon||f.promise)&&f.icon!==null&&(E?.[Xe]!==null||f.icon)?xe.default.createElement("div",{"data-icon":"",className:os(R?.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},Xe==="loading"?f.icon||xs():f.promise?xs():null,Xe!=="loading"?rf:null):null,xe.default.createElement("div",{"data-content":"",className:os(R?.content,f==null||(r=f.classNames)==null?void 0:r.content)},xe.default.createElement("div",{"data-title":"",className:os(R?.title,f==null||(s=f.classNames)==null?void 0:s.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?xe.default.createElement("div",{"data-description":"",className:os(F,pn,R?.description,f==null||(i=f.classNames)==null?void 0:i.description)},typeof f.description=="function"?f.description():f.description):null),xe.default.isValidElement(f.cancel)?f.cancel:f.cancel&&ty(f.cancel)?xe.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Ve=>{ty(f.cancel)&&Dt&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Ve),Aa())},className:os(R?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,xe.default.isValidElement(f.action)?f.action:f.action&&ty(f.action)?xe.default.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||A,onClick:Ve=>{ty(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Ve),!Ve.defaultPrevented&&Aa())},className:os(R?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function kP(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function H7(e,t){let a={};return[e,t].forEach((n,o)=>{let r=o===1,s=r?"--mobile-offset":"--offset",i=r?M7:E7;function l(u){["top","right","bottom","left"].forEach(c=>{a[`${s}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?a[`${s}-${u}`]=i:a[`${s}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(i)}),a}var CP=xe.default.forwardRef(function(t,a){let{id:n,invert:o,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:u,offset:c,mobileOffset:f,theme:d="light",richColors:m,duration:h,style:y,visibleToasts:w=A7,toastOptions:v,dir:x=kP(),gap:g=_7,icons:b,customAriaLabel:k,containerAriaLabel:C="Notifications"}=t,[N,L]=xe.default.useState([]),A=xe.default.useMemo(()=>n?N.filter($=>$.toasterId===n):N.filter($=>!$.toasterId),[N,n]),P=xe.default.useMemo(()=>Array.from(new Set([r].concat(A.filter($=>$.position).map($=>$.position)))),[A,r]),[F,B]=xe.default.useState([]),[H,S]=xe.default.useState(!1),[I,R]=xe.default.useState(!1),[E,q]=xe.default.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=xe.default.useRef(null),_=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=xe.default.useRef(null),re=xe.default.useRef(!1),oe=xe.default.useCallback($=>{L(W=>{var Q;return(Q=W.find(ne=>ne.id===$.id))!=null&&Q.delete||ro.dismiss($.id),W.filter(({id:ne})=>ne!==$.id)})},[]);return xe.default.useEffect(()=>ro.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{L(W=>W.map(Q=>Q.id===$.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{SP.default.flushSync(()=>{L(W=>{let Q=W.findIndex(ne=>ne.id===$.id);return Q!==-1?[...W.slice(0,Q),{...W[Q],...$},...W.slice(Q+1)]:[$,...W]})})})}),[]),xe.default.useEffect(()=>{if(d!=="system"){q(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:W})=>{q(W?"dark":"light")})}catch{$.addListener(({matches:Q})=>{try{q(Q?"dark":"light")}catch(ne){console.error(ne)}})}},[d]),xe.default.useEffect(()=>{N.length<=1&&S(!1)},[N]),xe.default.useEffect(()=>{let $=W=>{var Q;if(s.length>0&&s.every(z=>W[z]||W.code===z)){var V;S(!0),(V=M.current)==null||V.focus()}W.code==="Escape"&&(document.activeElement===M.current||(Q=M.current)!=null&&Q.contains(document.activeElement))&&S(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),xe.default.useEffect(()=>{if(M.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,re.current=!1)}},[M.current]),xe.default.createElement("section",{ref:a,"aria-label":k??`${C} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},P.map(($,W)=>{var Q;let[ne,V]=$.split("-");return A.length?xe.default.createElement("ol",{key:$,dir:x==="auto"?kP():x,tabIndex:-1,ref:M,className:u,"data-sonner-toaster":!0,"data-sonner-theme":E,"data-y-position":ne,"data-x-position":V,style:{"--front-toast-height":`${((Q=F[0])==null?void 0:Q.height)||0}px`,"--width":`${D7}px`,"--gap":`${g}px`,...y,...H7(c,f)},onBlur:z=>{re.current&&!z.currentTarget.contains(z.relatedTarget)&&(re.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||re.current||(re.current=!0,G.current=z.relatedTarget)},onMouseEnter:()=>S(!0),onMouseMove:()=>S(!0),onMouseLeave:()=>{I||S(!1)},onDragEnd:()=>S(!1),onPointerDown:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||R(!0)},onPointerUp:()=>R(!1)},A.filter(z=>!z.position&&W===0||z.position===$).map((z,Y)=>{var me,X;return xe.default.createElement(z7,{key:z.id,icons:b,index:Y,toast:z,defaultRichColors:m,duration:(me=v?.duration)!=null?me:h,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:o,visibleToasts:w,closeButton:(X=v?.closeButton)!=null?X:l,interacting:I,position:$,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:oe,toasts:A.filter(te=>te.position==z.position),heights:F.filter(te=>te.position==z.position),setHeights:B,expandByDefault:i,gap:g,expanded:H,swipeDirections:t.swipeDirections})})):null}))});var NP=O(Z(),1);function LP(){return(0,NP.jsx)(CP,{position:"bottom-center",toastOptions:{classNames:{toast:"!bg-card !text-foreground !border !border-border !shadow-lg",description:"!text-muted-foreground"}}})}var Cr=O(ve(),1);var Ge=O(ve(),1);var Ot=O(Z(),1),F7=Object.defineProperty,Bt=(e,t)=>F7(e,"name",{value:t,configurable:!0}),qS=["Enter"," "],q7=["ArrowDown","PageUp","Home"],TP=["ArrowUp","PageDown","End"],$7=[...q7,...TP],Cfe={ltr:[...qS,"ArrowRight"],rtl:[...qS,"ArrowLeft"]};var ny="Menu",[$S,U7,V7]=Xp(ny),[pu,VS]=An(ny,[V7,HS,IS]),jS=HS(),RP=IS(),[j7,rm]=pu(ny),[W7,WS]=pu(ny),K7=Bt(e=>{let{__scopeMenu:t,open:a=!1,children:n,dir:o,onOpenChange:r,modal:s=!0}=e,i=jS(t),[l,u]=Ge.useState(null),c=Ge.useRef(!1),f=eo(r),d=Zp(o);return Ge.useEffect(()=>{let m=Bt(()=>{c.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},"handleKeyDown"),h=Bt(()=>c.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),Ge.useEffect(()=>{if(!a)return;let m=Bt(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[a,f]),(0,Ot.jsx)(gP,{...i,children:(0,Ot.jsx)(j7,{scope:t,open:a,onOpenChange:f,content:l,onContentChange:u,children:(0,Ot.jsx)(W7,{scope:t,onClose:Ge.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:s,children:n})})})},"Menu"),G7=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,...o}=t,r=jS(n);return(0,Ot.jsx)(vP,{...r,...o,ref:a})},"MenuAnchor")),AP="MenuPortal",[Y7,X7]=pu(AP,{forceMount:void 0}),Z7=Bt(e=>{let{__scopeMenu:t,forceMount:a,children:n,container:o}=e,r=rm(AP,t);return(0,Ot.jsx)(Y7,{scope:t,forceMount:a,children:(0,Ot.jsx)(Xl,{present:a||r.open,children:(0,Ot.jsx)(cv,{asChild:!0,container:o,children:n})})})},"MenuPortal"),tl="MenuContent",[Q7,EP]=pu(tl),J7=Ge.forwardRef(Bt(function(t,a){let n=X7(tl,t.__scopeMenu),{forceMount:o=n.forceMount,...r}=t,s=rm(tl,t.__scopeMenu),i=WS(tl,t.__scopeMenu);return(0,Ot.jsx)($S.Provider,{scope:t.__scopeMenu,children:(0,Ot.jsx)(Xl,{present:o||s.open,children:(0,Ot.jsx)($S.Slot,{scope:t.__scopeMenu,children:i.modal?(0,Ot.jsx)(eG,{...r,ref:a}):(0,Ot.jsx)(tG,{...r,ref:a})})})})},"MenuContent")),eG=Ge.forwardRef(Bt(function(t,a){let n=rm(tl,t.__scopeMenu),o=Ge.useRef(null),r=At(a,o);return Ge.useEffect(()=>{let s=o.current;if(s)return xv(s)},[]),(0,Ot.jsx)(MP,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ct(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),tG=Ge.forwardRef(Bt(function(t,a){let n=rm(tl,t.__scopeMenu);return(0,Ot.jsx)(MP,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),aG=Jn("MenuContent.ScrollLock"),MP=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:h,disableOutsideScroll:y,...w}=t,v=rm(tl,n),x=WS(tl,n),g=jS(n),b=RP(n),k=U7(n),[C,N]=Ge.useState(null),L=Ge.useRef(null),A=At(a,L,v.onContentChange),P=Ge.useRef(0),F=Ge.useRef(""),B=Ge.useRef(0),H=Ge.useRef(null),S=Ge.useRef("right"),I=Ge.useRef(0),R=y?yp:Ge.Fragment,E=y?{as:aG,allowPinchZoom:!0}:void 0,q=Bt(_=>{let G=F.current+_,re=k().filter(V=>!V.disabled),oe=document.activeElement,$=re.find(V=>V.ref.current===oe)?.textValue,W=re.map(V=>V.textValue),Q=BP(W,G,$),ne=re.find(V=>V.textValue===Q)?.ref.current;Bt((function V(z){F.current=z,window.clearTimeout(P.current),z!==""&&(P.current=window.setTimeout(()=>V(""),1e3))}),"updateSearch")(G),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");Ge.useEffect(()=>()=>window.clearTimeout(P.current),[]),Yc();let M=Ge.useCallback(_=>S.current===H.current?.side&&HP(_,H.current?.area),[]);return(0,Ot.jsx)(Q7,{scope:n,searchRef:F,onItemEnter:Ge.useCallback(_=>{M(_)&&_.preventDefault()},[M]),onItemLeave:Ge.useCallback(_=>{M(_)||(L.current?.focus(),N(null))},[M]),onTriggerLeave:Ge.useCallback(_=>{M(_)&&_.preventDefault()},[M]),pointerGraceTimerRef:B,onPointerGraceIntentChange:Ge.useCallback(_=>{H.current=_},[]),children:(0,Ot.jsx)(R,{...E,children:(0,Ot.jsx)(lv,{asChild:!0,trapped:r,onMountAutoFocus:ct(s,_=>{_.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,Ot.jsx)(iv,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:h,children:(0,Ot.jsx)(d_,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:ct(u,_=>{x.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Ot.jsx)(yP,{role:"menu","aria-orientation":"vertical","data-state":DP(v.open),"data-radix-menu-content":"",dir:x.dir,...g,...w,ref:A,style:{outline:"none",...w.style},onKeyDown:ct(w.onKeyDown,_=>{let re=_.target.closest("[data-radix-menu-content]")===_.currentTarget,oe=_.ctrlKey||_.altKey||_.metaKey,$=_.key.length===1;re&&(_.key==="Tab"&&_.preventDefault(),!oe&&$&&q(_.key));let W=L.current;if(_.target!==W||!$7.includes(_.key))return;_.preventDefault();let ne=k().filter(V=>!V.disabled).map(V=>V.ref.current);TP.includes(_.key)&&ne.reverse(),PP(ne)}),onBlur:ct(t.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(P.current),F.current="")}),onPointerMove:ct(t.onPointerMove,ay(_=>{let G=_.target,re=I.current!==_.clientX;if(_.currentTarget.contains(G)&&re){let oe=_.clientX>I.current?"right":"left";S.current=oe,I.current=_.clientX}}))})})})})})})},"MenuContentImpl"));var nG=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,...o}=t;return(0,Ot.jsx)(ta.div,{...o,ref:a})},"MenuLabel")),US="MenuItem",IP="menu.itemSelect",oG=Ge.forwardRef(Bt(function(t,a){let{disabled:n=!1,onSelect:o,...r}=t,s=Ge.useRef(null),i=WS(US,t.__scopeMenu),l=EP(US,t.__scopeMenu),u=At(a,s),c=Ge.useRef(!1),f=Bt(()=>{let d=s.current;if(!n&&d){let m=new CustomEvent(IP,{bubbles:!0,cancelable:!0});d.addEventListener(IP,h=>o?.(h),{once:!0}),mp(d,m),m.defaultPrevented?c.current=!1:i.onClose()}},"handleSelect");return(0,Ot.jsx)(rG,{...r,ref:u,disabled:n,onClick:ct(t.onClick,f),onPointerDown:d=>{t.onPointerDown?.(d),c.current=!0},onPointerUp:ct(t.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:ct(t.onKeyDown,d=>{n||d.target!==d.currentTarget||l.searchRef.current!==""&&d.key===" "||qS.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})},"MenuItem")),rG=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=t,i=EP(US,n),l=RP(n),u=Ge.useRef(null),c=At(a,u),[f,d]=Ge.useState(!1),[m,h]=Ge.useState("");return Ge.useEffect(()=>{let y=u.current;y&&h((y.textContent??"").trim())},[s.children]),(0,Ot.jsx)($S.ItemSlot,{scope:n,disabled:o,textValue:r??m,children:(0,Ot.jsx)(f_,{asChild:!0,...l,focusable:!o,children:(0,Ot.jsx)(ta.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:c,onPointerMove:ct(t.onPointerMove,ay(y=>{o?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ct(t.onPointerLeave,ay(y=>i.onItemLeave(y))),onFocus:ct(t.onFocus,()=>d(!0)),onBlur:ct(t.onBlur,()=>d(!1))})})})},"MenuItemImpl"));var sG="MenuRadioGroup",[Lfe,Nfe]=pu(sG,{value:void 0,onValueChange:Bt(()=>{},"onValueChange")});var iG="MenuItemIndicator",[Ife,Tfe]=pu(iG,{checked:!1});var lG=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,...o}=t;return(0,Ot.jsx)(ta.div,{role:"separator","aria-orientation":"horizontal",...o,ref:a})},"MenuSeparator"));var uG="MenuSub",[Rfe,Afe]=pu(uG);function DP(e){return e?"open":"closed"}Bt(DP,"getOpenState");function _P(e){return e==="indeterminate"}Bt(_P,"isIndeterminate");function cG(e){return _P(e)?"indeterminate":e?"checked":"unchecked"}Bt(cG,"getCheckedState");function PP(e){let t=document.activeElement;for(let a of e)if(a===t||(a.focus(),document.activeElement!==t))return}Bt(PP,"focusFirst");function OP(e,t){return e.map((a,n)=>e[(t+n)%e.length])}Bt(OP,"wrapArray");function BP(e,t,a){let o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,r=a?e.indexOf(a):-1,s=OP(e,Math.max(r,0));o.length===1&&(s=s.filter(u=>u!==a));let l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==a?l:void 0}Bt(BP,"getNextMatch");function zP(e,t){let{x:a,y:n}=e,o=!1;for(let r=0,s=t.length-1;r<t.length;s=r++){let i=t[r],l=t[s],u=i.x,c=i.y,f=l.x,d=l.y;c>n!=d>n&&a<(f-u)*(n-c)/(d-c)+u&&(o=!o)}return o}Bt(zP,"isPointInPolygon");function HP(e,t){if(!t)return!1;let a={x:e.clientX,y:e.clientY};return zP(a,t)}Bt(HP,"isPointerInGraceArea");function ay(e){return t=>t.pointerType==="mouse"?e(t):void 0}Bt(ay,"whenMouse");var FP=K7,qP=G7,$P=Z7,UP=J7;var VP=nG,jP=oG;var WP=lG;var rs=O(Z(),1),fG=Object.defineProperty,mu=(e,t)=>fG(e,"name",{value:t,configurable:!0}),KS="DropdownMenu",[pG,Kfe]=An(KS,[VS]),hu=VS(),[mG,KP]=pG(KS),hG=mu(e=>{let{__scopeDropdownMenu:t,children:a,dir:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,l=hu(t),u=Cr.useRef(null),[c,f]=Yl({prop:o,defaultProp:r??!1,onChange:s,caller:KS});return(0,rs.jsx)(mG,{scope:t,triggerId:Zr(),triggerRef:u,contentId:Zr(),open:c,onOpenChange:f,onOpenToggle:Cr.useCallback(()=>f(d=>!d),[f]),modal:i,children:(0,rs.jsx)(FP,{...l,open:c,onOpenChange:f,dir:n,modal:i,children:a})})},"DropdownMenu"),gG="DropdownMenuTrigger",vG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,disabled:o=!1,...r}=t,s=KP(gG,n),i=hu(n),l=At(a,s.triggerRef);return(0,rs.jsx)(qP,{asChild:!0,...i,children:(0,rs.jsx)(ta.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:l,onPointerDown:ct(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(s.onOpenToggle(),s.open||u.preventDefault())}),onKeyDown:ct(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&s.onOpenToggle(),u.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),yG=mu(e=>{let{__scopeDropdownMenu:t,...a}=e,n=hu(t);return(0,rs.jsx)($P,{...n,...a})},"DropdownMenuPortal"),wG="DropdownMenuContent",xG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=KP(wG,n),s=hu(n),i=Cr.useRef(!1);return(0,rs.jsx)(UP,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:a,onCloseAutoFocus:ct(t.onCloseAutoFocus,l=>{i.current||r.triggerRef.current?.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:ct(t.onInteractOutside,l=>{let u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;(!r.modal||f)&&(i.current=!0)}),style:{...t.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)"}})},"DropdownMenuContent"));var bG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=hu(n);return(0,rs.jsx)(VP,{...r,...o,ref:a})},"DropdownMenuLabel")),kG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=hu(n);return(0,rs.jsx)(jP,{...r,...o,ref:a})},"DropdownMenuItem"));var SG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=hu(n);return(0,rs.jsx)(WP,{...r,...o,ref:a})},"DropdownMenuSeparator"));var GP=hG,YP=vG,XP=yG,ZP=xG;var QP=bG,JP=kG;var eO=SG;var wd=O(Z(),1),tO=GP,aO=YP;function nO({className:e,sideOffset:t=4,...a}){return(0,wd.jsx)(XP,{children:(0,wd.jsx)(ZP,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ye("z-[120] min-w-44 overflow-hidden rounded-card border-0 bg-popover p-1 text-popover-foreground shadow-overlay",e),...a})})}function oO({className:e,...t}){return(0,wd.jsx)(JP,{"data-slot":"dropdown-menu-item",className:ye("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-body outline-none data-[highlighted]:bg-accent phone:min-h-11 [&_svg]:size-4",e),...t})}function GS({className:e,...t}){return(0,wd.jsx)(QP,{className:ye("px-2 py-1.5 text-xs font-semibold text-muted-foreground",e),...t})}var rO=({className:e,...t})=>(0,wd.jsx)(eO,{className:ye("-mx-1 my-1 h-px bg-border",e),...t});var LG=O(Z(),1);var sO=O(Z(),1),NG=td("grid w-full grid-cols-[minmax(0,1fr)] items-start gap-y-0.5 rounded-md px-3 py-2.5 text-body has-[>svg]:grid-cols-[14px_minmax(0,1fr)] has-[>svg]:gap-x-2.5 [&>svg]:mt-0.5 [&>svg]:size-3.5",{variants:{tone:{neutral:"bg-raised text-foreground [&>svg]:text-muted-foreground",destructive:"bg-destructive-soft text-foreground [&>svg]:text-destructive"}},defaultVariants:{tone:"neutral"}});function sm({className:e,tone:t,...a}){return(0,sO.jsx)("div",{"data-slot":"alert",className:ye(NG({tone:t}),e),...a})}var iO=O(Z(),1);var LO=O(ve(),1);var oy="Accepting needs a reason";function lO(e){let t=e.canRequest?"request-changes":null,a=e.accept===null?null:"accept";if(e.failed!=null){let n=e.failed.acceptAnyway===!0?"accept-anyway":null;return e.failed.retry?{primary:"retry",secondary:n,line:null}:{primary:null,secondary:n,line:null}}return e.need!==null?{primary:e.need,secondary:t,line:null}:e.next!==null?{primary:e.next,secondary:a,line:null}:e.blocked!==null?{primary:t,secondary:a,line:e.blocked}:a!==null&&(e.unanswered??0)>0?{primary:null,secondary:a,line:null}:a!==null&&(e.notRight??0)>0?{primary:t,secondary:a,line:null}:e.checksRunning?{primary:null,secondary:a??t,line:null}:e.accept===null?{primary:null,secondary:t,line:null}:e.accept.ready?{primary:"accept",secondary:t,line:null}:e.runChecks?{primary:null,secondary:"accept",line:null}:{primary:"accept",secondary:t,line:null}}function uO(e,t){let a=n=>`“${n[0].replace(/[.!?]+$/,"")}”${n.length>1?` and ${n.length-1} more`:""}`;return t.unanswered.length>0?{label:"Accept without your check",ready:!1,why:`Not checked yet: ${a(t.unanswered)}.`}:t.notRight.length>0?{label:"Accept anyway",ready:!1,why:`You marked ${a(t.notRight)} not right.`}:e}function cO(e,t,a){let n=e.met+t,o=Math.max(0,e.yours-t-a);return{text:`${n} of ${e.total} met${o>0?` · You check ${o}`:""}`,done:n===e.total,short:e.total-n-o>0}}var Pe=(e,t,a)=>({never:e,pattern:new RegExp(`(?<![\\w-])(?:${t})(?![\\w-])`,"i"),say:a}),dO=[Pe("scope","scopes?|scoped","plan"),Pe("contract","contracts?","plan"),Pe("signs","signs|signed(?!\\s+(?:in|out|into)\\b)","Approved by …"),Pe("sealed","seal|seals|sealed|sealing","approved"),Pe("binds","binds?","approved"),Pe("digest","digests?","(the plan version, in Details)"),Pe("worker","workers?","builder"),Pe("runner","runners?","builder"),Pe("daemon","daemons?","builder"),Pe("background service","background service","builder"),Pe("operator","operators?|instance operator","approver, or owner"),Pe("coordinator","coordinators?","your lead"),Pe("mate","mate","your lead"),Pe("scout","scouts?|scouting|scouted","research"),Pe("criterion","criterion|criteria","requirement"),Pe("evidence","evidence","requirement, or the saved files"),Pe("proof","proofs?","requirement"),Pe("verdict","verdicts?","requirement"),Pe("caveat","caveats?","requirement"),Pe("mark complete","mark(?:ed|s|ing)?\\s+(?:it\\s+|this\\s+|that\\s+|them\\s+|the\\s+result\\s+)?complete","Accept"),Pe("Accept and finish","accept\\s+and\\s+finish","Accept"),Pe("Revise","revise","Send back, or Request changes"),Pe("re-file","re-?file[ds]?|re-?filing","Send back, or Request changes"),Pe("Draft a repair task","draft\\s+a\\s+repair\\s+task","Send back"),Pe("put away","put(?:s|ting)?\\s+(?:it\\s+|them\\s+|tasks\\s+|old\\s+tasks\\s+)?away","Archive"),Pe("tidy","tidy|tidied|tidying","Archive"),Pe("run #N","(?:run|result)\\s+#?\\d+|attempt\\s+#?\\d+(?!\\s+\\(build\\s+#\\d+\\))","build #N, or attempt N (build #M)"),Pe("reconcile","reconcile[ds]?|reconciling|reconciliation","Waiting: Toolroll is …"),Pe("requeue","requeue[ds]?|requeuing","Waiting: Toolroll is …"),Pe("claim","claim|claimed","Waiting: Toolroll is …"),Pe("lease","leases?|leased","Waiting: Toolroll is …"),Pe("custody","custody","Waiting: Toolroll is …"),Pe("incident","incidents?","Waiting: Toolroll is …"),Pe("plane","plane","Toolroll"),Pe("fence","fences?|fenced","Waiting: Toolroll is …"),Pe("attested","attest|attested|attestation","Waiting: Toolroll is …"),Pe("receipt","receipts?","Waiting: Toolroll is …"),Pe("regate","regate[ds]?","Run checks"),Pe("carried","carried|carry|carries","Waiting: Toolroll is …"),Pe("incarnation","incarnations?","Waiting: Toolroll is …"),Pe("admission","admission","Waiting: Toolroll is …"),Pe("quiescence","quiescen(?:ce|t)","Waiting: Toolroll is …"),Pe("witness","witness(?:es|ed)?","Waiting: Toolroll is …"),Pe("unproven","unproven","Waiting: Toolroll is …"),Pe("version hex","(?=[0-9a-f]*\\d)(?=[0-9a-f]*[a-f])[0-9a-f]{12,64}","(the plan version, in Details)")],IG=dO.map(e=>e.never);var bpe=[Pe("lead","lead","Toolroll, or Chat"),Pe("crew","crew","Toolroll"),Pe("scope","scopes?|scoped","plan"),Pe("mode","modes?","(Settings)"),Pe("flow","flows?","(Settings)"),Pe("fleet","fleet","(Settings)"),Pe("fallback","fallbacks?","(Settings)"),Pe("routing","routing|routed","(Settings)"),Pe("spend","spend|spends|spending|spent","cost"),Pe("MCP","mcp","(Settings)"),Pe("password","passwords?|passwordless","(only where one is asked for)"),Pe("token","tokens?","(Settings)"),Pe("builder","builders?","taking work")];var RG="/settings/computers?section=start",mO=e=>e===null?RG:`/settings/computers?task=${encodeURIComponent(e)}§ion=start`;var YS=()=>!0,fO=e=>e.build==null?"the last build":e.attempt==null?`build #${e.build}`:`attempt ${e.attempt} (build #${e.build})`,pO=e=>e.build==null?"The last build":`Build #${e.build}`,im={approval:{sentence:()=>"Review the plan and approve it to start.",action:{code:"approve-scope",label:"Review plan"}},card:{sentence:()=>"This card is waiting for your approval.",action:{code:"approve-card",label:"Approve card"}},answer:{sentence:()=>"Answer the question so the work can continue.",action:{code:"answer-decision",label:"Answer the question"},useReason:YS},questions:{sentence:()=>"Too many questions are open. Answer one so this task can start.",action:{code:"inspect-decisions",label:"Answer questions"}},"sign-in":{sentence:e=>`${e.provider??"Your agent"} needs you to sign in again. The task starts on its own after.`,action:{code:"sign-in",label:"Sign in again"},useReason:e=>/sign(?:ed)? in|API key/i.test(e)},"stop-unproven":{sentence:e=>`Toolroll can't prove ${fO(e)} stopped from this computer, so the work is held. Close anything of yours that is using its folder, then check again.`,action:{code:"recheck-stopped",label:"Check again"}},hold:{sentence:()=>"A hold is keeping this task from starting. Review it to release it.",action:{code:"inspect-hold",label:"Review hold"}},storage:{sentence:()=>"Toolroll couldn't finish checking other apps' data before starting. Allow it in Privacy & Security, then try again.",action:{code:"unhold",label:"Try again"},useReason:YS},"choose-project":{sentence:()=>"Choose a project so it can start.",action:{code:"place-task",label:"Choose a project"}},"define-task":{sentence:()=>"Say what the task should do so it can be planned.",action:{code:"write-scope",label:"Define the task"}},"fix-request":{sentence:()=>"The request can't be planned as written. Edit it so the planner can start.",action:{code:"write-scope",label:"Edit the request"},useReason:e=>/the planner can carry at most/.test(e)},"choose-agent":{sentence:()=>"Choose an agent to build this.",action:{code:"select-agent",label:"Choose an agent"}},"fix-dependency":{sentence:()=>"A task this one waits on didn't finish. Fix or remove it so this one can start.",action:{code:"repair-dependency",label:"Fix the required task"},useReason:e=>/didn't finish|did not finish|before it finished/i.test(e),withReason:e=>{let t=e.replace(/[.\s]*$/,".");return/Fix or remove it so this one can start\.$/.test(t)?t:`${t} Fix or remove it so this one can start.`}},"add-requirement":{sentence:()=>"This project is missing something the task needs. Add it so a builder can start.",action:{code:"repair-capability",label:"Add the requirement"}},"connect-builder":{sentence:()=>"No builder works on this project yet. Connect one so the task can start.",action:{code:"start-worker",label:"Connect a builder"}},"start-builder":{sentence:()=>"The builder is offline. Start the builder.",action:{code:"start-worker",label:"Start the builder"}},vanished:{sentence:e=>`${pO(e)} stopped unexpectedly. Retry it.`,action:{code:"reconcile-run",label:"Open the build"}},"review-result":{sentence:()=>"Check the result, then accept it or send it back.",action:{code:"open-result",label:"Open result"}},rebuild:{sentence:e=>`${pO(e)} was made to an earlier plan. Retry it on the current plan.`,action:{code:"retry-task",label:"Retry"}},replan:{sentence:e=>`The plan changed after ${fO(e)}. Approve the new plan, then retry it.`,action:{code:"approve-scope",label:"Review plan"}},"earlier-version":{sentence:e=>e.task==null?"An earlier version of this task still needs you. Finish it first.":`An earlier version, ${e.task}, still needs you. Finish it first.`,action:{code:"inspect-task",label:"Open earlier version"}},history:{sentence:()=>"Toolroll can't read this task's history. Open it to retry or archive it.",action:{code:"inspect-task",label:"Open the task"}},finding:{sentence:()=>"A finding has used its rounds. Read both sides and decide.",action:{code:"inspect-findings",label:"Open finding"}},"plan-again":{sentence:()=>"The plan didn't pass its checks. Plan again, or edit the task.",action:{code:"inspect-task",label:"Plan again"}},"planning-stopped":{sentence:()=>"Planning stopped after repeated failures. Plan again, or edit the task.",action:{code:"inspect-task",label:"Plan again"}},other:{sentence:()=>"Open the task to see what it needs from you.",action:{code:"inspect-task",label:"Open the task"},useReason:YS}};var XS={decide:"Decide",review:"Review",unblock:"Unblock"};var hO={queued:{stage:"queued"},ready:{stage:"queued"},"provider-quota":{stage:"queued"},running:{stage:"building"},reviewing:{stage:"reviewing"},"review-pending":{stage:"building"},"checks-running":{stage:"checking"},"ready-to-check":{stage:"finished",act:"open-result"},"ready-to-review":{stage:"finished"},"report-ready":{stage:"finished"},"no-change":{stage:"finished"},"pr-opened":{stage:"finished"},"merge-observed":{stage:"finished"},"pr-closed":{stage:"finished"},"agent-attested":{stage:"finished"},"accepted-exception":{stage:"finished"},complete:{stage:"complete",act:"open-result"},cancelled:{stage:"stopped",act:"inspect-task"},paused:{stage:"stopped"},stopped:{stage:"stopped",act:"resume-run"},failed:{stage:"failed",act:"retry-task"},"checks-failed":{stage:"failed"},"waiting-incident":{stage:"failed",act:"retry-task"},"plan-stopped":{stage:"needs-you",need:"plan-again",act:"inspect-task"},"planning-stopped":{stage:"needs-you",need:"planning-stopped",act:"inspect-task"},stopping:{stage:"waiting",wait:"build-stopping"},"build-stopping":{stage:"waiting",wait:"build-stopping"},"other-computer":{stage:"waiting",wait:"other-computer"},"planning-ready":{stage:"waiting",wait:"plan-next"},"scouting-ready":{stage:"waiting",wait:"research-next"},"worker-at-capacity":{stage:"waiting",wait:"builders-busy"},"retry-scheduled":{stage:"waiting",wait:"retry-later"},"plan-retry":{stage:"waiting",wait:"plan-retry-later"},updating:{stage:"waiting",wait:"app-update"},"waiting-dependency":{stage:"waiting",wait:"other-task"},"history-problem":{stage:"needs-you",need:"history",act:"inspect-task"},"earlier-active":{stage:"needs-you",need:"earlier-version",act:"inspect-task"},"waiting-decision":{stage:"needs-you",need:"answer",act:"answer-decision"},"finding-held":{stage:"needs-you",need:"finding",act:"inspect-findings"},"decision-queue":{stage:"needs-you",need:"questions",act:"inspect-decisions"},"result-needs-attention":{stage:"needs-you",need:"other",act:"inspect-run"},"process-needs-attention":{stage:"needs-you",need:"stop-unproven",act:"inspect-run"},"vanished-run":{stage:"needs-you",need:"vanished",act:"reconcile-run"},held:{stage:"needs-you",need:"hold",act:"inspect-hold"},"storage-blocked":{stage:"needs-you",need:"storage",act:"unhold"},"terminal-dependency":{stage:"needs-you",need:"fix-dependency",act:"repair-dependency"},"needs-project":{stage:"needs-you",need:"choose-project",act:"place-task"},"needs-scope":{stage:"needs-you",need:"define-task",act:"write-scope"},"invalid-scope":{stage:"needs-you",need:"define-task",act:"write-scope"},"planner-source":{stage:"needs-you",need:"fix-request",act:"write-scope"},"needs-agent-profile":{stage:"needs-you",need:"choose-agent",act:"select-agent"},"needs-approval":{stage:"needs-you",need:"approval",act:"approve-scope"},"missing-requirement":{stage:"needs-you",need:"add-requirement",act:"repair-capability"},"no-worker-registered":{stage:"needs-you",need:"connect-builder",act:"start-worker"},"no-worker-online":{stage:"needs-you",need:"start-builder",act:"start-worker"},"signed-out":{stage:"needs-you",need:"sign-in",act:"sign-in"},"needs-verification":{stage:"needs-you",need:"review-result"},"proof-refuted":{stage:"needs-you",need:"review-result"},"no-build-record":{stage:"needs-you",need:"review-result"},"verification-needed":{stage:"needs-you",need:"review-result"},"evidence-mismatch":{stage:"needs-you",need:"review-result"},"record-incomplete":{stage:"needs-you",need:"review-result"},"evidence-damaged":{stage:"needs-you",need:"review-result"}};var Lpe=Object.fromEntries(Object.entries(hO).flatMap(([e,t])=>t.need===void 0?[]:[[e,t.need]]));var gO=500;var vO=["Queued","Planning","Needs you","Waiting","Building","Ready","Complete","Failed","Stopped"],ZS={Queued:"neutral",Planning:"live","Needs you":"attention",Waiting:"neutral",Building:"live",Ready:"ready",Complete:"success",Failed:"danger",Stopped:"neutral"};var AG="The check result couldn't be read.",Ope=`${AG} Run checks on it, or open the result to see why.`;var Bpe={ok:Yi`<path d="M20 6 9 17l-5-5"/>`,running:Yi`<circle cx="12" cy="12" r="4"/>`,none:Yi`<circle cx="12" cy="12" r="3"/>`,note:Yi`<path d="M12 8v5"/><path d="M12 16.5h.01"/><path d="M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>`,failed:Yi`<path d="M18 6 6 18M6 6l12 12"/>`};var lm={needs:{word:"Needs you",tone:"needs"},running:{word:"Running",tone:"live"},queued:{word:"Queued",tone:""},finished:{word:"Finished",tone:"done"},failed:{word:"Failed",tone:"failed"}};function yO(e){let t=EG(e);return{word:e==="Needs you"?lm.needs.word:e,tone:lm[t].tone,status:t}}function EG(e){switch(ZS[e]){case"attention":case"ready":return"needs";case"live":return"running";case"success":return"finished";case"danger":return"failed";case"neutral":return"queued"}}var QS={idle:{word:"Idle",tone:""},building:{word:"Building",tone:"live"},offline:{word:"Offline",tone:"failed"}};function nl(e,t){return e==="way-in"?"password":t.automatic===!0?"automatic":e==="none"||t.passwordless||e==="standard"&&t.remembered?"click":"password"}function wO(e,t){let a=nl(e,t);return a==="password"?"password":a==="automatic"?"automatic":e==="none"?"none":t.passwordless?"passwordless":"remembered"}function gu(e,t){return e==="way-in"?t.passwordless?"Passwordless is on, but this creates a new way in, so it still asks for your password.":t.remembered?"A remembered password doesn’t count here: this creates a new way in.":"This creates a new way in, so it always asks for your password.":t.automatic===!0?"Approved automatically by your rule.":e==="none"?"":t.passwordless?"No password needed: Passwordless is on for your account.":e==="standard"&&t.remembered?t.rememberedUntil?`No password needed: remembered on this computer until ${t.rememberedUntil}.`:"No password needed: remembered on this computer.":"Asks for your password."}function xO(e){let t=Math.max(0,Math.round(e));return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${String(t%60).padStart(2,"0")}s`:`${Math.floor(t/3600)}h ${String(Math.floor(t%3600/60)).padStart(2,"0")}m`}var bO={ok:"Done",run:"Now",q:"Queued",bad:"Failed",wait:"Needs you",waiting:"Waiting",history:"Stopped earlier; went on"};function kO(e,t){let a=t??Math.max(1,...e.map(n=>n.start+(n.st==="q"?0:n.dur)))*1.02;return e.map(n=>n.st==="q"?null:{left:Math.max(0,n.start)/a*100,width:Math.max(n.dur,a/400)/a*100})}var SO={done:"done",needs:"waiting on you",live:"in progress",wait:"waiting",stuck:"stopped here",skipped:"skipped",todo:"not started"},CO=e=>`steprow-${e}`;var we=e=>["path",{d:e}],al=(e,t,a)=>["circle",{cx:e,cy:t,r:a}],ry={home:[we("m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"),we("M9 22V12h6v10")],tasks:[we("m3 17 2 2 4-4"),we("m3 7 2 2 4-4"),we("M13 6h8"),we("M13 12h8"),we("M13 18h8")],flows:[["rect",{x:3,y:3,width:8,height:8,rx:2}],we("M7 11v4a2 2 0 0 0 2 2h4"),["rect",{x:13,y:13,width:8,height:8,rx:2}]],agents:[we("M12 8V4H8"),["rect",{x:4,y:8,width:16,height:12,rx:2}],we("M2 14h2"),we("M20 14h2"),we("M15 13v2"),we("M9 13v2")],projects:[we("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],settings:[we("M21 4h-7"),we("M10 4H3"),we("M21 12h-9"),we("M8 12H3"),we("M21 20h-5"),we("M12 20H3"),we("M14 2v4"),we("M8 10v4"),we("M16 18v4")],pen:[we("M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z")],arrow:[we("M5 12h14"),we("m12 5 7 7-7 7")],plus:[we("M12 5v14"),we("M5 12h14")],send:[we("M12 19V5"),we("m5 12 7-7 7 7")],stop:[["rect",{x:6,y:6,width:12,height:12,rx:2}]],x:[we("M18 6 6 18"),we("m6 6 12 12")],back:[we("m15 18-6-6 6-6")],menu:[we("M4 6h16"),we("M4 12h16"),we("M4 18h16")],search:[al(11,11,7),we("m20 20-3.5-3.5")],chevron:[we("m6 9 6 6 6-6")],check:[we("M20 6 9 17l-5-5")],alert:[al(12,12,9),we("M12 8v4"),we("M12 16h.01")],more:[al(5,12,1),al(12,12,1),al(19,12,1)],file:[we("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),we("M14 3v5h5")],minus:[we("M5 12h14")],fit:[we("M15 3h6v6"),we("M9 21H3v-6"),we("M21 3l-7 7"),we("M3 21l7-7")],bolt:[we("M13 2 4 14h7l-1 8 9-12h-7z")],code:[we("m16 18 6-6-6-6"),we("m8 6-6 6 6 6")],sun:[al(12,12,4),we("M12 2v2"),we("M12 20v2"),we("m4.93 4.93 1.41 1.41"),we("m17.66 17.66 1.41 1.41"),we("M2 12h2"),we("M20 12h2"),we("m6.34 17.66-1.41 1.41"),we("m19.07 4.93-1.41 1.41")],cpu:[["rect",{x:4,y:4,width:16,height:16,rx:2}],["rect",{x:9,y:9,width:6,height:6,rx:1}],we("M15 2v2"),we("M15 20v2"),we("M2 15h2"),we("M2 9h2"),we("M20 15h2"),we("M20 9h2"),we("M9 2v2"),we("M9 20v2")],bell:[we("M10.27 21a2 2 0 0 0 3.46 0"),we("M3.26 15.33A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.67C19.41 13.96 18 12.5 18 8A6 6 0 0 0 6 8c0 4.5-1.41 5.96-2.74 7.33")],shield:[we("M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z")],folder:[we("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],people:[we("M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"),al(9,7,4),we("M22 21v-2a4 4 0 0 0-3-3.87"),we("M16 3.13a4 4 0 0 1 0 7.75")],coin:[al(12,12,10),we("M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"),we("M12 18V6")],monitor:[["rect",{x:2,y:3,width:20,height:14,rx:2}],we("M8 21h8"),we("M12 17v4")],list:[we("M8 6h13"),we("M8 12h13"),we("M8 18h13"),we("M3 6h.01"),we("M3 12h.01"),we("M3 18h.01")],board:[["rect",{x:3,y:3,width:18,height:18,rx:2}],we("M9 3v18"),we("M15 3v18")],panel:[["rect",{x:3,y:3,width:18,height:18,rx:2}],we("M15 3v18")],server:[["rect",{x:2,y:2,width:20,height:8,rx:2}],["rect",{x:2,y:14,width:20,height:8,rx:2}],we("M6 6h.01"),we("M6 18h.01")]};var NO=O(Z(),1);function at({name:e,small:t=!1}){return(0,NO.jsx)("svg",{className:Je("k-i",t&&"k-i-sm"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:ry[e].map((a,n)=>(0,LO.createElement)(a[0],{key:n,...a[1]}))})}var Bn=O(Z(),1);function de({variant:e="outline",sm:t,iconOnly:a,lead:n,label:o,docked:r,busy:s,className:i,type:l="button",...u}){return(0,Bn.jsx)("button",{type:l,className:Je("k-btn",`k-btn-${e}`,t&&"k-btn-sm",a&&"k-btn-icon",r&&"k-docked",s&&"busy",i),"aria-label":a?o:void 0,title:a?o:void 0,"aria-busy":s?!0:void 0,...u,children:a?(0,Bn.jsx)(at,{name:a}):(0,Bn.jsx)("span",{className:"k-face",children:s?(0,Bn.jsxs)(Bn.Fragment,{children:[(0,Bn.jsx)("span",{className:"k-spin","aria-hidden":"true"}),s]}):(0,Bn.jsxs)(Bn.Fragment,{children:[n&&(0,Bn.jsx)(at,{name:n,small:!0}),o]})})})}function He({variant:e="outline",sm:t,label:a,lead:n,className:o,...r}){return(0,Bn.jsx)("a",{className:Je("k-btn",`k-btn-${e}`,t&&"k-btn-sm",o),...r,children:(0,Bn.jsxs)("span",{className:"k-face",children:[n&&(0,Bn.jsx)(at,{name:n,small:!0}),a]})})}var sy=O(Z(),1);function Oe({word:e,tone:t="",dot:a=!0}){return(0,sy.jsx)("span",{className:Je("k-chip",t,!a&&"nodot"),children:e})}var um=({status:e})=>(0,sy.jsx)(Oe,{word:lm[e].word,tone:lm[e].tone});function JS({headline:e}){let{word:t,tone:a}=yO(e);return(0,sy.jsx)(Oe,{word:t,tone:a})}var IO=O(Z(),1);function Lt({n:e,ink:t=!1}){return(0,IO.jsx)("span",{className:Je("k-count",t&&e>0&&"ink",e===0&&"zero"),children:e})}var iy=O(Z(),1);function TO({label:e,current:t,items:a,onChange:n}){let o=(r,s)=>{if(r.key!=="ArrowRight"&&r.key!=="ArrowLeft")return;let i=a[(s+(r.key==="ArrowRight"?1:a.length-1))%a.length];i&&(n(i.key),r.currentTarget.parentElement?.querySelector(`[data-k-tab="${CSS.escape(i.key)}"]`)?.focus())};return(0,iy.jsx)("div",{className:"k-tabs",role:"tablist","aria-label":e,children:a.map((r,s)=>(0,iy.jsxs)("button",{type:"button",role:"tab","data-k-tab":r.key,"aria-selected":r.key===t,tabIndex:r.key===t?0:-1,onClick:()=>n(r.key),onKeyDown:i=>o(i,s),children:[r.label,r.count]},r.key))})}var xd=O(Z(),1);function ss({label:e,current:t,items:a,onChange:n}){return(0,xd.jsx)("div",{className:"k-seg",role:"group","aria-label":e,children:a.map(o=>(0,xd.jsxs)("button",{type:"button","aria-pressed":o.key===t,onClick:()=>n(o.key),children:[o.label,o.count]},o.key))})}function vu({label:e,current:t,items:a,icons:n}){return(0,xd.jsx)("nav",{className:Je("k-seg",n&&"k-seg-icons"),"aria-label":e,children:a.map(o=>(0,xd.jsxs)("a",{href:o.href,"aria-current":o.key===t?"page":void 0,...n?{"aria-label":o.label,title:o.label}:{},children:[n&&o.icon?o.icon:o.label,o.count]},o.key))})}var ly=O(Z(),1);function Lr({items:e,sm:t,wide:a,className:n,...o}){return(0,ly.jsx)("span",{className:Je("k-selw",t&&"sm",a&&"wide",n),children:(0,ly.jsx)("select",{className:"k-sel",...o,children:e.map(r=>{let[s,i]=typeof r=="string"?[r,r]:r;return(0,ly.jsx)("option",{value:s,children:i},s)})})})}var RO=O(Z(),1);var AO=O(Z(),1);var Vs=O(Z(),1);function EO({name:e,legend:t,current:a,items:n,onChange:o}){return(0,Vs.jsxs)("fieldset",{className:"k-radios",children:[(0,Vs.jsx)("legend",{className:"k-sr",children:t}),n.map(r=>(0,Vs.jsxs)("label",{className:"k-opt",children:[(0,Vs.jsx)("input",{type:"radio",name:e,value:r.value,checked:r.value===a,onChange:()=>o(r.value)}),(0,Vs.jsxs)("span",{children:[(0,Vs.jsx)("b",{children:r.label}),r.text&&(0,Vs.jsx)("span",{children:r.text})]}),r.tag]},r.value))]})}var MO=O(Z(),1),is=({children:e})=>(0,MO.jsx)("div",{className:"k-acts",children:e});var DO=O(ve(),1),bd=O(Z(),1);function e1({rows:e}){return(0,bd.jsx)("dl",{className:"k-facts",children:e.map(([t,a])=>(0,bd.jsxs)(DO.Fragment,{children:[(0,bd.jsx)("dt",{children:t}),(0,bd.jsx)("dd",{children:a})]},t))})}var yu=O(Z(),1),ln=({children:e})=>(0,yu.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,yu.jsx)(at,{name:"alert",small:!0}),(0,yu.jsx)("span",{children:e})]}),js=({children:e})=>(0,yu.jsx)("p",{className:"k-notice info",children:e}),xa=({children:e})=>(0,yu.jsx)("p",{className:"k-note",children:e});var cm=O(Z(),1);function Na({title:e,text:t,action:a}){return(0,cm.jsxs)("div",{className:"k-empty",children:[(0,cm.jsx)("p",{className:"k-empty-t",children:e}),t&&(0,cm.jsx)("p",{className:"k-empty-x",children:t}),a]})}var uy=O(Z(),1);function un({summary:e,children:t,open:a,onToggle:n}){return(0,uy.jsxs)("details",{className:"k-disclose",open:a,onToggle:n===void 0?void 0:o=>n(o.currentTarget.open),children:[(0,uy.jsx)("summary",{children:e}),t]})}var zn=O(Z(),1),Io=({label:e,count:t,right:a,id:n})=>(0,zn.jsxs)("h2",{className:"k-grp",id:n,children:[e,t,a!==void 0&&(0,zn.jsxs)(zn.Fragment,{children:[(0,zn.jsx)("span",{className:"k-grow"}),a]})]});function xn({href:e,chip:t,title:a,desc:n,meta:o,action:r,wait:s,message:i}){return(0,zn.jsxs)("div",{className:Je("k-row",s&&"wait",e===void 0&&"k-row-static"),children:[(0,zn.jsx)("span",{className:"k-row-c",children:t}),e===void 0?(0,zn.jsx)("span",{className:"k-row-t",children:a}):(0,zn.jsx)("a",{className:"k-row-t",href:e,children:a}),(0,zn.jsx)("span",{className:"k-row-d",children:n}),(0,zn.jsx)("span",{className:"k-row-m",children:o}),(0,zn.jsx)("span",{className:"k-row-a",children:r}),i&&(0,zn.jsx)("div",{className:"k-row-msg",children:i})]})}var bn=O(Z(),1);function cy({title:e,back:t,trailing:a}){return(0,bn.jsxs)("header",{className:"k-ph",children:[t&&(0,bn.jsx)("a",{className:"k-btn k-btn-ghost k-btn-icon",href:t,"aria-label":"Back",title:"Back",children:(0,bn.jsx)(at,{name:"back"})}),(0,bn.jsx)("p",{className:"k-ph-t",children:e}),a]})}function so({title:e,ctx:t,right:a,back:n,phoneTitle:o,trailing:r}){return(0,bn.jsxs)(bn.Fragment,{children:[(0,bn.jsx)(cy,{title:o??e,...n?{back:n}:{},trailing:r}),(0,bn.jsxs)("div",{className:"k-tb",children:[(0,bn.jsx)("h1",{children:e}),t&&(0,bn.jsx)("span",{className:"k-tb-ctx",children:t}),a&&(0,bn.jsxs)(bn.Fragment,{children:[(0,bn.jsx)("span",{className:"k-grow"}),a]})]})]})}var Xo=O(Z(),1);function dm({title:e,back:t,meta:a,right:n,same:o}){return(0,Xo.jsxs)(Xo.Fragment,{children:[t&&(0,Xo.jsxs)("a",{className:"k-backlink",href:t[0],children:[(0,Xo.jsx)(at,{name:"back",small:!0}),t[1]]}),(0,Xo.jsxs)("header",{className:"k-dh",children:[(0,Xo.jsxs)("div",{children:[(0,Xo.jsx)("h1",{className:o?"k-same":void 0,children:e}),a&&(0,Xo.jsx)("p",{className:"k-dh-meta",children:a})]}),n]})]})}var _O=({children:e})=>(0,Xo.jsx)("div",{className:"k-doc",children:e});var Ks=O(ve(),1),eB=O(_o(),1);var ls="form.k-sform",pm=e=>HTMLFormElement.prototype.getAttribute.call(e,"id")??"",MG=e=>Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(e),PO="http://www.w3.org/2000/svg",Ws=e=>e.querySelector("[data-k-proof]"),us=e=>e.querySelector("[data-k-save]"),FO=e=>new Set(Array.from(Ws(e)?.querySelectorAll("input[name]")??[]).map(t=>t.name));function fy(e,t=null){let a=FO(e),n;try{n=t?new FormData(e,t):new FormData(e)}catch{n=new FormData(e)}let o=[];return n.forEach((r,s)=>{!a.has(s)&&typeof r=="string"&&o.push([s,r])}),o}function s1(e){let t=new Map;for(let[a,n]of e)t.set(a,[...t.get(a)??[],n]);return t}function qO(e){let t=FO(e),a=[];for(let n of Array.from(MG(e)))!n.name||n.type==="hidden"||n.type==="submit"||n.type==="button"||t.has(n.name)||a.includes(n.name)||a.push(n.name);return a}var Nr=e=>(e??"").replace(/\s+/g," ").trim();function $O(e,t){return e.querySelector(`[name="${CSS.escape(t)}"]`)}function DG(e,t){let a=$O(e,t);if(a===null)return t;let n=a.getAttribute("aria-label");if(n)return Nr(n);if(a.type==="radio"||a.type==="checkbox"&&a.getAttribute("role")!=="switch"){let s=a.closest("fieldset")?.querySelector("legend");if(s)return Nr(s.textContent)}let o=a.closest(".k-frow")?.querySelector(".k-frow-t");if(o)return Nr(o.textContent);let r=a.labels?.[0];return r?Nr(r.querySelector(".k-sl-t, b")?.textContent??r.textContent):t}function _G(e,t,a){let n=$O(e,t);if(n instanceof HTMLSelectElement)return Nr(Array.from(n.options).find(s=>s.value===a[0])?.textContent??a[0]);if(n?.type==="radio"||n?.type==="checkbox"){let s=Array.from(e.querySelectorAll(`[name="${CSS.escape(t)}"]`));if(n.type==="checkbox"&&n.getAttribute("role")==="switch")return a.length>0?"On":"Off";let i=s.filter(l=>a.includes(l.value)).map(l=>Nr(l.labels?.[0]?.querySelector("b")?.textContent??l.labels?.[0]?.textContent??l.value));return i.length===0?"none":i.join(", ")}let o=a[0]??"";if(n?.type==="password")return o===""?"unchanged":"a new value";let r=o.split(`
|
|
52
|
+
`)}),this.event="",this.data=[];continue}if(o.startsWith(":"))continue;let r=o.indexOf(":"),s=r<0?o:o.slice(0,r),i=r<0?"":o.slice(r+1);i.startsWith(" ")&&(i=i.slice(1)),s==="event"?this.event=i:s==="data"&&this.data.push(i)}return a}},FM=()=>({fetch:(e,t)=>fetch(e,t),now:()=>Date.now(),random:()=>Math.random(),setTimeout:(e,t)=>window.setTimeout(e,t),clearTimeout:e=>window.clearTimeout(e),setInterval:(e,t)=>window.setInterval(e,t),clearInterval:e=>window.clearInterval(e),online:()=>typeof navigator>"u"||navigator.onLine!==!1,near:()=>typeof location>"u"||zW(location.hostname)});function zW(e){let t=e.replace(/^\[|\]$/g,"").toLowerCase();return t==="localhost"||t.endsWith(".localhost")||t.endsWith(".local")||t==="::1"||/^fe80:/.test(t)||/^f[cd][0-9a-f]{2}:/.test(t)||/^127\./.test(t)||/^10\./.test(t)||/^192\.168\./.test(t)||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(t)||/^169\.254\./.test(t)}function qM(){return typeof fetch=="function"&&typeof ReadableStream=="function"&&typeof TextDecoder=="function"&&typeof AbortController=="function"}function dS(e){try{let t=JSON.parse(e.data);if(t===null||typeof t!="object"||Array.isArray(t))return null;let{room:a,at:n,seq:o}=t;if(typeof a!="string")return null;let r={...t};return delete r.seq,{slot:`${a}\0${e.event}`,same:e.event==="change"&&n!==void 0?JSON.stringify(n):JSON.stringify(r),seq:typeof o=="number"&&Number.isSafeInteger(o)&&o>0?o:null}}catch{return null}}var Tv=class{constructor(t,a){this.deps=t;this.events=a}deps;events;target="";current=null;candidate=null;handoverDue=null;helloDue=null;probing=null;pings=0;heard=new Map;pingQuietUntil=0;status="idle";attempt=0;retry=null;retryAt=Number.POSITIVE_INFINITY;waiting=null;lastAttemptAt=Number.NEGATIVE_INFINITY;said=null;beat=null;lastBeatAt=0;suspendedAt=null;disposed=!1;get state(){return this.status}get wanted(){return this.target}get live(){return this.status==="live"&&this.current?.reading===!0}want(t,a=!1){if(!(this.disposed||t===this.target)){if(this.target=t,t===""){this.stop();return}if(!a&&this.candidate!==null&&this.current?.reading===!0&&!this.current.suspect&&this.current.url===t){this.dropCandidate();return}this.waiting==="refused"||this.suspendedAt!==null||this.open(a)}}retarget(t){this.disposed||t===""||(this.target=t,!(this.candidate===null||this.candidate.url===t)&&(this.dropCandidate(),this.current?.suspect===!0&&this.open(!1,!0)))}dropCandidate(){let t=this.candidate;this.candidate=null,this.endHandover(),this.abort(t)}wake(t=!1){if(this.disposed||this.target==="")return;if(this.suspendedAt!==null){this.suspendedAt=null,this.open();return}if(this.waiting!==null){let n=this.lastAttemptAt+1e3-this.deps.now();n<=0?this.open():n<this.retryAt-this.deps.now()&&this.schedule(n);return}let a=this.current;if(a===null){this.open();return}if(!(!a.reading||this.candidate!==null)){if(a.conn!==null&&this.deps.now()>=this.pingQuietUntil){this.probe(a,t);return}this.deps.now()-a.lastByteAt>a.tickMs+5e3&&this.open(!1,!0)}}offline(){this.disposed||this.target===""||this.suspendedAt!==null||this.current!==null&&this.open(!1,!0)}suspend(){this.disposed||(this.retireAll(),this.cancelRetry(),this.waiting=null,this.heard.clear(),this.suspendedAt=this.deps.now())}resume(){this.disposed||this.suspendedAt===null||(this.suspendedAt=null,this.target!==""&&this.open())}dispose(){this.stop(),this.disposed=!0}setState(t){this.status!==t&&(this.status=t,this.events.state(t))}active(t){return t===this.current||t===this.candidate}abort(t){try{t?.controller.abort()}catch{}}endHandover(){this.handoverDue!==null&&this.deps.clearTimeout(this.handoverDue),this.helloDue!==null&&this.deps.clearTimeout(this.helloDue),this.handoverDue=this.helloDue=null}retireAll(){this.endHandover(),this.endProbe();let t=[this.current,this.candidate];this.current=this.candidate=null;for(let a of t)this.abort(a)}cancelRetry(){this.retry!==null&&this.deps.clearTimeout(this.retry),this.retry=null,this.retryAt=Number.POSITIVE_INFINITY}schedule(t){this.cancelRetry(),this.retryAt=this.deps.now()+t,this.retry=this.deps.setTimeout(()=>{this.retry=null,this.retryAt=Number.POSITIVE_INFINITY,this.open()},t)}stop(){this.retireAll(),this.cancelRetry(),this.waiting=null,this.attempt=0,this.said=null,this.suspendedAt=null,this.heard.clear(),this.beat!==null&&this.deps.clearInterval(this.beat),this.beat=null,this.setState("idle")}ensureBeat(){this.beat===null&&(this.lastBeatAt=this.deps.now(),this.beat=this.deps.setInterval(()=>this.onBeat(),1e3))}onBeat(){let t=this.deps.now(),a=t-this.lastBeatAt;if(this.lastBeatAt=t,this.target==="")return;if(this.suspendedAt!==null){t-this.suspendedAt>2e3&&this.resume();return}if(a>5e3){this.wake(!0);return}let n=this.current;n?.reading===!0&&this.candidate===null&&t-n.lastByteAt>n.tickMs*2+5e3&&this.open(!1,!0)}open(t=!1,a=!1){if(this.disposed||this.target==="")return;a&&this.current!==null&&(this.current.suspect=!0),this.cancelRetry(),this.waiting=null,this.suspendedAt=null,this.endProbe(),this.lastAttemptAt=this.deps.now(),this.ensureBeat();let n={url:this.target,controller:new AbortController,reading:!1,openedAt:0,lastByteAt:0,tickMs:15e3,conn:null,helloAt:null,held:[],incarnation:null,synced:!1,suspect:!1};t||this.current===null||!this.current.reading?(this.retireAll(),this.current=n,this.setState(this.said===null&&this.attempt===0?"connecting":"reconnecting")):(this.abort(this.candidate),this.candidate=n,this.handoverDue??=this.deps.setTimeout(()=>{this.handoverDue=null,this.takeOver()},3e3),this.helloDue!==null&&this.deps.clearTimeout(this.helloDue),this.helloDue=this.deps.setTimeout(()=>{this.helloDue=null,this.candidate===n&&n.helloAt===null&&this.takeOver()},1500)),this.read(n).catch(()=>{this.active(n)&&!this.disposed&&this.events.unusable()})}takeOver(){let t=this.candidate;if(t===null)return!1;if(t.url!==this.target)return this.dropCandidate(),!1;this.endHandover(),this.endProbe();let a=this.current;return this.candidate=null,this.current=t,this.abort(a),t.reading?this.up(t):this.setState(this.said===null&&this.attempt===0?"connecting":"reconnecting"),!0}promoteIfCaughtUp(t){if(t!==this.candidate||!t.synced)return;let a=new Map;for(let o of t.held){let r=dS(o);if(r===null)continue;let s=a.get(r.slot);a.set(r.slot,r.seq===null?s??null:Math.max(s??0,r.seq))}let n=new Set(new URLSearchParams(t.url.slice(t.url.indexOf("?")+1)).getAll("room"));for(let[o,r]of this.heard){let[s="",i=""]=o.split("\0");if(!n.has(s)||i==="gone")continue;if(!a.has(o))return;let l=a.get(o)??null;if(l!==null&&r.seq!==null&&r.incarnation===t.incarnation&&l<r.seq)return}this.takeOver()}up(t){this.said=null,this.setState("live"),this.events.opened(t.url);let a=t.held;t.held=[];let n=a.map(dS),o=new Map;n.forEach((r,s)=>{if(r===null)return;let i=o.get(r.slot),l=i===void 0?null:n[i]?.seq??null;(i===void 0||r.seq===null||l===null||r.seq>=l)&&o.set(r.slot,s)});for(let[r,s]of a.entries()){if(this.current!==t)return;let i=n[r]??null;i!==null&&o.get(i.slot)!==r||this.apply(t,s)}}apply(t,a){let n=dS(a);if(n!==null){let o=this.heard.get(n.slot);if(o!==void 0&&(n.seq!==null&&o.seq!==null&&o.incarnation===t.incarnation&&n.seq<=o.seq||o.same===n.same))return;this.heard.set(n.slot,{same:n.same,incarnation:t.incarnation,seq:n.seq})}try{this.events.frame(a.event,a.data)}catch(o){queueMicrotask(()=>{throw o})}}async read(t){let a;try{a=await this.deps.fetch(t.url,{headers:{accept:"text/event-stream",[OW]:"1"},credentials:"same-origin",cache:"no-store",redirect:"manual",signal:t.controller.signal})}catch{this.active(t)&&this.failed(t,"network");return}if(!this.active(t)){a.body?.cancel().catch(()=>{});return}if(a.type==="opaqueredirect"||a.status===401||a.status===403){a.body?.cancel().catch(()=>{}),this.failed(t,"refused");return}if(!a.ok||!(a.headers.get("content-type")??"").startsWith("text/event-stream")){a.body?.cancel().catch(()=>{}),this.failed(t,"error");return}let n=a.body;if(n===null||typeof n.getReader!="function"){this.events.unusable();return}let o=n.getReader(),r=new fS,s=new TextDecoder;t.reading=!0,t.openedAt=t.lastByteAt=this.deps.now(),t===this.current&&this.up(t);try{for(;;){if(!this.active(t)){o.cancel().catch(()=>{});return}let{done:i,value:l}=await o.read();if(!this.active(t)){o.cancel().catch(()=>{});return}if(i)break;let u=this.deps.now();t.lastByteAt=u,t===this.current&&(u-t.openedAt>=3e4&&(this.attempt=0),this.probing?.stream===t&&this.endProbe());for(let c of r.push(s.decode(l,{stream:!0})))if(!this.active(t)||!this.take(t,c))return}}catch{this.active(t)&&this.failed(t,"network");return}this.active(t)&&this.failed(t,"dropped")}take(t,a){switch(a.event){case"hello":return this.hello(t,a.data),!0;case"tick":case"pong":return!0;case"synced":return t===this.candidate&&(t.synced=!0,this.promoteIfCaughtUp(t)),!0;case"ended":return this.failed(t,"refused"),!1}return t===this.current?(this.apply(t,a),!0):(t.held.push(a),t.held.length>64?this.takeOver():this.promoteIfCaughtUp(t),!0)}hello(t,a){t.helloAt=this.deps.now();try{let n=JSON.parse(a),o=n.tick,r=n.conn,s=n.incarnation;typeof s=="string"&&s.length<=64&&(t.incarnation=s),typeof o=="number"&&Number.isFinite(o)&&o>=1e3&&o<=12e4&&(t.tickMs=o),typeof r=="string"&&BW.test(r)&&(t.conn=r)}catch{}}failed(t,a){t===this.current&&this.candidate!==null&&a!=="refused"&&this.takeOver()||this.fail(a)}probe(t,a){if(this.probing!==null)return;let n=this.deps.near(),o={stream:t,controller:new AbortController,silence:null,deadline:null};this.probing=o;let r=()=>{this.probing===o&&(this.endProbe(),this.current===t&&this.candidate===null&&this.open(!1,!0))};o.deadline=this.deps.setTimeout(r,n||a?3e3:15e3),this.pings+=1;let s;try{s=this.deps.fetch(`/live/ping?conn=${t.conn??""}&n=${this.pings}`,{credentials:"same-origin",cache:"no-store",redirect:"manual",signal:o.controller.signal})}catch{r();return}s.then(i=>{if(i.body?.cancel().catch(()=>{}),this.probing===o)if(i.status===204)o.silence=this.deps.setTimeout(r,n?500:2500);else if(i.status===429){let l=i.headers.get("retry-after"),u=l!==null&&/^[0-9]{1,6}$/.test(l.trim())?Number(l.trim()):10;this.pingQuietUntil=this.deps.now()+Math.min(60,Math.max(1,u))*1e3,o.deadline!==null&&this.deps.clearTimeout(o.deadline),o.deadline=null,o.silence=this.deps.setTimeout(r,Math.max(0,t.lastByteAt+t.tickMs+5e3-this.deps.now()))}else r()},r)}endProbe(){let t=this.probing;if(t!==null){this.probing=null,t.silence!==null&&this.deps.clearTimeout(t.silence),t.deadline!==null&&this.deps.clearTimeout(t.deadline);try{t.controller.abort()}catch{}}}fail(t){this.retireAll(),this.heard.clear();let a=t==="error"||t==="refused"?"lost":"retrying";(a==="lost"?this.said!=="lost":this.said===null)&&(this.said=a,this.events.trouble(a));let n;t==="refused"?(this.waiting="refused",n=cS(Number.POSITIVE_INFINITY,this.deps.random())):this.deps.online()?(this.waiting="backoff",n=cS(this.attempt,this.deps.random()),this.attempt+=1):(this.waiting="offline",n=cS(Number.POSITIVE_INFINITY,this.deps.random())),this.setState(this.waiting==="backoff"?"reconnecting":this.waiting==="offline"?"offline":"signed-out"),this.schedule(n)}};var Mv="so:live",UM=["change","here","gone","turn"],Rv=3e4,Av=2e3,id=(e,t,a)=>{let n=new URLSearchParams;for(let[r,s]of Object.entries(a??{}))s!=null&&s!==!1&&n.set(r,s===!0?"1":String(s));let o=n.toString();return`${e}${t==null?"":`:${encodeURIComponent(String(t))}`}${o===""?"":`?${o}`}`},HW=new Set(["workspace","summary","chat","team"]),FW=e=>e.split(/[:?]/,1)[0]??"",Ev=e=>e===""?[]:new URLSearchParams(e.slice(e.indexOf("?")+1)).getAll("room");function qW(){return typeof document>"u"?"eventsource":document.getElementById("standing-orders-workspace")?.dataset.liveReader==="stream"&&qM()?"stream":"eventsource"}var pS=class{subscriptions=new Map;next=0;source=null;url="";held=new Set;refusedAt=0;settling=null;quietUntil=0;scheduled=!1;watching=!1;quiet=!1;reader;supervisor=null;deps;connection="idle";stateListeners=new Set;hiddenSince=null;graceTimer=null;constructor(t={}){this.reader=t.reader??null,this.deps=t.deps??{}}connectionState=()=>this.connection;onConnectionState=t=>(this.stateListeners.add(t),()=>{this.stateListeners.delete(t)});setQuiet(t){this.quiet!==t&&(this.quiet=t,this.schedule())}subscribe(t,a,n=!1){let o=this.next++;return this.subscriptions.set(o,{room:t,listener:a,hidden:n}),this.schedule(),()=>{this.subscriptions.delete(o),this.schedule()}}schedule(){this.scheduled||(this.scheduled=!0,queueMicrotask(()=>{this.scheduled=!1,this.reconcile()}))}wanted(t){if(this.quiet)return"";let a=this.reader==="stream";if(a&&t&&this.hiddenSince!==null&&Date.now()-this.hiddenSince>=6e4)return"";let n=r=>!t||(a?HW.has(FW(r.room)):r.hidden),o=[...new Set([...this.subscriptions.values()].filter(n).map(r=>r.room))].sort();return o.length===0?"":`/live?${o.map(r=>`room=${encodeURIComponent(r)}`).join("&")}`}unsettle(){this.settling!==null&&window.clearTimeout(this.settling),this.settling=null}deliver(t,a){let n={};try{let r=JSON.parse(a);r!==null&&typeof r=="object"&&!Array.isArray(r)&&(n=r)}catch{}let o=typeof n.room=="string"?n.room:null;for(let r of[...this.subscriptions.values()])(o===null||r.room===o)&&r.listener(t,n);window.dispatchEvent(new CustomEvent(Mv,{detail:{room:o,event:t,data:n}}))}setConnection(t){if(this.connection!==t){this.connection=t,t==="idle"?delete document.documentElement.dataset.liveState:document.documentElement.dataset.liveState=t;for(let a of[...this.stateListeners])a()}}reconcile(){if(typeof document>"u")return;if(this.reader??=qW(),this.reader==="stream"){this.reconcileStream();return}if(typeof EventSource>"u")return;this.watching||(this.watching=!0,document.addEventListener("visibilitychange",()=>this.reconcile()),window.addEventListener("online",()=>{this.quietUntil=0,this.reconcile()}));let t=this.wanted(document.hidden);if(t===this.url&&(t===""||this.source!==null))return;let a=Ev(t);if(this.source!==null&&a.length>0&&a.length===this.held.size&&a.every(r=>this.held.has(r))){this.url=t;return}if(t!==""&&Date.now()<this.quietUntil)return;let n=Date.now()-this.refusedAt;if(this.source!==null&&t!==""&&n<Av){this.settling===null&&(this.settling=window.setTimeout(()=>{this.settling=null,this.reconcile()},Av-n));return}if(this.unsettle(),this.source?.close(),this.source=null,this.url=t,t===""){delete document.documentElement.dataset.live;return}document.documentElement.dataset.live="1";let o=new EventSource(t);this.source=o,this.held=new Set(Ev(t)),this.refusedAt=0;for(let r of UM)o.addEventListener(r,s=>{let i=s.data;r==="gone"&&this.source===o&&this.heardGone(i),this.deliver(r,i)});o.addEventListener("reload",()=>this.deliver("reload","{}")),o.addEventListener("ended",()=>{this.source===o&&(this.unsettle(),o.close(),this.source=null,this.url="",this.deliver("lost","{}"),this.quietUntil=Date.now()+Rv,window.setTimeout(()=>this.reconcile(),Rv))}),o.addEventListener("error",()=>{if(this.source===o){if(o.readyState!==EventSource.CLOSED){this.deliver("retrying","{}");return}this.source=null,this.url="",this.deliver("lost","{}"),this.quietUntil=Date.now()+Rv,window.setTimeout(()=>this.reconcile(),Rv)}})}heardGone(t){this.refusedAt=Date.now();try{let a=JSON.parse(t).room;typeof a=="string"&&this.held.delete(a)}catch{}}reconcileStream(){let t=this.supervisor??this.startSupervisor(),a=this.wanted(document.hidden);if(a===t.wanted)return;let n=Ev(a);if(t.live&&n.length>0&&n.length===this.held.size&&n.every(r=>this.held.has(r))){t.retarget(a);return}let o=Date.now()-this.refusedAt;if(t.live&&a!==""&&o<Av){this.settling===null&&(this.settling=window.setTimeout(()=>{this.settling=null,this.reconcile()},Av-o));return}this.unsettle(),a===""?delete document.documentElement.dataset.live:document.documentElement.dataset.live="1",t.want(a,document.hidden)}startSupervisor(){let t=new Tv({...FM(),...this.deps},{opened:n=>{this.held=new Set(Ev(n)),this.refusedAt=0},frame:(n,o)=>{if(n==="reload"){this.deliver("reload","{}");return}UM.includes(n)&&(n==="gone"&&this.heardGone(o),this.deliver(n,o))},trouble:n=>{this.unsettle(),this.deliver(n,"{}")},state:n=>this.setConnection(n),unusable:()=>this.fallBack()});this.supervisor=t;let a=()=>t.wake();return document.addEventListener("visibilitychange",()=>{document.hidden?(this.hiddenSince??=Date.now(),this.graceTimer===null&&(this.graceTimer=window.setTimeout(()=>{this.graceTimer=null,this.reconcile()},6e4))):(this.hiddenSince=null,this.graceTimer!==null&&window.clearTimeout(this.graceTimer),this.graceTimer=null),this.reconcile(),document.hidden||a()}),window.addEventListener("online",a),window.addEventListener("offline",()=>t.offline()),window.addEventListener("focus",a),window.addEventListener("pageshow",n=>{n.persisted?t.resume():a()}),window.addEventListener("pagehide",()=>t.suspend()),document.addEventListener("resume",a),navigator.connection?.addEventListener?.("change",a),t}fallBack(){this.reader==="stream"&&(this.supervisor?.dispose(),this.reader="eventsource",this.setConnection("idle"),this.reconcile())}},rd=new pS,$W=new Set(["workspace"]);if(typeof window<"u"){let e=window,t=n=>(typeof n=="string"&&$W.has(n)&&rd.subscribe(n,()=>{}),0),a=e.__soLiveRooms;if(Array.isArray(a))for(let n of a)t(n);e.__soLiveRooms={push:t}}function mS(e){rd.setQuiet(e)}function Dn(e,t,a=!1){let n=(0,sd.useRef)(t);n.current=t,(0,sd.useEffect)(()=>{if(e!==null)return rd.subscribe(e,(o,r)=>n.current(o,r),a)},[e,a])}function VM(e,t){return rd.subscribe(e,t)}function jM(){return(0,sd.useSyncExternalStore)(rd.onConnectionState,rd.connectionState,()=>"idle")}var Dv=O(Z(),1),UW=td("inline-flex w-fit shrink-0 items-center whitespace-nowrap font-medium [&_svg]:size-3",{variants:{tone:{neutral:"bg-neutral-soft text-neutral-ink",success:"bg-success-soft text-success",warning:"bg-neutral-soft text-foreground",attention:"bg-attention-soft text-attention",needs:"bg-wait text-on-attention",danger:"bg-destructive-soft text-destructive",info:"bg-info-soft text-info"},size:{fact:"gap-1 rounded-badge px-1.5 py-px text-[11.5px] leading-[18px]",chip:"h-5 gap-1.5 rounded-sm px-1.5 text-[11.5px] leading-none"}},compoundVariants:[{size:"chip",tone:["neutral","success","warning","attention","danger","info"],className:"text-foreground"}],defaultVariants:{tone:"neutral",size:"fact"}}),VW={neutral:"text-neutral-ink",success:"text-success",warning:"text-neutral-ink",attention:"text-attention",needs:"text-on-attention",danger:"text-danger",info:"text-info"};function Jr({className:e,tone:t,size:a,dot:n=!1,children:o,...r}){return(0,Dv.jsxs)("span",{"data-slot":"badge",className:ye(UW({tone:t,size:a}),e),...r,children:[n&&t!=="needs"&&(0,Dv.jsx)("span",{"aria-hidden":"true","data-badge-dot":!0,className:ye("size-1.5 shrink-0 rounded-full bg-current",VW[t??"neutral"])}),o]})}var WM=O(ve(),1);var KM=O(Z(),1),jW=Object.defineProperty,WW=(e,t)=>jW(e,"name",{value:t,configurable:!0}),KW=WM.forwardRef(WW(function(t,a){return(0,KM.jsx)(ta.label,{...t,ref:a,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(t.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}})},"Label")),GM=KW;var YM=O(ve(),1);var Je=(...e)=>e.filter(Boolean).join(" ");var ji=O(Z(),1);function _v({label:e,hint:t,error:a,children:n}){let o=(0,YM.useId)(),r=Je(t&&`${o}-hint`,`${o}-err`);return(0,ji.jsxs)("div",{className:"k-field",children:[(0,ji.jsx)("label",{className:"k-label",htmlFor:o,children:e}),n({id:o,describedBy:r,invalid:!!a}),t&&(0,ji.jsx)("p",{className:"k-hint",id:`${o}-hint`,children:t}),(0,ji.jsx)("span",{className:"k-err",id:`${o}-err`,role:"alert",children:a??""})]})}var _n=({className:e,...t})=>(0,ji.jsx)("input",{className:Je("k-input",e),...t}),ld=({className:e,...t})=>(0,ji.jsx)("textarea",{className:Je("k-textarea",e),...t});var Pv=O(Z(),1);function au({className:e,...t}){return(0,Pv.jsx)(GM,{"data-slot":"label",className:ye("flex items-center gap-2 text-sm font-medium leading-none",e),...t})}function ze({className:e,...t}){return(0,Pv.jsx)(_n,{"data-slot":"input",className:e,...t})}function Gt({className:e,...t}){return(0,Pv.jsx)(ld,{"data-slot":"textarea",className:e,...t})}var Ov=O(ve(),1);var XM=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function ZM(e,t,a=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:XM(e),size:24,node:t,...a.length>0?{aliases:a}:{}}}var QM=e=>{let t="",a=!1;for(let n of e){if(n==="-"||n==="_"||n<=" "){a=t.length>0;continue}t.length===0?t+=n.toLowerCase():t+=a?n.toUpperCase():n,a=!1}return t};var JM=e=>{let t=QM(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Cp=O(ve(),1);var Sp=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var Wi={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"};function hS(e){return e!=null}function eD(e,t={}){let a=t.attributeNames??{},n=d=>a[d]??d,o=e.size??e.width??Wi.width,r=e.size??e.height??Wi.height,s=e.aliases?.filter(d=>typeof d=="string"&&d.trim()!=="").map(d=>`lucide-${d}`)??[],i=[...e.name?[`lucide-${e.name}`]:[],...s],l=t.className?.split(" ").filter(Boolean)??[],u=t.includeDefaultClasses===!1?Sp(...l):Sp("lucide",...i,...l),c=t.absoluteStrokeWidth?Number(t.strokeWidth??Wi["stroke-width"])*Number(e.size??e.width??Wi.width)/Number(t.size??t.width??Wi.width):t.strokeWidth??Wi["stroke-width"];return["svg",{...Object.entries(Wi).reduce((d,[m,h])=>(d[n(m)]=h,d),{}),..."color"in t&&t.color&&{[n("stroke")]:t.color},..."size"in t&&hS(t.size)&&{[n("width")]:t.size,[n("height")]:t.size},..."width"in t&&hS(t.width)&&{[n("width")]:t.width},..."height"in t&&hS(t.height)&&{[n("height")]:t.height},[n("stroke-width")]:c,...u&&{[n("class")]:u},[n("viewBox")]:`0 0 ${o} ${r}`,...t.hasA11yProp===!1?{[n("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(d=>{let[m,h,y]=d,w=t.nonScalingStroke?{[n("vector-effect")]:"non-scaling-stroke",...h}:h;return y?[m,w,y]:[m,w]})]}function tD(e,t={}){return eD(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var aD=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var ud=O(ve(),1);var YW=(0,ud.createContext)({});var nD=()=>(0,ud.useContext)(YW);var oD=(0,Cp.forwardRef)(({color:e,size:t,width:a,height:n,strokeWidth:o,absoluteStrokeWidth:r,nonScalingStroke:s,className:i="",children:l,iconNode:u=[],icon:c={node:u,aliases:[],size:24},...f},d)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:y=!1,nonScalingStroke:w=!1,color:v="currentColor",className:x=""}=nD()??{},g=!!l||aD(f),[b,k,C=[]]=tD(c,{color:e??v,width:a??t??m,height:n??t??m,strokeWidth:o??h,absoluteStrokeWidth:r??y,nonScalingStroke:s??w,className:Sp(x,i),hasA11yProp:g,attributes:f});return(0,Cp.createElement)(b,{ref:d,...k},[...C.map(([N,L])=>(0,Cp.createElement)(N,L)),...Array.isArray(l)?l:[l]])});function Ie(e,t=[],a=[]){let n=typeof e=="string"?ZM(e,t,a):e,o=(0,Ov.forwardRef)(({className:r,...s},i)=>(0,Ov.createElement)(oD,{ref:i,icon:n,className:r,...s}));return n.name&&(o.displayName=JM(n.name)),o}var rD={name:"bell-off",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]};rD.node;var Lp=Ie(rD);var sD={name:"bell",size:24,node:[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]};sD.node;var Np=Ie(sD);var iD={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};iD.node;var Ip=Ie(iD);var lD={name:"calendar-clock",size:24,node:[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v3",key:"otl347"}],["path",{d:"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338",key:"7hb8p4"}],["path",{d:"M3 9h5.859",key:"numkqi"}],["path",{d:"M8 2v3",key:"1ioesn"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]};lD.node;var Tp=Ie(lD);var uD={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};uD.node;var qs=Ie(uD);var cD={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};cD.node;var Rp=Ie(cD);var dD={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};dD.node;var Ap=Ie(dD);var fD={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};fD.node;var Ep=Ie(fD);var pD={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};pD.node;var Mp=Ie(pD);var mD={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};mD.node;var Dp=Ie(mD);var hD={name:"flag",size:24,node:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]};hD.node;var _p=Ie(hD);var gD={name:"git-pull-request",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]]};gD.node;var cd=Ie(gD);var vD={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};vD.node;var Pp=Ie(vD);var yD={name:"hammer",size:24,node:[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]};yD.node;var Op=Ie(yD);var wD={name:"hourglass",size:24,node:[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]};wD.node;var Bp=Ie(wD);var xD={name:"inbox",size:24,node:[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]};xD.node;var zp=Ie(xD);var bD={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};bD.node;var dd=Ie(bD);var kD={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};kD.node;var fd=Ie(kD);var SD={name:"megaphone",size:24,node:[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]]};SD.node;var Hp=Ie(SD);var CD={name:"message-square-reply",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m10 8-3 3 3 3",key:"fp6dz7"}],["path",{d:"M17 14v-1a2 2 0 0 0-2-2H7",key:"1tkjnz"}]]};CD.node;var Fp=Ie(CD);var LD={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};LD.node;var pd=Ie(LD);var ND={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};ND.node;var qp=Ie(ND);var ID={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],aliases:["edit-3"]};ID.node;var Ki=Ie(ID);var TD={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};TD.node;var vr=Ie(TD);var RD={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};RD.node;var $p=Ie(RD);var AD={name:"send",size:24,node:[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]};AD.node;var Up=Ie(AD);var ED={name:"signpost",size:24,node:[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M2.354 10.354a1.207 1.207 0 0 1 0-1.708l2.06-2.06A2 2 0 0 1 5.828 6h12.344a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H5.828a2 2 0 0 1-1.414-.586z",key:"1tm261"}]]};ED.node;var Vp=Ie(ED);var MD={name:"split",size:24,node:[["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"M8 3H3v5",key:"15dfkv"}],["path",{d:"M12 22v-8.3a4 4 0 0 0-1.172-2.872L3 3",key:"1qrqzj"}],["path",{d:"m15 9 6-6",key:"ko1vev"}]]};MD.node;var md=Ie(MD);var DD={name:"square-kanban",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]],aliases:["kanban-square"]};DD.node;var Gi=Ie(DD);var _D={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};_D.node;var Pn=Ie(_D);var PD={name:"user-check",size:24,node:[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]};PD.node;var jp=Ie(PD);var OD={name:"webhook",size:24,node:[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]};OD.node;var Wp=Ie(OD);var BD={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};BD.node;var Kp=Ie(BD);var zD={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};zD.node;var Gp=Ie(zD);var HD={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};HD.node;var no=Ie(HD);var FD={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};FD.node;var hd=Ie(FD);var Zs=O(ve(),1);var Yo=O(ve(),1);var UD=Symbol("html"),Yp=class{#e;constructor(t,a){if(t!==UD)throw new TypeError("Html is made by html`…`");this.#e=a}static markupOf(t){return t.#e}toString(){if(qD)throw new Error("Html coerced to a string: interpolate it with html`…` or hand it to a sink");return this.#e}toJSON(){if(qD)throw new Error("Html serialized as JSON: convert it with htmlString() first");return this.#e}},qD=typeof process<"u"&&process.env.VITEST!==void 0,XW=e=>new Yp(UD,e);var ZW={"&":"&","<":"<",">":">",'"':""","'":"'"},QW=e=>e.replace(/[&<>"']/g,t=>ZW[t]);function VD(e){if(e==null||typeof e=="boolean")return"";if(e instanceof Yp)return Yp.markupOf(e);if(Array.isArray(e))return e.map(VD).join("");if(typeof e=="string")return QW(e);if(typeof e=="number"||typeof e=="bigint")return String(e);throw new TypeError(`html: cannot interpolate ${typeof e}`)}var $D=new WeakSet,JW=/<form\b[^>]*\bmethod\s*=\s*["']?post\b/i,eK=/\bname\s*=\s*["']?csrf\b/i;function tK(e){if($D.has(e))return;let t=e.join("\0");if(JW.test(t))throw new Error("html: write POST forms with postForm, which adds the CSRF field");if(eK.test(t))throw new Error("html: postForm adds the CSRF field; don't write one");$D.add(e)}function Yi(e,...t){tK(e);let a=e[0];for(let n=0;n<t.length;n++)a+=VD(t[n])+e[n+1];return XW(a)}var aK=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nK=864e5,jD=new Map;function oK(e){let t=jD.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{timeZone:e,year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}),jD.set(e,t)),t}function gS(e,t){let a=o=>Object.fromEntries(oK(o).formatToParts(e).map(r=>[r.type,r.value])),n;try{n=a(t)}catch{n=a("UTC")}return{year:Number(n.year),month:Number(n.month),day:Number(n.day),clock:`${n.hour}:${n.minute}`}}var WD=e=>Math.floor(Date.UTC(e.year,e.month-1,e.day)/nK);function No(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function yr(e,t=new Date,a="UTC",n=!1){let o=new Date(e);if(Number.isNaN(o.getTime()))return e;let r=gS(o,a),s=gS(t,a),i=WD(r)-WD(s);if(i===0)return r.clock;if(i===-1)return`Yesterday ${r.clock}`;if(i===1)return`Tomorrow ${r.clock}`;let l=`${aK[r.month-1]} ${r.day}`;return`${r.year===s.year?l:`${l} ${r.year}`}${n?` ${r.clock}`:""}`}function Bv(e,t=new Date,a=No()){if(Number.isNaN(new Date(e.at).getTime()))return e.label;let n=yr(e.at,t,a,!0);return/^(?:\d|Tomorrow|Yesterday)/.test(n)?`${e.label} ${n}`:`${e.label.replace(/ at$/,"")} ${n}`}function KD(e,t=new Date){let a=new Date(e).getTime();if(Number.isNaN(a))return"";let n=Math.max(0,Math.floor((t.getTime()-a)/6e4));if(n<1)return"now";if(n<60)return`${n}m`;let o=Math.floor(n/60);return o<24?`${o}h`:`${Math.floor(o/24)}d`}function nu(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=gS(a,t);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")} ${n.clock}${t==="UTC"?" UTC":""}`}function GD(e,t=new Date,a=No()){e.querySelectorAll("time[data-when][datetime]").forEach(n=>{let o=n.getAttribute("datetime")??"";if(o===""||Number.isNaN(new Date(o).getTime()))return;if(n.getAttribute("data-when")==="exact"){let i=rK(o,a);n.textContent!==i&&(n.textContent=i);return}let r=yr(o,t,a),s=nu(o,a);n.title!==s&&(n.title=s),n.textContent!==r&&(n.textContent=r)})}function rK(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=String(a.getUTCSeconds()).padStart(2,"0"),o=nu(e,t);return t==="UTC"?o.replace(/ UTC$/,`:${n} UTC`):`${o}:${n}`}var Xi=O(Z(),1),vS=!1;function wS(){vS||(vS=!0,queueMicrotask(()=>{vS=!1,GD(document),window.dispatchEvent(new CustomEvent("standing-orders:workspace-rendered"))}))}var yS="form.approve-form, form.k-approve",sK=["form.approve-form","form.k-approve"].flatMap(e=>[`${e} button[type="submit"]`,`${e} input[type="submit"]`]).join(", ");function YD(e){return e.contains(document.activeElement)&&document.activeElement?.matches("input, textarea, select, [contenteditable=true]")===!0||e.querySelector(`${yS}, details[open] form`)!==null}function Ct({html:e,immutable:t=!1,className:a=""}){let n=(0,Yo.useRef)(null),o=(0,Yo.useRef)(null),r=(0,Yo.useRef)(!1),[s,i]=(0,Yo.useState)(0),[l,u]=(0,Yo.useState)(!1),[c,f]=(0,Yo.useState)(!1);return(0,Yo.useEffect)(()=>{let d=n.current,m=()=>i(h=>h+1);return d?.addEventListener("toggle",m,!0),()=>d?.removeEventListener("toggle",m,!0)},[]),(0,Yo.useLayoutEffect)(()=>{let d=n.current;if(!d||o.current===e||t&&o.current!==null)return;if(o.current!==null&&(r.current||YD(d))){let y=d.querySelector("[data-approval]"),w=new DOMParser().parseFromString(e,"text/html").querySelector("[data-approval]");!!d.querySelector(yS)&&y?.dataset.approval!==w?.dataset.approval?(u(!0),d.querySelectorAll(sK).forEach(x=>{x.disabled=!0})):d.querySelector(yS)||f(!0);return}let m=o.current===null;d.innerHTML=e,o.current=e;let h=m?d.querySelector("[autofocus]"):null;h!==null&&(document.activeElement===null||document.activeElement===document.body)&&h.focus(),f(!1),wS()},[e,t,s]),(0,Xi.jsxs)("div",{className:`so-native-region ${a}`,"data-workspace-native":!0,children:[l&&(0,Xi.jsxs)(Mn,{tone:"error",children:["The plan changed. ",(0,Xi.jsx)("a",{href:window.location.href,children:"Review the current plan"})," before approving."]}),c&&(0,Xi.jsxs)("p",{className:"so-deferred",role:"status",children:["Updates are available. Your form is preserved. ",(0,Xi.jsx)("a",{href:window.location.href,children:"Reload"})]}),(0,Xi.jsx)("div",{ref:n,onInput:()=>{r.current=!0},onChange:()=>{r.current=!0},onBlur:()=>i(d=>d+1)})]})}var XD=O(Z(),1);function ou({className:e,...t}){return(0,XD.jsx)("section",{"data-slot":"card",className:ye("flex flex-col gap-4 rounded-card border border-border bg-card p-5 text-card-foreground phone:gap-3 phone:p-3.5",e),...t})}var Wa=O(ve(),1);var wr=O(ve(),1);var zv=O(Z(),1),oo=O(ve(),1);var ru=O(Z(),1),iK=Object.defineProperty,ja=(e,t)=>iK(e,"name",{value:t,configurable:!0});function Xp(e){let t=e+"CollectionProvider",[a,n]=An(t),[o,r]=a(t,{collectionRef:{current:null},itemMap:new Map}),s=ja(y=>{let{scope:w,children:v}=y,x=wr.useRef(null),g=wr.useRef(new Map).current;return(0,zv.jsx)(o,{scope:w,itemMap:g,collectionRef:x,children:v})},"CollectionProvider");s.displayName=t;let i=e+"CollectionSlot",l=Jn(i),u=wr.forwardRef((y,w)=>{let{scope:v,children:x}=y,g=r(i,v),b=At(w,g.collectionRef);return(0,zv.jsx)(l,{ref:b,children:x})});u.displayName=i;let c=e+"CollectionItemSlot",f="data-radix-collection-item",d=Jn(c),m=wr.forwardRef((y,w)=>{let{scope:v,children:x,...g}=y,b=wr.useRef(null),k=At(w,b),C=r(c,v);return wr.useEffect(()=>(C.itemMap.set(b,{ref:b,...g}),()=>{C.itemMap.delete(b)})),(0,zv.jsx)(d,{[f]:"",ref:k,children:x})});m.displayName=c;function h(y){let w=r(e+"CollectionConsumer",y);return wr.useCallback(()=>{let x=w.collectionRef.current;if(!x)return[];let g=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(w.itemMap.values()).sort((C,N)=>g.indexOf(C.ref.current)-g.indexOf(N.ref.current))},[w.collectionRef,w.itemMap])}return ja(h,"useCollection"),[{Provider:s,Slot:u,ItemSlot:m},h,n]}ja(Xp,"createCollection");var ZD=new WeakMap,xS=class Zi extends Map{static{ja(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],ZD.set(this,!0)}set(t,a){return ZD.get(this)&&(this.has(t)?this.#e[this.#e.indexOf(t)]=t:this.#e.push(t)),super.set(t,a),this}insert(t,a,n){let o=this.has(a),r=this.#e.length,s=kS(t),i=s>=0?s:r+s,l=i<0||i>=r?-1:i;if(l===this.size||o&&l===this.size-1||l===-1)return this.set(a,n),this;let u=this.size+(o?0:1);s<0&&i++;let c=[...this.#e],f,d=!1;for(let m=i;m<u;m++)if(i===m){let h=c[m];c[m]===a&&(h=c[m+1]),o&&this.delete(a),f=this.get(h),this.set(a,n)}else{!d&&c[m-1]===a&&(d=!0);let h=c[d?m:m-1],y=f;f=this.get(h),this.delete(h),this.set(h,y)}return this}with(t,a,n){let o=new Zi(this);return o.insert(t,a,n),o}before(t){let a=this.#e.indexOf(t)-1;if(!(a<0))return this.entryAt(a)}setBefore(t,a,n){let o=this.#e.indexOf(t);return o===-1?this:this.insert(o,a,n)}after(t){let a=this.#e.indexOf(t);if(a=a===-1||a===this.size-1?-1:a+1,a!==-1)return this.entryAt(a)}setAfter(t,a,n){let o=this.#e.indexOf(t);return o===-1?this:this.insert(o+1,a,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(t){let a=super.delete(t);return a&&this.#e.splice(this.#e.indexOf(t),1),a}deleteAt(t){let a=this.keyAt(t);return a!==void 0?this.delete(a):!1}at(t){let a=Hv(this.#e,t);if(a!==void 0)return this.get(a)}entryAt(t){let a=Hv(this.#e,t);if(a!==void 0)return[a,this.get(a)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Hv(this.#e,t)}from(t,a){let n=this.indexOf(t);if(n===-1)return;let o=n+a;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.at(o)}keyFrom(t,a){let n=this.indexOf(t);if(n===-1)return;let o=n+a;return o<0&&(o=0),o>=this.size&&(o=this.size-1),this.keyAt(o)}find(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return o;n++}}findIndex(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return n;n++}return-1}filter(t,a){let n=[],o=0;for(let r of this)Reflect.apply(t,a,[r,o,this])&&n.push(r),o++;return new Zi(n)}map(t,a){let n=[],o=0;for(let r of this)n.push([r[0],Reflect.apply(t,a,[r,o,this])]),o++;return new Zi(n)}reduce(...t){let[a,n]=t,o=0,r=n??this.at(0);for(let s of this)o===0&&t.length===1?r=s:r=Reflect.apply(a,this,[r,s,o,this]),o++;return r}reduceRight(...t){let[a,n]=t,o=n??this.at(-1);for(let r=this.size-1;r>=0;r--){let s=this.at(r);r===this.size-1&&t.length===1?o=s:o=Reflect.apply(a,this,[o,s,r,this])}return o}toSorted(t){let a=[...this.entries()].sort(t);return new Zi(a)}toReversed(){let t=new Zi;for(let a=this.size-1;a>=0;a--){let n=this.keyAt(a),o=this.get(n);t.set(n,o)}return t}toSpliced(...t){let a=[...this.entries()];return a.splice(...t),new Zi(a)}slice(t,a){let n=new Zi,o=this.size-1;if(t===void 0)return n;t<0&&(t=t+this.size),a!==void 0&&a>0&&(o=a-1);for(let r=t;r<=o;r++){let s=this.keyAt(r),i=this.get(s);n.set(s,i)}return n}every(t,a){let n=0;for(let o of this){if(!Reflect.apply(t,a,[o,n,this]))return!1;n++}return!0}some(t,a){let n=0;for(let o of this){if(Reflect.apply(t,a,[o,n,this]))return!0;n++}return!1}};function Hv(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=QD(e,t);return a===-1?void 0:e[a]}ja(Hv,"at");function QD(e,t){let a=e.length,n=kS(t),o=n>=0?n:a+n;return o<0||o>=a?-1:o}ja(QD,"toSafeIndex");function kS(e){return e!==e||e===0?0:Math.trunc(e)}ja(kS,"toSafeInteger");function lK(e){let t=e+"CollectionProvider",[a,n]=An(t),[o,r]=a(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new xS,setItemMap:ja(()=>{},"setItemMap")}),s=ja(({state:g,...b})=>g?(0,ru.jsx)(l,{...b,state:g}):(0,ru.jsx)(i,{...b}),"CollectionProvider");s.displayName=t;let i=ja(g=>{let b=w();return(0,ru.jsx)(l,{...g,state:b})},"CollectionInit");i.displayName=t+"Init";let l=ja(g=>{let{scope:b,children:k,state:C}=g,N=oo.useRef(null),[L,A]=oo.useState(null),P=At(N,A),[F,B]=C;return oo.useEffect(()=>{if(!L)return;let H=t_(()=>{});return H.observe(L,{childList:!0,subtree:!0}),()=>{H.disconnect()}},[L]),(0,ru.jsx)(o,{scope:b,itemMap:F,setItemMap:B,collectionRef:P,collectionRefObject:N,collectionElement:L,children:k})},"CollectionProviderImpl");l.displayName=t+"Impl";let u=e+"CollectionSlot",c=Jn(u),f=oo.forwardRef((g,b)=>{let{scope:k,children:C}=g,N=r(u,k),L=At(b,N.collectionRef);return(0,ru.jsx)(c,{ref:L,children:C})});f.displayName=u;let d=e+"CollectionItemSlot",m="data-radix-collection-item",h=Jn(d),y=oo.forwardRef((g,b)=>{let{scope:k,children:C,...N}=g,L=oo.useRef(null),[A,P]=oo.useState(null),F=At(b,L,P),B=r(d,k),{setItemMap:H}=B,S=oo.useRef(N);JD(S.current,N)||(S.current=N);let I=S.current;return oo.useEffect(()=>{let R=I;return H(E=>A?E.has(A)?E.set(A,{...R,element:A}).toSorted(bS):(E.set(A,{...R,element:A}),E.toSorted(bS)):E),()=>{H(E=>!A||!E.has(A)?E:(E.delete(A),new xS(E)))}},[A,I,H]),(0,ru.jsx)(h,{[m]:"",ref:F,children:C})});y.displayName=d;function w(){return oo.useState(new xS)}ja(w,"useInitCollection");function v(g){let{itemMap:b}=r(e+"CollectionConsumer",g);return b}return ja(v,"useCollection"),[{Provider:s,Slot:f,ItemSlot:y},{createCollectionScope:n,useCollection:v,useInitCollection:w}]}ja(lK,"createCollection");function JD(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;let a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(let o of a)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}ja(JD,"shallowEqual");function e_(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ja(e_,"isElementPreceding");function bS(e,t){return!e[1].element||!t[1].element?0:e_(e[1].element,t[1].element)?-1:1}ja(bS,"sortByDocumentPosition");function t_(e){return new MutationObserver(a=>{for(let n of a)if(n.type==="childList"){e();return}})}ja(t_,"getChildListObserver");var Fv=O(ve(),1),dK=O(Z(),1),uK=Object.defineProperty,cK=(e,t)=>uK(e,"name",{value:t,configurable:!0}),fK=Fv.createContext(void 0);function Zp(e){let t=Fv.useContext(fK);return e||t||"ltr"}cK(Zp,"useDirection");var mK=O(ve(),1),qv=O(ve(),1),pK=Object.defineProperty,CS=(e,t)=>pK(e,"name",{value:t,configurable:!0}),SS=!1;function a_(){let[e,t]=qv.useState(SS);return qv.useEffect(()=>{SS||(SS=!0,t(!0))},[]),e}CS(a_,"useIsHydrated");var n_=mK[" useSyncExternalStore ".trim().toString()];function o_(){return()=>{}}CS(o_,"subscribe");function r_(){return n_(o_,()=>!0,()=>!1)}CS(r_,"useIsHydratedModern");var s_=typeof n_=="function"?r_:a_;var Qi=O(Z(),1),hK=Object.defineProperty,su=(e,t)=>hK(e,"name",{value:t,configurable:!0}),LS="rovingFocusGroup.onEntryFocus",gK={bubbles:!1,cancelable:!0},$v="RovingFocusGroup",[NS,i_,vK]=Xp($v),[yK,IS]=An($v,[vK]),[wK,xK]=yK($v),bK=Wa.forwardRef(su(function(t,a){return(0,Qi.jsx)(NS.Provider,{scope:t.__scopeRovingFocusGroup,children:(0,Qi.jsx)(NS.Slot,{scope:t.__scopeRovingFocusGroup,children:(0,Qi.jsx)(kK,{...t,ref:a})})})},"RovingFocusGroup")),kK=Wa.forwardRef(su(function(t,a){let{__scopeRovingFocusGroup:n,orientation:o,loop:r=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...d}=t,m=Wa.useRef(null),h=At(a,m),y=Zp(s),[w,v]=Yl({prop:i,defaultProp:l??null,onChange:u,caller:$v}),[x,g]=Wa.useState(!1),b=eo(c),k=i_(n),C=Wa.useRef(!1),[N,L]=Wa.useState(0);return Wa.useEffect(()=>{let A=m.current;if(A)return A.addEventListener(LS,b),()=>A.removeEventListener(LS,b)},[b]),(0,Qi.jsx)(wK,{scope:n,orientation:o,dir:y,loop:r,currentTabStopId:w,onItemFocus:Wa.useCallback(A=>v(A),[v]),onItemShiftTab:Wa.useCallback(()=>g(!0),[]),onFocusableItemAdd:Wa.useCallback(()=>L(A=>A+1),[]),onFocusableItemRemove:Wa.useCallback(()=>L(A=>A-1),[]),children:(0,Qi.jsx)(ta.div,{tabIndex:x||N===0?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:ct(t.onMouseDown,()=>{C.current=!0}),onFocus:ct(t.onFocus,A=>{let P=!C.current;if(A.target===A.currentTarget&&P&&!x){let F=new CustomEvent(LS,gK);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){let B=k().filter(E=>E.focusable),H=B.find(E=>E.active),S=B.find(E=>E.id===w),R=[H,S,...B].filter(Boolean).map(E=>E.ref.current);TS(R,f)}}C.current=!1}),onBlur:ct(t.onBlur,()=>g(!1))})})},"RovingFocusGroupImpl")),SK="RovingFocusGroupItem",CK=Wa.forwardRef(su(function(t,a){let{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...l}=t,u=Zr(),c=s||u,f=xK(SK,n),d=f.currentTabStopId===c,m=i_(n),{onFocusableItemAdd:h,onFocusableItemRemove:y,currentTabStopId:w}=f,v=s_();return ya(()=>{if(!(!v||!o))return h(),()=>y()},[v,o,h,y]),Wa.useEffect(()=>{if(!(v||!o))return h(),()=>y()},[v,o,h,y]),(0,Qi.jsx)(NS.ItemSlot,{scope:n,id:c,focusable:o,active:r,children:(0,Qi.jsx)(ta.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...l,ref:a,onMouseDown:ct(t.onMouseDown,x=>{o?f.onItemFocus(c):x.preventDefault()}),onFocus:ct(t.onFocus,()=>f.onItemFocus(c)),onKeyDown:ct(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;let g=u_(x,f.orientation,f.dir);if(g!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let k=m().filter(C=>C.focusable).map(C=>C.ref.current);if(g==="last")k.reverse();else if(g==="prev"||g==="next"){g==="prev"&&k.reverse();let C=k.indexOf(x.currentTarget);k=f.loop?c_(k,C+1):k.slice(C+1)}setTimeout(()=>TS(k))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:w!=null}):i})})},"RovingFocusGroupItem")),LK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function l_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}su(l_,"getDirectionAwareKey");function u_(e,t,a){let n=l_(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return LK[n]}su(u_,"getFocusIntent");function TS(e,t=!1){let a=document.activeElement;for(let n of e)if(n===a||(n.focus({preventScroll:t}),document.activeElement!==a))return}su(TS,"focusFirst");function c_(e,t){return e.map((a,n)=>e[(t+n)%e.length])}su(c_,"wrapArray");var d_=bK,f_=CK;var IK=O(Z(),1);var p_=O(ve(),1);var TK=Object.defineProperty,RK=(e,t)=>TK(e,"name",{value:t,configurable:!0});function RS(e){let[t,a]=p_.useState(void 0);return ya(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});let n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;let r=o[0],s,i;if("borderBoxSize"in r){let l=r.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,i=u.blockSize}else s=e.offsetWidth,i=e.offsetHeight;a({width:s,height:i})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else a(void 0)},[e]),t}RK(RS,"useSize");var m_=O(Z(),1);var wn=O(ve(),1);var v_=["top","right","bottom","left"];var es=Math.min,xr=Math.max,Jp=Math.round,em=Math.floor,ts=e=>({x:e,y:e}),AK={left:"right",right:"left",bottom:"top",top:"bottom"};function AS(e,t,a){return xr(e,es(t,a))}function as(e,t){return typeof e=="function"?e(t):e}function $s(e){return e.split("-")[0]}function iu(e){return e.split("-")[1]}function Vv(e){return e==="x"?"y":"x"}function jv(e){return e==="y"?"height":"width"}function br(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Wv(e){return Vv(br(e))}function y_(e,t,a){a===void 0&&(a=!1);let n=iu(e),o=Wv(e),r=jv(o),s=o==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Qp(s)),[s,Qp(s)]}function w_(e){let t=Qp(e);return[Uv(e),t,Uv(t)]}function Uv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var h_=["left","right"],g_=["right","left"],EK=["top","bottom"],MK=["bottom","top"];function DK(e,t,a){switch(e){case"top":case"bottom":return a?t?g_:h_:t?h_:g_;case"left":case"right":return t?EK:MK;default:return[]}}function x_(e,t,a,n){let o=iu(e),r=DK($s(e),a==="start",n);return o&&(r=r.map(s=>s+"-"+o),t&&(r=r.concat(r.map(Uv)))),r}function Qp(e){let t=$s(e);return AK[t]+e.slice(t.length)}function _K(e){var t,a,n,o;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(n=e.bottom)!=null?n:0,left:(o=e.left)!=null?o:0}}function ES(e){return typeof e!="number"?_K(e):{top:e,right:e,bottom:e,left:e}}function lu(e){let{x:t,y:a,width:n,height:o}=e;return{width:n,height:o,top:a,left:t,right:t+n,bottom:a+o,x:t,y:a}}function b_(e,t,a){let{reference:n,floating:o}=e,r=br(t),s=Wv(t),i=jv(s),l=$s(t),u=r==="y",c=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,d=n[i]/2-o[i]/2,m;switch(l){case"top":m={x:c,y:n.y-o.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-o.width,y:f};break;default:m={x:n.x,y:n.y}}let h=iu(t);return h&&(m[s]+=d*(h==="end"?1:-1)*(a&&u?-1:1)),m}async function C_(e,t){var a;t===void 0&&(t={});let{x:n,y:o,platform:r,rects:s,elements:i,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=as(t,e),h=ES(m),w=i[d?f==="floating"?"reference":"floating":f],v=lu(await r.getClippingRect({element:(a=await(r.isElement==null?void 0:r.isElement(w)))==null||a?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(i.floating)),boundary:u,rootBoundary:c,strategy:l})),x=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,g=await(r.getOffsetParent==null?void 0:r.getOffsetParent(i.floating)),b=await(r.isElement==null?void 0:r.isElement(g))&&await(r.getScale==null?void 0:r.getScale(g))||{x:1,y:1},k=lu(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:x,offsetParent:g,strategy:l}):x);return{top:(v.top-k.top+h.top)/b.y,bottom:(k.bottom-v.bottom+h.bottom)/b.y,left:(v.left-k.left+h.left)/b.x,right:(k.right-v.right+h.right)/b.x}}var PK=50,L_=async(e,t,a)=>{let{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:s}=a,i=s.detectOverflow?s:{...s,detectOverflow:C_},l=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=b_(u,n,l),d=n,m=0,h={};for(let y=0;y<r.length;y++){let w=r[y];if(!w)continue;let{name:v,fn:x}=w,{x:g,y:b,data:k,reset:C}=await x({x:c,y:f,initialPlacement:n,placement:d,strategy:o,middlewareData:h,rects:u,platform:i,elements:{reference:e,floating:t}});c=g??c,f=b??f,h[v]={...h[v],...k},C&&m<PK&&(m++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(u=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:c,y:f}=b_(u,d,l)),y=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:h}},N_=e=>({name:"arrow",options:e,async fn(t){let{x:a,y:n,placement:o,rects:r,platform:s,elements:i,middlewareData:l}=t,{element:u,padding:c=0}=as(e,t)||{};if(u==null)return{};let f=ES(c),d={x:a,y:n},m=Wv(o),h=jv(m),y=await s.getDimensions(u),w=m==="y",v=w?"top":"left",x=w?"bottom":"right",g=w?"clientHeight":"clientWidth",b=r.reference[h]+r.reference[m]-d[m]-r.floating[h],k=d[m]-r.reference[m],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u)),N=C?C[g]:0;(!N||!await(s.isElement==null?void 0:s.isElement(C)))&&(N=i.floating[g]||r.floating[h]);let L=b/2-k/2,A=N/2-y[h]/2-1,P=es(f[v],A),F=es(f[x],A),B=N-y[h]-F,H=N/2-y[h]/2+L,S=AS(P,H,B),I=!l.arrow&&iu(o)!=null&&H!==S&&r.reference[h]/2-(H<P?P:F)-y[h]/2<0,R=I?H<P?H-P:H-B:0;return{[m]:d[m]+R,data:{[m]:S,centerOffset:H-S-R,...I&&{alignmentOffset:R}},reset:I}}});var I_=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,n;let{placement:o,middlewareData:r,rects:s,initialPlacement:i,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:y=!0,...w}=as(e,t);if((a=r.arrow)!=null&&a.alignmentOffset)return{};let v=$s(o),x=br(i),g=$s(i)===i,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),k=d||(g||!y?[Qp(i)]:w_(i)),C=h!=="none";!d&&C&&k.push(...x_(i,y,h,b));let N=[i,...k],L=await l.detectOverflow(t,w),A=[],P=((n=r.flip)==null?void 0:n.overflows)||[];if(c&&A.push(L[v]),f){let S=y_(o,s,b);A.push(L[S[0]],L[S[1]])}if(P=[...P,{placement:o,overflows:A}],!A.every(S=>S<=0)){var F,B;let S=(((F=r.flip)==null?void 0:F.index)||0)+1,I=N[S];if(I&&(!(f==="alignment"?x!==br(I):!1)||P.every(q=>br(q.placement)===x?q.overflows[0]>0:!0)))return{data:{index:S,overflows:P},reset:{placement:I}};let R=(B=P.filter(E=>E.overflows[0]<=0).sort((E,q)=>E.overflows[1]-q.overflows[1])[0])==null?void 0:B.placement;if(!R)switch(m){case"bestFit":{var H;let E=(H=P.filter(q=>{if(C){let M=br(q.placement);return M===x||M==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(M=>M>0).reduce((M,_)=>M+_,0)]).sort((q,M)=>q[1]-M[1])[0])==null?void 0:H[0];E&&(R=E);break}case"initialPlacement":R=i;break}if(o!==R)return{reset:{placement:R}}}return{}}}};function k_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function S_(e){return v_.some(t=>e[t]>=0)}var T_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:a,platform:n}=t,{strategy:o="referenceHidden",...r}=as(e,t);switch(o){case"referenceHidden":{let s=await n.detectOverflow(t,{...r,elementContext:"reference"}),i=k_(s,a.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:S_(i)}}}case"escaped":{let s=await n.detectOverflow(t,{...r,altBoundary:!0}),i=k_(s,a.floating);return{data:{escapedOffsets:i,escaped:S_(i)}}}default:return{}}}}};var R_=new Set(["left","top"]);async function OK(e,t){let{placement:a,platform:n,elements:o}=e,r=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=$s(a),i=iu(a),l=br(a)==="y",u=R_.has(s)?-1:1,c=r&&l?-1:1,f=as(t,e),{mainAxis:d,crossAxis:m,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof h=="number"&&(m=i==="end"?h*-1:h),l?{x:m*c,y:d*u}:{x:d*u,y:m*c}}var A_=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,n;let{x:o,y:r,placement:s,middlewareData:i}=t,l=await OK(t,e);return s===((a=i.offset)==null?void 0:a.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}},E_=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:a,y:n,placement:o,platform:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:x=>{let{x:g,y:b}=x;return{x:g,y:b}}},...u}=as(e,t),c={x:a,y:n},f=await r.detectOverflow(t,u),d=br(o),m=Vv(d),h=c[m],y=c[d],w=(x,g)=>AS(g+f[x==="y"?"top":"left"],g,g-f[x==="y"?"bottom":"right"]);s&&(h=w(m,h)),i&&(y=w(d,y));let v=l.fn({...t,[m]:h,[d]:y});return{...v,data:{x:v.x-a,y:v.y-n,enabled:{[m]:s,[d]:i}}}}}},M_=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,n;let{x:o,y:r,placement:s,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:c=!0,crossAxis:f=!0}=as(e,t),d={x:o,y:r},m=br(s),h=Vv(m),y=d[h],w=d[m],v=as(u,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(a=v.mainAxis)!=null?a:0,crossAxis:(n=v.crossAxis)!=null?n:0};if(c){let k=h==="y"?"height":"width",C=i.reference[h]-i.floating[k]+x.mainAxis,N=i.reference[h]+i.reference[k]-x.mainAxis;y<C?y=C:y>N&&(y=N)}if(f){var g,b;let k=h==="y"?"width":"height",C=R_.has($s(s)),N=i.reference[m]-i.floating[k]+(C&&((g=l.offset)==null?void 0:g[m])||0)+(C?0:x.crossAxis),L=i.reference[m]+i.reference[k]+(C?0:((b=l.offset)==null?void 0:b[m])||0)-(C?x.crossAxis:0);w<N?w=N:w>L&&(w=L)}return{[h]:y,[m]:w}}}},D_=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){let{placement:a,rects:n,platform:o,elements:r}=t,{apply:s=()=>{},...i}=as(e,t),l=await o.detectOverflow(t,i),u=$s(a),c=iu(a),f=br(a)==="y",{width:d,height:m}=n.floating,h,y;u==="top"||u==="bottom"?(h=u,y=c===(await(o.isRTL==null?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(y=u,h=c==="end"?"top":"bottom");let w=m-l.top-l.bottom,v=d-l.left-l.right,x=es(m-l[h],w),g=es(d-l[y],v),b=t.middlewareData.shift,k=!b,C=x,N=g;b!=null&&b.enabled.x&&(N=v),b!=null&&b.enabled.y&&(C=w),k&&!c&&(f?N=d-2*xr(l.left,l.right):C=m-2*xr(l.top,l.bottom)),await s({...t,availableWidth:N,availableHeight:C});let L=await o.getDimensions(r.floating);return d!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function Kv(){return typeof window<"u"}function du(e){return P_(e)?(e.nodeName||"").toLowerCase():"#document"}function On(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ns(e){var t;return(t=(P_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function P_(e){return Kv()?e instanceof Node||e instanceof On(e).Node:!1}function kr(e){return Kv()?e instanceof Element||e instanceof On(e).Element:!1}function Us(e){return Kv()?e instanceof HTMLElement||e instanceof On(e).HTMLElement:!1}function __(e){return!Kv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof On(e).ShadowRoot}function tm(e){let{overflow:t,overflowX:a,overflowY:n,display:o}=Sr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&o!=="inline"&&o!=="contents"}function O_(e){return/^(table|td|th)$/.test(du(e))}function am(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var BK=/transform|translate|scale|rotate|perspective|filter/,zK=/paint|layout|strict|content/,uu=e=>!!e&&e!=="none",MS;function Gv(e){let t=kr(e)?Sr(e):e;return uu(t.transform)||uu(t.translate)||uu(t.scale)||uu(t.rotate)||uu(t.perspective)||!Yv()&&(uu(t.backdropFilter)||uu(t.filter))||BK.test(t.willChange||"")||zK.test(t.contain||"")}function B_(e){let t=Ji(e);for(;Us(t)&&!gd(t);){if(Gv(t))return t;if(am(t))return null;t=Ji(t)}return null}function Yv(){return MS==null&&(MS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),MS}function gd(e){return/^(html|body|#document)$/.test(du(e))}function Sr(e){return On(e).getComputedStyle(e)}function nm(e){return kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ji(e){if(du(e)==="html")return e;let t=e.assignedSlot||e.parentNode||__(e)&&e.host||ns(e);return __(t)?t.host:t}function z_(e){let t=Ji(e);return gd(t)?(e.ownerDocument||e).body:Us(t)&&tm(t)?t:z_(t)}function cu(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);let o=z_(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),s=On(o);if(r){let i=Xv(s);return t.concat(s,s.visualViewport||[],tm(o)?o:[],i&&a?cu(i):[])}else return t.concat(o,cu(o,[],a))}function Xv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function q_(e){let t=Sr(e),a=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=Us(e),r=o?e.offsetWidth:a,s=o?e.offsetHeight:n,i=Jp(a)!==r||Jp(n)!==s;return i&&(a=r,n=s),{width:a,height:n,$:i}}function _S(e){return kr(e)?e:e.contextElement}function vd(e){let t=_S(e);if(!Us(t))return ts(1);let a=t.getBoundingClientRect(),{width:n,height:o,$:r}=q_(t),s=(r?Jp(a.width):a.width)/n,i=(r?Jp(a.height):a.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var HK=ts(0);function $_(e){let t=On(e);return!Yv()||!t.visualViewport?HK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FK(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===On(e)}function fu(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);let o=e.getBoundingClientRect(),r=_S(e),s=ts(1);t&&(n?kr(n)&&(s=vd(n)):s=vd(e));let i=FK(r,a,n)?$_(r):ts(0),l=(o.left+i.x)/s.x,u=(o.top+i.y)/s.y,c=o.width/s.x,f=o.height/s.y;if(r&&n){let d=On(r),m=kr(n)?On(n):n,h=d,y=Xv(h);for(;y&&m!==h;){let w=vd(y),v=y.getBoundingClientRect(),x=Sr(y),g=v.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,b=v.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,u*=w.y,c*=w.x,f*=w.y,l+=g,u+=b,h=On(y),y=Xv(h)}}return lu({width:c,height:f,x:l,y:u})}function Zv(e,t){let a=nm(e).scrollLeft;return t?t.left+a:fu(ns(e)).left+a}function U_(e,t){let a=e.getBoundingClientRect(),n=a.left+t.scrollLeft-Zv(e,a),o=a.top+t.scrollTop;return{x:n,y:o}}function qK(e){let{elements:t,rect:a,offsetParent:n,strategy:o}=e,r=o==="fixed",s=ns(n),i=t?am(t.floating):!1;if(n===s||i&&r)return a;let l={scrollLeft:0,scrollTop:0},u=ts(1),c=ts(0),f=Us(n);if((f||!r)&&((du(n)!=="body"||tm(s))&&(l=nm(n)),f)){let m=fu(n);u=vd(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}let d=s&&!f&&!r?U_(s,l):ts(0);return{width:a.width*u.x,height:a.height*u.y,x:a.x*u.x-l.scrollLeft*u.x+c.x+d.x,y:a.y*u.y-l.scrollTop*u.y+c.y+d.y}}function $K(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function UK(e){let t=nm(e),a=e.ownerDocument.body,n=xr(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),o=xr(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight),r=-t.scrollLeft+Zv(e),s=-t.scrollTop;return Sr(a).direction==="rtl"&&(r+=xr(e.clientWidth,a.clientWidth)-n),{width:n,height:o,x:r,y:s}}var VK=25;function jK(e,t,a){a===void 0&&(a="viewport");let n=a==="layoutViewport",o=On(e),r=ns(e),s=o.visualViewport,i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(s){let d=!Yv()||t==="fixed";n?d||(u=-s.offsetLeft,c=-s.offsetTop):(i=s.width,l=s.height,d&&(u=s.offsetLeft,c=s.offsetTop))}if(Zv(r)<=0){let d=r.ownerDocument,m=d.body,h=getComputedStyle(m),y=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(r.clientWidth-m.clientWidth-y),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?w/2:w;v<=VK&&(i-=v)}return{width:i,height:l,x:u,y:c}}function WK(e,t){let a=fu(e,!0,t==="fixed"),n=a.top+e.clientTop,o=a.left+e.clientLeft,r=vd(e),s=e.clientWidth*r.x,i=e.clientHeight*r.y,l=o*r.x,u=n*r.y;return{width:s,height:i,x:l,y:u}}function H_(e,t,a){let n;if(t==="viewport"||t==="layoutViewport")n=jK(e,a,t);else if(t==="document")n=UK(ns(e));else if(kr(t))n=WK(t,a);else{let o=$_(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return lu(n)}function KK(e,t){let a=t.get(e);if(a)return a;let n=cu(e,[],!1).filter(i=>kr(i)&&du(i)!=="body"),o=null,r=Sr(e).position==="fixed",s=r?Ji(e):e;for(;kr(s)&&!gd(s);){let i=Sr(s),l=Gv(s),u=o?o.position:r?"fixed":"";!l&&(u==="fixed"||u==="absolute"&&i.position==="static")?n=n.filter(f=>f!==s):o=i,s=Ji(s)}return t.set(e,n),n}function GK(e){let{element:t,boundary:a,rootBoundary:n,strategy:o}=e,s=[...a==="clippingAncestors"?am(t)?[]:KK(t,this._c):[].concat(a),n],i=H_(t,s[0],o),l=i.top,u=i.right,c=i.bottom,f=i.left;for(let d=1;d<s.length;d++){let m=H_(t,s[d],o);l=xr(m.top,l),u=es(m.right,u),c=es(m.bottom,c),f=xr(m.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function YK(e){let{width:t,height:a}=q_(e);return{width:t,height:a}}function XK(e,t,a){let n=Us(t),o=ns(t),r=a==="fixed",s=fu(e,!0,r,t),i={scrollLeft:0,scrollTop:0},l=ts(0);if((n||!r)&&((du(t)!=="body"||tm(o))&&(i=nm(t)),n)){let d=fu(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}!n&&o&&(l.x=Zv(o));let u=o&&!n&&!r?U_(o,i):ts(0),c=s.left+i.scrollLeft-l.x-u.x,f=s.top+i.scrollTop-l.y-u.y;return{x:c,y:f,width:s.width,height:s.height}}function DS(e){return Sr(e).position==="static"}function F_(e,t){if(!Us(e)||Sr(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return ns(e)===a&&(a=a.ownerDocument.body),a}function V_(e,t){let a=On(e);if(am(e))return a;if(!Us(e)){let o=Ji(e);for(;o&&!gd(o);){if(kr(o)&&!DS(o))return o;o=Ji(o)}return a}let n=F_(e,t);for(;n&&O_(n)&&DS(n);)n=F_(n,t);return n&&gd(n)&&DS(n)&&!Gv(n)?a:n||B_(e)||a}var ZK=async function(e){let t=this.getOffsetParent||V_,a=this.getDimensions,n=await a(e.floating);return{reference:XK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function QK(e){return Sr(e).direction==="rtl"}var j_={convertOffsetParentRelativeRectToViewportRelativeRect:qK,getDocumentElement:ns,getClippingRect:GK,getOffsetParent:V_,getElementRects:ZK,getClientRects:$K,getDimensions:YK,getScale:vd,isElement:kr,isRTL:QK};function W_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function JK(e,t,a){let n=null,o,r=ns(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function i(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();let d=e.getBoundingClientRect(),{left:m,top:h,width:y,height:w}=d;if(c||t(),!y||!w)return;let v=em(h),x=em(r.clientWidth-(m+y)),g=em(r.clientHeight-(h+w)),b=em(m),C={rootMargin:-v+"px "+-x+"px "+-g+"px "+-b+"px",threshold:xr(0,es(1,f))||1},N=!0;function L(A){let P=A[0].intersectionRatio;if(!W_(d,e.getBoundingClientRect()))return i();if(P!==f){if(!N)return i();P?i(!1,P):o=setTimeout(()=>{i(!1,1e-7)},1e3)}N=!1}try{n=new IntersectionObserver(L,{...C,root:r.ownerDocument})}catch{n=new IntersectionObserver(L,C)}n.observe(e)}let l=On(e),u=()=>i(a);return l.addEventListener("resize",u),i(!0),()=>{l.removeEventListener("resize",u),s()}}function PS(e,t,a,n){n===void 0&&(n={});let{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=_S(e),c=o||r?[...u?cu(u):[],...t?cu(t):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",a),r&&v.addEventListener("resize",a)});let f=u&&i?JK(u,a,r):null,d=-1,m=null;s&&(m=new ResizeObserver(v=>{let[x]=v;x&&x.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var g;(g=m)==null||g.observe(t)})),a()}),u&&!l&&m.observe(u),t&&m.observe(t));let h,y=l?fu(e):null;l&&w();function w(){let v=fu(e);y&&!W_(y,v)&&a(),y=v,h=requestAnimationFrame(w)}return a(),()=>{var v;c.forEach(x=>{o&&x.removeEventListener("scroll",a),r&&x.removeEventListener("resize",a)}),f?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(h)}}var K_=A_;var G_=E_,Y_=I_,X_=D_,Z_=T_,OS=N_;var Q_=M_,BS=(e,t,a)=>{let n=new Map,o=a??{},r={...j_,...o.platform,_c:n};return L_(e,t,{...o,platform:r})};var La=O(ve(),1),eP=O(ve(),1),tP=O(_o(),1),e7=typeof document<"u",t7=function(){},Qv=e7?eP.useLayoutEffect:t7;function Jv(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 a,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(n=a;n--!==0;)if(!Jv(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),a=o.length,a!==Object.keys(t).length)return!1;for(n=a;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=a;n--!==0;){let r=o[n];if(!(r==="_owner"&&e.$$typeof)&&!Jv(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function aP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function J_(e,t){let a=aP(e);return Math.round(t*a)/a}function zS(e){let t=La.useRef(e);return Qv(()=>{t.current=e}),t}function nP(e){e===void 0&&(e={});let{placement:t="bottom",strategy:a="absolute",middleware:n=[],platform:o,elements:{reference:r,floating:s}={},transform:i=!0,whileElementsMounted:l,open:u}=e,[c,f]=La.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=La.useState(n);Jv(d,n)||m(n);let[h,y]=La.useState(null),[w,v]=La.useState(null),x=La.useCallback(q=>{q!==C.current&&(C.current=q,y(q))},[]),g=La.useCallback(q=>{q!==N.current&&(N.current=q,v(q))},[]),b=r||h,k=s||w,C=La.useRef(null),N=La.useRef(null),L=La.useRef(c),A=l!=null,P=zS(l),F=zS(o),B=zS(u),H=La.useCallback(()=>{if(!C.current||!N.current)return;let q={placement:t,strategy:a,middleware:d};F.current&&(q.platform=F.current),BS(C.current,N.current,q).then(M=>{let _={...M,isPositioned:B.current!==!1};S.current&&!Jv(L.current,_)&&(L.current=_,tP.flushSync(()=>{f(_)}))})},[d,t,a,F,B]);Qv(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[u]);let S=La.useRef(!1);Qv(()=>(S.current=!0,()=>{S.current=!1}),[]),Qv(()=>{if(b&&(C.current=b),k&&(N.current=k),b&&k){if(P.current)return P.current(b,k,H);H()}},[b,k,H,P,A]);let I=La.useMemo(()=>({reference:C,floating:N,setReference:x,setFloating:g}),[x,g]),R=La.useMemo(()=>({reference:b,floating:k}),[b,k]),E=La.useMemo(()=>{let q={position:a,left:0,top:0};if(!R.floating)return q;let M=J_(R.floating,c.x),_=J_(R.floating,c.y);return i?{...q,transform:"translate("+M+"px, "+_+"px)",...aP(R.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:M,top:_}},[a,i,R.floating,c.x,c.y]);return La.useMemo(()=>({...c,update:H,refs:I,elements:R,floatingStyles:E}),[c,H,I,R,E])}var a7=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){let{element:n,padding:o}=typeof e=="function"?e(a):e;return n&&t(n)?n.current!=null?OS({element:n.current,padding:o}).fn(a):{}:n?OS({element:n,padding:o}).fn(a):{}}}},oP=(e,t)=>{let a=K_(e);return{name:a.name,fn:a.fn,options:[e,t]}},rP=(e,t)=>{let a=G_(e);return{name:a.name,fn:a.fn,options:[e,t]}},sP=(e,t)=>({fn:Q_(e).fn,options:[e,t]}),iP=(e,t)=>{let a=Y_(e);return{name:a.name,fn:a.fn,options:[e,t]}},lP=(e,t)=>{let a=X_(e);return{name:a.name,fn:a.fn,options:[e,t]}};var uP=(e,t)=>{let a=Z_(e);return{name:a.name,fn:a.fn,options:[e,t]}};var cP=(e,t)=>{let a=a7(e);return{name:a.name,fn:a.fn,options:[e,t]}};var yd=O(Z(),1),n7=Object.defineProperty,el=(e,t)=>n7(e,"name",{value:t,configurable:!0});var dP="Popper",[fP,HS]=An(dP),[o7,pP]=fP(dP),r7=el(e=>{let{__scopePopper:t,children:a}=e,[n,o]=wn.useState(null),[r,s]=wn.useState(void 0);return(0,yd.jsx)(o7,{scope:t,anchor:n,onAnchorChange:o,placementState:r,setPlacementState:s,children:a})},"Popper"),s7="PopperAnchor",i7=wn.forwardRef(el(function(t,a){let{__scopePopper:n,virtualRef:o,...r}=t,s=pP(s7,n),i=wn.useRef(null),l=s.onAnchorChange,u=wn.useCallback(y=>{i.current=y,y&&l(y)},[l]),c=At(a,u),f=wn.useRef(null);wn.useEffect(()=>{if(!o)return;let y=f.current;f.current=o.current,y!==f.current&&l(f.current)});let d=s.placementState&&ey(s.placementState),m=d?.[0],h=d?.[1];return o?null:(0,yd.jsx)(ta.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...r,ref:c})},"PopperAnchor")),mP="PopperContent",[l7,Zde]=fP(mP),u7=wn.forwardRef(el(function(t,a){let{__scopePopper:n,side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:y,...w}=t,v=pP(mP,n),[x,g]=wn.useState(null),b=At(a,g),[k,C]=wn.useState(null),N=RS(k),L=N?.width??0,A=N?.height??0,P=o+(s!=="center"?"-"+s:""),F=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(c)?c:[c],H=B.length>0,S={padding:F,boundary:B.filter(hP),altBoundary:H},{refs:I,floatingStyles:R,placement:E,isPositioned:q,middlewareData:M}=nP({strategy:"fixed",placement:P,whileElementsMounted:el((...z)=>PS(...z,{animationFrame:h==="always"}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[oP({mainAxis:r+A,alignmentAxis:i}),u&&rP({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?sP():void 0,...S}),u&&iP({...S}),lP({...S,apply:el(({elements:z,rects:Y,availableWidth:me,availableHeight:X})=>{let{width:te,height:ge}=Y.reference,be=z.floating.style;be.setProperty("--radix-popper-available-width",`${me}px`),be.setProperty("--radix-popper-available-height",`${X}px`),be.setProperty("--radix-popper-anchor-width",`${te}px`),be.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),k&&cP({element:k,padding:l}),c7({arrowWidth:L,arrowHeight:A}),m&&uP({strategy:"referenceHidden",...S,boundary:H?S.boundary:void 0})]}),_=v.setPlacementState;ya(()=>(_(E),()=>{_(void 0)}),[E,_]);let[G,re]=ey(E),oe=eo(y);ya(()=>{q&&oe?.()},[q,oe]);let $=M.arrow?.x,W=M.arrow?.y,Q=M.arrow?.centerOffset!==0,[ne,V]=wn.useState();return ya(()=>{x&&V(window.getComputedStyle(x).zIndex)},[x]),(0,yd.jsx)("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:q?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(" "),...M.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:(0,yd.jsx)(l7,{scope:n,placedSide:G,placedAlign:re,onArrowChange:C,arrowX:$,arrowY:W,shouldHideArrow:Q,children:(0,yd.jsx)(ta.div,{"data-side":G,"data-align":re,...w,ref:b,style:{...w.style,animation:q?w.style?.animation:"none"}})})})},"PopperContent"));function hP(e){return e!==null}el(hP,"isNotNull");var c7=el(e=>({name:"transformOrigin",options:e,fn(t){let{placement:a,rects:n,middlewareData:o}=t,s=o.arrow?.centerOffset!==0,i=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,c]=ey(a),f={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,m=(o.arrow?.y??0)+l/2,h="",y="";return u==="bottom"?(h=s?f:`${d}px`,y=`${-l}px`):u==="top"?(h=s?f:`${d}px`,y=`${n.floating.height+l}px`):u==="right"?(h=`${-l}px`,y=s?f:`${m}px`):u==="left"&&(h=`${n.floating.width+l}px`,y=s?f:`${m}px`),{data:{x:h,y}}}}),"transformOrigin");function ey(e){let[t,a="center"]=e.split("-");return[t,a]}el(ey,"getSideAndAlignFromPlacement");var gP=r7,vP=i7,yP=u7;var wP=O(Z(),1);var f7=O(Z(),1);var xe=O(ve(),1),SP=O(_o(),1);function p7(e){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}var m7=e=>{switch(e){case"success":return v7;case"info":return w7;case"warning":return y7;case"error":return x7;default:return null}},h7=Array(12).fill(0),g7=({visible:e,className:t})=>xe.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},xe.default.createElement("div",{className:"sonner-spinner"},h7.map((a,n)=>xe.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),v7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),y7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),w7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),x7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20","aria-hidden":"true"},xe.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),b7=xe.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},xe.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),xe.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),k7=()=>{let[e,t]=xe.default.useState(document.hidden);return xe.default.useEffect(()=>{let a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>document.removeEventListener("visibilitychange",a)},[]),e},S7=1,C7=100,xP=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:S7++},FS=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),this.getActiveToasts().forEach(a=>t(a)),()=>{let a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t],this.trimHistory()},this.trimHistory=()=>{let t=this.toasts.length-C7;t<=0||(this.toasts=this.toasts.filter(a=>t>0&&this.dismissedToasts.has(a.id)?(this.dismissedToasts.delete(a.id),t--,!1):!0))},this.create=t=>{let{message:a,...n}=t,o=xP(t),r=this.pendingDismissals.get(o);r!==void 0&&(cancelAnimationFrame(r),this.pendingDismissals.delete(o),this.dismissedToasts.delete(o));let s=this.dismissedToasts.has(o),i=t.dismissible===void 0?!0:t.dismissible;return s&&(this.dismissedToasts.delete(o),this.toasts=this.toasts.filter(u=>u.id!==o)),(s?void 0:this.toasts.find(u=>u.id===o))?this.toasts=this.toasts.map(u=>u.id===o?(this.publish({...u,...t,id:o,title:a}),{...u,...t,id:o,dismissible:i,title:a}):u):this.addToast({title:a,...n,dismissible:i,id:o}),o},this.dismiss=t=>{if(t==null)return this.getActiveToasts().forEach(n=>{this.dismissedToasts.add(n.id),this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t;this.dismissedToasts.add(t);let a=this.pendingDismissals.get(t);return a!==void 0&&cancelAnimationFrame(a),this.pendingDismissals.set(t,requestAnimationFrame(()=>{this.pendingDismissals.delete(t),this.subscribers.forEach(n=>n({id:t,dismiss:!0}))})),t},this.message=(t,a)=>this.create({...a,message:t,type:void 0}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let n;a.loading!==void 0&&(n=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let o=Promise.resolve(t instanceof Function?t():t),r=n!==void 0,s,i=o.then(async u=>{if(s=["resolve",u],xe.default.isValidElement(u))r=!1,this.create({id:n,type:"default",message:u});else if(N7(u)&&!u.ok){r=!1;let f=typeof a.error=="function"?await a.error(`HTTP error! status: ${u.status}`):a.error,d=typeof a.description=="function"?await a.description(`HTTP error! status: ${u.status}`):a.description,h=typeof f=="object"&&!xe.default.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...h})}else if(u instanceof Error){r=!1;let f=typeof a.error=="function"?await a.error(u):a.error,d=typeof a.description=="function"?await a.description(u):a.description,h=typeof f=="object"&&!xe.default.isValidElement(f)?f:{message:f};this.create({id:n,type:"error",description:d,...h})}else if(a.success!==void 0){r=!1;let f=typeof a.success=="function"?await a.success(u):a.success,d=typeof a.description=="function"?await a.description(u):a.description,h=typeof f=="object"&&!xe.default.isValidElement(f)?f:{message:f};this.create({id:n,type:"success",description:d,...h})}}).catch(async u=>{if(s=["reject",u],a.error!==void 0){r=!1;let c=typeof a.error=="function"?await a.error(u):a.error,f=typeof a.description=="function"?await a.description(u):a.description,m=typeof c=="object"&&!xe.default.isValidElement(c)?c:{message:c};this.create({id:n,type:"error",description:f,...m})}}).finally(()=>{r&&(this.dismiss(n),n=void 0),a.finally==null||a.finally.call(a)}),l=()=>new Promise((u,c)=>i.then(()=>s[0]==="reject"?c(s[1]):u(s[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(t,a)=>{let n=xP(a);return this.create({...a,jsx:t(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},ro=new FS,L7=(e,t)=>ro.message(e,t),N7=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",I7=L7,T7=()=>ro.toasts,R7=()=>ro.getActiveToasts(),om=Object.assign(I7,{success:ro.success,info:ro.info,warning:ro.warning,error:ro.error,custom:ro.custom,message:ro.message,promise:ro.promise,dismiss:ro.dismiss,loading:ro.loading},{getHistory:T7,getToasts:R7});p7("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ty(e){return e.label!==void 0}var A7=3,E7="24px",M7="16px",bP=4e3,D7=356,_7=14,P7=45,O7=200;function os(...e){return e.filter(Boolean).join(" ")}function B7(e){let[t,a]=e.split("-"),n=[];return t&&n.push(t),a&&n.push(a),n}var z7=e=>{var t,a,n,o,r,s,i,l,u;let{invert:c,toast:f,unstyled:d,interacting:m,setHeights:h,visibleToasts:y,heights:w,index:v,toasts:x,expanded:g,removeToast:b,defaultRichColors:k,closeButton:C,style:N,cancelButtonStyle:L,actionButtonStyle:A,className:P="",descriptionClassName:F="",duration:B,position:H,gap:S,expandByDefault:I,classNames:R,icons:E,closeButtonAriaLabel:q="Close toast"}=e,[M,_]=xe.default.useState(null),[G,re]=xe.default.useState(null),[oe,$]=xe.default.useState(!1),[W,Q]=xe.default.useState(!1),[ne,V]=xe.default.useState(!1),[z,Y]=xe.default.useState(!1),[me,X]=xe.default.useState(!1),[te,ge]=xe.default.useState(0),[be,_e]=xe.default.useState(0),ee=xe.default.useRef(f.duration||B||bP),Te=xe.default.useRef(null),je=xe.default.useRef(null),Ye=v===0,tt=v+1<=y,Xe=f.type,Oa=Xe??"default",Dt=f.dismissible!==!1,Ba=f.className||"",pn=f.descriptionClassName||"",ba=xe.default.useMemo(()=>w.findIndex(Ve=>Ve.toastId===f.id)||0,[w,f.id]),ha=xe.default.useMemo(()=>{var Ve;return(Ve=f.closeButton)!=null?Ve:C},[f.closeButton,C]),or=xe.default.useMemo(()=>f.duration||B||bP,[f.duration,B]),Ao=xe.default.useRef(0),le=xe.default.useRef(0),$e=xe.default.useRef(0),Ue=xe.default.useRef(null),[Zt,Ra]=H.split("-"),rr=xe.default.useMemo(()=>w.reduce((Ve,Qt,J)=>J>=ba?Ve:Ve+Qt.height,0),[w,ba]),Un=k7(),za=xe.default.useMemo(()=>{var Ve;return(Ve=e.swipeDirections)!=null?Ve:B7(H)},[e.swipeDirections,H]),Eo=f.invert||c,ga=Xe==="loading";le.current=xe.default.useMemo(()=>ba*S+rr,[ba,rr]),xe.default.useEffect(()=>{ee.current=or},[or]),xe.default.useEffect(()=>{$(!0)},[]),xe.default.useEffect(()=>{let Ve=je.current;if(Ve){let Qt=Ve.getBoundingClientRect().height;return _e(Qt),h(J=>[{toastId:f.id,height:Qt,position:f.position},...J]),()=>h(J=>J.filter(Le=>Le.toastId!==f.id))}},[h,f.id]),xe.default.useLayoutEffect(()=>{if(!oe)return;let Ve=je.current,Qt=Ve.style.height;Ve.style.height="auto";let J=Ve.getBoundingClientRect().height;Ve.style.height=Qt,_e(J),h(Le=>Le.find(kt=>kt.toastId===f.id)?Le.map(kt=>kt.toastId===f.id?{...kt,height:J}:kt):[{toastId:f.id,height:J,position:f.position},...Le])},[oe,f.title,f.description,h,f.id,f.jsx,f.action,f.cancel]);let Aa=xe.default.useCallback(()=>{Q(!0),ge(le.current),h(Ve=>Ve.filter(Qt=>Qt.toastId!==f.id)),setTimeout(()=>{b(f)},O7)},[f,b,h,le]);xe.default.useEffect(()=>{if(f.promise&&Xe==="loading"||f.duration===1/0||f.type==="loading")return;let Ve;return g||m||Un?(()=>{if($e.current<Ao.current){let Le=new Date().getTime()-Ao.current;ee.current=ee.current-Le}$e.current=new Date().getTime()})():ee.current!==1/0&&(Ao.current=new Date().getTime(),Ve=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),Aa()},ee.current)),()=>clearTimeout(Ve)},[g,m,f,Xe,Un,Aa]),xe.default.useEffect(()=>{f.delete&&(Aa(),f.onDismiss==null||f.onDismiss.call(f,f))},[Aa,f.delete]);function xs(){var Ve;if(E?.loading){var Qt;return xe.default.createElement("div",{className:os(R?.loader,f==null||(Qt=f.classNames)==null?void 0:Qt.loader,"sonner-loader"),"data-visible":Xe==="loading"},E.loading)}return xe.default.createElement(g7,{className:os(R?.loader,f==null||(Ve=f.classNames)==null?void 0:Ve.loader),visible:Xe==="loading"})}let rf=f.icon||E?.[Xe]||m7(Xe);var Vu,ui;return xe.default.createElement("li",{tabIndex:0,ref:je,className:os(P,Ba,R?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,R?.[Oa],f==null||(a=f.classNames)==null?void 0:a[Oa]),"data-sonner-toast":"","data-rich-colors":(Vu=f.richColors)!=null?Vu:k,"data-styled":!(f.jsx||f.unstyled||d),"data-mounted":oe,"data-promise":!!f.promise,"data-swiped":me,"data-removed":W,"data-visible":tt,"data-y-position":Zt,"data-x-position":Ra,"data-index":v,"data-front":Ye,"data-swiping":ne,"data-dismissible":Dt,"data-type":Xe,"data-invert":Eo,"data-swipe-out":z,"data-swipe-direction":G,"data-expanded":!!(g||I&&oe),"data-testid":f.testId,style:{"--index":v,"--toasts-before":v,"--z-index":x.length-v,"--offset":`${W?te:le.current}px`,"--initial-height":I?"auto":`${be}px`,...N,...f.style},onDragEnd:()=>{V(!1),_(null),Ue.current=null},onPointerDown:Ve=>{Ve.button!==2&&(ga||!Dt||(Te.current=new Date,ge(le.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(V(!0),Ue.current={x:Ve.clientX,y:Ve.clientY})))},onPointerUp:()=>{var Ve,Qt,J;if(z||!Dt)return;Ue.current=null;let Le=Number(((Ve=je.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),qe=Number(((Qt=je.current)==null?void 0:Qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),kt=new Date().getTime()-((J=Te.current)==null?void 0:J.getTime()),Vn=M==="x"?Le:qe,Mo=Math.abs(Vn)/kt;if((M==="x"?za.includes(Le>0?"right":"left"):za.includes(qe>0?"bottom":"top"))&&(Math.abs(Vn)>=P7||Mo>.11)){ge(le.current),f.onDismiss==null||f.onDismiss.call(f,f),re(M==="x"?Le>0?"right":"left":qe>0?"down":"up"),Aa(),Y(!0);return}else{var Do,lf;(Do=je.current)==null||Do.style.setProperty("--swipe-amount-x","0px"),(lf=je.current)==null||lf.style.setProperty("--swipe-amount-y","0px")}X(!1),V(!1),_(null)},onPointerMove:Ve=>{var Qt,J,Le;if(!Ue.current||!Dt||((Qt=window.getSelection())==null?void 0:Qt.toString().length)>0)return;let kt=Ve.clientY-Ue.current.y,Vn=Ve.clientX-Ue.current.x;!M&&(Math.abs(Vn)>1||Math.abs(kt)>1)&&_(Math.abs(Vn)>Math.abs(kt)?"x":"y");let Mo={x:0,y:0},sf=Do=>1/(1.5+Math.abs(Do)/20);if(M==="y"){if(za.includes("top")||za.includes("bottom"))if(za.includes("top")&&kt<0||za.includes("bottom")&&kt>0)Mo.y=kt;else{let Do=kt*sf(kt);Mo.y=Math.abs(Do)<Math.abs(kt)?Do:kt}}else if(M==="x"&&(za.includes("left")||za.includes("right")))if(za.includes("left")&&Vn<0||za.includes("right")&&Vn>0)Mo.x=Vn;else{let Do=Vn*sf(Vn);Mo.x=Math.abs(Do)<Math.abs(Vn)?Do:Vn}(Math.abs(Mo.x)>0||Math.abs(Mo.y)>0)&&X(!0),(J=je.current)==null||J.style.setProperty("--swipe-amount-x",`${Mo.x}px`),(Le=je.current)==null||Le.style.setProperty("--swipe-amount-y",`${Mo.y}px`)}},ha&&!f.jsx&&Xe!=="loading"?xe.default.createElement("button",{"aria-label":q,"data-disabled":ga,"data-close-button":!0,onClick:ga||!Dt?()=>{}:()=>{Aa(),f.onDismiss==null||f.onDismiss.call(f,f)},className:os(R?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(ui=E?.close)!=null?ui:b7):null,(Xe||f.icon||f.promise)&&f.icon!==null&&(E?.[Xe]!==null||f.icon)?xe.default.createElement("div",{"data-icon":"",className:os(R?.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},Xe==="loading"?f.icon||xs():f.promise?xs():null,Xe!=="loading"?rf:null):null,xe.default.createElement("div",{"data-content":"",className:os(R?.content,f==null||(r=f.classNames)==null?void 0:r.content)},xe.default.createElement("div",{"data-title":"",className:os(R?.title,f==null||(s=f.classNames)==null?void 0:s.title)},f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title),f.description?xe.default.createElement("div",{"data-description":"",className:os(F,pn,R?.description,f==null||(i=f.classNames)==null?void 0:i.description)},typeof f.description=="function"?f.description():f.description):null),xe.default.isValidElement(f.cancel)?f.cancel:f.cancel&&ty(f.cancel)?xe.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Ve=>{ty(f.cancel)&&Dt&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Ve),Aa())},className:os(R?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,xe.default.isValidElement(f.action)?f.action:f.action&&ty(f.action)?xe.default.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||A,onClick:Ve=>{ty(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Ve),!Ve.defaultPrevented&&Aa())},className:os(R?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function kP(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function H7(e,t){let a={};return[e,t].forEach((n,o)=>{let r=o===1,s=r?"--mobile-offset":"--offset",i=r?M7:E7;function l(u){["top","right","bottom","left"].forEach(c=>{a[`${s}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?a[`${s}-${u}`]=i:a[`${s}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(i)}),a}var CP=xe.default.forwardRef(function(t,a){let{id:n,invert:o,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:l,className:u,offset:c,mobileOffset:f,theme:d="light",richColors:m,duration:h,style:y,visibleToasts:w=A7,toastOptions:v,dir:x=kP(),gap:g=_7,icons:b,customAriaLabel:k,containerAriaLabel:C="Notifications"}=t,[N,L]=xe.default.useState([]),A=xe.default.useMemo(()=>n?N.filter($=>$.toasterId===n):N.filter($=>!$.toasterId),[N,n]),P=xe.default.useMemo(()=>Array.from(new Set([r].concat(A.filter($=>$.position).map($=>$.position)))),[A,r]),[F,B]=xe.default.useState([]),[H,S]=xe.default.useState(!1),[I,R]=xe.default.useState(!1),[E,q]=xe.default.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=xe.default.useRef(null),_=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),G=xe.default.useRef(null),re=xe.default.useRef(!1),oe=xe.default.useCallback($=>{L(W=>{var Q;return(Q=W.find(ne=>ne.id===$.id))!=null&&Q.delete||ro.dismiss($.id),W.filter(({id:ne})=>ne!==$.id)})},[]);return xe.default.useEffect(()=>ro.subscribe($=>{if($.dismiss){requestAnimationFrame(()=>{L(W=>W.map(Q=>Q.id===$.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{SP.default.flushSync(()=>{L(W=>{let Q=W.findIndex(ne=>ne.id===$.id);return Q!==-1?[...W.slice(0,Q),{...W[Q],...$},...W.slice(Q+1)]:[$,...W]})})})}),[]),xe.default.useEffect(()=>{if(d!=="system"){q(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:W})=>{q(W?"dark":"light")})}catch{$.addListener(({matches:Q})=>{try{q(Q?"dark":"light")}catch(ne){console.error(ne)}})}},[d]),xe.default.useEffect(()=>{N.length<=1&&S(!1)},[N]),xe.default.useEffect(()=>{let $=W=>{var Q;if(s.length>0&&s.every(z=>W[z]||W.code===z)){var V;S(!0),(V=M.current)==null||V.focus()}W.code==="Escape"&&(document.activeElement===M.current||(Q=M.current)!=null&&Q.contains(document.activeElement))&&S(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),xe.default.useEffect(()=>{if(M.current)return()=>{G.current&&(G.current.focus({preventScroll:!0}),G.current=null,re.current=!1)}},[M.current]),xe.default.createElement("section",{ref:a,"aria-label":k??`${C} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},P.map(($,W)=>{var Q;let[ne,V]=$.split("-");return A.length?xe.default.createElement("ol",{key:$,dir:x==="auto"?kP():x,tabIndex:-1,ref:M,className:u,"data-sonner-toaster":!0,"data-sonner-theme":E,"data-y-position":ne,"data-x-position":V,style:{"--front-toast-height":`${((Q=F[0])==null?void 0:Q.height)||0}px`,"--width":`${D7}px`,"--gap":`${g}px`,...y,...H7(c,f)},onBlur:z=>{re.current&&!z.currentTarget.contains(z.relatedTarget)&&(re.current=!1,G.current&&(G.current.focus({preventScroll:!0}),G.current=null))},onFocus:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||re.current||(re.current=!0,G.current=z.relatedTarget)},onMouseEnter:()=>S(!0),onMouseMove:()=>S(!0),onMouseLeave:()=>{I||S(!1)},onDragEnd:()=>S(!1),onPointerDown:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||R(!0)},onPointerUp:()=>R(!1)},A.filter(z=>!z.position&&W===0||z.position===$).map((z,Y)=>{var me,X;return xe.default.createElement(z7,{key:z.id,icons:b,index:Y,toast:z,defaultRichColors:m,duration:(me=v?.duration)!=null?me:h,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:o,visibleToasts:w,closeButton:(X=v?.closeButton)!=null?X:l,interacting:I,position:$,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:oe,toasts:A.filter(te=>te.position==z.position),heights:F.filter(te=>te.position==z.position),setHeights:B,expandByDefault:i,gap:g,expanded:H,swipeDirections:t.swipeDirections})})):null}))});var NP=O(Z(),1);function LP(){return(0,NP.jsx)(CP,{position:"bottom-center",toastOptions:{classNames:{toast:"!bg-card !text-foreground !border !border-border !shadow-lg",description:"!text-muted-foreground"}}})}var Cr=O(ve(),1);var Ge=O(ve(),1);var Ot=O(Z(),1),F7=Object.defineProperty,Bt=(e,t)=>F7(e,"name",{value:t,configurable:!0}),qS=["Enter"," "],q7=["ArrowDown","PageUp","Home"],TP=["ArrowUp","PageDown","End"],$7=[...q7,...TP],Cfe={ltr:[...qS,"ArrowRight"],rtl:[...qS,"ArrowLeft"]};var ny="Menu",[$S,U7,V7]=Xp(ny),[pu,VS]=An(ny,[V7,HS,IS]),jS=HS(),RP=IS(),[j7,rm]=pu(ny),[W7,WS]=pu(ny),K7=Bt(e=>{let{__scopeMenu:t,open:a=!1,children:n,dir:o,onOpenChange:r,modal:s=!0}=e,i=jS(t),[l,u]=Ge.useState(null),c=Ge.useRef(!1),f=eo(r),d=Zp(o);return Ge.useEffect(()=>{let m=Bt(()=>{c.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},"handleKeyDown"),h=Bt(()=>c.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",h,{capture:!0}),document.removeEventListener("pointermove",h,{capture:!0})}},[]),Ge.useEffect(()=>{if(!a)return;let m=Bt(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[a,f]),(0,Ot.jsx)(gP,{...i,children:(0,Ot.jsx)(j7,{scope:t,open:a,onOpenChange:f,content:l,onContentChange:u,children:(0,Ot.jsx)(W7,{scope:t,onClose:Ge.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:s,children:n})})})},"Menu"),G7=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,...o}=t,r=jS(n);return(0,Ot.jsx)(vP,{...r,...o,ref:a})},"MenuAnchor")),AP="MenuPortal",[Y7,X7]=pu(AP,{forceMount:void 0}),Z7=Bt(e=>{let{__scopeMenu:t,forceMount:a,children:n,container:o}=e,r=rm(AP,t);return(0,Ot.jsx)(Y7,{scope:t,forceMount:a,children:(0,Ot.jsx)(Xl,{present:a||r.open,children:(0,Ot.jsx)(cv,{asChild:!0,container:o,children:n})})})},"MenuPortal"),tl="MenuContent",[Q7,EP]=pu(tl),J7=Ge.forwardRef(Bt(function(t,a){let n=X7(tl,t.__scopeMenu),{forceMount:o=n.forceMount,...r}=t,s=rm(tl,t.__scopeMenu),i=WS(tl,t.__scopeMenu);return(0,Ot.jsx)($S.Provider,{scope:t.__scopeMenu,children:(0,Ot.jsx)(Xl,{present:o||s.open,children:(0,Ot.jsx)($S.Slot,{scope:t.__scopeMenu,children:i.modal?(0,Ot.jsx)(eG,{...r,ref:a}):(0,Ot.jsx)(tG,{...r,ref:a})})})})},"MenuContent")),eG=Ge.forwardRef(Bt(function(t,a){let n=rm(tl,t.__scopeMenu),o=Ge.useRef(null),r=At(a,o);return Ge.useEffect(()=>{let s=o.current;if(s)return xv(s)},[]),(0,Ot.jsx)(MP,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ct(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),tG=Ge.forwardRef(Bt(function(t,a){let n=rm(tl,t.__scopeMenu);return(0,Ot.jsx)(MP,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),aG=Jn("MenuContent.ScrollLock"),MP=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,loop:o=!1,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:h,disableOutsideScroll:y,...w}=t,v=rm(tl,n),x=WS(tl,n),g=jS(n),b=RP(n),k=U7(n),[C,N]=Ge.useState(null),L=Ge.useRef(null),A=At(a,L,v.onContentChange),P=Ge.useRef(0),F=Ge.useRef(""),B=Ge.useRef(0),H=Ge.useRef(null),S=Ge.useRef("right"),I=Ge.useRef(0),R=y?yp:Ge.Fragment,E=y?{as:aG,allowPinchZoom:!0}:void 0,q=Bt(_=>{let G=F.current+_,re=k().filter(V=>!V.disabled),oe=document.activeElement,$=re.find(V=>V.ref.current===oe)?.textValue,W=re.map(V=>V.textValue),Q=BP(W,G,$),ne=re.find(V=>V.textValue===Q)?.ref.current;Bt((function V(z){F.current=z,window.clearTimeout(P.current),z!==""&&(P.current=window.setTimeout(()=>V(""),1e3))}),"updateSearch")(G),ne&&setTimeout(()=>ne.focus())},"handleTypeaheadSearch");Ge.useEffect(()=>()=>window.clearTimeout(P.current),[]),Yc();let M=Ge.useCallback(_=>S.current===H.current?.side&&HP(_,H.current?.area),[]);return(0,Ot.jsx)(Q7,{scope:n,searchRef:F,onItemEnter:Ge.useCallback(_=>{M(_)&&_.preventDefault()},[M]),onItemLeave:Ge.useCallback(_=>{M(_)||(L.current?.focus(),N(null))},[M]),onTriggerLeave:Ge.useCallback(_=>{M(_)&&_.preventDefault()},[M]),pointerGraceTimerRef:B,onPointerGraceIntentChange:Ge.useCallback(_=>{H.current=_},[]),children:(0,Ot.jsx)(R,{...E,children:(0,Ot.jsx)(lv,{asChild:!0,trapped:r,onMountAutoFocus:ct(s,_=>{_.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,Ot.jsx)(iv,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:h,children:(0,Ot.jsx)(d_,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:ct(u,_=>{x.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Ot.jsx)(yP,{role:"menu","aria-orientation":"vertical","data-state":DP(v.open),"data-radix-menu-content":"",dir:x.dir,...g,...w,ref:A,style:{outline:"none",...w.style},onKeyDown:ct(w.onKeyDown,_=>{let re=_.target.closest("[data-radix-menu-content]")===_.currentTarget,oe=_.ctrlKey||_.altKey||_.metaKey,$=_.key.length===1;re&&(_.key==="Tab"&&_.preventDefault(),!oe&&$&&q(_.key));let W=L.current;if(_.target!==W||!$7.includes(_.key))return;_.preventDefault();let ne=k().filter(V=>!V.disabled).map(V=>V.ref.current);TP.includes(_.key)&&ne.reverse(),PP(ne)}),onBlur:ct(t.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(P.current),F.current="")}),onPointerMove:ct(t.onPointerMove,ay(_=>{let G=_.target,re=I.current!==_.clientX;if(_.currentTarget.contains(G)&&re){let oe=_.clientX>I.current?"right":"left";S.current=oe,I.current=_.clientX}}))})})})})})})},"MenuContentImpl"));var nG=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,...o}=t;return(0,Ot.jsx)(ta.div,{...o,ref:a})},"MenuLabel")),US="MenuItem",IP="menu.itemSelect",oG=Ge.forwardRef(Bt(function(t,a){let{disabled:n=!1,onSelect:o,...r}=t,s=Ge.useRef(null),i=WS(US,t.__scopeMenu),l=EP(US,t.__scopeMenu),u=At(a,s),c=Ge.useRef(!1),f=Bt(()=>{let d=s.current;if(!n&&d){let m=new CustomEvent(IP,{bubbles:!0,cancelable:!0});d.addEventListener(IP,h=>o?.(h),{once:!0}),mp(d,m),m.defaultPrevented?c.current=!1:i.onClose()}},"handleSelect");return(0,Ot.jsx)(rG,{...r,ref:u,disabled:n,onClick:ct(t.onClick,f),onPointerDown:d=>{t.onPointerDown?.(d),c.current=!0},onPointerUp:ct(t.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:ct(t.onKeyDown,d=>{n||d.target!==d.currentTarget||l.searchRef.current!==""&&d.key===" "||qS.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})},"MenuItem")),rG=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=t,i=EP(US,n),l=RP(n),u=Ge.useRef(null),c=At(a,u),[f,d]=Ge.useState(!1),[m,h]=Ge.useState("");return Ge.useEffect(()=>{let y=u.current;y&&h((y.textContent??"").trim())},[s.children]),(0,Ot.jsx)($S.ItemSlot,{scope:n,disabled:o,textValue:r??m,children:(0,Ot.jsx)(f_,{asChild:!0,...l,focusable:!o,children:(0,Ot.jsx)(ta.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:c,onPointerMove:ct(t.onPointerMove,ay(y=>{o?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ct(t.onPointerLeave,ay(y=>i.onItemLeave(y))),onFocus:ct(t.onFocus,()=>d(!0)),onBlur:ct(t.onBlur,()=>d(!1))})})})},"MenuItemImpl"));var sG="MenuRadioGroup",[Lfe,Nfe]=pu(sG,{value:void 0,onValueChange:Bt(()=>{},"onValueChange")});var iG="MenuItemIndicator",[Ife,Tfe]=pu(iG,{checked:!1});var lG=Ge.forwardRef(Bt(function(t,a){let{__scopeMenu:n,...o}=t;return(0,Ot.jsx)(ta.div,{role:"separator","aria-orientation":"horizontal",...o,ref:a})},"MenuSeparator"));var uG="MenuSub",[Rfe,Afe]=pu(uG);function DP(e){return e?"open":"closed"}Bt(DP,"getOpenState");function _P(e){return e==="indeterminate"}Bt(_P,"isIndeterminate");function cG(e){return _P(e)?"indeterminate":e?"checked":"unchecked"}Bt(cG,"getCheckedState");function PP(e){let t=document.activeElement;for(let a of e)if(a===t||(a.focus(),document.activeElement!==t))return}Bt(PP,"focusFirst");function OP(e,t){return e.map((a,n)=>e[(t+n)%e.length])}Bt(OP,"wrapArray");function BP(e,t,a){let o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,r=a?e.indexOf(a):-1,s=OP(e,Math.max(r,0));o.length===1&&(s=s.filter(u=>u!==a));let l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==a?l:void 0}Bt(BP,"getNextMatch");function zP(e,t){let{x:a,y:n}=e,o=!1;for(let r=0,s=t.length-1;r<t.length;s=r++){let i=t[r],l=t[s],u=i.x,c=i.y,f=l.x,d=l.y;c>n!=d>n&&a<(f-u)*(n-c)/(d-c)+u&&(o=!o)}return o}Bt(zP,"isPointInPolygon");function HP(e,t){if(!t)return!1;let a={x:e.clientX,y:e.clientY};return zP(a,t)}Bt(HP,"isPointerInGraceArea");function ay(e){return t=>t.pointerType==="mouse"?e(t):void 0}Bt(ay,"whenMouse");var FP=K7,qP=G7,$P=Z7,UP=J7;var VP=nG,jP=oG;var WP=lG;var rs=O(Z(),1),fG=Object.defineProperty,mu=(e,t)=>fG(e,"name",{value:t,configurable:!0}),KS="DropdownMenu",[pG,Kfe]=An(KS,[VS]),hu=VS(),[mG,KP]=pG(KS),hG=mu(e=>{let{__scopeDropdownMenu:t,children:a,dir:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,l=hu(t),u=Cr.useRef(null),[c,f]=Yl({prop:o,defaultProp:r??!1,onChange:s,caller:KS});return(0,rs.jsx)(mG,{scope:t,triggerId:Zr(),triggerRef:u,contentId:Zr(),open:c,onOpenChange:f,onOpenToggle:Cr.useCallback(()=>f(d=>!d),[f]),modal:i,children:(0,rs.jsx)(FP,{...l,open:c,onOpenChange:f,dir:n,modal:i,children:a})})},"DropdownMenu"),gG="DropdownMenuTrigger",vG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,disabled:o=!1,...r}=t,s=KP(gG,n),i=hu(n),l=At(a,s.triggerRef);return(0,rs.jsx)(qP,{asChild:!0,...i,children:(0,rs.jsx)(ta.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...r,ref:l,onPointerDown:ct(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(s.onOpenToggle(),s.open||u.preventDefault())}),onKeyDown:ct(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&s.onOpenToggle(),u.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),yG=mu(e=>{let{__scopeDropdownMenu:t,...a}=e,n=hu(t);return(0,rs.jsx)($P,{...n,...a})},"DropdownMenuPortal"),wG="DropdownMenuContent",xG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=KP(wG,n),s=hu(n),i=Cr.useRef(!1);return(0,rs.jsx)(UP,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:a,onCloseAutoFocus:ct(t.onCloseAutoFocus,l=>{i.current||r.triggerRef.current?.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:ct(t.onInteractOutside,l=>{let u=l.detail.originalEvent,c=u.button===0&&u.ctrlKey===!0,f=u.button===2||c;(!r.modal||f)&&(i.current=!0)}),style:{...t.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)"}})},"DropdownMenuContent"));var bG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=hu(n);return(0,rs.jsx)(VP,{...r,...o,ref:a})},"DropdownMenuLabel")),kG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=hu(n);return(0,rs.jsx)(jP,{...r,...o,ref:a})},"DropdownMenuItem"));var SG=Cr.forwardRef(mu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=hu(n);return(0,rs.jsx)(WP,{...r,...o,ref:a})},"DropdownMenuSeparator"));var GP=hG,YP=vG,XP=yG,ZP=xG;var QP=bG,JP=kG;var eO=SG;var wd=O(Z(),1),tO=GP,aO=YP;function nO({className:e,sideOffset:t=4,...a}){return(0,wd.jsx)(XP,{children:(0,wd.jsx)(ZP,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ye("z-[120] min-w-44 overflow-hidden rounded-card border-0 bg-popover p-1 text-popover-foreground shadow-overlay",e),...a})})}function oO({className:e,...t}){return(0,wd.jsx)(JP,{"data-slot":"dropdown-menu-item",className:ye("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-body outline-none data-[highlighted]:bg-accent phone:min-h-11 [&_svg]:size-4",e),...t})}function GS({className:e,...t}){return(0,wd.jsx)(QP,{className:ye("px-2 py-1.5 text-xs font-semibold text-muted-foreground",e),...t})}var rO=({className:e,...t})=>(0,wd.jsx)(eO,{className:ye("-mx-1 my-1 h-px bg-border",e),...t});var LG=O(Z(),1);var sO=O(Z(),1),NG=td("grid w-full grid-cols-[minmax(0,1fr)] items-start gap-y-0.5 rounded-md px-3 py-2.5 text-body has-[>svg]:grid-cols-[14px_minmax(0,1fr)] has-[>svg]:gap-x-2.5 [&>svg]:mt-0.5 [&>svg]:size-3.5",{variants:{tone:{neutral:"bg-raised text-foreground [&>svg]:text-muted-foreground",destructive:"bg-destructive-soft text-foreground [&>svg]:text-destructive"}},defaultVariants:{tone:"neutral"}});function sm({className:e,tone:t,...a}){return(0,sO.jsx)("div",{"data-slot":"alert",className:ye(NG({tone:t}),e),...a})}var iO=O(Z(),1);var LO=O(ve(),1);var oy="Accepting needs a reason";function lO(e){let t=e.canRequest?"request-changes":null,a=e.accept===null?null:"accept";if(e.failed!=null){let n=e.failed.acceptAnyway===!0?"accept-anyway":null;return e.failed.retry?{primary:"retry",secondary:n,line:null}:{primary:null,secondary:n,line:null}}return e.need!==null?{primary:e.need,secondary:t,line:null}:e.next!==null?{primary:e.next,secondary:a,line:null}:e.blocked!==null?{primary:t,secondary:a,line:e.blocked}:a!==null&&(e.unanswered??0)>0?{primary:null,secondary:a,line:null}:a!==null&&(e.notRight??0)>0?{primary:t,secondary:a,line:null}:e.checksRunning?{primary:null,secondary:a??t,line:null}:e.accept===null?{primary:null,secondary:t,line:null}:e.accept.ready?{primary:"accept",secondary:t,line:null}:e.runChecks?{primary:null,secondary:"accept",line:null}:{primary:"accept",secondary:t,line:null}}function uO(e,t){let a=n=>`“${n[0].replace(/[.!?]+$/,"")}”${n.length>1?` and ${n.length-1} more`:""}`;return t.unanswered.length>0?{label:"Accept without your check",ready:!1,why:`Not checked yet: ${a(t.unanswered)}.`}:t.notRight.length>0?{label:"Accept anyway",ready:!1,why:`You marked ${a(t.notRight)} not right.`}:e}function cO(e,t,a){let n=e.met+t,o=Math.max(0,e.yours-t-a);return{text:`${n} of ${e.total} met${o>0?` · You check ${o}`:""}`,done:n===e.total,short:e.total-n-o>0}}var Pe=(e,t,a)=>({never:e,pattern:new RegExp(`(?<![\\w-])(?:${t})(?![\\w-])`,"i"),say:a}),dO=[Pe("scope","scopes?|scoped","plan"),Pe("contract","contracts?","plan"),Pe("signs","signs|signed(?!\\s+(?:in|out|into)\\b)","Approved by …"),Pe("sealed","seal|seals|sealed|sealing","approved"),Pe("binds","binds?","approved"),Pe("digest","digests?","(the plan version, in Details)"),Pe("worker","workers?","builder"),Pe("runner","runners?","builder"),Pe("daemon","daemons?","builder"),Pe("background service","background service","builder"),Pe("operator","operators?|instance operator","approver, or owner"),Pe("coordinator","coordinators?","your lead"),Pe("mate","mate","your lead"),Pe("scout","scouts?|scouting|scouted","research"),Pe("criterion","criterion|criteria","requirement"),Pe("evidence","evidence","requirement, or the saved files"),Pe("proof","proofs?","requirement"),Pe("verdict","verdicts?","requirement"),Pe("caveat","caveats?","requirement"),Pe("mark complete","mark(?:ed|s|ing)?\\s+(?:it\\s+|this\\s+|that\\s+|them\\s+|the\\s+result\\s+)?complete","Accept"),Pe("Accept and finish","accept\\s+and\\s+finish","Accept"),Pe("Revise","revise","Send back, or Request changes"),Pe("re-file","re-?file[ds]?|re-?filing","Send back, or Request changes"),Pe("Draft a repair task","draft\\s+a\\s+repair\\s+task","Send back"),Pe("put away","put(?:s|ting)?\\s+(?:it\\s+|them\\s+|tasks\\s+|old\\s+tasks\\s+)?away","Archive"),Pe("tidy","tidy|tidied|tidying","Archive"),Pe("run #N","(?:run|result)\\s+#?\\d+|attempt\\s+#?\\d+(?!\\s+\\(build\\s+#\\d+\\))","build #N, or attempt N (build #M)"),Pe("reconcile","reconcile[ds]?|reconciling|reconciliation","Waiting: Toolroll is …"),Pe("requeue","requeue[ds]?|requeuing","Waiting: Toolroll is …"),Pe("claim","claim|claimed","Waiting: Toolroll is …"),Pe("lease","leases?|leased","Waiting: Toolroll is …"),Pe("custody","custody","Waiting: Toolroll is …"),Pe("incident","incidents?","Waiting: Toolroll is …"),Pe("plane","plane","Toolroll"),Pe("fence","fences?|fenced","Waiting: Toolroll is …"),Pe("attested","attest|attested|attestation","Waiting: Toolroll is …"),Pe("receipt","receipts?","Waiting: Toolroll is …"),Pe("regate","regate[ds]?","Run checks"),Pe("carried","carried|carry|carries","Waiting: Toolroll is …"),Pe("incarnation","incarnations?","Waiting: Toolroll is …"),Pe("admission","admission","Waiting: Toolroll is …"),Pe("quiescence","quiescen(?:ce|t)","Waiting: Toolroll is …"),Pe("witness","witness(?:es|ed)?","Waiting: Toolroll is …"),Pe("unproven","unproven","Waiting: Toolroll is …"),Pe("version hex","(?=[0-9a-f]*\\d)(?=[0-9a-f]*[a-f])[0-9a-f]{12,64}","(the plan version, in Details)")],IG=dO.map(e=>e.never);var bpe=[Pe("lead","lead","Toolroll, or Chat"),Pe("crew","crew","Toolroll"),Pe("scope","scopes?|scoped","plan"),Pe("mode","modes?","(Settings)"),Pe("flow","flows?","(Settings)"),Pe("fleet","fleet","(Settings)"),Pe("fallback","fallbacks?","(Settings)"),Pe("routing","routing|routed","(Settings)"),Pe("spend","spend|spends|spending|spent","cost"),Pe("MCP","mcp","(Settings)"),Pe("password","passwords?|passwordless","(only where one is asked for)"),Pe("token","tokens?","(Settings)"),Pe("builder","builders?","taking work")];var RG="/settings/computers?section=start",mO=e=>e===null?RG:`/settings/computers?task=${encodeURIComponent(e)}§ion=start`;var YS=()=>!0,fO=e=>e.build==null?"the last build":e.attempt==null?`build #${e.build}`:`attempt ${e.attempt} (build #${e.build})`,pO=e=>e.build==null?"The last build":`Build #${e.build}`,im={approval:{sentence:()=>"Review the plan and approve it to start.",action:{code:"approve-scope",label:"Review plan"}},card:{sentence:()=>"This card is waiting for your approval.",action:{code:"approve-card",label:"Approve card"}},answer:{sentence:()=>"Answer the question so the work can continue.",action:{code:"answer-decision",label:"Answer the question"},useReason:YS},questions:{sentence:()=>"Too many questions are open. Answer one so this task can start.",action:{code:"inspect-decisions",label:"Answer questions"}},"sign-in":{sentence:e=>`${e.provider??"Your agent"} needs you to sign in again. The task starts on its own after.`,action:{code:"sign-in",label:"Sign in again"},useReason:e=>/sign(?:ed)? in|API key/i.test(e)},"stop-unproven":{sentence:e=>`Toolroll can't prove ${fO(e)} stopped from this computer, so the work is held. Close anything of yours that is using its folder, then check again.`,action:{code:"recheck-stopped",label:"Check again"}},hold:{sentence:()=>"A hold is keeping this task from starting. Review it to release it.",action:{code:"inspect-hold",label:"Review hold"}},storage:{sentence:()=>"Toolroll couldn't finish checking other apps' data before starting. Allow it in Privacy & Security, then try again.",action:{code:"unhold",label:"Try again"},useReason:YS},"choose-project":{sentence:()=>"Choose a project so it can start.",action:{code:"place-task",label:"Choose a project"}},"define-task":{sentence:()=>"Say what the task should do so it can be planned.",action:{code:"write-scope",label:"Define the task"}},"fix-request":{sentence:()=>"The request can't be planned as written. Edit it so the planner can start.",action:{code:"write-scope",label:"Edit the request"},useReason:e=>/the planner can carry at most/.test(e)},"choose-agent":{sentence:()=>"Choose an agent to build this.",action:{code:"select-agent",label:"Choose an agent"}},"fix-dependency":{sentence:()=>"A task this one waits on didn't finish. Fix or remove it so this one can start.",action:{code:"repair-dependency",label:"Fix the required task"},useReason:e=>/didn't finish|did not finish|before it finished/i.test(e),withReason:e=>{let t=e.replace(/[.\s]*$/,".");return/Fix or remove it so this one can start\.$/.test(t)?t:`${t} Fix or remove it so this one can start.`}},"add-requirement":{sentence:()=>"This project is missing something the task needs. Add it so a builder can start.",action:{code:"repair-capability",label:"Add the requirement"}},"connect-builder":{sentence:()=>"No builder works on this project yet. Connect one so the task can start.",action:{code:"start-worker",label:"Connect a builder"}},"start-builder":{sentence:()=>"The builder is offline. Start the builder.",action:{code:"start-worker",label:"Start the builder"}},vanished:{sentence:e=>`${pO(e)} stopped unexpectedly. Retry it.`,action:{code:"reconcile-run",label:"Open the build"}},"review-result":{sentence:()=>"Check the result, then accept it or send it back.",action:{code:"open-result",label:"Open result"}},rebuild:{sentence:e=>`${pO(e)} was made to an earlier plan. Retry it on the current plan.`,action:{code:"retry-task",label:"Retry"}},replan:{sentence:e=>`The plan changed after ${fO(e)}. Approve the new plan, then retry it.`,action:{code:"approve-scope",label:"Review plan"}},"earlier-version":{sentence:e=>e.task==null?"An earlier version of this task still needs you. Finish it first.":`An earlier version, ${e.task}, still needs you. Finish it first.`,action:{code:"inspect-task",label:"Open earlier version"}},history:{sentence:()=>"Toolroll can't read this task's history. Open it to retry or archive it.",action:{code:"inspect-task",label:"Open the task"}},finding:{sentence:()=>"A finding has used its rounds. Read both sides and decide.",action:{code:"inspect-findings",label:"Open finding"}},"plan-again":{sentence:()=>"The plan didn't pass its checks. Plan again, or edit the task.",action:{code:"inspect-task",label:"Plan again"}},"planning-stopped":{sentence:()=>"Planning stopped after repeated failures. Plan again, or edit the task.",action:{code:"inspect-task",label:"Plan again"}},other:{sentence:()=>"Open the task to see what it needs from you.",action:{code:"inspect-task",label:"Open the task"},useReason:YS}};var XS={decide:"Decide",review:"Review",unblock:"Unblock"};var hO={queued:{stage:"queued"},ready:{stage:"queued"},"provider-quota":{stage:"queued"},running:{stage:"building"},reviewing:{stage:"reviewing"},"review-pending":{stage:"building"},"checks-running":{stage:"checking"},"ready-to-check":{stage:"finished",act:"open-result"},"ready-to-review":{stage:"finished"},"report-ready":{stage:"finished"},"no-change":{stage:"finished"},"pr-opened":{stage:"finished"},"merge-observed":{stage:"finished"},"pr-closed":{stage:"finished"},"agent-attested":{stage:"finished"},"accepted-exception":{stage:"finished"},complete:{stage:"complete",act:"open-result"},cancelled:{stage:"stopped",act:"inspect-task"},paused:{stage:"stopped"},stopped:{stage:"stopped",act:"resume-run"},failed:{stage:"failed",act:"retry-task"},"checks-failed":{stage:"failed"},"waiting-incident":{stage:"failed",act:"retry-task"},"plan-stopped":{stage:"needs-you",need:"plan-again",act:"inspect-task"},"planning-stopped":{stage:"needs-you",need:"planning-stopped",act:"inspect-task"},stopping:{stage:"waiting",wait:"build-stopping"},"build-stopping":{stage:"waiting",wait:"build-stopping"},"other-computer":{stage:"waiting",wait:"other-computer"},"planning-ready":{stage:"waiting",wait:"plan-next"},"scouting-ready":{stage:"waiting",wait:"research-next"},"worker-at-capacity":{stage:"waiting",wait:"builders-busy"},"retry-scheduled":{stage:"waiting",wait:"retry-later"},"plan-retry":{stage:"waiting",wait:"plan-retry-later"},updating:{stage:"waiting",wait:"app-update"},"waiting-dependency":{stage:"waiting",wait:"other-task"},"watch-stalled":{stage:"waiting",wait:"builder-restarting"},"history-problem":{stage:"needs-you",need:"history",act:"inspect-task"},"earlier-active":{stage:"needs-you",need:"earlier-version",act:"inspect-task"},"waiting-decision":{stage:"needs-you",need:"answer",act:"answer-decision"},"finding-held":{stage:"needs-you",need:"finding",act:"inspect-findings"},"decision-queue":{stage:"needs-you",need:"questions",act:"inspect-decisions"},"result-needs-attention":{stage:"needs-you",need:"other",act:"inspect-run"},"process-needs-attention":{stage:"needs-you",need:"stop-unproven",act:"inspect-run"},"vanished-run":{stage:"needs-you",need:"vanished",act:"reconcile-run"},held:{stage:"needs-you",need:"hold",act:"inspect-hold"},"storage-blocked":{stage:"needs-you",need:"storage",act:"unhold"},"terminal-dependency":{stage:"needs-you",need:"fix-dependency",act:"repair-dependency"},"needs-project":{stage:"needs-you",need:"choose-project",act:"place-task"},"needs-scope":{stage:"needs-you",need:"define-task",act:"write-scope"},"invalid-scope":{stage:"needs-you",need:"define-task",act:"write-scope"},"planner-source":{stage:"needs-you",need:"fix-request",act:"write-scope"},"needs-agent-profile":{stage:"needs-you",need:"choose-agent",act:"select-agent"},"needs-approval":{stage:"needs-you",need:"approval",act:"approve-scope"},"missing-requirement":{stage:"needs-you",need:"add-requirement",act:"repair-capability"},"no-worker-registered":{stage:"needs-you",need:"connect-builder",act:"start-worker"},"no-worker-online":{stage:"needs-you",need:"start-builder",act:"start-worker"},"signed-out":{stage:"needs-you",need:"sign-in",act:"sign-in"},"needs-verification":{stage:"needs-you",need:"review-result"},"proof-refuted":{stage:"needs-you",need:"review-result"},"no-build-record":{stage:"needs-you",need:"review-result"},"verification-needed":{stage:"needs-you",need:"review-result"},"evidence-mismatch":{stage:"needs-you",need:"review-result"},"record-incomplete":{stage:"needs-you",need:"review-result"},"evidence-damaged":{stage:"needs-you",need:"review-result"}};var Lpe=Object.fromEntries(Object.entries(hO).flatMap(([e,t])=>t.need===void 0?[]:[[e,t.need]]));var gO=500;var vO=["Queued","Planning","Needs you","Waiting","Building","Ready","Complete","Failed","Stopped"],ZS={Queued:"neutral",Planning:"live","Needs you":"attention",Waiting:"neutral",Building:"live",Ready:"ready",Complete:"success",Failed:"danger",Stopped:"neutral"};var AG="The check result couldn't be read.",Ope=`${AG} Run checks on it, or open the result to see why.`;var Bpe={ok:Yi`<path d="M20 6 9 17l-5-5"/>`,running:Yi`<circle cx="12" cy="12" r="4"/>`,none:Yi`<circle cx="12" cy="12" r="3"/>`,note:Yi`<path d="M12 8v5"/><path d="M12 16.5h.01"/><path d="M10.3 3.9 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/>`,failed:Yi`<path d="M18 6 6 18M6 6l12 12"/>`};var lm={needs:{word:"Needs you",tone:"needs"},running:{word:"Running",tone:"live"},queued:{word:"Queued",tone:""},finished:{word:"Finished",tone:"done"},failed:{word:"Failed",tone:"failed"}};function yO(e){let t=EG(e);return{word:e==="Needs you"?lm.needs.word:e,tone:lm[t].tone,status:t}}function EG(e){switch(ZS[e]){case"attention":case"ready":return"needs";case"live":return"running";case"success":return"finished";case"danger":return"failed";case"neutral":return"queued"}}var QS={idle:{word:"Idle",tone:""},building:{word:"Building",tone:"live"},offline:{word:"Offline",tone:"failed"}};function nl(e,t){return e==="way-in"?"password":t.automatic===!0?"automatic":e==="none"||t.passwordless||e==="standard"&&t.remembered?"click":"password"}function wO(e,t){let a=nl(e,t);return a==="password"?"password":a==="automatic"?"automatic":e==="none"?"none":t.passwordless?"passwordless":"remembered"}function gu(e,t){return e==="way-in"?t.passwordless?"Passwordless is on, but this creates a new way in, so it still asks for your password.":t.remembered?"A remembered password doesn’t count here: this creates a new way in.":"This creates a new way in, so it always asks for your password.":t.automatic===!0?"Approved automatically by your rule.":e==="none"?"":t.passwordless?"No password needed: Passwordless is on for your account.":e==="standard"&&t.remembered?t.rememberedUntil?`No password needed: remembered on this computer until ${t.rememberedUntil}.`:"No password needed: remembered on this computer.":"Asks for your password."}function xO(e){let t=Math.max(0,Math.round(e));return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${String(t%60).padStart(2,"0")}s`:`${Math.floor(t/3600)}h ${String(Math.floor(t%3600/60)).padStart(2,"0")}m`}var bO={ok:"Done",run:"Now",q:"Queued",bad:"Failed",wait:"Needs you",waiting:"Waiting",history:"Stopped earlier; went on"};function kO(e,t){let a=t??Math.max(1,...e.map(n=>n.start+(n.st==="q"?0:n.dur)))*1.02;return e.map(n=>n.st==="q"?null:{left:Math.max(0,n.start)/a*100,width:Math.max(n.dur,a/400)/a*100})}var SO={done:"done",needs:"waiting on you",live:"in progress",wait:"waiting",stuck:"stopped here",skipped:"skipped",todo:"not started"},CO=e=>`steprow-${e}`;var we=e=>["path",{d:e}],al=(e,t,a)=>["circle",{cx:e,cy:t,r:a}],ry={home:[we("m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"),we("M9 22V12h6v10")],tasks:[we("m3 17 2 2 4-4"),we("m3 7 2 2 4-4"),we("M13 6h8"),we("M13 12h8"),we("M13 18h8")],flows:[["rect",{x:3,y:3,width:8,height:8,rx:2}],we("M7 11v4a2 2 0 0 0 2 2h4"),["rect",{x:13,y:13,width:8,height:8,rx:2}]],agents:[we("M12 8V4H8"),["rect",{x:4,y:8,width:16,height:12,rx:2}],we("M2 14h2"),we("M20 14h2"),we("M15 13v2"),we("M9 13v2")],projects:[we("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],settings:[we("M21 4h-7"),we("M10 4H3"),we("M21 12h-9"),we("M8 12H3"),we("M21 20h-5"),we("M12 20H3"),we("M14 2v4"),we("M8 10v4"),we("M16 18v4")],pen:[we("M21.17 6.81a1 1 0 0 0-3.99-3.99L3.84 16.17a2 2 0 0 0-.5.83l-1.32 4.35a.5.5 0 0 0 .62.62l4.35-1.32a2 2 0 0 0 .83-.5z")],arrow:[we("M5 12h14"),we("m12 5 7 7-7 7")],plus:[we("M12 5v14"),we("M5 12h14")],send:[we("M12 19V5"),we("m5 12 7-7 7 7")],stop:[["rect",{x:6,y:6,width:12,height:12,rx:2}]],x:[we("M18 6 6 18"),we("m6 6 12 12")],back:[we("m15 18-6-6 6-6")],menu:[we("M4 6h16"),we("M4 12h16"),we("M4 18h16")],search:[al(11,11,7),we("m20 20-3.5-3.5")],chevron:[we("m6 9 6 6 6-6")],check:[we("M20 6 9 17l-5-5")],alert:[al(12,12,9),we("M12 8v4"),we("M12 16h.01")],more:[al(5,12,1),al(12,12,1),al(19,12,1)],file:[we("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),we("M14 3v5h5")],minus:[we("M5 12h14")],fit:[we("M15 3h6v6"),we("M9 21H3v-6"),we("M21 3l-7 7"),we("M3 21l7-7")],bolt:[we("M13 2 4 14h7l-1 8 9-12h-7z")],code:[we("m16 18 6-6-6-6"),we("m8 6-6 6 6 6")],sun:[al(12,12,4),we("M12 2v2"),we("M12 20v2"),we("m4.93 4.93 1.41 1.41"),we("m17.66 17.66 1.41 1.41"),we("M2 12h2"),we("M20 12h2"),we("m6.34 17.66-1.41 1.41"),we("m19.07 4.93-1.41 1.41")],cpu:[["rect",{x:4,y:4,width:16,height:16,rx:2}],["rect",{x:9,y:9,width:6,height:6,rx:1}],we("M15 2v2"),we("M15 20v2"),we("M2 15h2"),we("M2 9h2"),we("M20 15h2"),we("M20 9h2"),we("M9 2v2"),we("M9 20v2")],bell:[we("M10.27 21a2 2 0 0 0 3.46 0"),we("M3.26 15.33A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.67C19.41 13.96 18 12.5 18 8A6 6 0 0 0 6 8c0 4.5-1.41 5.96-2.74 7.33")],shield:[we("M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z")],folder:[we("M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z")],people:[we("M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"),al(9,7,4),we("M22 21v-2a4 4 0 0 0-3-3.87"),we("M16 3.13a4 4 0 0 1 0 7.75")],coin:[al(12,12,10),we("M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"),we("M12 18V6")],monitor:[["rect",{x:2,y:3,width:20,height:14,rx:2}],we("M8 21h8"),we("M12 17v4")],list:[we("M8 6h13"),we("M8 12h13"),we("M8 18h13"),we("M3 6h.01"),we("M3 12h.01"),we("M3 18h.01")],board:[["rect",{x:3,y:3,width:18,height:18,rx:2}],we("M9 3v18"),we("M15 3v18")],panel:[["rect",{x:3,y:3,width:18,height:18,rx:2}],we("M15 3v18")],server:[["rect",{x:2,y:2,width:20,height:8,rx:2}],["rect",{x:2,y:14,width:20,height:8,rx:2}],we("M6 6h.01"),we("M6 18h.01")]};var NO=O(Z(),1);function at({name:e,small:t=!1}){return(0,NO.jsx)("svg",{className:Je("k-i",t&&"k-i-sm"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:ry[e].map((a,n)=>(0,LO.createElement)(a[0],{key:n,...a[1]}))})}var Bn=O(Z(),1);function de({variant:e="outline",sm:t,iconOnly:a,lead:n,label:o,docked:r,busy:s,className:i,type:l="button",...u}){return(0,Bn.jsx)("button",{type:l,className:Je("k-btn",`k-btn-${e}`,t&&"k-btn-sm",a&&"k-btn-icon",r&&"k-docked",s&&"busy",i),"aria-label":a?o:void 0,title:a?o:void 0,"aria-busy":s?!0:void 0,...u,children:a?(0,Bn.jsx)(at,{name:a}):(0,Bn.jsx)("span",{className:"k-face",children:s?(0,Bn.jsxs)(Bn.Fragment,{children:[(0,Bn.jsx)("span",{className:"k-spin","aria-hidden":"true"}),s]}):(0,Bn.jsxs)(Bn.Fragment,{children:[n&&(0,Bn.jsx)(at,{name:n,small:!0}),o]})})})}function He({variant:e="outline",sm:t,label:a,lead:n,className:o,...r}){return(0,Bn.jsx)("a",{className:Je("k-btn",`k-btn-${e}`,t&&"k-btn-sm",o),...r,children:(0,Bn.jsxs)("span",{className:"k-face",children:[n&&(0,Bn.jsx)(at,{name:n,small:!0}),a]})})}var sy=O(Z(),1);function Oe({word:e,tone:t="",dot:a=!0}){return(0,sy.jsx)("span",{className:Je("k-chip",t,!a&&"nodot"),children:e})}var um=({status:e})=>(0,sy.jsx)(Oe,{word:lm[e].word,tone:lm[e].tone});function JS({headline:e}){let{word:t,tone:a}=yO(e);return(0,sy.jsx)(Oe,{word:t,tone:a})}var IO=O(Z(),1);function Lt({n:e,ink:t=!1}){return(0,IO.jsx)("span",{className:Je("k-count",t&&e>0&&"ink",e===0&&"zero"),children:e})}var iy=O(Z(),1);function TO({label:e,current:t,items:a,onChange:n}){let o=(r,s)=>{if(r.key!=="ArrowRight"&&r.key!=="ArrowLeft")return;let i=a[(s+(r.key==="ArrowRight"?1:a.length-1))%a.length];i&&(n(i.key),r.currentTarget.parentElement?.querySelector(`[data-k-tab="${CSS.escape(i.key)}"]`)?.focus())};return(0,iy.jsx)("div",{className:"k-tabs",role:"tablist","aria-label":e,children:a.map((r,s)=>(0,iy.jsxs)("button",{type:"button",role:"tab","data-k-tab":r.key,"aria-selected":r.key===t,tabIndex:r.key===t?0:-1,onClick:()=>n(r.key),onKeyDown:i=>o(i,s),children:[r.label,r.count]},r.key))})}var xd=O(Z(),1);function ss({label:e,current:t,items:a,onChange:n}){return(0,xd.jsx)("div",{className:"k-seg",role:"group","aria-label":e,children:a.map(o=>(0,xd.jsxs)("button",{type:"button","aria-pressed":o.key===t,onClick:()=>n(o.key),children:[o.label,o.count]},o.key))})}function vu({label:e,current:t,items:a,icons:n}){return(0,xd.jsx)("nav",{className:Je("k-seg",n&&"k-seg-icons"),"aria-label":e,children:a.map(o=>(0,xd.jsxs)("a",{href:o.href,"aria-current":o.key===t?"page":void 0,...n?{"aria-label":o.label,title:o.label}:{},children:[n&&o.icon?o.icon:o.label,o.count]},o.key))})}var ly=O(Z(),1);function Lr({items:e,sm:t,wide:a,className:n,...o}){return(0,ly.jsx)("span",{className:Je("k-selw",t&&"sm",a&&"wide",n),children:(0,ly.jsx)("select",{className:"k-sel",...o,children:e.map(r=>{let[s,i]=typeof r=="string"?[r,r]:r;return(0,ly.jsx)("option",{value:s,children:i},s)})})})}var RO=O(Z(),1);var AO=O(Z(),1);var Vs=O(Z(),1);function EO({name:e,legend:t,current:a,items:n,onChange:o}){return(0,Vs.jsxs)("fieldset",{className:"k-radios",children:[(0,Vs.jsx)("legend",{className:"k-sr",children:t}),n.map(r=>(0,Vs.jsxs)("label",{className:"k-opt",children:[(0,Vs.jsx)("input",{type:"radio",name:e,value:r.value,checked:r.value===a,onChange:()=>o(r.value)}),(0,Vs.jsxs)("span",{children:[(0,Vs.jsx)("b",{children:r.label}),r.text&&(0,Vs.jsx)("span",{children:r.text})]}),r.tag]},r.value))]})}var MO=O(Z(),1),is=({children:e})=>(0,MO.jsx)("div",{className:"k-acts",children:e});var DO=O(ve(),1),bd=O(Z(),1);function e1({rows:e}){return(0,bd.jsx)("dl",{className:"k-facts",children:e.map(([t,a])=>(0,bd.jsxs)(DO.Fragment,{children:[(0,bd.jsx)("dt",{children:t}),(0,bd.jsx)("dd",{children:a})]},t))})}var yu=O(Z(),1),ln=({children:e})=>(0,yu.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,yu.jsx)(at,{name:"alert",small:!0}),(0,yu.jsx)("span",{children:e})]}),js=({children:e})=>(0,yu.jsx)("p",{className:"k-notice info",children:e}),xa=({children:e})=>(0,yu.jsx)("p",{className:"k-note",children:e});var cm=O(Z(),1);function Na({title:e,text:t,action:a}){return(0,cm.jsxs)("div",{className:"k-empty",children:[(0,cm.jsx)("p",{className:"k-empty-t",children:e}),t&&(0,cm.jsx)("p",{className:"k-empty-x",children:t}),a]})}var uy=O(Z(),1);function un({summary:e,children:t,open:a,onToggle:n}){return(0,uy.jsxs)("details",{className:"k-disclose",open:a,onToggle:n===void 0?void 0:o=>n(o.currentTarget.open),children:[(0,uy.jsx)("summary",{children:e}),t]})}var zn=O(Z(),1),Io=({label:e,count:t,right:a,id:n})=>(0,zn.jsxs)("h2",{className:"k-grp",id:n,children:[e,t,a!==void 0&&(0,zn.jsxs)(zn.Fragment,{children:[(0,zn.jsx)("span",{className:"k-grow"}),a]})]});function xn({href:e,chip:t,title:a,desc:n,meta:o,action:r,wait:s,message:i}){return(0,zn.jsxs)("div",{className:Je("k-row",s&&"wait",e===void 0&&"k-row-static"),children:[(0,zn.jsx)("span",{className:"k-row-c",children:t}),e===void 0?(0,zn.jsx)("span",{className:"k-row-t",children:a}):(0,zn.jsx)("a",{className:"k-row-t",href:e,children:a}),(0,zn.jsx)("span",{className:"k-row-d",children:n}),(0,zn.jsx)("span",{className:"k-row-m",children:o}),(0,zn.jsx)("span",{className:"k-row-a",children:r}),i&&(0,zn.jsx)("div",{className:"k-row-msg",children:i})]})}var bn=O(Z(),1);function cy({title:e,back:t,trailing:a}){return(0,bn.jsxs)("header",{className:"k-ph",children:[t&&(0,bn.jsx)("a",{className:"k-btn k-btn-ghost k-btn-icon",href:t,"aria-label":"Back",title:"Back",children:(0,bn.jsx)(at,{name:"back"})}),(0,bn.jsx)("p",{className:"k-ph-t",children:e}),a]})}function so({title:e,ctx:t,right:a,back:n,phoneTitle:o,trailing:r}){return(0,bn.jsxs)(bn.Fragment,{children:[(0,bn.jsx)(cy,{title:o??e,...n?{back:n}:{},trailing:r}),(0,bn.jsxs)("div",{className:"k-tb",children:[(0,bn.jsx)("h1",{children:e}),t&&(0,bn.jsx)("span",{className:"k-tb-ctx",children:t}),a&&(0,bn.jsxs)(bn.Fragment,{children:[(0,bn.jsx)("span",{className:"k-grow"}),a]})]})]})}var Xo=O(Z(),1);function dm({title:e,back:t,meta:a,right:n,same:o}){return(0,Xo.jsxs)(Xo.Fragment,{children:[t&&(0,Xo.jsxs)("a",{className:"k-backlink",href:t[0],children:[(0,Xo.jsx)(at,{name:"back",small:!0}),t[1]]}),(0,Xo.jsxs)("header",{className:"k-dh",children:[(0,Xo.jsxs)("div",{children:[(0,Xo.jsx)("h1",{className:o?"k-same":void 0,children:e}),a&&(0,Xo.jsx)("p",{className:"k-dh-meta",children:a})]}),n]})]})}var _O=({children:e})=>(0,Xo.jsx)("div",{className:"k-doc",children:e});var Ks=O(ve(),1),eB=O(_o(),1);var ls="form.k-sform",pm=e=>HTMLFormElement.prototype.getAttribute.call(e,"id")??"",MG=e=>Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(e),PO="http://www.w3.org/2000/svg",Ws=e=>e.querySelector("[data-k-proof]"),us=e=>e.querySelector("[data-k-save]"),FO=e=>new Set(Array.from(Ws(e)?.querySelectorAll("input[name]")??[]).map(t=>t.name));function fy(e,t=null){let a=FO(e),n;try{n=t?new FormData(e,t):new FormData(e)}catch{n=new FormData(e)}let o=[];return n.forEach((r,s)=>{!a.has(s)&&typeof r=="string"&&o.push([s,r])}),o}function s1(e){let t=new Map;for(let[a,n]of e)t.set(a,[...t.get(a)??[],n]);return t}function qO(e){let t=FO(e),a=[];for(let n of Array.from(MG(e)))!n.name||n.type==="hidden"||n.type==="submit"||n.type==="button"||t.has(n.name)||a.includes(n.name)||a.push(n.name);return a}var Nr=e=>(e??"").replace(/\s+/g," ").trim();function $O(e,t){return e.querySelector(`[name="${CSS.escape(t)}"]`)}function DG(e,t){let a=$O(e,t);if(a===null)return t;let n=a.getAttribute("aria-label");if(n)return Nr(n);if(a.type==="radio"||a.type==="checkbox"&&a.getAttribute("role")!=="switch"){let s=a.closest("fieldset")?.querySelector("legend");if(s)return Nr(s.textContent)}let o=a.closest(".k-frow")?.querySelector(".k-frow-t");if(o)return Nr(o.textContent);let r=a.labels?.[0];return r?Nr(r.querySelector(".k-sl-t, b")?.textContent??r.textContent):t}function _G(e,t,a){let n=$O(e,t);if(n instanceof HTMLSelectElement)return Nr(Array.from(n.options).find(s=>s.value===a[0])?.textContent??a[0]);if(n?.type==="radio"||n?.type==="checkbox"){let s=Array.from(e.querySelectorAll(`[name="${CSS.escape(t)}"]`));if(n.type==="checkbox"&&n.getAttribute("role")==="switch")return a.length>0?"On":"Off";let i=s.filter(l=>a.includes(l.value)).map(l=>Nr(l.labels?.[0]?.querySelector("b")?.textContent??l.labels?.[0]?.textContent??l.value));return i.length===0?"none":i.join(", ")}let o=a[0]??"";if(n?.type==="password")return o===""?"unchanged":"a new value";let r=o.split(`
|
|
53
53
|
`)[0].trim();return r===""?"empty":r.length>40?`${r.slice(0,39)}…`:`${r}${o.includes(`
|
|
54
54
|
`)?"…":""}`}var PG=(e,t)=>JSON.stringify(e??[])===JSON.stringify(t??[]);function i1(e){let t=s1(fy(e));return qO(e).filter(a=>!PG(e.kInit?.get(a),t.get(a)))}function UO(e,t){let a=s1(t),n=e.hasAttribute("data-k-gate")?i1(e):qO(e);return n.length>3?`${n.length} changes`:n.map(o=>`${DG(e,o)}: ${_G(e,o,a.get(o)??[])}`).join(" · ")}function VO(e,t){let a=e.dataset.kProofIf;if(!a)return!0;let n=a.indexOf("=");return t.some(([o,r])=>o===a.slice(0,n)&&r===a.slice(n+1))}var a1=e=>e!==null&&e.querySelector('input[type="password"], a.sso-step-up')!==null;function dy(e){if(e.kPrepped)return;e.kPrepped=!0,e.kInit=s1(fy(e));for(let a of Array.from(Ws(e)?.querySelectorAll("input[required]")??[]))a.removeAttribute("required"),a.dataset.kRequired="";let t=us(e);t&&(t.dataset.kVariant=t.classList.contains("k-btn-danger")?"danger":t.classList.contains("k-btn-outline")?"outline":"primary")}function OO(){for(let e of Array.from(document.querySelectorAll(ls)))dy(e)}function OG(e,t){e.classList.remove("k-btn-primary","k-btn-outline","k-btn-danger"),e.classList.add(`k-btn-${t}`)}function BG(e){for(let t of Array.from(document.querySelectorAll(`${ls}[data-k-gate]`))){let a=us(t);!a||a.dataset.kVariant!=="primary"||OG(a,t===e||e===null?"primary":"outline")}}function zG(e,t){if(!e.hasAttribute("data-k-gate"))return;let a=i1(e),n=e.querySelector(".k-ssave-said");if(e.toggleAttribute("data-dirty",a.length>0),n)if(n.dataset.kIdle===void 0&&(n.dataset.kIdle=n.textContent??""),a.length===0)n.textContent=n.dataset.kIdle??"";else{let o=fy(e),r=Ws(e)!==null&&a1(Ws(e))&&VO(e,o)?" · Asks for your password.":"";n.textContent=`${UO(e,o)}${r}`}t&&BG(a.length>0?e:document.querySelector(`${ls}[data-k-gate][data-dirty]`))}function jO(e){let t=document.createElementNS(PO,"svg");t.setAttribute("class","k-i"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true");for(let a of ry[e]){let n=document.createElementNS(PO,a[0]);for(let[o,r]of Object.entries(a[1]))n.setAttribute(o,String(r));t.append(n)}return t}function fm(e,t,a){let n=document.createElement("button");n.type="button",n.className=`k-btn k-btn-${t}`;for(let[r,s]of Object.entries(a))n.setAttribute(r,s);let o=document.createElement("span");return o.className="k-face",o.textContent=e,n.append(o),n}function mm(e,t){let a=us(e);if(!a)return;let n=a.querySelector(".k-face");if(n&&a.dataset.kLabel===void 0&&(a.dataset.kLabel=n.textContent??""),a.classList.toggle("busy",t),a.toggleAttribute("aria-busy",t),n)if(n.replaceChildren(),t){let o=document.createElement("span");o.className="k-spin",o.setAttribute("aria-hidden","true"),n.append(o,a.dataset.kBusy??"Saving…")}else n.textContent=a.dataset.kLabel??"Save"}function WO(e){let t=e.querySelector(".k-ssave-err");t&&t.childElementCount>0&&t.replaceChildren(),us(e)?.removeAttribute("aria-describedby")}function n1(e,t){e.kPending=!1,e.kSent=!1,mm(e,!1);for(let n of Array.from(Ws(e)?.querySelectorAll('input[type="password"]')??[]))n.value="";let a=e.querySelector(".k-ssave-err");if(a){let n=document.createElement("p");n.className="k-notice",n.setAttribute("role","alert"),n.append(jO("alert"));let o=document.createElement("span");o.textContent=t,n.append(o),a.replaceChildren(n),a.id||(a.id=`${pm(e)||"k-sform"}-err`),us(e)?.setAttribute("aria-describedby",a.id),(e.querySelector(".k-ssave")??a).scrollIntoView({block:"center",behavior:"instant"})}us(e)?.focus({preventScroll:!0})}var KO=e=>{let t=Nr(e);return t===""?t:`${t.charAt(0).toUpperCase()}${t.slice(1)}${/[.!?]$/.test(t)?"":"."}`},o1=e=>`${KO(e)} Your edits are still here.`;function HG(e){try{let a=new DOMParser().parseFromString(e,"text/html").querySelector(".k-notice[role=alert] span, .problem, .k-notice[role=alert], [role=alert]"),n=Nr(a?.textContent);return n===""?null:n.slice(0,400)}catch{return null}}var kd=!1,FG=e=>Nr(e.closest("section")?.querySelector("h3")?.childNodes[0]?.textContent??e.closest("section")?.querySelector("h3")?.textContent)||"a section",qG=e=>Array.from(document.querySelectorAll(`${ls}[data-k-gate][data-dirty]`)).filter(t=>t!==e);function $G(e){let t=new URL(window.location.href);for(let n of["said","problem","unconfirmed"])t.searchParams.delete(n);t.searchParams.set("unconfirmed",pm(e));let a=e.closest("section[id]")?.id;return`${t.pathname}${t.search}${a?`#${a}`:""}`}var UG=(e,t)=>t instanceof HTMLButtonElement&&t.form===e&&t.hasAttribute("formaction")?t.formAction:new URL(HTMLFormElement.prototype.getAttribute.call(e,"action")??"",window.location.href).href;function t1(e){kd=!0,window.location.assign(pm(e)?$G(e):window.location.href)}async function VG(e,t,a,n){mm(e,!0);let o=new URLSearchParams;for(let[d,m]of[...t,...a])o.append(d,m);let r=UG(e,n),s;try{s=await fetch(r,{method:"POST",body:o,credentials:"same-origin",redirect:"follow",headers:yt({accept:"text/html"})})}catch{t1(e);return}let i=new URL(s.url||r,window.location.href);if(i.origin!==window.location.origin||i.pathname==="/login"){t1(e);return}let l=i.searchParams.get("problem");if(l){n1(e,o1(l));return}if(!s.redirected&&s.status>=400&&s.status<500){let d=HG(await s.text().catch(()=>""));n1(e,o1(d??`Toolroll refused this (${s.status}). Nothing changed`));return}if(!s.ok){t1(e);return}let u=i.pathname===window.location.pathname,c=e.closest("section[id]")?.id;kd=!0;let f=`${i.pathname}${i.search}${u&&c?`#${c}`:""}`;s.redirected&&`${i.pathname}${i.search}`!=`${window.location.pathname}${window.location.search}`?window.location.assign(f):(s.redirected&&window.history.replaceState(window.history.state,"",f),window.location.reload())}function BO(e,t){let a=e.hasAttribute("data-k-download");a||(kd=!0),e.kGo=!0;try{t instanceof HTMLButtonElement&&t.form===e?e.requestSubmit(t):e.requestSubmit()}finally{e.kGo=!1}if(a){kd=!1,e.kPending=!1,e.kSent=!1,mm(e,!1);for(let n of Array.from(Ws(e)?.querySelectorAll('input[type="password"]')??[]))n.value=""}}function r1(e,t,a,n){if(e.kPending=!0,e.hasAttribute("data-k-native")){if(e.hasAttribute("data-k-download")||mm(e,!0),e.hasAttribute("data-k-prepare")){let o=!1,r=s=>{o||(o=!0,s===null?BO(e,n):n1(e,o1(s)))};e.dispatchEvent(new CustomEvent("k-prepare",{detail:{done:r}}));return}BO(e,n);return}VG(e,t,a,n)}var GO=e=>Array.from(e?.querySelectorAll("input[name]")??[]).map(t=>[t.name,t.value]);function jG(e,t,a){let n=Ws(e),o=n.nextElementSibling,r=`${pm(e)||"k-sform"}-pop`,s=document.createElement("div");s.className="k-pop",s.id=r,s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.setAttribute("aria-labelledby",`${r}-h`),s.tabIndex=-1;let i=document.createElement("div");i.className="k-pop-h";let l=document.createElement("h3");l.id=`${r}-h`,l.textContent="Confirm with your password";let u=fm("","ghost",{"data-k-close":"","aria-label":"Close",title:"Close"});u.classList.add("k-btn-sm","k-btn-icon"),u.replaceChildren(jO("x")),i.append(l,u);let c=document.createElement("p");c.className="k-pop-terms",c.textContent=UO(e,t)||Nr(e.dataset.kConfirm);let f=document.createElement("p");f.textContent=[e.dataset.kConfirm,e.dataset.kNote].filter(Boolean).map(h=>KO(h)).join(" ");let d=document.createElement("div");d.className="k-acts";let m=Nr(us(e)?.dataset.kLabel??us(e)?.textContent)||"Save";d.append(fm(m,"primary",{"data-k-sconfirm":""}),fm("Cancel","ghost",{"data-k-close":""})),s.append(i,c,f,n,d),e.append(s),e.kSnapshot=t,e.kSubmitter=a,e.kPending=!0,e.kSent=!1,e.kClose=io(s,a??us(e),{onClose:()=>{if(o&&o.parentElement===e?o.before(n):e.insertBefore(n,e.querySelector(".k-ssave")),s.remove(),e.kClose=null,!e.kSent){e.kPending=!1;for(let h of Array.from(n.querySelectorAll('input[type="password"]')))h.value="",h.setCustomValidity("")}}})}function zO(e){let t=Ws(e),a=Array.from(t?.querySelectorAll('input[type="password"]')??[]).find(o=>o.value==="");if(a){a.setCustomValidity("Enter your password."),a.reportValidity(),a.focus();return}let n=GO(t);e.kSent=!0,e.kClose?.(),r1(e,e.kSnapshot??[],n,e.kSubmitter??null)}function WG(e,t){if(e.kPending||(dy(e),e.hasAttribute("data-k-gate")&&i1(e).length===0&&!(t instanceof HTMLButtonElement&&t.hasAttribute("formaction"))))return;let a=e.hasAttribute("data-k-download")?[]:qG(e);if(a.length>0){KG(e,a,t);return}YO(e,t)}function KG(e,t,a){let n=[...new Set(t.map(FG))],o=`${pm(e)||"k-sform"}-discard`,r=document.createElement("div");r.className="k-pop",r.id=o,r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-labelledby",`${o}-h`),r.tabIndex=-1;let s=document.createElement("div");s.className="k-pop-h";let i=document.createElement("h3");i.id=`${o}-h`,i.textContent="Unsaved changes",s.append(i);let l=document.createElement("p");l.textContent=`You have unsaved changes in ${n.length>1?`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`:n[0]}. Saving this will discard them.`;let u=document.createElement("div");u.className="k-acts";let c=fm("Save this anyway","primary",{"data-k-discard":""});u.append(c,fm("Cancel","ghost",{"data-k-close":""})),r.append(s,l,u),e.append(r),e.kPending=!0;let f=!1,d=io(r,a??us(e),{onClose:()=>{r.remove(),e.kPending=!1,f&&YO(e,a)}});c.addEventListener("click",m=>{m.preventDefault(),f=!0,d()}),c.focus()}function YO(e,t){WO(e);let a=fy(e,t);if(t instanceof HTMLButtonElement&&t.hasAttribute("formaction")){r1(e,a,[],t);return}let n=Ws(e);if(n!==null&&VO(e,a)&&a1(n)){jG(e,a,t);return}r1(e,a,n!==null&&!a1(n)?GO(n):[],t)}var HO=!1;function XO(){if(HO||typeof document>"u")return;HO=!0,document.documentElement.classList.add("k-js");let e=a=>{let n=a.target?.closest?.(ls);n&&dy(n)};document.addEventListener("focusin",e,!0),document.addEventListener("pointerdown",e,!0);let t=a=>{let n=a.target,o=n?.form;if(!o||!o.matches(ls)||n.closest("[data-k-proof], .k-pop")){n?.type==="password"&&n.setCustomValidity("");return}dy(o),WO(o),zG(o,!0)};document.addEventListener("input",t),document.addEventListener("change",t),document.addEventListener("submit",a=>{let n=a.target;if(!(n instanceof HTMLFormElement)||!n.matches(ls))return;let o=n;if(!o.kGo){if(a.preventDefault(),a.stopImmediatePropagation(),o.kClose){zO(o);return}WG(o,a.submitter??null)}},!0),document.addEventListener("click",a=>{let n=a.target?.closest?.("[data-k-sconfirm]");if(!n)return;let o=n.closest(ls);o&&(a.preventDefault(),zO(o))}),window.addEventListener("pageshow",()=>{kd=!1;for(let a of Array.from(document.querySelectorAll(ls)))a.kPending=!1,a.kSent=!1,mm(a,!1)}),window.addEventListener("standing-orders:workspace-rendered",OO),window.addEventListener("beforeunload",a=>{kd||document.querySelector(`${ls}[data-k-gate][data-dirty]`)===null||a.preventDefault()}),OO()}var GG="(max-width: 760px)",YG='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',ol=()=>typeof window<"u"&&window.matchMedia(GG).matches,XG=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;function Sd(e){let t=e.closest(".k-composer");if(t===null)return;let a=getComputedStyle(e),n=parseFloat(a.lineHeight)||21,o=(parseFloat(a.paddingTop)||0)+(parseFloat(a.paddingBottom)||0),r=n*(Number(e.dataset.max)||8)+o,s=n*(Number(e.dataset.min)||1)+o;e.style.height="auto",e.style.height=`${Math.max(s,Math.min(e.scrollHeight,r))}px`,e.style.overflowY=e.scrollHeight>r+1?"auto":"hidden";let i=e.value.trim()!=="";t.classList.toggle("has-text",i);for(let l of t.querySelectorAll(".k-send[data-gate]:not(:disabled)"))l.setAttribute("aria-disabled",String(!i))}function l1(e,t){let a=document.querySelector(`[data-k-composer="${CSS.escape(e)}"]`);a&&(a.classList.contains("working")&&!t&&a.classList.add("was-working"),a.classList.toggle("working",t))}function ZO(){let e=window.visualViewport;if(!e)return;let t=Math.max(0,Math.round(window.innerHeight-e.height-e.offsetTop));document.documentElement.style.setProperty("--kb",`${t}px`),document.documentElement.classList.toggle("kb-open",t>80)}var kn=[];function ZG(e,t){if(t===null||!t.isConnected)return;let a=t.getBoundingClientRect(),n=e.offsetWidth||336,o=e.offsetHeight||200,r=Math.min(Math.max(8,a.right-n),window.innerWidth-n-8),s=a.bottom+6,i=s+o>window.innerHeight-8?Math.max(8,a.top-o-6):s;e.style.left=`${Math.round(r)}px`,e.style.top=`${Math.round(i)}px`,e.style.setProperty("--origin",`${a.right-r}px ${i>=s?0:o}px`)}function io(e,t,a={}){kn.length>0&&!e.classList.contains("k-pop")&&my("close");let o=e.classList.contains("k-pop"),r=ol();e.isConnected||document.body.append(e);let s=document.createElement("div");s.className=`k-scrim${a.dim??(!o||r)?" dim":""}${kn.length>0?" stacked":""}`,e.before(s),e.hidden=!1,e.setAttribute("role",e.getAttribute("role")??"dialog"),e.setAttribute("aria-modal","true"),e.hasAttribute("tabindex")||(e.tabIndex=-1),e.classList.toggle("stacked",kn.length>0),e.classList.toggle("as-sheet",o&&r),o&&!r&&ZG(e,t),XG()||(e.classList.remove("k-grow-in"),e.offsetWidth,e.classList.add("k-grow-in"));let i=[];for(let c=e;c&&c!==document.body;c=c.parentElement)c.inert&&(c.inert=!1,i.push(c));let l=[];for(let c=e;c!==document.body&&c.parentElement;c=c.parentElement)for(let f of Array.from(c.parentElement.children))f===c||f===s||f.inert||(f.inert=!0,l.push(f));let u={panel:e,scrim:s,trigger:t,inerted:l,released:i,onClose:a.onClose};return QG(),kn.push(u),s.addEventListener("click",()=>xu(u,"scrim")),(e.querySelector("[autofocus]")??e.querySelector('input:not([type="hidden"]), textarea, select')??e).focus(),()=>xu(u,"close")}function xu(e,t){let a=kn.indexOf(e);if(!(a<0)){for(let n of kn.slice(a+1).reverse())xu(n,"removed");kn.splice(a,1),kn.length===0&&(wu?.disconnect(),wu=null);for(let n of e.inerted)n.inert=!1;for(let n of e.released)n.isConnected&&(n.inert=!0);e.scrim.remove(),e.panel.hidden=!0,e.panel.classList.remove("k-grow-in","as-sheet","stacked"),JG(e.trigger),e.onClose?.(t)}}function u1(){for(let e of kn.slice().reverse())e.panel.isConnected||xu(e,"removed");kn.length===0&&(wu?.disconnect(),wu=null)}var wu=null;function QG(){wu!==null||typeof MutationObserver>"u"||(wu=new MutationObserver(()=>{kn.some(e=>!e.panel.isConnected)&&u1()}),wu.observe(document.body,{childList:!0,subtree:!0}))}function my(e="removed"){for(let t of kn.slice().reverse())xu(t,e)}function py(e){return e!=null&&e.isConnected&&e.getClientRects().length>0}function JG(e){let t=e?.getAttribute("data-k-open");if(py(e)){e.focus();return}((t?Array.from(document.querySelectorAll(`[data-k-open="${CSS.escape(t)}"]`)).find(py):void 0)??Array.from(document.querySelectorAll(".k-dock .k-btn")).find(py))?.focus()}function e9(e){let t=kn[kn.length-1];if(!t)return;if(e.key==="Escape"){e.preventDefault(),xu(t,"escape");return}if(e.key!=="Tab")return;let a=Array.from(t.panel.querySelectorAll(YG)).filter(py);if(a.length===0){e.preventDefault(),t.panel.focus();return}let n=a[0],o=a[a.length-1];e.shiftKey&&(document.activeElement===n||document.activeElement===t.panel)?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),n.focus())}function Ir(e,t,a){let n=ol(),o=document.createElement("div"),r=`k-menu-${Math.random().toString(36).slice(2,8)}`;o.className=n?"k-sheet":"k-pop k-pop-menu",o.setAttribute("role","dialog"),o.setAttribute("aria-labelledby",r);let s=document.createElement("div");s.className=n?"k-sheet-h":"k-pop-h";let i=document.createElement(n?"h2":"h3");i.id=r,i.textContent=t;let l=document.createElement("button");l.type="button",l.className="k-btn k-btn-ghost k-btn-sm k-btn-icon",l.setAttribute("aria-label","Close"),l.setAttribute("data-k-close",""),l.textContent="×",s.append(i,l);let u=document.createElement("div");u.className="k-menu";let c=()=>{};for(let f of a){let d=document.createElement("button");d.type="button",d.textContent=f.current?`${f.label} · current`:f.label,f.current&&d.setAttribute("aria-current","true"),d.addEventListener("click",()=>{c(),f.act()}),u.append(d)}return o.append(s,u),c=io(o,e,{onClose:()=>o.remove()}),c}function t9(e){let t=e.target,a=t?.closest("[data-k-composer-project]"),n=t?.closest("[data-k-composer-plus]"),o=a?.dataset.kComposerProject??n?.dataset.kComposerPlus;if(o===void 0)return!1;e.preventDefault();let r=document.getElementById(`${o}-project`),s=u=>{if(!r)return;let c=[];try{let f=JSON.parse(r.dataset.items??"[]");Array.isArray(f)&&(c=f.filter(d=>typeof d=="string"))}catch{c=[]}Ir(u,"Project",c.map(f=>({label:f,current:f===r.value,act:()=>{r.value=f;let d=document.querySelector(`[data-k-composer-project="${CSS.escape(o)}"] [data-k-project-name]`);d&&(d.textContent=f),document.querySelector(`[data-k-composer-project="${CSS.escape(o)}"]`)?.setAttribute("aria-label",`Project: ${f}. Change`),r.dispatchEvent(new Event("change",{bubbles:!0}))}})))};if(a)return s(a),!0;let i=document.querySelector(`input[type="file"][data-k-attach="${CSS.escape(o)}"]`),l=[];return i&&l.push({label:"Attach a file",act:()=>i.click()}),r&&l.push({label:"Choose project",act:()=>s(document.querySelector(`[data-k-composer-project="${CSS.escape(o)}"]`)??n)}),l.length>0&&Ir(n,"Add to your message",l),!0}function a9(e,t){let a=e.closest("[data-k-draft]");if(a===null)return!1;let n=document.getElementById(`${a.dataset.kInto??""}-text`);if(!(n instanceof HTMLTextAreaElement)||n.disabled)return!0;t.preventDefault();let o=a.dataset.kDraft??"",r=n.value;return n.value=r.trim()===""?o:r.includes(o)?r:`${r.trimEnd()}
|
|
55
55
|
${o}`,Sd(n),n.focus(),!0}var QO=!1,JO=new WeakMap;function n9(){let e=document.documentElement;e.classList.add("k-js"),document.addEventListener("keydown",t=>{(t.key==="Tab"||t.key==="F6")&&e.classList.add("k-kbd")},!0),document.addEventListener("pointerdown",()=>{e.classList.remove("k-kbd")},!0)}function hm(){if(QO||typeof document>"u")return;QO=!0,document.addEventListener("input",t=>{let a=t.target;a instanceof HTMLTextAreaElement&&a.classList.contains("k-composer-ta")&&Sd(a)}),document.addEventListener("click",t=>{let a=t.target;if(a===null)return;if(a.closest('.k-send[data-gate][aria-disabled="true"]')){t.preventDefault();return}if(a9(a,t)||t9(t))return;let o=a.closest("[data-k-open]");if(o){let s=document.getElementById(o.dataset.kOpen??"");s&&(t.preventDefault(),io(s,o));return}if(a.closest("[data-k-close]")){let s=kn[kn.length-1];s&&s.panel.contains(a)&&(t.preventDefault(),xu(s,"close"));return}let r=a.closest("button.k-switch[role=switch][data-k-switch]");if(r){let s=r.getAttribute("aria-checked")!=="true";r.setAttribute("aria-checked",String(s));let[i,l]=(r.dataset.kSwitch||"On|Off").split("|"),u=r.querySelector("[data-k-words]");u&&(u.textContent=(s?i:l)??""),r.dispatchEvent(new CustomEvent("k-switch",{bubbles:!0,detail:{on:s}}));return}a.closest("[data-k-print]")&&(t.preventDefault(),window.print())}),document.addEventListener("submit",t=>{let a=t.target;if(!(a instanceof HTMLFormElement)||t.defaultPrevented)return;let n=(t.submitter instanceof HTMLButtonElement?t.submitter:null)??a.querySelector("button[type=submit][data-k-busy]"),o=n?.dataset.kBusy;if(n==null||o===void 0)return;if(a.getAttribute("aria-busy")==="true"){t.preventDefault();return}a.setAttribute("aria-busy","true");let r=n.querySelector(".k-face");r!==null&&(JO.set(n,Array.from(r.childNodes)),r.replaceChildren(Object.assign(document.createElement("span"),{className:"k-spin"}),document.createTextNode(o)),r.firstElementChild?.setAttribute("aria-hidden","true")),n.classList.add("busy")}),window.addEventListener("pageshow",()=>{for(let t of document.querySelectorAll("form[aria-busy=true]")){t.removeAttribute("aria-busy");for(let a of Array.from(Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(t))){if(!(a instanceof HTMLButtonElement)||!a.classList.contains("busy")||a.dataset.kBusy===void 0)continue;a.classList.remove("busy");let n=a.querySelector(".k-face"),o=JO.get(a);n!==null&&o!==void 0&&n.replaceChildren(...o)}}}),document.addEventListener("keydown",e9,!0),n9();let e=()=>{u1();for(let t of document.querySelectorAll(".k-composer-ta"))Sd(t)};window.addEventListener("standing-orders:workspace-rendered",e),window.visualViewport?.addEventListener("resize",ZO),window.visualViewport?.addEventListener("scroll",ZO),XO(),e()}var ua=O(Z(),1);function Zo({kind:e,title:t,sub:a,trigger:n,onClose:o,children:r}){let s=(0,Ks.useRef)(null),i=(0,Ks.useRef)(o);i.current=o;let l=(0,Ks.useId)();(0,Ks.useLayoutEffect)(()=>{let m=s.current;if(!m)return;let h=!1,y=io(m,n,{onClose:w=>{h=!0,i.current(w)}});return()=>{h||y()}},[n]);let u=(0,ua.jsx)(de,{variant:"ghost",iconOnly:"x",label:"Close",sm:e==="popover"||e==="menu","data-k-close":""}),c=e==="menu"?(0,ua.jsx)("div",{className:"k-menu",children:r}):r,f=e==="drawer"?(0,ua.jsxs)(ua.Fragment,{children:[(0,ua.jsxs)("header",{className:"k-drawer-h",children:[(0,ua.jsx)("h2",{id:l,children:t}),u]}),(0,ua.jsx)("div",{className:"k-drawer-b",children:c})]}):e==="sheet"?(0,ua.jsxs)(ua.Fragment,{children:[(0,ua.jsxs)("div",{className:"k-sheet-h",children:[(0,ua.jsxs)("div",{className:"k-sheet-ht",children:[(0,ua.jsx)("h2",{id:l,children:t}),a&&(0,ua.jsx)(xa,{children:a})]}),u]}),(0,ua.jsx)("div",{className:"k-sheet-b",children:c})]}):(0,ua.jsxs)(ua.Fragment,{children:[(0,ua.jsxs)("div",{className:"k-pop-h",children:[(0,ua.jsx)("h3",{id:l,children:t}),u]}),c]}),d=e==="drawer"?"k-drawer":e==="sheet"?"k-sheet":Je("k-pop",e==="menu"&&"k-pop-menu");return(0,eB.createPortal)((0,ua.jsx)("div",{ref:s,className:d,role:"dialog","aria-modal":"true","aria-labelledby":l,tabIndex:-1,children:f}),document.body)}function Cd(){return(0,Ks.useCallback)((e,t,a)=>{Ir(e,t,a)},[])}var cs=O(Z(),1);function To({wait:e,status:t,text:a,body:n,acts:o,terms:r,err:s}){return(0,cs.jsxs)("section",{className:Je("k-slots",e&&"wait"),children:[(0,cs.jsx)("div",{className:"k-slot-status",children:t}),(0,cs.jsx)("p",{className:"k-slot-text",children:a}),n!==void 0&&(0,cs.jsx)("div",{className:"k-slot-body",children:n}),(0,cs.jsx)("div",{className:"k-slot-acts k-acts",children:o}),(0,cs.jsx)("p",{className:"k-slot-terms",children:r}),(0,cs.jsx)("div",{className:"k-slot-err",children:s?(0,cs.jsx)(ln,{children:s}):null})]})}var rl=O(ve(),1);var Ka=O(Z(),1);function gm({kind:e,facts:t,label:a,terms:n,text:o,primary:r=!0,docked:s,busy:i="Starting…",onApprove:l,check:u}){let c=nl(e,t),[f,d]=(0,rl.useState)(null),[m,h]=(0,rl.useState)(!1),[y,w]=(0,rl.useState)(null),v=(0,rl.useRef)(!1),x=(0,rl.useId)(),g=async k=>{if(!v.current){v.current=!0,h(!0),w(null);try{let C=await l(k,wO(e,t));w(C),C===null&&d(null)}finally{v.current=!1,h(!1)}}};if(c==="automatic")return null;let b=k=>{k.preventDefault();let C=new FormData(k.currentTarget).get("token");g(typeof C=="string"?C:"")};return(0,Ka.jsxs)(Ka.Fragment,{children:[(0,Ka.jsx)(de,{variant:r?"primary":"outline",label:a,docked:s===!0,busy:m&&f===null?i:!1,"aria-haspopup":c==="password"?"dialog":void 0,...r?{"data-ink-approve":""}:{},onClick:k=>{!Ld(k)||v.current||u!==void 0&&!u()||(c==="password"?d(k.currentTarget):g(null))}}),c==="click"&&y&&(0,Ka.jsx)(ln,{children:y}),f&&(0,Ka.jsxs)(Zo,{kind:"popover",title:"Confirm with your password",trigger:f,onClose:()=>{d(null),w(null)},children:[o&&(0,Ka.jsx)("p",{children:o}),(0,Ka.jsx)("p",{className:"k-pop-terms",children:n}),(0,Ka.jsxs)("form",{className:"k-field",onSubmit:b,children:[(0,Ka.jsx)("label",{className:"k-label",htmlFor:x,children:"Your password"}),(0,Ka.jsx)(_n,{id:x,type:"password",name:"token",autoComplete:"current-password",required:!0,autoFocus:!0,"aria-describedby":`${x}-err`,"aria-invalid":y?!0:void 0}),(0,Ka.jsx)("span",{className:"k-err",id:`${x}-err`,role:"alert",children:y??""}),(0,Ka.jsxs)(is,{children:[(0,Ka.jsx)(de,{type:"submit",variant:"primary",label:a,busy:m?i:!1}),(0,Ka.jsx)(de,{variant:"ghost",label:"Cancel","data-k-close":""})]})]}),(0,Ka.jsx)("p",{className:"k-pop-foot k-note",children:gu(e,{...t,remembered:!1,passwordless:!1})==="Asks for your password."&&e==="standard"?"After this, standard approvals on this computer need no password for 15 minutes.":gu(e,t)})]})]})}function Ld(e){return e.nativeEvent.isTrusted!==!1}var tB=O(Z(),1);var aB=O(ve(),1);var zt=O(Z(),1);function c1({label:e="Steps",chip:t,rows:a,scale:n,foot:o,head:r="Step"}){let[s,i]=(0,aB.useState)(!1),l=kO(a,n),u=c=>c==="wait"?(0,zt.jsx)("span",{className:"k-wd"}):c==="q"||c==="waiting"?(0,zt.jsx)("span",{className:"k-qd"}):c==="run"?(0,zt.jsx)("span",{className:"k-rund"}):(0,zt.jsx)(at,{name:c==="ok"?"check":"x",small:!0});return(0,zt.jsxs)("section",{className:Je("k-timing",s&&"show-chart"),"aria-label":e,children:[(0,zt.jsxs)("header",{className:"k-timing-h",children:[(0,zt.jsx)("h2",{children:e}),(0,zt.jsx)("span",{className:"k-timing-state",children:t}),(0,zt.jsx)(de,{className:"k-phone-only",variant:"ghost",sm:!0,label:s?"Hide timing":"Show timing","aria-expanded":s,onClick:()=>i(c=>!c)})]}),(0,zt.jsxs)("div",{className:"k-timing-b",children:[(0,zt.jsxs)("div",{className:"k-crow head","aria-hidden":"true",children:[(0,zt.jsx)("span",{}),(0,zt.jsx)("span",{children:r}),(0,zt.jsx)("span",{className:"k-crow-lane",children:"Elapsed time"}),(0,zt.jsx)("span",{children:"Status"}),(0,zt.jsx)("span",{className:"k-crow-s",children:"Time"})]}),a.map((c,f)=>{let d=l[f],m=c.st==="run"||c.st==="bad"||c.st==="wait"||c.st==="waiting";return(0,zt.jsxs)("div",{className:Je("k-crow",c.st,m&&"now"),children:[(0,zt.jsx)("span",{className:"k-crow-i",children:u(c.st)}),(0,zt.jsxs)("span",{className:"k-crow-n",children:[c.name,(0,zt.jsx)("span",{className:"k-crow-sub",children:c.sub??(c.st==="q"?"not reached":"")})]}),(0,zt.jsx)("span",{className:"k-crow-lane",children:d&&(0,zt.jsx)("i",{className:"k-crow-bar",style:{left:`${d.left}%`,width:`${d.width}%`}})}),(0,zt.jsx)("span",{className:"k-crow-w",children:bO[c.st]}),(0,zt.jsx)("span",{className:"k-crow-s k-num",children:c.st==="q"?"–":xO(c.dur)})]},`${c.name}-${f}`)})]}),o&&(0,zt.jsx)("div",{className:"k-timing-f",children:o})]})}var nB=O(Z(),1);var Ga=O(Z(),1);function d1({label:e="Steps",rows:t,onToggle:a}){return(0,Ga.jsx)("ol",{className:"k-steprows","aria-label":e,children:t.map(n=>{let o=n.body!==void 0&&n.body!==null&&n.body!=="",r=CO(n.key),s=(0,Ga.jsxs)(Ga.Fragment,{children:[(0,Ga.jsxs)("span",{className:"k-steprow-label",children:[n.label,(0,Ga.jsxs)("span",{className:"k-sr",children:[", ",SO[n.mark]]})]}),(0,Ga.jsxs)("span",{className:"k-steprow-say",children:[n.needsYou&&(0,Ga.jsx)(Oe,{word:"Needs you",tone:"needs"}),n.sentence!==""&&(0,Ga.jsx)("span",{children:n.sentence})]}),n.at?(0,Ga.jsx)("time",{className:"k-steprow-time k-num",dateTime:n.at,children:n.when??""}):null]});return(0,Ga.jsxs)("li",{className:Je("k-steprow",n.mark),"data-step-row":n.key,"aria-current":n.current?"step":void 0,children:[(0,Ga.jsx)("span",{className:"k-steprow-mark","aria-hidden":"true"}),(0,Ga.jsxs)("div",{className:"k-steprow-main",children:[n.toggle&&o?(0,Ga.jsx)("button",{className:"k-steprow-head",type:"button","aria-expanded":n.open?"true":"false","aria-controls":r,onClick:()=>a?.(n.key),children:s}):(0,Ga.jsx)("div",{className:"k-steprow-head",children:s}),o&&(0,Ga.jsx)("div",{className:"k-steprow-body",id:r,hidden:!n.open,children:n.body})]})]},n.key)})})}var oB=O(ve(),1);var Gs=O(Z(),1),rB=({label:e,children:t})=>(0,Gs.jsx)("div",{className:"k-board",role:"region","aria-label":e,children:t});function sB({label:e,count:t,needs:a,on:n,empty:o,children:r}){let s=oB.Children.toArray(r).length>0;return(0,Gs.jsxs)("section",{className:Je("k-col",n&&"on"),"aria-label":e,children:[(0,Gs.jsxs)("h2",{className:Je("k-col-h",a&&"needs"),children:[e,t]}),s?r:(0,Gs.jsx)("p",{className:"k-col-e",children:o})]})}var iB=({href:e,title:t,meta:a})=>(0,Gs.jsxs)("a",{className:"k-card",href:e,children:[(0,Gs.jsx)("span",{className:"k-card-t",children:t}),(0,Gs.jsx)("span",{className:"k-card-m",children:a})]});var vm=O(Z(),1);function f1({label:e,value:t,onChange:a,placeholder:n}){return(0,vm.jsxs)("label",{className:"k-filter",children:[(0,vm.jsx)(at,{name:"search",small:!0}),(0,vm.jsx)("input",{type:"search",value:t,placeholder:n??e,"aria-label":e,onChange:o=>a(o.target.value)})]})}var p1=O(Z(),1);var m1=O(Z(),1);var Ys=O(Z(),1),Qo=({children:e})=>(0,Ys.jsx)("div",{className:"k-dock",children:(0,Ys.jsx)("div",{className:"k-dock-primary",children:e})});function lB({count:e,label:t,scope:a,onOpen:n}){return(0,Ys.jsxs)("button",{type:"button",className:"k-dock-needs","aria-haspopup":"dialog","aria-label":`Needs you: ${t}`,onClick:n,children:[(0,Ys.jsxs)("span",{className:"k-dock-needs-l",children:[(0,Ys.jsx)("span",{className:"k-dot needs","aria-hidden":"true"}),"Needs you",(0,Ys.jsx)(Lt,{n:e,ink:!0})]}),(0,Ys.jsx)("span",{className:"k-dock-needs-s",children:a})]})}var Xs=O(ve(),1);var ca=O(Z(),1);function sl({id:e,label:t,placeholder:a,value:n,onChange:o,onSend:r,onStop:s,working:i=!1,rows:l=1,maxRows:u=8,project:c,onProject:f,attach:d,mentions:m,menu:h,before:y,note:w,error:v,disabled:x,line:g,gate:b=!0,sendLabel:k="Send",stopLabel:C="Stop",submit:N=!1,sendDisabled:L=!1,textareaId:A,name:P,maxLength:F,textareaRef:B,onKeyDown:H,enterSends:S,combobox:I=null}){let R=(0,Xs.useRef)(null),E=(0,Xs.useRef)(null),q=(0,Xs.useRef)(null),M=n.trim()==="";(0,Xs.useEffect)(()=>{hm()},[]),(0,Xs.useLayoutEffect)(()=>{R.current&&Sd(R.current)},[n]),(0,Xs.useEffect)(()=>{l1(e,i)},[e,i]);let _=Q=>{let ne=R.current,V=ne?.selectionStart??n.length,z=V>0&&!/\s$/.test(n.slice(0,V))?" ":"";o(n.slice(0,V)+z+Q+" "+n.slice(V)),ne?.focus()},G=Q=>{c&&Ir(Q,"Project",c.items.map(ne=>({label:ne,current:ne===c.current,act:()=>f?.(ne)})))},re=[...d?[{label:"Attach a file",act:()=>E.current?.click()}]:[],...m&&m.length>0?[{label:"Mention a task",act:()=>{let Q=q.current??R.current;Q&&Ir(Q,"Mention a task",m.map(ne=>({label:ne.label,act:()=>_(ne.text)})))}}]:[],...c?[{label:"Choose project",act:()=>{let Q=q.current;Q&&G(Q)}}]:[],...h??[]],oe=()=>{b&&M||L||(N?R.current?.form?.requestSubmit():r())},$=A??`${e}-text`,W=Q=>{R.current=Q,typeof B=="function"?B(Q):B&&(B.current=Q)};return(0,ca.jsxs)("div",{className:"k-composer-field",children:[(0,ca.jsxs)("div",{className:Je("k-composer",g&&"line",x&&"off",!M&&"has-text",i&&"working"),"data-k-composer":e,children:[(0,ca.jsx)("label",{className:"k-sr",htmlFor:$,children:t}),(0,ca.jsx)("div",{className:"k-composer-files","data-k-files":e}),(0,ca.jsx)("textarea",{ref:W,className:"k-composer-ta",id:$,name:P,maxLength:F,rows:l,"data-min":l,"data-max":u,placeholder:a,value:n,disabled:x,role:I?"combobox":void 0,"aria-expanded":I?I.expanded:void 0,"aria-controls":I?I.controls:void 0,"aria-invalid":v?!0:void 0,"aria-describedby":`${e}-err`,onChange:Q=>o(Q.target.value),onKeyDown:Q=>{H?.(Q),!Q.defaultPrevented&&Q.key==="Enter"&&!Q.shiftKey&&!Q.nativeEvent.isComposing&&(S?S(Q):!ol())&&(Q.preventDefault(),oe())}}),(0,ca.jsxs)("div",{className:"k-composer-bar",children:[re.length>0&&(0,ca.jsx)("button",{type:"button",className:"k-composer-plus","aria-haspopup":"dialog","aria-label":"Add to your message",disabled:x,onClick:Q=>Ir(Q.currentTarget,"Add to your message",re),children:(0,ca.jsx)(at,{name:"plus"})}),d&&(0,ca.jsx)("input",{ref:E,type:"file",className:"k-sr",tabIndex:-1,"aria-hidden":"true",onChange:Q=>{let ne=Q.target.files?.[0];ne&&d(ne),Q.target.value=""}}),c&&(0,ca.jsxs)("button",{ref:q,type:"button",className:"k-composer-chip","aria-haspopup":"dialog","aria-label":`Project: ${c.current}. Change`,disabled:x,onClick:Q=>G(Q.currentTarget),children:[(0,ca.jsx)("span",{children:c.current}),c.sub&&(0,ca.jsx)("span",{className:"k-chip-sub",children:c.sub})]}),y,(0,ca.jsx)("span",{className:"k-grow"}),(0,ca.jsxs)("span",{className:"k-send-slot",children:[(0,ca.jsx)("button",{type:N?"submit":"button",className:"k-send","aria-label":k,title:k,"data-gate":b||L?"1":void 0,"aria-disabled":b&&M||L?!0:void 0,disabled:x,onClick:N?Q=>{(b&&M||L)&&Q.preventDefault()}:oe,children:(0,ca.jsx)(at,{name:"send"})}),s&&(0,ca.jsx)("button",{type:"button",className:"k-send k-stop","aria-label":C,title:C,onClick:s,children:(0,ca.jsx)(at,{name:"stop"})})]})]})]}),w&&(0,ca.jsx)("p",{className:"k-note k-composer-note",children:w}),(0,ca.jsx)("div",{className:"k-composer-err k-err",id:`${e}-err`,role:"alert",children:v??""})]})}var Ya=O(ve(),1);var Me=O(Z(),1),uB=1500,o9=/^(?:(?:-{0,5}|-----B|-----BE|-----BEG|-----BEGI)\|(?:-{0,5}|-----B|-----BE|-----BEG|-----BEGI)\|(?:-{0,5}|-----B|-----BE|-----BEG|-----BEGI)\|[COE]?)?$/,ym=e=>({items:[],notes:[],older:0,detail:null,state:e===null?"unavailable":"loading",final:!1,offset:0,gen:null,inKey:!1,keyTail:"",seq:0,revision:0});function v1(e,t){let a={...e,items:e.items.slice(),revision:e.revision+1};if(Array.isArray(t.notes)&&(a.notes=t.notes),typeof t.older=="number"&&(a.older=t.older),t.error==="off")return{...a,state:"off"};let n=new Map;a.items.forEach((o,r)=>{o.kind==="step"&&n.set(o.key,r)});for(let o of t.records??[])switch(o.k){case"open":a.detail=o.detail;break;case"start":a.items.push({key:`m${a.seq++}`,kind:"marker",at:o.at,words:"The agent started"});break;case"say":a.items.push({key:`t${a.seq++}`,kind:"say",at:o.at,lines:o.t});break;case"step":n.set(o.id,a.items.length),a.items.push({key:o.id,kind:"step",at:o.at,step:o.kind,target:o.target??null,once:o.once===!0,done:null});break;case"done":{let r=n.get(o.id),s=r===void 0?void 0:a.items[r];s!==void 0&&s.kind==="step"&&(a.items[r]={...s,done:{at:o.at,ok:o.ok,out:o.out??[]}});break}case"cut":a.items.push({key:`c${a.seq++}`,kind:"marker",at:o.at,words:"A line was too long to show"});break;case"cap":a.items.push({key:`p${a.seq++}`,kind:"marker",at:o.at,words:"The live view stopped at its size limit. The run's record continues."});break}return a.items.length>uB&&(a.items=a.items.slice(-uB)),typeof t.nextOffset=="number"&&t.nextOffset>=a.offset&&(a.offset=t.nextOffset),typeof t.gen=="string"&&(a.gen=t.gen),typeof t.inKey=="boolean"&&(a.inKey=t.inKey),typeof t.keyTail=="string"&&(a.keyTail=o9.test(t.keyTail)?t.keyTail:""),a.final=t.final===!0,a.state="ready",a}var cB=50;function y1(e,t,a=!1){let[n,o]=(0,Ya.useState)(()=>ym(e)),r=(0,Ya.useRef)(a);r.current=a;let s=()=>r.current||h1(),i=(0,Ya.useRef)(null);return(0,Ya.useEffect)(()=>{let l=ym(e);if(o(l),i.current=null,e===null)return;let u=!1,c=0,f=h=>{l=h,u||o(h)},d=()=>{window.clearTimeout(c);let h=()=>{i.current=null,window.clearTimeout(c),u||m()};i.current=h,r.current||(c=window.setTimeout(h,500))},m=async()=>{if(s()){d();return}let h=2e3;try{for(let y=0;y<cB&&!u;y+=1){if(s()){d();return}let w=`${l.gen===null?"":`&gen=${encodeURIComponent(l.gen)}`}${l.inKey?"&inkey=1":""}${l.keyTail===""?"":`&ktail=${encodeURIComponent(l.keyTail)}`}`,v=await fetch(`${e}&from=${l.offset}${w}`,{cache:"no-store",credentials:"same-origin",redirect:"manual"});if(u)return;if(v.status===409){f({...ym(e),notes:l.notes,revision:l.revision+1,items:[{key:`restart:${l.revision}`,kind:"marker",at:"",words:"The view restarted"}]});continue}if(!v.ok){f({...l,state:l.items.length===0?"unavailable":"error",revision:l.revision+1});break}let x=await v.json();if(u)return;let g=l.offset;if(f(v1(l,x)),l.state==="off"||l.final||l.offset===g)break;y===cB-1&&(h=0)}}catch{f({...l,state:l.items.length===0?"unavailable":"error",revision:l.revision+1})}u||l.final&&!t||l.state==="off"&&!t||(c=window.setTimeout(()=>{m()},h))};return m(),()=>{u=!0,i.current=null,window.clearTimeout(c)}},[e,t]),(0,Ya.useEffect)(()=>{a||i.current?.()},[a]),n}var h1=()=>typeof document<"u"&&document.querySelector('input[type="password" i]')!==null;function hy(){let[e,t]=(0,Ya.useState)(h1);return(0,Ya.useEffect)(()=>{let a=()=>t(h1());a();let n=new MutationObserver(a);return n.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["type"]}),()=>n.disconnect()},[]),e}var g1={session:"Started",message:"Said",edit:"Edited files",command:"Ran a command",read:"Read the code",search:"Searched the code",lookup:"Looked something up",plan:"Updated its plan",delegate:"Asked a helper",tool:"Used a tool"},fB={edit:"Edited",read:"Read",search:"Searched for",lookup:"Looked up",delegate:"Asked a helper:"},pB=e=>{let t=Date.parse(e);return Number.isNaN(t)?"":new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},r9=(e,t)=>{let a=Date.parse(t)-Date.parse(e);return Number.isNaN(a)||a<0?null:a<1e3?"<1s":a<6e4?`${Math.round(a/1e3)}s`:`${Math.floor(a/6e4)}m ${Math.round(a%6e4/1e3)}s`};function s9({item:e,final:t}){let a=fB[e.step],n=e.step==="command"&&e.target!==null,o=e.done,r=e.once?null:o===null?t?{words:"No result",tone:"muted"}:{words:"Running",tone:"running"}:o.ok===!0?{words:"Done",tone:"ok"}:o.ok===!1?{words:"Failed",tone:"failed"}:{words:"Ended without a result",tone:"muted"},s=o===null||o.ok===null?null:r9(e.at,o.at),i=o?.out??[],[l,u]=(0,Ya.useState)(!1);return(0,Me.jsxs)("li",{className:Je("k-work-step",r?.tone==="running"&&"running"),"data-step":e.step,children:[(0,Me.jsxs)("span",{className:"k-work-step-l",children:[r?.tone==="running"&&(0,Me.jsx)("span",{className:"k-work-dot","aria-hidden":"true"}),(0,Me.jsx)("span",{className:"k-work-step-t",children:e.target===null?g1[e.step]:n?(0,Me.jsx)("code",{className:"k-mono","data-step-target":!0,children:e.target}):(0,Me.jsxs)(Me.Fragment,{children:[a??g1[e.step]," ",(0,Me.jsx)("code",{className:"k-mono","data-step-target":!0,children:e.target})]})}),r!==null&&(0,Me.jsxs)("span",{className:Je("k-work-step-s",r.tone),"data-step-status":r.tone,children:[r.tone==="ok"?(0,Me.jsx)(at,{name:"check",small:!0}):r.tone==="failed"?(0,Me.jsx)(at,{name:"x",small:!0}):null,(0,Me.jsx)("span",{className:r.tone==="ok"?"k-sr":void 0,children:r.words}),s!==null&&(0,Me.jsx)("span",{className:"k-num",children:s})]}),i.length>0&&(0,Me.jsx)(de,{variant:"ghost",sm:!0,label:l?"Hide output":"Show output","aria-expanded":l,onClick:()=>u(c=>!c),"data-step-toggle":!0})]}),i.length>0&&(0,Me.jsx)("div",{hidden:!l,className:"k-work-out","data-step-output":!0,children:i.join(`
|