@gperezmz/bb-plugin-thread-glance 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.css +1 -1
- package/dist/app.js +2 -2
- package/dist/app.meta.json +1 -1
- package/dist/server.js.map +1 -1
- package/dist/server.meta.json +1 -1
- package/features/thread-list/components/FoldRows.tsx +3 -3
- package/features/thread-list/components/ListHeader.tsx +1 -1
- package/features/thread-list/components/ProviderBadge.tsx +1 -1
- package/features/thread-list/components/PullRequestBadge.tsx +1 -1
- package/features/thread-list/components/ThreadRowView.tsx +4 -6
- package/features/thread-list/components/glyphs.tsx +7 -4
- package/features/thread-list/model/state.ts +3 -3
- package/features/thread-list/model/view.ts +1 -1
- package/features/thread-list/testing/browser.css +7 -0
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -2,7 +2,7 @@ var My=Object.defineProperty;var I=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(
|
|
|
2
2
|
To pick up a draggable item, press the space bar.
|
|
3
3
|
While dragging, use the arrow keys to move the item.
|
|
4
4
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
-
`},ib={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function sb(e){let{announcements:t=ib,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ob}=e,{announce:i,announcement:s}=Uh(),a=Fo("DndLiveRegion"),[c,u]=A(!1);if(D(()=>{u(!0)},[]),nb(K(()=>({onDragStart(d){let{active:m}=d;i(t.onDragStart({active:m}))},onDragMove(d){let{active:m,over:p}=d;t.onDragMove&&i(t.onDragMove({active:m,over:p}))},onDragOver(d){let{active:m,over:p}=d;i(t.onDragOver({active:m,over:p}))},onDragEnd(d){let{active:m,over:p}=d;i(t.onDragEnd({active:m,over:p}))},onDragCancel(d){let{active:m,over:p}=d;i(t.onDragCancel({active:m,over:p}))}}),[i,t])),!c)return null;let l=Ge.createElement(Ge.Fragment,null,Ge.createElement(Fh,{id:r,value:o.draggable}),Ge.createElement(Bh,{id:a,announcement:s}));return n?Rs(l,n):l}var _e;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(_e||(_e={}));function Ns(){}function Zs(e,t){return K(()=>({sensor:e,options:t??{}}),[e,t])}function o5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return K(()=>[...t].filter(r=>r!=null),[...t])}var zt=Object.freeze({x:0,y:0});function ab(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function cb(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ub(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function lb(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function db(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function pb(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){let c=t.width*t.height,u=e.width*e.height,l=s*a,d=l/(c+u-l);return Number(d.toFixed(4))}return 0}var fb=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,o=[];for(let i of r){let{id:s}=i,a=n.get(s);if(a){let c=pb(a,t);c>0&&o.push({id:s,data:{droppableContainer:i,value:c}})}}return o.sort(ub)};function mb(e,t){let{top:n,left:r,bottom:o,right:i}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=i}var i5=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];let o=[];for(let i of t){let{id:s}=i,a=n.get(s);if(a&&mb(r,a)){let u=lb(a).reduce((d,m)=>d+ab(r,m),0),l=Number((u/4).toFixed(4));o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(cb)};function hb(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function s5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zt}function gb(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}var Cb=gb(1);function kb(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function yb(e,t,n){let r=kb(t);if(!r)return e;let{scaleX:o,scaleY:i,x:s,y:a}=r,c=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),l=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:l,height:d,top:u,right:c+l,bottom:u+d,left:c}}var bb={ignoreTransform:!1};function Xo(e,t){t===void 0&&(t=bb);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:u,transformOrigin:l}=qe(e).getComputedStyle(e);u&&(n=yb(n,u,l))}let{top:r,left:o,width:i,height:s,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:c}}function Kh(e){return Xo(e,{ignoreTransform:!0})}function vb(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function wb(e,t){return t===void 0&&(t=qe(e).getComputedStyle(e)),t.position==="fixed"}function xb(e,t){t===void 0&&(t=qe(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{let i=t[o];return typeof i=="string"?n.test(i):!1})}function fl(e,t){let n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(As(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Er(o)||il(o)||n.includes(o))return n;let i=qe(e).getComputedStyle(o);return o!==e&&xb(o,i)&&n.push(o),wb(o,i)?n:r(o.parentNode)}return e?r(e):n}function a5(e){let[t]=fl(e,1);return t??null}function al(e){return!Vo||!e?null:Xn(e)?e:Ts(e)?As(e)||e===Qn(e).scrollingElement?window:Er(e)?e:null:null}function c5(e){return Xn(e)?e.scrollX:e.scrollLeft}function u5(e){return Xn(e)?e.scrollY:e.scrollTop}function ll(e){return{x:c5(e),y:u5(e)}}var Ae;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ae||(Ae={}));function l5(e){return!Vo||!e?!1:e===document.scrollingElement}function d5(e){let t={x:0,y:0},n=l5(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}var Ib={x:.2,y:.2};function Sb(e,t,n,r,o){let{top:i,left:s,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=Ib);let{isTop:u,isBottom:l,isLeft:d,isRight:m}=d5(e),p={x:0,y:0},h={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+g.height?(p.y=Ae.Backward,h.y=r*Math.abs((t.top+g.height-i)/g.height)):!l&&c>=t.bottom-g.height&&(p.y=Ae.Forward,h.y=r*Math.abs((t.bottom-g.height-c)/g.height)),!m&&a>=t.right-g.width?(p.x=Ae.Forward,h.x=r*Math.abs((t.right-g.width-a)/g.width)):!d&&s<=t.left+g.width&&(p.x=Ae.Backward,h.x=r*Math.abs((t.left+g.width-s)/g.width)),{direction:p,speed:h}}function _b(e){if(e===document.scrollingElement){let{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}let{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function p5(e){return e.reduce((t,n)=>er(t,ll(n)),zt)}function Pb(e){return e.reduce((t,n)=>t+c5(n),0)}function Lb(e){return e.reduce((t,n)=>t+u5(n),0)}function Mb(e,t){if(t===void 0&&(t=Xo),!e)return;let{top:n,left:r,bottom:o,right:i}=t(e);a5(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}var Rb=[["x",["left","right"],Pb],["y",["top","bottom"],Lb]],Ko=class{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let r=fl(n),o=p5(r);this.rect={...t},this.width=t.width,this.height=t.height;for(let[i,s,a]of Rb)for(let c of s)Object.defineProperty(this,c,{get:()=>{let u=a(r),l=o[i]-u;return this.rect[c]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},tr=class{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}};function Tb(e){let{EventTarget:t}=qe(e);return e instanceof t?e:Qn(e)}function cl(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var St;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(St||(St={}));function Gh(e){e.preventDefault()}function Ab(e){e.stopPropagation()}var pe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(pe||(pe={}));var f5={start:[pe.Space,pe.Enter],cancel:[pe.Esc],end:[pe.Space,pe.Enter,pe.Tab]},$b=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case pe.Right:return{...n,x:n.x+25};case pe.Left:return{...n,x:n.x-25};case pe.Down:return{...n,y:n.y+25};case pe.Up:return{...n,y:n.y-25}}},Nr=class{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:n}}=t;this.props=t,this.listeners=new tr(Qn(n)),this.windowListeners=new tr(qe(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(St.Resize,this.handleCancel),this.windowListeners.add(St.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(St.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Mb(r),n(zt)}handleKeyDown(t){if(sl(t)){let{active:n,context:r,options:o}=this.props,{keyboardCodes:i=f5,coordinateGetter:s=$b,scrollBehavior:a="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}let{collisionRect:u}=r.current,l=u?{x:u.left,y:u.top}:zt;this.referenceCoordinates||(this.referenceCoordinates=l);let d=s(t,{active:n,context:r.current,currentCoordinates:l});if(d){let m=Bo(d,l),p={x:0,y:0},{scrollableAncestors:h}=r.current;for(let g of h){let C=t.code,{isTop:w,isRight:y,isLeft:S,isBottom:T,maxScroll:L,minScroll:M}=d5(g),E=_b(g),B={x:Math.min(C===pe.Right?E.right-E.width/2:E.right,Math.max(C===pe.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(C===pe.Down?E.bottom-E.height/2:E.bottom,Math.max(C===pe.Down?E.top:E.top+E.height/2,d.y))},X=C===pe.Right&&!y||C===pe.Left&&!S,oe=C===pe.Down&&!T||C===pe.Up&&!w;if(X&&B.x!==d.x){let ee=g.scrollLeft+m.x,Z=C===pe.Right&&ee<=L.x||C===pe.Left&&ee>=M.x;if(Z&&!m.y){g.scrollTo({left:ee,behavior:a});return}Z?p.x=g.scrollLeft-ee:p.x=C===pe.Right?g.scrollLeft-L.x:g.scrollLeft-M.x,p.x&&g.scrollBy({left:-p.x,behavior:a});break}else if(oe&&B.y!==d.y){let ee=g.scrollTop+m.y,Z=C===pe.Down&&ee<=L.y||C===pe.Up&&ee>=M.y;if(Z&&!m.x){g.scrollTo({top:ee,behavior:a});return}Z?p.y=g.scrollTop-ee:p.y=C===pe.Down?g.scrollTop-L.y:g.scrollTop-M.y,p.y&&g.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,er(Bo(d,this.referenceCoordinates),p))}}}handleMove(t,n){let{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){let{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){let{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Nr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=f5,onActivation:o}=t,{active:i}=n,{code:s}=e.nativeEvent;if(r.start.includes(s)){let a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function qh(e){return!!(e&&"distance"in e)}function Yh(e){return!!(e&&"delay"in e)}var Go=class{constructor(t,n,r){var o;r===void 0&&(r=Tb(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;let{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=Qn(s),this.documentListeners=new tr(this.document),this.listeners=new tr(r),this.windowListeners=new tr(qe(s)),this.initialCoordinates=(o=Ds(i))!=null?o:zt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(St.Resize,this.handleCancel),this.windowListeners.add(St.DragStart,Gh),this.windowListeners.add(St.VisibilityChange,this.handleCancel),this.windowListeners.add(St.ContextMenu,Gh),this.documentListeners.add(St.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yh(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(qh(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){let{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){let{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(St.Click,Ab,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(St.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;let{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;let c=(n=Ds(t))!=null?n:zt,u=Bo(o,c);if(!r&&a){if(qh(a)){if(a.tolerance!=null&&cl(u,a.tolerance))return this.handleCancel();if(cl(u,a.distance))return this.handleStart()}if(Yh(a)&&cl(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){let{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){let{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===pe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}},Eb={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},zs=class extends Go{constructor(t){let{event:n}=t,r=Qn(n.target);super(t,Eb,r)}};zs.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Db={move:{name:"mousemove"},end:{name:"mouseup"}},dl;(function(e){e[e.RightClick=2]="RightClick"})(dl||(dl={}));var qo=class extends Go{constructor(t){super(t,Db,Qn(t.event.target))}};qo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===dl.RightClick?!1:(r?.({event:n}),!0)}}];var ul={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},Yo=class extends Go{constructor(t){super(t,ul)}static setup(){return window.addEventListener(ul.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ul.move.name,t)};function t(){}}};Yo.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Uo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Uo||(Uo={}));var js;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(js||(js={}));function Ob(e){let{acceleration:t,activator:n=Uo.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=js.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:l,delta:d,threshold:m}=e,p=zb({delta:d,disabled:!i}),[h,g]=Wh(),C=$({x:0,y:0}),w=$({x:0,y:0}),y=K(()=>{switch(n){case Uo.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Uo.DraggableRect:return o}},[n,o,c]),S=$(null),T=N(()=>{let M=S.current;if(!M)return;let E=C.current.x*w.current.x,B=C.current.y*w.current.y;M.scrollBy(E,B)},[]),L=K(()=>a===js.TreeOrder?[...u].reverse():u,[a,u]);D(()=>{if(!i||!u.length||!y){g();return}for(let M of L){if(r?.(M)===!1)continue;let E=u.indexOf(M),B=l[E];if(!B)continue;let{direction:X,speed:oe}=Sb(M,B,y,t,m);for(let ee of["x","y"])p[ee][X[ee]]||(oe[ee]=0,X[ee]=0);if(oe.x>0||oe.y>0){g(),S.current=M,h(T,s),C.current=oe,w.current=X;return}}C.current={x:0,y:0},w.current={x:0,y:0},g()},[t,T,r,g,i,s,JSON.stringify(y),JSON.stringify(p),h,u,L,l,JSON.stringify(m)])}var Nb={x:{[Ae.Backward]:!1,[Ae.Forward]:!1},y:{[Ae.Backward]:!1,[Ae.Forward]:!1}};function zb(e){let{delta:t,disabled:n}=e,r=Es(t);return Or(o=>{if(n||!r||!o)return Nb;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ae.Backward]:o.x[Ae.Backward]||i.x===-1,[Ae.Forward]:o.x[Ae.Forward]||i.x===1},y:{[Ae.Backward]:o.y[Ae.Backward]||i.y===-1,[Ae.Forward]:o.y[Ae.Forward]||i.y===1}}},[n,t,r])}function jb(e,t){let n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Or(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Zb(e,t){return K(()=>e.reduce((n,r)=>{let{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var Jo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Jo||(Jo={}));var pl;(function(e){e.Optimized="optimized"})(pl||(pl={}));var Jh=new Map;function Wb(e,t){let{dragging:n,dependencies:r,config:o}=t,[i,s]=A(null),{frequency:a,measure:c,strategy:u}=o,l=$(e),d=C(),m=Dr(d),p=N(function(w){w===void 0&&(w=[]),!m.current&&s(y=>y===null?w:y.concat(w.filter(S=>!y.includes(S))))},[m]),h=$(null),g=Or(w=>{if(d&&!n)return Jh;if(!w||w===Jh||l.current!==e||i!=null){let y=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){y.set(S.id,S.rect.current);continue}let T=S.node.current,L=T?new Ko(c(T),T):null;S.rect.current=L,L&&y.set(S.id,L)}return y}return w},[e,i,n,d,c]);return D(()=>{l.current=e},[e]),D(()=>{d||p()},[n,d]),D(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),D(()=>{d||typeof a!="number"||h.current!==null||(h.current=setTimeout(()=>{p(),h.current=null},a))},[a,d,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:i!=null};function C(){switch(u){case Jo.Always:return!1;case Jo.BeforeDragging:return n;default:return!n}}}function m5(e,t){return Or(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Vb(e,t){return m5(e,t)}function Hb(e){let{callback:t,disabled:n}=e,r=$s(t),o=K(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(r)},[r,n]);return D(()=>()=>o?.disconnect(),[o]),o}function Ws(e){let{callback:t,disabled:n}=e,r=$s(t),o=K(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(r)},[n]);return D(()=>()=>o?.disconnect(),[o]),o}function Fb(e){return new Ko(Xo(e),e)}function Xh(e,t,n){t===void 0&&(t=Fb);let[r,o]=A(null);function i(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}let l=t(e);return JSON.stringify(c)===JSON.stringify(l)?c:l})}let s=Hb({callback(c){if(e)for(let u of c){let{type:l,target:d}=u;if(l==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=Ws({callback:i});return an(()=>{i(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function Bb(e){let t=m5(e);return s5(e,t)}var Qh=[];function Ub(e){let t=$(e),n=Or(r=>e?r&&r!==Qh&&e&&t.current&&e.parentNode===t.current.parentNode?r:fl(e):Qh,[e]);return D(()=>{t.current=e},[e]),n}function Kb(e){let[t,n]=A(null),r=$(e),o=N(i=>{let s=al(i.target);s&&n(a=>a?(a.set(s,ll(s)),new Map(a)):null)},[]);return D(()=>{let i=r.current;if(e!==i){s(i);let a=e.map(c=>{let u=al(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,ll(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(c=>{let u=al(c);u?.removeEventListener("scroll",o)})}},[o,e]),K(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>er(i,s),zt):p5(e):zt,[e,t])}function e5(e,t){t===void 0&&(t=[]);let n=$(null);return D(()=>{n.current=null},t),D(()=>{let r=e!==zt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Bo(e,n.current):zt}function Gb(e){D(()=>{if(!Vo)return;let t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(let n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function qb(e,t){return K(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function h5(e){return K(()=>e?vb(e):null,[e])}var t5=[];function Yb(e,t){t===void 0&&(t=Xo);let[n]=e,r=h5(n?qe(n):null),[o,i]=A(t5);function s(){i(()=>e.length?e.map(c=>l5(c)?r:new Ko(t(c),c)):t5)}let a=Ws({callback:s});return an(()=>{a?.disconnect(),s(),e.forEach(c=>a?.observe(c))},[e]),o}function Jb(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Er(t)?t:e}function Xb(e){let{measure:t}=e,[n,r]=A(null),o=N(u=>{for(let{target:l}of u)if(Er(l)){r(d=>{let m=t(l);return d?{...d,width:m.width,height:m.height}:m});break}},[t]),i=Ws({callback:o}),s=N(u=>{let l=Jb(u);i?.disconnect(),l&&i?.observe(l),r(l?t(l):null)},[t,i]),[a,c]=Ho(s);return K(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}var Qb=[{sensor:zs,options:{}},{sensor:Nr,options:{}}],ev={current:{}},Os={draggable:{measure:Kh},droppable:{measure:Kh,strategy:Jo.WhileDragging,frequency:pl.Optimized},dragOverlay:{measure:Xo}},nr=class extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}},tv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new nr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ns},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Os,measureDroppableContainers:Ns,windowRect:null,measuringScheduled:!1},nv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ns,draggableNodes:new Map,over:null,measureDroppableContainers:Ns},Vs=be(nv),rv=be(tv);function ov(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new nr}}}function iv(e,t){switch(t.type){case _e.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case _e.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case _e.DragEnd:case _e.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case _e.RegisterDroppable:{let{element:n}=t,{id:r}=n,o=new nr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case _e.SetDroppableDisabled:{let{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let s=new nr(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case _e.UnregisterDroppable:{let{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;let i=new nr(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function sv(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:o}=ve(Vs),i=Es(r),s=Es(n?.id);return D(()=>{if(!t&&!r&&i&&s!=null){if(!sl(i)||document.activeElement===i.target)return;let a=o.get(s);if(!a)return;let{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(let l of[c.current,u.current]){if(!l)continue;let d=Hh(l);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function av(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function cv(e){return K(()=>({draggable:{...Os.draggable,...e?.draggable},droppable:{...Os.droppable,...e?.droppable},dragOverlay:{...Os.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function uv(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e,i=$(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;an(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;let u=t?.node.current;if(!u||u.isConnected===!1)return;let l=n(u),d=s5(l,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){let m=a5(u);m&&m.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}var g5=be({...zt,scaleX:1,scaleY:1}),Sn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Sn||(Sn={}));var C5=st(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:c=!0,children:u,sensors:l=Qb,collisionDetection:d=fb,measuring:m,modifiers:p,...h}=t,g=nl(iv,void 0,ov),[C,w]=g,[y,S]=rb(),[T,L]=A(Sn.Uninitialized),M=T===Sn.Initialized,{draggable:{active:E,nodes:B,translate:X},droppable:{containers:oe}}=C,ee=E!=null?B.get(E):null,Z=$({initial:null,translated:null}),ne=K(()=>{var Se;return E!=null?{id:E,data:(Se=ee?.data)!=null?Se:ev,rect:Z}:null},[E,ee]),Q=$(null),[ge,yt]=A(null),[Ke,gn]=A(null),nt=Dr(h,Object.values(h)),bt=Fo("DndDescribedBy",s),Cn=K(()=>oe.getEnabled(),[oe]),Oe=cv(m),{droppableRects:rt,measureDroppableContainers:Bt,measuringScheduled:Bn}=Wb(Cn,{dragging:M,dependencies:[X.x,X.y],config:Oe.droppable}),He=jb(B,E),Pr=K(()=>Ke?Ds(Ke):null,[Ke]),Un=Xu(),ot=Vb(He,Oe.draggable.measure);uv({activeNode:E!=null?B.get(E):null,config:Un.layoutShiftCompensation,initialRect:ot,measure:Oe.draggable.measure});let we=Xh(He,Oe.draggable.measure,ot),kn=Xh(He?He.parentElement:null),me=$({activatorEvent:null,active:null,activeNode:He,collisionRect:null,collisions:null,droppableRects:rt,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:oe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Kn=oe.getNodeFor((n=me.current.over)==null?void 0:n.id),Ne=Xb({measure:Oe.dragOverlay.measure}),vt=(r=Ne.nodeRef.current)!=null?r:He,wt=M?(o=Ne.rect)!=null?o:we:null,Me=!!(Ne.nodeRef.current&&Ne.rect),xt=Bb(Me?null:we),rn=h5(vt?qe(vt):null),re=Ub(M?Kn??He:null),Ut=Yb(re),Kt=av(p,{transform:{x:X.x-xt.x,y:X.y-xt.y,scaleX:1,scaleY:1},activatorEvent:Ke,active:ne,activeNodeRect:we,containerNodeRect:kn,draggingNodeRect:wt,over:me.current.over,overlayNodeRect:Ne.rect,scrollableAncestors:re,scrollableAncestorRects:Ut,windowRect:rn}),W=Pr?er(Pr,X):null,ze=Kb(re),Do=e5(ze),vs=e5(ze,[we]),At=er(Kt,Do),on=wt?Cb(wt,Kt):null,yn=ne&&on?d({active:ne,collisionRect:on,droppableRects:rt,droppableContainers:Cn,pointerCoordinates:W}):null,te=db(yn,"id"),[$t,Oo]=A(null),ws=Me?Kt:er(Kt,vs),bn=hb(ws,(i=$t?.rect)!=null?i:null,we),Gn=$(null),No=N((Se,Be)=>{let{sensor:Re,options:Gt}=Be;if(Q.current==null)return;let it=B.get(Q.current);if(!it)return;let je=Se.nativeEvent,It=new Re({active:Q.current,activeNode:it,event:je,options:Gt,context:me,onAbort(Ce){if(!B.get(Ce))return;let{onDragAbort:mt}=nt.current,Dt={id:Ce};mt?.(Dt),y({type:"onDragAbort",event:Dt})},onPending(Ce,qt,mt,Dt){if(!B.get(Ce))return;let{onDragPending:Yn}=nt.current,Te={id:Ce,constraint:qt,initialCoordinates:mt,offset:Dt};Yn?.(Te),y({type:"onDragPending",event:Te})},onStart(Ce){let qt=Q.current;if(qt==null)return;let mt=B.get(qt);if(!mt)return;let{onDragStart:Dt}=nt.current,qn={activatorEvent:je,active:{id:qt,data:mt.data,rect:Z}};Wo(()=>{Dt?.(qn),L(Sn.Initializing),w({type:_e.DragStart,initialCoordinates:Ce,active:qt}),y({type:"onDragStart",event:qn}),yt(Gn.current),gn(je)})},onMove(Ce){w({type:_e.DragMove,coordinates:Ce})},onEnd:Et(_e.DragEnd),onCancel:Et(_e.DragCancel)});Gn.current=It;function Et(Ce){return async function(){let{active:mt,collisions:Dt,over:qn,scrollAdjustedTranslate:Yn}=me.current,Te=null;if(mt&&Yn){let{cancelDrop:ht}=nt.current;Te={activatorEvent:je,active:mt,collisions:Dt,delta:Yn,over:qn},Ce===_e.DragEnd&&typeof ht=="function"&&await Promise.resolve(ht(Te))&&(Ce=_e.DragCancel)}Q.current=null,Wo(()=>{w({type:Ce}),L(Sn.Uninitialized),Oo(null),yt(null),gn(null),Gn.current=null;let ht=Ce===_e.DragEnd?"onDragEnd":"onDragCancel";if(Te){let Ot=nt.current[ht];Ot?.(Te),y({type:ht,event:Te})}})}}},[B]),Fe=N((Se,Be)=>(Re,Gt)=>{let it=Re.nativeEvent,je=B.get(Gt);if(Q.current!==null||!je||it.dndKit||it.defaultPrevented)return;let It={active:je};Se(Re,Be.options,It)===!0&&(it.dndKit={capturedBy:Be.sensor},Q.current=Gt,No(Re,Be))},[B,No]),zo=Zb(l,Fe);Gb(l),an(()=>{we&&T===Sn.Initializing&&L(Sn.Initialized)},[we,T]),D(()=>{let{onDragMove:Se}=nt.current,{active:Be,activatorEvent:Re,collisions:Gt,over:it}=me.current;if(!Be||!Re)return;let je={active:Be,activatorEvent:Re,collisions:Gt,delta:{x:At.x,y:At.y},over:it};Wo(()=>{Se?.(je),y({type:"onDragMove",event:je})})},[At.x,At.y]),D(()=>{let{active:Se,activatorEvent:Be,collisions:Re,droppableContainers:Gt,scrollAdjustedTranslate:it}=me.current;if(!Se||Q.current==null||!Be||!it)return;let{onDragOver:je}=nt.current,It=Gt.get(te),Et=It&&It.rect.current?{id:It.id,rect:It.rect.current,data:It.data,disabled:It.disabled}:null,Ce={active:Se,activatorEvent:Be,collisions:Re,delta:{x:it.x,y:it.y},over:Et};Wo(()=>{Oo(Et),je?.(Ce),y({type:"onDragOver",event:Ce})})},[te]),an(()=>{me.current={activatorEvent:Ke,active:ne,activeNode:He,collisionRect:on,collisions:yn,droppableRects:rt,draggableNodes:B,draggingNode:vt,draggingNodeRect:wt,droppableContainers:oe,over:$t,scrollableAncestors:re,scrollAdjustedTranslate:At},Z.current={initial:wt,translated:on}},[ne,He,yn,on,B,vt,wt,rt,oe,$t,re,At]),Ob({...Un,delta:X,draggingRect:on,pointerCoordinates:W,scrollableAncestors:re,scrollableAncestorRects:Ut});let Lr=K(()=>({active:ne,activeNode:He,activeNodeRect:we,activatorEvent:Ke,collisions:yn,containerNodeRect:kn,dragOverlay:Ne,draggableNodes:B,droppableContainers:oe,droppableRects:rt,over:$t,measureDroppableContainers:Bt,scrollableAncestors:re,scrollableAncestorRects:Ut,measuringConfiguration:Oe,measuringScheduled:Bn,windowRect:rn}),[ne,He,we,Ke,yn,kn,Ne,B,oe,rt,$t,Bt,re,Ut,Oe,Bn,rn]),Mr=K(()=>({activatorEvent:Ke,activators:zo,active:ne,activeNodeRect:we,ariaDescribedById:{draggable:bt},dispatch:w,draggableNodes:B,over:$t,measureDroppableContainers:Bt}),[Ke,zo,ne,we,w,bt,B,$t,Bt]);return Ge.createElement(r5.Provider,{value:S},Ge.createElement(Vs.Provider,{value:Mr},Ge.createElement(rv.Provider,{value:Lr},Ge.createElement(g5.Provider,{value:bn},u)),Ge.createElement(sv,{disabled:a?.restoreFocus===!1})),Ge.createElement(sb,{...a,hiddenTextDescribedById:bt}));function Xu(){let Se=ge?.autoScrollEnabled===!1,Be=typeof c=="object"?c.enabled===!1:c===!1,Re=M&&!Se&&!Be;return typeof c=="object"?{...c,enabled:Re}:{enabled:Re}}}),lv=be(null),n5="button",dv="Draggable";function Hs(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e,i=Fo(dv),{activators:s,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:l,draggableNodes:d,over:m}=ve(Vs),{role:p=n5,roleDescription:h="draggable",tabIndex:g=0}=o??{},C=c?.id===t,w=ve(C?g5:lv),[y,S]=Ho(),[T,L]=Ho(),M=qb(s,t),E=Dr(n);an(()=>(d.set(t,{id:t,key:i,node:y,activatorNode:T,data:E}),()=>{let X=d.get(t);X&&X.key===i&&d.delete(t)}),[d,t]);let B=K(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":C&&p===n5?!0:void 0,"aria-roledescription":h,"aria-describedby":l.draggable}),[r,p,g,C,h,l.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:B,isDragging:C,listeners:r?void 0:M,node:y,over:m,setNodeRef:S,setActivatorNodeRef:L,transform:w}}var pv="Droppable",fv={timeout:25};function Fs(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e,i=Fo(pv),{active:s,dispatch:a,over:c,measureDroppableContainers:u}=ve(Vs),l=$({disabled:n}),d=$(!1),m=$(null),p=$(null),{disabled:h,updateMeasurementsFor:g,timeout:C}={...fv,...o},w=Dr(g??r),y=N(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),p.current=null},C)},[C]),S=Ws({callback:y,disabled:h||!s}),T=N((B,X)=>{S&&(X&&(S.unobserve(X),d.current=!1),B&&S.observe(B))},[S]),[L,M]=Ho(T),E=Dr(t);return D(()=>{!S||!L.current||(S.disconnect(),d.current=!1,S.observe(L.current))},[L,S]),D(()=>(a({type:_e.RegisterDroppable,element:{id:r,key:i,disabled:n,node:L,rect:m,data:E}}),()=>a({type:_e.UnregisterDroppable,key:i,id:r})),[r]),D(()=>{n!==l.current.disabled&&(a({type:_e.SetDroppableDisabled,id:r,key:i,disabled:n}),l.current.disabled=n)},[r,i,n,a]),{active:s,rect:m,isOver:c?.id===r,node:L,over:c,setNodeRef:M}}var ml=globalThis.__bbPluginRuntime;if(ml==null||ml.sonner==null)throw new Error('Cannot load "sonner": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Bs=ml.sonner,YL="default"in Bs?Bs.default:Bs,{Toaster:JL,toast:gt,useSonner:XL}=Bs;var mv=Object.defineProperty,gl=(e,t)=>mv(e,"name",{value:t,configurable:!0});function hl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}gl(hl,"setRef");function k5(...e){return t=>{let n=!1,r=e.map(o=>{let i=hl(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){let i=r[o];typeof i=="function"?i():hl(e[o],null)}}}}gl(k5,"composeRefs");function Cl(...e){return N(k5(...e),e)}gl(Cl,"useComposedRefs");var hv=Object.defineProperty,jt=(e,t)=>hv(e,"name",{value:t,configurable:!0});function y5(e){let t=F((n,r)=>{let{children:o,...i}=n,s=null,a=!1,c=[];kl(o)&&typeof Us=="function"&&(o=Us(o._payload)),Ls.forEach(o,m=>{if(x5(m)){a=!0;let p=m,h="child"in p.props?p.props.child:p.props.children;kl(h)&&typeof Us=="function"&&(h=Us(h._payload)),s=Cv(p,h),c.push(s?.props?.children)}else c.push(m)}),s?s=Ar(s,void 0,c):!a&&Ls.count(o)===1&&$r(o)&&(s=o);let u=s?w5(s):void 0,l=Cl(r,u);if(!s){if(o||o===0)throw new Error(a?bv(e):yv(e));return o}let d=v5(i,s.props??{});return s.type!==Tr&&(d.ref=r?l:u),Ar(s,d)});return t.displayName=`${e}.Slot`,t}jt(y5,"createSlot");var _n=y5("Slot"),b5=Symbol.for("radix.slottable");function gv(e){let t=jt(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=b5,t}jt(gv,"createSlottable");var Cv=jt((e,t)=>{if("child"in e.props){let n=e.props.child;return $r(n)?Ar(n,void 0,e.props.children(n.props.children)):null}return $r(t)?t:null},"getSlottableElementFromSlottable");function v5(e,t){let n={...t};for(let r in t){let o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{let c=i(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}jt(v5,"mergeProps");function w5(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}jt(w5,"getElementRef");function x5(e){return $r(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===b5}jt(x5,"isSlottable");var kv=Symbol.for("react.lazy");function kl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===kv&&"_payload"in e&&I5(e._payload)}jt(kl,"isLazyComponent");function I5(e){return typeof e=="object"&&e!==null&&"then"in e}jt(I5,"isPromiseLike");var yv=jt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),bv=jt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Us=ct[" use ".trim().toString()];var yl=globalThis.__bbPluginRuntime;if(yl==null||yl.classVarianceAuthority==null)throw new Error('Cannot load "class-variance-authority": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Ks=yl.classVarianceAuthority,rM="default"in Ks?Ks.default:Ks,{cva:S5,cx:oM}=Ks;var bl=globalThis.__bbPluginRuntime;if(bl==null||bl.clsx==null)throw new Error('Cannot load "clsx": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Gs=bl.clsx,sM="default"in Gs?Gs.default:Gs,{clsx:_5}=Gs;var vl=globalThis.__bbPluginRuntime;if(vl==null||vl.tailwindMerge==null)throw new Error('Cannot load "tailwind-merge": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var qs=vl.tailwindMerge,cM="default"in qs?qs.default:qs,{createTailwindMerge:uM,extendTailwindMerge:lM,fromTheme:dM,getDefaultConfig:pM,mergeConfigs:fM,twJoin:mM,twMerge:P5,validators:hM}=qs;function x(...e){return P5(_5(e))}var Ys="transition-colors duration-150 hover:duration-0",Yt="transition-none";var wl=globalThis.__bbPluginRuntime;if(wl==null||wl.jsxRuntime==null)throw new Error('Cannot load "react/jsx-runtime": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Js=wl.jsxRuntime,vM="default"in Js?Js.default:Js,{Fragment:_t,jsx:f,jsxs:v}=Js;var Xs=S5(`inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ${Ys} focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_[data-icon-root]]:pointer-events-none [&_[data-icon-root]]:size-4 [&_[data-icon-root]]:shrink-0`,{variants:{variant:{default:"bg-foreground text-background hover:bg-foreground/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-transparent hover:bg-state-hover hover:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-state-hover hover:text-foreground aria-pressed:bg-state-active aria-pressed:text-foreground aria-pressed:hover:bg-state-active data-[state=open]:bg-state-active data-[state=open]:text-foreground data-[state=open]:hover:bg-state-active",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ye=F(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>f(r?_n:"button",{className:x(Xs({variant:t,size:n,className:e})),ref:i,...o}));Ye.displayName="Button";var xl=globalThis.__bbPluginRuntime;if(xl==null||xl.radixPopover==null)throw new Error('Cannot load "@radix-ui/react-popover": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Qs=xl.radixPopover,MM="default"in Qs?Qs.default:Qs,{Anchor:L5,Arrow:RM,Close:TM,Content:M5,Popover:AM,PopoverAnchor:$M,PopoverArrow:EM,PopoverClose:DM,PopoverContent:OM,PopoverPortal:NM,PopoverTrigger:zM,Portal:R5,Root:T5,Trigger:A5,createPopoverScope:jM}=Qs;function $e(){let e="thread-glance";return{"data-bb-portaled-overlay":"","data-bb-plugin-root":"",...e!==void 0?{"data-bb-plugin":e}:{}}}var wv="select-none",xv=new Set(["button","checkbox","file","hidden","image","radio","range","reset","submit"]),Pn=e=>x(wv,e);function Iv(e){return e instanceof HTMLTextAreaElement?!0:e instanceof HTMLInputElement?!e.disabled&&!e.readOnly&&!xv.has(e.type):e instanceof HTMLElement?e.isContentEditable||e.closest("[contenteditable='true']")!==null:!1}function Qo(e){if(typeof document>"u")return;let t=document.activeElement;!t||!Iv(t)||e!==null&&!e.contains(t)||t.blur()}function Ln(){Qo(null)}function $5(){Qo(null)}function cn(e){e.preventDefault()}var Il="pointer";typeof document<"u"&&(document.addEventListener("keydown",()=>{Il="keyboard"},{capture:!0}),document.addEventListener("pointerdown",()=>{Il="pointer"},{capture:!0}));function E5(){return Il==="keyboard"}var ea=new Map;function Sv(e){if(typeof window>"u"||!window.matchMedia)return null;let t=ea.get(e);if(t)return t;let n=window.matchMedia(e),r=new Set,o=()=>{for(let i of r)i()};return t={mql:n,subscribe(i){let s=r.size===0;return r.add(i),s&&n.addEventListener("change",o),()=>{r.delete(i),r.size===0&&(n.removeEventListener("change",o),ea.delete(e))}}},ea.set(e,t),t}function _v(e,t){return Sv(e)?.subscribe(t)??(()=>{})}function Pv(e){return typeof window>"u"||!window.matchMedia?!1:ea.get(e)?.mql.matches??window.matchMedia(e).matches}function ta(e){return sn(t=>_v(e,t),()=>Pv(e),()=>!1)}var Lv="(max-width: 767px)",Mv=be(null);function D5(){let e=ve(Mv),t=ta(Lv);return e!==null?e:t}var Rv="(pointer: coarse)";function na(){return ta(Rv)}var Tv=120,ia={width:"auto",minWidth:"auto",maxWidth:"none"},Sl="--bb-drawer-keyboard-inset",Av=80;function oa(e){e!==null&&(e.style.height="",e.style.bottom="",e.style.removeProperty(Sl))}function $v({layoutViewportHeight:e,visualViewportHeight:t,visualViewportOffsetTop:n}){let r=Math.round(e-(t+n));return r>=Av?r:0}function Ev(e,t){D(()=>{let n=e.current,r=window.visualViewport;if(n===null||!t||!r)return;let o=null,i=()=>{if(o=null,r.scale!==1){oa(n);return}let a=$v({layoutViewportHeight:n.ownerDocument.documentElement.clientHeight,visualViewportHeight:r.height,visualViewportOffsetTop:r.offsetTop});if(a===0){n.style.bottom="",n.style.removeProperty(Sl);return}n.style.bottom=`${a}px`,n.style.setProperty(Sl,`${a}px`)},s=()=>{o!==null&&window.cancelAnimationFrame(o),o=window.requestAnimationFrame(i)};return i(),r.addEventListener("resize",s),r.addEventListener("scroll",s),()=>{r.removeEventListener("resize",s),r.removeEventListener("scroll",s),o!==null&&window.cancelAnimationFrame(o),oa(n)}},[t,e])}function Dv(){let e=D5()?"drawer":"floating",t=na();return{presentation:e,supportsHover:e==="floating"&&!t}}function zr(e,t,n=!1){let{presentation:r}=Dv(),o=r==="drawer",[i,s]=A(n),a=e!==void 0,c=a?e:i,u=N(l=>{c&&!l&&o&&$5(),a||s(l),t?.(l)},[o,a,t,c]);return K(()=>({isCompactViewport:o,open:c,onOpenChange:u}),[o,c,u])}var rr=F(({asChild:e,open:t,onOpenChange:n,haspopup:r,onClick:o,children:i,className:s,...a},c)=>{let u=Pn(s),l=m=>{o?.(m),m.defaultPrevented||(t||Ln(),n(!t))},d={"aria-expanded":t,"aria-haspopup":r,"data-state":t?"open":"closed"};return e?f(_n,{ref:c,onClick:l,onMouseDown:cn,className:u,...d,...a,children:i}):f("button",{ref:c,type:"button",onClick:l,onMouseDown:cn,className:u,...d,...a,children:i})});rr.displayName="MobileTrigger";var Ov=["side","sideOffset","align","alignOffset","collisionPadding","collisionBoundary","arrowPadding","sticky","hideWhenDetached","avoidCollisions","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside"],Nv=new Set(Ov);function jr(e){let t={};for(let n of Object.keys(e))Nv.has(n)||(t[n]=e[n]);return t}function zv({open:e,enabled:t=!0}){let[n,r]=A(!1),o=N(()=>r(!0),[]);return D(()=>{if(!t||!e||n)return;let i=null,s=null;i=window.requestAnimationFrame(()=>{i=null,s=window.requestAnimationFrame(()=>{s=null,o()})});let a=window.setTimeout(o,Tv);return()=>{i!==null&&window.cancelAnimationFrame(i),s!==null&&window.cancelAnimationFrame(s),window.clearTimeout(a)}},[t,n,e,o]),{isContentRealized:t&&n,realizeContent:o}}function Zr({open:e,onOpenChange:t,onAfterCloseAutoFocus:n,closeOnBackdropClick:r=!0,srLabel:o,labelledBy:i,describedBy:s,contentClassName:a,onContentAnimationEnd:c,children:u}){let{isContentRealized:l}=zv({open:e});return!e&&!l?null:f(Kv,{open:e,onOpenChange:t,onAfterCloseAutoFocus:n,closeOnBackdropClick:r,srLabel:o,labelledBy:i,describedBy:s,contentClassName:a,onContentAnimationEnd:c,children:l?u:f("div",{"aria-hidden":"true",className:"min-h-32","data-responsive-drawer-placeholder":""})})}var O5="cubic-bezier(0.32, 0.72, 0, 1)",jv=.25,Zv=450,Wv=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),ra=new WeakMap;function Vv(e){return Array.from(e.querySelectorAll(Wv)).filter(t=>t.closest('[aria-hidden="true"], [inert]')===null)}function Hv(e,t){let n=e?.closest("[data-bb-portaled-overlay]");return n!=null&&n!==t}function Fv(e,t){let n=t.ownerDocument.activeElement;if(!t.contains(n)&&Hv(n,t))return;let r=Vv(t);if(e.preventDefault(),r.length===0){t.focus({preventScroll:!0});return}let o=r[0],i=r[r.length-1];if(e.shiftKey){if(!t.contains(n)||n===t||n===o){i?.focus({preventScroll:!0});return}let a=r.indexOf(n);r[Math.max(0,a-1)]?.focus({preventScroll:!0});return}if(!t.contains(n)||n===t||n===i){o?.focus({preventScroll:!0});return}let s=r.indexOf(n);r[Math.min(r.length-1,s+1)]?.focus({preventScroll:!0})}function Bv(e,t){let n=ra.get(e);if(n===void 0){let r=[],o=i=>{if(i.defaultPrevented)return;let s=r[r.length-1],a=s?.panel()??null;s===void 0||a===null||(i.key==="Escape"?(i.preventDefault(),s.requestClose()):i.key==="Tab"&&Fv(i,a))};n={entries:r,handleKeyDown:o},ra.set(e,n),e.addEventListener("keydown",o)}return n.entries.push(t),()=>{let r=ra.get(e);if(r===void 0)return;let o=r.entries.indexOf(t);o>=0&&r.entries.splice(o,1),r.entries.length===0&&(e.removeEventListener("keydown",r.handleKeyDown),ra.delete(e))}}function Uv({onAfterCloseAutoFocus:e,onBeforeCloseAutoFocus:t,open:n,panelRef:r,requestClose:o}){let i=$(null);at(()=>{if(!n)return;let a=r.current;if(a===null)return;let c=a.ownerDocument,u=c.activeElement;i.current=u instanceof HTMLElement&&u!==c.body?u:null;let l=Bv(c,{panel:()=>r.current,requestClose:o});return a.focus({preventScroll:!0}),l},[n,r,o]);let s=$(n);at(()=>{let a;if(s.current&&!n){t?.();let c=i.current;if(c?.isConnected&&c.closest('[aria-hidden="true"], [inert]')===null&&(c.focus({preventScroll:!0}),c.ownerDocument.activeElement!==c)){let u=c.ownerDocument.defaultView;if(u!==null){let l=u.requestAnimationFrame(()=>{c.isConnected&&c.closest('[aria-hidden="true"], [inert]')===null&&c.focus({preventScroll:!0}),e?.()});a=()=>u.cancelAnimationFrame(l)}}i.current=null,a===void 0&&e?.()}return s.current=n,a},[e,t,n])}function Kv({open:e,onOpenChange:t,onAfterCloseAutoFocus:n,closeOnBackdropClick:r=!0,srLabel:o,labelledBy:i,describedBy:s,contentClassName:a,motionDurationMs:c=220,onContentAnimationEnd:u,children:l}){let d=$(null),m=$(null),p=$(null),h=$(null),g=In(),C=$e(),w=`transform ${c}ms ${O5}`,y=`opacity ${c}ms ${O5}`,S=$(t);at(()=>{S.current=t},[t]);let T=N(()=>{Qo(d.current),oa(d.current),S.current(!1)},[]),L=N(()=>{Qo(d.current),oa(d.current)},[]);Uv({onAfterCloseAutoFocus:n,onBeforeCloseAutoFocus:L,open:e,panelRef:d,requestClose:T}),Ev(d,e);let M=N(Z=>{h.current!==Z&&(h.current=Z,u?.(Z))},[u]);D(()=>{h.current=null;let Z=window.setTimeout(()=>M(e),c+50);return()=>window.clearTimeout(Z)},[c,e,M]);let E=N((Z,ne,Q)=>{let ge=d.current,yt=m.current;ge===null||yt===null||(ge.style.transition=Q?w:"none",ge.style.transform=`translate3d(0, ${Z}px, 0)`,yt.style.transition=Q?y:"none",yt.style.opacity=String(Math.max(0,Math.min(1,1-Z/ne))))},[y,w]),B=N(Z=>{if(!e||Z.button!==0)return;Z.currentTarget.setPointerCapture(Z.pointerId);let ne=Date.now(),Q=Math.max(d.current?.clientHeight??0,1);p.current={pointerId:Z.pointerId,startY:Z.clientY,lastY:Z.clientY,lastTimeMs:ne,velocityY:0,height:Q},E(0,Q,!1),Z.preventDefault()},[e,E]),X=N(Z=>{let ne=p.current;if(ne===null||ne.pointerId!==Z.pointerId)return;let Q=Date.now(),ge=Q-ne.lastTimeMs;ge>0&&(ne.velocityY=(Z.clientY-ne.lastY)/ge*1e3,ne.lastY=Z.clientY,ne.lastTimeMs=Q),E(Math.max(0,Z.clientY-ne.startY),ne.height,!1),Z.preventDefault()},[E]),oe=N((Z,ne)=>{let Q=p.current;if(Q===null||Q.pointerId!==Z.pointerId)return;p.current=null;let ge=Math.max(0,Z.clientY-Q.startY);!ne&&(ge>=Q.height*jv||Q.velocityY>=Zv)?(E(Q.height,Q.height,!0),T()):E(0,Q.height,!0),Z.preventDefault()},[T,E]),ee=typeof document>"u"?null:document.body;return ee===null?null:Rs(v(_t,{children:[f("div",{ref:m,...C,"aria-hidden":"true","data-persistent-drawer-backdrop":"","data-state":e?"open":"closed",className:"fixed inset-0 z-50 bg-black/40",style:{opacity:e?1:0,pointerEvents:e?"auto":"none",transition:y},onClick:r?T:void 0,onTouchMove:Z=>Z.preventDefault()}),v("div",{ref:d,...C,"aria-hidden":!e,"aria-labelledby":i??(o===void 0?void 0:g),"aria-describedby":s,"aria-modal":e||void 0,"data-bb-portaled-overlay":"","data-persistent-drawer-content":"","data-state":e?"open":"closed",inert:!e,role:"dialog",tabIndex:-1,className:x("fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[calc(92dvh-var(--bb-drawer-keyboard-inset,0px))] flex-col rounded-t-xl border bg-background outline-none",a),style:{transform:e?"translate3d(0, 0, 0)":"translate3d(0, 100%, 0)",transition:w,willChange:e?"transform":void 0},onTransitionEnd:Z=>{Z.currentTarget===Z.target&&Z.propertyName==="transform"&&M(e)},children:[f("div",{"data-persistent-drawer-handle":"",className:"mx-auto flex h-8 w-16 shrink-0 touch-none cursor-grab items-center justify-center active:cursor-grabbing",onPointerDown:B,onPointerMove:X,onPointerUp:Z=>oe(Z,!1),onPointerCancel:Z=>oe(Z,!0),children:f("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/20"})}),o===void 0?null:f("h2",{id:g,className:"sr-only",children:o}),l]})]}),ee)}var _l=be({isCompactViewport:!1,open:!1,onOpenChange:()=>{}});function Pl(){return ve(_l)}function sa({children:e,open:t,onOpenChange:n,defaultOpen:r,...o}){let i=zr(t,n,r);return i.isCompactViewport?f(_l.Provider,{value:i,children:e}):f(T5,{open:i.open,onOpenChange:i.onOpenChange,...o,children:f(_l.Provider,{value:i,children:e})})}var ei=F(({asChild:e,children:t,className:n,...r},o)=>{let{isCompactViewport:i,open:s,onOpenChange:a}=Pl();return i?f(rr,{ref:o,asChild:e,open:s,onOpenChange:a,haspopup:"dialog",className:n,...r,children:t}):f(A5,{ref:o,asChild:e,className:Pn(n),onMouseDown:c=>{s||Ln(),cn(c)},...r,children:t})});ei.displayName="PopoverTrigger";var ti=F(({className:e,align:t="center",sideOffset:n=4,children:r,dismissOnOutsideInteraction:o=!0,onInteractOutside:i,mobileTitle:s,mobileClassName:a,onMobileContentAnimationEnd:c,onOpenAutoFocus:u,autoFocusRef:l,...d},m)=>{let{isCompactViewport:p,open:h,onOpenChange:g}=Pl(),C=na(),w=$e();if(D(()=>{if(!h||p||C||!l)return;let y=window.requestAnimationFrame(()=>{let S=l.current;S?.focus(),S instanceof HTMLInputElement&&S.select()});return()=>window.cancelAnimationFrame(y)},[l,p,C,h]),p){let{style:y,...S}=jr(d);return f(Zr,{open:h,onOpenChange:g,srLabel:s??"Options",closeOnBackdropClick:o,contentClassName:a,onContentAnimationEnd:c,children:f("div",{ref:m,className:x("overflow-y-auto px-4 pt-2 pb-[max(1rem,env(safe-area-inset-bottom))]",e),...S,style:{...y,...ia},children:r})})}return f(R5,{children:f(M5,{ref:m,...w,align:t,sideOffset:n,onOpenAutoFocus:y=>{(C||l)&&y.preventDefault(),C||u?.(y)},className:x("z-50 w-96 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...d,onInteractOutside:y=>{o||y.preventDefault(),i?.(y)},children:r})})});ti.displayName="PopoverContent";var Gv=F(({children:e,...t},n)=>{let{isCompactViewport:r}=Pl();return r?f(_t,{children:e}):f(L5,{ref:n,...t,children:e})});Gv.displayName="PopoverAnchor";var qv=["waits-on-you","unread-failed","queue-failed","offline","working","unread"],N5={question:{icon:"CircleQuestion",label:"Asks a question"},approval:{icon:"SecurityCheck",label:"Needs approval"},plan:{icon:"ListTodo",label:"Plan to review"},input:{icon:"MessageQuestion",label:"Needs your input"}},z5=new Set(["pending","starting","active","stopping","idle","error"]),Ll=new Set(["provisioning","starting","active","stopping","host-reconnecting"]),Yv=new Set([...z5,...Ll,"waiting-for-host"]);function or(e){return z5.has(e.status)?e.status:"idle"}function Ml(e){return Yv.has(e.runtimeStatus)?e.runtimeStatus:or(e)}function aa(e){return e.queuedWork==="waiting"||e.queuedWork==="failed"?e.queuedWork:"none"}function Jv(e){return Ll.has(Ml(e))}function Xv(e){return Ml(e)==="waiting-for-host"}function j5(e,t){return e.id===t.activeThreadId||(t.openThreadIds?.has(e.id)??!1)}function Z5(e,t){if(j5(e,t))return!1;let n=or(e),r=e.lastReadAt??0;return(n==="idle"||n==="error")&&r<e.latestAttentionAt?!0:ca(e,t)}function ca(e,t){if(e.parentThreadId===null||or(e)!=="idle"||j5(e,t))return!1;let n=t.finishedAt[e.id];return n===void 0?!1:n>Math.max(e.lastReadAt??0,t.seenAt[e.id]??0)}var Qv=[["planMode","ListTodo","Plan mode active"],["goals","Target","Goal active"],["workflows","Workflow","Workflow running"],["backgroundAgents","UserRoundPlus","Background agent running"],["backgroundCommands","Terminal","Background command running"]];function xe(e,t,n=!1,r=!1){return{icon:e,tone:t,spin:n,shine:r}}function ew(e){switch(e){case"provisioning":return"Setting up";case"host-reconnecting":return"Reconnecting";case"stopping":return"Stopping";default:return"Working"}}function ua(e,t){let n=or(e),r=Ml(e),o=aa(e),i={sendAt:null};if(e.hasPendingInteraction){let s=N5[t.needsKind??"input"]??N5.input,a=t.needsKind?s.icon:"CircleQuestion";return{kind:"waits-on-you",label:s.label,glyph:xe(a,"attention"),...i}}if(n==="error")return{kind:"failed",label:"Failed",glyph:xe("CircleX","destructive"),...i};if(o==="failed")return{kind:"queue-failed",label:"Queued message failed to send",glyph:xe("AlertTriangle","destructive"),...i};if(r==="waiting-for-host")return{kind:"offline",label:"Machine offline",glyph:xe("CloudOff","attention"),...i};if(Ll.has(r)){let s=ew(r);return t.hasDraft?{kind:"working",label:`${s}, unsubmitted draft`,glyph:xe("Edit","working",!1,!0),...i}:e.activity.planMode>0?{kind:"working",label:`${s}, plan mode`,glyph:xe("ListTodo","working",!1,!0),...i}:e.activity.goals>0?{kind:"working",label:`${s}, goal active`,glyph:xe("Target","working",!1,!0),...i}:{kind:"working",label:s,glyph:xe("Loading","working",!0),...i}}for(let[s,a,c]of Qv)if(e.activity[s]>0)return{kind:"background",label:c,glyph:xe(a,"background",!1,!0),...i};return o==="waiting"?t.scheduledAt!==null&&t.scheduledAt>t.now?{kind:"scheduled",label:"Scheduled message",glyph:xe("Calendar","muted-strong"),sendAt:t.scheduledAt}:{kind:"queued",label:"Message waiting to send",glyph:xe("Clock","muted-strong"),...i}:t.unread?{kind:"unread",label:"Unread",glyph:xe("dot","none"),...i}:t.hasDraft?{kind:"draft",label:"Unsubmitted draft",glyph:xe("Edit","muted"),...i}:{kind:"idle",label:"Idle",glyph:xe("ring","muted"),...i}}function W5(e,t){return!(t===null||e.kind==="waits-on-you"||e.kind==="failed"||e.kind==="working"&&e.glyph.spin)}function V5(e,t){let n=new Set;return e.hasPendingInteraction&&n.add("waits-on-you"),or(e)==="error"&&t&&n.add("unread-failed"),aa(e)==="failed"&&n.add("queue-failed"),Xv(e)&&n.add("offline"),Jv(e)&&n.add("working"),t&&n.add("unread"),n}function H5(e){let t=new Set;return e.has("waits-on-you")&&t.add("waits-on-you"),e.has("unread-failed")&&t.add("unread-failed"),t}var tw=new Set(["waits-on-you","unread-failed","queue-failed","offline"]);function F5(e,t){return t?new Set([...e].filter(n=>tw.has(n))):new Set(e)}function Rl(e){return qv.find(t=>e.has(t))??null}function B5(e){let t=la[e].tone;return t==="none"?"working":t}var la={"waits-on-you":{...xe("CircleQuestion","attention"),label:"needs your input"},"unread-failed":{...xe("CircleX","destructive"),label:"failed"},"queue-failed":{...xe("AlertTriangle","destructive"),label:"queued message failed"},offline:{...xe("CloudOff","attention"),label:"machine offline"},working:{...xe("Loading","working",!0),label:"working"},unread:{...xe("dot","none"),label:"unread"}};function Wr(e,t,n){return t||n?!1:e.kind==="idle"||e.kind==="draft"||e.kind==="failed"}var nw=new Set(["waits-on-you","unread-failed","queue-failed","offline","unread"]),rw=new Set(["working","background","queued","scheduled"]),ow=5e3;function U5(e){return!rw.has(e.state.kind)}function iw(e,t){let n=0;return t.has("unread-failed")&&(n=Math.max(n,e.latestAttentionAt)),t.has("queue-failed")&&(n=Math.max(n,e.updatedAt)),n}function K5(e,t,n){if(!t.has("unread-failed")&&!t.has("queue-failed")||!U5(n)||n.idleSince===null)return null;let r=Math.max(n.thread.latestAttentionAt,n.finishedAt??0),o=iw(e,t);return r>o?null:Math.max(o,n.idleSince??0)+ow}function sw(e){let t=ua(e,{unread:!1,hasDraft:!1,scheduledAt:null,now:0});return!U5({thread:e,state:t})}function G5(e,t,n){let r=new Set,o={},i=[];for(let s of t){let a=s.id;sw(s)?r.add(a):e?.busy.has(a)?(o[a]=n,i.push(a)):e?.idleSince[a]!==void 0&&(o[a]=e.idleSince[a])}return{busy:r,idleSince:o,wentIdle:i}}function q5(e,t){let n=new Set;if(t.isRoot||t.mode==="everything"){for(let r of e)nw.has(r)&&n.add(r);return n}return e.has("waits-on-you")&&n.add("waits-on-you"),e.has("offline")&&n.add("offline"),t.orphaned&&(e.has("unread-failed")&&n.add("unread-failed"),e.has("queue-failed")&&n.add("queue-failed")),n}function Y5(e,t){return e.has("waits-on-you")||e.has("unread-failed")?!0:!t&&e.has("queue-failed")}function J5(e,t){let n=new Set,r=new Set;for(let o of e.infos.values())o.thread.isArchived||(o.attentionFlags.has("unread")&&!o.thread.isHidden&&n.add(o.thread.id),Y5(o.attentionFlags,o.parentId===null)&&r.add(o.thread.id));return{activeThreadId:t,unread:n,attentionIds:r}}function X5(e,t){let n=new Map;t.activeThreadId!==null&&t.activeThreadId!==e?.activeThreadId&&n.set(t.activeThreadId,"reveal");for(let r of t.attentionIds)e?.attentionIds.has(r)||n.set(r,"reveal");for(let r of t.unread)r===t.activeThreadId||n.has(r)||e?.unread.has(r)||n.set(r,"open");return n}function Q5(e,t){if(t.size===0)return e;let n=new Map(e);for(let[r,o]of t)n.get(r)!=="reveal"&&n.set(r,o);return n}function e0(e,t){let n=!1,r=new Map;for(let[o,i]of e)t(o)?n=!0:r.set(o,i);return n?r:e}function t0(e,t){let n=$(null),r=$(null),o=$(void 0),[i,s]=A(()=>new Map),a=$(i);a.current=i;let c=i;if(e!==null&&(e!==r.current||t!==o.current)){let l=J5(e,t),d=X5(n.current,l);n.current=l,r.current=e,o.current=t,c=Q5(i,d),c!==i&&(a.current=c,s(c))}let u=N(l=>{let d=e0(a.current,l);d!==a.current&&(a.current=d,s(d))},[]);return{targets:c,prune:u}}var ce={};Nt(ce,{$brand:()=>Bl,$input:()=>gp,$output:()=>hp,INVALID:()=>Qe,NEVER:()=>Fl,TimePrecision:()=>Pp,ZodAny:()=>h2,ZodArray:()=>y2,ZodBase64:()=>au,ZodBase64URL:()=>cu,ZodBigInt:()=>Io,ZodBigIntFormat:()=>du,ZodBoolean:()=>xo,ZodCIDRv4:()=>iu,ZodCIDRv6:()=>su,ZodCUID:()=>Xc,ZodCUID2:()=>Qc,ZodCatch:()=>Z2,ZodCodec:()=>Gi,ZodCompileAsyncError:()=>Wt,ZodCompileUnsupportedError:()=>J,ZodCreditCard:()=>a2,ZodCustom:()=>qi,ZodCustomStringFormat:()=>wr,ZodDate:()=>Vi,ZodDefault:()=>E2,ZodDiscriminatedUnion:()=>v2,ZodE164:()=>uu,ZodEmail:()=>Gc,ZodEmoji:()=>Yc,ZodEnum:()=>bo,ZodError:()=>gS,ZodExactOptional:()=>hu,ZodFile:()=>R2,ZodFirstPartyTypeKind:()=>em,ZodFunction:()=>Y2,ZodGUID:()=>qc,ZodIBAN:()=>c2,ZodIPv4:()=>ru,ZodIPv6:()=>ou,ZodISODate:()=>zn,ZodISODateTime:()=>Nn,ZodISODuration:()=>Zn,ZodISOTime:()=>jn,ZodInstanceOf:()=>Q2,ZodIntersection:()=>w2,ZodIssueCode:()=>yS,ZodJWT:()=>lu,ZodKSUID:()=>nu,ZodLazy:()=>K2,ZodLiteral:()=>M2,ZodMAC:()=>s2,ZodMap:()=>P2,ZodNaN:()=>V2,ZodNanoID:()=>Jc,ZodNever:()=>C2,ZodNonOptional:()=>gu,ZodNull:()=>f2,ZodNullable:()=>$2,ZodNumber:()=>wo,ZodNumberFormat:()=>xr,ZodObject:()=>Fi,ZodOptional:()=>Ui,ZodPipe:()=>Ki,ZodPrefault:()=>O2,ZodPreprocess:()=>H2,ZodPromise:()=>q2,ZodReadonly:()=>F2,ZodRealError:()=>ft,ZodRecord:()=>yo,ZodSet:()=>L2,ZodString:()=>vo,ZodStringFormat:()=>le,ZodSuccess:()=>j2,ZodSymbol:()=>d2,ZodTemplateLiteral:()=>U2,ZodTransform:()=>T2,ZodTuple:()=>I2,ZodType:()=>q,ZodULID:()=>eu,ZodURL:()=>Wi,ZodUUID:()=>en,ZodUndefined:()=>p2,ZodUnion:()=>Bi,ZodUnknown:()=>g2,ZodVoid:()=>k2,ZodXID:()=>tu,ZodXor:()=>b2,_ZodString:()=>Kc,_default:()=>D2,_function:()=>Sg,any:()=>ng,array:()=>Hi,base64:()=>O9,base64url:()=>N9,bigint:()=>J9,boolean:()=>l2,catch:()=>W2,check:()=>_g,cidrv4:()=>E9,cidrv6:()=>D9,clone:()=>ie,codec:()=>vg,coerce:()=>nm,compile:()=>bp,config:()=>ke,core:()=>fn,creditCard:()=>j9,cuid:()=>_9,cuid2:()=>P9,currencyCode:()=>B9,custom:()=>Pg,date:()=>og,decode:()=>Qf,decodeAsync:()=>t2,deepPartial:()=>Zg,describe:()=>Lg,discriminatedUnion:()=>lg,e164:()=>z9,email:()=>g9,emoji:()=>I9,encode:()=>Xf,encodeAsync:()=>e2,endsWith:()=>ao,enum:()=>fu,exactOptional:()=>A2,file:()=>Cg,flattenError:()=>di,float32:()=>K9,float64:()=>G9,formatError:()=>pi,fromJSONSchema:()=>zg,function:()=>Sg,getDiscriminatedOption:()=>H1,getErrorMap:()=>vS,globalRegistry:()=>Ve,gt:()=>Xt,gte:()=>kt,guid:()=>C9,hash:()=>U9,hex:()=>F9,hostname:()=>H9,httpUrl:()=>x9,iban:()=>Z9,includes:()=>io,input:()=>Vg,instanceof:()=>Rg,int:()=>Bc,int32:()=>q9,int64:()=>X9,intersection:()=>x2,invertCodec:()=>wg,ipv4:()=>T9,ipv6:()=>$9,iso:()=>Yi,json:()=>Ag,jwt:()=>W9,keyof:()=>ig,ksuid:()=>R9,lazy:()=>G2,length:()=>Cr,literal:()=>gg,locales:()=>Ti,looseObject:()=>cg,looseRecord:()=>pg,lowercase:()=>ro,lt:()=>Jt,lte:()=>Ct,mac:()=>A9,map:()=>fg,maxLength:()=>gr,maxSize:()=>$n,memoizer:()=>Ri,meta:()=>Mg,mime:()=>uo,minLength:()=>pn,minSize:()=>Qt,multipleOf:()=>An,nan:()=>bg,nanoid:()=>S9,nativeEnum:()=>hg,negative:()=>Ec,never:()=>pu,nonnegative:()=>Oc,nonoptional:()=>z2,nonpositive:()=>Dc,normalize:()=>lo,null:()=>m2,nullable:()=>Zi,nullish:()=>kg,number:()=>u2,object:()=>sg,optional:()=>br,output:()=>Hg,overwrite:()=>Vt,parse:()=>Gf,parseAsync:()=>qf,partialRecord:()=>dg,pipe:()=>Uc,positive:()=>$c,prefault:()=>N2,preprocess:()=>$g,prettifyError:()=>Yl,promise:()=>Ig,properties:()=>co,property:()=>Nc,readonly:()=>B2,record:()=>_2,refine:()=>J2,regex:()=>no,regexes:()=>Mt,registry:()=>cc,safeDecode:()=>r2,safeDecodeAsync:()=>i2,safeEncode:()=>n2,safeEncodeAsync:()=>o2,safeParse:()=>Yf,safeParseAsync:()=>Jf,set:()=>mg,setErrorMap:()=>bS,size:()=>hr,slugify:()=>ho,startsWith:()=>so,strictObject:()=>ag,string:()=>ji,stringFormat:()=>V9,stringbool:()=>Tg,success:()=>yg,superRefine:()=>X2,symbol:()=>eg,templateLiteral:()=>xg,toJSONSchema:()=>Wc,toLowerCase:()=>fo,toUpperCase:()=>mo,toZod:()=>ni,transform:()=>mu,treeifyError:()=>ql,trim:()=>po,tuple:()=>S2,uint32:()=>Y9,uint64:()=>Q9,ulid:()=>L9,undefined:()=>tg,union:()=>So,unknown:()=>yr,uppercase:()=>oo,url:()=>w9,util:()=>j,uuid:()=>k9,uuidv4:()=>y9,uuidv6:()=>b9,uuidv7:()=>v9,validate:()=>fi,validateAsync:()=>mi,void:()=>rg,withParser:()=>uc,xid:()=>M9,xor:()=>ug});var fn={};Nt(fn,{$ZodAny:()=>D1,$ZodArray:()=>Z1,$ZodAsyncError:()=>dt,$ZodBase64:()=>x1,$ZodBase64URL:()=>I1,$ZodBigInt:()=>Ya,$ZodBigIntFormat:()=>T1,$ZodBoolean:()=>Ii,$ZodCIDRv4:()=>v1,$ZodCIDRv6:()=>w1,$ZodCUID:()=>u1,$ZodCUID2:()=>l1,$ZodCatch:()=>ip,$ZodCheck:()=>de,$ZodCheckBigIntFormat:()=>Od,$ZodCheckEndsWith:()=>Gd,$ZodCheckGreaterThan:()=>Ea,$ZodCheckIncludes:()=>Ud,$ZodCheckLengthEquals:()=>Vd,$ZodCheckLessThan:()=>$a,$ZodCheckLowerCase:()=>Fd,$ZodCheckMaxLength:()=>Zd,$ZodCheckMaxSize:()=>Nd,$ZodCheckMimeType:()=>Jd,$ZodCheckMinLength:()=>Wd,$ZodCheckMinSize:()=>zd,$ZodCheckMultipleOf:()=>Ed,$ZodCheckNumberFormat:()=>Dd,$ZodCheckOverwrite:()=>Xd,$ZodCheckProperties:()=>Yd,$ZodCheckProperty:()=>qd,$ZodCheckRegex:()=>Hd,$ZodCheckSizeEquals:()=>jd,$ZodCheckStartsWith:()=>Kd,$ZodCheckStringFormat:()=>Xr,$ZodCheckUpperCase:()=>Bd,$ZodCodec:()=>_i,$ZodCreditCard:()=>_1,$ZodCustom:()=>pp,$ZodCustomStringFormat:()=>M1,$ZodCyclicError:()=>rc,$ZodDate:()=>j1,$ZodDefault:()=>tp,$ZodDiscriminatedUnion:()=>F1,$ZodE164:()=>S1,$ZodEmail:()=>r1,$ZodEmoji:()=>a1,$ZodEncodeError:()=>Tn,$ZodEnum:()=>q1,$ZodError:()=>Gl,$ZodExactOptional:()=>Q1,$ZodFile:()=>J1,$ZodFunction:()=>lp,$ZodGUID:()=>t1,$ZodIBAN:()=>P1,$ZodIPv4:()=>k1,$ZodIPv6:()=>y1,$ZodISODate:()=>h1,$ZodISODateTime:()=>m1,$ZodISODuration:()=>C1,$ZodISOTime:()=>g1,$ZodIntersection:()=>B1,$ZodJWT:()=>L1,$ZodKSUID:()=>f1,$ZodLazy:()=>Pi,$ZodLiteral:()=>Y1,$ZodMAC:()=>b1,$ZodMap:()=>K1,$ZodNaN:()=>sp,$ZodNanoID:()=>c1,$ZodNever:()=>N1,$ZodNonOptional:()=>rp,$ZodNull:()=>E1,$ZodNullable:()=>ep,$ZodNumber:()=>qa,$ZodNumberFormat:()=>R1,$ZodObject:()=>O0,$ZodObjectJIT:()=>W1,$ZodOptional:()=>Xa,$ZodPipe:()=>Qa,$ZodPrefault:()=>np,$ZodPreprocess:()=>ap,$ZodPromise:()=>dp,$ZodReadonly:()=>cp,$ZodRealError:()=>pt,$ZodRecord:()=>U1,$ZodRegistry:()=>ac,$ZodSet:()=>G1,$ZodString:()=>lr,$ZodStringFormat:()=>se,$ZodSuccess:()=>op,$ZodSymbol:()=>A1,$ZodTemplateLiteral:()=>up,$ZodTransform:()=>X1,$ZodTuple:()=>Ja,$ZodType:()=>G,$ZodULID:()=>d1,$ZodURL:()=>s1,$ZodUUID:()=>n1,$ZodUndefined:()=>$1,$ZodUnion:()=>Si,$ZodUnknown:()=>O1,$ZodVoid:()=>z1,$ZodXID:()=>p1,$ZodXor:()=>V1,$brand:()=>Bl,$constructor:()=>k,$input:()=>gp,$output:()=>hp,Doc:()=>ur,INVALID:()=>Qe,JSONSchema:()=>f9,JSONSchemaGenerator:()=>Vc,NEVER:()=>Fl,TimePrecision:()=>Pp,URL_BAD_FORMAT:()=>o1,URL_UNPARSEABLE:()=>yi,ZodCompileAsyncError:()=>Wt,ZodCompileUnsupportedError:()=>J,_any:()=>Fp,_array:()=>Jp,_base64:()=>Mc,_base64url:()=>Rc,_bigint:()=>Np,_boolean:()=>Dp,_catch:()=>oS,_check:()=>J0,_cidrv4:()=>Pc,_cidrv6:()=>Lc,_coercedBigint:()=>zp,_coercedBoolean:()=>Op,_coercedDate:()=>qp,_coercedNumber:()=>Mp,_coercedString:()=>xp,_creditCard:()=>Sp,_cuid:()=>bc,_cuid2:()=>vc,_custom:()=>Qp,_date:()=>Gp,_decode:()=>wa,_decodeAsync:()=>Ia,_default:()=>tS,_discriminatedUnion:()=>HI,_e164:()=>Tc,_email:()=>pc,_emoji:()=>kc,_encode:()=>va,_encodeAsync:()=>xa,_endsWith:()=>ao,_enum:()=>qI,_file:()=>Xp,_float32:()=>Tp,_float64:()=>Ap,_gt:()=>Xt,_gte:()=>kt,_guid:()=>fc,_iban:()=>_p,_includes:()=>io,_int:()=>Rp,_int32:()=>$p,_int64:()=>jp,_intersection:()=>FI,_ipv4:()=>Sc,_ipv6:()=>_c,_isoDate:()=>Ei,_isoDateTime:()=>$i,_isoDuration:()=>Oi,_isoTime:()=>Di,_jwt:()=>Ac,_ksuid:()=>Ic,_lazy:()=>cS,_length:()=>Cr,_literal:()=>JI,_lowercase:()=>ro,_lt:()=>Jt,_lte:()=>Ct,_mac:()=>Ip,_map:()=>KI,_max:()=>Ct,_maxLength:()=>gr,_maxSize:()=>$n,_mime:()=>uo,_min:()=>kt,_minLength:()=>pn,_minSize:()=>Qt,_multipleOf:()=>An,_nan:()=>Yp,_nanoid:()=>yc,_nativeEnum:()=>YI,_negative:()=>Ec,_never:()=>Up,_nonnegative:()=>Oc,_nonoptional:()=>nS,_nonpositive:()=>Dc,_normalize:()=>lo,_null:()=>Hp,_nullable:()=>eS,_number:()=>Lp,_optional:()=>QI,_overwrite:()=>Vt,_parse:()=>Gr,_parseAsync:()=>qr,_pipe:()=>iS,_positive:()=>$c,_promise:()=>uS,_properties:()=>co,_property:()=>Nc,_readonly:()=>sS,_record:()=>UI,_refine:()=>ef,_regex:()=>no,_safeDecode:()=>_a,_safeDecodeAsync:()=>La,_safeEncode:()=>Sa,_safeEncodeAsync:()=>Pa,_safeParse:()=>Yr,_safeParseAsync:()=>Jr,_set:()=>GI,_size:()=>hr,_slugify:()=>ho,_startsWith:()=>so,_string:()=>wp,_stringFormat:()=>kr,_stringbool:()=>of,_success:()=>rS,_superRefine:()=>tf,_symbol:()=>Wp,_templateLiteral:()=>aS,_toLowerCase:()=>fo,_toUpperCase:()=>mo,_transform:()=>XI,_trim:()=>po,_tuple:()=>BI,_uint32:()=>Ep,_uint64:()=>Zp,_ulid:()=>wc,_undefined:()=>Vp,_union:()=>WI,_unknown:()=>Bp,_uppercase:()=>oo,_url:()=>Ai,_uuid:()=>mc,_uuidv4:()=>hc,_uuidv6:()=>gc,_uuidv7:()=>Cc,_void:()=>Kp,_xid:()=>xc,_xor:()=>VI,base64Charset:()=>Fa,base64urlCharset:()=>xi,canParseURL:()=>i1,clone:()=>ie,compile:()=>bp,compileFn:()=>lc,config:()=>ke,createStandardJSONSchemaMethod:()=>go,createToJSONSchemaMethod:()=>af,decode:()=>Jw,decodeAsync:()=>Qw,describe:()=>nf,encode:()=>Yw,encodeAsync:()=>Xw,extractDefs:()=>Dn,finalize:()=>On,flattenError:()=>di,formatError:()=>pi,getDiscriminatedOption:()=>H1,globalConfig:()=>Ee,globalRegistry:()=>Ve,handleUnrepresentable:()=>Pe,initializeContext:()=>En,isBackEdge:()=>ic,isRecursiveSchema:()=>oc,isValidBase64:()=>wi,isValidBase64URL:()=>Ba,isValidCIDRv6:()=>Ha,isValidCreditCard:()=>Ua,isValidIBAN:()=>Ka,isValidIPv6:()=>vi,isValidJWT:()=>Ga,locales:()=>Ti,memoizer:()=>Ri,mergeValues:()=>Qr,meta:()=>rf,parse:()=>ya,parseAsync:()=>ba,parseURLObject:()=>$0,prettifyError:()=>Yl,process:()=>ae,processSchema:()=>ae,regexes:()=>Mt,registry:()=>cc,safeDecode:()=>tx,safeDecodeAsync:()=>rx,safeEncode:()=>ex,safeEncodeAsync:()=>nx,safeParse:()=>Bw,safeParseAsync:()=>Uw,standardProps:()=>ja,stripTabAndNewline:()=>bi,toDotPath:()=>p0,toJSONSchema:()=>Wc,toZod:()=>ni,treeifyError:()=>ql,urlHostnameOk:()=>Wa,urlProtocolOk:()=>Va,util:()=>j,validate:()=>fi,validateAsync:()=>mi,validateURL:()=>Za,version:()=>Qd,withParser:()=>uc});var j={};Nt(j,{BIGINT_FORMAT_RANGES:()=>ai,CONSTANT_CATCH:()=>Ca,Class:()=>$l,NUMBER_FORMAT_RANGES:()=>si,aborted:()=>Xe,allowsEval:()=>Ol,assert:()=>dw,assertEqual:()=>aw,assertIs:()=>uw,assertNever:()=>lw,assertNotEqual:()=>cw,assignProp:()=>We,attachSchema:()=>ga,base64ToUint8Array:()=>s0,base64urlToUint8Array:()=>Rw,cached:()=>Br,captureStackTrace:()=>fa,cleanEnum:()=>Mw,cleanRegex:()=>ln,clone:()=>ie,cloneDef:()=>mw,codePointLength:()=>ar,constantCatch:()=>Vl,createTransparentProxy:()=>bw,defineLazy:()=>El,defineLazyInternal:()=>Y,derived:()=>Ew,esc:()=>Je,escapeRegex:()=>Lt,explicitlyAborted:()=>jl,extend:()=>xw,finalizeIssue:()=>lt,floatSafeRemainder:()=>ri,getElementAtPath:()=>hw,getEnumValues:()=>Hr,getLengthableOrigin:()=>ui,getParsedType:()=>yw,getSizableOrigin:()=>ci,hexToUint8Array:()=>Aw,hide:()=>li,installLazyProp:()=>zw,isObject:()=>sr,isPlainObject:()=>Pt,issue:()=>Kr,joinValues:()=>da,jsonStringifyReplacer:()=>Fr,members:()=>Wl,merge:()=>Sw,mergeDefs:()=>Zt,normalizeParams:()=>P,nullish:()=>pa,numKeys:()=>kw,objectClone:()=>pw,omit:()=>ww,optionalKeys:()=>zl,own:()=>Rn,parsedType:()=>Zl,partial:()=>_w,pick:()=>vw,prefixIssues:()=>ut,primitiveTypes:()=>Nl,promiseAllObject:()=>gw,propertyKeyTypes:()=>ii,randomString:()=>Cw,rawShape:()=>Ur,required:()=>Pw,safeExtend:()=>Iw,shallowClone:()=>oi,slugify:()=>Dl,stringifyPrimitive:()=>ma,toZod:()=>ni,uint8ArrayToBase64:()=>a0,uint8ArrayToBase64url:()=>Tw,uint8ArrayToHex:()=>$w,unwrapMessage:()=>Vr});function aw(e){return e}function cw(e){return e}function ni(){return e=>e}function uw(e){}function lw(e){throw new Error("Unexpected value in exhaustive check")}function dw(e){}function Hr(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function da(e,t="|"){return e.map(n=>ma(n)).join(t)}function Fr(e,t){return typeof t=="bigint"?t.toString():t}var Al=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Br(e){return new Al(e)}function pa(e){return e==null}function ln(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ri(e,t){let n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}var n0=Symbol("evaluating");function El(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==n0)return r===void 0&&(r=n0,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function pw(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function We(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ur(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function un(e){return Ur(e._zod.def)??e._zod.def.shape}function r0(e,t,n){Object.defineProperty(e,t,{get(){let r=n();return We(this,t,r),r},enumerable:!0,configurable:!0})}function o0(e,t,n){t in e?We(e,t,n):e[t]=n}function ir(e,t,n,r){let o=un(t);for(let i of n){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?r0(e,i,()=>{let a=t._zod.def.shape[i];return r?r(a,i):a}):o0(e,i,r?r(s.value,i):s.value))}}function fw(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?r0(e,n,()=>t[n]):o0(e,n,r.value))}}function Zt(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function mw(e){return Zt(e._zod.def)}function hw(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function gw(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=r[i];return o})}function Cw(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function Je(e){return JSON.stringify(e)}function Dl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ol=Br(()=>{if(Ee.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pt(e){if(sr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(sr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function oi(e){return Pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function kw(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var yw=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ii=new Set(["string","number","symbol"]),Nl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ie(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function P(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bw(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,i){return t??(t=e()),Reflect.set(t,r,o,i)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function ma(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zl(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var si={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ai={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function vw(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return ir(i,e,ha(e,t)),ie(e,Zt(n,{shape:i,checks:[]}))}function ha(e,t){let n=un(e),r=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&r.push(o)}return r}function ww(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ha(e,t)),s={};return ir(s,e,Reflect.ownKeys(un(e)).filter(a=>!i.has(a))),ie(e,Zt(n,{shape:s,checks:[]}))}function xw(e,t){if(!Pt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=un(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ie(e,Zt(e._zod.def,{shape:i0(e,t)}))}function i0(e,t){let n={};return ir(n,e,Reflect.ownKeys(un(e))),fw(n,t),n}function Iw(e,t){if(!Pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ie(e,Zt(e._zod.def,{shape:i0(e,t)}))}function Sw(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};ir(n,e,Reflect.ownKeys(un(e))),ir(n,t,Reflect.ownKeys(un(t)));let r=Zt(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ie(e,r)}function _w(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(ha(t,n)):void 0,c={};return ir(c,t,Reflect.ownKeys(un(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),ie(t,Zt(t._zod.def,{shape:c,checks:[]}))}function Pw(e,t,n){let r=n?new Set(ha(t,n)):void 0,o={};return ir(o,t,Reflect.ownKeys(un(t)),(i,s)=>r&&!r.has(s)?i:new e({type:"nonoptional",innerType:i})),ie(t,Zt(t._zod.def,{shape:o}))}function Xe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function jl(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ut(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Vr(e){return typeof e=="string"?e:e?.message}function ga(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function lt(e,t,n){var r;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Vr(e.inst?._zod.def?.error?.(e))??Vr(i?.(e))??Vr(t?.error?.(e))??Vr(n.customError?.(e))??Vr(n.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function ci(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Lw=/[\uD800-\uDBFF]/;function ar(e){let t=e.length;if(!Lw.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function ui(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Zl(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Kr(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function Mw(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function s0(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function a0(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Rw(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return s0(t+n)}function Tw(e){return a0(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Aw(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function $w(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var $l=class{constructor(...t){}};function Wl(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Dw(e,n,r.value)}}function Rn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function li(e,t,n){return Rn(e,t,n,!1)}function Ew(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Rn(this,n,r(this))},set(o){Rn(this,n,o)}})}return t}function Dw(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Rn(this,t,n.bind(this))},set(r){Rn(this,t,r)}})}function Ow(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Tl,Mn=!1,Nw={configurable:!0,get(){Mn=!0}};function Y(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Tl!==e._zod){Tl=void 0;return}Tl=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Nw);let o=Mn;Mn=!1;try{let i=n(this);return Mn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),Mn=Mn||o,i}catch(i){throw delete this[t],Mn=Mn||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function zw(e,t,n,r){let o=Ow(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}var Ca="~constantCatch";function Vl(e){let t=()=>e;return t[Ca]=!0,t}var c0,Fl=Object.freeze({status:"aborted"}),Hl={value:void 0,enumerable:!1},u0="captureStackTrace"in Error?Error:null;function jw(e){let t=u0;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return u0=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let o={};function i(m){this.def=m,this.constr=d,this.traits=new Set}i.prototype=o;let s=n,a=s&&new WeakSet;function c(m,p){if(m._zod){if(m._zod.traits.has(e))return}else{Hl.value=new i(p);try{Object.defineProperty(m,"_zod",Hl)}finally{Hl.value=void 0}}if(m._zod.traits.add(e),t(m,p),a){let g=Object.getPrototypeOf(m),C=m._zod.constr.prototype,w=g;for(;w&&w!==C;)w=Object.getPrototypeOf(w);let y=w??g;a.has(y)||(a.add(y),Wl(y,s))}let h=d.prototype;for(let g in h)Object.prototype.hasOwnProperty.call(h,g)&&(g in m||(m[g]=h[g].bind(m)))}let u=r?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(m){let p=r?.Parent?jw(l):this;c(p,m);let h=p._zod.deferred;if(h){for(let C of h)C();p._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Bl=Symbol("zod_brand"),dt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Tn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(c0=globalThis).__zod_globalConfig??(c0.__zod_globalConfig={});var Ee=globalThis.__zod_globalConfig;function ke(e){return e&&Object.assign(Ee,e),Ee}function Zw(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Fr,2)),e.message}function Ww(e){this._zod.message=e}var Vw={get:Zw,set:Ww,enumerable:!0,configurable:!0},Kl={value:void 0,enumerable:!1},l0=new WeakSet([Object.prototype,Error.prototype]),d0=(e,t)=>{e.name="$ZodError",Kl.value=t,Object.defineProperty(e,"issues",Kl),Kl.value=void 0,Object.defineProperty(e,"message",Vw);let n=Object.getPrototypeOf(e);l0.has(n)||(l0.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},Gl=k("$ZodError",d0),pt=k("$ZodError",d0,void 0,{Parent:Error});function Hw(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function di(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?Hw(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function pi(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,u=0;for(;u<a.length;){let l=a[u],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];d&&m._errors.push(t(s)),c=m,u++}}}};return r(e),n}function ql(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>r({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{let c=[...i,...a.path];if(c.length===0){n.errors.push(t(a));continue}let u=n,l=0;for(;l<c.length;){let d=c[l],m=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(s=u.items)[d]??(s[d]={errors:[]}),u=u.items[d]),m&&u.errors.push(t(a)),l++}}};return r(e),n}function p0(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function Yl(e){let t=[],n=[...e.issues].sort((r,o)=>(r.path??[]).length-(o.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${p0(r.path)}`);return t.join(`
|
|
5
|
+
`},ib={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function sb(e){let{announcements:t=ib,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=ob}=e,{announce:i,announcement:s}=Uh(),a=Fo("DndLiveRegion"),[c,u]=A(!1);if(D(()=>{u(!0)},[]),nb(K(()=>({onDragStart(d){let{active:m}=d;i(t.onDragStart({active:m}))},onDragMove(d){let{active:m,over:p}=d;t.onDragMove&&i(t.onDragMove({active:m,over:p}))},onDragOver(d){let{active:m,over:p}=d;i(t.onDragOver({active:m,over:p}))},onDragEnd(d){let{active:m,over:p}=d;i(t.onDragEnd({active:m,over:p}))},onDragCancel(d){let{active:m,over:p}=d;i(t.onDragCancel({active:m,over:p}))}}),[i,t])),!c)return null;let l=Ge.createElement(Ge.Fragment,null,Ge.createElement(Fh,{id:r,value:o.draggable}),Ge.createElement(Bh,{id:a,announcement:s}));return n?Rs(l,n):l}var _e;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(_e||(_e={}));function Ns(){}function Zs(e,t){return K(()=>({sensor:e,options:t??{}}),[e,t])}function o5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return K(()=>[...t].filter(r=>r!=null),[...t])}var zt=Object.freeze({x:0,y:0});function ab(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function cb(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ub(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function lb(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function db(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function pb(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){let c=t.width*t.height,u=e.width*e.height,l=s*a,d=l/(c+u-l);return Number(d.toFixed(4))}return 0}var fb=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,o=[];for(let i of r){let{id:s}=i,a=n.get(s);if(a){let c=pb(a,t);c>0&&o.push({id:s,data:{droppableContainer:i,value:c}})}}return o.sort(ub)};function mb(e,t){let{top:n,left:r,bottom:o,right:i}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=i}var i5=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];let o=[];for(let i of t){let{id:s}=i,a=n.get(s);if(a&&mb(r,a)){let u=lb(a).reduce((d,m)=>d+ab(r,m),0),l=Number((u/4).toFixed(4));o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(cb)};function hb(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function s5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:zt}function gb(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}var Cb=gb(1);function kb(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function yb(e,t,n){let r=kb(t);if(!r)return e;let{scaleX:o,scaleY:i,x:s,y:a}=r,c=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),l=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:l,height:d,top:u,right:c+l,bottom:u+d,left:c}}var bb={ignoreTransform:!1};function Xo(e,t){t===void 0&&(t=bb);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:u,transformOrigin:l}=qe(e).getComputedStyle(e);u&&(n=yb(n,u,l))}let{top:r,left:o,width:i,height:s,bottom:a,right:c}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:c}}function Kh(e){return Xo(e,{ignoreTransform:!0})}function vb(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function wb(e,t){return t===void 0&&(t=qe(e).getComputedStyle(e)),t.position==="fixed"}function xb(e,t){t===void 0&&(t=qe(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{let i=t[o];return typeof i=="string"?n.test(i):!1})}function fl(e,t){let n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(As(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Er(o)||il(o)||n.includes(o))return n;let i=qe(e).getComputedStyle(o);return o!==e&&xb(o,i)&&n.push(o),wb(o,i)?n:r(o.parentNode)}return e?r(e):n}function a5(e){let[t]=fl(e,1);return t??null}function al(e){return!Vo||!e?null:Xn(e)?e:Ts(e)?As(e)||e===Qn(e).scrollingElement?window:Er(e)?e:null:null}function c5(e){return Xn(e)?e.scrollX:e.scrollLeft}function u5(e){return Xn(e)?e.scrollY:e.scrollTop}function ll(e){return{x:c5(e),y:u5(e)}}var Ae;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ae||(Ae={}));function l5(e){return!Vo||!e?!1:e===document.scrollingElement}function d5(e){let t={x:0,y:0},n=l5(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}var Ib={x:.2,y:.2};function Sb(e,t,n,r,o){let{top:i,left:s,right:a,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=Ib);let{isTop:u,isBottom:l,isLeft:d,isRight:m}=d5(e),p={x:0,y:0},h={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+g.height?(p.y=Ae.Backward,h.y=r*Math.abs((t.top+g.height-i)/g.height)):!l&&c>=t.bottom-g.height&&(p.y=Ae.Forward,h.y=r*Math.abs((t.bottom-g.height-c)/g.height)),!m&&a>=t.right-g.width?(p.x=Ae.Forward,h.x=r*Math.abs((t.right-g.width-a)/g.width)):!d&&s<=t.left+g.width&&(p.x=Ae.Backward,h.x=r*Math.abs((t.left+g.width-s)/g.width)),{direction:p,speed:h}}function _b(e){if(e===document.scrollingElement){let{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}let{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function p5(e){return e.reduce((t,n)=>er(t,ll(n)),zt)}function Pb(e){return e.reduce((t,n)=>t+c5(n),0)}function Lb(e){return e.reduce((t,n)=>t+u5(n),0)}function Mb(e,t){if(t===void 0&&(t=Xo),!e)return;let{top:n,left:r,bottom:o,right:i}=t(e);a5(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}var Rb=[["x",["left","right"],Pb],["y",["top","bottom"],Lb]],Ko=class{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let r=fl(n),o=p5(r);this.rect={...t},this.width=t.width,this.height=t.height;for(let[i,s,a]of Rb)for(let c of s)Object.defineProperty(this,c,{get:()=>{let u=a(r),l=o[i]-u;return this.rect[c]+l},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},tr=class{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}};function Tb(e){let{EventTarget:t}=qe(e);return e instanceof t?e:Qn(e)}function cl(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var St;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(St||(St={}));function Gh(e){e.preventDefault()}function Ab(e){e.stopPropagation()}var pe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(pe||(pe={}));var f5={start:[pe.Space,pe.Enter],cancel:[pe.Esc],end:[pe.Space,pe.Enter,pe.Tab]},$b=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case pe.Right:return{...n,x:n.x+25};case pe.Left:return{...n,x:n.x-25};case pe.Down:return{...n,y:n.y+25};case pe.Up:return{...n,y:n.y-25}}},Nr=class{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:n}}=t;this.props=t,this.listeners=new tr(Qn(n)),this.windowListeners=new tr(qe(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(St.Resize,this.handleCancel),this.windowListeners.add(St.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(St.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Mb(r),n(zt)}handleKeyDown(t){if(sl(t)){let{active:n,context:r,options:o}=this.props,{keyboardCodes:i=f5,coordinateGetter:s=$b,scrollBehavior:a="smooth"}=o,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}let{collisionRect:u}=r.current,l=u?{x:u.left,y:u.top}:zt;this.referenceCoordinates||(this.referenceCoordinates=l);let d=s(t,{active:n,context:r.current,currentCoordinates:l});if(d){let m=Bo(d,l),p={x:0,y:0},{scrollableAncestors:h}=r.current;for(let g of h){let C=t.code,{isTop:w,isRight:y,isLeft:S,isBottom:T,maxScroll:L,minScroll:M}=d5(g),E=_b(g),B={x:Math.min(C===pe.Right?E.right-E.width/2:E.right,Math.max(C===pe.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(C===pe.Down?E.bottom-E.height/2:E.bottom,Math.max(C===pe.Down?E.top:E.top+E.height/2,d.y))},X=C===pe.Right&&!y||C===pe.Left&&!S,oe=C===pe.Down&&!T||C===pe.Up&&!w;if(X&&B.x!==d.x){let ee=g.scrollLeft+m.x,Z=C===pe.Right&&ee<=L.x||C===pe.Left&&ee>=M.x;if(Z&&!m.y){g.scrollTo({left:ee,behavior:a});return}Z?p.x=g.scrollLeft-ee:p.x=C===pe.Right?g.scrollLeft-L.x:g.scrollLeft-M.x,p.x&&g.scrollBy({left:-p.x,behavior:a});break}else if(oe&&B.y!==d.y){let ee=g.scrollTop+m.y,Z=C===pe.Down&&ee<=L.y||C===pe.Up&&ee>=M.y;if(Z&&!m.x){g.scrollTo({top:ee,behavior:a});return}Z?p.y=g.scrollTop-ee:p.y=C===pe.Down?g.scrollTop-L.y:g.scrollTop-M.y,p.y&&g.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,er(Bo(d,this.referenceCoordinates),p))}}}handleMove(t,n){let{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){let{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){let{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Nr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=f5,onActivation:o}=t,{active:i}=n,{code:s}=e.nativeEvent;if(r.start.includes(s)){let a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function qh(e){return!!(e&&"distance"in e)}function Yh(e){return!!(e&&"delay"in e)}var Go=class{constructor(t,n,r){var o;r===void 0&&(r=Tb(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;let{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=Qn(s),this.documentListeners=new tr(this.document),this.listeners=new tr(r),this.windowListeners=new tr(qe(s)),this.initialCoordinates=(o=Ds(i))!=null?o:zt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(St.Resize,this.handleCancel),this.windowListeners.add(St.DragStart,Gh),this.windowListeners.add(St.VisibilityChange,this.handleCancel),this.windowListeners.add(St.ContextMenu,Gh),this.documentListeners.add(St.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Yh(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(qh(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){let{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){let{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(St.Click,Ab,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(St.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;let{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;let c=(n=Ds(t))!=null?n:zt,u=Bo(o,c);if(!r&&a){if(qh(a)){if(a.tolerance!=null&&cl(u,a.tolerance))return this.handleCancel();if(cl(u,a.distance))return this.handleStart()}if(Yh(a)&&cl(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(c)}handleEnd(){let{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){let{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===pe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}},Eb={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},zs=class extends Go{constructor(t){let{event:n}=t,r=Qn(n.target);super(t,Eb,r)}};zs.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Db={move:{name:"mousemove"},end:{name:"mouseup"}},dl;(function(e){e[e.RightClick=2]="RightClick"})(dl||(dl={}));var qo=class extends Go{constructor(t){super(t,Db,Qn(t.event.target))}};qo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===dl.RightClick?!1:(r?.({event:n}),!0)}}];var ul={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},Yo=class extends Go{constructor(t){super(t,ul)}static setup(){return window.addEventListener(ul.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ul.move.name,t)};function t(){}}};Yo.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Uo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Uo||(Uo={}));var js;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(js||(js={}));function Ob(e){let{acceleration:t,activator:n=Uo.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=js.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:l,delta:d,threshold:m}=e,p=zb({delta:d,disabled:!i}),[h,g]=Wh(),C=$({x:0,y:0}),w=$({x:0,y:0}),y=K(()=>{switch(n){case Uo.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Uo.DraggableRect:return o}},[n,o,c]),S=$(null),T=N(()=>{let M=S.current;if(!M)return;let E=C.current.x*w.current.x,B=C.current.y*w.current.y;M.scrollBy(E,B)},[]),L=K(()=>a===js.TreeOrder?[...u].reverse():u,[a,u]);D(()=>{if(!i||!u.length||!y){g();return}for(let M of L){if(r?.(M)===!1)continue;let E=u.indexOf(M),B=l[E];if(!B)continue;let{direction:X,speed:oe}=Sb(M,B,y,t,m);for(let ee of["x","y"])p[ee][X[ee]]||(oe[ee]=0,X[ee]=0);if(oe.x>0||oe.y>0){g(),S.current=M,h(T,s),C.current=oe,w.current=X;return}}C.current={x:0,y:0},w.current={x:0,y:0},g()},[t,T,r,g,i,s,JSON.stringify(y),JSON.stringify(p),h,u,L,l,JSON.stringify(m)])}var Nb={x:{[Ae.Backward]:!1,[Ae.Forward]:!1},y:{[Ae.Backward]:!1,[Ae.Forward]:!1}};function zb(e){let{delta:t,disabled:n}=e,r=Es(t);return Or(o=>{if(n||!r||!o)return Nb;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ae.Backward]:o.x[Ae.Backward]||i.x===-1,[Ae.Forward]:o.x[Ae.Forward]||i.x===1},y:{[Ae.Backward]:o.y[Ae.Backward]||i.y===-1,[Ae.Forward]:o.y[Ae.Forward]||i.y===1}}},[n,t,r])}function jb(e,t){let n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Or(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function Zb(e,t){return K(()=>e.reduce((n,r)=>{let{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var Jo;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Jo||(Jo={}));var pl;(function(e){e.Optimized="optimized"})(pl||(pl={}));var Jh=new Map;function Wb(e,t){let{dragging:n,dependencies:r,config:o}=t,[i,s]=A(null),{frequency:a,measure:c,strategy:u}=o,l=$(e),d=C(),m=Dr(d),p=N(function(w){w===void 0&&(w=[]),!m.current&&s(y=>y===null?w:y.concat(w.filter(S=>!y.includes(S))))},[m]),h=$(null),g=Or(w=>{if(d&&!n)return Jh;if(!w||w===Jh||l.current!==e||i!=null){let y=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){y.set(S.id,S.rect.current);continue}let T=S.node.current,L=T?new Ko(c(T),T):null;S.rect.current=L,L&&y.set(S.id,L)}return y}return w},[e,i,n,d,c]);return D(()=>{l.current=e},[e]),D(()=>{d||p()},[n,d]),D(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),D(()=>{d||typeof a!="number"||h.current!==null||(h.current=setTimeout(()=>{p(),h.current=null},a))},[a,d,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:i!=null};function C(){switch(u){case Jo.Always:return!1;case Jo.BeforeDragging:return n;default:return!n}}}function m5(e,t){return Or(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Vb(e,t){return m5(e,t)}function Hb(e){let{callback:t,disabled:n}=e,r=$s(t),o=K(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(r)},[r,n]);return D(()=>()=>o?.disconnect(),[o]),o}function Ws(e){let{callback:t,disabled:n}=e,r=$s(t),o=K(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(r)},[n]);return D(()=>()=>o?.disconnect(),[o]),o}function Fb(e){return new Ko(Xo(e),e)}function Xh(e,t,n){t===void 0&&(t=Fb);let[r,o]=A(null);function i(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}let l=t(e);return JSON.stringify(c)===JSON.stringify(l)?c:l})}let s=Hb({callback(c){if(e)for(let u of c){let{type:l,target:d}=u;if(l==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=Ws({callback:i});return an(()=>{i(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function Bb(e){let t=m5(e);return s5(e,t)}var Qh=[];function Ub(e){let t=$(e),n=Or(r=>e?r&&r!==Qh&&e&&t.current&&e.parentNode===t.current.parentNode?r:fl(e):Qh,[e]);return D(()=>{t.current=e},[e]),n}function Kb(e){let[t,n]=A(null),r=$(e),o=N(i=>{let s=al(i.target);s&&n(a=>a?(a.set(s,ll(s)),new Map(a)):null)},[]);return D(()=>{let i=r.current;if(e!==i){s(i);let a=e.map(c=>{let u=al(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,ll(u)]):null}).filter(c=>c!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(c=>{let u=al(c);u?.removeEventListener("scroll",o)})}},[o,e]),K(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>er(i,s),zt):p5(e):zt,[e,t])}function e5(e,t){t===void 0&&(t=[]);let n=$(null);return D(()=>{n.current=null},t),D(()=>{let r=e!==zt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Bo(e,n.current):zt}function Gb(e){D(()=>{if(!Vo)return;let t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(let n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function qb(e,t){return K(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function h5(e){return K(()=>e?vb(e):null,[e])}var t5=[];function Yb(e,t){t===void 0&&(t=Xo);let[n]=e,r=h5(n?qe(n):null),[o,i]=A(t5);function s(){i(()=>e.length?e.map(c=>l5(c)?r:new Ko(t(c),c)):t5)}let a=Ws({callback:s});return an(()=>{a?.disconnect(),s(),e.forEach(c=>a?.observe(c))},[e]),o}function Jb(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return Er(t)?t:e}function Xb(e){let{measure:t}=e,[n,r]=A(null),o=N(u=>{for(let{target:l}of u)if(Er(l)){r(d=>{let m=t(l);return d?{...d,width:m.width,height:m.height}:m});break}},[t]),i=Ws({callback:o}),s=N(u=>{let l=Jb(u);i?.disconnect(),l&&i?.observe(l),r(l?t(l):null)},[t,i]),[a,c]=Ho(s);return K(()=>({nodeRef:a,rect:n,setRef:c}),[n,a,c])}var Qb=[{sensor:zs,options:{}},{sensor:Nr,options:{}}],ev={current:{}},Os={draggable:{measure:Kh},droppable:{measure:Kh,strategy:Jo.WhileDragging,frequency:pl.Optimized},dragOverlay:{measure:Xo}},nr=class extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}},tv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new nr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ns},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Os,measureDroppableContainers:Ns,windowRect:null,measuringScheduled:!1},nv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ns,draggableNodes:new Map,over:null,measureDroppableContainers:Ns},Vs=be(nv),rv=be(tv);function ov(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new nr}}}function iv(e,t){switch(t.type){case _e.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case _e.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case _e.DragEnd:case _e.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case _e.RegisterDroppable:{let{element:n}=t,{id:r}=n,o=new nr(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case _e.SetDroppableDisabled:{let{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let s=new nr(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case _e.UnregisterDroppable:{let{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;let i=new nr(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function sv(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:o}=ve(Vs),i=Es(r),s=Es(n?.id);return D(()=>{if(!t&&!r&&i&&s!=null){if(!sl(i)||document.activeElement===i.target)return;let a=o.get(s);if(!a)return;let{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(let l of[c.current,u.current]){if(!l)continue;let d=Hh(l);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function av(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function cv(e){return K(()=>({draggable:{...Os.draggable,...e?.draggable},droppable:{...Os.droppable,...e?.droppable},dragOverlay:{...Os.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function uv(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e,i=$(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;an(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;let u=t?.node.current;if(!u||u.isConnected===!1)return;let l=n(u),d=s5(l,r);if(s||(d.x=0),a||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){let m=a5(u);m&&m.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}var g5=be({...zt,scaleX:1,scaleY:1}),Sn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Sn||(Sn={}));var C5=st(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:c=!0,children:u,sensors:l=Qb,collisionDetection:d=fb,measuring:m,modifiers:p,...h}=t,g=nl(iv,void 0,ov),[C,w]=g,[y,S]=rb(),[T,L]=A(Sn.Uninitialized),M=T===Sn.Initialized,{draggable:{active:E,nodes:B,translate:X},droppable:{containers:oe}}=C,ee=E!=null?B.get(E):null,Z=$({initial:null,translated:null}),ne=K(()=>{var Se;return E!=null?{id:E,data:(Se=ee?.data)!=null?Se:ev,rect:Z}:null},[E,ee]),Q=$(null),[ge,yt]=A(null),[Ke,gn]=A(null),nt=Dr(h,Object.values(h)),bt=Fo("DndDescribedBy",s),Cn=K(()=>oe.getEnabled(),[oe]),Oe=cv(m),{droppableRects:rt,measureDroppableContainers:Bt,measuringScheduled:Bn}=Wb(Cn,{dragging:M,dependencies:[X.x,X.y],config:Oe.droppable}),He=jb(B,E),Pr=K(()=>Ke?Ds(Ke):null,[Ke]),Un=Xu(),ot=Vb(He,Oe.draggable.measure);uv({activeNode:E!=null?B.get(E):null,config:Un.layoutShiftCompensation,initialRect:ot,measure:Oe.draggable.measure});let we=Xh(He,Oe.draggable.measure,ot),kn=Xh(He?He.parentElement:null),me=$({activatorEvent:null,active:null,activeNode:He,collisionRect:null,collisions:null,droppableRects:rt,draggableNodes:B,draggingNode:null,draggingNodeRect:null,droppableContainers:oe,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Kn=oe.getNodeFor((n=me.current.over)==null?void 0:n.id),Ne=Xb({measure:Oe.dragOverlay.measure}),vt=(r=Ne.nodeRef.current)!=null?r:He,wt=M?(o=Ne.rect)!=null?o:we:null,Me=!!(Ne.nodeRef.current&&Ne.rect),xt=Bb(Me?null:we),rn=h5(vt?qe(vt):null),re=Ub(M?Kn??He:null),Ut=Yb(re),Kt=av(p,{transform:{x:X.x-xt.x,y:X.y-xt.y,scaleX:1,scaleY:1},activatorEvent:Ke,active:ne,activeNodeRect:we,containerNodeRect:kn,draggingNodeRect:wt,over:me.current.over,overlayNodeRect:Ne.rect,scrollableAncestors:re,scrollableAncestorRects:Ut,windowRect:rn}),W=Pr?er(Pr,X):null,ze=Kb(re),Do=e5(ze),vs=e5(ze,[we]),At=er(Kt,Do),on=wt?Cb(wt,Kt):null,yn=ne&&on?d({active:ne,collisionRect:on,droppableRects:rt,droppableContainers:Cn,pointerCoordinates:W}):null,te=db(yn,"id"),[$t,Oo]=A(null),ws=Me?Kt:er(Kt,vs),bn=hb(ws,(i=$t?.rect)!=null?i:null,we),Gn=$(null),No=N((Se,Be)=>{let{sensor:Re,options:Gt}=Be;if(Q.current==null)return;let it=B.get(Q.current);if(!it)return;let je=Se.nativeEvent,It=new Re({active:Q.current,activeNode:it,event:je,options:Gt,context:me,onAbort(Ce){if(!B.get(Ce))return;let{onDragAbort:mt}=nt.current,Dt={id:Ce};mt?.(Dt),y({type:"onDragAbort",event:Dt})},onPending(Ce,qt,mt,Dt){if(!B.get(Ce))return;let{onDragPending:Yn}=nt.current,Te={id:Ce,constraint:qt,initialCoordinates:mt,offset:Dt};Yn?.(Te),y({type:"onDragPending",event:Te})},onStart(Ce){let qt=Q.current;if(qt==null)return;let mt=B.get(qt);if(!mt)return;let{onDragStart:Dt}=nt.current,qn={activatorEvent:je,active:{id:qt,data:mt.data,rect:Z}};Wo(()=>{Dt?.(qn),L(Sn.Initializing),w({type:_e.DragStart,initialCoordinates:Ce,active:qt}),y({type:"onDragStart",event:qn}),yt(Gn.current),gn(je)})},onMove(Ce){w({type:_e.DragMove,coordinates:Ce})},onEnd:Et(_e.DragEnd),onCancel:Et(_e.DragCancel)});Gn.current=It;function Et(Ce){return async function(){let{active:mt,collisions:Dt,over:qn,scrollAdjustedTranslate:Yn}=me.current,Te=null;if(mt&&Yn){let{cancelDrop:ht}=nt.current;Te={activatorEvent:je,active:mt,collisions:Dt,delta:Yn,over:qn},Ce===_e.DragEnd&&typeof ht=="function"&&await Promise.resolve(ht(Te))&&(Ce=_e.DragCancel)}Q.current=null,Wo(()=>{w({type:Ce}),L(Sn.Uninitialized),Oo(null),yt(null),gn(null),Gn.current=null;let ht=Ce===_e.DragEnd?"onDragEnd":"onDragCancel";if(Te){let Ot=nt.current[ht];Ot?.(Te),y({type:ht,event:Te})}})}}},[B]),Fe=N((Se,Be)=>(Re,Gt)=>{let it=Re.nativeEvent,je=B.get(Gt);if(Q.current!==null||!je||it.dndKit||it.defaultPrevented)return;let It={active:je};Se(Re,Be.options,It)===!0&&(it.dndKit={capturedBy:Be.sensor},Q.current=Gt,No(Re,Be))},[B,No]),zo=Zb(l,Fe);Gb(l),an(()=>{we&&T===Sn.Initializing&&L(Sn.Initialized)},[we,T]),D(()=>{let{onDragMove:Se}=nt.current,{active:Be,activatorEvent:Re,collisions:Gt,over:it}=me.current;if(!Be||!Re)return;let je={active:Be,activatorEvent:Re,collisions:Gt,delta:{x:At.x,y:At.y},over:it};Wo(()=>{Se?.(je),y({type:"onDragMove",event:je})})},[At.x,At.y]),D(()=>{let{active:Se,activatorEvent:Be,collisions:Re,droppableContainers:Gt,scrollAdjustedTranslate:it}=me.current;if(!Se||Q.current==null||!Be||!it)return;let{onDragOver:je}=nt.current,It=Gt.get(te),Et=It&&It.rect.current?{id:It.id,rect:It.rect.current,data:It.data,disabled:It.disabled}:null,Ce={active:Se,activatorEvent:Be,collisions:Re,delta:{x:it.x,y:it.y},over:Et};Wo(()=>{Oo(Et),je?.(Ce),y({type:"onDragOver",event:Ce})})},[te]),an(()=>{me.current={activatorEvent:Ke,active:ne,activeNode:He,collisionRect:on,collisions:yn,droppableRects:rt,draggableNodes:B,draggingNode:vt,draggingNodeRect:wt,droppableContainers:oe,over:$t,scrollableAncestors:re,scrollAdjustedTranslate:At},Z.current={initial:wt,translated:on}},[ne,He,yn,on,B,vt,wt,rt,oe,$t,re,At]),Ob({...Un,delta:X,draggingRect:on,pointerCoordinates:W,scrollableAncestors:re,scrollableAncestorRects:Ut});let Lr=K(()=>({active:ne,activeNode:He,activeNodeRect:we,activatorEvent:Ke,collisions:yn,containerNodeRect:kn,dragOverlay:Ne,draggableNodes:B,droppableContainers:oe,droppableRects:rt,over:$t,measureDroppableContainers:Bt,scrollableAncestors:re,scrollableAncestorRects:Ut,measuringConfiguration:Oe,measuringScheduled:Bn,windowRect:rn}),[ne,He,we,Ke,yn,kn,Ne,B,oe,rt,$t,Bt,re,Ut,Oe,Bn,rn]),Mr=K(()=>({activatorEvent:Ke,activators:zo,active:ne,activeNodeRect:we,ariaDescribedById:{draggable:bt},dispatch:w,draggableNodes:B,over:$t,measureDroppableContainers:Bt}),[Ke,zo,ne,we,w,bt,B,$t,Bt]);return Ge.createElement(r5.Provider,{value:S},Ge.createElement(Vs.Provider,{value:Mr},Ge.createElement(rv.Provider,{value:Lr},Ge.createElement(g5.Provider,{value:bn},u)),Ge.createElement(sv,{disabled:a?.restoreFocus===!1})),Ge.createElement(sb,{...a,hiddenTextDescribedById:bt}));function Xu(){let Se=ge?.autoScrollEnabled===!1,Be=typeof c=="object"?c.enabled===!1:c===!1,Re=M&&!Se&&!Be;return typeof c=="object"?{...c,enabled:Re}:{enabled:Re}}}),lv=be(null),n5="button",dv="Draggable";function Hs(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e,i=Fo(dv),{activators:s,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:l,draggableNodes:d,over:m}=ve(Vs),{role:p=n5,roleDescription:h="draggable",tabIndex:g=0}=o??{},C=c?.id===t,w=ve(C?g5:lv),[y,S]=Ho(),[T,L]=Ho(),M=qb(s,t),E=Dr(n);an(()=>(d.set(t,{id:t,key:i,node:y,activatorNode:T,data:E}),()=>{let X=d.get(t);X&&X.key===i&&d.delete(t)}),[d,t]);let B=K(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":C&&p===n5?!0:void 0,"aria-roledescription":h,"aria-describedby":l.draggable}),[r,p,g,C,h,l.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:B,isDragging:C,listeners:r?void 0:M,node:y,over:m,setNodeRef:S,setActivatorNodeRef:L,transform:w}}var pv="Droppable",fv={timeout:25};function Fs(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e,i=Fo(pv),{active:s,dispatch:a,over:c,measureDroppableContainers:u}=ve(Vs),l=$({disabled:n}),d=$(!1),m=$(null),p=$(null),{disabled:h,updateMeasurementsFor:g,timeout:C}={...fv,...o},w=Dr(g??r),y=N(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),p.current=null},C)},[C]),S=Ws({callback:y,disabled:h||!s}),T=N((B,X)=>{S&&(X&&(S.unobserve(X),d.current=!1),B&&S.observe(B))},[S]),[L,M]=Ho(T),E=Dr(t);return D(()=>{!S||!L.current||(S.disconnect(),d.current=!1,S.observe(L.current))},[L,S]),D(()=>(a({type:_e.RegisterDroppable,element:{id:r,key:i,disabled:n,node:L,rect:m,data:E}}),()=>a({type:_e.UnregisterDroppable,key:i,id:r})),[r]),D(()=>{n!==l.current.disabled&&(a({type:_e.SetDroppableDisabled,id:r,key:i,disabled:n}),l.current.disabled=n)},[r,i,n,a]),{active:s,rect:m,isOver:c?.id===r,node:L,over:c,setNodeRef:M}}var ml=globalThis.__bbPluginRuntime;if(ml==null||ml.sonner==null)throw new Error('Cannot load "sonner": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Bs=ml.sonner,YL="default"in Bs?Bs.default:Bs,{Toaster:JL,toast:gt,useSonner:XL}=Bs;var mv=Object.defineProperty,gl=(e,t)=>mv(e,"name",{value:t,configurable:!0});function hl(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}gl(hl,"setRef");function k5(...e){return t=>{let n=!1,r=e.map(o=>{let i=hl(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){let i=r[o];typeof i=="function"?i():hl(e[o],null)}}}}gl(k5,"composeRefs");function Cl(...e){return N(k5(...e),e)}gl(Cl,"useComposedRefs");var hv=Object.defineProperty,jt=(e,t)=>hv(e,"name",{value:t,configurable:!0});function y5(e){let t=F((n,r)=>{let{children:o,...i}=n,s=null,a=!1,c=[];kl(o)&&typeof Us=="function"&&(o=Us(o._payload)),Ls.forEach(o,m=>{if(x5(m)){a=!0;let p=m,h="child"in p.props?p.props.child:p.props.children;kl(h)&&typeof Us=="function"&&(h=Us(h._payload)),s=Cv(p,h),c.push(s?.props?.children)}else c.push(m)}),s?s=Ar(s,void 0,c):!a&&Ls.count(o)===1&&$r(o)&&(s=o);let u=s?w5(s):void 0,l=Cl(r,u);if(!s){if(o||o===0)throw new Error(a?bv(e):yv(e));return o}let d=v5(i,s.props??{});return s.type!==Tr&&(d.ref=r?l:u),Ar(s,d)});return t.displayName=`${e}.Slot`,t}jt(y5,"createSlot");var _n=y5("Slot"),b5=Symbol.for("radix.slottable");function gv(e){let t=jt(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=b5,t}jt(gv,"createSlottable");var Cv=jt((e,t)=>{if("child"in e.props){let n=e.props.child;return $r(n)?Ar(n,void 0,e.props.children(n.props.children)):null}return $r(t)?t:null},"getSlottableElementFromSlottable");function v5(e,t){let n={...t};for(let r in t){let o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{let c=i(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}jt(v5,"mergeProps");function w5(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}jt(w5,"getElementRef");function x5(e){return $r(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===b5}jt(x5,"isSlottable");var kv=Symbol.for("react.lazy");function kl(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===kv&&"_payload"in e&&I5(e._payload)}jt(kl,"isLazyComponent");function I5(e){return typeof e=="object"&&e!==null&&"then"in e}jt(I5,"isPromiseLike");var yv=jt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),bv=jt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Us=ct[" use ".trim().toString()];var yl=globalThis.__bbPluginRuntime;if(yl==null||yl.classVarianceAuthority==null)throw new Error('Cannot load "class-variance-authority": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Ks=yl.classVarianceAuthority,rM="default"in Ks?Ks.default:Ks,{cva:S5,cx:oM}=Ks;var bl=globalThis.__bbPluginRuntime;if(bl==null||bl.clsx==null)throw new Error('Cannot load "clsx": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Gs=bl.clsx,sM="default"in Gs?Gs.default:Gs,{clsx:_5}=Gs;var vl=globalThis.__bbPluginRuntime;if(vl==null||vl.tailwindMerge==null)throw new Error('Cannot load "tailwind-merge": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var qs=vl.tailwindMerge,cM="default"in qs?qs.default:qs,{createTailwindMerge:uM,extendTailwindMerge:lM,fromTheme:dM,getDefaultConfig:pM,mergeConfigs:fM,twJoin:mM,twMerge:P5,validators:hM}=qs;function x(...e){return P5(_5(e))}var Ys="transition-colors duration-150 hover:duration-0",Yt="transition-none";var wl=globalThis.__bbPluginRuntime;if(wl==null||wl.jsxRuntime==null)throw new Error('Cannot load "react/jsx-runtime": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Js=wl.jsxRuntime,vM="default"in Js?Js.default:Js,{Fragment:_t,jsx:f,jsxs:v}=Js;var Xs=S5(`inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ${Ys} focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_[data-icon-root]]:pointer-events-none [&_[data-icon-root]]:size-4 [&_[data-icon-root]]:shrink-0`,{variants:{variant:{default:"bg-foreground text-background hover:bg-foreground/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-transparent hover:bg-state-hover hover:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-state-hover hover:text-foreground aria-pressed:bg-state-active aria-pressed:text-foreground aria-pressed:hover:bg-state-active data-[state=open]:bg-state-active data-[state=open]:text-foreground data-[state=open]:hover:bg-state-active",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ye=F(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>f(r?_n:"button",{className:x(Xs({variant:t,size:n,className:e})),ref:i,...o}));Ye.displayName="Button";var xl=globalThis.__bbPluginRuntime;if(xl==null||xl.radixPopover==null)throw new Error('Cannot load "@radix-ui/react-popover": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Qs=xl.radixPopover,MM="default"in Qs?Qs.default:Qs,{Anchor:L5,Arrow:RM,Close:TM,Content:M5,Popover:AM,PopoverAnchor:$M,PopoverArrow:EM,PopoverClose:DM,PopoverContent:OM,PopoverPortal:NM,PopoverTrigger:zM,Portal:R5,Root:T5,Trigger:A5,createPopoverScope:jM}=Qs;function $e(){let e="thread-glance";return{"data-bb-portaled-overlay":"","data-bb-plugin-root":"",...e!==void 0?{"data-bb-plugin":e}:{}}}var wv="select-none",xv=new Set(["button","checkbox","file","hidden","image","radio","range","reset","submit"]),Pn=e=>x(wv,e);function Iv(e){return e instanceof HTMLTextAreaElement?!0:e instanceof HTMLInputElement?!e.disabled&&!e.readOnly&&!xv.has(e.type):e instanceof HTMLElement?e.isContentEditable||e.closest("[contenteditable='true']")!==null:!1}function Qo(e){if(typeof document>"u")return;let t=document.activeElement;!t||!Iv(t)||e!==null&&!e.contains(t)||t.blur()}function Ln(){Qo(null)}function $5(){Qo(null)}function cn(e){e.preventDefault()}var Il="pointer";typeof document<"u"&&(document.addEventListener("keydown",()=>{Il="keyboard"},{capture:!0}),document.addEventListener("pointerdown",()=>{Il="pointer"},{capture:!0}));function E5(){return Il==="keyboard"}var ea=new Map;function Sv(e){if(typeof window>"u"||!window.matchMedia)return null;let t=ea.get(e);if(t)return t;let n=window.matchMedia(e),r=new Set,o=()=>{for(let i of r)i()};return t={mql:n,subscribe(i){let s=r.size===0;return r.add(i),s&&n.addEventListener("change",o),()=>{r.delete(i),r.size===0&&(n.removeEventListener("change",o),ea.delete(e))}}},ea.set(e,t),t}function _v(e,t){return Sv(e)?.subscribe(t)??(()=>{})}function Pv(e){return typeof window>"u"||!window.matchMedia?!1:ea.get(e)?.mql.matches??window.matchMedia(e).matches}function ta(e){return sn(t=>_v(e,t),()=>Pv(e),()=>!1)}var Lv="(max-width: 767px)",Mv=be(null);function D5(){let e=ve(Mv),t=ta(Lv);return e!==null?e:t}var Rv="(pointer: coarse)";function na(){return ta(Rv)}var Tv=120,ia={width:"auto",minWidth:"auto",maxWidth:"none"},Sl="--bb-drawer-keyboard-inset",Av=80;function oa(e){e!==null&&(e.style.height="",e.style.bottom="",e.style.removeProperty(Sl))}function $v({layoutViewportHeight:e,visualViewportHeight:t,visualViewportOffsetTop:n}){let r=Math.round(e-(t+n));return r>=Av?r:0}function Ev(e,t){D(()=>{let n=e.current,r=window.visualViewport;if(n===null||!t||!r)return;let o=null,i=()=>{if(o=null,r.scale!==1){oa(n);return}let a=$v({layoutViewportHeight:n.ownerDocument.documentElement.clientHeight,visualViewportHeight:r.height,visualViewportOffsetTop:r.offsetTop});if(a===0){n.style.bottom="",n.style.removeProperty(Sl);return}n.style.bottom=`${a}px`,n.style.setProperty(Sl,`${a}px`)},s=()=>{o!==null&&window.cancelAnimationFrame(o),o=window.requestAnimationFrame(i)};return i(),r.addEventListener("resize",s),r.addEventListener("scroll",s),()=>{r.removeEventListener("resize",s),r.removeEventListener("scroll",s),o!==null&&window.cancelAnimationFrame(o),oa(n)}},[t,e])}function Dv(){let e=D5()?"drawer":"floating",t=na();return{presentation:e,supportsHover:e==="floating"&&!t}}function zr(e,t,n=!1){let{presentation:r}=Dv(),o=r==="drawer",[i,s]=A(n),a=e!==void 0,c=a?e:i,u=N(l=>{c&&!l&&o&&$5(),a||s(l),t?.(l)},[o,a,t,c]);return K(()=>({isCompactViewport:o,open:c,onOpenChange:u}),[o,c,u])}var rr=F(({asChild:e,open:t,onOpenChange:n,haspopup:r,onClick:o,children:i,className:s,...a},c)=>{let u=Pn(s),l=m=>{o?.(m),m.defaultPrevented||(t||Ln(),n(!t))},d={"aria-expanded":t,"aria-haspopup":r,"data-state":t?"open":"closed"};return e?f(_n,{ref:c,onClick:l,onMouseDown:cn,className:u,...d,...a,children:i}):f("button",{ref:c,type:"button",onClick:l,onMouseDown:cn,className:u,...d,...a,children:i})});rr.displayName="MobileTrigger";var Ov=["side","sideOffset","align","alignOffset","collisionPadding","collisionBoundary","arrowPadding","sticky","hideWhenDetached","avoidCollisions","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside"],Nv=new Set(Ov);function jr(e){let t={};for(let n of Object.keys(e))Nv.has(n)||(t[n]=e[n]);return t}function zv({open:e,enabled:t=!0}){let[n,r]=A(!1),o=N(()=>r(!0),[]);return D(()=>{if(!t||!e||n)return;let i=null,s=null;i=window.requestAnimationFrame(()=>{i=null,s=window.requestAnimationFrame(()=>{s=null,o()})});let a=window.setTimeout(o,Tv);return()=>{i!==null&&window.cancelAnimationFrame(i),s!==null&&window.cancelAnimationFrame(s),window.clearTimeout(a)}},[t,n,e,o]),{isContentRealized:t&&n,realizeContent:o}}function Zr({open:e,onOpenChange:t,onAfterCloseAutoFocus:n,closeOnBackdropClick:r=!0,srLabel:o,labelledBy:i,describedBy:s,contentClassName:a,onContentAnimationEnd:c,children:u}){let{isContentRealized:l}=zv({open:e});return!e&&!l?null:f(Kv,{open:e,onOpenChange:t,onAfterCloseAutoFocus:n,closeOnBackdropClick:r,srLabel:o,labelledBy:i,describedBy:s,contentClassName:a,onContentAnimationEnd:c,children:l?u:f("div",{"aria-hidden":"true",className:"min-h-32","data-responsive-drawer-placeholder":""})})}var O5="cubic-bezier(0.32, 0.72, 0, 1)",jv=.25,Zv=450,Wv=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),ra=new WeakMap;function Vv(e){return Array.from(e.querySelectorAll(Wv)).filter(t=>t.closest('[aria-hidden="true"], [inert]')===null)}function Hv(e,t){let n=e?.closest("[data-bb-portaled-overlay]");return n!=null&&n!==t}function Fv(e,t){let n=t.ownerDocument.activeElement;if(!t.contains(n)&&Hv(n,t))return;let r=Vv(t);if(e.preventDefault(),r.length===0){t.focus({preventScroll:!0});return}let o=r[0],i=r[r.length-1];if(e.shiftKey){if(!t.contains(n)||n===t||n===o){i?.focus({preventScroll:!0});return}let a=r.indexOf(n);r[Math.max(0,a-1)]?.focus({preventScroll:!0});return}if(!t.contains(n)||n===t||n===i){o?.focus({preventScroll:!0});return}let s=r.indexOf(n);r[Math.min(r.length-1,s+1)]?.focus({preventScroll:!0})}function Bv(e,t){let n=ra.get(e);if(n===void 0){let r=[],o=i=>{if(i.defaultPrevented)return;let s=r[r.length-1],a=s?.panel()??null;s===void 0||a===null||(i.key==="Escape"?(i.preventDefault(),s.requestClose()):i.key==="Tab"&&Fv(i,a))};n={entries:r,handleKeyDown:o},ra.set(e,n),e.addEventListener("keydown",o)}return n.entries.push(t),()=>{let r=ra.get(e);if(r===void 0)return;let o=r.entries.indexOf(t);o>=0&&r.entries.splice(o,1),r.entries.length===0&&(e.removeEventListener("keydown",r.handleKeyDown),ra.delete(e))}}function Uv({onAfterCloseAutoFocus:e,onBeforeCloseAutoFocus:t,open:n,panelRef:r,requestClose:o}){let i=$(null);at(()=>{if(!n)return;let a=r.current;if(a===null)return;let c=a.ownerDocument,u=c.activeElement;i.current=u instanceof HTMLElement&&u!==c.body?u:null;let l=Bv(c,{panel:()=>r.current,requestClose:o});return a.focus({preventScroll:!0}),l},[n,r,o]);let s=$(n);at(()=>{let a;if(s.current&&!n){t?.();let c=i.current;if(c?.isConnected&&c.closest('[aria-hidden="true"], [inert]')===null&&(c.focus({preventScroll:!0}),c.ownerDocument.activeElement!==c)){let u=c.ownerDocument.defaultView;if(u!==null){let l=u.requestAnimationFrame(()=>{c.isConnected&&c.closest('[aria-hidden="true"], [inert]')===null&&c.focus({preventScroll:!0}),e?.()});a=()=>u.cancelAnimationFrame(l)}}i.current=null,a===void 0&&e?.()}return s.current=n,a},[e,t,n])}function Kv({open:e,onOpenChange:t,onAfterCloseAutoFocus:n,closeOnBackdropClick:r=!0,srLabel:o,labelledBy:i,describedBy:s,contentClassName:a,motionDurationMs:c=220,onContentAnimationEnd:u,children:l}){let d=$(null),m=$(null),p=$(null),h=$(null),g=In(),C=$e(),w=`transform ${c}ms ${O5}`,y=`opacity ${c}ms ${O5}`,S=$(t);at(()=>{S.current=t},[t]);let T=N(()=>{Qo(d.current),oa(d.current),S.current(!1)},[]),L=N(()=>{Qo(d.current),oa(d.current)},[]);Uv({onAfterCloseAutoFocus:n,onBeforeCloseAutoFocus:L,open:e,panelRef:d,requestClose:T}),Ev(d,e);let M=N(Z=>{h.current!==Z&&(h.current=Z,u?.(Z))},[u]);D(()=>{h.current=null;let Z=window.setTimeout(()=>M(e),c+50);return()=>window.clearTimeout(Z)},[c,e,M]);let E=N((Z,ne,Q)=>{let ge=d.current,yt=m.current;ge===null||yt===null||(ge.style.transition=Q?w:"none",ge.style.transform=`translate3d(0, ${Z}px, 0)`,yt.style.transition=Q?y:"none",yt.style.opacity=String(Math.max(0,Math.min(1,1-Z/ne))))},[y,w]),B=N(Z=>{if(!e||Z.button!==0)return;Z.currentTarget.setPointerCapture(Z.pointerId);let ne=Date.now(),Q=Math.max(d.current?.clientHeight??0,1);p.current={pointerId:Z.pointerId,startY:Z.clientY,lastY:Z.clientY,lastTimeMs:ne,velocityY:0,height:Q},E(0,Q,!1),Z.preventDefault()},[e,E]),X=N(Z=>{let ne=p.current;if(ne===null||ne.pointerId!==Z.pointerId)return;let Q=Date.now(),ge=Q-ne.lastTimeMs;ge>0&&(ne.velocityY=(Z.clientY-ne.lastY)/ge*1e3,ne.lastY=Z.clientY,ne.lastTimeMs=Q),E(Math.max(0,Z.clientY-ne.startY),ne.height,!1),Z.preventDefault()},[E]),oe=N((Z,ne)=>{let Q=p.current;if(Q===null||Q.pointerId!==Z.pointerId)return;p.current=null;let ge=Math.max(0,Z.clientY-Q.startY);!ne&&(ge>=Q.height*jv||Q.velocityY>=Zv)?(E(Q.height,Q.height,!0),T()):E(0,Q.height,!0),Z.preventDefault()},[T,E]),ee=typeof document>"u"?null:document.body;return ee===null?null:Rs(v(_t,{children:[f("div",{ref:m,...C,"aria-hidden":"true","data-persistent-drawer-backdrop":"","data-state":e?"open":"closed",className:"fixed inset-0 z-50 bg-black/40",style:{opacity:e?1:0,pointerEvents:e?"auto":"none",transition:y},onClick:r?T:void 0,onTouchMove:Z=>Z.preventDefault()}),v("div",{ref:d,...C,"aria-hidden":!e,"aria-labelledby":i??(o===void 0?void 0:g),"aria-describedby":s,"aria-modal":e||void 0,"data-bb-portaled-overlay":"","data-persistent-drawer-content":"","data-state":e?"open":"closed",inert:!e,role:"dialog",tabIndex:-1,className:x("fixed inset-x-0 bottom-0 z-50 mt-24 flex max-h-[calc(92dvh-var(--bb-drawer-keyboard-inset,0px))] flex-col rounded-t-xl border bg-background outline-none",a),style:{transform:e?"translate3d(0, 0, 0)":"translate3d(0, 100%, 0)",transition:w,willChange:e?"transform":void 0},onTransitionEnd:Z=>{Z.currentTarget===Z.target&&Z.propertyName==="transform"&&M(e)},children:[f("div",{"data-persistent-drawer-handle":"",className:"mx-auto flex h-8 w-16 shrink-0 touch-none cursor-grab items-center justify-center active:cursor-grabbing",onPointerDown:B,onPointerMove:X,onPointerUp:Z=>oe(Z,!1),onPointerCancel:Z=>oe(Z,!0),children:f("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/20"})}),o===void 0?null:f("h2",{id:g,className:"sr-only",children:o}),l]})]}),ee)}var _l=be({isCompactViewport:!1,open:!1,onOpenChange:()=>{}});function Pl(){return ve(_l)}function sa({children:e,open:t,onOpenChange:n,defaultOpen:r,...o}){let i=zr(t,n,r);return i.isCompactViewport?f(_l.Provider,{value:i,children:e}):f(T5,{open:i.open,onOpenChange:i.onOpenChange,...o,children:f(_l.Provider,{value:i,children:e})})}var ei=F(({asChild:e,children:t,className:n,...r},o)=>{let{isCompactViewport:i,open:s,onOpenChange:a}=Pl();return i?f(rr,{ref:o,asChild:e,open:s,onOpenChange:a,haspopup:"dialog",className:n,...r,children:t}):f(A5,{ref:o,asChild:e,className:Pn(n),onMouseDown:c=>{s||Ln(),cn(c)},...r,children:t})});ei.displayName="PopoverTrigger";var ti=F(({className:e,align:t="center",sideOffset:n=4,children:r,dismissOnOutsideInteraction:o=!0,onInteractOutside:i,mobileTitle:s,mobileClassName:a,onMobileContentAnimationEnd:c,onOpenAutoFocus:u,autoFocusRef:l,...d},m)=>{let{isCompactViewport:p,open:h,onOpenChange:g}=Pl(),C=na(),w=$e();if(D(()=>{if(!h||p||C||!l)return;let y=window.requestAnimationFrame(()=>{let S=l.current;S?.focus(),S instanceof HTMLInputElement&&S.select()});return()=>window.cancelAnimationFrame(y)},[l,p,C,h]),p){let{style:y,...S}=jr(d);return f(Zr,{open:h,onOpenChange:g,srLabel:s??"Options",closeOnBackdropClick:o,contentClassName:a,onContentAnimationEnd:c,children:f("div",{ref:m,className:x("overflow-y-auto px-4 pt-2 pb-[max(1rem,env(safe-area-inset-bottom))]",e),...S,style:{...y,...ia},children:r})})}return f(R5,{children:f(M5,{ref:m,...w,align:t,sideOffset:n,onOpenAutoFocus:y=>{(C||l)&&y.preventDefault(),C||u?.(y)},className:x("z-50 w-96 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",e),...d,onInteractOutside:y=>{o||y.preventDefault(),i?.(y)},children:r})})});ti.displayName="PopoverContent";var Gv=F(({children:e,...t},n)=>{let{isCompactViewport:r}=Pl();return r?f(_t,{children:e}):f(L5,{ref:n,...t,children:e})});Gv.displayName="PopoverAnchor";var qv=["waits-on-you","unread-failed","queue-failed","offline","working","unread"],N5={question:{icon:"CircleQuestion",label:"Asks a question"},approval:{icon:"SecurityCheck",label:"Needs approval"},plan:{icon:"ListTodo",label:"Plan to review"},input:{icon:"MessageQuestion",label:"Needs your input"}},z5=new Set(["pending","starting","active","stopping","idle","error"]),Ll=new Set(["provisioning","starting","active","stopping","host-reconnecting"]),Yv=new Set([...z5,...Ll,"waiting-for-host"]);function or(e){return z5.has(e.status)?e.status:"idle"}function Ml(e){return Yv.has(e.runtimeStatus)?e.runtimeStatus:or(e)}function aa(e){return e.queuedWork==="waiting"||e.queuedWork==="failed"?e.queuedWork:"none"}function Jv(e){return Ll.has(Ml(e))}function Xv(e){return Ml(e)==="waiting-for-host"}function j5(e,t){return e.id===t.activeThreadId||(t.openThreadIds?.has(e.id)??!1)}function Z5(e,t){if(j5(e,t))return!1;let n=or(e),r=e.lastReadAt??0;return(n==="idle"||n==="error")&&r<e.latestAttentionAt?!0:ca(e,t)}function ca(e,t){if(e.parentThreadId===null||or(e)!=="idle"||j5(e,t))return!1;let n=t.finishedAt[e.id];return n===void 0?!1:n>Math.max(e.lastReadAt??0,t.seenAt[e.id]??0)}var Qv=[["planMode","ListTodo","Plan mode active"],["goals","Target","Goal active"],["workflows","Workflow","Workflow running"],["backgroundAgents","UserRoundPlus","Background agent running"],["backgroundCommands","Terminal","Background command running"]];function xe(e,t,n=!1,r=!1){return{icon:e,tone:t,spin:n,shine:r}}function ew(e){switch(e){case"provisioning":return"Setting up";case"host-reconnecting":return"Reconnecting";case"stopping":return"Stopping";default:return"Working"}}function ua(e,t){let n=or(e),r=Ml(e),o=aa(e),i={sendAt:null};if(e.hasPendingInteraction){let s=N5[t.needsKind??"input"]??N5.input,a=t.needsKind?s.icon:"CircleQuestion";return{kind:"waits-on-you",label:s.label,glyph:xe(a,"attention"),...i}}if(n==="error")return{kind:"failed",label:"Failed",glyph:xe("CircleX","destructive"),...i};if(o==="failed")return{kind:"queue-failed",label:"Queued message failed to send",glyph:xe("AlertTriangle","destructive"),...i};if(r==="waiting-for-host")return{kind:"offline",label:"Machine offline",glyph:xe("CloudOff","attention"),...i};if(Ll.has(r)){let s=ew(r);return t.hasDraft?{kind:"working",label:`${s}, unsubmitted draft`,glyph:xe("Edit","working",!1,!0),...i}:e.activity.planMode>0?{kind:"working",label:`${s}, plan mode`,glyph:xe("ListTodo","working",!1,!0),...i}:e.activity.goals>0?{kind:"working",label:`${s}, goal active`,glyph:xe("Target","working",!1,!0),...i}:{kind:"working",label:s,glyph:xe("Loading","working",!0),...i}}for(let[s,a,c]of Qv)if(e.activity[s]>0)return{kind:"background",label:c,glyph:xe(a,"background",!1,!0),...i};return o==="waiting"?t.scheduledAt!==null&&t.scheduledAt>t.now?{kind:"scheduled",label:"Scheduled message",glyph:xe("Calendar","muted-strong"),sendAt:t.scheduledAt}:{kind:"queued",label:"Message waiting to send",glyph:xe("Clock","muted-strong"),...i}:t.unread?{kind:"unread",label:"Unread",glyph:xe("dot","none"),...i}:t.hasDraft?{kind:"draft",label:"Unsubmitted draft",glyph:xe("Edit","muted"),...i}:{kind:"idle",label:"Idle",glyph:xe("ring","muted-strong"),...i}}function W5(e,t){return!(t===null||e.kind==="waits-on-you"||e.kind==="failed"||e.kind==="working"&&e.glyph.spin)}function V5(e,t){let n=new Set;return e.hasPendingInteraction&&n.add("waits-on-you"),or(e)==="error"&&t&&n.add("unread-failed"),aa(e)==="failed"&&n.add("queue-failed"),Xv(e)&&n.add("offline"),Jv(e)&&n.add("working"),t&&n.add("unread"),n}function H5(e){let t=new Set;return e.has("waits-on-you")&&t.add("waits-on-you"),e.has("unread-failed")&&t.add("unread-failed"),t}var tw=new Set(["waits-on-you","unread-failed","queue-failed","offline"]);function F5(e,t){return t?new Set([...e].filter(n=>tw.has(n))):new Set(e)}function Rl(e){return qv.find(t=>e.has(t))??null}function B5(e){let t=la[e].tone;return t==="none"?"working":t}var la={"waits-on-you":{...xe("CircleQuestion","attention"),label:"needs your input"},"unread-failed":{...xe("CircleX","destructive"),label:"failed"},"queue-failed":{...xe("AlertTriangle","destructive"),label:"queued message failed"},offline:{...xe("CloudOff","attention"),label:"machine offline"},working:{...xe("Loading","working",!0),label:"working"},unread:{...xe("dot","none"),label:"unread"}};function Wr(e,t,n){return t||n?!1:e.kind==="idle"||e.kind==="draft"||e.kind==="failed"}var nw=new Set(["waits-on-you","unread-failed","queue-failed","offline","unread"]),rw=new Set(["working","background","queued","scheduled"]),ow=5e3;function U5(e){return!rw.has(e.state.kind)}function iw(e,t){let n=0;return t.has("unread-failed")&&(n=Math.max(n,e.latestAttentionAt)),t.has("queue-failed")&&(n=Math.max(n,e.updatedAt)),n}function K5(e,t,n){if(!t.has("unread-failed")&&!t.has("queue-failed")||!U5(n)||n.idleSince===null)return null;let r=Math.max(n.thread.latestAttentionAt,n.finishedAt??0),o=iw(e,t);return r>o?null:Math.max(o,n.idleSince??0)+ow}function sw(e){let t=ua(e,{unread:!1,hasDraft:!1,scheduledAt:null,now:0});return!U5({thread:e,state:t})}function G5(e,t,n){let r=new Set,o={},i=[];for(let s of t){let a=s.id;sw(s)?r.add(a):e?.busy.has(a)?(o[a]=n,i.push(a)):e?.idleSince[a]!==void 0&&(o[a]=e.idleSince[a])}return{busy:r,idleSince:o,wentIdle:i}}function q5(e,t){let n=new Set;if(t.isRoot||t.mode==="everything"){for(let r of e)nw.has(r)&&n.add(r);return n}return e.has("waits-on-you")&&n.add("waits-on-you"),e.has("offline")&&n.add("offline"),t.orphaned&&(e.has("unread-failed")&&n.add("unread-failed"),e.has("queue-failed")&&n.add("queue-failed")),n}function Y5(e,t){return e.has("waits-on-you")||e.has("unread-failed")?!0:!t&&e.has("queue-failed")}function J5(e,t){let n=new Set,r=new Set;for(let o of e.infos.values())o.thread.isArchived||(o.attentionFlags.has("unread")&&!o.thread.isHidden&&n.add(o.thread.id),Y5(o.attentionFlags,o.parentId===null)&&r.add(o.thread.id));return{activeThreadId:t,unread:n,attentionIds:r}}function X5(e,t){let n=new Map;t.activeThreadId!==null&&t.activeThreadId!==e?.activeThreadId&&n.set(t.activeThreadId,"reveal");for(let r of t.attentionIds)e?.attentionIds.has(r)||n.set(r,"reveal");for(let r of t.unread)r===t.activeThreadId||n.has(r)||e?.unread.has(r)||n.set(r,"open");return n}function Q5(e,t){if(t.size===0)return e;let n=new Map(e);for(let[r,o]of t)n.get(r)!=="reveal"&&n.set(r,o);return n}function e0(e,t){let n=!1,r=new Map;for(let[o,i]of e)t(o)?n=!0:r.set(o,i);return n?r:e}function t0(e,t){let n=$(null),r=$(null),o=$(void 0),[i,s]=A(()=>new Map),a=$(i);a.current=i;let c=i;if(e!==null&&(e!==r.current||t!==o.current)){let l=J5(e,t),d=X5(n.current,l);n.current=l,r.current=e,o.current=t,c=Q5(i,d),c!==i&&(a.current=c,s(c))}let u=N(l=>{let d=e0(a.current,l);d!==a.current&&(a.current=d,s(d))},[]);return{targets:c,prune:u}}var ce={};Nt(ce,{$brand:()=>Bl,$input:()=>gp,$output:()=>hp,INVALID:()=>Qe,NEVER:()=>Fl,TimePrecision:()=>Pp,ZodAny:()=>h2,ZodArray:()=>y2,ZodBase64:()=>au,ZodBase64URL:()=>cu,ZodBigInt:()=>Io,ZodBigIntFormat:()=>du,ZodBoolean:()=>xo,ZodCIDRv4:()=>iu,ZodCIDRv6:()=>su,ZodCUID:()=>Xc,ZodCUID2:()=>Qc,ZodCatch:()=>Z2,ZodCodec:()=>Gi,ZodCompileAsyncError:()=>Wt,ZodCompileUnsupportedError:()=>J,ZodCreditCard:()=>a2,ZodCustom:()=>qi,ZodCustomStringFormat:()=>wr,ZodDate:()=>Vi,ZodDefault:()=>E2,ZodDiscriminatedUnion:()=>v2,ZodE164:()=>uu,ZodEmail:()=>Gc,ZodEmoji:()=>Yc,ZodEnum:()=>bo,ZodError:()=>gS,ZodExactOptional:()=>hu,ZodFile:()=>R2,ZodFirstPartyTypeKind:()=>em,ZodFunction:()=>Y2,ZodGUID:()=>qc,ZodIBAN:()=>c2,ZodIPv4:()=>ru,ZodIPv6:()=>ou,ZodISODate:()=>zn,ZodISODateTime:()=>Nn,ZodISODuration:()=>Zn,ZodISOTime:()=>jn,ZodInstanceOf:()=>Q2,ZodIntersection:()=>w2,ZodIssueCode:()=>yS,ZodJWT:()=>lu,ZodKSUID:()=>nu,ZodLazy:()=>K2,ZodLiteral:()=>M2,ZodMAC:()=>s2,ZodMap:()=>P2,ZodNaN:()=>V2,ZodNanoID:()=>Jc,ZodNever:()=>C2,ZodNonOptional:()=>gu,ZodNull:()=>f2,ZodNullable:()=>$2,ZodNumber:()=>wo,ZodNumberFormat:()=>xr,ZodObject:()=>Fi,ZodOptional:()=>Ui,ZodPipe:()=>Ki,ZodPrefault:()=>O2,ZodPreprocess:()=>H2,ZodPromise:()=>q2,ZodReadonly:()=>F2,ZodRealError:()=>ft,ZodRecord:()=>yo,ZodSet:()=>L2,ZodString:()=>vo,ZodStringFormat:()=>le,ZodSuccess:()=>j2,ZodSymbol:()=>d2,ZodTemplateLiteral:()=>U2,ZodTransform:()=>T2,ZodTuple:()=>I2,ZodType:()=>q,ZodULID:()=>eu,ZodURL:()=>Wi,ZodUUID:()=>en,ZodUndefined:()=>p2,ZodUnion:()=>Bi,ZodUnknown:()=>g2,ZodVoid:()=>k2,ZodXID:()=>tu,ZodXor:()=>b2,_ZodString:()=>Kc,_default:()=>D2,_function:()=>Sg,any:()=>ng,array:()=>Hi,base64:()=>O9,base64url:()=>N9,bigint:()=>J9,boolean:()=>l2,catch:()=>W2,check:()=>_g,cidrv4:()=>E9,cidrv6:()=>D9,clone:()=>ie,codec:()=>vg,coerce:()=>nm,compile:()=>bp,config:()=>ke,core:()=>fn,creditCard:()=>j9,cuid:()=>_9,cuid2:()=>P9,currencyCode:()=>B9,custom:()=>Pg,date:()=>og,decode:()=>Qf,decodeAsync:()=>t2,deepPartial:()=>Zg,describe:()=>Lg,discriminatedUnion:()=>lg,e164:()=>z9,email:()=>g9,emoji:()=>I9,encode:()=>Xf,encodeAsync:()=>e2,endsWith:()=>ao,enum:()=>fu,exactOptional:()=>A2,file:()=>Cg,flattenError:()=>di,float32:()=>K9,float64:()=>G9,formatError:()=>pi,fromJSONSchema:()=>zg,function:()=>Sg,getDiscriminatedOption:()=>H1,getErrorMap:()=>vS,globalRegistry:()=>Ve,gt:()=>Xt,gte:()=>kt,guid:()=>C9,hash:()=>U9,hex:()=>F9,hostname:()=>H9,httpUrl:()=>x9,iban:()=>Z9,includes:()=>io,input:()=>Vg,instanceof:()=>Rg,int:()=>Bc,int32:()=>q9,int64:()=>X9,intersection:()=>x2,invertCodec:()=>wg,ipv4:()=>T9,ipv6:()=>$9,iso:()=>Yi,json:()=>Ag,jwt:()=>W9,keyof:()=>ig,ksuid:()=>R9,lazy:()=>G2,length:()=>Cr,literal:()=>gg,locales:()=>Ti,looseObject:()=>cg,looseRecord:()=>pg,lowercase:()=>ro,lt:()=>Jt,lte:()=>Ct,mac:()=>A9,map:()=>fg,maxLength:()=>gr,maxSize:()=>$n,memoizer:()=>Ri,meta:()=>Mg,mime:()=>uo,minLength:()=>pn,minSize:()=>Qt,multipleOf:()=>An,nan:()=>bg,nanoid:()=>S9,nativeEnum:()=>hg,negative:()=>Ec,never:()=>pu,nonnegative:()=>Oc,nonoptional:()=>z2,nonpositive:()=>Dc,normalize:()=>lo,null:()=>m2,nullable:()=>Zi,nullish:()=>kg,number:()=>u2,object:()=>sg,optional:()=>br,output:()=>Hg,overwrite:()=>Vt,parse:()=>Gf,parseAsync:()=>qf,partialRecord:()=>dg,pipe:()=>Uc,positive:()=>$c,prefault:()=>N2,preprocess:()=>$g,prettifyError:()=>Yl,promise:()=>Ig,properties:()=>co,property:()=>Nc,readonly:()=>B2,record:()=>_2,refine:()=>J2,regex:()=>no,regexes:()=>Mt,registry:()=>cc,safeDecode:()=>r2,safeDecodeAsync:()=>i2,safeEncode:()=>n2,safeEncodeAsync:()=>o2,safeParse:()=>Yf,safeParseAsync:()=>Jf,set:()=>mg,setErrorMap:()=>bS,size:()=>hr,slugify:()=>ho,startsWith:()=>so,strictObject:()=>ag,string:()=>ji,stringFormat:()=>V9,stringbool:()=>Tg,success:()=>yg,superRefine:()=>X2,symbol:()=>eg,templateLiteral:()=>xg,toJSONSchema:()=>Wc,toLowerCase:()=>fo,toUpperCase:()=>mo,toZod:()=>ni,transform:()=>mu,treeifyError:()=>ql,trim:()=>po,tuple:()=>S2,uint32:()=>Y9,uint64:()=>Q9,ulid:()=>L9,undefined:()=>tg,union:()=>So,unknown:()=>yr,uppercase:()=>oo,url:()=>w9,util:()=>j,uuid:()=>k9,uuidv4:()=>y9,uuidv6:()=>b9,uuidv7:()=>v9,validate:()=>fi,validateAsync:()=>mi,void:()=>rg,withParser:()=>uc,xid:()=>M9,xor:()=>ug});var fn={};Nt(fn,{$ZodAny:()=>D1,$ZodArray:()=>Z1,$ZodAsyncError:()=>dt,$ZodBase64:()=>x1,$ZodBase64URL:()=>I1,$ZodBigInt:()=>Ya,$ZodBigIntFormat:()=>T1,$ZodBoolean:()=>Ii,$ZodCIDRv4:()=>v1,$ZodCIDRv6:()=>w1,$ZodCUID:()=>u1,$ZodCUID2:()=>l1,$ZodCatch:()=>ip,$ZodCheck:()=>de,$ZodCheckBigIntFormat:()=>Od,$ZodCheckEndsWith:()=>Gd,$ZodCheckGreaterThan:()=>Ea,$ZodCheckIncludes:()=>Ud,$ZodCheckLengthEquals:()=>Vd,$ZodCheckLessThan:()=>$a,$ZodCheckLowerCase:()=>Fd,$ZodCheckMaxLength:()=>Zd,$ZodCheckMaxSize:()=>Nd,$ZodCheckMimeType:()=>Jd,$ZodCheckMinLength:()=>Wd,$ZodCheckMinSize:()=>zd,$ZodCheckMultipleOf:()=>Ed,$ZodCheckNumberFormat:()=>Dd,$ZodCheckOverwrite:()=>Xd,$ZodCheckProperties:()=>Yd,$ZodCheckProperty:()=>qd,$ZodCheckRegex:()=>Hd,$ZodCheckSizeEquals:()=>jd,$ZodCheckStartsWith:()=>Kd,$ZodCheckStringFormat:()=>Xr,$ZodCheckUpperCase:()=>Bd,$ZodCodec:()=>_i,$ZodCreditCard:()=>_1,$ZodCustom:()=>pp,$ZodCustomStringFormat:()=>M1,$ZodCyclicError:()=>rc,$ZodDate:()=>j1,$ZodDefault:()=>tp,$ZodDiscriminatedUnion:()=>F1,$ZodE164:()=>S1,$ZodEmail:()=>r1,$ZodEmoji:()=>a1,$ZodEncodeError:()=>Tn,$ZodEnum:()=>q1,$ZodError:()=>Gl,$ZodExactOptional:()=>Q1,$ZodFile:()=>J1,$ZodFunction:()=>lp,$ZodGUID:()=>t1,$ZodIBAN:()=>P1,$ZodIPv4:()=>k1,$ZodIPv6:()=>y1,$ZodISODate:()=>h1,$ZodISODateTime:()=>m1,$ZodISODuration:()=>C1,$ZodISOTime:()=>g1,$ZodIntersection:()=>B1,$ZodJWT:()=>L1,$ZodKSUID:()=>f1,$ZodLazy:()=>Pi,$ZodLiteral:()=>Y1,$ZodMAC:()=>b1,$ZodMap:()=>K1,$ZodNaN:()=>sp,$ZodNanoID:()=>c1,$ZodNever:()=>N1,$ZodNonOptional:()=>rp,$ZodNull:()=>E1,$ZodNullable:()=>ep,$ZodNumber:()=>qa,$ZodNumberFormat:()=>R1,$ZodObject:()=>O0,$ZodObjectJIT:()=>W1,$ZodOptional:()=>Xa,$ZodPipe:()=>Qa,$ZodPrefault:()=>np,$ZodPreprocess:()=>ap,$ZodPromise:()=>dp,$ZodReadonly:()=>cp,$ZodRealError:()=>pt,$ZodRecord:()=>U1,$ZodRegistry:()=>ac,$ZodSet:()=>G1,$ZodString:()=>lr,$ZodStringFormat:()=>se,$ZodSuccess:()=>op,$ZodSymbol:()=>A1,$ZodTemplateLiteral:()=>up,$ZodTransform:()=>X1,$ZodTuple:()=>Ja,$ZodType:()=>G,$ZodULID:()=>d1,$ZodURL:()=>s1,$ZodUUID:()=>n1,$ZodUndefined:()=>$1,$ZodUnion:()=>Si,$ZodUnknown:()=>O1,$ZodVoid:()=>z1,$ZodXID:()=>p1,$ZodXor:()=>V1,$brand:()=>Bl,$constructor:()=>k,$input:()=>gp,$output:()=>hp,Doc:()=>ur,INVALID:()=>Qe,JSONSchema:()=>f9,JSONSchemaGenerator:()=>Vc,NEVER:()=>Fl,TimePrecision:()=>Pp,URL_BAD_FORMAT:()=>o1,URL_UNPARSEABLE:()=>yi,ZodCompileAsyncError:()=>Wt,ZodCompileUnsupportedError:()=>J,_any:()=>Fp,_array:()=>Jp,_base64:()=>Mc,_base64url:()=>Rc,_bigint:()=>Np,_boolean:()=>Dp,_catch:()=>oS,_check:()=>J0,_cidrv4:()=>Pc,_cidrv6:()=>Lc,_coercedBigint:()=>zp,_coercedBoolean:()=>Op,_coercedDate:()=>qp,_coercedNumber:()=>Mp,_coercedString:()=>xp,_creditCard:()=>Sp,_cuid:()=>bc,_cuid2:()=>vc,_custom:()=>Qp,_date:()=>Gp,_decode:()=>wa,_decodeAsync:()=>Ia,_default:()=>tS,_discriminatedUnion:()=>HI,_e164:()=>Tc,_email:()=>pc,_emoji:()=>kc,_encode:()=>va,_encodeAsync:()=>xa,_endsWith:()=>ao,_enum:()=>qI,_file:()=>Xp,_float32:()=>Tp,_float64:()=>Ap,_gt:()=>Xt,_gte:()=>kt,_guid:()=>fc,_iban:()=>_p,_includes:()=>io,_int:()=>Rp,_int32:()=>$p,_int64:()=>jp,_intersection:()=>FI,_ipv4:()=>Sc,_ipv6:()=>_c,_isoDate:()=>Ei,_isoDateTime:()=>$i,_isoDuration:()=>Oi,_isoTime:()=>Di,_jwt:()=>Ac,_ksuid:()=>Ic,_lazy:()=>cS,_length:()=>Cr,_literal:()=>JI,_lowercase:()=>ro,_lt:()=>Jt,_lte:()=>Ct,_mac:()=>Ip,_map:()=>KI,_max:()=>Ct,_maxLength:()=>gr,_maxSize:()=>$n,_mime:()=>uo,_min:()=>kt,_minLength:()=>pn,_minSize:()=>Qt,_multipleOf:()=>An,_nan:()=>Yp,_nanoid:()=>yc,_nativeEnum:()=>YI,_negative:()=>Ec,_never:()=>Up,_nonnegative:()=>Oc,_nonoptional:()=>nS,_nonpositive:()=>Dc,_normalize:()=>lo,_null:()=>Hp,_nullable:()=>eS,_number:()=>Lp,_optional:()=>QI,_overwrite:()=>Vt,_parse:()=>Gr,_parseAsync:()=>qr,_pipe:()=>iS,_positive:()=>$c,_promise:()=>uS,_properties:()=>co,_property:()=>Nc,_readonly:()=>sS,_record:()=>UI,_refine:()=>ef,_regex:()=>no,_safeDecode:()=>_a,_safeDecodeAsync:()=>La,_safeEncode:()=>Sa,_safeEncodeAsync:()=>Pa,_safeParse:()=>Yr,_safeParseAsync:()=>Jr,_set:()=>GI,_size:()=>hr,_slugify:()=>ho,_startsWith:()=>so,_string:()=>wp,_stringFormat:()=>kr,_stringbool:()=>of,_success:()=>rS,_superRefine:()=>tf,_symbol:()=>Wp,_templateLiteral:()=>aS,_toLowerCase:()=>fo,_toUpperCase:()=>mo,_transform:()=>XI,_trim:()=>po,_tuple:()=>BI,_uint32:()=>Ep,_uint64:()=>Zp,_ulid:()=>wc,_undefined:()=>Vp,_union:()=>WI,_unknown:()=>Bp,_uppercase:()=>oo,_url:()=>Ai,_uuid:()=>mc,_uuidv4:()=>hc,_uuidv6:()=>gc,_uuidv7:()=>Cc,_void:()=>Kp,_xid:()=>xc,_xor:()=>VI,base64Charset:()=>Fa,base64urlCharset:()=>xi,canParseURL:()=>i1,clone:()=>ie,compile:()=>bp,compileFn:()=>lc,config:()=>ke,createStandardJSONSchemaMethod:()=>go,createToJSONSchemaMethod:()=>af,decode:()=>Jw,decodeAsync:()=>Qw,describe:()=>nf,encode:()=>Yw,encodeAsync:()=>Xw,extractDefs:()=>Dn,finalize:()=>On,flattenError:()=>di,formatError:()=>pi,getDiscriminatedOption:()=>H1,globalConfig:()=>Ee,globalRegistry:()=>Ve,handleUnrepresentable:()=>Pe,initializeContext:()=>En,isBackEdge:()=>ic,isRecursiveSchema:()=>oc,isValidBase64:()=>wi,isValidBase64URL:()=>Ba,isValidCIDRv6:()=>Ha,isValidCreditCard:()=>Ua,isValidIBAN:()=>Ka,isValidIPv6:()=>vi,isValidJWT:()=>Ga,locales:()=>Ti,memoizer:()=>Ri,mergeValues:()=>Qr,meta:()=>rf,parse:()=>ya,parseAsync:()=>ba,parseURLObject:()=>$0,prettifyError:()=>Yl,process:()=>ae,processSchema:()=>ae,regexes:()=>Mt,registry:()=>cc,safeDecode:()=>tx,safeDecodeAsync:()=>rx,safeEncode:()=>ex,safeEncodeAsync:()=>nx,safeParse:()=>Bw,safeParseAsync:()=>Uw,standardProps:()=>ja,stripTabAndNewline:()=>bi,toDotPath:()=>p0,toJSONSchema:()=>Wc,toZod:()=>ni,treeifyError:()=>ql,urlHostnameOk:()=>Wa,urlProtocolOk:()=>Va,util:()=>j,validate:()=>fi,validateAsync:()=>mi,validateURL:()=>Za,version:()=>Qd,withParser:()=>uc});var j={};Nt(j,{BIGINT_FORMAT_RANGES:()=>ai,CONSTANT_CATCH:()=>Ca,Class:()=>$l,NUMBER_FORMAT_RANGES:()=>si,aborted:()=>Xe,allowsEval:()=>Ol,assert:()=>dw,assertEqual:()=>aw,assertIs:()=>uw,assertNever:()=>lw,assertNotEqual:()=>cw,assignProp:()=>We,attachSchema:()=>ga,base64ToUint8Array:()=>s0,base64urlToUint8Array:()=>Rw,cached:()=>Br,captureStackTrace:()=>fa,cleanEnum:()=>Mw,cleanRegex:()=>ln,clone:()=>ie,cloneDef:()=>mw,codePointLength:()=>ar,constantCatch:()=>Vl,createTransparentProxy:()=>bw,defineLazy:()=>El,defineLazyInternal:()=>Y,derived:()=>Ew,esc:()=>Je,escapeRegex:()=>Lt,explicitlyAborted:()=>jl,extend:()=>xw,finalizeIssue:()=>lt,floatSafeRemainder:()=>ri,getElementAtPath:()=>hw,getEnumValues:()=>Hr,getLengthableOrigin:()=>ui,getParsedType:()=>yw,getSizableOrigin:()=>ci,hexToUint8Array:()=>Aw,hide:()=>li,installLazyProp:()=>zw,isObject:()=>sr,isPlainObject:()=>Pt,issue:()=>Kr,joinValues:()=>da,jsonStringifyReplacer:()=>Fr,members:()=>Wl,merge:()=>Sw,mergeDefs:()=>Zt,normalizeParams:()=>P,nullish:()=>pa,numKeys:()=>kw,objectClone:()=>pw,omit:()=>ww,optionalKeys:()=>zl,own:()=>Rn,parsedType:()=>Zl,partial:()=>_w,pick:()=>vw,prefixIssues:()=>ut,primitiveTypes:()=>Nl,promiseAllObject:()=>gw,propertyKeyTypes:()=>ii,randomString:()=>Cw,rawShape:()=>Ur,required:()=>Pw,safeExtend:()=>Iw,shallowClone:()=>oi,slugify:()=>Dl,stringifyPrimitive:()=>ma,toZod:()=>ni,uint8ArrayToBase64:()=>a0,uint8ArrayToBase64url:()=>Tw,uint8ArrayToHex:()=>$w,unwrapMessage:()=>Vr});function aw(e){return e}function cw(e){return e}function ni(){return e=>e}function uw(e){}function lw(e){throw new Error("Unexpected value in exhaustive check")}function dw(e){}function Hr(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function da(e,t="|"){return e.map(n=>ma(n)).join(t)}function Fr(e,t){return typeof t=="bigint"?t.toString():t}var Al=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Br(e){return new Al(e)}function pa(e){return e==null}function ln(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ri(e,t){let n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}var n0=Symbol("evaluating");function El(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==n0)return r===void 0&&(r=n0,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function pw(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function We(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ur(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function un(e){return Ur(e._zod.def)??e._zod.def.shape}function r0(e,t,n){Object.defineProperty(e,t,{get(){let r=n();return We(this,t,r),r},enumerable:!0,configurable:!0})}function o0(e,t,n){t in e?We(e,t,n):e[t]=n}function ir(e,t,n,r){let o=un(t);for(let i of n){let s=Object.getOwnPropertyDescriptor(o,i);s.enumerable&&(s.get?r0(e,i,()=>{let a=t._zod.def.shape[i];return r?r(a,i):a}):o0(e,i,r?r(s.value,i):s.value))}}function fw(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?r0(e,n,()=>t[n]):o0(e,n,r.value))}}function Zt(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function mw(e){return Zt(e._zod.def)}function hw(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function gw(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=r[i];return o})}function Cw(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function Je(e){return JSON.stringify(e)}function Dl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function sr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Ol=Br(()=>{if(Ee.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Pt(e){if(sr(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(sr(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function oi(e){return Pt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function kw(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var yw=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ii=new Set(["string","number","symbol"]),Nl=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Lt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ie(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function P(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bw(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,i){return t??(t=e()),Reflect.set(t,r,o,i)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function ma(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zl(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var si={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ai={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function vw(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i={};return ir(i,e,ha(e,t)),ie(e,Zt(n,{shape:i,checks:[]}))}function ha(e,t){let n=un(e),r=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&r.push(o)}return r}function ww(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(ha(e,t)),s={};return ir(s,e,Reflect.ownKeys(un(e)).filter(a=>!i.has(a))),ie(e,Zt(n,{shape:s,checks:[]}))}function xw(e,t){if(!Pt(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=un(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ie(e,Zt(e._zod.def,{shape:i0(e,t)}))}function i0(e,t){let n={};return ir(n,e,Reflect.ownKeys(un(e))),fw(n,t),n}function Iw(e,t){if(!Pt(t))throw new Error("Invalid input to safeExtend: expected a plain object");return ie(e,Zt(e._zod.def,{shape:i0(e,t)}))}function Sw(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};ir(n,e,Reflect.ownKeys(un(e))),ir(n,t,Reflect.ownKeys(un(t)));let r=Zt(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ie(e,r)}function _w(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(ha(t,n)):void 0,c={};return ir(c,t,Reflect.ownKeys(un(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),ie(t,Zt(t._zod.def,{shape:c,checks:[]}))}function Pw(e,t,n){let r=n?new Set(ha(t,n)):void 0,o={};return ir(o,t,Reflect.ownKeys(un(t)),(i,s)=>r&&!r.has(s)?i:new e({type:"nonoptional",innerType:i})),ie(t,Zt(t._zod.def,{shape:o}))}function Xe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function jl(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ut(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Vr(e){return typeof e=="string"?e:e?.message}function ga(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function lt(e,t,n){var r;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Vr(e.inst?._zod.def?.error?.(e))??Vr(i?.(e))??Vr(t?.error?.(e))??Vr(n.customError?.(e))??Vr(n.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=s,t?.reportInput&&(a.input=e.input),a}function ci(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Lw=/[\uD800-\uDBFF]/;function ar(e){let t=e.length;if(!Lw.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function ui(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Zl(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Kr(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function Mw(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function s0(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function a0(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Rw(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return s0(t+n)}function Tw(e){return a0(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Aw(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function $w(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var $l=class{constructor(...t){}};function Wl(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Dw(e,n,r.value)}}function Rn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function li(e,t,n){return Rn(e,t,n,!1)}function Ew(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Rn(this,n,r(this))},set(o){Rn(this,n,o)}})}return t}function Dw(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Rn(this,t,n.bind(this))},set(r){Rn(this,t,r)}})}function Ow(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Tl,Mn=!1,Nw={configurable:!0,get(){Mn=!0}};function Y(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Tl!==e._zod){Tl=void 0;return}Tl=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Nw);let o=Mn;Mn=!1;try{let i=n(this);return Mn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i}),Mn=Mn||o,i}catch(i){throw delete this[t],Mn=Mn||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function zw(e,t,n,r){let o=Ow(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,i),i.value=n(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:i})}})}var Ca="~constantCatch";function Vl(e){let t=()=>e;return t[Ca]=!0,t}var c0,Fl=Object.freeze({status:"aborted"}),Hl={value:void 0,enumerable:!1},u0="captureStackTrace"in Error?Error:null;function jw(e){let t=u0;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return u0=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(e,t,n,r){let o={};function i(m){this.def=m,this.constr=d,this.traits=new Set}i.prototype=o;let s=n,a=s&&new WeakSet;function c(m,p){if(m._zod){if(m._zod.traits.has(e))return}else{Hl.value=new i(p);try{Object.defineProperty(m,"_zod",Hl)}finally{Hl.value=void 0}}if(m._zod.traits.add(e),t(m,p),a){let g=Object.getPrototypeOf(m),C=m._zod.constr.prototype,w=g;for(;w&&w!==C;)w=Object.getPrototypeOf(w);let y=w??g;a.has(y)||(a.add(y),Wl(y,s))}let h=d.prototype;for(let g in h)Object.prototype.hasOwnProperty.call(h,g)&&(g in m||(m[g]=h[g].bind(m)))}let u=r?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(m){let p=r?.Parent?jw(l):this;c(p,m);let h=p._zod.deferred;if(h){for(let C of h)C();p._zod.deferred=void 0}let g=globalThis.__zod_globalConfig?.postProcessor;return g&&g(p),p}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:m=>r?.Parent&&m instanceof r.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Bl=Symbol("zod_brand"),dt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Tn=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(c0=globalThis).__zod_globalConfig??(c0.__zod_globalConfig={});var Ee=globalThis.__zod_globalConfig;function ke(e){return e&&Object.assign(Ee,e),Ee}function Zw(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Fr,2)),e.message}function Ww(e){this._zod.message=e}var Vw={get:Zw,set:Ww,enumerable:!0,configurable:!0},Kl={value:void 0,enumerable:!1},l0=new WeakSet([Object.prototype,Error.prototype]),d0=(e,t)=>{e.name="$ZodError",Kl.value=t,Object.defineProperty(e,"issues",Kl),Kl.value=void 0,Object.defineProperty(e,"message",Vw);let n=Object.getPrototypeOf(e);l0.has(n)||(l0.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},Gl=k("$ZodError",d0),pt=k("$ZodError",d0,void 0,{Parent:Error});function Hw(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function di(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?Hw(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function pi(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")r({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")r({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)n._errors.push(t(s));else{let c=n,u=0;for(;u<a.length;){let l=a[u],d=u===a.length-1;if(l==="_errors"){d&&c._errors.push(t(s)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];d&&m._errors.push(t(s)),c=m,u++}}}};return r(e),n}function ql(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var s;for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>r({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{let c=[...i,...a.path];if(c.length===0){n.errors.push(t(a));continue}let u=n,l=0;for(;l<c.length;){let d=c[l],m=l===c.length-1;typeof d=="string"?(u.properties??(u.properties={}),Object.prototype.hasOwnProperty.call(u.properties,d)||Object.defineProperty(u.properties,d,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),u=u.properties[d]):(u.items??(u.items=[]),(s=u.items)[d]??(s[d]={errors:[]}),u=u.items[d]),m&&u.errors.push(t(a)),l++}}};return r(e),n}function p0(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function Yl(e){let t=[],n=[...e.issues].sort((r,o)=>(r.path??[]).length-(o.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${p0(r.path)}`);return t.join(`
|
|
6
6
|
`)}function ka(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Gr=e=>{let t=(n,r,o,i)=>{let s=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new dt;if(a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>lt(u,s,ke())));throw fa(c,i?.callee??t),c}return a.value};return t},ya=Gr(pt),qr=e=>{let t=async(n,r,o,i)=>{let s=o?{...o,async:!0}:{async:!0},a=n._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(i?.Err??e)(a.issues.map(u=>lt(u,s,ke())));throw fa(c,i?.callee??t),c}return a.value};return t},ba=qr(pt),Yr=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new dt;return i.issues.length?f0(e,i.issues,o):{success:!0,data:i.value}},Bw=Yr(pt);function f0(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>lt(o,n,ke()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}var Jr=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?f0(e,i.issues,o):{success:!0,data:i.value}},Uw=Jr(pt),Kw=Symbol.for("zod.compile.invalid"),Gw=Symbol.for("zod.compile.fallback"),fi=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Kw)return!0;if(r.definite===!0&&n===void 0)return!1}return qw(e,t,n)});function qw(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o?(r[Gw]=!0,i=o({value:t,issues:[]},r)):i=e._zod.run({value:t,issues:[]},r),i instanceof Promise)throw new dt;return i.issues.length===0}var mi=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},va=e=>{let t=Gr(e),n=(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(r,o,a,ka(n,s))};return n},Yw=va(pt),wa=e=>{let t=Gr(e),n=(r,o,i,s)=>t(r,o,i,ka(n,s));return n},Jw=wa(pt),xa=e=>{let t=qr(e),n=async(r,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(r,o,a,ka(n,s))};return n},Xw=xa(pt),Ia=e=>{let t=qr(e),n=async(r,o,i,s)=>await t(r,o,i,ka(n,s));return n},Qw=Ia(pt),Sa=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return Yr(e)(t,n,o)},ex=Sa(pt),_a=e=>(t,n,r)=>Yr(e)(t,n,r),tx=_a(pt),Pa=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return Jr(e)(t,n,o)},nx=Pa(pt),La=e=>async(t,n,r)=>Jr(e)(t,n,r),rx=La(pt);var Mt={};Nt(Mt,{anyString:()=>xd,base64:()=>md,base64url:()=>hd,bigint:()=>Sd,boolean:()=>_d,browserEmail:()=>dx,cidrv4:()=>pd,cidrv6:()=>fd,creditCard:()=>Ma,cuid:()=>Xl,cuid2:()=>Ql,currencyCode:()=>yd,date:()=>bd,datetime:()=>wd,domain:()=>Cd,duration:()=>id,e164:()=>kd,email:()=>ad,emoji:()=>cd,extendedDuration:()=>ox,guid:()=>sd,hex:()=>Td,hostname:()=>gd,html5Email:()=>cx,httpProtocol:()=>hi,iban:()=>Ra,idnEmail:()=>lx,integer:()=>gi,ipv4:()=>ud,ipv6:()=>ld,ksuid:()=>nd,lowercase:()=>Md,mac:()=>dd,md5_base64:()=>hx,md5_base64url:()=>gx,md5_hex:()=>mx,nanoid:()=>rd,nanoidOfLength:()=>od,null:()=>Pd,number:()=>dn,rfc5322Email:()=>ux,sha1_base64:()=>kx,sha1_base64url:()=>yx,sha1_hex:()=>Cx,sha256_base64:()=>vx,sha256_base64url:()=>wx,sha256_hex:()=>bx,sha384_base64:()=>Ix,sha384_base64url:()=>Sx,sha384_hex:()=>xx,sha512_base64:()=>Px,sha512_base64url:()=>Lx,sha512_hex:()=>_x,string:()=>Id,time:()=>vd,ulid:()=>ed,undefined:()=>Ld,unicodeEmail:()=>m0,uppercase:()=>Rd,uuid:()=>cr,uuid4:()=>ix,uuid6:()=>sx,uuid7:()=>ax,xid:()=>td});var Xl=/^[cC][0-9a-z]{6,}$/,Ql=/^[0-9a-z]+$/,ed=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,td=/^[0-9a-vA-V]{20}$/,nd=/^[A-Za-z0-9]{27}$/,rd=/^[a-zA-Z0-9_-]{21}$/;function od(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var id=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ox=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sd=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ix=cr(4),sx=cr(6),ax=cr(7),ad=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,cx=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ux=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,m0=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,lx=m0,dx=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,px="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function cd(){return new RegExp(px,"u")}var ud=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ld=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,dd=e=>{let t=Lt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},pd=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,fd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,md=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hd=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,gd=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Cd=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,hi=/^https?$/,kd=/^\+[1-9]\d{6,14}$/,Ma=/^\d(?:[ -]?\d){11,18}$/,yd=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Ra=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,h0="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function fx(e){return new RegExp(`^${e}$`)}var bd=fx(h0);function Jl(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vd(e){return new RegExp(`^${Jl(e)}$`)}function wd(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${Jl({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Jl({precision:e.precision})}`:n;return new RegExp(`^${h0}T(?:${r})$`)}var xd=/^[\s\S]{0,}$/,Id=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Sd=/^-?\d+n?$/,gi=/^-?\d+$/,dn=/^-?\d+(?:\.\d+)?$/,_d=/^(?:true|false)$/i,Pd=/^null$/i;var Ld=/^undefined$/i;var Md=/^[^A-Z]*$/,Rd=/^[^a-z]*$/,Td=/^[0-9a-fA-F]*$/;function Ci(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function ki(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var mx=/^[0-9a-fA-F]{32}$/,hx=Ci(22,"=="),gx=ki(22),Cx=/^[0-9a-fA-F]{40}$/,kx=Ci(27,"="),yx=ki(27),bx=/^[0-9a-fA-F]{64}$/,vx=Ci(43,"="),wx=ki(43),xx=/^[0-9a-fA-F]{96}$/,Ix=Ci(64,""),Sx=ki(64),_x=/^[0-9a-fA-F]{128}$/,Px=Ci(86,"=="),Lx=ki(86);var de=k("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ad=e=>{let t=e.value;return!pa(t)&&t.size!==void 0},$d=e=>{let t=e.value;return!pa(t)&&t.length!==void 0},Ta={number:"number",bigint:"bigint",object:"date"},$a=k("$ZodCheckLessThan",(e,t)=>{de.init(e,t);let n=Ta[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Ta[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ea=k("$ZodCheckGreaterThan",(e,t)=>{de.init(e,t);let n=Ta[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Ta[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ed=k("$ZodCheckMultipleOf",(e,t)=>{de.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):ri(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Dd=k("$ZodCheckNumberFormat",(e,t)=>{de.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=si[t.format];e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Od=k("$ZodCheckBigIntFormat",(e,t)=>{de.init(e,t);let[n,r]=ai[t.format];e._zod.check=o=>{let i=o.value;i<n&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),Nd=k("$ZodCheckMaxSize",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=Ad),e._zod.check=r=>{let o=r.value;o.size<=t.maximum||r.issues.push({origin:ci(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),zd=k("$ZodCheckMinSize",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=Ad),e._zod.check=r=>{let o=r.value;o.size>=t.minimum||r.issues.push({origin:ci(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),jd=k("$ZodCheckSizeEquals",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=Ad),e._zod.check=r=>{let o=r.value,i=o.size;if(i===t.size)return;let s=i>t.size;r.issues.push({origin:ci(o),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Zd=k("$ZodCheckMaxLength",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=$d),e._zod.check=r=>{let o=r.value,i=o.length;if((typeof o=="string"&&i>t.maximum?ar(o):i)<=t.maximum)return;let a=ui(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Wd=k("$ZodCheckMinLength",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=$d),e._zod.check=r=>{let o=r.value,i=o.length;if((typeof o=="string"&&i>=t.minimum&&i<t.minimum*2?ar(o):i)>=t.minimum)return;let a=ui(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Vd=k("$ZodCheckLengthEquals",(e,t)=>{var n;de.init(e,t),(n=e._zod.def).when??(n.when=$d),e._zod.check=r=>{let o=r.value,i=o.length,s=typeof o=="string"&&i>=t.length&&i<=t.length*2?ar(o):i;if(s===t.length)return;let a=ui(o),c=s>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Xr=k("$ZodCheckStringFormat",(e,t)=>{var n,r;de.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Hd=k("$ZodCheckRegex",(e,t)=>{Xr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Fd=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Md),Xr.init(e,t)}),Bd=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Rd),Xr.init(e,t)}),Ud=k("$ZodCheckIncludes",(e,t)=>{de.init(e,t);let n=Lt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Kd=k("$ZodCheckStartsWith",(e,t)=>{de.init(e,t);let n=new RegExp(`^${Lt(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Gd=k("$ZodCheckEndsWith",(e,t)=>{de.init(e,t);let n=new RegExp(`.*${Lt(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function Aa(e,t,n){e.issues.length&&t.issues.push(...ut(n,e.issues))}var qd=k("$ZodCheckProperty",(e,t)=>{de.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(o=>Aa(o,n,t.property));Aa(r,n,t.property)}}),Yd=k("$ZodCheckProperties",(e,t)=>{de.init(e,t),li(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(s=>[s,t.shape[s]]));let o=r.value,i;for(let[s,a]of n){let c=a._zod.run({value:o[s],issues:[]},{});c instanceof Promise?(i??(i=[]),i.push(c.then(u=>Aa(u,r,s)))):Aa(c,r,s)}if(i)return Promise.all(i).then(()=>{})}}),Jd=k("$ZodCheckMimeType",(e,t)=>{de.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),Xd=k("$ZodCheckOverwrite",(e,t)=>{de.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ur=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
|
|
7
7
|
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
8
8
|
${n.join(`
|
|
@@ -63,4 +63,4 @@ ${c}`:c:"",l=Function,d=`return (input) => {
|
|
|
63
63
|
${c}
|
|
64
64
|
}`,m;try{m=new l(...s,d)(...a)}catch(p){throw new J(`this schema (generated code failed to evaluate: ${p.message})`)}return t?.debug&&(m.code=u),m.definite=r.definite,m}function U(e,t){for(let[r,o]of e.constants)if(o===t)return r;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function fr(e,t){return e.definite=!1,U(e,t)}function V(e){return`v${e.varCounter++}`}function Fx(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then=="function")return Qe;let r=n;return r.issues.length===0?r.value:Qe}function Ue(e,t,n,r,o=!0){let i=e.content.length,s=t.constants.size,a=t.constantCounter,c=t.varCounter;try{return he(e,t,n,r,o)}catch(u){if(!(u instanceof J)||!u.islandable)throw u;if(e.content.length=i,t.constants.size>s){let l=Array.from(t.constants.keys()).slice(s);for(let d of l)t.constants.delete(d)}return t.constantCounter=a,t.varCounter=c,Bx(e,t,n,r)}}function Bx(e,t,n,r){t.definite=!1;let o=U(t,n),i=U(t,Fx),s=V(t);return e.write(`const ${s} = ${i}(${o}, ${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}var Ux=new Set(["max_size","min_size","size_equals","max_length","min_length","length_equals"]);function Kx(e,t,n,r){let o=n._zod.def.checks;if(!o||o.length===0)return r;let i=r;for(let s of o){let a=s._zod.def;if(a.when&&!Ux.has(a.check))throw new J('check with a custom "when" condition');switch(a.check){case"greater_than":Gx(e,t,a,i);break;case"less_than":qx(e,t,a,i);break;case"multiple_of":Yx(e,t,a,i);break;case"number_format":q0(e,a,i);break;case"min_length":{let c=dr(a.minimum,"min_length"),u=Cp(e,t,i,`${i}.length >= ${c} && ${i}.length < ${a.minimum*2}`);e.write(`if (${u} < ${c}) return INVALID;`);break}case"max_length":{let c=dr(a.maximum,"max_length"),u=Cp(e,t,i,`${i}.length > ${c}`);e.write(`if (${u} > ${c}) return INVALID;`);break}case"length_equals":{let c=dr(a.length,"length_equals"),u=Cp(e,t,i,`${i}.length >= ${c} && ${i}.length <= ${a.length*2}`);e.write(`if (${u} !== ${c}) return INVALID;`);break}case"min_size":e.write(`if (${i}.size < ${dr(a.minimum,"min_size")}) return INVALID;`);break;case"max_size":e.write(`if (${i}.size > ${dr(a.maximum,"max_size")}) return INVALID;`);break;case"size_equals":e.write(`if (${i}.size !== ${dr(a.size,"size_equals")}) return INVALID;`);break;case"string_format":i=Y0(e,t,a,i);break;case"custom":i=nI(e,t,s,i);break;case"bigint_format":Jx(e,a,i);break;case"mime_type":Xx(e,t,a,i);break;case"property":eI(e,t,a,i);break;case"properties":Qx(e,t,a,i);break;case"overwrite":{let c=V(t);tI(e,t,s,i,c),i=c;break}default:throw new J(`check type ${a.check}`)}}return i}function Cp(e,t,n,r){let o=U(t,ar),i=V(t);return e.write(`const ${i} = typeof ${n} === "string" && ${r} ? ${o}(${n}) : ${n}.length;`),i}function dr(e,t){if(typeof e!="number"||!Number.isFinite(e))throw new J(`${t} bound of type ${typeof e}`);return`${e}`}function G0(e,t){if(typeof t=="bigint")return`${t}n`;if(typeof t=="number"){if(Number.isNaN(t))throw new J("comparison check with NaN bound");return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new J("comparison check with Invalid Date bound");return U(e,t)}throw new J(`comparison check bound of type ${typeof t}`)}function Gx(e,t,n,r){let o=n.inclusive?"<":"<=";e.write(`if (${r} ${o} ${G0(t,n.value)}) return INVALID;`)}function qx(e,t,n,r){let o=n.inclusive?">":">=";e.write(`if (${r} ${o} ${G0(t,n.value)}) return INVALID;`)}function Yx(e,t,n,r){if(typeof n.value=="bigint"){if(n.value===BigInt(0))throw new J("multiple_of check with a zero divisor");e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let o=U(t,ri);e.write(`if (${o}(${r}, ${dr(n.value,"multiple_of")}) !== 0) return INVALID;`)}}function q0(e,t,n){let r=t.format;switch(r){case"safeint":e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case"int32":e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case"uint32":e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case"float32":e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case"float64":e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new J(`number format ${r}`)}}function Jx(e,t,n){let r=t.format;if(r)switch(r){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new J(`bigint format ${r}`)}}function Xx(e,t,n,r){let o=n.mime;if(o&&o.length>0){let i=U(t,new Set(o));e.write(`if (!${i}.has(${r}.type)) return INVALID;`)}}function Qx(e,t,n,r){if(n.when)throw new J('check with a custom "when" condition');e.write(`if (${r} == null) return INVALID;`);let o=n.shape;for(let i of Reflect.ownKeys(o)){let s=typeof i=="symbol"?U(t,i):Je(i),a=V(t);e.write(`const ${a} = ${r}[${s}];`),Ue(e,t,o[i],a,!1)}}function eI(e,t,n,r){let o=`${r}[${JSON.stringify(n.property)}]`;he(e,t,n.schema,o)}function tI(e,t,n,r,o){let i=n._zod.def.tx;if(!i)throw new J("overwrite check without a transform function");if(mr(i))throw new Wt("z.compile: async overwrite transforms are not supported");let s=U(t,i);e.write(`const ${o} = ${s}(${r});`)}function kp(){throw new dt}function vp(e){this.issues.push(e)}function nI(e,t,n,r){let o=n._zod.def;if(o.fn){if(mr(o.fn))throw new Wt("z.compile: async .refine() predicates are not supported");let i=fr(t,o.fn),s=U(t,kp),a=V(t);return e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`),r}if(n._zod.check){if(mr(n._zod.check))throw new Wt("z.compile: async .superRefine() / check functions are not supported");let i=n._zod.check,a=fr(t,u=>{let l={value:u,issues:[],addIssue:vp};return i(l)instanceof Promise&&kp(),l.issues.length===0?l.value:Qe}),c=V(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}throw new J("custom check without a predicate or check function")}var rI=new Set(["cidrv4","cuid","cuid2","date","datetime","duration","e164","email","emoji","ends_with","guid","includes","ipv4","ksuid","lowercase","mac","nanoid","regex","starts_with","time","ulid","uppercase","uuid","xid"]);function Y0(e,t,n,r,o=!0){let i=n.format;if(i==="base64"){let u=U(t,wi);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="base64url"){let u=U(t,Ba);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="jwt"){let u=U(t,Ga),l=U(t,n.alg??null);return e.write(`if (!${u}(${r}, ${l})) return INVALID;`),r}if(i==="ipv6"){let u=U(t,vi);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="cidrv6"){let u=U(t,Ha);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="credit_card"){let u=U(t,Ua);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(i==="iban"){let u=U(t,Ka);return e.write(`if (!${u}(${r})) return INVALID;`),r}let s=n;if(i==="url"||i==="httpurl"||s.normalize||s.hostname!==void 0||s.protocol!==void 0){let u=U(t,Za),l=U(t,n),d=V(t),m=V(t);if(e.write(`const ${d} = ${r}.trim();`),e.write(`const ${m} = ${u}(${d}, ${l});`),e.write(`if (typeof ${m} === "number") return INVALID;`),s.hostname!==void 0){let g=U(t,Wa);e.write(`if (!${g}(${m}, ${l}.hostname)) return INVALID;`)}if(s.protocol!==void 0){let g=U(t,Va);e.write(`if (!${g}(${m}, ${l}.protocol)) return INVALID;`)}if(!o)return null;let p=V(t),h=s.normalize?`${m}.href`:`${U(t,bi)}(${d})`;return e.write(`const ${p} = ${h};`),p}let a=n.fn;if(a){if(mr(a))throw new J(`async string format ${i}`);let u=U(t,a);return e.write(`if (!${u}(${r})) return INVALID;`),r}if(rI.has(i)&&n.pattern){let u=U(t,n.pattern);return e.write(`${u}.lastIndex = 0;`),e.write(`if (!${u}.test(${r})) return INVALID;`),r}let c=n.format;switch(c){case"regex":throw new J("regex format without a pattern");case"lowercase":e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case"uppercase":e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case"includes":e.write(`if (!${r}.includes(${Je(n.includes)})) return INVALID;`);break;case"starts_with":{let u=n.prefix;e.write(`if (${r}.slice(0, ${u.length}) !== ${Je(u)}) return INVALID;`);break}case"ends_with":{let u=n.suffix;e.write(`if (${r}.slice(-${u.length}) !== ${Je(u)}) return INVALID;`);break}default:throw new J(`string format ${c}`)}return r}function he(e,t,n,r,o=!0){let i=n._zod.def,s=i.type;if(i.coerce)throw new J(`coercion (z.coerce.${s}())`);let a=o||!!i.checks?.length,c;switch(s){case"string":c=oI(e,t,n,r,a);break;case"number":c=iI(e,n,r);break;case"boolean":c=sI(e,r);break;case"bigint":c=aI(e,n,r);break;case"symbol":c=cI(e,r);break;case"undefined":c=uI(e,r);break;case"null":c=lI(e,r);break;case"any":case"unknown":c=r;break;case"never":e.write("return INVALID;"),c=r;break;case"void":c=dI(e,r);break;case"nan":c=pI(e,r);break;case"date":c=fI(e,r);break;case"object":c=mI(e,t,n,r,a);break;case"optional":c=hI(e,t,n,r,a);break;case"nullable":c=kI(e,t,n,r,a);break;case"array":c=yI(e,t,n,r,a);break;case"literal":c=bI(e,t,n,r);break;case"enum":c=vI(e,t,n,r);break;case"readonly":{let u=B0(e,t,n,r),l=V(t);e.write(`const ${l} = Object.freeze(${u});`),c=l;break}case"success":B0(e,t,n,r),c="true";break;case"default":case"prefault":c=wI(e,t,n,r);break;case"nonoptional":c=xI(e,t,n,r);break;case"tuple":c=II(e,t,n,r);break;case"union":c=SI(e,t,n,r);break;case"intersection":c=LI(e,t,n,r);break;case"record":c=MI(e,t,n,r);break;case"map":c=TI(e,t,n,r);break;case"set":c=AI(e,t,n,r);break;case"file":c=$I(e,r);break;case"template_literal":c=EI(e,t,n,r);break;case"lazy":c=DI(e,t,n,r);break;case"pipe":c=OI(e,t,n,r);break;case"custom":c=NI(e,t,n,r);break;case"transform":c=ZI(e,t,n,r);break;case"catch":c=jI(e,t,n,r);break;default:throw new J(`schema type ${s}`)}return c===null?null:Kx(e,t,n,c)}function oI(e,t,n,r,o=!0){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.def;return i.format===void 0?r:Y0(e,t,i,r,o)}function iI(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check==="number_format"&&r.format&&q0(e,{format:r.format},n),n}function sI(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function aI(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case"int64":e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case"uint64":e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break}return n}function cI(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function uI(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function lI(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function dI(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function pI(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function fI(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function mI(e,t,n,r,o=!0){let i=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let s=i.shape,a=Object.keys(s),c=Object.getOwnPropertySymbols(s),u=c.length?[...a,...c]:a,l=y=>typeof y=="symbol"?U(t,y):Je(y),d=y=>typeof y=="symbol"?`[${l(y)}]`:Je(y),m=s;if(a.includes("__proto__"))throw new J('object shape key "__proto__"');let p=new Map;for(let y of u){let S=m[y],T=l(y),L=V(t);if(e.write(`const ${L} = ${r}[${T}];`),S._zod.optin!==void 0){let M=V(t);e.write(`let ${M} = (() => {`),e.indented(E=>{let B=Ue(E,t,S,L);E.write(`return ${B};`)}),e.write("})();"),S._zod.optout==="optional"?(e.write(`if (${M} === INVALID) {`),e.indented(E=>{E.write(`if (${T} in ${r}) return INVALID;`),E.write(`${M} = undefined;`)}),e.write("}")):e.write(`if (${M} === INVALID) return INVALID;`),p.set(y,M)}else{CI(S)&&e.write(`if (!(${T} in ${r})) return INVALID;`);let M=Ue(e,t,S,L,o);M!==null&&p.set(y,M)}}let h=i.catchall,g="none";if(h){let y=h._zod.def.type;if(y==="never"){let S=a.map(T=>`k !== ${Je(T)}`).join(" && ")||"true";e.write(`for (const k in ${r}) {`),e.indented(T=>{T.write(`if (${S}) return INVALID;`)}),e.write("}")}else(y==="unknown"||y==="any")&&!h._zod.def.checks?.length?g="passthrough":g="schema"}let C=V(t),w=u.some(y=>F0(m[y])||yp(m[y]));if(!o){if(g==="schema"){let y=a.length>0?U(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(S=>{S.write('if (k === "__proto__") continue;'),y&&S.write(`if (${y}.has(k)) continue;`);let T=V(t);S.write(`const ${T} = ${r}[k];`),Ue(S,t,h,T,!1)}),e.write("}")}return null}if(w){e.write(`const ${C} = {};`);for(let y of u){let S=l(y),T=p.get(y);yp(m[y])?e.write(`if (${S} in ${r}) ${C}[${S}] = ${T};`):F0(m[y])?e.write(`if (${T} !== undefined || ${S} in ${r}) ${C}[${S}] = ${T};`):e.write(`${C}[${S}] = ${T};`)}}else{let y=u.map(S=>`${d(S)}: ${p.get(S)}`).join(", ");e.write(`const ${C} = { ${y} };`)}if(g!=="none"){let y=a.length>0?U(t,new Set(a)):null;e.write(`for (const k in ${r}) {`),e.indented(S=>{if(S.write('if (k === "__proto__") continue;'),y&&S.write(`if (${y}.has(k)) continue;`),g==="passthrough")S.write(`${C}[k] = ${r}[k];`);else{let T=V(t);S.write(`const ${T} = ${r}[k];`);let L=Ue(S,t,h,T);S.write(`${C}[k] = ${L};`)}}),e.write("}")}return C}function hI(e,t,n,r,o=!0){let i=n._zod.def;if(gI(n))return he(e,t,i.innerType,r,o);if(i.innerType._zod.optin==="defaulted"){let a=V(t),c=V(t);return e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(u=>{u.write(`const ${c} = (() => {`),u.indented(l=>{let d=he(l,t,i.innerType,r);l.write(`return ${d};`)}),u.write("})();"),u.write(`if (${c} !== INVALID) ${a} = ${c};`)}),e.write("} else {"),e.indented(u=>{let l=he(u,t,i.innerType,r);u.write(`${a} = ${l};`)}),e.write("}"),a}let s=o?V(t):null;return s&&e.write(`let ${s};`),e.write(`if (${r} !== undefined) {`),e.indented(a=>{let c=he(a,t,i.innerType,r,o);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function gI(e){return e._zod.traits?.has("$ZodExactOptional")===!0}function CI(e){return e._zod.optin===void 0&&pr(e)}function pr(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case"any":case"unknown":case"undefined":case"void":case"default":case"prefault":case"transform":case"custom":case"lazy":return!0;case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"never":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":return!1;case"nonoptional":return t.innerType?pr(t.innerType):!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":case"nullable":case"readonly":case"success":return t.innerType?pr(t.innerType):!0;case"catch":return!0;case"union":return t.options?t.options.some(pr):!0;case"intersection":return!t.left||!t.right?!0:pr(t.left)&&pr(t.right);case"pipe":return t.in?pr(t.in):!0;default:return!0}}function yp(e){return e._zod.optin==="optional"&&e._zod.optout==="optional"}function F0(e){return(e._zod.optin!=="defaulted"||e._zod.optout==="optional")&&to(e)}function to(e){let t=e._zod.def;switch(t.type){case"string":case"number":case"boolean":case"bigint":case"symbol":case"null":case"nan":case"date":case"object":case"array":case"tuple":case"record":case"map":case"set":case"file":case"template_literal":case"never":case"success":return!1;case"literal":return!!t.values?.includes(void 0);case"enum":return!!e._zod.values?.has(void 0);case"optional":return!0;case"nullable":case"readonly":case"nonoptional":return t.innerType?to(t.innerType):!0;case"union":return t.options?t.options.some(to):!0;case"intersection":return!t.left||!t.right||to(t.left)||to(t.right);case"pipe":return t.out?to(t.out):!0;default:return!0}}function kI(e,t,n,r,o=!0){let i=n._zod.def,s=o?V(t):null;return s&&e.write(`let ${s} = null;`),e.write(`if (${r} !== null) {`),e.indented(a=>{let c=he(a,t,i.innerType,r,o);s&&c!==null&&a.write(`${s} = ${c};`)}),e.write("}"),s}function yI(e,t,n,r,o=!0){let i=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`);let s=o?V(t):null,a=V(t),c=V(t);return s&&e.write(`const ${s} = new Array(${r}.length);`),e.write(`for (let ${a} = 0; ${a} < ${r}.length; ${a}++) {`),e.indented(u=>{u.write(`const ${c} = ${r}[${a}];`);let l=Ue(u,t,i.element,c,o);s&&l!==null&&u.write(`${s}[${a}] = ${l};`)}),e.write("}"),s}function bI(e,t,n,r){let i=n._zod.def.values;if(i.length!==1){let a=U(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}let s=i[0];if(typeof s=="number"&&Number.isNaN(s)){let a=U(t,new Set(i));return e.write(`if (!${a}.has(${r})) return INVALID;`),r}if(typeof s=="string")e.write(`if (${r} !== ${Je(s)}) return INVALID;`);else if(typeof s=="number"||typeof s=="boolean")e.write(`if (${r} !== ${s}) return INVALID;`);else if(s===null)e.write(`if (${r} !== null) return INVALID;`);else if(s===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof s=="bigint")e.write(`if (${r} !== ${s}n) return INVALID;`);else throw new J(`literal type ${typeof s}`);return r}function vI(e,t,n,r){let o=n._zod.values;if(!o)throw new J("enum schema without enumerated values");let i=U(t,o);return e.write(`if (!${i}.has(${r})) return INVALID;`),r}function B0(e,t,n,r){let o=n._zod.def;return he(e,t,o.innerType,r)}function wI(e,t,n,r){let o=n._zod.def,s=Object.getOwnPropertyDescriptor(n._zod.def,"defaultValue")?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type==="prefault"){if(!s)return he(e,t,o.innerType,r);let c=U(t,s),u=V(t);return e.write(`let ${u} = ${r};`),e.write(`if (${r} === undefined) ${u} = ${c}();`),he(e,t,o.innerType,u)}let a=V(t);if(s){let c=U(t,s),u=U(t,oi);e.write(`let ${a};`),e.write(`if (${r} === undefined) {`),e.indented(l=>{l.write(`${a} = ${u}(${c}());`)}),e.write("} else {"),e.indented(l=>{let d=he(l,t,o.innerType,r);l.write(`${a} = ${d} === undefined ? ${u}(${c}()) : ${d};`)}),e.write("}")}else e.write(`let ${a};`),e.write(`if (${r} !== undefined) {`),e.indented(c=>{let u=he(c,t,o.innerType,r);c.write(`${a} = ${u};`)}),e.write("}");return a}function xI(e,t,n,r){let o=n._zod.def,i=he(e,t,o.innerType,r),s=V(t);return e.write(`const ${s} = ${i};`),e.write(`if (${s} === undefined) return INVALID;`),s}function II(e,t,n,r){let o=n._zod.def,i=o.items,s=o.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let a=U0(i,"optin"),c=U0(i,"optout");s?e.write(`if (${r}.length < ${a}) return INVALID;`):e.write(`if (${r}.length < ${a} || ${r}.length > ${i.length}) return INVALID;`);let u=V(t);e.write(`const ${u} = [];`);for(let l=0;l<i.length;l++){let d=i[l];if(l>=c)e.write(`if (${u}.length === ${l}) {`),e.indented(m=>{m.write(`if (${l} < ${r}.length) {`),m.indented(p=>{let h=V(t);p.write(`const ${h} = ${r}[${l}];`);let g=Ue(p,t,d,h);p.write(`${u}[${l}] = ${g};`)}),m.write("} else {"),m.indented(p=>{if(yp(d)){p.write(`${u}.length = ${l};`);return}let h=V(t),g=V(t);p.write(`const ${h} = undefined;`),p.write(`const ${g} = (() => {`),p.indented(C=>{let w=Ue(C,t,d,h);C.write(`return ${w};`)}),p.write("})();"),p.write(`if (${g} === INVALID || ${g} === undefined) ${u}.length = ${l};`),p.write(`else ${u}[${l}] = ${g};`)}),m.write("}")}),e.write("}");else{let m=V(t);e.write(`const ${m} = ${r}[${l}];`);let p=Ue(e,t,d,m);e.write(`${u}[${l}] = ${p};`)}}if(s){let l=V(t),d=V(t);e.write(`for (let ${l} = ${i.length}; ${l} < ${r}.length; ${l}++) {`),e.indented(m=>{m.write(`const ${d} = ${r}[${l}];`);let p=Ue(m,t,s,d);m.write(`${u}[${l}] = ${p};`)}),e.write("}")}return u}function U0(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function SI(e,t,n,r){let o=n._zod.def,i=o.options;if(o.discriminator)return _I(e,t,o,r);if(o.inclusive===!1)throw new J("exclusive unions (z.xor)");if(i.length===0)return e.write("return INVALID;"),r;if(i.length===1)return he(e,t,i[0],r);if(i.every(c=>c._zod.def.type==="literal"&&!c._zod.def.checks?.length)){let c=new Set(i.flatMap(l=>l._zod.def.values)),u=U(t,c);return e.write(`if (!${u}.has(${r})) return INVALID;`),r}let a=V(t);e.write(`let ${a};`);for(let c=0;c<i.length;c++){let u=i[c];c===0?e.write(`${a} = (() => {`):e.write(`if (${a} === INVALID) ${a} = (() => {`),e.indented(l=>{let d=he(l,t,u,r);l.write(`return ${d};`)}),e.write("})();")}return e.write(`if (${a} === INVALID) return INVALID;`),a}function _I(e,t,n,r){if(n.unionFallback)throw new J("discriminated union with unionFallback");if(n.options.length===0)return e.write("return INVALID;"),r;let o=V(t),i=V(t);e.write(`const ${o} = ${r}?.[${Je(n.discriminator)}];`),e.write(`let ${i};`);let s=!0,a=new Set;for(let c of n.options){let u=c._zod.propValues?.[n.discriminator];if(!u||u.size===0)throw new J("discriminated union option without static discriminator values");for(let m of u){if(a.has(m))throw new J(`duplicate discriminator value ${String(m)}`);a.add(m)}let l=Array.from(u,m=>PI(t,o,m)),d=s?"if":"else if";e.write(`${d} (${l.join(" || ")}) {`),e.indented(m=>{let p=he(m,t,c,r);m.write(`${i} = ${p};`)}),e.write("}"),s=!1}return e.write("else { return INVALID; }"),i}function PI(e,t,n){if(typeof n=="string")return`${t} === ${Je(n)}`;if(typeof n=="number")return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n=="boolean")return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n=="bigint")return`${t} === ${n}n`;if(typeof n=="symbol"){let r=U(e,n);return`${t} === ${r}`}throw new J(`literal discriminator value ${String(n)}`)}function LI(e,t,n,r){let o=n._zod.def;t.definite=!1;let i=Ue(e,t,o.left,r),s=Ue(e,t,o.right,r),a=U(t,Qr),c=V(t);return e.write(`const ${c} = ${a}(${i}, ${s});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function MI(e,t,n,r){let o=n._zod.def,i=U(t,Pt);e.write(`if (!${i}(${r})) return INVALID;`);let s=V(t),a=V(t),c=V(t);e.write(`const ${s} = {};`);let u=o,l=u.partial?void 0:o.keyType._zod.values;if(l){let p=[];for(let g of l){if(!(typeof g=="string"||typeof g=="number"||typeof g=="symbol"))throw new J(`record key value ${String(g)}`);let C=typeof g=="number"?g.toString():g;if(C==="__proto__")throw new J('record key "__proto__"');p.push(C);let w=U(t,g),y=he(e,t,o.keyType,w),S=V(t);e.write(`const ${S} = ${r}[${RI(t,C)}];`);let T=Ue(e,t,o.valueType,S);e.write(`${s}[${y}] = ${T};`)}let h=U(t,new Set(p));return e.write(`for (const ${a} in ${r}) {`),e.indented(g=>{g.write(`if (${h}.has(${a})) continue;`),u.mode==="loose"?g.write(`if (${a} !== "__proto__") ${s}[${a}] = ${r}[${a}];`):g.write("return INVALID;")}),e.write("}"),s}let d=o.keyType._zod.def;if(!(d.type==="string"&&d.format===void 0&&!d.coerce&&(d.checks?.length??0)===0)){let p=o.mode==="loose",h=lc(o.keyType);h.definite===!1&&(t.definite=!1);let g=U(t,h),C=U(t,dn),w=V(t);return K0(e,t,r,a,y=>{y.write(`let ${w} = ${g}(${a});`),y.write(`if (${w} === INVALID && typeof ${a} === "string" && ${C}.test(${a})) ${w} = ${g}(Number(${a}));`),p?y.write(`if (${w} === INVALID) { ${s}[${a}] = ${r}[${a}]; continue; }`):y.write(`if (${w} === INVALID) return INVALID;`),y.write(`if (${w} === "__proto__") continue;`);let S=V(t);y.write(`const ${S} = ${r}[${a}];`);let T=Ue(y,t,o.valueType,S);y.write(`${s}[${w}] = ${T};`)}),s}return K0(e,t,r,a,p=>{p.write(`const ${c} = ${r}[${a}];`);let h=Ue(p,t,o.valueType,c);p.write(`${s}[${a}] = ${h};`)},"return INVALID;"),s}function K0(e,t,n,r,o,i){let s=U(t,Object.prototype.propertyIsEnumerable),a=V(t),c=V(t),u=V(t);e.write(`const ${a} = Object.getOwnPropertySymbols(${n});`),e.write(`const ${c} = Object.getOwnPropertyNames(${n});`),e.write(`for (let ${u} = 0; ${u} < ${c}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${r} = ${c}[${u}];`),l.write(`if (${r} === "__proto__" || !${s}.call(${n}, ${r})) continue;`),o(l)}),e.write("}"),e.write(`for (let ${u} = 0; ${u} < ${a}.length; ${u}++) {`),e.indented(l=>{l.write(`const ${r} = ${a}[${u}];`),l.write(`if (!${s}.call(${n}, ${r})) continue;`),i?l.write(i):o(l)}),e.write("}")}function RI(e,t){return typeof t=="string"?Je(t):U(e,t)}function TI(e,t,n,r){let o=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`);let i=V(t),s=V(t),a=V(t);return e.write(`const ${i} = new Map();`),e.write(`for (const [${s}, ${a}] of ${r}) {`),e.indented(c=>{let u=he(c,t,o.keyType,s),l=he(c,t,o.valueType,a);c.write(`${i}.set(${u}, ${l});`)}),e.write("}"),i}function AI(e,t,n,r){let o=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`);let i=V(t),s=V(t);return e.write(`const ${i} = new Set();`),e.write(`for (const ${s} of ${r}) {`),e.indented(a=>{let c=he(a,t,o.valueType,s);a.write(`${i}.add(${c});`)}),e.write("}"),i}function $I(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function EI(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let o=n._zod.pattern;if(o){let i=U(t,o);e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${r})) return INVALID;`)}return r}function DI(e,t,n,r){let o=n._zod.def,i=fr(t,o.getter),s=U(t,{parser:null});e.write(`if (!${s}.parser) {`),e.indented(c=>{c.write(`const inner = ${i}();`),c.write(`${s}.parser = function(input) {`),c.indented(u=>{u.write("const result = inner._zod.run({ value: input, issues: [] }, {});"),u.write("return result.issues.length === 0 ? result.value : INVALID;")}),c.write("};")}),e.write("}");let a=V(t);return e.write(`const ${a} = ${s}.parser(${r});`),e.write(`if (${a} === INVALID) return INVALID;`),a}function OI(e,t,n,r){let o=n._zod.def,i=he(e,t,o.in,r);if(o.transform){if(mr(o.transform))throw new Wt("z.compile: async transforms in pipes are not supported");let s=o.transform,c=fr(t,l=>{let d={value:l,issues:[],addIssue:vp},m=s(l,d);return m instanceof Promise?Qe:d.issues.length===0?m:Qe}),u=V(t);return e.write(`const ${u} = ${c}(${i});`),e.write(`if (${u} === INVALID) return INVALID;`),he(e,t,o.out,u)}else return he(e,t,o.out,i)}function mr(e){return typeof e=="function"&&(e.constructor.name==="AsyncFunction"||e[Symbol.toStringTag]==="AsyncFunction")}function NI(e,t,n,r){let o=n._zod.def;if(o.fn){if(mr(o.fn))throw new Wt("z.compile: async custom predicates are not supported");let i=fr(t,o.fn),s=U(t,kp),a=V(t);e.write(`const ${a} = ${i}(${r});`),e.write(`if (${a} instanceof Promise) ${s}();`),e.write(`if (!${a}) return INVALID;`)}else throw new J("custom schema without a predicate function");return r}function zI(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then=="function")return Qe;let o=r;return o.issues.length===0?o.value:t()}function jI(e,t,n,r){let o=n._zod.def;if(!o.catchValue[Ca])throw new J("catch with a callback (only a constant catch value compiles)",!1);let i=V(t);e.write(`let ${i} = (() => {`),e.indented(u=>{let l=Ue(u,t,o.innerType,r);u.write(`return ${l};`)}),e.write("})();");let s=U(t,o.innerType),a=fr(t,o.catchValue),c=U(t,zI);return e.write(`if (${i} === INVALID) {`),e.indented(u=>{u.write(`${i} = ${c}(${s}, ${a}, ${r});`),u.write(`if (${i} === INVALID) return INVALID;`)}),e.write("}"),i}function ZI(e,t,n,r){let o=n._zod.def;if(o.transform){if(mr(o.transform))throw new Wt("z.compile: async transforms are not supported");let i=o.transform,a=fr(t,u=>{let l={value:u,issues:[],addIssue:vp},d=i(u,l);return d instanceof Promise?Qe:l.issues.length===0?d:Qe}),c=V(t);return e.write(`const ${c} = ${a}(${r});`),e.write(`if (${c} === INVALID) return INVALID;`),c}return r}function dc(e){return e.checks&&(e.checks=[...e.checks]),e}function wp(e,t){return new e(dc({type:"string",...P(t)}))}function xp(e,t){return new e(dc({type:"string",coerce:!0,...P(t)}))}function pc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...P(t)})}function fc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...P(t)})}function mc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...P(t)})}function hc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...P(t)})}function gc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...P(t)})}function Cc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...P(t)})}function Ai(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...P(t)})}function kc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...P(t)})}function yc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...P(t)})}function bc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...P(t)})}function vc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...P(t)})}function wc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...P(t)})}function xc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...P(t)})}function Ic(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...P(t)})}function Sc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...P(t)})}function _c(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...P(t)})}function Ip(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...P(t)})}function Pc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...P(t)})}function Lc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...P(t)})}function Mc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...P(t)})}function Rc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...P(t)})}function Tc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...P(t)})}function Sp(e,t){return new e({type:"string",format:"credit_card",check:"string_format",abort:!1,...P(t)})}function _p(e,t){return new e({type:"string",format:"iban",check:"string_format",abort:!1,...P(t)})}function Ac(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...P(t)})}var Pp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function $i(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...P(t)})}function Ei(e,t){return new e({type:"string",format:"date",check:"string_format",...P(t)})}function Di(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...P(t)})}function Oi(e,t){return new e({type:"string",format:"duration",check:"string_format",...P(t)})}function Lp(e,t){return new e(dc({type:"number",checks:[],...P(t)}))}function Mp(e,t){return new e(dc({type:"number",coerce:!0,checks:[],...P(t)}))}function Rp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...P(t)})}function Tp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...P(t)})}function Ap(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...P(t)})}function $p(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...P(t)})}function Ep(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...P(t)})}function Dp(e,t){return new e({type:"boolean",...P(t)})}function Op(e,t){return new e({type:"boolean",coerce:!0,...P(t)})}function Np(e,t){return new e({type:"bigint",...P(t)})}function zp(e,t){return new e({type:"bigint",coerce:!0,...P(t)})}function jp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...P(t)})}function Zp(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...P(t)})}function Wp(e,t){return new e({type:"symbol",...P(t)})}function Vp(e,t){return new e({type:"undefined",...P(t)})}function Hp(e,t){return new e({type:"null",...P(t)})}function Fp(e){return new e({type:"any"})}function Bp(e){return new e({type:"unknown"})}function Up(e,t){return new e({type:"never",...P(t)})}function Kp(e,t){return new e({type:"void",...P(t)})}function Gp(e,t){return new e({type:"date",...P(t)})}function qp(e,t){return new e({type:"date",coerce:!0,...P(t)})}function Yp(e,t){return new e({type:"nan",...P(t)})}function Jt(e,t){return new $a({check:"less_than",...P(t),value:e,inclusive:!1})}function Ct(e,t){return new $a({check:"less_than",...P(t),value:e,inclusive:!0})}function Xt(e,t){return new Ea({check:"greater_than",...P(t),value:e,inclusive:!1})}function kt(e,t){return new Ea({check:"greater_than",...P(t),value:e,inclusive:!0})}function $c(e){return Xt(0,e)}function Ec(e){return Jt(0,e)}function Dc(e){return Ct(0,e)}function Oc(e){return kt(0,e)}function An(e,t){return new Ed({check:"multiple_of",...P(t),value:e})}function $n(e,t){return new Nd({check:"max_size",...P(t),maximum:e})}function Qt(e,t){return new zd({check:"min_size",...P(t),minimum:e})}function hr(e,t){return new jd({check:"size_equals",...P(t),size:e})}function gr(e,t){return new Zd({check:"max_length",...P(t),maximum:e})}function pn(e,t){return new Wd({check:"min_length",...P(t),minimum:e})}function Cr(e,t){return new Vd({check:"length_equals",...P(t),length:e})}function no(e,t){return new Hd({check:"string_format",format:"regex",...P(t),pattern:e})}function ro(e){return new Fd({check:"string_format",format:"lowercase",...P(e)})}function oo(e){return new Bd({check:"string_format",format:"uppercase",...P(e)})}function io(e,t){return new Ud({check:"string_format",format:"includes",...P(t),includes:e})}function so(e,t){return new Kd({check:"string_format",format:"starts_with",...P(t),prefix:e})}function ao(e,t){return new Gd({check:"string_format",format:"ends_with",...P(t),suffix:e})}function Nc(e,t,n){return new qd({check:"property",property:e,schema:t,...P(n)})}function co(e,t){return new Yd({check:"properties",shape:e,...P(t)})}function uo(e,t){return new Jd({check:"mime_type",mime:e,...P(t)})}function Vt(e){return new Xd({check:"overwrite",tx:e})}function lo(e){return Vt(t=>t.normalize(e))}function po(){return Vt(e=>e.trim())}function fo(){return Vt(e=>e.toLowerCase())}function mo(){return Vt(e=>e.toUpperCase())}function ho(){return Vt(e=>Dl(e))}function Jp(e,t,n){return new e({type:"array",element:t,...P(n)})}function WI(e,t,n){return new e({type:"union",options:t,...P(n)})}function VI(e,t,n){return new e({type:"union",options:t,inclusive:!1,...P(n)})}function HI(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...P(r)})}function FI(e,t,n){return new e({type:"intersection",left:t,right:n})}function BI(e,t,n,r){let o=n instanceof G,i=o?r:n,s=o?n:null;return new e({type:"tuple",items:t,rest:s,...P(i)})}function UI(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...P(r)})}function KI(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...P(r)})}function GI(e,t,n){return new e({type:"set",valueType:t,...P(n)})}function qI(e,t,n){let r=Array.isArray(t)?Object.fromEntries(t.map(o=>[o,o])):t;return new e({type:"enum",entries:r,...P(n)})}function YI(e,t,n){return new e({type:"enum",entries:t,...P(n)})}function JI(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...P(n)})}function Xp(e,t){return new e({type:"file",...P(t)})}function XI(e,t){return new e({type:"transform",transform:t})}function QI(e,t){return new e({type:"optional",innerType:t})}function eS(e,t){return new e({type:"nullable",innerType:t})}function tS(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():oi(n)}})}function nS(e,t,n){return new e({type:"nonoptional",innerType:t,...P(n)})}function rS(e,t){return new e({type:"success",innerType:t})}function oS(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:Vl(n)})}function iS(e,t,n){return new e({type:"pipe",in:t,out:n})}function sS(e,t){return new e({type:"readonly",innerType:t})}function aS(e,t,n){return new e({type:"template_literal",parts:t,...P(n)})}function cS(e,t){return new e({type:"lazy",getter:t})}function uS(e,t){return new e({type:"promise",innerType:t})}function Qp(e,t,n){let r=P(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function ef(e,t,n){return new e({type:"custom",check:"custom",fn:t,...P(n)})}function tf(e,t){let n=J0(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Kr(o,r.value,n._zod.def));else{let i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Kr(i))}},e(r.value,r)),t);return n}function J0(e,t){let n=new de({check:"custom",...P(t)});return n._zod.check=e,n}function nf(e){let t=new de({check:"describe"});return t._zod.onattach=[n=>{let r=Ve.get(n)??{};Ve.add(n,{...r,description:e})}],t._zod.check=()=>{},t}function rf(e){let t=new de({check:"meta"});return t._zod.onattach=[n=>{let r=Ve.get(n)??{};Ve.add(n,{...r,...e})}],t._zod.check=()=>{},t}function of(e,t){let n=P(t),r=n.truthy??["true","1","yes","on","y","enabled"],o=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(r=r.map(p=>typeof p=="string"?p.toLowerCase():p),o=o.map(p=>typeof p=="string"?p.toLowerCase():p));let i=new Set(r),s=new Set(o),a=e.Codec??_i,c=e.Boolean??Ii,u=e.String??lr,l=new u({type:"string",error:n.error}),d=new c({type:"boolean",error:n.error}),m=new a({type:"pipe",in:l,out:d,transform:((p,h)=>{let g=p;return n.case!=="sensitive"&&(g=g.toLowerCase()),i.has(g)?!0:s.has(g)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:h.value,inst:m,continue:!1}),{})}),reverseTransform:((p,h)=>p===!0?r[0]||"true":o[0]||"false"),error:n.error});return m._zod.bag.truthy=r,m._zod.bag.falsy=o,m._zod.bag.case=n.case??"insensitive",m}function kr(e,t,n,r={}){let o=P(r),i={check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...o};return n instanceof RegExp&&(i.pattern=n),new e(i)}function Ni(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&We(e,r,n[r]);return e}function En(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ve,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function Pe(e,t,n,r,o){let i=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw new Error(o);return Object.assign(n,i),!0}function ae(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let m=s.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,m,l)}let d=e._zod.parent;d&&(s.ref||(s.ref=d),ae(d,t,l),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ni(s.schema,c),t.io==="input"&&et(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function X0(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Dn(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=r.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,s[0])}}let o=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(s[0])?.id,m=e.external.uri??(h=>h);if(d)return{ref:m(d)};let p=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=p,{defId:p,ref:`${m("__shared")}#/${a}/${X0(p)}`}}let c="#",u=`${c}/${a}/`;if(s[1]===n&&!s[1].schema.id)return{ref:c};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+X0(l)}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=o(s);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
65
65
|
|
|
66
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function t9(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;t9(r);let o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;let i=r.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var n9=new Set(["type","properties","required","additionalProperties"]),Q0=["oneOf","anyOf"];function e9(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function sf(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!n9.has(s))return null;t.push(i)}let n={},r=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??e9(u);l!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(l))||a.push(l))}let c=a.length===1?a[0]:sf(a)??{allOf:a};We(n,s,c)}for(let s of i.required??[])r.add(s)}let o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let a=e9(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function lS(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of n9)if(o in e)return;let n=t.filter(o=>Q0.some(i=>Array.isArray(o[i]))),r=null;if(!n.length)r=sf(t);else{let o=n[0],i=Q0.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>sf([...s,c]));if(a.some(c=>!c))return;r={[i]:a}}r&&(delete e.allOf,Ni(e,r))}function On(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){r(d);let p=e.seen.get(d),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Ni(u,h),Ni(u,l),a._zod.parent===d)for(let C in u)C==="$ref"||C==="allOf"||C in l||delete u[C];if(h.$ref&&p.def)for(let C in u)C==="$ref"||C==="allOf"||C in p.def&&JSON.stringify(u[C])===JSON.stringify(p.def[C])&&delete u[C]}let m=a._zod.parent;if(m&&m!==d){r(m);let p=e.seen.get(m);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let h in u)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(u[h])===JSON.stringify(p.def[h])&&delete u[h]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())t9(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);d?d.push(u):a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])lS(u)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Ni(o,n.defId?n.schema:n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,We(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:go(t,"input",e.processors),output:go(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function et(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return et(r.element,n);if(r.type==="set")return et(r.valueType,n);if(r.type==="lazy")return et(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return et(r.innerType,n);if(r.type==="intersection")return et(r.left,n)||et(r.right,n);if(r.type==="record"||r.type==="map")return et(r.keyType,n)||et(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:et(r.in,n)||et(r.out,n);if(r.type==="object"){for(let o in r.shape)if(et(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(let o of r.options)if(et(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(et(o,n))return!0;return!!(r.rest&&et(r.rest,n))}return!1}var af=(e,t={})=>n=>{let r=En({...n,processors:t});return ae(e,r),Dn(r,e),On(r,e)},go=(e,t,n={})=>r=>{let{libraryOptions:o,target:i}=r??{},s=En({...o??{},target:i,io:t,processors:n});return ae(e,s),Dn(s,e),On(s,e)};var Co=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ko=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},r9=(e,t)=>{Co(e,"minimum",t),ko(e,"maximum",t)},a9=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},c9=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},u9=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},l9=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},o9=(e,t)=>Co(e,"minimum",t.minimum),i9=(e,t)=>ko(e,"maximum",t.maximum),s9=e=>(t,n)=>{l9(t,n.format);let[r,o]=e[n.format];Co(t,"minimum",r),ko(t,"maximum",o)},dS={greater_than:(e,t)=>Co(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ko(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>a9(e,t.value),number_format:s9(si),bigint_format:s9(ai),min_length:o9,max_length:i9,length_equals:(e,t)=>r9(e,t.length),min_size:o9,max_size:i9,size_equals:(e,t)=>r9(e,t.size),string_format:(e,t)=>{l9(e,t.format),t.pattern&&c9(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>u9(e,t.mime)};function Le(e){let t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let i of r)dS[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Co(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Co(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&ko(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&ko(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&a9(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&u9(t,o.mime);for(let i of o.patterns??[])c9(t,i);return t}var pS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fS=new Map([[Fa,md],[xi,hd]]),d9=e=>fS.get(e)??e,lf=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=Le(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=pS[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let d=[...c].map(d9);d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},df=(e,t,n,r)=>{let o=n,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=Le(e);o.type=l?"integer":"number";let d=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(d?p?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),m?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),a){let h=new Set;for(let w of a)Number.isFinite(w)&&w!==0?h.add(Math.abs(w)):Pe(e,t,o,r,`A multipleOf divisor of ${w} cannot be represented in JSON Schema`);let[g,...C]=h;g!==void 0&&(o.multipleOf=g),C.length&&(o.allOf=[...o.allOf??[],...C.map(w=>({multipleOf:w}))])}},pf=(e,t,n,r)=>{n.type="boolean"},ff=(e,t,n,r)=>{Pe(e,t,n,r,"BigInt cannot be represented in JSON Schema")},mf=(e,t,n,r)=>{Pe(e,t,n,r,"Symbols cannot be represented in JSON Schema")},hf=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},gf=(e,t,n,r)=>{Pe(e,t,n,r,"Undefined cannot be represented in JSON Schema")},Cf=(e,t,n,r)=>{Pe(e,t,n,r,"Void cannot be represented in JSON Schema")},kf=(e,t,n,r)=>{n.not={}},yf=(e,t,n,r)=>{},bf=(e,t,n,r)=>{},vf=(e,t,n,r)=>{Pe(e,t,n,r,"Date cannot be represented in JSON Schema")},wf=(e,t,n,r)=>{let o=e._zod.def,i=Hr(o.entries);if(i.length===0){n.not={};return}i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},xf=(e,t,n,r)=>{let o=e._zod.def;if(o.values.length===0){n.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(Pe(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Pe(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},If=(e,t,n,r)=>{Pe(e,t,n,r,"NaN cannot be represented in JSON Schema")},Sf=(e,t,n,r)=>{let o=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},_f=(e,t,n,r)=>{let o=n;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=Le(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(c=>({contentMediaType:c})))},Pf=(e,t,n,r)=>{n.type="boolean"},Lf=(e,t,n,r)=>{Pe(e,t,n,r,"Custom types cannot be represented in JSON Schema")},Mf=(e,t,n,r)=>{Pe(e,t,n,r,"Function types cannot be represented in JSON Schema")},Rf=(e,t,n,r)=>{Pe(e,t,n,r,"Transforms cannot be represented in JSON Schema")},Tf=(e,t,n,r)=>{Pe(e,t,n,r,"Map cannot be represented in JSON Schema")},Af=(e,t,n,r)=>{Pe(e,t,n,r,"Set cannot be represented in JSON Schema")},$f=(e,t,n,r)=>{let o=n,i=e._zod.def,{minimum:s,maximum:a}=Le(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=ae(i.element,t,{...r,path:[...r.path,"items"]})};function zi(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?zi(t.out):t.type==="catch"?zi(t.innerType):e._zod.optin}var Ef=(e,t,n,r)=>{let o=n,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Pe(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)We(o.properties,u,ae(s[u],t,{...r,path:[...r.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];(t.io==="input"?zi(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(o.required=c),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=ae(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},jc=(e,t,n,r)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>ae(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=s:n.anyOf=s},Df=(e,t,n,r)=>{let o=e._zod.def,i=ae(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=ae(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},Of=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((g,C)=>ae(g,t,{...r,path:[...r.path,s,C]})),u=i.rest?ae(i.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,l=i.items.length;for(;l>0;){let g=i.items[l-1];if(!(t.io==="input"?zi(g)!==void 0:g._zod.optout==="optional"))break;l--}let d=i.items.length,m=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,m?o.items=!1:u&&(o.items=u),l>0&&(o.minItems=l),m&&(o.maxItems=d)):t.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),l>0&&(o.minItems=l),m&&(o.maxItems=d)):(o.items=c,m?o.additionalItems=!1:u&&(o.additionalItems=u),l>0&&(o.minItems=l),m&&(o.maxItems=d));let{minimum:p,maximum:h}=Le(e);typeof p=="number"&&(o.minItems=p),typeof h=="number"&&(o.maxItems=h)};function cf(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let h=e.get(t)?.def;if(!h)return t;let g=cf(e,h,n);return g===h?t:g}for(let h of["anyOf","oneOf"]){let g=t[h];if(!Array.isArray(g))continue;let C=g.map(w=>cf(e,w,n));C.some((w,y)=>w!==g[y])&&(t={...t,[h]:C})}let r=Array.isArray(t.type)?t.type:[t.type],o=!r.includes("string")&&r.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:m,...p}=t;return p.enum?p.enum=p.enum.map(h=>typeof h=="number"?String(h):h):typeof p.const=="number"&&(p.const=String(p.const)),o&&(p.type="string",i||(p.pattern=(r.includes("number")?dn:gi).source)),p}var uf=new WeakMap;function mS(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of uf.get(e)??[]){let o=e.seen.get(r),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||n.has(i))continue;let s=cf(t,i,new Set);s!==i&&n.set(i,s)}if(n.size)for(let r of e.seen.values())for(let o of[r.schema,r.def]){let i=o&&n.get(o.propertyNames);i&&(o.propertyNames=i)}}var Nf=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object";let s=i.keyType,a=Le(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=ae(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let d of a)We(o.patternProperties,d9(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=ae(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=uf.get(t);l||(l=[],uf.set(t,l),t.deferred.push(()=>mS(t))),l.push(e)}o.additionalProperties=ae(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let c=s._zod.values,u=t.io==="input"&&zi(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l.map(String))}},zf=(e,t,n,r)=>{let o=e._zod.def,i=ae(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},jf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Zf=Symbol();function p9(e,t,n,r,o){let i=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=!0,null));return i?(Pe(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Zf):JSON.parse(s)}var Wf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s=p9(o.defaultValue,e,t,n,r);s!==Zf&&(n.default=s)},Vf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=p9(o.defaultValue,e,t,n,r);s!==Zf&&(n._prefault=s)},Hf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{Pe(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},Ff=(e,t,n,r)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;ae(s,t,r);let a=t.seen.get(e);a.ref=s},Bf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Uf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Zc=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Kf=(e,t,n,r)=>{let o=e._zod.innerType;ae(o,t,r);let i=t.seen.get(e);i.ref=o},zc={string:lf,number:df,boolean:pf,bigint:ff,symbol:mf,null:hf,undefined:gf,void:Cf,never:kf,any:yf,unknown:bf,date:vf,enum:wf,literal:xf,nan:If,template_literal:Sf,file:_f,success:Pf,custom:Lf,function:Mf,transform:Rf,map:Tf,set:Af,array:$f,object:Ef,union:jc,intersection:Df,tuple:Of,record:Nf,nullable:zf,nonoptional:jf,default:Wf,prefault:Vf,catch:Hf,pipe:Ff,readonly:Bf,promise:Uf,optional:Zc,lazy:Kf};function Wc(e,t){if("_idmap"in e){let r=e,o=En({...t,processors:zc}),i={};for(let c of r._idmap.entries()){let[u,l]=c;ae(l,o)}let s={},a={registry:r,uri:t?.uri,defs:i};o.external=a;for(let c of r._idmap.entries()){let[u,l]=c;Dn(o,l),We(s,u,On(o,l))}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i}}return{schemas:s}}let n=En({...t,processors:zc});return ae(e,n),Dn(n,e),On(n,e)}var Vc=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=En({processors:zc,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ae(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Dn(this.ctx,t);let r=On(this.ctx,t),{"~standard":o,...i}=r;return i}};var f9={};var _o={};Nt(_o,{ZodAny:()=>h2,ZodArray:()=>y2,ZodBase64:()=>au,ZodBase64URL:()=>cu,ZodBigInt:()=>Io,ZodBigIntFormat:()=>du,ZodBoolean:()=>xo,ZodCIDRv4:()=>iu,ZodCIDRv6:()=>su,ZodCUID:()=>Xc,ZodCUID2:()=>Qc,ZodCatch:()=>Z2,ZodCodec:()=>Gi,ZodCreditCard:()=>a2,ZodCustom:()=>qi,ZodCustomStringFormat:()=>wr,ZodDate:()=>Vi,ZodDefault:()=>E2,ZodDiscriminatedUnion:()=>v2,ZodE164:()=>uu,ZodEmail:()=>Gc,ZodEmoji:()=>Yc,ZodEnum:()=>bo,ZodExactOptional:()=>hu,ZodFile:()=>R2,ZodFunction:()=>Y2,ZodGUID:()=>qc,ZodIBAN:()=>c2,ZodIPv4:()=>ru,ZodIPv6:()=>ou,ZodISODate:()=>zn,ZodISODateTime:()=>Nn,ZodISODuration:()=>Zn,ZodISOTime:()=>jn,ZodInstanceOf:()=>Q2,ZodIntersection:()=>w2,ZodJWT:()=>lu,ZodKSUID:()=>nu,ZodLazy:()=>K2,ZodLiteral:()=>M2,ZodMAC:()=>s2,ZodMap:()=>P2,ZodNaN:()=>V2,ZodNanoID:()=>Jc,ZodNever:()=>C2,ZodNonOptional:()=>gu,ZodNull:()=>f2,ZodNullable:()=>$2,ZodNumber:()=>wo,ZodNumberFormat:()=>xr,ZodObject:()=>Fi,ZodOptional:()=>Ui,ZodPipe:()=>Ki,ZodPrefault:()=>O2,ZodPreprocess:()=>H2,ZodPromise:()=>q2,ZodReadonly:()=>F2,ZodRecord:()=>yo,ZodSet:()=>L2,ZodString:()=>vo,ZodStringFormat:()=>le,ZodSuccess:()=>j2,ZodSymbol:()=>d2,ZodTemplateLiteral:()=>U2,ZodTransform:()=>T2,ZodTuple:()=>I2,ZodType:()=>q,ZodULID:()=>eu,ZodURL:()=>Wi,ZodUUID:()=>en,ZodUndefined:()=>p2,ZodUnion:()=>Bi,ZodUnknown:()=>g2,ZodVoid:()=>k2,ZodXID:()=>tu,ZodXor:()=>b2,_ZodString:()=>Kc,_default:()=>D2,_function:()=>Sg,any:()=>ng,array:()=>Hi,base64:()=>O9,base64url:()=>N9,bigint:()=>J9,boolean:()=>l2,catch:()=>W2,check:()=>_g,cidrv4:()=>E9,cidrv6:()=>D9,codec:()=>vg,creditCard:()=>j9,cuid:()=>_9,cuid2:()=>P9,currencyCode:()=>B9,custom:()=>Pg,date:()=>og,describe:()=>Lg,discriminatedUnion:()=>lg,e164:()=>z9,email:()=>g9,emoji:()=>I9,enum:()=>fu,exactOptional:()=>A2,file:()=>Cg,float32:()=>K9,float64:()=>G9,function:()=>Sg,guid:()=>C9,hash:()=>U9,hex:()=>F9,hostname:()=>H9,httpUrl:()=>x9,iban:()=>Z9,instanceof:()=>Rg,int:()=>Bc,int32:()=>q9,int64:()=>X9,intersection:()=>x2,invertCodec:()=>wg,ipv4:()=>T9,ipv6:()=>$9,json:()=>Ag,jwt:()=>W9,keyof:()=>ig,ksuid:()=>R9,lazy:()=>G2,literal:()=>gg,looseObject:()=>cg,looseRecord:()=>pg,mac:()=>A9,map:()=>fg,meta:()=>Mg,nan:()=>bg,nanoid:()=>S9,nativeEnum:()=>hg,never:()=>pu,nonoptional:()=>z2,null:()=>m2,nullable:()=>Zi,nullish:()=>kg,number:()=>u2,object:()=>sg,optional:()=>br,partialRecord:()=>dg,pipe:()=>Uc,prefault:()=>N2,preprocess:()=>$g,promise:()=>Ig,readonly:()=>B2,record:()=>_2,refine:()=>J2,set:()=>mg,strictObject:()=>ag,string:()=>ji,stringFormat:()=>V9,stringbool:()=>Tg,success:()=>yg,superRefine:()=>X2,symbol:()=>eg,templateLiteral:()=>xg,transform:()=>mu,tuple:()=>S2,uint32:()=>Y9,uint64:()=>Q9,ulid:()=>L9,undefined:()=>tg,union:()=>So,unknown:()=>yr,url:()=>w9,uuid:()=>k9,uuidv4:()=>y9,uuidv6:()=>b9,uuidv7:()=>v9,void:()=>rg,xid:()=>M9,xor:()=>ug});var Hc={};Nt(Hc,{endsWith:()=>ao,gt:()=>Xt,gte:()=>kt,includes:()=>io,length:()=>Cr,lowercase:()=>ro,lt:()=>Jt,lte:()=>Ct,maxLength:()=>gr,maxSize:()=>$n,mime:()=>uo,minLength:()=>pn,minSize:()=>Qt,multipleOf:()=>An,negative:()=>Ec,nonnegative:()=>Oc,nonpositive:()=>Dc,normalize:()=>lo,overwrite:()=>Vt,positive:()=>$c,properties:()=>co,property:()=>Nc,regex:()=>no,size:()=>hr,slugify:()=>ho,startsWith:()=>so,toLowerCase:()=>fo,toUpperCase:()=>mo,trim:()=>po,uppercase:()=>oo});var m9=new WeakSet([Object.prototype,Error.prototype]);function Fc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var h9=(e,t)=>{Gl.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);m9.has(n)||(m9.add(n),Fc(n,"format",r=>o=>pi(r,o)),Fc(n,"flatten",r=>o=>di(r,o)),Fc(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,Fr,2)}),Fc(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,Fr,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},gS=k("ZodError",h9),ft=k("ZodError",h9,void 0,{Parent:Error});var Gf=Gr(ft),qf=qr(ft),Yf=Yr(ft),Jf=Jr(ft),Xf=va(ft),Qf=wa(ft),e2=xa(ft),t2=Ia(ft),n2=Sa(ft),r2=_a(ft),o2=Pa(ft),i2=La(ft);function kS(){Ee.localeError||ke(sc())}function vr(){Ee.memoizer||ke({memoizer:Ri()})}var q=k("ZodType",(e,t)=>(kS(),G.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(j.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ie(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(J2(e,t))},superRefine(e,t){return this.check(X2(e,t))},overwrite(e){return this.check(Vt(e))},optional(){return br(this)},exactOptional(){return A2(this)},nullable(){return Zi(this)},nullish(){return br(Zi(this))},nonoptional(e){return z2(this,e)},array(){return Hi(this)},or(e){return So([this,e])},and(e){return x2(this,e)},transform(e){return Uc(this,mu(e))},default(e){return D2(this,e)},prefault(e){return N2(this,e)},catch(e){return W2(this,e)},pipe(e){return Uc(this,e)},readonly(){return B2(this)},describe(e){let t=this.clone();return Ve.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ve.get(this);let t=this.clone();return Ve.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return j.hide(this,"~standard",{...ja(this),jsonSchema:{input:go(this,"input"),output:go(this,"output")}})},set"~standard"(e){j.own(this,"~standard",e)},parse:function e(t,n){return Gf(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await qf(this,t,n,{callee:e})},safeParse(e,t){return Yf(this,e,t)},async safeParseAsync(e,t){return Jf(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){j.own(this,"spa",e)},validate(e,t){return fi(this,e,t)},validateAsync(e,t){return mi(this,e,t)},encode:function e(t,n){return Xf(this,t,n,{callee:e})},decode:function e(t,n){return Qf(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await e2(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await t2(this,t,n,{callee:e})},safeEncode(e,t){return n2(this,e,t)},safeDecode(e,t){return r2(this,e,t)},async safeEncodeAsync(e,t){return o2(this,e,t)},async safeDecodeAsync(e,t){return i2(this,e,t)},toJSONSchema(e){return af(this,{})(e)},get description(){return Ve.get(this)?.description},get _def(){return this._zod.def}}),Kc=k("_ZodString",(e,t)=>{lr.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lf(e,n,r,o)},j.derived({format:e=>Le(e).format??null,minLength:e=>Le(e).minimum??null,maxLength:e=>Le(e).maximum??null},{regex(...e){return this.check(no(...e))},includes(...e){return this.check(io(...e))},startsWith(...e){return this.check(so(...e))},endsWith(...e){return this.check(ao(...e))},min(...e){return this.check(pn(...e))},max(...e){return this.check(gr(...e))},length(...e){return this.check(Cr(...e))},nonempty(...e){return this.check(pn(1,...e))},lowercase(e){return this.check(ro(e))},uppercase(e){return this.check(oo(e))},trim(){return this.check(po())},normalize(...e){return this.check(lo(...e))},toLowerCase(){return this.check(fo())},toUpperCase(){return this.check(mo())},slugify(){return this.check(ho())}})),vo=k("ZodString",(e,t)=>{lr.init(e,t),Kc.init(e,t)},{email(e){return this.check(pc(Gc,e))},url(e){return this.check(Ai(Wi,e))},jwt(e){return this.check(Ac(lu,e))},emoji(e){return this.check(kc(Yc,e))},guid(e){return this.check(fc(qc,e))},uuid(e){return this.check(mc(en,e))},uuidv4(e){return this.check(hc(en,e))},uuidv6(e){return this.check(gc(en,e))},uuidv7(e){return this.check(Cc(en,e))},nanoid(e){return this.check(yc(Jc,e))},cuid(e){return this.check(bc(Xc,e))},cuid2(e){return this.check(vc(Qc,e))},ulid(e){return this.check(wc(eu,e))},base64(e){return this.check(Mc(au,e))},base64url(e){return this.check(Rc(cu,e))},xid(e){return this.check(xc(tu,e))},ksuid(e){return this.check(Ic(nu,e))},ipv4(e){return this.check(Sc(ru,e))},ipv6(e){return this.check(_c(ou,e))},cidrv4(e){return this.check(Pc(iu,e))},cidrv6(e){return this.check(Lc(su,e))},e164(e){return this.check(Tc(uu,e))},datetime(e){return this.check($i(Nn,e))},date(e){return this.check(Ei(zn,e))},time(e){return this.check(Di(jn,e))},duration(e){return this.check(Oi(Zn,e))}});function ji(e){return wp(vo,e)}var le=k("ZodStringFormat",(e,t)=>{se.init(e,t),Kc.init(e,t)}),Nn=k("ZodISODateTime",(e,t)=>{m1.init(e,t),le.init(e,t)}),zn=k("ZodISODate",(e,t)=>{h1.init(e,t),le.init(e,t)}),jn=k("ZodISOTime",(e,t)=>{g1.init(e,t),le.init(e,t)}),Zn=k("ZodISODuration",(e,t)=>{C1.init(e,t),le.init(e,t)}),Gc=k("ZodEmail",(e,t)=>{r1.init(e,t),le.init(e,t)});function g9(e){return pc(Gc,e)}var qc=k("ZodGUID",(e,t)=>{t1.init(e,t),le.init(e,t)});function C9(e){return fc(qc,e)}var en=k("ZodUUID",(e,t)=>{n1.init(e,t),le.init(e,t)});function k9(e){return mc(en,e)}function y9(e){return hc(en,e)}function b9(e){return gc(en,e)}function v9(e){return Cc(en,e)}var Wi=k("ZodURL",(e,t)=>{s1.init(e,t),le.init(e,t)});function w9(e){return Ai(Wi,e)}function x9(e){return Ai(Wi,{protocol:hi,hostname:Cd,...j.normalizeParams(e)})}var Yc=k("ZodEmoji",(e,t)=>{a1.init(e,t),le.init(e,t)});function I9(e){return kc(Yc,e)}var Jc=k("ZodNanoID",(e,t)=>{c1.init(e,t),le.init(e,t)});function S9(e){return yc(Jc,e)}var Xc=k("ZodCUID",(e,t)=>{u1.init(e,t),le.init(e,t)});function _9(e){return bc(Xc,e)}var Qc=k("ZodCUID2",(e,t)=>{l1.init(e,t),le.init(e,t)});function P9(e){return vc(Qc,e)}var eu=k("ZodULID",(e,t)=>{d1.init(e,t),le.init(e,t)});function L9(e){return wc(eu,e)}var tu=k("ZodXID",(e,t)=>{p1.init(e,t),le.init(e,t)});function M9(e){return xc(tu,e)}var nu=k("ZodKSUID",(e,t)=>{f1.init(e,t),le.init(e,t)});function R9(e){return Ic(nu,e)}var ru=k("ZodIPv4",(e,t)=>{k1.init(e,t),le.init(e,t)});function T9(e){return Sc(ru,e)}var s2=k("ZodMAC",(e,t)=>{b1.init(e,t),le.init(e,t)});function A9(e){return Ip(s2,e)}var ou=k("ZodIPv6",(e,t)=>{y1.init(e,t),le.init(e,t)});function $9(e){return _c(ou,e)}var iu=k("ZodCIDRv4",(e,t)=>{v1.init(e,t),le.init(e,t)});function E9(e){return Pc(iu,e)}var su=k("ZodCIDRv6",(e,t)=>{w1.init(e,t),le.init(e,t)});function D9(e){return Lc(su,e)}var au=k("ZodBase64",(e,t)=>{x1.init(e,t),le.init(e,t)});function O9(e){return Mc(au,e)}var cu=k("ZodBase64URL",(e,t)=>{I1.init(e,t),le.init(e,t)});function N9(e){return Rc(cu,e)}var uu=k("ZodE164",(e,t)=>{S1.init(e,t),le.init(e,t)});function z9(e){return Tc(uu,e)}var a2=k("ZodCreditCard",(e,t)=>{_1.init(e,t),le.init(e,t)});function j9(e){return Sp(a2,e)}var c2=k("ZodIBAN",(e,t)=>{P1.init(e,t),le.init(e,t)});function Z9(e){return _p(c2,e)}var lu=k("ZodJWT",(e,t)=>{L1.init(e,t),le.init(e,t)});function W9(e){return Ac(lu,e)}var wr=k("ZodCustomStringFormat",(e,t)=>{M1.init(e,t),le.init(e,t)});function V9(e,t,n={}){return kr(wr,e,t,n)}function H9(e){return kr(wr,"hostname",gd,e)}function F9(e){return kr(wr,"hex",Td,e)}function B9(e){return kr(wr,"currency_code",yd,e)}function U9(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,o=Mt[r];if(!o)throw new Error(`Unrecognized hash format: ${r}`);return kr(wr,r,o,t)}var wo=k("ZodNumber",(e,t)=>{qa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>df(e,n,r,o),e.isFinite=!0},j.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Le(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Le(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=Le(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Le(e).format??null},{gt(e,t){return this.check(Xt(e,t))},gte(e,t){return this.check(kt(e,t))},min(e,t){return this.check(kt(e,t))},lt(e,t){return this.check(Jt(e,t))},lte(e,t){return this.check(Ct(e,t))},max(e,t){return this.check(Ct(e,t))},int(e){return this.check(Bc(e))},safe(e){return this.check(Bc(e))},positive(e){return this.check(Xt(0,e))},nonnegative(e){return this.check(kt(0,e))},negative(e){return this.check(Jt(0,e))},nonpositive(e){return this.check(Ct(0,e))},multipleOf(e,t){return this.check(An(e,t))},step(e,t){return this.check(An(e,t))},finite(){return this}}));function u2(e){return Lp(wo,e)}var xr=k("ZodNumberFormat",(e,t)=>{R1.init(e,t),wo.init(e,t)});function Bc(e){return Rp(xr,e)}function K9(e){return Tp(xr,e)}function G9(e){return Ap(xr,e)}function q9(e){return $p(xr,e)}function Y9(e){return Ep(xr,e)}var xo=k("ZodBoolean",(e,t)=>{Ii.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pf(e,n,r,o)});function l2(e){return Dp(xo,e)}var Io=k("ZodBigInt",(e,t)=>{Ya.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ff(e,n,r,o)},j.derived({minValue:e=>Le(e).minimum??null,maxValue:e=>Le(e).maximum??null,format:e=>Le(e).format??null},{gte(e,t){return this.check(kt(e,t))},min(e,t){return this.check(kt(e,t))},gt(e,t){return this.check(Xt(e,t))},lt(e,t){return this.check(Jt(e,t))},lte(e,t){return this.check(Ct(e,t))},max(e,t){return this.check(Ct(e,t))},positive(e){return this.check(Xt(BigInt(0),e))},negative(e){return this.check(Jt(BigInt(0),e))},nonpositive(e){return this.check(Ct(BigInt(0),e))},nonnegative(e){return this.check(kt(BigInt(0),e))},multipleOf(e,t){return this.check(An(e,t))}}));function J9(e){return Np(Io,e)}var du=k("ZodBigIntFormat",(e,t)=>{T1.init(e,t),Io.init(e,t)});function X9(e){return jp(du,e)}function Q9(e){return Zp(du,e)}var d2=k("ZodSymbol",(e,t)=>{A1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mf(e,n,r,o)});function eg(e){return Wp(d2,e)}var p2=k("ZodUndefined",(e,t)=>{$1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gf(e,n,r,o)});function tg(e){return Vp(p2,e)}var f2=k("ZodNull",(e,t)=>{E1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hf(e,n,r,o)});function m2(e){return Hp(f2,e)}var h2=k("ZodAny",(e,t)=>{D1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yf(e,n,r,o)});function ng(){return Fp(h2)}var g2=k("ZodUnknown",(e,t)=>{O1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bf(e,n,r,o)});function yr(){return Bp(g2)}var C2=k("ZodNever",(e,t)=>{N1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kf(e,n,r,o)});function pu(e){return Up(C2,e)}var k2=k("ZodVoid",(e,t)=>{z1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cf(e,n,r,o)});function rg(e){return Kp(k2,e)}var Vi=k("ZodDate",(e,t)=>{j1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vf(e,n,r,o),e.min=(n,r)=>e.check(kt(n,r)),e.max=(n,r)=>e.check(Ct(n,r))},j.derived({minDate:e=>{let{minimum:t}=Le(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Le(e);return t?new Date(t):null}},{}));function og(e){return Gp(Vi,e)}var y2=k("ZodArray",(e,t)=>{vr(),Z1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$f(e,n,r,o),e.element=t.element},{min(e,t){return this.check(pn(e,t))},nonempty(e){return this.check(pn(1,e))},max(e,t){return this.check(gr(e,t))},length(e,t){return this.check(Cr(e,t))},unwrap(){return this.element}});function Hi(e,t){return Jp(y2,e,t)}function ig(e){let t=e._zod.def.shape;return fu(Object.keys(t))}var Fi=k("ZodObject",(e,t)=>{vr(),W1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ef(e,n,r,o),j.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return fu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(j.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(j.mergeDefs(this._zod.def,{catchall:yr()}))},loose(){return this.clone(j.mergeDefs(this._zod.def,{catchall:yr()}))},strict(){return this.clone(j.mergeDefs(this._zod.def,{catchall:pu()}))},strip(){return this.clone(j.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return j.extend(this,e)},safeExtend(e){return j.safeExtend(this,e)},merge(e){return j.merge(this,e)},pick(e){return j.pick(this,e)},omit(e){return j.omit(this,e)},partial(...e){return j.partial(Ui,this,e[0])},exactPartial(...e){return j.partial(hu,this,e[0],"exactPartial")},required(...e){return j.required(gu,this,e[0])}});function sg(e,t){let n={type:"object",shape:e??{},...j.normalizeParams(t)};return new Fi(n)}function ag(e,t){return new Fi({type:"object",shape:e,catchall:pu(),...j.normalizeParams(t)})}function cg(e,t){return new Fi({type:"object",shape:e,catchall:yr(),...j.normalizeParams(t)})}var Bi=k("ZodUnion",(e,t)=>{Si.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jc(e,n,r,o),e.options=t.options});function So(e,t){return new Bi({type:"union",options:e,...j.normalizeParams(t)})}var b2=k("ZodXor",(e,t)=>{Bi.init(e,t),V1.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jc(e,n,r,o),e.options=t.options});function ug(e,t){return new b2({type:"union",options:e,inclusive:!1,...j.normalizeParams(t)})}var v2=k("ZodDiscriminatedUnion",(e,t)=>{Bi.init(e,t),F1.init(e,t)});function lg(e,t,n){return new v2({type:"union",options:t,discriminator:e,...j.normalizeParams(n)})}var w2=k("ZodIntersection",(e,t)=>{B1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Df(e,n,r,o)});function x2(e,t){return new w2({type:"intersection",left:e,right:t})}var I2=k("ZodTuple",(e,t)=>{vr(),Ja.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Of(e,n,r,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Ui({type:"optional",innerType:t}))})}});function S2(e,t,n){let r=t instanceof G,o=r?n:t,i=r?t:null;return new I2({type:"tuple",items:e,rest:i,...j.normalizeParams(o)})}var yo=k("ZodRecord",(e,t)=>{vr(),U1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Nf(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function _2(e,t,n){return!t||!t._zod?new yo({type:"record",keyType:ji(),valueType:e,...j.normalizeParams(t)}):new yo({type:"record",keyType:e,valueType:t,...j.normalizeParams(n)})}function dg(e,t,n){return new yo({type:"record",keyType:e,valueType:t,...j.normalizeParams(n),partial:!0})}function pg(e,t,n){return new yo({type:"record",keyType:e,valueType:t,mode:"loose",...j.normalizeParams(n)})}var P2=k("ZodMap",(e,t)=>{vr(),K1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tf(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Qt(...n)),e.nonempty=n=>e.check(Qt(1,n)),e.max=(...n)=>e.check($n(...n)),e.size=(...n)=>e.check(hr(...n))});function fg(e,t,n){return new P2({type:"map",keyType:e,valueType:t,...j.normalizeParams(n)})}var L2=k("ZodSet",(e,t)=>{vr(),G1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Af(e,n,r,o),e.min=(...n)=>e.check(Qt(...n)),e.nonempty=n=>e.check(Qt(1,n)),e.max=(...n)=>e.check($n(...n)),e.size=(...n)=>e.check(hr(...n))});function mg(e,t){return new L2({type:"set",valueType:e,...j.normalizeParams(t)})}var bo=k("ZodEnum",(e,t)=>{q1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,o,i)=>wf(e,r,o,i),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let i={};for(let s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new bo({...t,checks:[],...j.normalizeParams(o),entries:i})},e.exclude=(r,o)=>{let i={...t.entries};for(let s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new bo({...t,checks:[],...j.normalizeParams(o),entries:i})}});function fu(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new bo({type:"enum",entries:n,...j.normalizeParams(t)})}function hg(e,t){return new bo({type:"enum",entries:e,...j.normalizeParams(t)})}var M2=k("ZodLiteral",(e,t)=>{Y1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xf(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function gg(e,t){return new M2({type:"literal",values:Array.isArray(e)?e:[e],...j.normalizeParams(t)})}var R2=k("ZodFile",(e,t)=>{J1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_f(e,n,r,o),e.min=(n,r)=>e.check(Qt(n,r)),e.max=(n,r)=>e.check($n(n,r)),e.mime=(n,r)=>e.check(uo(Array.isArray(n)?n:[n],r))});function Cg(e){return Xp(R2,e)}var T2=k("ZodTransform",(e,t)=>{vr(),X1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rf(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Tn(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(j.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(j.issue(s))}};let o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function mu(e){return new T2({type:"transform",transform:e})}var Ui=k("ZodOptional",(e,t)=>{Xa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function br(e){return new Ui({type:"optional",innerType:e})}var hu=k("ZodExactOptional",(e,t)=>{Q1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function A2(e){return new hu({type:"optional",innerType:e})}var $2=k("ZodNullable",(e,t)=>{ep.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Zi(e){return new $2({type:"nullable",innerType:e})}function kg(e){return br(Zi(e))}var E2=k("ZodDefault",(e,t)=>{tp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Wf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function D2(e,t){return new E2({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():j.shallowClone(t)}})}var O2=k("ZodPrefault",(e,t)=>{np.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function N2(e,t){return new O2({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():j.shallowClone(t)}})}var gu=k("ZodNonOptional",(e,t)=>{rp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function z2(e,t){return new gu({type:"nonoptional",innerType:e,...j.normalizeParams(t)})}var j2=k("ZodSuccess",(e,t)=>{op.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Pf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function yg(e){return new j2({type:"success",innerType:e})}var Z2=k("ZodCatch",(e,t)=>{ip.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function W2(e,t){return new Z2({type:"catch",innerType:e,catchValue:typeof t=="function"?t:j.constantCatch(t)})}var V2=k("ZodNaN",(e,t)=>{sp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>If(e,n,r,o)});function bg(e){return Yp(V2,e)}var Ki=k("ZodPipe",(e,t)=>{Qa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ff(e,n,r,o),e.in=t.in,e.out=t.out});function Uc(e,t){return new Ki({type:"pipe",in:e,out:t})}var Gi=k("ZodCodec",(e,t)=>{Ki.init(e,t),_i.init(e,t)});function vg(e,t,n){return new Gi({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function wg(e){let t=e._zod.def;return new Gi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var H2=k("ZodPreprocess",(e,t)=>{Ki.init(e,t),ap.init(e,t)}),F2=k("ZodReadonly",(e,t)=>{cp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function B2(e){return new F2({type:"readonly",innerType:e})}var U2=k("ZodTemplateLiteral",(e,t)=>{up.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sf(e,n,r,o)});function xg(e,t){return new U2({type:"template_literal",parts:e,...j.normalizeParams(t)})}var K2=k("ZodLazy",(e,t)=>{Pi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kf(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function G2(e){return new K2({type:"lazy",getter:e})}var q2=k("ZodPromise",(e,t)=>{dp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ig(e){return new q2({type:"promise",innerType:e})}var Y2=k("ZodFunction",(e,t)=>{lp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mf(e,n,r,o)});function Sg(e){return new Y2({type:"function",input:Array.isArray(e?.input)?S2(e?.input):e?.input??Hi(yr()),output:e?.output??yr()})}var qi=k("ZodCustom",(e,t)=>{pp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lf(e,n,r,o)});function _g(e){let t=new de({check:"custom"});return t._zod.check=e,t}function Pg(e,t){return Qp(qi,e??(()=>!0),t)}function J2(e,t={}){return ef(qi,e,t)}function X2(e,t){return tf(e,t)}var Lg=nf,Mg=rf,Q2=k("ZodInstanceOf",(e,t)=>{qi.init(e,t)},{properties(e,t){return this.check(co(e,t))}});function Rg(e,t={}){let n=new Q2({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...j.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Tg=(...e)=>of({Codec:Gi,Boolean:xo,String:vo},...e);function Ag(e){let t=G2(()=>So([ji(e),u2(),l2(),m2(),Hi(t),_2(ji(),t)]));return t}function $g(e,t){return new H2({type:"pipe",in:mu(e),out:t})}var yS={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function bS(e){ke({customError:e})}function vS(){return ke().customError}var em;em||(em={});var Yi={};Nt(Yi,{ZodISODate:()=>zn,ZodISODateTime:()=>Nn,ZodISODuration:()=>Zn,ZodISOTime:()=>jn,date:()=>xS,datetime:()=>wS,duration:()=>SS,time:()=>IS});function wS(e){return $i(Nn,e)}function xS(e){return Ei(zn,e)}function IS(e){return Di(jn,e)}function SS(e){return Oi(Zn,e)}var O={..._o,...Hc,iso:Yi},_S=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function PS(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function Eg(e,t){return e.map((n,r)=>r<t?n:n.optional())}function LS(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function MS(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let o=n[1]===void 0?void 0:LS(n[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function RS(e,t){return O.transform(r=>r).check(r=>{let o=r.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&r.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:!0}),t.maxProperties!==void 0&&i.length>t.maxProperties&&r.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:!0}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||r.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function tm(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let r=String(e);return`${n[0]}${r.length}:${r}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=tm(s,t);if(a===null)return null;i.push(a)}return`a${i.length}:[${i.join(",")}]`}let r=Object.keys(e).sort(),o=[];for(let i of r){let s=tm(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`)}return`o${o.length}:{${o.join(",")}}`}finally{t.delete(e)}}var TS=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),AS=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Ji(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Ji):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>TS.has(t)?Ji(n):!AS.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(Ji))}function Dg(e){return e===1?"element":"elements"}function $S(e,t){return O.transform(r=>r).check(r=>{let o=r.value;if(Array.isArray(o)){if(t.uniqueItems===!0){let i=new Map;for(let s=0;s<o.length;s++){let a=tm(o[s],new Set);if(a===null)continue;let c=i.get(a);if(c===void 0){i.set(a,s);continue}r.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:o,path:[s],continue:!0})}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of o)if(t.containsSchema.safeParse(c).success&&++a>=s)break;a<i&&r.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${Dg(i)}; found ${a}`,input:o,continue:!0}),t.maxContains!==void 0&&a>t.maxContains&&r.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${Dg(t.maxContains)}`,input:o,continue:!0})}}}).pipe(e)}function Og(e,t){if(e!==!1)return e===void 0||e===!0?O.any():tt(e,t)}var ES=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function Ng(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return O.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=MS(o,t),s=tt(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return O.null();if(o.length===0)return O.never();if(o.length===1)return O.literal(o[0]);if(o.every(s=>typeof s=="string"))return O.enum(o);let i=o.map(s=>O.literal(s));return i.length<2?i[0]:O.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return O.literal(e.const);let n=e.type;if(Array.isArray(n)){let o=n.map(i=>{let s={...e,type:i};return Ng(s,t)});return o.length===0?O.never():o.length===1?o[0]:O.union(o)}if(!n)return O.any();let r;switch(n){case"string":{let o=O.string();if(e.format){let i=e.format;i==="email"?o=o.check(O.email()):i==="uri"||i==="uri-reference"?o=o.check(O.url()):i==="uuid"||i==="guid"?o=o.check(O.uuid()):i==="date-time"?o=o.check(O.iso.datetime({offset:!0})):i==="date"?o=o.check(O.iso.date()):i==="time"?o=o.check(O.regex(ES)):i==="duration"?o=o.check(O.iso.duration()):i==="hostname"?o=o.check(O.hostname()):i==="ipv4"?o=o.check(O.ipv4()):i==="ipv6"?o=o.check(O.ipv6()):i==="mac"?o=o.check(O.mac()):i==="cidr"?o=o.check(O.cidrv4()):i==="cidr-v6"?o=o.check(O.cidrv6()):i==="base64"?o=o.check(O.base64()):i==="base64url"?o=o.check(O.base64url()):i==="e164"?o=o.check(O.e164()):i==="credit_card"?o=o.check(O.creditCard()):i==="iban"?o=o.check(O.iban()):i==="jwt"?o=o.check(O.jwt()):i==="emoji"?o=o.check(O.emoji()):i==="nanoid"?o=o.check(O.nanoid()):i==="cuid"?o=o.check(O.cuid()):i==="cuid2"?o=o.check(O.cuid2()):i==="ulid"?o=o.check(O.ulid()):i==="xid"?o=o.check(O.xid()):i==="ksuid"&&(o=o.check(O.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),r=o;break}case"number":case"integer":{let o=n==="integer"?O.number().int():O.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),r=o;break}case"boolean":{r=O.boolean();break}case"null":{r=O.null();break}case"object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?tt(e.additionalProperties,t):void 0;for(let[d,m]of Object.entries(i)){let p=tt(m,t);We(o,d,s.has(d)?p:p.optional())}if(e.patternProperties){let d=e.patternProperties,m=Object.keys(d),p=[];for(let g of m){let C=tt(d[g],t),w=O.string().regex(new RegExp(g));p.push(O.looseRecord(w,C))}let h=[];if(Object.keys(o).length>0&&h.push(O.object(o).passthrough()),h.push(...p),h.length===0)r=O.object({}).passthrough();else if(h.length===1)r=h[0];else{let g=O.intersection(h[0],h[1]);for(let C=2;C<h.length;C++)g=O.intersection(g,h[C]);r=g}if(e.additionalProperties===!1){let g=Object.keys(o),C=m.map(y=>new RegExp(y)),w=r;r=r.check(y=>{if(!Pt(y.value))return;let S=[];for(let T of Object.keys(y.value))g.includes(T)||C.some(L=>L.test(T))||S.push(T);S.length&&y.issues.push({code:"unrecognized_keys",keys:S,input:y.value,inst:w})})}}else{let d=O.object(o);e.additionalProperties===!1?r=d.strict():a?r=d.catchall(a):r=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let d;if(c){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=tt(m,t)}r=RS(r,{keySchema:d,minProperties:u,maxProperties:l})}break}case"array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(d=>tt(d,t)),c=Eg(a,s),u=Array.isArray(i)?void 0:Og(i,t),l=O.tuple(c);r=u?l.rest(u):l,typeof e.minItems=="number"&&(r=r.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(O.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(d=>tt(d,t)),c=Eg(a,s),u=Og(e.additionalItems,t),l=O.tuple(c);r=u?l.rest(u):l,typeof e.minItems=="number"&&(r=r.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(O.maxLength(e.maxItems)))}else if(i!==void 0){let s=tt(i,t),a=O.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),r=a}else r=O.array(O.any());(e.uniqueItems===!0||e.contains!==void 0)&&(r=$S(r,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?tt(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return r}function tt(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n=Ng(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>tt(u,t)),c=O.union(a);n=r?O.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>tt(u,t)),c=O.xor(a);n=r?O.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:O.any();else{let a=r?n:tt(e.allOf[0],t),c=r?0:1;for(let u=c;u<e.allOf.length;u++)a=O.intersection(a,tt(e.allOf[u],t));n=a}e.nullable===!0&&t.version==="openapi-3.0"&&(n=O.nullable(n)),e.readOnly===!0&&(n=O.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Ji(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Ji(e.contains)&&(o.contains=e.contains);for(let a of["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a])}for(let a of Object.keys(e))_S.has(a)||We(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(n,o),e.description&&(n=n.describe(e.description)),n}function zg(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=PS(n,t?.defaultTarget),o=n.$defs||n.definitions||{},i={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Ve};return tt(n,i)}var jg=Symbol("z.visit/resolving");function Xi(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},r=new Map;function o(s){let a=r.get(s);if(a===jg)return new Pi({type:"lazy",getter:()=>r.get(s)});if(a!==void 0)return a;r.set(s,jg);let c=i(s),u=n(c,c!==s);return r.set(s,u),u}function i(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let u=a.shape,l=Object.keys(u),d=!1,m={};for(let h of l){let g=o(u[h]);g!==u[h]&&(d=!0),m[h]=g}let p=a.catchall;return a.catchall&&(p=o(a.catchall),p!==a.catchall&&(d=!0)),d?ie(s,{...a,shape:m,catchall:p}):s}case"array":{let u=o(a.element);return u===a.element?s:ie(s,{...a,element:u})}case"tuple":{let u=a.items,l=!1,d=[];for(let p of u){let h=o(p);h!==p&&(l=!0),d.push(h)}let m=a.rest;return a.rest&&(m=o(a.rest),m!==a.rest&&(l=!0)),l?ie(s,{...a,items:d,rest:m}):s}case"record":case"map":{let u=o(a.keyType),l=o(a.valueType);return u===a.keyType&&l===a.valueType?s:ie(s,{...a,keyType:u,valueType:l})}case"set":{let u=o(a.valueType);return u===a.valueType?s:ie(s,{...a,valueType:u})}case"union":{let u=a.options,l=!1,d=[];for(let m of u){let p=o(m);p!==m&&(l=!0),d.push(p)}return l?ie(s,{...a,options:d}):s}case"intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:ie(s,{...a,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=o(a.innerType);return u===a.innerType?s:ie(s,{...a,innerType:u})}case"pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:ie(s,{...a,in:u,out:l})}case"function":{let u=o(a.input),l=o(a.output);return u===a.input&&l===a.output?s:ie(s,{...a,input:u,output:l})}case"lazy":{let u=a.getter,{_cachedInner:l,...d}=a;return ie(s,{...d,getter:()=>o(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return o(e)}function Zg(e){return Xi(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:So(n.options)}})}function DS(e,t){if(!t?.length)return e;let n=e._zod.def;return ie(e,Zt(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function Wg(e){return DS(e.out,e.checks)}function OS(e){return e.in._zod.traits.has("$ZodTransform")?Wg(e):e.in}function Vg(e){return Xi(e,{pipe:t=>OS(t._zod.def),default:(t,n)=>n?br(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function Hg(e){return Xi(e,{pipe:t=>Wg(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var nm={};Nt(nm,{bigint:()=>ZS,boolean:()=>jS,date:()=>WS,number:()=>zS,string:()=>NS});function NS(e){return xp(vo,e)}function zS(e){return Mp(wo,e)}function jS(e){return Op(xo,e)}function ZS(e){return zp(Io,e)}function WS(e){return qp(Vi,e)}var rm=1e4,Fg=ce.string().min(1).max(1024),tn=ce.array(Fg).max(rm),VS=ce.enum(["project","chronological","machine"]),HS=ce.enum(["updated","created","alpha","none"]),FS=ce.enum(["default","ascending","descending"]),BS=ce.enum(["muted","colour"]),US=ce.enum(["12h","1d","3d","1w","never"]),KS=ce.enum(["blocked","everything"]),GS=ce.array(ce.union([ce.literal("threads"),Fg.regex(/^(project|section|machine):\S+$/)])).max(rm).transform(e=>[...new Set(e)]);function Ie(e,t,n,r){return{schema:e,defaultValue:t,description:n,...r?{readStored:r}:{}}}var Qi={showArchived:Ie(ce.boolean(),!1,"Show archived threads: whether every group also lists archived threads, as each group's menu toggles."),organizationMode:Ie(VS,"project","How top-level groups are formed: project, chronological (custom sections) or machine."),environmentGrouping:Ie(ce.boolean(),!1,"Worktrees as folders: whether sibling threads sharing a worktree environment fold into a folder row."),chronologicalSort:Ie(HS,"updated","Sort field inside a group: updated, created or alpha. none is read as updated."),sortDirection:Ie(FS,"default","Sort direction: ascending or descending. A saved default reads as the field's own direction (descending for dates, ascending for alpha)."),sectionOrder:Ie(tn,["pinned","projects","threads"],"Top-level group order when organized by project."),manualSectionOrder:Ie(tn,["pinned","sections","threads"],"Top-level group order when organized chronologically."),machineSectionOrder:Ie(tn,["pinned","machines","threads"],"Top-level group order when organized by machine."),hiddenGroups:Ie(GS,[],"Groups moved into More: threads, project:<id>, section:<id> or machine:<id>."),collapsedSections:Ie(ce.array(ce.enum(["pinned","threads"])).max(rm),[],"Built-in groups (pinned, threads) that are collapsed."),collapsedProjects:Ie(tn,[],"Project ids whose group is collapsed."),collapsedThreadSections:Ie(tn,[],"Custom section keys (section:<id>) whose group is collapsed."),collapsedMachines:Ie(tn,[],"Machine ids whose group is collapsed."),collapsedEnvironments:Ie(tn,[],"Environment ids whose folder row is collapsed."),expandedOlder:Ie(tn,[],`Parent thread ids whose "N more child threads" row the user opened, once that tree's children chip was open.`),openSettledFolds:Ie(tn,[],"Group ids whose settled fold the user opened."),settleAfter:Ie(US,"1d","Settle after: how long a quiet thread goes without activity before it settles into its group's settled fold: 12h, 1d, 3d, 1w or never."),expandedChildren:Ie(tn,[],"Parent thread ids whose chip the user opened."),childAttention:Ie(KS,"blocked","Needs attention counts every child: blocked counts a child thread that waits on you, is offline or has an orphaned failure; everything also counts every failed or finished-unread child. The same children stay out of an open tree's N more child threads fold, as running ones do."),harnessIcon:Ie(BS,"muted","How rows draw the harness logo, where a row draws one: muted (monochrome) or colour (the provider's tint). A stored hidden reads as muted.",e=>e==="hidden"?"muted":e)},Bg=Object.keys(Qi);function om(e){return Object.hasOwn(Qi,e)}function qS(e){return structuredClone(Qi[e].defaultValue)}function YS(){return Object.fromEntries(Bg.map(e=>[e,qS(e)]))}function im(e,t){let n=Qi[e].schema.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,message:n.error.issues.map(r=>r.message).join("; ")}}function JS(e,t){let n=Qi[e];return im(e,n.readStored?n.readStored(t):t)}function sm(e){let t=YS();if(e===null||typeof e!="object")return t;let n=e;for(let r of Bg){if(!(r in n))continue;let o=JS(r,n[r]);o.success&&(t[r]=o.value)}return t}var XS=ce.object({density:ce.enum(["compact","comfortable"]).catch("compact")}),am="bb.thread-glance.client.v1",es="bb.thread-glance.preferences.v1",Ug="bb.thread-list.preferences.v1";function Kg(e){let t=XS.safeParse(e??{});return t.success?t.data:{density:"compact"}}function Cu(){return new Set}function ku(e,t){let n=N(r=>t(o=>({...o,...r})),[t]);return D(()=>(e.add(n),()=>{e.delete(n)}),[e,n]),N(r=>{for(let o of e)o!==n&&o(r)},[e,n])}function ts(e){try{let t=globalThis.localStorage?.getItem(e);return t==null?null:JSON.parse(t)}catch{return null}}function Po(e,t){try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch{}}var QS=Cu();function Gg(){let[e,t]=A(()=>Kg(ts(am))),n=ku(QS,t),r=N(o=>{t(i=>{let s={...i,...o};return Po(am,s),s}),n(o)},[n]);return[e,r]}var e_={};function qg(e,t){let[n,r]=A(null),[o,i]=A(null);if(e!==n){let s=Date.now();r(e),i(a=>G5(a,e,s))}return D(()=>{o!==null&&o.wentIdle.length>0&&t([...o.wentIdle])},[o,t]),o?.idleSince??e_}function Yg(e){let[t,n]=A(()=>Date.now());return D(()=>{let r=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(r)},[]),D(()=>{if(e===null)return;let r=e-Date.now();if(r>2**31-1)return;let o=setTimeout(()=>n(Date.now()),Math.max(r,0)+50);return()=>clearTimeout(o)},[e]),t}var ns=ce.record(ce.string(),ce.number()),iA=ce.object({startedAt:ns,finishedAt:ns,pendingAt:ns,seenAt:ns,idleAt:ns}),t_=140,cm=ce.object({kind:ce.enum(["question","approval","plan","input","failed","done"]),text:ce.string().max(t_),at:ce.number()}),Jg=ce.object({pending:cm.optional(),failed:cm.optional(),done:cm.optional()}),Wn={preferences:"preferences",stamps:"stamps",scheduled:"scheduled",notes:"notes"};var n_=150,r_=Cu(),rs=new Map;function Xg(){let e=xn(),[t,n]=A(()=>sm(ts(es))),[r,o]=A(!1),i=$(null),s=wn(),a=$(!1),c=N(async()=>{try{let{preferences:m}=await e.call("listPreferences",null),p=sm(m);for(let[h,g]of rs)p[h]=g;n(p),Po(es,p)}finally{o(!0)}},[e]);D(()=>{let m=!1;return(async()=>{try{await e.call("importPreferences",{bbMirror:ts(Ug)})}catch{}m||await c().catch(()=>{})})(),()=>{m=!0}},[e,c]),D(()=>{s==="connected"&&(a.current&&c().catch(()=>{}),a.current=!0)},[s,c]),vn(Wn.preferences,m=>{let p=m;if(!om(p?.key)||rs.has(p.key))return;let h=im(p.key,p.value);h.success&&n(g=>{let C={...g,[p.key]:h.value};return Po(es,C),C})});let u=N(()=>{let m=[...rs];rs.clear();for(let[p,h]of m)e.call("setPreference",{key:p,value:h}).catch(g=>{gt.error(`Couldn't save the ${p} setting`,{description:g instanceof Error?g.message:String(g)})})},[e]);D(()=>()=>{i.current!==null&&clearTimeout(i.current),u()},[u]);let l=ku(r_,n),d=N(m=>{n(p=>{let h={...p,...m};return Po(es,h),h}),l(m);for(let[p,h]of Object.entries(m))om(p)&&rs.set(p,h);i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,u()},n_)},[u,l]);return{prefs:t,hydrated:r,update:d}}var um={};function Qg(){let e=xn(),[t,n]=A(um),r=wn(),o=$(!1),[i,s]=A(0);return D(()=>{let a=!1;return e.call("listScheduled",null).then(c=>{a||n(c.status==="ready"?c.scheduled:um)},()=>{}),()=>{a=!0}},[e,i]),D(()=>{r==="connected"&&(o.current&&s(a=>a+1),o.current=!0)},[r]),vn(Wn.scheduled,a=>{let c=a;c===null||typeof c!="object"||n(c.status==="ready"&&c.scheduled?c.scheduled:um)}),t}var e4={startedAt:{},finishedAt:{},pendingAt:{},seenAt:{},idleAt:{}},o_=new Set(Object.keys(e4));function t4(){let e=xn(),[t,n]=A(e4),[r,o]=A(!1),i=wn(),s=$(!1),a=N(()=>{e.call("listStamps",null).then(m=>{n(m.stamps),o(!0)},()=>o(!0))},[e]);D(a,[a]),D(()=>{i==="connected"&&(s.current&&a(),s.current=!0)},[i,a]);let c=N(m=>{!o_.has(m.kind)||!Array.isArray(m.threadIds)||n(p=>{let h={...p[m.kind]};for(let g of m.threadIds)m.value===null?delete h[g]:h[g]=m.value;return{...p,[m.kind]:h}})},[]);vn(Wn.stamps,m=>c(m));let u=N(m=>{m.length!==0&&(c({kind:"seenAt",threadIds:m,value:Date.now()}),e.call("markSeen",{threadIds:m}).catch(()=>{}))},[c,e]),l=N(m=>{m.length!==0&&e.call("markIdle",{threadIds:m}).catch(()=>{})},[e]),d=N(m=>{m.length!==0&&(c({kind:"seenAt",threadIds:m,value:null}),e.call("clearSeen",{threadIds:m}).catch(()=>{}))},[c,e]);return{stamps:t,loaded:r,markSeen:u,markIdle:l,clearSeen:d}}function lm(e,t,n){let r=new Set,o=e;for(;o!==null&&!r.has(o);){if(o===t)return!0;r.add(o),o=n(o)}return!1}function n4(e,t,n){if(t==="pinned")return e.pinned?{type:"unchanged"}:{type:"pin",threadId:e.threadId};if(e.pinned)return{type:"unpin",threadId:e.threadId};if(n.mode==="chronological"&&(t==="threads"||t.startsWith("section:"))){let r=t==="threads"?null:t.slice(8);return r===e.sectionId&&e.parentThreadId===null?{type:"unchanged"}:{type:"move",threadId:e.threadId,sectionId:r,detach:e.parentThreadId!==null}}return e.parentThreadId!==null?{type:"detach",threadId:e.threadId}:{type:"unchanged"}}function dm(e,t,n){if(t.kind==="group")return n4(e,t.groupId,n);if(t.threadId===e.threadId)return{type:"unchanged"};if(t.zone==="middle")return lm(t.threadId,e.threadId,n.parentOf)?{type:"blocked"}:e.parentThreadId===t.threadId?{type:"unchanged"}:{type:"nest",threadId:e.threadId,parentThreadId:t.threadId,unpinFirst:e.pinned};if(t.inPinned&&n.pinnedOrder.includes(t.threadId)){if(!e.pinned)return{type:"pin",threadId:e.threadId};let r=n.pinnedOrder.filter(u=>u!==e.threadId),o=r.indexOf(t.threadId),i=t.zone==="before"?o:o+1,s=r[i-1]??null,a=r[i]??null,c=n.pinnedOrder.indexOf(e.threadId);return(n.pinnedOrder[c-1]??null)===s&&(n.pinnedOrder[c+1]??null)===a?{type:"unchanged"}:{type:"reorder-pinned",threadId:e.threadId,previousThreadId:s,nextThreadId:a}}return n4(e,n.groupOfThread(t.threadId),n)}function r4(e,t){let n=t.thread.createdAt-e.thread.createdAt;return n!==0?n:e.thread.id<t.thread.id?-1:e.thread.id>t.thread.id?1:0}function i_(e,t){let n=e.thread.displayTitle.localeCompare(t.thread.displayTitle);return n!==0?n:e.thread.id.localeCompare(t.thread.id)}function s_(e,t){let n=t.treeAttention-e.treeAttention;return n!==0?n:r4(e,t)}function Vn(e){return e==="none"?"updated":e}function yu(e){return Vn(e)==="alpha"?"ascending":"descending"}function pm(e,t){return t==="default"?yu(e):t}function o4(e){let t=Vn(e.field),n=pm(t,e.direction)===yu(t)?1:-1,r=t==="alpha"?i_:t==="created"?r4:s_;return(o,i)=>n*r(o,i)}function i4(e,t){if(e.pinSortKey!==null&&t.pinSortKey!==null&&e.pinSortKey!==t.pinSortKey)return e.pinSortKey<t.pinSortKey?-1:1;let n=(t.pinnedAt??0)-(e.pinnedAt??0);if(n!==0)return n;let r=t.createdAt-e.createdAt;return r!==0?r:e.id<t.id?-1:e.id>t.id?1:0}function s4(e,t){let n=e.createdAt-t.createdAt;return n!==0?n:e.id<t.id?-1:e.id>t.id?1:0}var a_={question:"Asks",approval:"Approve",plan:"Plan",input:"Needs"};function fm(e){let t=e?.pending?.kind;return t==="question"||t==="approval"||t==="plan"||t==="input"?t:null}function a4(e,t){if(e.hasPendingInteraction){let n=fm(t),r=t?.pending?.text.trim();return n===null||!r?null:{prefix:a_[n],text:r,tone:"attention"}}if(or(e)==="error"){let n=t?.failed?.text.trim();return n&&n.toLowerCase()!=="failed"?{prefix:"Failed",text:n,tone:"destructive"}:null}return aa(e)==="failed"?{prefix:"Failed",text:"queued message wasn't sent",tone:"destructive"}:null}function c4(e){return e.text===""?e.prefix:`${e.prefix}: ${e.text}`}function u4(e){return e?.done??null}var c_=new Set(["working","background"]);function l4(e){return e.pinnedAt!==null||e.isPinned}function u_(e,t){let n=new Set([e.id]),r=e.parentThreadId,o=null,i=!1;for(;r!==null;){if(n.has(r))return null;n.add(r);let s=t.get(r);if(s===void 0)break;s.isHidden||(o??=s.id,l4(s)&&(i=!0)),r=s.parentThreadId}return!e.isHidden&&l4(e)&&!i?null:o}function l_(e,t){if(t.stampsLoaded===!1)return null;let n=t.idleSince?.[e],r=t.idleAt?.[e];return n===void 0?r:r===void 0?n:Math.max(n,r)}function d4(e){let t=new Map(e.threads.map(d=>[d.id,d])),n=new Map;for(let d of e.threads){let m=Z5(d,e),p=ua(d,{unread:m,hasDraft:e.draftIds.has(d.id),scheduledAt:e.scheduled[d.id]??null,now:e.now,needsKind:fm(e.notes?.[d.id])}),h=V5(d,m),g=d.id===e.activeThreadId;n.set(d.id,{thread:d,state:p,unread:m,flags:d.isHidden?H5(h):h,chipFlags:F5(h,d.isHidden),attentionFlags:new Set,quiet:Wr(p,m,g),quietIgnoringOpen:!1,isActive:g,parentId:u_(d,t),note:a4(d,e.notes?.[d.id])})}let r=e.childAttention??"blocked",o=null;for(let d of n.values()){let m=d.parentId===null?void 0:n.get(d.parentId),p=m===void 0?null:K5(d.thread,d.flags,{...m,finishedAt:e.finishedAt[m.thread.id],idleSince:l_(m.thread.id,e)});p!==null&&p>e.now&&(o=Math.min(o??p,p)),d.attentionFlags=q5(d.flags,{isRoot:m===void 0,mode:r,orphaned:p!==null&&p<=e.now}),d.quietIgnoringOpen=m===void 0||r==="everything"?Wr(d.state,d.unread,!1):d.thread.isArchived||!c_.has(d.state.kind)&&d.attentionFlags.size===0}let i=new Map,s=[];for(let d of n.values()){if(d.parentId===null){d.thread.isHidden||s.push(d);continue}let m=i.get(d.parentId)??[];m.push(d.thread.id),i.set(d.parentId,m)}for(let d of i.values())d.sort((m,p)=>s4(t.get(m),t.get(p)));let a=new Map,c=(d,m)=>{let p=a.get(d);if(p!==void 0)return p;let h=[],g=new Set,C=new Set,w=0,y=0,S=!0;m.add(d);for(let L of i.get(d)??[]){if(m.has(L))continue;let M=n.get(L),E=c(L,m);if(h.push(M,...E.descendants),!M.thread.isArchived){for(let B of M.attentionFlags)g.add(B);M.flags.has("working")&&g.add("working");for(let B of M.chipFlags)C.add(B)}for(let B of E.flags)g.add(B);for(let B of E.chipFlags)C.add(B);(M.thread.isHidden?M.attentionFlags.size>0:!M.quietIgnoringOpen)&&(S=!1),M.thread.isHidden||(w+=1,y+=1),w+=E.visibleCount,E.quietIgnoringOpen||(S=!1)}m.delete(d);let T={descendants:h,flags:g,chipFlags:C,visibleCount:w,childCount:y,quietIgnoringOpen:S};return a.set(d,T),T};for(let d of n.keys())c(d,new Set);let u=[],l=new Map;for(let d of s){let{descendants:m,flags:p,visibleCount:h}=a.get(d.thread.id),g=d.thread.latestAttentionAt,C=d.quiet,w=Wr(d.state,d.unread,!1),y=d.isActive,S=new Set;for(let M of m){if(!M.thread.isArchived)for(let E of M.attentionFlags)S.add(E);g=Math.max(g,M.thread.latestAttentionAt),M.isActive&&(y=!0),M.thread.isHidden?M.attentionFlags.size>0&&(C=w=!1):(M.quiet||(C=!1),M.quietIgnoringOpen||(w=!1))}let T=new Set(p);if(!d.thread.isArchived){for(let M of d.attentionFlags)T.add(M),S.add(M);d.flags.has("working")&&T.add("working")}let L={root:d,descendants:m,descendantFlags:p,flags:T,attentionFlags:S,visibleDescendantCount:h,latestAttentionAt:g,quiet:C&&!y,quietIgnoringOpen:w,containsActive:y};u.push(L),l.set(d.thread.id,L);for(let M of m)l.set(M.thread.id,L)}return{infos:n,children:i,trees:u,treeOf:l,subtrees:a,nextOrphanAt:o}}function bu(e){return e.some(t=>t.root.unread||t.descendants.some(n=>n.unread))}function os(e,t,n=null){let r=[],o=new Set([e]),i=t.get(e)?.parentId??null;for(;i!==null&&i!==n&&!o.has(i);)r.push(i),o.add(i),i=t.get(i)?.parentId??null;return r}var Tt="pinned",Rt="threads";function d_(e){return e.pinnedAt!==null||e.isPinned}function p4(e){return e.find(t=>t.isPersonal)??null}function vu(e,t){if(d_(e)&&!e.isHidden)return Tt;switch(t.mode){case"project":{let n=t.projects.find(r=>r.id===e.projectId);return n===void 0||n.isPersonal?Rt:`project:${n.id}`}case"chronological":return e.sectionId===null?Rt:`section:${e.sectionId}`;case"machine":return e.host===null?Rt:`machine:${e.host.id}`}}function f4(e,t){let n=p4(e.projects);switch(e.mode){case"project":return e.projects.filter(r=>!r.isPersonal).map(r=>({id:`project:${r.id}`,kind:"project",label:r.name,entityId:r.id,newThreadProjectId:r.id,newThreadSectionId:null}));case"chronological":{let r=new Set(e.sections.map(s=>s.id)),o=[...e.sections];t&&o.sort((s,a)=>s.name.localeCompare(a.name));let i=o.map(s=>({id:`section:${s.id}`,kind:"section",label:s.name,entityId:s.id,newThreadProjectId:n?.id??null,newThreadSectionId:s.id}));for(let s of e.threads)s.sectionId===null||r.has(s.sectionId)||(r.add(s.sectionId),i.push({id:`section:${s.sectionId}`,kind:"section",label:"Section",entityId:s.sectionId,newThreadProjectId:n?.id??null,newThreadSectionId:s.sectionId}));return i}case"machine":{let r=new Map;for(let o of e.threads)o.host!==null&&!r.has(o.host.id)&&r.set(o.host.id,o.host.name);return[...r].map(([o,i])=>({id:`machine:${o}`,kind:"machine",label:i||"Unknown machine",entityId:o,newThreadProjectId:null,newThreadSectionId:null}))}}}function mm(e,t){return e===Tt?{id:e,kind:"pinned",label:"Pinned",entityId:null,newThreadProjectId:null,newThreadSectionId:null}:{id:e,kind:"threads",label:"Threads",entityId:null,newThreadProjectId:p4(t)?.id??null,newThreadSectionId:null}}var p_={project:"projects",chronological:"sections",machine:"machines"},is={project:"sectionOrder",chronological:"manualSectionOrder",machine:"machineSectionOrder"};function m4(e,t,n){let r=p_[e],o=new Set(n),i=new Set(t),s=[],a=u=>{s.includes(u)||s.push(u)};for(let u of t)if(u===r)for(let l of n)i.has(l)||a(l);else(u===Tt||u===Rt||o.has(u))&&a(u);let c=n.filter(u=>!s.includes(u));if(c.length>0){let u=-1;s.forEach((d,m)=>{o.has(d)&&(u=m)});let l=u>=0?u+1:s.includes(Rt)?s.indexOf(Rt):s.length;s.splice(l,0,...c)}return s.includes(Tt)||s.unshift(Tt),s.includes(Rt)||s.push(Rt),s}function hm(e,t,n,r){if(t===n)return[...e];let o=e.filter(s=>s!==t),i=o.indexOf(n);return i<0?[...e]:(o.splice(r==="before"?i:i+1,0,t),o)}function ss(e,t){switch(e.kind){case"pinned":case"threads":return t.collapsedSections.includes(e.kind);case"project":return t.collapsedProjects.includes(e.entityId);case"section":return t.collapsedThreadSections.includes(e.id);case"machine":return t.collapsedMachines.includes(e.entityId)}}function gm(e,t){let n=(r,o)=>r.includes(o)?r.filter(i=>i!==o):[...r,o];switch(e.kind){case"pinned":case"threads":return{collapsedSections:n(t.collapsedSections,e.kind)};case"project":return{collapsedProjects:n(t.collapsedProjects,e.entityId)};case"section":return{collapsedThreadSections:n(t.collapsedThreadSections,e.id)};case"machine":return{collapsedMachines:n(t.collapsedMachines,e.entityId)}}}var z={archive:"Archive",unarchive:"ArchiveRestore",more:"MoreHorizontal",openInSplit:"Columns2",copy:"Copy",link:"ExternalLink",markRead:"MailOpen",markUnread:"Mail",pin:"Pin",unpin:"PinOff",moveToSection:"SectionMove",rename:"Edit",remove:"Trash2",details:"Info",crossGroup:"FolderExport",hidden:"EyeOff",show:"Eye",expand:"ChevronRight",collapse:"ChevronDown",moveUp:"ChevronUp",newThread:"Plus",newSection:"SectionAdd",customize:"SlidersHorizontal",settings:"SlidersHorizontal",check:"Check",pullRequest:"GitPullRequest",branch:"GitBranch",worktree:"FolderGit",machine:"Laptop",environmentFallback:"Zap",filter:"FilterHorizontal",drag:"DragDropVertical",move:"MoveTo",open:"ArrowUpRight"},$A=Object.values(z);function h4(e){let{thread:t}=e,n=t.archivedAt!==null||t.isArchived,r=t.pinnedAt!==null||t.isPinned,o=[];return o.push({action:"details",label:"Details",icon:z.details}),e.splitAvailable&&o.push({action:"open-in-split",label:"Open in split",icon:z.openInSplit}),o.push({action:"copy-link",label:"Copy thread link",icon:z.link}),o.push({action:"copy-id",label:"Copy thread ID",icon:z.copy}),o.push(e.unread?{action:"mark-read",label:"Mark read",icon:z.markRead}:{action:"mark-unread",label:"Mark unread",icon:z.markUnread}),o.push(r?{action:"unpin",label:"Unpin",icon:z.unpin}:{action:"pin",label:"Pin",icon:z.pin}),e.isRoot&&!n&&e.hasSections&&o.push({action:"move-to-section",label:"Move to section",icon:z.moveToSection}),n||o.push({action:"move",label:"Move\u2026",icon:z.move}),o.push({action:"rename",label:"Rename",icon:z.rename}),o.push(n?{action:"unarchive",label:"Unarchive",icon:z.unarchive,separated:!0}:{action:"archive",label:"Archive",icon:z.archive,separated:!0}),o.push({action:"delete",label:"Delete",icon:z.remove,destructive:!0}),o}var g4=20;function C4(e){return e.split(/[^\p{L}\p{N}]+/u).map(t=>t.trim()).filter(t=>t.length>0)}function k4(e){let t=e.displayName?.trim()||e.id,n=C4(t),r=C4(e.id),o=(n[0]??e.id)[0]??"?",i=[],s=a=>{if(a===void 0)return;let c=(o+a).toUpperCase();i.includes(c)||i.push(c)};s((n[0]??"")[1]);for(let a of n.slice(1))s(a[0]);for(let a of r)for(let c of a)s(c);for(let a of(n[0]??"").slice(2))s(a);return i.length===0&&i.push(o.toUpperCase()),i}function y4(e){let t=new Map,n=new Set;for(let r of e){let o=k4(r),i=o.find(s=>!n.has(s))??o[0];n.add(i),t.set(r.id,i)}return t}function b4(e,t){return t.get(e)??k4({id:e})[0]}function as(e,t){return e.filter(n=>n!==t)}function v4(e,t){return n=>os(n,e.infos).includes(t)}function w4(e,t,n){let r=e.info.thread.id;return e.chip?.expanded??!1?{patch:{expandedChildren:as(t.expandedChildren,r)},drop:v4(n,r)}:x4(r,t)}function x4(e,t){return{patch:{expandedChildren:[...as(t.expandedChildren,e),e]},drop:null}}function I4(e,t,n){return e.scope==="reveal"?x4(e.scopeId,t):e.expanded?{patch:{expandedOlder:as(t.expandedOlder,e.scopeId)},drop:v4(n,e.scopeId)}:{patch:{expandedOlder:[...as(t.expandedOlder,e.scopeId),e.scopeId]},drop:null}}function S4(e,t){let n=as(t.openSettledFolds,e.groupId);return{patch:{openSettledFolds:e.expanded?n:[...n,e.groupId]},drop:null}}function _4(e,t,n){let r=new Set(e.rootIds),o=i=>{let s=n.treeOf.get(i);return s!==void 0&&r.has(s.root.thread.id)};return e.collapsed?{patch:ss(e.descriptor,t)?gm(e.descriptor,t):{},drop:null}:e.userCollapsed?{patch:{},drop:o}:{patch:gm(e.descriptor,t),drop:o}}function Cm(e,t){let n=[],r=[];for(let o of e)for(let i of[o.root,...o.descendants])i.unread&&(n.push(i.thread.id),ca(i.thread,t)&&r.push(i.thread.id));return{read:n,seen:r}}function P4(e,t,n){let r=t.treeOf.get(e);if(r!==void 0&&r.root.thread.id===e)return Cm([r],n);let o=t.infos.get(e)?.thread;return o===void 0?{read:[e],seen:[]}:{read:[e],seen:ca(o,n)?[e]:[]}}var km={waitsOnYou:0,failed:0,offline:0,working:0,unread:0};function ym(e){let t={...km};for(let n of e)for(let r of[n.root,...n.descendants]){if(r.thread.isArchived)continue;let o=r.attentionFlags;o.has("waits-on-you")&&(t.waitsOnYou+=1),(o.has("unread-failed")||o.has("queue-failed"))&&(t.failed+=1),o.has("offline")&&(t.offline+=1),r.flags.has("working")&&(t.working+=1),o.has("unread")&&(t.unread+=1)}return t}function L4(e,t){return{waitsOnYou:e.waitsOnYou+t.waitsOnYou,failed:e.failed+t.failed,offline:e.offline+t.offline,working:e.working+t.working,unread:e.unread+t.unread}}function M4(e,t){return{waitsOnYou:e.waitsOnYou,failed:e.failed,offline:e.offline,working:t.collapsed||t.more?e.working:0,unread:t.more?e.unread:0}}var wu=3600*1e3,f_={"12h":12*wu,"1d":24*wu,"3d":72*wu,"1w":168*wu};function m_(e,t){return Math.max(e.createdAt,e.latestAttentionAt,t.startedAt[e.id]??0,t.finishedAt[e.id]??0)}function R4(e,t){let n=e.thread;return n.pinnedAt!==null||n.isPinned||!Wr(e.state,e.unread,!1)||e.attentionFlags.size>0||t.settleAfter==="never"?!1:t.now-m_(n,t)>=f_[t.settleAfter]}function T4(e,t){return R4(e.root,t)&&e.descendants.every(n=>R4(n,t))}function A4(e){return(e.find(t=>t.isDefault)??e[0])?.hostId??null}function $4(e,t){return e!==null&&typeof t=="string"&&e!==t}var h_=3;function g_(e,t){return t===null?null:e.forest.infos.get(t)?.thread.displayTitle??null}function C_(e,t,n){let r=t.thread,o=n.thread;if(t===n)return null;switch(e.prefs.organizationMode){case"project":return r.projectId===o.projectId?null:`In project ${e.projectNames.get(r.projectId)??"another project"}`;case"chronological":return r.sectionId===o.sectionId?null:r.sectionId===null?"In Threads":`In section ${e.sectionNames.get(r.sectionId)??"another section"}`;case"machine":return(r.host?.id??null)===(o.host?.id??null)?null:r.host===null?"On no machine":`On machine ${r.host.name}`}}function k_(e,t,n){return t.parentId===null&&n!==null?e.forest.treeOf.get(t.thread.id)?.quiet??t.quiet:t.quiet}function y_(e,t){let n=t.thread.providerId;return t.parentId===null?e.defaultProviderId!==null&&n!==e.defaultProviderId:n!==e.forest.infos.get(t.parentId)?.thread.providerId}function b_(e,t,n){let r=t.thread.environment?.branchName??null,o=$4(r,e.defaultBranchOf(t.thread));return e.comfortable&&t.note===null&&o?{branchLine:r,pullRequest:"second-line"}:{branchLine:null,pullRequest:n===0&&o?"title":null}}function v_(e,t){let n=t.thread.host;return e.prefs.organizationMode==="machine"||e.primaryHostId===null||n===null||n.id===e.primaryHostId?null:n.name||"Unknown machine"}function D4(e,t,n,r){return{...b_(e,t,r.depth),machine:v_(e,t),type:"thread",key:`thread:${t.thread.id}`,info:t,depth:r.depth,nested:r.nested,parentTitle:g_(e,t.parentId),chip:r.chip,harness:y_(e,t),bold:t.unread,treeUnread:t===n&&[n,...e.forest.treeOf.get(n.thread.id)?.descendants??[]].some(o=>o.unread),note:t.note,dimmed:k_(e,t,r.chip),hiddenBadge:t.thread.isHidden,crossGroupLabel:C_(e,t,n),projectId:t.thread.projectId}}function O4(e,t){return(e.forest.children.get(t)??[]).map(n=>e.forest.infos.get(n)).filter(n=>!n.thread.isHidden||n.attentionFlags.size>0)}function bm(e,t){return e.forest.subtrees.get(t)}function w_(e,t,n){let r=t.thread.id,o=O4(e,r),i=h=>e.revealIds.has(h.thread.id)||e.revealPath.has(h.thread.id),s=(h,g,C)=>g>0?{type:"older",key:`older:${h}:${r}`,scopeId:r,scope:h,count:g,expanded:C,depth:n}:null;if(!e.expandedChildren.has(r)){let h=o.filter(i),g=o.filter(C=>!i(C)&&!C.thread.isHidden).length;return{shown:h,older:h.length>0?s("reveal",g,!1):null}}let a=h=>h.quietIgnoringOpen&&bm(e,h.thread.id).quietIgnoringOpen,c=new Set;for(let h of o)(h.thread.isHidden||!a(h))&&c.add(h.thread.id);let u=o.filter(h=>!c.has(h.thread.id)&&!h.thread.isHidden).sort((h,g)=>g.thread.createdAt-h.thread.createdAt).slice(0,h_);for(let h of u)c.add(h.thread.id);let l=e.expandedOlder.has(r),d=h=>c.has(h.thread.id)||i(h)||e.activePath.has(h.thread.id),m=o.filter(h=>!d(h)).length;return{shown:l?o:o.filter(d),older:s("tree",m,l)}}function x_(e){let t=e.environment;return t===null?"Environment":t.name?t.name:t.branchName?t.branchName:t.path?t.path.split(/[\\/]/).filter(Boolean).pop()??"Environment":"Environment"}function us(e,t,n){if(!e.prefs.environmentGrouping)return t.flatMap(s=>s.rows);let r=new Map;for(let s of t){let a=s.info.thread.environment;a?.isWorktree===!0&&a.id!==null&&r.set(a.id,(r.get(a.id)??0)+1)}let o=[],i=new Set;for(let s of t){let a=s.info.thread.environment,c=a?.isWorktree===!0?a.id:null;if(c===null||(r.get(c)??0)<2){o.push(...s.rows);continue}if(i.has(c))continue;i.add(c);let u=t.filter(m=>m.info.thread.environment?.id===c),l=e.collapsedEnvironments.has(c),d=new Set;for(let m of u)for(let p of m.flags)d.add(p);if(o.push({type:"environment",key:`environment:${c}:${s.info.thread.id}`,environmentId:c,label:x_(s.info.thread),environmentProviderId:a?.providerId??null,projectId:s.info.thread.projectId,sectionId:s.info.thread.sectionId,threadIds:u.map(m=>m.info.thread.id),collapsed:l,flag:l?Rl(d):null,depth:n}),!l)for(let m of u)for(let p of m.rows)o.push({...p,depth:p.depth+1})}return o}function N4(e,t,n){let{childCount:r,chipFlags:o}=bm(e,t.thread.id),i=Rl(o);return r===0&&i===null&&O4(e,t.thread.id).length===0?null:{count:r,expanded:n,flag:i}}function I_(e,t){let n=new Set([...t.attentionFlags,...bm(e,t.thread.id).flags]);return t.flags.has("working")&&n.add("working"),n}function z4(e,t,n,r){let{shown:o,older:i}=w_(e,n,r),s=o.map(c=>({info:c,flags:I_(e,c),rows:[D4(e,c,t.root,{depth:r,nested:r>1,chip:N4(e,c,e.expandedChildren.has(c.thread.id))}),...z4(e,t,c,r+1)]})),a=us(e,s,r);return i!==null&&a.push(i),a}function S_(e,t){let n=t.root,r=N4(e,n,e.expandedChildren.has(n.thread.id));return[D4(e,n,n,{depth:0,nested:!1,chip:r}),...z4(e,t,n,1)]}function cs(e,t){return{info:t.root,rows:S_(e,t),flags:t.flags}}function xu(e){return e.attentionFlags.size>0}function Iu(e){return e.trees.filter(xu).length}function vm(e,t){return e&&t>0}function E4(e,t,n,r){if(e.needYouOnly)return __(e,t,n,r);let o=ym(n),i=ss(t,e.prefs),s=e.activeThreadId,a=s!==null&&e.targets.has(s)&&n.some(m=>m.containsActive),c=i&&!a,u=t.id===Tt,l=j4(e,t,n),d;if(c)d=us(e,l.filter(xu).map(m=>cs(e,m)),0);else{let m=l.filter(C=>T4(C,e.settle)),p=new Set(m),h=l.filter(C=>!p.has(C)),g=m.find(C=>C.containsActive)??null;if(d=us(e,h.map(C=>cs(e,C)),0),m.length>0){g!==null&&d.push(...cs(e,g).rows);let C=e.openSettledFolds.has(t.id);if(d.push({type:"settled",key:`settled:${t.id}`,groupId:t.id,count:m.length,expanded:C}),C){let w=m.filter(y=>y!==g).map(y=>cs(e,y));d.push(...us(e,w,0))}}}return{descriptor:t,counters:o,userCollapsed:i,collapsed:c,hidden:r,rows:d,rootIds:n.map(m=>m.root.thread.id),hasUnread:bu(n)}}function j4(e,t,n){return t.id===Tt?[...n].sort((r,o)=>i4(r.root.thread,o.root.thread)):[...n].sort((r,o)=>e.compare({thread:r.root.thread,treeAttention:r.latestAttentionAt},{thread:o.root.thread,treeAttention:o.latestAttentionAt}))}function __(e,t,n,r){let o=j4(e,t,n);return{descriptor:t,counters:ym(n),userCollapsed:ss(t,e.prefs),collapsed:!1,hidden:r,rows:us(e,o.filter(xu).map(i=>cs(e,i)),0),rootIds:n.map(i=>i.root.thread.id),hasUnread:bu(n)}}function Z4(e){let{forest:t,prefs:n}=e,r=new Set,o=new Set;for(let[C,w]of e.targets)if(!(w!=="reveal"||!t.infos.has(C))){r.add(C);for(let y of os(C,t.infos))o.add(y)}let i=new Set;if(e.activeThreadId!==null&&t.infos.has(e.activeThreadId)){i.add(e.activeThreadId);for(let C of os(e.activeThreadId,t.infos))i.add(C)}let s={...e,compare:o4({field:n.chronologicalSort,direction:n.sortDirection}),expandedChildren:new Set(n.expandedChildren),expandedOlder:new Set(n.expandedOlder),openSettledFolds:new Set(n.openSettledFolds),collapsedEnvironments:new Set(n.collapsedEnvironments),revealIds:r,revealPath:o,activePath:i,projectNames:new Map(e.projects.map(C=>[C.id,C.name])),sectionNames:new Map(e.sections.map(C=>[C.id,C.name]))},a=new Map;for(let C of t.trees){let w=vu(C.root.thread,{mode:n.organizationMode,projects:e.projects}),y=a.get(w)??[];y.push(C),a.set(w,y)}let c=Vn(n.chronologicalSort)==="alpha",u=f4({mode:n.organizationMode,projects:e.projects,sections:e.sections,threads:e.threads},c),l=new Map(u.map(C=>[C.id,C]));l.set(Tt,mm(Tt,e.projects)),l.set(Rt,mm(Rt,e.projects));let d=m4(n.organizationMode,n[is[n.organizationMode]],u.map(C=>C.id)),m=new Set(n.hiddenGroups),p=[],h=[],g=km;for(let C of d){let w=l.get(C);if(w===void 0)continue;let y=a.get(C)??[];if(y.length===0&&(C===Tt||C===Rt&&n.organizationMode!=="chronological"))continue;let S=C!==Tt&&m.has(C);if(s.needYouOnly){y.some(xu)&&p.push(E4(s,w,y,S));continue}let T=E4(s,w,y,S);S?(h.push(T),g=L4(g,T.counters)):p.push(T)}return{groups:p,more:h,moreCounters:g,order:d,needYouCount:Iu(t),hasUnread:bu(t.trees)}}function W4(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function P_(e,t){if(e.size!==t.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Su(e,t){if(Object.is(e,t))return e;if(Array.isArray(e)&&Array.isArray(t)){let n=e.length===t.length,r=t.map((o,i)=>{let s=i<e.length?Su(e[i],o):o;return s!==e[i]&&(n=!1),s});return n?e:r}if(e instanceof Set&&t instanceof Set)return P_(e,t)?e:t;if(W4(e)&&W4(t)){let n=Object.keys(t),r=n.length===Object.keys(e).length,o={};for(let i of n){i in e||(r=!1);let s=i in e?Su(e[i],t[i]):t[i];s!==e[i]&&(r=!1),o[i]=s}return r?e:o}return t}function L_(e,t){let n=new Map(e.map(i=>[i.key,i])),r=e.length===t.length,o=t.map((i,s)=>{let a=n.get(i.key),c=a===void 0?i:Su(a,i);return c!==e[s]&&(r=!1),c});return r?e:o}function H4(e,t,n){let r={...t},o=e,i=Object.keys(r).length===Object.keys(o).length;for(let s of Object.keys(r))s in o||(i=!1),r[s]=s in n?n[s]:Su(o[s],r[s]),r[s]!==o[s]&&(i=!1);return i?e:r}function M_(e,t){return e.length===t.length&&t.every((n,r)=>n===e[r])}function V4(e,t,n){let r=n.map(o=>{let i=t.get(o.descriptor.id);return i===void 0?o:H4(i,o,{rows:L_(i.rows,o.rows)})});return M_(e,r)?e:r}function F4(e,t){if(e===null)return t;let n=new Map([...e.groups,...e.more].map(r=>[r.descriptor.id,r]));return H4(e,t,{groups:V4(e.groups,n,t.groups),more:V4(e.more,n,t.more)})}var _u=be({now:0,stamps:{startedAt:{},finishedAt:{},pendingAt:{},seenAt:{},idleAt:{}},notes:{},treeOf:()=>{}});var wm=globalThis.__bbPluginRuntime;if(wm==null||wm.radixAlertDialog==null)throw new Error('Cannot load "@radix-ui/react-alert-dialog": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Pu=wm.radixAlertDialog,r$="default"in Pu?Pu.default:Pu,{Action:xm,AlertDialog:o$,AlertDialogAction:i$,AlertDialogCancel:s$,AlertDialogContent:a$,AlertDialogDescription:c$,AlertDialogOverlay:u$,AlertDialogPortal:l$,AlertDialogTitle:d$,AlertDialogTrigger:p$,Cancel:Im,Content:Sm,Description:_m,Overlay:Pm,Portal:B4,Root:U4,Title:Lm,Trigger:R_,createAlertDialogScope:f$}=Pu;var K4=U4;var A_=B4,G4=F(({className:e,...t},n)=>f(Pm,{className:x("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n,...$e()}));G4.displayName=Pm.displayName;var Mm=F(({className:e,...t},n)=>v(A_,{children:[f(G4,{}),f(Sm,{ref:n,...$e(),className:x("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Mm.displayName=Sm.displayName;var Rm=({className:e,...t})=>f("div",{className:x("flex flex-col space-y-2 text-center sm:text-left",e),...t});Rm.displayName="AlertDialogHeader";var Tm=({className:e,...t})=>f("div",{className:x("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Tm.displayName="AlertDialogFooter";var Am=F(({className:e,...t},n)=>f(Lm,{ref:n,className:x("text-lg font-semibold",e),...t}));Am.displayName=Lm.displayName;var $m=F(({className:e,...t},n)=>f(_m,{ref:n,className:x("text-sm text-muted-foreground",e),...t}));$m.displayName=_m.displayName;var Em=F(({className:e,...t},n)=>f(xm,{ref:n,className:x(Xs(),e),...t}));Em.displayName=xm.displayName;var Dm=F(({className:e,...t},n)=>f(Im,{ref:n,className:x(Xs({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Dm.displayName=Im.displayName;var Om=globalThis.__bbPluginRuntime;if(Om==null||Om.radixDialog==null)throw new Error('Cannot load "@radix-ui/react-dialog": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Lu=Om.radixDialog,y$="default"in Lu?Lu.default:Lu,{Close:Nm,Content:q4,Description:zm,Dialog:b$,DialogClose:v$,DialogContent:w$,DialogDescription:x$,DialogOverlay:I$,DialogPortal:S$,DialogTitle:_$,DialogTrigger:P$,Overlay:jm,Portal:Y4,Root:J4,Title:X4,Trigger:Q4,WarningProvider:L$,createDialogScope:M$}=Lu;var E_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},ls=F(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:r=!1,className:o="",altIcon:i,showAlt:s=!1,icon:a,primaryColor:c,secondaryColor:u,disableSecondaryOpacity:l=!1,...d},m)=>{let p=n!==void 0?r?Number(n)*24/Number(t):n:void 0,h=p!==void 0?{strokeWidth:p,stroke:"currentColor"}:{},g={ref:m,...E_,width:t,height:t,color:c||e,className:o,...h,...d},w=[...s&&i?i:a].sort(([,y],[,S])=>{let T=y.opacity!==void 0;return S.opacity!==void 0?1:T?-1:0}).map(([y,S])=>{let T=S.opacity!==void 0,L=T&&!l?S.opacity:void 0,M=u?{...S.stroke!==void 0?{stroke:T?u:c||e}:{fill:T?u:c||e}}:{};return Zo(y,{...S,...h,...M,opacity:L,key:S.key})});return Zo("svg",g,w)});ls.displayName="HugeiconsIcon";var e8=[["path",{d:"M13.9248 21H10.0752C5.44476 21 3.12955 21 2.27636 19.4939C1.42317 17.9879 2.60736 15.9914 4.97574 11.9985L6.90057 8.75333C9.17559 4.91778 10.3131 3 12 3C13.6869 3 14.8244 4.91777 17.0994 8.75332L19.0243 11.9985C21.3926 15.9914 22.5768 17.9879 21.7236 19.4939C20.8704 21 18.5552 21 13.9248 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 9V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var t8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var n8=[["path",{d:"M21 7H3V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M21 7H3L4.2 5.4C5.08328 4.22229 5.52492 3.63344 6.15836 3.31672C6.7918 3 7.52786 3 9 3H15C16.4721 3 17.2082 3 17.8416 3.31672C18.4751 3.63344 18.9167 4.22229 19.8 5.4L21 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 17L12 10.5M9 14.5C9.58984 15.1068 11.1597 17.5 12 17.5C12.8403 17.5 14.4102 15.1068 15 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var r8=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var o8=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var i8=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var s8=[["path",{d:"M13 7H11C8.19108 7 6.78661 7 5.77772 7.67412C5.34096 7.96596 4.96596 8.34096 4.67412 8.77772C4 9.78661 4 11.1911 4 14C4 16.8089 4 18.2134 4.67412 19.2223C4.96596 19.659 5.34096 20.034 5.77772 20.3259C6.78661 21 8.19108 21 11 21H13C15.8089 21 17.2134 21 18.2223 20.3259C18.659 20.034 19.034 19.659 19.3259 19.2223C20 18.2134 20 16.8089 20 14C20 11.1911 20 9.78661 19.3259 8.77772C19.034 8.34096 18.659 7.96596 18.2223 7.67412C17.2134 7 15.8089 7 13 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4 14H2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M10 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M22 14H20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M9 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M12 7C12 5.11438 12 4.17157 11.4142 3.58579C10.8284 3 9.88562 3 8 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]];var Zm=[["path",{d:"M21.5 12C21.5 17.2467 17.2467 21.5 12 21.5C10.3719 21.5 8.8394 21.0904 7.5 20.3687C5.63177 19.362 4.37462 20.2979 3.26592 20.4658C3.09774 20.4913 2.93024 20.4302 2.80997 20.31C2.62741 20.1274 2.59266 19.8451 2.6935 19.6074C3.12865 18.5818 3.5282 16.6382 2.98341 15C2.6698 14.057 2.5 13.0483 2.5 12C2.5 6.75329 6.75329 2.5 12 2.5C17.2467 2.5 21.5 6.75329 21.5 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5 12H8.5M12 8.5V15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var a8=[["path",{d:"M21.5 12C21.5 17.2467 17.2467 21.5 12 21.5C10.3719 21.5 8.8394 21.0904 7.5 20.3687C5.63177 19.362 4.37462 20.2979 3.26592 20.4658C3.09774 20.4913 2.93024 20.4302 2.80997 20.31C2.62741 20.1274 2.59266 19.8451 2.6935 19.6074C3.12865 18.5818 3.5282 16.6382 2.98341 15C2.6698 14.057 2.5 13.0483 2.5 12C2.5 6.75329 6.75329 2.5 12 2.5C17.2467 2.5 21.5 6.75329 21.5 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.1257 12H12.0007M8.125 12H8M16.125 12H16M12.2507 12C12.2507 12.1381 12.1388 12.25 12.0007 12.25C11.8627 12.25 11.7507 12.1381 11.7507 12C11.7507 11.8619 11.8627 11.75 12.0007 11.75C12.1388 11.75 12.2507 11.8619 12.2507 12ZM8.25 12C8.25 12.1381 8.13807 12.25 8 12.25C7.86193 12.25 7.75 12.1381 7.75 12C7.75 11.8619 7.86193 11.75 8 11.75C8.13807 11.75 8.25 11.8619 8.25 12ZM16.25 12C16.25 12.1381 16.1381 12.25 16 12.25C15.8619 12.25 15.75 12.1381 15.75 12C15.75 11.8619 15.8619 11.75 16 11.75C16.1381 11.75 16.25 11.8619 16.25 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var c8=[["path",{d:"M3.01309 4.99084C2.89323 6.05084 3.55249 8.42285 6.48923 8.42285",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.5951 8.38081C18.8357 8.57881 21.1132 7.49881 20.9957 5.00281",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20.9928 20.9989C21.0528 19.9429 20.1777 17.5549 17.599 17.4229",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6.45163 17.4708C5.65013 17.2308 3.01306 18.3348 3.01306 20.9988",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M9.3299 6.11884C9.35388 5.09884 9.84533 2.99884 12.0029 2.99884C13.9208 2.99884 14.5861 4.61884 14.676 6.11884M6.26131 9.41884C6.38118 8.63884 7.29216 6.81484 9.36586 6.63484C11.4635 6.55564 14.3403 6.58684 14.8797 6.67084C15.5869 6.73377 17.2951 7.43884 17.7506 9.41884C17.9124 10.4388 17.8285 11.8788 17.8524 12.7188C17.8165 13.5588 17.9207 15.2623 17.7565 16.1388C17.6367 17.0988 16.9894 18.4668 16.1024 19.3068C14.7838 20.7228 11.1639 22.2108 8.03534 19.4508C6.41713 17.8908 6.30925 16.3788 6.18939 15.7788C6.15725 15.4571 6.15875 13.8763 6.16541 12.3588C6.14144 11.046 6.17235 9.78063 6.26131 9.41884Z",stroke:"currentColor",strokeWidth:"1.5",key:"4"}],["path",{d:"M3.01306 12.8988H5.9498",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M20.9929 12.8988L18.1161 12.8988",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M12.0033 16.4988L12.0033 20.2788",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]];var Mu=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var u8=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.9994 15L9 9M9.00064 15L15 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var l8=[["path",{d:"M11 6L21 6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 12L21 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 18L21 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M3 7.39286C3 7.39286 4 8.04466 4.5 9C4.5 9 6 5.25 8 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M3 18.3929C3 18.3929 4 19.0447 4.5 20C4.5 20 6 16.25 8 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]];var d8=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var p8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var Wm=[["path",{d:"M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.5 12.5H15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var f8=[["path",{d:"M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var m8=[["path",{d:"M14 2.20004C13.3538 2.06886 12.6849 2 12 2C11.3151 2 10.6462 2.06886 10 2.20004M21.8 10C21.9311 10.6462 22 11.3151 22 12C22 12.6849 21.9311 13.3538 21.8 14M14 21.8C13.3538 21.9311 12.6849 22 12 22C11.3151 22 10.6462 21.9311 10 21.8M2.20004 14C2.06886 13.3538 2 12.6849 2 12C2 11.3151 2.06886 10.6462 2.20004 10M17.5 3.64702C18.6332 4.39469 19.6053 5.36678 20.353 6.5M20.353 17.5C19.6053 18.6332 18.6332 19.6053 17.5 20.353M6.5 20.353C5.36678 19.6053 4.39469 18.6332 3.64702 17.5M3.64702 6.5C4.39469 5.36678 5.36678 4.39469 6.5 3.64702",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var h8=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]];var g8=[["path",{d:"M2.99969 17.0002C2.99969 17.9302 2.99969 18.3952 3.10192 18.7767C3.37932 19.8119 4.18796 20.6206 5.22324 20.898C5.60474 21.0002 6.06972 21.0002 6.99969 21.0002L16.9997 21.0002C17.9297 21.0002 18.3947 21.0002 18.7762 20.898C19.8114 20.6206 20.6201 19.8119 20.8975 18.7767C20.9997 18.3952 20.9997 17.9302 20.9997 17.0002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.4998 11.5002C16.4998 11.5002 13.1856 16.0002 11.9997 16.0002C10.8139 16.0002 7.49976 11.5002 7.49976 11.5002M11.9997 15.0002V3.00016",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var C8=[["path",{d:"M14.0737 3.88545C14.8189 3.07808 15.1915 2.6744 15.5874 2.43893C16.5427 1.87076 17.7191 1.85309 18.6904 2.39232C19.0929 2.6158 19.4769 3.00812 20.245 3.79276C21.0131 4.5774 21.3972 4.96972 21.6159 5.38093C22.1438 6.37312 22.1265 7.57479 21.5703 8.5507C21.3398 8.95516 20.9446 9.33578 20.1543 10.097L10.7506 19.1543C9.25288 20.5969 8.504 21.3182 7.56806 21.6837C6.63212 22.0493 5.6032 22.0224 3.54536 21.9686L3.26538 21.9613C2.63891 21.9449 2.32567 21.9367 2.14359 21.73C1.9615 21.5234 1.98636 21.2043 2.03608 20.5662L2.06308 20.2197C2.20301 18.4235 2.27297 17.5255 2.62371 16.7182C2.97444 15.9109 3.57944 15.2555 4.78943 13.9445L14.0737 3.88545Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4L20 11",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14 22L22 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var k8=[["path",{d:"M3 7H6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 17H9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M18 17L21 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M15 7L21 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M6 7C6 6.06812 6 5.60218 6.15224 5.23463C6.35523 4.74458 6.74458 4.35523 7.23463 4.15224C7.60218 4 8.06812 4 9 4C9.93188 4 10.3978 4 10.7654 4.15224C11.2554 4.35523 11.6448 4.74458 11.8478 5.23463C12 5.60218 12 6.06812 12 7C12 7.93188 12 8.39782 11.8478 8.76537C11.6448 9.25542 11.2554 9.64477 10.7654 9.84776C10.3978 10 9.93188 10 9 10C8.06812 10 7.60218 10 7.23463 9.84776C6.74458 9.64477 6.35523 9.25542 6.15224 8.76537C6 8.39782 6 7.93188 6 7Z",stroke:"currentColor",strokeWidth:"1.5",key:"4"}],["path",{d:"M12 17C12 16.0681 12 15.6022 12.1522 15.2346C12.3552 14.7446 12.7446 14.3552 13.2346 14.1522C13.6022 14 14.0681 14 15 14C15.9319 14 16.3978 14 16.7654 14.1522C17.2554 14.3552 17.6448 14.7446 17.8478 15.2346C18 15.6022 18 16.0681 18 17C18 17.9319 18 18.3978 17.8478 18.7654C17.6448 19.2554 17.2554 19.6448 16.7654 19.8478C16.3978 20 15.9319 20 15 20C14.0681 20 13.6022 20 13.2346 19.8478C12.7446 19.6448 12.3552 19.2554 12.1522 18.7654C12 18.3978 12 17.9319 12 17Z",stroke:"currentColor",strokeWidth:"1.5",key:"5"}]];var y8=[["path",{d:"M13 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 13V21M22 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var b8=[["path",{d:"M19 21C19.6068 20.4102 22 18.8403 22 18C22 17.1597 19.6068 15.5898 19 15M21 18H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 21C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12V13",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]];var v8=[["path",{d:"M8 6.50116H16.75C18.8567 6.50116 19.91 6.50116 20.6667 7.0069C20.9943 7.22584 21.2755 7.50717 21.4944 7.83484C22 8.59173 22 9.64538 22 11.7527C22 12.0122 22 12.2621 21.9997 12.5029M12 6.50116L11.3666 5.23392C10.8418 4.18406 10.3622 3.1273 9.19926 2.69106C8.6899 2.5 8.10802 2.5 6.94427 2.5C5.1278 2.5 4.21956 2.5 3.53806 2.88043C3.05227 3.15161 2.65142 3.55257 2.38032 4.03851C2 4.72021 2 5.62871 2 7.44571V10.5023C2 15.2177 2 17.5754 3.46447 19.0403C4.70529 20.2815 6.58687 20.4711 10 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"14",cy:"12.5",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"20",cy:"18.5",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M18 18.5C15.7909 18.5 14 16.7091 14 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14 14.5V21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]];Vm();var w8=[["path",{d:"M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}]];var x8=[["path",{d:"M8.00164 6.50013H16.754C18.8613 6.50013 19.9149 6.50013 20.6718 7.00574C20.9995 7.22462 21.2808 7.50588 21.4997 7.83346C21.8937 8.42301 21.9808 9.19265 22 10.5003M12.0027 6.50013L11.3691 5.23321C10.8442 4.18363 10.3645 3.12714 9.20122 2.69101C8.69172 2.5 8.10969 2.5 6.94562 2.5C5.12865 2.5 4.22017 2.5 3.53848 2.88033C3.05255 3.15144 2.6516 3.5523 2.38042 4.03811C2 4.71963 2 5.6279 2 7.44443V10.5003C2 15.2145 2 17.5716 3.46487 19.0361C4.82227 20.3931 6.94628 20.4927 11.0025 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M21.4649 15C20.7733 13.8044 19.4806 13 18 13C16.4726 13 15.1451 13.8561 14.4713 15.1147M14.5351 19C15.2267 20.1956 16.5194 21 18 21C19.5227 21 20.8467 20.1492 21.5224 18.897M17 15.5H16C15.0572 15.5 14.5858 15.5 14.2929 15.2071C14 14.9142 14 14.4428 14 13.5V12.5M19 18.5H20C20.9428 18.5 21.4142 18.5 21.7071 18.7929C22 19.0858 22 19.5572 22 20.5V21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var I8=[["path",{d:"M15.0244 21H12.0222C7.29769 21 4.93543 21 3.46772 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38116 4.53806C2.65287 4.05227 3.0546 3.65142 3.54148 3.38032C4.22449 3 5.13474 3 6.95525 3C8.12158 3 8.70475 3 9.21524 3.19101C10.3808 3.62712 10.8614 4.68358 11.3874 5.73313L12.0222 7M8.01332 7H16.7827C18.8941 7 19.9498 7 20.7081 7.50559C21.0364 7.72447 21.3183 8.00572 21.5377 8.33329C21.8193 8.75388 21.9444 9.26614 22 10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.9961 14C15.9961 12.6193 17.1159 11.5 18.4973 11.5C19.8786 11.5 20.9984 12.6193 20.9984 14C20.9984 14.8571 20.5668 15.6135 19.9091 16.0639C19.2259 16.5317 18.4985 17.172 18.5 18M18.625 20.75H18.5M18.75 20.75C18.75 20.8881 18.6381 21 18.5 21C18.3619 21 18.25 20.8881 18.25 20.75C18.25 20.6119 18.3619 20.5 18.5 20.5C18.6381 20.5 18.75 20.6119 18.75 20.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var S8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 9.5C9.5 8.11929 10.6193 7 12 7C13.3807 7 14.5 8.11929 14.5 9.5C14.5 10.3569 14.0689 11.1131 13.4117 11.5636C12.7283 12.0319 12 12.6716 12 13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var _8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 8.25H12M12.25 8.25C12.25 8.11193 12.1381 8 12 8C11.8619 8 11.75 8.11193 11.75 8.25C11.75 8.38807 11.8619 8.5 12 8.5C12.1381 8.5 12.25 8.38807 12.25 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var P8=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]];var L8=[["path",{d:"M12 20.5C19.1328 20.5 22 16.4706 22 11.5C22 6.52944 20.1328 2.5 12 2.5C4.13281 2.5 2 6.52944 2 11.5C2 13.5712 2.37034 15.4791 3.37161 17C4.63281 19 3.99253 20.8333 3 21.5C4.61547 21.5 5.70211 20.9858 6.39239 20.4766C6.88252 20.115 7.50688 19.9364 8.0984 20.0815C9.20689 20.3533 10.4991 20.5 12 20.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10 9C10 7.89543 10.8954 7 12 7C13.1046 7 14 7.89543 14 9C14 9.57777 13.755 10.0983 13.3632 10.4634C12.7572 11.0282 12 11.6716 12 12.5M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var M8=[["path",{d:"M6.00449 12.5V12M18.0045 12.5V12M12.0045 12.5V12M7.00449 12.5C7.00449 11.9477 6.55677 11.5 6.00449 11.5C5.4522 11.5 5.00449 11.9477 5.00449 12.5C5.00449 13.0523 5.4522 13.5 6.00449 13.5C6.55677 13.5 7.00449 13.0523 7.00449 12.5ZM19.0045 12.5C19.0045 11.9477 18.5568 11.5 18.0045 11.5C17.4522 11.5 17.0045 11.9477 17.0045 12.5C17.0045 13.0523 17.4522 13.5 18.0045 13.5C18.5568 13.5 19.0045 13.0523 19.0045 12.5ZM13.0045 12.5C13.0045 11.9477 12.5568 11.5 12.0045 11.5C11.4522 11.5 11.0045 11.9477 11.0045 12.5C11.0045 13.0523 11.4522 13.5 12.0045 13.5C12.5568 13.5 13.0045 13.0523 13.0045 12.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var R8=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var T8=[["path",{d:"M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]];var A8=[["path",{d:"M2 12C2 8.31087 2 6.4663 2.81382 5.15877C3.1149 4.67502 3.48891 4.25427 3.91891 3.91554C5.08116 3 6.72077 3 10 3H14C17.2792 3 18.9188 3 20.0811 3.91554C20.5111 4.25427 20.8851 4.67502 21.1862 5.15877C22 6.4663 22 8.31087 22 12C22 15.6891 22 17.5337 21.1862 18.8412C20.8851 19.325 20.5111 19.7457 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7457 3.1149 19.325 2.81382 18.8412C2 17.5337 2 15.6891 2 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 3L9.5 21",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 7H6M5 10H6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var $8=[["path",{d:"M3.99963 5.00055L9.99963 5.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.9996 5.00031L19.9996 5.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9996 9.00031L15.9996 15.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M9.99963 2.00031L9.99963 8.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M11.9996 16.0003L11.9996 22.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M15.9996 12.0001L19.9996 12.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M3.99963 12.0005L12.9996 12.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M11.9996 19.0003L19.9996 19.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}],["path",{d:"M3.99963 19.0005L8.99963 19.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"8"}]];var E8=[["path",{d:"M17 8L18.8398 9.85008C19.6133 10.6279 20 11.0168 20 11.5C20 11.9832 19.6133 12.3721 18.8398 13.1499L17 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 8L5.16019 9.85008C4.38673 10.6279 4 11.0168 4 11.5C4 11.9832 4.38673 12.3721 5.16019 13.1499L7 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14.5 4L9.5 20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var D8=[["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 2.20004C13.3538 2.06886 12.6849 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.3151 21.9311 10.6462 21.8 10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.0303 11.9625L16.5832 7.4096M19.7404 4.34462L19.1872 2.35748C19.0853 2.03011 18.6914 1.89965 18.4259 2.11662C16.9898 3.29018 15.4254 4.87091 16.703 7.36419C19.2771 8.56455 20.7466 6.94584 21.8733 5.5853C22.0975 5.3146 21.9623 4.90767 21.6247 4.81005L19.7404 4.34462Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var O8=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var N8=[["path",{d:"M3 15V14H21V15C21 17.8284 21 19.2426 20.1213 20.1213C19.2426 21 17.8284 21 15 21H9C6.17157 21 4.75736 21 3.87868 20.1213C3 19.2426 3 17.8284 3 15Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 14L3.00001 12.9999C3.00003 11.5278 3.00004 10.7918 3.31675 10.1584C3.63347 9.52493 4.22231 9.08329 5.39999 8.20002C6.19297 7.60528 6.58946 7.30791 7.05132 7.15395C7.51317 7 8.00879 7 9.00002 7H15C15.9912 7 16.4868 7 16.9487 7.15395C17.4105 7.3079 17.807 7.60527 18.6 8.2C19.7777 9.08328 20.3666 9.52492 20.6833 10.1584C21 10.7918 21 11.5279 21 13V14H3Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M16 12V16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M8 12V16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M8.49997 7.00006V6.50006C8.49997 5.0956 8.49997 4.39337 8.83703 3.88892C8.98295 3.67054 9.17045 3.48304 9.38883 3.33712C9.89328 3.00006 10.5955 3.00006 12 3.00006C13.4044 3.00006 14.1067 3.00006 14.6111 3.33712C14.8295 3.48304 15.017 3.67054 15.1629 3.88892C15.5 4.39337 15.5 5.0956 15.5 6.50006V7.00006",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]];var z8=[["path",{d:"M20.0004 10.9826C20.6281 10.1316 21 9.07385 21 7.92761C21 5.11556 18.7614 2.83594 16 2.83594C14.0209 2.83594 12.3104 4.00687 11.5 5.70554",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.6364 21.1658H9.36364C6.67794 21.1658 5.33509 21.1658 4.40253 20.4549C4.13533 20.2512 3.89812 20.0096 3.69811 19.7375C3 18.7879 3 17.4204 3 14.6855C3 13.1226 3 12.3412 3.39892 11.7986C3.51321 11.6431 3.64876 11.505 3.80144 11.3887C4.33434 10.9824 5.10168 10.9824 6.63636 10.9824H17.3636C18.8983 10.9824 19.6657 10.9824 20.1986 11.3887C20.3512 11.505 20.4868 11.6431 20.6011 11.7986C21 12.3412 21 13.1226 21 14.6855C21 17.4204 21 18.7879 20.3019 19.7375C20.1019 20.0096 19.8647 20.2512 19.5975 20.4549C18.6649 21.1658 17.3221 21.1658 14.6364 21.1658Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M10 15.0547H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M13.6858 10.9826L13.335 10.1564C13.2474 9.94999 13.2565 9.71349 13.3595 9.51989L14.9144 6.59747C15.1776 6.10273 14.7982 5.48558 14.2636 5.53902L11.1099 5.85432C10.9004 5.87526 10.692 5.78776 10.5492 5.6189L8.39732 3.07491C8.03241 2.64349 7.37203 2.82539 7.26584 3.38656L6.63969 6.69573C6.59813 6.91538 6.46021 7.09827 6.26863 7.18779L3.38401 8.53572C2.89509 8.76418 2.86669 9.49366 3.33529 9.78682L5.24666 10.9826",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]];var j8=[["path",{d:"M3 20.5002C3.28417 16.8058 6.3 13.7193 10.0008 13.5379C10.3134 13.5226 10.6446 13.5097 11 13.5L11.995 13.5663C12.6939 13.6129 13.3665 13.7543 14 13.9777",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 15.5V21.5M21 18.5L15 18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"11",cy:"6.5",r:"4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var Z8=[["path",{d:"M5.25 5L19.25 19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M22.25 12C22.25 6.47715 17.7728 2 12.25 2C6.72715 2 2.25 6.47715 2.25 12C2.25 17.5228 6.72715 22 12.25 22C17.7728 22 22.25 17.5228 22.25 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]];var W8=[["path",{d:"M15 5C15 6.65685 13.6569 8 12 8C10.3431 8 9 6.65685 9 5C9 3.34315 10.3431 2 12 2C13.6569 2 15 3.34315 15 5Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V9M12 9C12 9.93188 12 10.3978 12.1776 10.7654C12.4144 11.2554 12.8687 11.6448 13.4404 11.8478C13.8692 12 14.4128 12 15.5 12C16.5872 12 17.1308 12 17.5596 12.1522C18.1313 12.3552 18.5856 12.7446 18.8224 13.2346C19 13.6022 19 14.0681 19 15V16M12 9C12 9.93188 12 10.3978 11.8224 10.7654C11.5856 11.2554 11.1313 11.6448 10.5596 11.8478C10.1308 12 9.5872 12 8.5 12C7.4128 12 6.8692 12 6.44041 12.1522C5.86867 12.3552 5.41443 12.7446 5.17761 13.2346C5 13.6022 5 14.0681 5 15V16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M8 19C8 20.6569 6.65685 22 5 22C3.34315 22 2 20.6569 2 19C2 17.3431 3.34315 16 5 16C6.65685 16 8 17.3431 8 19Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M22 19C22 20.6569 20.6569 22 19 22C17.3431 22 16 20.6569 16 19C16 17.3431 17.3431 16 19 16C20.6569 16 22 17.3431 22 19Z",stroke:"currentColor",strokeWidth:"1.5",key:"3"}]];var V8=[["path",{d:"M8.62814 12.6736H8.16918C6.68545 12.6736 5.94358 12.6736 5.62736 12.1844C5.31114 11.6953 5.61244 11.0138 6.21504 9.65083L8.02668 5.55323C8.57457 4.314 8.84852 3.69438 9.37997 3.34719C9.91142 3 10.5859 3 11.935 3H14.0244C15.6632 3 16.4826 3 16.7916 3.53535C17.1007 4.0707 16.6942 4.78588 15.8811 6.21623L14.8092 8.10188C14.405 8.81295 14.2029 9.16849 14.2057 9.45952C14.2094 9.83775 14.4105 10.1862 14.7354 10.377C14.9854 10.5239 15.3927 10.5239 16.2074 10.5239C17.2373 10.5239 17.7523 10.5239 18.0205 10.7022C18.3689 10.9338 18.5513 11.3482 18.4874 11.7632C18.4382 12.0826 18.0918 12.4656 17.399 13.2317L11.8639 19.3523C10.7767 20.5545 10.2331 21.1556 9.86807 20.9654C9.50303 20.7751 9.67833 19.9822 10.0289 18.3962L10.7157 15.2896C10.9826 14.082 11.1161 13.4782 10.7951 13.0759C10.4741 12.6736 9.85877 12.6736 8.62814 12.6736Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];Km();var Z_=[["path",{d:"M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 11.4C2 10.2417 2.24173 10 3.4 10H10.6C11.7583 10 12 10.2417 12 11.4V12.6C12 13.7583 11.7583 14 10.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M2 19.4C2 18.2417 2.24173 18 3.4 18H10.6C11.7583 18 12 18.2417 12 19.4V20.6C12 21.7583 11.7583 22 10.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M18 13V21M22 17H14",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],W_=[["path",{d:"M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 11.4C2 10.2417 2.24173 10 3.4 10H10.6C11.7583 10 12 10.2417 12 11.4V12.6C12 13.7583 11.7583 14 10.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M2 19.4C2 18.2417 2.24173 18 3.4 18H10.6C11.7583 18 12 18.2417 12 19.4V20.6C12 21.7583 11.7583 22 10.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14 17H22M19 14L22 17L19 20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],KC={AlertCircle:t8,AlertTriangle:e8,Archive:n8,Bot:s8,Bug:c8,Check:O8,ChevronDown:r8,ChevronLeft:o8,ChevronRight:i8,Circle:p8,CircleCheck:d8,CircleQuestion:S8,CircleX:u8,ClosePluginPane:Mu,CloseThreadPane:Mu,Code:E8,ComputerTerminal01:Wm,Copy:f8,Download:g8,Edit:C8,FilterHorizontal:k8,Folder:w8,FolderExport:b8,FolderGit:v8,FolderPlus:y8,FolderSync:x8,FolderUnknown:I8,Folder02:Ru,Info:_8,ListTodo:l8,Loading:P8,MessageQuestion:L8,MessageCirclePlus:Zm,MessageSquarePlus:Zm,MessageSquare:a8,MoreHorizontal:M8,PanelLeft:A8,Search:R8,SectionAdd:Z_,SectionMove:W_,Settings:T8,SlidersHorizontal:$8,Spinner:m8,Target:D8,Terminal:Wm,Toolbox:N8,ToolCase:z8,Trash2:h8,Unavailable:Z8,UserRoundPlus:j8,Workflow:W8,X:Mu,Zap:V8},V_=Object.keys(KC),H_=[...V_,...B8],F_=KC,Ym=null;function B_(){return Tu()!==null?Promise.resolve():(Ym??=Promise.resolve().then(()=>(BC(),FC)).then(()=>{},e=>{throw Ym=null,e}),Ym)}var U_=[],K_=new Set(H_),UC=be([]);function Jm(e){return K_.has(e)}var Qm=class extends tl{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};function Ht({name:e,fallback:t="Zap",...n}){let r=ve(UC),o=sn(Bm,()=>ds(e),()=>ds(e)),i=sn(Bm,()=>ds(t),()=>ds(t)),s=sn(Um,()=>ps(e),()=>ps(e)),a=sn(Um,()=>ps(t),()=>ps(t)),c=o!==void 0||Jm(e)||s!==void 0,u=c?e:t,l=c?o:i,d=c?s:a,m=l?.component;return r.includes(u)?f(Xm,{name:Jm(u)?u:"Zap",...n}):m!==void 0&&l!==void 0?f(UC.Provider,{value:[...r,u],children:f(Qm,{fallback:f(Xm,{name:"Zap",...n}),children:f("span",{className:x("inline-flex size-6 shrink-0",n.className),style:n.style,"aria-hidden":n["aria-hidden"],"aria-label":n["aria-label"],role:n["aria-label"]?"img":void 0,"data-icon":u,"data-icon-root":"",children:f(m,{className:"size-full"})})},l.key)}):m===void 0&&d!==void 0?f(G_,{url:d,resolved:u,...n}):f(Xm,{name:Jm(u)?u:"Zap",...n})}function G_({url:e,resolved:t,className:n,style:r,"aria-hidden":o,"aria-label":i}){let s=`url("${e.replace(/["\\]/gu,"\\$&")}")`;return f("span",{className:x("inline-block size-6 shrink-0",n),style:{...r,backgroundColor:"currentColor",maskImage:s,maskPosition:"center",maskRepeat:"no-repeat",maskSize:"contain",WebkitMaskImage:s,WebkitMaskPosition:"center",WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain"},"aria-hidden":o,"aria-label":i,role:i?"img":void 0,"data-icon":t,"data-icon-root":"","data-plugin-icon-asset":e})}function Xm({name:e,className:t,style:n,"aria-hidden":r,"aria-label":o}){let i=F_[e];return i!==void 0?f(ls,{icon:i,className:x(t),style:n,"aria-hidden":r,"aria-label":o,"data-icon":e,"data-icon-root":""}):f(q_,{name:e,className:t,style:n,"aria-hidden":r,"aria-label":o})}function q_({name:e,className:t,style:n,"aria-hidden":r,"aria-label":o}){let s=sn(K8,Tu,Tu)?.[e];return s===void 0&&B_().catch(()=>{}),f(ls,{icon:s??U_,className:x(t),style:n,"aria-hidden":r,"aria-label":o,"data-icon":e,"data-icon-root":"","data-icon-pending":s===void 0?"":void 0})}var GC=be({isCompactViewport:!1,open:!1,onOpenChange:()=>{},titleId:"",descriptionId:"",registerTitleId:()=>()=>{},registerDescriptionId:()=>()=>{}});function fs(){return ve(GC)}function ms({children:e,open:t,onOpenChange:n,...r}){let o=zr(t,n),i=In(),s=In(),[a,c]=A(i),[u,l]=A(s),d=N(g=>(c(g),()=>c(i)),[i]),m=N(g=>(l(g),()=>l(s)),[s]),p=K(()=>({...o,titleId:a,descriptionId:u,registerTitleId:d,registerDescriptionId:m}),[u,m,d,o,a]),h=p.isCompactViewport?e:f(J4,{open:p.open,onOpenChange:p.onOpenChange,...r,children:e});return f(GC.Provider,{value:p,children:h})}var Y_=F(({asChild:e,children:t,className:n,...r},o)=>{let{isCompactViewport:i,open:s,onOpenChange:a}=fs();return i?f(rr,{ref:o,asChild:e,open:s,onOpenChange:a,haspopup:"dialog",className:n,...r,children:t}):f(Q4,{ref:o,asChild:e,className:Pn(n),onMouseDown:c=>{s||Ln(),cn(c)},...r,children:t})});Y_.displayName="DialogTrigger";var J_=F(({asChild:e,onClick:t,children:n,...r},o)=>{let{isCompactViewport:i,onOpenChange:s}=fs();return i?f(e?_n:"button",{ref:o,onClick:u=>{t?.(u),u.defaultPrevented||s(!1)},...r,children:n}):f(Nm,{ref:o,asChild:e,onClick:t,...r,children:n})});J_.displayName="DialogClose";var qC=F(({className:e,...t},n)=>f(jm,{ref:n,...$e(),className:x("fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qC.displayName=jm.displayName;var Lo=F(({className:e,children:t,hideCloseButton:n=!1,onAfterCloseAutoFocus:r,onCloseAutoFocus:o,...i},s)=>{let{isCompactViewport:a,open:c,onOpenChange:u,titleId:l,descriptionId:d}=fs();let m=$e();if(a){let p=jr(i);return f(Zr,{open:c,onOpenChange:u,onAfterCloseAutoFocus:r,labelledBy:l,describedBy:d,children:f("div",{ref:s,className:x("grid grid-cols-[minmax(0,1fr)] gap-4 overflow-y-auto px-4 pt-2 pb-[max(1rem,env(safe-area-inset-bottom))]",e,"max-w-none"),...p,children:t})})}return v(Y4,{children:[f(qC,{}),v(q4,{ref:s,...m,onCloseAutoFocus:p=>{o?.(p),queueMicrotask(()=>r?.())},className:x("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg grid-cols-[minmax(0,1fr)] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-sm duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",e),...i,children:[t,n?null:v(Nm,{className:"absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-state-active data-[state=open]:text-foreground",children:[f(Ht,{name:"X",className:"h-4 w-4"}),f("span",{className:"sr-only",children:"Close"})]})]})]})});Lo.displayName="DialogContent";var Mo=({className:e,...t})=>f("div",{className:x("flex flex-col space-y-1.5 text-left",e),...t});Mo.displayName="DialogHeader";var $u=({className:e,...t})=>f("div",{className:x("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$u.displayName="DialogFooter";var Ro=F(({asChild:e,className:t,id:n,children:r,...o},i)=>{let{isCompactViewport:s,titleId:a,registerTitleId:c}=fs(),u=n??a;if(at(()=>{if(s)return c(u)},[s,c,u]),s){let l={id:u,className:x("text-base font-semibold leading-none tracking-tight",t),...o};return e?f(_n,{ref:i,...l,children:r}):f("h2",{ref:i,...l,children:r})}return f(X4,{ref:i,asChild:e,...n===void 0?{}:{id:n},className:x("text-base font-semibold leading-none tracking-tight",t),...o,children:r})});Ro.displayName="DialogTitle";var Eu=F(({asChild:e,className:t,id:n,children:r,...o},i)=>{let{isCompactViewport:s,descriptionId:a,registerDescriptionId:c}=fs(),u=n??a;if(at(()=>{if(s)return c(u)},[s,c,u]),s){let l={id:u,className:x("text-sm text-muted-foreground",t),...o};return e?f(_n,{ref:i,...l,children:r}):f("p",{ref:i,...l,children:r})}return f(zm,{ref:i,asChild:e,...n===void 0?{}:{id:n},className:x("text-sm text-muted-foreground",t),...o,children:r})});Eu.displayName=zm.displayName;var YC="text-sm max-md:pointer-coarse:text-base";var Hn="h-3.5 w-3.5 max-md:pointer-coarse:h-5 max-md:pointer-coarse:w-5",JC="h-[28px] w-[28px] rounded-md p-0 max-md:pointer-coarse:h-[36px] max-md:pointer-coarse:w-[36px]",Zj=`${JC} [&_[data-icon-root]]:size-[16px] max-md:pointer-coarse:[&_[data-icon-root]]:size-[20px]`,Wj=`${JC} [&_[data-icon-root]]:size-[13px] max-md:pointer-coarse:[&_[data-icon-root]]:size-[16px]`;var XC="h-9 max-md:pointer-coarse:h-10";var Du=F(({className:e,type:t,...n},r)=>f("input",{type:t,autoComplete:"off",className:x(`flex w-full rounded-md border border-input bg-transparent pl-3 pr-3 py-1 ${Ys} file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,XC,YC,e),ref:r,...n}));Du.displayName="Input";function QC({open:e,items:t,onOpenChange:n,onToggleHidden:r,onMove:o}){return f(ms,{open:e,onOpenChange:n,children:v(Lo,{className:"max-w-sm",children:[v(Mo,{children:[f(Ro,{children:"Customize list"}),f(Eu,{children:"Hidden groups move into More. Their counters still show there."})]}),f("ul",{className:"flex flex-col gap-0.5","aria-label":"Groups",children:t.map((i,s)=>v("li",{"data-sidebar-customize-item":i.id,className:"flex items-center gap-1 rounded-md py-0.5 pl-2 pr-1 text-sm hover:bg-accent",children:[f("span",{className:x("min-w-0 flex-1 truncate",i.hidden&&"text-muted-foreground"),children:i.label}),f(Ye,{variant:"ghost",size:"icon",className:"size-7","aria-label":`Move ${i.label} up`,disabled:s===0,onClick:()=>o(i.id,-1),children:f(H,{name:z.moveUp,"aria-hidden":!0})}),f(Ye,{variant:"ghost",size:"icon",className:"size-7","aria-label":`Move ${i.label} down`,disabled:s===t.length-1,onClick:()=>o(i.id,1),children:f(H,{name:z.collapse,"aria-hidden":!0})}),f(Ye,{variant:"ghost",size:"icon",className:"size-7","aria-pressed":!i.hidden,"aria-label":i.hidden?`Show ${i.label}`:`Hide ${i.label}`,disabled:!i.hideable,onClick:()=>r(i.id),children:f(H,{name:i.hidden?z.hidden:z.show,"aria-hidden":!0})})]},i.id))}),f($u,{children:f(Ye,{onClick:()=>n(!1),children:"Done"})})]})})}function ek({open:e,onOpenChange:t,onCreate:n}){let[r,o]=A(""),[i,s]=A(!1);return D(()=>{e&&o("")},[e]),f(ms,{open:e,onOpenChange:t,children:f(Lo,{className:"max-w-sm",children:v("form",{className:"flex flex-col gap-4",onSubmit:async a=>{a.preventDefault();let c=r.trim();if(c!==""){s(!0);try{await n(c),t(!1)}finally{s(!1)}}},children:[f(Mo,{children:f(Ro,{children:"New section"})}),f(Du,{autoFocus:!0,"aria-label":"Section name",value:r,onChange:a=>o(a.target.value)}),v($u,{children:[f(Ye,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),f(Ye,{type:"submit",disabled:i||r.trim()==="",children:"Create"})]})]})})})}function tk({open:e,title:t,description:n,confirmLabel:r,destructive:o,onOpenChange:i,onConfirm:s}){return f(K4,{open:e,onOpenChange:i,children:v(Mm,{children:[v(Rm,{children:[f(Am,{children:t}),f($m,{children:n})]}),v(Tm,{children:[f(Dm,{children:"Cancel"}),f(Em,{className:x(o&&"bg-destructive text-destructive-foreground hover:bg-destructive/90"),onClick:s,children:r})]})]})})}function nk({open:e,title:t,onOpenChange:n,children:r}){return f(ms,{open:e,onOpenChange:n,children:v(Lo,{className:"max-w-sm",children:[f(Mo,{children:f(Ro,{className:"sr-only",children:t})}),r]})})}function rk({open:e,title:t,targets:n,query:r,onQueryChange:o,onOpenChange:i,onMove:s}){let[a,c]=A(0);D(()=>c(0),[r,e]);let u=l=>{l!==void 0&&(s(l.parentThreadId),i(!1))};return f(ms,{open:e,onOpenChange:i,children:v(Lo,{className:"max-w-sm",children:[v(Mo,{children:[v(Ro,{children:["Move \u201C",t,"\u201D"]}),f(Eu,{children:"Nest it under another thread, or move it to the top level."})]}),f(Du,{autoFocus:!0,role:"combobox","aria-expanded":!0,"aria-controls":"thread-glance-move-targets","aria-activedescendant":n[a]?`thread-glance-move-${a}`:void 0,"aria-label":"Find a thread",placeholder:"Find a thread",value:r,onChange:l=>o(l.target.value),onKeyDown:l=>{l.key==="ArrowDown"?(l.preventDefault(),c(d=>Math.min(d+1,n.length-1))):l.key==="ArrowUp"?(l.preventDefault(),c(d=>Math.max(d-1,0))):l.key==="Enter"&&(l.preventDefault(),u(n[a]))}}),v("ul",{id:"thread-glance-move-targets",role:"listbox","aria-label":"Move to",className:"flex max-h-72 flex-col gap-0.5 overflow-y-auto",children:[n.length===0?f("li",{className:"px-2 py-1.5 text-sm text-muted-foreground",children:"No matching threads"}):null,n.map((l,d)=>v("li",{id:`thread-glance-move-${d}`,role:"option","aria-selected":d===a,onMouseEnter:()=>c(d),onClick:()=>u(l),className:x("flex cursor-pointer flex-col rounded-md px-2 py-1.5 text-sm",d===a&&"bg-accent"),children:[f("span",{className:"truncate",children:l.label}),l.detail?f("span",{className:"truncate text-xs text-muted-foreground",children:l.detail}):null]},l.parentThreadId??"top"))]})]})})}function ok(){let e=xn(),[t,n]=A({}),r=wn(),o=$(!1),i=N(()=>{e.call("listNotes",null).then(s=>n(s.notes),()=>{})},[e]);return D(i,[i]),D(()=>{r==="connected"&&(o.current&&i(),o.current=!0)},[r,i]),vn(Wn.notes,s=>{let a=s;if(a===null||typeof a!="object"||typeof a.threadId!="string")return;let c=a.notes===null?null:Jg.safeParse(a.notes);c!==null&&!c.success||n(u=>{let l={...u};return c===null?delete l[a.threadId]:l[a.threadId]=c.data,l})}),t}function ik(e){let t=Rr(),[n,r]=A(()=>new Map),o=$(new Set);return D(()=>{for(let i of e){if(o.current.has(i))continue;o.current.add(i);let s=a=>r(c=>new Map(c).set(i,a));t.projects.get({projectId:i}).then(async a=>{let c=A4(a.sources);return c===null?null:(await t.projects.branches({projectId:i,hostId:c,limit:"1"})).defaultBranch??null}).then(s,()=>s(null))}},[e,t]),n}var X_={defaultProviderId:null,primaryHostId:null};function Q_(e){return{defaultProviderId:e.generalSettings.defaultProviderId??e.serverAccess.defaultProviderId??null,primaryHostId:e.primaryHostId}}function sk(){let e=Rr(),[t,n]=A(X_);return D(()=>{let r=!1;return Promise.resolve().then(()=>e.system.config()).then(o=>{r||n(Q_(o))},()=>{}),()=>{r=!0}},[e]),t}function ak(e,t,n="",r=50){let o=t.infos.get(e);if(o===void 0)return[];let i=u=>t.infos.get(u)?.thread.parentThreadId??null,s=n.trim().toLowerCase(),a=[];o.thread.parentThreadId!==null&&(s===""||"top level".includes(s))&&a.push({parentThreadId:null,label:"Top level",detail:"No parent thread"});let c=[...t.infos.values()].filter(u=>{let l=u.thread;return l.isHidden||l.isArchived||l.id===o.thread.parentThreadId||lm(l.id,e,i)?!1:s===""||l.displayTitle.toLowerCase().includes(s)}).sort((u,l)=>l.thread.latestAttentionAt-u.thread.latestAttentionAt);for(let u of c.slice(0,r)){let l=u.parentId===null?null:t.infos.get(u.parentId);a.push({parentThreadId:u.thread.id,label:u.thread.displayTitle,detail:l?`in ${l.thread.displayTitle}`:null})}return a}var eP=[["waits-on-you","needing you"],["failed","failed"],["queue-failed","queue failed"],["offline","offline"],["working","working"],["background","in background"],["scheduled","scheduled"],["queued","queued"],["unread","unread"],["draft","drafts"],["idle","idle"]];function ck(e){let t=new Map;for(let r of e)r.thread.isHidden||t.set(r.state.kind,(t.get(r.state.kind)??0)+1);let n=eP.filter(([r])=>t.has(r)).map(([r,o])=>`${t.get(r)} ${o}`);return n.length>0?n.join(", "):null}function uk(e,t){if(e===void 0)return[];if(e.root.thread.id===t)return e.descendants;let n=[],r=new Set([t]);for(let o of e.descendants)o.parentId!==null&&r.has(o.parentId)&&(r.add(o.thread.id),n.push(o));return n}function To(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function lk(e,t){if(t===null)return null;let n=t==="now"?"just now":`${t} ago`;switch(e){case"working":case"background":return`started ${n}`;case"waits-on-you":return`waiting since ${n}`;case"failed":return`failed ${n}`;default:return`finished ${n}`}}function dk(e,t){return t.find(n=>n.model===e||n.id===e)?.displayName??e}var Ou={attention:"text-attention",destructive:"text-destructive",working:"text-[var(--timeline-accent)]",background:"text-muted-foreground/50","muted-strong":"text-muted-foreground/75",muted:"text-muted-foreground",none:""},pk="animate-shine-icon motion-reduce:animate-none",tP="animate-spin motion-reduce:animate-none";function fk({label:e,className:t}){return f("span",{role:e?"img":void 0,"aria-label":e,"aria-hidden":e?void 0:!0,className:x("inline-block size-[6px] shrink-0 rounded-full bg-[var(--timeline-accent)]",t)})}function nP({className:e}){return f("span",{"aria-hidden":!0,className:x("inline-block size-2.5 shrink-0 rounded-full border-[1.5px] border-current opacity-50",e)})}function hs({glyph:e,label:t,className:n}){return e.icon==="ring"?f(nP,{className:Ou[e.tone]}):e.icon==="dot"?f(fk,{label:t}):f(H,{name:e.icon,"aria-label":t,"aria-hidden":t?void 0:!0,className:x("size-4 shrink-0",Ou[e.tone],e.spin&&tP,e.shine&&pk,n)})}function mk({status:e}){let t=e.tone==="error"?"text-destructive":e.tone==="success"?"text-success-foreground":e.tone==="running"?"text-success motion-safe:animate-pulse":"text-muted-foreground";return f(H,{name:e.icon,"aria-label":e.label,className:x("size-4 shrink-0",t,e.tone==="running"&&pk)})}var rP={attention:"text-attention",destructive:"text-destructive",muted:"text-muted-foreground"};function Nu({note:e}){return v(_t,{children:[f("span",{className:rP[e.tone],children:e.text===""?e.prefix:`${e.prefix}:`}),e.text===""?null:` ${e.text}`]})}function zu({flag:e,className:t}){return f(hs,{glyph:la[e],className:t})}function hk({flag:e}){return la[e].icon==="dot"?f(fk,{className:"size-[5px]"}):f(zu,{flag:e,className:"size-3"})}var oP=[{key:"waitsOnYou",flag:"waits-on-you",label:e=>`${e} waiting on you`},{key:"failed",flag:"unread-failed",label:e=>`${e} failed`},{key:"offline",flag:"offline",label:e=>`${e} waiting for an offline machine`},{key:"working",flag:"working",label:e=>`${e} working`},{key:"unread",flag:"unread",label:e=>`${e} unread`}];function ju({counters:e,className:t}){let n=oP.filter(r=>e[r.key]>0);return n.length===0?null:f("span",{role:"group","aria-label":n.map(r=>r.label(e[r.key])).join(", "),className:x("inline-flex shrink-0 items-center gap-1.5 text-xs tabular-nums",t),children:n.map(r=>v("span",{"aria-hidden":!0,className:"inline-flex items-center gap-0.5 text-muted-foreground",children:[f(zu,{flag:r.flag,className:"size-3.5"}),e[r.key]]},r.key))})}var iP=500,sP=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),gs=!1,Zu=0,gk=0;function Ck(e){gs=sP.has(e.key)}function kk(){gs=!1,Zu+=1}function yk(){Zu+=1}function bk(e,t){let[n,r]=A(!1),o=$(null),i=$(null),s=$(!1),a=()=>{o.current!==null&&clearTimeout(o.current),o.current=null},c=()=>{if(o.current!==null||!t||s.current)return;let u=Zu;o.current=setTimeout(()=>{o.current=null,Zu===u&&r(!0)},iP)};return D(()=>(gk++===0&&(gs=!1,document.addEventListener("keydown",Ck,!0),document.addEventListener("pointerdown",kk,!0)),()=>{a(),--gk===0&&(document.removeEventListener("keydown",Ck,!0),document.removeEventListener("pointerdown",kk,!0))}),[]),D(()=>{a(),r(!1)},[e,t]),{open:n&&t&&!e,onOpenChange:u=>{u||(a(),r(!1))},rowProps:{onPointerEnter:u=>{i.current={x:u.clientX,y:u.clientY}},onPointerMove:u=>{if(u.pointerType==="touch")return;let l=i.current;l!==null&&l.x===u.clientX&&l.y===u.clientY||(i.current=null,c())},onPointerLeave:()=>{a(),i.current=null,s.current=!1},onPointerDown:()=>{s.current=!0,a(),r(!1)},onFocus:()=>{gs&&(gs=!1,c())},onBlur:a}}}function aP(e){return e.type==="pointerdown"?"pointer":e.type!=="keydown"||e.metaKey||e.ctrlKey||e.altKey||e.key==="Shift"||e.key==="Meta"||e.key==="Control"||e.key==="Alt"?null:"keyboard"}var vk="group-hover/row:opacity-0 in-data-[input-modality=keyboard]:group-focus-within/row:opacity-0",wk="opacity-0 group-hover/row:opacity-100 in-data-[input-modality=keyboard]:group-focus-within/row:opacity-100",xk="hidden group-hover/row:flex in-data-[input-modality=keyboard]:group-focus-within/row:flex",Ik="group-hover/header:opacity-0 in-data-[input-modality=keyboard]:group-focus-within/header:opacity-0",Sk="pointer-events-none opacity-0 group-hover/header:pointer-events-auto group-hover/header:opacity-100 in-data-[input-modality=keyboard]:group-focus-within/header:pointer-events-auto in-data-[input-modality=keyboard]:group-focus-within/header:opacity-100";function _k(e){D(()=>{let t=n=>{let r=aP(n);r!==null&&e.current?.setAttribute("data-input-modality",r)};return document.addEventListener("keydown",t,!0),document.addEventListener("pointerdown",t,!0),()=>{document.removeEventListener("keydown",t,!0),document.removeEventListener("pointerdown",t,!0)}},[e])}var eh=globalThis.__bbPluginRuntime;if(eh==null||eh.radixDropdownMenu==null)throw new Error('Cannot load "@radix-ui/react-dropdown-menu": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Wu=eh.radixDropdownMenu,PZ="default"in Wu?Wu.default:Wu,{Arrow:LZ,CheckboxItem:Pk,Content:Lk,DropdownMenu:MZ,DropdownMenuArrow:RZ,DropdownMenuCheckboxItem:TZ,DropdownMenuContent:AZ,DropdownMenuGroup:$Z,DropdownMenuItem:EZ,DropdownMenuItemIndicator:DZ,DropdownMenuLabel:OZ,DropdownMenuPortal:NZ,DropdownMenuRadioGroup:zZ,DropdownMenuRadioItem:jZ,DropdownMenuSeparator:ZZ,DropdownMenuSub:WZ,DropdownMenuSubContent:VZ,DropdownMenuSubTrigger:HZ,DropdownMenuTrigger:FZ,Group:Mk,Item:Rk,ItemIndicator:th,Label:Tk,Portal:Ak,RadioGroup:cP,RadioItem:nh,Root:$k,Separator:Ek,Sub:Dk,SubContent:rh,SubTrigger:oh,Trigger:Ok,createDropdownMenuScope:BZ}=Wu;var lP=new Set(["ArrowDown","ArrowUp","Home","End","PageDown","PageUp"]),mn="data-[last-hovered]:bg-state-hover data-[last-hovered]:text-foreground",Nk=be({lastHoveredId:null,setLastHovered:()=>{},clearLastHovered:()=>{}});function Vu({children:e}){let[t,n]=A(null),r=K(()=>({lastHoveredId:t,setLastHovered:n,clearLastHovered:()=>n(null)}),[t]);return f(Nk.Provider,{value:r,children:e})}function nn(e){let t=In(),{lastHoveredId:n,setLastHovered:r,clearLastHovered:o}=ve(Nk),i=n===t,s=$(e);s.current=e;let a=N(u=>{s.current?.onPointerEnter?.(u),r(t)},[t,r]),c=N(u=>{s.current?.onKeyDown?.(u),lP.has(u.key)&&o()},[o]);return{isLastHovered:i,hoverProps:{"data-last-hovered":i?"":void 0,onPointerEnter:a,onKeyDown:c}}}var dP="focus:bg-state-hover focus:text-foreground data-[last-hovered]:bg-state-hover data-[last-hovered]:text-foreground",pP="text-destructive focus:bg-destructive/15 focus:text-destructive data-[last-hovered]:bg-destructive/15",fP="text-destructive focus:bg-destructive/15 focus:text-destructive active:bg-destructive/20 active:text-destructive",ih=be({isCompactViewport:!1,open:!1,onOpenChange:()=>{}});function Fn(){return ve(ih)}function Ao({children:e,open:t,onOpenChange:n,defaultOpen:r,...o}){let i=zr(t,n,r);return i.isCompactViewport?f(ih.Provider,{value:i,children:e}):f($k,{open:i.open,onOpenChange:i.onOpenChange,...o,children:f(ih.Provider,{value:i,children:e})})}var Ir=F(({asChild:e,children:t,className:n,...r},o)=>{let{isCompactViewport:i,open:s,onOpenChange:a}=Fn();return i?f(rr,{ref:o,asChild:e,open:s,onOpenChange:a,haspopup:"menu",className:n,...r,children:t}):f(Ok,{ref:o,asChild:e,className:Pn(n),onMouseDown:c=>{s||Ln(),cn(c)},...r,children:t})});Ir.displayName="DropdownMenuTrigger";var Sr=F(({className:e,sideOffset:t=4,children:n,mobileTitle:r,onCloseAutoFocus:o,...i},s)=>{let{isCompactViewport:a,open:c,onOpenChange:u}=Fn(),l=$e();if(a){let{style:d,...m}=jr(i);return f(Zr,{open:c,onOpenChange:u,srLabel:r??"Menu",children:f("div",{ref:s,className:x("flex flex-col gap-0.5 overflow-y-auto p-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]",e),...m,style:{...d,...ia},children:n})})}return f(Ak,{children:f(Lk,{ref:s,...l,sideOffset:t,onCloseAutoFocus:d=>{E5()||d.preventDefault(),o?.(d)},className:x("z-50 min-w-28 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i,children:f(Vu,{children:n})})})});Sr.displayName="DropdownMenuContent";function zk(){return new Event("select",{cancelable:!0})}var De=F(({className:e,inset:t,variant:n="default",onSelect:r,disabled:o,role:i="menuitem","aria-checked":s,textValue:a,children:c,onPointerEnter:u,onKeyDown:l,onFocus:d,onBlur:m,...p},h)=>{let{isCompactViewport:g,onOpenChange:C}=Fn(),{hoverProps:w}=nn({onPointerEnter:u,onKeyDown:l});return g?f("button",{ref:h,type:"button",role:i,disabled:o,"aria-disabled":o||void 0,"aria-checked":s,className:x("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-2 text-left text-xs outline-none transition-colors focus:bg-state-hover focus:text-foreground active:bg-state-active active:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>[data-icon-root]]:size-4 [&>[data-icon-root]]:shrink-0",t&&"pl-8",n==="destructive"&&fP,e),"data-disabled":o?"":void 0,onFocus:d,onBlur:m,onClick:()=>{if(o)return;let y=zk();r?.(y),y.defaultPrevented||C(!1)},children:c}):f(Rk,{ref:h,className:x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-[0.3125rem] text-xs outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>[data-icon-root]]:size-4 [&>[data-icon-root]]:shrink-0",Yt,n==="destructive"?pP:dP,t&&"pl-8",e),disabled:o,role:i,"aria-checked":s,onSelect:r,textValue:a,onFocus:d,onBlur:m,...p,...w,children:c})});De.displayName="DropdownMenuItem";var mP=F(({className:e,children:t,checked:n,onSelect:r,onCheckedChange:o,disabled:i,textValue:s,onPointerEnter:a,onKeyDown:c,...u},l)=>{let{isCompactViewport:d,onOpenChange:m}=Fn(),{hoverProps:p}=nn({onPointerEnter:a,onKeyDown:c});return d?v("button",{ref:l,type:"button",role:"menuitemcheckbox","aria-checked":n==="indeterminate"?"mixed":n===!0,disabled:i,"aria-disabled":i||void 0,className:x("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-left text-xs outline-none transition-colors focus:bg-state-hover focus:text-foreground active:bg-state-active active:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),"data-disabled":i?"":void 0,onClick:()=>{if(i)return;let h=zk();r?.(h),o?.(n==="indeterminate"?!0:!n),h.defaultPrevented||m(!1)},children:[f("span",{className:x("absolute right-2 flex items-center justify-center",Hn),children:(n===!0||n==="indeterminate")&&f(Ht,{name:"Check",className:Hn})}),t]}):v(Pk,{ref:l,className:x("relative flex cursor-default select-none items-center rounded-sm py-[0.3125rem] pl-2 pr-8 text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Yt,mn,e),checked:n,onSelect:r,onCheckedChange:o,disabled:i,textValue:s,...u,...p,children:[f("span",{className:x("absolute right-2 flex items-center justify-center",Hn),children:f(th,{children:f(Ht,{name:"Check",className:Hn})})}),t]})});mP.displayName="DropdownMenuCheckboxItem";var hP=F(({className:e,children:t,onPointerEnter:n,onKeyDown:r,...o},i)=>{let{isCompactViewport:s}=Fn(),{hoverProps:a}=nn({onPointerEnter:n,onKeyDown:r});return s?null:v(nh,{ref:i,className:x("relative flex cursor-default select-none items-center rounded-sm py-[0.3125rem] pl-8 pr-2 text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Yt,mn,e),...o,...a,children:[f("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f(th,{children:f(Ht,{name:"Circle",className:"h-2 w-2 fill-current"})})}),t]})});hP.displayName=nh.displayName;var gP=F(({className:e,inset:t,children:n,...r},o)=>{let{isCompactViewport:i}=Fn();return i?f("div",{ref:o,className:x("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),children:n}):f(Tk,{ref:o,className:x("px-2 py-[0.3125rem] text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r,children:n})});gP.displayName="DropdownMenuLabel";var Cs=F(({className:e,...t},n)=>{let{isCompactViewport:r}=Fn();return r?f("hr",{ref:n,className:x("-mx-1 my-1 h-px border-0 bg-muted",e)}):f(Ek,{ref:n,className:x("-mx-1 my-1 h-px bg-muted",e),...t})});Cs.displayName="DropdownMenuSeparator";var CP=F(({children:e,...t},n)=>{let{isCompactViewport:r}=Fn();return r?f("div",{ref:n,role:"group",...t,children:e}):f(Mk,{ref:n,...t,children:e})});CP.displayName="DropdownMenuGroup";var jk=Dk,sh=F(({className:e,inset:t,children:n,onPointerEnter:r,onKeyDown:o,...i},s)=>{let{hoverProps:a}=nn({onPointerEnter:r,onKeyDown:o});return v(oh,{ref:s,className:x("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-[0.3125rem] text-xs outline-none focus:bg-state-hover focus:text-foreground data-[state=open]:bg-state-active data-[state=open]:text-foreground [&_[data-icon-root]]:pointer-events-none [&_[data-icon-root]]:size-4 [&_[data-icon-root]]:shrink-0",Yt,mn,t&&"pl-8",e),...i,...a,children:[n,f(Ht,{name:"ChevronRight",className:"ml-auto"})]})});sh.displayName=oh.displayName;var ah=F(({className:e,...t},n)=>f(rh,{ref:n,...$e(),className:x("z-50 min-w-28 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));ah.displayName=rh.displayName;var kP=({className:e,...t})=>f("span",{className:x("ml-auto text-xs tracking-widest opacity-60",e),...t});kP.displayName="DropdownMenuShortcut";function Zk(e){return e.map(t=>`${t.threadId}:${t.projectId}`).join(" ")}var yP=25;function Wk(e,t=yP){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function bP(e,t){let n=e.info.state,r=t??n.label;return n.kind==="scheduled"&&n.sendAt!==null?`${r}, sends ${To(n.sendAt)}`:r}function Vk(e,t){let n=[bP(e,t.pluginLabel),t.providerName];return e.parentTitle!==null&&e.depth>0&&n.push(`child of ${e.parentTitle}`),e.crossGroupLabel!==null&&n.push(e.crossGroupLabel.toLowerCase()),e.hiddenBadge&&n.push("hidden thread"),e.info.unread&&e.info.state.kind!=="unread"&&n.push("unread"),t.hasDraft&&e.info.state.kind!=="draft"&&n.push("unsubmitted draft"),`Open ${e.info.thread.displayTitle} \u2014 ${n.join("; ")}`}var vP={"waits-on-you":"waiting on you below","unread-failed":"failed below","queue-failed":"queued message failed below",offline:"machine offline below",working:"working below",unread:"unread below"};function ch(e,t){let n=t.count===0?"hidden child threads":`${t.count} ${t.count===1?"child thread":"child threads"}`,r=t.flag===null?"":`, ${vP[t.flag]}`;return`${t.expanded?"Collapse":"Show"} ${n} of ${e}${r}`}function Hk(e){let t=e.count===1?"child thread":"child threads";return e.expanded?{label:"Show fewer",ariaLabel:`Hide ${e.count} more ${t}`}:{label:`${e.count} more ${t}`,ariaLabel:`Show ${e.count} more ${t}`}}function Fk(e){let t=e.count===1?"settled thread tree":"settled thread trees";return{label:e.expanded?"Settled":`Settled (${e.count})`,ariaLabel:`${e.expanded?"Hide":"Show"} ${e.count} ${t}`}}function Bk(e){switch(e){case"project":return"Projects";case"chronological":return"Sections";case"machine":return"Machines"}}function $o(e){return 8+e*12}var wP=600;function xP(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="INPUT":!1}function Eo({initial:e,label:t,onSave:n,onDone:r,className:o}){let[i,s]=A(e),[a,c]=A(!1),u=$(null),l=$(!1),d=$(!1),m=$(!1);D(()=>{let h=g=>{g.target!==u.current&&(m.current=!0)};return window.addEventListener("pointerdown",h,!0),()=>window.removeEventListener("pointerdown",h,!0)},[]),D(()=>{u.current?.focus(),u.current?.select();let h=setTimeout(()=>{d.current=!0},wP);return()=>clearTimeout(h)},[]);let p=async h=>{if(l.current)return;l.current=!0;let g=i.trim();if(!h||g===""||g===e){r();return}c(!0);try{await n(g)}catch(C){gt.error("Couldn't rename",{description:C instanceof Error?C.message:String(C)})}finally{r()}};return v(_t,{children:[f("input",{ref:u,"aria-label":t,value:i,disabled:a,onChange:h=>s(h.target.value),onKeyDown:h=>{h.stopPropagation(),!h.nativeEvent.isComposing&&(h.key==="Enter"?(h.preventDefault(),p(!0)):h.key==="Escape"&&(h.preventDefault(),p(!1)))},onBlur:h=>{if(!d.current&&!m.current&&xP(h.relatedTarget)){setTimeout(()=>{u.current?.focus(),u.current?.select()},0);return}p(!0)},onClick:h=>h.stopPropagation(),onPointerDown:h=>h.stopPropagation(),className:x("pointer-events-auto relative z-10 h-6 min-w-0 flex-1 rounded-sm border border-input bg-background px-1.5 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",o)}),a?f("span",{role:"status",className:"sr-only",children:"Saving name"}):null]})}var uh=globalThis.__bbPluginRuntime;if(uh==null||uh.radixContextMenu==null)throw new Error('Cannot load "@radix-ui/react-context-menu": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Hu=uh.radixContextMenu,fW="default"in Hu?Hu.default:Hu,{Arrow:mW,CheckboxItem:lh,Content:dh,ContextMenu:hW,ContextMenuArrow:gW,ContextMenuCheckboxItem:CW,ContextMenuContent:kW,ContextMenuGroup:yW,ContextMenuItem:bW,ContextMenuItemIndicator:vW,ContextMenuLabel:wW,ContextMenuPortal:xW,ContextMenuRadioGroup:IW,ContextMenuRadioItem:SW,ContextMenuSeparator:_W,ContextMenuSub:PW,ContextMenuSubContent:LW,ContextMenuSubTrigger:MW,ContextMenuTrigger:RW,Group:IP,Item:ph,ItemIndicator:fh,Label:mh,Portal:Uk,RadioGroup:SP,RadioItem:hh,Root:Kk,Separator:gh,Sub:Gk,SubContent:Ch,SubTrigger:kh,Trigger:qk,createContextMenuScope:TW}=Hu;var Yk="z-[70]",Jk=Kk,Xk=qk;var Qk=Gk;var yh=F(({className:e,inset:t,children:n,onPointerEnter:r,onKeyDown:o,...i},s)=>{let{hoverProps:a}=nn({onPointerEnter:r,onKeyDown:o});return v(kh,{ref:s,className:x("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-[0.3125rem] text-xs outline-none focus:bg-state-hover focus:text-foreground data-[state=open]:bg-state-active data-[state=open]:text-foreground [&_[data-icon-root]]:pointer-events-none [&_[data-icon-root]]:size-4 [&_[data-icon-root]]:shrink-0",Yt,mn,t&&"pl-8",e),...i,...a,children:[n,f(Ht,{name:"ChevronRight",className:"ml-auto"})]})});yh.displayName=kh.displayName;var bh=F(({className:e,...t},n)=>f(Ch,{ref:n,...$e(),className:x(Yk,"min-w-28 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));bh.displayName=Ch.displayName;var vh=F(({className:e,children:t,...n},r)=>f(Uk,{children:f(dh,{ref:r,...$e(),className:x(Yk,"min-w-28 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n,children:f(Vu,{children:t})})}));vh.displayName=dh.displayName;var Fu=F(({className:e,inset:t,onPointerEnter:n,onKeyDown:r,...o},i)=>{let{hoverProps:s}=nn({onPointerEnter:n,onKeyDown:r});return f(ph,{ref:i,className:x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-[0.3125rem] text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>[data-icon-root]]:size-4 [&>[data-icon-root]]:shrink-0",Yt,mn,t&&"pl-8",e),...o,...s})});Fu.displayName=ph.displayName;var PP=F(({className:e,children:t,checked:n,onPointerEnter:r,onKeyDown:o,...i},s)=>{let{hoverProps:a}=nn({onPointerEnter:r,onKeyDown:o});return v(lh,{ref:s,className:x("relative flex cursor-default select-none items-center rounded-sm py-[0.3125rem] pl-2 pr-8 text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Yt,mn,e),checked:n,...i,...a,children:[f("span",{className:x("absolute right-2 flex items-center justify-center",Hn),children:f(fh,{children:f(Ht,{name:"Check",className:Hn})})}),t]})});PP.displayName=lh.displayName;var LP=F(({className:e,children:t,onPointerEnter:n,onKeyDown:r,...o},i)=>{let{hoverProps:s}=nn({onPointerEnter:n,onKeyDown:r});return v(hh,{ref:i,className:x("relative flex cursor-default select-none items-center rounded-sm py-[0.3125rem] pl-8 pr-2 text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Yt,mn,e),...o,...s,children:[f("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f(fh,{children:f(Ht,{name:"Circle",className:"h-2 w-2 fill-current"})})}),t]})});LP.displayName=hh.displayName;var MP=F(({className:e,inset:t,...n},r)=>f(mh,{ref:r,className:x("px-2 py-[0.3125rem] text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));MP.displayName=mh.displayName;var wh=F(({className:e,...t},n)=>f(gh,{ref:n,className:x("-mx-1 my-1 h-px bg-muted",e),...t}));wh.displayName=gh.displayName;function RP({className:e,...t}){return f("span",{className:x("ml-auto text-xs tracking-widest opacity-60",e),...t})}RP.displayName="ContextMenuShortcut";var xh=globalThis.__bbPluginRuntime;if(xh==null||xh.radixHoverCard==null)throw new Error('Cannot load "@radix-ui/react-hover-card": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Bu=xh.radixHoverCard,ZW="default"in Bu?Bu.default:Bu,{Arrow:WW,Content:Ih,HoverCard:VW,HoverCardArrow:HW,HoverCardContent:FW,HoverCardPortal:BW,HoverCardTrigger:UW,Portal:ey,Root:ty,Trigger:ny,createHoverCardScope:KW}=Bu;var ry=ty,oy=ny,Sh=F(({className:e,align:t="center",sideOffset:n=4,...r},o)=>{let i=$e();return f(ey,{children:f(Ih,{ref:o,align:t,sideOffset:n,...i,className:x("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",e),...r})})});Sh.displayName=Ih.displayName;function Uu(e){let t=Math.max(0,e);return t<6e4?"now":t<36e5?`${Math.floor(t/6e4)}m`:t<864e5?`${Math.floor(t/36e5)}h`:t<6048e5?`${Math.floor(t/864e5)}d`:`${Math.floor(t/6048e5)}w`}function AP(e,t){return Math.max(e.latestAttentionAt,t[e.id]??e.createdAt)}function iy(e,t,n,r,o){if(o!==void 0){if(o===null)return null;let s=Uu(r-o),a=s==="now"?"<1m":s;return{text:a,label:`Waiting on you for ${a==="<1m"?"less than a minute":a}`,kind:"waiting"}}if(t){let s=n.startedAt[e.id];if(s===void 0)return null;let a=Uu(r-s),c=a==="now"?"<1m":a;return{text:c,label:`Working for ${c==="<1m"?"less than a minute":c}`,kind:"timer"}}let i=Uu(r-AP(e,n.finishedAt));return{text:i,label:i==="now"?"Finished just now":`Finished ${i} ago`,kind:"age"}}function sy(e,t){if(e.status!=="idle"&&e.status!=="error"||e.hasPendingInteraction)return null;let n=t[e.id];return n!==void 0?Math.max(n,e.latestAttentionAt):e.latestAttentionAt>e.createdAt&&(e.parentThreadId===null||e.status==="error")?e.latestAttentionAt:null}function ay(e,t,n,r){let o=e==="working"?n.startedAt[t]:e==="waits-on-you"?n.pendingAt[t]:e==="idle"||e==="unread"||e==="failed"?n.finishedAt[t]:void 0;return o===void 0?null:Uu(r-o)}var cy=["now","<1m","59m","23h","6d","99w"];function Ku({display:e,mode:t="muted",className:n}){let r=t==="muted";if(e.provider!==null){let o=r?{id:e.provider.id,logoUrl:e.provider.logoUrl,icon:e.provider.icon}:e.provider;return f("span",{title:e.name,className:x("inline-flex size-3.5 shrink-0 text-muted-foreground",r&&"opacity-60",n),children:f(Is,{providerKind:"agent",provider:o,"aria-label":e.name,className:"size-3.5"})})}return f("span",{role:"img","aria-label":e.name,title:e.name,className:x("inline-flex h-3.5 min-w-3.5 shrink-0 items-center justify-center rounded-[3px] border border-border px-px text-[8px] font-semibold leading-none tracking-tight text-muted-foreground",r&&"opacity-60",n),children:e.mark})}function _h(e){switch(e){case"checks_failed":case"conflicts":case"changes_requested":return"text-destructive";case"ready_to_merge":return"text-success";default:return"text-muted-foreground"}}var $P={checks_failed:"checks failed",conflicts:"has conflicts",changes_requested:"changes requested",ready_to_merge:"ready to merge",checks_pending:"checks pending",review_requested:"review requested",draft:"draft",merged:"merged",closed:"closed",blocked:"blocked"};function Gu(e){let t=$P[e.attention];return`Pull request #${e.number}${t?`, ${t}`:""}: ${e.title}`}function qu({threadId:e}){let{pullRequest:t}=Ss(e);return t===null?null:v("span",{title:Gu(t),"aria-label":Gu(t),className:x("shrink-0 text-[11px] tabular-nums",_h(t.attention)),children:["#",t.number]})}function Yu({item:e}){return v(_t,{children:[f(H,{name:e.icon,"aria-hidden":!0,className:"size-4"}),f("span",{children:e.label})]})}function uy(e){return[{id:null,name:"Threads"},...e.map(t=>({id:t.id,name:t.name}))]}function ly({items:e,sections:t,currentSectionId:n,onAction:r,onCloseAutoFocus:o,input:i}){let s=a=>c=>{if(!i.current.pressed&&!i.current.keyed){c.preventDefault();return}a()};return f(vh,{className:"min-w-48",onCloseAutoFocus:o,onPointerDown:()=>{i.current.pressed=!0},onKeyDown:()=>{i.current.keyed=!0},children:e.map(a=>v(Tr,{children:[a.separated?f(wh,{}):null,a.action==="move-to-section"?v(Qk,{children:[f(yh,{children:f(Yu,{item:a})}),f(bh,{children:uy(t).map(c=>v(Fu,{disabled:c.id===n,onSelect:s(()=>r("move-to-section",c.id)),children:[c.id===n?f(H,{name:z.check,"aria-hidden":!0,className:"size-4"}):f("span",{className:"size-4"}),c.name]},c.id??"threads"))})]}):f(Fu,{className:x(a.destructive&&"text-destructive focus:text-destructive"),onSelect:s(()=>r(a.action)),children:f(Yu,{item:a})})]},a.action))})}function dy({items:e,sections:t,currentSectionId:n,onAction:r,onCloseAutoFocus:o}){return f(Sr,{align:"end",className:"min-w-48",onCloseAutoFocus:o,children:e.map(i=>v(Tr,{children:[i.separated?f(Cs,{}):null,i.action==="move-to-section"?v(jk,{children:[f(sh,{children:f(Yu,{item:i})}),f(ah,{children:uy(t).map(s=>v(De,{disabled:s.id===n,onSelect:()=>r("move-to-section",s.id),children:[s.id===n?f(H,{name:z.check,"aria-hidden":!0,className:"size-4"}):f("span",{className:"size-4"}),s.name]},s.id??"threads"))})]}):f(De,{className:x(i.destructive&&"text-destructive focus:text-destructive"),onSelect:()=>r(i.action),children:f(Yu,{item:i})})]},i.action))})}function py({panes:e,label:t,working:n}){let r=e.some(o=>o.isMe&&o.isFocused);return f("svg",{role:"img","aria-label":t,viewBox:"0 0 14 14",width:14,height:14,shapeRendering:"crispEdges",className:x("pointer-events-none size-3.5 shrink-0",!r&&"opacity-60",n&&"animate-shine-icon motion-reduce:animate-none"),children:e.map(o=>{let i=o.isMe?0:.5;return f("rect",{x:1+o.rect.x*12+i,y:1+o.rect.y*12+i,width:Math.max(o.rect.width*12-2*i,0),height:Math.max(o.rect.height*12-2*i,0),strokeWidth:o.isMe?0:1,className:o.isMe?o.isFocused?"fill-primary/70 stroke-none":"fill-muted-foreground/45 stroke-none":"fill-none stroke-muted-foreground/30"},o.paneId)})})}function hn({label:e,title:t,children:n}){return v("div",{className:"flex min-w-0 gap-2",title:t,children:[f("dt",{className:"w-20 shrink-0 text-muted-foreground",children:e}),f("dd",{className:"min-w-0 flex-1 break-words",children:n})]})}function EP(e,t){let[n,r]=A("loading"),{id:o,status:i}=t.thread;return D(()=>{let s=!1;return r("loading"),e.loadModel(o,i).then(a=>!s&&r(a),()=>!s&&r(null)),()=>{s=!0}},[e,o,i]),n}function DP({threadId:e}){let{pullRequest:t}=Ss(e);return t===null?null:f(hn,{label:"Pull request",children:f("span",{className:_h(t.attention),children:Gu(t)})})}function Ju({info:e,controller:t,showPullRequest:n,actions:r}){let o=e.thread,i=t.provider(o.providerId),s=EP(t,e),a=ve(_u),c=lk(e.state.kind,ay(e.state.kind,o.id,a.stamps,a.now)),u=ck(uk(a.treeOf(o.id),o.id)),l=o.environment,d=sy(o,a.stamps.finishedAt),m=u4(a.notes[o.id]);return v("div",{className:"flex flex-col gap-2 text-xs",children:[f("p",{className:"text-sm font-medium leading-snug break-words",children:o.displayTitle}),v("div",{className:"flex items-center gap-1.5",children:[f(hs,{glyph:e.state.glyph,className:"size-3.5"}),v("span",{children:[e.state.label,c!==null?` \xB7 ${c}`:"",e.state.sendAt!==null?` \xB7 sends ${To(e.state.sendAt)}`:""]})]}),e.note!==null?f("p",{className:"break-words leading-snug",children:f(Nu,{note:e.note})}):null,v("dl",{className:"flex flex-col gap-1",children:[f(hn,{label:"Harness",children:v("span",{className:"inline-flex items-center gap-1.5",children:[f(Ku,{display:i,mode:t.harnessIcon}),i.name]})}),f(hn,{label:"Model",title:"The model and reasoning level the next message will use",children:s==="loading"?"\u2026":s===null?"Unknown":`${s.model} \xB7 ${s.reasoningLevel}`}),l?.branchName?f(hn,{label:"Branch",children:v("span",{className:"inline-flex items-center gap-1",children:[f(H,{name:l.isWorktree?z.worktree:z.branch,"aria-hidden":!0,className:"size-3.5"}),l.branchName,l.isWorktree?" (worktree)":""]})}):null,o.host!==null?f(hn,{label:"Machine",children:o.host.name}):null,u!==null?f(hn,{label:"Children",children:u}):null,n?f(DP,{threadId:o.id}):null,m!==null&&e.note===null?f(hn,{label:"Last reply",children:f("span",{className:"line-clamp-2",children:m.text})}):null,f(hn,{label:"Created",children:To(o.createdAt)}),d!==null?f(hn,{label:"Finished",children:To(d)}):null]}),r?v("div",{className:"flex gap-2 pt-1",children:[v(Ye,{size:"sm",onClick:r.open,children:[f(H,{name:z.open,"aria-hidden":!0}),"Open"]}),v(Ye,{size:"sm",variant:"outline",onClick:r.toggleRead,children:[f(H,{name:e.unread?z.markRead:z.markUnread,"aria-hidden":!0}),e.unread?"Mark read":"Mark unread"]})]}):null]})}var OP=400,NP=700,zP=10,ks=null;function jP(){let e=t=>{t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",e,!0)};window.addEventListener("click",e,!0),window.addEventListener("touchend",()=>setTimeout(()=>window.removeEventListener("click",e,!0),400),{capture:!0,once:!0})}var fy="text-[color:color-mix(in_oklch,var(--foreground)_68%,var(--sidebar))]",Ft="pointer-events-auto relative z-10 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-state-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring data-[state=open]:bg-state-active";function ZP(e){let t=_s();return K(()=>{if(t===null)return null;let n=t.panes.map(r=>({paneId:r.paneId,rect:r.rect,isMe:r.threadId===e,isFocused:r.isFocused}));return n.some(r=>r.isMe)?n:null},[t,e])}var my=st(function({row:t,controller:n,groupId:r,inPinned:o,dropState:i,active:s,editing:a,now:c,startedAt:u,finishedAt:l,pendingAt:d}){let{info:m}=t,p=m.thread,h=p.archivedAt!==null||p.isArchived,g=n.compact,C=jh(p.id),w=zh(p.id),{hasUnsubmittedDraft:y}=Oh(p.id),S=$h(p.id),T=ZP(p.id),[L,M]=A(!1),[E,B]=A(!1),X=bk(s,!g&&!a&&!L&&!E),oe=$({pressed:!1,keyed:!1}),ee=$(null),Z=$(null),ne={threadId:p.id,parentThreadId:p.parentThreadId,sectionId:p.sectionId,pinned:p.pinnedAt!==null||p.isPinned},Q=Hs({id:`thread:${p.id}:${r}`,data:{kind:"thread",thread:ne,groupId:r},disabled:a||g}),ge=Fs({id:`drop-thread:${p.id}:${r}`,data:{kind:"thread",threadId:p.id,inPinned:o,groupId:r}}),yt=N(W=>{Q.setNodeRef(W),ge.setNodeRef(W)},[Q.setNodeRef,ge.setNodeRef]),Ke=n.provider(p.providerId),gn=W5(m.state,w),nt=Vk(t,{providerName:Ke.name,pluginLabel:gn?w.label:null,hasDraft:y}),bt=h?null:iy(p,m.flags.has("working"),{startedAt:u===void 0?{}:{[p.id]:u},finishedAt:l===void 0?{}:{[p.id]:l}},c,m.state.kind==="waits-on-you"?d??null:void 0),Cn=h4({thread:p,unread:t.depth===0?t.treeUnread:m.unread,splitAvailable:S.isAvailable,isRoot:p.parentThreadId===null,hasSections:n.mode==="chronological"||n.sections.length>0,compact:g}),Oe=$(!1),rt=$(!1),Bt=(W,ze)=>{if(W==="rename"){Oe.current=!0,rt.current=!0,setTimeout(()=>{rt.current=!1},1500);return}n.onMenuAction(W,p,ze)};D(()=>{if(L||E||!Oe.current)return;let W=setTimeout(()=>{Oe.current&&(Oe.current=!1,n.setEditingId(p.id))},60);return()=>clearTimeout(W)},[L,E,n,p.id]);let Bn=W=>{rt.current&&(rt.current=!1,W.preventDefault(),Oe.current&&(Oe.current=!1,n.setEditingId(p.id)))},He=t.pullRequest!==null,Pr=T?f(py,{panes:T,label:`${p.displayTitle} \u2014 open in split; ${m.state.label}`,working:m.flags.has("working")}):gn?f(mk,{status:w}):f("span",{title:m.state.label,className:"inline-flex",children:f(hs,{glyph:m.state.glyph,label:m.state.label})}),Un=W=>{if(a){W.preventDefault();return}if(S.isAvailable&&(W.metaKey||W.ctrlKey)){W.preventDefault(),n.onMenuAction("open-in-split",p);return}let ze=Date.now();if(ks!==null&&ks.threadId===p.id&&ze-ks.at<OP){ks=null,W.preventDefault(),n.setEditingId(p.id);return}ks={threadId:p.id,at:ze},n.onNavigate()},ot=()=>{Z.current!==null&&clearTimeout(Z.current.timer),Z.current=null},we=$(!1),kn=g?{onTouchStart:W=>{let ze=W.touches[0];ze!==void 0&&(ot(),we.current=!1,Z.current={x:ze.clientX,y:ze.clientY,timer:setTimeout(()=>{Z.current=null,we.current=!0,jP(),M(!0)},NP)})},onTouchMove:W=>{let ze=W.touches[0];Z.current===null||ze===void 0||Math.hypot(ze.clientX-Z.current.x,ze.clientY-Z.current.y)>zP&&ot()},onTouchEnd:W=>{ot(),we.current&&W.preventDefault()},onTouchCancel:ot,onContextMenu:W=>W.preventDefault(),style:{WebkitTouchCallout:"none"}}:{},me=t.chip,Kn=$o(t.depth),Ne=t.note,vt=Ne!==null||t.branchLine!==null,wt=t.dimmed&&!a,Me=L||E,xt=t.machine!==null&&C===null,rn=t.harness||xt,re=!g&&C===null,Ut=g?"":Me?"opacity-0":vk,Kt=v("div",{ref:yt,"data-sidebar-rename-row":"","data-sidebar-nest-target":i==="valid"||i==="blocked"||i==="unchanged"?i:void 0,"data-sidebar-reorder-placement":i==="before"||i==="after"?i:void 0,...Q.attributes,...Q.listeners,role:void 0,tabIndex:void 0,"aria-roledescription":void 0,onPointerEnter:X.rowProps.onPointerEnter,onPointerMove:X.rowProps.onPointerMove,onPointerDown:W=>{X.rowProps.onPointerDown(),a||S.splitProps.onPointerDown?.(W)},onPointerLeave:X.rowProps.onPointerLeave,onFocus:X.rowProps.onFocus,onBlur:X.rowProps.onBlur,...kn,className:x("group/row relative flex w-full items-center gap-1.5 rounded-md pr-1 text-sm transition-colors",vt?"h-11 max-md:pointer-coarse:h-12":"h-7 max-md:pointer-coarse:h-9",s?"bg-state-active text-sidebar-foreground":"cursor-pointer text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",!s&&Me&&"bg-sidebar-accent",T&&!s&&"bb-sidebar-open-in-split-row",Q.isDragging&&"opacity-50",i==="valid"&&"ring-1 ring-inset ring-sidebar-ring/80 bg-sidebar-accent/45",i==="blocked"&&"ring-1 ring-inset ring-destructive/60",i==="before"&&"shadow-[inset_0_2px_0_0_var(--sidebar-ring)]",i==="after"&&"shadow-[inset_0_-2px_0_0_var(--sidebar-ring)]"),style:{paddingLeft:Kn},children:[f("a",{ref:ee,href:p.href,"data-sidebar-thread-shortcut-target":"","data-sidebar-thread-id":p.id,"data-sidebar-rename-anchor":"","aria-label":nt,"aria-keyshortcuts":C?.ariaKeyshortcuts,"aria-current":s?"page":void 0,onClick:Un,onDoubleClick:W=>{W.preventDefault(),n.setEditingId(p.id)},className:"absolute inset-0 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring"}),f("span",{className:"pointer-events-none relative flex size-4 shrink-0 items-center justify-center",children:Pr}),t.nested?f("span",{"aria-hidden":!0,title:`Child of ${t.parentTitle??"a thread"}`,className:x("pointer-events-none relative -ml-[3px] -mr-px w-1.5 shrink-0 text-center text-[10px] leading-none text-muted-foreground",vt&&"mt-[9px] self-start"),children:"\u21B3"}):null,t.crossGroupLabel!==null?f("span",{role:"img","aria-label":t.crossGroupLabel,title:t.crossGroupLabel,"data-sidebar-thread-cross-project":"",className:"pointer-events-none relative inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground",children:f(H,{name:z.crossGroup,"aria-hidden":!0,className:"size-3.5"})}):null,v("span",{className:"pointer-events-none relative flex min-w-0 flex-1 flex-col justify-center",children:[a?f(Eo,{initial:p.displayTitle,label:"Thread name",onSave:W=>n.onRename(p.id,W),onDone:()=>{n.setEditingId(null),ee.current?.focus()}}):v("span",{className:"flex min-w-0 items-center gap-1.5",children:[f("span",{title:p.displayTitle,className:x("min-w-0 truncate",t.bold?"font-semibold":"font-normal",t.depth>0&&"text-xs",wt&&`${fy} group-hover/row:text-foreground`),children:p.displayTitle}),t.pullRequest==="title"&&vt?f(qu,{threadId:p.id}):null]}),!a&&Ne!==null?f("span",{className:"min-w-0 truncate text-xs leading-4 text-muted-foreground",title:c4(Ne),children:f(Nu,{note:Ne})}):t.branchLine!==null&&!a?f(WP,{row:t,branch:t.branchLine}):null]}),t.hiddenBadge?f("span",{role:"img","aria-label":"Hidden thread",title:"Hidden thread",className:"pointer-events-none relative shrink-0 text-muted-foreground",children:f(H,{name:z.hidden,"aria-hidden":!0,className:"size-3.5"})}):null,t.pullRequest==="title"&&!vt&&!a?f("span",{className:"pointer-events-none relative",children:f(qu,{threadId:p.id})}):null,!a&&(rn||re)?v("span",{className:"relative -ml-1.5 grid shrink-0 items-center",children:[rn?v("span",{className:x("flex items-center gap-1.5 pl-1.5 [grid-area:1/1] transition-opacity",C===null&&Ut),children:[t.harness?f("span",{className:"pointer-events-none relative inline-flex shrink-0",children:f(Ku,{display:Ke,mode:n.harnessIcon})}):null,xt?f("span",{title:`On ${t.machine}`,"aria-label":`On ${t.machine}`,className:"pointer-events-none max-w-20 truncate text-[11px] text-muted-foreground",children:t.machine}):null]}):null,re?v("span",{className:x("items-center justify-self-end gap-0.5 pl-1.5 [grid-area:1/1]",Me?"flex":xk),children:[t.treeUnread?f("button",{type:"button","aria-label":"Mark read",title:"Mark read",className:Ft,onPointerDown:W=>W.stopPropagation(),onClick:W=>{W.preventDefault(),W.stopPropagation(),n.onMenuAction("mark-read",p)},children:f(H,{name:z.markRead,"aria-hidden":!0,className:"size-4"})}):null,f("button",{type:"button","aria-label":h?"Unarchive thread":"Archive thread",title:h?"Unarchive":"Archive",className:Ft,onPointerDown:W=>W.stopPropagation(),onClick:W=>{W.preventDefault(),W.stopPropagation(),n.onMenuAction(h?"unarchive":"archive",p)},children:f(H,{name:h?z.unarchive:z.archive,"aria-hidden":!0,className:"size-4"})})]}):null]}):null,a?null:v("span",{className:"relative flex shrink-0 items-center gap-1",children:[me!==null?v("button",{type:"button","aria-expanded":me.expanded,"aria-label":ch(p.displayTitle,me),title:ch(p.displayTitle,me),onClick:W=>{W.preventDefault(),W.stopPropagation(),n.onToggleChip(t)},onPointerDown:W=>W.stopPropagation(),onKeyDown:W=>W.stopPropagation(),className:x("pointer-events-auto relative z-10 inline-flex h-5 shrink-0 items-center gap-0.5 rounded-md px-0.5 text-[11px] leading-none tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",me.flag===null?x("text-muted-foreground hover:text-foreground",wt&&fy):Ou[B5(me.flag)]),children:[me.flag!==null?f(hk,{flag:me.flag}):null,me.count>0?me.count:null,f(H,{name:z.expand,"aria-hidden":!0,className:x("size-3 transition-transform duration-150",me.expanded&&"rotate-90")})]}):null,v("span",{"data-trailing-slot":"",className:"relative grid h-6 shrink-0 items-center",children:[f("span",{"aria-hidden":!0,className:"invisible w-6 [grid-area:1/1]"}),cy.map(W=>f("span",{"aria-hidden":!0,className:"invisible text-[11px] font-medium tabular-nums [grid-area:1/1]",children:W},W)),C!==null?f("kbd",{"aria-hidden":!0,className:"pointer-events-none justify-self-end rounded border border-border px-1 font-sans text-[10px] leading-4 text-muted-foreground [grid-area:1/1]",children:C.label}):v(_t,{children:[bt!==null?f("span",{title:bt.label,"aria-label":bt.label,className:x("pointer-events-none justify-self-end text-[11px] tabular-nums transition-opacity [grid-area:1/1]",bt.kind==="timer"?"font-medium text-[var(--timeline-accent)]":"text-muted-foreground",Ut),children:bt.text}):null,f("span",{className:x("flex items-center justify-self-end transition-opacity [grid-area:1/1]",g?"relative":Me?"opacity-100":wk),children:v(Ao,{open:L,onOpenChange:M,children:[f(Ir,{asChild:!0,children:f("button",{type:"button","aria-label":"Thread actions",className:g?"sr-only":Ft,onPointerDown:W=>W.stopPropagation(),onClick:W=>W.stopPropagation(),children:f(H,{name:z.more,"aria-hidden":!0,className:"size-4"})})}),f(dy,{items:Cn,sections:n.sections,currentSectionId:p.sectionId,onAction:Bt,onCloseAutoFocus:Bn})]})})]})]})]})]});return g?Kt:v(Jk,{onOpenChange:W=>{W&&(oe.current={pressed:!1,keyed:!1}),B(W)},children:[v(ry,{closeDelay:100,open:X.open,onOpenChange:X.onOpenChange,children:[f(Xk,{asChild:!0,disabled:a,children:f(oy,{asChild:!0,children:Kt})}),!a&&!L&&!E?f(Sh,{side:"right",align:"start",collisionPadding:8,className:"z-[100] w-72 p-3",children:f(Ju,{info:m,controller:n,showPullRequest:He})}):null]}),f(ly,{items:Cn,sections:n.sections,currentSectionId:p.sectionId,onAction:Bt,onCloseAutoFocus:Bn,input:oe})]})});function WP({row:e,branch:t}){let n=e.info.thread.environment;return v("span",{className:"flex min-w-0 items-center gap-1.5 text-xs leading-4 text-muted-foreground",children:[v("span",{className:"inline-flex min-w-0 items-center gap-0.5",children:[f(H,{name:n?.isWorktree?z.worktree:z.branch,"aria-hidden":!0,className:"size-3 shrink-0"}),f("span",{className:"truncate",children:t}),n?.isWorktree?f("span",{className:"sr-only",children:" (worktree)"}):null]}),e.pullRequest==="second-line"?f(qu,{threadId:e.info.thread.id}):null]})}var hy=st(function({row:t,controller:n}){let{label:r,ariaLabel:o}=Hk(t);return v("button",{type:"button","aria-expanded":t.expanded,"aria-label":o,onClick:()=>n.onToggleOlder(t),className:"relative flex h-7 w-full items-center gap-1.5 rounded-md pr-2 text-left text-xs text-muted-foreground outline-none hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring max-md:pointer-coarse:h-9",style:{paddingLeft:$o(t.depth)},children:[f("span",{"aria-hidden":!0,className:"inline-flex size-4 shrink-0 items-center justify-center",children:f(H,{name:z.more,className:"size-3.5"})}),r]})}),gy=st(function({row:t,controller:n}){let{label:r,ariaLabel:o}=Fk(t);return v("button",{type:"button","aria-expanded":t.expanded,"aria-label":o,onClick:()=>n.onToggleSettled(t),className:"group/settled relative flex h-6 w-full items-center gap-2 rounded-md pr-1 text-left text-[11px] text-muted-foreground/70 outline-none hover:text-muted-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring max-md:pointer-coarse:h-9",style:{paddingLeft:$o(0)},children:[f("span",{className:"shrink-0 tabular-nums",children:r}),f("span",{"aria-hidden":!0,className:"h-px flex-1 bg-border/60"}),f(H,{name:z.expand,"aria-hidden":!0,className:x("size-3 shrink-0 transition-transform duration-150",t.expanded&&"rotate-90")})]})}),Cy=st(function({row:t,controller:n,environmentProviders:r}){let[o,i]=A(!1),s=t.environmentProviderId===null?null:r.find(a=>a.id===t.environmentProviderId)??null;return v("div",{className:"group/row relative flex h-7 w-full items-center gap-1.5 rounded-md pr-1 text-sm text-muted-foreground hover:bg-sidebar-accent",style:{paddingLeft:$o(t.depth)},children:[f("button",{type:"button","aria-expanded":!t.collapsed,"aria-label":`${t.collapsed?"Expand":"Collapse"} ${t.label} environment, ${t.threadIds.length} threads`,onClick:()=>n.onToggleEnvironment(t.environmentId),className:"absolute inset-0 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring"}),f("span",{className:"pointer-events-none relative inline-flex size-4 shrink-0 items-center justify-center",children:s!==null?f(Is,{providerKind:"environment",provider:s,className:"size-3.5"}):f(H,{name:t.environmentProviderId===null?z.machine:z.environmentFallback,"aria-hidden":!0,className:"size-3.5"})}),o?f(Eo,{initial:t.label,label:"Environment name",onSave:a=>n.onRenameEnvironment(t.environmentId,a),onDone:()=>i(!1)}):f("span",{className:"pointer-events-none relative min-w-0 flex-1 truncate",children:t.label}),t.flag!==null?f(zu,{flag:t.flag,className:"pointer-events-none relative size-3.5"}):null,f("span",{className:"pointer-events-none relative text-[11px] tabular-nums",children:t.threadIds.length}),f(H,{name:z.expand,"aria-hidden":!0,className:x("pointer-events-none relative size-3 transition-transform",!t.collapsed&&"rotate-90")}),v(Ao,{children:[f(Ir,{asChild:!0,children:f("button",{type:"button","aria-label":"Environment actions",className:x(Ft,!n.compact&&"opacity-0 group-hover/row:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100"),children:f(H,{name:z.more,"aria-hidden":!0,className:"size-4"})})}),v(Sr,{align:"end",children:[v(De,{onSelect:()=>n.onNewThreadInEnvironment(t.environmentId,t.projectId,t.sectionId),children:[f(H,{name:z.newThread,"aria-hidden":!0,className:"size-4"}),"New thread in environment"]}),v(De,{onSelect:()=>i(!0),children:[f(H,{name:z.rename,"aria-hidden":!0,className:"size-4"}),"Rename"]}),v(De,{onSelect:()=>n.onArchiveEnvironment(t.environmentId),children:[f(H,{name:z.archive,"aria-hidden":!0,className:"size-4"}),"Archive"]})]})]})]})});var ky={compact:28,comfortable:44};function yy(e){return e.descriptor.kind==="section"||e.descriptor.kind==="machine"}var VP=st(function({group:t,controller:n,inOverflow:r,dropActive:o}){let[i,s]=A(!1),[a,c]=A(!1),u=t.descriptor.label,l=Hs({id:`group:${t.descriptor.id}`,data:{kind:"group",groupId:t.descriptor.id},disabled:n.compact||r||i}),d=n.compact,m=d?"":a?"opacity-0":Ik,p=d?"":x("absolute top-1/2 right-0 -translate-y-1/2 pl-1",o?"bg-sidebar-accent":"bg-sidebar",a?"opacity-100":Sk);return v("div",{ref:l.setNodeRef,...l.attributes,...l.listeners,role:void 0,tabIndex:void 0,"data-sidebar":"group-label",className:x("group/header sticky top-0 z-20 flex h-7 items-center gap-1 rounded-md bg-sidebar pl-2 pr-1 text-xs text-muted-foreground max-md:pointer-coarse:h-9",o&&"bg-sidebar-accent",l.isDragging&&"opacity-50",!n.compact&&!r&&"select-none"),children:[i?f(Eo,{initial:u,label:t.descriptor.kind==="section"?"Section name":"Machine name",onSave:h=>n.onRename(t,h),onDone:()=>s(!1),className:"text-xs"}):v("button",{type:"button","aria-expanded":!t.collapsed,"aria-label":`${t.collapsed?"Expand":"Collapse"} ${u} section`,onClick:()=>n.onToggleCollapse(t),onPointerDown:h=>h.stopPropagation(),onDoubleClick:()=>yy(t)&&s(!0),className:"flex min-w-0 flex-1 items-center gap-1 rounded-md py-1 text-left font-medium outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:[f("span",{className:"min-w-0 truncate",title:u,children:u}),f(H,{name:z.expand,"aria-hidden":!0,className:x("size-3 shrink-0 transition-transform duration-150",!t.collapsed&&"rotate-90")})]}),i?null:v("span",{className:"relative ml-auto flex shrink-0 items-center",children:[f(ju,{counters:M4(t.counters,{collapsed:t.collapsed,more:!1}),className:x("transition-opacity",m)}),v("span",{className:x("flex items-center transition-opacity",p),children:[t.descriptor.kind!=="pinned"&&(t.descriptor.newThreadProjectId!==null||t.descriptor.kind==="machine")&&(!n.compact||n.activeGroupId===t.descriptor.id)?f("button",{type:"button","aria-label":`New thread in ${u}`,title:`New thread in ${u}`,"data-sidebar-hover-actions-mobile":n.compact?"always":void 0,className:Ft,onPointerDown:h=>h.stopPropagation(),onClick:()=>n.onNewThread(t),children:f(H,{name:z.newThread,"aria-hidden":!0,className:"size-4"})}):null,v(Ao,{open:a,onOpenChange:c,children:[f(Ir,{asChild:!0,children:f("button",{type:"button","aria-label":`${u} actions`,className:Ft,onPointerDown:h=>h.stopPropagation(),children:f(H,{name:z.more,"aria-hidden":!0,className:"size-4"})})}),v(Sr,{align:"end",className:"min-w-48",children:[t.hasUnread?v(De,{onSelect:()=>n.onMarkAllRead(t),children:[f(H,{name:z.markRead,"aria-hidden":!0,className:"size-4"}),"Mark all read"]}):null,t.descriptor.kind!=="pinned"&&t.descriptor.newThreadProjectId!==null?v(De,{onSelect:()=>n.onNewThread(t),children:[f(H,{name:z.newThread,"aria-hidden":!0,className:"size-4"}),"New thread"]}):null,n.canCreateSections?v(De,{onSelect:()=>n.onNewSection(),children:[f(H,{name:z.newSection,"aria-hidden":!0,className:"size-4"}),"New section"]}):null,yy(t)?v(De,{onSelect:()=>s(!0),children:[f(H,{name:z.rename,"aria-hidden":!0,className:"size-4"}),"Rename"]}):null,f(Cs,{}),t.descriptor.kind!=="pinned"?t.hidden?v(De,{onSelect:()=>n.onShow(t),children:[f(H,{name:z.show,"aria-hidden":!0,className:"size-4"}),"Show in list"]}):v(De,{onSelect:()=>n.onHide(t),children:[f(H,{name:z.hidden,"aria-hidden":!0,className:"size-4"}),"Hide from list"]}):null,v(De,{onSelect:()=>n.onToggleArchived(),children:[f(H,{name:n.showArchived?z.check:z.archive,"aria-hidden":!0,className:"size-4"}),"Show archived threads"]}),v(De,{onSelect:()=>n.onCustomize(),children:[f(H,{name:z.customize,"aria-hidden":!0,className:"size-4"}),"Customize list"]}),t.descriptor.kind==="section"?v(De,{className:"text-destructive focus:text-destructive",onSelect:()=>n.onRemove(t),children:[f(H,{name:z.remove,"aria-hidden":!0,className:"size-4"}),"Remove section"]}):null]})]})]})]})]})});function HP(e){return e.key}function FP({rows:e,forceMount:t,rowHeight:n,children:r}){let o=$(null),[i,s]=A(!0),a=$(null);D(()=>{let l=o.current;if(l===null||typeof IntersectionObserver>"u")return;let d=new IntersectionObserver(m=>{for(let p of m)p.isIntersecting===!1&&l.firstElementChild!==null&&i&&(a.current=l.getBoundingClientRect().height),s(p.isIntersecting)},{rootMargin:"240px 0px"});return d.observe(l),()=>d.disconnect()},[i]);let c=i||t,u=e.filter(l=>l.type==="thread").map(l=>({threadId:l.info.thread.id,projectId:l.projectId}));return f("div",{ref:o,"data-sidebar-windowed-item":"","data-sidebar-windowed-nav":c||u.length===0?void 0:Zk(u),style:c?void 0:{height:a.current??e.length*n},children:c?r:null})}function BP({rows:e,groupId:t,inPinned:n,forceMount:r,rowController:o,environmentProviders:i,dropStates:s,activeThreadId:a,editingId:c,now:u,stamps:l}){let d=o.comfortable?ky.comfortable:ky.compact;return f("div",{"data-sidebar":"group-content",className:"flex w-full flex-col text-sm",children:Wk(e).map(m=>f(FP,{rows:m,rowHeight:d,forceMount:r||m.some(p=>p.type==="thread"&&(p.info.thread.id===a||p.info.thread.id===c)),children:m.map(p=>p.type==="thread"?f(my,{row:p,controller:o,groupId:t,inPinned:n,dropState:s.get(p.info.thread.id)??null,active:p.info.thread.id===a,editing:p.info.thread.id===c,now:u,startedAt:l.startedAt[p.info.thread.id],finishedAt:l.finishedAt[p.info.thread.id],pendingAt:l.pendingAt[p.info.thread.id]},p.key):p.type==="older"?f(hy,{row:p,controller:o},p.key):p.type==="settled"?f(gy,{row:p,controller:o},p.key):f(Cy,{row:p,controller:o,environmentProviders:i},p.key))},HP(m[0])))})}var Ph=st(function({group:t,groupController:n,dropTargetGroupId:r,inOverflow:o=!1,...i}){let s=Fs({id:`drop-group:${t.descriptor.id}`,data:{kind:"group",groupId:t.descriptor.id}});return v("section",{ref:s.setNodeRef,"aria-label":t.descriptor.label,"data-sidebar-visibility-group":t.descriptor.id,"data-sidebar-section-id":t.descriptor.kind==="section"?t.descriptor.entityId??void 0:void 0,className:"relative flex w-full min-w-0 flex-col",children:[f(VP,{group:t,controller:n,inOverflow:o,dropActive:r===t.descriptor.id}),t.rows.length===0?t.collapsed||t.rootIds.length>0?null:f("p",{className:"py-1 pl-8 text-xs text-muted-foreground",children:"No threads"}):f(BP,{...i,rows:t.rows,groupId:t.descriptor.id,inPinned:t.descriptor.id==="pinned",forceMount:o})]})});function by(e){return e==="everything"}function vy(e){return e?"everything":"blocked"}function wy(e){return{chronologicalSort:e,sortDirection:yu(e)}}function xy(e){let t=Vn(e.chronologicalSort),r=pm(t,e.sortDirection)==="descending";return{glyph:r?"\u2193":"\u2191",label:t==="alpha"?r?"Z\u2013A":"A\u2013Z":r?"Newest first":"Oldest first",patch:{sortDirection:r?"ascending":"descending"}}}var UP="flex flex-1 gap-0.5 rounded-md bg-surface-recessed p-0.5",KP="flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-1 py-0.5 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring";function GP(e){return x(KP,e?"bg-state-active text-foreground":"text-muted-foreground hover:bg-state-hover hover:text-foreground")}function ys({label:e,children:t}){return v("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1",children:[f("span",{className:"min-w-[5.5rem] shrink-0 whitespace-nowrap text-sm",children:e}),f("div",{className:"flex flex-1 gap-2",children:t})]})}function bs({label:e,options:t,current:n,onSelect:r}){return f("div",{role:"radiogroup","aria-label":e,className:UP,children:t.map(([o,i])=>f("button",{type:"button",role:"radio","aria-checked":o===n,onClick:()=>r(o),className:GP(o===n),children:i},o))})}function Iy({label:e,checked:t,onChange:n,description:r}){return v("button",{type:"button",role:"checkbox","aria-checked":t,onClick:()=>n(!t),className:"flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm outline-none hover:bg-accent focus-visible:bg-accent",children:[f("span",{"aria-hidden":!0,className:x("mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-sm border border-input",t&&"border-primary bg-primary text-primary-foreground"),children:t?f(H,{name:z.check,"aria-hidden":!0,className:"size-3"}):null}),v("span",{className:"flex min-w-0 flex-col",children:[f("span",{children:e}),r?f("span",{className:"text-xs text-muted-foreground",children:r}):null]})]})}function Lh({children:e}){return f("h3",{className:"px-2 pb-0.5 pt-3 text-xs font-medium text-muted-foreground first:pt-0",children:e})}function Sy({prefs:e,client:t,onPrefs:n,onClient:r}){let o=xy(e);return v("div",{className:"flex flex-col",children:[f(Lh,{children:"List"}),f(ys,{label:"Group by",children:f(bs,{label:"Group by",options:[["project","Project"],["chronological","Custom"],["machine","Machine"]],current:e.organizationMode,onSelect:i=>n({organizationMode:i})})}),v(ys,{label:"Sort by",children:[f(bs,{label:"Sort by",options:[["updated","Updated"],["created","Created"],["alpha","A\u2013Z"]],current:Vn(e.chronologicalSort),onSelect:i=>n(wy(i))}),f("button",{type:"button","aria-label":`Sort order: ${o.label}. Reverse`,title:o.label,onClick:()=>n(o.patch),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-surface-recessed text-xs outline-none hover:bg-state-hover focus-visible:ring-2 focus-visible:ring-ring",children:o.glyph})]}),f(Iy,{label:"Worktrees as folders",description:"Threads sharing a worktree fold into one row",checked:e.environmentGrouping,onChange:i=>n({environmentGrouping:i})}),f(ys,{label:"Settle after",children:f(bs,{label:"Settle after",options:[["12h","12h"],["1d","1d"],["3d","3d"],["1w","1w"],["never","Never"]],current:e.settleAfter,onSelect:i=>n({settleAfter:i})})}),f(Lh,{children:"Rows"}),f(ys,{label:"Density",children:f(bs,{label:"Density",options:[["compact","Compact"],["comfortable","Comfortable"]],current:t.density,onSelect:i=>r({density:i})})}),f(ys,{label:"Harness icon",children:f(bs,{label:"Harness icon",options:[["muted","Muted"],["colour","Colour"]],current:e.harnessIcon,onSelect:i=>n({harnessIcon:i})})}),f(Lh,{children:"Attention"}),f(Iy,{label:"Needs attention counts every child",description:"Every unread or failed child thread; otherwise only those blocked on you.",checked:by(e.childAttention),onChange:i=>n({childAttention:vy(i)})})]})}var qP="bg-[color-mix(in_oklab,var(--attention)_14%,transparent)] text-[color:color-mix(in_oklab,var(--attention),var(--foreground)_55%)] hover:bg-[color-mix(in_oklab,var(--attention)_24%,transparent)]",YP="bg-[color-mix(in_oklab,var(--attention)_30%,transparent)] text-foreground",_y=st(function({mode:t,needYouCount:n,needYouOnly:r,onToggleNeedYou:o,hasUnread:i,onMarkAllRead:s,prefs:a,client:c,onPrefs:u,onClient:l}){let[d,m]=A(!1);return v("div",{"data-sidebar":"list-header",className:"flex h-7 items-center gap-1 pl-2 pr-1 text-xs text-muted-foreground max-md:pointer-coarse:h-9",children:[f("h2",{className:"min-w-0 flex-1 truncate font-medium select-none",children:Bk(t)}),n>0?v("button",{type:"button","aria-pressed":r,title:r?"Show every thread":"Show only what needs you",onClick:o,className:x("inline-flex h-5 shrink-0 items-center rounded-full px-1.5 text-[11px] leading-none tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r?YP:qP),children:[n," need you"]}):null,i?f("button",{type:"button","aria-label":"Mark all read",title:"Mark all read",className:Ft,onClick:s,children:f(H,{name:z.markRead,"aria-hidden":!0,className:"size-4"})}):null,v(sa,{open:d,onOpenChange:m,children:[f(ei,{asChild:!0,children:f("button",{type:"button","aria-label":"Thread Glance settings",title:"Settings",className:Ft,children:f(H,{name:z.settings,"aria-hidden":!0,className:"size-4"})})}),f(ti,{side:"bottom",align:"end",className:"w-80 max-w-[calc(100vw-1rem)] p-1",children:f(Sy,{prefs:a,client:c,onPrefs:u,onClient:l})})]})]})});var JP="thread-glance";function _r(e){return e instanceof Error?e.message:String(e)}async function Py(e,t){try{await navigator.clipboard.writeText(e),gt.success(t)}catch(n){gt.error("Couldn't copy",{description:_r(n)})}}var XP={activationConstraint:{distance:4}},QP={activationConstraint:{delay:200,tolerance:6}},eL=e=>{let t=e.active.data.current?.kind,n=i5(e);if(t==="group")return n.filter(o=>String(o.id).startsWith("drop-group:"));let r=n.filter(o=>String(o.id).startsWith("drop-thread:"));return r.length>0?r:n};function Ly(e){let t=e.activatorEvent,n=null;return t instanceof MouseEvent?n=t.clientY:typeof TouchEvent<"u"&&t instanceof TouchEvent&&(n=t.touches[0]?.clientY??null),n===null?null:n+e.delta.y}function Mh(e){let[t,n]=A(0);return f(tL,{...e,attempt:t,onRetry:()=>n(r=>r+1)},t)}function tL({activeThreadId:e,isCompactViewport:t,onNavigate:n,attempt:r,onRetry:o}){let{prefs:i,hydrated:s,update:a}=Xg(),[c,u]=Gg(),[l,d]=A(!1),m=$(null);_k(m);let p=Eh({experimental_lifecycles:i.showArchived?["active","archived"]:["active"]}),h=Ah(),g=Rr(),{providers:C}=Th(),{providers:w}=Dh(),y=Nh(),S=_s(),T=K(()=>new Set(S?.panes.flatMap(b=>b.threadId===null?[]:[b.threadId])??[]),[S]),{stamps:L,loaded:M,markSeen:E,markIdle:B,clearSeen:X}=t4(),oe=Qg(),ee=ok(),[Z,ne]=A(null),Q=K(()=>{let b=Object.values(oe).filter(_=>_>Date.now());return Z!==null&&b.push(Z),b.length>0?Math.min(...b):null},[oe,Z]),ge=Yg(Q),[yt,Ke]=A(null),[gn,nt]=A(null),[bt,Cn]=A(null),[Oe,rt]=A(""),Bt=$(new Map),[Bn,He]=A(!1),[Pr,Un]=A(!1),[ot,we]=A(null),[kn,me]=A(()=>new Map),[Kn,Ne]=A(null),vt=$(new Map),wt=p.status==="ready",Me=p.threads,xt=K(()=>new Map(Me.map(b=>[b.id,b])),[Me]),rn=qg(Me,B),re=K(()=>wt?d4({threads:Me,activeThreadId:e,openThreadIds:T,finishedAt:L.finishedAt,seenAt:L.seenAt,draftIds:y,scheduled:oe,now:ge,notes:ee,childAttention:i.childAttention,idleSince:rn,idleAt:L.idleAt,stampsLoaded:M}):null,[wt,Me,e,T,L.finishedAt,L.seenAt,L.idleAt,M,y,oe,ge,ee,i.childAttention,rn]),Ut=re?.nextOrphanAt??null;Ut!==Z&&ne(Ut);let{targets:Kt,prune:W}=t0(s?re:null,e),ze=K(()=>[...new Set(Me.flatMap(b=>b.environment?.branchName?[b.projectId]:[]))],[Me]),Do=ik(ze),vs=N(b=>Do.has(b.projectId)?Do.get(b.projectId)??null:void 0,[Do]),At=sk(),on=K(()=>({now:ge,settleAfter:i.settleAfter,startedAt:L.startedAt,finishedAt:L.finishedAt}),[ge,i.settleAfter,L.startedAt,L.finishedAt]),yn=$(null),te=K(()=>re===null?null:F4(yn.current,Z4({forest:re,threads:Me,projects:p.projects,sections:p.sections,prefs:i,activeThreadId:e,targets:Kt,settle:on,defaultProviderId:At.defaultProviderId,primaryHostId:At.primaryHostId,comfortable:c.density==="comfortable",defaultBranchOf:vs,needYouOnly:vm(l,Iu(re))})),[re,Me,p.projects,p.sections,i,e,Kt,on,At.defaultProviderId,At.primaryHostId,c.density,vs,l]);at(()=>{yn.current=te},[te]),l&&re!==null&&!vm(l,Iu(re))&&d(!1);let $t=$(null);D(()=>{let b=[$t.current,e].filter(_=>_!==null&&xt.get(_)?.parentThreadId!=null);$t.current=e,yk(),b.length>0&&E([...new Set(b)])},[e]);let Oo=K(()=>y4(C),[C]),ws=K(()=>{let b=new Map,_=new Map(C.map(R=>[R.id,R]));return R=>{let ue=b.get(R);if(ue===void 0){let fe=_.get(R);ue={id:R,name:fe?.displayName??R,provider:fe?.logoUrl?fe:null,mark:b4(R,Oo)},b.set(R,ue)}return ue}},[C,Oo]),bn=N(b=>{Object.keys(b.patch).length>0&&a(b.patch),b.drop!==null&&W(b.drop)},[a,W]),Gn=N((b,_,R)=>{let ue={activeThreadId:e,openThreadIds:T,finishedAt:L.finishedAt,seenAt:L.seenAt},fe=ye=>Ze=>gt.error(ye,{description:_r(Ze)});switch(b){case"open-in-split":h.open(_.id,{split:!0}),n();return;case"copy-link":Py(new URL(_.href,window.location.origin).toString(),"Thread link copied");return;case"copy-id":Py(_.id,"Thread ID copied");return;case"mark-read":{let ye=Fe.current.forest,Ze=ye===null?{read:[_.id],seen:[]}:P4(_.id,ye,ue);Ze.seen.length>0&&E(Ze.seen);for(let Jn of Ze.read)h.setRead(Jn,!0).catch(fe("Couldn't mark read"));return}case"mark-unread":X([_.id]),h.setRead(_.id,!1).catch(fe("Couldn't mark unread"));return;case"pin":case"unpin":h.setPinned(_.id,b==="pin").catch(fe("Couldn't change the pin"));return;case"move-to-section":g.threads.update({threadId:_.id,sectionId:R??null}).catch(fe("Couldn't move the thread"));return;case"rename":Ke(_.id);return;case"details":nt(_.id);return;case"move":rt(""),Cn(_.id);return;case"archive":h.archive(_.id);return;case"unarchive":g.threads.unarchive({threadId:_.id}).catch(fe("Couldn't unarchive"));return;case"delete":setTimeout(()=>h.requestDelete(_.id),0);return}},[h,e,T,X,E,n,g,L.finishedAt,L.seenAt]),No=$(Gn);at(()=>{No.current=Gn});let Fe=$({forest:re,view:te,prefs:i,byId:xt,activeThreadId:e,openThreadIds:T,stamps:L});at(()=>{Fe.current={forest:re,view:te,prefs:i,byId:xt,activeThreadId:e,openThreadIds:T,stamps:L}});let zo=N((b,_)=>{let R=`${b}:${_}`,ue=vt.current.get(R);if(ue===void 0){let fe=Fe.current.byId.get(b),ye=fe?.providerId??"",Ze=Bt.current.get(ye);Ze===void 0&&(Ze=g.providers.models(fe?.host?{providerId:ye,hostId:fe.host.id}:{providerId:ye}).then(jo=>jo.models,()=>[]),Bt.current.set(ye,Ze));let Jn=Ze;ue=g.threads.defaultExecutionOptions({threadId:b}).then(async jo=>jo===null?null:{model:dk(jo.model,await Jn),reasoningLevel:jo.reasoningLevel},()=>null),vt.current.set(R,ue)}return ue},[g]),Lr=re!==null&&te!==null,Mr=K(()=>Lr?{compact:t,comfortable:c.density==="comfortable",setEditingId:Ke,harnessIcon:i.harnessIcon,provider:ws,sections:p.sections,mode:i.organizationMode,onNavigate:n,onToggleChip:b=>{let{prefs:_,forest:R}=Fe.current;bn(w4(b,_,R))},onToggleOlder:b=>{let{prefs:_,forest:R}=Fe.current;bn(I4(b,_,R))},onToggleSettled:b=>bn(S4(b,Fe.current.prefs)),onToggleEnvironment:b=>{let{collapsedEnvironments:_}=Fe.current.prefs;a({collapsedEnvironments:_.includes(b)?_.filter(R=>R!==b):[..._,b]})},onMenuAction:(b,_,R)=>No.current(b,_,R),onRename:(b,_)=>h.rename(b,_),loadModel:zo,openDetails:nt,onNewThreadInEnvironment:(b,_,R)=>{h.openNewThread({projectId:_,environmentId:b,...R?{sectionId:R}:{},focusPrompt:!0}),n()},onRenameEnvironment:async(b,_)=>{await g.environments.update({environmentId:b,name:_})},onArchiveEnvironment:b=>{g.environments.archiveThreads({environmentId:b}).catch(_=>gt.error("Couldn't archive the environment",{description:_r(_)}))}}:null,[Lr,t,c.density,i.harnessIcon,i.organizationMode,ws,p.sections,n,bn,a,h,g,zo]),Xu=K(()=>({now:ge,stamps:L,notes:ee,treeOf:b=>re?.treeOf.get(b)}),[ge,L,ee,re]),Se=K(()=>{let b=e===null||re===null?void 0:re.treeOf.get(e);return b===void 0?null:vu(b.root.thread,{mode:i.organizationMode,projects:p.projects})},[e,re,i.organizationMode,p.projects]),Be=i.showArchived,Re=N((b,_)=>{let{activeThreadId:R,openThreadIds:ue,stamps:fe}=Fe.current,ye=Cm(b,{activeThreadId:R,openThreadIds:ue,finishedAt:fe.finishedAt,seenAt:fe.seenAt}),Ze=()=>{ye.seen.length>0&&E(ye.seen);for(let Jn of ye.read)h.setRead(Jn,!0).catch(()=>{})};ye.read.length>g4?we({title:`Mark ${ye.read.length} threads read?`,description:`Every unread thread in ${_}, child threads included, will be marked read.`,confirmLabel:"Mark all read",run:Ze}):Ze()},[h,E]),Gt=N(()=>Re(Fe.current.forest?.trees??[],"the list"),[Re]),it=N(()=>d(b=>!b),[]),je=K(()=>{if(!Lr)return null;let b=_=>Re(_.rootIds.flatMap(R=>Fe.current.forest.treeOf.get(R)??[]),_.descriptor.label);return{compact:t,activeGroupId:Se,showArchived:Be,onToggleArchived:()=>a({showArchived:!Fe.current.prefs.showArchived}),canCreateSections:i.organizationMode==="chronological",onToggleCollapse:_=>{let{prefs:R,forest:ue}=Fe.current;bn(_4(_,R,ue))},onNewThread:_=>{let R=_.descriptor;h.openNewThread({...R.newThreadProjectId?{projectId:R.newThreadProjectId}:{},...R.newThreadSectionId?{sectionId:R.newThreadSectionId}:{},focusPrompt:!0}),n()},onHide:_=>a({hiddenGroups:[...Fe.current.prefs.hiddenGroups,_.descriptor.id]}),onShow:_=>a({hiddenGroups:Fe.current.prefs.hiddenGroups.filter(R=>R!==_.descriptor.id)}),onCustomize:()=>He(!0),onRename:async(_,R)=>{_.descriptor.kind==="section"?await g.threadSections.update({id:_.descriptor.entityId,name:R}):_.descriptor.kind==="machine"&&await g.hosts.update({hostId:_.descriptor.entityId,name:R})},onRemove:_=>we({title:"Remove section?",description:"Threads in this section will move back to Threads.",confirmLabel:"Remove",destructive:!0,run:()=>{g.threadSections.delete({id:_.descriptor.entityId}).catch(R=>gt.error("Couldn't remove the section",{description:_r(R)}))}}),onMarkAllRead:b,onNewSection:()=>Un(!0)}},[Lr,t,Se,Be,i.organizationMode,bn,h,n,a,g,Re]),It=o5(Zs(qo,XP),Zs(Yo,QP),Zs(Nr)),Et=N(b=>{let _=b.over;if(_===null)return null;let R=_.data.current;if(R===void 0)return null;if(R.kind==="group")return{kind:"group",groupId:R.groupId};let ue=Ly(b),fe=_.rect,ye=ue===null?.5:(ue-fe.top)/Math.max(fe.height,1),Ze=ye<.25?"before":ye>.75?"after":"middle";return{kind:"thread",threadId:R.threadId,zone:Ze,inPinned:R.inPinned??!1}},[]),Ce=K(()=>{let b=new Map;for(let R of[...te?.groups??[],...te?.more??[]])for(let ue of R.rows)ue.type==="thread"&&b.set(ue.info.thread.id,R.descriptor.id);let _=te?.groups.find(R=>R.descriptor.id==="pinned");return{mode:i.organizationMode,parentOf:R=>xt.get(R)?.parentThreadId??null,pinnedOrder:(_?.rows??[]).flatMap(R=>R.type==="thread"&&R.depth===0?[R.info.thread.id]:[]),groupOfThread:R=>b.get(R)??"threads"}},[te,i.organizationMode,xt]),qt=N(b=>{let _=b.active.data.current,R=Et(b);if(_?.kind!=="thread"||R===null){me(new Map),Ne(_?.kind==="group"&&R?.kind==="group"?R.groupId:null);return}if(R.kind==="group"){me(new Map),Ne(R.groupId);return}Ne(null);let ue=dm(_.thread,R,Ce),fe=ue.type==="blocked"?"blocked":ue.type==="unchanged"?"unchanged":R.zone==="middle"?"valid":R.zone;me(new Map([[R.threadId,fe]]))},[Et,Ce]),mt=N(async b=>{switch(b.type){case"nest":b.unpinFirst&&await g.threads.unpin({threadId:b.threadId}),await g.threads.update({threadId:b.threadId,parentThreadId:b.parentThreadId});return;case"move":await g.threads.update({threadId:b.threadId,sectionId:b.sectionId,...b.detach?{parentThreadId:null}:{}});return;case"detach":await g.threads.update({threadId:b.threadId,parentThreadId:null});return;case"pin":await h.setPinned(b.threadId,!0);return;case"unpin":await h.setPinned(b.threadId,!1);return;case"reorder-pinned":await g.threads.reorderPinned({threadId:b.threadId,previousThreadId:b.previousThreadId,nextThreadId:b.nextThreadId});return;case"blocked":case"unchanged":return}},[g,h]),Dt=N(b=>{me(new Map),Ne(null);let _=b.active.data.current,R=Et(b);if(_===void 0||R===null||te===null)return;if(_.kind==="group"){if(R.kind!=="group"||R.groupId===_.groupId)return;let fe=b.over.rect,ye=Ly(b),Ze=ye!==null&&ye>fe.top+fe.height/2?"after":"before",Jn=is[i.organizationMode];a({[Jn]:hm(te.order,_.groupId,R.groupId,Ze)});return}let ue=dm(_.thread,R,Ce);mt(ue).catch(fe=>gt.error("Failed to move thread.",{description:_r(fe)}))},[Et,te,i.organizationMode,a,Ce,mt]),qn=N(()=>me(new Map),[]),Yn=K(()=>{if(te===null)return[];let b=new Map([...te.groups,...te.more].map(_=>[_.descriptor.id,_]));return te.order.flatMap(_=>{let R=b.get(_);return R===void 0?[]:[{id:_,label:R.descriptor.label,hidden:R.hidden,hideable:_!=="pinned"}]})},[te]);if(p.status==="error")return v("div",{role:"alert",className:"flex flex-col items-start gap-2 px-3 py-2 text-sm",children:[f("p",{className:"text-muted-foreground",children:"Threads couldn't load."}),r===0?f(Ye,{size:"sm",variant:"outline",onClick:o,children:"Retry"}):f(Ye,{size:"sm",variant:"outline",onClick:()=>{g.plugins.reload({pluginId:JP}).catch(()=>window.location.reload())},children:"Reload plugin"})]});if(p.status==="loading"||!s||te===null||Mr===null||je===null)return f("div",{role:"status","aria-label":"Loading threads",className:"flex flex-col gap-1 px-2 py-1",children:[0,1,2].map(b=>f("div",{"data-sidebar":"navigation-loading-row",className:"h-7 animate-pulse rounded-md bg-muted/60"},b))});let Te=p.experimental_archived,ht=gn===null?null:re?.infos.get(gn)??null,Ot=bt===null?null:xt.get(bt)??null;return f(_u.Provider,{value:Xu,children:v("div",{ref:m,className:"flex w-full min-w-0 flex-col px-1.5 pb-2",children:[f(_y,{mode:i.organizationMode,needYouCount:te.needYouCount,needYouOnly:l,onToggleNeedYou:it,hasUnread:te.hasUnread,onMarkAllRead:Gt,prefs:i,client:c,onPrefs:a,onClient:u}),Me.length===0?f("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:"No threads yet."}):v(C5,{sensors:It,collisionDetection:eL,onDragMove:qt,onDragEnd:Dt,onDragCancel:qn,children:[te.groups.map(b=>f(Ph,{group:b,rowController:Mr,groupController:je,environmentProviders:w,dropStates:kn,dropTargetGroupId:Kn,activeThreadId:e,editingId:yt,now:ge,stamps:L},b.descriptor.id)),te.more.length>0?v(sa,{children:[f(ei,{asChild:!0,children:v("button",{type:"button","data-testid":"sidebar-thread-list-more-trigger","aria-label":`More: ${te.more.length} hidden ${te.more.length===1?"group":"groups"}`,className:"mt-1 flex h-7 w-full items-center gap-1 rounded-md pl-2 pr-1 text-left text-xs text-muted-foreground outline-none hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:[f("span",{className:"flex-1 font-medium",children:"More"}),f(ju,{counters:te.moreCounters}),f(H,{name:"ChevronRight","aria-hidden":!0,className:"size-3"})]})}),f(ti,{side:"right",align:"end",className:"max-h-[70vh] w-72 overflow-y-auto p-1",children:f("div",{"data-sidebar-overflow":"true",className:"flex flex-col",children:te.more.map(b=>f(Ph,{group:b,rowController:Mr,groupController:je,environmentProviders:w,dropStates:kn,dropTargetGroupId:Kn,activeThreadId:e,editingId:yt,now:ge,stamps:L,inOverflow:!0},b.descriptor.id))})})]}):null]}),Te!==null?v("div",{className:"flex flex-col items-start gap-1 px-2 pt-2",children:[Te.status==="loading"?f("p",{role:"status",className:"text-xs text-muted-foreground",children:"Loading archived threads\u2026"}):Te.status==="error"?f("p",{role:"status",className:"text-xs text-muted-foreground",children:"Archived threads unavailable"}):null,Te.hasNextPage||Te.isFetchNextPageError?f(Ye,{size:"sm",variant:"ghost","aria-label":"Load more archived threads",disabled:Te.isFetchingNextPage,className:x("h-7 text-xs text-muted-foreground"),onClick:()=>{Te.fetchNextPage()},children:Te.isFetchingNextPage?"Loading\u2026":Te.isFetchNextPageError?"Retry loading":"Show more"}):null]}):null,f(QC,{open:Bn,items:Yn,onOpenChange:He,onToggleHidden:b=>a({hiddenGroups:i.hiddenGroups.includes(b)?i.hiddenGroups.filter(_=>_!==b):[...i.hiddenGroups,b]}),onMove:(b,_)=>{let R=te.order.indexOf(b),ue=te.order[R+_];ue!==void 0&&a({[is[i.organizationMode]]:hm(te.order,b,ue,_<0?"before":"after")})}}),f(ek,{open:Pr,onOpenChange:Un,onCreate:async b=>{try{await g.threadSections.create({name:b})}catch(_){throw gt.error("Couldn't create the section",{description:_r(_)}),_}}}),f(tk,{open:ot!==null,title:ot?.title??"",description:ot?.description??"",confirmLabel:ot?.confirmLabel??"OK",destructive:ot?.destructive,onOpenChange:b=>!b&&we(null),onConfirm:()=>{ot?.run(),we(null)}}),ht!=null?f(nk,{open:!0,title:ht.thread.displayTitle,onOpenChange:b=>!b&&nt(null),children:f(Ju,{info:ht,controller:Mr,showPullRequest:!0,actions:{open:()=>{nt(null),h.open(ht.thread.id),n()},toggleRead:()=>Gn(ht.unread?"mark-read":"mark-unread",ht.thread)}})}):null,Ot!==null&&re!==null?f(rk,{open:!0,title:Ot.displayTitle,targets:ak(Ot.id,re,Oe),query:Oe,onQueryChange:rt,onOpenChange:b=>!b&&Cn(null),onMove:b=>{(async()=>{b!==null&&(Ot.pinnedAt!==null||Ot.isPinned)&&await g.threads.unpin({threadId:Ot.id}),await g.threads.update({threadId:Ot.id,parentThreadId:b})})().catch(R=>gt.error("Failed to move thread.",{description:_r(R)}))}}):null]})})}var OF=Rh(e=>{e.slots.experimental_threadList({id:"thread-glance",title:"Thread Glance",description:"Every thread's state, harness and child threads at a glance.",component:Mh})});export{OF as default};
|
|
66
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}a.count>1&&e.reused==="ref"&&i(s)}e.external&&(e.sharedDefsExtractedFor=e.external)}function t9(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;t9(r);let o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;let i=r.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!="string")return;n.includes(s)||n.push(s)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var n9=new Set(["type","properties","required","additionalProperties"]),Q0=["oneOf","anyOf"];function e9(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function sf(e){let t=[];for(let i of e){if(typeof i!="object"||i.type!=="object")return null;for(let s in i)if(!n9.has(s))return null;t.push(i)}let n={},r=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(n,s))continue;let a=[];for(let u of t){let l=u.properties?.[s]??e9(u);l!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(l))||a.push(l))}let c=a.length===1?a[0]:sf(a)??{allOf:a};We(n,s,c)}for(let s of i.required??[])r.add(s)}let o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let a=e9(s);a&&!i.some(c=>JSON.stringify(c)===JSON.stringify(a))&&i.push(a)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function lS(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of n9)if(o in e)return;let n=t.filter(o=>Q0.some(i=>Array.isArray(o[i]))),r=null;if(!n.length)r=sf(t);else{let o=n[0],i=Q0.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let s=t.filter(c=>c!==o),a=o[i].map(c=>sf([...s,c]));if(a.some(c=>!c))return;r={[i]:a}}r&&(delete e.allOf,Ni(e,r))}function On(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){r(d);let p=e.seen.get(d),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Ni(u,h),Ni(u,l),a._zod.parent===d)for(let C in u)C==="$ref"||C==="allOf"||C in l||delete u[C];if(h.$ref&&p.def)for(let C in u)C==="$ref"||C==="allOf"||C in p.def&&JSON.stringify(u[C])===JSON.stringify(p.def[C])&&delete u[C]}let m=a._zod.parent;if(m&&m!==d){r(m);let p=e.seen.get(m);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let h in u)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(u[h])===JSON.stringify(p.def[h])&&delete u[h]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())t9(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);d?d.push(u):a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])lS(u)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Ni(o,n.defId?n.schema:n.def??n.schema);let i=e.metadataRegistry.get(t)?.id;i!==void 0&&o.id===i&&delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,We(s,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:go(t,"input",e.processors),output:go(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function et(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return et(r.element,n);if(r.type==="set")return et(r.valueType,n);if(r.type==="lazy")return et(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return et(r.innerType,n);if(r.type==="intersection")return et(r.left,n)||et(r.right,n);if(r.type==="record"||r.type==="map")return et(r.keyType,n)||et(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:et(r.in,n)||et(r.out,n);if(r.type==="object"){for(let o in r.shape)if(et(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(let o of r.options)if(et(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(et(o,n))return!0;return!!(r.rest&&et(r.rest,n))}return!1}var af=(e,t={})=>n=>{let r=En({...n,processors:t});return ae(e,r),Dn(r,e),On(r,e)},go=(e,t,n={})=>r=>{let{libraryOptions:o,target:i}=r??{},s=En({...o??{},target:i,io:t,processors:n});return ae(e,s),Dn(s,e),On(s,e)};var Co=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ko=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},r9=(e,t)=>{Co(e,"minimum",t),ko(e,"maximum",t)},a9=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},c9=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},u9=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},l9=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},o9=(e,t)=>Co(e,"minimum",t.minimum),i9=(e,t)=>ko(e,"maximum",t.maximum),s9=e=>(t,n)=>{l9(t,n.format);let[r,o]=e[n.format];Co(t,"minimum",r),ko(t,"maximum",o)},dS={greater_than:(e,t)=>Co(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ko(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>a9(e,t.value),number_format:s9(si),bigint_format:s9(ai),min_length:o9,max_length:i9,length_equals:(e,t)=>r9(e,t.length),min_size:o9,max_size:i9,size_equals:(e,t)=>r9(e,t.size),string_format:(e,t)=>{l9(e,t.format),t.pattern&&c9(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>u9(e,t.mime)};function Le(e){let t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let i of r)dS[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Co(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Co(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&ko(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&ko(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&a9(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&u9(t,o.mime);for(let i of o.patterns??[])c9(t,i);return t}var pS={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},fS=new Map([[Fa,md],[xi,hd]]),d9=e=>fS.get(e)??e,lf=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u,laxFormat:l}=Le(e);if(typeof i=="number"&&(o.minLength=i),typeof s=="number"&&(o.maxLength=s),a&&(o.format=pS[a]??a,o.format===""&&delete o.format,(a==="time"||l)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let d=[...c].map(d9);d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},df=(e,t,n,r)=>{let o=n,{minimum:i,maximum:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=Le(e);o.type=l?"integer":"number";let d=typeof u=="number"&&u>=(i??Number.NEGATIVE_INFINITY),m=typeof c=="number"&&c<=(s??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(d?p?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof i=="number"&&(o.minimum=i),m?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof s=="number"&&(o.maximum=s),a){let h=new Set;for(let w of a)Number.isFinite(w)&&w!==0?h.add(Math.abs(w)):Pe(e,t,o,r,`A multipleOf divisor of ${w} cannot be represented in JSON Schema`);let[g,...C]=h;g!==void 0&&(o.multipleOf=g),C.length&&(o.allOf=[...o.allOf??[],...C.map(w=>({multipleOf:w}))])}},pf=(e,t,n,r)=>{n.type="boolean"},ff=(e,t,n,r)=>{Pe(e,t,n,r,"BigInt cannot be represented in JSON Schema")},mf=(e,t,n,r)=>{Pe(e,t,n,r,"Symbols cannot be represented in JSON Schema")},hf=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},gf=(e,t,n,r)=>{Pe(e,t,n,r,"Undefined cannot be represented in JSON Schema")},Cf=(e,t,n,r)=>{Pe(e,t,n,r,"Void cannot be represented in JSON Schema")},kf=(e,t,n,r)=>{n.not={}},yf=(e,t,n,r)=>{},bf=(e,t,n,r)=>{},vf=(e,t,n,r)=>{Pe(e,t,n,r,"Date cannot be represented in JSON Schema")},wf=(e,t,n,r)=>{let o=e._zod.def,i=Hr(o.entries);if(i.length===0){n.not={};return}i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},xf=(e,t,n,r)=>{let o=e._zod.def;if(o.values.length===0){n.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(Pe(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s=="bigint"){if(Pe(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},If=(e,t,n,r)=>{Pe(e,t,n,r,"NaN cannot be represented in JSON Schema")},Sf=(e,t,n,r)=>{let o=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=i.source},_f=(e,t,n,r)=>{let o=n;o.type="string",o.format="binary",o.contentEncoding="binary";let{minimum:i,maximum:s,mime:a}=Le(e);i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),a&&(a.length===0?o.not={}:a.length===1?o.contentMediaType=a[0]:o.anyOf=a.map(c=>({contentMediaType:c})))},Pf=(e,t,n,r)=>{n.type="boolean"},Lf=(e,t,n,r)=>{Pe(e,t,n,r,"Custom types cannot be represented in JSON Schema")},Mf=(e,t,n,r)=>{Pe(e,t,n,r,"Function types cannot be represented in JSON Schema")},Rf=(e,t,n,r)=>{Pe(e,t,n,r,"Transforms cannot be represented in JSON Schema")},Tf=(e,t,n,r)=>{Pe(e,t,n,r,"Map cannot be represented in JSON Schema")},Af=(e,t,n,r)=>{Pe(e,t,n,r,"Set cannot be represented in JSON Schema")},$f=(e,t,n,r)=>{let o=n,i=e._zod.def,{minimum:s,maximum:a}=Le(e);typeof s=="number"&&(o.minItems=s),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=ae(i.element,t,{...r,path:[...r.path,"items"]})};function zi(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?zi(t.out):t.type==="catch"?zi(t.innerType):e._zod.optin}var Ef=(e,t,n,r)=>{let o=n,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&Pe(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in s)We(o.properties,u,ae(s[u],t,{...r,path:[...r.path,"properties",u]}));let c=[];for(let u of Object.keys(s)){let l=i.shape[u];(t.io==="input"?zi(l)===void 0:l._zod.optout===void 0)&&c.push(u)}c.length>0&&(o.required=c),i.catchall?._zod.def.type==="never"?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=ae(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},jc=(e,t,n,r)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((a,c)=>ae(a,t,{...r,path:[...r.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=s:n.anyOf=s},Df=(e,t,n,r)=>{let o=e._zod.def,i=ae(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=ae(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c,t.intersections.push(c)},Of=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((g,C)=>ae(g,t,{...r,path:[...r.path,s,C]})),u=i.rest?ae(i.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null,l=i.items.length;for(;l>0;){let g=i.items[l-1];if(!(t.io==="input"?zi(g)!==void 0:g._zod.optout==="optional"))break;l--}let d=i.items.length,m=!i.rest;t.target==="draft-2020-12"?(o.prefixItems=c,m?o.items=!1:u&&(o.items=u),l>0&&(o.minItems=l),m&&(o.maxItems=d)):t.target==="openapi-3.0"?(o.items={anyOf:c},u&&o.items.anyOf.push(u),l>0&&(o.minItems=l),m&&(o.maxItems=d)):(o.items=c,m?o.additionalItems=!1:u&&(o.additionalItems=u),l>0&&(o.minItems=l),m&&(o.maxItems=d));let{minimum:p,maximum:h}=Le(e);typeof p=="number"&&(o.minItems=p),typeof h=="number"&&(o.maxItems=h)};function cf(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let h=e.get(t)?.def;if(!h)return t;let g=cf(e,h,n);return g===h?t:g}for(let h of["anyOf","oneOf"]){let g=t[h];if(!Array.isArray(g))continue;let C=g.map(w=>cf(e,w,n));C.some((w,y)=>w!==g[y])&&(t={...t,[h]:C})}let r=Array.isArray(t.type)?t.type:[t.type],o=!r.includes("string")&&r.some(h=>h==="number"||h==="integer"),i=t.enum??(t.const!==void 0?[t.const]:void 0);if(!o&&!i?.some(h=>typeof h=="number"))return t;let{minimum:s,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:m,...p}=t;return p.enum?p.enum=p.enum.map(h=>typeof h=="number"?String(h):h):typeof p.const=="number"&&(p.const=String(p.const)),o&&(p.type="string",i||(p.pattern=(r.includes("number")?dn:gi).source)),p}var uf=new WeakMap;function mS(e){let t=new Map;for(let r of e.seen.values())r.def&&!t.has(r.schema)&&t.set(r.schema,r);let n=new Map;for(let r of uf.get(e)??[]){let o=e.seen.get(r),i=(o?.def??o?.schema)?.propertyNames;if(!i||i===!0||n.has(i))continue;let s=cf(t,i,new Set);s!==i&&n.set(i,s)}if(n.size)for(let r of e.seen.values())for(let o of[r.schema,r.def]){let i=o&&n.get(o.propertyNames);i&&(o.propertyNames=i)}}var Nf=(e,t,n,r)=>{let o=n,i=e._zod.def;o.type="object";let s=i.keyType,a=Le(s).patterns;if(i.mode==="loose"&&a&&a.size>0){let l=ae(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});o.patternProperties={};for(let d of a)We(o.patternProperties,d9(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){o.propertyNames=ae(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let l=uf.get(t);l||(l=[],uf.set(t,l),t.deferred.push(()=>mS(t))),l.push(e)}o.additionalProperties=ae(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let c=s._zod.values,u=t.io==="input"&&zi(i.valueType)!==void 0;if(c&&!i.partial&&!u){let l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l.map(String))}},zf=(e,t,n,r)=>{let o=e._zod.def,i=ae(o.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},jf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Zf=Symbol();function p9(e,t,n,r,o){let i=!1,s=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(i=!0,null));return i?(Pe(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Zf):JSON.parse(s)}var Wf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s=p9(o.defaultValue,e,t,n,r);s!==Zf&&(n.default=s)},Vf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=p9(o.defaultValue,e,t,n,r);s!==Zf&&(n._prefault=s)},Hf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{Pe(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=s},Ff=(e,t,n,r)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;ae(s,t,r);let a=t.seen.get(e);a.ref=s},Bf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType,n.readOnly=!0},Uf=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Zc=(e,t,n,r)=>{let o=e._zod.def;ae(o.innerType,t,r);let i=t.seen.get(e);i.ref=o.innerType},Kf=(e,t,n,r)=>{let o=e._zod.innerType;ae(o,t,r);let i=t.seen.get(e);i.ref=o},zc={string:lf,number:df,boolean:pf,bigint:ff,symbol:mf,null:hf,undefined:gf,void:Cf,never:kf,any:yf,unknown:bf,date:vf,enum:wf,literal:xf,nan:If,template_literal:Sf,file:_f,success:Pf,custom:Lf,function:Mf,transform:Rf,map:Tf,set:Af,array:$f,object:Ef,union:jc,intersection:Df,tuple:Of,record:Nf,nullable:zf,nonoptional:jf,default:Wf,prefault:Vf,catch:Hf,pipe:Ff,readonly:Bf,promise:Uf,optional:Zc,lazy:Kf};function Wc(e,t){if("_idmap"in e){let r=e,o=En({...t,processors:zc}),i={};for(let c of r._idmap.entries()){let[u,l]=c;ae(l,o)}let s={},a={registry:r,uri:t?.uri,defs:i};o.external=a;for(let c of r._idmap.entries()){let[u,l]=c;Dn(o,l),We(s,u,On(o,l))}if(Object.keys(i).length>0){let c=o.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i}}return{schemas:s}}let n=En({...t,processors:zc});return ae(e,n),Dn(n,e),On(n,e)}var Vc=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=En({processors:zc,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return ae(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,Dn(this.ctx,t);let r=On(this.ctx,t),{"~standard":o,...i}=r;return i}};var f9={};var _o={};Nt(_o,{ZodAny:()=>h2,ZodArray:()=>y2,ZodBase64:()=>au,ZodBase64URL:()=>cu,ZodBigInt:()=>Io,ZodBigIntFormat:()=>du,ZodBoolean:()=>xo,ZodCIDRv4:()=>iu,ZodCIDRv6:()=>su,ZodCUID:()=>Xc,ZodCUID2:()=>Qc,ZodCatch:()=>Z2,ZodCodec:()=>Gi,ZodCreditCard:()=>a2,ZodCustom:()=>qi,ZodCustomStringFormat:()=>wr,ZodDate:()=>Vi,ZodDefault:()=>E2,ZodDiscriminatedUnion:()=>v2,ZodE164:()=>uu,ZodEmail:()=>Gc,ZodEmoji:()=>Yc,ZodEnum:()=>bo,ZodExactOptional:()=>hu,ZodFile:()=>R2,ZodFunction:()=>Y2,ZodGUID:()=>qc,ZodIBAN:()=>c2,ZodIPv4:()=>ru,ZodIPv6:()=>ou,ZodISODate:()=>zn,ZodISODateTime:()=>Nn,ZodISODuration:()=>Zn,ZodISOTime:()=>jn,ZodInstanceOf:()=>Q2,ZodIntersection:()=>w2,ZodJWT:()=>lu,ZodKSUID:()=>nu,ZodLazy:()=>K2,ZodLiteral:()=>M2,ZodMAC:()=>s2,ZodMap:()=>P2,ZodNaN:()=>V2,ZodNanoID:()=>Jc,ZodNever:()=>C2,ZodNonOptional:()=>gu,ZodNull:()=>f2,ZodNullable:()=>$2,ZodNumber:()=>wo,ZodNumberFormat:()=>xr,ZodObject:()=>Fi,ZodOptional:()=>Ui,ZodPipe:()=>Ki,ZodPrefault:()=>O2,ZodPreprocess:()=>H2,ZodPromise:()=>q2,ZodReadonly:()=>F2,ZodRecord:()=>yo,ZodSet:()=>L2,ZodString:()=>vo,ZodStringFormat:()=>le,ZodSuccess:()=>j2,ZodSymbol:()=>d2,ZodTemplateLiteral:()=>U2,ZodTransform:()=>T2,ZodTuple:()=>I2,ZodType:()=>q,ZodULID:()=>eu,ZodURL:()=>Wi,ZodUUID:()=>en,ZodUndefined:()=>p2,ZodUnion:()=>Bi,ZodUnknown:()=>g2,ZodVoid:()=>k2,ZodXID:()=>tu,ZodXor:()=>b2,_ZodString:()=>Kc,_default:()=>D2,_function:()=>Sg,any:()=>ng,array:()=>Hi,base64:()=>O9,base64url:()=>N9,bigint:()=>J9,boolean:()=>l2,catch:()=>W2,check:()=>_g,cidrv4:()=>E9,cidrv6:()=>D9,codec:()=>vg,creditCard:()=>j9,cuid:()=>_9,cuid2:()=>P9,currencyCode:()=>B9,custom:()=>Pg,date:()=>og,describe:()=>Lg,discriminatedUnion:()=>lg,e164:()=>z9,email:()=>g9,emoji:()=>I9,enum:()=>fu,exactOptional:()=>A2,file:()=>Cg,float32:()=>K9,float64:()=>G9,function:()=>Sg,guid:()=>C9,hash:()=>U9,hex:()=>F9,hostname:()=>H9,httpUrl:()=>x9,iban:()=>Z9,instanceof:()=>Rg,int:()=>Bc,int32:()=>q9,int64:()=>X9,intersection:()=>x2,invertCodec:()=>wg,ipv4:()=>T9,ipv6:()=>$9,json:()=>Ag,jwt:()=>W9,keyof:()=>ig,ksuid:()=>R9,lazy:()=>G2,literal:()=>gg,looseObject:()=>cg,looseRecord:()=>pg,mac:()=>A9,map:()=>fg,meta:()=>Mg,nan:()=>bg,nanoid:()=>S9,nativeEnum:()=>hg,never:()=>pu,nonoptional:()=>z2,null:()=>m2,nullable:()=>Zi,nullish:()=>kg,number:()=>u2,object:()=>sg,optional:()=>br,partialRecord:()=>dg,pipe:()=>Uc,prefault:()=>N2,preprocess:()=>$g,promise:()=>Ig,readonly:()=>B2,record:()=>_2,refine:()=>J2,set:()=>mg,strictObject:()=>ag,string:()=>ji,stringFormat:()=>V9,stringbool:()=>Tg,success:()=>yg,superRefine:()=>X2,symbol:()=>eg,templateLiteral:()=>xg,transform:()=>mu,tuple:()=>S2,uint32:()=>Y9,uint64:()=>Q9,ulid:()=>L9,undefined:()=>tg,union:()=>So,unknown:()=>yr,url:()=>w9,uuid:()=>k9,uuidv4:()=>y9,uuidv6:()=>b9,uuidv7:()=>v9,void:()=>rg,xid:()=>M9,xor:()=>ug});var Hc={};Nt(Hc,{endsWith:()=>ao,gt:()=>Xt,gte:()=>kt,includes:()=>io,length:()=>Cr,lowercase:()=>ro,lt:()=>Jt,lte:()=>Ct,maxLength:()=>gr,maxSize:()=>$n,mime:()=>uo,minLength:()=>pn,minSize:()=>Qt,multipleOf:()=>An,negative:()=>Ec,nonnegative:()=>Oc,nonpositive:()=>Dc,normalize:()=>lo,overwrite:()=>Vt,positive:()=>$c,properties:()=>co,property:()=>Nc,regex:()=>no,size:()=>hr,slugify:()=>ho,startsWith:()=>so,toLowerCase:()=>fo,toUpperCase:()=>mo,trim:()=>po,uppercase:()=>oo});var m9=new WeakSet([Object.prototype,Error.prototype]);function Fc(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var h9=(e,t)=>{Gl.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);m9.has(n)||(m9.add(n),Fc(n,"format",r=>o=>pi(r,o)),Fc(n,"flatten",r=>o=>di(r,o)),Fc(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,Fr,2)}),Fc(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,Fr,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},gS=k("ZodError",h9),ft=k("ZodError",h9,void 0,{Parent:Error});var Gf=Gr(ft),qf=qr(ft),Yf=Yr(ft),Jf=Jr(ft),Xf=va(ft),Qf=wa(ft),e2=xa(ft),t2=Ia(ft),n2=Sa(ft),r2=_a(ft),o2=Pa(ft),i2=La(ft);function kS(){Ee.localeError||ke(sc())}function vr(){Ee.memoizer||ke({memoizer:Ri()})}var q=k("ZodType",(e,t)=>(kS(),G.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(j.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return ie(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(J2(e,t))},superRefine(e,t){return this.check(X2(e,t))},overwrite(e){return this.check(Vt(e))},optional(){return br(this)},exactOptional(){return A2(this)},nullable(){return Zi(this)},nullish(){return br(Zi(this))},nonoptional(e){return z2(this,e)},array(){return Hi(this)},or(e){return So([this,e])},and(e){return x2(this,e)},transform(e){return Uc(this,mu(e))},default(e){return D2(this,e)},prefault(e){return N2(this,e)},catch(e){return W2(this,e)},pipe(e){return Uc(this,e)},readonly(){return B2(this)},describe(e){let t=this.clone();return Ve.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ve.get(this);let t=this.clone();return Ve.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return j.hide(this,"~standard",{...ja(this),jsonSchema:{input:go(this,"input"),output:go(this,"output")}})},set"~standard"(e){j.own(this,"~standard",e)},parse:function e(t,n){return Gf(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await qf(this,t,n,{callee:e})},safeParse(e,t){return Yf(this,e,t)},async safeParseAsync(e,t){return Jf(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){j.own(this,"spa",e)},validate(e,t){return fi(this,e,t)},validateAsync(e,t){return mi(this,e,t)},encode:function e(t,n){return Xf(this,t,n,{callee:e})},decode:function e(t,n){return Qf(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await e2(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await t2(this,t,n,{callee:e})},safeEncode(e,t){return n2(this,e,t)},safeDecode(e,t){return r2(this,e,t)},async safeEncodeAsync(e,t){return o2(this,e,t)},async safeDecodeAsync(e,t){return i2(this,e,t)},toJSONSchema(e){return af(this,{})(e)},get description(){return Ve.get(this)?.description},get _def(){return this._zod.def}}),Kc=k("_ZodString",(e,t)=>{lr.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lf(e,n,r,o)},j.derived({format:e=>Le(e).format??null,minLength:e=>Le(e).minimum??null,maxLength:e=>Le(e).maximum??null},{regex(...e){return this.check(no(...e))},includes(...e){return this.check(io(...e))},startsWith(...e){return this.check(so(...e))},endsWith(...e){return this.check(ao(...e))},min(...e){return this.check(pn(...e))},max(...e){return this.check(gr(...e))},length(...e){return this.check(Cr(...e))},nonempty(...e){return this.check(pn(1,...e))},lowercase(e){return this.check(ro(e))},uppercase(e){return this.check(oo(e))},trim(){return this.check(po())},normalize(...e){return this.check(lo(...e))},toLowerCase(){return this.check(fo())},toUpperCase(){return this.check(mo())},slugify(){return this.check(ho())}})),vo=k("ZodString",(e,t)=>{lr.init(e,t),Kc.init(e,t)},{email(e){return this.check(pc(Gc,e))},url(e){return this.check(Ai(Wi,e))},jwt(e){return this.check(Ac(lu,e))},emoji(e){return this.check(kc(Yc,e))},guid(e){return this.check(fc(qc,e))},uuid(e){return this.check(mc(en,e))},uuidv4(e){return this.check(hc(en,e))},uuidv6(e){return this.check(gc(en,e))},uuidv7(e){return this.check(Cc(en,e))},nanoid(e){return this.check(yc(Jc,e))},cuid(e){return this.check(bc(Xc,e))},cuid2(e){return this.check(vc(Qc,e))},ulid(e){return this.check(wc(eu,e))},base64(e){return this.check(Mc(au,e))},base64url(e){return this.check(Rc(cu,e))},xid(e){return this.check(xc(tu,e))},ksuid(e){return this.check(Ic(nu,e))},ipv4(e){return this.check(Sc(ru,e))},ipv6(e){return this.check(_c(ou,e))},cidrv4(e){return this.check(Pc(iu,e))},cidrv6(e){return this.check(Lc(su,e))},e164(e){return this.check(Tc(uu,e))},datetime(e){return this.check($i(Nn,e))},date(e){return this.check(Ei(zn,e))},time(e){return this.check(Di(jn,e))},duration(e){return this.check(Oi(Zn,e))}});function ji(e){return wp(vo,e)}var le=k("ZodStringFormat",(e,t)=>{se.init(e,t),Kc.init(e,t)}),Nn=k("ZodISODateTime",(e,t)=>{m1.init(e,t),le.init(e,t)}),zn=k("ZodISODate",(e,t)=>{h1.init(e,t),le.init(e,t)}),jn=k("ZodISOTime",(e,t)=>{g1.init(e,t),le.init(e,t)}),Zn=k("ZodISODuration",(e,t)=>{C1.init(e,t),le.init(e,t)}),Gc=k("ZodEmail",(e,t)=>{r1.init(e,t),le.init(e,t)});function g9(e){return pc(Gc,e)}var qc=k("ZodGUID",(e,t)=>{t1.init(e,t),le.init(e,t)});function C9(e){return fc(qc,e)}var en=k("ZodUUID",(e,t)=>{n1.init(e,t),le.init(e,t)});function k9(e){return mc(en,e)}function y9(e){return hc(en,e)}function b9(e){return gc(en,e)}function v9(e){return Cc(en,e)}var Wi=k("ZodURL",(e,t)=>{s1.init(e,t),le.init(e,t)});function w9(e){return Ai(Wi,e)}function x9(e){return Ai(Wi,{protocol:hi,hostname:Cd,...j.normalizeParams(e)})}var Yc=k("ZodEmoji",(e,t)=>{a1.init(e,t),le.init(e,t)});function I9(e){return kc(Yc,e)}var Jc=k("ZodNanoID",(e,t)=>{c1.init(e,t),le.init(e,t)});function S9(e){return yc(Jc,e)}var Xc=k("ZodCUID",(e,t)=>{u1.init(e,t),le.init(e,t)});function _9(e){return bc(Xc,e)}var Qc=k("ZodCUID2",(e,t)=>{l1.init(e,t),le.init(e,t)});function P9(e){return vc(Qc,e)}var eu=k("ZodULID",(e,t)=>{d1.init(e,t),le.init(e,t)});function L9(e){return wc(eu,e)}var tu=k("ZodXID",(e,t)=>{p1.init(e,t),le.init(e,t)});function M9(e){return xc(tu,e)}var nu=k("ZodKSUID",(e,t)=>{f1.init(e,t),le.init(e,t)});function R9(e){return Ic(nu,e)}var ru=k("ZodIPv4",(e,t)=>{k1.init(e,t),le.init(e,t)});function T9(e){return Sc(ru,e)}var s2=k("ZodMAC",(e,t)=>{b1.init(e,t),le.init(e,t)});function A9(e){return Ip(s2,e)}var ou=k("ZodIPv6",(e,t)=>{y1.init(e,t),le.init(e,t)});function $9(e){return _c(ou,e)}var iu=k("ZodCIDRv4",(e,t)=>{v1.init(e,t),le.init(e,t)});function E9(e){return Pc(iu,e)}var su=k("ZodCIDRv6",(e,t)=>{w1.init(e,t),le.init(e,t)});function D9(e){return Lc(su,e)}var au=k("ZodBase64",(e,t)=>{x1.init(e,t),le.init(e,t)});function O9(e){return Mc(au,e)}var cu=k("ZodBase64URL",(e,t)=>{I1.init(e,t),le.init(e,t)});function N9(e){return Rc(cu,e)}var uu=k("ZodE164",(e,t)=>{S1.init(e,t),le.init(e,t)});function z9(e){return Tc(uu,e)}var a2=k("ZodCreditCard",(e,t)=>{_1.init(e,t),le.init(e,t)});function j9(e){return Sp(a2,e)}var c2=k("ZodIBAN",(e,t)=>{P1.init(e,t),le.init(e,t)});function Z9(e){return _p(c2,e)}var lu=k("ZodJWT",(e,t)=>{L1.init(e,t),le.init(e,t)});function W9(e){return Ac(lu,e)}var wr=k("ZodCustomStringFormat",(e,t)=>{M1.init(e,t),le.init(e,t)});function V9(e,t,n={}){return kr(wr,e,t,n)}function H9(e){return kr(wr,"hostname",gd,e)}function F9(e){return kr(wr,"hex",Td,e)}function B9(e){return kr(wr,"currency_code",yd,e)}function U9(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,o=Mt[r];if(!o)throw new Error(`Unrecognized hash format: ${r}`);return kr(wr,r,o,t)}var wo=k("ZodNumber",(e,t)=>{qa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>df(e,n,r,o),e.isFinite=!0},j.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Le(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Le(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=Le(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Le(e).format??null},{gt(e,t){return this.check(Xt(e,t))},gte(e,t){return this.check(kt(e,t))},min(e,t){return this.check(kt(e,t))},lt(e,t){return this.check(Jt(e,t))},lte(e,t){return this.check(Ct(e,t))},max(e,t){return this.check(Ct(e,t))},int(e){return this.check(Bc(e))},safe(e){return this.check(Bc(e))},positive(e){return this.check(Xt(0,e))},nonnegative(e){return this.check(kt(0,e))},negative(e){return this.check(Jt(0,e))},nonpositive(e){return this.check(Ct(0,e))},multipleOf(e,t){return this.check(An(e,t))},step(e,t){return this.check(An(e,t))},finite(){return this}}));function u2(e){return Lp(wo,e)}var xr=k("ZodNumberFormat",(e,t)=>{R1.init(e,t),wo.init(e,t)});function Bc(e){return Rp(xr,e)}function K9(e){return Tp(xr,e)}function G9(e){return Ap(xr,e)}function q9(e){return $p(xr,e)}function Y9(e){return Ep(xr,e)}var xo=k("ZodBoolean",(e,t)=>{Ii.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pf(e,n,r,o)});function l2(e){return Dp(xo,e)}var Io=k("ZodBigInt",(e,t)=>{Ya.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ff(e,n,r,o)},j.derived({minValue:e=>Le(e).minimum??null,maxValue:e=>Le(e).maximum??null,format:e=>Le(e).format??null},{gte(e,t){return this.check(kt(e,t))},min(e,t){return this.check(kt(e,t))},gt(e,t){return this.check(Xt(e,t))},lt(e,t){return this.check(Jt(e,t))},lte(e,t){return this.check(Ct(e,t))},max(e,t){return this.check(Ct(e,t))},positive(e){return this.check(Xt(BigInt(0),e))},negative(e){return this.check(Jt(BigInt(0),e))},nonpositive(e){return this.check(Ct(BigInt(0),e))},nonnegative(e){return this.check(kt(BigInt(0),e))},multipleOf(e,t){return this.check(An(e,t))}}));function J9(e){return Np(Io,e)}var du=k("ZodBigIntFormat",(e,t)=>{T1.init(e,t),Io.init(e,t)});function X9(e){return jp(du,e)}function Q9(e){return Zp(du,e)}var d2=k("ZodSymbol",(e,t)=>{A1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mf(e,n,r,o)});function eg(e){return Wp(d2,e)}var p2=k("ZodUndefined",(e,t)=>{$1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gf(e,n,r,o)});function tg(e){return Vp(p2,e)}var f2=k("ZodNull",(e,t)=>{E1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hf(e,n,r,o)});function m2(e){return Hp(f2,e)}var h2=k("ZodAny",(e,t)=>{D1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yf(e,n,r,o)});function ng(){return Fp(h2)}var g2=k("ZodUnknown",(e,t)=>{O1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bf(e,n,r,o)});function yr(){return Bp(g2)}var C2=k("ZodNever",(e,t)=>{N1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kf(e,n,r,o)});function pu(e){return Up(C2,e)}var k2=k("ZodVoid",(e,t)=>{z1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Cf(e,n,r,o)});function rg(e){return Kp(k2,e)}var Vi=k("ZodDate",(e,t)=>{j1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vf(e,n,r,o),e.min=(n,r)=>e.check(kt(n,r)),e.max=(n,r)=>e.check(Ct(n,r))},j.derived({minDate:e=>{let{minimum:t}=Le(e);return t?new Date(t):null},maxDate:e=>{let{maximum:t}=Le(e);return t?new Date(t):null}},{}));function og(e){return Gp(Vi,e)}var y2=k("ZodArray",(e,t)=>{vr(),Z1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$f(e,n,r,o),e.element=t.element},{min(e,t){return this.check(pn(e,t))},nonempty(e){return this.check(pn(1,e))},max(e,t){return this.check(gr(e,t))},length(e,t){return this.check(Cr(e,t))},unwrap(){return this.element}});function Hi(e,t){return Jp(y2,e,t)}function ig(e){let t=e._zod.def.shape;return fu(Object.keys(t))}var Fi=k("ZodObject",(e,t)=>{vr(),W1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ef(e,n,r,o),j.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return fu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(j.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(j.mergeDefs(this._zod.def,{catchall:yr()}))},loose(){return this.clone(j.mergeDefs(this._zod.def,{catchall:yr()}))},strict(){return this.clone(j.mergeDefs(this._zod.def,{catchall:pu()}))},strip(){return this.clone(j.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return j.extend(this,e)},safeExtend(e){return j.safeExtend(this,e)},merge(e){return j.merge(this,e)},pick(e){return j.pick(this,e)},omit(e){return j.omit(this,e)},partial(...e){return j.partial(Ui,this,e[0])},exactPartial(...e){return j.partial(hu,this,e[0],"exactPartial")},required(...e){return j.required(gu,this,e[0])}});function sg(e,t){let n={type:"object",shape:e??{},...j.normalizeParams(t)};return new Fi(n)}function ag(e,t){return new Fi({type:"object",shape:e,catchall:pu(),...j.normalizeParams(t)})}function cg(e,t){return new Fi({type:"object",shape:e,catchall:yr(),...j.normalizeParams(t)})}var Bi=k("ZodUnion",(e,t)=>{Si.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jc(e,n,r,o),e.options=t.options});function So(e,t){return new Bi({type:"union",options:e,...j.normalizeParams(t)})}var b2=k("ZodXor",(e,t)=>{Bi.init(e,t),V1.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jc(e,n,r,o),e.options=t.options});function ug(e,t){return new b2({type:"union",options:e,inclusive:!1,...j.normalizeParams(t)})}var v2=k("ZodDiscriminatedUnion",(e,t)=>{Bi.init(e,t),F1.init(e,t)});function lg(e,t,n){return new v2({type:"union",options:t,discriminator:e,...j.normalizeParams(n)})}var w2=k("ZodIntersection",(e,t)=>{B1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Df(e,n,r,o)});function x2(e,t){return new w2({type:"intersection",left:e,right:t})}var I2=k("ZodTuple",(e,t)=>{vr(),Ja.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Of(e,n,r,o)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new Ui({type:"optional",innerType:t}))})}});function S2(e,t,n){let r=t instanceof G,o=r?n:t,i=r?t:null;return new I2({type:"tuple",items:e,rest:i,...j.normalizeParams(o)})}var yo=k("ZodRecord",(e,t)=>{vr(),U1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Nf(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType});function _2(e,t,n){return!t||!t._zod?new yo({type:"record",keyType:ji(),valueType:e,...j.normalizeParams(t)}):new yo({type:"record",keyType:e,valueType:t,...j.normalizeParams(n)})}function dg(e,t,n){return new yo({type:"record",keyType:e,valueType:t,...j.normalizeParams(n),partial:!0})}function pg(e,t,n){return new yo({type:"record",keyType:e,valueType:t,mode:"loose",...j.normalizeParams(n)})}var P2=k("ZodMap",(e,t)=>{vr(),K1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Tf(e,n,r,o),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Qt(...n)),e.nonempty=n=>e.check(Qt(1,n)),e.max=(...n)=>e.check($n(...n)),e.size=(...n)=>e.check(hr(...n))});function fg(e,t,n){return new P2({type:"map",keyType:e,valueType:t,...j.normalizeParams(n)})}var L2=k("ZodSet",(e,t)=>{vr(),G1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Af(e,n,r,o),e.min=(...n)=>e.check(Qt(...n)),e.nonempty=n=>e.check(Qt(1,n)),e.max=(...n)=>e.check($n(...n)),e.size=(...n)=>e.check(hr(...n))});function mg(e,t){return new L2({type:"set",valueType:e,...j.normalizeParams(t)})}var bo=k("ZodEnum",(e,t)=>{q1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(r,o,i)=>wf(e,r,o,i),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let i={};for(let s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new bo({...t,checks:[],...j.normalizeParams(o),entries:i})},e.exclude=(r,o)=>{let i={...t.entries};for(let s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new bo({...t,checks:[],...j.normalizeParams(o),entries:i})}});function fu(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new bo({type:"enum",entries:n,...j.normalizeParams(t)})}function hg(e,t){return new bo({type:"enum",entries:e,...j.normalizeParams(t)})}var M2=k("ZodLiteral",(e,t)=>{Y1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xf(e,n,r,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function gg(e,t){return new M2({type:"literal",values:Array.isArray(e)?e:[e],...j.normalizeParams(t)})}var R2=k("ZodFile",(e,t)=>{J1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_f(e,n,r,o),e.min=(n,r)=>e.check(Qt(n,r)),e.max=(n,r)=>e.check($n(n,r)),e.mime=(n,r)=>e.check(uo(Array.isArray(n)?n:[n],r))});function Cg(e){return Xp(R2,e)}var T2=k("ZodTransform",(e,t)=>{vr(),X1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Rf(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Tn(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(j.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=n.value),s.inst??(s.inst=e),n.issues.push(j.issue(s))}};let o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function mu(e){return new T2({type:"transform",transform:e})}var Ui=k("ZodOptional",(e,t)=>{Xa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function br(e){return new Ui({type:"optional",innerType:e})}var hu=k("ZodExactOptional",(e,t)=>{Q1.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zc(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function A2(e){return new hu({type:"optional",innerType:e})}var $2=k("ZodNullable",(e,t)=>{ep.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>zf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Zi(e){return new $2({type:"nullable",innerType:e})}function kg(e){return br(Zi(e))}var E2=k("ZodDefault",(e,t)=>{tp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Wf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function D2(e,t){return new E2({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():j.shallowClone(t)}})}var O2=k("ZodPrefault",(e,t)=>{np.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Vf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function N2(e,t){return new O2({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():j.shallowClone(t)}})}var gu=k("ZodNonOptional",(e,t)=>{rp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function z2(e,t){return new gu({type:"nonoptional",innerType:e,...j.normalizeParams(t)})}var j2=k("ZodSuccess",(e,t)=>{op.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Pf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function yg(e){return new j2({type:"success",innerType:e})}var Z2=k("ZodCatch",(e,t)=>{ip.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function W2(e,t){return new Z2({type:"catch",innerType:e,catchValue:typeof t=="function"?t:j.constantCatch(t)})}var V2=k("ZodNaN",(e,t)=>{sp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>If(e,n,r,o)});function bg(e){return Yp(V2,e)}var Ki=k("ZodPipe",(e,t)=>{Qa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ff(e,n,r,o),e.in=t.in,e.out=t.out});function Uc(e,t){return new Ki({type:"pipe",in:e,out:t})}var Gi=k("ZodCodec",(e,t)=>{Ki.init(e,t),_i.init(e,t)});function vg(e,t,n){return new Gi({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function wg(e){let t=e._zod.def;return new Gi({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}var H2=k("ZodPreprocess",(e,t)=>{Ki.init(e,t),ap.init(e,t)}),F2=k("ZodReadonly",(e,t)=>{cp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function B2(e){return new F2({type:"readonly",innerType:e})}var U2=k("ZodTemplateLiteral",(e,t)=>{up.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Sf(e,n,r,o)});function xg(e,t){return new U2({type:"template_literal",parts:e,...j.normalizeParams(t)})}var K2=k("ZodLazy",(e,t)=>{Pi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Kf(e,n,r,o),e.unwrap=()=>e._zod.def.getter()});function G2(e){return new K2({type:"lazy",getter:e})}var q2=k("ZodPromise",(e,t)=>{dp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Uf(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ig(e){return new q2({type:"promise",innerType:e})}var Y2=k("ZodFunction",(e,t)=>{lp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mf(e,n,r,o)});function Sg(e){return new Y2({type:"function",input:Array.isArray(e?.input)?S2(e?.input):e?.input??Hi(yr()),output:e?.output??yr()})}var qi=k("ZodCustom",(e,t)=>{pp.init(e,t),q.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Lf(e,n,r,o)});function _g(e){let t=new de({check:"custom"});return t._zod.check=e,t}function Pg(e,t){return Qp(qi,e??(()=>!0),t)}function J2(e,t={}){return ef(qi,e,t)}function X2(e,t){return tf(e,t)}var Lg=nf,Mg=rf,Q2=k("ZodInstanceOf",(e,t)=>{qi.init(e,t)},{properties(e,t){return this.check(co(e,t))}});function Rg(e,t={}){let n=new Q2({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...j.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Tg=(...e)=>of({Codec:Gi,Boolean:xo,String:vo},...e);function Ag(e){let t=G2(()=>So([ji(e),u2(),l2(),m2(),Hi(t),_2(ji(),t)]));return t}function $g(e,t){return new H2({type:"pipe",in:mu(e),out:t})}var yS={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function bS(e){ke({customError:e})}function vS(){return ke().customError}var em;em||(em={});var Yi={};Nt(Yi,{ZodISODate:()=>zn,ZodISODateTime:()=>Nn,ZodISODuration:()=>Zn,ZodISOTime:()=>jn,date:()=>xS,datetime:()=>wS,duration:()=>SS,time:()=>IS});function wS(e){return $i(Nn,e)}function xS(e){return Ei(zn,e)}function IS(e){return Di(jn,e)}function SS(e){return Oi(Zn,e)}var O={..._o,...Hc,iso:Yi},_S=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function PS(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function Eg(e,t){return e.map((n,r)=>r<t?n:n.optional())}function LS(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function MS(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===r){let o=n[1]===void 0?void 0:LS(n[1]);if(!o||!t.defs[o])throw new Error(`Reference not found: ${e}`);return t.defs[o]}throw new Error(`Reference not found: ${e}`)}function RS(e,t){return O.transform(r=>r).check(r=>{let o=r.value;if(typeof o!="object"||o===null||Array.isArray(o))return;let i=Object.getOwnPropertyNames(o);if(t.minProperties!==void 0&&i.length<t.minProperties&&r.issues.push({origin:"object",code:"too_small",minimum:t.minProperties,inclusive:!0,message:`Too small: expected object to have >=${t.minProperties} properties`,input:o,inst:e,continue:!0}),t.maxProperties!==void 0&&i.length>t.maxProperties&&r.issues.push({origin:"object",code:"too_big",maximum:t.maxProperties,inclusive:!0,message:`Too big: expected object to have <=${t.maxProperties} properties`,input:o,inst:e,continue:!0}),t.keySchema)for(let s of i){let a=t.keySchema.safeParse(s);a.success||r.issues.push({code:"invalid_key",origin:"record",issues:a.error.issues,input:s,path:[s],continue:!0})}}).pipe(e)}function tm(e,t){if(e===null)return"z";let n=typeof e;if(n!=="object"){if(n==="number"&&Number.isNaN(e))return null;let r=String(e);return`${n[0]}${r.length}:${r}`}if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let i=[];for(let s of e){let a=tm(s,t);if(a===null)return null;i.push(a)}return`a${i.length}:[${i.join(",")}]`}let r=Object.keys(e).sort(),o=[];for(let i of r){let s=tm(e[i],t);if(s===null)return null;o.push(`${i.length}:${i}=${s}`)}return`o${o.length}:{${o.join(",")}}`}finally{t.delete(e)}}var TS=new Set(["items","prefixItems","additionalItems","additionalProperties","contains","propertyNames","not","if","then","else","allOf","anyOf","oneOf","unevaluatedItems","unevaluatedProperties","contentSchema"]),AS=new Set(["properties","patternProperties","dependentSchemas","dependencies","$defs","definitions"]);function Ji(e){return typeof e!="object"||e===null?!1:Array.isArray(e)?e.some(Ji):typeof e.$ref=="string"?!0:Object.entries(e).some(([t,n])=>TS.has(t)?Ji(n):!AS.has(t)||typeof n!="object"||n===null?!1:Object.values(n).some(Ji))}function Dg(e){return e===1?"element":"elements"}function $S(e,t){return O.transform(r=>r).check(r=>{let o=r.value;if(Array.isArray(o)){if(t.uniqueItems===!0){let i=new Map;for(let s=0;s<o.length;s++){let a=tm(o[s],new Set);if(a===null)continue;let c=i.get(a);if(c===void 0){i.set(a,s);continue}r.issues.push({code:"custom",message:`Array items must be unique: element at index ${s} duplicates the one at index ${c}`,input:o,path:[s],continue:!0})}}if(t.containsSchema){let i=t.minContains??1,s=t.maxContains!==void 0?t.maxContains+1:Number.POSITIVE_INFINITY,a=0;for(let c of o)if(t.containsSchema.safeParse(c).success&&++a>=s)break;a<i&&r.issues.push({code:"custom",message:`Array must contain at least ${i} matching ${Dg(i)}; found ${a}`,input:o,continue:!0}),t.maxContains!==void 0&&a>t.maxContains&&r.issues.push({code:"custom",message:`Array must contain at most ${t.maxContains} matching ${Dg(t.maxContains)}`,input:o,continue:!0})}}}).pipe(e)}function Og(e,t){if(e!==!1)return e===void 0||e===!0?O.any():tt(e,t)}var ES=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;function Ng(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return O.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let o=e.$ref;if(t.refs.has(o))return t.refs.get(o);if(t.processing.has(o))return O.lazy(()=>{if(!t.refs.has(o))throw new Error(`Circular reference not resolved: ${o}`);return t.refs.get(o)});t.processing.add(o);let i=MS(o,t),s=tt(i,t);return t.refs.set(o,s),t.processing.delete(o),s}if(e.enum!==void 0){let o=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&o.length===1&&o[0]===null)return O.null();if(o.length===0)return O.never();if(o.length===1)return O.literal(o[0]);if(o.every(s=>typeof s=="string"))return O.enum(o);let i=o.map(s=>O.literal(s));return i.length<2?i[0]:O.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return O.literal(e.const);let n=e.type;if(Array.isArray(n)){let o=n.map(i=>{let s={...e,type:i};return Ng(s,t)});return o.length===0?O.never():o.length===1?o[0]:O.union(o)}if(!n)return O.any();let r;switch(n){case"string":{let o=O.string();if(e.format){let i=e.format;i==="email"?o=o.check(O.email()):i==="uri"||i==="uri-reference"?o=o.check(O.url()):i==="uuid"||i==="guid"?o=o.check(O.uuid()):i==="date-time"?o=o.check(O.iso.datetime({offset:!0})):i==="date"?o=o.check(O.iso.date()):i==="time"?o=o.check(O.regex(ES)):i==="duration"?o=o.check(O.iso.duration()):i==="hostname"?o=o.check(O.hostname()):i==="ipv4"?o=o.check(O.ipv4()):i==="ipv6"?o=o.check(O.ipv6()):i==="mac"?o=o.check(O.mac()):i==="cidr"?o=o.check(O.cidrv4()):i==="cidr-v6"?o=o.check(O.cidrv6()):i==="base64"?o=o.check(O.base64()):i==="base64url"?o=o.check(O.base64url()):i==="e164"?o=o.check(O.e164()):i==="credit_card"?o=o.check(O.creditCard()):i==="iban"?o=o.check(O.iban()):i==="jwt"?o=o.check(O.jwt()):i==="emoji"?o=o.check(O.emoji()):i==="nanoid"?o=o.check(O.nanoid()):i==="cuid"?o=o.check(O.cuid()):i==="cuid2"?o=o.check(O.cuid2()):i==="ulid"?o=o.check(O.ulid()):i==="xid"?o=o.check(O.xid()):i==="ksuid"&&(o=o.check(O.ksuid()))}typeof e.minLength=="number"&&(o=o.min(e.minLength)),typeof e.maxLength=="number"&&(o=o.max(e.maxLength)),e.pattern&&(o=o.regex(new RegExp(e.pattern))),r=o;break}case"number":case"integer":{let o=n==="integer"?O.number().int():O.number();typeof e.minimum=="number"&&e.exclusiveMinimum!==!0&&(o=o.min(e.minimum)),typeof e.maximum=="number"&&e.exclusiveMaximum!==!0&&(o=o.max(e.maximum)),typeof e.exclusiveMinimum=="number"?o=o.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(o=o.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?o=o.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(o=o.lt(e.maximum)),typeof e.multipleOf=="number"&&(o=o.multipleOf(e.multipleOf)),r=o;break}case"boolean":{r=O.boolean();break}case"null":{r=O.null();break}case"object":{let o={},i=e.properties||{},s=new Set(e.required||[]),a=typeof e.additionalProperties=="object"?tt(e.additionalProperties,t):void 0;for(let[d,m]of Object.entries(i)){let p=tt(m,t);We(o,d,s.has(d)?p:p.optional())}if(e.patternProperties){let d=e.patternProperties,m=Object.keys(d),p=[];for(let g of m){let C=tt(d[g],t),w=O.string().regex(new RegExp(g));p.push(O.looseRecord(w,C))}let h=[];if(Object.keys(o).length>0&&h.push(O.object(o).passthrough()),h.push(...p),h.length===0)r=O.object({}).passthrough();else if(h.length===1)r=h[0];else{let g=O.intersection(h[0],h[1]);for(let C=2;C<h.length;C++)g=O.intersection(g,h[C]);r=g}if(e.additionalProperties===!1){let g=Object.keys(o),C=m.map(y=>new RegExp(y)),w=r;r=r.check(y=>{if(!Pt(y.value))return;let S=[];for(let T of Object.keys(y.value))g.includes(T)||C.some(L=>L.test(T))||S.push(T);S.length&&y.issues.push({code:"unrecognized_keys",keys:S,input:y.value,inst:w})})}}else{let d=O.object(o);e.additionalProperties===!1?r=d.strict():a?r=d.catchall(a):r=d.passthrough()}let c=e.propertyNames!==void 0&&e.propertyNames!==!0,u=typeof e.minProperties=="number"?e.minProperties:void 0,l=typeof e.maxProperties=="number"?e.maxProperties:void 0;if(c||u!==void 0||l!==void 0){let d;if(c){let m=typeof e.propertyNames=="object"&&e.propertyNames.type===void 0?{type:"string",...e.propertyNames}:e.propertyNames;d=tt(m,t)}r=RS(r,{keySchema:d,minProperties:u,maxProperties:l})}break}case"array":{let o=e.prefixItems,i=e.items;if(o&&Array.isArray(o)){let s=typeof e.minItems=="number"?e.minItems:0,a=o.map(d=>tt(d,t)),c=Eg(a,s),u=Array.isArray(i)?void 0:Og(i,t),l=O.tuple(c);r=u?l.rest(u):l,typeof e.minItems=="number"&&(r=r.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(O.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=typeof e.minItems=="number"?e.minItems:0,a=i.map(d=>tt(d,t)),c=Eg(a,s),u=Og(e.additionalItems,t),l=O.tuple(c);r=u?l.rest(u):l,typeof e.minItems=="number"&&(r=r.check(O.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(O.maxLength(e.maxItems)))}else if(i!==void 0){let s=tt(i,t),a=O.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),r=a}else r=O.array(O.any());(e.uniqueItems===!0||e.contains!==void 0)&&(r=$S(r,{uniqueItems:e.uniqueItems===!0,containsSchema:e.contains!==void 0?tt(e.contains,t):void 0,minContains:typeof e.minContains=="number"?e.minContains:void 0,maxContains:typeof e.maxContains=="number"?e.maxContains:void 0}));break}default:throw new Error(`Unsupported type: ${n}`)}return r}function tt(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n=Ng(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>tt(u,t)),c=O.union(a);n=r?O.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>tt(u,t)),c=O.xor(a);n=r?O.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=r?n:O.any();else{let a=r?n:tt(e.allOf[0],t),c=r?0:1;for(let u=c;u<e.allOf.length;u++)a=O.intersection(a,tt(e.allOf[u],t));n=a}e.nullable===!0&&t.version==="openapi-3.0"&&(n=O.nullable(n)),e.readOnly===!0&&(n=O.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let o={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(o[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(o[a]=e[a]);if(e.type==="object"&&e.$ref===void 0){e.propertyNames!==void 0&&!Ji(e.propertyNames)&&(o.propertyNames=e.propertyNames);for(let a of["minProperties","maxProperties"])e[a]!==void 0&&(o[a]=e[a])}if(e.type==="array"&&e.$ref===void 0){e.contains!==void 0&&!Ji(e.contains)&&(o.contains=e.contains);for(let a of["uniqueItems","minContains","maxContains"])e[a]!==void 0&&(o[a]=e[a])}for(let a of Object.keys(e))_S.has(a)||We(o,a,e[a]);return Object.keys(o).length>0&&t.registry.add(n,o),e.description&&(n=n.describe(e.description)),n}function zg(e,t){if(typeof e=="boolean")return e?O.any():O.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let r=PS(n,t?.defaultTarget),o=n.$defs||n.definitions||{},i={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Ve};return tt(n,i)}var jg=Symbol("z.visit/resolving");function Xi(e,t){let n=typeof t=="function"?t:(s,a)=>{let c=t[s._zod.def.type];return c?c(s,a):s},r=new Map;function o(s){let a=r.get(s);if(a===jg)return new Pi({type:"lazy",getter:()=>r.get(s)});if(a!==void 0)return a;r.set(s,jg);let c=i(s),u=n(c,c!==s);return r.set(s,u),u}function i(s){let a=s._zod.def,c=a.type;switch(c){case"object":{let u=a.shape,l=Object.keys(u),d=!1,m={};for(let h of l){let g=o(u[h]);g!==u[h]&&(d=!0),m[h]=g}let p=a.catchall;return a.catchall&&(p=o(a.catchall),p!==a.catchall&&(d=!0)),d?ie(s,{...a,shape:m,catchall:p}):s}case"array":{let u=o(a.element);return u===a.element?s:ie(s,{...a,element:u})}case"tuple":{let u=a.items,l=!1,d=[];for(let p of u){let h=o(p);h!==p&&(l=!0),d.push(h)}let m=a.rest;return a.rest&&(m=o(a.rest),m!==a.rest&&(l=!0)),l?ie(s,{...a,items:d,rest:m}):s}case"record":case"map":{let u=o(a.keyType),l=o(a.valueType);return u===a.keyType&&l===a.valueType?s:ie(s,{...a,keyType:u,valueType:l})}case"set":{let u=o(a.valueType);return u===a.valueType?s:ie(s,{...a,valueType:u})}case"union":{let u=a.options,l=!1,d=[];for(let m of u){let p=o(m);p!==m&&(l=!0),d.push(p)}return l?ie(s,{...a,options:d}):s}case"intersection":{let u=o(a.left),l=o(a.right);return u===a.left&&l===a.right?s:ie(s,{...a,left:u,right:l})}case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":{let u=o(a.innerType);return u===a.innerType?s:ie(s,{...a,innerType:u})}case"pipe":{let u=o(a.in),l=o(a.out);return u===a.in&&l===a.out?s:ie(s,{...a,in:u,out:l})}case"function":{let u=o(a.input),l=o(a.output);return u===a.input&&l===a.output?s:ie(s,{...a,input:u,output:l})}case"lazy":{let u=a.getter,{_cachedInner:l,...d}=a;return ie(s,{...d,getter:()=>o(u())})}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":return s;default:return s}}return o(e)}function Zg(e){return Xi(e,{object:t=>t.partial(),union:t=>{let n=t._zod.def;return n.discriminator===void 0?t:So(n.options)}})}function DS(e,t){if(!t?.length)return e;let n=e._zod.def;return ie(e,Zt(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function Wg(e){return DS(e.out,e.checks)}function OS(e){return e.in._zod.traits.has("$ZodTransform")?Wg(e):e.in}function Vg(e){return Xi(e,{pipe:t=>OS(t._zod.def),default:(t,n)=>n?br(t._zod.def.innerType):t,catch:(t,n)=>n?t._zod.def.innerType:t})}function Hg(e){return Xi(e,{pipe:t=>Wg(t._zod.def),prefault:(t,n)=>n?t._zod.def.innerType:t})}var nm={};Nt(nm,{bigint:()=>ZS,boolean:()=>jS,date:()=>WS,number:()=>zS,string:()=>NS});function NS(e){return xp(vo,e)}function zS(e){return Mp(wo,e)}function jS(e){return Op(xo,e)}function ZS(e){return zp(Io,e)}function WS(e){return qp(Vi,e)}var rm=1e4,Fg=ce.string().min(1).max(1024),tn=ce.array(Fg).max(rm),VS=ce.enum(["project","chronological","machine"]),HS=ce.enum(["updated","created","alpha","none"]),FS=ce.enum(["default","ascending","descending"]),BS=ce.enum(["muted","colour"]),US=ce.enum(["12h","1d","3d","1w","never"]),KS=ce.enum(["blocked","everything"]),GS=ce.array(ce.union([ce.literal("threads"),Fg.regex(/^(project|section|machine):\S+$/)])).max(rm).transform(e=>[...new Set(e)]);function Ie(e,t,n,r){return{schema:e,defaultValue:t,description:n,...r?{readStored:r}:{}}}var Qi={showArchived:Ie(ce.boolean(),!1,"Show archived threads: whether every group also lists archived threads, as each group's menu toggles."),organizationMode:Ie(VS,"project","How top-level groups are formed: project, chronological (custom sections) or machine."),environmentGrouping:Ie(ce.boolean(),!1,"Worktrees as folders: whether sibling threads sharing a worktree environment fold into a folder row."),chronologicalSort:Ie(HS,"updated","Sort field inside a group: updated, created or alpha. none is read as updated."),sortDirection:Ie(FS,"default","Sort direction: ascending or descending. A saved default reads as the field's own direction (descending for dates, ascending for alpha)."),sectionOrder:Ie(tn,["pinned","projects","threads"],"Top-level group order when organized by project."),manualSectionOrder:Ie(tn,["pinned","sections","threads"],"Top-level group order when organized chronologically."),machineSectionOrder:Ie(tn,["pinned","machines","threads"],"Top-level group order when organized by machine."),hiddenGroups:Ie(GS,[],"Groups moved into More: threads, project:<id>, section:<id> or machine:<id>."),collapsedSections:Ie(ce.array(ce.enum(["pinned","threads"])).max(rm),[],"Built-in groups (pinned, threads) that are collapsed."),collapsedProjects:Ie(tn,[],"Project ids whose group is collapsed."),collapsedThreadSections:Ie(tn,[],"Custom section keys (section:<id>) whose group is collapsed."),collapsedMachines:Ie(tn,[],"Machine ids whose group is collapsed."),collapsedEnvironments:Ie(tn,[],"Environment ids whose folder row is collapsed."),expandedOlder:Ie(tn,[],`Parent thread ids whose "N more child threads" row the user opened, once that tree's children chip was open.`),openSettledFolds:Ie(tn,[],"Group ids whose settled fold the user opened."),settleAfter:Ie(US,"1d","Settle after: how long a quiet thread goes without activity before it settles into its group's settled fold: 12h, 1d, 3d, 1w or never."),expandedChildren:Ie(tn,[],"Parent thread ids whose chip the user opened."),childAttention:Ie(KS,"blocked","Needs attention counts every child: blocked counts a child thread that waits on you, is offline or has an orphaned failure; everything also counts every failed or finished-unread child. The same children stay out of an open tree's N more child threads fold, as running ones do."),harnessIcon:Ie(BS,"muted","How rows draw the harness logo, where a row draws one: muted (monochrome) or colour (the provider's tint). A stored hidden reads as muted.",e=>e==="hidden"?"muted":e)},Bg=Object.keys(Qi);function om(e){return Object.hasOwn(Qi,e)}function qS(e){return structuredClone(Qi[e].defaultValue)}function YS(){return Object.fromEntries(Bg.map(e=>[e,qS(e)]))}function im(e,t){let n=Qi[e].schema.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,message:n.error.issues.map(r=>r.message).join("; ")}}function JS(e,t){let n=Qi[e];return im(e,n.readStored?n.readStored(t):t)}function sm(e){let t=YS();if(e===null||typeof e!="object")return t;let n=e;for(let r of Bg){if(!(r in n))continue;let o=JS(r,n[r]);o.success&&(t[r]=o.value)}return t}var XS=ce.object({density:ce.enum(["compact","comfortable"]).catch("compact")}),am="bb.thread-glance.client.v1",es="bb.thread-glance.preferences.v1",Ug="bb.thread-list.preferences.v1";function Kg(e){let t=XS.safeParse(e??{});return t.success?t.data:{density:"compact"}}function Cu(){return new Set}function ku(e,t){let n=N(r=>t(o=>({...o,...r})),[t]);return D(()=>(e.add(n),()=>{e.delete(n)}),[e,n]),N(r=>{for(let o of e)o!==n&&o(r)},[e,n])}function ts(e){try{let t=globalThis.localStorage?.getItem(e);return t==null?null:JSON.parse(t)}catch{return null}}function Po(e,t){try{globalThis.localStorage?.setItem(e,JSON.stringify(t))}catch{}}var QS=Cu();function Gg(){let[e,t]=A(()=>Kg(ts(am))),n=ku(QS,t),r=N(o=>{t(i=>{let s={...i,...o};return Po(am,s),s}),n(o)},[n]);return[e,r]}var e_={};function qg(e,t){let[n,r]=A(null),[o,i]=A(null);if(e!==n){let s=Date.now();r(e),i(a=>G5(a,e,s))}return D(()=>{o!==null&&o.wentIdle.length>0&&t([...o.wentIdle])},[o,t]),o?.idleSince??e_}function Yg(e){let[t,n]=A(()=>Date.now());return D(()=>{let r=setInterval(()=>n(Date.now()),6e4);return()=>clearInterval(r)},[]),D(()=>{if(e===null)return;let r=e-Date.now();if(r>2**31-1)return;let o=setTimeout(()=>n(Date.now()),Math.max(r,0)+50);return()=>clearTimeout(o)},[e]),t}var ns=ce.record(ce.string(),ce.number()),iA=ce.object({startedAt:ns,finishedAt:ns,pendingAt:ns,seenAt:ns,idleAt:ns}),t_=140,cm=ce.object({kind:ce.enum(["question","approval","plan","input","failed","done"]),text:ce.string().max(t_),at:ce.number()}),Jg=ce.object({pending:cm.optional(),failed:cm.optional(),done:cm.optional()}),Wn={preferences:"preferences",stamps:"stamps",scheduled:"scheduled",notes:"notes"};var n_=150,r_=Cu(),rs=new Map;function Xg(){let e=xn(),[t,n]=A(()=>sm(ts(es))),[r,o]=A(!1),i=$(null),s=wn(),a=$(!1),c=N(async()=>{try{let{preferences:m}=await e.call("listPreferences",null),p=sm(m);for(let[h,g]of rs)p[h]=g;n(p),Po(es,p)}finally{o(!0)}},[e]);D(()=>{let m=!1;return(async()=>{try{await e.call("importPreferences",{bbMirror:ts(Ug)})}catch{}m||await c().catch(()=>{})})(),()=>{m=!0}},[e,c]),D(()=>{s==="connected"&&(a.current&&c().catch(()=>{}),a.current=!0)},[s,c]),vn(Wn.preferences,m=>{let p=m;if(!om(p?.key)||rs.has(p.key))return;let h=im(p.key,p.value);h.success&&n(g=>{let C={...g,[p.key]:h.value};return Po(es,C),C})});let u=N(()=>{let m=[...rs];rs.clear();for(let[p,h]of m)e.call("setPreference",{key:p,value:h}).catch(g=>{gt.error(`Couldn't save the ${p} setting`,{description:g instanceof Error?g.message:String(g)})})},[e]);D(()=>()=>{i.current!==null&&clearTimeout(i.current),u()},[u]);let l=ku(r_,n),d=N(m=>{n(p=>{let h={...p,...m};return Po(es,h),h}),l(m);for(let[p,h]of Object.entries(m))om(p)&&rs.set(p,h);i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,u()},n_)},[u,l]);return{prefs:t,hydrated:r,update:d}}var um={};function Qg(){let e=xn(),[t,n]=A(um),r=wn(),o=$(!1),[i,s]=A(0);return D(()=>{let a=!1;return e.call("listScheduled",null).then(c=>{a||n(c.status==="ready"?c.scheduled:um)},()=>{}),()=>{a=!0}},[e,i]),D(()=>{r==="connected"&&(o.current&&s(a=>a+1),o.current=!0)},[r]),vn(Wn.scheduled,a=>{let c=a;c===null||typeof c!="object"||n(c.status==="ready"&&c.scheduled?c.scheduled:um)}),t}var e4={startedAt:{},finishedAt:{},pendingAt:{},seenAt:{},idleAt:{}},o_=new Set(Object.keys(e4));function t4(){let e=xn(),[t,n]=A(e4),[r,o]=A(!1),i=wn(),s=$(!1),a=N(()=>{e.call("listStamps",null).then(m=>{n(m.stamps),o(!0)},()=>o(!0))},[e]);D(a,[a]),D(()=>{i==="connected"&&(s.current&&a(),s.current=!0)},[i,a]);let c=N(m=>{!o_.has(m.kind)||!Array.isArray(m.threadIds)||n(p=>{let h={...p[m.kind]};for(let g of m.threadIds)m.value===null?delete h[g]:h[g]=m.value;return{...p,[m.kind]:h}})},[]);vn(Wn.stamps,m=>c(m));let u=N(m=>{m.length!==0&&(c({kind:"seenAt",threadIds:m,value:Date.now()}),e.call("markSeen",{threadIds:m}).catch(()=>{}))},[c,e]),l=N(m=>{m.length!==0&&e.call("markIdle",{threadIds:m}).catch(()=>{})},[e]),d=N(m=>{m.length!==0&&(c({kind:"seenAt",threadIds:m,value:null}),e.call("clearSeen",{threadIds:m}).catch(()=>{}))},[c,e]);return{stamps:t,loaded:r,markSeen:u,markIdle:l,clearSeen:d}}function lm(e,t,n){let r=new Set,o=e;for(;o!==null&&!r.has(o);){if(o===t)return!0;r.add(o),o=n(o)}return!1}function n4(e,t,n){if(t==="pinned")return e.pinned?{type:"unchanged"}:{type:"pin",threadId:e.threadId};if(e.pinned)return{type:"unpin",threadId:e.threadId};if(n.mode==="chronological"&&(t==="threads"||t.startsWith("section:"))){let r=t==="threads"?null:t.slice(8);return r===e.sectionId&&e.parentThreadId===null?{type:"unchanged"}:{type:"move",threadId:e.threadId,sectionId:r,detach:e.parentThreadId!==null}}return e.parentThreadId!==null?{type:"detach",threadId:e.threadId}:{type:"unchanged"}}function dm(e,t,n){if(t.kind==="group")return n4(e,t.groupId,n);if(t.threadId===e.threadId)return{type:"unchanged"};if(t.zone==="middle")return lm(t.threadId,e.threadId,n.parentOf)?{type:"blocked"}:e.parentThreadId===t.threadId?{type:"unchanged"}:{type:"nest",threadId:e.threadId,parentThreadId:t.threadId,unpinFirst:e.pinned};if(t.inPinned&&n.pinnedOrder.includes(t.threadId)){if(!e.pinned)return{type:"pin",threadId:e.threadId};let r=n.pinnedOrder.filter(u=>u!==e.threadId),o=r.indexOf(t.threadId),i=t.zone==="before"?o:o+1,s=r[i-1]??null,a=r[i]??null,c=n.pinnedOrder.indexOf(e.threadId);return(n.pinnedOrder[c-1]??null)===s&&(n.pinnedOrder[c+1]??null)===a?{type:"unchanged"}:{type:"reorder-pinned",threadId:e.threadId,previousThreadId:s,nextThreadId:a}}return n4(e,n.groupOfThread(t.threadId),n)}function r4(e,t){let n=t.thread.createdAt-e.thread.createdAt;return n!==0?n:e.thread.id<t.thread.id?-1:e.thread.id>t.thread.id?1:0}function i_(e,t){let n=e.thread.displayTitle.localeCompare(t.thread.displayTitle);return n!==0?n:e.thread.id.localeCompare(t.thread.id)}function s_(e,t){let n=t.treeAttention-e.treeAttention;return n!==0?n:r4(e,t)}function Vn(e){return e==="none"?"updated":e}function yu(e){return Vn(e)==="alpha"?"ascending":"descending"}function pm(e,t){return t==="default"?yu(e):t}function o4(e){let t=Vn(e.field),n=pm(t,e.direction)===yu(t)?1:-1,r=t==="alpha"?i_:t==="created"?r4:s_;return(o,i)=>n*r(o,i)}function i4(e,t){if(e.pinSortKey!==null&&t.pinSortKey!==null&&e.pinSortKey!==t.pinSortKey)return e.pinSortKey<t.pinSortKey?-1:1;let n=(t.pinnedAt??0)-(e.pinnedAt??0);if(n!==0)return n;let r=t.createdAt-e.createdAt;return r!==0?r:e.id<t.id?-1:e.id>t.id?1:0}function s4(e,t){let n=e.createdAt-t.createdAt;return n!==0?n:e.id<t.id?-1:e.id>t.id?1:0}var a_={question:"Asks",approval:"Approve",plan:"Plan",input:"Needs"};function fm(e){let t=e?.pending?.kind;return t==="question"||t==="approval"||t==="plan"||t==="input"?t:null}function a4(e,t){if(e.hasPendingInteraction){let n=fm(t),r=t?.pending?.text.trim();return n===null||!r?null:{prefix:a_[n],text:r,tone:"attention"}}if(or(e)==="error"){let n=t?.failed?.text.trim();return n&&n.toLowerCase()!=="failed"?{prefix:"Failed",text:n,tone:"destructive"}:null}return aa(e)==="failed"?{prefix:"Failed",text:"queued message wasn't sent",tone:"destructive"}:null}function c4(e){return e.text===""?e.prefix:`${e.prefix}: ${e.text}`}function u4(e){return e?.done??null}var c_=new Set(["working","background"]);function l4(e){return e.pinnedAt!==null||e.isPinned}function u_(e,t){let n=new Set([e.id]),r=e.parentThreadId,o=null,i=!1;for(;r!==null;){if(n.has(r))return null;n.add(r);let s=t.get(r);if(s===void 0)break;s.isHidden||(o??=s.id,l4(s)&&(i=!0)),r=s.parentThreadId}return!e.isHidden&&l4(e)&&!i?null:o}function l_(e,t){if(t.stampsLoaded===!1)return null;let n=t.idleSince?.[e],r=t.idleAt?.[e];return n===void 0?r:r===void 0?n:Math.max(n,r)}function d4(e){let t=new Map(e.threads.map(d=>[d.id,d])),n=new Map;for(let d of e.threads){let m=Z5(d,e),p=ua(d,{unread:m,hasDraft:e.draftIds.has(d.id),scheduledAt:e.scheduled[d.id]??null,now:e.now,needsKind:fm(e.notes?.[d.id])}),h=V5(d,m),g=d.id===e.activeThreadId;n.set(d.id,{thread:d,state:p,unread:m,flags:d.isHidden?H5(h):h,chipFlags:F5(h,d.isHidden),attentionFlags:new Set,quiet:Wr(p,m,g),quietIgnoringOpen:!1,isActive:g,parentId:u_(d,t),note:a4(d,e.notes?.[d.id])})}let r=e.childAttention??"blocked",o=null;for(let d of n.values()){let m=d.parentId===null?void 0:n.get(d.parentId),p=m===void 0?null:K5(d.thread,d.flags,{...m,finishedAt:e.finishedAt[m.thread.id],idleSince:l_(m.thread.id,e)});p!==null&&p>e.now&&(o=Math.min(o??p,p)),d.attentionFlags=q5(d.flags,{isRoot:m===void 0,mode:r,orphaned:p!==null&&p<=e.now}),d.quietIgnoringOpen=m===void 0||r==="everything"?Wr(d.state,d.unread,!1):d.thread.isArchived||!c_.has(d.state.kind)&&d.attentionFlags.size===0}let i=new Map,s=[];for(let d of n.values()){if(d.parentId===null){d.thread.isHidden||s.push(d);continue}let m=i.get(d.parentId)??[];m.push(d.thread.id),i.set(d.parentId,m)}for(let d of i.values())d.sort((m,p)=>s4(t.get(m),t.get(p)));let a=new Map,c=(d,m)=>{let p=a.get(d);if(p!==void 0)return p;let h=[],g=new Set,C=new Set,w=0,y=0,S=!0;m.add(d);for(let L of i.get(d)??[]){if(m.has(L))continue;let M=n.get(L),E=c(L,m);if(h.push(M,...E.descendants),!M.thread.isArchived){for(let B of M.attentionFlags)g.add(B);M.flags.has("working")&&g.add("working");for(let B of M.chipFlags)C.add(B)}for(let B of E.flags)g.add(B);for(let B of E.chipFlags)C.add(B);(M.thread.isHidden?M.attentionFlags.size>0:!M.quietIgnoringOpen)&&(S=!1),M.thread.isHidden||(w+=1,y+=1),w+=E.visibleCount,E.quietIgnoringOpen||(S=!1)}m.delete(d);let T={descendants:h,flags:g,chipFlags:C,visibleCount:w,childCount:y,quietIgnoringOpen:S};return a.set(d,T),T};for(let d of n.keys())c(d,new Set);let u=[],l=new Map;for(let d of s){let{descendants:m,flags:p,visibleCount:h}=a.get(d.thread.id),g=d.thread.latestAttentionAt,C=d.quiet,w=Wr(d.state,d.unread,!1),y=d.isActive,S=new Set;for(let M of m){if(!M.thread.isArchived)for(let E of M.attentionFlags)S.add(E);g=Math.max(g,M.thread.latestAttentionAt),M.isActive&&(y=!0),M.thread.isHidden?M.attentionFlags.size>0&&(C=w=!1):(M.quiet||(C=!1),M.quietIgnoringOpen||(w=!1))}let T=new Set(p);if(!d.thread.isArchived){for(let M of d.attentionFlags)T.add(M),S.add(M);d.flags.has("working")&&T.add("working")}let L={root:d,descendants:m,descendantFlags:p,flags:T,attentionFlags:S,visibleDescendantCount:h,latestAttentionAt:g,quiet:C&&!y,quietIgnoringOpen:w,containsActive:y};u.push(L),l.set(d.thread.id,L);for(let M of m)l.set(M.thread.id,L)}return{infos:n,children:i,trees:u,treeOf:l,subtrees:a,nextOrphanAt:o}}function bu(e){return e.some(t=>t.root.unread||t.descendants.some(n=>n.unread))}function os(e,t,n=null){let r=[],o=new Set([e]),i=t.get(e)?.parentId??null;for(;i!==null&&i!==n&&!o.has(i);)r.push(i),o.add(i),i=t.get(i)?.parentId??null;return r}var Tt="pinned",Rt="threads";function d_(e){return e.pinnedAt!==null||e.isPinned}function p4(e){return e.find(t=>t.isPersonal)??null}function vu(e,t){if(d_(e)&&!e.isHidden)return Tt;switch(t.mode){case"project":{let n=t.projects.find(r=>r.id===e.projectId);return n===void 0||n.isPersonal?Rt:`project:${n.id}`}case"chronological":return e.sectionId===null?Rt:`section:${e.sectionId}`;case"machine":return e.host===null?Rt:`machine:${e.host.id}`}}function f4(e,t){let n=p4(e.projects);switch(e.mode){case"project":return e.projects.filter(r=>!r.isPersonal).map(r=>({id:`project:${r.id}`,kind:"project",label:r.name,entityId:r.id,newThreadProjectId:r.id,newThreadSectionId:null}));case"chronological":{let r=new Set(e.sections.map(s=>s.id)),o=[...e.sections];t&&o.sort((s,a)=>s.name.localeCompare(a.name));let i=o.map(s=>({id:`section:${s.id}`,kind:"section",label:s.name,entityId:s.id,newThreadProjectId:n?.id??null,newThreadSectionId:s.id}));for(let s of e.threads)s.sectionId===null||r.has(s.sectionId)||(r.add(s.sectionId),i.push({id:`section:${s.sectionId}`,kind:"section",label:"Section",entityId:s.sectionId,newThreadProjectId:n?.id??null,newThreadSectionId:s.sectionId}));return i}case"machine":{let r=new Map;for(let o of e.threads)o.host!==null&&!r.has(o.host.id)&&r.set(o.host.id,o.host.name);return[...r].map(([o,i])=>({id:`machine:${o}`,kind:"machine",label:i||"Unknown machine",entityId:o,newThreadProjectId:null,newThreadSectionId:null}))}}}function mm(e,t){return e===Tt?{id:e,kind:"pinned",label:"Pinned",entityId:null,newThreadProjectId:null,newThreadSectionId:null}:{id:e,kind:"threads",label:"Threads",entityId:null,newThreadProjectId:p4(t)?.id??null,newThreadSectionId:null}}var p_={project:"projects",chronological:"sections",machine:"machines"},is={project:"sectionOrder",chronological:"manualSectionOrder",machine:"machineSectionOrder"};function m4(e,t,n){let r=p_[e],o=new Set(n),i=new Set(t),s=[],a=u=>{s.includes(u)||s.push(u)};for(let u of t)if(u===r)for(let l of n)i.has(l)||a(l);else(u===Tt||u===Rt||o.has(u))&&a(u);let c=n.filter(u=>!s.includes(u));if(c.length>0){let u=-1;s.forEach((d,m)=>{o.has(d)&&(u=m)});let l=u>=0?u+1:s.includes(Rt)?s.indexOf(Rt):s.length;s.splice(l,0,...c)}return s.includes(Tt)||s.unshift(Tt),s.includes(Rt)||s.push(Rt),s}function hm(e,t,n,r){if(t===n)return[...e];let o=e.filter(s=>s!==t),i=o.indexOf(n);return i<0?[...e]:(o.splice(r==="before"?i:i+1,0,t),o)}function ss(e,t){switch(e.kind){case"pinned":case"threads":return t.collapsedSections.includes(e.kind);case"project":return t.collapsedProjects.includes(e.entityId);case"section":return t.collapsedThreadSections.includes(e.id);case"machine":return t.collapsedMachines.includes(e.entityId)}}function gm(e,t){let n=(r,o)=>r.includes(o)?r.filter(i=>i!==o):[...r,o];switch(e.kind){case"pinned":case"threads":return{collapsedSections:n(t.collapsedSections,e.kind)};case"project":return{collapsedProjects:n(t.collapsedProjects,e.entityId)};case"section":return{collapsedThreadSections:n(t.collapsedThreadSections,e.id)};case"machine":return{collapsedMachines:n(t.collapsedMachines,e.entityId)}}}var z={archive:"Archive",unarchive:"ArchiveRestore",more:"MoreHorizontal",openInSplit:"Columns2",copy:"Copy",link:"ExternalLink",markRead:"MailOpen",markUnread:"Mail",pin:"Pin",unpin:"PinOff",moveToSection:"SectionMove",rename:"Edit",remove:"Trash2",details:"Info",crossGroup:"FolderExport",hidden:"EyeOff",show:"Eye",expand:"ChevronRight",collapse:"ChevronDown",moveUp:"ChevronUp",newThread:"Plus",newSection:"SectionAdd",customize:"SlidersHorizontal",settings:"SlidersHorizontal",check:"Check",pullRequest:"GitPullRequest",branch:"GitBranch",worktree:"FolderGit",machine:"Laptop",environmentFallback:"Zap",filter:"FilterHorizontal",drag:"DragDropVertical",move:"MoveTo",open:"ArrowUpRight"},$A=Object.values(z);function h4(e){let{thread:t}=e,n=t.archivedAt!==null||t.isArchived,r=t.pinnedAt!==null||t.isPinned,o=[];return o.push({action:"details",label:"Details",icon:z.details}),e.splitAvailable&&o.push({action:"open-in-split",label:"Open in split",icon:z.openInSplit}),o.push({action:"copy-link",label:"Copy thread link",icon:z.link}),o.push({action:"copy-id",label:"Copy thread ID",icon:z.copy}),o.push(e.unread?{action:"mark-read",label:"Mark read",icon:z.markRead}:{action:"mark-unread",label:"Mark unread",icon:z.markUnread}),o.push(r?{action:"unpin",label:"Unpin",icon:z.unpin}:{action:"pin",label:"Pin",icon:z.pin}),e.isRoot&&!n&&e.hasSections&&o.push({action:"move-to-section",label:"Move to section",icon:z.moveToSection}),n||o.push({action:"move",label:"Move\u2026",icon:z.move}),o.push({action:"rename",label:"Rename",icon:z.rename}),o.push(n?{action:"unarchive",label:"Unarchive",icon:z.unarchive,separated:!0}:{action:"archive",label:"Archive",icon:z.archive,separated:!0}),o.push({action:"delete",label:"Delete",icon:z.remove,destructive:!0}),o}var g4=20;function C4(e){return e.split(/[^\p{L}\p{N}]+/u).map(t=>t.trim()).filter(t=>t.length>0)}function k4(e){let t=e.displayName?.trim()||e.id,n=C4(t),r=C4(e.id),o=(n[0]??e.id)[0]??"?",i=[],s=a=>{if(a===void 0)return;let c=(o+a).toUpperCase();i.includes(c)||i.push(c)};s((n[0]??"")[1]);for(let a of n.slice(1))s(a[0]);for(let a of r)for(let c of a)s(c);for(let a of(n[0]??"").slice(2))s(a);return i.length===0&&i.push(o.toUpperCase()),i}function y4(e){let t=new Map,n=new Set;for(let r of e){let o=k4(r),i=o.find(s=>!n.has(s))??o[0];n.add(i),t.set(r.id,i)}return t}function b4(e,t){return t.get(e)??k4({id:e})[0]}function as(e,t){return e.filter(n=>n!==t)}function v4(e,t){return n=>os(n,e.infos).includes(t)}function w4(e,t,n){let r=e.info.thread.id;return e.chip?.expanded??!1?{patch:{expandedChildren:as(t.expandedChildren,r)},drop:v4(n,r)}:x4(r,t)}function x4(e,t){return{patch:{expandedChildren:[...as(t.expandedChildren,e),e]},drop:null}}function I4(e,t,n){return e.scope==="reveal"?x4(e.scopeId,t):e.expanded?{patch:{expandedOlder:as(t.expandedOlder,e.scopeId)},drop:v4(n,e.scopeId)}:{patch:{expandedOlder:[...as(t.expandedOlder,e.scopeId),e.scopeId]},drop:null}}function S4(e,t){let n=as(t.openSettledFolds,e.groupId);return{patch:{openSettledFolds:e.expanded?n:[...n,e.groupId]},drop:null}}function _4(e,t,n){let r=new Set(e.rootIds),o=i=>{let s=n.treeOf.get(i);return s!==void 0&&r.has(s.root.thread.id)};return e.collapsed?{patch:ss(e.descriptor,t)?gm(e.descriptor,t):{},drop:null}:e.userCollapsed?{patch:{},drop:o}:{patch:gm(e.descriptor,t),drop:o}}function Cm(e,t){let n=[],r=[];for(let o of e)for(let i of[o.root,...o.descendants])i.unread&&(n.push(i.thread.id),ca(i.thread,t)&&r.push(i.thread.id));return{read:n,seen:r}}function P4(e,t,n){let r=t.treeOf.get(e);if(r!==void 0&&r.root.thread.id===e)return Cm([r],n);let o=t.infos.get(e)?.thread;return o===void 0?{read:[e],seen:[]}:{read:[e],seen:ca(o,n)?[e]:[]}}var km={waitsOnYou:0,failed:0,offline:0,working:0,unread:0};function ym(e){let t={...km};for(let n of e)for(let r of[n.root,...n.descendants]){if(r.thread.isArchived)continue;let o=r.attentionFlags;o.has("waits-on-you")&&(t.waitsOnYou+=1),(o.has("unread-failed")||o.has("queue-failed"))&&(t.failed+=1),o.has("offline")&&(t.offline+=1),r.flags.has("working")&&(t.working+=1),o.has("unread")&&(t.unread+=1)}return t}function L4(e,t){return{waitsOnYou:e.waitsOnYou+t.waitsOnYou,failed:e.failed+t.failed,offline:e.offline+t.offline,working:e.working+t.working,unread:e.unread+t.unread}}function M4(e,t){return{waitsOnYou:e.waitsOnYou,failed:e.failed,offline:e.offline,working:t.collapsed||t.more?e.working:0,unread:t.more?e.unread:0}}var wu=3600*1e3,f_={"12h":12*wu,"1d":24*wu,"3d":72*wu,"1w":168*wu};function m_(e,t){return Math.max(e.createdAt,e.latestAttentionAt,t.startedAt[e.id]??0,t.finishedAt[e.id]??0)}function R4(e,t){let n=e.thread;return n.pinnedAt!==null||n.isPinned||!Wr(e.state,e.unread,!1)||e.attentionFlags.size>0||t.settleAfter==="never"?!1:t.now-m_(n,t)>=f_[t.settleAfter]}function T4(e,t){return R4(e.root,t)&&e.descendants.every(n=>R4(n,t))}function A4(e){return(e.find(t=>t.isDefault)??e[0])?.hostId??null}function $4(e,t){return e!==null&&typeof t=="string"&&e!==t}var h_=3;function g_(e,t){return t===null?null:e.forest.infos.get(t)?.thread.displayTitle??null}function C_(e,t,n){let r=t.thread,o=n.thread;if(t===n)return null;switch(e.prefs.organizationMode){case"project":return r.projectId===o.projectId?null:`In project ${e.projectNames.get(r.projectId)??"another project"}`;case"chronological":return r.sectionId===o.sectionId?null:r.sectionId===null?"In Threads":`In section ${e.sectionNames.get(r.sectionId)??"another section"}`;case"machine":return(r.host?.id??null)===(o.host?.id??null)?null:r.host===null?"On no machine":`On machine ${r.host.name}`}}function k_(e,t,n){return t.parentId===null&&n!==null?e.forest.treeOf.get(t.thread.id)?.quiet??t.quiet:t.quiet}function y_(e,t){let n=t.thread.providerId;return t.parentId===null?e.defaultProviderId!==null&&n!==e.defaultProviderId:n!==e.forest.infos.get(t.parentId)?.thread.providerId}function b_(e,t,n){let r=t.thread.environment?.branchName??null,o=$4(r,e.defaultBranchOf(t.thread));return e.comfortable&&t.note===null&&o?{branchLine:r,pullRequest:"second-line"}:{branchLine:null,pullRequest:n===0&&o?"title":null}}function v_(e,t){let n=t.thread.host;return e.prefs.organizationMode==="machine"||e.primaryHostId===null||n===null||n.id===e.primaryHostId?null:n.name||"Unknown machine"}function D4(e,t,n,r){return{...b_(e,t,r.depth),machine:v_(e,t),type:"thread",key:`thread:${t.thread.id}`,info:t,depth:r.depth,nested:r.nested,parentTitle:g_(e,t.parentId),chip:r.chip,harness:y_(e,t),bold:t.unread,treeUnread:t===n&&[n,...e.forest.treeOf.get(n.thread.id)?.descendants??[]].some(o=>o.unread),note:t.note,dimmed:k_(e,t,r.chip),hiddenBadge:t.thread.isHidden,crossGroupLabel:C_(e,t,n),projectId:t.thread.projectId}}function O4(e,t){return(e.forest.children.get(t)??[]).map(n=>e.forest.infos.get(n)).filter(n=>!n.thread.isHidden||n.attentionFlags.size>0)}function bm(e,t){return e.forest.subtrees.get(t)}function w_(e,t,n){let r=t.thread.id,o=O4(e,r),i=h=>e.revealIds.has(h.thread.id)||e.revealPath.has(h.thread.id),s=(h,g,C)=>g>0?{type:"older",key:`older:${h}:${r}`,scopeId:r,scope:h,count:g,expanded:C,depth:n}:null;if(!e.expandedChildren.has(r)){let h=o.filter(i),g=o.filter(C=>!i(C)&&!C.thread.isHidden).length;return{shown:h,older:h.length>0?s("reveal",g,!1):null}}let a=h=>h.quietIgnoringOpen&&bm(e,h.thread.id).quietIgnoringOpen,c=new Set;for(let h of o)(h.thread.isHidden||!a(h))&&c.add(h.thread.id);let u=o.filter(h=>!c.has(h.thread.id)&&!h.thread.isHidden).sort((h,g)=>g.thread.createdAt-h.thread.createdAt).slice(0,h_);for(let h of u)c.add(h.thread.id);let l=e.expandedOlder.has(r),d=h=>c.has(h.thread.id)||i(h)||e.activePath.has(h.thread.id),m=o.filter(h=>!d(h)).length;return{shown:l?o:o.filter(d),older:s("tree",m,l)}}function x_(e){let t=e.environment;return t===null?"Environment":t.name?t.name:t.branchName?t.branchName:t.path?t.path.split(/[\\/]/).filter(Boolean).pop()??"Environment":"Environment"}function us(e,t,n){if(!e.prefs.environmentGrouping)return t.flatMap(s=>s.rows);let r=new Map;for(let s of t){let a=s.info.thread.environment;a?.isWorktree===!0&&a.id!==null&&r.set(a.id,(r.get(a.id)??0)+1)}let o=[],i=new Set;for(let s of t){let a=s.info.thread.environment,c=a?.isWorktree===!0?a.id:null;if(c===null||(r.get(c)??0)<2){o.push(...s.rows);continue}if(i.has(c))continue;i.add(c);let u=t.filter(m=>m.info.thread.environment?.id===c),l=e.collapsedEnvironments.has(c),d=new Set;for(let m of u)for(let p of m.flags)d.add(p);if(o.push({type:"environment",key:`environment:${c}:${s.info.thread.id}`,environmentId:c,label:x_(s.info.thread),environmentProviderId:a?.providerId??null,projectId:s.info.thread.projectId,sectionId:s.info.thread.sectionId,threadIds:u.map(m=>m.info.thread.id),collapsed:l,flag:l?Rl(d):null,depth:n}),!l)for(let m of u)for(let p of m.rows)o.push({...p,depth:p.depth+1})}return o}function N4(e,t,n){let{childCount:r,chipFlags:o}=bm(e,t.thread.id),i=Rl(o);return r===0&&i===null&&O4(e,t.thread.id).length===0?null:{count:r,expanded:n,flag:i}}function I_(e,t){let n=new Set([...t.attentionFlags,...bm(e,t.thread.id).flags]);return t.flags.has("working")&&n.add("working"),n}function z4(e,t,n,r){let{shown:o,older:i}=w_(e,n,r),s=o.map(c=>({info:c,flags:I_(e,c),rows:[D4(e,c,t.root,{depth:r,nested:r>1,chip:N4(e,c,e.expandedChildren.has(c.thread.id))}),...z4(e,t,c,r+1)]})),a=us(e,s,r);return i!==null&&a.push(i),a}function S_(e,t){let n=t.root,r=N4(e,n,e.expandedChildren.has(n.thread.id));return[D4(e,n,n,{depth:0,nested:!1,chip:r}),...z4(e,t,n,1)]}function cs(e,t){return{info:t.root,rows:S_(e,t),flags:t.flags}}function xu(e){return e.attentionFlags.size>0}function Iu(e){return e.trees.filter(xu).length}function vm(e,t){return e&&t>0}function E4(e,t,n,r){if(e.needYouOnly)return __(e,t,n,r);let o=ym(n),i=ss(t,e.prefs),s=e.activeThreadId,a=s!==null&&e.targets.has(s)&&n.some(m=>m.containsActive),c=i&&!a,u=t.id===Tt,l=j4(e,t,n),d;if(c)d=us(e,l.filter(xu).map(m=>cs(e,m)),0);else{let m=l.filter(C=>T4(C,e.settle)),p=new Set(m),h=l.filter(C=>!p.has(C)),g=m.find(C=>C.containsActive)??null;if(d=us(e,h.map(C=>cs(e,C)),0),m.length>0){g!==null&&d.push(...cs(e,g).rows);let C=e.openSettledFolds.has(t.id);if(d.push({type:"settled",key:`settled:${t.id}`,groupId:t.id,count:m.length,expanded:C}),C){let w=m.filter(y=>y!==g).map(y=>cs(e,y));d.push(...us(e,w,0))}}}return{descriptor:t,counters:o,userCollapsed:i,collapsed:c,hidden:r,rows:d,rootIds:n.map(m=>m.root.thread.id),hasUnread:bu(n)}}function j4(e,t,n){return t.id===Tt?[...n].sort((r,o)=>i4(r.root.thread,o.root.thread)):[...n].sort((r,o)=>e.compare({thread:r.root.thread,treeAttention:r.latestAttentionAt},{thread:o.root.thread,treeAttention:o.latestAttentionAt}))}function __(e,t,n,r){let o=j4(e,t,n);return{descriptor:t,counters:ym(n),userCollapsed:ss(t,e.prefs),collapsed:!1,hidden:r,rows:us(e,o.filter(xu).map(i=>cs(e,i)),0),rootIds:n.map(i=>i.root.thread.id),hasUnread:bu(n)}}function Z4(e){let{forest:t,prefs:n}=e,r=new Set,o=new Set;for(let[C,w]of e.targets)if(!(w!=="reveal"||!t.infos.has(C))){r.add(C);for(let y of os(C,t.infos))o.add(y)}let i=new Set;if(e.activeThreadId!==null&&t.infos.has(e.activeThreadId)){i.add(e.activeThreadId);for(let C of os(e.activeThreadId,t.infos))i.add(C)}let s={...e,compare:o4({field:n.chronologicalSort,direction:n.sortDirection}),expandedChildren:new Set(n.expandedChildren),expandedOlder:new Set(n.expandedOlder),openSettledFolds:new Set(n.openSettledFolds),collapsedEnvironments:new Set(n.collapsedEnvironments),revealIds:r,revealPath:o,activePath:i,projectNames:new Map(e.projects.map(C=>[C.id,C.name])),sectionNames:new Map(e.sections.map(C=>[C.id,C.name]))},a=new Map;for(let C of t.trees){let w=vu(C.root.thread,{mode:n.organizationMode,projects:e.projects}),y=a.get(w)??[];y.push(C),a.set(w,y)}let c=Vn(n.chronologicalSort)==="alpha",u=f4({mode:n.organizationMode,projects:e.projects,sections:e.sections,threads:e.threads},c),l=new Map(u.map(C=>[C.id,C]));l.set(Tt,mm(Tt,e.projects)),l.set(Rt,mm(Rt,e.projects));let d=m4(n.organizationMode,n[is[n.organizationMode]],u.map(C=>C.id)),m=new Set(n.hiddenGroups),p=[],h=[],g=km;for(let C of d){let w=l.get(C);if(w===void 0)continue;let y=a.get(C)??[];if(y.length===0&&(C===Tt||C===Rt&&n.organizationMode!=="chronological"))continue;let S=C!==Tt&&m.has(C);if(s.needYouOnly){y.some(xu)&&p.push(E4(s,w,y,S));continue}let T=E4(s,w,y,S);S?(h.push(T),g=L4(g,T.counters)):p.push(T)}return{groups:p,more:h,moreCounters:g,order:d,needYouCount:Iu(t),hasUnread:bu(t.trees)}}function W4(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function P_(e,t){if(e.size!==t.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Su(e,t){if(Object.is(e,t))return e;if(Array.isArray(e)&&Array.isArray(t)){let n=e.length===t.length,r=t.map((o,i)=>{let s=i<e.length?Su(e[i],o):o;return s!==e[i]&&(n=!1),s});return n?e:r}if(e instanceof Set&&t instanceof Set)return P_(e,t)?e:t;if(W4(e)&&W4(t)){let n=Object.keys(t),r=n.length===Object.keys(e).length,o={};for(let i of n){i in e||(r=!1);let s=i in e?Su(e[i],t[i]):t[i];s!==e[i]&&(r=!1),o[i]=s}return r?e:o}return t}function L_(e,t){let n=new Map(e.map(i=>[i.key,i])),r=e.length===t.length,o=t.map((i,s)=>{let a=n.get(i.key),c=a===void 0?i:Su(a,i);return c!==e[s]&&(r=!1),c});return r?e:o}function H4(e,t,n){let r={...t},o=e,i=Object.keys(r).length===Object.keys(o).length;for(let s of Object.keys(r))s in o||(i=!1),r[s]=s in n?n[s]:Su(o[s],r[s]),r[s]!==o[s]&&(i=!1);return i?e:r}function M_(e,t){return e.length===t.length&&t.every((n,r)=>n===e[r])}function V4(e,t,n){let r=n.map(o=>{let i=t.get(o.descriptor.id);return i===void 0?o:H4(i,o,{rows:L_(i.rows,o.rows)})});return M_(e,r)?e:r}function F4(e,t){if(e===null)return t;let n=new Map([...e.groups,...e.more].map(r=>[r.descriptor.id,r]));return H4(e,t,{groups:V4(e.groups,n,t.groups),more:V4(e.more,n,t.more)})}var _u=be({now:0,stamps:{startedAt:{},finishedAt:{},pendingAt:{},seenAt:{},idleAt:{}},notes:{},treeOf:()=>{}});var wm=globalThis.__bbPluginRuntime;if(wm==null||wm.radixAlertDialog==null)throw new Error('Cannot load "@radix-ui/react-alert-dialog": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Pu=wm.radixAlertDialog,r$="default"in Pu?Pu.default:Pu,{Action:xm,AlertDialog:o$,AlertDialogAction:i$,AlertDialogCancel:s$,AlertDialogContent:a$,AlertDialogDescription:c$,AlertDialogOverlay:u$,AlertDialogPortal:l$,AlertDialogTitle:d$,AlertDialogTrigger:p$,Cancel:Im,Content:Sm,Description:_m,Overlay:Pm,Portal:B4,Root:U4,Title:Lm,Trigger:R_,createAlertDialogScope:f$}=Pu;var K4=U4;var A_=B4,G4=F(({className:e,...t},n)=>f(Pm,{className:x("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n,...$e()}));G4.displayName=Pm.displayName;var Mm=F(({className:e,...t},n)=>v(A_,{children:[f(G4,{}),f(Sm,{ref:n,...$e(),className:x("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));Mm.displayName=Sm.displayName;var Rm=({className:e,...t})=>f("div",{className:x("flex flex-col space-y-2 text-center sm:text-left",e),...t});Rm.displayName="AlertDialogHeader";var Tm=({className:e,...t})=>f("div",{className:x("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Tm.displayName="AlertDialogFooter";var Am=F(({className:e,...t},n)=>f(Lm,{ref:n,className:x("text-lg font-semibold",e),...t}));Am.displayName=Lm.displayName;var $m=F(({className:e,...t},n)=>f(_m,{ref:n,className:x("text-sm text-muted-foreground",e),...t}));$m.displayName=_m.displayName;var Em=F(({className:e,...t},n)=>f(xm,{ref:n,className:x(Xs(),e),...t}));Em.displayName=xm.displayName;var Dm=F(({className:e,...t},n)=>f(Im,{ref:n,className:x(Xs({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));Dm.displayName=Im.displayName;var Om=globalThis.__bbPluginRuntime;if(Om==null||Om.radixDialog==null)throw new Error('Cannot load "@radix-ui/react-dialog": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Lu=Om.radixDialog,y$="default"in Lu?Lu.default:Lu,{Close:Nm,Content:q4,Description:zm,Dialog:b$,DialogClose:v$,DialogContent:w$,DialogDescription:x$,DialogOverlay:I$,DialogPortal:S$,DialogTitle:_$,DialogTrigger:P$,Overlay:jm,Portal:Y4,Root:J4,Title:X4,Trigger:Q4,WarningProvider:L$,createDialogScope:M$}=Lu;var E_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none"},ls=F(({color:e="currentColor",size:t=24,strokeWidth:n,absoluteStrokeWidth:r=!1,className:o="",altIcon:i,showAlt:s=!1,icon:a,primaryColor:c,secondaryColor:u,disableSecondaryOpacity:l=!1,...d},m)=>{let p=n!==void 0?r?Number(n)*24/Number(t):n:void 0,h=p!==void 0?{strokeWidth:p,stroke:"currentColor"}:{},g={ref:m,...E_,width:t,height:t,color:c||e,className:o,...h,...d},w=[...s&&i?i:a].sort(([,y],[,S])=>{let T=y.opacity!==void 0;return S.opacity!==void 0?1:T?-1:0}).map(([y,S])=>{let T=S.opacity!==void 0,L=T&&!l?S.opacity:void 0,M=u?{...S.stroke!==void 0?{stroke:T?u:c||e}:{fill:T?u:c||e}}:{};return Zo(y,{...S,...h,...M,opacity:L,key:S.key})});return Zo("svg",g,w)});ls.displayName="HugeiconsIcon";var e8=[["path",{d:"M13.9248 21H10.0752C5.44476 21 3.12955 21 2.27636 19.4939C1.42317 17.9879 2.60736 15.9914 4.97574 11.9985L6.90057 8.75333C9.17559 4.91778 10.3131 3 12 3C13.6869 3 14.8244 4.91777 17.0994 8.75332L19.0243 11.9985C21.3926 15.9914 22.5768 17.9879 21.7236 19.4939C20.8704 21 18.5552 21 13.9248 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 9V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var t8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var n8=[["path",{d:"M21 7H3V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M21 7H3L4.2 5.4C5.08328 4.22229 5.52492 3.63344 6.15836 3.31672C6.7918 3 7.52786 3 9 3H15C16.4721 3 17.2082 3 17.8416 3.31672C18.4751 3.63344 18.9167 4.22229 19.8 5.4L21 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 17L12 10.5M9 14.5C9.58984 15.1068 11.1597 17.5 12 17.5C12.8403 17.5 14.4102 15.1068 15 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var r8=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var o8=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var i8=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var s8=[["path",{d:"M13 7H11C8.19108 7 6.78661 7 5.77772 7.67412C5.34096 7.96596 4.96596 8.34096 4.67412 8.77772C4 9.78661 4 11.1911 4 14C4 16.8089 4 18.2134 4.67412 19.2223C4.96596 19.659 5.34096 20.034 5.77772 20.3259C6.78661 21 8.19108 21 11 21H13C15.8089 21 17.2134 21 18.2223 20.3259C18.659 20.034 19.034 19.659 19.3259 19.2223C20 18.2134 20 16.8089 20 14C20 11.1911 20 9.78661 19.3259 8.77772C19.034 8.34096 18.659 7.96596 18.2223 7.67412C17.2134 7 15.8089 7 13 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4 14H2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M10 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M22 14H20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M9 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M12 7C12 5.11438 12 4.17157 11.4142 3.58579C10.8284 3 9.88562 3 8 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]];var Zm=[["path",{d:"M21.5 12C21.5 17.2467 17.2467 21.5 12 21.5C10.3719 21.5 8.8394 21.0904 7.5 20.3687C5.63177 19.362 4.37462 20.2979 3.26592 20.4658C3.09774 20.4913 2.93024 20.4302 2.80997 20.31C2.62741 20.1274 2.59266 19.8451 2.6935 19.6074C3.12865 18.5818 3.5282 16.6382 2.98341 15C2.6698 14.057 2.5 13.0483 2.5 12C2.5 6.75329 6.75329 2.5 12 2.5C17.2467 2.5 21.5 6.75329 21.5 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5 12H8.5M12 8.5V15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var a8=[["path",{d:"M21.5 12C21.5 17.2467 17.2467 21.5 12 21.5C10.3719 21.5 8.8394 21.0904 7.5 20.3687C5.63177 19.362 4.37462 20.2979 3.26592 20.4658C3.09774 20.4913 2.93024 20.4302 2.80997 20.31C2.62741 20.1274 2.59266 19.8451 2.6935 19.6074C3.12865 18.5818 3.5282 16.6382 2.98341 15C2.6698 14.057 2.5 13.0483 2.5 12C2.5 6.75329 6.75329 2.5 12 2.5C17.2467 2.5 21.5 6.75329 21.5 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.1257 12H12.0007M8.125 12H8M16.125 12H16M12.2507 12C12.2507 12.1381 12.1388 12.25 12.0007 12.25C11.8627 12.25 11.7507 12.1381 11.7507 12C11.7507 11.8619 11.8627 11.75 12.0007 11.75C12.1388 11.75 12.2507 11.8619 12.2507 12ZM8.25 12C8.25 12.1381 8.13807 12.25 8 12.25C7.86193 12.25 7.75 12.1381 7.75 12C7.75 11.8619 7.86193 11.75 8 11.75C8.13807 11.75 8.25 11.8619 8.25 12ZM16.25 12C16.25 12.1381 16.1381 12.25 16 12.25C15.8619 12.25 15.75 12.1381 15.75 12C15.75 11.8619 15.8619 11.75 16 11.75C16.1381 11.75 16.25 11.8619 16.25 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var c8=[["path",{d:"M3.01309 4.99084C2.89323 6.05084 3.55249 8.42285 6.48923 8.42285",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17.5951 8.38081C18.8357 8.57881 21.1132 7.49881 20.9957 5.00281",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20.9928 20.9989C21.0528 19.9429 20.1777 17.5549 17.599 17.4229",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6.45163 17.4708C5.65013 17.2308 3.01306 18.3348 3.01306 20.9988",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M9.3299 6.11884C9.35388 5.09884 9.84533 2.99884 12.0029 2.99884C13.9208 2.99884 14.5861 4.61884 14.676 6.11884M6.26131 9.41884C6.38118 8.63884 7.29216 6.81484 9.36586 6.63484C11.4635 6.55564 14.3403 6.58684 14.8797 6.67084C15.5869 6.73377 17.2951 7.43884 17.7506 9.41884C17.9124 10.4388 17.8285 11.8788 17.8524 12.7188C17.8165 13.5588 17.9207 15.2623 17.7565 16.1388C17.6367 17.0988 16.9894 18.4668 16.1024 19.3068C14.7838 20.7228 11.1639 22.2108 8.03534 19.4508C6.41713 17.8908 6.30925 16.3788 6.18939 15.7788C6.15725 15.4571 6.15875 13.8763 6.16541 12.3588C6.14144 11.046 6.17235 9.78063 6.26131 9.41884Z",stroke:"currentColor",strokeWidth:"1.5",key:"4"}],["path",{d:"M3.01306 12.8988H5.9498",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M20.9929 12.8988L18.1161 12.8988",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M12.0033 16.4988L12.0033 20.2788",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]];var Mu=[["path",{d:"M18 6L6.00081 17.9992M17.9992 18L6 6.00085",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var u8=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.9994 15L9 9M9.00064 15L15 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var l8=[["path",{d:"M11 6L21 6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11 12L21 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 18L21 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M3 7.39286C3 7.39286 4 8.04466 4.5 9C4.5 9 6 5.25 8 4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M3 18.3929C3 18.3929 4 19.0447 4.5 20C4.5 20 6 16.25 8 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]];var d8=[["path",{d:"M22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M8 12.5L10.5 15L16 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var p8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var Wm=[["path",{d:"M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.5 12.5H15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var f8=[["path",{d:"M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var m8=[["path",{d:"M14 2.20004C13.3538 2.06886 12.6849 2 12 2C11.3151 2 10.6462 2.06886 10 2.20004M21.8 10C21.9311 10.6462 22 11.3151 22 12C22 12.6849 21.9311 13.3538 21.8 14M14 21.8C13.3538 21.9311 12.6849 22 12 22C11.3151 22 10.6462 21.9311 10 21.8M2.20004 14C2.06886 13.3538 2 12.6849 2 12C2 11.3151 2.06886 10.6462 2.20004 10M17.5 3.64702C18.6332 4.39469 19.6053 5.36678 20.353 6.5M20.353 17.5C19.6053 18.6332 18.6332 19.6053 17.5 20.353M6.5 20.353C5.36678 19.6053 4.39469 18.6332 3.64702 17.5M3.64702 6.5C4.39469 5.36678 5.36678 4.39469 6.5 3.64702",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var h8=[["path",{d:"M19.5 5.5L18.8803 15.5251C18.7219 18.0864 18.6428 19.3671 18.0008 20.2879C17.6833 20.7431 17.2747 21.1273 16.8007 21.416C15.8421 22 14.559 22 11.9927 22C9.42312 22 8.1383 22 7.17905 21.4149C6.7048 21.1257 6.296 20.7408 5.97868 20.2848C5.33688 19.3626 5.25945 18.0801 5.10461 15.5152L4.5 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 5.5H21M16.0557 5.5L15.3731 4.09173C14.9196 3.15626 14.6928 2.68852 14.3017 2.39681C14.215 2.3321 14.1231 2.27454 14.027 2.2247C13.5939 2 13.0741 2 12.0345 2C10.9688 2 10.436 2 9.99568 2.23412C9.8981 2.28601 9.80498 2.3459 9.71729 2.41317C9.32164 2.7167 9.10063 3.20155 8.65861 4.17126L8.05292 5.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M9.5 16.5L9.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14.5 16.5L14.5 10.5",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]];var g8=[["path",{d:"M2.99969 17.0002C2.99969 17.9302 2.99969 18.3952 3.10192 18.7767C3.37932 19.8119 4.18796 20.6206 5.22324 20.898C5.60474 21.0002 6.06972 21.0002 6.99969 21.0002L16.9997 21.0002C17.9297 21.0002 18.3947 21.0002 18.7762 20.898C19.8114 20.6206 20.6201 19.8119 20.8975 18.7767C20.9997 18.3952 20.9997 17.9302 20.9997 17.0002",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16.4998 11.5002C16.4998 11.5002 13.1856 16.0002 11.9997 16.0002C10.8139 16.0002 7.49976 11.5002 7.49976 11.5002M11.9997 15.0002V3.00016",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var C8=[["path",{d:"M14.0737 3.88545C14.8189 3.07808 15.1915 2.6744 15.5874 2.43893C16.5427 1.87076 17.7191 1.85309 18.6904 2.39232C19.0929 2.6158 19.4769 3.00812 20.245 3.79276C21.0131 4.5774 21.3972 4.96972 21.6159 5.38093C22.1438 6.37312 22.1265 7.57479 21.5703 8.5507C21.3398 8.95516 20.9446 9.33578 20.1543 10.097L10.7506 19.1543C9.25288 20.5969 8.504 21.3182 7.56806 21.6837C6.63212 22.0493 5.6032 22.0224 3.54536 21.9686L3.26538 21.9613C2.63891 21.9449 2.32567 21.9367 2.14359 21.73C1.9615 21.5234 1.98636 21.2043 2.03608 20.5662L2.06308 20.2197C2.20301 18.4235 2.27297 17.5255 2.62371 16.7182C2.97444 15.9109 3.57944 15.2555 4.78943 13.9445L14.0737 3.88545Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4L20 11",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14 22L22 22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var k8=[["path",{d:"M3 7H6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 17H9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M18 17L21 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M15 7L21 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M6 7C6 6.06812 6 5.60218 6.15224 5.23463C6.35523 4.74458 6.74458 4.35523 7.23463 4.15224C7.60218 4 8.06812 4 9 4C9.93188 4 10.3978 4 10.7654 4.15224C11.2554 4.35523 11.6448 4.74458 11.8478 5.23463C12 5.60218 12 6.06812 12 7C12 7.93188 12 8.39782 11.8478 8.76537C11.6448 9.25542 11.2554 9.64477 10.7654 9.84776C10.3978 10 9.93188 10 9 10C8.06812 10 7.60218 10 7.23463 9.84776C6.74458 9.64477 6.35523 9.25542 6.15224 8.76537C6 8.39782 6 7.93188 6 7Z",stroke:"currentColor",strokeWidth:"1.5",key:"4"}],["path",{d:"M12 17C12 16.0681 12 15.6022 12.1522 15.2346C12.3552 14.7446 12.7446 14.3552 13.2346 14.1522C13.6022 14 14.0681 14 15 14C15.9319 14 16.3978 14 16.7654 14.1522C17.2554 14.3552 17.6448 14.7446 17.8478 15.2346C18 15.6022 18 16.0681 18 17C18 17.9319 18 18.3978 17.8478 18.7654C17.6448 19.2554 17.2554 19.6448 16.7654 19.8478C16.3978 20 15.9319 20 15 20C14.0681 20 13.6022 20 13.2346 19.8478C12.7446 19.6448 12.3552 19.2554 12.1522 18.7654C12 18.3978 12 17.9319 12 17Z",stroke:"currentColor",strokeWidth:"1.5",key:"5"}]];var y8=[["path",{d:"M13 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 13V21M22 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var b8=[["path",{d:"M19 21C19.6068 20.4102 22 18.8403 22 18C22 17.1597 19.6068 15.5898 19 15M21 18H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 21C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C21.9796 9.05942 21.9992 10.0588 22 12V13",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]];var v8=[["path",{d:"M8 6.50116H16.75C18.8567 6.50116 19.91 6.50116 20.6667 7.0069C20.9943 7.22584 21.2755 7.50717 21.4944 7.83484C22 8.59173 22 9.64538 22 11.7527C22 12.0122 22 12.2621 21.9997 12.5029M12 6.50116L11.3666 5.23392C10.8418 4.18406 10.3622 3.1273 9.19926 2.69106C8.6899 2.5 8.10802 2.5 6.94427 2.5C5.1278 2.5 4.21956 2.5 3.53806 2.88043C3.05227 3.15161 2.65142 3.55257 2.38032 4.03851C2 4.72021 2 5.62871 2 7.44571V10.5023C2 15.2177 2 17.5754 3.46447 19.0403C4.70529 20.2815 6.58687 20.4711 10 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"14",cy:"12.5",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"20",cy:"18.5",r:"2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M18 18.5C15.7909 18.5 14 16.7091 14 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14 14.5V21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]];Vm();var w8=[["path",{d:"M8 7H16.75C18.8567 7 19.91 7 20.6667 7.50559C20.9943 7.72447 21.2755 8.00572 21.4944 8.33329C22 9.08996 22 10.1433 22 12.25C22 15.7612 22 17.5167 21.1573 18.7779C20.7926 19.3238 20.3238 19.7926 19.7779 20.1573C18.5167 21 16.7612 21 13.25 21H12C7.28595 21 4.92893 21 3.46447 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38032 4.53806C2.65142 4.05227 3.05227 3.65142 3.53806 3.38032C4.21956 3 5.1278 3 6.94427 3C8.10802 3 8.6899 3 9.19926 3.19101C10.3622 3.62712 10.8418 4.68358 11.3666 5.73313L12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}]];var x8=[["path",{d:"M8.00164 6.50013H16.754C18.8613 6.50013 19.9149 6.50013 20.6718 7.00574C20.9995 7.22462 21.2808 7.50588 21.4997 7.83346C21.8937 8.42301 21.9808 9.19265 22 10.5003M12.0027 6.50013L11.3691 5.23321C10.8442 4.18363 10.3645 3.12714 9.20122 2.69101C8.69172 2.5 8.10969 2.5 6.94562 2.5C5.12865 2.5 4.22017 2.5 3.53848 2.88033C3.05255 3.15144 2.6516 3.5523 2.38042 4.03811C2 4.71963 2 5.6279 2 7.44443V10.5003C2 15.2145 2 17.5716 3.46487 19.0361C4.82227 20.3931 6.94628 20.4927 11.0025 20.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M21.4649 15C20.7733 13.8044 19.4806 13 18 13C16.4726 13 15.1451 13.8561 14.4713 15.1147M14.5351 19C15.2267 20.1956 16.5194 21 18 21C19.5227 21 20.8467 20.1492 21.5224 18.897M17 15.5H16C15.0572 15.5 14.5858 15.5 14.2929 15.2071C14 14.9142 14 14.4428 14 13.5V12.5M19 18.5H20C20.9428 18.5 21.4142 18.5 21.7071 18.7929C22 19.0858 22 19.5572 22 20.5V21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var I8=[["path",{d:"M15.0244 21H12.0222C7.29769 21 4.93543 21 3.46772 19.5355C2 18.0711 2 15.714 2 11V7.94427C2 6.1278 2 5.21956 2.38116 4.53806C2.65287 4.05227 3.0546 3.65142 3.54148 3.38032C4.22449 3 5.13474 3 6.95525 3C8.12158 3 8.70475 3 9.21524 3.19101C10.3808 3.62712 10.8614 4.68358 11.3874 5.73313L12.0222 7M8.01332 7H16.7827C18.8941 7 19.9498 7 20.7081 7.50559C21.0364 7.72447 21.3183 8.00572 21.5377 8.33329C21.8193 8.75388 21.9444 9.26614 22 10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.9961 14C15.9961 12.6193 17.1159 11.5 18.4973 11.5C19.8786 11.5 20.9984 12.6193 20.9984 14C20.9984 14.8571 20.5668 15.6135 19.9091 16.0639C19.2259 16.5317 18.4985 17.172 18.5 18M18.625 20.75H18.5M18.75 20.75C18.75 20.8881 18.6381 21 18.5 21C18.3619 21 18.25 20.8881 18.25 20.75C18.25 20.6119 18.3619 20.5 18.5 20.5C18.6381 20.5 18.75 20.6119 18.75 20.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var S8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 9.5C9.5 8.11929 10.6193 7 12 7C13.3807 7 14.5 8.11929 14.5 9.5C14.5 10.3569 14.0689 11.1131 13.4117 11.5636C12.7283 12.0319 12 12.6716 12 13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var _8=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 16V12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 8.25H12M12.25 8.25C12.25 8.11193 12.1381 8 12 8C11.8619 8 11.75 8.11193 11.75 8.25C11.75 8.38807 11.8619 8.5 12 8.5C12.1381 8.5 12.25 8.38807 12.25 8.25Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var P8=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]];var L8=[["path",{d:"M12 20.5C19.1328 20.5 22 16.4706 22 11.5C22 6.52944 20.1328 2.5 12 2.5C4.13281 2.5 2 6.52944 2 11.5C2 13.5712 2.37034 15.4791 3.37161 17C4.63281 19 3.99253 20.8333 3 21.5C4.61547 21.5 5.70211 20.9858 6.39239 20.4766C6.88252 20.115 7.50688 19.9364 8.0984 20.0815C9.20689 20.3533 10.4991 20.5 12 20.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10 9C10 7.89543 10.8954 7 12 7C13.1046 7 14 7.89543 14 9C14 9.57777 13.755 10.0983 13.3632 10.4634C12.7572 11.0282 12 11.6716 12 12.5M12.125 15.75H12M12.25 15.75C12.25 15.8881 12.1381 16 12 16C11.8619 16 11.75 15.8881 11.75 15.75C11.75 15.6119 11.8619 15.5 12 15.5C12.1381 15.5 12.25 15.6119 12.25 15.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var M8=[["path",{d:"M6.00449 12.5V12M18.0045 12.5V12M12.0045 12.5V12M7.00449 12.5C7.00449 11.9477 6.55677 11.5 6.00449 11.5C5.4522 11.5 5.00449 11.9477 5.00449 12.5C5.00449 13.0523 5.4522 13.5 6.00449 13.5C6.55677 13.5 7.00449 13.0523 7.00449 12.5ZM19.0045 12.5C19.0045 11.9477 18.5568 11.5 18.0045 11.5C17.4522 11.5 17.0045 11.9477 17.0045 12.5C17.0045 13.0523 17.4522 13.5 18.0045 13.5C18.5568 13.5 19.0045 13.0523 19.0045 12.5ZM13.0045 12.5C13.0045 11.9477 12.5568 11.5 12.0045 11.5C11.4522 11.5 11.0045 11.9477 11.0045 12.5C11.0045 13.0523 11.4522 13.5 12.0045 13.5C12.5568 13.5 13.0045 13.0523 13.0045 12.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var R8=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]];var T8=[["path",{d:"M21.3175 7.14139L20.8239 6.28479C20.4506 5.63696 20.264 5.31305 19.9464 5.18388C19.6288 5.05472 19.2696 5.15664 18.5513 5.36048L17.3311 5.70418C16.8725 5.80994 16.3913 5.74994 15.9726 5.53479L15.6357 5.34042C15.2766 5.11043 15.0004 4.77133 14.8475 4.37274L14.5136 3.37536C14.294 2.71534 14.1842 2.38533 13.9228 2.19657C13.6615 2.00781 13.3143 2.00781 12.6199 2.00781H11.5051C10.8108 2.00781 10.4636 2.00781 10.2022 2.19657C9.94085 2.38533 9.83106 2.71534 9.61149 3.37536L9.27753 4.37274C9.12465 4.77133 8.84845 5.11043 8.48937 5.34042L8.15249 5.53479C7.73374 5.74994 7.25259 5.80994 6.79398 5.70418L5.57375 5.36048C4.85541 5.15664 4.49625 5.05472 4.17867 5.18388C3.86109 5.31305 3.67445 5.63696 3.30115 6.28479L2.80757 7.14139C2.45766 7.74864 2.2827 8.05227 2.31666 8.37549C2.35061 8.69871 2.58483 8.95918 3.05326 9.48012L4.0843 10.6328C4.3363 10.9518 4.51521 11.5078 4.51521 12.0077C4.51521 12.5078 4.33636 13.0636 4.08433 13.3827L3.05326 14.5354C2.58483 15.0564 2.35062 15.3168 2.31666 15.6401C2.2827 15.9633 2.45766 16.2669 2.80757 16.8741L3.30114 17.7307C3.67443 18.3785 3.86109 18.7025 4.17867 18.8316C4.49625 18.9608 4.85542 18.8589 5.57377 18.655L6.79394 18.3113C7.25263 18.2055 7.73387 18.2656 8.15267 18.4808L8.4895 18.6752C8.84851 18.9052 9.12464 19.2442 9.2775 19.6428L9.61149 20.6403C9.83106 21.3003 9.94085 21.6303 10.2022 21.8191C10.4636 22.0078 10.8108 22.0078 11.5051 22.0078H12.6199C13.3143 22.0078 13.6615 22.0078 13.9228 21.8191C14.1842 21.6303 14.294 21.3003 14.5136 20.6403L14.8476 19.6428C15.0004 19.2442 15.2765 18.9052 15.6356 18.6752L15.9724 18.4808C16.3912 18.2656 16.8724 18.2055 17.3311 18.3113L18.5513 18.655C19.2696 18.8589 19.6288 18.9608 19.9464 18.8316C20.264 18.7025 20.4506 18.3785 20.8239 17.7307L21.3175 16.8741C21.6674 16.2669 21.8423 15.9633 21.8084 15.6401C21.7744 15.3168 21.5402 15.0564 21.0718 14.5354L20.0407 13.3827C19.7887 13.0636 19.6098 12.5078 19.6098 12.0077C19.6098 11.5078 19.7888 10.9518 20.0407 10.6328L21.0718 9.48012C21.5402 8.95918 21.7744 8.69871 21.8084 8.37549C21.8423 8.05227 21.6674 7.74864 21.3175 7.14139Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15.5195 12C15.5195 13.933 13.9525 15.5 12.0195 15.5C10.0865 15.5 8.51953 13.933 8.51953 12C8.51953 10.067 10.0865 8.5 12.0195 8.5C13.9525 8.5 15.5195 10.067 15.5195 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]];var A8=[["path",{d:"M2 12C2 8.31087 2 6.4663 2.81382 5.15877C3.1149 4.67502 3.48891 4.25427 3.91891 3.91554C5.08116 3 6.72077 3 10 3H14C17.2792 3 18.9188 3 20.0811 3.91554C20.5111 4.25427 20.8851 4.67502 21.1862 5.15877C22 6.4663 22 8.31087 22 12C22 15.6891 22 17.5337 21.1862 18.8412C20.8851 19.325 20.5111 19.7457 20.0811 20.0845C18.9188 21 17.2792 21 14 21H10C6.72077 21 5.08116 21 3.91891 20.0845C3.48891 19.7457 3.1149 19.325 2.81382 18.8412C2 17.5337 2 15.6891 2 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 3L9.5 21",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M5 7H6M5 10H6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var $8=[["path",{d:"M3.99963 5.00055L9.99963 5.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.9996 5.00031L19.9996 5.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M15.9996 9.00031L15.9996 15.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M9.99963 2.00031L9.99963 8.00031",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M11.9996 16.0003L11.9996 22.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M15.9996 12.0001L19.9996 12.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M3.99963 12.0005L12.9996 12.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M11.9996 19.0003L19.9996 19.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}],["path",{d:"M3.99963 19.0005L8.99963 19.0003",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"8"}]];var E8=[["path",{d:"M17 8L18.8398 9.85008C19.6133 10.6279 20 11.0168 20 11.5C20 11.9832 19.6133 12.3721 18.8398 13.1499L17 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 8L5.16019 9.85008C4.38673 10.6279 4 11.0168 4 11.5C4 11.9832 4.38673 12.3721 5.16019 13.1499L7 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14.5 4L9.5 20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var D8=[["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 2.20004C13.3538 2.06886 12.6849 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.3151 21.9311 10.6462 21.8 10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.0303 11.9625L16.5832 7.4096M19.7404 4.34462L19.1872 2.35748C19.0853 2.03011 18.6914 1.89965 18.4259 2.11662C16.9898 3.29018 15.4254 4.87091 16.703 7.36419C19.2771 8.56455 20.7466 6.94584 21.8733 5.5853C22.0975 5.3146 21.9623 4.90767 21.6247 4.81005L19.7404 4.34462Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var O8=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];var N8=[["path",{d:"M3 15V14H21V15C21 17.8284 21 19.2426 20.1213 20.1213C19.2426 21 17.8284 21 15 21H9C6.17157 21 4.75736 21 3.87868 20.1213C3 19.2426 3 17.8284 3 15Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 14L3.00001 12.9999C3.00003 11.5278 3.00004 10.7918 3.31675 10.1584C3.63347 9.52493 4.22231 9.08329 5.39999 8.20002C6.19297 7.60528 6.58946 7.30791 7.05132 7.15395C7.51317 7 8.00879 7 9.00002 7H15C15.9912 7 16.4868 7 16.9487 7.15395C17.4105 7.3079 17.807 7.60527 18.6 8.2C19.7777 9.08328 20.3666 9.52492 20.6833 10.1584C21 10.7918 21 11.5279 21 13V14H3Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M16 12V16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M8 12V16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M8.49997 7.00006V6.50006C8.49997 5.0956 8.49997 4.39337 8.83703 3.88892C8.98295 3.67054 9.17045 3.48304 9.38883 3.33712C9.89328 3.00006 10.5955 3.00006 12 3.00006C13.4044 3.00006 14.1067 3.00006 14.6111 3.33712C14.8295 3.48304 15.017 3.67054 15.1629 3.88892C15.5 4.39337 15.5 5.0956 15.5 6.50006V7.00006",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}]];var z8=[["path",{d:"M20.0004 10.9826C20.6281 10.1316 21 9.07385 21 7.92761C21 5.11556 18.7614 2.83594 16 2.83594C14.0209 2.83594 12.3104 4.00687 11.5 5.70554",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14.6364 21.1658H9.36364C6.67794 21.1658 5.33509 21.1658 4.40253 20.4549C4.13533 20.2512 3.89812 20.0096 3.69811 19.7375C3 18.7879 3 17.4204 3 14.6855C3 13.1226 3 12.3412 3.39892 11.7986C3.51321 11.6431 3.64876 11.505 3.80144 11.3887C4.33434 10.9824 5.10168 10.9824 6.63636 10.9824H17.3636C18.8983 10.9824 19.6657 10.9824 20.1986 11.3887C20.3512 11.505 20.4868 11.6431 20.6011 11.7986C21 12.3412 21 13.1226 21 14.6855C21 17.4204 21 18.7879 20.3019 19.7375C20.1019 20.0096 19.8647 20.2512 19.5975 20.4549C18.6649 21.1658 17.3221 21.1658 14.6364 21.1658Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M10 15.0547H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M13.6858 10.9826L13.335 10.1564C13.2474 9.94999 13.2565 9.71349 13.3595 9.51989L14.9144 6.59747C15.1776 6.10273 14.7982 5.48558 14.2636 5.53902L11.1099 5.85432C10.9004 5.87526 10.692 5.78776 10.5492 5.6189L8.39732 3.07491C8.03241 2.64349 7.37203 2.82539 7.26584 3.38656L6.63969 6.69573C6.59813 6.91538 6.46021 7.09827 6.26863 7.18779L3.38401 8.53572C2.89509 8.76418 2.86669 9.49366 3.33529 9.78682L5.24666 10.9826",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]];var j8=[["path",{d:"M3 20.5002C3.28417 16.8058 6.3 13.7193 10.0008 13.5379C10.3134 13.5226 10.6446 13.5097 11 13.5L11.995 13.5663C12.6939 13.6129 13.3665 13.7543 14 13.9777",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18 15.5V21.5M21 18.5L15 18.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"11",cy:"6.5",r:"4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]];var Z8=[["path",{d:"M5.25 5L19.25 19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M22.25 12C22.25 6.47715 17.7728 2 12.25 2C6.72715 2 2.25 6.47715 2.25 12C2.25 17.5228 6.72715 22 12.25 22C17.7728 22 22.25 17.5228 22.25 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]];var W8=[["path",{d:"M15 5C15 6.65685 13.6569 8 12 8C10.3431 8 9 6.65685 9 5C9 3.34315 10.3431 2 12 2C13.6569 2 15 3.34315 15 5Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V9M12 9C12 9.93188 12 10.3978 12.1776 10.7654C12.4144 11.2554 12.8687 11.6448 13.4404 11.8478C13.8692 12 14.4128 12 15.5 12C16.5872 12 17.1308 12 17.5596 12.1522C18.1313 12.3552 18.5856 12.7446 18.8224 13.2346C19 13.6022 19 14.0681 19 15V16M12 9C12 9.93188 12 10.3978 11.8224 10.7654C11.5856 11.2554 11.1313 11.6448 10.5596 11.8478C10.1308 12 9.5872 12 8.5 12C7.4128 12 6.8692 12 6.44041 12.1522C5.86867 12.3552 5.41443 12.7446 5.17761 13.2346C5 13.6022 5 14.0681 5 15V16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M8 19C8 20.6569 6.65685 22 5 22C3.34315 22 2 20.6569 2 19C2 17.3431 3.34315 16 5 16C6.65685 16 8 17.3431 8 19Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M22 19C22 20.6569 20.6569 22 19 22C17.3431 22 16 20.6569 16 19C16 17.3431 17.3431 16 19 16C20.6569 16 22 17.3431 22 19Z",stroke:"currentColor",strokeWidth:"1.5",key:"3"}]];var V8=[["path",{d:"M8.62814 12.6736H8.16918C6.68545 12.6736 5.94358 12.6736 5.62736 12.1844C5.31114 11.6953 5.61244 11.0138 6.21504 9.65083L8.02668 5.55323C8.57457 4.314 8.84852 3.69438 9.37997 3.34719C9.91142 3 10.5859 3 11.935 3H14.0244C15.6632 3 16.4826 3 16.7916 3.53535C17.1007 4.0707 16.6942 4.78588 15.8811 6.21623L14.8092 8.10188C14.405 8.81295 14.2029 9.16849 14.2057 9.45952C14.2094 9.83775 14.4105 10.1862 14.7354 10.377C14.9854 10.5239 15.3927 10.5239 16.2074 10.5239C17.2373 10.5239 17.7523 10.5239 18.0205 10.7022C18.3689 10.9338 18.5513 11.3482 18.4874 11.7632C18.4382 12.0826 18.0918 12.4656 17.399 13.2317L11.8639 19.3523C10.7767 20.5545 10.2331 21.1556 9.86807 20.9654C9.50303 20.7751 9.67833 19.9822 10.0289 18.3962L10.7157 15.2896C10.9826 14.082 11.1161 13.4782 10.7951 13.0759C10.4741 12.6736 9.85877 12.6736 8.62814 12.6736Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]];Km();var Z_=[["path",{d:"M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 11.4C2 10.2417 2.24173 10 3.4 10H10.6C11.7583 10 12 10.2417 12 11.4V12.6C12 13.7583 11.7583 14 10.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M2 19.4C2 18.2417 2.24173 18 3.4 18H10.6C11.7583 18 12 18.2417 12 19.4V20.6C12 21.7583 11.7583 22 10.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M18 13V21M22 17H14",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}]],W_=[["path",{d:"M2 3.4C2 2.24173 2.24173 2 3.4 2H20.6C21.7583 2 22 2.24173 22 3.4V4.6C22 5.75827 21.7583 6 20.6 6H3.4C2.24173 6 2 5.75827 2 4.6V3.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 11.4C2 10.2417 2.24173 10 3.4 10H10.6C11.7583 10 12 10.2417 12 11.4V12.6C12 13.7583 11.7583 14 10.6 14H3.4C2.24173 14 2 13.7583 2 12.6V11.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M2 19.4C2 18.2417 2.24173 18 3.4 18H10.6C11.7583 18 12 18.2417 12 19.4V20.6C12 21.7583 11.7583 22 10.6 22H3.4C2.24173 22 2 21.7583 2 20.6V19.4Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14 17H22M19 14L22 17L19 20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],KC={AlertCircle:t8,AlertTriangle:e8,Archive:n8,Bot:s8,Bug:c8,Check:O8,ChevronDown:r8,ChevronLeft:o8,ChevronRight:i8,Circle:p8,CircleCheck:d8,CircleQuestion:S8,CircleX:u8,ClosePluginPane:Mu,CloseThreadPane:Mu,Code:E8,ComputerTerminal01:Wm,Copy:f8,Download:g8,Edit:C8,FilterHorizontal:k8,Folder:w8,FolderExport:b8,FolderGit:v8,FolderPlus:y8,FolderSync:x8,FolderUnknown:I8,Folder02:Ru,Info:_8,ListTodo:l8,Loading:P8,MessageQuestion:L8,MessageCirclePlus:Zm,MessageSquarePlus:Zm,MessageSquare:a8,MoreHorizontal:M8,PanelLeft:A8,Search:R8,SectionAdd:Z_,SectionMove:W_,Settings:T8,SlidersHorizontal:$8,Spinner:m8,Target:D8,Terminal:Wm,Toolbox:N8,ToolCase:z8,Trash2:h8,Unavailable:Z8,UserRoundPlus:j8,Workflow:W8,X:Mu,Zap:V8},V_=Object.keys(KC),H_=[...V_,...B8],F_=KC,Ym=null;function B_(){return Tu()!==null?Promise.resolve():(Ym??=Promise.resolve().then(()=>(BC(),FC)).then(()=>{},e=>{throw Ym=null,e}),Ym)}var U_=[],K_=new Set(H_),UC=be([]);function Jm(e){return K_.has(e)}var Qm=class extends tl{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};function Ht({name:e,fallback:t="Zap",...n}){let r=ve(UC),o=sn(Bm,()=>ds(e),()=>ds(e)),i=sn(Bm,()=>ds(t),()=>ds(t)),s=sn(Um,()=>ps(e),()=>ps(e)),a=sn(Um,()=>ps(t),()=>ps(t)),c=o!==void 0||Jm(e)||s!==void 0,u=c?e:t,l=c?o:i,d=c?s:a,m=l?.component;return r.includes(u)?f(Xm,{name:Jm(u)?u:"Zap",...n}):m!==void 0&&l!==void 0?f(UC.Provider,{value:[...r,u],children:f(Qm,{fallback:f(Xm,{name:"Zap",...n}),children:f("span",{className:x("inline-flex size-6 shrink-0",n.className),style:n.style,"aria-hidden":n["aria-hidden"],"aria-label":n["aria-label"],role:n["aria-label"]?"img":void 0,"data-icon":u,"data-icon-root":"",children:f(m,{className:"size-full"})})},l.key)}):m===void 0&&d!==void 0?f(G_,{url:d,resolved:u,...n}):f(Xm,{name:Jm(u)?u:"Zap",...n})}function G_({url:e,resolved:t,className:n,style:r,"aria-hidden":o,"aria-label":i}){let s=`url("${e.replace(/["\\]/gu,"\\$&")}")`;return f("span",{className:x("inline-block size-6 shrink-0",n),style:{...r,backgroundColor:"currentColor",maskImage:s,maskPosition:"center",maskRepeat:"no-repeat",maskSize:"contain",WebkitMaskImage:s,WebkitMaskPosition:"center",WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain"},"aria-hidden":o,"aria-label":i,role:i?"img":void 0,"data-icon":t,"data-icon-root":"","data-plugin-icon-asset":e})}function Xm({name:e,className:t,style:n,"aria-hidden":r,"aria-label":o}){let i=F_[e];return i!==void 0?f(ls,{icon:i,className:x(t),style:n,"aria-hidden":r,"aria-label":o,"data-icon":e,"data-icon-root":""}):f(q_,{name:e,className:t,style:n,"aria-hidden":r,"aria-label":o})}function q_({name:e,className:t,style:n,"aria-hidden":r,"aria-label":o}){let s=sn(K8,Tu,Tu)?.[e];return s===void 0&&B_().catch(()=>{}),f(ls,{icon:s??U_,className:x(t),style:n,"aria-hidden":r,"aria-label":o,"data-icon":e,"data-icon-root":"","data-icon-pending":s===void 0?"":void 0})}var GC=be({isCompactViewport:!1,open:!1,onOpenChange:()=>{},titleId:"",descriptionId:"",registerTitleId:()=>()=>{},registerDescriptionId:()=>()=>{}});function fs(){return ve(GC)}function ms({children:e,open:t,onOpenChange:n,...r}){let o=zr(t,n),i=In(),s=In(),[a,c]=A(i),[u,l]=A(s),d=N(g=>(c(g),()=>c(i)),[i]),m=N(g=>(l(g),()=>l(s)),[s]),p=K(()=>({...o,titleId:a,descriptionId:u,registerTitleId:d,registerDescriptionId:m}),[u,m,d,o,a]),h=p.isCompactViewport?e:f(J4,{open:p.open,onOpenChange:p.onOpenChange,...r,children:e});return f(GC.Provider,{value:p,children:h})}var Y_=F(({asChild:e,children:t,className:n,...r},o)=>{let{isCompactViewport:i,open:s,onOpenChange:a}=fs();return i?f(rr,{ref:o,asChild:e,open:s,onOpenChange:a,haspopup:"dialog",className:n,...r,children:t}):f(Q4,{ref:o,asChild:e,className:Pn(n),onMouseDown:c=>{s||Ln(),cn(c)},...r,children:t})});Y_.displayName="DialogTrigger";var J_=F(({asChild:e,onClick:t,children:n,...r},o)=>{let{isCompactViewport:i,onOpenChange:s}=fs();return i?f(e?_n:"button",{ref:o,onClick:u=>{t?.(u),u.defaultPrevented||s(!1)},...r,children:n}):f(Nm,{ref:o,asChild:e,onClick:t,...r,children:n})});J_.displayName="DialogClose";var qC=F(({className:e,...t},n)=>f(jm,{ref:n,...$e(),className:x("fixed inset-0 z-50 bg-black/40 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));qC.displayName=jm.displayName;var Lo=F(({className:e,children:t,hideCloseButton:n=!1,onAfterCloseAutoFocus:r,onCloseAutoFocus:o,...i},s)=>{let{isCompactViewport:a,open:c,onOpenChange:u,titleId:l,descriptionId:d}=fs();let m=$e();if(a){let p=jr(i);return f(Zr,{open:c,onOpenChange:u,onAfterCloseAutoFocus:r,labelledBy:l,describedBy:d,children:f("div",{ref:s,className:x("grid grid-cols-[minmax(0,1fr)] gap-4 overflow-y-auto px-4 pt-2 pb-[max(1rem,env(safe-area-inset-bottom))]",e,"max-w-none"),...p,children:t})})}return v(Y4,{children:[f(qC,{}),v(q4,{ref:s,...m,onCloseAutoFocus:p=>{o?.(p),queueMicrotask(()=>r?.())},className:x("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg grid-cols-[minmax(0,1fr)] translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-sm duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",e),...i,children:[t,n?null:v(Nm,{className:"absolute right-4 top-4 cursor-pointer rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-state-active data-[state=open]:text-foreground",children:[f(Ht,{name:"X",className:"h-4 w-4"}),f("span",{className:"sr-only",children:"Close"})]})]})]})});Lo.displayName="DialogContent";var Mo=({className:e,...t})=>f("div",{className:x("flex flex-col space-y-1.5 text-left",e),...t});Mo.displayName="DialogHeader";var $u=({className:e,...t})=>f("div",{className:x("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});$u.displayName="DialogFooter";var Ro=F(({asChild:e,className:t,id:n,children:r,...o},i)=>{let{isCompactViewport:s,titleId:a,registerTitleId:c}=fs(),u=n??a;if(at(()=>{if(s)return c(u)},[s,c,u]),s){let l={id:u,className:x("text-base font-semibold leading-none tracking-tight",t),...o};return e?f(_n,{ref:i,...l,children:r}):f("h2",{ref:i,...l,children:r})}return f(X4,{ref:i,asChild:e,...n===void 0?{}:{id:n},className:x("text-base font-semibold leading-none tracking-tight",t),...o,children:r})});Ro.displayName="DialogTitle";var Eu=F(({asChild:e,className:t,id:n,children:r,...o},i)=>{let{isCompactViewport:s,descriptionId:a,registerDescriptionId:c}=fs(),u=n??a;if(at(()=>{if(s)return c(u)},[s,c,u]),s){let l={id:u,className:x("text-sm text-muted-foreground",t),...o};return e?f(_n,{ref:i,...l,children:r}):f("p",{ref:i,...l,children:r})}return f(zm,{ref:i,asChild:e,...n===void 0?{}:{id:n},className:x("text-sm text-muted-foreground",t),...o,children:r})});Eu.displayName=zm.displayName;var YC="text-sm max-md:pointer-coarse:text-base";var Hn="h-3.5 w-3.5 max-md:pointer-coarse:h-5 max-md:pointer-coarse:w-5",JC="h-[28px] w-[28px] rounded-md p-0 max-md:pointer-coarse:h-[36px] max-md:pointer-coarse:w-[36px]",Zj=`${JC} [&_[data-icon-root]]:size-[16px] max-md:pointer-coarse:[&_[data-icon-root]]:size-[20px]`,Wj=`${JC} [&_[data-icon-root]]:size-[13px] max-md:pointer-coarse:[&_[data-icon-root]]:size-[16px]`;var XC="h-9 max-md:pointer-coarse:h-10";var Du=F(({className:e,type:t,...n},r)=>f("input",{type:t,autoComplete:"off",className:x(`flex w-full rounded-md border border-input bg-transparent pl-3 pr-3 py-1 ${Ys} file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,XC,YC,e),ref:r,...n}));Du.displayName="Input";function QC({open:e,items:t,onOpenChange:n,onToggleHidden:r,onMove:o}){return f(ms,{open:e,onOpenChange:n,children:v(Lo,{className:"max-w-sm",children:[v(Mo,{children:[f(Ro,{children:"Customize list"}),f(Eu,{children:"Hidden groups move into More. Their counters still show there."})]}),f("ul",{className:"flex flex-col gap-0.5","aria-label":"Groups",children:t.map((i,s)=>v("li",{"data-sidebar-customize-item":i.id,className:"flex items-center gap-1 rounded-md py-0.5 pl-2 pr-1 text-sm hover:bg-accent",children:[f("span",{className:x("min-w-0 flex-1 truncate",i.hidden&&"text-muted-foreground"),children:i.label}),f(Ye,{variant:"ghost",size:"icon",className:"size-7","aria-label":`Move ${i.label} up`,disabled:s===0,onClick:()=>o(i.id,-1),children:f(H,{name:z.moveUp,"aria-hidden":!0})}),f(Ye,{variant:"ghost",size:"icon",className:"size-7","aria-label":`Move ${i.label} down`,disabled:s===t.length-1,onClick:()=>o(i.id,1),children:f(H,{name:z.collapse,"aria-hidden":!0})}),f(Ye,{variant:"ghost",size:"icon",className:"size-7","aria-pressed":!i.hidden,"aria-label":i.hidden?`Show ${i.label}`:`Hide ${i.label}`,disabled:!i.hideable,onClick:()=>r(i.id),children:f(H,{name:i.hidden?z.hidden:z.show,"aria-hidden":!0})})]},i.id))}),f($u,{children:f(Ye,{onClick:()=>n(!1),children:"Done"})})]})})}function ek({open:e,onOpenChange:t,onCreate:n}){let[r,o]=A(""),[i,s]=A(!1);return D(()=>{e&&o("")},[e]),f(ms,{open:e,onOpenChange:t,children:f(Lo,{className:"max-w-sm",children:v("form",{className:"flex flex-col gap-4",onSubmit:async a=>{a.preventDefault();let c=r.trim();if(c!==""){s(!0);try{await n(c),t(!1)}finally{s(!1)}}},children:[f(Mo,{children:f(Ro,{children:"New section"})}),f(Du,{autoFocus:!0,"aria-label":"Section name",value:r,onChange:a=>o(a.target.value)}),v($u,{children:[f(Ye,{type:"button",variant:"ghost",onClick:()=>t(!1),children:"Cancel"}),f(Ye,{type:"submit",disabled:i||r.trim()==="",children:"Create"})]})]})})})}function tk({open:e,title:t,description:n,confirmLabel:r,destructive:o,onOpenChange:i,onConfirm:s}){return f(K4,{open:e,onOpenChange:i,children:v(Mm,{children:[v(Rm,{children:[f(Am,{children:t}),f($m,{children:n})]}),v(Tm,{children:[f(Dm,{children:"Cancel"}),f(Em,{className:x(o&&"bg-destructive text-destructive-foreground hover:bg-destructive/90"),onClick:s,children:r})]})]})})}function nk({open:e,title:t,onOpenChange:n,children:r}){return f(ms,{open:e,onOpenChange:n,children:v(Lo,{className:"max-w-sm",children:[f(Mo,{children:f(Ro,{className:"sr-only",children:t})}),r]})})}function rk({open:e,title:t,targets:n,query:r,onQueryChange:o,onOpenChange:i,onMove:s}){let[a,c]=A(0);D(()=>c(0),[r,e]);let u=l=>{l!==void 0&&(s(l.parentThreadId),i(!1))};return f(ms,{open:e,onOpenChange:i,children:v(Lo,{className:"max-w-sm",children:[v(Mo,{children:[v(Ro,{children:["Move \u201C",t,"\u201D"]}),f(Eu,{children:"Nest it under another thread, or move it to the top level."})]}),f(Du,{autoFocus:!0,role:"combobox","aria-expanded":!0,"aria-controls":"thread-glance-move-targets","aria-activedescendant":n[a]?`thread-glance-move-${a}`:void 0,"aria-label":"Find a thread",placeholder:"Find a thread",value:r,onChange:l=>o(l.target.value),onKeyDown:l=>{l.key==="ArrowDown"?(l.preventDefault(),c(d=>Math.min(d+1,n.length-1))):l.key==="ArrowUp"?(l.preventDefault(),c(d=>Math.max(d-1,0))):l.key==="Enter"&&(l.preventDefault(),u(n[a]))}}),v("ul",{id:"thread-glance-move-targets",role:"listbox","aria-label":"Move to",className:"flex max-h-72 flex-col gap-0.5 overflow-y-auto",children:[n.length===0?f("li",{className:"px-2 py-1.5 text-sm text-muted-foreground",children:"No matching threads"}):null,n.map((l,d)=>v("li",{id:`thread-glance-move-${d}`,role:"option","aria-selected":d===a,onMouseEnter:()=>c(d),onClick:()=>u(l),className:x("flex cursor-pointer flex-col rounded-md px-2 py-1.5 text-sm",d===a&&"bg-accent"),children:[f("span",{className:"truncate",children:l.label}),l.detail?f("span",{className:"truncate text-xs text-muted-foreground",children:l.detail}):null]},l.parentThreadId??"top"))]})]})})}function ok(){let e=xn(),[t,n]=A({}),r=wn(),o=$(!1),i=N(()=>{e.call("listNotes",null).then(s=>n(s.notes),()=>{})},[e]);return D(i,[i]),D(()=>{r==="connected"&&(o.current&&i(),o.current=!0)},[r,i]),vn(Wn.notes,s=>{let a=s;if(a===null||typeof a!="object"||typeof a.threadId!="string")return;let c=a.notes===null?null:Jg.safeParse(a.notes);c!==null&&!c.success||n(u=>{let l={...u};return c===null?delete l[a.threadId]:l[a.threadId]=c.data,l})}),t}function ik(e){let t=Rr(),[n,r]=A(()=>new Map),o=$(new Set);return D(()=>{for(let i of e){if(o.current.has(i))continue;o.current.add(i);let s=a=>r(c=>new Map(c).set(i,a));t.projects.get({projectId:i}).then(async a=>{let c=A4(a.sources);return c===null?null:(await t.projects.branches({projectId:i,hostId:c,limit:"1"})).defaultBranch??null}).then(s,()=>s(null))}},[e,t]),n}var X_={defaultProviderId:null,primaryHostId:null};function Q_(e){return{defaultProviderId:e.generalSettings.defaultProviderId??e.serverAccess.defaultProviderId??null,primaryHostId:e.primaryHostId}}function sk(){let e=Rr(),[t,n]=A(X_);return D(()=>{let r=!1;return Promise.resolve().then(()=>e.system.config()).then(o=>{r||n(Q_(o))},()=>{}),()=>{r=!0}},[e]),t}function ak(e,t,n="",r=50){let o=t.infos.get(e);if(o===void 0)return[];let i=u=>t.infos.get(u)?.thread.parentThreadId??null,s=n.trim().toLowerCase(),a=[];o.thread.parentThreadId!==null&&(s===""||"top level".includes(s))&&a.push({parentThreadId:null,label:"Top level",detail:"No parent thread"});let c=[...t.infos.values()].filter(u=>{let l=u.thread;return l.isHidden||l.isArchived||l.id===o.thread.parentThreadId||lm(l.id,e,i)?!1:s===""||l.displayTitle.toLowerCase().includes(s)}).sort((u,l)=>l.thread.latestAttentionAt-u.thread.latestAttentionAt);for(let u of c.slice(0,r)){let l=u.parentId===null?null:t.infos.get(u.parentId);a.push({parentThreadId:u.thread.id,label:u.thread.displayTitle,detail:l?`in ${l.thread.displayTitle}`:null})}return a}var eP=[["waits-on-you","needing you"],["failed","failed"],["queue-failed","queue failed"],["offline","offline"],["working","working"],["background","in background"],["scheduled","scheduled"],["queued","queued"],["unread","unread"],["draft","drafts"],["idle","idle"]];function ck(e){let t=new Map;for(let r of e)r.thread.isHidden||t.set(r.state.kind,(t.get(r.state.kind)??0)+1);let n=eP.filter(([r])=>t.has(r)).map(([r,o])=>`${t.get(r)} ${o}`);return n.length>0?n.join(", "):null}function uk(e,t){if(e===void 0)return[];if(e.root.thread.id===t)return e.descendants;let n=[],r=new Set([t]);for(let o of e.descendants)o.parentId!==null&&r.has(o.parentId)&&(r.add(o.thread.id),n.push(o));return n}function To(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function lk(e,t){if(t===null)return null;let n=t==="now"?"just now":`${t} ago`;switch(e){case"working":case"background":return`started ${n}`;case"waits-on-you":return`waiting since ${n}`;case"failed":return`failed ${n}`;default:return`finished ${n}`}}function dk(e,t){return t.find(n=>n.model===e||n.id===e)?.displayName??e}var Ou={attention:"text-attention",destructive:"text-destructive",working:"text-[var(--timeline-accent)]",background:"text-muted-foreground","muted-strong":"text-muted-foreground/75",muted:"text-muted-foreground",none:""},pk="animate-shine-icon motion-reduce:animate-none",tP="animate-spin motion-reduce:animate-none";function fk({label:e,className:t}){return f("span",{role:e?"img":void 0,"aria-label":e,"aria-hidden":e?void 0:!0,className:x("inline-block size-[6px] shrink-0 rounded-full bg-[var(--timeline-accent)]",t)})}function nP({className:e}){return f("span",{"aria-hidden":!0,className:x("inline-block size-2.5 shrink-0 rounded-full border-[1.5px] border-current",e)})}function hs({glyph:e,label:t,className:n}){return e.icon==="ring"?f(nP,{className:Ou[e.tone]}):e.icon==="dot"?f(fk,{label:t}):f(H,{name:e.icon,"aria-label":t,"aria-hidden":t?void 0:!0,className:x("size-4 shrink-0",Ou[e.tone],e.spin&&tP,e.shine&&pk,n)})}function mk({status:e}){let t=e.tone==="error"?"text-destructive":e.tone==="success"?"text-success-foreground":e.tone==="running"?"text-success motion-safe:animate-pulse":"text-muted-foreground";return f(H,{name:e.icon,"aria-label":e.label,className:x("size-4 shrink-0",t,e.tone==="running"&&pk)})}var rP={attention:"text-attention",destructive:"text-destructive",muted:"text-muted-foreground"};function Nu({note:e}){return v(_t,{children:[f("span",{className:rP[e.tone],children:e.text===""?e.prefix:`${e.prefix}:`}),e.text===""?null:` ${e.text}`]})}function zu({flag:e,className:t}){return f(hs,{glyph:la[e],className:t})}function hk({flag:e}){return la[e].icon==="dot"?f(fk,{className:"size-[5px]"}):f(zu,{flag:e,className:"size-3"})}var oP=[{key:"waitsOnYou",flag:"waits-on-you",label:e=>`${e} waiting on you`},{key:"failed",flag:"unread-failed",label:e=>`${e} failed`},{key:"offline",flag:"offline",label:e=>`${e} waiting for an offline machine`},{key:"working",flag:"working",label:e=>`${e} working`},{key:"unread",flag:"unread",label:e=>`${e} unread`}];function ju({counters:e,className:t}){let n=oP.filter(r=>e[r.key]>0);return n.length===0?null:f("span",{role:"group","aria-label":n.map(r=>r.label(e[r.key])).join(", "),className:x("inline-flex shrink-0 items-center gap-1.5 text-xs tabular-nums",t),children:n.map(r=>v("span",{"aria-hidden":!0,className:"inline-flex items-center gap-0.5 text-muted-foreground",children:[f(zu,{flag:r.flag,className:"size-3.5"}),e[r.key]]},r.key))})}var iP=500,sP=new Set(["Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),gs=!1,Zu=0,gk=0;function Ck(e){gs=sP.has(e.key)}function kk(){gs=!1,Zu+=1}function yk(){Zu+=1}function bk(e,t){let[n,r]=A(!1),o=$(null),i=$(null),s=$(!1),a=()=>{o.current!==null&&clearTimeout(o.current),o.current=null},c=()=>{if(o.current!==null||!t||s.current)return;let u=Zu;o.current=setTimeout(()=>{o.current=null,Zu===u&&r(!0)},iP)};return D(()=>(gk++===0&&(gs=!1,document.addEventListener("keydown",Ck,!0),document.addEventListener("pointerdown",kk,!0)),()=>{a(),--gk===0&&(document.removeEventListener("keydown",Ck,!0),document.removeEventListener("pointerdown",kk,!0))}),[]),D(()=>{a(),r(!1)},[e,t]),{open:n&&t&&!e,onOpenChange:u=>{u||(a(),r(!1))},rowProps:{onPointerEnter:u=>{i.current={x:u.clientX,y:u.clientY}},onPointerMove:u=>{if(u.pointerType==="touch")return;let l=i.current;l!==null&&l.x===u.clientX&&l.y===u.clientY||(i.current=null,c())},onPointerLeave:()=>{a(),i.current=null,s.current=!1},onPointerDown:()=>{s.current=!0,a(),r(!1)},onFocus:()=>{gs&&(gs=!1,c())},onBlur:a}}}function aP(e){return e.type==="pointerdown"?"pointer":e.type!=="keydown"||e.metaKey||e.ctrlKey||e.altKey||e.key==="Shift"||e.key==="Meta"||e.key==="Control"||e.key==="Alt"?null:"keyboard"}var vk="group-hover/row:opacity-0 in-data-[input-modality=keyboard]:group-focus-within/row:opacity-0",wk="opacity-0 group-hover/row:opacity-100 in-data-[input-modality=keyboard]:group-focus-within/row:opacity-100",xk="hidden group-hover/row:flex in-data-[input-modality=keyboard]:group-focus-within/row:flex",Ik="group-hover/header:opacity-0 in-data-[input-modality=keyboard]:group-focus-within/header:opacity-0",Sk="pointer-events-none opacity-0 group-hover/header:pointer-events-auto group-hover/header:opacity-100 in-data-[input-modality=keyboard]:group-focus-within/header:pointer-events-auto in-data-[input-modality=keyboard]:group-focus-within/header:opacity-100";function _k(e){D(()=>{let t=n=>{let r=aP(n);r!==null&&e.current?.setAttribute("data-input-modality",r)};return document.addEventListener("keydown",t,!0),document.addEventListener("pointerdown",t,!0),()=>{document.removeEventListener("keydown",t,!0),document.removeEventListener("pointerdown",t,!0)}},[e])}var eh=globalThis.__bbPluginRuntime;if(eh==null||eh.radixDropdownMenu==null)throw new Error('Cannot load "@radix-ui/react-dropdown-menu": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Wu=eh.radixDropdownMenu,PZ="default"in Wu?Wu.default:Wu,{Arrow:LZ,CheckboxItem:Pk,Content:Lk,DropdownMenu:MZ,DropdownMenuArrow:RZ,DropdownMenuCheckboxItem:TZ,DropdownMenuContent:AZ,DropdownMenuGroup:$Z,DropdownMenuItem:EZ,DropdownMenuItemIndicator:DZ,DropdownMenuLabel:OZ,DropdownMenuPortal:NZ,DropdownMenuRadioGroup:zZ,DropdownMenuRadioItem:jZ,DropdownMenuSeparator:ZZ,DropdownMenuSub:WZ,DropdownMenuSubContent:VZ,DropdownMenuSubTrigger:HZ,DropdownMenuTrigger:FZ,Group:Mk,Item:Rk,ItemIndicator:th,Label:Tk,Portal:Ak,RadioGroup:cP,RadioItem:nh,Root:$k,Separator:Ek,Sub:Dk,SubContent:rh,SubTrigger:oh,Trigger:Ok,createDropdownMenuScope:BZ}=Wu;var lP=new Set(["ArrowDown","ArrowUp","Home","End","PageDown","PageUp"]),mn="data-[last-hovered]:bg-state-hover data-[last-hovered]:text-foreground",Nk=be({lastHoveredId:null,setLastHovered:()=>{},clearLastHovered:()=>{}});function Vu({children:e}){let[t,n]=A(null),r=K(()=>({lastHoveredId:t,setLastHovered:n,clearLastHovered:()=>n(null)}),[t]);return f(Nk.Provider,{value:r,children:e})}function nn(e){let t=In(),{lastHoveredId:n,setLastHovered:r,clearLastHovered:o}=ve(Nk),i=n===t,s=$(e);s.current=e;let a=N(u=>{s.current?.onPointerEnter?.(u),r(t)},[t,r]),c=N(u=>{s.current?.onKeyDown?.(u),lP.has(u.key)&&o()},[o]);return{isLastHovered:i,hoverProps:{"data-last-hovered":i?"":void 0,onPointerEnter:a,onKeyDown:c}}}var dP="focus:bg-state-hover focus:text-foreground data-[last-hovered]:bg-state-hover data-[last-hovered]:text-foreground",pP="text-destructive focus:bg-destructive/15 focus:text-destructive data-[last-hovered]:bg-destructive/15",fP="text-destructive focus:bg-destructive/15 focus:text-destructive active:bg-destructive/20 active:text-destructive",ih=be({isCompactViewport:!1,open:!1,onOpenChange:()=>{}});function Fn(){return ve(ih)}function Ao({children:e,open:t,onOpenChange:n,defaultOpen:r,...o}){let i=zr(t,n,r);return i.isCompactViewport?f(ih.Provider,{value:i,children:e}):f($k,{open:i.open,onOpenChange:i.onOpenChange,...o,children:f(ih.Provider,{value:i,children:e})})}var Ir=F(({asChild:e,children:t,className:n,...r},o)=>{let{isCompactViewport:i,open:s,onOpenChange:a}=Fn();return i?f(rr,{ref:o,asChild:e,open:s,onOpenChange:a,haspopup:"menu",className:n,...r,children:t}):f(Ok,{ref:o,asChild:e,className:Pn(n),onMouseDown:c=>{s||Ln(),cn(c)},...r,children:t})});Ir.displayName="DropdownMenuTrigger";var Sr=F(({className:e,sideOffset:t=4,children:n,mobileTitle:r,onCloseAutoFocus:o,...i},s)=>{let{isCompactViewport:a,open:c,onOpenChange:u}=Fn(),l=$e();if(a){let{style:d,...m}=jr(i);return f(Zr,{open:c,onOpenChange:u,srLabel:r??"Menu",children:f("div",{ref:s,className:x("flex flex-col gap-0.5 overflow-y-auto p-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]",e),...m,style:{...d,...ia},children:n})})}return f(Ak,{children:f(Lk,{ref:s,...l,sideOffset:t,onCloseAutoFocus:d=>{E5()||d.preventDefault(),o?.(d)},className:x("z-50 min-w-28 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i,children:f(Vu,{children:n})})})});Sr.displayName="DropdownMenuContent";function zk(){return new Event("select",{cancelable:!0})}var De=F(({className:e,inset:t,variant:n="default",onSelect:r,disabled:o,role:i="menuitem","aria-checked":s,textValue:a,children:c,onPointerEnter:u,onKeyDown:l,onFocus:d,onBlur:m,...p},h)=>{let{isCompactViewport:g,onOpenChange:C}=Fn(),{hoverProps:w}=nn({onPointerEnter:u,onKeyDown:l});return g?f("button",{ref:h,type:"button",role:i,disabled:o,"aria-disabled":o||void 0,"aria-checked":s,className:x("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-2 text-left text-xs outline-none transition-colors focus:bg-state-hover focus:text-foreground active:bg-state-active active:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>[data-icon-root]]:size-4 [&>[data-icon-root]]:shrink-0",t&&"pl-8",n==="destructive"&&fP,e),"data-disabled":o?"":void 0,onFocus:d,onBlur:m,onClick:()=>{if(o)return;let y=zk();r?.(y),y.defaultPrevented||C(!1)},children:c}):f(Rk,{ref:h,className:x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-[0.3125rem] text-xs outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>[data-icon-root]]:size-4 [&>[data-icon-root]]:shrink-0",Yt,n==="destructive"?pP:dP,t&&"pl-8",e),disabled:o,role:i,"aria-checked":s,onSelect:r,textValue:a,onFocus:d,onBlur:m,...p,...w,children:c})});De.displayName="DropdownMenuItem";var mP=F(({className:e,children:t,checked:n,onSelect:r,onCheckedChange:o,disabled:i,textValue:s,onPointerEnter:a,onKeyDown:c,...u},l)=>{let{isCompactViewport:d,onOpenChange:m}=Fn(),{hoverProps:p}=nn({onPointerEnter:a,onKeyDown:c});return d?v("button",{ref:l,type:"button",role:"menuitemcheckbox","aria-checked":n==="indeterminate"?"mixed":n===!0,disabled:i,"aria-disabled":i||void 0,className:x("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-left text-xs outline-none transition-colors focus:bg-state-hover focus:text-foreground active:bg-state-active active:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),"data-disabled":i?"":void 0,onClick:()=>{if(i)return;let h=zk();r?.(h),o?.(n==="indeterminate"?!0:!n),h.defaultPrevented||m(!1)},children:[f("span",{className:x("absolute right-2 flex items-center justify-center",Hn),children:(n===!0||n==="indeterminate")&&f(Ht,{name:"Check",className:Hn})}),t]}):v(Pk,{ref:l,className:x("relative flex cursor-default select-none items-center rounded-sm py-[0.3125rem] pl-2 pr-8 text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Yt,mn,e),checked:n,onSelect:r,onCheckedChange:o,disabled:i,textValue:s,...u,...p,children:[f("span",{className:x("absolute right-2 flex items-center justify-center",Hn),children:f(th,{children:f(Ht,{name:"Check",className:Hn})})}),t]})});mP.displayName="DropdownMenuCheckboxItem";var hP=F(({className:e,children:t,onPointerEnter:n,onKeyDown:r,...o},i)=>{let{isCompactViewport:s}=Fn(),{hoverProps:a}=nn({onPointerEnter:n,onKeyDown:r});return s?null:v(nh,{ref:i,className:x("relative flex cursor-default select-none items-center rounded-sm py-[0.3125rem] pl-8 pr-2 text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Yt,mn,e),...o,...a,children:[f("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f(th,{children:f(Ht,{name:"Circle",className:"h-2 w-2 fill-current"})})}),t]})});hP.displayName=nh.displayName;var gP=F(({className:e,inset:t,children:n,...r},o)=>{let{isCompactViewport:i}=Fn();return i?f("div",{ref:o,className:x("px-2 py-1.5 text-xs font-medium text-muted-foreground",t&&"pl-8",e),children:n}):f(Tk,{ref:o,className:x("px-2 py-[0.3125rem] text-xs font-medium text-muted-foreground",t&&"pl-8",e),...r,children:n})});gP.displayName="DropdownMenuLabel";var Cs=F(({className:e,...t},n)=>{let{isCompactViewport:r}=Fn();return r?f("hr",{ref:n,className:x("-mx-1 my-1 h-px border-0 bg-muted",e)}):f(Ek,{ref:n,className:x("-mx-1 my-1 h-px bg-muted",e),...t})});Cs.displayName="DropdownMenuSeparator";var CP=F(({children:e,...t},n)=>{let{isCompactViewport:r}=Fn();return r?f("div",{ref:n,role:"group",...t,children:e}):f(Mk,{ref:n,...t,children:e})});CP.displayName="DropdownMenuGroup";var jk=Dk,sh=F(({className:e,inset:t,children:n,onPointerEnter:r,onKeyDown:o,...i},s)=>{let{hoverProps:a}=nn({onPointerEnter:r,onKeyDown:o});return v(oh,{ref:s,className:x("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-[0.3125rem] text-xs outline-none focus:bg-state-hover focus:text-foreground data-[state=open]:bg-state-active data-[state=open]:text-foreground [&_[data-icon-root]]:pointer-events-none [&_[data-icon-root]]:size-4 [&_[data-icon-root]]:shrink-0",Yt,mn,t&&"pl-8",e),...i,...a,children:[n,f(Ht,{name:"ChevronRight",className:"ml-auto"})]})});sh.displayName=oh.displayName;var ah=F(({className:e,...t},n)=>f(rh,{ref:n,...$e(),className:x("z-50 min-w-28 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));ah.displayName=rh.displayName;var kP=({className:e,...t})=>f("span",{className:x("ml-auto text-xs tracking-widest opacity-60",e),...t});kP.displayName="DropdownMenuShortcut";function Zk(e){return e.map(t=>`${t.threadId}:${t.projectId}`).join(" ")}var yP=25;function Wk(e,t=yP){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function bP(e,t){let n=e.info.state,r=t??n.label;return n.kind==="scheduled"&&n.sendAt!==null?`${r}, sends ${To(n.sendAt)}`:r}function Vk(e,t){let n=[bP(e,t.pluginLabel),t.providerName];return e.parentTitle!==null&&e.depth>0&&n.push(`child of ${e.parentTitle}`),e.crossGroupLabel!==null&&n.push(e.crossGroupLabel.toLowerCase()),e.hiddenBadge&&n.push("hidden thread"),e.info.unread&&e.info.state.kind!=="unread"&&n.push("unread"),t.hasDraft&&e.info.state.kind!=="draft"&&n.push("unsubmitted draft"),`Open ${e.info.thread.displayTitle} \u2014 ${n.join("; ")}`}var vP={"waits-on-you":"waiting on you below","unread-failed":"failed below","queue-failed":"queued message failed below",offline:"machine offline below",working:"working below",unread:"unread below"};function ch(e,t){let n=t.count===0?"hidden child threads":`${t.count} ${t.count===1?"child thread":"child threads"}`,r=t.flag===null?"":`, ${vP[t.flag]}`;return`${t.expanded?"Collapse":"Show"} ${n} of ${e}${r}`}function Hk(e){let t=e.count===1?"child thread":"child threads";return e.expanded?{label:"Show fewer",ariaLabel:`Hide ${e.count} more ${t}`}:{label:`${e.count} more ${t}`,ariaLabel:`Show ${e.count} more ${t}`}}function Fk(e){let t=e.count===1?"settled thread tree":"settled thread trees";return{label:e.expanded?"Settled":`Settled (${e.count})`,ariaLabel:`${e.expanded?"Hide":"Show"} ${e.count} ${t}`}}function Bk(e){switch(e){case"project":return"Projects";case"chronological":return"Sections";case"machine":return"Machines"}}function $o(e){return 8+e*12}var wP=600;function xP(e){return e instanceof HTMLElement?e.isContentEditable||e.tagName==="TEXTAREA"||e.tagName==="INPUT":!1}function Eo({initial:e,label:t,onSave:n,onDone:r,className:o}){let[i,s]=A(e),[a,c]=A(!1),u=$(null),l=$(!1),d=$(!1),m=$(!1);D(()=>{let h=g=>{g.target!==u.current&&(m.current=!0)};return window.addEventListener("pointerdown",h,!0),()=>window.removeEventListener("pointerdown",h,!0)},[]),D(()=>{u.current?.focus(),u.current?.select();let h=setTimeout(()=>{d.current=!0},wP);return()=>clearTimeout(h)},[]);let p=async h=>{if(l.current)return;l.current=!0;let g=i.trim();if(!h||g===""||g===e){r();return}c(!0);try{await n(g)}catch(C){gt.error("Couldn't rename",{description:C instanceof Error?C.message:String(C)})}finally{r()}};return v(_t,{children:[f("input",{ref:u,"aria-label":t,value:i,disabled:a,onChange:h=>s(h.target.value),onKeyDown:h=>{h.stopPropagation(),!h.nativeEvent.isComposing&&(h.key==="Enter"?(h.preventDefault(),p(!0)):h.key==="Escape"&&(h.preventDefault(),p(!1)))},onBlur:h=>{if(!d.current&&!m.current&&xP(h.relatedTarget)){setTimeout(()=>{u.current?.focus(),u.current?.select()},0);return}p(!0)},onClick:h=>h.stopPropagation(),onPointerDown:h=>h.stopPropagation(),className:x("pointer-events-auto relative z-10 h-6 min-w-0 flex-1 rounded-sm border border-input bg-background px-1.5 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",o)}),a?f("span",{role:"status",className:"sr-only",children:"Saving name"}):null]})}var uh=globalThis.__bbPluginRuntime;if(uh==null||uh.radixContextMenu==null)throw new Error('Cannot load "@radix-ui/react-context-menu": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Hu=uh.radixContextMenu,fW="default"in Hu?Hu.default:Hu,{Arrow:mW,CheckboxItem:lh,Content:dh,ContextMenu:hW,ContextMenuArrow:gW,ContextMenuCheckboxItem:CW,ContextMenuContent:kW,ContextMenuGroup:yW,ContextMenuItem:bW,ContextMenuItemIndicator:vW,ContextMenuLabel:wW,ContextMenuPortal:xW,ContextMenuRadioGroup:IW,ContextMenuRadioItem:SW,ContextMenuSeparator:_W,ContextMenuSub:PW,ContextMenuSubContent:LW,ContextMenuSubTrigger:MW,ContextMenuTrigger:RW,Group:IP,Item:ph,ItemIndicator:fh,Label:mh,Portal:Uk,RadioGroup:SP,RadioItem:hh,Root:Kk,Separator:gh,Sub:Gk,SubContent:Ch,SubTrigger:kh,Trigger:qk,createContextMenuScope:TW}=Hu;var Yk="z-[70]",Jk=Kk,Xk=qk;var Qk=Gk;var yh=F(({className:e,inset:t,children:n,onPointerEnter:r,onKeyDown:o,...i},s)=>{let{hoverProps:a}=nn({onPointerEnter:r,onKeyDown:o});return v(kh,{ref:s,className:x("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-[0.3125rem] text-xs outline-none focus:bg-state-hover focus:text-foreground data-[state=open]:bg-state-active data-[state=open]:text-foreground [&_[data-icon-root]]:pointer-events-none [&_[data-icon-root]]:size-4 [&_[data-icon-root]]:shrink-0",Yt,mn,t&&"pl-8",e),...i,...a,children:[n,f(Ht,{name:"ChevronRight",className:"ml-auto"})]})});yh.displayName=kh.displayName;var bh=F(({className:e,...t},n)=>f(Ch,{ref:n,...$e(),className:x(Yk,"min-w-28 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));bh.displayName=Ch.displayName;var vh=F(({className:e,children:t,...n},r)=>f(Uk,{children:f(dh,{ref:r,...$e(),className:x(Yk,"min-w-28 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n,children:f(Vu,{children:t})})}));vh.displayName=dh.displayName;var Fu=F(({className:e,inset:t,onPointerEnter:n,onKeyDown:r,...o},i)=>{let{hoverProps:s}=nn({onPointerEnter:n,onKeyDown:r});return f(ph,{ref:i,className:x("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-[0.3125rem] text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>[data-icon-root]]:size-4 [&>[data-icon-root]]:shrink-0",Yt,mn,t&&"pl-8",e),...o,...s})});Fu.displayName=ph.displayName;var PP=F(({className:e,children:t,checked:n,onPointerEnter:r,onKeyDown:o,...i},s)=>{let{hoverProps:a}=nn({onPointerEnter:r,onKeyDown:o});return v(lh,{ref:s,className:x("relative flex cursor-default select-none items-center rounded-sm py-[0.3125rem] pl-2 pr-8 text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Yt,mn,e),checked:n,...i,...a,children:[f("span",{className:x("absolute right-2 flex items-center justify-center",Hn),children:f(fh,{children:f(Ht,{name:"Check",className:Hn})})}),t]})});PP.displayName=lh.displayName;var LP=F(({className:e,children:t,onPointerEnter:n,onKeyDown:r,...o},i)=>{let{hoverProps:s}=nn({onPointerEnter:n,onKeyDown:r});return v(hh,{ref:i,className:x("relative flex cursor-default select-none items-center rounded-sm py-[0.3125rem] pl-8 pr-2 text-xs outline-none focus:bg-state-hover focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",Yt,mn,e),...o,...s,children:[f("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f(fh,{children:f(Ht,{name:"Circle",className:"h-2 w-2 fill-current"})})}),t]})});LP.displayName=hh.displayName;var MP=F(({className:e,inset:t,...n},r)=>f(mh,{ref:r,className:x("px-2 py-[0.3125rem] text-xs font-medium text-muted-foreground",t&&"pl-8",e),...n}));MP.displayName=mh.displayName;var wh=F(({className:e,...t},n)=>f(gh,{ref:n,className:x("-mx-1 my-1 h-px bg-muted",e),...t}));wh.displayName=gh.displayName;function RP({className:e,...t}){return f("span",{className:x("ml-auto text-xs tracking-widest opacity-60",e),...t})}RP.displayName="ContextMenuShortcut";var xh=globalThis.__bbPluginRuntime;if(xh==null||xh.radixHoverCard==null)throw new Error('Cannot load "@radix-ui/react-hover-card": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var Bu=xh.radixHoverCard,ZW="default"in Bu?Bu.default:Bu,{Arrow:WW,Content:Ih,HoverCard:VW,HoverCardArrow:HW,HoverCardContent:FW,HoverCardPortal:BW,HoverCardTrigger:UW,Portal:ey,Root:ty,Trigger:ny,createHoverCardScope:KW}=Bu;var ry=ty,oy=ny,Sh=F(({className:e,align:t="center",sideOffset:n=4,...r},o)=>{let i=$e();return f(ey,{children:f(Ih,{ref:o,align:t,sideOffset:n,...i,className:x("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-hover-card-content-transform-origin]",e),...r})})});Sh.displayName=Ih.displayName;function Uu(e){let t=Math.max(0,e);return t<6e4?"now":t<36e5?`${Math.floor(t/6e4)}m`:t<864e5?`${Math.floor(t/36e5)}h`:t<6048e5?`${Math.floor(t/864e5)}d`:`${Math.floor(t/6048e5)}w`}function AP(e,t){return Math.max(e.latestAttentionAt,t[e.id]??e.createdAt)}function iy(e,t,n,r,o){if(o!==void 0){if(o===null)return null;let s=Uu(r-o),a=s==="now"?"<1m":s;return{text:a,label:`Waiting on you for ${a==="<1m"?"less than a minute":a}`,kind:"waiting"}}if(t){let s=n.startedAt[e.id];if(s===void 0)return null;let a=Uu(r-s),c=a==="now"?"<1m":a;return{text:c,label:`Working for ${c==="<1m"?"less than a minute":c}`,kind:"timer"}}let i=Uu(r-AP(e,n.finishedAt));return{text:i,label:i==="now"?"Finished just now":`Finished ${i} ago`,kind:"age"}}function sy(e,t){if(e.status!=="idle"&&e.status!=="error"||e.hasPendingInteraction)return null;let n=t[e.id];return n!==void 0?Math.max(n,e.latestAttentionAt):e.latestAttentionAt>e.createdAt&&(e.parentThreadId===null||e.status==="error")?e.latestAttentionAt:null}function ay(e,t,n,r){let o=e==="working"?n.startedAt[t]:e==="waits-on-you"?n.pendingAt[t]:e==="idle"||e==="unread"||e==="failed"?n.finishedAt[t]:void 0;return o===void 0?null:Uu(r-o)}var cy=["now","<1m","59m","23h","6d","99w"];function Ku({display:e,mode:t="muted",className:n}){let r=t==="muted";if(e.provider!==null){let o=r?{id:e.provider.id,logoUrl:e.provider.logoUrl,icon:e.provider.icon}:e.provider;return f("span",{title:e.name,className:x("inline-flex size-3.5 shrink-0 text-muted-foreground",r&&"opacity-60",n),children:f(Is,{providerKind:"agent",provider:o,"aria-label":e.name,className:"size-3.5"})})}return f("span",{role:"img","aria-label":e.name,title:e.name,className:x("inline-flex h-3.5 min-w-3.5 shrink-0 items-center justify-center rounded-[3px] border border-border px-px text-[10px] font-semibold leading-none tracking-tight text-muted-foreground",r&&"opacity-60",n),children:e.mark})}function _h(e){switch(e){case"checks_failed":case"conflicts":case"changes_requested":return"text-destructive";case"ready_to_merge":return"text-success";default:return"text-muted-foreground"}}var $P={checks_failed:"checks failed",conflicts:"has conflicts",changes_requested:"changes requested",ready_to_merge:"ready to merge",checks_pending:"checks pending",review_requested:"review requested",draft:"draft",merged:"merged",closed:"closed",blocked:"blocked"};function Gu(e){let t=$P[e.attention];return`Pull request #${e.number}${t?`, ${t}`:""}: ${e.title}`}function qu({threadId:e}){let{pullRequest:t}=Ss(e);return t===null?null:v("span",{title:Gu(t),"aria-label":Gu(t),className:x("shrink-0 text-xs tabular-nums",_h(t.attention)),children:["#",t.number]})}function Yu({item:e}){return v(_t,{children:[f(H,{name:e.icon,"aria-hidden":!0,className:"size-4"}),f("span",{children:e.label})]})}function uy(e){return[{id:null,name:"Threads"},...e.map(t=>({id:t.id,name:t.name}))]}function ly({items:e,sections:t,currentSectionId:n,onAction:r,onCloseAutoFocus:o,input:i}){let s=a=>c=>{if(!i.current.pressed&&!i.current.keyed){c.preventDefault();return}a()};return f(vh,{className:"min-w-48",onCloseAutoFocus:o,onPointerDown:()=>{i.current.pressed=!0},onKeyDown:()=>{i.current.keyed=!0},children:e.map(a=>v(Tr,{children:[a.separated?f(wh,{}):null,a.action==="move-to-section"?v(Qk,{children:[f(yh,{children:f(Yu,{item:a})}),f(bh,{children:uy(t).map(c=>v(Fu,{disabled:c.id===n,onSelect:s(()=>r("move-to-section",c.id)),children:[c.id===n?f(H,{name:z.check,"aria-hidden":!0,className:"size-4"}):f("span",{className:"size-4"}),c.name]},c.id??"threads"))})]}):f(Fu,{className:x(a.destructive&&"text-destructive focus:text-destructive"),onSelect:s(()=>r(a.action)),children:f(Yu,{item:a})})]},a.action))})}function dy({items:e,sections:t,currentSectionId:n,onAction:r,onCloseAutoFocus:o}){return f(Sr,{align:"end",className:"min-w-48",onCloseAutoFocus:o,children:e.map(i=>v(Tr,{children:[i.separated?f(Cs,{}):null,i.action==="move-to-section"?v(jk,{children:[f(sh,{children:f(Yu,{item:i})}),f(ah,{children:uy(t).map(s=>v(De,{disabled:s.id===n,onSelect:()=>r("move-to-section",s.id),children:[s.id===n?f(H,{name:z.check,"aria-hidden":!0,className:"size-4"}):f("span",{className:"size-4"}),s.name]},s.id??"threads"))})]}):f(De,{className:x(i.destructive&&"text-destructive focus:text-destructive"),onSelect:()=>r(i.action),children:f(Yu,{item:i})})]},i.action))})}function py({panes:e,label:t,working:n}){let r=e.some(o=>o.isMe&&o.isFocused);return f("svg",{role:"img","aria-label":t,viewBox:"0 0 14 14",width:14,height:14,shapeRendering:"crispEdges",className:x("pointer-events-none size-3.5 shrink-0",!r&&"opacity-60",n&&"animate-shine-icon motion-reduce:animate-none"),children:e.map(o=>{let i=o.isMe?0:.5;return f("rect",{x:1+o.rect.x*12+i,y:1+o.rect.y*12+i,width:Math.max(o.rect.width*12-2*i,0),height:Math.max(o.rect.height*12-2*i,0),strokeWidth:o.isMe?0:1,className:o.isMe?o.isFocused?"fill-primary/70 stroke-none":"fill-muted-foreground/45 stroke-none":"fill-none stroke-muted-foreground/30"},o.paneId)})})}function hn({label:e,title:t,children:n}){return v("div",{className:"flex min-w-0 gap-2",title:t,children:[f("dt",{className:"w-20 shrink-0 text-muted-foreground",children:e}),f("dd",{className:"min-w-0 flex-1 break-words",children:n})]})}function EP(e,t){let[n,r]=A("loading"),{id:o,status:i}=t.thread;return D(()=>{let s=!1;return r("loading"),e.loadModel(o,i).then(a=>!s&&r(a),()=>!s&&r(null)),()=>{s=!0}},[e,o,i]),n}function DP({threadId:e}){let{pullRequest:t}=Ss(e);return t===null?null:f(hn,{label:"Pull request",children:f("span",{className:_h(t.attention),children:Gu(t)})})}function Ju({info:e,controller:t,showPullRequest:n,actions:r}){let o=e.thread,i=t.provider(o.providerId),s=EP(t,e),a=ve(_u),c=lk(e.state.kind,ay(e.state.kind,o.id,a.stamps,a.now)),u=ck(uk(a.treeOf(o.id),o.id)),l=o.environment,d=sy(o,a.stamps.finishedAt),m=u4(a.notes[o.id]);return v("div",{className:"flex flex-col gap-2 text-xs",children:[f("p",{className:"text-sm font-medium leading-snug break-words",children:o.displayTitle}),v("div",{className:"flex items-center gap-1.5",children:[f(hs,{glyph:e.state.glyph,className:"size-3.5"}),v("span",{children:[e.state.label,c!==null?` \xB7 ${c}`:"",e.state.sendAt!==null?` \xB7 sends ${To(e.state.sendAt)}`:""]})]}),e.note!==null?f("p",{className:"break-words leading-snug",children:f(Nu,{note:e.note})}):null,v("dl",{className:"flex flex-col gap-1",children:[f(hn,{label:"Harness",children:v("span",{className:"inline-flex items-center gap-1.5",children:[f(Ku,{display:i,mode:t.harnessIcon}),i.name]})}),f(hn,{label:"Model",title:"The model and reasoning level the next message will use",children:s==="loading"?"\u2026":s===null?"Unknown":`${s.model} \xB7 ${s.reasoningLevel}`}),l?.branchName?f(hn,{label:"Branch",children:v("span",{className:"inline-flex items-center gap-1",children:[f(H,{name:l.isWorktree?z.worktree:z.branch,"aria-hidden":!0,className:"size-3.5"}),l.branchName,l.isWorktree?" (worktree)":""]})}):null,o.host!==null?f(hn,{label:"Machine",children:o.host.name}):null,u!==null?f(hn,{label:"Children",children:u}):null,n?f(DP,{threadId:o.id}):null,m!==null&&e.note===null?f(hn,{label:"Last reply",children:f("span",{className:"line-clamp-2",children:m.text})}):null,f(hn,{label:"Created",children:To(o.createdAt)}),d!==null?f(hn,{label:"Finished",children:To(d)}):null]}),r?v("div",{className:"flex gap-2 pt-1",children:[v(Ye,{size:"sm",onClick:r.open,children:[f(H,{name:z.open,"aria-hidden":!0}),"Open"]}),v(Ye,{size:"sm",variant:"outline",onClick:r.toggleRead,children:[f(H,{name:e.unread?z.markRead:z.markUnread,"aria-hidden":!0}),e.unread?"Mark read":"Mark unread"]})]}):null]})}var OP=400,NP=700,zP=10,ks=null;function jP(){let e=t=>{t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",e,!0)};window.addEventListener("click",e,!0),window.addEventListener("touchend",()=>setTimeout(()=>window.removeEventListener("click",e,!0),400),{capture:!0,once:!0})}var fy="text-[color:color-mix(in_oklch,var(--foreground)_68%,var(--sidebar))]",Ft="pointer-events-auto relative z-10 inline-flex size-6 shrink-0 cursor-pointer items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-state-hover hover:text-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring data-[state=open]:bg-state-active";function ZP(e){let t=_s();return K(()=>{if(t===null)return null;let n=t.panes.map(r=>({paneId:r.paneId,rect:r.rect,isMe:r.threadId===e,isFocused:r.isFocused}));return n.some(r=>r.isMe)?n:null},[t,e])}var my=st(function({row:t,controller:n,groupId:r,inPinned:o,dropState:i,active:s,editing:a,now:c,startedAt:u,finishedAt:l,pendingAt:d}){let{info:m}=t,p=m.thread,h=p.archivedAt!==null||p.isArchived,g=n.compact,C=jh(p.id),w=zh(p.id),{hasUnsubmittedDraft:y}=Oh(p.id),S=$h(p.id),T=ZP(p.id),[L,M]=A(!1),[E,B]=A(!1),X=bk(s,!g&&!a&&!L&&!E),oe=$({pressed:!1,keyed:!1}),ee=$(null),Z=$(null),ne={threadId:p.id,parentThreadId:p.parentThreadId,sectionId:p.sectionId,pinned:p.pinnedAt!==null||p.isPinned},Q=Hs({id:`thread:${p.id}:${r}`,data:{kind:"thread",thread:ne,groupId:r},disabled:a||g}),ge=Fs({id:`drop-thread:${p.id}:${r}`,data:{kind:"thread",threadId:p.id,inPinned:o,groupId:r}}),yt=N(W=>{Q.setNodeRef(W),ge.setNodeRef(W)},[Q.setNodeRef,ge.setNodeRef]),Ke=n.provider(p.providerId),gn=W5(m.state,w),nt=Vk(t,{providerName:Ke.name,pluginLabel:gn?w.label:null,hasDraft:y}),bt=h?null:iy(p,m.flags.has("working"),{startedAt:u===void 0?{}:{[p.id]:u},finishedAt:l===void 0?{}:{[p.id]:l}},c,m.state.kind==="waits-on-you"?d??null:void 0),Cn=h4({thread:p,unread:t.depth===0?t.treeUnread:m.unread,splitAvailable:S.isAvailable,isRoot:p.parentThreadId===null,hasSections:n.mode==="chronological"||n.sections.length>0,compact:g}),Oe=$(!1),rt=$(!1),Bt=(W,ze)=>{if(W==="rename"){Oe.current=!0,rt.current=!0,setTimeout(()=>{rt.current=!1},1500);return}n.onMenuAction(W,p,ze)};D(()=>{if(L||E||!Oe.current)return;let W=setTimeout(()=>{Oe.current&&(Oe.current=!1,n.setEditingId(p.id))},60);return()=>clearTimeout(W)},[L,E,n,p.id]);let Bn=W=>{rt.current&&(rt.current=!1,W.preventDefault(),Oe.current&&(Oe.current=!1,n.setEditingId(p.id)))},He=t.pullRequest!==null,Pr=T?f(py,{panes:T,label:`${p.displayTitle} \u2014 open in split; ${m.state.label}`,working:m.flags.has("working")}):gn?f(mk,{status:w}):f("span",{title:m.state.label,className:"inline-flex",children:f(hs,{glyph:m.state.glyph,label:m.state.label})}),Un=W=>{if(a){W.preventDefault();return}if(S.isAvailable&&(W.metaKey||W.ctrlKey)){W.preventDefault(),n.onMenuAction("open-in-split",p);return}let ze=Date.now();if(ks!==null&&ks.threadId===p.id&&ze-ks.at<OP){ks=null,W.preventDefault(),n.setEditingId(p.id);return}ks={threadId:p.id,at:ze},n.onNavigate()},ot=()=>{Z.current!==null&&clearTimeout(Z.current.timer),Z.current=null},we=$(!1),kn=g?{onTouchStart:W=>{let ze=W.touches[0];ze!==void 0&&(ot(),we.current=!1,Z.current={x:ze.clientX,y:ze.clientY,timer:setTimeout(()=>{Z.current=null,we.current=!0,jP(),M(!0)},NP)})},onTouchMove:W=>{let ze=W.touches[0];Z.current===null||ze===void 0||Math.hypot(ze.clientX-Z.current.x,ze.clientY-Z.current.y)>zP&&ot()},onTouchEnd:W=>{ot(),we.current&&W.preventDefault()},onTouchCancel:ot,onContextMenu:W=>W.preventDefault(),style:{WebkitTouchCallout:"none"}}:{},me=t.chip,Kn=$o(t.depth),Ne=t.note,vt=Ne!==null||t.branchLine!==null,wt=t.dimmed&&!a,Me=L||E,xt=t.machine!==null&&C===null,rn=t.harness||xt,re=!g&&C===null,Ut=g?"":Me?"opacity-0":vk,Kt=v("div",{ref:yt,"data-sidebar-rename-row":"","data-sidebar-nest-target":i==="valid"||i==="blocked"||i==="unchanged"?i:void 0,"data-sidebar-reorder-placement":i==="before"||i==="after"?i:void 0,...Q.attributes,...Q.listeners,role:void 0,tabIndex:void 0,"aria-roledescription":void 0,onPointerEnter:X.rowProps.onPointerEnter,onPointerMove:X.rowProps.onPointerMove,onPointerDown:W=>{X.rowProps.onPointerDown(),a||S.splitProps.onPointerDown?.(W)},onPointerLeave:X.rowProps.onPointerLeave,onFocus:X.rowProps.onFocus,onBlur:X.rowProps.onBlur,...kn,className:x("group/row relative flex w-full items-center gap-1.5 rounded-md pr-1 text-sm transition-colors",vt?"h-11 max-md:pointer-coarse:h-12":"h-7 max-md:pointer-coarse:h-9",s?"bg-state-active text-sidebar-foreground":"cursor-pointer text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",!s&&Me&&"bg-sidebar-accent",T&&!s&&"bb-sidebar-open-in-split-row",Q.isDragging&&"opacity-50",i==="valid"&&"ring-1 ring-inset ring-sidebar-ring/80 bg-sidebar-accent/45",i==="blocked"&&"ring-1 ring-inset ring-destructive/60",i==="before"&&"shadow-[inset_0_2px_0_0_var(--sidebar-ring)]",i==="after"&&"shadow-[inset_0_-2px_0_0_var(--sidebar-ring)]"),style:{paddingLeft:Kn},children:[f("a",{ref:ee,href:p.href,"data-sidebar-thread-shortcut-target":"","data-sidebar-thread-id":p.id,"data-sidebar-rename-anchor":"","aria-label":nt,"aria-keyshortcuts":C?.ariaKeyshortcuts,"aria-current":s?"page":void 0,onClick:Un,onDoubleClick:W=>{W.preventDefault(),n.setEditingId(p.id)},className:"absolute inset-0 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring"}),f("span",{className:"pointer-events-none relative flex size-4 shrink-0 items-center justify-center",children:Pr}),t.nested?f("span",{"aria-hidden":!0,title:`Child of ${t.parentTitle??"a thread"}`,className:x("pointer-events-none relative -ml-[3px] -mr-px w-1.5 shrink-0 text-center text-[10px] leading-none text-muted-foreground",vt&&"mt-[9px] self-start"),children:"\u21B3"}):null,t.crossGroupLabel!==null?f("span",{role:"img","aria-label":t.crossGroupLabel,title:t.crossGroupLabel,"data-sidebar-thread-cross-project":"",className:"pointer-events-none relative inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground",children:f(H,{name:z.crossGroup,"aria-hidden":!0,className:"size-3.5"})}):null,v("span",{className:"pointer-events-none relative flex min-w-0 flex-1 flex-col justify-center",children:[a?f(Eo,{initial:p.displayTitle,label:"Thread name",onSave:W=>n.onRename(p.id,W),onDone:()=>{n.setEditingId(null),ee.current?.focus()}}):v("span",{className:"flex min-w-0 items-center gap-1.5",children:[f("span",{title:p.displayTitle,className:x("min-w-0 truncate",t.bold?"font-semibold":"font-normal",wt&&`${fy} group-hover/row:text-foreground`),children:p.displayTitle}),t.pullRequest==="title"&&vt?f(qu,{threadId:p.id}):null]}),!a&&Ne!==null?f("span",{className:"min-w-0 truncate text-xs leading-4 text-muted-foreground",title:c4(Ne),children:f(Nu,{note:Ne})}):t.branchLine!==null&&!a?f(WP,{row:t,branch:t.branchLine}):null]}),t.hiddenBadge?f("span",{role:"img","aria-label":"Hidden thread",title:"Hidden thread",className:"pointer-events-none relative shrink-0 text-muted-foreground",children:f(H,{name:z.hidden,"aria-hidden":!0,className:"size-3.5"})}):null,t.pullRequest==="title"&&!vt&&!a?f("span",{className:"pointer-events-none relative",children:f(qu,{threadId:p.id})}):null,!a&&(rn||re)?v("span",{className:"relative -ml-1.5 grid shrink-0 items-center",children:[rn?v("span",{className:x("flex items-center gap-1.5 pl-1.5 [grid-area:1/1] transition-opacity",C===null&&Ut),children:[t.harness?f("span",{className:"pointer-events-none relative inline-flex shrink-0",children:f(Ku,{display:Ke,mode:n.harnessIcon})}):null,xt?f("span",{title:`On ${t.machine}`,"aria-label":`On ${t.machine}`,className:"pointer-events-none max-w-20 truncate text-xs text-muted-foreground",children:t.machine}):null]}):null,re?v("span",{className:x("items-center justify-self-end gap-0.5 pl-1.5 [grid-area:1/1]",Me?"flex":xk),children:[t.treeUnread?f("button",{type:"button","aria-label":"Mark read",title:"Mark read",className:Ft,onPointerDown:W=>W.stopPropagation(),onClick:W=>{W.preventDefault(),W.stopPropagation(),n.onMenuAction("mark-read",p)},children:f(H,{name:z.markRead,"aria-hidden":!0,className:"size-4"})}):null,f("button",{type:"button","aria-label":h?"Unarchive thread":"Archive thread",title:h?"Unarchive":"Archive",className:Ft,onPointerDown:W=>W.stopPropagation(),onClick:W=>{W.preventDefault(),W.stopPropagation(),n.onMenuAction(h?"unarchive":"archive",p)},children:f(H,{name:h?z.unarchive:z.archive,"aria-hidden":!0,className:"size-4"})})]}):null]}):null,a?null:v("span",{className:"relative flex shrink-0 items-center gap-1",children:[me!==null?v("button",{type:"button","aria-expanded":me.expanded,"aria-label":ch(p.displayTitle,me),title:ch(p.displayTitle,me),onClick:W=>{W.preventDefault(),W.stopPropagation(),n.onToggleChip(t)},onPointerDown:W=>W.stopPropagation(),onKeyDown:W=>W.stopPropagation(),className:x("pointer-events-auto relative z-10 inline-flex h-5 shrink-0 items-center gap-0.5 rounded-md px-0.5 text-xs leading-none tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",me.flag===null?x("text-muted-foreground hover:text-foreground",wt&&fy):Ou[B5(me.flag)]),children:[me.flag!==null?f(hk,{flag:me.flag}):null,me.count>0?me.count:null,f(H,{name:z.expand,"aria-hidden":!0,className:x("size-3 transition-transform duration-150",me.expanded&&"rotate-90")})]}):null,v("span",{"data-trailing-slot":"",className:"relative grid h-6 shrink-0 items-center",children:[f("span",{"aria-hidden":!0,className:"invisible w-6 [grid-area:1/1]"}),cy.map(W=>f("span",{"aria-hidden":!0,className:"invisible text-xs font-medium tabular-nums [grid-area:1/1]",children:W},W)),C!==null?f("kbd",{"aria-hidden":!0,className:"pointer-events-none justify-self-end rounded border border-border px-1 font-sans text-[10px] leading-4 text-muted-foreground [grid-area:1/1]",children:C.label}):v(_t,{children:[bt!==null?f("span",{title:bt.label,"aria-label":bt.label,className:x("pointer-events-none justify-self-end text-xs tabular-nums transition-opacity [grid-area:1/1]",bt.kind==="timer"?"font-medium text-[var(--timeline-accent)]":"text-muted-foreground",Ut),children:bt.text}):null,f("span",{className:x("flex items-center justify-self-end transition-opacity [grid-area:1/1]",g?"relative":Me?"opacity-100":wk),children:v(Ao,{open:L,onOpenChange:M,children:[f(Ir,{asChild:!0,children:f("button",{type:"button","aria-label":"Thread actions",className:g?"sr-only":Ft,onPointerDown:W=>W.stopPropagation(),onClick:W=>W.stopPropagation(),children:f(H,{name:z.more,"aria-hidden":!0,className:"size-4"})})}),f(dy,{items:Cn,sections:n.sections,currentSectionId:p.sectionId,onAction:Bt,onCloseAutoFocus:Bn})]})})]})]})]})]});return g?Kt:v(Jk,{onOpenChange:W=>{W&&(oe.current={pressed:!1,keyed:!1}),B(W)},children:[v(ry,{closeDelay:100,open:X.open,onOpenChange:X.onOpenChange,children:[f(Xk,{asChild:!0,disabled:a,children:f(oy,{asChild:!0,children:Kt})}),!a&&!L&&!E?f(Sh,{side:"right",align:"start",collisionPadding:8,className:"z-[100] w-72 p-3",children:f(Ju,{info:m,controller:n,showPullRequest:He})}):null]}),f(ly,{items:Cn,sections:n.sections,currentSectionId:p.sectionId,onAction:Bt,onCloseAutoFocus:Bn,input:oe})]})});function WP({row:e,branch:t}){let n=e.info.thread.environment;return v("span",{className:"flex min-w-0 items-center gap-1.5 text-xs leading-4 text-muted-foreground",children:[v("span",{className:"inline-flex min-w-0 items-center gap-0.5",children:[f(H,{name:n?.isWorktree?z.worktree:z.branch,"aria-hidden":!0,className:"size-3 shrink-0"}),f("span",{className:"truncate",children:t}),n?.isWorktree?f("span",{className:"sr-only",children:" (worktree)"}):null]}),e.pullRequest==="second-line"?f(qu,{threadId:e.info.thread.id}):null]})}var hy=st(function({row:t,controller:n}){let{label:r,ariaLabel:o}=Hk(t);return v("button",{type:"button","aria-expanded":t.expanded,"aria-label":o,onClick:()=>n.onToggleOlder(t),className:"relative flex h-7 w-full items-center gap-1.5 rounded-md pr-2 text-left text-xs text-muted-foreground outline-none hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring max-md:pointer-coarse:h-9",style:{paddingLeft:$o(t.depth)},children:[f("span",{"aria-hidden":!0,className:"inline-flex size-4 shrink-0 items-center justify-center",children:f(H,{name:z.more,className:"size-3.5"})}),r]})}),gy=st(function({row:t,controller:n}){let{label:r,ariaLabel:o}=Fk(t);return v("button",{type:"button","aria-expanded":t.expanded,"aria-label":o,onClick:()=>n.onToggleSettled(t),className:"group/settled relative flex h-6 w-full items-center gap-2 rounded-md pr-1 text-left text-xs text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring max-md:pointer-coarse:h-9",style:{paddingLeft:$o(0)},children:[f("span",{className:"shrink-0 tabular-nums",children:r}),f("span",{"aria-hidden":!0,className:"h-px flex-1 bg-border/60"}),f(H,{name:z.expand,"aria-hidden":!0,className:x("size-3 shrink-0 transition-transform duration-150",t.expanded&&"rotate-90")})]})}),Cy=st(function({row:t,controller:n,environmentProviders:r}){let[o,i]=A(!1),s=t.environmentProviderId===null?null:r.find(a=>a.id===t.environmentProviderId)??null;return v("div",{className:"group/row relative flex h-7 w-full items-center gap-1.5 rounded-md pr-1 text-sm text-muted-foreground hover:bg-sidebar-accent",style:{paddingLeft:$o(t.depth)},children:[f("button",{type:"button","aria-expanded":!t.collapsed,"aria-label":`${t.collapsed?"Expand":"Collapse"} ${t.label} environment, ${t.threadIds.length} threads`,onClick:()=>n.onToggleEnvironment(t.environmentId),className:"absolute inset-0 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring"}),f("span",{className:"pointer-events-none relative inline-flex size-4 shrink-0 items-center justify-center",children:s!==null?f(Is,{providerKind:"environment",provider:s,className:"size-3.5"}):f(H,{name:t.environmentProviderId===null?z.machine:z.environmentFallback,"aria-hidden":!0,className:"size-3.5"})}),o?f(Eo,{initial:t.label,label:"Environment name",onSave:a=>n.onRenameEnvironment(t.environmentId,a),onDone:()=>i(!1)}):f("span",{className:"pointer-events-none relative min-w-0 flex-1 truncate",children:t.label}),t.flag!==null?f(zu,{flag:t.flag,className:"pointer-events-none relative size-3.5"}):null,f("span",{className:"pointer-events-none relative text-xs tabular-nums",children:t.threadIds.length}),f(H,{name:z.expand,"aria-hidden":!0,className:x("pointer-events-none relative size-3 transition-transform",!t.collapsed&&"rotate-90")}),v(Ao,{children:[f(Ir,{asChild:!0,children:f("button",{type:"button","aria-label":"Environment actions",className:x(Ft,!n.compact&&"opacity-0 group-hover/row:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100"),children:f(H,{name:z.more,"aria-hidden":!0,className:"size-4"})})}),v(Sr,{align:"end",children:[v(De,{onSelect:()=>n.onNewThreadInEnvironment(t.environmentId,t.projectId,t.sectionId),children:[f(H,{name:z.newThread,"aria-hidden":!0,className:"size-4"}),"New thread in environment"]}),v(De,{onSelect:()=>i(!0),children:[f(H,{name:z.rename,"aria-hidden":!0,className:"size-4"}),"Rename"]}),v(De,{onSelect:()=>n.onArchiveEnvironment(t.environmentId),children:[f(H,{name:z.archive,"aria-hidden":!0,className:"size-4"}),"Archive"]})]})]})]})});var ky={compact:28,comfortable:44};function yy(e){return e.descriptor.kind==="section"||e.descriptor.kind==="machine"}var VP=st(function({group:t,controller:n,inOverflow:r,dropActive:o}){let[i,s]=A(!1),[a,c]=A(!1),u=t.descriptor.label,l=Hs({id:`group:${t.descriptor.id}`,data:{kind:"group",groupId:t.descriptor.id},disabled:n.compact||r||i}),d=n.compact,m=d?"":a?"opacity-0":Ik,p=d?"":x("absolute top-1/2 right-0 -translate-y-1/2 pl-1",o?"bg-sidebar-accent":"bg-sidebar",a?"opacity-100":Sk);return v("div",{ref:l.setNodeRef,...l.attributes,...l.listeners,role:void 0,tabIndex:void 0,"data-sidebar":"group-label",className:x("group/header sticky top-0 z-20 flex h-7 items-center gap-1 rounded-md bg-sidebar pl-2 pr-1 text-xs text-muted-foreground max-md:pointer-coarse:h-9",o&&"bg-sidebar-accent",l.isDragging&&"opacity-50",!n.compact&&!r&&"select-none"),children:[i?f(Eo,{initial:u,label:t.descriptor.kind==="section"?"Section name":"Machine name",onSave:h=>n.onRename(t,h),onDone:()=>s(!1),className:"text-xs"}):v("button",{type:"button","aria-expanded":!t.collapsed,"aria-label":`${t.collapsed?"Expand":"Collapse"} ${u} section`,onClick:()=>n.onToggleCollapse(t),onPointerDown:h=>h.stopPropagation(),onDoubleClick:()=>yy(t)&&s(!0),className:"flex min-w-0 flex-1 items-center gap-1 rounded-md py-1 text-left font-medium outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:[f("span",{className:"min-w-0 truncate",title:u,children:u}),f(H,{name:z.expand,"aria-hidden":!0,className:x("size-3 shrink-0 transition-transform duration-150",!t.collapsed&&"rotate-90")})]}),i?null:v("span",{className:"relative ml-auto flex shrink-0 items-center",children:[f(ju,{counters:M4(t.counters,{collapsed:t.collapsed,more:!1}),className:x("transition-opacity",m)}),v("span",{className:x("flex items-center transition-opacity",p),children:[t.descriptor.kind!=="pinned"&&(t.descriptor.newThreadProjectId!==null||t.descriptor.kind==="machine")&&(!n.compact||n.activeGroupId===t.descriptor.id)?f("button",{type:"button","aria-label":`New thread in ${u}`,title:`New thread in ${u}`,"data-sidebar-hover-actions-mobile":n.compact?"always":void 0,className:Ft,onPointerDown:h=>h.stopPropagation(),onClick:()=>n.onNewThread(t),children:f(H,{name:z.newThread,"aria-hidden":!0,className:"size-4"})}):null,v(Ao,{open:a,onOpenChange:c,children:[f(Ir,{asChild:!0,children:f("button",{type:"button","aria-label":`${u} actions`,className:Ft,onPointerDown:h=>h.stopPropagation(),children:f(H,{name:z.more,"aria-hidden":!0,className:"size-4"})})}),v(Sr,{align:"end",className:"min-w-48",children:[t.hasUnread?v(De,{onSelect:()=>n.onMarkAllRead(t),children:[f(H,{name:z.markRead,"aria-hidden":!0,className:"size-4"}),"Mark all read"]}):null,t.descriptor.kind!=="pinned"&&t.descriptor.newThreadProjectId!==null?v(De,{onSelect:()=>n.onNewThread(t),children:[f(H,{name:z.newThread,"aria-hidden":!0,className:"size-4"}),"New thread"]}):null,n.canCreateSections?v(De,{onSelect:()=>n.onNewSection(),children:[f(H,{name:z.newSection,"aria-hidden":!0,className:"size-4"}),"New section"]}):null,yy(t)?v(De,{onSelect:()=>s(!0),children:[f(H,{name:z.rename,"aria-hidden":!0,className:"size-4"}),"Rename"]}):null,f(Cs,{}),t.descriptor.kind!=="pinned"?t.hidden?v(De,{onSelect:()=>n.onShow(t),children:[f(H,{name:z.show,"aria-hidden":!0,className:"size-4"}),"Show in list"]}):v(De,{onSelect:()=>n.onHide(t),children:[f(H,{name:z.hidden,"aria-hidden":!0,className:"size-4"}),"Hide from list"]}):null,v(De,{onSelect:()=>n.onToggleArchived(),children:[f(H,{name:n.showArchived?z.check:z.archive,"aria-hidden":!0,className:"size-4"}),"Show archived threads"]}),v(De,{onSelect:()=>n.onCustomize(),children:[f(H,{name:z.customize,"aria-hidden":!0,className:"size-4"}),"Customize list"]}),t.descriptor.kind==="section"?v(De,{className:"text-destructive focus:text-destructive",onSelect:()=>n.onRemove(t),children:[f(H,{name:z.remove,"aria-hidden":!0,className:"size-4"}),"Remove section"]}):null]})]})]})]})]})});function HP(e){return e.key}function FP({rows:e,forceMount:t,rowHeight:n,children:r}){let o=$(null),[i,s]=A(!0),a=$(null);D(()=>{let l=o.current;if(l===null||typeof IntersectionObserver>"u")return;let d=new IntersectionObserver(m=>{for(let p of m)p.isIntersecting===!1&&l.firstElementChild!==null&&i&&(a.current=l.getBoundingClientRect().height),s(p.isIntersecting)},{rootMargin:"240px 0px"});return d.observe(l),()=>d.disconnect()},[i]);let c=i||t,u=e.filter(l=>l.type==="thread").map(l=>({threadId:l.info.thread.id,projectId:l.projectId}));return f("div",{ref:o,"data-sidebar-windowed-item":"","data-sidebar-windowed-nav":c||u.length===0?void 0:Zk(u),style:c?void 0:{height:a.current??e.length*n},children:c?r:null})}function BP({rows:e,groupId:t,inPinned:n,forceMount:r,rowController:o,environmentProviders:i,dropStates:s,activeThreadId:a,editingId:c,now:u,stamps:l}){let d=o.comfortable?ky.comfortable:ky.compact;return f("div",{"data-sidebar":"group-content",className:"flex w-full flex-col text-sm",children:Wk(e).map(m=>f(FP,{rows:m,rowHeight:d,forceMount:r||m.some(p=>p.type==="thread"&&(p.info.thread.id===a||p.info.thread.id===c)),children:m.map(p=>p.type==="thread"?f(my,{row:p,controller:o,groupId:t,inPinned:n,dropState:s.get(p.info.thread.id)??null,active:p.info.thread.id===a,editing:p.info.thread.id===c,now:u,startedAt:l.startedAt[p.info.thread.id],finishedAt:l.finishedAt[p.info.thread.id],pendingAt:l.pendingAt[p.info.thread.id]},p.key):p.type==="older"?f(hy,{row:p,controller:o},p.key):p.type==="settled"?f(gy,{row:p,controller:o},p.key):f(Cy,{row:p,controller:o,environmentProviders:i},p.key))},HP(m[0])))})}var Ph=st(function({group:t,groupController:n,dropTargetGroupId:r,inOverflow:o=!1,...i}){let s=Fs({id:`drop-group:${t.descriptor.id}`,data:{kind:"group",groupId:t.descriptor.id}});return v("section",{ref:s.setNodeRef,"aria-label":t.descriptor.label,"data-sidebar-visibility-group":t.descriptor.id,"data-sidebar-section-id":t.descriptor.kind==="section"?t.descriptor.entityId??void 0:void 0,className:"relative flex w-full min-w-0 flex-col",children:[f(VP,{group:t,controller:n,inOverflow:o,dropActive:r===t.descriptor.id}),t.rows.length===0?t.collapsed||t.rootIds.length>0?null:f("p",{className:"py-1 pl-8 text-xs text-muted-foreground",children:"No threads"}):f(BP,{...i,rows:t.rows,groupId:t.descriptor.id,inPinned:t.descriptor.id==="pinned",forceMount:o})]})});function by(e){return e==="everything"}function vy(e){return e?"everything":"blocked"}function wy(e){return{chronologicalSort:e,sortDirection:yu(e)}}function xy(e){let t=Vn(e.chronologicalSort),r=pm(t,e.sortDirection)==="descending";return{glyph:r?"\u2193":"\u2191",label:t==="alpha"?r?"Z\u2013A":"A\u2013Z":r?"Newest first":"Oldest first",patch:{sortDirection:r?"ascending":"descending"}}}var UP="flex flex-1 gap-0.5 rounded-md bg-surface-recessed p-0.5",KP="flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-1 py-0.5 text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring";function GP(e){return x(KP,e?"bg-state-active text-foreground":"text-muted-foreground hover:bg-state-hover hover:text-foreground")}function ys({label:e,children:t}){return v("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 px-2 py-1",children:[f("span",{className:"min-w-[5.5rem] shrink-0 whitespace-nowrap text-sm",children:e}),f("div",{className:"flex flex-1 gap-2",children:t})]})}function bs({label:e,options:t,current:n,onSelect:r}){return f("div",{role:"radiogroup","aria-label":e,className:UP,children:t.map(([o,i])=>f("button",{type:"button",role:"radio","aria-checked":o===n,onClick:()=>r(o),className:GP(o===n),children:i},o))})}function Iy({label:e,checked:t,onChange:n,description:r}){return v("button",{type:"button",role:"checkbox","aria-checked":t,onClick:()=>n(!t),className:"flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-sm outline-none hover:bg-accent focus-visible:bg-accent",children:[f("span",{"aria-hidden":!0,className:x("mt-0.5 inline-flex size-4 shrink-0 items-center justify-center rounded-sm border border-input",t&&"border-primary bg-primary text-primary-foreground"),children:t?f(H,{name:z.check,"aria-hidden":!0,className:"size-3"}):null}),v("span",{className:"flex min-w-0 flex-col",children:[f("span",{children:e}),r?f("span",{className:"text-xs text-muted-foreground",children:r}):null]})]})}function Lh({children:e}){return f("h3",{className:"px-2 pb-0.5 pt-3 text-xs font-medium text-muted-foreground first:pt-0",children:e})}function Sy({prefs:e,client:t,onPrefs:n,onClient:r}){let o=xy(e);return v("div",{className:"flex flex-col",children:[f(Lh,{children:"List"}),f(ys,{label:"Group by",children:f(bs,{label:"Group by",options:[["project","Project"],["chronological","Custom"],["machine","Machine"]],current:e.organizationMode,onSelect:i=>n({organizationMode:i})})}),v(ys,{label:"Sort by",children:[f(bs,{label:"Sort by",options:[["updated","Updated"],["created","Created"],["alpha","A\u2013Z"]],current:Vn(e.chronologicalSort),onSelect:i=>n(wy(i))}),f("button",{type:"button","aria-label":`Sort order: ${o.label}. Reverse`,title:o.label,onClick:()=>n(o.patch),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-surface-recessed text-xs outline-none hover:bg-state-hover focus-visible:ring-2 focus-visible:ring-ring",children:o.glyph})]}),f(Iy,{label:"Worktrees as folders",description:"Threads sharing a worktree fold into one row",checked:e.environmentGrouping,onChange:i=>n({environmentGrouping:i})}),f(ys,{label:"Settle after",children:f(bs,{label:"Settle after",options:[["12h","12h"],["1d","1d"],["3d","3d"],["1w","1w"],["never","Never"]],current:e.settleAfter,onSelect:i=>n({settleAfter:i})})}),f(Lh,{children:"Rows"}),f(ys,{label:"Density",children:f(bs,{label:"Density",options:[["compact","Compact"],["comfortable","Comfortable"]],current:t.density,onSelect:i=>r({density:i})})}),f(ys,{label:"Harness icon",children:f(bs,{label:"Harness icon",options:[["muted","Muted"],["colour","Colour"]],current:e.harnessIcon,onSelect:i=>n({harnessIcon:i})})}),f(Lh,{children:"Attention"}),f(Iy,{label:"Needs attention counts every child",description:"Every unread or failed child thread; otherwise only those blocked on you.",checked:by(e.childAttention),onChange:i=>n({childAttention:vy(i)})})]})}var qP="bg-[color-mix(in_oklab,var(--attention)_14%,transparent)] text-[color:color-mix(in_oklab,var(--attention),var(--foreground)_55%)] hover:bg-[color-mix(in_oklab,var(--attention)_24%,transparent)]",YP="bg-[color-mix(in_oklab,var(--attention)_30%,transparent)] text-foreground",_y=st(function({mode:t,needYouCount:n,needYouOnly:r,onToggleNeedYou:o,hasUnread:i,onMarkAllRead:s,prefs:a,client:c,onPrefs:u,onClient:l}){let[d,m]=A(!1);return v("div",{"data-sidebar":"list-header",className:"flex h-7 items-center gap-1 pl-2 pr-1 text-xs text-muted-foreground max-md:pointer-coarse:h-9",children:[f("h2",{className:"min-w-0 flex-1 truncate font-medium select-none",children:Bk(t)}),n>0?v("button",{type:"button","aria-pressed":r,title:r?"Show every thread":"Show only what needs you",onClick:o,className:x("inline-flex h-5 shrink-0 items-center rounded-full px-1.5 text-xs leading-none tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r?YP:qP),children:[n," need you"]}):null,i?f("button",{type:"button","aria-label":"Mark all read",title:"Mark all read",className:Ft,onClick:s,children:f(H,{name:z.markRead,"aria-hidden":!0,className:"size-4"})}):null,v(sa,{open:d,onOpenChange:m,children:[f(ei,{asChild:!0,children:f("button",{type:"button","aria-label":"Thread Glance settings",title:"Settings",className:Ft,children:f(H,{name:z.settings,"aria-hidden":!0,className:"size-4"})})}),f(ti,{side:"bottom",align:"end",className:"w-80 max-w-[calc(100vw-1rem)] p-1",children:f(Sy,{prefs:a,client:c,onPrefs:u,onClient:l})})]})]})});var JP="thread-glance";function _r(e){return e instanceof Error?e.message:String(e)}async function Py(e,t){try{await navigator.clipboard.writeText(e),gt.success(t)}catch(n){gt.error("Couldn't copy",{description:_r(n)})}}var XP={activationConstraint:{distance:4}},QP={activationConstraint:{delay:200,tolerance:6}},eL=e=>{let t=e.active.data.current?.kind,n=i5(e);if(t==="group")return n.filter(o=>String(o.id).startsWith("drop-group:"));let r=n.filter(o=>String(o.id).startsWith("drop-thread:"));return r.length>0?r:n};function Ly(e){let t=e.activatorEvent,n=null;return t instanceof MouseEvent?n=t.clientY:typeof TouchEvent<"u"&&t instanceof TouchEvent&&(n=t.touches[0]?.clientY??null),n===null?null:n+e.delta.y}function Mh(e){let[t,n]=A(0);return f(tL,{...e,attempt:t,onRetry:()=>n(r=>r+1)},t)}function tL({activeThreadId:e,isCompactViewport:t,onNavigate:n,attempt:r,onRetry:o}){let{prefs:i,hydrated:s,update:a}=Xg(),[c,u]=Gg(),[l,d]=A(!1),m=$(null);_k(m);let p=Eh({experimental_lifecycles:i.showArchived?["active","archived"]:["active"]}),h=Ah(),g=Rr(),{providers:C}=Th(),{providers:w}=Dh(),y=Nh(),S=_s(),T=K(()=>new Set(S?.panes.flatMap(b=>b.threadId===null?[]:[b.threadId])??[]),[S]),{stamps:L,loaded:M,markSeen:E,markIdle:B,clearSeen:X}=t4(),oe=Qg(),ee=ok(),[Z,ne]=A(null),Q=K(()=>{let b=Object.values(oe).filter(_=>_>Date.now());return Z!==null&&b.push(Z),b.length>0?Math.min(...b):null},[oe,Z]),ge=Yg(Q),[yt,Ke]=A(null),[gn,nt]=A(null),[bt,Cn]=A(null),[Oe,rt]=A(""),Bt=$(new Map),[Bn,He]=A(!1),[Pr,Un]=A(!1),[ot,we]=A(null),[kn,me]=A(()=>new Map),[Kn,Ne]=A(null),vt=$(new Map),wt=p.status==="ready",Me=p.threads,xt=K(()=>new Map(Me.map(b=>[b.id,b])),[Me]),rn=qg(Me,B),re=K(()=>wt?d4({threads:Me,activeThreadId:e,openThreadIds:T,finishedAt:L.finishedAt,seenAt:L.seenAt,draftIds:y,scheduled:oe,now:ge,notes:ee,childAttention:i.childAttention,idleSince:rn,idleAt:L.idleAt,stampsLoaded:M}):null,[wt,Me,e,T,L.finishedAt,L.seenAt,L.idleAt,M,y,oe,ge,ee,i.childAttention,rn]),Ut=re?.nextOrphanAt??null;Ut!==Z&&ne(Ut);let{targets:Kt,prune:W}=t0(s?re:null,e),ze=K(()=>[...new Set(Me.flatMap(b=>b.environment?.branchName?[b.projectId]:[]))],[Me]),Do=ik(ze),vs=N(b=>Do.has(b.projectId)?Do.get(b.projectId)??null:void 0,[Do]),At=sk(),on=K(()=>({now:ge,settleAfter:i.settleAfter,startedAt:L.startedAt,finishedAt:L.finishedAt}),[ge,i.settleAfter,L.startedAt,L.finishedAt]),yn=$(null),te=K(()=>re===null?null:F4(yn.current,Z4({forest:re,threads:Me,projects:p.projects,sections:p.sections,prefs:i,activeThreadId:e,targets:Kt,settle:on,defaultProviderId:At.defaultProviderId,primaryHostId:At.primaryHostId,comfortable:c.density==="comfortable",defaultBranchOf:vs,needYouOnly:vm(l,Iu(re))})),[re,Me,p.projects,p.sections,i,e,Kt,on,At.defaultProviderId,At.primaryHostId,c.density,vs,l]);at(()=>{yn.current=te},[te]),l&&re!==null&&!vm(l,Iu(re))&&d(!1);let $t=$(null);D(()=>{let b=[$t.current,e].filter(_=>_!==null&&xt.get(_)?.parentThreadId!=null);$t.current=e,yk(),b.length>0&&E([...new Set(b)])},[e]);let Oo=K(()=>y4(C),[C]),ws=K(()=>{let b=new Map,_=new Map(C.map(R=>[R.id,R]));return R=>{let ue=b.get(R);if(ue===void 0){let fe=_.get(R);ue={id:R,name:fe?.displayName??R,provider:fe?.logoUrl?fe:null,mark:b4(R,Oo)},b.set(R,ue)}return ue}},[C,Oo]),bn=N(b=>{Object.keys(b.patch).length>0&&a(b.patch),b.drop!==null&&W(b.drop)},[a,W]),Gn=N((b,_,R)=>{let ue={activeThreadId:e,openThreadIds:T,finishedAt:L.finishedAt,seenAt:L.seenAt},fe=ye=>Ze=>gt.error(ye,{description:_r(Ze)});switch(b){case"open-in-split":h.open(_.id,{split:!0}),n();return;case"copy-link":Py(new URL(_.href,window.location.origin).toString(),"Thread link copied");return;case"copy-id":Py(_.id,"Thread ID copied");return;case"mark-read":{let ye=Fe.current.forest,Ze=ye===null?{read:[_.id],seen:[]}:P4(_.id,ye,ue);Ze.seen.length>0&&E(Ze.seen);for(let Jn of Ze.read)h.setRead(Jn,!0).catch(fe("Couldn't mark read"));return}case"mark-unread":X([_.id]),h.setRead(_.id,!1).catch(fe("Couldn't mark unread"));return;case"pin":case"unpin":h.setPinned(_.id,b==="pin").catch(fe("Couldn't change the pin"));return;case"move-to-section":g.threads.update({threadId:_.id,sectionId:R??null}).catch(fe("Couldn't move the thread"));return;case"rename":Ke(_.id);return;case"details":nt(_.id);return;case"move":rt(""),Cn(_.id);return;case"archive":h.archive(_.id);return;case"unarchive":g.threads.unarchive({threadId:_.id}).catch(fe("Couldn't unarchive"));return;case"delete":setTimeout(()=>h.requestDelete(_.id),0);return}},[h,e,T,X,E,n,g,L.finishedAt,L.seenAt]),No=$(Gn);at(()=>{No.current=Gn});let Fe=$({forest:re,view:te,prefs:i,byId:xt,activeThreadId:e,openThreadIds:T,stamps:L});at(()=>{Fe.current={forest:re,view:te,prefs:i,byId:xt,activeThreadId:e,openThreadIds:T,stamps:L}});let zo=N((b,_)=>{let R=`${b}:${_}`,ue=vt.current.get(R);if(ue===void 0){let fe=Fe.current.byId.get(b),ye=fe?.providerId??"",Ze=Bt.current.get(ye);Ze===void 0&&(Ze=g.providers.models(fe?.host?{providerId:ye,hostId:fe.host.id}:{providerId:ye}).then(jo=>jo.models,()=>[]),Bt.current.set(ye,Ze));let Jn=Ze;ue=g.threads.defaultExecutionOptions({threadId:b}).then(async jo=>jo===null?null:{model:dk(jo.model,await Jn),reasoningLevel:jo.reasoningLevel},()=>null),vt.current.set(R,ue)}return ue},[g]),Lr=re!==null&&te!==null,Mr=K(()=>Lr?{compact:t,comfortable:c.density==="comfortable",setEditingId:Ke,harnessIcon:i.harnessIcon,provider:ws,sections:p.sections,mode:i.organizationMode,onNavigate:n,onToggleChip:b=>{let{prefs:_,forest:R}=Fe.current;bn(w4(b,_,R))},onToggleOlder:b=>{let{prefs:_,forest:R}=Fe.current;bn(I4(b,_,R))},onToggleSettled:b=>bn(S4(b,Fe.current.prefs)),onToggleEnvironment:b=>{let{collapsedEnvironments:_}=Fe.current.prefs;a({collapsedEnvironments:_.includes(b)?_.filter(R=>R!==b):[..._,b]})},onMenuAction:(b,_,R)=>No.current(b,_,R),onRename:(b,_)=>h.rename(b,_),loadModel:zo,openDetails:nt,onNewThreadInEnvironment:(b,_,R)=>{h.openNewThread({projectId:_,environmentId:b,...R?{sectionId:R}:{},focusPrompt:!0}),n()},onRenameEnvironment:async(b,_)=>{await g.environments.update({environmentId:b,name:_})},onArchiveEnvironment:b=>{g.environments.archiveThreads({environmentId:b}).catch(_=>gt.error("Couldn't archive the environment",{description:_r(_)}))}}:null,[Lr,t,c.density,i.harnessIcon,i.organizationMode,ws,p.sections,n,bn,a,h,g,zo]),Xu=K(()=>({now:ge,stamps:L,notes:ee,treeOf:b=>re?.treeOf.get(b)}),[ge,L,ee,re]),Se=K(()=>{let b=e===null||re===null?void 0:re.treeOf.get(e);return b===void 0?null:vu(b.root.thread,{mode:i.organizationMode,projects:p.projects})},[e,re,i.organizationMode,p.projects]),Be=i.showArchived,Re=N((b,_)=>{let{activeThreadId:R,openThreadIds:ue,stamps:fe}=Fe.current,ye=Cm(b,{activeThreadId:R,openThreadIds:ue,finishedAt:fe.finishedAt,seenAt:fe.seenAt}),Ze=()=>{ye.seen.length>0&&E(ye.seen);for(let Jn of ye.read)h.setRead(Jn,!0).catch(()=>{})};ye.read.length>g4?we({title:`Mark ${ye.read.length} threads read?`,description:`Every unread thread in ${_}, child threads included, will be marked read.`,confirmLabel:"Mark all read",run:Ze}):Ze()},[h,E]),Gt=N(()=>Re(Fe.current.forest?.trees??[],"the list"),[Re]),it=N(()=>d(b=>!b),[]),je=K(()=>{if(!Lr)return null;let b=_=>Re(_.rootIds.flatMap(R=>Fe.current.forest.treeOf.get(R)??[]),_.descriptor.label);return{compact:t,activeGroupId:Se,showArchived:Be,onToggleArchived:()=>a({showArchived:!Fe.current.prefs.showArchived}),canCreateSections:i.organizationMode==="chronological",onToggleCollapse:_=>{let{prefs:R,forest:ue}=Fe.current;bn(_4(_,R,ue))},onNewThread:_=>{let R=_.descriptor;h.openNewThread({...R.newThreadProjectId?{projectId:R.newThreadProjectId}:{},...R.newThreadSectionId?{sectionId:R.newThreadSectionId}:{},focusPrompt:!0}),n()},onHide:_=>a({hiddenGroups:[...Fe.current.prefs.hiddenGroups,_.descriptor.id]}),onShow:_=>a({hiddenGroups:Fe.current.prefs.hiddenGroups.filter(R=>R!==_.descriptor.id)}),onCustomize:()=>He(!0),onRename:async(_,R)=>{_.descriptor.kind==="section"?await g.threadSections.update({id:_.descriptor.entityId,name:R}):_.descriptor.kind==="machine"&&await g.hosts.update({hostId:_.descriptor.entityId,name:R})},onRemove:_=>we({title:"Remove section?",description:"Threads in this section will move back to Threads.",confirmLabel:"Remove",destructive:!0,run:()=>{g.threadSections.delete({id:_.descriptor.entityId}).catch(R=>gt.error("Couldn't remove the section",{description:_r(R)}))}}),onMarkAllRead:b,onNewSection:()=>Un(!0)}},[Lr,t,Se,Be,i.organizationMode,bn,h,n,a,g,Re]),It=o5(Zs(qo,XP),Zs(Yo,QP),Zs(Nr)),Et=N(b=>{let _=b.over;if(_===null)return null;let R=_.data.current;if(R===void 0)return null;if(R.kind==="group")return{kind:"group",groupId:R.groupId};let ue=Ly(b),fe=_.rect,ye=ue===null?.5:(ue-fe.top)/Math.max(fe.height,1),Ze=ye<.25?"before":ye>.75?"after":"middle";return{kind:"thread",threadId:R.threadId,zone:Ze,inPinned:R.inPinned??!1}},[]),Ce=K(()=>{let b=new Map;for(let R of[...te?.groups??[],...te?.more??[]])for(let ue of R.rows)ue.type==="thread"&&b.set(ue.info.thread.id,R.descriptor.id);let _=te?.groups.find(R=>R.descriptor.id==="pinned");return{mode:i.organizationMode,parentOf:R=>xt.get(R)?.parentThreadId??null,pinnedOrder:(_?.rows??[]).flatMap(R=>R.type==="thread"&&R.depth===0?[R.info.thread.id]:[]),groupOfThread:R=>b.get(R)??"threads"}},[te,i.organizationMode,xt]),qt=N(b=>{let _=b.active.data.current,R=Et(b);if(_?.kind!=="thread"||R===null){me(new Map),Ne(_?.kind==="group"&&R?.kind==="group"?R.groupId:null);return}if(R.kind==="group"){me(new Map),Ne(R.groupId);return}Ne(null);let ue=dm(_.thread,R,Ce),fe=ue.type==="blocked"?"blocked":ue.type==="unchanged"?"unchanged":R.zone==="middle"?"valid":R.zone;me(new Map([[R.threadId,fe]]))},[Et,Ce]),mt=N(async b=>{switch(b.type){case"nest":b.unpinFirst&&await g.threads.unpin({threadId:b.threadId}),await g.threads.update({threadId:b.threadId,parentThreadId:b.parentThreadId});return;case"move":await g.threads.update({threadId:b.threadId,sectionId:b.sectionId,...b.detach?{parentThreadId:null}:{}});return;case"detach":await g.threads.update({threadId:b.threadId,parentThreadId:null});return;case"pin":await h.setPinned(b.threadId,!0);return;case"unpin":await h.setPinned(b.threadId,!1);return;case"reorder-pinned":await g.threads.reorderPinned({threadId:b.threadId,previousThreadId:b.previousThreadId,nextThreadId:b.nextThreadId});return;case"blocked":case"unchanged":return}},[g,h]),Dt=N(b=>{me(new Map),Ne(null);let _=b.active.data.current,R=Et(b);if(_===void 0||R===null||te===null)return;if(_.kind==="group"){if(R.kind!=="group"||R.groupId===_.groupId)return;let fe=b.over.rect,ye=Ly(b),Ze=ye!==null&&ye>fe.top+fe.height/2?"after":"before",Jn=is[i.organizationMode];a({[Jn]:hm(te.order,_.groupId,R.groupId,Ze)});return}let ue=dm(_.thread,R,Ce);mt(ue).catch(fe=>gt.error("Failed to move thread.",{description:_r(fe)}))},[Et,te,i.organizationMode,a,Ce,mt]),qn=N(()=>me(new Map),[]),Yn=K(()=>{if(te===null)return[];let b=new Map([...te.groups,...te.more].map(_=>[_.descriptor.id,_]));return te.order.flatMap(_=>{let R=b.get(_);return R===void 0?[]:[{id:_,label:R.descriptor.label,hidden:R.hidden,hideable:_!=="pinned"}]})},[te]);if(p.status==="error")return v("div",{role:"alert",className:"flex flex-col items-start gap-2 px-3 py-2 text-sm",children:[f("p",{className:"text-muted-foreground",children:"Threads couldn't load."}),r===0?f(Ye,{size:"sm",variant:"outline",onClick:o,children:"Retry"}):f(Ye,{size:"sm",variant:"outline",onClick:()=>{g.plugins.reload({pluginId:JP}).catch(()=>window.location.reload())},children:"Reload plugin"})]});if(p.status==="loading"||!s||te===null||Mr===null||je===null)return f("div",{role:"status","aria-label":"Loading threads",className:"flex flex-col gap-1 px-2 py-1",children:[0,1,2].map(b=>f("div",{"data-sidebar":"navigation-loading-row",className:"h-7 animate-pulse rounded-md bg-muted/60"},b))});let Te=p.experimental_archived,ht=gn===null?null:re?.infos.get(gn)??null,Ot=bt===null?null:xt.get(bt)??null;return f(_u.Provider,{value:Xu,children:v("div",{ref:m,className:"flex w-full min-w-0 flex-col px-1.5 pb-2",children:[f(_y,{mode:i.organizationMode,needYouCount:te.needYouCount,needYouOnly:l,onToggleNeedYou:it,hasUnread:te.hasUnread,onMarkAllRead:Gt,prefs:i,client:c,onPrefs:a,onClient:u}),Me.length===0?f("p",{className:"px-3 py-4 text-sm text-muted-foreground",children:"No threads yet."}):v(C5,{sensors:It,collisionDetection:eL,onDragMove:qt,onDragEnd:Dt,onDragCancel:qn,children:[te.groups.map(b=>f(Ph,{group:b,rowController:Mr,groupController:je,environmentProviders:w,dropStates:kn,dropTargetGroupId:Kn,activeThreadId:e,editingId:yt,now:ge,stamps:L},b.descriptor.id)),te.more.length>0?v(sa,{children:[f(ei,{asChild:!0,children:v("button",{type:"button","data-testid":"sidebar-thread-list-more-trigger","aria-label":`More: ${te.more.length} hidden ${te.more.length===1?"group":"groups"}`,className:"mt-1 flex h-7 w-full items-center gap-1 rounded-md pl-2 pr-1 text-left text-xs text-muted-foreground outline-none hover:bg-sidebar-accent focus-visible:ring-2 focus-visible:ring-sidebar-ring",children:[f("span",{className:"flex-1 font-medium",children:"More"}),f(ju,{counters:te.moreCounters}),f(H,{name:"ChevronRight","aria-hidden":!0,className:"size-3"})]})}),f(ti,{side:"right",align:"end",className:"max-h-[70vh] w-72 overflow-y-auto p-1",children:f("div",{"data-sidebar-overflow":"true",className:"flex flex-col",children:te.more.map(b=>f(Ph,{group:b,rowController:Mr,groupController:je,environmentProviders:w,dropStates:kn,dropTargetGroupId:Kn,activeThreadId:e,editingId:yt,now:ge,stamps:L,inOverflow:!0},b.descriptor.id))})})]}):null]}),Te!==null?v("div",{className:"flex flex-col items-start gap-1 px-2 pt-2",children:[Te.status==="loading"?f("p",{role:"status",className:"text-xs text-muted-foreground",children:"Loading archived threads\u2026"}):Te.status==="error"?f("p",{role:"status",className:"text-xs text-muted-foreground",children:"Archived threads unavailable"}):null,Te.hasNextPage||Te.isFetchNextPageError?f(Ye,{size:"sm",variant:"ghost","aria-label":"Load more archived threads",disabled:Te.isFetchingNextPage,className:x("h-7 text-xs text-muted-foreground"),onClick:()=>{Te.fetchNextPage()},children:Te.isFetchingNextPage?"Loading\u2026":Te.isFetchNextPageError?"Retry loading":"Show more"}):null]}):null,f(QC,{open:Bn,items:Yn,onOpenChange:He,onToggleHidden:b=>a({hiddenGroups:i.hiddenGroups.includes(b)?i.hiddenGroups.filter(_=>_!==b):[...i.hiddenGroups,b]}),onMove:(b,_)=>{let R=te.order.indexOf(b),ue=te.order[R+_];ue!==void 0&&a({[is[i.organizationMode]]:hm(te.order,b,ue,_<0?"before":"after")})}}),f(ek,{open:Pr,onOpenChange:Un,onCreate:async b=>{try{await g.threadSections.create({name:b})}catch(_){throw gt.error("Couldn't create the section",{description:_r(_)}),_}}}),f(tk,{open:ot!==null,title:ot?.title??"",description:ot?.description??"",confirmLabel:ot?.confirmLabel??"OK",destructive:ot?.destructive,onOpenChange:b=>!b&&we(null),onConfirm:()=>{ot?.run(),we(null)}}),ht!=null?f(nk,{open:!0,title:ht.thread.displayTitle,onOpenChange:b=>!b&&nt(null),children:f(Ju,{info:ht,controller:Mr,showPullRequest:!0,actions:{open:()=>{nt(null),h.open(ht.thread.id),n()},toggleRead:()=>Gn(ht.unread?"mark-read":"mark-unread",ht.thread)}})}):null,Ot!==null&&re!==null?f(rk,{open:!0,title:Ot.displayTitle,targets:ak(Ot.id,re,Oe),query:Oe,onQueryChange:rt,onOpenChange:b=>!b&&Cn(null),onMove:b=>{(async()=>{b!==null&&(Ot.pinnedAt!==null||Ot.isPinned)&&await g.threads.unpin({threadId:Ot.id}),await g.threads.update({threadId:Ot.id,parentThreadId:b})})().catch(R=>gt.error("Failed to move thread.",{description:_r(R)}))}}):null]})})}var OF=Rh(e=>{e.slots.experimental_threadList({id:"thread-glance",title:"Thread Glance",description:"Every thread's state, harness and child threads at a glance.",component:Mh})});export{OF as default};
|