toolroll 0.9.110 → 0.9.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/README.md +5 -1
  3. package/THIRD_PARTY_NOTICES.md +30 -0
  4. package/dist/action-ledger.js +13 -0
  5. package/dist/agent-detect.js +1 -1
  6. package/dist/agent-said-schema.js +4 -0
  7. package/dist/agent-said.js +77 -0
  8. package/dist/approval-summary.js +39 -8
  9. package/dist/bin.js +5 -1
  10. package/dist/browser/THIRD_PARTY_NOTICES.txt +30 -0
  11. package/dist/browser/terminal.js +1 -1
  12. package/dist/browser/workspace.js +1 -1
  13. package/dist/builder.js +6 -1
  14. package/dist/chat-channel.js +10 -0
  15. package/dist/claim.js +28 -13
  16. package/dist/cli-help.js +7 -1
  17. package/dist/cli.js +2 -0
  18. package/dist/codex-limits.js +21 -8
  19. package/dist/console-instance.js +2 -1
  20. package/dist/contracts/console-api.js +3 -2
  21. package/dist/contracts/engine-api.js +15 -3
  22. package/dist/contracts/lead-tools.js +28 -0
  23. package/dist/contracts/route.js +1 -0
  24. package/dist/dispatch.js +1 -1
  25. package/dist/dispose.js +15 -9
  26. package/dist/easy-start.js +19 -3
  27. package/dist/engine-reads.js +79 -2
  28. package/dist/evidence.js +6 -6
  29. package/dist/fast-start.js +20 -11
  30. package/dist/flexible-start.js +1 -1
  31. package/dist/integrations.js +6 -1
  32. package/dist/lead-tools.js +107 -1
  33. package/dist/lead.js +1 -1
  34. package/dist/ledger-view.js +2 -1
  35. package/dist/local-owner.js +1 -0
  36. package/dist/needs-you.js +12 -2
  37. package/dist/operate.js +57 -9
  38. package/dist/outbound-privacy.js +6 -1
  39. package/dist/phase-routing.js +3 -1
  40. package/dist/plain-words.js +1 -1
  41. package/dist/plane-review.js +1 -1
  42. package/dist/proposal.js +2 -2
  43. package/dist/provider-connection.js +14 -2
  44. package/dist/release.js +1 -0
  45. package/dist/route-store.js +1 -1
  46. package/dist/serve.js +6 -4
  47. package/dist/server/chat.js +6 -1
  48. package/dist/server/pages.js +4 -1
  49. package/dist/server/render-history.js +2 -1
  50. package/dist/server/render-tasks.js +5 -2
  51. package/dist/server/route-table.js +2 -0
  52. package/dist/server/settings-section-table.js +3 -0
  53. package/dist/server/settings-sections.js +36 -0
  54. package/dist/server/settings.js +36 -0
  55. package/dist/server/tasks.js +31 -4
  56. package/dist/settings-proofs.js +1 -0
  57. package/dist/store.js +83 -11
  58. package/dist/task-sizing-schema.js +14 -0
  59. package/dist/task-sizing.js +76 -10
  60. package/dist/toolroll-update.js +3 -1
  61. package/dist/tui/darwin-arm64/toolroll-tui +0 -0
  62. package/dist/tui/darwin-x64/toolroll-tui +0 -0
  63. package/dist/tui/linux-arm64/toolroll-tui +0 -0
  64. package/dist/tui/linux-x64/toolroll-tui +0 -0
  65. package/dist/view-tools.js +94 -0
  66. package/dist/webhooks.js +8 -2
  67. package/dist/work-index.js +4 -4
  68. package/package.json +2 -1
@@ -49,7 +49,7 @@ Error generating stack: `+n.message+`
49
49
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
50
50
  `)},Gj=0,Kc=[];function X2(e){var t=Wt.useRef([]),a=Wt.useRef([0,0]),n=Wt.useRef(),o=Wt.useState(Gj++)[0],r=Wt.useState(hp)[0],s=Wt.useRef(e);Wt.useEffect(function(){s.current=e},[e]),Wt.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=D2([e.lockRef.current],(e.shards||[]).map(G2),!0).filter(Boolean);return w.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var i=Wt.useCallback(function(w,x){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!s.current.allowPinchZoom;var v=fv(w),y=a.current,g="deltaX"in w?w.deltaX:y[0]-v[0],b="deltaY"in w?w.deltaY:y[1]-v[1],k,C=w.target,N=Math.abs(g)>Math.abs(b)?"h":"v";if("touches"in w&&N==="h"&&C.type==="range")return!1;var L=window.getSelection(),R=L&&L.anchorNode,z=R?R===C||R.contains(C):!1;if(z)return!1;var M=zk(N,C);if(!M)return!0;if(M?k=N:(k=N==="v"?"h":"v",M=zk(N,C)),!M)return!1;if(!n.current&&"changedTouches"in w&&(g||b)&&(n.current=k),!k)return!0;var _=n.current||k;return W2(_,x,w,_==="h"?g:b,!0)},[]),l=Wt.useCallback(function(w){var x=w;if(!(!Kc.length||Kc[Kc.length-1]!==r)){var v="deltaY"in x?K2(x):fv(x),y=t.current.filter(function(k){return k.name===x.type&&(k.target===x.target||x.target===k.shadowParent)&&Wj(k.delta,v)})[0];if(y&&y.should){x.cancelable&&x.preventDefault();return}if(!y){var g=(s.current.shards||[]).map(G2).filter(Boolean).filter(function(k){return k.contains(x.target)}),b=g.length>0?i(x,g[0]):!s.current.noIsolation;b&&x.cancelable&&x.preventDefault()}}},[]),u=Wt.useCallback(function(w,x,v,y){var g={name:w,delta:x,target:v,should:y,shadowParent:Xj(v)};t.current.push(g),setTimeout(function(){t.current=t.current.filter(function(b){return b!==g})},1)},[]),c=Wt.useCallback(function(w){a.current=fv(w),n.current=void 0},[]),f=Wt.useCallback(function(w){u(w.type,K2(w),w.target,i(w,e.lockRef.current))},[]),d=Wt.useCallback(function(w){u(w.type,fv(w),w.target,i(w,e.lockRef.current))},[]);Wt.useEffect(function(){return Kc.push(r),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:d}),document.addEventListener("wheel",l,Wl),document.addEventListener("touchmove",l,Wl),document.addEventListener("touchstart",c,Wl),function(){Kc=Kc.filter(function(w){return w!==r}),document.removeEventListener("wheel",l,Wl),document.removeEventListener("touchmove",l,Wl),document.removeEventListener("touchstart",c,Wl)}},[]);var m=e.removeScrollBar,h=e.inert;return Wt.createElement(Wt.Fragment,null,h?Wt.createElement(r,{styles:Kj(o)}):null,m?Wt.createElement(Ok,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Xj(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Y2=Ek(dv,X2);var Z2=pv.forwardRef(function(e,t){return pv.createElement(mp,Kn({},e,{ref:t,sideCar:Y2}))});Z2.classNames=mp.classNames;var vp=Z2;var Yj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Gc=new WeakMap,mv=new WeakMap,hv={},Hk=0,Q2=function(e){return e&&(e.host||Q2(e.parentNode))},Zj=function(e,t){return t.map(function(a){if(e.contains(a))return a;var n=Q2(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})},Qj=function(e,t,a,n){var o=Zj(t,Array.isArray(e)?e:[e]);hv[a]||(hv[a]=new WeakMap);var r=hv[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",w=(Gc.get(d)||0)+1,x=(r.get(d)||0)+1;Gc.set(d,w),r.set(d,x),s.push(d),w===1&&h&&mv.set(d,!0),x===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(),Hk++,function(){s.forEach(function(f){var d=Gc.get(f)-1,m=r.get(f)-1;Gc.set(f,d),r.set(f,m),d||(mv.has(f)||f.removeAttribute(n),mv.delete(f)),m||f.removeAttribute(a)}),Hk--,Hk||(Gc=new WeakMap,Gc=new WeakMap,mv=new WeakMap,hv={})}},gv=function(e,t,a){a===void 0&&(a="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||Yj(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Qj(n,o,a,"aria-hidden")):function(){return null}};var va=H(Z(),1),Jj=Object.defineProperty,lr=(e,t)=>Jj(e,"name",{value:t,configurable:!0}),qk="Dialog",[J2,cie]=kn(qk),[eW,Ms]=J2(qk),$k=lr(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]=$l({prop:n,defaultProp:o??!1,onChange:r,caller:qk}),[f,d]=aa.useState(0),[m,h]=aa.useState(0);return(0,va.jsx)(eW,{scope:t,triggerRef:i,contentRef:l,contentId:Vr(),titleId:Vr(),descriptionId:Vr(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:d,setDescriptionCount:h,open:u,onOpenChange:c,onOpenToggle:aa.useCallback(()=>c(w=>!w),[c]),modal:s,children:a})},"Dialog");var eM="DialogPortal",[tW,tM]=J2(eM,{forceMount:void 0}),Uk=lr(e=>{let{__scopeDialog:t,forceMount:a,children:n,container:o}=e,r=Ms(eM,t);return(0,va.jsx)(tW,{scope:t,forceMount:a,children:aa.Children.map(n,s=>(0,va.jsx)(Ul,{present:a||r.open,children:(0,va.jsx)(sv,{asChild:!0,container:o,children:s})}))})},"DialogPortal"),Fk="DialogOverlay",Vk=aa.forwardRef(lr(function(t,a){let n=tM(Fk,t.__scopeDialog),{forceMount:o=n.forceMount,...r}=t,s=Ms(Fk,t.__scopeDialog);return s.modal?(0,va.jsx)(Ul,{present:o||s.open,children:(0,va.jsx)(nW,{...r,ref:a})}):null},"DialogOverlay")),aW=jn("DialogOverlay.RemoveScroll"),nW=aa.forwardRef(lr(function(t,a){let{__scopeDialog:n,...o}=t,r=Ms(Fk,n),s=gk(),i=Tt(a,s);return(0,va.jsx)(vp,{as:aW,allowPinchZoom:!0,shards:[r.contentRef],children:(0,va.jsx)(ta.div,{"data-state":Gk(r.open),...o,ref:i,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),yp="DialogContent",jk=aa.forwardRef(lr(function(t,a){let n=tM(yp,t.__scopeDialog),{forceMount:o=n.forceMount,...r}=t,s=Ms(yp,t.__scopeDialog);return(0,va.jsx)(Ul,{present:o||s.open,children:s.modal?(0,va.jsx)(oW,{...r,ref:a}):(0,va.jsx)(rW,{...r,ref:a})})},"DialogContent")),oW=aa.forwardRef(lr(function(t,a){let n=Ms(yp,t.__scopeDialog),o=aa.useRef(null),r=Tt(a,n.contentRef,o);return aa.useEffect(()=>{let s=o.current;if(s)return gv(s)},[]),(0,va.jsx)(aM,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ut(t.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ut(t.onPointerDownOutside,s=>{let i=s.detail.originalEvent,l=i.button===0&&i.ctrlKey===!0;(i.button===2||l)&&s.preventDefault()}),onFocusOutside:ut(t.onFocusOutside,s=>s.preventDefault())})},"DialogContentModal")),rW=aa.forwardRef(lr(function(t,a){let n=Ms(yp,t.__scopeDialog),o=aa.useRef(!1),r=aa.useRef(!1);return(0,va.jsx)(aM,{...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")),aM=aa.forwardRef(lr(function(t,a){let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:s,...i}=t,l=Ms(yp,n);return Vc(),(0,va.jsx)(va.Fragment,{children:(0,va.jsx)(ov,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:s,children:(0,va.jsx)(nv,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":Gk(l.open),...i,ref:a,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),sW="DialogTitle",Wk=aa.forwardRef(lr(function(t,a){let{__scopeDialog:n,...o}=t,r=Ms(sW,n),{setTitleCount:s}=r;return ga(()=>(s(i=>i+1),()=>s(i=>i-1)),[s]),(0,va.jsx)(ta.h2,{id:r.titleId,...o,ref:a})},"DialogTitle"));var iW="DialogClose",Kk=aa.forwardRef(lr(function(t,a){let{__scopeDialog:n,...o}=t,r=Ms(iW,n);return(0,va.jsx)(ta.button,{type:"button",...o,ref:a,onClick:ut(t.onClick,()=>r.onOpenChange(!1))})},"DialogClose"));function Gk(e){return e?"open":"closed"}lr(Gk,"getState");var Xc=H(Z(),1);function ur(...e){return e.filter(Boolean).join(" ")}function cr({summary:e,className:t,children:a,...n}){return(0,Xc.jsxs)("details",{className:ur("ui-disclosure",t),...n,children:[(0,Xc.jsx)("summary",{className:"ui-disclosure-trigger",children:e}),(0,Xc.jsx)("div",{className:"ui-disclosure-content",children:a})]})}function Cn({className:e,tone:t="info",...a}){return(0,Xc.jsx)("div",{role:t==="error"?"alert":"status","data-tone":t,className:ur("ui-alert",`ui-alert--${t}`,e),...a})}var yv=H(we(),1);var Qa=H(we(),1);var uW={damping:.7,stiffness:.05,mass:1.25},cW=70,dW=1e3/60,fW=350,vv=!1;globalThis.document?.addEventListener("mousedown",()=>{vv=!0});globalThis.document?.addEventListener("mouseup",()=>{vv=!1});globalThis.document?.addEventListener("click",()=>{vv=!1});var oM=(e={})=>{let[t,a]=(0,Qa.useState)(!1),[n,o]=(0,Qa.useState)(e.initial!==!1),[r,s]=(0,Qa.useState)(!1),i=(0,Qa.useRef)(null);i.current=e;let l=(0,Qa.useCallback)(()=>{if(!vv)return!1;let y=window.getSelection();if(!y||!y.rangeCount)return!1;let g=y.getRangeAt(0);return g.commonAncestorContainer.contains(x.current)||x.current?.contains(g.commonAncestorContainer)},[]),u=(0,Qa.useCallback)(y=>{f.isAtBottom=y,o(y)},[]),c=(0,Qa.useCallback)(y=>{f.escapedFromLock=y,a(y)},[]),f=(0,Qa.useMemo)(()=>{let y;return{escapedFromLock:t,isAtBottom:n,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return x.current?.scrollTop??0},set scrollTop(g){if(x.current){let{scrollBehavior:b}=getComputedStyle(x.current);b!=="auto"&&(x.current.style.scrollBehavior="auto"),x.current.scrollTop=g,f.ignoreScrollToTop=x.current.scrollTop,b!=="auto"&&(x.current.style.scrollBehavior=b)}},get targetScrollTop(){return!x.current||!v.current?0:x.current.scrollHeight-1-x.current.clientHeight},get calculatedTargetScrollTop(){if(!x.current||!v.current)return 0;let{targetScrollTop:g}=this;if(!e.targetScrollTop)return g;if(y?.targetScrollTop===g)return y.calculatedScrollTop;let b=Math.max(Math.min(e.targetScrollTop(g,{scrollElement:x.current,contentElement:v.current}),g),0);return y={targetScrollTop:g,calculatedScrollTop:b},requestAnimationFrame(()=>{y=void 0}),b},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=cW}}},[]),d=(0,Qa.useCallback)((y={})=>{typeof y=="string"&&(y={animation:y}),y.preserveScrollPosition||u(!0);let g=Date.now()+(Number(y.wait)||0),b=Yk(i.current,y.animation),{ignoreEscapes:k=!1}=y,C,N=f.calculatedTargetScrollTop;y.duration instanceof Promise?y.duration.finally(()=>{C=Date.now()}):C=g+(y.duration??0);let L=async()=>{let R=new Promise(requestAnimationFrame).then(()=>{if(!f.isAtBottom)return f.animation=void 0,!1;let{scrollTop:z}=f,M=performance.now(),_=(M-(f.lastTick??M))/dW;if(f.animation||(f.animation={behavior:b,promise:R,ignoreEscapes:k}),f.animation.behavior===b&&(f.lastTick=M),l()||g>Date.now())return L();if(z<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*_,f.scrollTop+=f.accumulated,f.scrollTop!==z&&(f.accumulated=0)}return L()}return C>Date.now()?(N=f.calculatedTargetScrollTop,L()):(f.animation=void 0,f.scrollTop<f.calculatedTargetScrollTop?d({animation:Yk(i.current,i.current.resize),ignoreEscapes:k,duration:Math.max(0,C-Date.now())||void 0}):f.isAtBottom)});return R.then(z=>(requestAnimationFrame(()=>{f.animation||(f.lastTick=void 0,f.velocity=0)}),z))};return y.wait!==!0&&(f.animation=void 0),f.animation?.behavior===b?f.animation.promise:L()},[u,l,f]),m=(0,Qa.useCallback)(()=>{c(!0),u(!1)},[c,u]),h=(0,Qa.useCallback)(({target:y})=>{if(y!==x.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]),w=(0,Qa.useCallback)(({target:y,deltaY:g})=>{let b=y;for(;!["scroll","auto"].includes(getComputedStyle(b).overflow);){if(!b.parentElement)return;b=b.parentElement}b===x.current&&g<0&&x.current.scrollHeight>x.current.clientHeight&&!f.animation?.ignoreEscapes&&(c(!0),u(!1))},[c,u,f]),x=nM(y=>{x.current?.removeEventListener("scroll",h),x.current?.removeEventListener("wheel",w),y?.addEventListener("scroll",h,{passive:!0}),y?.addEventListener("wheel",w,{passive:!0})},[]),v=nM(y=>{if(f.resizeObserver?.disconnect(),f.resizeObserver=void 0,!y)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=Yk(i.current,g?i.current.resize:i.current.initial);d({animation:N,wait:!0,preserveScrollPosition:!0,duration:N==="instant"?void 0:fW})}else f.isNearBottom&&(c(!1),u(!0));g=k,requestAnimationFrame(()=>{setTimeout(()=>{f.resizeDifference===C&&(f.resizeDifference=0)},1)})}),f.resizeObserver?.observe(y)},[]);return{contentRef:v,scrollRef:x,scrollToBottom:d,stopScroll:m,isAtBottom:n||r,isNearBottom:r,escapedFromLock:t,state:f}};function nM(e,t){let a=(0,Qa.useCallback)(n=>(a.current=n,e(n)),t);return a}var Xk=new Map;function Yk(...e){let t={...uW},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 Xk.has(n)||Xk.set(n,Object.freeze(t)),a?"instant":Xk.get(n)}var Kl=H(we(),1),Gn=H(we(),1);var rM=(0,Gn.createContext)(null),pW=typeof window<"u"?Gn.useLayoutEffect:Gn.useEffect;function wp({instance:e,children:t,resize:a,initial:n,mass:o,damping:r,stiffness:s,targetScrollTop:i,contextRef:l,...u}){let c=(0,Gn.useRef)(null),f=Kl.useCallback((k,C)=>(b?.targetScrollTop??i)?.(k,C)??k,[i]),d=oM({mass:o,damping:r,stiffness:s,resize:a,initial:n,targetScrollTop:f}),{scrollRef:m,contentRef:h,scrollToBottom:w,stopScroll:x,isAtBottom:v,escapedFromLock:y,state:g}=e??d,b=(0,Gn.useMemo)(()=>({scrollToBottom:w,stopScroll:x,scrollRef:m,isAtBottom:v,escapedFromLock:y,contentRef:h,state:g,get targetScrollTop(){return c.current},set targetScrollTop(k){c.current=k}}),[w,v,h,m,x,y,g]);return(0,Gn.useImperativeHandle)(l,()=>b,[b]),pW(()=>{m.current&&getComputedStyle(m.current).overflow==="visible"&&(m.current.style.overflow="auto")},[]),Kl.createElement(rM.Provider,{value:b},Kl.createElement("div",{...u},typeof t=="function"?t(b):t))}(function(e){function t({children:a,scrollClassName:n,...o}){let r=xp();return Kl.createElement("div",{ref:r.scrollRef,style:{height:"100%",width:"100%",scrollbarGutter:"stable both-edges"},className:n},Kl.createElement("div",{...o,ref:r.contentRef},typeof a=="function"?a(r):a))}e.Content=t})(wp||(wp={}));function xp(){let e=(0,Gn.useContext)(rM);if(!e)throw new Error("use-stick-to-bottom component context must be used within a StickToBottom component");return e}var sM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,iM=ch,Yc=(e,t)=>a=>{var n;if(t?.variants==null)return iM(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=sM(c)||sM(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[w,x]=h;return Array.isArray(x)?x.includes({...r,...i}[w]):{...r,...i}[w]===x})?[...u,f,d]:u},[]);return iM(e,s,l,a?.class,a?.className)};var lM=H(Z(),1),mW=Yc("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 me({className:e,variant:t,size:a,asChild:n=!1,type:o,...r}){return(0,lM.jsx)(n?a2:"button",{"data-slot":"button",className:ve(mW({variant:t,size:a}),e),...n?{}:{type:o??"button"},...r})}var wo=H(Z(),1);function cM({className:e,children:t,...a}){return(0,wo.jsx)(wp,{className:ur("ui-conversation",e),initial:"instant",resize:"instant",role:"log","aria-label":"Conversation",...a,children:typeof t=="function"?n=>(0,wo.jsxs)(wo.Fragment,{children:[t(n),(0,wo.jsx)(uM,{})]}):(0,wo.jsxs)(wo.Fragment,{children:[t,(0,wo.jsx)(uM,{})]})})}function uM(){let{scrollRef:e,state:t,scrollToBottom:a}=xp(),n=(0,yv.useRef)(()=>t.isAtBottom&&!t.escapedFromLock);return n.current=()=>t.isAtBottom&&!t.escapedFromLock,(0,yv.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 dM({className:e,...t}){return(0,wo.jsx)(wp.Content,{className:ur("ui-conversation-content",e),...t})}function fM({className:e,from:t,...a}){return(0,wo.jsx)("article",{className:ur("ui-message",`ui-message--${t}`,e),"data-from":t,...a})}function wv({className:e,...t}){return(0,wo.jsx)("div",{className:ur("ui-message-content",e),...t})}var Zk=H(we(),1);var Qk=H(Z(),1);var Iie=(0,Zk.createContext)(null);function pM({className:e,...t}){return(0,Qk.jsx)("section",{className:ur("ui-artifact",e),...t})}function mM({className:e,...t}){return(0,Qk.jsx)("div",{className:ur("ui-artifact-content",e),...t})}var hM=H(Z(),1);var Gl=H(we(),1),bp=H(Z(),1),Xn=(0,Gl.createContext)(""),Oi=(0,Gl.createContext)(!1);var He=(0,Gl.forwardRef)(function({children:t,...a},n){let o=(0,Gl.useContext)(Xn);return(0,bp.jsxs)("form",{ref:n,method:"post",...a,children:[(0,bp.jsx)("input",{type:"hidden",name:"csrf",value:o}),t]})});var gM="x-toolroll-work";var hW="toolroll.key",gW="x-toolroll-key",vW=/^[0-9a-f]{64}$/;function yW(){try{let e=globalThis.localStorage?.getItem(hW)??null;if(e===null)return null;let t=JSON.parse(e),a=typeof t=="object"&&t!==null?t.key:null;return typeof a=="string"&&vW.test(a)?a:null}catch{return null}}function Kt(e){let t=yW();return t===null?e:{...e,[gW]:t}}function xv(e,t){t===""||!Number.isSafeInteger(e)||e<=0||fetch("/agents/seen",{method:"POST",credentials:"same-origin",headers:Kt({accept:"application/json"}),body:new URLSearchParams({csrf:t,run:String(e)})}).catch(()=>{})}function vM(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:Kt({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 yM=864e5,Jk="standing-orders:workspace-draft:",xM="standing-orders:workspace-carry:",eS=/^[a-f0-9]{32}$/;function tS(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("")}function bv(e,t){return`${e}${encodeURIComponent(t.user)}:${e===Jk?`${t.session}:`:""}${encodeURIComponent(t.task??"")}`}function Zc(e,t=Date.now()){return{text:"",request:e,submitted:!1,pending:null,at:t}}function $t(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xW(e,t){return $t(e)&&typeof e.request=="string"&&eS.test(e.request)&&typeof e.text=="string"&&e.text.length<=t}function bM(e,t,a,n,o=Date.now()){let r=Zc(a,o);try{let s=bv(Jk,t),i=JSON.parse(e.getItem(s)??"null");if($t(i)&&i.user===t.user&&i.session===t.session&&i.task===t.task&&typeof i.at=="number"&&i.at>o-yM&&i.at<=o&&typeof i.text=="string"&&i.text.length<=n&&typeof i.request=="string"&&eS.test(i.request)&&typeof i.submitted=="boolean"&&(i.pending===null||xW(i.pending,n)))return{text:i.text,request:i.request,submitted:i.submitted,pending:i.pending,at:i.at};e.removeItem(s);let l=bv(xM,t),u=JSON.parse(e.getItem(l)??"null");if(e.removeItem(l),$t(u)&&u.user===t.user&&u.task===t.task&&typeof u.at=="number"&&u.at>o-yM&&u.at<=o&&typeof u.text=="string"&&u.text.length<=n)return{...r,text:u.text}}catch{}return r}function aS(e,t,a){try{let n=bv(Jk,t);return a.text||a.pending?e.setItem(n,JSON.stringify({...t,...a})):e.removeItem(n),!0}catch{return!1}}function kM(e,t,a,n=Date.now()){try{return t.user&&a.trim()&&e.setItem(bv(xM,t),JSON.stringify({user:t.user,task:t.task,text:a,at:n})),!0}catch{return!1}}function kv(e,t,a=tS,n=Date.now()){return{...e,text:t,request:e.submitted?a():e.request,submitted:!1,at:n}}function SM(e,t=Date.now()){return e.pending||!e.text.trim()?e:{...e,submitted:!0,pending:{request:e.request,text:e.text},at:t}}function CM(e,t,a,n=tS,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?Zc(n(),o):{...e,pending:null,at:o}}function LM(e,t,a=tS,n=Date.now()){return e.pending?.request!==t?e:e.submitted&&e.request===t&&e.text===e.pending.text?Zc(a(),n):{...e,pending:null,at:n}}function NM(e,t){return e.pending?.request===t?{...e,pending:null,submitted:!1}:e}var bW=0;function IM(e,t,a=null){let n=e.conversation?.sessionId===bW&&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 Sv(e){if(!e.startsWith("/")||e.startsWith("//"))throw new Error("Unexpected workspace address");return e}function kW(e){return $t(e)&&(e.sandbox===null||typeof e.sandbox=="string")&&Array.isArray(e.steps)&&e.steps.every(t=>$t(t)&&typeof t.key=="string"&&typeof t.title=="string"&&typeof t.done=="boolean"&&(t.action===null||$t(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=>$t(t)&&typeof t.label=="string"&&typeof t.draft=="string"&&typeof t.source=="string")}function Qc(e){if(!$t(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=>$t(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&&!($t(e.view)&&typeof e.view.kind=="string")||e.work!==void 0&&!(Array.isArray(e.work)&&e.work.every(a=>$t(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=>$t(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&&!kW(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=>$t(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=>$t(a)&&[a.name,a.path,a.href,a.knowledgeHref].every(n=>typeof n=="string"))||!Array.isArray(e.crew)||!e.crew.every(a=>$t(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||$t(a.action)&&typeof a.action.label=="string"&&typeof a.action.href=="string"))||!(e.focus===null||$t(e.focus)&&typeof e.focus.id=="string"&&typeof e.focus.title=="string"&&typeof e.focus.html=="string")||!(e.result===null||$t(e.result)&&typeof e.result.runId=="number"&&typeof e.result.html=="string")||!(e.receipt===null||$t(e.receipt)&&typeof e.receipt.request=="string"&&typeof e.receipt.received=="boolean"))return!1;let t=e.conversation;return t===null||$t(t)&&typeof t.sessionId=="number"&&typeof t.user=="string"&&typeof t.version=="string"&&typeof t.requestId=="string"&&eS.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(wM)&&(t.previous===void 0||t.previous===null||$t(t.previous)&&Array.isArray(t.previous.messages)&&t.previous.messages.every(wM))&&(t.failure===void 0||t.failure===null||typeof t.failure=="string")}function wM(e){return $t(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=>$t(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 jr=class extends Error{},TM={[gM]:String(2)};async function RM(e,t,a=fetch,n={}){let o=new URL(Sv(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",...TM,...r?{"if-none-match":r}:{}},signal:AbortSignal.timeout(12e3)});if(s.status===401||s.status===403||s.redirected)throw new jr("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(!Qc(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 EM(e,t,a=fetch,n=null){let o=e.conversation;if(!o)throw new jr("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:Kt({accept:"application/json"}),signal:AbortSignal.timeout(15e3)});if(s.status===401||s.status===403)throw new jr("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 jr("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($t(i)&&i.ok===!1)return{refused:!0,message:typeof i.said=="string"?i.said:"Message not sent. Your draft is saved."};let l=$t(i)&&i.ok===!0&&i.request===t.request&&typeof i.session=="number"&&Number.isSafeInteger(i.session)&&i.session>0?{session:i.session}:{};return $t(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 AM(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 SW=8e3;async function Jc(e,t,a=fetch,n){let o;try{o=new URL(Sv(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,SW);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,...TM}});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 Qc(u)?u:null}catch{return null}finally{clearTimeout(i),n?.removeEventListener("abort",s)}}var sa=H(we(),1);var td=H(we(),1);var CW="x-toolroll-live";var LW=/^[0-9a-f]{24}$/;function nS(e,t){let a=Math.min(6e4,1e3*2**(Math.min(e,30)+1));return a/2+t*(a/2)}var rS=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}},MM=()=>({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"||NW(location.hostname)});function NW(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 DM(){return typeof fetch=="function"&&typeof ReadableStream=="function"&&typeof TextDecoder=="function"&&typeof AbortController=="function"}function oS(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 Cv=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=oS(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(oS),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=oS(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",[CW]:"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 rS,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"&&LW.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=nS(Number.POSITIVE_INFINITY,this.deps.random())):this.deps.online()?(this.waiting="backoff",n=nS(this.attempt,this.deps.random()),this.attempt+=1):(this.waiting="offline",n=nS(Number.POSITIVE_INFINITY,this.deps.random())),this.setState(this.waiting==="backoff"?"reconnecting":this.waiting==="offline"?"offline":"signed-out"),this.schedule(n)}};var Tv="so:live",PM=["change","here","gone","turn"],Lv=3e4,Nv=2e3,ad=(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}`}`},IW=new Set(["workspace","summary","chat","team"]),TW=e=>e.split(/[:?]/,1)[0]??"",Iv=e=>e===""?[]:new URLSearchParams(e.slice(e.indexOf("?")+1)).getAll("room");function RW(){return typeof document>"u"?"eventsource":document.getElementById("standing-orders-workspace")?.dataset.liveReader==="stream"&&DM()?"stream":"eventsource"}var sS=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?IW.has(TW(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(Tv,{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??=RW(),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=Iv(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<Nv){this.settling===null&&(this.settling=window.setTimeout(()=>{this.settling=null,this.reconcile()},Nv-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(Iv(t)),this.refusedAt=0;for(let r of PM)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()+Lv,window.setTimeout(()=>this.reconcile(),Lv))}),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()+Lv,window.setTimeout(()=>this.reconcile(),Lv)}})}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=Iv(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<Nv){this.settling===null&&(this.settling=window.setTimeout(()=>{this.settling=null,this.reconcile()},Nv-o));return}this.unsettle(),a===""?delete document.documentElement.dataset.live:document.documentElement.dataset.live="1",t.want(a,document.hidden)}startSupervisor(){let t=new Cv({...MM(),...this.deps},{opened:n=>{this.held=new Set(Iv(n)),this.refusedAt=0},frame:(n,o)=>{if(n==="reload"){this.deliver("reload","{}");return}PM.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())}},ed=new sS,EW=new Set(["workspace"]);if(typeof window<"u"){let e=window,t=n=>(typeof n=="string"&&EW.has(n)&&ed.subscribe(n,()=>{}),0),a=e.__soLiveRooms;if(Array.isArray(a))for(let n of a)t(n);e.__soLiveRooms={push:t}}function iS(e){ed.setQuiet(e)}function Ln(e,t,a=!1){let n=(0,td.useRef)(t);n.current=t,(0,td.useEffect)(()=>{if(e!==null)return ed.subscribe(e,(o,r)=>n.current(o,r),a)},[e,a])}function OM(e,t){return ed.subscribe(e,t)}function BM(){return(0,td.useSyncExternalStore)(ed.onConnectionState,ed.connectionState,()=>"idle")}var Rv=H(Z(),1),AW=Yc("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"}}),MW={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 Wr({className:e,tone:t,size:a,dot:n=!1,children:o,...r}){return(0,Rv.jsxs)("span",{"data-slot":"badge",className:ve(AW({tone:t,size:a}),e),...r,children:[n&&t!=="needs"&&(0,Rv.jsx)("span",{"aria-hidden":"true","data-badge-dot":!0,className:ve("size-1.5 shrink-0 rounded-full bg-current",MW[t??"neutral"])}),o]})}var zM=H(we(),1);var HM=H(Z(),1),DW=Object.defineProperty,_W=(e,t)=>DW(e,"name",{value:t,configurable:!0}),PW=zM.forwardRef(_W(function(t,a){return(0,HM.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")),FM=PW;var qM=H(we(),1);var Qe=(...e)=>e.filter(Boolean).join(" ");var Bi=H(Z(),1);function Ev({label:e,hint:t,error:a,children:n}){let o=(0,qM.useId)(),r=Qe(t&&`${o}-hint`,`${o}-err`);return(0,Bi.jsxs)("div",{className:"k-field",children:[(0,Bi.jsx)("label",{className:"k-label",htmlFor:o,children:e}),n({id:o,describedBy:r,invalid:!!a}),t&&(0,Bi.jsx)("p",{className:"k-hint",id:`${o}-hint`,children:t}),(0,Bi.jsx)("span",{className:"k-err",id:`${o}-err`,role:"alert",children:a??""})]})}var Nn=({className:e,...t})=>(0,Bi.jsx)("input",{className:Qe("k-input",e),...t}),nd=({className:e,...t})=>(0,Bi.jsx)("textarea",{className:Qe("k-textarea",e),...t});var Av=H(Z(),1);function Xl({className:e,...t}){return(0,Av.jsx)(FM,{"data-slot":"label",className:ve("flex items-center gap-2 text-sm font-medium leading-none",e),...t})}function Be({className:e,...t}){return(0,Av.jsx)(Nn,{"data-slot":"input",className:e,...t})}function Gt({className:e,...t}){return(0,Av.jsx)(nd,{"data-slot":"textarea",className:e,...t})}var Mv=H(we(),1);var $M=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function UM(e,t,a=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:$M(e),size:24,node:t,...a.length>0?{aliases:a}:{}}}var VM=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=VM(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Sp=H(we(),1);var kp=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var zi={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 lS(e){return e!=null}function WM(e,t={}){let a=t.attributeNames??{},n=d=>a[d]??d,o=e.size??e.width??zi.width,r=e.size??e.height??zi.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?kp(...l):kp("lucide",...i,...l),c=t.absoluteStrokeWidth?Number(t.strokeWidth??zi["stroke-width"])*Number(e.size??e.width??zi.width)/Number(t.size??t.width??zi.width):t.strokeWidth??zi["stroke-width"];return["svg",{...Object.entries(zi).reduce((d,[m,h])=>(d[n(m)]=h,d),{}),..."color"in t&&t.color&&{[n("stroke")]:t.color},..."size"in t&&lS(t.size)&&{[n("width")]:t.size,[n("height")]:t.size},..."width"in t&&lS(t.width)&&{[n("width")]:t.width},..."height"in t&&lS(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,w]=d,x=t.nonScalingStroke?{[n("vector-effect")]:"non-scaling-stroke",...h}:h;return w?[m,x,w]:[m,x]})]}function KM(e,t={}){return WM(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var GM=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var od=H(we(),1);var BW=(0,od.createContext)({});var XM=()=>(0,od.useContext)(BW);var YM=(0,Sp.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:w=!1,nonScalingStroke:x=!1,color:v="currentColor",className:y=""}=XM()??{},g=!!l||GM(f),[b,k,C=[]]=KM(c,{color:e??v,width:a??t??m,height:n??t??m,strokeWidth:o??h,absoluteStrokeWidth:r??w,nonScalingStroke:s??x,className:kp(y,i),hasA11yProp:g,attributes:f});return(0,Sp.createElement)(b,{ref:d,...k},[...C.map(([N,L])=>(0,Sp.createElement)(N,L)),...Array.isArray(l)?l:[l]])});function Ie(e,t=[],a=[]){let n=typeof e=="string"?UM(e,t,a):e,o=(0,Mv.forwardRef)(({className:r,...s},i)=>(0,Mv.createElement)(YM,{ref:i,icon:n,className:r,...s}));return n.name&&(o.displayName=jM(n.name)),o}var ZM={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"}]]};ZM.node;var Cp=Ie(ZM);var QM={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"}]]};QM.node;var Lp=Ie(QM);var JM={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"}]]};JM.node;var Np=Ie(JM);var eD={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"}]]};eD.node;var Ip=Ie(eD);var tD={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};tD.node;var Ds=Ie(tD);var aD={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};aD.node;var Tp=Ie(aD);var nD={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};nD.node;var rd=Ie(nD);var oD={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};oD.node;var Rp=Ie(oD);var rD={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};rD.node;var Ep=Ie(rD);var sD={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"}]]};sD.node;var Ap=Ie(sD);var iD={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"}]]};iD.node;var Mp=Ie(iD);var lD={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"}]]};lD.node;var sd=Ie(lD);var uD={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"}]]};uD.node;var Dp=Ie(uD);var cD={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"}]]};cD.node;var _p=Ie(cD);var dD={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"}]]};dD.node;var Pp=Ie(dD);var fD={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"}]]};fD.node;var Op=Ie(fD);var pD={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"}]]};pD.node;var id=Ie(pD);var mD={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"}]]};mD.node;var ld=Ie(mD);var hD={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"}]]};hD.node;var Bp=Ie(hD);var gD={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"}]]};gD.node;var zp=Ie(gD);var vD={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"}]]};vD.node;var ud=Ie(vD);var yD={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"}]]};yD.node;var Hp=Ie(yD);var wD={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"]};wD.node;var Hi=Ie(wD);var xD={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};xD.node;var dr=Ie(xD);var bD={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};bD.node;var Fp=Ie(bD);var kD={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"}]]};kD.node;var qp=Ie(kD);var SD={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"}]]};SD.node;var $p=Ie(SD);var CD={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"}]]};CD.node;var cd=Ie(CD);var LD={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"]};LD.node;var Fi=Ie(LD);var ND={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"]};ND.node;var In=Ie(ND);var ID={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"}]]};ID.node;var Up=Ie(ID);var TD={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"}]]};TD.node;var Vp=Ie(TD);var RD={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"}]]};RD.node;var jp=Ie(RD);var ED={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"}]]};ED.node;var Wp=Ie(ED);var AD={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};AD.node;var Yn=Ie(AD);var MD={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"}]]};MD.node;var dd=Ie(MD);var Us=H(we(),1);var Vo=H(we(),1);var PD=Symbol("html"),Kp=class{#e;constructor(t,a){if(t!==PD)throw new TypeError("Html is made by html`…`");this.#e=a}static markupOf(t){return t.#e}toString(){if(DD)throw new Error("Html coerced to a string: interpolate it with html`…` or hand it to a sink");return this.#e}toJSON(){if(DD)throw new Error("Html serialized as JSON: convert it with htmlString() first");return this.#e}},DD=typeof process<"u"&&process.env.VITEST!==void 0,zW=e=>new Kp(PD,e);var HW={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},FW=e=>e.replace(/[&<>"']/g,t=>HW[t]);function OD(e){if(e==null||typeof e=="boolean")return"";if(e instanceof Kp)return Kp.markupOf(e);if(Array.isArray(e))return e.map(OD).join("");if(typeof e=="string")return FW(e);if(typeof e=="number"||typeof e=="bigint")return String(e);throw new TypeError(`html: cannot interpolate ${typeof e}`)}var _D=new WeakSet,qW=/<form\b[^>]*\bmethod\s*=\s*["']?post\b/i,$W=/\bname\s*=\s*["']?csrf\b/i;function UW(e){if(_D.has(e))return;let t=e.join("\0");if(qW.test(t))throw new Error("html: write POST forms with postForm, which adds the CSRF field");if($W.test(t))throw new Error("html: postForm adds the CSRF field; don't write one");_D.add(e)}function qi(e,...t){UW(e);let a=e[0];for(let n=0;n<t.length;n++)a+=OD(t[n])+e[n+1];return zW(a)}var VW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],jW=864e5,BD=new Map;function WW(e){let t=BD.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"}),BD.set(e,t)),t}function uS(e,t){let a=o=>Object.fromEntries(WW(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 zD=e=>Math.floor(Date.UTC(e.year,e.month-1,e.day)/jW);function xo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function fr(e,t=new Date,a="UTC",n=!1){let o=new Date(e);if(Number.isNaN(o.getTime()))return e;let r=uS(o,a),s=uS(t,a),i=zD(r)-zD(s);if(i===0)return r.clock;if(i===-1)return`Yesterday ${r.clock}`;if(i===1)return`Tomorrow ${r.clock}`;let l=`${VW[r.month-1]} ${r.day}`;return`${r.year===s.year?l:`${l} ${r.year}`}${n?` ${r.clock}`:""}`}function Dv(e,t=new Date,a=xo()){if(Number.isNaN(new Date(e.at).getTime()))return e.label;let n=fr(e.at,t,a,!0);return/^(?:\d|Tomorrow|Yesterday)/.test(n)?`${e.label} ${n}`:`${e.label.replace(/ at$/,"")} ${n}`}function HD(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 Yl(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=uS(a,t);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")} ${n.clock}${t==="UTC"?" UTC":""}`}function FD(e,t=new Date,a=xo()){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=KW(o,a);n.textContent!==i&&(n.textContent=i);return}let r=fr(o,t,a),s=Yl(o,a);n.title!==s&&(n.title=s),n.textContent!==r&&(n.textContent=r)})}function KW(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=String(a.getUTCSeconds()).padStart(2,"0"),o=Yl(e,t);return t==="UTC"?o.replace(/ UTC$/,`:${n} UTC`):`${o}:${n}`}var $i=H(Z(),1),cS=!1;function fS(){cS||(cS=!0,queueMicrotask(()=>{cS=!1,FD(document),window.dispatchEvent(new CustomEvent("standing-orders:workspace-rendered"))}))}var dS="form.approve-form, form.k-approve",GW=["form.approve-form","form.k-approve"].flatMap(e=>[`${e} button[type="submit"]`,`${e} input[type="submit"]`]).join(", ");function qD(e){return e.contains(document.activeElement)&&document.activeElement?.matches("input, textarea, select, [contenteditable=true]")===!0||e.querySelector(`${dS}, details[open] form`)!==null}function kt({html:e,immutable:t=!1,className:a=""}){let n=(0,Vo.useRef)(null),o=(0,Vo.useRef)(null),r=(0,Vo.useRef)(!1),[s,i]=(0,Vo.useState)(0),[l,u]=(0,Vo.useState)(!1),[c,f]=(0,Vo.useState)(!1);return(0,Vo.useEffect)(()=>{let d=n.current,m=()=>i(h=>h+1);return d?.addEventListener("toggle",m,!0),()=>d?.removeEventListener("toggle",m,!0)},[]),(0,Vo.useLayoutEffect)(()=>{let d=n.current;if(!d||o.current===e||t&&o.current!==null)return;if(o.current!==null&&(r.current||qD(d))){let w=d.querySelector("[data-approval]"),x=new DOMParser().parseFromString(e,"text/html").querySelector("[data-approval]");!!d.querySelector(dS)&&w?.dataset.approval!==x?.dataset.approval?(u(!0),d.querySelectorAll(GW).forEach(y=>{y.disabled=!0})):d.querySelector(dS)||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),fS()},[e,t,s]),(0,$i.jsxs)("div",{className:`so-native-region ${a}`,"data-workspace-native":!0,children:[l&&(0,$i.jsxs)(Cn,{tone:"error",children:["The plan changed. ",(0,$i.jsx)("a",{href:window.location.href,children:"Review the current plan"})," before approving."]}),c&&(0,$i.jsxs)("p",{className:"so-deferred",role:"status",children:["Updates are available. Your form is preserved. ",(0,$i.jsx)("a",{href:window.location.href,children:"Reload"})]}),(0,$i.jsx)("div",{ref:n,onInput:()=>{r.current=!0},onChange:()=>{r.current=!0},onBlur:()=>i(d=>d+1)})]})}var $D=H(Z(),1);function Zl({className:e,...t}){return(0,$D.jsx)("section",{"data-slot":"card",className:ve("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 za=H(we(),1);var pr=H(we(),1);var _v=H(Z(),1),Zn=H(we(),1);var Ql=H(Z(),1),XW=Object.defineProperty,Ba=(e,t)=>XW(e,"name",{value:t,configurable:!0});function Gp(e){let t=e+"CollectionProvider",[a,n]=kn(t),[o,r]=a(t,{collectionRef:{current:null},itemMap:new Map}),s=Ba(w=>{let{scope:x,children:v}=w,y=pr.useRef(null),g=pr.useRef(new Map).current;return(0,_v.jsx)(o,{scope:x,itemMap:g,collectionRef:y,children:v})},"CollectionProvider");s.displayName=t;let i=e+"CollectionSlot",l=jn(i),u=pr.forwardRef((w,x)=>{let{scope:v,children:y}=w,g=r(i,v),b=Tt(x,g.collectionRef);return(0,_v.jsx)(l,{ref:b,children:y})});u.displayName=i;let c=e+"CollectionItemSlot",f="data-radix-collection-item",d=jn(c),m=pr.forwardRef((w,x)=>{let{scope:v,children:y,...g}=w,b=pr.useRef(null),k=Tt(x,b),C=r(c,v);return pr.useEffect(()=>(C.itemMap.set(b,{ref:b,...g}),()=>{C.itemMap.delete(b)})),(0,_v.jsx)(d,{[f]:"",ref:k,children:y})});m.displayName=c;function h(w){let x=r(e+"CollectionConsumer",w);return pr.useCallback(()=>{let y=x.collectionRef.current;if(!y)return[];let g=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((C,N)=>g.indexOf(C.ref.current)-g.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return Ba(h,"useCollection"),[{Provider:s,Slot:u,ItemSlot:m},h,n]}Ba(Gp,"createCollection");var UD=new WeakMap,pS=class Ui extends Map{static{Ba(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],UD.set(this,!0)}set(t,a){return UD.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=hS(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],w=f;f=this.get(h),this.delete(h),this.set(h,w)}return this}with(t,a,n){let o=new Ui(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=Pv(this.#e,t);if(a!==void 0)return this.get(a)}entryAt(t){let a=Pv(this.#e,t);if(a!==void 0)return[a,this.get(a)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Pv(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 Ui(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 Ui(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 Ui(a)}toReversed(){let t=new Ui;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 Ui(a)}slice(t,a){let n=new Ui,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 Pv(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=VD(e,t);return a===-1?void 0:e[a]}Ba(Pv,"at");function VD(e,t){let a=e.length,n=hS(t),o=n>=0?n:a+n;return o<0||o>=a?-1:o}Ba(VD,"toSafeIndex");function hS(e){return e!==e||e===0?0:Math.trunc(e)}Ba(hS,"toSafeInteger");function YW(e){let t=e+"CollectionProvider",[a,n]=kn(t),[o,r]=a(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new pS,setItemMap:Ba(()=>{},"setItemMap")}),s=Ba(({state:g,...b})=>g?(0,Ql.jsx)(l,{...b,state:g}):(0,Ql.jsx)(i,{...b}),"CollectionProvider");s.displayName=t;let i=Ba(g=>{let b=x();return(0,Ql.jsx)(l,{...g,state:b})},"CollectionInit");i.displayName=t+"Init";let l=Ba(g=>{let{scope:b,children:k,state:C}=g,N=Zn.useRef(null),[L,R]=Zn.useState(null),z=Tt(N,R),[M,_]=C;return Zn.useEffect(()=>{if(!L)return;let B=KD(()=>{});return B.observe(L,{childList:!0,subtree:!0}),()=>{B.disconnect()}},[L]),(0,Ql.jsx)(o,{scope:b,itemMap:M,setItemMap:_,collectionRef:z,collectionRefObject:N,collectionElement:L,children:k})},"CollectionProviderImpl");l.displayName=t+"Impl";let u=e+"CollectionSlot",c=jn(u),f=Zn.forwardRef((g,b)=>{let{scope:k,children:C}=g,N=r(u,k),L=Tt(b,N.collectionRef);return(0,Ql.jsx)(c,{ref:L,children:C})});f.displayName=u;let d=e+"CollectionItemSlot",m="data-radix-collection-item",h=jn(d),w=Zn.forwardRef((g,b)=>{let{scope:k,children:C,...N}=g,L=Zn.useRef(null),[R,z]=Zn.useState(null),M=Tt(b,L,z),_=r(d,k),{setItemMap:B}=_,S=Zn.useRef(N);jD(S.current,N)||(S.current=N);let T=S.current;return Zn.useEffect(()=>{let E=T;return B(A=>R?A.has(R)?A.set(R,{...E,element:R}).toSorted(mS):(A.set(R,{...E,element:R}),A.toSorted(mS)):A),()=>{B(A=>!R||!A.has(R)?A:(A.delete(R),new pS(A)))}},[R,T,B]),(0,Ql.jsx)(h,{[m]:"",ref:M,children:C})});w.displayName=d;function x(){return Zn.useState(new pS)}Ba(x,"useInitCollection");function v(g){let{itemMap:b}=r(e+"CollectionConsumer",g);return b}return Ba(v,"useCollection"),[{Provider:s,Slot:f,ItemSlot:w},{createCollectionScope:n,useCollection:v,useInitCollection:x}]}Ba(YW,"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}Ba(jD,"shallowEqual");function WD(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ba(WD,"isElementPreceding");function mS(e,t){return!e[1].element||!t[1].element?0:WD(e[1].element,t[1].element)?-1:1}Ba(mS,"sortByDocumentPosition");function KD(e){return new MutationObserver(a=>{for(let n of a)if(n.type==="childList"){e();return}})}Ba(KD,"getChildListObserver");var Ov=H(we(),1),JW=H(Z(),1),ZW=Object.defineProperty,QW=(e,t)=>ZW(e,"name",{value:t,configurable:!0}),eK=Ov.createContext(void 0);function Xp(e){let t=Ov.useContext(eK);return e||t||"ltr"}QW(Xp,"useDirection");var aK=H(we(),1),Bv=H(we(),1),tK=Object.defineProperty,vS=(e,t)=>tK(e,"name",{value:t,configurable:!0}),gS=!1;function GD(){let[e,t]=Bv.useState(gS);return Bv.useEffect(()=>{gS||(gS=!0,t(!0))},[]),e}vS(GD,"useIsHydrated");var XD=aK[" useSyncExternalStore ".trim().toString()];function YD(){return()=>{}}vS(YD,"subscribe");function ZD(){return XD(YD,()=>!0,()=>!1)}vS(ZD,"useIsHydratedModern");var QD=typeof XD=="function"?ZD:GD;var Vi=H(Z(),1),nK=Object.defineProperty,Jl=(e,t)=>nK(e,"name",{value:t,configurable:!0}),yS="rovingFocusGroup.onEntryFocus",oK={bubbles:!1,cancelable:!0},zv="RovingFocusGroup",[wS,JD,rK]=Gp(zv),[sK,xS]=kn(zv,[rK]),[iK,lK]=sK(zv),uK=za.forwardRef(Jl(function(t,a){return(0,Vi.jsx)(wS.Provider,{scope:t.__scopeRovingFocusGroup,children:(0,Vi.jsx)(wS.Slot,{scope:t.__scopeRovingFocusGroup,children:(0,Vi.jsx)(cK,{...t,ref:a})})})},"RovingFocusGroup")),cK=za.forwardRef(Jl(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=za.useRef(null),h=Tt(a,m),w=Xp(s),[x,v]=$l({prop:i,defaultProp:l??null,onChange:u,caller:zv}),[y,g]=za.useState(!1),b=Wn(c),k=JD(n),C=za.useRef(!1),[N,L]=za.useState(0);return za.useEffect(()=>{let R=m.current;if(R)return R.addEventListener(yS,b),()=>R.removeEventListener(yS,b)},[b]),(0,Vi.jsx)(iK,{scope:n,orientation:o,dir:w,loop:r,currentTabStopId:x,onItemFocus:za.useCallback(R=>v(R),[v]),onItemShiftTab:za.useCallback(()=>g(!0),[]),onFocusableItemAdd:za.useCallback(()=>L(R=>R+1),[]),onFocusableItemRemove:za.useCallback(()=>L(R=>R-1),[]),children:(0,Vi.jsx)(ta.div,{tabIndex:y||N===0?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:ut(t.onMouseDown,()=>{C.current=!0}),onFocus:ut(t.onFocus,R=>{let z=!C.current;if(R.target===R.currentTarget&&z&&!y){let M=new CustomEvent(yS,oK);if(R.currentTarget.dispatchEvent(M),!M.defaultPrevented){let _=k().filter(A=>A.focusable),B=_.find(A=>A.active),S=_.find(A=>A.id===x),E=[B,S,..._].filter(Boolean).map(A=>A.ref.current);bS(E,f)}}C.current=!1}),onBlur:ut(t.onBlur,()=>g(!1))})})},"RovingFocusGroupImpl")),dK="RovingFocusGroupItem",fK=za.forwardRef(Jl(function(t,a){let{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...l}=t,u=Vr(),c=s||u,f=lK(dK,n),d=f.currentTabStopId===c,m=JD(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:x}=f,v=QD();return ga(()=>{if(!(!v||!o))return h(),()=>w()},[v,o,h,w]),za.useEffect(()=>{if(!(v||!o))return h(),()=>w()},[v,o,h,w]),(0,Vi.jsx)(wS.ItemSlot,{scope:n,id:c,focusable:o,active:r,children:(0,Vi.jsx)(ta.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...l,ref:a,onMouseDown:ut(t.onMouseDown,y=>{o?f.onItemFocus(c):y.preventDefault()}),onFocus:ut(t.onFocus,()=>f.onItemFocus(c)),onKeyDown:ut(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;let g=t_(y,f.orientation,f.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.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(y.currentTarget);k=f.loop?a_(k,C+1):k.slice(C+1)}setTimeout(()=>bS(k))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:x!=null}):i})})},"RovingFocusGroupItem")),pK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function e_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Jl(e_,"getDirectionAwareKey");function t_(e,t,a){let n=e_(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return pK[n]}Jl(t_,"getFocusIntent");function bS(e,t=!1){let a=document.activeElement;for(let n of e)if(n===a||(n.focus({preventScroll:t}),document.activeElement!==a))return}Jl(bS,"focusFirst");function a_(e,t){return e.map((a,n)=>e[(t+n)%e.length])}Jl(a_,"wrapArray");var n_=uK,o_=fK;var hK=H(Z(),1);var r_=H(we(),1);var gK=Object.defineProperty,vK=(e,t)=>gK(e,"name",{value:t,configurable:!0});function kS(e){let[t,a]=r_.useState(void 0);return ga(()=>{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}vK(kS,"useSize");var s_=H(Z(),1);var un=H(we(),1);var u_=["top","right","bottom","left"];var Kr=Math.min,mr=Math.max,Zp=Math.round,Qp=Math.floor,Gr=e=>({x:e,y:e}),yK={left:"right",right:"left",bottom:"top",top:"bottom"};function SS(e,t,a){return mr(e,Kr(t,a))}function Xr(e,t){return typeof e=="function"?e(t):e}function _s(e){return e.split("-")[0]}function eu(e){return e.split("-")[1]}function Fv(e){return e==="x"?"y":"x"}function qv(e){return e==="y"?"height":"width"}function hr(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function $v(e){return Fv(hr(e))}function c_(e,t,a){a===void 0&&(a=!1);let n=eu(e),o=$v(e),r=qv(o),s=o==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Yp(s)),[s,Yp(s)]}function d_(e){let t=Yp(e);return[Hv(e),t,Hv(t)]}function Hv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var i_=["left","right"],l_=["right","left"],wK=["top","bottom"],xK=["bottom","top"];function bK(e,t,a){switch(e){case"top":case"bottom":return a?t?l_:i_:t?i_:l_;case"left":case"right":return t?wK:xK;default:return[]}}function f_(e,t,a,n){let o=eu(e),r=bK(_s(e),a==="start",n);return o&&(r=r.map(s=>s+"-"+o),t&&(r=r.concat(r.map(Hv)))),r}function Yp(e){let t=_s(e);return yK[t]+e.slice(t.length)}function kK(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 CS(e){return typeof e!="number"?kK(e):{top:e,right:e,bottom:e,left:e}}function tu(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 p_(e,t,a){let{reference:n,floating:o}=e,r=hr(t),s=$v(t),i=qv(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=eu(t);return h&&(m[s]+=d*(h==="end"?1:-1)*(a&&u?-1:1)),m}async function g_(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}=Xr(t,e),h=CS(m),x=i[d?f==="floating"?"reference":"floating":f],v=tu(await r.getClippingRect({element:(a=await(r.isElement==null?void 0:r.isElement(x)))==null||a?x:x.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(i.floating)),boundary:u,rootBoundary:c,strategy:l})),y=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=tu(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:g,strategy:l}):y);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 SK=50,v_=async(e,t,a)=>{let{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:s}=a,i=s.detectOverflow?s:{...s,detectOverflow:g_},l=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=p_(u,n,l),d=n,m=0,h={};for(let w=0;w<r.length;w++){let x=r[w];if(!x)continue;let{name:v,fn:y}=x,{x:g,y:b,data:k,reset:C}=await y({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<SK&&(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}=p_(u,d,l)),w=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:h}},y_=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}=Xr(e,t)||{};if(u==null)return{};let f=CS(c),d={x:a,y:n},m=$v(o),h=qv(m),w=await s.getDimensions(u),x=m==="y",v=x?"top":"left",y=x?"bottom":"right",g=x?"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,R=N/2-w[h]/2-1,z=Kr(f[v],R),M=Kr(f[y],R),_=N-w[h]-M,B=N/2-w[h]/2+L,S=SS(z,B,_),T=!l.arrow&&eu(o)!=null&&B!==S&&r.reference[h]/2-(B<z?z:M)-w[h]/2<0,E=T?B<z?B-z:B-_:0;return{[m]:d[m]+E,data:{[m]:S,centerOffset:B-S-E,...T&&{alignmentOffset:E}},reset:T}}});var w_=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:w=!0,...x}=Xr(e,t);if((a=r.arrow)!=null&&a.alignmentOffset)return{};let v=_s(o),y=hr(i),g=_s(i)===i,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),k=d||(g||!w?[Yp(i)]:d_(i)),C=h!=="none";!d&&C&&k.push(...f_(i,w,h,b));let N=[i,...k],L=await l.detectOverflow(t,x),R=[],z=((n=r.flip)==null?void 0:n.overflows)||[];if(c&&R.push(L[v]),f){let S=c_(o,s,b);R.push(L[S[0]],L[S[1]])}if(z=[...z,{placement:o,overflows:R}],!R.every(S=>S<=0)){var M,_;let S=(((M=r.flip)==null?void 0:M.index)||0)+1,T=N[S];if(T&&(!(f==="alignment"?y!==hr(T):!1)||z.every(q=>hr(q.placement)===y?q.overflows[0]>0:!0)))return{data:{index:S,overflows:z},reset:{placement:T}};let E=(_=z.filter(A=>A.overflows[0]<=0).sort((A,q)=>A.overflows[1]-q.overflows[1])[0])==null?void 0:_.placement;if(!E)switch(m){case"bestFit":{var B;let A=(B=z.filter(q=>{if(C){let D=hr(q.placement);return D===y||D==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(D=>D>0).reduce((D,O)=>D+O,0)]).sort((q,D)=>q[1]-D[1])[0])==null?void 0:B[0];A&&(E=A);break}case"initialPlacement":E=i;break}if(o!==E)return{reset:{placement:E}}}return{}}}};function m_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function h_(e){return u_.some(t=>e[t]>=0)}var x_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:a,platform:n}=t,{strategy:o="referenceHidden",...r}=Xr(e,t);switch(o){case"referenceHidden":{let s=await n.detectOverflow(t,{...r,elementContext:"reference"}),i=m_(s,a.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:h_(i)}}}case"escaped":{let s=await n.detectOverflow(t,{...r,altBoundary:!0}),i=m_(s,a.floating);return{data:{escapedOffsets:i,escaped:h_(i)}}}default:return{}}}}};var b_=new Set(["left","top"]);async function CK(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=eu(a),l=hr(a)==="y",u=b_.has(s)?-1:1,c=r&&l?-1:1,f=Xr(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 k_=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 CK(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}}}}},S_=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:y=>{let{x:g,y:b}=y;return{x:g,y:b}}},...u}=Xr(e,t),c={x:a,y:n},f=await r.detectOverflow(t,u),d=hr(o),m=Fv(d),h=c[m],w=c[d],x=(y,g)=>SS(g+f[y==="y"?"top":"left"],g,g-f[y==="y"?"bottom":"right"]);s&&(h=x(m,h)),i&&(w=x(d,w));let v=l.fn({...t,[m]:h,[d]:w});return{...v,data:{x:v.x-a,y:v.y-n,enabled:{[m]:s,[d]:i}}}}}},C_=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}=Xr(e,t),d={x:o,y:r},m=hr(s),h=Fv(m),w=d[h],x=d[m],v=Xr(u,t),y=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]+y.mainAxis,N=i.reference[h]+i.reference[k]-y.mainAxis;w<C?w=C:w>N&&(w=N)}if(f){var g,b;let k=h==="y"?"width":"height",C=b_.has(_s(s)),N=i.reference[m]-i.floating[k]+(C&&((g=l.offset)==null?void 0:g[m])||0)+(C?0:y.crossAxis),L=i.reference[m]+i.reference[k]+(C?0:((b=l.offset)==null?void 0:b[m])||0)-(C?y.crossAxis:0);x<N?x=N:x>L&&(x=L)}return{[h]:w,[m]:x}}}},L_=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}=Xr(e,t),l=await o.detectOverflow(t,i),u=_s(a),c=eu(a),f=hr(a)==="y",{width:d,height:m}=n.floating,h,w;u==="top"||u==="bottom"?(h=u,w=c===(await(o.isRTL==null?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(w=u,h=c==="end"?"top":"bottom");let x=m-l.top-l.bottom,v=d-l.left-l.right,y=Kr(m-l[h],x),g=Kr(d-l[w],v),b=t.middlewareData.shift,k=!b,C=y,N=g;b!=null&&b.enabled.x&&(N=v),b!=null&&b.enabled.y&&(C=x),k&&!c&&(f?N=d-2*mr(l.left,l.right):C=m-2*mr(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 Uv(){return typeof window<"u"}function ou(e){return I_(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yr(e){var t;return(t=(I_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I_(e){return Uv()?e instanceof Node||e instanceof Tn(e).Node:!1}function gr(e){return Uv()?e instanceof Element||e instanceof Tn(e).Element:!1}function Ps(e){return Uv()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function N_(e){return!Uv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}function Jp(e){let{overflow:t,overflowX:a,overflowY:n,display:o}=vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&o!=="inline"&&o!=="contents"}function T_(e){return/^(table|td|th)$/.test(ou(e))}function em(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var LK=/transform|translate|scale|rotate|perspective|filter/,NK=/paint|layout|strict|content/,au=e=>!!e&&e!=="none",LS;function Vv(e){let t=gr(e)?vr(e):e;return au(t.transform)||au(t.translate)||au(t.scale)||au(t.rotate)||au(t.perspective)||!jv()&&(au(t.backdropFilter)||au(t.filter))||LK.test(t.willChange||"")||NK.test(t.contain||"")}function R_(e){let t=ji(e);for(;Ps(t)&&!fd(t);){if(Vv(t))return t;if(em(t))return null;t=ji(t)}return null}function jv(){return LS==null&&(LS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),LS}function fd(e){return/^(html|body|#document)$/.test(ou(e))}function vr(e){return Tn(e).getComputedStyle(e)}function tm(e){return gr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ji(e){if(ou(e)==="html")return e;let t=e.assignedSlot||e.parentNode||N_(e)&&e.host||Yr(e);return N_(t)?t.host:t}function E_(e){let t=ji(e);return fd(t)?(e.ownerDocument||e).body:Ps(t)&&Jp(t)?t:E_(t)}function nu(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);let o=E_(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),s=Tn(o);if(r){let i=Wv(s);return t.concat(s,s.visualViewport||[],Jp(o)?o:[],i&&a?nu(i):[])}else return t.concat(o,nu(o,[],a))}function Wv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function D_(e){let t=vr(e),a=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=Ps(e),r=o?e.offsetWidth:a,s=o?e.offsetHeight:n,i=Zp(a)!==r||Zp(n)!==s;return i&&(a=r,n=s),{width:a,height:n,$:i}}function IS(e){return gr(e)?e:e.contextElement}function pd(e){let t=IS(e);if(!Ps(t))return Gr(1);let a=t.getBoundingClientRect(),{width:n,height:o,$:r}=D_(t),s=(r?Zp(a.width):a.width)/n,i=(r?Zp(a.height):a.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var IK=Gr(0);function __(e){let t=Tn(e);return!jv()||!t.visualViewport?IK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TK(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===Tn(e)}function ru(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);let o=e.getBoundingClientRect(),r=IS(e),s=Gr(1);t&&(n?gr(n)&&(s=pd(n)):s=pd(e));let i=TK(r,a,n)?__(r):Gr(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=Tn(r),m=gr(n)?Tn(n):n,h=d,w=Wv(h);for(;w&&m!==h;){let x=pd(w),v=w.getBoundingClientRect(),y=vr(w),g=v.left+(w.clientLeft+parseFloat(y.paddingLeft))*x.x,b=v.top+(w.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=g,u+=b,h=Tn(w),w=Wv(h)}}return tu({width:c,height:f,x:l,y:u})}function Kv(e,t){let a=tm(e).scrollLeft;return t?t.left+a:ru(Yr(e)).left+a}function P_(e,t){let a=e.getBoundingClientRect(),n=a.left+t.scrollLeft-Kv(e,a),o=a.top+t.scrollTop;return{x:n,y:o}}function RK(e){let{elements:t,rect:a,offsetParent:n,strategy:o}=e,r=o==="fixed",s=Yr(n),i=t?em(t.floating):!1;if(n===s||i&&r)return a;let l={scrollLeft:0,scrollTop:0},u=Gr(1),c=Gr(0),f=Ps(n);if((f||!r)&&((ou(n)!=="body"||Jp(s))&&(l=tm(n)),f)){let m=ru(n);u=pd(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}let d=s&&!f&&!r?P_(s,l):Gr(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 EK(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function AK(e){let t=tm(e),a=e.ownerDocument.body,n=mr(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),o=mr(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight),r=-t.scrollLeft+Kv(e),s=-t.scrollTop;return vr(a).direction==="rtl"&&(r+=mr(e.clientWidth,a.clientWidth)-n),{width:n,height:o,x:r,y:s}}var MK=25;function DK(e,t,a){a===void 0&&(a="viewport");let n=a==="layoutViewport",o=Tn(e),r=Yr(e),s=o.visualViewport,i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(s){let d=!jv()||t==="fixed";n?d||(u=-s.offsetLeft,c=-s.offsetTop):(i=s.width,l=s.height,d&&(u=s.offsetLeft,c=s.offsetTop))}if(Kv(r)<=0){let d=r.ownerDocument,m=d.body,h=getComputedStyle(m),w=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(r.clientWidth-m.clientWidth-w),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?x/2:x;v<=MK&&(i-=v)}return{width:i,height:l,x:u,y:c}}function _K(e,t){let a=ru(e,!0,t==="fixed"),n=a.top+e.clientTop,o=a.left+e.clientLeft,r=pd(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 A_(e,t,a){let n;if(t==="viewport"||t==="layoutViewport")n=DK(e,a,t);else if(t==="document")n=AK(Yr(e));else if(gr(t))n=_K(t,a);else{let o=__(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return tu(n)}function PK(e,t){let a=t.get(e);if(a)return a;let n=nu(e,[],!1).filter(i=>gr(i)&&ou(i)!=="body"),o=null,r=vr(e).position==="fixed",s=r?ji(e):e;for(;gr(s)&&!fd(s);){let i=vr(s),l=Vv(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 OK(e){let{element:t,boundary:a,rootBoundary:n,strategy:o}=e,s=[...a==="clippingAncestors"?em(t)?[]:PK(t,this._c):[].concat(a),n],i=A_(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=A_(t,s[d],o);l=mr(m.top,l),u=Kr(m.right,u),c=Kr(m.bottom,c),f=mr(m.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function BK(e){let{width:t,height:a}=D_(e);return{width:t,height:a}}function zK(e,t,a){let n=Ps(t),o=Yr(t),r=a==="fixed",s=ru(e,!0,r,t),i={scrollLeft:0,scrollTop:0},l=Gr(0);if((n||!r)&&((ou(t)!=="body"||Jp(o))&&(i=tm(t)),n)){let d=ru(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}!n&&o&&(l.x=Kv(o));let u=o&&!n&&!r?P_(o,i):Gr(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 NS(e){return vr(e).position==="static"}function M_(e,t){if(!Ps(e)||vr(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return Yr(e)===a&&(a=a.ownerDocument.body),a}function O_(e,t){let a=Tn(e);if(em(e))return a;if(!Ps(e)){let o=ji(e);for(;o&&!fd(o);){if(gr(o)&&!NS(o))return o;o=ji(o)}return a}let n=M_(e,t);for(;n&&T_(n)&&NS(n);)n=M_(n,t);return n&&fd(n)&&NS(n)&&!Vv(n)?a:n||R_(e)||a}var HK=async function(e){let t=this.getOffsetParent||O_,a=this.getDimensions,n=await a(e.floating);return{reference:zK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function FK(e){return vr(e).direction==="rtl"}var B_={convertOffsetParentRelativeRectToViewportRelativeRect:RK,getDocumentElement:Yr,getClippingRect:OK,getOffsetParent:O_,getElementRects:HK,getClientRects:EK,getDimensions:BK,getScale:pd,isElement:gr,isRTL:FK};function z_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qK(e,t,a){let n=null,o,r=Yr(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:w,height:x}=d;if(c||t(),!w||!x)return;let v=Qp(h),y=Qp(r.clientWidth-(m+w)),g=Qp(r.clientHeight-(h+x)),b=Qp(m),C={rootMargin:-v+"px "+-y+"px "+-g+"px "+-b+"px",threshold:mr(0,Kr(1,f))||1},N=!0;function L(R){let z=R[0].intersectionRatio;if(!z_(d,e.getBoundingClientRect()))return i();if(z!==f){if(!N)return i();z?i(!1,z):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=Tn(e),u=()=>i(a);return l.addEventListener("resize",u),i(!0),()=>{l.removeEventListener("resize",u),s()}}function TS(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=IS(e),c=o||r?[...u?nu(u):[],...t?nu(t):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",a),r&&v.addEventListener("resize",a)});let f=u&&i?qK(u,a,r):null,d=-1,m=null;s&&(m=new ResizeObserver(v=>{let[y]=v;y&&y.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,w=l?ru(e):null;l&&x();function x(){let v=ru(e);w&&!z_(w,v)&&a(),w=v,h=requestAnimationFrame(x)}return a(),()=>{var v;c.forEach(y=>{o&&y.removeEventListener("scroll",a),r&&y.removeEventListener("resize",a)}),f?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(h)}}var H_=k_;var F_=S_,q_=w_,$_=L_,U_=x_,RS=y_;var V_=C_,ES=(e,t,a)=>{let n=new Map,o=a??{},r={...B_,...o.platform,_c:n};return v_(e,t,{...o,platform:r})};var Sa=H(we(),1),W_=H(we(),1),K_=H(Ro(),1),$K=typeof document<"u",UK=function(){},Gv=$K?W_.useLayoutEffect:UK;function Xv(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(!Xv(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)&&!Xv(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function G_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function j_(e,t){let a=G_(e);return Math.round(t*a)/a}function AS(e){let t=Sa.useRef(e);return Gv(()=>{t.current=e}),t}function X_(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]=Sa.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=Sa.useState(n);Xv(d,n)||m(n);let[h,w]=Sa.useState(null),[x,v]=Sa.useState(null),y=Sa.useCallback(q=>{q!==C.current&&(C.current=q,w(q))},[]),g=Sa.useCallback(q=>{q!==N.current&&(N.current=q,v(q))},[]),b=r||h,k=s||x,C=Sa.useRef(null),N=Sa.useRef(null),L=Sa.useRef(c),R=l!=null,z=AS(l),M=AS(o),_=AS(u),B=Sa.useCallback(()=>{if(!C.current||!N.current)return;let q={placement:t,strategy:a,middleware:d};M.current&&(q.platform=M.current),ES(C.current,N.current,q).then(D=>{let O={...D,isPositioned:_.current!==!1};S.current&&!Xv(L.current,O)&&(L.current=O,K_.flushSync(()=>{f(O)}))})},[d,t,a,M,_]);Gv(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[u]);let S=Sa.useRef(!1);Gv(()=>(S.current=!0,()=>{S.current=!1}),[]),Gv(()=>{if(b&&(C.current=b),k&&(N.current=k),b&&k){if(z.current)return z.current(b,k,B);B()}},[b,k,B,z,R]);let T=Sa.useMemo(()=>({reference:C,floating:N,setReference:y,setFloating:g}),[y,g]),E=Sa.useMemo(()=>({reference:b,floating:k}),[b,k]),A=Sa.useMemo(()=>{let q={position:a,left:0,top:0};if(!E.floating)return q;let D=j_(E.floating,c.x),O=j_(E.floating,c.y);return i?{...q,transform:"translate("+D+"px, "+O+"px)",...G_(E.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:D,top:O}},[a,i,E.floating,c.x,c.y]);return Sa.useMemo(()=>({...c,update:B,refs:T,elements:E,floatingStyles:A}),[c,B,T,E,A])}var VK=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?RS({element:n.current,padding:o}).fn(a):{}:n?RS({element:n,padding:o}).fn(a):{}}}},Y_=(e,t)=>{let a=H_(e);return{name:a.name,fn:a.fn,options:[e,t]}},Z_=(e,t)=>{let a=F_(e);return{name:a.name,fn:a.fn,options:[e,t]}},Q_=(e,t)=>({fn:V_(e).fn,options:[e,t]}),J_=(e,t)=>{let a=q_(e);return{name:a.name,fn:a.fn,options:[e,t]}},eP=(e,t)=>{let a=$_(e);return{name:a.name,fn:a.fn,options:[e,t]}};var tP=(e,t)=>{let a=U_(e);return{name:a.name,fn:a.fn,options:[e,t]}};var aP=(e,t)=>{let a=VK(e);return{name:a.name,fn:a.fn,options:[e,t]}};var md=H(Z(),1),jK=Object.defineProperty,Wi=(e,t)=>jK(e,"name",{value:t,configurable:!0});var nP="Popper",[oP,MS]=kn(nP),[WK,rP]=oP(nP),KK=Wi(e=>{let{__scopePopper:t,children:a}=e,[n,o]=un.useState(null),[r,s]=un.useState(void 0);return(0,md.jsx)(WK,{scope:t,anchor:n,onAnchorChange:o,placementState:r,setPlacementState:s,children:a})},"Popper"),GK="PopperAnchor",XK=un.forwardRef(Wi(function(t,a){let{__scopePopper:n,virtualRef:o,...r}=t,s=rP(GK,n),i=un.useRef(null),l=s.onAnchorChange,u=un.useCallback(w=>{i.current=w,w&&l(w)},[l]),c=Tt(a,u),f=un.useRef(null);un.useEffect(()=>{if(!o)return;let w=f.current;f.current=o.current,w!==f.current&&l(f.current)});let d=s.placementState&&Yv(s.placementState),m=d?.[0],h=d?.[1];return o?null:(0,md.jsx)(ta.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...r,ref:c})},"PopperAnchor")),sP="PopperContent",[YK,Mde]=oP(sP),ZK=un.forwardRef(Wi(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:w,...x}=t,v=rP(sP,n),[y,g]=un.useState(null),b=Tt(a,g),[k,C]=un.useState(null),N=kS(k),L=N?.width??0,R=N?.height??0,z=o+(s!=="center"?"-"+s:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(c)?c:[c],B=_.length>0,S={padding:M,boundary:_.filter(iP),altBoundary:B},{refs:T,floatingStyles:E,placement:A,isPositioned:q,middlewareData:D}=X_({strategy:"fixed",placement:z,whileElementsMounted:Wi((...F)=>TS(...F,{animationFrame:h==="always"}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[Y_({mainAxis:r+R,alignmentAxis:i}),u&&Z_({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Q_():void 0,...S}),u&&J_({...S}),eP({...S,apply:Wi(({elements:F,rects:G,availableWidth:pe,availableHeight:X})=>{let{width:ee,height:ge}=G.reference,be=F.floating.style;be.setProperty("--radix-popper-available-width",`${pe}px`),be.setProperty("--radix-popper-available-height",`${X}px`),be.setProperty("--radix-popper-anchor-width",`${ee}px`),be.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),k&&aP({element:k,padding:l}),QK({arrowWidth:L,arrowHeight:R}),m&&tP({strategy:"referenceHidden",...S,boundary:B?S.boundary:void 0})]}),O=v.setPlacementState;ga(()=>(O(A),()=>{O(void 0)}),[A,O]);let[K,se]=Yv(A),ne=Wn(w);ga(()=>{q&&ne?.()},[q,ne]);let U=D.arrow?.x,W=D.arrow?.y,Q=D.arrow?.centerOffset!==0,[oe,V]=un.useState();return ga(()=>{y&&V(window.getComputedStyle(y).zIndex)},[y]),(0,md.jsx)("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...E,transform:q?E.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:(0,md.jsx)(YK,{scope:n,placedSide:K,placedAlign:se,onArrowChange:C,arrowX:U,arrowY:W,shouldHideArrow:Q,children:(0,md.jsx)(ta.div,{"data-side":K,"data-align":se,...x,ref:b,style:{...x.style,animation:q?x.style?.animation:"none"}})})})},"PopperContent"));function iP(e){return e!==null}Wi(iP,"isNotNull");var QK=Wi(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]=Yv(a),f={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,m=(o.arrow?.y??0)+l/2,h="",w="";return u==="bottom"?(h=s?f:`${d}px`,w=`${-l}px`):u==="top"?(h=s?f:`${d}px`,w=`${n.floating.height+l}px`):u==="right"?(h=`${-l}px`,w=s?f:`${m}px`):u==="left"&&(h=`${n.floating.width+l}px`,w=s?f:`${m}px`),{data:{x:h,y:w}}}}),"transformOrigin");function Yv(e){let[t,a="center"]=e.split("-");return[t,a]}Wi(Yv,"getSideAndAlignFromPlacement");var lP=KK,uP=XK,cP=ZK;var dP=H(Z(),1);var e7=H(Z(),1);var xe=H(we(),1),hP=H(Ro(),1);function t7(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 a7=e=>{switch(e){case"success":return r7;case"info":return i7;case"warning":return s7;case"error":return l7;default:return null}},n7=Array(12).fill(0),o7=({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"},n7.map((a,n)=>xe.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),r7=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"})),s7=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"})),i7=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"})),l7=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"})),u7=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"})),c7=()=>{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},d7=1,f7=100,fP=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:d7++},DS=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-f7;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=fP(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(m7(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=fP(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}},Qn=new DS,p7=(e,t)=>Qn.message(e,t),m7=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",h7=p7,g7=()=>Qn.toasts,v7=()=>Qn.getActiveToasts(),am=Object.assign(h7,{success:Qn.success,info:Qn.info,warning:Qn.warning,error:Qn.error,custom:Qn.custom,message:Qn.message,promise:Qn.promise,dismiss:Qn.dismiss,loading:Qn.loading},{getHistory:g7,getToasts:v7});t7("[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 Zv(e){return e.label!==void 0}var y7=3,w7="24px",x7="16px",pP=4e3,b7=356,k7=14,S7=45,C7=200;function Zr(...e){return e.filter(Boolean).join(" ")}function L7(e){let[t,a]=e.split("-"),n=[];return t&&n.push(t),a&&n.push(a),n}var N7=e=>{var t,a,n,o,r,s,i,l,u;let{invert:c,toast:f,unstyled:d,interacting:m,setHeights:h,visibleToasts:w,heights:x,index:v,toasts:y,expanded:g,removeToast:b,defaultRichColors:k,closeButton:C,style:N,cancelButtonStyle:L,actionButtonStyle:R,className:z="",descriptionClassName:M="",duration:_,position:B,gap:S,expandByDefault:T,classNames:E,icons:A,closeButtonAriaLabel:q="Close toast"}=e,[D,O]=xe.default.useState(null),[K,se]=xe.default.useState(null),[ne,U]=xe.default.useState(!1),[W,Q]=xe.default.useState(!1),[oe,V]=xe.default.useState(!1),[F,G]=xe.default.useState(!1),[pe,X]=xe.default.useState(!1),[ee,ge]=xe.default.useState(0),[be,ze]=xe.default.useState(0),Y=xe.default.useRef(f.duration||_||pP),Te=xe.default.useRef(null),Ue=xe.default.useRef(null),it=v===0,at=v+1<=w,te=f.type,Pe=te??"default",De=f.dismissible!==!1,mt=f.className||"",Bt=f.descriptionClassName||"",Zt=xe.default.useMemo(()=>x.findIndex(Ve=>Ve.toastId===f.id)||0,[x,f.id]),wa=xe.default.useMemo(()=>{var Ve;return(Ve=f.closeButton)!=null?Ve:C},[f.closeButton,C]),Lo=xe.default.useMemo(()=>f.duration||_||pP,[f.duration,_]),nn=xe.default.useRef(0),jt=xe.default.useRef(0),Pn=xe.default.useRef(0),so=xe.default.useRef(null),[af,Ou]=B.split("-"),Bu=xe.default.useMemo(()=>x.reduce((Ve,Qt,J)=>J>=Zt?Ve:Ve+Qt.height,0),[x,Zt]),Jo=c7(),gn=xe.default.useMemo(()=>{var Ve;return(Ve=e.swipeDirections)!=null?Ve:L7(B)},[e.swipeDirections,B]),nf=f.invert||c,ml=te==="loading";jt.current=xe.default.useMemo(()=>Zt*S+Bu,[Zt,Bu]),xe.default.useEffect(()=>{Y.current=Lo},[Lo]),xe.default.useEffect(()=>{U(!0)},[]),xe.default.useEffect(()=>{let Ve=Ue.current;if(Ve){let Qt=Ve.getBoundingClientRect().height;return ze(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(!ne)return;let Ve=Ue.current,Qt=Ve.style.height;Ve.style.height="auto";let J=Ve.getBoundingClientRect().height;Ve.style.height=Qt,ze(J),h(Le=>Le.find(xt=>xt.toastId===f.id)?Le.map(xt=>xt.toastId===f.id?{...xt,height:J}:xt):[{toastId:f.id,height:J,position:f.position},...Le])},[ne,f.title,f.description,h,f.id,f.jsx,f.action,f.cancel]);let No=xe.default.useCallback(()=>{Q(!0),ge(jt.current),h(Ve=>Ve.filter(Qt=>Qt.toastId!==f.id)),setTimeout(()=>{b(f)},C7)},[f,b,h,jt]);xe.default.useEffect(()=>{if(f.promise&&te==="loading"||f.duration===1/0||f.type==="loading")return;let Ve;return g||m||Jo?(()=>{if(Pn.current<nn.current){let Le=new Date().getTime()-nn.current;Y.current=Y.current-Le}Pn.current=new Date().getTime()})():Y.current!==1/0&&(nn.current=new Date().getTime(),Ve=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),No()},Y.current)),()=>clearTimeout(Ve)},[g,m,f,te,Jo,No]),xe.default.useEffect(()=>{f.delete&&(No(),f.onDismiss==null||f.onDismiss.call(f,f))},[No,f.delete]);function zu(){var Ve;if(A?.loading){var Qt;return xe.default.createElement("div",{className:Zr(E?.loader,f==null||(Qt=f.classNames)==null?void 0:Qt.loader,"sonner-loader"),"data-visible":te==="loading"},A.loading)}return xe.default.createElement(o7,{className:Zr(E?.loader,f==null||(Ve=f.classNames)==null?void 0:Ve.loader),visible:te==="loading"})}let of=f.icon||A?.[te]||a7(te);var Hu,ti;return xe.default.createElement("li",{tabIndex:0,ref:Ue,className:Zr(z,mt,E?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,E?.[Pe],f==null||(a=f.classNames)==null?void 0:a[Pe]),"data-sonner-toast":"","data-rich-colors":(Hu=f.richColors)!=null?Hu:k,"data-styled":!(f.jsx||f.unstyled||d),"data-mounted":ne,"data-promise":!!f.promise,"data-swiped":pe,"data-removed":W,"data-visible":at,"data-y-position":af,"data-x-position":Ou,"data-index":v,"data-front":it,"data-swiping":oe,"data-dismissible":De,"data-type":te,"data-invert":nf,"data-swipe-out":F,"data-swipe-direction":K,"data-expanded":!!(g||T&&ne),"data-testid":f.testId,style:{"--index":v,"--toasts-before":v,"--z-index":y.length-v,"--offset":`${W?ee:jt.current}px`,"--initial-height":T?"auto":`${be}px`,...N,...f.style},onDragEnd:()=>{V(!1),O(null),so.current=null},onPointerDown:Ve=>{Ve.button!==2&&(ml||!De||(Te.current=new Date,ge(jt.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(V(!0),so.current={x:Ve.clientX,y:Ve.clientY})))},onPointerUp:()=>{var Ve,Qt,J;if(F||!De)return;so.current=null;let Le=Number(((Ve=Ue.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$e=Number(((Qt=Ue.current)==null?void 0:Qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),xt=new Date().getTime()-((J=Te.current)==null?void 0:J.getTime()),On=D==="x"?Le:$e,Io=Math.abs(On)/xt;if((D==="x"?gn.includes(Le>0?"right":"left"):gn.includes($e>0?"bottom":"top"))&&(Math.abs(On)>=S7||Io>.11)){ge(jt.current),f.onDismiss==null||f.onDismiss.call(f,f),se(D==="x"?Le>0?"right":"left":$e>0?"down":"up"),No(),G(!0);return}else{var To,sf;(To=Ue.current)==null||To.style.setProperty("--swipe-amount-x","0px"),(sf=Ue.current)==null||sf.style.setProperty("--swipe-amount-y","0px")}X(!1),V(!1),O(null)},onPointerMove:Ve=>{var Qt,J,Le;if(!so.current||!De||((Qt=window.getSelection())==null?void 0:Qt.toString().length)>0)return;let xt=Ve.clientY-so.current.y,On=Ve.clientX-so.current.x;!D&&(Math.abs(On)>1||Math.abs(xt)>1)&&O(Math.abs(On)>Math.abs(xt)?"x":"y");let Io={x:0,y:0},rf=To=>1/(1.5+Math.abs(To)/20);if(D==="y"){if(gn.includes("top")||gn.includes("bottom"))if(gn.includes("top")&&xt<0||gn.includes("bottom")&&xt>0)Io.y=xt;else{let To=xt*rf(xt);Io.y=Math.abs(To)<Math.abs(xt)?To:xt}}else if(D==="x"&&(gn.includes("left")||gn.includes("right")))if(gn.includes("left")&&On<0||gn.includes("right")&&On>0)Io.x=On;else{let To=On*rf(On);Io.x=Math.abs(To)<Math.abs(On)?To:On}(Math.abs(Io.x)>0||Math.abs(Io.y)>0)&&X(!0),(J=Ue.current)==null||J.style.setProperty("--swipe-amount-x",`${Io.x}px`),(Le=Ue.current)==null||Le.style.setProperty("--swipe-amount-y",`${Io.y}px`)}},wa&&!f.jsx&&te!=="loading"?xe.default.createElement("button",{"aria-label":q,"data-disabled":ml,"data-close-button":!0,onClick:ml||!De?()=>{}:()=>{No(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Zr(E?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(ti=A?.close)!=null?ti:u7):null,(te||f.icon||f.promise)&&f.icon!==null&&(A?.[te]!==null||f.icon)?xe.default.createElement("div",{"data-icon":"",className:Zr(E?.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},te==="loading"?f.icon||zu():f.promise?zu():null,te!=="loading"?of:null):null,xe.default.createElement("div",{"data-content":"",className:Zr(E?.content,f==null||(r=f.classNames)==null?void 0:r.content)},xe.default.createElement("div",{"data-title":"",className:Zr(E?.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:Zr(M,Bt,E?.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&&Zv(f.cancel)?xe.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Ve=>{Zv(f.cancel)&&De&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Ve),No())},className:Zr(E?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,xe.default.isValidElement(f.action)?f.action:f.action&&Zv(f.action)?xe.default.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||R,onClick:Ve=>{Zv(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Ve),!Ve.defaultPrevented&&No())},className:Zr(E?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function mP(){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 I7(e,t){let a={};return[e,t].forEach((n,o)=>{let r=o===1,s=r?"--mobile-offset":"--offset",i=r?x7:w7;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 gP=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:w,visibleToasts:x=y7,toastOptions:v,dir:y=mP(),gap:g=k7,icons:b,customAriaLabel:k,containerAriaLabel:C="Notifications"}=t,[N,L]=xe.default.useState([]),R=xe.default.useMemo(()=>n?N.filter(U=>U.toasterId===n):N.filter(U=>!U.toasterId),[N,n]),z=xe.default.useMemo(()=>Array.from(new Set([r].concat(R.filter(U=>U.position).map(U=>U.position)))),[R,r]),[M,_]=xe.default.useState([]),[B,S]=xe.default.useState(!1),[T,E]=xe.default.useState(!1),[A,q]=xe.default.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=xe.default.useRef(null),O=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=xe.default.useRef(null),se=xe.default.useRef(!1),ne=xe.default.useCallback(U=>{L(W=>{var Q;return(Q=W.find(oe=>oe.id===U.id))!=null&&Q.delete||Qn.dismiss(U.id),W.filter(({id:oe})=>oe!==U.id)})},[]);return xe.default.useEffect(()=>Qn.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{L(W=>W.map(Q=>Q.id===U.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{hP.default.flushSync(()=>{L(W=>{let Q=W.findIndex(oe=>oe.id===U.id);return Q!==-1?[...W.slice(0,Q),{...W[Q],...U},...W.slice(Q+1)]:[U,...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 U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:W})=>{q(W?"dark":"light")})}catch{U.addListener(({matches:Q})=>{try{q(Q?"dark":"light")}catch(oe){console.error(oe)}})}},[d]),xe.default.useEffect(()=>{N.length<=1&&S(!1)},[N]),xe.default.useEffect(()=>{let U=W=>{var Q;if(s.length>0&&s.every(F=>W[F]||W.code===F)){var V;S(!0),(V=D.current)==null||V.focus()}W.code==="Escape"&&(document.activeElement===D.current||(Q=D.current)!=null&&Q.contains(document.activeElement))&&S(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[s]),xe.default.useEffect(()=>{if(D.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,se.current=!1)}},[D.current]),xe.default.createElement("section",{ref:a,"aria-label":k??`${C} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},z.map((U,W)=>{var Q;let[oe,V]=U.split("-");return R.length?xe.default.createElement("ol",{key:U,dir:y==="auto"?mP():y,tabIndex:-1,ref:D,className:u,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":oe,"data-x-position":V,style:{"--front-toast-height":`${((Q=M[0])==null?void 0:Q.height)||0}px`,"--width":`${b7}px`,"--gap":`${g}px`,...w,...I7(c,f)},onBlur:F=>{se.current&&!F.currentTarget.contains(F.relatedTarget)&&(se.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||se.current||(se.current=!0,K.current=F.relatedTarget)},onMouseEnter:()=>S(!0),onMouseMove:()=>S(!0),onMouseLeave:()=>{T||S(!1)},onDragEnd:()=>S(!1),onPointerDown:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},R.filter(F=>!F.position&&W===0||F.position===U).map((F,G)=>{var pe,X;return xe.default.createElement(N7,{key:F.id,icons:b,index:G,toast:F,defaultRichColors:m,duration:(pe=v?.duration)!=null?pe:h,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:o,visibleToasts:x,closeButton:(X=v?.closeButton)!=null?X:l,interacting:T,position:U,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ne,toasts:R.filter(ee=>ee.position==F.position),heights:M.filter(ee=>ee.position==F.position),setHeights:_,expandByDefault:i,gap:g,expanded:B,swipeDirections:t.swipeDirections})})):null}))});var yP=H(Z(),1);function vP(){return(0,yP.jsx)(gP,{position:"bottom-center",toastOptions:{classNames:{toast:"!bg-card !text-foreground !border !border-border !shadow-lg",description:"!text-muted-foreground"}}})}var yr=H(we(),1);var Ke=H(we(),1);var Dt=H(Z(),1),T7=Object.defineProperty,_t=(e,t)=>T7(e,"name",{value:t,configurable:!0}),_S=["Enter"," "],R7=["ArrowDown","PageUp","Home"],xP=["ArrowUp","PageDown","End"],E7=[...R7,...xP],rfe={ltr:[..._S,"ArrowRight"],rtl:[..._S,"ArrowLeft"]};var Jv="Menu",[PS,A7,M7]=Gp(Jv),[su,BS]=kn(Jv,[M7,MS,xS]),zS=MS(),bP=xS(),[D7,nm]=su(Jv),[_7,HS]=su(Jv),P7=_t(e=>{let{__scopeMenu:t,open:a=!1,children:n,dir:o,onOpenChange:r,modal:s=!0}=e,i=zS(t),[l,u]=Ke.useState(null),c=Ke.useRef(!1),f=Wn(r),d=Xp(o);return Ke.useEffect(()=>{let m=_t(()=>{c.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},"handleKeyDown"),h=_t(()=>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})}},[]),Ke.useEffect(()=>{if(!a)return;let m=_t(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[a,f]),(0,Dt.jsx)(lP,{...i,children:(0,Dt.jsx)(D7,{scope:t,open:a,onOpenChange:f,content:l,onContentChange:u,children:(0,Dt.jsx)(_7,{scope:t,onClose:Ke.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:s,children:n})})})},"Menu"),O7=Ke.forwardRef(_t(function(t,a){let{__scopeMenu:n,...o}=t,r=zS(n);return(0,Dt.jsx)(uP,{...r,...o,ref:a})},"MenuAnchor")),kP="MenuPortal",[B7,z7]=su(kP,{forceMount:void 0}),H7=_t(e=>{let{__scopeMenu:t,forceMount:a,children:n,container:o}=e,r=nm(kP,t);return(0,Dt.jsx)(B7,{scope:t,forceMount:a,children:(0,Dt.jsx)(Ul,{present:a||r.open,children:(0,Dt.jsx)(sv,{asChild:!0,container:o,children:n})})})},"MenuPortal"),Ki="MenuContent",[F7,SP]=su(Ki),q7=Ke.forwardRef(_t(function(t,a){let n=z7(Ki,t.__scopeMenu),{forceMount:o=n.forceMount,...r}=t,s=nm(Ki,t.__scopeMenu),i=HS(Ki,t.__scopeMenu);return(0,Dt.jsx)(PS.Provider,{scope:t.__scopeMenu,children:(0,Dt.jsx)(Ul,{present:o||s.open,children:(0,Dt.jsx)(PS.Slot,{scope:t.__scopeMenu,children:i.modal?(0,Dt.jsx)($7,{...r,ref:a}):(0,Dt.jsx)(U7,{...r,ref:a})})})})},"MenuContent")),$7=Ke.forwardRef(_t(function(t,a){let n=nm(Ki,t.__scopeMenu),o=Ke.useRef(null),r=Tt(a,o);return Ke.useEffect(()=>{let s=o.current;if(s)return gv(s)},[]),(0,Dt.jsx)(CP,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ut(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),U7=Ke.forwardRef(_t(function(t,a){let n=nm(Ki,t.__scopeMenu);return(0,Dt.jsx)(CP,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),V7=jn("MenuContent.ScrollLock"),CP=Ke.forwardRef(_t(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:w,...x}=t,v=nm(Ki,n),y=HS(Ki,n),g=zS(n),b=bP(n),k=A7(n),[C,N]=Ke.useState(null),L=Ke.useRef(null),R=Tt(a,L,v.onContentChange),z=Ke.useRef(0),M=Ke.useRef(""),_=Ke.useRef(0),B=Ke.useRef(null),S=Ke.useRef("right"),T=Ke.useRef(0),E=w?vp:Ke.Fragment,A=w?{as:V7,allowPinchZoom:!0}:void 0,q=_t(O=>{let K=M.current+O,se=k().filter(V=>!V.disabled),ne=document.activeElement,U=se.find(V=>V.ref.current===ne)?.textValue,W=se.map(V=>V.textValue),Q=RP(W,K,U),oe=se.find(V=>V.textValue===Q)?.ref.current;_t((function V(F){M.current=F,window.clearTimeout(z.current),F!==""&&(z.current=window.setTimeout(()=>V(""),1e3))}),"updateSearch")(K),oe&&setTimeout(()=>oe.focus())},"handleTypeaheadSearch");Ke.useEffect(()=>()=>window.clearTimeout(z.current),[]),Vc();let D=Ke.useCallback(O=>S.current===B.current?.side&&AP(O,B.current?.area),[]);return(0,Dt.jsx)(F7,{scope:n,searchRef:M,onItemEnter:Ke.useCallback(O=>{D(O)&&O.preventDefault()},[D]),onItemLeave:Ke.useCallback(O=>{D(O)||(L.current?.focus(),N(null))},[D]),onTriggerLeave:Ke.useCallback(O=>{D(O)&&O.preventDefault()},[D]),pointerGraceTimerRef:_,onPointerGraceIntentChange:Ke.useCallback(O=>{B.current=O},[]),children:(0,Dt.jsx)(E,{...A,children:(0,Dt.jsx)(ov,{asChild:!0,trapped:r,onMountAutoFocus:ut(s,O=>{O.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,Dt.jsx)(nv,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:h,children:(0,Dt.jsx)(n_,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:ut(u,O=>{y.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Dt.jsx)(cP,{role:"menu","aria-orientation":"vertical","data-state":LP(v.open),"data-radix-menu-content":"",dir:y.dir,...g,...x,ref:R,style:{outline:"none",...x.style},onKeyDown:ut(x.onKeyDown,O=>{let se=O.target.closest("[data-radix-menu-content]")===O.currentTarget,ne=O.ctrlKey||O.altKey||O.metaKey,U=O.key.length===1;se&&(O.key==="Tab"&&O.preventDefault(),!ne&&U&&q(O.key));let W=L.current;if(O.target!==W||!E7.includes(O.key))return;O.preventDefault();let oe=k().filter(V=>!V.disabled).map(V=>V.ref.current);xP.includes(O.key)&&oe.reverse(),IP(oe)}),onBlur:ut(t.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(z.current),M.current="")}),onPointerMove:ut(t.onPointerMove,Qv(O=>{let K=O.target,se=T.current!==O.clientX;if(O.currentTarget.contains(K)&&se){let ne=O.clientX>T.current?"right":"left";S.current=ne,T.current=O.clientX}}))})})})})})})},"MenuContentImpl"));var j7=Ke.forwardRef(_t(function(t,a){let{__scopeMenu:n,...o}=t;return(0,Dt.jsx)(ta.div,{...o,ref:a})},"MenuLabel")),OS="MenuItem",wP="menu.itemSelect",W7=Ke.forwardRef(_t(function(t,a){let{disabled:n=!1,onSelect:o,...r}=t,s=Ke.useRef(null),i=HS(OS,t.__scopeMenu),l=SP(OS,t.__scopeMenu),u=Tt(a,s),c=Ke.useRef(!1),f=_t(()=>{let d=s.current;if(!n&&d){let m=new CustomEvent(wP,{bubbles:!0,cancelable:!0});d.addEventListener(wP,h=>o?.(h),{once:!0}),pp(d,m),m.defaultPrevented?c.current=!1:i.onClose()}},"handleSelect");return(0,Dt.jsx)(K7,{...r,ref:u,disabled:n,onClick:ut(t.onClick,f),onPointerDown:d=>{t.onPointerDown?.(d),c.current=!0},onPointerUp:ut(t.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:ut(t.onKeyDown,d=>{n||d.target!==d.currentTarget||l.searchRef.current!==""&&d.key===" "||_S.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})},"MenuItem")),K7=Ke.forwardRef(_t(function(t,a){let{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=t,i=SP(OS,n),l=bP(n),u=Ke.useRef(null),c=Tt(a,u),[f,d]=Ke.useState(!1),[m,h]=Ke.useState("");return Ke.useEffect(()=>{let w=u.current;w&&h((w.textContent??"").trim())},[s.children]),(0,Dt.jsx)(PS.ItemSlot,{scope:n,disabled:o,textValue:r??m,children:(0,Dt.jsx)(o_,{asChild:!0,...l,focusable:!o,children:(0,Dt.jsx)(ta.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:c,onPointerMove:ut(t.onPointerMove,Qv(w=>{o?i.onItemLeave(w):(i.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ut(t.onPointerLeave,Qv(w=>i.onItemLeave(w))),onFocus:ut(t.onFocus,()=>d(!0)),onBlur:ut(t.onBlur,()=>d(!1))})})})},"MenuItemImpl"));var G7="MenuRadioGroup",[sfe,ife]=su(G7,{value:void 0,onValueChange:_t(()=>{},"onValueChange")});var X7="MenuItemIndicator",[lfe,ufe]=su(X7,{checked:!1});var Y7=Ke.forwardRef(_t(function(t,a){let{__scopeMenu:n,...o}=t;return(0,Dt.jsx)(ta.div,{role:"separator","aria-orientation":"horizontal",...o,ref:a})},"MenuSeparator"));var Z7="MenuSub",[cfe,dfe]=su(Z7);function LP(e){return e?"open":"closed"}_t(LP,"getOpenState");function NP(e){return e==="indeterminate"}_t(NP,"isIndeterminate");function Q7(e){return NP(e)?"indeterminate":e?"checked":"unchecked"}_t(Q7,"getCheckedState");function IP(e){let t=document.activeElement;for(let a of e)if(a===t||(a.focus(),document.activeElement!==t))return}_t(IP,"focusFirst");function TP(e,t){return e.map((a,n)=>e[(t+n)%e.length])}_t(TP,"wrapArray");function RP(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=TP(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}_t(RP,"getNextMatch");function EP(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}_t(EP,"isPointInPolygon");function AP(e,t){if(!t)return!1;let a={x:e.clientX,y:e.clientY};return EP(a,t)}_t(AP,"isPointerInGraceArea");function Qv(e){return t=>t.pointerType==="mouse"?e(t):void 0}_t(Qv,"whenMouse");var MP=P7,DP=O7,_P=H7,PP=q7;var OP=j7,BP=W7;var zP=Y7;var Qr=H(Z(),1),e9=Object.defineProperty,iu=(e,t)=>e9(e,"name",{value:t,configurable:!0}),FS="DropdownMenu",[t9,Tfe]=kn(FS,[BS]),lu=BS(),[a9,HP]=t9(FS),n9=iu(e=>{let{__scopeDropdownMenu:t,children:a,dir:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,l=lu(t),u=yr.useRef(null),[c,f]=$l({prop:o,defaultProp:r??!1,onChange:s,caller:FS});return(0,Qr.jsx)(a9,{scope:t,triggerId:Vr(),triggerRef:u,contentId:Vr(),open:c,onOpenChange:f,onOpenToggle:yr.useCallback(()=>f(d=>!d),[f]),modal:i,children:(0,Qr.jsx)(MP,{...l,open:c,onOpenChange:f,dir:n,modal:i,children:a})})},"DropdownMenu"),o9="DropdownMenuTrigger",r9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,disabled:o=!1,...r}=t,s=HP(o9,n),i=lu(n),l=Tt(a,s.triggerRef);return(0,Qr.jsx)(DP,{asChild:!0,...i,children:(0,Qr.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:ut(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(s.onOpenToggle(),s.open||u.preventDefault())}),onKeyDown:ut(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&s.onOpenToggle(),u.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),s9=iu(e=>{let{__scopeDropdownMenu:t,...a}=e,n=lu(t);return(0,Qr.jsx)(_P,{...n,...a})},"DropdownMenuPortal"),i9="DropdownMenuContent",l9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=HP(i9,n),s=lu(n),i=yr.useRef(!1);return(0,Qr.jsx)(PP,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:a,onCloseAutoFocus:ut(t.onCloseAutoFocus,l=>{i.current||r.triggerRef.current?.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:ut(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 u9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=lu(n);return(0,Qr.jsx)(OP,{...r,...o,ref:a})},"DropdownMenuLabel")),c9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=lu(n);return(0,Qr.jsx)(BP,{...r,...o,ref:a})},"DropdownMenuItem"));var d9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=lu(n);return(0,Qr.jsx)(zP,{...r,...o,ref:a})},"DropdownMenuSeparator"));var FP=n9,qP=r9,$P=s9,UP=l9;var VP=u9,jP=c9;var WP=d9;var hd=H(Z(),1),KP=FP,GP=qP;function XP({className:e,sideOffset:t=4,...a}){return(0,hd.jsx)($P,{children:(0,hd.jsx)(UP,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ve("z-[120] min-w-44 overflow-hidden rounded-card border-0 bg-popover p-1 text-popover-foreground shadow-overlay",e),...a})})}function YP({className:e,...t}){return(0,hd.jsx)(jP,{"data-slot":"dropdown-menu-item",className:ve("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 qS({className:e,...t}){return(0,hd.jsx)(VP,{className:ve("px-2 py-1.5 text-xs font-semibold text-muted-foreground",e),...t})}var ZP=({className:e,...t})=>(0,hd.jsx)(WP,{className:ve("-mx-1 my-1 h-px bg-border",e),...t});var p9=H(Z(),1);var QP=H(Z(),1),m9=Yc("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 om({className:e,tone:t,...a}){return(0,QP.jsx)("div",{"data-slot":"alert",className:ve(m9({tone:t}),e),...a})}var JP=H(Z(),1);var vO=H(we(),1);var ey="Accepting needs a reason";function eO(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 tO(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 aO(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 Oe=(e,t,a)=>({never:e,pattern:new RegExp(`(?<![\\w-])(?:${t})(?![\\w-])`,"i"),say:a}),nO=[Oe("scope","scopes?|scoped","plan"),Oe("contract","contracts?","plan"),Oe("signs","signs|signed(?!\\s+(?:in|out|into)\\b)","Approved by …"),Oe("sealed","seal|seals|sealed|sealing","approved"),Oe("binds","binds?","approved"),Oe("digest","digests?","(the plan version, in Details)"),Oe("worker","workers?","builder"),Oe("runner","runners?","builder"),Oe("daemon","daemons?","builder"),Oe("background service","background service","builder"),Oe("operator","operators?|instance operator","approver, or owner"),Oe("coordinator","coordinators?","your lead"),Oe("mate","mate","your lead"),Oe("scout","scouts?|scouting|scouted","research"),Oe("criterion","criterion|criteria","requirement"),Oe("evidence","evidence","requirement, or the saved files"),Oe("proof","proofs?","requirement"),Oe("verdict","verdicts?","requirement"),Oe("caveat","caveats?","requirement"),Oe("mark complete","mark(?:ed|s|ing)?\\s+(?:it\\s+|this\\s+|that\\s+|them\\s+|the\\s+result\\s+)?complete","Accept"),Oe("Accept and finish","accept\\s+and\\s+finish","Accept"),Oe("Revise","revise","Send back, or Request changes"),Oe("re-file","re-?file[ds]?|re-?filing","Send back, or Request changes"),Oe("Draft a repair task","draft\\s+a\\s+repair\\s+task","Send back"),Oe("put away","put(?:s|ting)?\\s+(?:it\\s+|them\\s+|tasks\\s+|old\\s+tasks\\s+)?away","Archive"),Oe("tidy","tidy|tidied|tidying","Archive"),Oe("run #N","(?:run|attempt|result)\\s+#?\\d+","build #N"),Oe("reconcile","reconcile[ds]?|reconciling|reconciliation","Waiting: Toolroll is …"),Oe("requeue","requeue[ds]?|requeuing","Waiting: Toolroll is …"),Oe("claim","claim|claimed","Waiting: Toolroll is …"),Oe("lease","leases?|leased","Waiting: Toolroll is …"),Oe("custody","custody","Waiting: Toolroll is …"),Oe("incident","incidents?","Waiting: Toolroll is …"),Oe("plane","plane","Toolroll"),Oe("fence","fences?|fenced","Waiting: Toolroll is …"),Oe("attested","attest|attested|attestation","Waiting: Toolroll is …"),Oe("receipt","receipts?","Waiting: Toolroll is …"),Oe("regate","regate[ds]?","Run checks"),Oe("carried","carried|carry|carries","Waiting: Toolroll is …"),Oe("incarnation","incarnations?","Waiting: Toolroll is …"),Oe("admission","admission","Waiting: Toolroll is …"),Oe("quiescence","quiescen(?:ce|t)","Waiting: Toolroll is …"),Oe("witness","witness(?:es|ed)?","Waiting: Toolroll is …"),Oe("unproven","unproven","Waiting: Toolroll is …"),Oe("version hex","(?=[0-9a-f]*\\d)(?=[0-9a-f]*[a-f])[0-9a-f]{12,64}","(the plan version, in Details)")],h9=nO.map(e=>e.never);var ape=[Oe("lead","lead","Toolroll, or Chat"),Oe("crew","crew","Toolroll"),Oe("scope","scopes?|scoped","plan"),Oe("mode","modes?","(Settings)"),Oe("flow","flows?","(Settings)"),Oe("fleet","fleet","(Settings)"),Oe("fallback","fallbacks?","(Settings)"),Oe("routing","routing|routed","(Settings)"),Oe("spend","spend|spends|spending|spent","cost"),Oe("MCP","mcp","(Settings)"),Oe("password","passwords?|passwordless","(only where one is asked for)"),Oe("token","tokens?","(Settings)"),Oe("builder","builders?","taking work")];var v9="/settings/computers?section=start",sO=e=>e===null?v9:`/settings/computers?task=${encodeURIComponent(e)}&section=start`;var $S=()=>!0,oO=e=>e.build==null?"the last build":`build #${e.build}`,rO=e=>e.build==null?"The last build":`Build #${e.build}`,rm={approval:{sentence:()=>"Review the plan and approve it to start.",action:{code:"approve-scope",label:"Approve 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:$S},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 ${oO(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:$S},"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=>`${rO(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=>`${rO(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 ${oO(e)}. Approve the new plan, then retry it.`,action:{code:"approve-scope",label:"Approve 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"}},other:{sentence:()=>"Open the task to see what it needs from you.",action:{code:"inspect-task",label:"Open the task"},useReason:$S}};var US={decide:"Decide",review:"Review",unblock:"Unblock"};var iO={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"},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"},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 spe=Object.fromEntries(Object.entries(iO).flatMap(([e,t])=>t.need===void 0?[]:[[e,t.need]]));var lO=500;var uO=["Queued","Planning","Needs you","Waiting","Building","Ready for review","Complete","Failed","Stopped"],VS={Queued:"neutral",Planning:"live","Needs you":"attention",Waiting:"neutral",Building:"live","Ready for review":"ready",Complete:"success",Failed:"danger",Stopped:"neutral"};var y9="The check result couldn't be read.",vpe=`${y9} Run checks on it, or open the result to see why.`;var ype={ok:qi`<path d="M20 6 9 17l-5-5"/>`,running:qi`<circle cx="12" cy="12" r="4"/>`,none:qi`<circle cx="12" cy="12" r="3"/>`,note:qi`<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:qi`<path d="M18 6 6 18M6 6l12 12"/>`};var sm={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 cO(e){let t=w9(e);return{word:e==="Needs you"?sm.needs.word:e,tone:sm[t].tone,status:t}}function w9(e){switch(VS[e]){case"attention":case"ready":return"needs";case"live":return"running";case"success":return"finished";case"danger":return"failed";case"neutral":return"queued"}}var jS={idle:{word:"Idle",tone:""},building:{word:"Building",tone:"live"},offline:{word:"Offline",tone:"failed"}};function Xi(e,t){return e==="way-in"?"password":t.automatic===!0?"automatic":e==="none"||t.passwordless||e==="standard"&&t.remembered?"click":"password"}function dO(e,t){let a=Xi(e,t);return a==="password"?"password":a==="automatic"?"automatic":e==="none"?"none":t.passwordless?"passwordless":"remembered"}function uu(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 fO(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 pO={ok:"Done",run:"Now",q:"Queued",bad:"Failed",wait:"Needs you"};function mO(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 hO={done:"done",needs:"waiting on you",live:"in progress",wait:"waiting",stuck:"stopped here",skipped:"skipped",todo:"not started"},gO=e=>`steprow-${e}`;var ye=e=>["path",{d:e}],Gi=(e,t,a)=>["circle",{cx:e,cy:t,r:a}],ty={home:[ye("m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"),ye("M9 22V12h6v10")],tasks:[ye("m3 17 2 2 4-4"),ye("m3 7 2 2 4-4"),ye("M13 6h8"),ye("M13 12h8"),ye("M13 18h8")],flows:[["rect",{x:3,y:3,width:8,height:8,rx:2}],ye("M7 11v4a2 2 0 0 0 2 2h4"),["rect",{x:13,y:13,width:8,height:8,rx:2}]],agents:[ye("M12 8V4H8"),["rect",{x:4,y:8,width:16,height:12,rx:2}],ye("M2 14h2"),ye("M20 14h2"),ye("M15 13v2"),ye("M9 13v2")],projects:[ye("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:[ye("M21 4h-7"),ye("M10 4H3"),ye("M21 12h-9"),ye("M8 12H3"),ye("M21 20h-5"),ye("M12 20H3"),ye("M14 2v4"),ye("M8 10v4"),ye("M16 18v4")],pen:[ye("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:[ye("M5 12h14"),ye("m12 5 7 7-7 7")],plus:[ye("M12 5v14"),ye("M5 12h14")],send:[ye("M12 19V5"),ye("m5 12 7-7 7 7")],stop:[["rect",{x:6,y:6,width:12,height:12,rx:2}]],x:[ye("M18 6 6 18"),ye("m6 6 12 12")],back:[ye("m15 18-6-6 6-6")],menu:[ye("M4 6h16"),ye("M4 12h16"),ye("M4 18h16")],search:[Gi(11,11,7),ye("m20 20-3.5-3.5")],chevron:[ye("m6 9 6 6 6-6")],check:[ye("M20 6 9 17l-5-5")],alert:[Gi(12,12,9),ye("M12 8v4"),ye("M12 16h.01")],more:[Gi(5,12,1),Gi(12,12,1),Gi(19,12,1)],file:[ye("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),ye("M14 3v5h5")],minus:[ye("M5 12h14")],fit:[ye("M15 3h6v6"),ye("M9 21H3v-6"),ye("M21 3l-7 7"),ye("M3 21l7-7")],bolt:[ye("M13 2 4 14h7l-1 8 9-12h-7z")],code:[ye("m16 18 6-6-6-6"),ye("m8 6-6 6 6 6")],sun:[Gi(12,12,4),ye("M12 2v2"),ye("M12 20v2"),ye("m4.93 4.93 1.41 1.41"),ye("m17.66 17.66 1.41 1.41"),ye("M2 12h2"),ye("M20 12h2"),ye("m6.34 17.66-1.41 1.41"),ye("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}],ye("M15 2v2"),ye("M15 20v2"),ye("M2 15h2"),ye("M2 9h2"),ye("M20 15h2"),ye("M20 9h2"),ye("M9 2v2"),ye("M9 20v2")],bell:[ye("M10.27 21a2 2 0 0 0 3.46 0"),ye("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:[ye("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:[ye("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:[ye("M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"),Gi(9,7,4),ye("M22 21v-2a4 4 0 0 0-3-3.87"),ye("M16 3.13a4 4 0 0 1 0 7.75")],coin:[Gi(12,12,10),ye("M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"),ye("M12 18V6")],monitor:[["rect",{x:2,y:3,width:20,height:14,rx:2}],ye("M8 21h8"),ye("M12 17v4")],list:[ye("M8 6h13"),ye("M8 12h13"),ye("M8 18h13"),ye("M3 6h.01"),ye("M3 12h.01"),ye("M3 18h.01")],board:[["rect",{x:3,y:3,width:18,height:18,rx:2}],ye("M9 3v18"),ye("M15 3v18")],panel:[["rect",{x:3,y:3,width:18,height:18,rx:2}],ye("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}],ye("M6 6h.01"),ye("M6 18h.01")]};var yO=H(Z(),1);function Je({name:e,small:t=!1}){return(0,yO.jsx)("svg",{className:Qe("k-i",t&&"k-i-sm"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:ty[e].map((a,n)=>(0,vO.createElement)(a[0],{key:n,...a[1]}))})}var Rn=H(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,Rn.jsx)("button",{type:l,className:Qe("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,Rn.jsx)(Je,{name:a}):(0,Rn.jsx)("span",{className:"k-face",children:s?(0,Rn.jsxs)(Rn.Fragment,{children:[(0,Rn.jsx)("span",{className:"k-spin","aria-hidden":"true"}),s]}):(0,Rn.jsxs)(Rn.Fragment,{children:[n&&(0,Rn.jsx)(Je,{name:n,small:!0}),o]})})})}function Fe({variant:e="outline",sm:t,label:a,lead:n,className:o,...r}){return(0,Rn.jsx)("a",{className:Qe("k-btn",`k-btn-${e}`,t&&"k-btn-sm",o),...r,children:(0,Rn.jsxs)("span",{className:"k-face",children:[n&&(0,Rn.jsx)(Je,{name:n,small:!0}),a]})})}var ay=H(Z(),1);function qe({word:e,tone:t="",dot:a=!0}){return(0,ay.jsx)("span",{className:Qe("k-chip",t,!a&&"nodot"),children:e})}var im=({status:e})=>(0,ay.jsx)(qe,{word:sm[e].word,tone:sm[e].tone});function WS({headline:e}){let{word:t,tone:a}=cO(e);return(0,ay.jsx)(qe,{word:t,tone:a})}var wO=H(Z(),1);function St({n:e,ink:t=!1}){return(0,wO.jsx)("span",{className:Qe("k-count",t&&e>0&&"ink",e===0&&"zero"),children:e})}var ny=H(Z(),1);function xO({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,ny.jsx)("div",{className:"k-tabs",role:"tablist","aria-label":e,children:a.map((r,s)=>(0,ny.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 gd=H(Z(),1);function Jr({label:e,current:t,items:a,onChange:n}){return(0,gd.jsx)("div",{className:"k-seg",role:"group","aria-label":e,children:a.map(o=>(0,gd.jsxs)("button",{type:"button","aria-pressed":o.key===t,onClick:()=>n(o.key),children:[o.label,o.count]},o.key))})}function cu({label:e,current:t,items:a,icons:n}){return(0,gd.jsx)("nav",{className:Qe("k-seg",n&&"k-seg-icons"),"aria-label":e,children:a.map(o=>(0,gd.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 oy=H(Z(),1);function wr({items:e,sm:t,wide:a,className:n,...o}){return(0,oy.jsx)("span",{className:Qe("k-selw",t&&"sm",a&&"wide",n),children:(0,oy.jsx)("select",{className:"k-sel",...o,children:e.map(r=>{let[s,i]=typeof r=="string"?[r,r]:r;return(0,oy.jsx)("option",{value:s,children:i},s)})})})}var bO=H(Z(),1);var kO=H(Z(),1);var Os=H(Z(),1);function SO({name:e,legend:t,current:a,items:n,onChange:o}){return(0,Os.jsxs)("fieldset",{className:"k-radios",children:[(0,Os.jsx)("legend",{className:"k-sr",children:t}),n.map(r=>(0,Os.jsxs)("label",{className:"k-opt",children:[(0,Os.jsx)("input",{type:"radio",name:e,value:r.value,checked:r.value===a,onChange:()=>o(r.value)}),(0,Os.jsxs)("span",{children:[(0,Os.jsx)("b",{children:r.label}),r.text&&(0,Os.jsx)("span",{children:r.text})]}),r.tag]},r.value))]})}var CO=H(Z(),1),es=({children:e})=>(0,CO.jsx)("div",{className:"k-acts",children:e});var LO=H(we(),1),vd=H(Z(),1);function KS({rows:e}){return(0,vd.jsx)("dl",{className:"k-facts",children:e.map(([t,a])=>(0,vd.jsxs)(LO.Fragment,{children:[(0,vd.jsx)("dt",{children:t}),(0,vd.jsx)("dd",{children:a})]},t))})}var du=H(Z(),1),Ja=({children:e})=>(0,du.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,du.jsx)(Je,{name:"alert",small:!0}),(0,du.jsx)("span",{children:e})]}),Bs=({children:e})=>(0,du.jsx)("p",{className:"k-notice info",children:e}),ya=({children:e})=>(0,du.jsx)("p",{className:"k-note",children:e});var lm=H(Z(),1);function Ca({title:e,text:t,action:a}){return(0,lm.jsxs)("div",{className:"k-empty",children:[(0,lm.jsx)("p",{className:"k-empty-t",children:e}),t&&(0,lm.jsx)("p",{className:"k-empty-x",children:t}),a]})}var ry=H(Z(),1);function cn({summary:e,children:t,open:a,onToggle:n}){return(0,ry.jsxs)("details",{className:"k-disclose",open:a,onToggle:n===void 0?void 0:o=>n(o.currentTarget.open),children:[(0,ry.jsx)("summary",{children:e}),t]})}var En=H(Z(),1),bo=({label:e,count:t,right:a,id:n})=>(0,En.jsxs)("h2",{className:"k-grp",id:n,children:[e,t,a!==void 0&&(0,En.jsxs)(En.Fragment,{children:[(0,En.jsx)("span",{className:"k-grow"}),a]})]});function dn({href:e,chip:t,title:a,desc:n,meta:o,action:r,wait:s,message:i}){return(0,En.jsxs)("div",{className:Qe("k-row",s&&"wait",e===void 0&&"k-row-static"),children:[(0,En.jsx)("span",{className:"k-row-c",children:t}),e===void 0?(0,En.jsx)("span",{className:"k-row-t",children:a}):(0,En.jsx)("a",{className:"k-row-t",href:e,children:a}),(0,En.jsx)("span",{className:"k-row-d",children:n}),(0,En.jsx)("span",{className:"k-row-m",children:o}),(0,En.jsx)("span",{className:"k-row-a",children:r}),i&&(0,En.jsx)("div",{className:"k-row-msg",children:i})]})}var fn=H(Z(),1);function sy({title:e,back:t,trailing:a}){return(0,fn.jsxs)("header",{className:"k-ph",children:[t&&(0,fn.jsx)("a",{className:"k-btn k-btn-ghost k-btn-icon",href:t,"aria-label":"Back",title:"Back",children:(0,fn.jsx)(Je,{name:"back"})}),(0,fn.jsx)("p",{className:"k-ph-t",children:e}),a]})}function Jn({title:e,ctx:t,right:a,back:n,phoneTitle:o,trailing:r}){return(0,fn.jsxs)(fn.Fragment,{children:[(0,fn.jsx)(sy,{title:o??e,...n?{back:n}:{},trailing:r}),(0,fn.jsxs)("div",{className:"k-tb",children:[(0,fn.jsx)("h1",{children:e}),t&&(0,fn.jsx)("span",{className:"k-tb-ctx",children:t}),a&&(0,fn.jsxs)(fn.Fragment,{children:[(0,fn.jsx)("span",{className:"k-grow"}),a]})]})]})}var jo=H(Z(),1);function um({title:e,back:t,meta:a,right:n,same:o}){return(0,jo.jsxs)(jo.Fragment,{children:[t&&(0,jo.jsxs)("a",{className:"k-backlink",href:t[0],children:[(0,jo.jsx)(Je,{name:"back",small:!0}),t[1]]}),(0,jo.jsxs)("header",{className:"k-dh",children:[(0,jo.jsxs)("div",{children:[(0,jo.jsx)("h1",{className:o?"k-same":void 0,children:e}),a&&(0,jo.jsx)("p",{className:"k-dh-meta",children:a})]}),n]})]})}var NO=({children:e})=>(0,jo.jsx)("div",{className:"k-doc",children:e});var Hs=H(we(),1),WO=H(Ro(),1);var ts="form.k-sform",dm=e=>HTMLFormElement.prototype.getAttribute.call(e,"id")??"",x9=e=>Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(e),IO="http://www.w3.org/2000/svg",zs=e=>e.querySelector("[data-k-proof]"),as=e=>e.querySelector("[data-k-save]"),MO=e=>new Set(Array.from(zs(e)?.querySelectorAll("input[name]")??[]).map(t=>t.name));function ly(e,t=null){let a=MO(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 JS(e){let t=new Map;for(let[a,n]of e)t.set(a,[...t.get(a)??[],n]);return t}function DO(e){let t=MO(e),a=[];for(let n of Array.from(x9(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 xr=e=>(e??"").replace(/\s+/g," ").trim();function _O(e,t){return e.querySelector(`[name="${CSS.escape(t)}"]`)}function b9(e,t){let a=_O(e,t);if(a===null)return t;let n=a.getAttribute("aria-label");if(n)return xr(n);if(a.type==="radio"||a.type==="checkbox"&&a.getAttribute("role")!=="switch"){let s=a.closest("fieldset")?.querySelector("legend");if(s)return xr(s.textContent)}let o=a.closest(".k-frow")?.querySelector(".k-frow-t");if(o)return xr(o.textContent);let r=a.labels?.[0];return r?xr(r.querySelector(".k-sl-t, b")?.textContent??r.textContent):t}function k9(e,t,a){let n=_O(e,t);if(n instanceof HTMLSelectElement)return xr(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=>xr(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}},MM=()=>({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"||NW(location.hostname)});function NW(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 DM(){return typeof fetch=="function"&&typeof ReadableStream=="function"&&typeof TextDecoder=="function"&&typeof AbortController=="function"}function oS(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 Cv=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=oS(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(oS),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=oS(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",[CW]:"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 rS,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"&&LW.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=nS(Number.POSITIVE_INFINITY,this.deps.random())):this.deps.online()?(this.waiting="backoff",n=nS(this.attempt,this.deps.random()),this.attempt+=1):(this.waiting="offline",n=nS(Number.POSITIVE_INFINITY,this.deps.random())),this.setState(this.waiting==="backoff"?"reconnecting":this.waiting==="offline"?"offline":"signed-out"),this.schedule(n)}};var Tv="so:live",PM=["change","here","gone","turn"],Lv=3e4,Nv=2e3,ad=(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}`}`},IW=new Set(["workspace","summary","chat","team"]),TW=e=>e.split(/[:?]/,1)[0]??"",Iv=e=>e===""?[]:new URLSearchParams(e.slice(e.indexOf("?")+1)).getAll("room");function RW(){return typeof document>"u"?"eventsource":document.getElementById("standing-orders-workspace")?.dataset.liveReader==="stream"&&DM()?"stream":"eventsource"}var sS=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?IW.has(TW(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(Tv,{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??=RW(),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=Iv(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<Nv){this.settling===null&&(this.settling=window.setTimeout(()=>{this.settling=null,this.reconcile()},Nv-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(Iv(t)),this.refusedAt=0;for(let r of PM)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()+Lv,window.setTimeout(()=>this.reconcile(),Lv))}),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()+Lv,window.setTimeout(()=>this.reconcile(),Lv)}})}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=Iv(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<Nv){this.settling===null&&(this.settling=window.setTimeout(()=>{this.settling=null,this.reconcile()},Nv-o));return}this.unsettle(),a===""?delete document.documentElement.dataset.live:document.documentElement.dataset.live="1",t.want(a,document.hidden)}startSupervisor(){let t=new Cv({...MM(),...this.deps},{opened:n=>{this.held=new Set(Iv(n)),this.refusedAt=0},frame:(n,o)=>{if(n==="reload"){this.deliver("reload","{}");return}PM.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())}},ed=new sS,EW=new Set(["workspace"]);if(typeof window<"u"){let e=window,t=n=>(typeof n=="string"&&EW.has(n)&&ed.subscribe(n,()=>{}),0),a=e.__soLiveRooms;if(Array.isArray(a))for(let n of a)t(n);e.__soLiveRooms={push:t}}function iS(e){ed.setQuiet(e)}function Ln(e,t,a=!1){let n=(0,td.useRef)(t);n.current=t,(0,td.useEffect)(()=>{if(e!==null)return ed.subscribe(e,(o,r)=>n.current(o,r),a)},[e,a])}function OM(e,t){return ed.subscribe(e,t)}function BM(){return(0,td.useSyncExternalStore)(ed.onConnectionState,ed.connectionState,()=>"idle")}var Rv=H(Z(),1),AW=Yc("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"}}),MW={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 Wr({className:e,tone:t,size:a,dot:n=!1,children:o,...r}){return(0,Rv.jsxs)("span",{"data-slot":"badge",className:ve(AW({tone:t,size:a}),e),...r,children:[n&&t!=="needs"&&(0,Rv.jsx)("span",{"aria-hidden":"true","data-badge-dot":!0,className:ve("size-1.5 shrink-0 rounded-full bg-current",MW[t??"neutral"])}),o]})}var zM=H(we(),1);var HM=H(Z(),1),DW=Object.defineProperty,_W=(e,t)=>DW(e,"name",{value:t,configurable:!0}),PW=zM.forwardRef(_W(function(t,a){return(0,HM.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")),FM=PW;var qM=H(we(),1);var Qe=(...e)=>e.filter(Boolean).join(" ");var Bi=H(Z(),1);function Ev({label:e,hint:t,error:a,children:n}){let o=(0,qM.useId)(),r=Qe(t&&`${o}-hint`,`${o}-err`);return(0,Bi.jsxs)("div",{className:"k-field",children:[(0,Bi.jsx)("label",{className:"k-label",htmlFor:o,children:e}),n({id:o,describedBy:r,invalid:!!a}),t&&(0,Bi.jsx)("p",{className:"k-hint",id:`${o}-hint`,children:t}),(0,Bi.jsx)("span",{className:"k-err",id:`${o}-err`,role:"alert",children:a??""})]})}var Nn=({className:e,...t})=>(0,Bi.jsx)("input",{className:Qe("k-input",e),...t}),nd=({className:e,...t})=>(0,Bi.jsx)("textarea",{className:Qe("k-textarea",e),...t});var Av=H(Z(),1);function Xl({className:e,...t}){return(0,Av.jsx)(FM,{"data-slot":"label",className:ve("flex items-center gap-2 text-sm font-medium leading-none",e),...t})}function Be({className:e,...t}){return(0,Av.jsx)(Nn,{"data-slot":"input",className:e,...t})}function Gt({className:e,...t}){return(0,Av.jsx)(nd,{"data-slot":"textarea",className:e,...t})}var Mv=H(we(),1);var $M=e=>e?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function UM(e,t,a=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:$M(e),size:24,node:t,...a.length>0?{aliases:a}:{}}}var VM=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=VM(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Sp=H(we(),1);var kp=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();var zi={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 lS(e){return e!=null}function WM(e,t={}){let a=t.attributeNames??{},n=d=>a[d]??d,o=e.size??e.width??zi.width,r=e.size??e.height??zi.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?kp(...l):kp("lucide",...i,...l),c=t.absoluteStrokeWidth?Number(t.strokeWidth??zi["stroke-width"])*Number(e.size??e.width??zi.width)/Number(t.size??t.width??zi.width):t.strokeWidth??zi["stroke-width"];return["svg",{...Object.entries(zi).reduce((d,[m,h])=>(d[n(m)]=h,d),{}),..."color"in t&&t.color&&{[n("stroke")]:t.color},..."size"in t&&lS(t.size)&&{[n("width")]:t.size,[n("height")]:t.size},..."width"in t&&lS(t.width)&&{[n("width")]:t.width},..."height"in t&&lS(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,w]=d,x=t.nonScalingStroke?{[n("vector-effect")]:"non-scaling-stroke",...h}:h;return w?[m,x,w]:[m,x]})]}function KM(e,t={}){return WM(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}var GM=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var od=H(we(),1);var BW=(0,od.createContext)({});var XM=()=>(0,od.useContext)(BW);var YM=(0,Sp.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:w=!1,nonScalingStroke:x=!1,color:v="currentColor",className:y=""}=XM()??{},g=!!l||GM(f),[b,k,C=[]]=KM(c,{color:e??v,width:a??t??m,height:n??t??m,strokeWidth:o??h,absoluteStrokeWidth:r??w,nonScalingStroke:s??x,className:kp(y,i),hasA11yProp:g,attributes:f});return(0,Sp.createElement)(b,{ref:d,...k},[...C.map(([N,L])=>(0,Sp.createElement)(N,L)),...Array.isArray(l)?l:[l]])});function Ie(e,t=[],a=[]){let n=typeof e=="string"?UM(e,t,a):e,o=(0,Mv.forwardRef)(({className:r,...s},i)=>(0,Mv.createElement)(YM,{ref:i,icon:n,className:r,...s}));return n.name&&(o.displayName=jM(n.name)),o}var ZM={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"}]]};ZM.node;var Cp=Ie(ZM);var QM={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"}]]};QM.node;var Lp=Ie(QM);var JM={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"}]]};JM.node;var Np=Ie(JM);var eD={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"}]]};eD.node;var Ip=Ie(eD);var tD={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};tD.node;var Ds=Ie(tD);var aD={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};aD.node;var Tp=Ie(aD);var nD={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};nD.node;var rd=Ie(nD);var oD={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};oD.node;var Rp=Ie(oD);var rD={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};rD.node;var Ep=Ie(rD);var sD={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"}]]};sD.node;var Ap=Ie(sD);var iD={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"}]]};iD.node;var Mp=Ie(iD);var lD={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"}]]};lD.node;var sd=Ie(lD);var uD={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"}]]};uD.node;var Dp=Ie(uD);var cD={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"}]]};cD.node;var _p=Ie(cD);var dD={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"}]]};dD.node;var Pp=Ie(dD);var fD={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"}]]};fD.node;var Op=Ie(fD);var pD={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"}]]};pD.node;var id=Ie(pD);var mD={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"}]]};mD.node;var ld=Ie(mD);var hD={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"}]]};hD.node;var Bp=Ie(hD);var gD={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"}]]};gD.node;var zp=Ie(gD);var vD={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"}]]};vD.node;var ud=Ie(vD);var yD={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"}]]};yD.node;var Hp=Ie(yD);var wD={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"]};wD.node;var Hi=Ie(wD);var xD={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};xD.node;var dr=Ie(xD);var bD={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};bD.node;var Fp=Ie(bD);var kD={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"}]]};kD.node;var qp=Ie(kD);var SD={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"}]]};SD.node;var $p=Ie(SD);var CD={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"}]]};CD.node;var cd=Ie(CD);var LD={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"]};LD.node;var Fi=Ie(LD);var ND={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"]};ND.node;var In=Ie(ND);var ID={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"}]]};ID.node;var Up=Ie(ID);var TD={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"}]]};TD.node;var Vp=Ie(TD);var RD={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"}]]};RD.node;var jp=Ie(RD);var ED={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"}]]};ED.node;var Wp=Ie(ED);var AD={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};AD.node;var Yn=Ie(AD);var MD={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"}]]};MD.node;var dd=Ie(MD);var Us=H(we(),1);var Vo=H(we(),1);var PD=Symbol("html"),Kp=class{#e;constructor(t,a){if(t!==PD)throw new TypeError("Html is made by html`…`");this.#e=a}static markupOf(t){return t.#e}toString(){if(DD)throw new Error("Html coerced to a string: interpolate it with html`…` or hand it to a sink");return this.#e}toJSON(){if(DD)throw new Error("Html serialized as JSON: convert it with htmlString() first");return this.#e}},DD=typeof process<"u"&&process.env.VITEST!==void 0,zW=e=>new Kp(PD,e);var HW={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},FW=e=>e.replace(/[&<>"']/g,t=>HW[t]);function OD(e){if(e==null||typeof e=="boolean")return"";if(e instanceof Kp)return Kp.markupOf(e);if(Array.isArray(e))return e.map(OD).join("");if(typeof e=="string")return FW(e);if(typeof e=="number"||typeof e=="bigint")return String(e);throw new TypeError(`html: cannot interpolate ${typeof e}`)}var _D=new WeakSet,qW=/<form\b[^>]*\bmethod\s*=\s*["']?post\b/i,$W=/\bname\s*=\s*["']?csrf\b/i;function UW(e){if(_D.has(e))return;let t=e.join("\0");if(qW.test(t))throw new Error("html: write POST forms with postForm, which adds the CSRF field");if($W.test(t))throw new Error("html: postForm adds the CSRF field; don't write one");_D.add(e)}function qi(e,...t){UW(e);let a=e[0];for(let n=0;n<t.length;n++)a+=OD(t[n])+e[n+1];return zW(a)}var VW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],jW=864e5,BD=new Map;function WW(e){let t=BD.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"}),BD.set(e,t)),t}function uS(e,t){let a=o=>Object.fromEntries(WW(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 zD=e=>Math.floor(Date.UTC(e.year,e.month-1,e.day)/jW);function xo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}function fr(e,t=new Date,a="UTC",n=!1){let o=new Date(e);if(Number.isNaN(o.getTime()))return e;let r=uS(o,a),s=uS(t,a),i=zD(r)-zD(s);if(i===0)return r.clock;if(i===-1)return`Yesterday ${r.clock}`;if(i===1)return`Tomorrow ${r.clock}`;let l=`${VW[r.month-1]} ${r.day}`;return`${r.year===s.year?l:`${l} ${r.year}`}${n?` ${r.clock}`:""}`}function Dv(e,t=new Date,a=xo()){if(Number.isNaN(new Date(e.at).getTime()))return e.label;let n=fr(e.at,t,a,!0);return/^(?:\d|Tomorrow|Yesterday)/.test(n)?`${e.label} ${n}`:`${e.label.replace(/ at$/,"")} ${n}`}function HD(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 Yl(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=uS(a,t);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")} ${n.clock}${t==="UTC"?" UTC":""}`}function FD(e,t=new Date,a=xo()){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=KW(o,a);n.textContent!==i&&(n.textContent=i);return}let r=fr(o,t,a),s=Yl(o,a);n.title!==s&&(n.title=s),n.textContent!==r&&(n.textContent=r)})}function KW(e,t="UTC"){let a=new Date(e);if(Number.isNaN(a.getTime()))return e;let n=String(a.getUTCSeconds()).padStart(2,"0"),o=Yl(e,t);return t==="UTC"?o.replace(/ UTC$/,`:${n} UTC`):`${o}:${n}`}var $i=H(Z(),1),cS=!1;function fS(){cS||(cS=!0,queueMicrotask(()=>{cS=!1,FD(document),window.dispatchEvent(new CustomEvent("standing-orders:workspace-rendered"))}))}var dS="form.approve-form, form.k-approve",GW=["form.approve-form","form.k-approve"].flatMap(e=>[`${e} button[type="submit"]`,`${e} input[type="submit"]`]).join(", ");function qD(e){return e.contains(document.activeElement)&&document.activeElement?.matches("input, textarea, select, [contenteditable=true]")===!0||e.querySelector(`${dS}, details[open] form`)!==null}function kt({html:e,immutable:t=!1,className:a=""}){let n=(0,Vo.useRef)(null),o=(0,Vo.useRef)(null),r=(0,Vo.useRef)(!1),[s,i]=(0,Vo.useState)(0),[l,u]=(0,Vo.useState)(!1),[c,f]=(0,Vo.useState)(!1);return(0,Vo.useEffect)(()=>{let d=n.current,m=()=>i(h=>h+1);return d?.addEventListener("toggle",m,!0),()=>d?.removeEventListener("toggle",m,!0)},[]),(0,Vo.useLayoutEffect)(()=>{let d=n.current;if(!d||o.current===e||t&&o.current!==null)return;if(o.current!==null&&(r.current||qD(d))){let w=d.querySelector("[data-approval]"),x=new DOMParser().parseFromString(e,"text/html").querySelector("[data-approval]");!!d.querySelector(dS)&&w?.dataset.approval!==x?.dataset.approval?(u(!0),d.querySelectorAll(GW).forEach(y=>{y.disabled=!0})):d.querySelector(dS)||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),fS()},[e,t,s]),(0,$i.jsxs)("div",{className:`so-native-region ${a}`,"data-workspace-native":!0,children:[l&&(0,$i.jsxs)(Cn,{tone:"error",children:["The plan changed. ",(0,$i.jsx)("a",{href:window.location.href,children:"Review the current plan"})," before approving."]}),c&&(0,$i.jsxs)("p",{className:"so-deferred",role:"status",children:["Updates are available. Your form is preserved. ",(0,$i.jsx)("a",{href:window.location.href,children:"Reload"})]}),(0,$i.jsx)("div",{ref:n,onInput:()=>{r.current=!0},onChange:()=>{r.current=!0},onBlur:()=>i(d=>d+1)})]})}var $D=H(Z(),1);function Zl({className:e,...t}){return(0,$D.jsx)("section",{"data-slot":"card",className:ve("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 za=H(we(),1);var pr=H(we(),1);var _v=H(Z(),1),Zn=H(we(),1);var Ql=H(Z(),1),XW=Object.defineProperty,Ba=(e,t)=>XW(e,"name",{value:t,configurable:!0});function Gp(e){let t=e+"CollectionProvider",[a,n]=kn(t),[o,r]=a(t,{collectionRef:{current:null},itemMap:new Map}),s=Ba(w=>{let{scope:x,children:v}=w,y=pr.useRef(null),g=pr.useRef(new Map).current;return(0,_v.jsx)(o,{scope:x,itemMap:g,collectionRef:y,children:v})},"CollectionProvider");s.displayName=t;let i=e+"CollectionSlot",l=jn(i),u=pr.forwardRef((w,x)=>{let{scope:v,children:y}=w,g=r(i,v),b=Tt(x,g.collectionRef);return(0,_v.jsx)(l,{ref:b,children:y})});u.displayName=i;let c=e+"CollectionItemSlot",f="data-radix-collection-item",d=jn(c),m=pr.forwardRef((w,x)=>{let{scope:v,children:y,...g}=w,b=pr.useRef(null),k=Tt(x,b),C=r(c,v);return pr.useEffect(()=>(C.itemMap.set(b,{ref:b,...g}),()=>{C.itemMap.delete(b)})),(0,_v.jsx)(d,{[f]:"",ref:k,children:y})});m.displayName=c;function h(w){let x=r(e+"CollectionConsumer",w);return pr.useCallback(()=>{let y=x.collectionRef.current;if(!y)return[];let g=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((C,N)=>g.indexOf(C.ref.current)-g.indexOf(N.ref.current))},[x.collectionRef,x.itemMap])}return Ba(h,"useCollection"),[{Provider:s,Slot:u,ItemSlot:m},h,n]}Ba(Gp,"createCollection");var UD=new WeakMap,pS=class Ui extends Map{static{Ba(this,"OrderedDict")}#e;constructor(t){super(t),this.#e=[...super.keys()],UD.set(this,!0)}set(t,a){return UD.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=hS(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],w=f;f=this.get(h),this.delete(h),this.set(h,w)}return this}with(t,a,n){let o=new Ui(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=Pv(this.#e,t);if(a!==void 0)return this.get(a)}entryAt(t){let a=Pv(this.#e,t);if(a!==void 0)return[a,this.get(a)]}indexOf(t){return this.#e.indexOf(t)}keyAt(t){return Pv(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 Ui(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 Ui(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 Ui(a)}toReversed(){let t=new Ui;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 Ui(a)}slice(t,a){let n=new Ui,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 Pv(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=VD(e,t);return a===-1?void 0:e[a]}Ba(Pv,"at");function VD(e,t){let a=e.length,n=hS(t),o=n>=0?n:a+n;return o<0||o>=a?-1:o}Ba(VD,"toSafeIndex");function hS(e){return e!==e||e===0?0:Math.trunc(e)}Ba(hS,"toSafeInteger");function YW(e){let t=e+"CollectionProvider",[a,n]=kn(t),[o,r]=a(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new pS,setItemMap:Ba(()=>{},"setItemMap")}),s=Ba(({state:g,...b})=>g?(0,Ql.jsx)(l,{...b,state:g}):(0,Ql.jsx)(i,{...b}),"CollectionProvider");s.displayName=t;let i=Ba(g=>{let b=x();return(0,Ql.jsx)(l,{...g,state:b})},"CollectionInit");i.displayName=t+"Init";let l=Ba(g=>{let{scope:b,children:k,state:C}=g,N=Zn.useRef(null),[L,R]=Zn.useState(null),z=Tt(N,R),[M,_]=C;return Zn.useEffect(()=>{if(!L)return;let B=KD(()=>{});return B.observe(L,{childList:!0,subtree:!0}),()=>{B.disconnect()}},[L]),(0,Ql.jsx)(o,{scope:b,itemMap:M,setItemMap:_,collectionRef:z,collectionRefObject:N,collectionElement:L,children:k})},"CollectionProviderImpl");l.displayName=t+"Impl";let u=e+"CollectionSlot",c=jn(u),f=Zn.forwardRef((g,b)=>{let{scope:k,children:C}=g,N=r(u,k),L=Tt(b,N.collectionRef);return(0,Ql.jsx)(c,{ref:L,children:C})});f.displayName=u;let d=e+"CollectionItemSlot",m="data-radix-collection-item",h=jn(d),w=Zn.forwardRef((g,b)=>{let{scope:k,children:C,...N}=g,L=Zn.useRef(null),[R,z]=Zn.useState(null),M=Tt(b,L,z),_=r(d,k),{setItemMap:B}=_,S=Zn.useRef(N);jD(S.current,N)||(S.current=N);let T=S.current;return Zn.useEffect(()=>{let E=T;return B(A=>R?A.has(R)?A.set(R,{...E,element:R}).toSorted(mS):(A.set(R,{...E,element:R}),A.toSorted(mS)):A),()=>{B(A=>!R||!A.has(R)?A:(A.delete(R),new pS(A)))}},[R,T,B]),(0,Ql.jsx)(h,{[m]:"",ref:M,children:C})});w.displayName=d;function x(){return Zn.useState(new pS)}Ba(x,"useInitCollection");function v(g){let{itemMap:b}=r(e+"CollectionConsumer",g);return b}return Ba(v,"useCollection"),[{Provider:s,Slot:f,ItemSlot:w},{createCollectionScope:n,useCollection:v,useInitCollection:x}]}Ba(YW,"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}Ba(jD,"shallowEqual");function WD(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Ba(WD,"isElementPreceding");function mS(e,t){return!e[1].element||!t[1].element?0:WD(e[1].element,t[1].element)?-1:1}Ba(mS,"sortByDocumentPosition");function KD(e){return new MutationObserver(a=>{for(let n of a)if(n.type==="childList"){e();return}})}Ba(KD,"getChildListObserver");var Ov=H(we(),1),JW=H(Z(),1),ZW=Object.defineProperty,QW=(e,t)=>ZW(e,"name",{value:t,configurable:!0}),eK=Ov.createContext(void 0);function Xp(e){let t=Ov.useContext(eK);return e||t||"ltr"}QW(Xp,"useDirection");var aK=H(we(),1),Bv=H(we(),1),tK=Object.defineProperty,vS=(e,t)=>tK(e,"name",{value:t,configurable:!0}),gS=!1;function GD(){let[e,t]=Bv.useState(gS);return Bv.useEffect(()=>{gS||(gS=!0,t(!0))},[]),e}vS(GD,"useIsHydrated");var XD=aK[" useSyncExternalStore ".trim().toString()];function YD(){return()=>{}}vS(YD,"subscribe");function ZD(){return XD(YD,()=>!0,()=>!1)}vS(ZD,"useIsHydratedModern");var QD=typeof XD=="function"?ZD:GD;var Vi=H(Z(),1),nK=Object.defineProperty,Jl=(e,t)=>nK(e,"name",{value:t,configurable:!0}),yS="rovingFocusGroup.onEntryFocus",oK={bubbles:!1,cancelable:!0},zv="RovingFocusGroup",[wS,JD,rK]=Gp(zv),[sK,xS]=kn(zv,[rK]),[iK,lK]=sK(zv),uK=za.forwardRef(Jl(function(t,a){return(0,Vi.jsx)(wS.Provider,{scope:t.__scopeRovingFocusGroup,children:(0,Vi.jsx)(wS.Slot,{scope:t.__scopeRovingFocusGroup,children:(0,Vi.jsx)(cK,{...t,ref:a})})})},"RovingFocusGroup")),cK=za.forwardRef(Jl(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=za.useRef(null),h=Tt(a,m),w=Xp(s),[x,v]=$l({prop:i,defaultProp:l??null,onChange:u,caller:zv}),[y,g]=za.useState(!1),b=Wn(c),k=JD(n),C=za.useRef(!1),[N,L]=za.useState(0);return za.useEffect(()=>{let R=m.current;if(R)return R.addEventListener(yS,b),()=>R.removeEventListener(yS,b)},[b]),(0,Vi.jsx)(iK,{scope:n,orientation:o,dir:w,loop:r,currentTabStopId:x,onItemFocus:za.useCallback(R=>v(R),[v]),onItemShiftTab:za.useCallback(()=>g(!0),[]),onFocusableItemAdd:za.useCallback(()=>L(R=>R+1),[]),onFocusableItemRemove:za.useCallback(()=>L(R=>R-1),[]),children:(0,Vi.jsx)(ta.div,{tabIndex:y||N===0?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...t.style},onMouseDown:ut(t.onMouseDown,()=>{C.current=!0}),onFocus:ut(t.onFocus,R=>{let z=!C.current;if(R.target===R.currentTarget&&z&&!y){let M=new CustomEvent(yS,oK);if(R.currentTarget.dispatchEvent(M),!M.defaultPrevented){let _=k().filter(A=>A.focusable),B=_.find(A=>A.active),S=_.find(A=>A.id===x),E=[B,S,..._].filter(Boolean).map(A=>A.ref.current);bS(E,f)}}C.current=!1}),onBlur:ut(t.onBlur,()=>g(!1))})})},"RovingFocusGroupImpl")),dK="RovingFocusGroupItem",fK=za.forwardRef(Jl(function(t,a){let{__scopeRovingFocusGroup:n,focusable:o=!0,active:r=!1,tabStopId:s,children:i,...l}=t,u=Vr(),c=s||u,f=lK(dK,n),d=f.currentTabStopId===c,m=JD(n),{onFocusableItemAdd:h,onFocusableItemRemove:w,currentTabStopId:x}=f,v=QD();return ga(()=>{if(!(!v||!o))return h(),()=>w()},[v,o,h,w]),za.useEffect(()=>{if(!(v||!o))return h(),()=>w()},[v,o,h,w]),(0,Vi.jsx)(wS.ItemSlot,{scope:n,id:c,focusable:o,active:r,children:(0,Vi.jsx)(ta.span,{tabIndex:d?0:-1,"data-orientation":f.orientation,...l,ref:a,onMouseDown:ut(t.onMouseDown,y=>{o?f.onItemFocus(c):y.preventDefault()}),onFocus:ut(t.onFocus,()=>f.onItemFocus(c)),onKeyDown:ut(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;let g=t_(y,f.orientation,f.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.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(y.currentTarget);k=f.loop?a_(k,C+1):k.slice(C+1)}setTimeout(()=>bS(k))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:x!=null}):i})})},"RovingFocusGroupItem")),pK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function e_(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Jl(e_,"getDirectionAwareKey");function t_(e,t,a){let n=e_(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return pK[n]}Jl(t_,"getFocusIntent");function bS(e,t=!1){let a=document.activeElement;for(let n of e)if(n===a||(n.focus({preventScroll:t}),document.activeElement!==a))return}Jl(bS,"focusFirst");function a_(e,t){return e.map((a,n)=>e[(t+n)%e.length])}Jl(a_,"wrapArray");var n_=uK,o_=fK;var hK=H(Z(),1);var r_=H(we(),1);var gK=Object.defineProperty,vK=(e,t)=>gK(e,"name",{value:t,configurable:!0});function kS(e){let[t,a]=r_.useState(void 0);return ga(()=>{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}vK(kS,"useSize");var s_=H(Z(),1);var un=H(we(),1);var u_=["top","right","bottom","left"];var Kr=Math.min,mr=Math.max,Zp=Math.round,Qp=Math.floor,Gr=e=>({x:e,y:e}),yK={left:"right",right:"left",bottom:"top",top:"bottom"};function SS(e,t,a){return mr(e,Kr(t,a))}function Xr(e,t){return typeof e=="function"?e(t):e}function _s(e){return e.split("-")[0]}function eu(e){return e.split("-")[1]}function Fv(e){return e==="x"?"y":"x"}function qv(e){return e==="y"?"height":"width"}function hr(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function $v(e){return Fv(hr(e))}function c_(e,t,a){a===void 0&&(a=!1);let n=eu(e),o=$v(e),r=qv(o),s=o==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Yp(s)),[s,Yp(s)]}function d_(e){let t=Yp(e);return[Hv(e),t,Hv(t)]}function Hv(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var i_=["left","right"],l_=["right","left"],wK=["top","bottom"],xK=["bottom","top"];function bK(e,t,a){switch(e){case"top":case"bottom":return a?t?l_:i_:t?i_:l_;case"left":case"right":return t?wK:xK;default:return[]}}function f_(e,t,a,n){let o=eu(e),r=bK(_s(e),a==="start",n);return o&&(r=r.map(s=>s+"-"+o),t&&(r=r.concat(r.map(Hv)))),r}function Yp(e){let t=_s(e);return yK[t]+e.slice(t.length)}function kK(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 CS(e){return typeof e!="number"?kK(e):{top:e,right:e,bottom:e,left:e}}function tu(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 p_(e,t,a){let{reference:n,floating:o}=e,r=hr(t),s=$v(t),i=qv(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=eu(t);return h&&(m[s]+=d*(h==="end"?1:-1)*(a&&u?-1:1)),m}async function g_(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}=Xr(t,e),h=CS(m),x=i[d?f==="floating"?"reference":"floating":f],v=tu(await r.getClippingRect({element:(a=await(r.isElement==null?void 0:r.isElement(x)))==null||a?x:x.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(i.floating)),boundary:u,rootBoundary:c,strategy:l})),y=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=tu(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:y,offsetParent:g,strategy:l}):y);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 SK=50,v_=async(e,t,a)=>{let{placement:n="bottom",strategy:o="absolute",middleware:r=[],platform:s}=a,i=s.detectOverflow?s:{...s,detectOverflow:g_},l=await(s.isRTL==null?void 0:s.isRTL(t)),u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=p_(u,n,l),d=n,m=0,h={};for(let w=0;w<r.length;w++){let x=r[w];if(!x)continue;let{name:v,fn:y}=x,{x:g,y:b,data:k,reset:C}=await y({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<SK&&(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}=p_(u,d,l)),w=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:h}},y_=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}=Xr(e,t)||{};if(u==null)return{};let f=CS(c),d={x:a,y:n},m=$v(o),h=qv(m),w=await s.getDimensions(u),x=m==="y",v=x?"top":"left",y=x?"bottom":"right",g=x?"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,R=N/2-w[h]/2-1,z=Kr(f[v],R),M=Kr(f[y],R),_=N-w[h]-M,B=N/2-w[h]/2+L,S=SS(z,B,_),T=!l.arrow&&eu(o)!=null&&B!==S&&r.reference[h]/2-(B<z?z:M)-w[h]/2<0,E=T?B<z?B-z:B-_:0;return{[m]:d[m]+E,data:{[m]:S,centerOffset:B-S-E,...T&&{alignmentOffset:E}},reset:T}}});var w_=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:w=!0,...x}=Xr(e,t);if((a=r.arrow)!=null&&a.alignmentOffset)return{};let v=_s(o),y=hr(i),g=_s(i)===i,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),k=d||(g||!w?[Yp(i)]:d_(i)),C=h!=="none";!d&&C&&k.push(...f_(i,w,h,b));let N=[i,...k],L=await l.detectOverflow(t,x),R=[],z=((n=r.flip)==null?void 0:n.overflows)||[];if(c&&R.push(L[v]),f){let S=c_(o,s,b);R.push(L[S[0]],L[S[1]])}if(z=[...z,{placement:o,overflows:R}],!R.every(S=>S<=0)){var M,_;let S=(((M=r.flip)==null?void 0:M.index)||0)+1,T=N[S];if(T&&(!(f==="alignment"?y!==hr(T):!1)||z.every(q=>hr(q.placement)===y?q.overflows[0]>0:!0)))return{data:{index:S,overflows:z},reset:{placement:T}};let E=(_=z.filter(A=>A.overflows[0]<=0).sort((A,q)=>A.overflows[1]-q.overflows[1])[0])==null?void 0:_.placement;if(!E)switch(m){case"bestFit":{var B;let A=(B=z.filter(q=>{if(C){let D=hr(q.placement);return D===y||D==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(D=>D>0).reduce((D,O)=>D+O,0)]).sort((q,D)=>q[1]-D[1])[0])==null?void 0:B[0];A&&(E=A);break}case"initialPlacement":E=i;break}if(o!==E)return{reset:{placement:E}}}return{}}}};function m_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function h_(e){return u_.some(t=>e[t]>=0)}var x_=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:a,platform:n}=t,{strategy:o="referenceHidden",...r}=Xr(e,t);switch(o){case"referenceHidden":{let s=await n.detectOverflow(t,{...r,elementContext:"reference"}),i=m_(s,a.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:h_(i)}}}case"escaped":{let s=await n.detectOverflow(t,{...r,altBoundary:!0}),i=m_(s,a.floating);return{data:{escapedOffsets:i,escaped:h_(i)}}}default:return{}}}}};var b_=new Set(["left","top"]);async function CK(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=eu(a),l=hr(a)==="y",u=b_.has(s)?-1:1,c=r&&l?-1:1,f=Xr(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 k_=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 CK(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}}}}},S_=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:y=>{let{x:g,y:b}=y;return{x:g,y:b}}},...u}=Xr(e,t),c={x:a,y:n},f=await r.detectOverflow(t,u),d=hr(o),m=Fv(d),h=c[m],w=c[d],x=(y,g)=>SS(g+f[y==="y"?"top":"left"],g,g-f[y==="y"?"bottom":"right"]);s&&(h=x(m,h)),i&&(w=x(d,w));let v=l.fn({...t,[m]:h,[d]:w});return{...v,data:{x:v.x-a,y:v.y-n,enabled:{[m]:s,[d]:i}}}}}},C_=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}=Xr(e,t),d={x:o,y:r},m=hr(s),h=Fv(m),w=d[h],x=d[m],v=Xr(u,t),y=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]+y.mainAxis,N=i.reference[h]+i.reference[k]-y.mainAxis;w<C?w=C:w>N&&(w=N)}if(f){var g,b;let k=h==="y"?"width":"height",C=b_.has(_s(s)),N=i.reference[m]-i.floating[k]+(C&&((g=l.offset)==null?void 0:g[m])||0)+(C?0:y.crossAxis),L=i.reference[m]+i.reference[k]+(C?0:((b=l.offset)==null?void 0:b[m])||0)-(C?y.crossAxis:0);x<N?x=N:x>L&&(x=L)}return{[h]:w,[m]:x}}}},L_=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}=Xr(e,t),l=await o.detectOverflow(t,i),u=_s(a),c=eu(a),f=hr(a)==="y",{width:d,height:m}=n.floating,h,w;u==="top"||u==="bottom"?(h=u,w=c===(await(o.isRTL==null?void 0:o.isRTL(r.floating))?"start":"end")?"left":"right"):(w=u,h=c==="end"?"top":"bottom");let x=m-l.top-l.bottom,v=d-l.left-l.right,y=Kr(m-l[h],x),g=Kr(d-l[w],v),b=t.middlewareData.shift,k=!b,C=y,N=g;b!=null&&b.enabled.x&&(N=v),b!=null&&b.enabled.y&&(C=x),k&&!c&&(f?N=d-2*mr(l.left,l.right):C=m-2*mr(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 Uv(){return typeof window<"u"}function ou(e){return I_(e)?(e.nodeName||"").toLowerCase():"#document"}function Tn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yr(e){var t;return(t=(I_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I_(e){return Uv()?e instanceof Node||e instanceof Tn(e).Node:!1}function gr(e){return Uv()?e instanceof Element||e instanceof Tn(e).Element:!1}function Ps(e){return Uv()?e instanceof HTMLElement||e instanceof Tn(e).HTMLElement:!1}function N_(e){return!Uv()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Tn(e).ShadowRoot}function Jp(e){let{overflow:t,overflowX:a,overflowY:n,display:o}=vr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&o!=="inline"&&o!=="contents"}function T_(e){return/^(table|td|th)$/.test(ou(e))}function em(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var LK=/transform|translate|scale|rotate|perspective|filter/,NK=/paint|layout|strict|content/,au=e=>!!e&&e!=="none",LS;function Vv(e){let t=gr(e)?vr(e):e;return au(t.transform)||au(t.translate)||au(t.scale)||au(t.rotate)||au(t.perspective)||!jv()&&(au(t.backdropFilter)||au(t.filter))||LK.test(t.willChange||"")||NK.test(t.contain||"")}function R_(e){let t=ji(e);for(;Ps(t)&&!fd(t);){if(Vv(t))return t;if(em(t))return null;t=ji(t)}return null}function jv(){return LS==null&&(LS=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),LS}function fd(e){return/^(html|body|#document)$/.test(ou(e))}function vr(e){return Tn(e).getComputedStyle(e)}function tm(e){return gr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ji(e){if(ou(e)==="html")return e;let t=e.assignedSlot||e.parentNode||N_(e)&&e.host||Yr(e);return N_(t)?t.host:t}function E_(e){let t=ji(e);return fd(t)?(e.ownerDocument||e).body:Ps(t)&&Jp(t)?t:E_(t)}function nu(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);let o=E_(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),s=Tn(o);if(r){let i=Wv(s);return t.concat(s,s.visualViewport||[],Jp(o)?o:[],i&&a?nu(i):[])}else return t.concat(o,nu(o,[],a))}function Wv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function D_(e){let t=vr(e),a=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=Ps(e),r=o?e.offsetWidth:a,s=o?e.offsetHeight:n,i=Zp(a)!==r||Zp(n)!==s;return i&&(a=r,n=s),{width:a,height:n,$:i}}function IS(e){return gr(e)?e:e.contextElement}function pd(e){let t=IS(e);if(!Ps(t))return Gr(1);let a=t.getBoundingClientRect(),{width:n,height:o,$:r}=D_(t),s=(r?Zp(a.width):a.width)/n,i=(r?Zp(a.height):a.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var IK=Gr(0);function __(e){let t=Tn(e);return!jv()||!t.visualViewport?IK:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function TK(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===Tn(e)}function ru(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);let o=e.getBoundingClientRect(),r=IS(e),s=Gr(1);t&&(n?gr(n)&&(s=pd(n)):s=pd(e));let i=TK(r,a,n)?__(r):Gr(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=Tn(r),m=gr(n)?Tn(n):n,h=d,w=Wv(h);for(;w&&m!==h;){let x=pd(w),v=w.getBoundingClientRect(),y=vr(w),g=v.left+(w.clientLeft+parseFloat(y.paddingLeft))*x.x,b=v.top+(w.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,u*=x.y,c*=x.x,f*=x.y,l+=g,u+=b,h=Tn(w),w=Wv(h)}}return tu({width:c,height:f,x:l,y:u})}function Kv(e,t){let a=tm(e).scrollLeft;return t?t.left+a:ru(Yr(e)).left+a}function P_(e,t){let a=e.getBoundingClientRect(),n=a.left+t.scrollLeft-Kv(e,a),o=a.top+t.scrollTop;return{x:n,y:o}}function RK(e){let{elements:t,rect:a,offsetParent:n,strategy:o}=e,r=o==="fixed",s=Yr(n),i=t?em(t.floating):!1;if(n===s||i&&r)return a;let l={scrollLeft:0,scrollTop:0},u=Gr(1),c=Gr(0),f=Ps(n);if((f||!r)&&((ou(n)!=="body"||Jp(s))&&(l=tm(n)),f)){let m=ru(n);u=pd(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}let d=s&&!f&&!r?P_(s,l):Gr(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 EK(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function AK(e){let t=tm(e),a=e.ownerDocument.body,n=mr(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),o=mr(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight),r=-t.scrollLeft+Kv(e),s=-t.scrollTop;return vr(a).direction==="rtl"&&(r+=mr(e.clientWidth,a.clientWidth)-n),{width:n,height:o,x:r,y:s}}var MK=25;function DK(e,t,a){a===void 0&&(a="viewport");let n=a==="layoutViewport",o=Tn(e),r=Yr(e),s=o.visualViewport,i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(s){let d=!jv()||t==="fixed";n?d||(u=-s.offsetLeft,c=-s.offsetTop):(i=s.width,l=s.height,d&&(u=s.offsetLeft,c=s.offsetTop))}if(Kv(r)<=0){let d=r.ownerDocument,m=d.body,h=getComputedStyle(m),w=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,x=Math.abs(r.clientWidth-m.clientWidth-w),v=getComputedStyle(r).scrollbarGutter==="stable both-edges"?x/2:x;v<=MK&&(i-=v)}return{width:i,height:l,x:u,y:c}}function _K(e,t){let a=ru(e,!0,t==="fixed"),n=a.top+e.clientTop,o=a.left+e.clientLeft,r=pd(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 A_(e,t,a){let n;if(t==="viewport"||t==="layoutViewport")n=DK(e,a,t);else if(t==="document")n=AK(Yr(e));else if(gr(t))n=_K(t,a);else{let o=__(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return tu(n)}function PK(e,t){let a=t.get(e);if(a)return a;let n=nu(e,[],!1).filter(i=>gr(i)&&ou(i)!=="body"),o=null,r=vr(e).position==="fixed",s=r?ji(e):e;for(;gr(s)&&!fd(s);){let i=vr(s),l=Vv(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 OK(e){let{element:t,boundary:a,rootBoundary:n,strategy:o}=e,s=[...a==="clippingAncestors"?em(t)?[]:PK(t,this._c):[].concat(a),n],i=A_(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=A_(t,s[d],o);l=mr(m.top,l),u=Kr(m.right,u),c=Kr(m.bottom,c),f=mr(m.left,f)}return{width:u-f,height:c-l,x:f,y:l}}function BK(e){let{width:t,height:a}=D_(e);return{width:t,height:a}}function zK(e,t,a){let n=Ps(t),o=Yr(t),r=a==="fixed",s=ru(e,!0,r,t),i={scrollLeft:0,scrollTop:0},l=Gr(0);if((n||!r)&&((ou(t)!=="body"||Jp(o))&&(i=tm(t)),n)){let d=ru(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}!n&&o&&(l.x=Kv(o));let u=o&&!n&&!r?P_(o,i):Gr(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 NS(e){return vr(e).position==="static"}function M_(e,t){if(!Ps(e)||vr(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return Yr(e)===a&&(a=a.ownerDocument.body),a}function O_(e,t){let a=Tn(e);if(em(e))return a;if(!Ps(e)){let o=ji(e);for(;o&&!fd(o);){if(gr(o)&&!NS(o))return o;o=ji(o)}return a}let n=M_(e,t);for(;n&&T_(n)&&NS(n);)n=M_(n,t);return n&&fd(n)&&NS(n)&&!Vv(n)?a:n||R_(e)||a}var HK=async function(e){let t=this.getOffsetParent||O_,a=this.getDimensions,n=await a(e.floating);return{reference:zK(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function FK(e){return vr(e).direction==="rtl"}var B_={convertOffsetParentRelativeRectToViewportRelativeRect:RK,getDocumentElement:Yr,getClippingRect:OK,getOffsetParent:O_,getElementRects:HK,getClientRects:EK,getDimensions:BK,getScale:pd,isElement:gr,isRTL:FK};function z_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qK(e,t,a){let n=null,o,r=Yr(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:w,height:x}=d;if(c||t(),!w||!x)return;let v=Qp(h),y=Qp(r.clientWidth-(m+w)),g=Qp(r.clientHeight-(h+x)),b=Qp(m),C={rootMargin:-v+"px "+-y+"px "+-g+"px "+-b+"px",threshold:mr(0,Kr(1,f))||1},N=!0;function L(R){let z=R[0].intersectionRatio;if(!z_(d,e.getBoundingClientRect()))return i();if(z!==f){if(!N)return i();z?i(!1,z):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=Tn(e),u=()=>i(a);return l.addEventListener("resize",u),i(!0),()=>{l.removeEventListener("resize",u),s()}}function TS(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=IS(e),c=o||r?[...u?nu(u):[],...t?nu(t):[]]:[];c.forEach(v=>{o&&v.addEventListener("scroll",a),r&&v.addEventListener("resize",a)});let f=u&&i?qK(u,a,r):null,d=-1,m=null;s&&(m=new ResizeObserver(v=>{let[y]=v;y&&y.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,w=l?ru(e):null;l&&x();function x(){let v=ru(e);w&&!z_(w,v)&&a(),w=v,h=requestAnimationFrame(x)}return a(),()=>{var v;c.forEach(y=>{o&&y.removeEventListener("scroll",a),r&&y.removeEventListener("resize",a)}),f?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(h)}}var H_=k_;var F_=S_,q_=w_,$_=L_,U_=x_,RS=y_;var V_=C_,ES=(e,t,a)=>{let n=new Map,o=a??{},r={...B_,...o.platform,_c:n};return v_(e,t,{...o,platform:r})};var Sa=H(we(),1),W_=H(we(),1),K_=H(Ro(),1),$K=typeof document<"u",UK=function(){},Gv=$K?W_.useLayoutEffect:UK;function Xv(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(!Xv(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)&&!Xv(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function G_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function j_(e,t){let a=G_(e);return Math.round(t*a)/a}function AS(e){let t=Sa.useRef(e);return Gv(()=>{t.current=e}),t}function X_(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]=Sa.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[d,m]=Sa.useState(n);Xv(d,n)||m(n);let[h,w]=Sa.useState(null),[x,v]=Sa.useState(null),y=Sa.useCallback(q=>{q!==C.current&&(C.current=q,w(q))},[]),g=Sa.useCallback(q=>{q!==N.current&&(N.current=q,v(q))},[]),b=r||h,k=s||x,C=Sa.useRef(null),N=Sa.useRef(null),L=Sa.useRef(c),R=l!=null,z=AS(l),M=AS(o),_=AS(u),B=Sa.useCallback(()=>{if(!C.current||!N.current)return;let q={placement:t,strategy:a,middleware:d};M.current&&(q.platform=M.current),ES(C.current,N.current,q).then(D=>{let O={...D,isPositioned:_.current!==!1};S.current&&!Xv(L.current,O)&&(L.current=O,K_.flushSync(()=>{f(O)}))})},[d,t,a,M,_]);Gv(()=>{u===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(q=>({...q,isPositioned:!1})))},[u]);let S=Sa.useRef(!1);Gv(()=>(S.current=!0,()=>{S.current=!1}),[]),Gv(()=>{if(b&&(C.current=b),k&&(N.current=k),b&&k){if(z.current)return z.current(b,k,B);B()}},[b,k,B,z,R]);let T=Sa.useMemo(()=>({reference:C,floating:N,setReference:y,setFloating:g}),[y,g]),E=Sa.useMemo(()=>({reference:b,floating:k}),[b,k]),A=Sa.useMemo(()=>{let q={position:a,left:0,top:0};if(!E.floating)return q;let D=j_(E.floating,c.x),O=j_(E.floating,c.y);return i?{...q,transform:"translate("+D+"px, "+O+"px)",...G_(E.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:D,top:O}},[a,i,E.floating,c.x,c.y]);return Sa.useMemo(()=>({...c,update:B,refs:T,elements:E,floatingStyles:A}),[c,B,T,E,A])}var VK=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?RS({element:n.current,padding:o}).fn(a):{}:n?RS({element:n,padding:o}).fn(a):{}}}},Y_=(e,t)=>{let a=H_(e);return{name:a.name,fn:a.fn,options:[e,t]}},Z_=(e,t)=>{let a=F_(e);return{name:a.name,fn:a.fn,options:[e,t]}},Q_=(e,t)=>({fn:V_(e).fn,options:[e,t]}),J_=(e,t)=>{let a=q_(e);return{name:a.name,fn:a.fn,options:[e,t]}},eP=(e,t)=>{let a=$_(e);return{name:a.name,fn:a.fn,options:[e,t]}};var tP=(e,t)=>{let a=U_(e);return{name:a.name,fn:a.fn,options:[e,t]}};var aP=(e,t)=>{let a=VK(e);return{name:a.name,fn:a.fn,options:[e,t]}};var md=H(Z(),1),jK=Object.defineProperty,Wi=(e,t)=>jK(e,"name",{value:t,configurable:!0});var nP="Popper",[oP,MS]=kn(nP),[WK,rP]=oP(nP),KK=Wi(e=>{let{__scopePopper:t,children:a}=e,[n,o]=un.useState(null),[r,s]=un.useState(void 0);return(0,md.jsx)(WK,{scope:t,anchor:n,onAnchorChange:o,placementState:r,setPlacementState:s,children:a})},"Popper"),GK="PopperAnchor",XK=un.forwardRef(Wi(function(t,a){let{__scopePopper:n,virtualRef:o,...r}=t,s=rP(GK,n),i=un.useRef(null),l=s.onAnchorChange,u=un.useCallback(w=>{i.current=w,w&&l(w)},[l]),c=Tt(a,u),f=un.useRef(null);un.useEffect(()=>{if(!o)return;let w=f.current;f.current=o.current,w!==f.current&&l(f.current)});let d=s.placementState&&Yv(s.placementState),m=d?.[0],h=d?.[1];return o?null:(0,md.jsx)(ta.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...r,ref:c})},"PopperAnchor")),sP="PopperContent",[YK,Mde]=oP(sP),ZK=un.forwardRef(Wi(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:w,...x}=t,v=rP(sP,n),[y,g]=un.useState(null),b=Tt(a,g),[k,C]=un.useState(null),N=kS(k),L=N?.width??0,R=N?.height??0,z=o+(s!=="center"?"-"+s:""),M=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},_=Array.isArray(c)?c:[c],B=_.length>0,S={padding:M,boundary:_.filter(iP),altBoundary:B},{refs:T,floatingStyles:E,placement:A,isPositioned:q,middlewareData:D}=X_({strategy:"fixed",placement:z,whileElementsMounted:Wi((...F)=>TS(...F,{animationFrame:h==="always"}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[Y_({mainAxis:r+R,alignmentAxis:i}),u&&Z_({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Q_():void 0,...S}),u&&J_({...S}),eP({...S,apply:Wi(({elements:F,rects:G,availableWidth:pe,availableHeight:X})=>{let{width:ee,height:ge}=G.reference,be=F.floating.style;be.setProperty("--radix-popper-available-width",`${pe}px`),be.setProperty("--radix-popper-available-height",`${X}px`),be.setProperty("--radix-popper-anchor-width",`${ee}px`),be.setProperty("--radix-popper-anchor-height",`${ge}px`)},"apply")}),k&&aP({element:k,padding:l}),QK({arrowWidth:L,arrowHeight:R}),m&&tP({strategy:"referenceHidden",...S,boundary:B?S.boundary:void 0})]}),O=v.setPlacementState;ga(()=>(O(A),()=>{O(void 0)}),[A,O]);let[K,se]=Yv(A),ne=Wn(w);ga(()=>{q&&ne?.()},[q,ne]);let U=D.arrow?.x,W=D.arrow?.y,Q=D.arrow?.centerOffset!==0,[oe,V]=un.useState();return ga(()=>{y&&V(window.getComputedStyle(y).zIndex)},[y]),(0,md.jsx)("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...E,transform:q?E.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:(0,md.jsx)(YK,{scope:n,placedSide:K,placedAlign:se,onArrowChange:C,arrowX:U,arrowY:W,shouldHideArrow:Q,children:(0,md.jsx)(ta.div,{"data-side":K,"data-align":se,...x,ref:b,style:{...x.style,animation:q?x.style?.animation:"none"}})})})},"PopperContent"));function iP(e){return e!==null}Wi(iP,"isNotNull");var QK=Wi(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]=Yv(a),f={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,m=(o.arrow?.y??0)+l/2,h="",w="";return u==="bottom"?(h=s?f:`${d}px`,w=`${-l}px`):u==="top"?(h=s?f:`${d}px`,w=`${n.floating.height+l}px`):u==="right"?(h=`${-l}px`,w=s?f:`${m}px`):u==="left"&&(h=`${n.floating.width+l}px`,w=s?f:`${m}px`),{data:{x:h,y:w}}}}),"transformOrigin");function Yv(e){let[t,a="center"]=e.split("-");return[t,a]}Wi(Yv,"getSideAndAlignFromPlacement");var lP=KK,uP=XK,cP=ZK;var dP=H(Z(),1);var e7=H(Z(),1);var xe=H(we(),1),hP=H(Ro(),1);function t7(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 a7=e=>{switch(e){case"success":return r7;case"info":return i7;case"warning":return s7;case"error":return l7;default:return null}},n7=Array(12).fill(0),o7=({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"},n7.map((a,n)=>xe.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),r7=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"})),s7=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"})),i7=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"})),l7=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"})),u7=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"})),c7=()=>{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},d7=1,f7=100,fP=e=>{var t;return typeof e?.id=="number"||(e==null||(t=e.id)==null?void 0:t.length)>0?e.id:d7++},DS=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-f7;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=fP(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(m7(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=fP(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}},Qn=new DS,p7=(e,t)=>Qn.message(e,t),m7=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",h7=p7,g7=()=>Qn.toasts,v7=()=>Qn.getActiveToasts(),am=Object.assign(h7,{success:Qn.success,info:Qn.info,warning:Qn.warning,error:Qn.error,custom:Qn.custom,message:Qn.message,promise:Qn.promise,dismiss:Qn.dismiss,loading:Qn.loading},{getHistory:g7,getToasts:v7});t7("[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 Zv(e){return e.label!==void 0}var y7=3,w7="24px",x7="16px",pP=4e3,b7=356,k7=14,S7=45,C7=200;function Zr(...e){return e.filter(Boolean).join(" ")}function L7(e){let[t,a]=e.split("-"),n=[];return t&&n.push(t),a&&n.push(a),n}var N7=e=>{var t,a,n,o,r,s,i,l,u;let{invert:c,toast:f,unstyled:d,interacting:m,setHeights:h,visibleToasts:w,heights:x,index:v,toasts:y,expanded:g,removeToast:b,defaultRichColors:k,closeButton:C,style:N,cancelButtonStyle:L,actionButtonStyle:R,className:z="",descriptionClassName:M="",duration:_,position:B,gap:S,expandByDefault:T,classNames:E,icons:A,closeButtonAriaLabel:q="Close toast"}=e,[D,O]=xe.default.useState(null),[K,se]=xe.default.useState(null),[ne,U]=xe.default.useState(!1),[W,Q]=xe.default.useState(!1),[oe,V]=xe.default.useState(!1),[F,G]=xe.default.useState(!1),[pe,X]=xe.default.useState(!1),[ee,ge]=xe.default.useState(0),[be,ze]=xe.default.useState(0),Y=xe.default.useRef(f.duration||_||pP),Te=xe.default.useRef(null),Ue=xe.default.useRef(null),it=v===0,at=v+1<=w,te=f.type,Pe=te??"default",De=f.dismissible!==!1,mt=f.className||"",Bt=f.descriptionClassName||"",Zt=xe.default.useMemo(()=>x.findIndex(Ve=>Ve.toastId===f.id)||0,[x,f.id]),wa=xe.default.useMemo(()=>{var Ve;return(Ve=f.closeButton)!=null?Ve:C},[f.closeButton,C]),Lo=xe.default.useMemo(()=>f.duration||_||pP,[f.duration,_]),nn=xe.default.useRef(0),jt=xe.default.useRef(0),Pn=xe.default.useRef(0),so=xe.default.useRef(null),[af,Ou]=B.split("-"),Bu=xe.default.useMemo(()=>x.reduce((Ve,Qt,J)=>J>=Zt?Ve:Ve+Qt.height,0),[x,Zt]),Jo=c7(),gn=xe.default.useMemo(()=>{var Ve;return(Ve=e.swipeDirections)!=null?Ve:L7(B)},[e.swipeDirections,B]),nf=f.invert||c,ml=te==="loading";jt.current=xe.default.useMemo(()=>Zt*S+Bu,[Zt,Bu]),xe.default.useEffect(()=>{Y.current=Lo},[Lo]),xe.default.useEffect(()=>{U(!0)},[]),xe.default.useEffect(()=>{let Ve=Ue.current;if(Ve){let Qt=Ve.getBoundingClientRect().height;return ze(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(!ne)return;let Ve=Ue.current,Qt=Ve.style.height;Ve.style.height="auto";let J=Ve.getBoundingClientRect().height;Ve.style.height=Qt,ze(J),h(Le=>Le.find(xt=>xt.toastId===f.id)?Le.map(xt=>xt.toastId===f.id?{...xt,height:J}:xt):[{toastId:f.id,height:J,position:f.position},...Le])},[ne,f.title,f.description,h,f.id,f.jsx,f.action,f.cancel]);let No=xe.default.useCallback(()=>{Q(!0),ge(jt.current),h(Ve=>Ve.filter(Qt=>Qt.toastId!==f.id)),setTimeout(()=>{b(f)},C7)},[f,b,h,jt]);xe.default.useEffect(()=>{if(f.promise&&te==="loading"||f.duration===1/0||f.type==="loading")return;let Ve;return g||m||Jo?(()=>{if(Pn.current<nn.current){let Le=new Date().getTime()-nn.current;Y.current=Y.current-Le}Pn.current=new Date().getTime()})():Y.current!==1/0&&(nn.current=new Date().getTime(),Ve=setTimeout(()=>{f.onAutoClose==null||f.onAutoClose.call(f,f),No()},Y.current)),()=>clearTimeout(Ve)},[g,m,f,te,Jo,No]),xe.default.useEffect(()=>{f.delete&&(No(),f.onDismiss==null||f.onDismiss.call(f,f))},[No,f.delete]);function zu(){var Ve;if(A?.loading){var Qt;return xe.default.createElement("div",{className:Zr(E?.loader,f==null||(Qt=f.classNames)==null?void 0:Qt.loader,"sonner-loader"),"data-visible":te==="loading"},A.loading)}return xe.default.createElement(o7,{className:Zr(E?.loader,f==null||(Ve=f.classNames)==null?void 0:Ve.loader),visible:te==="loading"})}let of=f.icon||A?.[te]||a7(te);var Hu,ti;return xe.default.createElement("li",{tabIndex:0,ref:Ue,className:Zr(z,mt,E?.toast,f==null||(t=f.classNames)==null?void 0:t.toast,E?.[Pe],f==null||(a=f.classNames)==null?void 0:a[Pe]),"data-sonner-toast":"","data-rich-colors":(Hu=f.richColors)!=null?Hu:k,"data-styled":!(f.jsx||f.unstyled||d),"data-mounted":ne,"data-promise":!!f.promise,"data-swiped":pe,"data-removed":W,"data-visible":at,"data-y-position":af,"data-x-position":Ou,"data-index":v,"data-front":it,"data-swiping":oe,"data-dismissible":De,"data-type":te,"data-invert":nf,"data-swipe-out":F,"data-swipe-direction":K,"data-expanded":!!(g||T&&ne),"data-testid":f.testId,style:{"--index":v,"--toasts-before":v,"--z-index":y.length-v,"--offset":`${W?ee:jt.current}px`,"--initial-height":T?"auto":`${be}px`,...N,...f.style},onDragEnd:()=>{V(!1),O(null),so.current=null},onPointerDown:Ve=>{Ve.button!==2&&(ml||!De||(Te.current=new Date,ge(jt.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(V(!0),so.current={x:Ve.clientX,y:Ve.clientY})))},onPointerUp:()=>{var Ve,Qt,J;if(F||!De)return;so.current=null;let Le=Number(((Ve=Ue.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$e=Number(((Qt=Ue.current)==null?void 0:Qt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),xt=new Date().getTime()-((J=Te.current)==null?void 0:J.getTime()),On=D==="x"?Le:$e,Io=Math.abs(On)/xt;if((D==="x"?gn.includes(Le>0?"right":"left"):gn.includes($e>0?"bottom":"top"))&&(Math.abs(On)>=S7||Io>.11)){ge(jt.current),f.onDismiss==null||f.onDismiss.call(f,f),se(D==="x"?Le>0?"right":"left":$e>0?"down":"up"),No(),G(!0);return}else{var To,sf;(To=Ue.current)==null||To.style.setProperty("--swipe-amount-x","0px"),(sf=Ue.current)==null||sf.style.setProperty("--swipe-amount-y","0px")}X(!1),V(!1),O(null)},onPointerMove:Ve=>{var Qt,J,Le;if(!so.current||!De||((Qt=window.getSelection())==null?void 0:Qt.toString().length)>0)return;let xt=Ve.clientY-so.current.y,On=Ve.clientX-so.current.x;!D&&(Math.abs(On)>1||Math.abs(xt)>1)&&O(Math.abs(On)>Math.abs(xt)?"x":"y");let Io={x:0,y:0},rf=To=>1/(1.5+Math.abs(To)/20);if(D==="y"){if(gn.includes("top")||gn.includes("bottom"))if(gn.includes("top")&&xt<0||gn.includes("bottom")&&xt>0)Io.y=xt;else{let To=xt*rf(xt);Io.y=Math.abs(To)<Math.abs(xt)?To:xt}}else if(D==="x"&&(gn.includes("left")||gn.includes("right")))if(gn.includes("left")&&On<0||gn.includes("right")&&On>0)Io.x=On;else{let To=On*rf(On);Io.x=Math.abs(To)<Math.abs(On)?To:On}(Math.abs(Io.x)>0||Math.abs(Io.y)>0)&&X(!0),(J=Ue.current)==null||J.style.setProperty("--swipe-amount-x",`${Io.x}px`),(Le=Ue.current)==null||Le.style.setProperty("--swipe-amount-y",`${Io.y}px`)}},wa&&!f.jsx&&te!=="loading"?xe.default.createElement("button",{"aria-label":q,"data-disabled":ml,"data-close-button":!0,onClick:ml||!De?()=>{}:()=>{No(),f.onDismiss==null||f.onDismiss.call(f,f)},className:Zr(E?.closeButton,f==null||(n=f.classNames)==null?void 0:n.closeButton)},(ti=A?.close)!=null?ti:u7):null,(te||f.icon||f.promise)&&f.icon!==null&&(A?.[te]!==null||f.icon)?xe.default.createElement("div",{"data-icon":"",className:Zr(E?.icon,f==null||(o=f.classNames)==null?void 0:o.icon)},te==="loading"?f.icon||zu():f.promise?zu():null,te!=="loading"?of:null):null,xe.default.createElement("div",{"data-content":"",className:Zr(E?.content,f==null||(r=f.classNames)==null?void 0:r.content)},xe.default.createElement("div",{"data-title":"",className:Zr(E?.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:Zr(M,Bt,E?.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&&Zv(f.cancel)?xe.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||L,onClick:Ve=>{Zv(f.cancel)&&De&&(f.cancel.onClick==null||f.cancel.onClick.call(f.cancel,Ve),No())},className:Zr(E?.cancelButton,f==null||(l=f.classNames)==null?void 0:l.cancelButton)},f.cancel.label):null,xe.default.isValidElement(f.action)?f.action:f.action&&Zv(f.action)?xe.default.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||R,onClick:Ve=>{Zv(f.action)&&(f.action.onClick==null||f.action.onClick.call(f.action,Ve),!Ve.defaultPrevented&&No())},className:Zr(E?.actionButton,f==null||(u=f.classNames)==null?void 0:u.actionButton)},f.action.label):null)};function mP(){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 I7(e,t){let a={};return[e,t].forEach((n,o)=>{let r=o===1,s=r?"--mobile-offset":"--offset",i=r?x7:w7;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 gP=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:w,visibleToasts:x=y7,toastOptions:v,dir:y=mP(),gap:g=k7,icons:b,customAriaLabel:k,containerAriaLabel:C="Notifications"}=t,[N,L]=xe.default.useState([]),R=xe.default.useMemo(()=>n?N.filter(U=>U.toasterId===n):N.filter(U=>!U.toasterId),[N,n]),z=xe.default.useMemo(()=>Array.from(new Set([r].concat(R.filter(U=>U.position).map(U=>U.position)))),[R,r]),[M,_]=xe.default.useState([]),[B,S]=xe.default.useState(!1),[T,E]=xe.default.useState(!1),[A,q]=xe.default.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),D=xe.default.useRef(null),O=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=xe.default.useRef(null),se=xe.default.useRef(!1),ne=xe.default.useCallback(U=>{L(W=>{var Q;return(Q=W.find(oe=>oe.id===U.id))!=null&&Q.delete||Qn.dismiss(U.id),W.filter(({id:oe})=>oe!==U.id)})},[]);return xe.default.useEffect(()=>Qn.subscribe(U=>{if(U.dismiss){requestAnimationFrame(()=>{L(W=>W.map(Q=>Q.id===U.id?{...Q,delete:!0}:Q))});return}setTimeout(()=>{hP.default.flushSync(()=>{L(W=>{let Q=W.findIndex(oe=>oe.id===U.id);return Q!==-1?[...W.slice(0,Q),{...W[Q],...U},...W.slice(Q+1)]:[U,...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 U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:W})=>{q(W?"dark":"light")})}catch{U.addListener(({matches:Q})=>{try{q(Q?"dark":"light")}catch(oe){console.error(oe)}})}},[d]),xe.default.useEffect(()=>{N.length<=1&&S(!1)},[N]),xe.default.useEffect(()=>{let U=W=>{var Q;if(s.length>0&&s.every(F=>W[F]||W.code===F)){var V;S(!0),(V=D.current)==null||V.focus()}W.code==="Escape"&&(document.activeElement===D.current||(Q=D.current)!=null&&Q.contains(document.activeElement))&&S(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[s]),xe.default.useEffect(()=>{if(D.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,se.current=!1)}},[D.current]),xe.default.createElement("section",{ref:a,"aria-label":k??`${C} ${O}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},z.map((U,W)=>{var Q;let[oe,V]=U.split("-");return R.length?xe.default.createElement("ol",{key:U,dir:y==="auto"?mP():y,tabIndex:-1,ref:D,className:u,"data-sonner-toaster":!0,"data-sonner-theme":A,"data-y-position":oe,"data-x-position":V,style:{"--front-toast-height":`${((Q=M[0])==null?void 0:Q.height)||0}px`,"--width":`${b7}px`,"--gap":`${g}px`,...w,...I7(c,f)},onBlur:F=>{se.current&&!F.currentTarget.contains(F.relatedTarget)&&(se.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||se.current||(se.current=!0,K.current=F.relatedTarget)},onMouseEnter:()=>S(!0),onMouseMove:()=>S(!0),onMouseLeave:()=>{T||S(!1)},onDragEnd:()=>S(!1),onPointerDown:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},R.filter(F=>!F.position&&W===0||F.position===U).map((F,G)=>{var pe,X;return xe.default.createElement(N7,{key:F.id,icons:b,index:G,toast:F,defaultRichColors:m,duration:(pe=v?.duration)!=null?pe:h,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:o,visibleToasts:x,closeButton:(X=v?.closeButton)!=null?X:l,interacting:T,position:U,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ne,toasts:R.filter(ee=>ee.position==F.position),heights:M.filter(ee=>ee.position==F.position),setHeights:_,expandByDefault:i,gap:g,expanded:B,swipeDirections:t.swipeDirections})})):null}))});var yP=H(Z(),1);function vP(){return(0,yP.jsx)(gP,{position:"bottom-center",toastOptions:{classNames:{toast:"!bg-card !text-foreground !border !border-border !shadow-lg",description:"!text-muted-foreground"}}})}var yr=H(we(),1);var Ke=H(we(),1);var Dt=H(Z(),1),T7=Object.defineProperty,_t=(e,t)=>T7(e,"name",{value:t,configurable:!0}),_S=["Enter"," "],R7=["ArrowDown","PageUp","Home"],xP=["ArrowUp","PageDown","End"],E7=[...R7,...xP],rfe={ltr:[..._S,"ArrowRight"],rtl:[..._S,"ArrowLeft"]};var Jv="Menu",[PS,A7,M7]=Gp(Jv),[su,BS]=kn(Jv,[M7,MS,xS]),zS=MS(),bP=xS(),[D7,nm]=su(Jv),[_7,HS]=su(Jv),P7=_t(e=>{let{__scopeMenu:t,open:a=!1,children:n,dir:o,onOpenChange:r,modal:s=!0}=e,i=zS(t),[l,u]=Ke.useState(null),c=Ke.useRef(!1),f=Wn(r),d=Xp(o);return Ke.useEffect(()=>{let m=_t(()=>{c.current=!0,document.addEventListener("pointerdown",h,{capture:!0,once:!0}),document.addEventListener("pointermove",h,{capture:!0,once:!0})},"handleKeyDown"),h=_t(()=>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})}},[]),Ke.useEffect(()=>{if(!a)return;let m=_t(()=>f(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[a,f]),(0,Dt.jsx)(lP,{...i,children:(0,Dt.jsx)(D7,{scope:t,open:a,onOpenChange:f,content:l,onContentChange:u,children:(0,Dt.jsx)(_7,{scope:t,onClose:Ke.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:c,dir:d,modal:s,children:n})})})},"Menu"),O7=Ke.forwardRef(_t(function(t,a){let{__scopeMenu:n,...o}=t,r=zS(n);return(0,Dt.jsx)(uP,{...r,...o,ref:a})},"MenuAnchor")),kP="MenuPortal",[B7,z7]=su(kP,{forceMount:void 0}),H7=_t(e=>{let{__scopeMenu:t,forceMount:a,children:n,container:o}=e,r=nm(kP,t);return(0,Dt.jsx)(B7,{scope:t,forceMount:a,children:(0,Dt.jsx)(Ul,{present:a||r.open,children:(0,Dt.jsx)(sv,{asChild:!0,container:o,children:n})})})},"MenuPortal"),Ki="MenuContent",[F7,SP]=su(Ki),q7=Ke.forwardRef(_t(function(t,a){let n=z7(Ki,t.__scopeMenu),{forceMount:o=n.forceMount,...r}=t,s=nm(Ki,t.__scopeMenu),i=HS(Ki,t.__scopeMenu);return(0,Dt.jsx)(PS.Provider,{scope:t.__scopeMenu,children:(0,Dt.jsx)(Ul,{present:o||s.open,children:(0,Dt.jsx)(PS.Slot,{scope:t.__scopeMenu,children:i.modal?(0,Dt.jsx)($7,{...r,ref:a}):(0,Dt.jsx)(U7,{...r,ref:a})})})})},"MenuContent")),$7=Ke.forwardRef(_t(function(t,a){let n=nm(Ki,t.__scopeMenu),o=Ke.useRef(null),r=Tt(a,o);return Ke.useEffect(()=>{let s=o.current;if(s)return gv(s)},[]),(0,Dt.jsx)(CP,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ut(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentModal")),U7=Ke.forwardRef(_t(function(t,a){let n=nm(Ki,t.__scopeMenu);return(0,Dt.jsx)(CP,{...t,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},"MenuRootContentNonModal")),V7=jn("MenuContent.ScrollLock"),CP=Ke.forwardRef(_t(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:w,...x}=t,v=nm(Ki,n),y=HS(Ki,n),g=zS(n),b=bP(n),k=A7(n),[C,N]=Ke.useState(null),L=Ke.useRef(null),R=Tt(a,L,v.onContentChange),z=Ke.useRef(0),M=Ke.useRef(""),_=Ke.useRef(0),B=Ke.useRef(null),S=Ke.useRef("right"),T=Ke.useRef(0),E=w?vp:Ke.Fragment,A=w?{as:V7,allowPinchZoom:!0}:void 0,q=_t(O=>{let K=M.current+O,se=k().filter(V=>!V.disabled),ne=document.activeElement,U=se.find(V=>V.ref.current===ne)?.textValue,W=se.map(V=>V.textValue),Q=RP(W,K,U),oe=se.find(V=>V.textValue===Q)?.ref.current;_t((function V(F){M.current=F,window.clearTimeout(z.current),F!==""&&(z.current=window.setTimeout(()=>V(""),1e3))}),"updateSearch")(K),oe&&setTimeout(()=>oe.focus())},"handleTypeaheadSearch");Ke.useEffect(()=>()=>window.clearTimeout(z.current),[]),Vc();let D=Ke.useCallback(O=>S.current===B.current?.side&&AP(O,B.current?.area),[]);return(0,Dt.jsx)(F7,{scope:n,searchRef:M,onItemEnter:Ke.useCallback(O=>{D(O)&&O.preventDefault()},[D]),onItemLeave:Ke.useCallback(O=>{D(O)||(L.current?.focus(),N(null))},[D]),onTriggerLeave:Ke.useCallback(O=>{D(O)&&O.preventDefault()},[D]),pointerGraceTimerRef:_,onPointerGraceIntentChange:Ke.useCallback(O=>{B.current=O},[]),children:(0,Dt.jsx)(E,{...A,children:(0,Dt.jsx)(ov,{asChild:!0,trapped:r,onMountAutoFocus:ut(s,O=>{O.preventDefault(),L.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:(0,Dt.jsx)(nv,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:c,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:m,onDismiss:h,children:(0,Dt.jsx)(n_,{asChild:!0,...b,dir:y.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:N,onEntryFocus:ut(u,O=>{y.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Dt.jsx)(cP,{role:"menu","aria-orientation":"vertical","data-state":LP(v.open),"data-radix-menu-content":"",dir:y.dir,...g,...x,ref:R,style:{outline:"none",...x.style},onKeyDown:ut(x.onKeyDown,O=>{let se=O.target.closest("[data-radix-menu-content]")===O.currentTarget,ne=O.ctrlKey||O.altKey||O.metaKey,U=O.key.length===1;se&&(O.key==="Tab"&&O.preventDefault(),!ne&&U&&q(O.key));let W=L.current;if(O.target!==W||!E7.includes(O.key))return;O.preventDefault();let oe=k().filter(V=>!V.disabled).map(V=>V.ref.current);xP.includes(O.key)&&oe.reverse(),IP(oe)}),onBlur:ut(t.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(z.current),M.current="")}),onPointerMove:ut(t.onPointerMove,Qv(O=>{let K=O.target,se=T.current!==O.clientX;if(O.currentTarget.contains(K)&&se){let ne=O.clientX>T.current?"right":"left";S.current=ne,T.current=O.clientX}}))})})})})})})},"MenuContentImpl"));var j7=Ke.forwardRef(_t(function(t,a){let{__scopeMenu:n,...o}=t;return(0,Dt.jsx)(ta.div,{...o,ref:a})},"MenuLabel")),OS="MenuItem",wP="menu.itemSelect",W7=Ke.forwardRef(_t(function(t,a){let{disabled:n=!1,onSelect:o,...r}=t,s=Ke.useRef(null),i=HS(OS,t.__scopeMenu),l=SP(OS,t.__scopeMenu),u=Tt(a,s),c=Ke.useRef(!1),f=_t(()=>{let d=s.current;if(!n&&d){let m=new CustomEvent(wP,{bubbles:!0,cancelable:!0});d.addEventListener(wP,h=>o?.(h),{once:!0}),pp(d,m),m.defaultPrevented?c.current=!1:i.onClose()}},"handleSelect");return(0,Dt.jsx)(K7,{...r,ref:u,disabled:n,onClick:ut(t.onClick,f),onPointerDown:d=>{t.onPointerDown?.(d),c.current=!0},onPointerUp:ut(t.onPointerUp,d=>{c.current||d.currentTarget?.click()}),onKeyDown:ut(t.onKeyDown,d=>{n||d.target!==d.currentTarget||l.searchRef.current!==""&&d.key===" "||_S.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})},"MenuItem")),K7=Ke.forwardRef(_t(function(t,a){let{__scopeMenu:n,disabled:o=!1,textValue:r,...s}=t,i=SP(OS,n),l=bP(n),u=Ke.useRef(null),c=Tt(a,u),[f,d]=Ke.useState(!1),[m,h]=Ke.useState("");return Ke.useEffect(()=>{let w=u.current;w&&h((w.textContent??"").trim())},[s.children]),(0,Dt.jsx)(PS.ItemSlot,{scope:n,disabled:o,textValue:r??m,children:(0,Dt.jsx)(o_,{asChild:!0,...l,focusable:!o,children:(0,Dt.jsx)(ta.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...s,ref:c,onPointerMove:ut(t.onPointerMove,Qv(w=>{o?i.onItemLeave(w):(i.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ut(t.onPointerLeave,Qv(w=>i.onItemLeave(w))),onFocus:ut(t.onFocus,()=>d(!0)),onBlur:ut(t.onBlur,()=>d(!1))})})})},"MenuItemImpl"));var G7="MenuRadioGroup",[sfe,ife]=su(G7,{value:void 0,onValueChange:_t(()=>{},"onValueChange")});var X7="MenuItemIndicator",[lfe,ufe]=su(X7,{checked:!1});var Y7=Ke.forwardRef(_t(function(t,a){let{__scopeMenu:n,...o}=t;return(0,Dt.jsx)(ta.div,{role:"separator","aria-orientation":"horizontal",...o,ref:a})},"MenuSeparator"));var Z7="MenuSub",[cfe,dfe]=su(Z7);function LP(e){return e?"open":"closed"}_t(LP,"getOpenState");function NP(e){return e==="indeterminate"}_t(NP,"isIndeterminate");function Q7(e){return NP(e)?"indeterminate":e?"checked":"unchecked"}_t(Q7,"getCheckedState");function IP(e){let t=document.activeElement;for(let a of e)if(a===t||(a.focus(),document.activeElement!==t))return}_t(IP,"focusFirst");function TP(e,t){return e.map((a,n)=>e[(t+n)%e.length])}_t(TP,"wrapArray");function RP(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=TP(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}_t(RP,"getNextMatch");function EP(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}_t(EP,"isPointInPolygon");function AP(e,t){if(!t)return!1;let a={x:e.clientX,y:e.clientY};return EP(a,t)}_t(AP,"isPointerInGraceArea");function Qv(e){return t=>t.pointerType==="mouse"?e(t):void 0}_t(Qv,"whenMouse");var MP=P7,DP=O7,_P=H7,PP=q7;var OP=j7,BP=W7;var zP=Y7;var Qr=H(Z(),1),e9=Object.defineProperty,iu=(e,t)=>e9(e,"name",{value:t,configurable:!0}),FS="DropdownMenu",[t9,Tfe]=kn(FS,[BS]),lu=BS(),[a9,HP]=t9(FS),n9=iu(e=>{let{__scopeDropdownMenu:t,children:a,dir:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,l=lu(t),u=yr.useRef(null),[c,f]=$l({prop:o,defaultProp:r??!1,onChange:s,caller:FS});return(0,Qr.jsx)(a9,{scope:t,triggerId:Vr(),triggerRef:u,contentId:Vr(),open:c,onOpenChange:f,onOpenToggle:yr.useCallback(()=>f(d=>!d),[f]),modal:i,children:(0,Qr.jsx)(MP,{...l,open:c,onOpenChange:f,dir:n,modal:i,children:a})})},"DropdownMenu"),o9="DropdownMenuTrigger",r9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,disabled:o=!1,...r}=t,s=HP(o9,n),i=lu(n),l=Tt(a,s.triggerRef);return(0,Qr.jsx)(DP,{asChild:!0,...i,children:(0,Qr.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:ut(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(s.onOpenToggle(),s.open||u.preventDefault())}),onKeyDown:ut(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&s.onOpenToggle(),u.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),s9=iu(e=>{let{__scopeDropdownMenu:t,...a}=e,n=lu(t);return(0,Qr.jsx)(_P,{...n,...a})},"DropdownMenuPortal"),i9="DropdownMenuContent",l9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=HP(i9,n),s=lu(n),i=yr.useRef(!1);return(0,Qr.jsx)(PP,{id:r.contentId,"aria-labelledby":r.triggerId,...s,...o,ref:a,onCloseAutoFocus:ut(t.onCloseAutoFocus,l=>{i.current||r.triggerRef.current?.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:ut(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 u9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=lu(n);return(0,Qr.jsx)(OP,{...r,...o,ref:a})},"DropdownMenuLabel")),c9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=lu(n);return(0,Qr.jsx)(BP,{...r,...o,ref:a})},"DropdownMenuItem"));var d9=yr.forwardRef(iu(function(t,a){let{__scopeDropdownMenu:n,...o}=t,r=lu(n);return(0,Qr.jsx)(zP,{...r,...o,ref:a})},"DropdownMenuSeparator"));var FP=n9,qP=r9,$P=s9,UP=l9;var VP=u9,jP=c9;var WP=d9;var hd=H(Z(),1),KP=FP,GP=qP;function XP({className:e,sideOffset:t=4,...a}){return(0,hd.jsx)($P,{children:(0,hd.jsx)(UP,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ve("z-[120] min-w-44 overflow-hidden rounded-card border-0 bg-popover p-1 text-popover-foreground shadow-overlay",e),...a})})}function YP({className:e,...t}){return(0,hd.jsx)(jP,{"data-slot":"dropdown-menu-item",className:ve("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 qS({className:e,...t}){return(0,hd.jsx)(VP,{className:ve("px-2 py-1.5 text-xs font-semibold text-muted-foreground",e),...t})}var ZP=({className:e,...t})=>(0,hd.jsx)(WP,{className:ve("-mx-1 my-1 h-px bg-border",e),...t});var p9=H(Z(),1);var QP=H(Z(),1),m9=Yc("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 om({className:e,tone:t,...a}){return(0,QP.jsx)("div",{"data-slot":"alert",className:ve(m9({tone:t}),e),...a})}var JP=H(Z(),1);var vO=H(we(),1);var ey="Accepting needs a reason";function eO(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 tO(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 aO(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 Oe=(e,t,a)=>({never:e,pattern:new RegExp(`(?<![\\w-])(?:${t})(?![\\w-])`,"i"),say:a}),nO=[Oe("scope","scopes?|scoped","plan"),Oe("contract","contracts?","plan"),Oe("signs","signs|signed(?!\\s+(?:in|out|into)\\b)","Approved by …"),Oe("sealed","seal|seals|sealed|sealing","approved"),Oe("binds","binds?","approved"),Oe("digest","digests?","(the plan version, in Details)"),Oe("worker","workers?","builder"),Oe("runner","runners?","builder"),Oe("daemon","daemons?","builder"),Oe("background service","background service","builder"),Oe("operator","operators?|instance operator","approver, or owner"),Oe("coordinator","coordinators?","your lead"),Oe("mate","mate","your lead"),Oe("scout","scouts?|scouting|scouted","research"),Oe("criterion","criterion|criteria","requirement"),Oe("evidence","evidence","requirement, or the saved files"),Oe("proof","proofs?","requirement"),Oe("verdict","verdicts?","requirement"),Oe("caveat","caveats?","requirement"),Oe("mark complete","mark(?:ed|s|ing)?\\s+(?:it\\s+|this\\s+|that\\s+|them\\s+|the\\s+result\\s+)?complete","Accept"),Oe("Accept and finish","accept\\s+and\\s+finish","Accept"),Oe("Revise","revise","Send back, or Request changes"),Oe("re-file","re-?file[ds]?|re-?filing","Send back, or Request changes"),Oe("Draft a repair task","draft\\s+a\\s+repair\\s+task","Send back"),Oe("put away","put(?:s|ting)?\\s+(?:it\\s+|them\\s+|tasks\\s+|old\\s+tasks\\s+)?away","Archive"),Oe("tidy","tidy|tidied|tidying","Archive"),Oe("run #N","(?:run|result)\\s+#?\\d+|attempt\\s+#?\\d+(?!\\s+\\(build\\s+#\\d+\\))","build #N, or attempt N (build #M)"),Oe("reconcile","reconcile[ds]?|reconciling|reconciliation","Waiting: Toolroll is …"),Oe("requeue","requeue[ds]?|requeuing","Waiting: Toolroll is …"),Oe("claim","claim|claimed","Waiting: Toolroll is …"),Oe("lease","leases?|leased","Waiting: Toolroll is …"),Oe("custody","custody","Waiting: Toolroll is …"),Oe("incident","incidents?","Waiting: Toolroll is …"),Oe("plane","plane","Toolroll"),Oe("fence","fences?|fenced","Waiting: Toolroll is …"),Oe("attested","attest|attested|attestation","Waiting: Toolroll is …"),Oe("receipt","receipts?","Waiting: Toolroll is …"),Oe("regate","regate[ds]?","Run checks"),Oe("carried","carried|carry|carries","Waiting: Toolroll is …"),Oe("incarnation","incarnations?","Waiting: Toolroll is …"),Oe("admission","admission","Waiting: Toolroll is …"),Oe("quiescence","quiescen(?:ce|t)","Waiting: Toolroll is …"),Oe("witness","witness(?:es|ed)?","Waiting: Toolroll is …"),Oe("unproven","unproven","Waiting: Toolroll is …"),Oe("version hex","(?=[0-9a-f]*\\d)(?=[0-9a-f]*[a-f])[0-9a-f]{12,64}","(the plan version, in Details)")],h9=nO.map(e=>e.never);var ape=[Oe("lead","lead","Toolroll, or Chat"),Oe("crew","crew","Toolroll"),Oe("scope","scopes?|scoped","plan"),Oe("mode","modes?","(Settings)"),Oe("flow","flows?","(Settings)"),Oe("fleet","fleet","(Settings)"),Oe("fallback","fallbacks?","(Settings)"),Oe("routing","routing|routed","(Settings)"),Oe("spend","spend|spends|spending|spent","cost"),Oe("MCP","mcp","(Settings)"),Oe("password","passwords?|passwordless","(only where one is asked for)"),Oe("token","tokens?","(Settings)"),Oe("builder","builders?","taking work")];var v9="/settings/computers?section=start",sO=e=>e===null?v9:`/settings/computers?task=${encodeURIComponent(e)}&section=start`;var $S=()=>!0,oO=e=>e.build==null?"the last build":e.attempt==null?`build #${e.build}`:`attempt ${e.attempt} (build #${e.build})`,rO=e=>e.build==null?"The last build":`Build #${e.build}`,rm={approval:{sentence:()=>"Review the plan and approve it to start.",action:{code:"approve-scope",label:"Approve 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:$S},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 ${oO(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:$S},"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=>`${rO(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=>`${rO(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 ${oO(e)}. Approve the new plan, then retry it.`,action:{code:"approve-scope",label:"Approve 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"}},other:{sentence:()=>"Open the task to see what it needs from you.",action:{code:"inspect-task",label:"Open the task"},useReason:$S}};var US={decide:"Decide",review:"Review",unblock:"Unblock"};var iO={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"},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"},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 spe=Object.fromEntries(Object.entries(iO).flatMap(([e,t])=>t.need===void 0?[]:[[e,t.need]]));var lO=500;var uO=["Queued","Planning","Needs you","Waiting","Building","Ready for review","Complete","Failed","Stopped"],VS={Queued:"neutral",Planning:"live","Needs you":"attention",Waiting:"neutral",Building:"live","Ready for review":"ready",Complete:"success",Failed:"danger",Stopped:"neutral"};var y9="The check result couldn't be read.",vpe=`${y9} Run checks on it, or open the result to see why.`;var ype={ok:qi`<path d="M20 6 9 17l-5-5"/>`,running:qi`<circle cx="12" cy="12" r="4"/>`,none:qi`<circle cx="12" cy="12" r="3"/>`,note:qi`<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:qi`<path d="M18 6 6 18M6 6l12 12"/>`};var sm={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 cO(e){let t=w9(e);return{word:e==="Needs you"?sm.needs.word:e,tone:sm[t].tone,status:t}}function w9(e){switch(VS[e]){case"attention":case"ready":return"needs";case"live":return"running";case"success":return"finished";case"danger":return"failed";case"neutral":return"queued"}}var jS={idle:{word:"Idle",tone:""},building:{word:"Building",tone:"live"},offline:{word:"Offline",tone:"failed"}};function Xi(e,t){return e==="way-in"?"password":t.automatic===!0?"automatic":e==="none"||t.passwordless||e==="standard"&&t.remembered?"click":"password"}function dO(e,t){let a=Xi(e,t);return a==="password"?"password":a==="automatic"?"automatic":e==="none"?"none":t.passwordless?"passwordless":"remembered"}function uu(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 fO(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 pO={ok:"Done",run:"Now",q:"Queued",bad:"Failed",wait:"Needs you"};function mO(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 hO={done:"done",needs:"waiting on you",live:"in progress",wait:"waiting",stuck:"stopped here",skipped:"skipped",todo:"not started"},gO=e=>`steprow-${e}`;var ye=e=>["path",{d:e}],Gi=(e,t,a)=>["circle",{cx:e,cy:t,r:a}],ty={home:[ye("m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"),ye("M9 22V12h6v10")],tasks:[ye("m3 17 2 2 4-4"),ye("m3 7 2 2 4-4"),ye("M13 6h8"),ye("M13 12h8"),ye("M13 18h8")],flows:[["rect",{x:3,y:3,width:8,height:8,rx:2}],ye("M7 11v4a2 2 0 0 0 2 2h4"),["rect",{x:13,y:13,width:8,height:8,rx:2}]],agents:[ye("M12 8V4H8"),["rect",{x:4,y:8,width:16,height:12,rx:2}],ye("M2 14h2"),ye("M20 14h2"),ye("M15 13v2"),ye("M9 13v2")],projects:[ye("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:[ye("M21 4h-7"),ye("M10 4H3"),ye("M21 12h-9"),ye("M8 12H3"),ye("M21 20h-5"),ye("M12 20H3"),ye("M14 2v4"),ye("M8 10v4"),ye("M16 18v4")],pen:[ye("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:[ye("M5 12h14"),ye("m12 5 7 7-7 7")],plus:[ye("M12 5v14"),ye("M5 12h14")],send:[ye("M12 19V5"),ye("m5 12 7-7 7 7")],stop:[["rect",{x:6,y:6,width:12,height:12,rx:2}]],x:[ye("M18 6 6 18"),ye("m6 6 12 12")],back:[ye("m15 18-6-6 6-6")],menu:[ye("M4 6h16"),ye("M4 12h16"),ye("M4 18h16")],search:[Gi(11,11,7),ye("m20 20-3.5-3.5")],chevron:[ye("m6 9 6 6 6-6")],check:[ye("M20 6 9 17l-5-5")],alert:[Gi(12,12,9),ye("M12 8v4"),ye("M12 16h.01")],more:[Gi(5,12,1),Gi(12,12,1),Gi(19,12,1)],file:[ye("M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"),ye("M14 3v5h5")],minus:[ye("M5 12h14")],fit:[ye("M15 3h6v6"),ye("M9 21H3v-6"),ye("M21 3l-7 7"),ye("M3 21l7-7")],bolt:[ye("M13 2 4 14h7l-1 8 9-12h-7z")],code:[ye("m16 18 6-6-6-6"),ye("m8 6-6 6 6 6")],sun:[Gi(12,12,4),ye("M12 2v2"),ye("M12 20v2"),ye("m4.93 4.93 1.41 1.41"),ye("m17.66 17.66 1.41 1.41"),ye("M2 12h2"),ye("M20 12h2"),ye("m6.34 17.66-1.41 1.41"),ye("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}],ye("M15 2v2"),ye("M15 20v2"),ye("M2 15h2"),ye("M2 9h2"),ye("M20 15h2"),ye("M20 9h2"),ye("M9 2v2"),ye("M9 20v2")],bell:[ye("M10.27 21a2 2 0 0 0 3.46 0"),ye("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:[ye("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:[ye("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:[ye("M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"),Gi(9,7,4),ye("M22 21v-2a4 4 0 0 0-3-3.87"),ye("M16 3.13a4 4 0 0 1 0 7.75")],coin:[Gi(12,12,10),ye("M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"),ye("M12 18V6")],monitor:[["rect",{x:2,y:3,width:20,height:14,rx:2}],ye("M8 21h8"),ye("M12 17v4")],list:[ye("M8 6h13"),ye("M8 12h13"),ye("M8 18h13"),ye("M3 6h.01"),ye("M3 12h.01"),ye("M3 18h.01")],board:[["rect",{x:3,y:3,width:18,height:18,rx:2}],ye("M9 3v18"),ye("M15 3v18")],panel:[["rect",{x:3,y:3,width:18,height:18,rx:2}],ye("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}],ye("M6 6h.01"),ye("M6 18h.01")]};var yO=H(Z(),1);function Je({name:e,small:t=!1}){return(0,yO.jsx)("svg",{className:Qe("k-i",t&&"k-i-sm"),viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:ty[e].map((a,n)=>(0,vO.createElement)(a[0],{key:n,...a[1]}))})}var Rn=H(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,Rn.jsx)("button",{type:l,className:Qe("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,Rn.jsx)(Je,{name:a}):(0,Rn.jsx)("span",{className:"k-face",children:s?(0,Rn.jsxs)(Rn.Fragment,{children:[(0,Rn.jsx)("span",{className:"k-spin","aria-hidden":"true"}),s]}):(0,Rn.jsxs)(Rn.Fragment,{children:[n&&(0,Rn.jsx)(Je,{name:n,small:!0}),o]})})})}function Fe({variant:e="outline",sm:t,label:a,lead:n,className:o,...r}){return(0,Rn.jsx)("a",{className:Qe("k-btn",`k-btn-${e}`,t&&"k-btn-sm",o),...r,children:(0,Rn.jsxs)("span",{className:"k-face",children:[n&&(0,Rn.jsx)(Je,{name:n,small:!0}),a]})})}var ay=H(Z(),1);function qe({word:e,tone:t="",dot:a=!0}){return(0,ay.jsx)("span",{className:Qe("k-chip",t,!a&&"nodot"),children:e})}var im=({status:e})=>(0,ay.jsx)(qe,{word:sm[e].word,tone:sm[e].tone});function WS({headline:e}){let{word:t,tone:a}=cO(e);return(0,ay.jsx)(qe,{word:t,tone:a})}var wO=H(Z(),1);function St({n:e,ink:t=!1}){return(0,wO.jsx)("span",{className:Qe("k-count",t&&e>0&&"ink",e===0&&"zero"),children:e})}var ny=H(Z(),1);function xO({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,ny.jsx)("div",{className:"k-tabs",role:"tablist","aria-label":e,children:a.map((r,s)=>(0,ny.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 gd=H(Z(),1);function Jr({label:e,current:t,items:a,onChange:n}){return(0,gd.jsx)("div",{className:"k-seg",role:"group","aria-label":e,children:a.map(o=>(0,gd.jsxs)("button",{type:"button","aria-pressed":o.key===t,onClick:()=>n(o.key),children:[o.label,o.count]},o.key))})}function cu({label:e,current:t,items:a,icons:n}){return(0,gd.jsx)("nav",{className:Qe("k-seg",n&&"k-seg-icons"),"aria-label":e,children:a.map(o=>(0,gd.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 oy=H(Z(),1);function wr({items:e,sm:t,wide:a,className:n,...o}){return(0,oy.jsx)("span",{className:Qe("k-selw",t&&"sm",a&&"wide",n),children:(0,oy.jsx)("select",{className:"k-sel",...o,children:e.map(r=>{let[s,i]=typeof r=="string"?[r,r]:r;return(0,oy.jsx)("option",{value:s,children:i},s)})})})}var bO=H(Z(),1);var kO=H(Z(),1);var Os=H(Z(),1);function SO({name:e,legend:t,current:a,items:n,onChange:o}){return(0,Os.jsxs)("fieldset",{className:"k-radios",children:[(0,Os.jsx)("legend",{className:"k-sr",children:t}),n.map(r=>(0,Os.jsxs)("label",{className:"k-opt",children:[(0,Os.jsx)("input",{type:"radio",name:e,value:r.value,checked:r.value===a,onChange:()=>o(r.value)}),(0,Os.jsxs)("span",{children:[(0,Os.jsx)("b",{children:r.label}),r.text&&(0,Os.jsx)("span",{children:r.text})]}),r.tag]},r.value))]})}var CO=H(Z(),1),es=({children:e})=>(0,CO.jsx)("div",{className:"k-acts",children:e});var LO=H(we(),1),vd=H(Z(),1);function KS({rows:e}){return(0,vd.jsx)("dl",{className:"k-facts",children:e.map(([t,a])=>(0,vd.jsxs)(LO.Fragment,{children:[(0,vd.jsx)("dt",{children:t}),(0,vd.jsx)("dd",{children:a})]},t))})}var du=H(Z(),1),Ja=({children:e})=>(0,du.jsxs)("p",{className:"k-notice",role:"alert",children:[(0,du.jsx)(Je,{name:"alert",small:!0}),(0,du.jsx)("span",{children:e})]}),Bs=({children:e})=>(0,du.jsx)("p",{className:"k-notice info",children:e}),ya=({children:e})=>(0,du.jsx)("p",{className:"k-note",children:e});var lm=H(Z(),1);function Ca({title:e,text:t,action:a}){return(0,lm.jsxs)("div",{className:"k-empty",children:[(0,lm.jsx)("p",{className:"k-empty-t",children:e}),t&&(0,lm.jsx)("p",{className:"k-empty-x",children:t}),a]})}var ry=H(Z(),1);function cn({summary:e,children:t,open:a,onToggle:n}){return(0,ry.jsxs)("details",{className:"k-disclose",open:a,onToggle:n===void 0?void 0:o=>n(o.currentTarget.open),children:[(0,ry.jsx)("summary",{children:e}),t]})}var En=H(Z(),1),bo=({label:e,count:t,right:a,id:n})=>(0,En.jsxs)("h2",{className:"k-grp",id:n,children:[e,t,a!==void 0&&(0,En.jsxs)(En.Fragment,{children:[(0,En.jsx)("span",{className:"k-grow"}),a]})]});function dn({href:e,chip:t,title:a,desc:n,meta:o,action:r,wait:s,message:i}){return(0,En.jsxs)("div",{className:Qe("k-row",s&&"wait",e===void 0&&"k-row-static"),children:[(0,En.jsx)("span",{className:"k-row-c",children:t}),e===void 0?(0,En.jsx)("span",{className:"k-row-t",children:a}):(0,En.jsx)("a",{className:"k-row-t",href:e,children:a}),(0,En.jsx)("span",{className:"k-row-d",children:n}),(0,En.jsx)("span",{className:"k-row-m",children:o}),(0,En.jsx)("span",{className:"k-row-a",children:r}),i&&(0,En.jsx)("div",{className:"k-row-msg",children:i})]})}var fn=H(Z(),1);function sy({title:e,back:t,trailing:a}){return(0,fn.jsxs)("header",{className:"k-ph",children:[t&&(0,fn.jsx)("a",{className:"k-btn k-btn-ghost k-btn-icon",href:t,"aria-label":"Back",title:"Back",children:(0,fn.jsx)(Je,{name:"back"})}),(0,fn.jsx)("p",{className:"k-ph-t",children:e}),a]})}function Jn({title:e,ctx:t,right:a,back:n,phoneTitle:o,trailing:r}){return(0,fn.jsxs)(fn.Fragment,{children:[(0,fn.jsx)(sy,{title:o??e,...n?{back:n}:{},trailing:r}),(0,fn.jsxs)("div",{className:"k-tb",children:[(0,fn.jsx)("h1",{children:e}),t&&(0,fn.jsx)("span",{className:"k-tb-ctx",children:t}),a&&(0,fn.jsxs)(fn.Fragment,{children:[(0,fn.jsx)("span",{className:"k-grow"}),a]})]})]})}var jo=H(Z(),1);function um({title:e,back:t,meta:a,right:n,same:o}){return(0,jo.jsxs)(jo.Fragment,{children:[t&&(0,jo.jsxs)("a",{className:"k-backlink",href:t[0],children:[(0,jo.jsx)(Je,{name:"back",small:!0}),t[1]]}),(0,jo.jsxs)("header",{className:"k-dh",children:[(0,jo.jsxs)("div",{children:[(0,jo.jsx)("h1",{className:o?"k-same":void 0,children:e}),a&&(0,jo.jsx)("p",{className:"k-dh-meta",children:a})]}),n]})]})}var NO=({children:e})=>(0,jo.jsx)("div",{className:"k-doc",children:e});var Hs=H(we(),1),WO=H(Ro(),1);var ts="form.k-sform",dm=e=>HTMLFormElement.prototype.getAttribute.call(e,"id")??"",x9=e=>Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements").get.call(e),IO="http://www.w3.org/2000/svg",zs=e=>e.querySelector("[data-k-proof]"),as=e=>e.querySelector("[data-k-save]"),MO=e=>new Set(Array.from(zs(e)?.querySelectorAll("input[name]")??[]).map(t=>t.name));function ly(e,t=null){let a=MO(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 JS(e){let t=new Map;for(let[a,n]of e)t.set(a,[...t.get(a)??[],n]);return t}function DO(e){let t=MO(e),a=[];for(let n of Array.from(x9(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 xr=e=>(e??"").replace(/\s+/g," ").trim();function _O(e,t){return e.querySelector(`[name="${CSS.escape(t)}"]`)}function b9(e,t){let a=_O(e,t);if(a===null)return t;let n=a.getAttribute("aria-label");if(n)return xr(n);if(a.type==="radio"||a.type==="checkbox"&&a.getAttribute("role")!=="switch"){let s=a.closest("fieldset")?.querySelector("legend");if(s)return xr(s.textContent)}let o=a.closest(".k-frow")?.querySelector(".k-frow-t");if(o)return xr(o.textContent);let r=a.labels?.[0];return r?xr(r.querySelector(".k-sl-t, b")?.textContent??r.textContent):t}function k9(e,t,a){let n=_O(e,t);if(n instanceof HTMLSelectElement)return xr(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=>xr(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 S9=(e,t)=>JSON.stringify(e??[])===JSON.stringify(t??[]);function e1(e){let t=JS(ly(e));return DO(e).filter(a=>!S9(e.kInit?.get(a),t.get(a)))}function PO(e,t){let a=JS(t),n=e.hasAttribute("data-k-gate")?e1(e):DO(e);return n.length>3?`${n.length} changes`:n.map(o=>`${b9(e,o)}: ${k9(e,o,a.get(o)??[])}`).join(" · ")}function OO(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 XS=e=>e!==null&&e.querySelector('input[type="password"], a.sso-step-up')!==null;function iy(e){if(e.kPrepped)return;e.kPrepped=!0,e.kInit=JS(ly(e));for(let a of Array.from(zs(e)?.querySelectorAll("input[required]")??[]))a.removeAttribute("required"),a.dataset.kRequired="";let t=as(e);t&&(t.dataset.kVariant=t.classList.contains("k-btn-danger")?"danger":t.classList.contains("k-btn-outline")?"outline":"primary")}function TO(){for(let e of Array.from(document.querySelectorAll(ts)))iy(e)}function C9(e,t){e.classList.remove("k-btn-primary","k-btn-outline","k-btn-danger"),e.classList.add(`k-btn-${t}`)}function L9(e){for(let t of Array.from(document.querySelectorAll(`${ts}[data-k-gate]`))){let a=as(t);!a||a.dataset.kVariant!=="primary"||C9(a,t===e||e===null?"primary":"outline")}}function N9(e,t){if(!e.hasAttribute("data-k-gate"))return;let a=e1(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=ly(e),r=zs(e)!==null&&XS(zs(e))&&OO(e,o)?" · Asks for your password.":"";n.textContent=`${PO(e,o)}${r}`}t&&L9(a.length>0?e:document.querySelector(`${ts}[data-k-gate][data-dirty]`))}function BO(e){let t=document.createElementNS(IO,"svg");t.setAttribute("class","k-i"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true");for(let a of ty[e]){let n=document.createElementNS(IO,a[0]);for(let[o,r]of Object.entries(a[1]))n.setAttribute(o,String(r));t.append(n)}return t}function cm(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 fm(e,t){let a=as(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 zO(e){let t=e.querySelector(".k-ssave-err");t&&t.childElementCount>0&&t.replaceChildren(),as(e)?.removeAttribute("aria-describedby")}function YS(e,t){e.kPending=!1,e.kSent=!1,fm(e,!1);for(let n of Array.from(zs(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(BO("alert"));let o=document.createElement("span");o.textContent=t,n.append(o),a.replaceChildren(n),a.id||(a.id=`${dm(e)||"k-sform"}-err`),as(e)?.setAttribute("aria-describedby",a.id),(e.querySelector(".k-ssave")??a).scrollIntoView({block:"center",behavior:"instant"})}as(e)?.focus({preventScroll:!0})}var HO=e=>{let t=xr(e);return t===""?t:`${t.charAt(0).toUpperCase()}${t.slice(1)}${/[.!?]$/.test(t)?"":"."}`},ZS=e=>`${HO(e)} Your edits are still here.`;function I9(e){try{let a=new DOMParser().parseFromString(e,"text/html").querySelector(".k-notice[role=alert] span, .problem, .k-notice[role=alert], [role=alert]"),n=xr(a?.textContent);return n===""?null:n.slice(0,400)}catch{return null}}var yd=!1,T9=e=>xr(e.closest("section")?.querySelector("h3")?.childNodes[0]?.textContent??e.closest("section")?.querySelector("h3")?.textContent)||"a section",R9=e=>Array.from(document.querySelectorAll(`${ts}[data-k-gate][data-dirty]`)).filter(t=>t!==e);function E9(e){let t=new URL(window.location.href);for(let n of["said","problem","unconfirmed"])t.searchParams.delete(n);t.searchParams.set("unconfirmed",dm(e));let a=e.closest("section[id]")?.id;return`${t.pathname}${t.search}${a?`#${a}`:""}`}var A9=(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 GS(e){yd=!0,window.location.assign(dm(e)?E9(e):window.location.href)}async function M9(e,t,a,n){fm(e,!0);let o=new URLSearchParams;for(let[d,m]of[...t,...a])o.append(d,m);let r=A9(e,n),s;try{s=await fetch(r,{method:"POST",body:o,credentials:"same-origin",redirect:"follow",headers:Kt({accept:"text/html"})})}catch{GS(e);return}let i=new URL(s.url||r,window.location.href);if(i.origin!==window.location.origin||i.pathname==="/login"){GS(e);return}let l=i.searchParams.get("problem");if(l){YS(e,ZS(l));return}if(!s.redirected&&s.status>=400&&s.status<500){let d=I9(await s.text().catch(()=>""));YS(e,ZS(d??`Toolroll refused this (${s.status}). Nothing changed`));return}if(!s.ok){GS(e);return}let u=i.pathname===window.location.pathname,c=e.closest("section[id]")?.id;yd=!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 RO(e,t){let a=e.hasAttribute("data-k-download");a||(yd=!0),e.kGo=!0;try{t instanceof HTMLButtonElement&&t.form===e?e.requestSubmit(t):e.requestSubmit()}finally{e.kGo=!1}if(a){yd=!1,e.kPending=!1,e.kSent=!1,fm(e,!1);for(let n of Array.from(zs(e)?.querySelectorAll('input[type="password"]')??[]))n.value=""}}function QS(e,t,a,n){if(e.kPending=!0,e.hasAttribute("data-k-native")){if(e.hasAttribute("data-k-download")||fm(e,!0),e.hasAttribute("data-k-prepare")){let o=!1,r=s=>{o||(o=!0,s===null?RO(e,n):YS(e,ZS(s)))};e.dispatchEvent(new CustomEvent("k-prepare",{detail:{done:r}}));return}RO(e,n);return}M9(e,t,a,n)}var FO=e=>Array.from(e?.querySelectorAll("input[name]")??[]).map(t=>[t.name,t.value]);function D9(e,t,a){let n=zs(e),o=n.nextElementSibling,r=`${dm(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=cm("","ghost",{"data-k-close":"","aria-label":"Close",title:"Close"});u.classList.add("k-btn-sm","k-btn-icon"),u.replaceChildren(BO("x")),i.append(l,u);let c=document.createElement("p");c.className="k-pop-terms",c.textContent=PO(e,t)||xr(e.dataset.kConfirm);let f=document.createElement("p");f.textContent=[e.dataset.kConfirm,e.dataset.kNote].filter(Boolean).map(h=>HO(h)).join(" ");let d=document.createElement("div");d.className="k-acts";let m=xr(as(e)?.dataset.kLabel??as(e)?.textContent)||"Save";d.append(cm(m,"primary",{"data-k-sconfirm":""}),cm("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=eo(s,a??as(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 EO(e){let t=zs(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=FO(t);e.kSent=!0,e.kClose?.(),QS(e,e.kSnapshot??[],n,e.kSubmitter??null)}function _9(e,t){if(e.kPending||(iy(e),e.hasAttribute("data-k-gate")&&e1(e).length===0&&!(t instanceof HTMLButtonElement&&t.hasAttribute("formaction"))))return;let a=e.hasAttribute("data-k-download")?[]:R9(e);if(a.length>0){P9(e,a,t);return}qO(e,t)}function P9(e,t,a){let n=[...new Set(t.map(T9))],o=`${dm(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=cm("Save this anyway","primary",{"data-k-discard":""});u.append(c,cm("Cancel","ghost",{"data-k-close":""})),r.append(s,l,u),e.append(r),e.kPending=!0;let f=!1,d=eo(r,a??as(e),{onClose:()=>{r.remove(),e.kPending=!1,f&&qO(e,a)}});c.addEventListener("click",m=>{m.preventDefault(),f=!0,d()}),c.focus()}function qO(e,t){zO(e);let a=ly(e,t);if(t instanceof HTMLButtonElement&&t.hasAttribute("formaction")){QS(e,a,[],t);return}let n=zs(e);if(n!==null&&OO(e,a)&&XS(n)){D9(e,a,t);return}QS(e,a,n!==null&&!XS(n)?FO(n):[],t)}var AO=!1;function $O(){if(AO||typeof document>"u")return;AO=!0,document.documentElement.classList.add("k-js");let e=a=>{let n=a.target?.closest?.(ts);n&&iy(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(ts)||n.closest("[data-k-proof], .k-pop")){n?.type==="password"&&n.setCustomValidity("");return}iy(o),zO(o),N9(o,!0)};document.addEventListener("input",t),document.addEventListener("change",t),document.addEventListener("submit",a=>{let n=a.target;if(!(n instanceof HTMLFormElement)||!n.matches(ts))return;let o=n;if(!o.kGo){if(a.preventDefault(),a.stopImmediatePropagation(),o.kClose){EO(o);return}_9(o,a.submitter??null)}},!0),document.addEventListener("click",a=>{let n=a.target?.closest?.("[data-k-sconfirm]");if(!n)return;let o=n.closest(ts);o&&(a.preventDefault(),EO(o))}),window.addEventListener("pageshow",()=>{yd=!1;for(let a of Array.from(document.querySelectorAll(ts)))a.kPending=!1,a.kSent=!1,fm(a,!1)}),window.addEventListener("standing-orders:workspace-rendered",TO),window.addEventListener("beforeunload",a=>{yd||document.querySelector(`${ts}[data-k-gate][data-dirty]`)===null||a.preventDefault()}),TO()}var O9="(max-width: 760px)",B9='a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',Yi=()=>typeof window<"u"&&window.matchMedia(O9).matches,z9=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches;function wd(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 t1(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 UO(){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 pn=[];function H9(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 eo(e,t,a={}){pn.length>0&&!e.classList.contains("k-pop")&&cy("close");let o=e.classList.contains("k-pop"),r=Yi();e.isConnected||document.body.append(e);let s=document.createElement("div");s.className=`k-scrim${a.dim??(!o||r)?" dim":""}${pn.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",pn.length>0),e.classList.toggle("as-sheet",o&&r),o&&!r&&H9(e,t),z9()||(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 F9(),pn.push(u),s.addEventListener("click",()=>pu(u,"scrim")),(e.querySelector("[autofocus]")??e.querySelector('input:not([type="hidden"]), textarea, select')??e).focus(),()=>pu(u,"close")}function pu(e,t){let a=pn.indexOf(e);if(!(a<0)){for(let n of pn.slice(a+1).reverse())pu(n,"removed");pn.splice(a,1),pn.length===0&&(fu?.disconnect(),fu=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"),q9(e.trigger),e.onClose?.(t)}}function a1(){for(let e of pn.slice().reverse())e.panel.isConnected||pu(e,"removed");pn.length===0&&(fu?.disconnect(),fu=null)}var fu=null;function F9(){fu!==null||typeof MutationObserver>"u"||(fu=new MutationObserver(()=>{pn.some(e=>!e.panel.isConnected)&&a1()}),fu.observe(document.body,{childList:!0,subtree:!0}))}function cy(e="removed"){for(let t of pn.slice().reverse())pu(t,e)}function uy(e){return e!=null&&e.isConnected&&e.getClientRects().length>0}function q9(e){let t=e?.getAttribute("data-k-open");if(uy(e)){e.focus();return}((t?Array.from(document.querySelectorAll(`[data-k-open="${CSS.escape(t)}"]`)).find(uy):void 0)??Array.from(document.querySelectorAll(".k-dock .k-btn")).find(uy))?.focus()}function $9(e){let t=pn[pn.length-1];if(!t)return;if(e.key==="Escape"){e.preventDefault(),pu(t,"escape");return}if(e.key!=="Tab")return;let a=Array.from(t.panel.querySelectorAll(B9)).filter(uy);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 br(e,t,a){let n=Yi(),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=eo(o,e,{onClose:()=>o.remove()}),c}function U9(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=[]}br(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&&br(n,"Add to your message",l),!0}function V9(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}`,wd(n),n.focus(),!0}var VO=!1,jO=new WeakMap;function j9(){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 pm(){if(VO||typeof document>"u")return;VO=!0,document.addEventListener("input",t=>{let a=t.target;a instanceof HTMLTextAreaElement&&a.classList.contains("k-composer-ta")&&wd(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(V9(a,t)||U9(t))return;let o=a.closest("[data-k-open]");if(o){let s=document.getElementById(o.dataset.kOpen??"");s&&(t.preventDefault(),eo(s,o));return}if(a.closest("[data-k-close]")){let s=pn[pn.length-1];s&&s.panel.contains(a)&&(t.preventDefault(),pu(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",$9,!0),j9();let e=()=>{a1();for(let t of document.querySelectorAll(".k-composer-ta"))wd(t)};window.addEventListener("standing-orders:workspace-rendered",e),window.visualViewport?.addEventListener("resize",UO),window.visualViewport?.addEventListener("scroll",UO),$O(),e()}var ua=H(Z(),1);function Wo({kind:e,title:t,sub:a,trigger:n,onClose:o,children:r}){let s=(0,Hs.useRef)(null),i=(0,Hs.useRef)(o);i.current=o;let l=(0,Hs.useId)();(0,Hs.useLayoutEffect)(()=>{let m=s.current;if(!m)return;let h=!1,w=eo(m,n,{onClose:x=>{h=!0,i.current(x)}});return()=>{h||w()}},[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)(ya,{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":Qe("k-pop",e==="menu"&&"k-pop-menu");return(0,WO.createPortal)((0,ua.jsx)("div",{ref:s,className:d,role:"dialog","aria-modal":"true","aria-labelledby":l,tabIndex:-1,children:f}),document.body)}function xd(){return(0,Hs.useCallback)((e,t,a)=>{br(e,t,a)},[])}var ns=H(Z(),1);function ko({wait:e,status:t,text:a,body:n,acts:o,terms:r,err:s}){return(0,ns.jsxs)("section",{className:Qe("k-slots",e&&"wait"),children:[(0,ns.jsx)("div",{className:"k-slot-status",children:t}),(0,ns.jsx)("p",{className:"k-slot-text",children:a}),n!==void 0&&(0,ns.jsx)("div",{className:"k-slot-body",children:n}),(0,ns.jsx)("div",{className:"k-slot-acts k-acts",children:o}),(0,ns.jsx)("p",{className:"k-slot-terms",children:r}),(0,ns.jsx)("div",{className:"k-slot-err",children:s?(0,ns.jsx)(Ja,{children:s}):null})]})}var Zi=H(we(),1);var Ha=H(Z(),1);function mm({kind:e,facts:t,label:a,terms:n,text:o,primary:r=!0,docked:s,busy:i="Starting…",onApprove:l,check:u}){let c=Xi(e,t),[f,d]=(0,Zi.useState)(null),[m,h]=(0,Zi.useState)(!1),[w,x]=(0,Zi.useState)(null),v=(0,Zi.useRef)(!1),y=(0,Zi.useId)(),g=async k=>{if(!v.current){v.current=!0,h(!0),x(null);try{let C=await l(k,dO(e,t));x(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,Ha.jsxs)(Ha.Fragment,{children:[(0,Ha.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=>{!bd(k)||v.current||u!==void 0&&!u()||(c==="password"?d(k.currentTarget):g(null))}}),c==="click"&&w&&(0,Ha.jsx)(Ja,{children:w}),f&&(0,Ha.jsxs)(Wo,{kind:"popover",title:"Confirm with your password",trigger:f,onClose:()=>{d(null),x(null)},children:[o&&(0,Ha.jsx)("p",{children:o}),(0,Ha.jsx)("p",{className:"k-pop-terms",children:n}),(0,Ha.jsxs)("form",{className:"k-field",onSubmit:b,children:[(0,Ha.jsx)("label",{className:"k-label",htmlFor:y,children:"Your password"}),(0,Ha.jsx)(Nn,{id:y,type:"password",name:"token",autoComplete:"current-password",required:!0,autoFocus:!0,"aria-describedby":`${y}-err`,"aria-invalid":w?!0:void 0}),(0,Ha.jsx)("span",{className:"k-err",id:`${y}-err`,role:"alert",children:w??""}),(0,Ha.jsxs)(es,{children:[(0,Ha.jsx)(de,{type:"submit",variant:"primary",label:a,busy:m?i:!1}),(0,Ha.jsx)(de,{variant:"ghost",label:"Cancel","data-k-close":""})]})]}),(0,Ha.jsx)("p",{className:"k-pop-foot k-note",children:uu(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.":uu(e,t)})]})]})}function bd(e){return e.nativeEvent.isTrusted!==!1}var KO=H(Z(),1);var GO=H(we(),1);var Pt=H(Z(),1);function n1({label:e="Steps",chip:t,rows:a,scale:n,foot:o,head:r="Step"}){let[s,i]=(0,GO.useState)(!1),l=mO(a,n),u=c=>c==="wait"?(0,Pt.jsx)("span",{className:"k-wd"}):c==="q"?(0,Pt.jsx)("span",{className:"k-qd"}):c==="run"?(0,Pt.jsx)("span",{className:"k-rund"}):(0,Pt.jsx)(Je,{name:c==="ok"?"check":"x",small:!0});return(0,Pt.jsxs)("section",{className:Qe("k-timing",s&&"show-chart"),"aria-label":e,children:[(0,Pt.jsxs)("header",{className:"k-timing-h",children:[(0,Pt.jsx)("h2",{children:e}),(0,Pt.jsx)("span",{className:"k-timing-state",children:t}),(0,Pt.jsx)(de,{className:"k-phone-only",variant:"ghost",sm:!0,label:s?"Hide timing":"Show timing","aria-expanded":s,onClick:()=>i(c=>!c)})]}),(0,Pt.jsxs)("div",{className:"k-timing-b",children:[(0,Pt.jsxs)("div",{className:"k-crow head","aria-hidden":"true",children:[(0,Pt.jsx)("span",{}),(0,Pt.jsx)("span",{children:r}),(0,Pt.jsx)("span",{className:"k-crow-lane",children:"Elapsed time"}),(0,Pt.jsx)("span",{children:"Status"}),(0,Pt.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";return(0,Pt.jsxs)("div",{className:Qe("k-crow",c.st,m&&"now"),children:[(0,Pt.jsx)("span",{className:"k-crow-i",children:u(c.st)}),(0,Pt.jsxs)("span",{className:"k-crow-n",children:[c.name,(0,Pt.jsx)("span",{className:"k-crow-sub",children:c.sub??(c.st==="q"?"not reached":"")})]}),(0,Pt.jsx)("span",{className:"k-crow-lane",children:d&&(0,Pt.jsx)("i",{className:"k-crow-bar",style:{left:`${d.left}%`,width:`${d.width}%`}})}),(0,Pt.jsx)("span",{className:"k-crow-w",children:pO[c.st]}),(0,Pt.jsx)("span",{className:"k-crow-s k-num",children:c.st==="q"?"–":fO(c.dur)})]},`${c.name}-${f}`)})]}),o&&(0,Pt.jsx)("div",{className:"k-timing-f",children:o})]})}var XO=H(Z(),1);var Fa=H(Z(),1);function o1({label:e="Steps",rows:t,onToggle:a}){return(0,Fa.jsx)("ol",{className:"k-steprows","aria-label":e,children:t.map(n=>{let o=n.body!==void 0&&n.body!==null&&n.body!=="",r=gO(n.key),s=(0,Fa.jsxs)(Fa.Fragment,{children:[(0,Fa.jsxs)("span",{className:"k-steprow-label",children:[n.label,(0,Fa.jsxs)("span",{className:"k-sr",children:[", ",hO[n.mark]]})]}),(0,Fa.jsxs)("span",{className:"k-steprow-say",children:[n.needsYou&&(0,Fa.jsx)(qe,{word:"Needs you",tone:"needs"}),n.sentence!==""&&(0,Fa.jsx)("span",{children:n.sentence})]}),n.at?(0,Fa.jsx)("time",{className:"k-steprow-time k-num",dateTime:n.at,children:n.when??""}):null]});return(0,Fa.jsxs)("li",{className:Qe("k-steprow",n.mark),"data-step-row":n.key,"aria-current":n.current?"step":void 0,children:[(0,Fa.jsx)("span",{className:"k-steprow-mark","aria-hidden":"true"}),(0,Fa.jsxs)("div",{className:"k-steprow-main",children:[n.toggle&&o?(0,Fa.jsx)("button",{className:"k-steprow-head",type:"button","aria-expanded":n.open?"true":"false","aria-controls":r,onClick:()=>a?.(n.key),children:s}):(0,Fa.jsx)("div",{className:"k-steprow-head",children:s}),o&&(0,Fa.jsx)("div",{className:"k-steprow-body",id:r,hidden:!n.open,children:n.body})]})]},n.key)})})}var YO=H(we(),1);var Fs=H(Z(),1),ZO=({label:e,children:t})=>(0,Fs.jsx)("div",{className:"k-board",role:"region","aria-label":e,children:t});function QO({label:e,count:t,needs:a,on:n,empty:o,children:r}){let s=YO.Children.toArray(r).length>0;return(0,Fs.jsxs)("section",{className:Qe("k-col",n&&"on"),"aria-label":e,children:[(0,Fs.jsxs)("h2",{className:Qe("k-col-h",a&&"needs"),children:[e,t]}),s?r:(0,Fs.jsx)("p",{className:"k-col-e",children:o})]})}var JO=({href:e,title:t,meta:a})=>(0,Fs.jsxs)("a",{className:"k-card",href:e,children:[(0,Fs.jsx)("span",{className:"k-card-t",children:t}),(0,Fs.jsx)("span",{className:"k-card-m",children:a})]});var hm=H(Z(),1);function r1({label:e,value:t,onChange:a,placeholder:n}){return(0,hm.jsxs)("label",{className:"k-filter",children:[(0,hm.jsx)(Je,{name:"search",small:!0}),(0,hm.jsx)("input",{type:"search",value:t,placeholder:n??e,"aria-label":e,onChange:o=>a(o.target.value)})]})}var s1=H(Z(),1);var i1=H(Z(),1);var qs=H(Z(),1),Ko=({children:e})=>(0,qs.jsx)("div",{className:"k-dock",children:(0,qs.jsx)("div",{className:"k-dock-primary",children:e})});function eB({count:e,label:t,scope:a,onOpen:n}){return(0,qs.jsxs)("button",{type:"button",className:"k-dock-needs","aria-haspopup":"dialog","aria-label":`Needs you: ${t}`,onClick:n,children:[(0,qs.jsxs)("span",{className:"k-dock-needs-l",children:[(0,qs.jsx)("span",{className:"k-dot needs","aria-hidden":"true"}),"Needs you",(0,qs.jsx)(St,{n:e,ink:!0})]}),(0,qs.jsx)("span",{className:"k-dock-needs-s",children:a})]})}var $s=H(we(),1);var ca=H(Z(),1);function Qi({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:w,note:x,error:v,disabled:y,line:g,gate:b=!0,sendLabel:k="Send",stopLabel:C="Stop",submit:N=!1,sendDisabled:L=!1,textareaId:R,name:z,maxLength:M,textareaRef:_,onKeyDown:B,enterSends:S,combobox:T=null}){let E=(0,$s.useRef)(null),A=(0,$s.useRef)(null),q=(0,$s.useRef)(null),D=n.trim()==="";(0,$s.useEffect)(()=>{pm()},[]),(0,$s.useLayoutEffect)(()=>{E.current&&wd(E.current)},[n]),(0,$s.useEffect)(()=>{t1(e,i)},[e,i]);let O=Q=>{let oe=E.current,V=oe?.selectionStart??n.length,F=V>0&&!/\s$/.test(n.slice(0,V))?" ":"";o(n.slice(0,V)+F+Q+" "+n.slice(V)),oe?.focus()},K=Q=>{c&&br(Q,"Project",c.items.map(oe=>({label:oe,current:oe===c.current,act:()=>f?.(oe)})))},se=[...d?[{label:"Attach a file",act:()=>A.current?.click()}]:[],...m&&m.length>0?[{label:"Mention a task",act:()=>{let Q=q.current??E.current;Q&&br(Q,"Mention a task",m.map(oe=>({label:oe.label,act:()=>O(oe.text)})))}}]:[],...c?[{label:"Choose project",act:()=>{let Q=q.current;Q&&K(Q)}}]:[],...h??[]],ne=()=>{b&&D||L||(N?E.current?.form?.requestSubmit():r())},U=R??`${e}-text`,W=Q=>{E.current=Q,typeof _=="function"?_(Q):_&&(_.current=Q)};return(0,ca.jsxs)("div",{className:"k-composer-field",children:[(0,ca.jsxs)("div",{className:Qe("k-composer",g&&"line",y&&"off",!D&&"has-text",i&&"working"),"data-k-composer":e,children:[(0,ca.jsx)("label",{className:"k-sr",htmlFor:U,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:U,name:z,maxLength:M,rows:l,"data-min":l,"data-max":u,placeholder:a,value:n,disabled:y,role:T?"combobox":void 0,"aria-expanded":T?T.expanded:void 0,"aria-controls":T?T.controls:void 0,"aria-invalid":v?!0:void 0,"aria-describedby":`${e}-err`,onChange:Q=>o(Q.target.value),onKeyDown:Q=>{B?.(Q),!Q.defaultPrevented&&Q.key==="Enter"&&!Q.shiftKey&&!Q.nativeEvent.isComposing&&(S?S(Q):!Yi())&&(Q.preventDefault(),ne())}}),(0,ca.jsxs)("div",{className:"k-composer-bar",children:[se.length>0&&(0,ca.jsx)("button",{type:"button",className:"k-composer-plus","aria-haspopup":"dialog","aria-label":"Add to your message",disabled:y,onClick:Q=>br(Q.currentTarget,"Add to your message",se),children:(0,ca.jsx)(Je,{name:"plus"})}),d&&(0,ca.jsx)("input",{ref:A,type:"file",className:"k-sr",tabIndex:-1,"aria-hidden":"true",onChange:Q=>{let oe=Q.target.files?.[0];oe&&d(oe),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:y,onClick:Q=>K(Q.currentTarget),children:[(0,ca.jsx)("span",{children:c.current}),c.sub&&(0,ca.jsx)("span",{className:"k-chip-sub",children:c.sub})]}),w,(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&&D||L?!0:void 0,disabled:y,onClick:N?Q=>{(b&&D||L)&&Q.preventDefault()}:ne,children:(0,ca.jsx)(Je,{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)(Je,{name:"stop"})})]})]})]}),x&&(0,ca.jsx)("p",{className:"k-note k-composer-note",children:x}),(0,ca.jsx)("div",{className:"k-composer-err k-err",id:`${e}-err`,role:"alert",children:v??""})]})}var qa=H(we(),1);var Me=H(Z(),1),tB=1500,W9=/^(?:(?:-{0,5}|-----B|-----BE|-----BEG|-----BEGI)\|(?:-{0,5}|-----B|-----BE|-----BEG|-----BEGI)\|(?:-{0,5}|-----B|-----BE|-----BEG|-----BEGI)\|[COE]?)?$/,l1=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 K9(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>tB&&(a.items=a.items.slice(-tB)),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=W9.test(t.keyTail)?t.keyTail:""),a.final=t.final===!0,a.state="ready",a}var aB=50;function d1(e,t,a=!1){let[n,o]=(0,qa.useState)(()=>l1(e)),r=(0,qa.useRef)(a);r.current=a;let s=()=>r.current||u1(),i=(0,qa.useRef)(null);return(0,qa.useEffect)(()=>{let l=l1(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 w=0;w<aB&&!u;w+=1){if(s()){d();return}let x=`${l.gen===null?"":`&gen=${encodeURIComponent(l.gen)}`}${l.inKey?"&inkey=1":""}${l.keyTail===""?"":`&ktail=${encodeURIComponent(l.keyTail)}`}`,v=await fetch(`${e}&from=${l.offset}${x}`,{cache:"no-store",credentials:"same-origin",redirect:"manual"});if(u)return;if(v.status===409){f({...l1(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 y=await v.json();if(u)return;let g=l.offset;if(f(K9(l,y)),l.state==="off"||l.final||l.offset===g)break;w===aB-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,qa.useEffect)(()=>{a||i.current?.()},[a]),n}var u1=()=>typeof document<"u"&&document.querySelector('input[type="password" i]')!==null;function dy(){let[e,t]=(0,qa.useState)(u1);return(0,qa.useEffect)(()=>{let a=()=>t(u1());a();let n=new MutationObserver(a);return n.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["type"]}),()=>n.disconnect()},[]),e}var c1={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"},oB={edit:"Edited",read:"Read",search:"Searched for",lookup:"Looked up",delegate:"Asked a helper:"},rB=e=>{let t=Date.parse(e);return Number.isNaN(t)?"":new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},G9=(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 X9({item:e,final:t}){let a=oB[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:G9(e.at,o.at),i=o?.out??[],[l,u]=(0,qa.useState)(!1);return(0,Me.jsxs)("li",{className:Qe("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?c1[e.step]:n?(0,Me.jsx)("code",{className:"k-mono","data-step-target":!0,children:e.target}):(0,Me.jsxs)(Me.Fragment,{children:[a??c1[e.step]," ",(0,Me.jsx)("code",{className:"k-mono","data-step-target":!0,children:e.target})]})}),r!==null&&(0,Me.jsxs)("span",{className:Qe("k-work-step-s",r.tone),"data-step-status":r.tone,children:[r.tone==="ok"?(0,Me.jsx)(Je,{name:"check",small:!0}):r.tone==="failed"?(0,Me.jsx)(Je,{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(`