vibora 8.6.1 → 8.6.2

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/bin/vibora.js CHANGED
@@ -32635,7 +32635,7 @@ function installUv() {
32635
32635
  var package_default = {
32636
32636
  name: "vibora",
32637
32637
  private: true,
32638
- version: "8.6.1",
32638
+ version: "8.6.2",
32639
32639
  description: "Harness Attention. Orchestrate Agents. Ship.",
32640
32640
  license: "PolyForm-Shield-1.0.0",
32641
32641
  type: "module",
@@ -24,9 +24,9 @@ Error generating stack: `+k.message+`
24
24
  `:"",R=_+w+S+A+C;t(R)}else t(e+(e?`
25
25
  `:"")+S)}catch(S){St.error(a("errors.imageUploadFailed")),jt.kanban.error("Upload error",{error:String(S)})}finally{o(!1)}return}}};return f.jsxs("div",{className:"space-y-2",children:[f.jsxs("div",{className:"relative",children:[f.jsx(F0,{ref:l,value:e,onChange:d=>t(d.target.value),onPaste:p,className:Be(s&&"opacity-50",n),disabled:s||r,...i}),s&&f.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 rounded-md",children:f.jsx("span",{className:"text-sm text-muted-foreground",children:a("status.uploading")})})]}),u.length>0&&f.jsx("div",{className:"flex flex-wrap gap-2",children:u.map((d,m)=>f.jsx("a",{href:gH(d),target:"_blank",rel:"noopener noreferrer",className:"block",children:f.jsx("img",{src:gH(d),alt:`Attachment ${m+1}`,className:"h-16 w-auto rounded border object-cover hover:opacity-80 transition-opacity"})},m))})]})}function Vi({className:e,...t}){return f.jsx("label",{"data-slot":"label",className:Be("gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",e),...t})}const h3=T.forwardRef(function(t,n){const{className:r,render:i,orientation:a="horizontal",...s}=t,o=T.useMemo(()=>({orientation:a}),[a]);return wt("div",t,{state:o,ref:n,props:[{role:"separator","aria-orientation":a},s]})});function u_e({className:e,orientation:t="horizontal",...n}){return f.jsx(h3,{"data-slot":"separator",orientation:t,className:Be("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",e),...n})}function lp({className:e,...t}){return f.jsx("div",{"data-slot":"field-group",className:Be("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",e),...t})}const c_e=kd("data-[invalid=true]:text-destructive gap-2 group/field flex w-full",{variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function Vn({className:e,orientation:t="vertical",...n}){return f.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:Be(c_e({orientation:t}),e),...n})}function qn({className:e,...t}){return f.jsx(Vi,{"data-slot":"field-label",className:Be("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function Ea({className:e,...t}){return f.jsx("p",{"data-slot":"field-description",className:Be("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function tre(e){const t=T.useRef(!0);t.current&&(t.current=!1,e())}const nre=T.createContext(null),rre=T.createContext(null);function Hl(){const e=T.useContext(nre);if(e===null)throw new Error(nn(60));return e}function ire(){const e=T.useContext(rre);if(e===null)throw new Error(nn(61));return e}const are=(e,t)=>Object.is(e,t);function Gu(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Rf(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Gu(r,t,n))}function Am(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Gu(r,t,n))}function sre(e,t,n){return e.filter(r=>!Gu(r,t,n))}function FD(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function ore(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function bi(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return FD(e)}function Lo(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?FD(e.value):FD(e)}function d_e(e,t,n){if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??bi(e,n);if(Array.isArray(t)){const r=ore(t)?t.flatMap(i=>i.items):t;if(e==null){const i=r.find(a=>a.value==null);return i&&i.label!=null?i.label:bi(e,n)}if(typeof e!="object"){const i=r.find(a=>a&&a.value===e);return i&&i.label!=null?i.label:bi(e,n)}if("value"in e){const i=r.find(a=>a&&a.value===e.value);if(i&&i.label!=null)return i.label}}return bi(e,n)}function f_e(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>bi(n,t)).join(", ")}const Xt={id:Ve(e=>e.id),modal:Ve(e=>e.modal),multiple:Ve(e=>e.multiple),items:Ve(e=>e.items),itemToStringLabel:Ve(e=>e.itemToStringLabel),itemToStringValue:Ve(e=>e.itemToStringValue),isItemEqualToValue:Ve(e=>e.isItemEqualToValue),value:Ve(e=>e.value),open:Ve(e=>e.open),mounted:Ve(e=>e.mounted),forceMount:Ve(e=>e.forceMount),transitionStatus:Ve(e=>e.transitionStatus),openMethod:Ve(e=>e.openMethod),activeIndex:Ve(e=>e.activeIndex),selectedIndex:Ve(e=>e.selectedIndex),isActive:Ve((e,t)=>e.activeIndex===t),isSelected:Ve((e,t,n)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>Gu(a,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Gu(i,n,r)}),isSelectedByFocus:Ve((e,t)=>e.selectedIndex===t),popupProps:Ve(e=>e.popupProps),triggerProps:Ve(e=>e.triggerProps),triggerElement:Ve(e=>e.triggerElement),positionerElement:Ve(e=>e.positionerElement),listElement:Ve(e=>e.listElement),scrollUpArrowVisible:Ve(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ve(e=>e.scrollDownArrowVisible),hasScrollArrows:Ve(e=>e.hasScrollArrows),serializedValue:Ve(e=>{const{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?"":Lo(n,r)})};function rd(e,t){const n=T.useRef(e),r=Je(t);at(()=>{n.current!==e&&r(n.current)},[e,r]),at(()=>{n.current=e},[e])}function p_e(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:s=!1,onOpenChange:o,name:l,disabled:u=!1,readOnly:p=!1,required:d=!1,modal:m=!0,actionsRef:g,inputRef:x,onOpenChangeComplete:S,items:b,multiple:y=!1,itemToStringLabel:v,itemToStringValue:_,isItemEqualToValue:C=are,highlightItemOnHover:w=!0,children:A}=e,{clearErrors:R}=Eg(),{setDirty:O,shouldValidateOnChange:N,validityData:D,setFilled:L,name:z,disabled:P,validation:V}=is(),{controlId:H}=zl(),j=j0({id:t}),G=P||u,q=z??l,[B,F]=Ja({controlled:n,default:y?r??_a:r,name:"Select",state:"value"}),[U,K]=Ja({controlled:a,default:s,name:"Select",state:"open"}),W=T.useRef([]),ee=T.useRef([]),oe=T.useRef(null),ne=T.useRef(null),Z=T.useRef(0),Y=T.useRef(null),Q=T.useRef([]),re=T.useRef(!1),se=T.useRef(!1),te=T.useRef(null),xe=T.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),be=T.useRef(!1),{mounted:ce,setMounted:ye,transitionStatus:me}=xo(U),{openMethod:Pe,triggerProps:Ie,reset:We}=Mw(U),Te=Li(()=>new Hf({id:j,modal:m,multiple:y,itemToStringLabel:v,itemToStringValue:_,isItemEqualToValue:C,value:B,open:U,mounted:ce,transitionStatus:me,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,he=tt(Te,Xt.activeIndex),fe=tt(Te,Xt.selectedIndex),ke=tt(Te,Xt.triggerElement),Se=tt(Te,Xt.positionerElement),pe=T.useMemo(()=>y&&Array.isArray(B)&&B.length===0?"":Lo(B,_),[y,B,_]),Oe=T.useMemo(()=>y&&Array.isArray(B)?B.map(Ct=>Lo(Ct,_)):Lo(B,_),[y,B,_]),Ee=Er(Te.state.triggerElement);_g({id:j,commit:V.commit,value:B,controlRef:Ee,name:q,getValue:()=>Oe});const Ue=T.useRef(B);at(()=>{B!==Ue.current&&Te.set("forceMount",!0)},[Te,B]),at(()=>{L(B!==null)},[B,L]),at(function(){if(U)return;const Vt=Q.current;if(y){const Me=Array.isArray(B)?B:[];if(Me.length===0){Te.set("selectedIndex",null);return}const st=Me[Me.length-1],Ot=Am(Vt,st,C);Te.set("selectedIndex",Ot===-1?null:Ot);return}const qt=Am(Vt,B,C);Te.set("selectedIndex",qt===-1?null:qt)},[y,U,B,Q,C,Te]),rd(B,()=>{R(q),O(B!==D.initialValue),N()?V.commit(B):V.commit(B,!0)});const Ge=Je((Ct,Vt)=>{if(o?.(Ct,Vt),!Vt.isCanceled&&(K(Ct),!Ct&&Te.state.activeIndex!==null)){const qt=W.current[Te.state.activeIndex];queueMicrotask(()=>{qt?.setAttribute("tabindex","-1")})}}),ze=Je(()=>{ye(!1),Te.set("activeIndex",null),We(),S?.(!1)});Pi({enabled:!g,open:U,ref:oe,onComplete(){U||ze()}}),T.useImperativeHandle(g,()=>({unmount:ze}),[ze]);const Xe=Je((Ct,Vt)=>{i?.(Ct,Vt),!Vt.isCanceled&&F(Ct)}),Qe=Je(()=>{const Ct=Te.state.listElement||oe.current;if(!Ct)return;const Vt=Ct.scrollTop,qt=Ct.scrollTop+Ct.clientHeight,Me=Vt>1,st=qt<Ct.scrollHeight-1;Te.state.scrollUpArrowVisible!==Me&&Te.set("scrollUpArrowVisible",Me),Te.state.scrollDownArrowVisible!==st&&Te.set("scrollDownArrowVisible",st)}),Fe=Cw({open:U,onOpenChange:Ge,elements:{reference:ke,floating:Se}}),bt=bg(Fe,{enabled:!p&&!G,event:"mousedown"}),Ne=vg(Fe,{bubbles:!1}),qe=JM(Fe,{enabled:!p&&!G,listRef:W,activeIndex:he,selectedIndex:fe,disabledIndices:_a,onNavigate(Ct){Ct===null&&!U||Te.set("activeIndex",Ct)},focusItemOnHover:!1}),nt=e3(Fe,{enabled:!p&&!G&&(U||!y),listRef:ee,activeIndex:he,selectedIndex:fe,onMatch(Ct){U?Te.set("activeIndex",Ct):Xe(Q.current[Ct],ft("none"))},onTypingChange(Ct){re.current=Ct}}),{getReferenceProps:ht,getFloatingProps:gt,getItemProps:fn}=Id([bt,Ne,qe,nt]),rt=T.useMemo(()=>Ho(ht(),Ie),[ht,Ie]);tre(()=>{Te.update({popupProps:gt(),triggerProps:rt})}),at(()=>{Te.update({id:j,modal:m,multiple:y,value:B,open:U,mounted:ce,transitionStatus:me,popupProps:gt(),triggerProps:rt,items:b,itemToStringLabel:v,itemToStringValue:_,isItemEqualToValue:C,openMethod:Pe})},[Te,j,m,y,B,U,ce,me,gt,rt,b,v,_,C,Pe]);const _t=T.useMemo(()=>({store:Te,name:q,required:d,disabled:G,readOnly:p,multiple:y,itemToStringLabel:v,itemToStringValue:_,highlightItemOnHover:w,setValue:Xe,setOpen:Ge,listRef:W,popupRef:oe,scrollHandlerRef:ne,handleScrollArrowVisibility:Qe,scrollArrowsMountedCountRef:Z,getItemProps:fn,events:Fe.context.events,valueRef:Y,valuesRef:Q,labelsRef:ee,typingRef:re,selectionRef:xe,selectedItemTextRef:te,validation:V,onOpenChangeComplete:S,keyboardActiveRef:se,alignItemWithTriggerActiveRef:be,initialValueRef:Ue}),[Te,q,d,G,p,y,v,_,w,Xe,Ge,fn,Fe.context.events,V,S,Qe]),pt=ns(x,V.inputRef),rn=y&&Array.isArray(B)&&B.length>0,Ut=T.useMemo(()=>!y||!Array.isArray(B)||!q?null:B.map(Ct=>{const Vt=Lo(Ct,_);return f.jsx("input",{type:"hidden",name:q,value:Vt},Vt)}),[y,B,q,_]);return f.jsx(nre.Provider,{value:_t,children:f.jsxs(rre.Provider,{value:Fe,children:[A,f.jsx("input",{...V.getInputValidationProps({onFocus(){Te.state.triggerElement?.focus()},onChange(Ct){if(Ct.nativeEvent.defaultPrevented)return;const Vt=Ct.target.value,qt=ft(Hr,Ct.nativeEvent);function Me(){if(y)return;const st=Q.current.find(Ot=>Lo(Ot,_).toLowerCase()===Vt.toLowerCase());st!=null&&(O(st!==D.initialValue),Xe(st,qt),N()&&V.commit(st))}Te.set("forceMount",!0),queueMicrotask(Me)}}),id:t||H||void 0,name:y?void 0:q,value:pe,disabled:G,required:d&&!rn,readOnly:p,ref:pt,style:Nd,tabIndex:-1,"aria-hidden":!0}),Ut]})})}function m3(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const a=parseFloat(n.width)||0,s=parseFloat(n.height)||0,o=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,a,o),p=Math.max(t.height,s,l),d=u-t.width,m=p-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-m/2,bottom:t.bottom+m/2}}const rS=2,h_e={..._m,...lc,value:()=>null},m_e=T.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,...o}=t,{setTouched:l,setFocused:u,validationMode:p,state:d,disabled:m}=is(),{labelId:g}=zl(),{store:x,setOpen:S,selectionRef:b,validation:y,readOnly:v,alignItemWithTriggerActiveRef:_,disabled:C,keyboardActiveRef:w}=Hl(),A=m||C||a,R=tt(x,Xt.open),O=tt(x,Xt.value),N=tt(x,Xt.triggerProps),D=tt(x,Xt.positionerElement),L=tt(x,Xt.listElement),z=tt(x,Xt.serializedValue),P=Er(D),V=T.useRef(null),H=Gn(),j=Gn(),{getButtonProps:G,buttonRef:q}=fa({disabled:A,native:s}),B=Je(ne=>{x.set("triggerElement",ne)}),F=ns(n,V,q,B),U=Gn(),K=Gn();T.useEffect(()=>{if(R)return K.start(200,()=>{b.current.allowUnselectedMouseUp=!0,U.start(200,()=>{b.current.allowSelectedMouseUp=!0})}),()=>{U.clear(),K.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},j.clear()},[R,b,j,U,K]);const W=T.useMemo(()=>L?.id??iy(D)?.id,[L,D]),ee=Ho(N,{role:"combobox","aria-expanded":R?"true":"false","aria-haspopup":"listbox","aria-controls":R?W:void 0,"aria-labelledby":g,"aria-readonly":v||void 0,tabIndex:A?-1:0,ref:F,onFocus(ne){u(!0),R&&_.current&&S(!1,ft(Wo,ne.nativeEvent)),H.start(0,()=>{x.set("forceMount",!0)})},onBlur(){l(!0),u(!1),p==="onBlur"&&y.commit(O)},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(ne){if(R)return;const Z=Yi(ne.currentTarget);function Y(Q){if(!V.current)return;const re=Q.target;if(Mt(V.current,re)||Mt(P.current,re)||re===V.current)return;const se=m3(V.current);Q.clientX>=se.left-rS&&Q.clientX<=se.right+rS&&Q.clientY>=se.top-rS&&Q.clientY<=se.bottom+rS||S(!1,ft(Hte,Q))}j.start(0,()=>{Z.addEventListener("mouseup",Y,{once:!0})})}},y.getValidationProps,o,G);ee.role="combobox";const oe=T.useMemo(()=>({...d,open:R,disabled:A,value:O,readOnly:v,placeholder:!z}),[d,R,A,O,v,z]);return wt("button",t,{ref:[n,V],state:oe,stateAttributesMapping:h_e,props:ee})}),g_e={value:()=>null},b_e=T.forwardRef(function(t,n){const{className:r,render:i,children:a,...s}=t,{store:o,valueRef:l}=Hl(),u=tt(o,Xt.value),p=tt(o,Xt.items),d=tt(o,Xt.itemToStringLabel),m=tt(o,Xt.serializedValue),g=T.useMemo(()=>({value:u,placeholder:!m}),[u,m]),x=typeof a=="function"?a(u):a??(Array.isArray(u)?f_e(u,d):d_e(u,p,d));return wt("span",t,{state:g,ref:[n,l],props:[{children:x},s],stateAttributesMapping:g_e})}),v_e=T.forwardRef(function(t,n){const{className:r,render:i,...a}=t,{store:s}=Hl(),o=tt(s,Xt.open),l=T.useMemo(()=>({open:o}),[o]);return wt("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:kw})}),y_e=T.createContext(void 0),x_e=T.forwardRef(function(t,n){const{store:r}=Hl(),i=tt(r,Xt.mounted),a=tt(r,Xt.forceMount);return i||a?f.jsx(y_e.Provider,{value:!0,children:f.jsx(T0,{ref:n,...t})}):null}),lre=T.createContext(void 0);function g3(){const e=T.useContext(lre);if(!e)throw new Error(nn(59));return e}function RE(e,t){e&&Object.assign(e.style,t)}const ure={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},S_e={position:"fixed"},E_e=T.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:s,side:o="bottom",align:l="center",sideOffset:u=0,alignOffset:p=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:S,alignItemWithTrigger:b=!0,collisionAvoidance:y=vw,...v}=t,{store:_,listRef:C,labelsRef:w,alignItemWithTriggerActiveRef:A,selectedItemTextRef:R,valuesRef:O,initialValueRef:N,popupRef:D,setValue:L}=Hl(),z=ire(),P=tt(_,Xt.open),V=tt(_,Xt.mounted),H=tt(_,Xt.modal),j=tt(_,Xt.value),G=tt(_,Xt.openMethod),q=tt(_,Xt.positionerElement),B=tt(_,Xt.triggerElement),F=tt(_,Xt.isItemEqualToValue),U=T.useRef(null),K=T.useRef(null),[W,ee]=T.useState(b),oe=V&&W&&G!=="touch";!V&&W!==b&&ee(b),at(()=>{V||(Xt.scrollUpArrowVisible(_.state)&&_.set("scrollUpArrowVisible",!1),Xt.scrollDownArrowVisible(_.state)&&_.set("scrollDownArrowVisible",!1))},[_,V]),T.useImperativeHandle(A,()=>oe),Pw((oe||H)&&P&&G!=="touch",B);const ne=D0({anchor:r,floatingRootContext:z,positionMethod:i,mounted:V,side:o,sideOffset:u,align:l,alignOffset:p,arrowPadding:g,collisionBoundary:d,collisionPadding:m,sticky:x,disableAnchorTracking:S??oe,collisionAvoidance:y,keepMounted:!0}),Z=oe?"none":ne.side,Y=oe?S_e:ne.positionerStyles,Q=T.useMemo(()=>{const ye={};return P||(ye.pointerEvents="none"),{role:"presentation",hidden:!V,style:{...Y,...ye}}},[P,V,Y]),re=T.useMemo(()=>({open:P,side:Z,align:ne.align,anchorHidden:ne.anchorHidden}),[P,Z,ne.align,ne.anchorHidden]),se=Je(ye=>{_.set("positionerElement",ye)}),te=wt("div",t,{ref:[n,se],state:re,stateAttributesMapping:ls,props:[Q,v]}),xe=T.useRef(0),be=Je(ye=>{if(ye.size===0&&xe.current===0||O.current.length===0)return;const me=xe.current;if(xe.current=ye.size,ye.size===me)return;const Pe=ft(Hr);if(me!==0&&!_.state.multiple&&j!==null&&Am(O.current,j,F)===-1){const We=N.current,he=We!=null&&Rf(O.current,We,F)?We:null;L(he,Pe),he===null&&(_.set("selectedIndex",null),R.current=null)}if(me!==0&&_.state.multiple&&Array.isArray(j)){const Ie=j.filter(We=>Rf(O.current,We,F));(Ie.length!==j.length||Ie.some(We=>!Rf(j,We,F)))&&(L(Ie,Pe),Ie.length===0&&(_.set("selectedIndex",null),R.current=null))}if(P&&oe){_.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ie={height:""};RE(q,Ie),RE(D.current,Ie)}}),ce=T.useMemo(()=>({...ne,side:Z,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:U,scrollDownArrowRef:K}),[ne,Z,oe,ee]);return f.jsx(k0,{elementsRef:C,labelsRef:w,onMapChange:be,children:f.jsxs(lre.Provider,{value:ce,children:[V&&H&&f.jsx(Lw,{inert:yg(!P),cutout:B}),te]})})});function cre(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const iS="base-ui-disable-scrollbar",my={className:iS,element:f.jsx("style",{href:iS,precedence:"base-ui:low",children:`.${iS}{scrollbar-width:none}.${iS}::-webkit-scrollbar{display:none}`})},__e=T.createContext(void 0);function b3(e){return T.useContext(__e)}const w_e={...ls,...os},C_e=T.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{store:s,popupRef:o,onOpenChangeComplete:l,setOpen:u,valueRef:p,selectedItemTextRef:d,keyboardActiveRef:m,multiple:g,handleScrollArrowVisibility:x,scrollHandlerRef:S}=Hl(),{side:b,align:y,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:_,scrollDownArrowRef:C,scrollUpArrowRef:w}=g3(),A=b3()!=null,R=ire(),O=Gn(),N=tt(s,Xt.id),D=tt(s,Xt.open),L=tt(s,Xt.mounted),z=tt(s,Xt.popupProps),P=tt(s,Xt.transitionStatus),V=tt(s,Xt.triggerElement),H=tt(s,Xt.positionerElement),j=tt(s,Xt.listElement),G=T.useRef(0),q=T.useRef(!1),B=T.useRef(0),F=T.useRef(!1),U=T.useRef({}),K=Pu(),W=Je(Z=>{if(!H||!o.current||!F.current)return;if(q.current||!v){x();return}const Y=H.style.top==="0px",Q=H.style.bottom==="0px",re=H.getBoundingClientRect().height,se=Yi(H),te=getComputedStyle(H),xe=parseFloat(te.marginTop),be=parseFloat(te.marginBottom),ce=se.documentElement.clientHeight-xe-be,ye=Z.scrollTop,me=Z.scrollHeight,Pe=Z.clientHeight,Ie=me-Pe;let We=null,Te=null,he=!1;if(Y){const fe=Ie-ye,ke=re+fe,Se=Math.min(ke,ce);We=Se,Se!==ce?Te=Ie:he=!0}else if(Q){const fe=ye-0,ke=re+fe,Se=Math.min(ke,ce),pe=ke-ce;We=Se,Se!==ce?Te=0:(he=!0,ye<Ie&&(Te=ye-(fe-pe)))}We!=null&&(H.style.height=`${We}px`),Te!=null&&(Z.scrollTop=Te),he&&(q.current=!0),x()});T.useImperativeHandle(S,()=>W,[W]),Pi({open:D,ref:o,onComplete(){D&&l?.(!0)}});const ee=T.useMemo(()=>({open:D,transitionStatus:P,side:b,align:y}),[D,P,b,y]);at(()=>{!H||!o.current||Object.keys(U.current).length||(U.current={top:H.style.top||"0",left:H.style.left||"0",right:H.style.right,height:H.style.height,bottom:H.style.bottom,minHeight:H.style.minHeight,maxHeight:H.style.maxHeight,marginTop:H.style.marginTop,marginBottom:H.style.marginBottom})},[o,H]),at(()=>{L||v||(F.current=!1,q.current=!1,G.current=0,B.current=0,RE(H,U.current))},[L,v,H,o]),at(()=>{const Z=o.current;if(!(!L||!V||!H||!Z)){if(!v){F.current=!0,K.request(x);return}queueMicrotask(()=>{const Y=getComputedStyle(H),Q=getComputedStyle(Z),re=Yi(V),se=Pr(H),te=V.getBoundingClientRect(),xe=H.getBoundingClientRect(),be=te.left,ce=te.height,ye=j||Z,me=ye.scrollHeight,Pe=parseFloat(Q.borderBottomWidth),Ie=parseFloat(Y.marginTop)||10,We=parseFloat(Y.marginBottom)||10,Te=parseFloat(Y.minHeight)||100,he=5,fe=5,ke=20,Se=re.documentElement.clientHeight-Ie-We,pe=re.documentElement.clientWidth,Oe=Se-te.bottom+ce,Ee=d.current,Ue=p.current;let Ge=0,ze=0;if(Ee&&Ue){const _t=Ue.getBoundingClientRect(),pt=Ee.getBoundingClientRect(),rn=_t.left-be,Ut=pt.left-xe.left,Ct=_t.top-te.top+_t.height/2,Vt=pt.top-xe.top+pt.height/2;Ge=rn-Ut,ze=Vt-Ct}const Xe=Oe+ze+We+Pe;let Qe=Math.min(Se,Xe);const Fe=Se-Ie-We,bt=Xe-Qe,Ne=Math.max(he,be+Ge),qe=pe-fe,nt=Math.max(0,Ne+xe.width-qe);H.style.left=`${Ne-nt}px`,H.style.height=`${Qe}px`,H.style.maxHeight="auto",H.style.marginTop=`${Ie}px`,H.style.marginBottom=`${We}px`,Z.style.height="100%";const ht=ye.scrollHeight-ye.clientHeight,gt=bt>=ht;gt&&(Qe=Math.min(Se,xe.height)-(bt-ht));const fn=te.top<ke||te.bottom>Se-ke||Qe<Math.min(me,Te),rt=(se.visualViewport?.scale??1)!==1&&IM;if(fn||rt){F.current=!0,RE(H,U.current),Fr.flushSync(()=>_(!1));return}if(gt){const _t=Math.max(0,Se-Xe);H.style.top=xe.height>=Fe?"0":`${_t}px`,H.style.height=`${Qe}px`,ye.scrollTop=ye.scrollHeight-ye.clientHeight,G.current=Math.max(Te,Qe)}else H.style.bottom="0",G.current=Math.max(Te,Qe),ye.scrollTop=bt;G.current===Se&&(q.current=!0),x(),setTimeout(()=>{F.current=!0})})}},[s,L,H,V,p,d,o,x,v,_,K,C,w,j]),T.useEffect(()=>{if(!v||!H||!L)return;const Z=Pr(H);function Y(Q){u(!1,ft(W0e,Q))}return Z.addEventListener("resize",Y),()=>{Z.removeEventListener("resize",Y)}},[u,v,H,L]);const oe={...j?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${N}-list`},onKeyDown(Z){m.current=!0,A&&n3.has(Z.key)&&Z.stopPropagation()},onMouseMove(){m.current=!1},onPointerLeave(Z){if(cre(Z)||Z.pointerType==="touch")return;const Y=Z.currentTarget;O.start(0,()=>{s.set("activeIndex",null),Y.focus({preventScroll:!0})})},onScroll(Z){j||S.current?.(Z.currentTarget)},...v&&{style:j?{height:"100%"}:ure}},ne=wt("div",t,{ref:[n,o],state:ee,stateAttributesMapping:w_e,props:[z,oe,Sg(P),{className:!j&&v?my.className:void 0},a]});return f.jsxs(T.Fragment,{children:[my.element,f.jsx(Sw,{context:R,modal:!1,disabled:!L,restoreFocus:!0,children:ne})]})}),T_e=T.forwardRef(function(t,n){const{className:r,render:i,...a}=t,{store:s,scrollHandlerRef:o}=Hl(),{alignItemWithTriggerActive:l}=g3(),u=tt(s,Xt.hasScrollArrows),p=tt(s,Xt.openMethod),d=tt(s,Xt.multiple),g={id:`${tt(s,Xt.id)}-list`,role:"listbox","aria-multiselectable":d||void 0,onScroll(S){o.current?.(S.currentTarget)},...l&&{style:ure},className:u&&p!=="touch"?my.className:void 0},x=Je(S=>{s.set("listElement",S)});return wt("div",t,{ref:[n,x],props:[g,a]})}),dre=T.createContext(void 0);function v3(){const e=T.useContext(dre);if(!e)throw new Error(nn(57));return e}const A_e=T.memo(T.forwardRef(function(t,n){const{render:r,className:i,value:a=null,label:s,disabled:o=!1,nativeButton:l=!1,...u}=t,p=T.useRef(null),d=xg({label:s,textRef:p,indexGuessBehavior:i3.GuessFromOrder}),{store:m,getItemProps:g,setOpen:x,setValue:S,selectionRef:b,typingRef:y,valuesRef:v,keyboardActiveRef:_,multiple:C,highlightItemOnHover:w}=Hl(),A=Gn(),R=tt(m,Xt.isActive,d.index),O=tt(m,Xt.isSelected,d.index,a),N=tt(m,Xt.isSelectedByFocus,d.index),D=tt(m,Xt.isItemEqualToValue),L=d.index,z=L!==-1,P=T.useRef(null),V=Er(L);at(()=>{if(!z)return;const ne=v.current;return ne[L]=a,()=>{delete ne[L]}},[z,L,a,v]),at(()=>{if(!z)return;const ne=m.state.value;let Z=ne;C&&Array.isArray(ne)&&ne.length>0&&(Z=ne[ne.length-1]),Z!==void 0&&Gu(Z,a,D)&&m.set("selectedIndex",L)},[z,L,C,D,m,a]);const H=T.useMemo(()=>({disabled:o,selected:O,highlighted:R}),[o,O,R]),j=g({active:R,selected:O});j.onFocus=void 0,j.id=void 0;const G=T.useRef(null),q=T.useRef("mouse"),B=T.useRef(!1),{getButtonProps:F,buttonRef:U}=fa({disabled:o,focusableWhenDisabled:!0,native:l});function K(ne){const Z=m.state.value;if(C){const Y=Array.isArray(Z)?Z:[],Q=O?sre(Y,a,D):[...Y,a];S(Q,ft($f,ne))}else S(a,ft($f,ne)),x(!1,ft($f,ne))}const W={role:"option","aria-selected":O,"aria-disabled":o||void 0,tabIndex:R?0:-1,onFocus(){m.set("activeIndex",L)},onMouseEnter(){!_.current&&m.state.selectedIndex===null&&m.set("activeIndex",L)},onMouseMove(){w&&m.set("activeIndex",L)},onMouseLeave(ne){!w||_.current||cre(ne)||A.start(0,()=>{m.state.activeIndex===L&&m.set("activeIndex",null)})},onTouchStart(){b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ne){G.current=ne.key,m.set("activeIndex",L)},onClick(ne){B.current=!1,!(ne.type==="keydown"&&G.current===null)&&(o||G.current===" "&&y.current||q.current!=="touch"&&!R||(G.current=null,K(ne.nativeEvent)))},onPointerEnter(ne){q.current=ne.pointerType},onPointerDown(ne){q.current=ne.pointerType,B.current=!0},onMouseUp(ne){if(o)return;if(B.current){B.current=!1;return}const Z=!b.current.allowSelectedMouseUp&&O,Y=!b.current.allowUnselectedMouseUp&&!O;Z||Y||q.current!=="touch"&&!R||K(ne.nativeEvent)}},ee=wt("div",t,{ref:[U,n,d.ref,P],state:H,props:[j,W,u,F]}),oe=T.useMemo(()=>({selected:O,indexRef:V,textRef:p,selectedByFocus:N,hasRegistered:z}),[O,V,p,N,z]);return f.jsx(dre.Provider,{value:oe,children:ee})})),k_e=T.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=v3();return r||i?f.jsx(O_e,{...t,ref:n}):null}),O_e=T.memo(T.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...a}=e,{selected:s}=v3(),o=T.useRef(null),{transitionStatus:l,setMounted:u}=xo(s),p=T.useMemo(()=>({selected:s,transitionStatus:l}),[s,l]),d=wt("span",e,{ref:[t,o],state:p,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:os});return Pi({open:s,ref:o,onComplete(){s||u(!1)}}),d})),R_e=T.memo(T.forwardRef(function(t,n){const{indexRef:r,textRef:i,selectedByFocus:a,hasRegistered:s}=v3(),{selectedItemTextRef:o}=Hl(),{className:l,render:u,...p}=t,d=T.useCallback(g=>{if(!g||!s)return;const x=o.current===null||!o.current.isConnected;(a||x&&r.current===0)&&(o.current=g)},[o,r,a,s]);return wt("div",t,{ref:[d,n,i],props:p})})),fre=T.forwardRef(function(t,n){const{render:r,className:i,direction:a,keepMounted:s=!1,...o}=t,{store:l,popupRef:u,listRef:p,handleScrollArrowVisibility:d,scrollArrowsMountedCountRef:m}=Hl(),{side:g,scrollDownArrowRef:x,scrollUpArrowRef:S}=g3(),b=a==="up"?Xt.scrollUpArrowVisible:Xt.scrollDownArrowVisible,y=tt(l,b),v=tt(l,Xt.openMethod),_=y&&v!=="touch",C=Gn(),w=a==="up"?S:x,{transitionStatus:A,setMounted:R}=xo(_);at(()=>(m.current+=1,l.state.hasScrollArrows||l.set("hasScrollArrows",!0),()=>{m.current=Math.max(0,m.current-1),m.current===0&&l.state.hasScrollArrows&&l.set("hasScrollArrows",!1)}),[l,m]),Pi({open:_,ref:w,onComplete(){_||R(!1)}});const O=T.useMemo(()=>({direction:a,visible:_,side:g,transitionStatus:A}),[a,_,g,A]),D=wt("div",t,{ref:[n,w],state:O,props:[{"aria-hidden":!0,children:a==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(z){if(z.movementX===0&&z.movementY===0||C.isStarted())return;l.set("activeIndex",null);function P(){const V=l.state.listElement??u.current;if(!V)return;l.set("activeIndex",null),d();const H=V.scrollTop===0,j=Math.round(V.scrollTop+V.clientHeight)>=V.scrollHeight;if(p.current.length===0&&(a==="up"?l.set("scrollUpArrowVisible",!H):l.set("scrollDownArrowVisible",!j)),a==="up"&&H||a==="down"&&j){C.clear();return}if((l.state.listElement||u.current)&&p.current&&p.current.length>0){const q=p.current,B=w.current?.offsetHeight||0;if(a==="up"){let F=0;const U=V.scrollTop+B;for(let W=0;W<q.length;W+=1){const ee=q[W];if(ee&&ee.offsetTop>=U){F=W;break}}const K=Math.max(0,F-1);if(K<F){const W=q[K];W&&(V.scrollTop=Math.max(0,W.offsetTop-B))}else V.scrollTop=0}else{let F=q.length-1;const U=V.scrollTop+V.clientHeight-B;for(let W=0;W<q.length;W+=1){const ee=q[W];if(ee&&ee.offsetTop+ee.offsetHeight>U){F=Math.max(0,W-1);break}}const K=Math.min(q.length-1,F+1);if(K>F){const W=q[K];W&&(V.scrollTop=W.offsetTop+W.offsetHeight-V.clientHeight+B)}else V.scrollTop=V.scrollHeight-V.clientHeight}}C.start(40,P)}C.start(40,P)},onMouseLeave(){C.clear()}},o]});return _||s?D:null}),N_e=T.forwardRef(function(t,n){return f.jsx(fre,{...t,ref:n,direction:"down"})}),I_e=T.forwardRef(function(t,n){return f.jsx(fre,{...t,ref:n,direction:"up"})}),si=p_e;function oi({className:e,...t}){return f.jsx(b_e,{"data-slot":"select-value",className:Be("flex flex-1 text-left",e),...t})}function li({className:e,size:t="default",children:n,...r}){return f.jsxs(m_e,{"data-slot":"select-trigger","data-size":t,className:Be("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,f.jsx(v_e,{render:f.jsx(J,{icon:Fne,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function ui({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:a=0,alignItemWithTrigger:s=!0,...o}){return f.jsx(x_e,{children:f.jsx(E_e,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:s,className:"isolate z-50",children:f.jsxs(C_e,{"data-slot":"select-content",className:Be("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",e),...o,children:[f.jsx(D_e,{}),f.jsx(T_e,{children:t}),f.jsx(L_e,{})]})})})}function dn({className:e,children:t,...n}){return f.jsxs(A_e,{"data-slot":"select-item",className:Be("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[f.jsx(R_e,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),f.jsx(k_e,{render:f.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:f.jsx(J,{icon:Dr,strokeWidth:2,className:"pointer-events-none"})})]})}function D_e({className:e,...t}){return f.jsx(I_e,{"data-slot":"select-scroll-up-button",className:Be("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full",e),...t,children:f.jsx(J,{icon:s3,strokeWidth:2})})}function L_e({className:e,...t}){return f.jsx(N_e,{"data-slot":"select-scroll-down-button",className:Be("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full",e),...t,children:f.jsx(J,{icon:L0,strokeWidth:2})})}const pre=T.createContext(void 0);function y3(){const e=T.useContext(pre);if(e===void 0)throw new Error(nn(64));return e}let P_e=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const x3={tabActivationDirection:e=>({[P_e.activationDirection]:e})},M_e=T.forwardRef(function(t,n){const{className:r,defaultValue:i=0,onValueChange:a,orientation:s="horizontal",render:o,value:l,...u}=t,p=sc(),d=Object.hasOwn(t,"defaultValue"),m=T.useRef([]),[g,x]=T.useState(()=>new Map),[S,b]=Ja({controlled:l,default:i,name:"Tabs",state:"value"}),y=l!==void 0,[v,_]=T.useState(()=>new Map),[C,w]=T.useState("none"),A=Je((G,q)=>{a?.(G,q),!q.isCanceled&&(b(G),w(q.activationDirection))}),R=Je((G,q)=>{x(B=>{if(B.get(G)===q)return B;const F=new Map(B);return F.set(G,q),F})}),O=Je((G,q)=>{x(B=>{if(!B.has(G)||B.get(G)!==q)return B;const F=new Map(B);return F.delete(G),F})}),N=T.useCallback(G=>g.get(G),[g]),D=T.useCallback(G=>{for(const q of v.values())if(G===q?.value)return q?.id},[v]),L=T.useCallback(G=>{if(G===void 0)return null;for(const[q,B]of v.entries())if(B!=null&&G===(B.value??B.index))return q;return null},[v]),z=T.useMemo(()=>({direction:p,getTabElementBySelectedValue:L,getTabIdByPanelValue:D,getTabPanelIdByValue:N,onValueChange:A,orientation:s,registerMountedTabPanel:R,setTabMap:_,unregisterMountedTabPanel:O,tabActivationDirection:C,value:S}),[p,L,D,N,A,s,R,_,O,C,S]),P=T.useMemo(()=>{for(const G of v.values())if(G!=null&&G.value===S)return G},[v,S]),V=T.useMemo(()=>{for(const G of v.values())if(G!=null&&!G.disabled)return G.value},[v]);at(()=>{if(y||v.size===0)return;const G=P?.disabled,q=P==null&&S!==null;if(d&&G&&S===i||!G&&!q)return;const F=V??null;S!==F&&(b(F),w("none"))},[i,V,d,y,P,w,b,v,S]);const j=wt("div",t,{state:{orientation:s,tabActivationDirection:C},ref:n,props:u,stateAttributesMapping:x3});return f.jsx(pre.Provider,{value:z,children:f.jsx(k0,{elementsRef:m,children:j})})}),hre=T.createContext(void 0);function j_e(){const e=T.useContext(hre);if(e===void 0)throw new Error(nn(65));return e}const F_e=T.forwardRef(function(t,n){const{className:r,disabled:i=!1,render:a,value:s,id:o,nativeButton:l=!0,...u}=t,{value:p,getTabPanelIdByValue:d,orientation:m}=y3(),{activateOnFocus:g,highlightedTabIndex:x,onTabActivation:S,setHighlightedTabIndex:b,tabsListElement:y}=j_e(),v=Zr(o),_=T.useMemo(()=>({disabled:i,id:v,value:s}),[i,v,s]),{compositeProps:C,compositeRef:w,index:A}=Sne({metadata:_}),R=s===p,O=T.useRef(!1);at(()=>{if(O.current){O.current=!1;return}if(!(R&&A>-1&&x!==A))return;const B=y;if(B!=null){const F=so(Yi(B));if(F&&Mt(B,F))return}i||b(A)},[R,A,x,b,i,y]);const{getButtonProps:N,buttonRef:D}=fa({disabled:i,native:l,focusableWhenDisabled:!0}),L=d(s),z=T.useRef(!1),P=T.useRef(!1);function V(B){R||i||S(s,ft(Hr,B.nativeEvent,void 0,{activationDirection:"none"}))}function H(B){R||(A>-1&&!i&&b(A),!i&&g&&(!z.current||z.current&&P.current)&&S(s,ft(Hr,B.nativeEvent,void 0,{activationDirection:"none"})))}function j(B){if(R||i)return;z.current=!0;function F(){z.current=!1,P.current=!1}(!B.button||B.button===0)&&(P.current=!0,Yi(B.currentTarget).addEventListener("pointerup",F,{once:!0}))}const G=T.useMemo(()=>({disabled:i,active:R,orientation:m}),[i,R,m]);return wt("button",t,{state:G,ref:[n,D,w],props:[C,{role:"tab","aria-controls":L,"aria-selected":R,id:v,onClick:V,onFocus:H,onPointerDown:j,[r3]:R?"":void 0,onKeyDownCapture(){O.current=!0}},u,N]})});let B_e=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const U_e=T.forwardRef(function(t,n){const{className:r,value:i,render:a,keepMounted:s=!1,...o}=t,{value:l,getTabIdByPanelValue:u,orientation:p,tabActivationDirection:d,registerMountedTabPanel:m,unregisterMountedTabPanel:g}=y3(),x=Zr(),S=T.useMemo(()=>({id:x,value:i}),[x,i]),{ref:b,index:y}=xg({metadata:S}),v=i!==l,_=u(i),C=T.useMemo(()=>({hidden:v,orientation:p,tabActivationDirection:d}),[v,p,d]),w=wt("div",t,{state:C,ref:[n,b],props:[{"aria-labelledby":_,hidden:v,id:x??void 0,role:"tabpanel",tabIndex:v?-1:0,[B_e.index]:y},o],stateAttributesMapping:x3});return at(()=>{if(!(v&&!s)&&x!=null)return m(i,x),()=>{g(i,x)}},[v,s,i,x,m,g]),!v||s?w:null}),$_e=T.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:i,loopFocus:a=!0,render:s,...o}=t,{getTabElementBySelectedValue:l,onValueChange:u,orientation:p,value:d,setTabMap:m,tabActivationDirection:g}=y3(),[x,S]=T.useState(0),[b,y]=T.useState(null),v=z_e(d,p,b,l),_=Je((R,O)=>{if(R!==d){const N=v(R);O.activationDirection=N,u(R,O)}}),C=T.useMemo(()=>({orientation:p,tabActivationDirection:g}),[p,g]),w={"aria-orientation":p==="vertical"?"vertical":void 0,role:"tablist"},A=T.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:x,onTabActivation:_,setHighlightedTabIndex:S,tabsListElement:b,value:d}),[r,x,_,S,b,d]);return f.jsx(hre.Provider,{value:A,children:f.jsx(N0,{render:s,className:i,state:C,refs:[n,y],props:[w,o],stateAttributesMapping:x3,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:a,orientation:p,onHighlightedIndexChange:S,onMapChange:m,disabledIndices:_a})})});function bH(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),s=n-i,o=r-a;return{left:s,top:o}}function z_e(e,t,n,r){const[i,a]=T.useState(null);return at(()=>{if(e==null||n==null){a(null);return}const s=r(e);if(s==null){a(null);return}const{left:o,top:l}=bH(s,n);a(t==="horizontal"?o:l)},[t,r,n,e]),T.useCallback(s=>{if(s===e)return"none";if(s==null)return a(null),"none";if(s!=null&&n!=null){const o=r(s);if(o!=null){const{left:l,top:u}=bH(o,n);if(i==null)return a(t==="horizontal"?l:u),"none";if(t==="horizontal"){if(l<i)return a(l),"left";if(l>i)return a(l),"right"}else{if(u<i)return a(u),"up";if(u>i)return a(u),"down"}}}return"none"},[r,t,i,n,e])}function mo({className:e,orientation:t="horizontal",...n}){return f.jsx(M_e,{"data-slot":"tabs","data-orientation":t,className:Be("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const H_e=kd("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function go({className:e,variant:t="default",...n}){return f.jsx($_e,{"data-slot":"tabs-list","data-variant":t,className:Be(H_e({variant:t}),e),...n})}function Rn({className:e,...t}){return f.jsx(F_e,{"data-slot":"tabs-trigger",className:Be("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function Mn({className:e,...t}){return f.jsx(U_e,{"data-slot":"tabs-content",className:Be("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function W_e(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:s,handle:o,triggerId:l,defaultTriggerId:u=null}=e,p=oc(),d=!!p,m=Li(()=>o?.store??new Kne({open:n??r,activeTriggerId:l!==void 0?l:u,modal:!0,disablePointerDismissal:!0,nested:d,role:"alertdialog"})).current;m.useControlledProp("open",n,r),m.useControlledProp("activeTriggerId",l,u),m.useSyncedValue("nested",d),m.useContextCallback("onOpenChange",i),m.useContextCallback("onOpenChangeComplete",a);const g=m.useState("payload");Gne({store:m,actionsRef:s,parentContext:p?.store.context});const x=T.useMemo(()=>({store:m}),[m]);return f.jsx(p3.Provider,{value:x,children:typeof t=="function"?t({payload:g}):t})}const mre=T.createContext(void 0),gre=T.createContext(void 0),bre=T.createContext(void 0),vre=T.createContext("");function uc(){const e=T.useContext(mre);if(!e)throw new Error(nn(22));return e}function jw(){const e=T.useContext(gre);if(!e)throw new Error(nn(23));return e}function Cp(){const e=T.useContext(bre);if(!e)throw new Error(nn(24));return e}function S3(){return T.useContext(vre)}const xt={id:Ve(e=>e.id),query:Ve(e=>e.query),items:Ve(e=>e.items),selectedValue:Ve(e=>e.selectedValue),open:Ve(e=>e.open),mounted:Ve(e=>e.mounted),forceMounted:Ve(e=>e.forceMounted),inline:Ve(e=>e.inline),activeIndex:Ve(e=>e.activeIndex),selectedIndex:Ve(e=>e.selectedIndex),isActive:Ve((e,t)=>e.activeIndex===t),isSelected:Ve((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(i=>Gu(i,t,n)):Gu(r,t,n)}),transitionStatus:Ve(e=>e.transitionStatus),popupProps:Ve(e=>e.popupProps),inputProps:Ve(e=>e.inputProps),triggerProps:Ve(e=>e.triggerProps),getItemProps:Ve(e=>e.getItemProps),positionerElement:Ve(e=>e.positionerElement),listElement:Ve(e=>e.listElement),triggerElement:Ve(e=>e.triggerElement),inputElement:Ve(e=>e.inputElement),popupSide:Ve(e=>e.popupSide),openMethod:Ve(e=>e.openMethod),inputInsidePopup:Ve(e=>e.inputInsidePopup),selectionMode:Ve(e=>e.selectionMode),listRef:Ve(e=>e.listRef),labelsRef:Ve(e=>e.labelsRef),popupRef:Ve(e=>e.popupRef),emptyRef:Ve(e=>e.emptyRef),inputRef:Ve(e=>e.inputRef),keyboardActiveRef:Ve(e=>e.keyboardActiveRef),chipsContainerRef:Ve(e=>e.chipsContainerRef),clearRef:Ve(e=>e.clearRef),valuesRef:Ve(e=>e.valuesRef),allValuesRef:Ve(e=>e.allValuesRef),name:Ve(e=>e.name),disabled:Ve(e=>e.disabled),readOnly:Ve(e=>e.readOnly),required:Ve(e=>e.required),grid:Ve(e=>e.grid),isGrouped:Ve(e=>e.isGrouped),virtualized:Ve(e=>e.virtualized),onOpenChangeComplete:Ve(e=>e.onOpenChangeComplete),openOnInputClick:Ve(e=>e.openOnInputClick),itemToStringLabel:Ve(e=>e.itemToStringLabel),isItemEqualToValue:Ve(e=>e.isItemEqualToValue),modal:Ve(e=>e.modal),autoHighlight:Ve(e=>e.autoHighlight),submitOnItemClick:Ve(e=>e.submitOnItemClick)};function V_e(e,t){return(n,r)=>{if(n==null)return!1;const i=bi(n,t);return e.contains(i,r)}}function q_e(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;const a=bi(r,t),s=n!=null?bi(n,t):"";return s&&e.contains(s,i)&&s.length===i.length?!0:e.contains(a,i)}}const vH=new Map;function yre(e){return Array.isArray(e)?e.map(t=>yre(t)).join(","):e==null?"":String(e)}function G_e(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${yre(e.locale)}|${JSON.stringify(t)}`,r=vH.get(n);if(r)return r;const i=new Intl.Collator(e.locale,t),a={contains(s,o,l){if(!o)return!0;const u=bi(s,l);for(let p=0;p<=u.length-o.length;p+=1)if(i.compare(u.slice(p,p+o.length),o)===0)return!0;return!1},startsWith(s,o,l){if(!o)return!0;const u=bi(s,l);return i.compare(u.slice(0,o.length),o)===0},endsWith(s,o,l){if(!o)return!0;const u=bi(s,l),p=o.length;return u.length>=p&&i.compare(u.slice(u.length-p),o)===0}};return vH.set(n,a),a}const K_e=G_e,xre=Symbol("none"),ff={value:xre,index:-1};function Y_e(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:s,inputValue:o,selectionMode:l="none",onItemHighlighted:u,name:p,disabled:d=!1,readOnly:m=!1,required:g=!1,inputRef:x,grid:S=!1,items:b,filteredItems:y,filter:v,openOnInputClick:_=!0,autoHighlight:C=!1,keepHighlight:w=!1,highlightItemOnHover:A=!0,itemToStringLabel:R,itemToStringValue:O,isItemEqualToValue:N=are,virtualized:D=!1,inline:L=!1,fillInputOnItemPress:z=!0,modal:P=!1,limit:V=-1,autoComplete:H="list",locale:j,submitOnItemClick:G=!1}=e,{clearErrors:q}=Eg(),{setDirty:B,validityData:F,shouldValidateOnChange:U,setFilled:K,name:W,disabled:ee,validation:oe}=is(),ne=j0({id:t}),Z=K_e({locale:j}),[Y,Q]=T.useState(!1),[re,se]=T.useState(null),te=T.useRef([]),xe=T.useRef([]),be=T.useRef(null),ce=T.useRef(null),ye=T.useRef(null),me=T.useRef(!0),Pe=T.useRef(!1),Ie=T.useRef(null),We=T.useRef(null),Te=T.useRef(null),he=T.useRef(ff),fe=T.useRef(null),ke=T.useRef([]),Se=T.useRef([]),pe=ee||d,Oe=W??p,Ee=l==="multiple",Ue=l==="single",Ge=o!==void 0||s!==void 0,ze=b!==void 0,Xe=y!==void 0;let Qe;C==="always"?Qe="always":Qe=C?"input-change":!1;const[Fe,bt]=Ja({controlled:i,default:Ee?r??_a:r,name:"Combobox",state:"selectedValue"}),Ne=T.useMemo(()=>v===null?()=>!0:v!==void 0?v:Ue&&!Y?q_e(Z,R,Fe):V_e(Z,R),[v,Ue,Fe,Y,Z,R]),qe=Li(()=>Ge?s??"":Ue?bi(Fe,R):"").current,[nt,ht]=Ja({controlled:o,default:qe,name:"Combobox",state:"inputValue"}),[gt,fn]=Ja({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),rt=ore(b),_t=re??(nt===""?"":String(nt).trim()),pt=Ue?bi(Fe,R):"",rn=Ue&&!Y&&_t!==""&&pt!==""&&pt.length===_t.length&&Z.contains(pt,_t),Ut=rn?"":_t,Ct=ze&&Xe&&rn,Vt=T.useMemo(()=>b?rt?b.flatMap(vt=>vt.items):b:_a,[b,rt]),qt=T.useMemo(()=>{if(y&&!Ct)return y;if(!b)return _a;if(rt){const we=b,ut=[];let ln=0;for(const _n of we){if(V>-1&&ln>=V)break;const Kn=Ut===""?_n.items:_n.items.filter(ru=>Ne(ru,Ut,R));if(Kn.length===0)continue;const sl=V>-1?V-ln:1/0,nu=Kn.slice(0,sl);if(nu.length>0){const ru={..._n,items:nu};ut.push(ru),ln+=nu.length}}return ut}if(Ut==="")return V>-1?Vt.slice(0,V):Vt;const vt=[];for(const we of Vt){if(V>-1&&vt.length>=V)break;Ne(we,Ut,R)&&vt.push(we)}return vt},[y,Ct,b,rt,Ut,V,Ne,R,Vt]),Me=T.useMemo(()=>rt?qt.flatMap(we=>we.items):qt,[qt,rt]),st=Li(()=>new Hf({id:ne,selectedValue:Fe,open:gt,filter:Ne,query:_t,items:b,selectionMode:l,listRef:te,labelsRef:xe,popupRef:be,emptyRef:ye,inputRef:ce,keyboardActiveRef:me,chipsContainerRef:Ie,clearRef:We,valuesRef:ke,allValuesRef:Se,selectionEventRef:Te,name:Oe,disabled:pe,readOnly:m,required:g,grid:S,isGrouped:rt,virtualized:D,openOnInputClick:_,itemToStringLabel:R,isItemEqualToValue:N,modal:P,autoHighlight:Qe,submitOnItemClick:G,hasInputValue:Ge,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:L,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Zn,setOpen:Zn,setInputValue:Zn,setSelectedValue:Zn,setIndices:Zn,onItemHighlighted:Zn,handleSelection:Zn,getItemProps:()=>or,forceMount:Zn,requestSubmit:Zn})).current,Ot=l==="none"?nt:Fe,Dn=T.useMemo(()=>l==="none"?Ot:Array.isArray(Fe)?Fe.map(vt=>Lo(vt,O)):Lo(Fe,O),[Ot,O,l,Fe]),zn=Je(u),rr=Je(n),_r=tt(st,xt.activeIndex),Ql=tt(st,xt.selectedIndex),Fi=tt(st,xt.positionerElement),Nr=tt(st,xt.listElement),ir=tt(st,xt.triggerElement),fs=tt(st,xt.inputElement),Qr=tt(st,xt.inline),Bs=tt(st,xt.inputInsidePopup),Jl=Er(ir),{mounted:vc,setMounted:Us,transitionStatus:rl}=xo(gt),{openMethod:Ba,triggerProps:ps,reset:wo}=Mw(gt);_g({id:ne,name:Oe,commit:oe.commit,value:Ot,controlRef:Bs?Jl:ce,getValue:()=>Dn});const ga=Je(()=>{b?xe.current=Me.map(vt=>bi(vt,R)):st.set("forceMounted",!0)}),Ir=T.useRef(Fe);at(()=>{Fe!==Ir.current&&ga()},[ga,Fe]);const fi=Je(vt=>{st.update(vt);const we=vt.type||"none";if(vt.activeIndex!==void 0)if(vt.activeIndex===null)he.current!==ff&&(he.current=ff,zn(void 0,Yb(we,void 0,{index:-1})));else{const ut=ke.current[vt.activeIndex];he.current={value:ut,index:vt.activeIndex},zn(ut,Yb(we,void 0,{index:vt.activeIndex}))}}),wi=Je((vt,we)=>{if(Pe.current=we.reason===Xc,e.onInputValueChange?.(vt,we),!we.isCanceled){if(we.reason===Af){const ut=vt.trim()!=="";ut&&Q(!0),fe.current={hasQuery:ut},ut&&Qe&&st.state.activeIndex==null&&st.set("activeIndex",0)}ht(vt)}}),ea=Je((vt,we)=>{gt!==vt&&(we.reason==="escape-key"&&ze&&Me.length===0&&!st.state.emptyRef.current&&we.allowPropagation(),e.onOpenChange?.(vt,we),!we.isCanceled&&(!vt&&Y&&(Ue?(se(_t),_t===""&&Q(!1)):Ee&&(Qr||Bs?fi({activeIndex:null}):se(_t),wi("",ft(Xc,we.event)))),fn(vt)))}),ta=Je((vt,we)=>{if(a?.(vt,we),we.isCanceled)return;bt(vt),(l==="none"&&be.current&&z||Ue&&!st.state.inputInsidePopup)&&wi(bi(vt,R),ft(we.reason,we.event)),Ue&&vt!=null&&we.reason!==Af&&Y&&se(_t)}),Zt=Je((vt,we)=>{let ut=we;if(ut===void 0){if(_r===null)return;ut=ke.current[_r]}const ln=Lr(vt),_n=Te.current??vt;Te.current=null;const Kn=ft($f,_n),sl=ln?.closest("a")?.getAttribute("href");if(sl){sl.startsWith("#")&&ea(!1,Kn);return}if(Ee){const nu=Array.isArray(Fe)?Fe:[],Co=Rf(nu,ut,st.state.isItemEqualToValue)?sre(nu,ut,st.state.isItemEqualToValue):[...nu,ut];if(ta(Co,Kn),!(ce.current?ce.current.value.trim()!=="":!1))return;st.state.inputInsidePopup?wi("",ft(Xc,Kn.event)):ea(!1,Kn)}else ta(ut,Kn),ea(!1,Kn)}),eu=Je(()=>{if(!st.state.submitOnItemClick)return;const vt=st.state.inputElement?.form;vt&&typeof vt.requestSubmit=="function"&&vt.requestSubmit()}),tu=Je(()=>{if(Us(!1),rr?.(!1),Q(!1),wo(),se(null),fi(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ee&&ce.current&&ce.current.value!==""&&!Pe.current&&wi("",ft(Xc)),Ue)if(st.state.inputInsidePopup)ce.current&&ce.current.value!==""&&wi("",ft(Xc));else{const vt=bi(Fe,R);ce.current&&ce.current.value!==vt&&wi(vt,ft(vt===""?Xc:Hr))}}),Vp=T.useMemo(()=>Qr&&Fi?{current:Fi.closest('[role="dialog"]')}:be,[Qr,Fi]);Pi({enabled:!e.actionsRef,open:gt,ref:Vp,onComplete(){gt||tu()}}),T.useImperativeHandle(e.actionsRef,()=>({unmount:tu}),[tu]),at(function(){if(gt||l==="none")return;const we=b?Vt:Se.current;if(Ee){const ut=Array.isArray(Fe)?Fe:[],ln=ut[ut.length-1],_n=Am(we,ln,N);fi({selectedIndex:_n===-1?null:_n})}else{const ut=Am(we,Fe,N);fi({selectedIndex:ut===-1?null:ut})}},[gt,Fe,b,l,Vt,Ee,N,fi]),at(()=>{b&&(ke.current=Me,te.current.length=Me.length)},[b,Me]),at(()=>{const vt=fe.current;if(vt&&(vt.hasQuery?Qe&&st.set("activeIndex",0):Qe==="always"&&st.set("activeIndex",0),fe.current=null),!gt&&!Qr)return;const ut=ze||Xe?Me:ke.current,ln=st.state.activeIndex;if(ln==null){if(Qe==="always"&&ut.length>0){st.set("activeIndex",0);return}he.current!==ff&&(he.current=ff,st.state.onItemHighlighted(void 0,Yb(Hr,void 0,{index:-1})));return}if(ln>=ut.length){he.current!==ff&&(he.current=ff,st.state.onItemHighlighted(void 0,Yb(Hr,void 0,{index:-1}))),st.set("activeIndex",null);return}const _n=ut[ln],Kn=he.current.value,sl=Kn!==xre&&st.state.isItemEqualToValue(_n,Kn);(he.current.index!==ln||!sl)&&(he.current={value:_n,index:ln},st.state.onItemHighlighted(_n,Yb(Hr,void 0,{index:ln})))},[_r,Qe,Xe,ze,Me,Qr,gt,st]),at(()=>{if(!b||l==="none")return;const vt=Vt;if(Ee){const ln=Array.isArray(Fe)?Fe:_a,_n=ln.filter(Kn=>Rf(vt,Kn,st.state.isItemEqualToValue));_n.length!==ln.length&&bt(_n);return}if(Fe==null?!0:Rf(vt,Fe,st.state.isItemEqualToValue))return;let ut=null;if(r!=null&&Rf(vt,r,st.state.isItemEqualToValue)&&(ut=r),bt(ut),!st.state.inputInsidePopup){const ln=bi(ut,R);ce.current&&ce.current.value!==ln&&wi(ln,ft(Hr))}},[b,Vt,Ee,l,Fe,r,bt,R,st,wi]),at(()=>{if(l==="none"){K(String(nt)!=="");return}K(Ee?Array.isArray(Fe)&&Fe.length>0:Fe!=null)},[K,l,nt,Fe,Ee]),T.useEffect(()=>{ze&&Qe&&Me.length===0&&fi({activeIndex:null})},[ze,Qe,Me.length,fi]),rd(_t,()=>{!gt||_t===""||_t===String(qe)||Q(!0)}),rd(Fe,()=>{if(l!=="none"&&(q(Oe),B(Fe!==F.initialValue),U()?oe.commit(Fe):oe.commit(Fe,!0),Ee&&st.state.selectedIndex!==null&&(!Array.isArray(Fe)||Fe.length===0)&&fi({activeIndex:null,selectedIndex:null}),Ue&&!Ge&&!Bs)){const vt=bi(Fe,R);nt!==vt&&wi(vt,ft(Hr))}}),rd(nt,()=>{l==="none"&&(q(Oe),B(nt!==F.initialValue),U()?oe.commit(nt):oe.commit(nt,!0))}),rd(b,()=>{if(!Ue||Ge||Bs||Y)return;const vt=bi(Fe,R);nt!==vt&&wi(vt,ft(Hr))});const $s=Cw({open:Qr?!0:gt,onOpenChange:ea,elements:{reference:Bs?ir:fs,floating:Fi}});let il,ba;Qr||(il=S?"grid":"listbox",ba=gt?"true":"false");const na=T.useMemo(()=>{const vt=fs?.tagName==="INPUT",we=vt||gt,ut=vt?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return we&&(ut.role="combobox",ut["aria-expanded"]=ba,ut["aria-haspopup"]=il,ut["aria-controls"]=gt?Nr?.id:void 0,ut["aria-autocomplete"]=H),{reference:ut,floating:{role:"presentation"}}},[fs,gt,ba,il,Nr?.id,H]),qp=bg($s,{enabled:!m&&!pe&&_,event:"mousedown-only",toggle:!1,touchOpenDelay:Bs?0:50}),Jg=vg($s,{enabled:!m&&!pe&&!Qr,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Qr?!0:void 0,outsidePress(vt){const we=Lr(vt);return!Mt(ir,we)&&!Mt(We.current,we)&&!Mt(Ie.current,we)}}),Wd=JM($s,{enabled:!m&&!pe,id:ne,listRef:te,activeIndex:_r,selectedIndex:Ql,virtual:!0,loopFocus:!0,allowEscape:!Qe,focusItemOnOpen:Y||l==="none"&&!Qe?!1:"auto",focusItemOnHover:A,resetOnPointerLeave:!w,cols:S?2:1,orientation:S?"horizontal":void 0,disabledIndices:_a,onNavigate(vt,we){!we&&!gt||rl==="ending"||fi(we?{activeIndex:vt,type:me.current?"keyboard":"pointer"}:{activeIndex:vt})}}),{getReferenceProps:yc,getFloatingProps:al,getItemProps:Vd}=Id([na,qp,Jg,Wd]);tre(()=>{st.update({inline:L,popupProps:al(),inputProps:yc(),triggerProps:ps,getItemProps:Vd,setOpen:ea,setInputValue:wi,setSelectedValue:ta,setIndices:fi,onItemHighlighted:zn,handleSelection:Zt,forceMount:ga,requestSubmit:eu})}),at(()=>{st.update({id:ne,selectedValue:Fe,open:gt,mounted:vc,transitionStatus:rl,items:b,inline:L,popupProps:al(),inputProps:yc(),triggerProps:ps,openMethod:Ba,getItemProps:Vd,selectionMode:l,name:Oe,disabled:pe,readOnly:m,required:g,grid:S,isGrouped:rt,virtualized:D,onOpenChangeComplete:rr,openOnInputClick:_,itemToStringLabel:R,modal:P,autoHighlight:Qe,isItemEqualToValue:N,submitOnItemClick:G,hasInputValue:Ge,requestSubmit:eu})},[st,ne,Fe,gt,vc,rl,b,al,yc,Vd,Ba,ps,l,Oe,pe,m,g,oe,S,rt,D,rr,_,R,P,N,G,Ge,L,eu,Qe]);const ra=ns(x,oe.inputRef),qd=T.useMemo(()=>({query:_t,filteredItems:qt,flatFilteredItems:Me}),[_t,qt,Me]),Gp=T.useMemo(()=>Array.isArray(Ot)?"":Lo(Ot,O),[Ot,O]),Gd=Ee&&Array.isArray(Fe)&&Fe.length>0,hs=T.useMemo(()=>!Ee||!Array.isArray(Fe)||!Oe?null:Fe.map(vt=>{const we=Lo(vt,O);return f.jsx("input",{type:"hidden",name:Oe,value:we},we)}),[Ee,Fe,Oe,O]),Kp=f.jsxs(T.Fragment,{children:[e.children,f.jsx("input",{...oe.getInputValidationProps({onFocus(){if(Bs){ir?.focus();return}(ce.current||ir)?.focus()},onChange(vt){if(vt.nativeEvent.defaultPrevented)return;const we=vt.target.value,ut=ft(Af,vt.nativeEvent);function ln(){if(Ee)return;if(l==="none"){B(we!==F.initialValue),wi(we,ut),U()&&oe.commit(we);return}const _n=ke.current.find(Kn=>Lo(Kn,O).toLowerCase()===we.toLowerCase());_n!=null&&(B(_n!==F.initialValue),ta?.(_n,ut),U()&&oe.commit(_n))}b?ln():(ga(),queueMicrotask(ln))}}),id:ne,name:Ee||l==="none"?void 0:Oe,disabled:pe,required:g&&!Gd,readOnly:m,value:Gp,ref:ra,style:Nd,tabIndex:-1,"aria-hidden":!0}),hs]});return f.jsx(mre.Provider,{value:st,children:f.jsx(gre.Provider,{value:$s,children:f.jsx(bre.Provider,{value:qd,children:f.jsx(vre.Provider,{value:nt,children:Kp})})})})}const aS=2,X_e={..._m,...lc},Z_e=T.forwardRef(function(t,n){const{render:r,className:i,nativeButton:a=!0,disabled:s=!1,...o}=t,{state:l,disabled:u,setTouched:p,setFocused:d,validationMode:m,validation:g}=is(),{labelId:x}=zl(),S=uc(),b=tt(S,xt.selectionMode),y=tt(S,xt.disabled),v=tt(S,xt.readOnly),_=tt(S,xt.listElement),C=tt(S,xt.triggerProps),w=tt(S,xt.triggerElement),A=tt(S,xt.inputInsidePopup),R=tt(S,xt.open),O=tt(S,xt.selectedValue),N=tt(S,xt.activeIndex),D=tt(S,xt.selectedIndex),L=jw(),z=S3(),P=Gn(),V=u||y||s,H=T.useRef("");function j(oe){H.current=oe.pointerType}const G=L.select("domReferenceElement");T.useEffect(()=>{A&&w&&w!==G&&L.set("domReferenceElement",w)},[w,G,L,A]);const{reference:q}=e3(L,{enabled:!R&&!v&&!y&&b==="single",listRef:S.state.labelsRef,activeIndex:N,selectedIndex:D,onMatch(oe){const ne=S.state.valuesRef.current[oe];ne!==void 0&&S.state.setSelectedValue(ne,ft("none"))}}),{reference:B}=bg(L,{enabled:!v&&!y,event:"mousedown"}),{buttonRef:F,getButtonProps:U}=fa({native:a,disabled:V}),K=T.useMemo(()=>({...l,open:R,disabled:V}),[l,R,V]),W=Je(oe=>{S.set("triggerElement",oe)});return wt("button",t,{ref:[n,F,W],state:K,props:[C,B,q,{tabIndex:A?0:-1,disabled:V,role:A?"combobox":void 0,"aria-expanded":R?"true":"false","aria-haspopup":A?"dialog":"listbox","aria-controls":R?_?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":x,onPointerDown:j,onPointerEnter:j,onFocus(){d(!0),!(V||v)&&P.start(0,S.state.forceMount)},onBlur(){if(p(!0),d(!1),m==="onBlur"){const oe=b==="none"?z:O;g.commit(oe)}},onMouseDown(oe){if(V||v||(A||L.set("domReferenceElement",oe.currentTarget),S.state.forceMount(),H.current!=="touch"&&(S.state.inputRef.current?.focus(),A||oe.preventDefault()),R))return;const ne=Yi(oe.currentTarget);function Z(Y){if(!w)return;const Q=Lr(Y),re=S.state.positionerElement,se=S.state.listElement;if(Mt(w,Q)||Mt(re,Q)||Mt(se,Q)||Q===w)return;const te=m3(w),xe=Y.clientX>=te.left-aS&&Y.clientX<=te.right+aS,be=Y.clientY>=te.top-aS&&Y.clientY<=te.bottom+aS;xe&&be||S.state.setOpen(!1,ft("cancel-open",Y))}A&&ne.addEventListener("mouseup",Z,{once:!0})},onKeyDown(oe){V||v||(oe.key==="ArrowDown"||oe.key==="ArrowUp")&&(zr(oe),S.state.setOpen(!0,ft(em,oe.nativeEvent)),S.state.inputRef.current?.focus())}},g?g.getValidationProps(o):o,U],stateAttributesMapping:X_e})}),Q_e=T.createContext(void 0);function J_e(){return T.useContext(Q_e)}const Sre=T.createContext(void 0);function E3(e){const t=T.useContext(Sre);if(t===void 0&&!e)throw new Error(nn(21));return t}const ewe={..._m,...lc,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},twe=T.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,id:s,...o}=t,{state:l,disabled:u,setTouched:p,setFocused:d,validationMode:m,validation:g}=is(),{labelId:x}=zl(),S=J_e(),y=!!E3(!0),v=uc(),{filteredItems:_}=Cp(),C=S3(),w=Zr(s),A=sc(),R=tt(v,xt.disabled),O=tt(v,xt.readOnly),N=tt(v,xt.name),D=tt(v,xt.selectionMode),L=tt(v,xt.autoHighlight),z=tt(v,xt.inputProps),P=tt(v,xt.triggerProps),V=tt(v,xt.open),H=tt(v,xt.mounted),j=tt(v,xt.selectedValue),G=tt(v,xt.popupSide),q=tt(v,xt.positionerElement),B=!!L,F=H&&q?G:null,U=u||R||a,K=_.length===0,[W,ee]=T.useState(null),oe=T.useRef(!1),ne=Je(re=>{const se=y||v.state.inline;se&&!v.state.hasInputValue&&v.state.setInputValue("",ft(Hr)),v.update({inputElement:re,inputInsidePopup:se})}),Z=T.useMemo(()=>({...l,open:V,disabled:U,readOnly:O,popupSide:F,listEmpty:K}),[l,V,U,O,F,K]);function Y(re){if(!S)return;let se;const{highlightedChipIndex:te}=S;if(te!==void 0){if(re.key==="ArrowLeft")re.preventDefault(),te>0?se=te-1:se=void 0;else if(re.key==="ArrowRight")re.preventDefault(),te<j.length-1?se=te+1:se=void 0;else if(re.key==="Backspace"||re.key==="Delete"){re.preventDefault();const xe=te>=j.length-1?j.length-2:te;se=xe>=0?xe:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return se}return re.key==="ArrowLeft"&&(re.currentTarget.selectionStart??0)===0&&j.length>0?(re.preventDefault(),se=Math.max(j.length-1,0)):re.key==="Backspace"&&re.currentTarget.value===""&&j.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),re.preventDefault()),se}return wt("input",t,{state:Z,ref:[n,v.state.inputRef,ne],props:[z,P,{type:"text",value:t.value??W??C,"aria-readonly":O||void 0,"aria-labelledby":x,disabled:U,readOnly:O,...D==="none"&&N&&{name:N},id:w,onFocus(){d(!0)},onBlur(){if(p(!0),d(!1),m==="onBlur"){const re=D==="none"?C:j;g.commit(re)}},onCompositionStart(re){xE||(oe.current=!0,ee(re.currentTarget.value))},onCompositionEnd(re){oe.current=!1;const se=re.currentTarget.value;ee(null),v.state.setInputValue(se,ft(Af,re.nativeEvent))},onChange(re){if(oe.current){const be=re.currentTarget.value;ee(be),be===""&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,ft(Xc,re.nativeEvent));const ce=be.trim(),ye=B&&ce!=="";!O&&!U&&ce!==""&&(v.state.setOpen(!0,ft(Af,re.nativeEvent)),B||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),V&&v.state.activeIndex!==null&&!ye&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"});return}v.state.setInputValue(re.currentTarget.value,ft(Af,re.nativeEvent));const se=re.currentTarget.value==="",te=ft(Xc,re.nativeEvent);se&&!v.state.inputInsidePopup&&(D==="single"&&v.state.setSelectedValue(null,te),v.state.openOnInputClick||v.state.setOpen(!1,te));const xe=re.currentTarget.value.trim();!O&&!U&&xe!==""&&(v.state.setOpen(!0,ft(Af,re.nativeEvent)),B||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),V&&v.state.activeIndex!==null&&!B&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(re){if(U||O||re.ctrlKey||re.shiftKey||re.altKey||re.metaKey)return;v.state.keyboardActiveRef.current=!0;const se=re.currentTarget,te=se.scrollWidth-se.clientWidth,xe=A==="rtl";if(re.key==="Home"){zr(re);const ce=Oz&&xe?se.value.length:0;se.setSelectionRange(ce,ce),se.scrollLeft=0;return}if(re.key==="End"){zr(re);const ce=Oz&&xe?0:se.value.length;se.setSelectionRange(ce,ce),se.scrollLeft=xe?-te:te;return}if(!H&&re.key==="Escape"){const ce=D==="multiple"&&Array.isArray(j)?j.length===0:j===null,ye=ft(C0,re.nativeEvent),me=D==="multiple"?[]:null;v.state.setInputValue("",ye),v.state.setSelectedValue(me,ye),!ce&&!v.state.inline&&!ye.isPropagationAllowed&&re.stopPropagation();return}if(S&&re.key==="Backspace"&&se.value===""&&S.highlightedChipIndex===void 0&&Array.isArray(j)&&j.length>0){const ce=j.slice(0,-1);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}),v.state.setSelectedValue(ce,ft(Hr,re.nativeEvent));return}const be=Y(re);if(S?.setHighlightedChipIndex(be),be!==void 0?S?.chipsRef.current[be]?.focus():v.state.inputRef.current?.focus(),re.which!==229&&re.key==="Enter"&&V){const ce=v.state.activeIndex,ye=re.nativeEvent;if(ce===null){v.state.setOpen(!1,ft(Hr,ye));return}zr(re);const me=v.state.listRef.current[ce];me&&(v.state.selectionEventRef.current=ye,me.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},g?g.getValidationProps(o):o],stateAttributesMapping:ewe})}),nwe={...os,...kw},rwe=T.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,keepMounted:o=!1,...l}=t,{disabled:u}=is(),p=uc(),d=tt(p,xt.selectionMode),m=tt(p,xt.disabled),g=tt(p,xt.readOnly),x=tt(p,xt.open),S=tt(p,xt.selectedValue),b=S3();let y=!1;d==="none"?y=b!=="":d==="single"?y=S!=null:y=Array.isArray(S)&&S.length>0;const v=u||m||a,{buttonRef:_,getButtonProps:C}=fa({native:s,disabled:v}),{mounted:w,transitionStatus:A,setMounted:R}=xo(y),O=T.useMemo(()=>({disabled:v,open:x,transitionStatus:A}),[v,x,A]);Pi({open:y,ref:p.state.clearRef,onComplete(){y||R(!1)}});const N=wt("button",t,{state:O,ref:[n,_,p.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":g||void 0,onMouseDown(L){L.preventDefault()},onClick(L){if(v||g)return;const z=p.state.keyboardActiveRef;p.state.setInputValue("",ft(Mz,L.nativeEvent)),d!=="none"?(p.state.setSelectedValue(Array.isArray(S)?[]:null,ft(Mz,L.nativeEvent)),p.state.setIndices({activeIndex:null,selectedIndex:null,type:z.current?"keyboard":"pointer"})):p.state.setIndices({activeIndex:null,type:z.current?"keyboard":"pointer"}),p.state.inputRef.current?.focus()}},l,C],stateAttributesMapping:nwe});return o||w?N:null}),Ere=T.createContext(null);function iwe(){return T.useContext(Ere)}function awe(e){const{children:t,items:n}=e,r=T.useMemo(()=>({items:n}),[n]);return f.jsx(Ere.Provider,{value:r,children:t})}function swe(e){const{children:t}=e,{filteredItems:n}=Cp(),r=iwe(),i=r?r.items:n;return i?f.jsx(T.Fragment,{children:i.map(t)}):null}const owe=T.forwardRef(function(t,n){var r;const{render:i,className:a,children:s,...o}=t,l=uc(),u=jw(),p=!!E3(!0),{filteredItems:d}=Cp(),m=tt(l,xt.items),g=tt(l,xt.labelsRef),x=tt(l,xt.listRef),S=tt(l,xt.selectionMode),b=tt(l,xt.grid),y=tt(l,xt.popupProps),v=tt(l,xt.disabled),_=tt(l,xt.readOnly),C=tt(l,xt.virtualized),w=S==="multiple",A=d.length===0,R=Je(P=>{l.set("positionerElement",P)}),O=Je(P=>{l.set("listElement",P)}),N=T.useMemo(()=>typeof s=="function"?r||(r=f.jsx(swe,{children:s})):s,[s]),D=T.useMemo(()=>({empty:A}),[A]),L=u.useState("floatingId"),z=wt("div",t,{state:D,ref:[n,O,p?null:R],props:[y,{children:N,tabIndex:-1,id:L,role:b?"grid":"listbox","aria-multiselectable":w?"true":void 0,onKeyDown(P){if(!(v||_)&&P.key==="Enter"){const V=l.state.activeIndex;if(V==null)return;zr(P);const H=P.nativeEvent,j=l.state.listRef.current[V];j&&(l.state.selectionEventRef.current=H,j.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},o]});return C?z:f.jsx(k0,{elementsRef:x,labelsRef:m?void 0:g,children:z})}),_re=T.createContext(void 0);function lwe(){const e=T.useContext(_re);if(e===void 0)throw new Error(nn(20));return e}const uwe=T.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,a=uc(),s=tt(a,xt.mounted),o=tt(a,xt.forceMounted);return s||r||o?f.jsx(_re.Provider,{value:r,children:f.jsx(T0,{ref:n,...i})}):null}),cwe=T.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:s="absolute",side:o="bottom",align:l="center",sideOffset:u=0,alignOffset:p=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:S=!1,collisionAvoidance:b=vw,...y}=t,v=uc(),{filteredItems:_}=Cp(),C=jw(),w=lwe(),A=tt(v,xt.modal),R=tt(v,xt.open),O=tt(v,xt.mounted),N=tt(v,xt.openMethod),D=tt(v,xt.triggerElement),L=tt(v,xt.inputElement),z=tt(v,xt.inputInsidePopup),P=_.length===0,H=D0({anchor:a??(z?D:L),floatingRootContext:C,positionMethod:s,mounted:O,side:o,sideOffset:u,align:l,alignOffset:p,arrowPadding:g,collisionBoundary:d,collisionPadding:m,sticky:x,disableAnchorTracking:S,keepMounted:w,collisionAvoidance:b,lazyFlip:!0});Pw(R&&A&&N!=="touch",D);const j=T.useMemo(()=>{const U={...H.positionerStyles};return R||(U.pointerEvents="none"),{role:"presentation",hidden:!O,style:U}},[R,O,H.positionerStyles]),G=T.useMemo(()=>({open:R,side:H.side,align:H.align,anchorHidden:H.anchorHidden,empty:P}),[R,H.side,H.align,H.anchorHidden,P]);at(()=>{v.set("popupSide",H.side)},[v,H.side]);const q=T.useMemo(()=>({side:H.side,align:H.align,arrowRef:H.arrowRef,arrowUncentered:H.arrowUncentered,arrowStyles:H.arrowStyles,anchorHidden:H.anchorHidden,isPositioned:H.isPositioned}),[H.side,H.align,H.arrowRef,H.arrowUncentered,H.arrowStyles,H.anchorHidden,H.isPositioned]),B=Je(U=>{v.set("positionerElement",U)}),F=wt("div",t,{state:G,ref:[n,B],props:[j,y],stateAttributesMapping:ls});return f.jsxs(Sre.Provider,{value:q,children:[O&&A&&f.jsx(Lw,{inert:yg(!R),cutout:L??D}),F]})}),dwe={...ls,...os},fwe=T.forwardRef(function(t,n){const{render:r,className:i,initialFocus:a,finalFocus:s,...o}=t,l=uc(),u=E3(),p=jw(),{filteredItems:d}=Cp(),m=tt(l,xt.mounted),g=tt(l,xt.open),x=tt(l,xt.openMethod),S=tt(l,xt.transitionStatus),b=tt(l,xt.inputInsidePopup),y=tt(l,xt.inputElement),v=d.length===0;Pi({open:g,ref:l.state.popupRef,onComplete(){g&&l.state.onOpenChangeComplete(!0)}});const _=T.useMemo(()=>({open:g,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:S,empty:v}),[g,u.side,u.align,u.anchorHidden,S,v]),C=wt("div",t,{state:_,ref:[n,l.state.popupRef],props:[{role:b?"dialog":"presentation",tabIndex:-1,onFocus(O){const N=Lr(O.nativeEvent);x!=="touch"&&(Mt(l.state.listElement,N)||N===O.currentTarget)&&l.state.inputRef.current?.focus()}},Sg(S),o],stateAttributesMapping:dwe}),A=a===void 0?b?O=>O==="touch"?l.state.popupRef.current:y:!1:a;let R;return s!=null?R=s:R=b?void 0:!1,f.jsx(Sw,{context:p,disabled:!m,modal:!b,openInteractionType:x,initialFocus:A,returnFocus:R,children:C})}),wre=T.createContext(void 0);function pwe(){const e=T.useContext(wre);if(e===void 0)throw new Error(nn(18));return e}const hwe=T.forwardRef(function(t,n){const{render:r,className:i,items:a,...s}=t,[o,l]=T.useState(),u=T.useMemo(()=>({labelId:o,setLabelId:l,items:a}),[o,l,a]),p=wt("div",t,{ref:n,props:[{role:"group","aria-labelledby":o},s]}),d=f.jsx(wre.Provider,{value:u,children:p});return a?f.jsx(awe,{items:a,children:d}):d}),mwe=T.forwardRef(function(t,n){const{render:r,className:i,id:a,...s}=t,{setLabelId:o}=pwe(),l=Zr(a);return at(()=>(o(l),()=>{o(void 0)}),[l,o]),wt("div",t,{ref:n,props:[{id:l},s]})}),Cre=T.createContext(void 0);function Tre(){const e=T.useContext(Cre);if(!e)throw new Error(nn(19));return e}const gwe=T.createContext(!1);function bwe(){return T.useContext(gwe)}const vwe=T.memo(T.forwardRef(function(t,n){const{render:r,className:i,value:a=null,index:s,disabled:o=!1,nativeButton:l=!1,...u}=t,p=T.useRef(!1),d=T.useRef(null),m=xg({index:s,textRef:d,indexGuessBehavior:i3.GuessFromOrder}),g=uc(),x=bwe(),{flatFilteredItems:S}=Cp(),b=tt(g,xt.open),y=tt(g,xt.selectionMode),v=tt(g,xt.readOnly),_=tt(g,xt.virtualized),C=tt(g,xt.isItemEqualToValue),w=y!=="none",A=s??(_?Am(S,a,C):m.index),R=m.index!==-1,O=tt(g,xt.id),N=tt(g,xt.isActive,A),D=tt(g,xt.isSelected,a),L=tt(g,xt.items),z=tt(g,xt.getItemProps),P=T.useRef(null),V=O!=null&&R?`${O}-${A}`:void 0,H=D&&w;at(()=>{if(!(R&&(_||s!=null)))return;const oe=g.state.listRef.current;return oe[A]=P.current,()=>{delete oe[A]}},[R,_,A,s,g]),at(()=>{if(!R||L)return;const ee=g.state.valuesRef.current;return ee[A]=a,y!=="none"&&g.state.allValuesRef.current.push(a),()=>{delete ee[A]}},[R,L,A,a,g,y]),at(()=>{if(!b){p.current=!1;return}if(!R||L)return;const ee=g.state.selectedValue,oe=Array.isArray(ee)?ee[ee.length-1]:ee;Gu(oe,a,C)&&g.set("selectedIndex",A)},[R,L,b,g,A,a,C]);const j=T.useMemo(()=>({disabled:o,selected:H,highlighted:N}),[o,H,N]),G=z({active:N,selected:H});G.id=void 0,G.onFocus=void 0;const{getButtonProps:q,buttonRef:B}=fa({disabled:o,focusableWhenDisabled:!0,native:l});function F(ee){function oe(){g.state.handleSelection(ee,a)}g.state.submitOnItemClick?(Fr.flushSync(oe),g.state.requestSubmit()):oe()}const U={id:V,role:x?"gridcell":"option","aria-disabled":o||void 0,"aria-selected":w?H:void 0,tabIndex:void 0,onPointerDownCapture(ee){p.current=!0,ee.preventDefault()},onClick(ee){o||v||F(ee.nativeEvent)},onMouseUp(ee){const oe=p.current;p.current=!1,!(o||v||ee.button!==0||oe||!N)&&F(ee.nativeEvent)}},K=wt("div",t,{ref:[B,n,m.ref,P],state:j,props:[G,U,u,q]}),W=T.useMemo(()=>({selected:H,textRef:d}),[H,d]);return f.jsx(Cre.Provider,{value:W,children:K})})),ywe=T.forwardRef(function(t,n){const{render:r,className:i,children:a,...s}=t,{filteredItems:o}=Cp(),l=uc(),u=o.length===0?a:null;return wt("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});let yH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function Are(e){return T.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[yH.checked]:""}:{[yH.unchecked]:""}},...lc}),[e.indeterminate])}const kre=T.createContext(void 0);function xwe(){const e=T.useContext(kre);if(e===void 0)throw new Error(nn(14));return e}const Swe="data-parent",Ewe=T.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:a=!1,disabled:s=!1,id:o,indeterminate:l=!1,inputRef:u,name:p,onCheckedChange:d,parent:m=!1,readOnly:g=!1,render:x,required:S=!1,uncheckedValue:b,value:y,nativeButton:v=!1,..._}=t,{clearErrors:C}=Eg(),{disabled:w,name:A,setDirty:R,setFilled:O,setFocused:N,setTouched:D,state:L,validationMode:z,validityData:P,shouldValidateOnChange:V,validation:H}=is(),j=Zne(),{labelId:G,controlId:q,setControlId:B,getDescriptionProps:F}=zl(),U=s_e(),K=U?.parent,W=K&&U.allValues,ee=w||j.disabled||U?.disabled||s,oe=A??p,ne=y??oe,Z=Zr(),Y=Zr();let Q=q;W?Q=m?Y:`${K.id}-${ne}`:o&&(Q=o);let re={};W&&(m?re=U.parent.getParentProps():ne&&(re=U.parent.getChildProps(ne)));const se=Je(d),{checked:te=r,indeterminate:xe=l,onCheckedChange:be,...ce}=re,ye=U?.value,me=U?.setValue,Pe=U?.defaultValue,Ie=T.useRef(null),{getButtonProps:We,buttonRef:Te}=fa({disabled:ee,native:v}),he=U?.validation??H,[fe,ke]=Ja({controlled:ne&&ye&&!m?ye.includes(ne):te,default:ne&&Pe&&!m?Pe.includes(ne):a,name:"Checkbox",state:"checked"});at(()=>{if(B!==Zn)return B(Q),()=>{B(void 0)}},[Q,U,B,m]),_g({enabled:!U,id:Z,commit:he.commit,value:fe,controlRef:Ie,name:oe,getValue:()=>fe});const Se=T.useRef(null),pe=ns(u,Se,he.inputRef);at(()=>{Se.current&&(Se.current.indeterminate=xe,fe&&O(!0))},[fe,xe,O]),rd(fe,()=>{U&&!m||(C(oe),O(fe),R(fe!==P.initialValue),V()?he.commit(fe):he.commit(fe,!0))});const Oe=Ho({checked:fe,disabled:ee,name:m?void 0:oe,id:Q??void 0,required:S,ref:pe,style:Nd,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Qe){if(Qe.nativeEvent.defaultPrevented)return;const Fe=Qe.target.checked,bt=ft(Hr,Qe.nativeEvent);if(be?.(Fe,bt),se(Fe,bt),!bt.isCanceled&&(ke(Fe),ne&&ye&&me&&!m)){const Ne=Fe?[...ye,ne]:ye.filter(qe=>qe!==ne);me(Ne,bt)}},onFocus(){Ie.current?.focus()}},y!==void 0?{value:(U?fe&&y:y)||""}:or,F,U?he.getValidationProps:he.getInputValidationProps),Ee=W?!!te:fe,Ue=W&&xe||l;T.useEffect(()=>{K&&ne&&K.disabledStatesRef.current.set(ne,ee)},[K,ee,ne]);const Ge=T.useMemo(()=>({...L,checked:Ee,disabled:ee,readOnly:g,required:S,indeterminate:Ue}),[L,Ee,ee,g,S,Ue]),ze=Are(Ge),Xe=wt("span",t,{state:Ge,ref:[Te,Ie,n,U?.registerControlRef],props:[{id:Z,role:"checkbox","aria-checked":xe?"mixed":fe,"aria-readonly":g||void 0,"aria-required":S||void 0,"aria-labelledby":G,[Swe]:m?"":void 0,onFocus(){N(!0)},onBlur(){const Qe=Se.current;Qe&&(D(!0),N(!1),z==="onBlur"&&he.commit(U?ye:Qe.checked))},onClick(Qe){g||ee||(Qe.preventDefault(),Se.current?.click())}},F,he.getValidationProps,_,ce,We],stateAttributesMapping:ze});return f.jsxs(kre.Provider,{value:Ge,children:[Xe,!fe&&!U&&oe&&!m&&b!==void 0&&f.jsx("input",{type:"hidden",name:oe,value:b}),f.jsx("input",{...Oe})]})}),_we=T.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=xwe(),l=o.checked||o.indeterminate,{transitionStatus:u,setMounted:p}=xo(l),d=T.useRef(null),m=T.useMemo(()=>({...o,transitionStatus:u}),[o,u]);Pi({open:l,ref:d,onComplete(){l||p(!1)}});const g=Are(o),x=T.useMemo(()=>({...g,...os,...lc}),[g]),S=a||l,b=wt("span",t,{enabled:S,ref:[n,d],state:m,stateAttributesMapping:x,props:s});return S?b:null});function wwe(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,...a}=e;return f.jsx(Y_e,{...a,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i})}const Cwe=T.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=Tre();return r||i?f.jsx(Twe,{...t,ref:n}):null}),Twe=T.memo(T.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...a}=e,{selected:s}=Tre(),o=T.useRef(null),{transitionStatus:l,setMounted:u}=xo(s),p=T.useMemo(()=>({selected:s,transitionStatus:l}),[s,l]),d=wt("span",e,{ref:[t,o],state:p,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:os});return Pi({open:s,ref:o,onComplete(){s||u(!1)}}),d})),Awe=T.createContext(void 0);function Fw(e=!0){const t=T.useContext(Awe);if(t===void 0&&!e)throw new Error(nn(25));return t}const Ore=T.createContext(void 0);function _3(e){const t=T.useContext(Ore);if(t===void 0&&!e)throw new Error(nn(33));return t}const Rre=T.createContext(void 0);function Dd(e){const t=T.useContext(Rre);if(t===void 0&&!e)throw new Error(nn(36));return t}const Nre={type:"regular-item"};function Ire(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,nativeButton:s,itemMetadata:o,nodeId:l}=e,u=T.useRef(null),p=Fw(!0),d=p!==void 0,{events:m}=a.useState("floatingTreeRoot"),{getButtonProps:g,buttonRef:x}=fa({disabled:n,focusableWhenDisabled:!0,native:s}),S=T.useCallback(y=>Ho({id:i,role:"menuitem",tabIndex:r?0:-1,onMouseMove(v){l&&m.emit("itemhover",{nodeId:l,target:v.currentTarget})},onMouseEnter(){o.type==="submenu-trigger"&&o.setActive()},onKeyUp(v){v.key===" "&&a.context.typingRef.current&&v.preventBaseUIHandler()},onClick(v){t&&m.emit("close",{domEvent:v,reason:$f})},onMouseUp(v){if(p){const _=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,d&&_&&Math.abs(v.clientX-_.x)<=1&&Math.abs(v.clientY-_.y)<=1)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!d||v.button===2)&&o.type==="regular-item"&&u.current.click()}},y,g),[i,r,g,t,m,a,d,p,o,l]),b=ns(u,x);return T.useMemo(()=>({getItemProps:S,itemRef:b}),[S,b])}let xH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const Dre={checked(e){return e?{[xH.checked]:""}:{[xH.unchecked]:""}},...os},kwe=T.forwardRef(function(t,n){const{render:r,className:i,id:a,label:s,nativeButton:o=!1,disabled:l=!1,closeOnClick:u=!0,...p}=t,d=xg({label:s}),m=_3(!0),g=Zr(a),{store:x}=Dd(),S=x.useState("isActive",d.index),b=x.useState("itemProps"),{getItemProps:y,itemRef:v}=Ire({closeOnClick:u,disabled:l,highlighted:S,id:g,store:x,nativeButton:o,nodeId:m?.nodeId,itemMetadata:Nre}),_=T.useMemo(()=>({disabled:l,highlighted:S}),[l,S]);return wt("div",t,{state:_,props:[b,p,y],ref:[v,n,d.ref]})}),Owe={...ls,...os},Rwe=T.forwardRef(function(t,n){const{render:r,className:i,finalFocus:a,...s}=t,{store:o}=Dd(),{side:l,align:u}=_3(),p=b3()!=null,d=o.useState("open"),m=o.useState("transitionStatus"),g=o.useState("popupProps"),x=o.useState("mounted"),S=o.useState("instantType"),b=o.useState("activeTriggerElement"),y=o.useState("parent"),v=o.useState("lastOpenChangeReason"),_=o.useState("rootId"),C=o.useState("floatingRootContext"),w=o.useState("floatingTreeRoot"),A=o.useState("closeDelay"),R=o.useState("activeTriggerElement");Pi({open:d,ref:o.context.popupRef,onComplete(){d&&o.context.onOpenChangeComplete?.(!0)}}),T.useEffect(()=>{function P(V){o.setOpen(!1,ft(V.reason,V.domEvent))}return w.events.on("close",P),()=>{w.events.off("close",P)}},[w.events,o]);const O=o.useState("hoverEnabled"),N=o.useState("disabled");one(C,{enabled:O&&!N&&y.type!=="context-menu"&&y.type!=="menubar",closeDelay:A});const D=T.useMemo(()=>({transitionStatus:m,side:l,align:u,open:d,nested:y.type==="menu",instant:S}),[m,l,u,d,y.type,S]),L=wt("div",t,{state:D,ref:[n,o.context.popupRef],stateAttributesMapping:Owe,props:[g,{onKeyDown(P){p&&n3.has(P.key)&&P.stopPropagation()}},Sg(m),s,{"data-rootownerid":_}]});let z=y.type===void 0||y.type==="context-menu";return(b||y.type==="menubar"&&v!==xw)&&(z=!0),f.jsx(Sw,{context:C,modal:!1,disabled:!x,returnFocus:a===void 0?z:a,initialFocus:y.type!=="menu",restoreFocus:!0,externalTree:y.type!=="menubar"?w:void 0,previousFocusableElement:R,nextFocusableElement:y.type===void 0?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:y.type===void 0?o.context.beforeContentFocusGuardRef:void 0,children:L})}),Lre=T.createContext(void 0);function Nwe(){const e=T.useContext(Lre);if(e===void 0)throw new Error(nn(32));return e}const Iwe=T.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:a}=Dd();return a.useState("mounted")||r?f.jsx(Lre.Provider,{value:r,children:f.jsx(T0,{ref:n,...i})}):null}),Dwe=T.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:s,side:o,align:l,sideOffset:u=0,alignOffset:p=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:S=!1,collisionAvoidance:b=vw,...y}=t,{store:v}=Dd(),_=Nwe(),C=Fw(!0),w=v.useState("parent"),A=v.useState("floatingRootContext"),R=v.useState("floatingTreeRoot"),O=v.useState("mounted"),N=v.useState("open"),D=v.useState("modal"),L=v.useState("activeTriggerElement"),z=v.useState("lastOpenChangeReason"),P=v.useState("floatingNodeId"),V=v.useState("floatingParentNodeId");let H=r,j=u,G=p,q=l,B=b;w.type==="context-menu"&&(H=r??w.context?.anchor,q=q??"start",!o&&q!=="center"&&(G=t.alignOffset??2,j=t.sideOffset??-5));let F=o,U=q;w.type==="menu"?(F=F??"inline-end",U=U??"start",B=t.collisionAvoidance??OM):w.type==="menubar"&&(F=F??"bottom",U=U??"start");const K=w.type==="context-menu",W=D0({anchor:H,floatingRootContext:A,positionMethod:C?"fixed":i,mounted:O,side:F,sideOffset:j,align:U,alignOffset:G,arrowPadding:K?0:g,collisionBoundary:d,collisionPadding:m,sticky:x,nodeId:P,keepMounted:_,disableAnchorTracking:S,collisionAvoidance:B,shiftCrossAxis:K,externalTree:R}),ee=T.useMemo(()=>{const re={};return N||(re.pointerEvents="none"),{role:"presentation",hidden:!O,style:{...W.positionerStyles,...re}}},[N,O,W.positionerStyles]);T.useEffect(()=>{function re(se){se.open?(se.parentNodeId===P&&v.set("hoverEnabled",!1),se.nodeId!==P&&se.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,ft(xv))):se.parentNodeId===P&&se.reason!==xv&&v.set("hoverEnabled",!0)}return R.events.on("menuopenchange",re),()=>{R.events.off("menuopenchange",re)}},[v,R.events,P]),T.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function re(se){if(se.open||se.nodeId!==v.select("floatingParentNodeId"))return;const te=se.reason??xv;v.setOpen(!1,ft(te))}return R.events.on("menuopenchange",re),()=>{R.events.off("menuopenchange",re)}},[R.events,v]),T.useEffect(()=>{function re(se){!N||se.nodeId!==v.select("floatingParentNodeId")||se.target&&L&&L!==se.target&&v.setOpen(!1,ft(xv))}return R.events.on("itemhover",re),()=>{R.events.off("itemhover",re)}},[R.events,N,L,v]),T.useEffect(()=>{const re={open:N,nodeId:P,parentNodeId:V,reason:v.select("lastOpenChangeReason")};R.events.emit("menuopenchange",re)},[R.events,N,v,P,V]);const oe=T.useMemo(()=>({open:N,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:w.type==="menu"}),[N,W.side,W.align,W.anchorHidden,w.type]),ne=T.useMemo(()=>({side:W.side,align:W.align,arrowRef:W.arrowRef,arrowUncentered:W.arrowUncentered,arrowStyles:W.arrowStyles,nodeId:W.context.nodeId}),[W.side,W.align,W.arrowRef,W.arrowUncentered,W.arrowStyles,W.context.nodeId]),Z=wt("div",t,{state:oe,stateAttributesMapping:ls,ref:[n,v.useStateSetter("positionerElement")],props:[ee,y]}),Y=O&&w.type!=="menu"&&(w.type!=="menubar"&&D&&z!==Ar||w.type==="menubar"&&w.context.modal);let Q=null;return w.type==="menubar"?Q=w.context.contentElement:w.type===void 0&&(Q=L),f.jsxs(Ore.Provider,{value:ne,children:[Y&&f.jsx(Lw,{ref:w.type==="context-menu"||w.type==="nested-context-menu"?w.context.internalBackdropRef:null,inert:yg(!N),cutout:Q}),f.jsx($te,{id:P,children:f.jsx(k0,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:Z})})]})}),Pre=T.createContext(void 0);function Lwe(){const e=T.useContext(Pre);if(e===void 0)throw new Error(nn(34));return e}const Pwe=T.memo(T.forwardRef(function(t,n){const{render:r,className:i,value:a,defaultValue:s,onValueChange:o,disabled:l=!1,...u}=t,[p,d]=Ja({controlled:a,default:s,name:"MenuRadioGroup"}),m=Je(o),g=Je((y,v)=>{m?.(y,v),!v.isCanceled&&d(y)}),x=T.useMemo(()=>({disabled:l}),[l]),S=wt("div",t,{state:x,ref:n,props:{role:"group","aria-disabled":l||void 0,...u}}),b=T.useMemo(()=>({value:p,setValue:g,disabled:l}),[p,g,l]);return f.jsx(Pre.Provider,{value:b,children:S})})),Mre=T.createContext(void 0);function Mwe(){const e=T.useContext(Mre);if(e===void 0)throw new Error(nn(35));return e}const jwe=T.forwardRef(function(t,n){const{render:r,className:i,id:a,label:s,nativeButton:o=!1,disabled:l=!1,closeOnClick:u=!1,value:p,...d}=t,m=xg({label:s}),g=_3(!0),x=Zr(a),{store:S}=Dd(),b=S.useState("isActive",m.index),y=S.useState("itemProps"),{value:v,setValue:_,disabled:C}=Lwe(),w=C||l,A=v===p,{getItemProps:R,itemRef:O}=Ire({closeOnClick:u,disabled:w,highlighted:b,id:x,store:S,nativeButton:o,nodeId:g?.nodeId,itemMetadata:Nre}),N=T.useMemo(()=>({disabled:w,highlighted:b,checked:A}),[w,b,A]),D=Je(z=>{const P={...ft($f,z.nativeEvent),preventUnmountOnClose:()=>{}};_(p,P)}),L=wt("div",t,{state:N,stateAttributesMapping:Dre,props:[y,{role:"menuitemradio","aria-checked":A,onClick:D},d,R],ref:[O,n,m.ref]});return f.jsx(Mre.Provider,{value:N,children:L})}),Fwe=T.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=Mwe(),l=T.useRef(null),{transitionStatus:u,setMounted:p}=xo(o.checked);Pi({open:o.checked,ref:l,onComplete(){o.checked||p(!1)}});const d=T.useMemo(()=>({checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:u}),[o.checked,o.disabled,o.highlighted,u]);return wt("span",t,{state:d,stateAttributesMapping:Dre,ref:[n,l],props:{"aria-hidden":!0,...s},enabled:a||o.checked})}),Bwe=T.createContext(null);function jre(e){return T.useContext(Bwe)}const Uwe={...ZM,disabled:Ve(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ve(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Ve(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:Ve(e=>e.stickIfOpen),parent:Ve(e=>e.parent),rootId:Ve(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ve(e=>e.activeIndex),isActive:Ve((e,t)=>e.activeIndex===t),hoverEnabled:Ve(e=>e.hoverEnabled),instantType:Ve(e=>e.instantType),lastOpenChangeReason:Ve(e=>e.openChangeReason),floatingTreeRoot:Ve(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ve(e=>e.floatingNodeId),floatingParentNodeId:Ve(e=>e.floatingParentNodeId),itemProps:Ve(e=>e.itemProps),closeDelay:Ve(e=>e.closeDelay),keyboardEventRelay:Ve(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class w3 extends _w{constructor(t){super({...$we(),...t},{positionerRef:T.createRef(),popupRef:T.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:T.createRef(),beforeContentFocusGuardRef:T.createRef(),onOpenChangeComplete:void 0,triggerElements:new A0},Uwe),this.observe(Ve(n=>n.allowMouseEnter),(n,r)=>{this.state.parent.type==="menu"&&n!==r&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){return Li(()=>t??new w3(n)).current}unsubscribeParentListener=null}function $we(){return{...XM(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new UM,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:or,keyboardEventRelay:void 0,closeDelay:0}}const zwe=T.createContext(void 0);function Hwe(){return T.useContext(zwe)}function Wwe(e){const{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:s=!1,modal:o,loopFocus:l=!0,orientation:u="vertical",actionsRef:p,closeParentOnEsc:d=!1,handle:m,triggerId:g,defaultTriggerId:x=null,highlightItemOnHover:S=!0}=e,b=Fw(!0),y=Dd(!0),v=jre(),_=Hwe(),C=T.useMemo(()=>_&&y?{type:"menu",store:y.store}:v?{type:"menubar",context:v}:b&&!y?{type:"context-menu",context:b}:{type:void 0},[b,y,v,_]),w=w3.useStore(m?.store,{parent:C}),A=w.useState("floatingTreeRoot"),R=$M(A),O=Ko();at(()=>{b&&!y?w.update({parent:{type:"context-menu",context:b},floatingNodeId:R,floatingParentNodeId:O}):y&&w.update({floatingNodeId:R,floatingParentNodeId:O})},[b,y,R,O,w]),w.useControlledProp("open",n,a),w.useControlledProp("activeTriggerId",g,x),w.useContextCallback("onOpenChangeComplete",i);const N=w.useState("open"),D=w.useState("activeTriggerElement"),L=w.useState("positionerElement"),z=w.useState("hoverEnabled"),P=w.useState("modal"),V=w.useState("disabled"),H=w.useState("lastOpenChangeReason"),j=w.useState("parent"),G=w.useState("activeIndex"),q=w.useState("payload"),B=w.useState("floatingParentNodeId"),F=T.useRef(null),U=B!=null;let K;w.useSyncedValues({disabled:s,modal:j.type===void 0?o:void 0,rootId:Rd()});const{openMethod:W,triggerProps:ee,reset:oe}=Mw(N);KM(w);const{forceUnmount:ne}=YM(N,w,()=>{w.update({allowMouseEnter:!1,stickIfOpen:!0}),oe()}),Z=T.useRef(j.type!=="context-menu"),Y=Gn();T.useEffect(()=>{if(N||(F.current=null),j.type==="context-menu"){if(!N){Y.clear(),Z.current=!1;return}Y.start(500,()=>{Z.current=!0})}},[Y,N,j.type]),Pw(N&&P&&H!==Ar&&W!=="touch",L),at(()=>{!N&&!z&&w.set("hoverEnabled",!0)},[N,z,w]);const Q=T.useRef(!0),re=Gn(),se=Je((Fe,bt)=>{const Ne=bt.reason;if(N===Fe&&bt.trigger===D||(bt.preventUnmountOnClose=()=>{w.set("preventUnmountingOnClose",!0)},!Fe&&bt.trigger==null&&(bt.trigger=D??void 0),r?.(Fe,bt),bt.isCanceled))return;const qe={open:Fe,nativeEvent:bt.event,reason:bt.reason,nested:U};K?.emit("openchange",qe);const nt=bt.event;if(Fe===!1&&nt?.type==="click"&&nt.pointerType==="touch"&&!Q.current)return;if(!Fe&&G!==null){const rt=w.context.itemDomElements.current[G];queueMicrotask(()=>{rt?.setAttribute("tabindex","-1")})}Fe&&Ne===sy?(Q.current=!1,re.start(300,()=>{Q.current=!0})):(Q.current=!0,re.clear());const ht=(Ne===Lu||Ne===$f)&&nt.detail===0&&nt?.isTrusted,gt=!Fe&&(Ne===C0||Ne==null);function fn(){const rt={open:Fe,openChangeReason:Ne};F.current=bt.event??null;const _t=bt.trigger?.id??null;(_t||Fe)&&(rt.activeTriggerId=_t,rt.activeTriggerElement=bt.trigger??null),w.update(rt)}Ne===Ar?Fr.flushSync(fn):fn(),j.type==="menubar"&&(Ne===sy||Ne===Wo||Ne===Ar||Ne===em||Ne===xv)?w.set("instantType","group"):ht||gt?w.set("instantType",ht?"click":"dismiss"):w.set("instantType",void 0)}),te=T.useCallback(Fe=>{const bt=ft(Fe);return bt.preventUnmountOnClose=()=>{w.set("preventUnmountingOnClose",!0)},bt},[w]),xe=T.useCallback(()=>{w.setOpen(!1,te(zM))},[w,te]);T.useImperativeHandle(p,()=>({unmount:ne,close:xe}),[ne,xe]);let be;j.type==="context-menu"&&(be=j.context),T.useImperativeHandle(be?.positionerRef,()=>L,[L]),T.useImperativeHandle(be?.actionsRef,()=>({setOpen:se}),[se]);const ce=QM({popupStore:w,onOpenChange:se});K=ce.context.events,T.useEffect(()=>{const Fe=({open:bt,eventDetails:Ne})=>se(bt,Ne);return K.on("setOpen",Fe),()=>{K?.off("setOpen",Fe)}},[K,se]);const ye=vg(ce,{enabled:!V,bubbles:d&&j.type==="menu",outsidePress(){return j.type!=="context-menu"||F.current?.type==="contextmenu"?!0:Z.current},externalTree:U?A:void 0}),me=une(ce,{role:"menu"}),Pe=sc(),Ie=T.useCallback(Fe=>{w.select("activeIndex")!==Fe&&w.set("activeIndex",Fe)},[w]),We=JM(ce,{enabled:!V,listRef:w.context.itemDomElements,activeIndex:G,nested:j.type!==void 0,loopFocus:l,orientation:u,parentOrientation:j.type==="menubar"?j.context.orientation:void 0,rtl:Pe==="rtl",disabledIndices:_a,onNavigate:Ie,openOnArrowKeyDown:j.type!=="context-menu",externalTree:U?A:void 0,focusItemOnHover:S}),Te=T.useCallback(Fe=>{w.context.typingRef.current=Fe},[w]),he=e3(ce,{listRef:w.context.itemLabels,activeIndex:G,resetMs:sye,onMatch:Fe=>{N&&Fe!==G&&w.set("activeIndex",Fe)},onTypingChange:Te}),{getReferenceProps:fe,getFloatingProps:ke,getItemProps:Se,getTriggerProps:pe}=Id([ye,me,We,he]),Oe=T.useMemo(()=>{const Fe=Ho(fe(),{onMouseEnter(){w.set("hoverEnabled",!0)},onMouseMove(){w.set("allowMouseEnter",!0)}},ee);return delete Fe.role,Fe},[fe,w,ee]),Ee=T.useMemo(()=>{const Fe=pe();if(!Fe)return Fe;const bt=Ho(Fe,ee);return delete bt.role,delete bt["aria-controls"],bt},[pe,ee]),Ue=Pu(),Ge=T.useMemo(()=>ke({onMouseEnter(){j.type==="menu"&&Ue.request(()=>w.set("hoverEnabled",!1))},onMouseMove(){w.set("allowMouseEnter",!0)},onClick(){w.select("hoverEnabled")&&w.set("hoverEnabled",!1)},onKeyDown(Fe){const bt=w.select("keyboardEventRelay");bt&&!Fe.isPropagationStopped()&&bt(Fe)}}),[ke,j.type,Ue,w]),ze=T.useMemo(()=>Se(),[Se]);w.useSyncedValues({floatingRootContext:ce,activeTriggerProps:Oe,inactiveTriggerProps:Ee,popupProps:Ge,itemProps:ze});const Xe=T.useMemo(()=>({store:w,parent:C}),[w,C]),Qe=f.jsx(Rre.Provider,{value:Xe,children:typeof t=="function"?t({payload:q}):t});return j.type===void 0||j.type==="context-menu"?f.jsx(zte,{externalTree:A,children:Qe}):Qe}function Fre(e){if(mr(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!El(e))return Fre(Dl(e))}function Vwe(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=T.useRef(!1);return T.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,Yi(a.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:a=>{i.current&&(i.current=!1,a.preventBaseUIHandler())}}:or,[t,n,r])}const sS=2,qwe=T.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,id:o,openOnHover:l,delay:u=100,closeDelay:p=0,handle:d,payload:m,...g}=t,x=Dd(!0),S=d?.store??x?.store;if(!S)throw new Error(nn(85));const b=Zr(o),y=S.useState("isTriggerActive",b),v=S.useState("floatingRootContext"),_=S.useState("isOpenedByTrigger",b),C=T.useRef(null),w=Kwe(),A=AM(!0),R=Yo(),O=T.useMemo(()=>R??new UM,[R]),N=$M(O),D=Ko(),{registerTrigger:L,isMountedByThisTrigger:z}=GM(b,C,S,{payload:m,closeDelay:p,parent:w,floatingTreeRoot:O,floatingNodeId:N,floatingParentNodeId:D,keyboardEventRelay:A?.relayKeyboardEvent}),P=S.useState("disabled"),V=a||P||w.type==="menubar"&&w.context.disabled,{getButtonProps:H,buttonRef:j}=fa({disabled:V,native:s});T.useEffect(()=>{!_&&w.type===void 0&&(S.context.allowMouseUpTriggerRef.current=!1)},[S,_,w.type]);const G=T.useRef(null),q=Gn(),B=Je(me=>{if(!G.current)return;q.clear(),S.context.allowMouseUpTriggerRef.current=!1;const Pe=me.target;if(Mt(G.current,Pe)||Mt(S.select("positionerElement"),Pe)||Pe===G.current||Pe!=null&&Fre(Pe)===S.select("rootId"))return;const Ie=m3(G.current);me.clientX>=Ie.left-sS&&me.clientX<=Ie.right+sS&&me.clientY>=Ie.top-sS&&me.clientY<=Ie.bottom+sS||O.events.emit("close",{domEvent:me,reason:Hte})});T.useEffect(()=>{_&&S.select("lastOpenChangeReason")===Ar&&Yi(G.current).addEventListener("mouseup",B,{once:!0})},[_,B,S]);const F=w.type==="menubar"&&w.context.hasSubmenuOpen,K=lne(v,{enabled:(l??F??!1)&&!V&&w.type!=="context-menu"&&(w.type!=="menubar"||F&&!z),handleClose:t3({blockPointerEvents:w.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:w.type===void 0?u:void 0,delay:{close:p},triggerElementRef:C,externalTree:O,isActiveTrigger:y}),W=Gwe(_,S.select("lastOpenChangeReason")),ee=bg(v,{enabled:!V&&w.type!=="context-menu",event:_&&w.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0?W:!1}),oe=ane(v,{enabled:!V&&(w.type!=="menubar"&&_||F)}),ne=Vwe({open:_,enabled:w.type==="menubar",mouseDownAction:"open"}),Z=Id([ee,oe]),Y=w.type==="menubar",Q=T.useMemo(()=>({disabled:V,open:_}),[V,_]),re=S.useState("triggerProps",z),se=[G,n,j,L,C],te=[Z.getReferenceProps(),K??or,re,{"aria-haspopup":"menu",id:b,onMouseDown:me=>{if(S.select("open"))return;q.start(200,()=>{S.context.allowMouseUpTriggerRef.current=!0}),Yi(me.currentTarget).addEventListener("mouseup",B,{once:!0})}},Y?{role:"menuitem"}:{},ne,g,H],xe=T.useRef(null),be=Je(me=>{Fr.flushSync(()=>{S.setOpen(!1,ft(Wo,me.nativeEvent,me.currentTarget))}),F0e(xe.current)?.focus()}),ce=Je(me=>{const Pe=S.select("positionerElement");if(Pe&&Fo(me,Pe))S.context.beforeContentFocusGuardRef.current?.focus();else{Fr.flushSync(()=>{S.setOpen(!1,ft(Wo,me.nativeEvent,me.currentTarget))});let Ie=j0e(C.current);for(;Ie!==null&&Mt(Pe,Ie)||Ie?.hasAttribute("aria-hidden");){const We=Ie;if(Ie=w0(Ie),Ie===We)break}Ie?.focus()}}),ye=wt("button",t,{enabled:!Y,stateAttributesMapping:_m,state:Q,ref:se,props:te});return Y?f.jsx(I0,{tag:"button",render:r,className:i,state:Q,refs:se,props:te,stateAttributesMapping:_m}):_?f.jsxs(T.Fragment,{children:[f.jsx(Ll,{ref:xe,onFocus:be},`${b}-pre-focus-guard`),f.jsx(T.Fragment,{children:ye},b),f.jsx(Ll,{ref:S.context.triggerFocusTargetRef,onFocus:ce},`${b}-post-focus-guard`)]}):f.jsx(T.Fragment,{children:ye},b)});function Gwe(e,t){const n=Gn(),[r,i]=T.useState(!1);return at(()=>{e&&t==="trigger-hover"?(i(!0),n.start(Jee,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function Kwe(){const e=Fw(!0),t=Dd(!0),n=jre();return T.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function Eu(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Ywe=typeof ResizeObserver<"u",Xwe=()=>!0;function Zwe(e){const{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=Xwe,onMeasureLayout:s,onMeasureLayoutComplete:o,side:l,direction:u}=e,p=T.useRef(!0),d=qM(t,!0,!1),m=Pu(),g=T.useRef(null),x=Je(s),S=Je(o),b=T.useMemo(()=>{let y=l==="top",v=l==="left";return u==="rtl"?(y=y||l==="inline-end",v=v||l==="inline-end"):(y=y||l==="inline-start",v=v||l==="inline-start"),y?{position:"absolute",[l==="top"?"bottom":"top"]:"0",[v?"right":"left"]:"0"}:or},[l,u]);at(()=>{if(!i||!a()||!Ywe){p.current=!0,g.current=null;return}if(!t||!n)return;Object.entries(b).forEach(([N,D])=>{t.style.setProperty(N,D)});const y=new ResizeObserver(N=>{const D=N[0];D&&(g.current===null?g.current={width:Math.ceil(D.borderBoxSize[0].inlineSize),height:Math.ceil(D.borderBoxSize[0].blockSize)}:(g.current.width=Math.ceil(D.borderBoxSize[0].inlineSize),g.current.height=Math.ceil(D.borderBoxSize[0].blockSize)))});y.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const v=Xb(t,"position","static"),_=Xb(t,"transform","none"),C=Xb(t,"scale","1"),w=Xb(n,"--available-width","max-content"),A=Xb(n,"--available-height","max-content");if(x?.(),p.current||g.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const N=ly(t);return n.style.setProperty("--positioner-width",`${N.width}px`),n.style.setProperty("--positioner-height",`${N.height}px`),v(),_(),C(),w(),A(),S?.(null,N),p.current=!1,()=>{y.disconnect()}}t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto"),n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const R=ly(t);t.style.setProperty("--popup-width",`${g.current.width}px`),t.style.setProperty("--popup-height",`${g.current.height}px`),v(),_(),w(),A(),S?.(g.current,R),n.style.setProperty("--positioner-width",`${R.width}px`),n.style.setProperty("--positioner-height",`${R.height}px`);const O=new AbortController;return m.request(()=>{t.style.setProperty("--popup-width",`${R.width}px`),t.style.setProperty("--popup-height",`${R.height}px`),d(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},O.signal)}),()=>{y.disconnect(),O.abort(),m.cancel()}},[r,t,n,d,m,a,i,x,S,b])}function Xb(e,t,n){const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}const Qwe=T.forwardRef(function(t,n){const{children:r,container:i,className:a,render:s,...o}=t,{portalNode:l,portalSubtree:u}=Kte({container:i,ref:n,componentProps:t,elementProps:o});return!u&&!l?null:f.jsxs(T.Fragment,{children:[u,l&&Fr.createPortal(r,l)]})});let SH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const BD={checked(e){return e?{[SH.checked]:""}:{[SH.unchecked]:""}},...os,...lc},Bre=T.createContext({disabled:void 0,readOnly:void 0,required:void 0,name:void 0,checkedValue:"",setCheckedValue:Zn,onValueChange:Zn,touched:!1,setTouched:Zn,registerControlRef:Zn});function Jwe(){return T.useContext(Bre)}const Ure=T.createContext(void 0);function eCe(){const e=T.useContext(Ure);if(e===void 0)throw new Error(nn(52));return e}const tCe=T.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,readOnly:s=!1,required:o=!1,value:l,inputRef:u,nativeButton:p=!1,id:d,...m}=t,{disabled:g,readOnly:x,required:S,checkedValue:b,setCheckedValue:y,touched:v,setTouched:_,validation:C,registerControlRef:w}=Jwe(),{setDirty:A,validityData:R,setTouched:O,setFilled:N,state:D,disabled:L}=is(),z=Zne(),{labelId:P,getDescriptionProps:V}=zl(),H=L||z.disabled||g||a,j=x||s,G=S||o,q=b===l,B=T.useRef(null),F=T.useRef(null),U=ns(u,F);at(()=>{F.current?.checked&&N(!0)},[N]);const K=Zr(),W=j0({id:d,implicit:!1,controlRef:B}),ee={role:"radio","aria-checked":q,"aria-required":G||void 0,"aria-disabled":H||void 0,"aria-readonly":j||void 0,"aria-labelledby":P,[r3]:q?"":void 0,id:K,disabled:H,onKeyDown(be){be.key==="Enter"&&be.preventDefault()},onClick(be){be.defaultPrevented||H||j||(be.preventDefault(),F.current?.click())},onFocus(be){be.defaultPrevented||H||j||!v||(F.current?.click(),_(!1))}},{getButtonProps:oe,buttonRef:ne}=fa({disabled:H,native:p}),Z=T.useMemo(()=>({type:"radio",ref:U,id:W,tabIndex:-1,style:Nd,"aria-hidden":!0,disabled:H,checked:q,required:G,readOnly:j,onChange(be){if(be.nativeEvent.defaultPrevented||H||j||l===void 0)return;const ce=ft(Hr,be.nativeEvent);ce.isCanceled||(O(!0),A(l!==R.initialValue),N(!0),y(l,ce))},onFocus(){B.current?.focus()}}),[q,H,W,U,j,G,y,A,O,N,R.initialValue,l]),Y=T.useMemo(()=>({...D,required:G,disabled:H,readOnly:j,checked:q}),[D,H,j,q,G]),Q=T.useMemo(()=>Y,[Y]),re=y!==Zn,se=[n,w,B,ne],te=[ee,V,C?.getValidationProps??or,m,oe],xe=wt("span",t,{enabled:!re,state:Y,ref:se,props:te,stateAttributesMapping:BD});return f.jsxs(Ure.Provider,{value:Q,children:[re?f.jsx(I0,{tag:"span",render:r,className:i,state:Y,refs:se,props:te,stateAttributesMapping:BD}):xe,f.jsx("input",{...Z})]})}),nCe=T.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=eCe(),l=o.checked,{transitionStatus:u,setMounted:p}=xo(l),d=T.useMemo(()=>({...o,transitionStatus:u}),[o,u]),m=T.useRef(null),g=a||l,x=wt("span",t,{enabled:g,ref:[n,m],state:d,props:s,stateAttributesMapping:BD});return Pi({open:l,ref:m,onComplete(){l||p(!1)}}),g?x:null}),rCe=[gne],iCe=T.forwardRef(function(t,n){const{render:r,className:i,disabled:a,readOnly:s,required:o,onValueChange:l,value:u,defaultValue:p,name:d,inputRef:m,id:g,...x}=t,{setTouched:S,setFocused:b,shouldValidateOnChange:y,validationMode:v,name:_,disabled:C,state:w,validation:A,setDirty:R,setFilled:O,validityData:N}=is(),{labelId:D}=zl(),{clearErrors:L}=Eg(),z=JEe(!0),P=C||a,V=_??d,H=Zr(g),[j,G]=Ja({controlled:u,default:p,name:"RadioGroup",state:"value"}),q=Je(l),B=Je((te,xe)=>{q(te,xe),!xe.isCanceled&&G(te)}),F=T.useRef(null),U=Je(te=>{F.current==null&&te!=null&&(F.current=te)});_g({id:H,commit:A.commit,value:j,controlRef:F,name:V,getValue:()=>j??null}),rd(j,()=>{L(V),R(j!==N.initialValue),O(j!=null),y()?A.commit(j):A.commit(j,!0)});const[K,W]=T.useState(!1),ee=Je(te=>{Mt(te.currentTarget,te.relatedTarget)||(S(!0),b(!1),v==="onBlur"&&A.commit(j))}),oe=Je(te=>{te.key.startsWith("Arrow")&&(S(!0),W(!0),b(!0))}),ne=T.useMemo(()=>j==null?"":typeof j=="string"?j:JSON.stringify(j),[j]),Z=ns(A.inputRef,m),Y=Ho({value:ne,ref:Z,id:H,name:ne?V:void 0,disabled:P,readOnly:s,required:o,"aria-labelledby":x["aria-labelledby"]??z?.legendId,"aria-hidden":!0,tabIndex:-1,style:Nd,onChange:Zn,onFocus(){F.current?.focus()}},A.getInputValidationProps),Q=T.useMemo(()=>({...w,disabled:P??!1,required:o??!1,readOnly:s??!1}),[w,P,s,o]),re=T.useMemo(()=>({...w,checkedValue:j,disabled:P,validation:A,name:V,onValueChange:q,readOnly:s,registerControlRef:U,required:o,setCheckedValue:B,setTouched:W,touched:K}),[j,P,A,w,V,q,s,U,o,B,W,K]),se={role:"radiogroup","aria-required":o||void 0,"aria-disabled":P||void 0,"aria-readonly":s||void 0,"aria-labelledby":D,onFocus(){b(!0)},onBlur:ee,onKeyDownCapture:oe};return f.jsxs(Bre.Provider,{value:re,children:[f.jsx(N0,{render:r,className:i,state:Q,props:[se,A.getValidationProps,x],refs:[n],stateAttributesMapping:lc,enableHomeAndEndKeys:!1,modifierKeys:rCe}),f.jsx("input",{...Y})]})}),$re=T.createContext(void 0);function Bw(){const e=T.useContext($re);if(e===void 0)throw new Error(nn(53));return e}let NE=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const oS=500,EH=16;function fo(e,t,n){if(!e)return 0;const r=getComputedStyle(e),i=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}let aCe=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),kh=(function(e){return e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const C3={hasOverflowX:e=>e?{[kh.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[kh.hasOverflowY]:""}:null,overflowXStart:e=>e?{[kh.overflowXStart]:""}:null,overflowXEnd:e=>e?{[kh.overflowXEnd]:""}:null,overflowYStart:e=>e?{[kh.overflowYStart]:""}:null,overflowYEnd:e=>e?{[kh.overflowYEnd]:""}:null,cornerHidden:()=>null},_H={width:0,height:0},sCe={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},oCe=T.forwardRef(function(t,n){const{render:r,className:i,overflowEdgeThreshold:a,...s}=t,[o,l]=T.useState(!1),[u,p]=T.useState(!1),[d,m]=T.useState(!1),[g,x]=T.useState(_H),[S,b]=T.useState(_H),[y,v]=T.useState(!1),[_,C]=T.useState(sCe),w=Zr(),A=T.useRef(null),R=T.useRef(null),O=T.useRef(null),N=T.useRef(null),D=T.useRef(null),L=T.useRef(null),z=T.useRef(null),P=T.useRef(!1),V=T.useRef(0),H=T.useRef(0),j=T.useRef(0),G=T.useRef(0),q=T.useRef("vertical"),B=Gn(),F=Gn(),U=T.useRef({x:0,y:0}),[K,W]=T.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),ee=lCe(a),oe=Je(be=>{const ce=be.x-U.current.x,ye=be.y-U.current.y;U.current=be,ye!==0&&(m(!0),B.start(oS,()=>{m(!1)})),ce!==0&&(p(!0),F.start(oS,()=>{p(!1)}))}),ne=Je(be=>{be.button===0&&(P.current=!0,V.current=be.clientY,H.current=be.clientX,q.current=be.currentTarget.getAttribute(aCe.orientation),R.current&&(j.current=R.current.scrollTop,G.current=R.current.scrollLeft),D.current&&q.current==="vertical"&&D.current.setPointerCapture(be.pointerId),L.current&&q.current==="horizontal"&&L.current.setPointerCapture(be.pointerId))}),Z=Je(be=>{if(!P.current)return;const ce=be.clientY-V.current,ye=be.clientX-H.current;if(R.current){const me=R.current.scrollHeight,Pe=R.current.clientHeight,Ie=R.current.scrollWidth,We=R.current.clientWidth;if(D.current&&O.current&&q.current==="vertical"){const Te=fo(O.current,"padding","y"),he=fo(D.current,"margin","y"),fe=D.current.offsetHeight,ke=O.current.offsetHeight-fe-Te-he,Se=ce/ke;R.current.scrollTop=j.current+Se*(me-Pe),be.preventDefault(),m(!0),B.start(oS,()=>{m(!1)})}if(L.current&&N.current&&q.current==="horizontal"){const Te=fo(N.current,"padding","x"),he=fo(L.current,"margin","x"),fe=L.current.offsetWidth,ke=N.current.offsetWidth-fe-Te-he,Se=ye/ke;R.current.scrollLeft=G.current+Se*(Ie-We),be.preventDefault(),p(!0),F.start(oS,()=>{p(!1)})}}}),Y=Je(be=>{P.current=!1,D.current&&q.current==="vertical"&&D.current.releasePointerCapture(be.pointerId),L.current&&q.current==="horizontal"&&L.current.releasePointerCapture(be.pointerId)});function Q(be){const ce=be.pointerType==="touch";if(v(ce),!ce){const ye=Mt(A.current,be.target);l(ye)}}const re=T.useMemo(()=>({hasOverflowX:!K.scrollbarXHidden,hasOverflowY:!K.scrollbarYHidden,overflowXStart:_.xStart,overflowXEnd:_.xEnd,overflowYStart:_.yStart,overflowYEnd:_.yEnd,cornerHidden:K.cornerHidden}),[K.scrollbarXHidden,K.scrollbarYHidden,K.cornerHidden,_]),se={role:"presentation",onPointerEnter:Q,onPointerMove:Q,onPointerDown({pointerType:be}){v(be==="touch")},onPointerLeave(){l(!1)},style:{position:"relative",[NE.scrollAreaCornerHeight]:`${g.height}px`,[NE.scrollAreaCornerWidth]:`${g.width}px`}},te=wt("div",t,{state:re,ref:[n,A],props:[se,s],stateAttributesMapping:C3}),xe=T.useMemo(()=>({handlePointerDown:ne,handlePointerMove:Z,handlePointerUp:Y,handleScroll:oe,cornerSize:g,setCornerSize:x,thumbSize:S,setThumbSize:b,touchModality:y,cornerRef:z,scrollingX:u,setScrollingX:p,scrollingY:d,setScrollingY:m,hovering:o,setHovering:l,viewportRef:R,rootRef:A,scrollbarYRef:O,scrollbarXRef:N,thumbYRef:D,thumbXRef:L,rootId:w,hiddenState:K,setHiddenState:W,overflowEdges:_,setOverflowEdges:C,viewportState:re,overflowEdgeThreshold:ee}),[ne,Z,Y,oe,g,S,y,z,u,p,d,m,o,l,R,A,O,N,D,L,w,K,_,re,ee]);return f.jsxs($re.Provider,{value:xe,children:[my.element,te]})});function lCe(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}const uCe=T.createContext(void 0);function cCe(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(i=>{i.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let id=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({}),wH=!1;function dCe(){wH||IM||(typeof CSS<"u"&&"registerProperty"in CSS&&[id.scrollAreaOverflowXStart,id.scrollAreaOverflowXEnd,id.scrollAreaOverflowYStart,id.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),wH=!0)}const fCe=T.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{viewportRef:s,scrollbarYRef:o,scrollbarXRef:l,thumbYRef:u,thumbXRef:p,cornerRef:d,setCornerSize:m,setThumbSize:g,rootId:x,setHiddenState:S,hiddenState:b,handleScroll:y,setHovering:v,setOverflowEdges:_,overflowEdges:C,overflowEdgeThreshold:w}=Bw(),A=sc(),R=T.useRef(!0),O=Gn(),N=Gn();function D(){const G=s.current,q=o.current,B=l.current,F=u.current,U=p.current,K=d.current;if(!G)return;const W=G.scrollHeight,ee=G.scrollWidth,oe=G.clientHeight,ne=G.clientWidth,Z=G.scrollTop,Y=G.scrollLeft;if(W===0||ee===0)return;const Q=oe>=W,re=ne>=ee,se=ne/ee,te=oe/W,xe=Math.max(0,ee-ne),be=Math.max(0,W-oe);let ce=0,ye=0;re||(A==="rtl"?ce=Eu(-Y,0,xe):ce=Eu(Y,0,xe),ye=xe-ce);const me=Q?0:Eu(Z,0,be),Pe=Q?0:be-me,Ie=re?0:ne,We=Q?0:oe,Te=fo(B,"padding","x"),he=fo(q,"padding","y"),fe=fo(U,"margin","x"),ke=fo(F,"margin","y"),Se=Ie-Te-fe,pe=We-he-ke,Oe=B?Math.min(B.offsetWidth,Se):Se,Ee=q?Math.min(q.offsetHeight,pe):pe,Ue=Math.max(EH,Oe*se),Ge=Math.max(EH,Ee*te);if(g(qe=>qe.height===Ge&&qe.width===Ue?qe:{width:Ue,height:Ge}),q&&F){const qe=q.offsetHeight-Ge-he-ke,nt=W-oe,ht=nt===0?0:Z/nt,gt=Math.min(qe,Math.max(0,ht*qe));F.style.transform=`translate3d(0,${gt}px,0)`}if(B&&U){const qe=B.offsetWidth-Ue-Te-fe,nt=ee-ne,ht=nt===0?0:Y/nt,gt=A==="rtl"?Eu(ht*qe,-qe,0):Eu(ht*qe,0,qe);U.style.transform=`translate3d(${gt}px,0,0)`}const ze=Eu(ce,0,xe),Xe=Eu(ye,0,xe),Qe=Eu(me,0,be),Fe=Eu(Pe,0,be),bt=[[id.scrollAreaOverflowXStart,ze],[id.scrollAreaOverflowXEnd,Xe],[id.scrollAreaOverflowYStart,Qe],[id.scrollAreaOverflowYEnd,Fe]];for(const[qe,nt]of bt)G.style.setProperty(qe,`${nt}px`);if(K){if(re||Q)m({width:0,height:0});else if(!re&&!Q){const qe=q?.offsetWidth||0,nt=B?.offsetHeight||0;m({width:qe,height:nt})}}S(qe=>{const nt=Q||re;return qe.scrollbarYHidden===Q&&qe.scrollbarXHidden===re&&qe.cornerHidden===nt?qe:{scrollbarYHidden:Q,scrollbarXHidden:re,cornerHidden:nt}});const Ne={xStart:!re&&ze>w.xStart,xEnd:!re&&Xe>w.xEnd,yStart:!Q&&Qe>w.yStart,yEnd:!Q&&Fe>w.yEnd};_(qe=>qe.xStart===Ne.xStart&&qe.xEnd===Ne.xEnd&&qe.yStart===Ne.yStart&&qe.yEnd===Ne.yEnd?qe:Ne)}const L=Je(()=>{Fr.flushSync(D)});at(()=>s.current?(dCe(),cCe(s.current,L)):void 0,[L,s]),at(()=>{queueMicrotask(L)},[L,b,A]),at(()=>{s.current?.matches(":hover")&&v(!0)},[s,v]),T.useEffect(()=>{const G=s.current;if(typeof ResizeObserver>"u"||!G)return;const q=new ResizeObserver(L);return q.observe(G),N.start(0,()=>{Promise.all(G.getAnimations({subtree:!0}).map(B=>B.finished)).then(L).catch(()=>{})}),()=>{q.disconnect(),N.clear()}},[L,s,N]);function z(){R.current=!1}const P={role:"presentation",...x&&{"data-id":`${x}-viewport`},...(!b.scrollbarXHidden||!b.scrollbarYHidden)&&{tabIndex:0},className:my.className,style:{overflow:"scroll"},onScroll(){s.current&&(L(),R.current||y({x:s.current.scrollLeft,y:s.current.scrollTop}),O.start(100,()=>{R.current=!0}))},onWheel:z,onTouchMove:z,onPointerMove:z,onPointerEnter:z,onKeyDown:z},V=T.useMemo(()=>({hasOverflowX:!b.scrollbarXHidden,hasOverflowY:!b.scrollbarYHidden,overflowXStart:C.xStart,overflowXEnd:C.xEnd,overflowYStart:C.yStart,overflowYEnd:C.yEnd,cornerHidden:b.cornerHidden}),[b.scrollbarXHidden,b.scrollbarYHidden,b.cornerHidden,C]),H=wt("div",t,{ref:[n,s],state:V,props:[P,a],stateAttributesMapping:C3}),j=T.useMemo(()=>({computeThumbPosition:L}),[L]);return f.jsx(uCe.Provider,{value:j,children:H})}),zre=T.createContext(void 0);function pCe(){const e=T.useContext(zre);if(e===void 0)throw new Error(nn(54));return e}let IE=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const hCe=T.forwardRef(function(t,n){const{render:r,className:i,orientation:a="vertical",keepMounted:s=!1,...o}=t,{hovering:l,scrollingX:u,scrollingY:p,hiddenState:d,overflowEdges:m,scrollbarYRef:g,scrollbarXRef:x,viewportRef:S,thumbYRef:b,thumbXRef:y,handlePointerDown:v,handlePointerUp:_,rootId:C,thumbSize:w}=Bw(),A=T.useMemo(()=>({hovering:l,scrolling:{horizontal:u,vertical:p}[a],orientation:a,hasOverflowX:!d.scrollbarXHidden,hasOverflowY:!d.scrollbarYHidden,overflowXStart:m.xStart,overflowXEnd:m.xEnd,overflowYStart:m.yStart,overflowYEnd:m.yEnd,cornerHidden:d.cornerHidden}),[l,u,p,a,d,m]),R=sc();T.useEffect(()=>{const P=S.current,V=a==="vertical"?g.current:x.current;if(!V)return;function H(j){if(!(!P||!V||j.ctrlKey)){if(j.preventDefault(),a==="vertical"){if(P.scrollTop===0&&j.deltaY<0)return}else if(P.scrollLeft===0&&j.deltaX<0)return;if(a==="vertical"){if(P.scrollTop===P.scrollHeight-P.clientHeight&&j.deltaY>0)return}else if(P.scrollLeft===P.scrollWidth-P.clientWidth&&j.deltaX>0)return;a==="vertical"?P.scrollTop+=j.deltaY:P.scrollLeft+=j.deltaX}}return V.addEventListener("wheel",H,{passive:!1}),()=>{V.removeEventListener("wheel",H)}},[a,x,g,S]);const O={...C&&{"data-id":`${C}-scrollbar`},onPointerDown(P){if(P.button===0&&P.currentTarget===P.target&&S.current){if(b.current&&g.current&&a==="vertical"){const V=fo(b.current,"margin","y"),H=fo(g.current,"padding","y"),j=b.current.offsetHeight,G=g.current.getBoundingClientRect(),q=P.clientY-G.top-j/2-H+V/2,B=S.current.scrollHeight,F=S.current.clientHeight,U=g.current.offsetHeight-j-H-V,W=q/U*(B-F);S.current.scrollTop=W}if(y.current&&x.current&&a==="horizontal"){const V=fo(y.current,"margin","x"),H=fo(x.current,"padding","x"),j=y.current.offsetWidth,G=x.current.getBoundingClientRect(),q=P.clientX-G.left-j/2-H+V/2,B=S.current.scrollWidth,F=S.current.clientWidth,U=x.current.offsetWidth-j-H-V,K=q/U;let W;R==="rtl"?(W=(1-K)*(B-F),S.current.scrollLeft<=0&&(W=-W)):W=K*(B-F),S.current.scrollLeft=W}v(P)}},onPointerUp:_,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...a==="vertical"&&{top:0,bottom:`var(${NE.scrollAreaCornerHeight})`,insetInlineEnd:0,[IE.scrollAreaThumbHeight]:`${w.height}px`},...a==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${NE.scrollAreaCornerWidth})`,bottom:0,[IE.scrollAreaThumbWidth]:`${w.width}px`}}},N=wt("div",t,{ref:[n,a==="vertical"?g:x],state:A,props:[O,o],stateAttributesMapping:C3}),D=T.useMemo(()=>({orientation:a}),[a]),L=a==="vertical"?d.scrollbarYHidden:d.scrollbarXHidden;return s||!L?f.jsx(zre.Provider,{value:D,children:N}):null}),mCe=T.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{thumbYRef:s,thumbXRef:o,handlePointerDown:l,handlePointerMove:u,handlePointerUp:p,setScrollingX:d,setScrollingY:m}=Bw(),{orientation:g}=pCe(),x=T.useMemo(()=>({orientation:g}),[g]);return wt("div",t,{ref:[n,g==="vertical"?s:o],state:x,props:[{onPointerDown:l,onPointerMove:u,onPointerUp(b){g==="vertical"&&m(!1),g==="horizontal"&&d(!1),p(b)},style:{...g==="vertical"&&{height:`var(${IE.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${IE.scrollAreaThumbWidth})`}}},a]})}),gCe=T.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{cornerRef:s,cornerSize:o,hiddenState:l}=Bw(),u=wt("div",t,{ref:[n,s],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:o.width,height:o.height}},a]});return l.cornerHidden?null:u}),Hre=T.createContext(void 0);function bCe(){const e=T.useContext(Hre);if(e===void 0)throw new Error(nn(63));return e}let CH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Wre={...lc,checked(e){return e?{[CH.checked]:""}:{[CH.unchecked]:""}}},vCe=T.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:a,id:s,inputRef:o,name:l,nativeButton:u=!1,onCheckedChange:p,readOnly:d=!1,required:m=!1,disabled:g=!1,render:x,uncheckedValue:S,...b}=t,{clearErrors:y}=Eg(),{state:v,setTouched:_,setDirty:C,validityData:w,setFilled:A,setFocused:R,shouldValidateOnChange:O,validationMode:N,disabled:D,name:L,validation:z}=is(),{labelId:P}=zl(),V=D||g,H=L??l,j=Je(p),G=T.useRef(null),q=ns(G,o,z.inputRef),B=T.useRef(null),F=Zr(),U=j0({id:s,implicit:!1,controlRef:B}),[K,W]=Ja({controlled:r,default:!!a,name:"Switch",state:"checked"});_g({id:F,commit:z.commit,value:K,controlRef:B,name:H,getValue:()=>K}),at(()=>{G.current&&A(G.current.checked)},[G,A]),rd(K,()=>{y(H),C(K!==w.initialValue),A(K),O()?z.commit(K):z.commit(K,!0)});const{getButtonProps:ee,buttonRef:oe}=fa({disabled:V,native:u}),ne={id:F,role:"switch","aria-checked":K,"aria-readonly":d||void 0,"aria-labelledby":P,onFocus(){V||R(!0)},onBlur(){const re=G.current;!re||V||(_(!0),R(!1),N==="onBlur"&&z.commit(re.checked))},onClick(re){d||V||(re.preventDefault(),G?.current?.click())}},Z=T.useMemo(()=>Ho({checked:K,disabled:V,id:U,name:H,required:m,style:Nd,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:q,onChange(re){if(re.nativeEvent.defaultPrevented)return;const se=re.target.checked,te=ft(Hr,re.nativeEvent);j?.(se,te),!te.isCanceled&&W(se)},onFocus(){B.current?.focus()}},z.getInputValidationProps),[K,V,q,U,H,j,m,W,z]),Y=T.useMemo(()=>({...v,checked:K,disabled:V,readOnly:d,required:m}),[v,K,V,d,m]),Q=wt("span",t,{state:Y,ref:[n,B,oe],props:[ne,z.getValidationProps,b,ee],stateAttributesMapping:Wre});return f.jsxs(Hre.Provider,{value:Y,children:[Q,!K&&H&&S!==void 0&&f.jsx("input",{type:"hidden",name:H,value:S}),f.jsx("input",{...Z})]})}),yCe=T.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{state:s}=is(),o=bCe(),l={...s,...o};return wt("span",t,{state:l,ref:n,stateAttributesMapping:Wre,props:a})}),Vre=T.createContext(void 0);function xCe(e=!0){const t=T.useContext(Vre);if(t===void 0&&!e)throw new Error(nn(7));return t}const SCe=T.forwardRef(function(t,n){const{className:r,defaultPressed:i=!1,disabled:a=!1,form:s,onPressedChange:o,pressed:l,render:u,type:p,value:d,nativeButton:m=!0,...g}=t,x=Zr(d||void 0),S=xCe(),b=S?.value??[],y=S?void 0:i,v=(a||S?.disabled)??!1,[_,C]=Ja({controlled:S?b?.indexOf(x)>-1:l,default:y,name:"Toggle",state:"pressed"}),w=Je((z,P)=>{x&&S?.setGroupValue?.(x,z,P),o?.(z,P)}),{getButtonProps:A,buttonRef:R}=fa({disabled:v,native:m}),O=T.useMemo(()=>({disabled:v,pressed:_}),[v,_]),N=[R,n],D=[{"aria-pressed":_,onClick(z){const P=!_,V=ft(Hr,z.nativeEvent);w(P,V),!V.isCanceled&&C(P)}},g,A],L=wt("button",t,{enabled:!S,state:O,ref:N,props:D});return S?f.jsx(I0,{tag:"button",render:u,className:r,state:O,refs:N,props:D}):L});let ECe=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const TH={multiple(e){return e?{[ECe.multiple]:""}:null}},_Ce=T.forwardRef(function(t,n){const{defaultValue:r,disabled:i=!1,loopFocus:a=!0,onValueChange:s,orientation:o="horizontal",multiple:l=!1,value:u,className:p,render:d,...m}=t,g=b3(),x=T.useMemo(()=>{if(u===void 0)return r??[]},[u,r]),S=(g?.disabled??!1)||i,[b,y]=Ja({controlled:u,default:x,name:"ToggleGroup",state:"value"}),v=Je((R,O,N)=>{let D;if(l?(D=b.slice(),O?D.push(R):D.splice(b.indexOf(R),1)):D=O?[R]:[],Array.isArray(D)){if(s?.(D,N),N.isCanceled)return;y(D)}}),_=T.useMemo(()=>({disabled:S,multiple:l,orientation:o}),[S,o,l]),C=T.useMemo(()=>({disabled:S,orientation:o,setGroupValue:v,value:b}),[S,o,v,b]),w={role:"group"},A=wt("div",t,{enabled:!!g,state:_,ref:n,props:[w,m],stateAttributesMapping:TH});return f.jsx(Vre.Provider,{value:C,children:g?A:f.jsx(N0,{render:d,className:p,state:_,refs:[n],props:[w,m],stateAttributesMapping:TH,loopFocus:a})})}),qre=T.createContext(void 0);function B0(e){const t=T.useContext(qre);if(t===void 0&&!e)throw new Error(nn(72));return t}const wCe={...ZM,disabled:Ve(e=>e.disabled),instantType:Ve(e=>e.instantType),isInstantPhase:Ve(e=>e.isInstantPhase),trackCursorAxis:Ve(e=>e.trackCursorAxis),disableHoverablePopup:Ve(e=>e.disableHoverablePopup),lastOpenChangeReason:Ve(e=>e.openChangeReason),closeDelay:Ve(e=>e.closeDelay)};class T3 extends _w{constructor(t){super({...CCe(),...t},{popupRef:T.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new A0},wCe)}setOpen=(t,n)=>{const r=n.reason,i=r===Ar,a=t&&r===sy,s=!t&&(r===Lu||r===C0);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const o=()=>{const l={open:t,openChangeReason:r};a?l.instantType="focus":s?l.instantType="dismiss":r===Ar&&(l.instantType=void 0);const u=n.trigger?.id??null;(u||t)&&(l.activeTriggerId=u,l.activeTriggerElement=n.trigger??null),this.update(l)};i?Fr.flushSync(o):o()};static useStore(t,n){const r=Li(()=>t??new T3(n)).current,i=QM({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}}function CCe(){return{...XM(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function TCe(e){const{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a="none",actionsRef:s,onOpenChange:o,onOpenChangeComplete:l,handle:u,triggerId:p,defaultTriggerId:d=null,children:m}=e,g=T3.useStore(u?.store,{open:r??n,activeTriggerId:p!==void 0?p:d});g.useControlledProp("open",r,n),g.useControlledProp("activeTriggerId",p,d),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",l);const x=g.useState("open"),S=g.useState("activeTriggerId"),b=g.useState("payload");g.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});const y=!t&&x;at(()=>{x&&t&&g.setOpen(!1,ft(H0e))},[x,t,g]),g.useSyncedValue("disabled",t),KM(g);const{forceUnmount:v,transitionStatus:_}=YM(y,g),C=g.useState("isInstantPhase"),w=g.useState("instantType"),A=g.useState("lastOpenChangeReason"),R=T.useRef(null);at(()=>{_==="ending"&&A===Hr||_!=="ending"&&C?(w!=="delay"&&(R.current=w),g.set("instantType","delay")):R.current!==null&&(g.set("instantType",R.current),R.current=null)},[_,C,A,w,g]),at(()=>{y&&S==null&&g.set("payload",void 0)},[g,S,y]);const O=T.useCallback(()=>{g.setOpen(!1,ACe(g,zM))},[g]);T.useImperativeHandle(s,()=>({unmount:v,close:O}),[v,O]);const N=g.useState("floatingRootContext"),D=ane(N,{enabled:!t}),L=vg(N,{enabled:!t,referencePress:!0}),z=s1e(N,{enabled:!t&&a!=="none",axis:a==="none"?void 0:a}),{getReferenceProps:P,getFloatingProps:V,getTriggerProps:H}=Id([D,L,z]),j=T.useMemo(()=>P(),[P]),G=T.useMemo(()=>H(),[H]),q=T.useMemo(()=>V(),[V]);return g.useSyncedValues({floatingRootContext:N,activeTriggerProps:j,inactiveTriggerProps:G,popupProps:q}),f.jsx(qre.Provider,{value:g,children:typeof m=="function"?m({payload:b}):m})}function ACe(e,t){const n=ft(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const Gre=T.createContext(void 0);function kCe(){return T.useContext(Gre)}const OCe=600,RCe=T.forwardRef(function(t,n){const{className:r,render:i,handle:a,payload:s,disabled:o,delay:l,closeDelay:u,id:p,...d}=t,m=B0(!0),g=a?.store??m;if(!g)throw new Error(nn(82));const x=Zr(p),S=g.useState("isTriggerActive",x),b=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",x),v=T.useRef(null),_=l??OCe,C=u??0,{registerTrigger:w,isMountedByThisTrigger:A}=GM(x,v,g,{payload:s,closeDelay:C}),R=kCe(),{delayRef:O,isInstantPhase:N,hasProvider:D}=Y0e(b,{open:y});g.useSyncedValue("isInstantPhase",N);const L=g.useState("disabled"),z=o??L,P=g.useState("trackCursorAxis"),V=g.useState("disableHoverablePopup"),H=lne(b,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!V&&P!=="both"?t3():null,restMs(){const B=R?.delay,F=typeof O.current=="object"?O.current.open:void 0;let U=_;return D&&(F!==0?U=l??B??_:U=0),U},delay(){const B=typeof O.current=="object"?O.current.close:void 0;let F=C;return u==null&&D&&(F=B),{close:F}},triggerElementRef:v,isActiveTrigger:S}),j=T.useMemo(()=>({open:y}),[y]),G=g.useState("triggerProps",A);return wt("button",t,{state:j,ref:[n,w,v],props:[H,G,{id:x},d],stateAttributesMapping:kw})}),Kre=T.createContext(void 0);function NCe(){const e=T.useContext(Kre);if(e===void 0)throw new Error(nn(70));return e}const ICe=T.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return B0().useState("mounted")||r?f.jsx(Kre.Provider,{value:r,children:f.jsx(Qwe,{ref:n,...i})}):null}),Yre=T.createContext(void 0);function Xre(){const e=T.useContext(Yre);if(e===void 0)throw new Error(nn(71));return e}const DCe=T.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:s="absolute",side:o="top",align:l="center",sideOffset:u=0,alignOffset:p=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:S=!1,collisionAvoidance:b=OM,...y}=t,v=B0(),_=NCe(),C=v.useState("open"),w=v.useState("mounted"),A=v.useState("trackCursorAxis"),R=v.useState("disableHoverablePopup"),O=v.useState("floatingRootContext"),N=v.useState("instantType"),D=v.useState("transitionStatus"),L=D0({anchor:a,positionMethod:s,floatingRootContext:O,mounted:w,side:o,sideOffset:u,align:l,alignOffset:p,collisionBoundary:d,collisionPadding:m,sticky:x,arrowPadding:g,disableAnchorTracking:S,keepMounted:_,collisionAvoidance:b,adaptiveOrigin:_ne}),z=T.useMemo(()=>{const j={};return(!C||A==="both"||R)&&(j.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...L.positionerStyles,...j}}},[C,A,R,w,L.positionerStyles]),P=T.useMemo(()=>({open:C,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:A!=="none"?"tracking-cursor":N}),[C,L.side,L.align,L.anchorHidden,A,N]),V=T.useMemo(()=>({...P,arrowRef:L.arrowRef,arrowStyles:L.arrowStyles,arrowUncentered:L.arrowUncentered}),[P,L.arrowRef,L.arrowStyles,L.arrowUncentered]),H=wt("div",t,{state:P,props:[z,Sg(D),y],ref:[n,v.useStateSetter("positionerElement")],stateAttributesMapping:ls});return f.jsx(Yre.Provider,{value:V,children:H})}),LCe={...ls,...os},PCe=T.forwardRef(function(t,n){const{className:r,render:i,...a}=t,s=B0(),{side:o,align:l}=Xre(),u=s.useState("open"),p=s.useState("mounted"),d=s.useState("instantType"),m=s.useState("transitionStatus"),g=s.useState("popupProps"),x=s.useState("payload"),S=s.useState("popupElement"),b=s.useState("positionerElement"),y=s.useState("floatingRootContext"),v=sc();Pi({open:u,ref:s.context.popupRef,onComplete(){u&&s.context.onOpenChangeComplete?.(!0)}});function _(){y.context.events.emit("measure-layout")}function C(D,L){y.context.events.emit("measure-layout-complete",{previousDimensions:D,nextDimensions:L})}const w=T.useCallback(()=>s.context.triggerElements.size>1,[s]);Zwe({popupElement:S,positionerElement:b,mounted:p,content:x,enabled:w,onMeasureLayout:_,onMeasureLayoutComplete:C,side:o,direction:v});const A=s.useState("disabled"),R=s.useState("closeDelay");one(y,{enabled:!A,closeDelay:R});const O=T.useMemo(()=>({open:u,side:o,align:l,instant:d,transitionStatus:m}),[u,o,l,d,m]);return wt("div",t,{state:O,ref:[n,s.context.popupRef,s.useStateSetter("popupElement")],props:[g,Sg(m),a],stateAttributesMapping:LCe})}),MCe=T.forwardRef(function(t,n){const{className:r,render:i,...a}=t,o=B0().useState("instantType"),{open:l,arrowRef:u,side:p,align:d,arrowUncentered:m,arrowStyles:g}=Xre(),x=T.useMemo(()=>({open:l,side:p,align:d,uncentered:m,instant:o}),[l,p,d,m,o]);return wt("div",t,{state:x,ref:[n,u],props:[{style:g,"aria-hidden":!0},a],stateAttributesMapping:ls})}),jCe=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,a=T.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),s=T.useMemo(()=>({open:n,close:r}),[n,r]);return f.jsx(Gre.Provider,{value:a,children:f.jsx(K0e,{delay:s,timeoutMs:i,children:t.children})})};function FCe(e){return wt(e.defaultTagName??"div",e,e)}function BCe({className:e,...t}){return f.jsx("div",{"data-slot":"input-group",role:"group",className:Be("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot=input-group-control]:focus-visible]:ring-inset has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[[data-slot][aria-invalid=true]]:ring-inset h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",e),...t})}const UCe=kd("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function $Ce({className:e,align:t="inline-start",...n}){return f.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Be(UCe({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const zCe=kd("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Zre({className:e,type:t="button",variant:n="ghost",size:r="xs",...i}){return f.jsx(Ae,{type:t,"data-size":r,variant:n,className:Be(zCe({size:r}),e),...i})}function HCe({className:e,...t}){return f.jsx($t,{"data-slot":"input-group-control",className:Be("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1",e),...t})}const Qre=wwe;function WCe({className:e,children:t,...n}){return f.jsxs(Z_e,{"data-slot":"combobox-trigger",className:Be("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,f.jsx(J,{icon:L0,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function VCe({className:e,...t}){return f.jsx(rwe,{"data-slot":"combobox-clear",render:f.jsx(Zre,{variant:"ghost",size:"icon-xs"}),className:Be(e),...t,children:f.jsx(J,{icon:Mr,strokeWidth:2,className:"pointer-events-none"})})}function Jre({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...a}){return f.jsxs(BCe,{className:Be("w-auto",e),children:[f.jsx(twe,{render:f.jsx(HCe,{disabled:n}),...a}),f.jsxs($Ce,{align:"inline-end",children:[r&&f.jsx(Zre,{size:"icon-xs",variant:"ghost",render:f.jsx(WCe,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),i&&f.jsx(VCe,{disabled:n})]}),t]})}function eie({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:i=0,anchor:a,...s}){return f.jsx(uwe,{children:f.jsx(cwe,{side:t,sideOffset:n,align:r,alignOffset:i,anchor:a,className:"isolate z-50",children:f.jsx(fwe,{"data-slot":"combobox-content","data-chips":!!a,className:Be("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-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 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",e),...s})})})}function tie({className:e,...t}){return f.jsx(owe,{"data-slot":"combobox-list",className:Be("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",e),...t})}function UD({className:e,children:t,...n}){return f.jsxs(vwe,{"data-slot":"combobox-item",className:Be("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,f.jsx(Cwe,{render:f.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:f.jsx(J,{icon:Dr,strokeWidth:2,className:"pointer-events-none"})})]})}function qCe({className:e,...t}){return f.jsx(hwe,{"data-slot":"combobox-group",className:Be(e),...t})}function GCe({className:e,...t}){return f.jsx(mwe,{"data-slot":"combobox-label",className:Be("text-muted-foreground px-2 py-1.5 text-xs",e),...t})}function nie({className:e,...t}){return f.jsx(ywe,{"data-slot":"combobox-empty",className:Be("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}function AH({className:e,...t}){return f.jsx(h3,{"data-slot":"combobox-separator",className:Be("bg-border/50 -mx-1 my-1 h-px",e),...t})}const KCe=kd("hover:text-foreground hover:bg-accent/20 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground data-[state=on]:hover:bg-accent gap-1 rounded-md text-xs font-medium transition-all [&_svg:not([class*='size-'])]:size-3.5 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border-input hover:bg-accent/20 border bg-transparent"},size:{default:"h-7 min-w-7 px-2",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-1.5 text-[0.625rem] [&_svg:not([class*='size-'])]:size-3",lg:"h-8 min-w-8 px-2"}},defaultVariants:{variant:"default",size:"default"}}),rie=T.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function YCe({className:e,variant:t,size:n,spacing:r=0,orientation:i="horizontal",children:a,...s}){return f.jsx(_Ce,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:Be("rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",e),...s,children:f.jsx(rie.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function kH({className:e,children:t,variant:n="default",size:r="default",...i}){const a=T.useContext(rie);return f.jsx(SCe,{"data-slot":"toggle-group-item","data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:Be("group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",KCe({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}async function yt(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Request failed"}));throw new Error(r.error||"Request failed")}return n.json()}const _d="";function A3(){return on({queryKey:["tasks"],queryFn:()=>yt(`${_d}/api/tasks`)})}function iie(e){return on({queryKey:["tasks",e],queryFn:()=>yt(`${_d}/api/tasks/${e}`),enabled:!!e})}function XCe(){const e=vn();return tn({mutationFn:t=>yt(`${_d}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function ZCe(){const e=vn();return tn({mutationFn:({taskId:t,status:n,position:r})=>yt(`${_d}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:r})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function Uw(){const e=vn();return tn({mutationFn:({taskId:t,updates:n})=>yt(`${_d}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function $w(){const e=vn();return tn({mutationFn:({taskId:t,deleteLinkedWorktree:n})=>{const r=n?`${_d}/api/tasks/${t}?deleteLinkedWorktree=true`:`${_d}/api/tasks/${t}`;return yt(r,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["worktrees"]})}})}function QCe(){const e=vn();return tn({mutationFn:({ids:t,deleteLinkedWorktrees:n})=>yt(`${_d}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t,deleteLinkedWorktrees:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["worktrees"]})}})}const U0="";function JCe(e){return on({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return yt(`${U0}/api/fs/list${t}`)},enabled:e!==null})}function aie(e){return on({queryKey:["git","branches",e],queryFn:()=>yt(`${U0}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function eTe(e,t={}){const{staged:n=!1,ignoreWhitespace:r=!1,includeUntracked:i=!1,baseBranch:a}=t;return on({queryKey:["git","diff",e,n,r,i,a],queryFn:()=>{const s=new URLSearchParams({path:e,...n&&{staged:"true"},...r&&{ignoreWhitespace:"true"},...i&&{includeUntracked:"true"},...a&&{baseBranch:a}});return yt(`${U0}/api/git/diff?${s}`)},enabled:!!e,refetchInterval:5e3})}function tTe(e){return on({queryKey:["git","status",e],queryFn:()=>yt(`${U0}/api/git/status?path=${encodeURIComponent(e)}`),enabled:!!e,refetchInterval:5e3})}async function nTe(e){return yt(`${U0}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}const Wl="",mn={PORT:"server.port",WORKTREE_BASE_PATH:"worktree_base_path",HOME_DIR:"home_dir",DEFAULT_GIT_REPOS_DIR:"paths.defaultGitReposDir",EDITOR_APP:"editor.app",EDITOR_HOST:"editor.host",EDITOR_SSH_PORT:"editor.sshPort",LINEAR_API_KEY:"integrations.linearApiKey",GITHUB_PAT:"integrations.githubPat",DEFAULT_AGENT:"agent.defaultAgent",OPENCODE_MODEL:"agent.opencodeModel",LANGUAGE:"appearance.language",SYNC_CLAUDE_CODE_THEME:"appearance.syncClaudeCodeTheme",CLAUDE_CODE_LIGHT_THEME:"appearance.claudeCodeLightTheme",CLAUDE_CODE_DARK_THEME:"appearance.claudeCodeDarkTheme"},rTe=7777;function ja(e){return on({queryKey:["config",e],queryFn:()=>yt(`${Wl}/api/config/${e}`)})}function sie(){const e=ja(mn.PORT);return{...e,data:e.data?.value??rTe,isDefault:e.data?.isDefault??!0}}function iTe(){const e=ja(mn.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??""}}function aTe(){const e=ja(mn.HOME_DIR);return{...e,data:e.data?.value??""}}function k3(){const e=ja(mn.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function $0(){const e=ja(mn.EDITOR_APP);return{...e,data:e.data?.value??"vscode",isDefault:e.data?.isDefault??!0}}function z0(){const e=ja(mn.EDITOR_HOST);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function H0(){const e=ja(mn.EDITOR_SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function sTe(){const e=ja(mn.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function oTe(){const e=ja(mn.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function oie(){const e=ja(mn.DEFAULT_AGENT);return{...e,data:e.data?.value??"claude",isDefault:e.data?.isDefault??!0}}function O3(){const e=ja(mn.OPENCODE_MODEL);return{...e,data:e.data?.value??null,isDefault:e.data?.isDefault??!0}}function lTe(){const e=ja(mn.LANGUAGE);return{...e,data:e.data?.value??null,isDefault:e.data?.isDefault??!0}}function uTe(){const e=ja(mn.SYNC_CLAUDE_CODE_THEME);return{...e,data:!!e.data?.value,isDefault:e.data?.isDefault??!0}}const OH=["light","light-ansi","light-daltonized","dark","dark-ansi","dark-daltonized"];function cTe(){const e=ja(mn.CLAUDE_CODE_LIGHT_THEME);return{...e,data:e.data?.value??"light-ansi",isDefault:e.data?.isDefault??!0}}function dTe(){const e=ja(mn.CLAUDE_CODE_DARK_THEME);return{...e,data:e.data?.value??"dark-ansi",isDefault:e.data?.isDefault??!0}}function lie(){const e=vn();return tn({mutationFn:({key:t,value:n})=>yt(`${Wl}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]}),n===mn.GITHUB_PAT&&(e.invalidateQueries({queryKey:["github-user"]}),e.invalidateQueries({queryKey:["github-prs"]}),e.invalidateQueries({queryKey:["github-issues"]}),e.invalidateQueries({queryKey:["github-orgs"]}))}})}function fTe(){const e=vn();return tn({mutationFn:t=>yt(`${Wl}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function pTe(){return on({queryKey:["config","notifications"],queryFn:()=>yt(`${Wl}/api/config/notifications`)})}function hTe(){const e=vn();return tn({mutationFn:t=>yt(`${Wl}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function mTe(){return tn({mutationFn:e=>yt(`${Wl}/api/config/notifications/test/${e}`,{method:"POST"})})}function gTe(){return on({queryKey:["config","z-ai"],queryFn:()=>yt(`${Wl}/api/config/z-ai`)})}function bTe(){const e=vn();return tn({mutationFn:t=>yt(`${Wl}/api/config/z-ai`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","z-ai"]}),e.invalidateQueries({queryKey:["monitoring","claude-usage"]})}})}function uie(){return on({queryKey:["config","developer-mode"],queryFn:()=>yt(`${Wl}/api/config/developer-mode`),staleTime:1/0})}function vTe(){return tn({mutationFn:()=>yt(`${Wl}/api/config/restart`,{method:"POST"})})}const Pl={claude:"Claude Code",opencode:"OpenCode"},yTe={claude:"npm install -g @anthropic-ai/claude-code",opencode:"npm install -g opencode-ai@latest"},xTe={claude:"https://docs.anthropic.com/en/docs/claude-code/overview",opencode:"https://opencode.ai/docs/"},Ku="";function wg(){return on({queryKey:["repositories"],queryFn:()=>yt(`${Ku}/api/repositories`)})}function STe(e){return on({queryKey:["repositories",e],queryFn:()=>yt(`${Ku}/api/repositories/${e}`),enabled:!!e})}function cie(){const e=vn();return tn({mutationFn:t=>yt(`${Ku}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function ETe(){const e=vn();return tn({mutationFn:t=>yt(`${Ku}/api/repositories/clone`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function _Te(){const e=vn();return tn({mutationFn:({id:t,updates:n})=>yt(`${Ku}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]})}})}function die(){const e=vn();return tn({mutationFn:({id:t,deleteDirectory:n=!1})=>{const r=n?`${Ku}/api/repositories/${t}?deleteDirectory=true`:`${Ku}/api/repositories/${t}`;return yt(r,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function wTe(){return tn({mutationFn:e=>yt(`${Ku}/api/repositories/scan`,{method:"POST",body:JSON.stringify(e?{directory:e}:{})})})}function CTe(){const e=vn();return tn({mutationFn:t=>yt(`${Ku}/api/repositories/bulk`,{method:"POST",body:JSON.stringify({repositories:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function Cg({className:e,children:t,...n}){return f.jsxs(oCe,{"data-slot":"scroll-area",className:Be("relative",e),...n,children:[f.jsx(fCe,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),f.jsx(TTe,{}),f.jsx(gCe,{})]})}function TTe({className:e,orientation:t="vertical",...n}){return f.jsx(hCe,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Be("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",e),...n,children:f.jsx(mCe,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function ad({open:e,onOpenChange:t,onSelect:n,initialPath:r}){const[i,a]=T.useState(r||null),[s,o]=T.useState(""),[l,u]=T.useState("");T.useEffect(()=>{e&&(a(r||null),o(""),u(""))},[e,r]);const{data:p,isLoading:d,error:m}=JCe(e?i??"":null),g=_=>{p&&(a(p.path+"/"+_),u(""))},x=()=>{p?.parent&&p.parent!==p.path&&(a(p.parent),u(""))},S=()=>{a(null),u("")},b=()=>{s.trim()&&(a(s.trim()),u(""))},y=_=>{n(_),t(!1)},v=p?.entries.filter(_=>_.name.toLowerCase().includes(l.toLowerCase()));return f.jsx(Xo,{open:e,onOpenChange:t,children:f.jsxs(Zo,{className:"sm:max-w-lg overflow-x-hidden max-w-[calc(100vw-2rem)]",children:[f.jsxs(Ul,{children:[f.jsx($l,{children:"Select Git Repository"}),f.jsx(wp,{children:"Choose an existing git repository"})]}),f.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),f.jsx(u_e,{}),f.jsxs("div",{className:"space-y-1 min-w-0",children:[f.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),f.jsxs("div",{className:"flex gap-2 min-w-0",children:[f.jsx($t,{value:s,onChange:_=>o(_.target.value),placeholder:"/path/to/your/project",onKeyDown:_=>_.key==="Enter"&&b(),className:"flex-1 min-w-0"}),f.jsx(Ae,{variant:"outline",size:"sm",onClick:b,className:"shrink-0",children:"Go"})]})]}),f.jsxs("div",{className:"space-y-1 min-w-0",children:[f.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),f.jsxs("div",{className:"relative",children:[f.jsx(J,{icon:_p,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),f.jsx($t,{value:l,onChange:_=>u(_.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),f.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[f.jsx(Ae,{variant:"outline",size:"icon-sm",onClick:S,title:"Home",className:"shrink-0",children:f.jsx(J,{icon:LSe,size:14,strokeWidth:2})}),f.jsx(Ae,{variant:"outline",size:"icon-sm",onClick:x,disabled:!p||p.parent===p.path,title:"Parent directory",className:"shrink-0",children:f.jsx(J,{icon:s3,size:14,strokeWidth:2})}),f.jsx("code",{className:"min-w-0 flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate overflow-hidden",children:p?.path||"~"}),f.jsxs(Ae,{variant:"outline",size:"sm",onClick:()=>p&&y(p.path),disabled:!p,className:"shrink-0 max-sm:px-2",title:"Select current directory",children:[f.jsx(J,{icon:PD,size:14,strokeWidth:2,className:"sm:hidden"}),f.jsx("span",{className:"max-sm:hidden",children:"Select Current"})]})]}),f.jsx(Cg,{className:"h-64 border rounded-md min-w-0",children:f.jsxs("div",{className:"p-1 min-w-0",children:[d&&f.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),m&&f.jsx("div",{className:"text-destructive text-xs p-3",children:m.message}),p&&v&&f.jsxs(f.Fragment,{children:[v.length===0&&f.jsx("div",{className:"text-muted-foreground text-xs p-3",children:l?"No matches found":"Empty directory"}),v.map(_=>f.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group min-w-0",children:_.type==="directory"?f.jsxs(f.Fragment,{children:[f.jsx(J,{icon:_.isGitRepo?PD:ua,size:16,strokeWidth:2,className:"text-accent shrink-0"}),f.jsx("button",{onClick:()=>g(_.name),className:"flex-1 text-left text-xs truncate hover:underline min-w-0",children:_.name}),_.isGitRepo&&f.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-accent/50 text-accent font-medium shrink-0",children:[f.jsx("span",{className:"max-sm:hidden",children:"git repo"}),f.jsx("span",{className:"sm:hidden",children:"git"})]})]}):f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"w-4 shrink-0"}),f.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate min-w-0",children:_.name})]})},_.name))]})]})}),f.jsxs(Fu,{children:[f.jsx(Wf,{render:f.jsx(Ae,{variant:"outline"}),children:"Cancel"}),f.jsx(Ae,{onClick:()=>p&&y(p.path),disabled:!p,children:"Select Path"})]})]})})}function ATe(){const e=on({queryKey:["opencode","models"],queryFn:()=>yt("/api/opencode/models"),staleTime:3e5,gcTime:6e5});return{...e,installed:e.data?.installed??!1,providers:e.data?.providers??{},models:e.data?.models??[]}}function R3({value:e,onChange:t,placeholder:n,showUseDefault:r=!0,className:i}){const{t:a}=At("common"),{providers:s,installed:o,isLoading:l,isError:u}=ATe(),p=T.useMemo(()=>Object.entries(s).sort(([m],[g])=>m.localeCompare(g)),[s]),d=m=>m||"";return l?f.jsx("div",{className:`text-muted-foreground text-sm ${i}`,children:a("status.loading")}):u||!o?f.jsx("div",{className:`text-muted-foreground text-sm ${i}`,children:a("opencode.notInstalled","OpenCode not installed")}):f.jsx("div",{className:i,children:f.jsxs(Qre,{value:e||"",onValueChange:m=>t(m===""?null:m),itemToStringLabel:d,children:[f.jsx(Jre,{placeholder:n||a("opencode.selectModel","Select model"),className:"w-full"}),f.jsx(eie,{children:f.jsxs(tie,{children:[f.jsx(nie,{children:a("opencode.noModelsFound","No models found")}),r&&f.jsxs(f.Fragment,{children:[f.jsx(UD,{value:"",children:f.jsx("span",{className:"text-muted-foreground",children:a("opencode.useDefault","Use default")})}),p.length>0&&f.jsx(AH,{})]}),p.map(([m,g],x)=>f.jsxs(qCe,{children:[f.jsx(GCe,{children:m}),g.map(S=>f.jsx(UD,{value:`${m}/${S}`,children:f.jsx("span",{className:"pl-2",children:S})},`${m}/${S}`)),x<p.length-1&&f.jsx(AH,{})]},m))]})})]})})}function kTe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function OTe(e){const t=e.trim().split(/\s+/).slice(0,4).join(" "),n=kTe(t);if(!n)return"";const r=Math.random().toString(36).substring(2,6);return`${n}-${r}`}function N3({open:e,onOpenChange:t,defaultRepository:n,showTrigger:r=!0}={}){const{t:i}=At("tasks"),{t:a}=At("common"),[s,o]=T.useState(!1),l=e??s,u=t??o,[p,d]=T.useState(!1),[m,g]=T.useState(""),[x,S]=T.useState(""),[b,y]=T.useState(""),[v,_]=T.useState(""),[C,w]=T.useState(""),[A,R]=T.useState(""),[O,N]=T.useState("default"),[D,L]=T.useState(!1),[z,P]=T.useState("claude"),[V,H]=T.useState(null),[j,G]=T.useState("browse"),[q,B]=T.useState(""),[F,U]=T.useState(null),[K,W]=T.useState(!1),[ee,oe]=T.useState(null),ne=Vr(),Z=XCe(),Y=cie(),Q=T.useRef(null),{data:re}=iTe(),{data:se}=k3(),{data:te}=oie(),{data:xe}=O3(),{data:be}=wg(),{data:ce,isLoading:ye}=aie(b||null),me=V?be?.find(Se=>Se.id===V):null,Pe=T.useMemo(()=>{if(!be)return[];if(me&&q===me.displayName||!q.trim())return be;const Se=q.toLowerCase();return be.filter(pe=>pe.displayName.toLowerCase().includes(Se)||pe.path.toLowerCase().includes(Se))},[be,q,me]);T.useEffect(()=>{be&&be.length>0?G("saved"):G("browse")},[be]),T.useEffect(()=>{if(l){const Se=n??(be&&be.length>0?be[0]:null);if(Se?.defaultAgent?P(Se.defaultAgent):te&&P(te),Se?.opencodeModel?oe(Se.opencodeModel):oe(xe||null),n)H(n.id),y(n.path),B(n.displayName),G("saved");else if(be&&be.length>0){const pe=be[0];H(pe.id),y(pe.path),B(pe.displayName),G("saved")}}},[l,n,be,te,xe]),T.useEffect(()=>{_(ce?ce.defaultBranch||ce.branches[0]||"main":"")},[ce,b]);const Ie=Se=>{g(Se),R(OTe(Se))},We=async Se=>{U(null),W(!0);try{if(!(await nTe(Se)).isGitRepo){U(i("createModal.errors.notGitRepo")),W(!1);return}y(Se);const Oe=be?.find(Ee=>Ee.path===Se);if(Oe)H(Oe.id);else{H(null);const Ee=Se.split("/").pop()||"Unknown";Y.mutate({path:Se,displayName:Ee})}}catch(pe){U(pe instanceof Error?pe.message:i("createModal.errors.validationFailed"))}finally{W(!1)}},Te=Se=>{if(Se.preventDefault(),!m.trim()||!b)return;const pe=b.split("/").pop()||"repo",Oe=C.trim()||A,Ee=`${re}/${Oe}`,Ue=z==="claude"?me?.claudeOptions:me?.opencodeOptions;Z.mutate({title:m.trim(),description:x.trim(),agent:z,aiMode:O,repoPath:b,repoName:pe,baseBranch:v||"main",branch:Oe,worktreePath:Ee,copyFiles:me?.copyFiles||void 0,startupScript:me?.startupScript||void 0,agentOptions:Ue||void 0,opencodeModel:z==="opencode"?ee:void 0},{onSuccess:Ge=>{const ze=x.trim()?{aiMode:O,description:x.trim(),focusTerminal:!0}:{aiMode:O,focusTerminal:!0};u(!1),g(""),S(""),y(""),_(""),w(""),R(""),N("default"),L(!1),P(te||"claude"),oe(null),H(null),B(""),U(null),G(be&&be.length>0?"saved":"browse"),ne({to:"/tasks/$taskId",params:{taskId:Ge.id},state:ze})},onError:Ge=>{St.error(i("createModal.errors.createFailed"),{description:Ge instanceof Error?Ge.message:String(Ge)})}})},he=!Z.isPending&&!!m.trim()&&!!b;ya("meta+enter",()=>{Q.current&&Q.current.requestSubmit()},{enabled:l&&he,allowInInput:!0,ignoreContext:!0,deps:[l,he]});const fe=C.trim()||A,ke=fe?`${re}/${fe}`:"";return f.jsxs(f.Fragment,{children:[f.jsxs(Xo,{open:l,onOpenChange:u,children:[r&&f.jsxs(GEe,{render:f.jsx(Ae,{size:"sm"}),children:[f.jsx(J,{icon:c3,size:16,strokeWidth:2,"data-slot":"icon",className:"-translate-y-px"}),i("newTask")]}),f.jsx(Zo,{className:"sm:max-w-md max-h-[80dvh] flex flex-col overflow-hidden",children:f.jsxs("form",{ref:Q,onSubmit:Te,className:"flex flex-col min-h-0 flex-1",children:[f.jsxs(Ul,{className:"shrink-0",children:[f.jsx($l,{children:i("createModal.title")}),f.jsx(wp,{children:i("createModal.description")})]}),f.jsxs(lp,{className:"mt-4 pb-4 overflow-y-auto min-h-0 flex-1",children:[f.jsxs(Vn,{children:[f.jsx(qn,{htmlFor:"title",children:i("createModal.fields.title")}),f.jsx($t,{id:"title",value:m,onChange:Se=>Ie(Se.target.value),placeholder:i("createModal.fields.titlePlaceholder"),required:!0})]}),f.jsxs(Vn,{children:[f.jsx(qn,{htmlFor:"description",children:i("createModal.fields.description")}),f.jsx(ere,{id:"description",value:x,onValueChange:Se=>{S(Se),D||N(Se.trim()?"plan":"default")},placeholder:i("createModal.fields.descriptionPlaceholder"),rows:2})]}),f.jsxs(Vn,{children:[f.jsx(qn,{children:i("createModal.fields.aiMode")}),f.jsxs(YCe,{value:[O],onValueChange:Se=>{const pe=Array.isArray(Se)?Se[0]:Se;pe&&(N(pe),L(!0))},className:"w-full",variant:"outline",children:[f.jsx(kH,{value:"plan",className:"flex-1",children:i("createModal.aiModes.plan")}),f.jsx(kH,{value:"default",className:"flex-1",children:i("createModal.aiModes.default")})]})]}),f.jsxs(Vn,{children:[f.jsx(qn,{children:i("createModal.fields.agent")}),f.jsxs(si,{value:z,onValueChange:Se=>P(Se),children:[f.jsx(li,{className:"w-full",children:f.jsx(oi,{})}),f.jsx(ui,{children:Object.keys(Pl).map(Se=>f.jsx(dn,{value:Se,children:Pl[Se]},Se))})]})]}),z==="opencode"&&f.jsxs(Vn,{children:[f.jsx(qn,{children:i("createModal.fields.opencodeModel")}),f.jsx(R3,{value:ee,onChange:oe,placeholder:i("createModal.fields.opencodeModelPlaceholder")})]}),f.jsxs(Vn,{children:[f.jsx(qn,{children:i("createModal.fields.repository")}),f.jsxs(mo,{value:j,onValueChange:Se=>{G(Se),U(null)},children:[f.jsxs(go,{children:[f.jsx(Rn,{value:"saved",disabled:!be?.length,children:i("createModal.tabs.saved")}),f.jsx(Rn,{value:"browse",children:i("createModal.tabs.browse")})]}),f.jsx(Mn,{value:"saved",className:"mt-2",children:f.jsxs(Qre,{value:V||"",onValueChange:Se=>{const pe=be?.find(Oe=>Oe.id===Se);pe&&(H(Se),y(pe.path),B(pe.displayName),U(null),pe.defaultAgent&&P(pe.defaultAgent),oe(pe.opencodeModel??xe??null))},inputValue:q,onInputValueChange:Se=>{B(Se)},itemToStringLabel:Se=>be?.find(pe=>pe.id===Se)?.displayName||"",children:[f.jsx(Jre,{placeholder:i("createModal.searchRepositories"),className:"w-full"}),f.jsx(eie,{children:f.jsxs(tie,{children:[f.jsx(nie,{children:i("createModal.noRepositoriesFound")}),Pe.map(Se=>f.jsx(UD,{value:Se.id,children:Se.displayName},Se.id))]})})]})}),f.jsx(Mn,{value:"browse",className:"mt-2",children:f.jsxs(Ae,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>d(!0),disabled:K,children:[f.jsx(J,{icon:ua,size:14,strokeWidth:2,className:"mr-2"}),K?f.jsx("span",{className:"text-muted-foreground",children:a("status.validating")}):b&&!V?f.jsx("span",{className:"truncate",children:b}):f.jsx("span",{className:"text-muted-foreground group-hover/button:text-accent-foreground",children:i("createModal.selectFolder")})]})})]}),F&&f.jsx("p",{className:"text-sm text-destructive",children:F}),b&&!F&&f.jsx(Ea,{className:"font-mono text-xs truncate",children:b})]}),f.jsxs(Vn,{children:[f.jsx(qn,{htmlFor:"baseBranch",children:i("createModal.fields.baseBranch")}),f.jsxs(si,{value:v,onValueChange:Se=>_(Se??""),disabled:!b||ye,children:[f.jsx(li,{className:"w-full",children:f.jsx(oi,{children:v||f.jsx("span",{className:"text-muted-foreground",children:i(b?ye?"createModal.loadingBranches":"createModal.selectBranch":"createModal.selectRepositoryFirst")})})}),f.jsx(ui,{children:ce?.branches.map(Se=>f.jsxs(dn,{value:Se,children:[Se,Se===ce.current&&f.jsx("span",{className:"text-muted-foreground ml-2",children:i("createModal.current")})]},Se))})]})]}),f.jsxs(Vn,{children:[f.jsx(qn,{htmlFor:"branch",children:i("createModal.fields.branchName")}),f.jsx($t,{id:"branch",value:C,onChange:Se=>w(Se.target.value),placeholder:A||i("createModal.fields.branchPlaceholder")}),ke&&f.jsxs(Ea,{children:[i("createModal.worktreePrefix")," ",ke]}),!C.trim()&&A&&f.jsx(Ea,{children:i("createModal.branchAutoGenerated",{branch:A})})]})]}),f.jsxs(Fu,{className:"mt-4 shrink-0",children:[f.jsx(Wf,{render:f.jsx(Ae,{variant:"outline",type:"button",className:"border-destructive text-destructive hover:bg-destructive hover:text-white"}),children:a("buttons.cancel")}),f.jsx(Ae,{type:"submit",disabled:Z.isPending||!m.trim()||!b,children:Z.isPending?a("status.creating"):i("createModal.createTask")})]})]})})]}),f.jsx(ad,{open:p,onOpenChange:d,onSelect:We,initialPath:se||void 0})]})}const RH=[{to:"/tasks",icon:wm,labelKey:"header.tasks",matchPrefix:!0},{to:"/terminals",icon:Ow,labelKey:"header.terminals",matchPrefix:!1},{to:"/repositories",icon:Ou,labelKey:"header.repositories",matchPrefix:!0},{to:"/apps",icon:op,labelKey:"header.apps",matchPrefix:!0},{to:"/review",icon:ju,labelKey:"header.review",matchPrefix:!0},{to:"/monitoring",icon:kne,labelKey:"header.monitoring",matchPrefix:!0}];function RTe({onNewTaskRef:e,onOpenCommandPalette:t}){const{t:n}=At("navigation"),{location:r}=Ei(),i=r.pathname,[a,s]=T.useState(!1),[o,l]=T.useState(""),u=(p,d)=>d?i.startsWith(p):i===p;return T.useEffect(()=>{e?.(()=>s(!0))},[e]),f.jsxs("header",{className:"sticky top-0 z-10 flex h-10 shrink-0 items-center justify-between border-b border-border bg-card px-4 max-sm:px-2",children:[f.jsxs("div",{className:"flex min-w-0 items-center gap-4 max-sm:gap-2",children:[f.jsx(KSe,{className:"sm:hidden",value:o,onValueChange:l,children:f.jsx(YSe,{children:f.jsxs(XSe,{children:[f.jsxs(QSe,{className:"bg-transparent hover:bg-muted/50 data-open:bg-muted/50 gap-1 px-2",children:[f.jsx(J,{icon:Mne,size:16,strokeWidth:2}),f.jsx("span",{className:"sr-only",children:"Menu"})]}),f.jsx(JSe,{className:"min-w-48",children:RH.map(p=>f.jsxs(tEe,{href:p.to,active:u(p.to,p.matchPrefix),render:f.jsx(Nn,{to:p.to}),onClick:()=>l(""),children:[f.jsx(J,{icon:p.icon,size:16,strokeWidth:2}),n(p.labelKey)]},p.to))})]})})}),f.jsx("nav",{className:"hidden items-center gap-1 sm:flex",children:RH.map(p=>{const d=u(p.to,p.matchPrefix);return f.jsxs(Nn,{to:p.to,className:Be("relative flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium transition-colors",d?"bg-background text-foreground":"text-foreground/60 hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",d?"after:opacity-100":"after:opacity-0"),children:[f.jsx(J,{icon:p.icon,size:16,strokeWidth:2,"data-slot":"icon"}),f.jsx("span",{children:n(p.labelKey)})]},p.to)})})]}),f.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[f.jsx(N3,{open:a,onOpenChange:s}),f.jsx(Ae,{variant:"ghost",size:"icon-sm",onClick:t,title:n("header.commandPalette",{shortcut:"⌘K"}),className:"hidden sm:inline-flex",children:f.jsx(J,{icon:OE,size:16,strokeWidth:2})}),f.jsx("a",{href:"https://www.vibora.dev/guide/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center rounded-md p-1.5 text-foreground/60 transition-colors hover:text-foreground",title:n("header.help"),children:f.jsx(J,{icon:Dne,size:16,strokeWidth:2})}),f.jsx(Nn,{to:"/settings",className:Be("relative flex items-center justify-center rounded-md p-1.5 transition-colors",i==="/settings"?"bg-background text-foreground":"text-foreground/60 hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",i==="/settings"?"after:opacity-100":"after:opacity-0"),children:f.jsx(J,{icon:jne,size:16,strokeWidth:2})})]})]})}function NTe(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const ITe=10,DTe=2e3;function LTe(){const e=vn(),t=Vr(),n=T.useRef(null),r=T.useRef(void 0),i=T.useRef(0),a=T.useRef(void 0),s=T.useCallback(l=>{try{const u=JSON.parse(l.data);if(u.type==="task:updated")e.invalidateQueries({queryKey:["tasks"]});else if(u.type==="notification"&&"payload"in u){let p=function(){const D=v&&!_?"/goat.jpeg":"/logo.png";if(b!==!1){const z={description:g,icon:f.jsx("img",{src:D,alt:"",className:"size-8 shrink-0 aspect-square rounded-sm object-cover"}),...S&&{action:{label:"View",onClick:()=>t({to:"/tasks/$taskId",params:{taskId:S}})}}};switch(x){case"success":St.success(m,z);break;case"error":St.error(m,z);break;case"warning":St.warning(m,z);break;default:St.info(m,z);break}}if(y!==!1&&"Notification"in window&&window.parent===window&&Notification.permission==="granted"&&new Notification(m,{body:g,icon:D,tag:d}),v){const P="vibora:lastSoundPlayed",V=Date.now(),H=localStorage.getItem(P);if(H){const G=parseInt(H.split(":")[0]);if(V-G<1e3)return}const j=`${V}:${Math.random().toString(36).slice(2)}`;localStorage.setItem(P,j),setTimeout(()=>{if(localStorage.getItem(P)!==j)return;let G=!1;const q=()=>{if(G)return;G=!0,new Audio("/sounds/goat-bleat.mp3").play().catch(()=>{})},B=new Audio("/api/uploads/sound");B.onerror=q,B.play().catch(q)},50)}window.parent!==window&&window.parent.postMessage({type:"vibora:notification",title:m,message:g,notificationType:x},"*")};const{id:d,title:m,message:g,notificationType:x,taskId:S,showToast:b,showDesktop:y,playSound:v,isCustomSound:_}=u.payload,C=`vibora:notification:${d}`,w=50,A=1e4;if(localStorage.getItem(C))return;const O=`${Date.now()}:${Math.random().toString(36).slice(2)}`;localStorage.setItem(C,O),setTimeout(()=>{localStorage.getItem(C)===O&&(setTimeout(()=>localStorage.removeItem(C),A),p())},w)}}catch{}},[e,t]),o=T.useCallback(()=>{const l=n.current;if(l&&(l.readyState===WebSocket.CONNECTING||l.readyState===WebSocket.OPEN))return;const u=NTe(),p=new WebSocket(u);n.current=p,p.onopen=()=>{i.current=0},p.onmessage=s,p.onclose=()=>{n.current===p&&(n.current=null),i.current<ITe&&(i.current++,r.current=setTimeout(()=>{a.current?.()},DTe))},p.onerror=()=>{}},[s]);a.current=o,T.useEffect(()=>{"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[]),T.useEffect(()=>(o(),()=>{r.current&&clearTimeout(r.current);const l=n.current;l&&(l.readyState===WebSocket.OPEN&&l.close(),n.current=null)}),[o])}const PTe={save:"Save Changes",cancel:"Cancel",delete:"Delete",create:"Create",reset:"Reset to default",browse:"Browse",clearFilters:"Clear filters"},MTe={loading:"Loading...",saving:"Saving...",saved:"Saved",error:"Error",calculating:"calculating...",validating:"Validating...",creating:"Creating...",deleting:"Deleting...",loggingIn:"Logging in...",uploading:"Uploading..."},jTe={justNow:"just now",minuteAgo:"1 minute ago",minutesAgo:"{{count}} minutes ago",hourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",dayAgo:"1 day ago",daysAgo:"{{count}} days ago"},FTe={one:"{{count}} result",other:"{{count}} results"},BTe={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},UTe={loginTitle:"Login to Vibora",username:"Username",password:"Password",login:"Login",loginFailed:"Login failed"},$Te={sentToClaude:"Sent to Claude Code",noTerminal:"No terminal available",syncedFromMain:"Synced from main",mergedToMain:"Merged to main",pushedToOrigin:"Pushed to origin",parentSynced:"Parent synced with origin",prCreated:"PR created",prExists:"PR already exists"},zTe={imageUploadFailed:"Failed to upload image",terminalNotConnected:"Terminal not connected",terminalNotConnectedDesc:"Please wait for the connection to establish"},HTe={notInstalled:"OpenCode not installed",selectModel:"Select model",useDefault:"Use default",noModelsFound:"No models found"},WTe={manualDnsRequired:"Manual DNS required",manualDnsRequiredDesc:"Cloudflare API token not configured. You must create DNS records manually for your domains.",deployToApply:"Deploy to apply changes",deployToApplyDesc:"Domain configuration saved. Deploy the app for changes to take effect.",unknownRepo:"Unknown repo",service:"service",services:"services",exposed:"exposed",lastDeployed:"Last deployed",stop:"Stop",deploy:"Deploy",deploying:"Deploying...",building:"Building...",cancelDeploy:"Cancel",cancelling:"Cancelling...",delete:"Delete",deleting:"Deleting...",searchApps:"Search apps...",allRepos:"All repos",newApp:"New App",createApp:"Create App",noAppsYet:"No apps yet. Create your first app to get started!",noAppsMatch:"No apps match your search.",failedToLoadApps:"Failed to load apps",deleteApp:"Delete App",deleteAppConfirm:'Are you sure you want to delete "{{name}}"? This will stop all containers and remove the app configuration. This action cannot be undone.',cancel:"Cancel",appNotFound:"App not found",backToApps:"Back to Apps",tabs:{general:"General",deployments:"Deployments",logs:"Logs",environment:"Environment",domains:"Domains",monitoring:"Monitoring"},general:{deploy:"Deploy",autodeploy:"Autodeploy",noCache:"No-cache",notifications:"Notifications",services:"Services",noServicesConfigured:"No services configured"},compose:{title:"Compose File",repoNotFound:"Repository path not found",unsaved:"Unsaved",edit:"Edit",done:"Done"},logs:{title:"Logs",description:"Watch the logs of the application in real time",allContainers:"All containers",lines:"lines",copy:"Copy",copied:"Copied",download:"Download",refresh:"Refresh",noLogs:"No logs available"},deployments:{title:"Deployments",description:"See the last 10 deployments for this compose",noDeployments:"No deployments yet",view:"View",statusDone:"Done",statusError:"Error",statusBuilding:"Building",deployment:"Deployment",seeDetails:"See all the details of this deployment",noBuildLogs:"No build logs available"},environment:{title:"Environment Variables",description:"Set environment variables for Docker Compose builds. These will be available during the build and in your containers.",placeholder:`DATABASE_URL=postgres://...
26
26
  API_KEY=your-api-key
27
- # Comments are supported`,save:"Save Environment",showValues:"Show values",hideValues:"Hide values",unsavedChanges:"You have unsaved changes"},domains:{title:"Domain Configuration",description:"Configure which services are exposed and their domain mappings",expose:"Expose",exposeRequiresPort:"No port configured. Add a port mapping to your compose file.",domain:"Domain",noDomain:"No domain configured",portRequired:"Port required",editDomain:"Edit domain",noServices:"No services configured. Deploy the app first to see available services.",save:"Save"},streaming:{pulling:"Pulling code...",building:"Building containers...",starting:"Starting services...",configuring:"Configuring routing...",done:"Deployment complete!",failed:"Deployment failed",cancelled:"Deployment cancelled",preparing:"Preparing...",waitingForLogs:"Waiting for logs..."},dnsConfigRequired:"DNS configuration required",settings:"Settings",status:{running:"Running",building:"Building",failed:"Failed",stopped:"Stopped"},monitoring:{title:"Resource Usage",description:"Real-time CPU and memory usage for each service",cpu:"CPU",memory:"Memory",noContainers:"No running containers found",dockerUnavailable:"Docker stats not available",serviceTotal:"Service Total"}},VTe={buttons:PTe,status:MTe,time:jTe,results:FTe,statuses:BTe,auth:UTe,git:$Te,errors:zTe,opencode:HTe,apps:WTe},qTe={tasks:"Tasks",terminals:"Terminals",worktrees:"Worktrees",repositories:"Repositories",apps:"Apps",jobs:"Jobs",review:"Review",monitoring:"Monitoring",settings:"Settings",commandPalette:"Command Palette ({{shortcut}})",help:"Documentation"},GTe={placeholder:"Type a command or search...",noResults:"No commands found.",categories:{navigation:"Navigation",actions:"Actions"},commands:{goToTasks:"Go to Tasks",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToJobs:"Go to Jobs",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",newTask:"New Task",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts"}},KTe={title:"Keyboard Shortcuts",groups:{navigation:"Navigation",actions:"Actions",terminals:"Terminals (Desktop)",general:"General"},labels:{goToTasks:"Go to Tasks",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToJobs:"Go to Jobs",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",commandPalette:"Command Palette",newTask:"New Task",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts",closeModal:"Close Modal",newTerminal:"New Terminal",closeTerminal:"Close Terminal",submitForm:"Submit Form"}},YTe={title:"Open in Editor",description:"Open a folder in {{editor}}",pathLabel:"Path",pathPlaceholder:"~/projects/my-project",pathHint:"Supports ~ for home directory",browse:"Browse",cancel:"Cancel",open:"Open"},XTe={header:qTe,commandPalette:GTe,shortcuts:KTe,openInEditor:YTe},ZTe="Tasks",QTe="Search",JTe="All Repos",eAe="New Task",tAe={title:"Create New Task",description:"Create a new task with a git worktree for isolated development.",fields:{title:"Title",titlePlaceholder:"Add user authentication",description:"Description",descriptionPlaceholder:"Implement OAuth2 login flow...",aiMode:"AI Mode",agent:"AI Agent",opencodeModel:"OpenCode Model",opencodeModelPlaceholder:"Select model",repository:"Repository",baseBranch:"Base Branch",branchName:"Branch Name",branchPlaceholder:"auto-generated-from-title"},aiModes:{plan:"Plan",default:"Default"},tabs:{saved:"Repos",browse:"Browse"},worktreePrefix:"Worktree:",branchAutoGenerated:'Will use "{{branch}}" if left empty.',selectFolder:"Select folder...",searchRepositories:"Search repositories...",noRepositoriesFound:"No repositories found",selectRepositoryFirst:"Select repository first",loadingBranches:"Loading branches...",selectBranch:"Select branch",current:"(current)",createTask:"Create Task",errors:{notGitRepo:"Selected folder is not a git repository",validationFailed:"Failed to validate repository",createFailed:"Failed to create task"}},nAe={title:ZTe,searchPlaceholder:QTe,allRepos:JTe,newTask:eAe,createModal:tAe},rAe="Settings",iAe={server:"Server",serverDefaults:"Server & Defaults",paths:"Paths",editor:"Editor",integrations:"Integrations",zai:"z.ai",agent:"Agent",notifications:"Notifications",appearance:"Appearance",developer:"Developer"},aAe={port:{label:"Port",description:"Requires restart"},startupCommand:{label:"Startup Command",description:"Command for new task terminals"},gitReposDir:{label:"Git Repos Directory",description:"Starting directory for repo picker"},editor:{app:{label:"Editor",description:"Code editor for opening worktrees",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"Remote Host",description:"For SSH URLs when code is on a remote machine",placeholder:"e.g., my-server.tailnet.ts.net"},sshPort:{label:"SSH Port",description:"Remote SSH port (default 22)"}},linear:{label:"Linear",description:"API key for ticket sync"},github:{label:"GitHub",description:"PAT for Issues & PRs"},cloudflare:{label:"Cloudflare",placeholder:"Enter API token...",description:"API token for automatic DNS records"},zai:{enable:"Enable",apiKey:"API Key",description:"Configures Claude Code to use z.ai proxy",modelMappings:"Model Mappings",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},agent:{default:{label:"Default Agent",description:"The AI coding agent to use for new tasks"},opencodeModel:{label:"OpenCode Model",placeholder:"Select model",description:"Default model used when launching OpenCode tasks"}},language:{label:"Language",description:"Interface language",options:{auto:"Auto-detect",en:"English",zh:"Chinese (Simplified)"}},theme:{label:"Theme",description:"Color theme for the interface",options:{system:"System",light:"Light",dark:"Dark"}},syncClaudeTheme:{label:"Sync Claude Code",description:"Automatically update Claude Code's theme when Vibora switches between light and dark mode"},claudeCodeTheme:{light:"Light mode",dark:"Dark mode",options:{light:"Light","light-ansi":"Light ANSI","light-daltonized":"Light (colorblind)",dark:"Dark","dark-ansi":"Dark ANSI","dark-daltonized":"Dark (colorblind)"}}},sAe={enable:"Enable Notifications",toast:"In-app Toast",toastDescription:"Show toast notifications in the Vibora interface",desktop:"Desktop Notifications",desktopDescription:"Show native desktop or browser notifications",sound:"Sound",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"App Token",userKey:"User Key",testSuccess:"{{channel}} test successful",testFailed:"{{channel}} test failed: {{error}}",uploadSound:"Upload custom sound",deleteSound:"Remove custom sound",testSound:"Test sound",soundUploaded:"Custom sound uploaded",soundUploadFailed:"Failed to upload sound: {{error}}",soundDeleted:"Custom sound removed",soundDeleteFailed:"Failed to remove custom sound",customSoundActive:"Custom sound active"},oAe={restartButton:"Restart Vibora",restarting:"Restarting...",restartDescription:"Rebuild and restart the Vibora server. If the build fails, the server will continue running.",restartFailed:"Restart failed",checkLogs:"Build may have failed. Check journalctl --user -u vibora for details."},lAe={title:"Unsaved Changes",description:"You have unsaved changes that will be lost if you leave this page.",stay:"Stay",leave:"Leave"},uAe={title:rAe,sections:iAe,fields:aAe,notifications:sAe,developer:oAe,unsavedChanges:lAe},cAe="Review",dAe={pullRequests:"Pull Requests",issues:"Issues"},fAe={pr:{created:"Created by me",assigned:"Assigned to me",reviewRequested:"Review requests",mentioned:"Mentioned"},issue:{assigned:"Assigned to me",created:"Created by me",mentioned:"Mentioned"},allOrgs:"All Orgs",allOrganizations:"All Organizations",viboraReposOnly:"Vibora repos only"},pAe={tokenRequired:"GitHub Token Required",tokenDescription:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings.",requiredScopes:"Required scopes:",scopes:{repo:"(for private repositories)",readUser:"(for user info)",readOrg:"(for organization list)"},generateToken:"Generate Token",goToSettings:"Go to Settings"},hAe={loading:"Loading...",failedToLoad:"Failed to load pull requests",empty:{all:"No open pull requests",created:"No pull requests created by you",assigned:"No pull requests assigned to you",reviewRequested:"No pull requests awaiting your review",mentioned:"No pull requests mentioning you"},draft:"Draft"},mAe={loading:"Loading...",failedToLoad:"Failed to load issues",empty:{assigned:"No issues assigned to you",created:"No issues created by you",mentioned:"No issues mentioning you"}},gAe={title:cAe,tabs:dAe,filters:fAe,github:pAe,prs:hAe,issues:mAe},bAe="Worktrees",vAe={total:"{{count}} total",orphaned:"{{count}} orphaned"},yAe={button:"Clean up ({{count}})",title:"Delete Completed Worktrees",description:"This will permanently delete {{count}} worktree(s).",linkedTasksWillBeDeleted:"Their linked tasks will also be deleted.",alsoDeleteLinkedTasks:"Also delete linked tasks",done:"Done",canceled:"Canceled",cannotUndo:"This action cannot be undone."},xAe={noMatch:"No worktrees match the selected filters.",noWorktrees:"No worktrees found. Worktrees are created when you create tasks."},SAe={failedToLoad:"Failed to load worktrees: {{message}}"},EAe={title:bAe,summary:vAe,cleanup:yAe,delete:{title:"Delete Worktree",description:"This will permanently delete the worktree directory at",linkedTaskWillBeDeleted:'The linked task "{{title}}" will also be deleted.',alsoDeleteLinkedTask:'Also delete linked task "{{title}}"',cannotUndo:"This action cannot be undone.",button:"Delete {{count}}"},empty:xAe,error:SAe},_Ae="Monitoring",wAe={claude:"AI Agents",system:"System Metrics",processes:"Processes",vibora:"Vibora Servers",worktrees:"Worktrees",jobs:"Jobs",usage:"Usage Limits"},CAe={showAllInstances:"Show all instances",instanceCount:"{{count}} instance(s) running",totalRam:"{{ram}} MB total",headers:{agent:"Agent",terminal:"Terminal",task:"Task",ram:"RAM",actions:"Actions",pid:"PID",workingDirectory:"Working Dir",source:"Source"},noTask:"(no task)",kill:"Kill",killing:"Killing...",killSelected:"Kill {{count}} selected",source:{vibora:"Vibora: {{name}}",external:"External"},empty:"No AI agent instances running",emptyVibora:" in Vibora terminals",error:"Failed to load AI agent instances: {{message}}"},TAe={cpuUsage:"CPU Usage",memoryUsage:"Memory Usage",memoryLabels:{used:"Used",cache:"Cache / Buffers"},diskUsage:"Disk Usage ({{path}})",error:"Failed to load system metrics: {{message}}",timeWindows:{"1m":"1 min","10m":"10 min","1h":"1 hour","3h":"3 hours","6h":"6 hours","12h":"12 hours","24h":"24 hours"}},AAe={topProcesses:"Top Processes",sortBy:{memory:"By Memory",cpu:"By CPU"},headers:{pid:"PID",name:"Name",command:"Command",memory:"Memory"},empty:"No processes found",error:"Failed to load processes: {{message}}",containers:"Containers",containersEmpty:"No containers running",containersUnavailable:"Docker/Podman not available"},kAe={description:"Running Vibora dev servers",instanceCount:"{{count}} instance(s) running",headers:{port:"Port",mode:"Mode",directory:"Directory",ram:"RAM",actions:"Actions"},mode:{dev:"Dev",prod:"Prod"},vite:"Vite",kill:"Kill",killing:"Killing...",empty:"No Vibora instances running",error:"Failed to load Vibora instances: {{message}}"},OAe={fiveHourBlock:"5-Hour Block",sevenDayRolling:"7-Day Rolling",opusWeekly:"Opus Weekly",sonnetWeekly:"Sonnet Weekly",resetsIn:"Resets in {{time}}",resetsAt:"Resets {{time}}",weekProgress:"{{percent}}% through week",unavailable:"Claude Code usage data not available. Make sure you're logged in to Claude Code.",error:"Failed to load usage data: {{message}}"},RAe={title:_Ae,tabs:wAe,claude:CAe,system:TAe,processes:AAe,vibora:kAe,usage:OAe},NAe="Tasks",IAe="New Terminal",DAe="All Repos",LAe={title:"Edit Tab",name:"Name",namePlaceholder:"Tab name",directory:"Directory",directoryPlaceholder:"Select a directory...",clearDirectory:"Clear directory",cancel:"Cancel",save:"Save"},PAe={title:"New Tab",create:"Create"},MAe={taskTerminals:NAe,newTerminal:IAe,allRepos:DAe,editTab:LAe,newTab:PAe},jAe="Repositories",FAe="{{count}} total",BAe="Search repositories...",UAe="New Task",$Ae="Tasks",zAe="Terminal",HAe="Editor",WAe="Application",VAe="Applications",qAe="Create App",GAe={title:"Docker Compose Required",description:"To create an app for deployment, this repository needs a Docker Compose file.",instructions:"Create a docker-compose.yml file in your repository.",close:"Got it"},KAe="Settings",YAe="Add Repository",XAe="Scan Directory",ZAe="Open in Terminal",QAe="Open in {{editor}}",JAe={openInVSCode:"Open in VS Code"},eke={title:"Add Repository",description:"Add a git repository from a URL or local path, or scan a directory.",tabs:{add:"Add",scan:"Scan",template:"From Template"},inputLabel:"Repository URL or path",inputPlaceholder:"https://github.com/user/repo or /local/path",browse:"Browse...",cloneOptions:"Clone Options",targetDirectory:"Clone to directory",folderName:"Folder name",willCloneTo:"Will clone to",cloning:"Cloning repository...",adding:"Adding...",cloneFailed:"Failed to clone repository",createFailed:"Failed to add repository",cancel:"Cancel",add:"Add",retry:"Retry",fields:{path:"Repository Path",pathPlaceholder:"Select repository...",displayName:"Display Name",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects."}},tke={button:"New Project",title:"Create New Project",back:"Back",next:"Next",create:"Create Project",steps:{template:{description:"Select a template to create your project from.",sectionTitle:"Copier Template",sectionDescription:"Select a saved template or enter a URL/path.",learnMore:"Learn more",savedTemplates:"Saved Templates",selectTemplate:"Select a template...",or:"or",customUrl:"Custom Template URL/Path"},questions:{title:"Template Questions",description:"Configure your project.",noQuestions:"This template has no configuration questions."},output:{title:"Output Location",description:"Choose where to create your project.",projectName:"Project Name",outputDirectory:"Output Directory",selectDirectory:"Select directory...",willCreate:"Will create",trust:"Trust template"},creating:{description:"Creating your project...",inProgress:"Running Copier..."}}},nke={title:"Scan Directory for Repositories",description:"Find and add multiple git repositories from a directory.",directoryLabel:"Directory to scan",directoryPlaceholder:"Enter directory path",browse:"Browse...",scan:"Scan",foundRepos:"Found {{count}} repositories",selectAll:"Select all",selectNone:"Select none",noReposFound:"No git repositories found in this directory.",alreadyAdded:"Already added",adding:"Adding repositories...",scanFailed:"Failed to scan directory",addFailed:"Failed to add repositories",cancel:"Cancel",addSelected:"Add {{count}} selected"},rke={noRepositories:"No repositories added yet. Add a repository for quick access when creating tasks.",noMatches:"No repositories match your search."},ike={failedToLoad:"Failed to load repositories: {{message}}"},ake={breadcrumb:"Repositories",notFound:"Repository not found",save:"Save",saving:"Saving...",saved:"Repository saved",failedToSave:"Failed to save repository",tabs:{settings:"Settings",workspace:"Workspace"},mobileWorkspace:{terminal:"Terminal",files:"Files"},settings:{generalTitle:"General",agentTitle:"Agent Options",displayName:"Display Name",defaultAgent:"Default Agent",defaultAgentInherit:"Use global default",defaultAgentDescription:"Override the global default agent for tasks created from this repository.",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",claudeOptions:"Claude Code Options",claudeOptionsDescription:"CLI flags passed to Claude Code when starting a task.",opencodeOptions:"OpenCode Options",opencodeOptionsDescription:"CLI flags passed to OpenCode when starting a task.",opencodeModel:"OpenCode Model",opencodeModelPlaceholder:"Select model",opencodeModelDescription:"Default OpenCode model for tasks created from this repository.",agentOptionsFlag:"Flag",agentOptionsValue:"Value",addAgentOption:"Add option",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects with Copier."},workspace:{connectingToTerminal:"Connecting to terminal server...",initializingTerminal:"Initializing terminal..."}},ske={title:jAe,total:FAe,searchPlaceholder:BAe,newTask:UAe,viewTasks:$Ae,terminal:zAe,editor:HAe,application:WAe,applications:VAe,createApp:qAe,createAppDialog:GAe,settings:KAe,addRepository:YAe,scanDirectory:XAe,openInTerminal:ZAe,openInEditor:QAe,card:JAe,delete:{title:"Delete Repository",description:'This will remove "{{name}}" from Vibora. The actual repository files will not be affected.',button:"Delete",deleting:"Deleting...",alsoDeleteDirectory:"Also delete the directory from disk",deleteDirectoryWarning:"This will permanently delete all files in the repository. This action cannot be undone."},addModal:eke,newProject:tke,bulkAdd:nke,empty:rke,error:ike,detailView:ake},oke="Jobs",lke="Manage scheduled tasks with systemd timers",uke="Search jobs...",cke="No scheduled jobs found",dke="No jobs match your search",fke="Create Job",pke={all:"All",user:"User",system:"System"},hke={active:"Active",inactive:"Inactive",failed:"Failed",waiting:"Waiting",disabled:"Disabled"},mke="Next",gke="Last",bke="System timers are read-only",vke={enable:"Enable",disable:"Disable",start:"Start",stop:"Stop",runNow:"Run Now",edit:"Edit",delete:"Delete",viewLogs:"View Logs"},yke={tabs:{general:"General",logs:"Logs",edit:"Edit"},schedule:"Schedule",nextRun:"Next Run",lastRun:"Last Run",lastResult:"Last Result",description:"Description",command:"Command",workingDir:"Working Directory",systemTimer:"System timer (read-only)",timerFile:"Timer File",serviceFile:"Service File",executionStats:"Last Execution",duration:"Duration",cpuTime:"CPU Time",noStats:"No execution data available"},xke={title:"Create Scheduled Job",name:"Job Name",namePlaceholder:"backup-daily",nameHelp:"Alphanumeric, hyphens, and underscores only",description:"Description",descriptionPlaceholder:"Daily backup of important files",schedule:"Schedule",scheduleHelp:"OnCalendar expression (e.g., *-*-* 02:00:00, daily, weekly)",command:"Command",commandPlaceholder:"/home/user/scripts/backup.sh",workingDir:"Working Directory",workingDirPlaceholder:"/home/user",persistent:"Persistent",persistentHelp:"Run missed executions when system starts",cancel:"Cancel",create:"Create Job"},Ske={title:"Job Logs",noLogs:"No logs available",lines:"lines",refresh:"Refresh"},Eke={loadFailed:"Failed to load jobs",createFailed:"Failed to create job",updateFailed:"Failed to update job",deleteFailed:"Failed to delete job"},NH={title:oke,description:lke,searchPlaceholder:uke,noJobs:cke,noJobsMatch:dke,createJob:fke,scope:pke,status:hke,nextRun:mke,lastRun:gke,systemTimerReadonly:bke,actions:vke,detail:yke,create:xke,delete:{title:"Delete Job",confirm:'Are you sure you want to delete "{{name}}"? This will remove both the timer and service files.',cancel:"Cancel",delete:"Delete"},logs:Ske,errors:Eke},_ke={save:"保存更改",cancel:"取消",delete:"删除",create:"创建",reset:"重置为默认值",browse:"浏览",clearFilters:"清除筛选"},wke={loading:"加载中...",saving:"保存中...",saved:"已保存",error:"错误",calculating:"计算中...",validating:"验证中...",creating:"创建中...",deleting:"删除中...",loggingIn:"登录中...",uploading:"上传中..."},Cke={justNow:"刚刚",minuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",hourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",dayAgo:"1 天前",daysAgo:"{{count}} 天前"},Tke={one:"{{count}} 个结果",other:"{{count}} 个结果"},Ake={IN_PROGRESS:"进行中",IN_REVIEW:"审核中",DONE:"已完成",CANCELED:"已取消",ORPHANED:"孤立"},kke={loginTitle:"登录 Vibora",username:"用户名",password:"密码",login:"登录",loginFailed:"登录失败"},Oke={sentToClaude:"已发送到 Claude Code",noTerminal:"没有可用的终端",syncedFromMain:"已从 main 同步",mergedToMain:"已合并到 main",pushedToOrigin:"已推送到 origin",parentSynced:"父仓库已与 origin 同步",prCreated:"PR 已创建",prExists:"PR 已存在"},Rke={imageUploadFailed:"图片上传失败",terminalNotConnected:"终端未连接",terminalNotConnectedDesc:"请等待连接建立"},Nke={notInstalled:"OpenCode 未安装",selectModel:"选择模型",useDefault:"使用默认",noModelsFound:"未找到模型"},Ike={manualDnsRequired:"需要手动配置 DNS",manualDnsRequiredDesc:"未配置 Cloudflare API 令牌。您需要手动为域名创建 DNS 记录。",deployToApply:"部署以应用更改",deployToApplyDesc:"域名配置已保存。部署应用程序以使更改生效。",unknownRepo:"未知仓库",service:"服务",services:"服务",exposed:"已暴露",lastDeployed:"上次部署",stop:"停止",deploy:"部署",deploying:"部署中...",building:"构建中...",cancelDeploy:"取消",cancelling:"取消中...",delete:"删除",deleting:"删除中...",searchApps:"搜索应用...",allRepos:"所有仓库",newApp:"新建应用",createApp:"创建应用",noAppsYet:"暂无应用。创建您的第一个应用开始使用!",noAppsMatch:"没有匹配的应用。",failedToLoadApps:"加载应用失败",deleteApp:"删除应用",deleteAppConfirm:'确定要删除 "{{name}}" 吗?这将停止所有容器并删除应用配置。此操作无法撤销。',cancel:"取消",appNotFound:"应用未找到",backToApps:"返回应用列表",tabs:{general:"概览",deployments:"部署记录",logs:"日志",environment:"环境变量",domains:"域名"},general:{deploy:"部署",autodeploy:"自动部署",noCache:"无缓存",notifications:"通知",services:"服务",noServicesConfigured:"未配置服务"},compose:{title:"Compose 文件",repoNotFound:"未找到仓库路径",unsaved:"未保存",edit:"编辑",done:"完成"},logs:{title:"日志",description:"实时查看应用程序日志",allContainers:"所有容器",lines:"行",copy:"复制",copied:"已复制",download:"下载",refresh:"刷新",noLogs:"暂无日志"},deployments:{title:"部署记录",description:"查看此 Compose 的最近 10 次部署",noDeployments:"暂无部署记录",view:"查看",statusDone:"完成",statusError:"错误",statusBuilding:"构建中",deployment:"部署",seeDetails:"查看此部署的详细信息",noBuildLogs:"暂无构建日志"},environment:{title:"环境变量",description:"设置 Docker Compose 构建的环境变量。这些变量在构建期间和容器中都可用。",placeholder:`DATABASE_URL=postgres://...
27
+ # Comments are supported`,save:"Save Environment",showValues:"Show values",hideValues:"Hide values",unsavedChanges:"You have unsaved changes"},domains:{title:"Domain Configuration",description:"Configure which services are exposed and their domain mappings",expose:"Expose",exposeRequiresPort:"No port configured. Add a port mapping to your compose file.",domain:"Domain",noDomain:"No domain configured",portRequired:"Port required",editDomain:"Edit domain",noServices:"No services configured. Deploy the app first to see available services.",save:"Save"},streaming:{pulling:"Pulling code...",building:"Building containers...",starting:"Starting services...",configuring:"Configuring routing...",done:"Deployment complete!",failed:"Deployment failed",cancelled:"Deployment cancelled",preparing:"Preparing...",waitingForLogs:"Waiting for logs..."},dnsConfigRequired:"DNS configuration required",settings:"Settings",status:{running:"Running",building:"Building",failed:"Failed",stopped:"Stopped"},monitoring:{title:"Resource Usage",description:"Real-time CPU and memory usage for each service",cpu:"CPU",memory:"Memory",noContainers:"No running containers found",dockerUnavailable:"Docker stats not available",serviceTotal:"Service Total"}},VTe={buttons:PTe,status:MTe,time:jTe,results:FTe,statuses:BTe,auth:UTe,git:$Te,errors:zTe,opencode:HTe,apps:WTe},qTe={tasks:"Tasks",terminals:"Terminals",worktrees:"Worktrees",repositories:"Repositories",apps:"Apps",jobs:"Jobs",review:"Review",monitoring:"Monitoring",settings:"Settings",commandPalette:"Command Palette ({{shortcut}})",help:"Documentation"},GTe={placeholder:"Type a command or search...",noResults:"No commands found.",categories:{navigation:"Navigation",actions:"Actions"},commands:{goToTasks:"Go to Tasks",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToJobs:"Go to Jobs",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",newTask:"New Task",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts"}},KTe={title:"Keyboard Shortcuts",groups:{navigation:"Navigation",actions:"Actions",terminals:"Terminals (Desktop)",general:"General"},labels:{goToTasks:"Go to Tasks",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToJobs:"Go to Jobs",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",commandPalette:"Command Palette",newTask:"New Task",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts",closeModal:"Close Modal",newTerminal:"New Terminal",closeTerminal:"Close Terminal",submitForm:"Submit Form"}},YTe={title:"Open in Editor",description:"Open a folder in {{editor}}",pathLabel:"Path",pathPlaceholder:"~/projects/my-project",pathHint:"Supports ~ for home directory",browse:"Browse",cancel:"Cancel",open:"Open"},XTe={header:qTe,commandPalette:GTe,shortcuts:KTe,openInEditor:YTe},ZTe="Tasks",QTe="Search",JTe="All Repos",eAe="New Task",tAe={title:"Create New Task",description:"Create a new task with a git worktree for isolated development.",fields:{title:"Title",titlePlaceholder:"Add user authentication",description:"Description",descriptionPlaceholder:"Implement OAuth2 login flow...",aiMode:"AI Mode",agent:"AI Agent",opencodeModel:"OpenCode Model",opencodeModelPlaceholder:"Select model",repository:"Repository",baseBranch:"Base Branch",branchName:"Branch Name",branchPlaceholder:"auto-generated-from-title"},aiModes:{plan:"Plan",default:"Default"},tabs:{saved:"Repos",browse:"Browse"},worktreePrefix:"Worktree:",branchAutoGenerated:'Will use "{{branch}}" if left empty.',selectFolder:"Select folder...",searchRepositories:"Search repositories...",noRepositoriesFound:"No repositories found",selectRepositoryFirst:"Select repository first",loadingBranches:"Loading branches...",selectBranch:"Select branch",current:"(current)",createTask:"Create Task",errors:{notGitRepo:"Selected folder is not a git repository",validationFailed:"Failed to validate repository",createFailed:"Failed to create task"}},nAe={title:ZTe,searchPlaceholder:QTe,allRepos:JTe,newTask:eAe,createModal:tAe},rAe="Settings",iAe={server:"Server",serverDefaults:"Server & Defaults",paths:"Paths",editor:"Editor",integrations:"Integrations",zai:"z.ai",agent:"Agent",notifications:"Notifications",appearance:"Appearance",developer:"Developer"},aAe={port:{label:"Port",description:"Requires restart"},startupCommand:{label:"Startup Command",description:"Command for new task terminals"},gitReposDir:{label:"Git Repos Directory",description:"Starting directory for repo picker"},editor:{app:{label:"Editor",description:"Code editor for opening worktrees",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"Remote Host",description:"For SSH URLs when code is on a remote machine",placeholder:"e.g., my-server.tailnet.ts.net"},sshPort:{label:"SSH Port",description:"Remote SSH port (default 22)"}},linear:{label:"Linear",description:"API key for ticket sync"},github:{label:"GitHub",description:"PAT for Issues & PRs"},cloudflare:{label:"Cloudflare",placeholder:"Enter API token...",description:"API token for automatic DNS records"},zai:{enable:"Enable",apiKey:"API Key",description:"Configures Claude Code to use z.ai proxy",modelMappings:"Model Mappings",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},agent:{default:{label:"Default Agent",description:"The AI coding agent to use for new tasks"},opencodeModel:{label:"OpenCode Model",placeholder:"Select model",description:"Default model used when launching OpenCode tasks"}},language:{label:"Language",description:"Interface language",options:{auto:"Auto-detect",en:"English",zh:"Chinese (Simplified)"}},theme:{label:"Theme",description:"Color theme for the interface",options:{system:"System",light:"Light",dark:"Dark"}},syncClaudeTheme:{label:"Sync Claude Code",description:"Automatically update Claude Code's theme when Vibora switches between light and dark mode"},claudeCodeTheme:{light:"Light mode",dark:"Dark mode",options:{light:"Light","light-ansi":"Light ANSI","light-daltonized":"Light (colorblind)",dark:"Dark","dark-ansi":"Dark ANSI","dark-daltonized":"Dark (colorblind)"}}},sAe={enable:"Enable Notifications",toast:"In-app Toast",toastDescription:"Show toast notifications in the Vibora interface",desktop:"Desktop Notifications",desktopDescription:"Show native desktop or browser notifications",sound:"Sound",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"App Token",userKey:"User Key",testSuccess:"{{channel}} test successful",testFailed:"{{channel}} test failed: {{error}}",uploadSound:"Upload custom sound",deleteSound:"Remove custom sound",testSound:"Test sound",soundUploaded:"Custom sound uploaded",soundUploadFailed:"Failed to upload sound: {{error}}",soundDeleted:"Custom sound removed",soundDeleteFailed:"Failed to remove custom sound",customSoundActive:"Custom sound active"},oAe={restartButton:"Restart Vibora",restarting:"Restarting...",restartDescription:"Rebuild and restart the Vibora server. If the build fails, the server will continue running.",restartFailed:"Restart failed",checkLogs:"Build may have failed. Check journalctl --user -u vibora for details."},lAe={title:"Unsaved Changes",description:"You have unsaved changes that will be lost if you leave this page.",stay:"Stay",leave:"Leave"},uAe={title:rAe,sections:iAe,fields:aAe,notifications:sAe,developer:oAe,unsavedChanges:lAe},cAe="Review",dAe={pullRequests:"Pull Requests",issues:"Issues"},fAe={pr:{created:"Created by me",assigned:"Assigned to me",reviewRequested:"Review requests",mentioned:"Mentioned"},issue:{assigned:"Assigned to me",created:"Created by me",mentioned:"Mentioned"},allOrgs:"All Orgs",allOrganizations:"All Organizations",viboraReposOnly:"Vibora repos only"},pAe={tokenRequired:"GitHub Token Required",tokenDescription:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings.",requiredScopes:"Required scopes:",scopes:{repo:"(for private repositories)",readUser:"(for user info)",readOrg:"(for organization list)"},generateToken:"Generate Token",goToSettings:"Go to Settings"},hAe={loading:"Loading...",failedToLoad:"Failed to load pull requests",empty:{all:"No open pull requests",created:"No pull requests created by you",assigned:"No pull requests assigned to you",reviewRequested:"No pull requests awaiting your review",mentioned:"No pull requests mentioning you"},draft:"Draft"},mAe={loading:"Loading...",failedToLoad:"Failed to load issues",empty:{assigned:"No issues assigned to you",created:"No issues created by you",mentioned:"No issues mentioning you"}},gAe={title:cAe,tabs:dAe,filters:fAe,github:pAe,prs:hAe,issues:mAe},bAe="Worktrees",vAe={total:"{{count}} total",orphaned:"{{count}} orphaned"},yAe={button:"Clean up ({{count}})",title:"Delete Completed Worktrees",description:"This will permanently delete {{count}} worktree(s).",linkedTasksWillBeDeleted:"Their linked tasks will also be deleted.",alsoDeleteLinkedTasks:"Also delete linked tasks",done:"Done",canceled:"Canceled",cannotUndo:"This action cannot be undone."},xAe={noMatch:"No worktrees match the selected filters.",noWorktrees:"No worktrees found. Worktrees are created when you create tasks."},SAe={failedToLoad:"Failed to load worktrees: {{message}}"},EAe={title:bAe,summary:vAe,cleanup:yAe,delete:{title:"Delete Worktree",description:"This will permanently delete the worktree directory at",linkedTaskWillBeDeleted:'The linked task "{{title}}" will also be deleted.',alsoDeleteLinkedTask:'Also delete linked task "{{title}}"',cannotUndo:"This action cannot be undone.",button:"Delete {{count}}"},empty:xAe,error:SAe},_Ae="Monitoring",wAe={claude:"AI Agents",system:"System Metrics",processes:"Processes",vibora:"Vibora Servers",worktrees:"Worktrees",jobs:"Jobs",usage:"Usage Limits"},CAe={showAllInstances:"Show all instances",instanceCount:"{{count}} instance(s) running",totalRam:"{{ram}} MB total",headers:{agent:"Agent",terminal:"Terminal",task:"Task",ram:"RAM",actions:"Actions",pid:"PID",workingDirectory:"Working Dir",source:"Source"},noTask:"(no task)",kill:"Kill",killing:"Killing...",killSelected:"Kill {{count}} selected",source:{vibora:"Vibora: {{name}}",external:"External"},empty:"No AI agent instances running",emptyVibora:" in Vibora terminals",error:"Failed to load AI agent instances: {{message}}"},TAe={cpuUsage:"CPU Usage",memoryUsage:"Memory Usage",memoryLabels:{used:"Used",cache:"Cache / Buffers"},diskUsage:"Disk Usage ({{path}})",error:"Failed to load system metrics: {{message}}",timeWindows:{"1m":"1 min","10m":"10 min","1h":"1 hour","3h":"3 hours","6h":"6 hours","12h":"12 hours","24h":"24 hours"}},AAe={topProcesses:"Top Processes",sortBy:{memory:"By Memory",cpu:"By CPU"},headers:{pid:"PID",name:"Name",command:"Command",memory:"Memory"},empty:"No processes found",error:"Failed to load processes: {{message}}",containers:"Containers",containersEmpty:"No containers running",containersUnavailable:"Docker/Podman not available"},kAe={description:"Running Vibora dev servers",instanceCount:"{{count}} instance(s) running",headers:{port:"Port",mode:"Mode",directory:"Directory",ram:"RAM",actions:"Actions"},mode:{dev:"Dev",prod:"Prod"},vite:"Vite",kill:"Kill",killing:"Killing...",empty:"No Vibora instances running",error:"Failed to load Vibora instances: {{message}}"},OAe={fiveHourBlock:"5-Hour Block",sevenDayRolling:"7-Day Rolling",opusWeekly:"Opus Weekly",sonnetWeekly:"Sonnet Weekly",resetsIn:"Resets in {{time}}",resetsAt:"Resets {{time}}",weekProgress:"{{percent}}% through week",unavailable:"Claude Code usage data not available. Make sure you're logged in to Claude Code.",error:"Failed to load usage data: {{message}}"},RAe={title:_Ae,tabs:wAe,claude:CAe,system:TAe,processes:AAe,vibora:kAe,usage:OAe},NAe="Tasks",IAe="New Terminal",DAe="All Repos",LAe={title:"Edit Tab",name:"Name",namePlaceholder:"Tab name",directory:"Directory",directoryPlaceholder:"Select a directory...",clearDirectory:"Clear directory",cancel:"Cancel",save:"Save"},PAe={title:"New Tab",create:"Create"},MAe={taskTerminals:NAe,newTerminal:IAe,allRepos:DAe,editTab:LAe,newTab:PAe},jAe="Repositories",FAe="{{count}} total",BAe="Search repositories...",UAe="New Task",$Ae="Tasks",zAe="Terminal",HAe="Editor",WAe="Application",VAe="Applications",qAe="Create App",GAe={title:"Docker Compose Required",description:"To create an app for deployment, this repository needs a Docker Compose file.",instructions:"Create a docker-compose.yml file in your repository.",close:"Got it"},KAe="Settings",YAe="Add Repository",XAe="Scan Directory",ZAe="Open in Terminal",QAe="Open in {{editor}}",JAe={openInVSCode:"Open in VS Code"},eke={title:"Add Repository",description:"Add a git repository from a URL or local path, or scan a directory.",tabs:{add:"Add",scan:"Scan",template:"From Template"},inputLabel:"Repository URL or path",inputPlaceholder:"https://github.com/user/repo or /local/path",browse:"Browse...",cloneOptions:"Clone Options",targetDirectory:"Clone to directory",folderName:"Folder name",willCloneTo:"Will clone to",cloning:"Cloning repository...",adding:"Adding...",cloneFailed:"Failed to clone repository",createFailed:"Failed to add repository",cancel:"Cancel",add:"Add",retry:"Retry",fields:{path:"Repository Path",pathPlaceholder:"Select repository...",displayName:"Display Name",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects."}},tke={button:"New Project",title:"Create New Project",back:"Back",next:"Next",create:"Create Project",steps:{template:{description:"Select a template to create your project from.",sectionTitle:"Copier Template",sectionDescription:"Select a saved template or enter a URL/path.",learnMore:"Learn more",savedTemplates:"Saved Templates",selectTemplate:"Select a template...",or:"or",customUrl:"Custom Template URL/Path"},questions:{title:"Template Questions",description:"Configure your project.",noQuestions:"This template has no configuration questions."},output:{title:"Output Location",description:"Choose where to create your project.",projectName:"Project Name",outputDirectory:"Output Directory",selectDirectory:"Select directory...",willCreate:"Will create",trust:"Trust template"},creating:{description:"Creating your project...",inProgress:"Running Copier..."}}},nke={title:"Scan Directory for Repositories",description:"Find and add multiple git repositories from a directory.",directoryLabel:"Directory to scan",directoryPlaceholder:"Enter directory path",browse:"Browse...",scan:"Scan",foundRepos:"Found {{count}} repositories",selectAll:"Select all",selectNone:"Select none",noReposFound:"No git repositories found in this directory.",alreadyAdded:"Already added",adding:"Adding repositories...",scanFailed:"Failed to scan directory",addFailed:"Failed to add repositories",cancel:"Cancel",addSelected:"Add {{count}} selected"},rke={noRepositories:"No repositories added yet. Add a repository for quick access when creating tasks.",noMatches:"No repositories match your search."},ike={failedToLoad:"Failed to load repositories: {{message}}"},ake={breadcrumb:"Repositories",notFound:"Repository not found",save:"Save",saving:"Saving...",saved:"Repository saved",failedToSave:"Failed to save repository",tabs:{settings:"Task Settings",workspace:"Workspace"},mobileWorkspace:{terminal:"Terminal",files:"Files"},settings:{generalTitle:"General",agentTitle:"Agent Options",displayName:"Display Name",defaultAgent:"Default Agent",defaultAgentInherit:"Use global default",defaultAgentDescription:"Override the global default agent for tasks created from this repository.",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",claudeOptions:"Claude Code Options",claudeOptionsDescription:"CLI flags passed to Claude Code when starting a task.",opencodeOptions:"OpenCode Options",opencodeOptionsDescription:"CLI flags passed to OpenCode when starting a task.",opencodeModel:"OpenCode Model",opencodeModelPlaceholder:"Select model",opencodeModelDescription:"Default OpenCode model for tasks created from this repository.",agentOptionsFlag:"Flag",agentOptionsValue:"Value",addAgentOption:"Add option",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects with Copier."},workspace:{connectingToTerminal:"Connecting to terminal server...",initializingTerminal:"Initializing terminal..."}},ske={title:jAe,total:FAe,searchPlaceholder:BAe,newTask:UAe,viewTasks:$Ae,terminal:zAe,editor:HAe,application:WAe,applications:VAe,createApp:qAe,createAppDialog:GAe,settings:KAe,addRepository:YAe,scanDirectory:XAe,openInTerminal:ZAe,openInEditor:QAe,card:JAe,delete:{title:"Delete Repository",description:'This will remove "{{name}}" from Vibora. The actual repository files will not be affected.',button:"Delete",deleting:"Deleting...",alsoDeleteDirectory:"Also delete the directory from disk",deleteDirectoryWarning:"This will permanently delete all files in the repository. This action cannot be undone."},addModal:eke,newProject:tke,bulkAdd:nke,empty:rke,error:ike,detailView:ake},oke="Jobs",lke="Manage scheduled tasks with systemd timers",uke="Search jobs...",cke="No scheduled jobs found",dke="No jobs match your search",fke="Create Job",pke={all:"All",user:"User",system:"System"},hke={active:"Active",inactive:"Inactive",failed:"Failed",waiting:"Waiting",disabled:"Disabled"},mke="Next",gke="Last",bke="System timers are read-only",vke={enable:"Enable",disable:"Disable",start:"Start",stop:"Stop",runNow:"Run Now",edit:"Edit",delete:"Delete",viewLogs:"View Logs"},yke={tabs:{general:"General",logs:"Logs",edit:"Edit"},schedule:"Schedule",nextRun:"Next Run",lastRun:"Last Run",lastResult:"Last Result",description:"Description",command:"Command",workingDir:"Working Directory",systemTimer:"System timer (read-only)",timerFile:"Timer File",serviceFile:"Service File",executionStats:"Last Execution",duration:"Duration",cpuTime:"CPU Time",noStats:"No execution data available"},xke={title:"Create Scheduled Job",name:"Job Name",namePlaceholder:"backup-daily",nameHelp:"Alphanumeric, hyphens, and underscores only",description:"Description",descriptionPlaceholder:"Daily backup of important files",schedule:"Schedule",scheduleHelp:"OnCalendar expression (e.g., *-*-* 02:00:00, daily, weekly)",command:"Command",commandPlaceholder:"/home/user/scripts/backup.sh",workingDir:"Working Directory",workingDirPlaceholder:"/home/user",persistent:"Persistent",persistentHelp:"Run missed executions when system starts",cancel:"Cancel",create:"Create Job"},Ske={title:"Job Logs",noLogs:"No logs available",lines:"lines",refresh:"Refresh"},Eke={loadFailed:"Failed to load jobs",createFailed:"Failed to create job",updateFailed:"Failed to update job",deleteFailed:"Failed to delete job"},NH={title:oke,description:lke,searchPlaceholder:uke,noJobs:cke,noJobsMatch:dke,createJob:fke,scope:pke,status:hke,nextRun:mke,lastRun:gke,systemTimerReadonly:bke,actions:vke,detail:yke,create:xke,delete:{title:"Delete Job",confirm:'Are you sure you want to delete "{{name}}"? This will remove both the timer and service files.',cancel:"Cancel",delete:"Delete"},logs:Ske,errors:Eke},_ke={save:"保存更改",cancel:"取消",delete:"删除",create:"创建",reset:"重置为默认值",browse:"浏览",clearFilters:"清除筛选"},wke={loading:"加载中...",saving:"保存中...",saved:"已保存",error:"错误",calculating:"计算中...",validating:"验证中...",creating:"创建中...",deleting:"删除中...",loggingIn:"登录中...",uploading:"上传中..."},Cke={justNow:"刚刚",minuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",hourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",dayAgo:"1 天前",daysAgo:"{{count}} 天前"},Tke={one:"{{count}} 个结果",other:"{{count}} 个结果"},Ake={IN_PROGRESS:"进行中",IN_REVIEW:"审核中",DONE:"已完成",CANCELED:"已取消",ORPHANED:"孤立"},kke={loginTitle:"登录 Vibora",username:"用户名",password:"密码",login:"登录",loginFailed:"登录失败"},Oke={sentToClaude:"已发送到 Claude Code",noTerminal:"没有可用的终端",syncedFromMain:"已从 main 同步",mergedToMain:"已合并到 main",pushedToOrigin:"已推送到 origin",parentSynced:"父仓库已与 origin 同步",prCreated:"PR 已创建",prExists:"PR 已存在"},Rke={imageUploadFailed:"图片上传失败",terminalNotConnected:"终端未连接",terminalNotConnectedDesc:"请等待连接建立"},Nke={notInstalled:"OpenCode 未安装",selectModel:"选择模型",useDefault:"使用默认",noModelsFound:"未找到模型"},Ike={manualDnsRequired:"需要手动配置 DNS",manualDnsRequiredDesc:"未配置 Cloudflare API 令牌。您需要手动为域名创建 DNS 记录。",deployToApply:"部署以应用更改",deployToApplyDesc:"域名配置已保存。部署应用程序以使更改生效。",unknownRepo:"未知仓库",service:"服务",services:"服务",exposed:"已暴露",lastDeployed:"上次部署",stop:"停止",deploy:"部署",deploying:"部署中...",building:"构建中...",cancelDeploy:"取消",cancelling:"取消中...",delete:"删除",deleting:"删除中...",searchApps:"搜索应用...",allRepos:"所有仓库",newApp:"新建应用",createApp:"创建应用",noAppsYet:"暂无应用。创建您的第一个应用开始使用!",noAppsMatch:"没有匹配的应用。",failedToLoadApps:"加载应用失败",deleteApp:"删除应用",deleteAppConfirm:'确定要删除 "{{name}}" 吗?这将停止所有容器并删除应用配置。此操作无法撤销。',cancel:"取消",appNotFound:"应用未找到",backToApps:"返回应用列表",tabs:{general:"概览",deployments:"部署记录",logs:"日志",environment:"环境变量",domains:"域名"},general:{deploy:"部署",autodeploy:"自动部署",noCache:"无缓存",notifications:"通知",services:"服务",noServicesConfigured:"未配置服务"},compose:{title:"Compose 文件",repoNotFound:"未找到仓库路径",unsaved:"未保存",edit:"编辑",done:"完成"},logs:{title:"日志",description:"实时查看应用程序日志",allContainers:"所有容器",lines:"行",copy:"复制",copied:"已复制",download:"下载",refresh:"刷新",noLogs:"暂无日志"},deployments:{title:"部署记录",description:"查看此 Compose 的最近 10 次部署",noDeployments:"暂无部署记录",view:"查看",statusDone:"完成",statusError:"错误",statusBuilding:"构建中",deployment:"部署",seeDetails:"查看此部署的详细信息",noBuildLogs:"暂无构建日志"},environment:{title:"环境变量",description:"设置 Docker Compose 构建的环境变量。这些变量在构建期间和容器中都可用。",placeholder:`DATABASE_URL=postgres://...
28
28
  API_KEY=your-api-key
29
- # 支持注释`,save:"保存环境变量",showValues:"显示值",hideValues:"隐藏值",unsavedChanges:"您有未保存的更改"},domains:{title:"域名配置",description:"配置要暴露的服务及其域名映射",expose:"暴露",exposeRequiresPort:"未配置端口。请在 compose 文件中添加端口映射。",domain:"域名",noDomain:"未配置域名",portRequired:"需要端口",editDomain:"编辑域名",noServices:"未配置服务。请先部署应用以查看可用服务。",save:"保存"},streaming:{pulling:"拉取代码...",building:"构建容器...",starting:"启动服务...",configuring:"配置路由...",done:"部署完成!",failed:"部署失败",cancelled:"部署已取消",preparing:"准备中...",waitingForLogs:"等待日志..."},dnsConfigRequired:"需要配置 DNS",settings:"设置",status:{running:"运行中",building:"构建中",failed:"失败",stopped:"已停止"}},Dke={buttons:_ke,status:wke,time:Cke,results:Tke,statuses:Ake,auth:kke,git:Oke,errors:Rke,opencode:Nke,apps:Ike},Lke={tasks:"任务",terminals:"终端",worktrees:"工作树",repositories:"仓库",apps:"应用",review:"审核",monitoring:"监控",settings:"设置",commandPalette:"命令面板 ({{shortcut}})",help:"文档"},Pke={placeholder:"输入命令或搜索...",noResults:"未找到命令",categories:{navigation:"导航",actions:"操作"},commands:{goToTasks:"前往任务",goToTerminals:"前往终端",goToTaskTerminals:"前往任务终端",goToRepositories:"前往仓库",goToApps:"前往应用",goToReview:"前往审核",goToMonitoring:"前往监控",goToSettings:"前往设置",newTask:"新建任务",openInEditor:"在编辑器中打开",keyboardShortcuts:"键盘快捷键"}},Mke={title:"键盘快捷键",groups:{navigation:"导航",actions:"操作",terminals:"终端(桌面端)",general:"通用"},labels:{goToTasks:"前往任务",goToTerminals:"前往终端",goToTaskTerminals:"前往任务终端",goToRepositories:"前往仓库",goToApps:"前往应用",goToReview:"前往审核",goToMonitoring:"前往监控",goToSettings:"前往设置",commandPalette:"命令面板",newTask:"新建任务",openInEditor:"在编辑器中打开",keyboardShortcuts:"键盘快捷键",closeModal:"关闭弹窗",newTerminal:"新建终端",closeTerminal:"关闭终端",submitForm:"提交表单"}},jke={title:"在编辑器中打开",description:"在 {{editor}} 中打开文件夹",pathLabel:"路径",pathPlaceholder:"~/projects/my-project",pathHint:"支持 ~ 表示主目录",browse:"浏览",cancel:"取消",open:"打开"},Fke={header:Lke,commandPalette:Pke,shortcuts:Mke,openInEditor:jke},Bke="任务",Uke="搜索",$ke="全部仓库",zke="新建任务",Hke={title:"创建新任务",description:"创建一个带有 Git 工作树的新任务,用于隔离开发。",fields:{title:"标题",titlePlaceholder:"添加用户认证",description:"描述",descriptionPlaceholder:"实现 OAuth2 登录流程...",aiMode:"AI 模式",agent:"AI 代理",opencodeModel:"OpenCode 模型",opencodeModelPlaceholder:"选择模型",repository:"仓库",baseBranch:"基础分支",branchName:"分支名称",branchPlaceholder:"自动生成分支名"},aiModes:{plan:"计划",default:"默认"},tabs:{saved:"仓库",browse:"浏览"},worktreePrefix:"工作树:",branchAutoGenerated:'留空将使用 "{{branch}}"。',selectFolder:"选择文件夹...",searchRepositories:"搜索仓库...",noRepositoriesFound:"未找到仓库",selectRepositoryFirst:"请先选择仓库",loadingBranches:"加载分支中...",selectBranch:"选择分支",current:"(当前)",createTask:"创建任务",errors:{notGitRepo:"所选文件夹不是 Git 仓库",validationFailed:"验证仓库失败",createFailed:"创建任务失败"}},Wke={title:Bke,searchPlaceholder:Uke,allRepos:$ke,newTask:zke,createModal:Hke},Vke="设置",qke={server:"服务器",serverDefaults:"服务器与默认设置",paths:"路径",editor:"编辑器",integrations:"集成",zai:"z.ai",agent:"AI 代理",notifications:"通知",appearance:"外观",developer:"开发者"},Gke={port:{label:"端口",description:"需要重启"},startupCommand:{label:"启动命令",description:"新任务终端的命令"},gitReposDir:{label:"Git 仓库目录",description:"仓库选择器的起始目录"},editor:{app:{label:"编辑器",description:"用于打开工作树的代码编辑器",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"远程主机",description:"代码在远程机器上时使用的 SSH 地址",placeholder:"例如:my-server.tailnet.ts.net"},sshPort:{label:"SSH 端口",description:"远程 SSH 端口(默认 22)"}},linear:{label:"Linear",description:"用于工单同步的 API 密钥"},github:{label:"GitHub",description:"用于 Issues 和 PR 的个人访问令牌"},cloudflare:{label:"Cloudflare",placeholder:"输入 API 令牌...",description:"用于自动 DNS 记录的 API 令牌"},zai:{enable:"启用",apiKey:"API 密钥",description:"配置 Claude Code 使用 z.ai 代理",modelMappings:"模型映射",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},agent:{default:{label:"默认代理",description:"新任务使用的 AI 编码代理"},opencodeModel:{label:"OpenCode 模型",placeholder:"选择模型",description:"启动 OpenCode 任务时使用的默认模型"}},language:{label:"语言",description:"界面语言",options:{auto:"自动检测",en:"English",zh:"简体中文"}},theme:{label:"主题",description:"界面颜色主题",options:{system:"跟随系统",light:"浅色",dark:"深色"}},syncClaudeTheme:{label:"同步 Claude Code",description:"当 Vibora 在浅色和深色模式之间切换时自动更新 Claude Code 的主题"},claudeCodeTheme:{light:"浅色模式",dark:"深色模式",options:{light:"浅色","light-ansi":"浅色 ANSI","light-daltonized":"浅色(色盲友好)",dark:"深色","dark-ansi":"深色 ANSI","dark-daltonized":"深色(色盲友好)"}}},Kke={enable:"启用通知",toast:"应用内提示",toastDescription:"在 Vibora 界面中显示提示通知",desktop:"桌面通知",desktopDescription:"显示原生桌面或浏览器通知",sound:"声音",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"应用令牌",userKey:"用户密钥",testSuccess:"{{channel}} 测试成功",testFailed:"{{channel}} 测试失败:{{error}}",uploadSound:"上传自定义声音",deleteSound:"删除自定义声音",testSound:"测试声音",soundUploaded:"自定义声音已上传",soundUploadFailed:"上传声音失败:{{error}}",soundDeleted:"自定义声音已删除",soundDeleteFailed:"删除自定义声音失败",customSoundActive:"使用自定义声音"},Yke={restartButton:"重启 Vibora",restarting:"重启中...",restartDescription:"重新构建并重启 Vibora 服务器。如果构建失败,服务器将继续运行。",restartFailed:"重启失败",checkLogs:"构建可能失败。运行 journalctl --user -u vibora 查看详情。"},Xke={title:"未保存的更改",description:"您有未保存的更改,离开此页面将丢失这些更改。",stay:"留下",leave:"离开"},Zke={title:Vke,sections:qke,fields:Gke,notifications:Kke,developer:Yke,unsavedChanges:Xke},Qke="审核",Jke={pullRequests:"拉取请求",issues:"问题"},e2e={pr:{created:"我创建的",assigned:"分配给我的",reviewRequested:"待我审核",mentioned:"提及我的"},issue:{assigned:"分配给我的",created:"我创建的",mentioned:"提及我的"},allOrgs:"所有组织",allOrganizations:"所有组织",viboraReposOnly:"仅 Vibora 仓库"},t2e={tokenRequired:"需要 GitHub 令牌",tokenDescription:"要查看您的问题和拉取请求,请在设置中添加 GitHub 个人访问令牌。",requiredScopes:"所需权限:",scopes:{repo:"(用于私有仓库)",readUser:"(用于用户信息)",readOrg:"(用于组织列表)"},generateToken:"生成令牌",goToSettings:"前往设置"},n2e={loading:"加载中...",failedToLoad:"加载拉取请求失败",empty:{all:"没有打开的拉取请求",created:"没有您创建的拉取请求",assigned:"没有分配给您的拉取请求",reviewRequested:"没有等待您审核的拉取请求",mentioned:"没有提及您的拉取请求"},draft:"草稿"},r2e={loading:"加载中...",failedToLoad:"加载问题失败",empty:{assigned:"没有分配给您的问题",created:"没有您创建的问题",mentioned:"没有提及您的问题"}},i2e={title:Qke,tabs:Jke,filters:e2e,github:t2e,prs:n2e,issues:r2e},a2e="工作树",s2e={total:"共 {{count}} 个",orphaned:"{{count}} 个孤立"},o2e={button:"清理 ({{count}})",title:"删除已完成的工作树",description:"这将永久删除 {{count}} 个工作树。",linkedTasksWillBeDeleted:"关联的任务也将被删除。",alsoDeleteLinkedTasks:"同时删除关联的任务",done:"已完成",canceled:"已取消",cannotUndo:"此操作无法撤销。"},l2e={noMatch:"没有匹配所选筛选条件的工作树。",noWorktrees:"未找到工作树。工作树在创建任务时自动生成。"},u2e={failedToLoad:"加载工作树失败:{{message}}"},c2e={title:a2e,summary:s2e,cleanup:o2e,delete:{title:"删除工作树",description:"这将永久删除位于以下位置的工作树目录",linkedTaskWillBeDeleted:'关联的任务 "{{title}}" 也将被删除。',alsoDeleteLinkedTask:'同时删除关联的任务 "{{title}}"',cannotUndo:"此操作无法撤销。",button:"删除 {{count}} 个"},empty:l2e,error:u2e},d2e="监控",f2e={claude:"AI 代理",system:"系统指标",processes:"进程",vibora:"Vibora 服务器",worktrees:"工作树",jobs:"作业",usage:"使用限额"},p2e={showAllInstances:"显示所有实例",instanceCount:"{{count}} 个实例运行中",totalRam:"总计 {{ram}} MB",headers:{agent:"代理",terminal:"终端",task:"任务",ram:"内存",actions:"操作",pid:"PID",workingDirectory:"工作目录",source:"来源"},noTask:"(无任务)",kill:"终止",killing:"终止中...",killSelected:"终止 {{count}} 个已选",source:{vibora:"Vibora: {{name}}",external:"外部"},empty:"没有 AI 代理实例运行中",emptyVibora:" (在 Vibora 终端中)",error:"加载 AI 代理实例失败:{{message}}"},h2e={cpuUsage:"CPU 使用率",memoryUsage:"内存使用率",memoryLabels:{used:"已使用",cache:"缓存/缓冲区"},diskUsage:"磁盘使用率 ({{path}})",error:"加载系统指标失败:{{message}}",timeWindows:{"1m":"1 分钟","10m":"10 分钟","1h":"1 小时","3h":"3 小时","6h":"6 小时","12h":"12 小时","24h":"24 小时"}},m2e={topProcesses:"热门进程",sortBy:{memory:"按内存",cpu:"按 CPU"},headers:{pid:"PID",name:"名称",command:"命令",memory:"内存"},empty:"未找到进程",error:"加载进程失败:{{message}}",containers:"容器",containersEmpty:"没有容器运行中",containersUnavailable:"Docker/Podman 不可用"},g2e={description:"运行中的 Vibora 开发服务器",instanceCount:"{{count}} 个实例运行中",headers:{port:"端口",mode:"模式",directory:"目录",ram:"内存",actions:"操作"},mode:{dev:"开发",prod:"生产"},vite:"Vite",kill:"终止",killing:"终止中...",empty:"没有 Vibora 实例运行中",error:"加载 Vibora 实例失败:{{message}}"},b2e={fiveHourBlock:"5小时配额",sevenDayRolling:"7天滚动配额",opusWeekly:"Opus 周配额",sonnetWeekly:"Sonnet 周配额",resetsIn:"{{time}}后重置",resetsAt:"{{time}}重置",weekProgress:"本周已过 {{percent}}%",unavailable:"Claude Code 使用数据不可用。请确保已登录 Claude Code。",error:"加载使用数据失败:{{message}}"},v2e={title:d2e,tabs:f2e,claude:p2e,system:h2e,processes:m2e,vibora:g2e,usage:b2e},y2e="任务",x2e="新建终端",S2e="全部仓库",E2e={taskTerminals:y2e,newTerminal:x2e,allRepos:S2e},_2e="仓库",w2e="共 {{count}} 个",C2e="搜索仓库...",T2e="新建任务",A2e="任务",k2e="终端",O2e="编辑器",R2e="应用",N2e="应用",I2e="创建应用",D2e={title:"需要 Docker Compose",description:"要为部署创建应用,此仓库需要 Docker Compose 文件。",instructions:"请在仓库中创建 docker-compose.yml 文件。",close:"知道了"},L2e="设置",P2e="添加仓库",M2e="扫描目录",j2e="在终端中打开",F2e="在 {{editor}} 中打开",B2e={openInVSCode:"在 VS Code 中打开"},U2e={title:"添加仓库",description:"从 URL 或本地路径添加 Git 仓库,或扫描目录。",tabs:{add:"添加",scan:"扫描",template:"从模板创建"},inputLabel:"仓库 URL 或路径",inputPlaceholder:"https://github.com/user/repo 或 /local/path",browse:"浏览...",cloneOptions:"克隆选项",targetDirectory:"克隆到目录",folderName:"文件夹名称",willCloneTo:"将克隆到",cloning:"正在克隆仓库...",adding:"添加中...",cloneFailed:"克隆仓库失败",createFailed:"添加仓库失败",cancel:"取消",add:"添加",retry:"重试",fields:{path:"仓库路径",pathPlaceholder:"选择仓库...",displayName:"显示名称",startupScript:"启动脚本",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"创建工作树时在终端中运行的命令。",copyFiles:"复制文件",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"用逗号分隔的 glob 模式,用于复制文件到新的工作树。"}},$2e={title:"扫描目录中的仓库",description:"从目录中查找并添加多个 Git 仓库。",directoryLabel:"要扫描的目录",directoryPlaceholder:"输入目录路径",browse:"浏览...",scan:"扫描",foundRepos:"找到 {{count}} 个仓库",selectAll:"全选",selectNone:"取消全选",noReposFound:"此目录中未找到 Git 仓库。",alreadyAdded:"已添加",adding:"正在添加仓库...",scanFailed:"扫描目录失败",addFailed:"添加仓库失败",cancel:"取消",addSelected:"添加 {{count}} 个选中项"},z2e={button:"新建项目",title:"创建新项目",back:"返回",next:"下一步",create:"创建项目",steps:{template:{description:"选择一个模板来创建您的项目。",sectionTitle:"Copier 模板",sectionDescription:"选择已保存的模板或输入 URL/路径。",learnMore:"了解更多",savedTemplates:"已保存的模板",selectTemplate:"选择模板...",or:"或",customUrl:"自定义模板 URL/路径"},questions:{title:"模板问题",description:"配置您的项目。",noQuestions:"此模板没有配置问题。"},output:{title:"输出位置",description:"选择项目创建位置。",projectName:"项目名称",outputDirectory:"输出目录",selectDirectory:"选择目录...",willCreate:"将创建",trust:"信任模板"},creating:{description:"正在创建您的项目...",inProgress:"正在运行 Copier..."}}},H2e={noRepositories:"尚未添加任何仓库。添加一个仓库以便在创建任务时快速访问。",noMatches:"没有匹配的仓库。"},W2e={failedToLoad:"加载仓库失败:{{message}}"},V2e={breadcrumb:"仓库",notFound:"仓库未找到",save:"保存",saving:"保存中...",saved:"仓库已保存",failedToSave:"保存仓库失败",tabs:{settings:"设置",workspace:"工作区"},mobileWorkspace:{terminal:"终端",files:"文件"},settings:{generalTitle:"常规",agentTitle:"代理选项",displayName:"显示名称",defaultAgent:"默认代理",defaultAgentInherit:"使用全局默认",defaultAgentDescription:"覆盖从此仓库创建任务时使用的全局默认代理。",startupScript:"启动脚本",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"创建工作树时在终端中运行的命令。",claudeOptions:"Claude Code 选项",claudeOptionsDescription:"启动任务时传递给 Claude Code 的命令行参数。",opencodeOptions:"OpenCode 选项",opencodeOptionsDescription:"启动任务时传递给 OpenCode 的命令行参数。",opencodeModel:"OpenCode 模型",opencodeModelPlaceholder:"选择模型",opencodeModelDescription:"从此仓库创建任务时使用的默认 OpenCode 模型。",agentOptionsFlag:"参数",agentOptionsValue:"值",addAgentOption:"添加选项",copyFiles:"复制文件",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"用逗号分隔的 glob 模式,用于复制文件到新的工作树。",isCopierTemplate:"用作 Copier 模板",isCopierTemplateDescription:"标记为使用 Copier 创建新项目的模板。"},workspace:{connectingToTerminal:"正在连接终端服务器...",initializingTerminal:"正在初始化终端..."}},q2e={title:_2e,total:w2e,searchPlaceholder:C2e,newTask:T2e,viewTasks:A2e,terminal:k2e,editor:O2e,application:R2e,applications:N2e,createApp:I2e,createAppDialog:D2e,settings:L2e,addRepository:P2e,scanDirectory:M2e,openInTerminal:j2e,openInEditor:F2e,card:B2e,delete:{title:"删除仓库",description:'这将从 Vibora 中移除 "{{name}}"。实际的仓库文件不会受到影响。',button:"删除",deleting:"删除中...",alsoDeleteDirectory:"同时从磁盘删除目录",deleteDirectoryWarning:"这将永久删除仓库中的所有文件。此操作无法撤销。"},addModal:U2e,bulkAdd:$2e,newProject:z2e,empty:H2e,error:W2e,detailView:V2e},G2e="common",$D=["en","zh"],K2e={en:{common:VTe,navigation:XTe,tasks:nAe,settings:uAe,review:gAe,worktrees:EAe,monitoring:RAe,terminals:MAe,repositories:ske,jobs:NH},zh:{common:Dke,navigation:Fke,tasks:Wke,settings:Zke,review:i2e,worktrees:c2e,monitoring:v2e,terminals:E2e,repositories:q2e,jobs:NH}};function Y2e(){if(typeof window<"u"){const e=localStorage.getItem("vibora-language");if(e&&$D.includes(e))return e;const t=navigator.language.split("-")[0];if($D.includes(t))return t}return"en"}da.use(Ave).init({resources:K2e,lng:Y2e(),fallbackLng:"en",defaultNS:G2e,ns:["common","navigation","tasks","settings","review","worktrees","monitoring","terminals","repositories","jobs"],interpolation:{escapeValue:!1}});da.on("languageChanged",e=>{typeof window<"u"&&localStorage.setItem("vibora-language",e)});function fie(){const{i18n:e}=At(),{data:t,isSuccess:n}=lTe(),r=lie();T.useEffect(()=>{n&&t&&t!==e.language&&e.changeLanguage(t)},[n,t,e]);const i=T.useCallback(async a=>{if(a)await e.changeLanguage(a);else{const s=navigator.language.split("-")[0],o=$D.includes(s)?s:"en";await e.changeLanguage(o)}r.mutate({key:mn.LANGUAGE,value:a??""})},[e,r]);return{language:e.language,savedLanguage:t,changeLanguage:i,isUpdating:r.isPending}}function hn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var X2e={};function zw(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:X2e}var pie=Object.assign,DE=Object.getOwnPropertyDescriptor,wl=Object.defineProperty,Hw=Object.prototype,zD=[];Object.freeze(zD);var I3={};Object.freeze(I3);var Z2e=typeof Proxy<"u",Q2e=Object.toString();function hie(){Z2e||hn("Proxy not available")}function mie(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var $h=function(){};function Ms(e){return typeof e=="function"}function up(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Ww(e){return e!==null&&typeof e=="object"}function wd(e){if(!Ww(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===Q2e}function gie(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Vw(e,t,n){wl(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function bie(e,t,n){wl(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Ld(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return Ww(r)&&r[n]===!0}}function Tg(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function J2e(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function Tu(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var vie=typeof Object.getOwnPropertySymbols<"u";function eOe(e){var t=Object.keys(e);if(!vie)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return Hw.propertyIsEnumerable.call(e,r)})):t}var qw=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:vie?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function yie(e){return e===null?null:typeof e=="object"?""+e:e}function Bu(e,t){return Hw.hasOwnProperty.call(e,t)}var tOe=Object.getOwnPropertyDescriptors||function(t){var n={};return qw(t).forEach(function(r){n[r]=DE(t,r)}),n};function Rs(e,t){return!!(e&t)}function Ns(e,t,n){return n?e|=t:e&=~t,e}function IH(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nOe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iOe(r.key),r)}}function Ag(e,t,n){return t&&nOe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zh(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=aOe(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
29
+ # 支持注释`,save:"保存环境变量",showValues:"显示值",hideValues:"隐藏值",unsavedChanges:"您有未保存的更改"},domains:{title:"域名配置",description:"配置要暴露的服务及其域名映射",expose:"暴露",exposeRequiresPort:"未配置端口。请在 compose 文件中添加端口映射。",domain:"域名",noDomain:"未配置域名",portRequired:"需要端口",editDomain:"编辑域名",noServices:"未配置服务。请先部署应用以查看可用服务。",save:"保存"},streaming:{pulling:"拉取代码...",building:"构建容器...",starting:"启动服务...",configuring:"配置路由...",done:"部署完成!",failed:"部署失败",cancelled:"部署已取消",preparing:"准备中...",waitingForLogs:"等待日志..."},dnsConfigRequired:"需要配置 DNS",settings:"设置",status:{running:"运行中",building:"构建中",failed:"失败",stopped:"已停止"}},Dke={buttons:_ke,status:wke,time:Cke,results:Tke,statuses:Ake,auth:kke,git:Oke,errors:Rke,opencode:Nke,apps:Ike},Lke={tasks:"任务",terminals:"终端",worktrees:"工作树",repositories:"仓库",apps:"应用",review:"审核",monitoring:"监控",settings:"设置",commandPalette:"命令面板 ({{shortcut}})",help:"文档"},Pke={placeholder:"输入命令或搜索...",noResults:"未找到命令",categories:{navigation:"导航",actions:"操作"},commands:{goToTasks:"前往任务",goToTerminals:"前往终端",goToTaskTerminals:"前往任务终端",goToRepositories:"前往仓库",goToApps:"前往应用",goToReview:"前往审核",goToMonitoring:"前往监控",goToSettings:"前往设置",newTask:"新建任务",openInEditor:"在编辑器中打开",keyboardShortcuts:"键盘快捷键"}},Mke={title:"键盘快捷键",groups:{navigation:"导航",actions:"操作",terminals:"终端(桌面端)",general:"通用"},labels:{goToTasks:"前往任务",goToTerminals:"前往终端",goToTaskTerminals:"前往任务终端",goToRepositories:"前往仓库",goToApps:"前往应用",goToReview:"前往审核",goToMonitoring:"前往监控",goToSettings:"前往设置",commandPalette:"命令面板",newTask:"新建任务",openInEditor:"在编辑器中打开",keyboardShortcuts:"键盘快捷键",closeModal:"关闭弹窗",newTerminal:"新建终端",closeTerminal:"关闭终端",submitForm:"提交表单"}},jke={title:"在编辑器中打开",description:"在 {{editor}} 中打开文件夹",pathLabel:"路径",pathPlaceholder:"~/projects/my-project",pathHint:"支持 ~ 表示主目录",browse:"浏览",cancel:"取消",open:"打开"},Fke={header:Lke,commandPalette:Pke,shortcuts:Mke,openInEditor:jke},Bke="任务",Uke="搜索",$ke="全部仓库",zke="新建任务",Hke={title:"创建新任务",description:"创建一个带有 Git 工作树的新任务,用于隔离开发。",fields:{title:"标题",titlePlaceholder:"添加用户认证",description:"描述",descriptionPlaceholder:"实现 OAuth2 登录流程...",aiMode:"AI 模式",agent:"AI 代理",opencodeModel:"OpenCode 模型",opencodeModelPlaceholder:"选择模型",repository:"仓库",baseBranch:"基础分支",branchName:"分支名称",branchPlaceholder:"自动生成分支名"},aiModes:{plan:"计划",default:"默认"},tabs:{saved:"仓库",browse:"浏览"},worktreePrefix:"工作树:",branchAutoGenerated:'留空将使用 "{{branch}}"。',selectFolder:"选择文件夹...",searchRepositories:"搜索仓库...",noRepositoriesFound:"未找到仓库",selectRepositoryFirst:"请先选择仓库",loadingBranches:"加载分支中...",selectBranch:"选择分支",current:"(当前)",createTask:"创建任务",errors:{notGitRepo:"所选文件夹不是 Git 仓库",validationFailed:"验证仓库失败",createFailed:"创建任务失败"}},Wke={title:Bke,searchPlaceholder:Uke,allRepos:$ke,newTask:zke,createModal:Hke},Vke="设置",qke={server:"服务器",serverDefaults:"服务器与默认设置",paths:"路径",editor:"编辑器",integrations:"集成",zai:"z.ai",agent:"AI 代理",notifications:"通知",appearance:"外观",developer:"开发者"},Gke={port:{label:"端口",description:"需要重启"},startupCommand:{label:"启动命令",description:"新任务终端的命令"},gitReposDir:{label:"Git 仓库目录",description:"仓库选择器的起始目录"},editor:{app:{label:"编辑器",description:"用于打开工作树的代码编辑器",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"远程主机",description:"代码在远程机器上时使用的 SSH 地址",placeholder:"例如:my-server.tailnet.ts.net"},sshPort:{label:"SSH 端口",description:"远程 SSH 端口(默认 22)"}},linear:{label:"Linear",description:"用于工单同步的 API 密钥"},github:{label:"GitHub",description:"用于 Issues 和 PR 的个人访问令牌"},cloudflare:{label:"Cloudflare",placeholder:"输入 API 令牌...",description:"用于自动 DNS 记录的 API 令牌"},zai:{enable:"启用",apiKey:"API 密钥",description:"配置 Claude Code 使用 z.ai 代理",modelMappings:"模型映射",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},agent:{default:{label:"默认代理",description:"新任务使用的 AI 编码代理"},opencodeModel:{label:"OpenCode 模型",placeholder:"选择模型",description:"启动 OpenCode 任务时使用的默认模型"}},language:{label:"语言",description:"界面语言",options:{auto:"自动检测",en:"English",zh:"简体中文"}},theme:{label:"主题",description:"界面颜色主题",options:{system:"跟随系统",light:"浅色",dark:"深色"}},syncClaudeTheme:{label:"同步 Claude Code",description:"当 Vibora 在浅色和深色模式之间切换时自动更新 Claude Code 的主题"},claudeCodeTheme:{light:"浅色模式",dark:"深色模式",options:{light:"浅色","light-ansi":"浅色 ANSI","light-daltonized":"浅色(色盲友好)",dark:"深色","dark-ansi":"深色 ANSI","dark-daltonized":"深色(色盲友好)"}}},Kke={enable:"启用通知",toast:"应用内提示",toastDescription:"在 Vibora 界面中显示提示通知",desktop:"桌面通知",desktopDescription:"显示原生桌面或浏览器通知",sound:"声音",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"应用令牌",userKey:"用户密钥",testSuccess:"{{channel}} 测试成功",testFailed:"{{channel}} 测试失败:{{error}}",uploadSound:"上传自定义声音",deleteSound:"删除自定义声音",testSound:"测试声音",soundUploaded:"自定义声音已上传",soundUploadFailed:"上传声音失败:{{error}}",soundDeleted:"自定义声音已删除",soundDeleteFailed:"删除自定义声音失败",customSoundActive:"使用自定义声音"},Yke={restartButton:"重启 Vibora",restarting:"重启中...",restartDescription:"重新构建并重启 Vibora 服务器。如果构建失败,服务器将继续运行。",restartFailed:"重启失败",checkLogs:"构建可能失败。运行 journalctl --user -u vibora 查看详情。"},Xke={title:"未保存的更改",description:"您有未保存的更改,离开此页面将丢失这些更改。",stay:"留下",leave:"离开"},Zke={title:Vke,sections:qke,fields:Gke,notifications:Kke,developer:Yke,unsavedChanges:Xke},Qke="审核",Jke={pullRequests:"拉取请求",issues:"问题"},e2e={pr:{created:"我创建的",assigned:"分配给我的",reviewRequested:"待我审核",mentioned:"提及我的"},issue:{assigned:"分配给我的",created:"我创建的",mentioned:"提及我的"},allOrgs:"所有组织",allOrganizations:"所有组织",viboraReposOnly:"仅 Vibora 仓库"},t2e={tokenRequired:"需要 GitHub 令牌",tokenDescription:"要查看您的问题和拉取请求,请在设置中添加 GitHub 个人访问令牌。",requiredScopes:"所需权限:",scopes:{repo:"(用于私有仓库)",readUser:"(用于用户信息)",readOrg:"(用于组织列表)"},generateToken:"生成令牌",goToSettings:"前往设置"},n2e={loading:"加载中...",failedToLoad:"加载拉取请求失败",empty:{all:"没有打开的拉取请求",created:"没有您创建的拉取请求",assigned:"没有分配给您的拉取请求",reviewRequested:"没有等待您审核的拉取请求",mentioned:"没有提及您的拉取请求"},draft:"草稿"},r2e={loading:"加载中...",failedToLoad:"加载问题失败",empty:{assigned:"没有分配给您的问题",created:"没有您创建的问题",mentioned:"没有提及您的问题"}},i2e={title:Qke,tabs:Jke,filters:e2e,github:t2e,prs:n2e,issues:r2e},a2e="工作树",s2e={total:"共 {{count}} 个",orphaned:"{{count}} 个孤立"},o2e={button:"清理 ({{count}})",title:"删除已完成的工作树",description:"这将永久删除 {{count}} 个工作树。",linkedTasksWillBeDeleted:"关联的任务也将被删除。",alsoDeleteLinkedTasks:"同时删除关联的任务",done:"已完成",canceled:"已取消",cannotUndo:"此操作无法撤销。"},l2e={noMatch:"没有匹配所选筛选条件的工作树。",noWorktrees:"未找到工作树。工作树在创建任务时自动生成。"},u2e={failedToLoad:"加载工作树失败:{{message}}"},c2e={title:a2e,summary:s2e,cleanup:o2e,delete:{title:"删除工作树",description:"这将永久删除位于以下位置的工作树目录",linkedTaskWillBeDeleted:'关联的任务 "{{title}}" 也将被删除。',alsoDeleteLinkedTask:'同时删除关联的任务 "{{title}}"',cannotUndo:"此操作无法撤销。",button:"删除 {{count}} 个"},empty:l2e,error:u2e},d2e="监控",f2e={claude:"AI 代理",system:"系统指标",processes:"进程",vibora:"Vibora 服务器",worktrees:"工作树",jobs:"作业",usage:"使用限额"},p2e={showAllInstances:"显示所有实例",instanceCount:"{{count}} 个实例运行中",totalRam:"总计 {{ram}} MB",headers:{agent:"代理",terminal:"终端",task:"任务",ram:"内存",actions:"操作",pid:"PID",workingDirectory:"工作目录",source:"来源"},noTask:"(无任务)",kill:"终止",killing:"终止中...",killSelected:"终止 {{count}} 个已选",source:{vibora:"Vibora: {{name}}",external:"外部"},empty:"没有 AI 代理实例运行中",emptyVibora:" (在 Vibora 终端中)",error:"加载 AI 代理实例失败:{{message}}"},h2e={cpuUsage:"CPU 使用率",memoryUsage:"内存使用率",memoryLabels:{used:"已使用",cache:"缓存/缓冲区"},diskUsage:"磁盘使用率 ({{path}})",error:"加载系统指标失败:{{message}}",timeWindows:{"1m":"1 分钟","10m":"10 分钟","1h":"1 小时","3h":"3 小时","6h":"6 小时","12h":"12 小时","24h":"24 小时"}},m2e={topProcesses:"热门进程",sortBy:{memory:"按内存",cpu:"按 CPU"},headers:{pid:"PID",name:"名称",command:"命令",memory:"内存"},empty:"未找到进程",error:"加载进程失败:{{message}}",containers:"容器",containersEmpty:"没有容器运行中",containersUnavailable:"Docker/Podman 不可用"},g2e={description:"运行中的 Vibora 开发服务器",instanceCount:"{{count}} 个实例运行中",headers:{port:"端口",mode:"模式",directory:"目录",ram:"内存",actions:"操作"},mode:{dev:"开发",prod:"生产"},vite:"Vite",kill:"终止",killing:"终止中...",empty:"没有 Vibora 实例运行中",error:"加载 Vibora 实例失败:{{message}}"},b2e={fiveHourBlock:"5小时配额",sevenDayRolling:"7天滚动配额",opusWeekly:"Opus 周配额",sonnetWeekly:"Sonnet 周配额",resetsIn:"{{time}}后重置",resetsAt:"{{time}}重置",weekProgress:"本周已过 {{percent}}%",unavailable:"Claude Code 使用数据不可用。请确保已登录 Claude Code。",error:"加载使用数据失败:{{message}}"},v2e={title:d2e,tabs:f2e,claude:p2e,system:h2e,processes:m2e,vibora:g2e,usage:b2e},y2e="任务",x2e="新建终端",S2e="全部仓库",E2e={taskTerminals:y2e,newTerminal:x2e,allRepos:S2e},_2e="仓库",w2e="共 {{count}} 个",C2e="搜索仓库...",T2e="新建任务",A2e="任务",k2e="终端",O2e="编辑器",R2e="应用",N2e="应用",I2e="创建应用",D2e={title:"需要 Docker Compose",description:"要为部署创建应用,此仓库需要 Docker Compose 文件。",instructions:"请在仓库中创建 docker-compose.yml 文件。",close:"知道了"},L2e="设置",P2e="添加仓库",M2e="扫描目录",j2e="在终端中打开",F2e="在 {{editor}} 中打开",B2e={openInVSCode:"在 VS Code 中打开"},U2e={title:"添加仓库",description:"从 URL 或本地路径添加 Git 仓库,或扫描目录。",tabs:{add:"添加",scan:"扫描",template:"从模板创建"},inputLabel:"仓库 URL 或路径",inputPlaceholder:"https://github.com/user/repo 或 /local/path",browse:"浏览...",cloneOptions:"克隆选项",targetDirectory:"克隆到目录",folderName:"文件夹名称",willCloneTo:"将克隆到",cloning:"正在克隆仓库...",adding:"添加中...",cloneFailed:"克隆仓库失败",createFailed:"添加仓库失败",cancel:"取消",add:"添加",retry:"重试",fields:{path:"仓库路径",pathPlaceholder:"选择仓库...",displayName:"显示名称",startupScript:"启动脚本",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"创建工作树时在终端中运行的命令。",copyFiles:"复制文件",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"用逗号分隔的 glob 模式,用于复制文件到新的工作树。"}},$2e={title:"扫描目录中的仓库",description:"从目录中查找并添加多个 Git 仓库。",directoryLabel:"要扫描的目录",directoryPlaceholder:"输入目录路径",browse:"浏览...",scan:"扫描",foundRepos:"找到 {{count}} 个仓库",selectAll:"全选",selectNone:"取消全选",noReposFound:"此目录中未找到 Git 仓库。",alreadyAdded:"已添加",adding:"正在添加仓库...",scanFailed:"扫描目录失败",addFailed:"添加仓库失败",cancel:"取消",addSelected:"添加 {{count}} 个选中项"},z2e={button:"新建项目",title:"创建新项目",back:"返回",next:"下一步",create:"创建项目",steps:{template:{description:"选择一个模板来创建您的项目。",sectionTitle:"Copier 模板",sectionDescription:"选择已保存的模板或输入 URL/路径。",learnMore:"了解更多",savedTemplates:"已保存的模板",selectTemplate:"选择模板...",or:"或",customUrl:"自定义模板 URL/路径"},questions:{title:"模板问题",description:"配置您的项目。",noQuestions:"此模板没有配置问题。"},output:{title:"输出位置",description:"选择项目创建位置。",projectName:"项目名称",outputDirectory:"输出目录",selectDirectory:"选择目录...",willCreate:"将创建",trust:"信任模板"},creating:{description:"正在创建您的项目...",inProgress:"正在运行 Copier..."}}},H2e={noRepositories:"尚未添加任何仓库。添加一个仓库以便在创建任务时快速访问。",noMatches:"没有匹配的仓库。"},W2e={failedToLoad:"加载仓库失败:{{message}}"},V2e={breadcrumb:"仓库",notFound:"仓库未找到",save:"保存",saving:"保存中...",saved:"仓库已保存",failedToSave:"保存仓库失败",tabs:{settings:"任务设置",workspace:"工作区"},mobileWorkspace:{terminal:"终端",files:"文件"},settings:{generalTitle:"常规",agentTitle:"代理选项",displayName:"显示名称",defaultAgent:"默认代理",defaultAgentInherit:"使用全局默认",defaultAgentDescription:"覆盖从此仓库创建任务时使用的全局默认代理。",startupScript:"启动脚本",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"创建工作树时在终端中运行的命令。",claudeOptions:"Claude Code 选项",claudeOptionsDescription:"启动任务时传递给 Claude Code 的命令行参数。",opencodeOptions:"OpenCode 选项",opencodeOptionsDescription:"启动任务时传递给 OpenCode 的命令行参数。",opencodeModel:"OpenCode 模型",opencodeModelPlaceholder:"选择模型",opencodeModelDescription:"从此仓库创建任务时使用的默认 OpenCode 模型。",agentOptionsFlag:"参数",agentOptionsValue:"值",addAgentOption:"添加选项",copyFiles:"复制文件",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"用逗号分隔的 glob 模式,用于复制文件到新的工作树。",isCopierTemplate:"用作 Copier 模板",isCopierTemplateDescription:"标记为使用 Copier 创建新项目的模板。"},workspace:{connectingToTerminal:"正在连接终端服务器...",initializingTerminal:"正在初始化终端..."}},q2e={title:_2e,total:w2e,searchPlaceholder:C2e,newTask:T2e,viewTasks:A2e,terminal:k2e,editor:O2e,application:R2e,applications:N2e,createApp:I2e,createAppDialog:D2e,settings:L2e,addRepository:P2e,scanDirectory:M2e,openInTerminal:j2e,openInEditor:F2e,card:B2e,delete:{title:"删除仓库",description:'这将从 Vibora 中移除 "{{name}}"。实际的仓库文件不会受到影响。',button:"删除",deleting:"删除中...",alsoDeleteDirectory:"同时从磁盘删除目录",deleteDirectoryWarning:"这将永久删除仓库中的所有文件。此操作无法撤销。"},addModal:U2e,bulkAdd:$2e,newProject:z2e,empty:H2e,error:W2e,detailView:V2e},G2e="common",$D=["en","zh"],K2e={en:{common:VTe,navigation:XTe,tasks:nAe,settings:uAe,review:gAe,worktrees:EAe,monitoring:RAe,terminals:MAe,repositories:ske,jobs:NH},zh:{common:Dke,navigation:Fke,tasks:Wke,settings:Zke,review:i2e,worktrees:c2e,monitoring:v2e,terminals:E2e,repositories:q2e,jobs:NH}};function Y2e(){if(typeof window<"u"){const e=localStorage.getItem("vibora-language");if(e&&$D.includes(e))return e;const t=navigator.language.split("-")[0];if($D.includes(t))return t}return"en"}da.use(Ave).init({resources:K2e,lng:Y2e(),fallbackLng:"en",defaultNS:G2e,ns:["common","navigation","tasks","settings","review","worktrees","monitoring","terminals","repositories","jobs"],interpolation:{escapeValue:!1}});da.on("languageChanged",e=>{typeof window<"u"&&localStorage.setItem("vibora-language",e)});function fie(){const{i18n:e}=At(),{data:t,isSuccess:n}=lTe(),r=lie();T.useEffect(()=>{n&&t&&t!==e.language&&e.changeLanguage(t)},[n,t,e]);const i=T.useCallback(async a=>{if(a)await e.changeLanguage(a);else{const s=navigator.language.split("-")[0],o=$D.includes(s)?s:"en";await e.changeLanguage(o)}r.mutate({key:mn.LANGUAGE,value:a??""})},[e,r]);return{language:e.language,savedLanguage:t,changeLanguage:i,isUpdating:r.isPending}}function hn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error(typeof e=="number"?"[MobX] minified error nr: "+e+(n.length?" "+n.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var X2e={};function zw(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:X2e}var pie=Object.assign,DE=Object.getOwnPropertyDescriptor,wl=Object.defineProperty,Hw=Object.prototype,zD=[];Object.freeze(zD);var I3={};Object.freeze(I3);var Z2e=typeof Proxy<"u",Q2e=Object.toString();function hie(){Z2e||hn("Proxy not available")}function mie(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var $h=function(){};function Ms(e){return typeof e=="function"}function up(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Ww(e){return e!==null&&typeof e=="object"}function wd(e){if(!Ww(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n.toString()===Q2e}function gie(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Vw(e,t,n){wl(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function bie(e,t,n){wl(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Ld(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(r){return Ww(r)&&r[n]===!0}}function Tg(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function J2e(e){var t=Object.getPrototypeOf(e),n=Object.getPrototypeOf(t),r=Object.getPrototypeOf(n);return r===null}function Tu(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var vie=typeof Object.getOwnPropertySymbols<"u";function eOe(e){var t=Object.keys(e);if(!vie)return t;var n=Object.getOwnPropertySymbols(e);return n.length?[].concat(t,n.filter(function(r){return Hw.propertyIsEnumerable.call(e,r)})):t}var qw=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:vie?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function yie(e){return e===null?null:typeof e=="object"?""+e:e}function Bu(e,t){return Hw.hasOwnProperty.call(e,t)}var tOe=Object.getOwnPropertyDescriptors||function(t){var n={};return qw(t).forEach(function(r){n[r]=DE(t,r)}),n};function Rs(e,t){return!!(e&t)}function Ns(e,t,n){return n?e|=t:e&=~t,e}function IH(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nOe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,iOe(r.key),r)}}function Ag(e,t,n){return t&&nOe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zh(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=aOe(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
30
30
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cd(){return Cd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cd.apply(null,arguments)}function xie(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,HD(e,t)}function HD(e,t){return HD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},HD(e,t)}function rOe(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function iOe(e){var t=rOe(e,"string");return typeof t=="symbol"?t:t+""}function aOe(e,t){if(e){if(typeof e=="string")return IH(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?IH(e,t):void 0}}var yl=Symbol("mobx-stored-annotations");function Cl(e){function t(n,r){if(V0(r))return e.decorate_20223_(n,r);W0(n,r,e)}return Object.assign(t,e)}function W0(e,t,n){Bu(e,yl)||Vw(e,yl,Cd({},e[yl])),fOe(n)||(e[yl][t]=n)}function sOe(e){return Bu(e,yl)||Vw(e,yl,Cd({},e[yl])),e[yl]}function V0(e){return typeof e=="object"&&typeof e.kind=="string"}var Kt=Symbol("mobx administration"),Pd=(function(){function e(n){n===void 0&&(n="Atom"),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Fn.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=n}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.reportObserved=function(){return jie(this)},t.reportChanged=function(){Ya(),Fie(this),Xa()},t.toString=function(){return this.name_},Ag(e,[{key:"isBeingObserved",get:function(){return Rs(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Rs(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Rs(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ns(this.flags_,e.diffValueMask_,r===1)}}])})();Pd.isBeingObservedMask_=1;Pd.isPendingUnobservationMask_=2;Pd.diffValueMask_=4;var D3=Ld("Atom",Pd);function LE(e,t,n){t===void 0&&(t=$h),n===void 0&&(n=$h);var r=new Pd(e);return t!==$h&&mRe(r,t),n!==$h&&qie(r,n),r}function oOe(e,t){return uae(e,t)}function lOe(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var km={structural:oOe,default:lOe};function cp(e,t,n){return Zie(e)?e:Array.isArray(e)?kr.array(e,{name:n}):wd(e)?kr.object(e,void 0,{name:n}):Tg(e)?kr.map(e,{name:n}):Tu(e)?kr.set(e,{name:n}):typeof e=="function"&&!Om(e)&&!by(e)?gie(e)?Nm(e):gy(n,e):e}function uOe(e,t,n){if(e==null||Jo(e)||Vl(e)||So(e)||wa(e))return e;if(Array.isArray(e))return kr.array(e,{name:n,deep:!1});if(wd(e))return kr.object(e,void 0,{name:n,deep:!1});if(Tg(e))return kr.map(e,{name:n,deep:!1});if(Tu(e))return kr.set(e,{name:n,deep:!1})}function Gw(e){return e}function cOe(e,t){return uae(e,t)?t:e}var dOe="override";function fOe(e){return e.annotationType_===dOe}function q0(e,t){return{annotationType_:e,options_:t,make_:pOe,extend_:hOe,decorate_20223_:mOe}}function pOe(e,t,n,r){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,n,!1)===null?0:1;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if(Om(n.value))return 1;var a=Sie(e,this,t,n,!1);return wl(r,t,a),2}function hOe(e,t,n,r){var i=Sie(e,this,t,n);return e.defineProperty_(t,i,r)}function mOe(e,t){var n=t.kind,r=t.name,i=t.addInitializer,a=this,s=function(u){var p,d,m,g;return Td((p=(d=a.options_)==null?void 0:d.name)!=null?p:r.toString(),u,(m=(g=a.options_)==null?void 0:g.autoAction)!=null?m:!1)};if(n=="field")return function(l){var u,p=l;return Om(p)||(p=s(p)),(u=a.options_)!=null&&u.bound&&(p=p.bind(this),p.isMobxAction=!0),p};if(n=="method"){var o;return Om(e)||(e=s(e)),(o=this.options_)!=null&&o.bound&&i(function(){var l=this,u=l[r].bind(l);u.isMobxAction=!0,l[r]=u}),e}hn("Cannot apply '"+a.annotationType_+"' to '"+String(r)+"' (kind: "+n+"):"+(`
31
31
  '`+a.annotationType_+"' can only be used on properties with a function value."))}function gOe(e,t,n,r){t.annotationType_,r.value}function Sie(e,t,n,r,i){var a,s,o,l,u,p,d;i===void 0&&(i=mt.safeDescriptors),gOe(e,t,n,r);var m=r.value;if((a=t.options_)!=null&&a.bound){var g;m=m.bind((g=e.proxy_)!=null?g:e.target_)}return{value:Td((s=(o=t.options_)==null?void 0:o.name)!=null?s:n.toString(),m,(l=(u=t.options_)==null?void 0:u.autoAction)!=null?l:!1,(p=t.options_)!=null&&p.bound?(d=e.proxy_)!=null?d:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function Eie(e,t){return{annotationType_:e,options_:t,make_:bOe,extend_:vOe,decorate_20223_:yOe}}function bOe(e,t,n,r){var i;if(r===e.target_)return this.extend_(e,t,n,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!Bu(e.target_,t)||!by(e.target_[t]))&&this.extend_(e,t,n,!1)===null)return 0;if(by(n.value))return 1;var a=_ie(e,this,t,n,!1,!1);return wl(r,t,a),2}function vOe(e,t,n,r){var i,a=_ie(e,this,t,n,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,a,r)}function yOe(e,t){var n,r=t.name,i=t.addInitializer;return by(e)||(e=Nm(e)),(n=this.options_)!=null&&n.bound&&i(function(){var a=this,s=a[r].bind(a);s.isMobXFlow=!0,a[r]=s}),e}function xOe(e,t,n,r){t.annotationType_,r.value}function _ie(e,t,n,r,i,a){a===void 0&&(a=mt.safeDescriptors),xOe(e,t,n,r);var s=r.value;if(by(s)||(s=Nm(s)),i){var o;s=s.bind((o=e.proxy_)!=null?o:e.target_),s.isMobXFlow=!0}return{value:s,configurable:a?e.isPlainObject_:!0,enumerable:!1,writable:!a}}function L3(e,t){return{annotationType_:e,options_:t,make_:SOe,extend_:EOe,decorate_20223_:_Oe}}function SOe(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function EOe(e,t,n,r){return wOe(e,this,t,n),e.defineComputedProperty_(t,Cd({},this.options_,{get:n.get,set:n.set}),r)}function _Oe(e,t){var n=this,r=t.name,i=t.addInitializer;return i(function(){var a=Og(this)[Kt],s=Cd({},n.options_,{get:e,context:this});s.name||(s.name="ObservableObject."+r.toString()),a.values_.set(r,new qo(s))}),function(){return this[Kt].getObservablePropValue_(r)}}function wOe(e,t,n,r){t.annotationType_,r.get}function Kw(e,t){return{annotationType_:e,options_:t,make_:COe,extend_:TOe,decorate_20223_:AOe}}function COe(e,t,n){return this.extend_(e,t,n,!1)===null?0:1}function TOe(e,t,n,r){var i,a;return kOe(e,this),e.defineObservableProperty_(t,n.value,(i=(a=this.options_)==null?void 0:a.enhancer)!=null?i:cp,r)}function AOe(e,t){var n=this,r=t.kind,i=t.name,a=new WeakSet;function s(o,l){var u,p,d=Og(o)[Kt],m=new vd(l,(u=(p=n.options_)==null?void 0:p.enhancer)!=null?u:cp,"ObservableObject."+i.toString(),!1);d.values_.set(i,m),a.add(o)}if(r=="accessor")return{get:function(){return a.has(this)||s(this,e.get.call(this)),this[Kt].getObservablePropValue_(i)},set:function(l){return a.has(this)||s(this,l),this[Kt].setObservablePropValue_(i,l)},init:function(l){return a.has(this)||s(this,l),l}}}function kOe(e,t,n,r){t.annotationType_}var OOe="true",ROe=wie();function wie(e){return{annotationType_:OOe,options_:e,make_:NOe,extend_:IOe,decorate_20223_:DOe}}function NOe(e,t,n,r){var i,a;if(n.get)return kg.make_(e,t,n,r);if(n.set){var s=Om(n.set)?n.set:Td(t.toString(),n.set);return r===e.target_?e.defineProperty_(t,{configurable:mt.safeDescriptors?e.isPlainObject_:!0,set:s})===null?0:2:(wl(r,t,{configurable:!0,set:s}),2)}if(r!==e.target_&&typeof n.value=="function"){var o;if(gie(n.value)){var l,u=(l=this.options_)!=null&&l.autoBind?Nm.bound:Nm;return u.make_(e,t,n,r)}var p=(o=this.options_)!=null&&o.autoBind?gy.bound:gy;return p.make_(e,t,n,r)}var d=((i=this.options_)==null?void 0:i.deep)===!1?kr.ref:kr;if(typeof n.value=="function"&&(a=this.options_)!=null&&a.autoBind){var m;n.value=n.value.bind((m=e.proxy_)!=null?m:e.target_)}return d.make_(e,t,n,r)}function IOe(e,t,n,r){var i,a;if(n.get)return kg.extend_(e,t,n,r);if(n.set)return e.defineProperty_(t,{configurable:mt.safeDescriptors?e.isPlainObject_:!0,set:Td(t.toString(),n.set)},r);if(typeof n.value=="function"&&(i=this.options_)!=null&&i.autoBind){var s;n.value=n.value.bind((s=e.proxy_)!=null?s:e.target_)}var o=((a=this.options_)==null?void 0:a.deep)===!1?kr.ref:kr;return o.extend_(e,t,n,r)}function DOe(e,t){hn("'"+this.annotationType_+"' cannot be used as a decorator")}var LOe="observable",POe="observable.ref",MOe="observable.shallow",jOe="observable.struct",Cie={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Cie);function lS(e){return e||Cie}var WD=Kw(LOe),FOe=Kw(POe,{enhancer:Gw}),BOe=Kw(MOe,{enhancer:uOe}),UOe=Kw(jOe,{enhancer:cOe}),Tie=Cl(WD);function uS(e){return e.deep===!0?cp:e.deep===!1?Gw:zOe(e.defaultDecorator)}function $Oe(e){var t;return e?(t=e.defaultDecorator)!=null?t:wie(e):void 0}function zOe(e){var t,n;return e&&(t=(n=e.options_)==null?void 0:n.enhancer)!=null?t:cp}function Aie(e,t,n){if(V0(t))return WD.decorate_20223_(e,t);if(up(t)){W0(e,t,WD);return}return Zie(e)?e:wd(e)?kr.object(e,t,n):Array.isArray(e)?kr.array(e,t):Tg(e)?kr.map(e,t):Tu(e)?kr.set(e,t):typeof e=="object"&&e!==null?e:kr.box(e,t)}pie(Aie,Tie);var HOe={box:function(t,n){var r=lS(n);return new vd(t,uS(r),r.name,!0,r.equals)},array:function(t,n){var r=lS(n);return(mt.useProxies===!1||r.proxy===!1?VRe:PRe)(t,uS(r),r.name)},map:function(t,n){var r=lS(n);return new B3(t,uS(r),r.name)},set:function(t,n){var r=lS(n);return new iae(t,uS(r),r.name)},object:function(t,n,r){return Ap(function(){return yRe(mt.useProxies===!1||r?.proxy===!1?Og({},r):IRe({},r),t,n)})},ref:Cl(FOe),shallow:Cl(BOe),deep:Tie,struct:Cl(UOe)},kr=pie(Aie,HOe),kie="computed",WOe="computed.struct",VD=L3(kie),VOe=L3(WOe,{equals:km.structural}),kg=function(t,n){if(V0(n))return VD.decorate_20223_(t,n);if(up(n))return W0(t,n,VD);if(wd(t))return Cl(L3(kie,t));var r=wd(n)?n:{};return r.get=t,r.name||(r.name=t.name||""),new qo(r)};Object.assign(kg,VD);kg.struct=Cl(VOe);var DH,LH,PE=0,qOe=1,GOe=(DH=(LH=DE(function(){},"name"))==null?void 0:LH.configurable)!=null?DH:!1,PH={value:"action",configurable:!0,writable:!1,enumerable:!1};function Td(e,t,n,r){n===void 0&&(n=!1);function i(){return Oie(e,n,t,r||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},GOe&&(PH.value=e,wl(i,"name",PH)),i}function Oie(e,t,n,r,i){var a=KOe(e,t);try{return n.apply(r,i)}catch(s){throw a.error_=s,s}finally{YOe(a)}}function KOe(e,t,n,r){var i=!1,a=0,s=mt.trackingDerivation,o=!t||!s;Ya();var l=mt.allowStateChanges;o&&(Tp(),l=Yw(!0));var u=P3(!0),p={runAsAction_:o,prevDerivation_:s,prevAllowStateChanges_:l,prevAllowStateReads_:u,notifySpy_:i,startTime_:a,actionId_:qOe++,parentActionId_:PE};return PE=p.actionId_,p}function YOe(e){PE!==e.actionId_&&hn(30),PE=e.parentActionId_,e.error_!==void 0&&(mt.suppressReactionErrors=!0),Xw(e.prevAllowStateChanges_),Iv(e.prevAllowStateReads_),Xa(),e.runAsAction_&&Uu(e.prevDerivation_),mt.suppressReactionErrors=!1}function Rie(e,t){var n=Yw(e);try{return t()}finally{Xw(n)}}function Yw(e){var t=mt.allowStateChanges;return mt.allowStateChanges=e,t}function Xw(e){mt.allowStateChanges=e}var vd=(function(e){function t(r,i,a,s,o){var l;return a===void 0&&(a="ObservableValue"),o===void 0&&(o=km.default),l=e.call(this,a)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=i,l.name_=a,l.equals=o,l.value_=i(r,void 0,a),l}xie(t,e);var n=t.prototype;return n.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},n.set=function(i){this.value_,i=this.prepareNewValue_(i),i!==mt.UNCHANGED&&this.setNewValue_(i)},n.prepareNewValue_=function(i){if(oo(this)){var a=lo(this,{object:this,type:Tl,newValue:i});if(!a)return mt.UNCHANGED;i=a.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?mt.UNCHANGED:i},n.setNewValue_=function(i){var a=this.value_;this.value_=i,this.reportChanged(),Bo(this)&&Uo(this,{type:Tl,object:this,newValue:i,oldValue:a})},n.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},n.intercept_=function(i){return G0(this,i)},n.observe_=function(i,a){return a&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:Tl,newValue:this.value_,oldValue:void 0}),K0(this,i)},n.raw=function(){return this.value_},n.toJSON=function(){return this.get()},n.toString=function(){return this.name_+"["+this.value_+"]"},n.valueOf=function(){return yie(this.get())},n[Symbol.toPrimitive]=function(){return this.valueOf()},t})(Pd),XOe=Ld("ObservableValue",vd),qo=(function(){function e(n){this.dependenciesState_=Fn.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Fn.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new jE(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=ME.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,n.get||hn(31),this.derivation=n.get,this.name_=n.name||"ComputedValue",n.set&&(this.setter_=Td("ComputedValue-setter",n.set)),this.equals_=n.equals||(n.compareStructural||n.struct?km.structural:km.default),this.scope_=n.context,this.requiresReaction_=n.requiresReaction,this.keepAlive_=!!n.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){nRe(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(r){return r()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(r){return r()})},t.get=function(){if(this.isComputing&&hn(32,this.name_,this.derivation),mt.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)qD(this)&&(this.warnAboutUntrackedRead_(),Ya(),this.value_=this.computeValue_(!1),Xa());else if(jie(this),qD(this)){var r=mt.trackingContext;this.keepAlive_&&!r&&(mt.trackingContext=this),this.trackAndCompute()&&tRe(this),mt.trackingContext=r}var i=this.value_;if(KS(i))throw i.cause;return i},t.set=function(r){if(this.setter_){this.isRunningSetter&&hn(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,r)}finally{this.isRunningSetter=!1}}else hn(34,this.name_)},t.trackAndCompute=function(){var r=this.value_,i=this.dependenciesState_===Fn.NOT_TRACKING_,a=this.computeValue_(!0),s=i||KS(r)||KS(a)||!this.equals_(r,a);return s&&(this.value_=a),s},t.computeValue_=function(r){this.isComputing=!0;var i=Yw(!1),a;if(r)a=Nie(this,this.derivation,this.scope_);else if(mt.disableErrorBoundaries===!0)a=this.derivation.call(this.scope_);else try{a=this.derivation.call(this.scope_)}catch(s){a=new jE(s)}return Xw(i),this.isComputing=!1,a},t.suspend_=function(){this.keepAlive_||(GD(this),this.value_=void 0)},t.observe_=function(r,i){var a=this,s=!0,o=void 0;return Wie(function(){var l=a.get();if(!s||i){var u=Tp();r({observableKind:"computed",debugObjectName:a.name_,type:Tl,object:a,newValue:l,oldValue:o}),Uu(u)}s=!1,o=l})},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return yie(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},Ag(e,[{key:"isComputing",get:function(){return Rs(this.flags_,e.isComputingMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isComputingMask_,r)}},{key:"isRunningSetter",get:function(){return Rs(this.flags_,e.isRunningSetterMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isRunningSetterMask_,r)}},{key:"isBeingObserved",get:function(){return Rs(this.flags_,e.isBeingObservedMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isBeingObservedMask_,r)}},{key:"isPendingUnobservation",get:function(){return Rs(this.flags_,e.isPendingUnobservationMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isPendingUnobservationMask_,r)}},{key:"diffValue",get:function(){return Rs(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ns(this.flags_,e.diffValueMask_,r===1)}}])})();qo.isComputingMask_=1;qo.isRunningSetterMask_=2;qo.isBeingObservedMask_=4;qo.isPendingUnobservationMask_=8;qo.diffValueMask_=16;var Zw=Ld("ComputedValue",qo),Fn;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Fn||(Fn={}));var ME;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(ME||(ME={}));var jE=function(t){this.cause=void 0,this.cause=t};function KS(e){return e instanceof jE}function qD(e){switch(e.dependenciesState_){case Fn.UP_TO_DATE_:return!1;case Fn.NOT_TRACKING_:case Fn.STALE_:return!0;case Fn.POSSIBLY_STALE_:{for(var t=P3(!0),n=Tp(),r=e.observing_,i=r.length,a=0;a<i;a++){var s=r[a];if(Zw(s)){if(mt.disableErrorBoundaries)s.get();else try{s.get()}catch{return Uu(n),Iv(t),!0}if(e.dependenciesState_===Fn.STALE_)return Uu(n),Iv(t),!0}}return Die(e),Uu(n),Iv(t),!1}}}function Nie(e,t,n){var r=P3(!0);Die(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++mt.runId;var i=mt.trackingDerivation;mt.trackingDerivation=e,mt.inBatch++;var a;if(mt.disableErrorBoundaries===!0)a=t.call(n);else try{a=t.call(n)}catch(s){a=new jE(s)}return mt.inBatch--,mt.trackingDerivation=i,ZOe(e),Iv(r),a}function ZOe(e){for(var t=e.observing_,n=e.observing_=e.newObserving_,r=Fn.UP_TO_DATE_,i=0,a=e.unboundDepsCount_,s=0;s<a;s++){var o=n[s];o.diffValue===0&&(o.diffValue=1,i!==s&&(n[i]=o),i++),o.dependenciesState_>r&&(r=o.dependenciesState_)}for(n.length=i,e.newObserving_=null,a=t.length;a--;){var l=t[a];l.diffValue===0&&Pie(l,e),l.diffValue=0}for(;i--;){var u=n[i];u.diffValue===1&&(u.diffValue=0,eRe(u,e))}r!==Fn.UP_TO_DATE_&&(e.dependenciesState_=r,e.onBecomeStale_())}function GD(e){var t=e.observing_;e.observing_=[];for(var n=t.length;n--;)Pie(t[n],e);e.dependenciesState_=Fn.NOT_TRACKING_}function Iie(e){var t=Tp();try{return e()}finally{Uu(t)}}function Tp(){var e=mt.trackingDerivation;return mt.trackingDerivation=null,e}function Uu(e){mt.trackingDerivation=e}function P3(e){var t=mt.allowStateReads;return mt.allowStateReads=e,t}function Iv(e){mt.allowStateReads=e}function Die(e){if(e.dependenciesState_!==Fn.UP_TO_DATE_){e.dependenciesState_=Fn.UP_TO_DATE_;for(var t=e.observing_,n=t.length;n--;)t[n].lowestObserverState_=Fn.UP_TO_DATE_}}var YS=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},XS=!0,Lie=!1,mt=(function(){var e=zw();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(XS=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new YS().version&&(XS=!1),XS?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new YS):(setTimeout(function(){Lie||hn(35)},1),new YS)})();function QOe(){if((mt.pendingReactions.length||mt.inBatch||mt.isRunningReactions)&&hn(36),Lie=!0,XS){var e=zw();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),mt=new YS}}function JOe(){return mt}function eRe(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Pie(e,t){e.observers_.delete(t),e.observers_.size===0&&Mie(e)}function Mie(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,mt.pendingUnobservations.push(e))}function Ya(){mt.inBatch++}function Xa(){if(--mt.inBatch===0){Bie();for(var e=mt.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,n.observers_.size===0&&(n.isBeingObserved&&(n.isBeingObserved=!1,n.onBUO()),n instanceof qo&&n.suspend_())}mt.pendingUnobservations=[]}}function jie(e){var t=mt.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&mt.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&mt.inBatch>0&&Mie(e),!1)}function Fie(e){e.lowestObserverState_!==Fn.STALE_&&(e.lowestObserverState_=Fn.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Fn.UP_TO_DATE_&&t.onBecomeStale_(),t.dependenciesState_=Fn.STALE_}))}function tRe(e){e.lowestObserverState_!==Fn.STALE_&&(e.lowestObserverState_=Fn.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Fn.POSSIBLY_STALE_?t.dependenciesState_=Fn.STALE_:t.dependenciesState_===Fn.UP_TO_DATE_&&(e.lowestObserverState_=Fn.UP_TO_DATE_)}))}function nRe(e){e.lowestObserverState_===Fn.UP_TO_DATE_&&(e.lowestObserverState_=Fn.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Fn.UP_TO_DATE_&&(t.dependenciesState_=Fn.POSSIBLY_STALE_,t.onBecomeStale_())}))}var Ml=(function(){function e(n,r,i,a){n===void 0&&(n="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Fn.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=ME.NONE,this.name_=n,this.onInvalidate_=r,this.errorHandler_=i,this.requiresObservable_=a}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,mt.pendingReactions.push(this),Bie())},t.runReaction_=function(){if(!this.isDisposed){Ya(),this.isScheduled=!1;var r=mt.trackingContext;if(mt.trackingContext=this,qD(this)){this.isTrackPending=!0;try{this.onInvalidate_()}catch(i){this.reportExceptionInDerivation_(i)}}mt.trackingContext=r,Xa()}},t.track=function(r){if(!this.isDisposed){Ya(),this.isRunning=!0;var i=mt.trackingContext;mt.trackingContext=this;var a=Nie(this,r,void 0);mt.trackingContext=i,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&GD(this),KS(a)&&this.reportExceptionInDerivation_(a.cause),Xa()}},t.reportExceptionInDerivation_=function(r){var i=this;if(this.errorHandler_){this.errorHandler_(r,this);return}if(mt.disableErrorBoundaries)throw r;var a="[mobx] uncaught error in '"+this+"'";mt.suppressReactionErrors||console.error(a,r),mt.globalReactionErrorHandlers.forEach(function(s){return s(r,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(Ya(),GD(this),Xa()))},t.getDisposer_=function(r){var i=this,a=function s(){i.dispose(),r==null||r.removeEventListener==null||r.removeEventListener("abort",s)};return r==null||r.addEventListener==null||r.addEventListener("abort",a),a[Kt]=this,"dispose"in Symbol&&typeof Symbol.dispose=="symbol"&&(a[Symbol.dispose]=a),a},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(r){},Ag(e,[{key:"isDisposed",get:function(){return Rs(this.flags_,e.isDisposedMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isDisposedMask_,r)}},{key:"isScheduled",get:function(){return Rs(this.flags_,e.isScheduledMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isScheduledMask_,r)}},{key:"isTrackPending",get:function(){return Rs(this.flags_,e.isTrackPendingMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isTrackPendingMask_,r)}},{key:"isRunning",get:function(){return Rs(this.flags_,e.isRunningMask_)},set:function(r){this.flags_=Ns(this.flags_,e.isRunningMask_,r)}},{key:"diffValue",get:function(){return Rs(this.flags_,e.diffValueMask_)?1:0},set:function(r){this.flags_=Ns(this.flags_,e.diffValueMask_,r===1)}}])})();Ml.isDisposedMask_=1;Ml.isScheduledMask_=2;Ml.isTrackPendingMask_=4;Ml.isRunningMask_=8;Ml.diffValueMask_=16;var rRe=100,KD=function(t){return t()};function Bie(){mt.inBatch>0||mt.isRunningReactions||KD(iRe)}function iRe(){mt.isRunningReactions=!0;for(var e=mt.pendingReactions,t=0;e.length>0;){++t===rRe&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction_()}mt.isRunningReactions=!1}var FE=Ld("Reaction",Ml);function aRe(e){var t=KD;KD=function(r){return e(function(){return t(r)})}}function Dv(){return!1}function sRe(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}}var Uie="action",oRe="action.bound",$ie="autoAction",lRe="autoAction.bound",zie="<unnamed action>",YD=q0(Uie),uRe=q0(oRe,{bound:!0}),XD=q0($ie,{autoAction:!0}),cRe=q0(lRe,{autoAction:!0,bound:!0});function Hie(e){var t=function(r,i){if(Ms(r))return Td(r.name||zie,r,e);if(Ms(i))return Td(r,i,e);if(V0(i))return(e?XD:YD).decorate_20223_(r,i);if(up(i))return W0(r,i,e?XD:YD);if(up(r))return Cl(q0(e?$ie:Uie,{name:r,autoAction:e}))};return t}var xi=Hie(!1);Object.assign(xi,YD);var gy=Hie(!0);Object.assign(gy,XD);xi.bound=Cl(uRe);gy.bound=Cl(cRe);function MH(e){return Oie(e.name||zie,!1,e,this,void 0)}function Om(e){return Ms(e)&&e.isMobxAction===!0}function Wie(e,t){var n,r,i,a;t===void 0&&(t=I3);var s=(n=(r=t)==null?void 0:r.name)!=null?n:"Autorun",o=!t.scheduler&&!t.delay,l;if(o)l=new Ml(s,function(){this.track(d)},t.onError,t.requiresObservable);else{var u=Vie(t),p=!1;l=new Ml(s,function(){p||(p=!0,u(function(){p=!1,l.isDisposed||l.track(d)}))},t.onError,t.requiresObservable)}function d(){e(l)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||l.schedule_(),l.getDisposer_((a=t)==null?void 0:a.signal)}var dRe=function(t){return t()};function Vie(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:dRe}function Rm(e,t,n){var r,i,a;n===void 0&&(n=I3);var s=(r=n.name)!=null?r:"Reaction",o=xi(s,n.onError?fRe(n.onError,t):t),l=!n.scheduler&&!n.delay,u=Vie(n),p=!0,d=!1,m,g=n.compareStructural?km.structural:n.equals||km.default,x=new Ml(s,function(){p||l?S():d||(d=!0,u(S))},n.onError,n.requiresObservable);function S(){if(d=!1,!x.isDisposed){var b=!1,y=m;x.track(function(){var v=Rie(!1,function(){return e(x)});b=p||!g(m,v),m=v}),(p&&n.fireImmediately||!p&&b)&&o(m,y,x),p=!1}}return(i=n)!=null&&(i=i.signal)!=null&&i.aborted||x.schedule_(),x.getDisposer_((a=n)==null?void 0:a.signal)}function fRe(e,t){return function(){try{return t.apply(this,arguments)}catch(n){e.call(this,n)}}}var pRe="onBO",hRe="onBUO";function mRe(e,t,n){return Gie(pRe,e,t,n)}function qie(e,t,n){return Gie(hRe,e,t,n)}function Gie(e,t,n,r){var i=Im(t),a=Ms(r)?r:n,s=e+"L";return i[s]?i[s].add(a):i[s]=new Set([a]),function(){var o=i[s];o&&(o.delete(a),o.size===0&&delete i[s])}}var gRe="never",cS="always",bRe="observed";function vRe(e){e.isolateGlobalState===!0&&QOe();var t=e.useProxies,n=e.enforceActions;if(t!==void 0&&(mt.useProxies=t===cS?!0:t===gRe?!1:typeof Proxy<"u"),t==="ifavailable"&&(mt.verifyProxies=!0),n!==void 0){var r=n===cS?cS:n===bRe;mt.enforceActions=r,mt.allowStateChanges=!(r===!0||r===cS)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(mt[i]=!!e[i])}),mt.allowStateReads=!mt.observableRequiresReaction,e.reactionScheduler&&aRe(e.reactionScheduler)}function yRe(e,t,n,r){var i=tOe(t);return Ap(function(){var a=Og(e,r)[Kt];qw(i).forEach(function(s){a.extend_(s,i[s],n&&s in n?n[s]:!0)})}),e}function xRe(e,t){return Kie(Im(e,t))}function Kie(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=SRe(e.observing_).map(Kie)),t}function SRe(e){return Array.from(new Set(e))}var ERe=0;function Yie(){this.message="FLOW_CANCELLED"}Yie.prototype=Object.create(Error.prototype);var Jk=Eie("flow"),_Re=Eie("flow.bound",{bound:!0}),Nm=Object.assign(function(t,n){if(V0(n))return Jk.decorate_20223_(t,n);if(up(n))return W0(t,n,Jk);var r=t,i=r.name||"<unnamed flow>",a=function(){var o=this,l=arguments,u=++ERe,p=xi(i+" - runid: "+u+" - init",r).apply(o,l),d,m=void 0,g=new Promise(function(x,S){var b=0;d=S;function y(C){m=void 0;var w;try{w=xi(i+" - runid: "+u+" - yield "+b++,p.next).call(p,C)}catch(A){return S(A)}_(w)}function v(C){m=void 0;var w;try{w=xi(i+" - runid: "+u+" - yield "+b++,p.throw).call(p,C)}catch(A){return S(A)}_(w)}function _(C){if(Ms(C?.then)){C.then(_,S);return}return C.done?x(C.value):(m=Promise.resolve(C.value),m.then(y,v))}y(void 0)});return g.cancel=xi(i+" - runid: "+u+" - cancel",function(){try{m&&jH(m);var x=p.return(void 0),S=Promise.resolve(x.value);S.then($h,$h),jH(S),d(new Yie)}catch(b){d(b)}}),g};return a.isMobXFlow=!0,a},Jk);Nm.bound=Cl(_Re);function jH(e){Ms(e.cancel)&&e.cancel()}function by(e){return e?.isMobXFlow===!0}function Xie(e,t,n){var r;return So(e)||Vl(e)||XOe(e)?r=jl(e):Jo(e)&&(r=jl(e,t)),r.dehancer=typeof t=="function"?t:n,function(){r.dehancer=void 0}}function M3(e,t,n){return Ms(n)?CRe(e,t,n):wRe(e,t)}function wRe(e,t){return jl(e).intercept_(t)}function CRe(e,t,n){return jl(e,t).intercept_(n)}function TRe(e,t){return e?Jo(e)||!!e[Kt]||D3(e)||FE(e)||Zw(e):!1}function Zie(e){return TRe(e)}function BE(e){if(Jo(e))return e[Kt].keys_();if(So(e)||wa(e))return Array.from(e.keys());if(Vl(e))return e.map(function(t,n){return n});hn(5)}function Qie(e){if(Jo(e))return BE(e).map(function(t){return e[t]});if(So(e))return BE(e).map(function(t){return e.get(t)});if(wa(e))return Array.from(e.values());if(Vl(e))return e.slice();hn(6)}function ARe(e){if(Jo(e))return BE(e).map(function(t){return[t,e[t]]});if(So(e))return BE(e).map(function(t){return[t,e.get(t)]});if(wa(e))return Array.from(e.entries());if(Vl(e))return e.map(function(t,n){return[n,t]});hn(7)}function Jie(e,t,n){if(arguments.length===2&&!wa(e)){Ya();var r=t;try{for(var i in r)Jie(e,i,r[i])}finally{Xa()}return}Jo(e)?e[Kt].set_(t,n):So(e)?e.set(t,n):wa(e)?e.add(t):Vl(e)?(typeof t!="number"&&(t=parseInt(t,10)),t<0&&hn("Invalid index: '"+t+"'"),Ya(),t>=e.length&&(e.length=t+1),e[t]=n,Xa()):hn(8)}function eae(e,t,n){if(Jo(e))return e[Kt].defineProperty_(t,n);hn(39)}function j3(e,t,n,r){return Ms(n)?ORe(e,t,n,r):kRe(e,t,n)}function kRe(e,t,n){return jl(e).observe_(t,n)}function ORe(e,t,n,r){return jl(e,t).observe_(n,r)}function Au(e,t){t===void 0&&(t=void 0),Ya();try{return e.apply(t)}finally{Xa()}}function FH(e,t,n){return arguments.length===1||t&&typeof t=="object"?RRe(e,t):tae(e,t,{})}function tae(e,t,n){var r;if(typeof n.timeout=="number"){var i=new Error("WHEN_TIMEOUT");r=setTimeout(function(){if(!s[Kt].isDisposed)if(s(),n.onError)n.onError(i);else throw i},n.timeout)}n.name="When";var a=Td("When-effect",t),s=Wie(function(o){var l=Rie(!1,e);l&&(o.dispose(),r&&clearTimeout(r),a())},n);return s}function RRe(e,t){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)return Object.assign(Promise.reject(new Error("WHEN_ABORTED")),{cancel:function(){return null}});var r,i,a=new Promise(function(s,o){var l,u=tae(e,s,Cd({},t,{onError:o}));r=function(){u(),o(new Error("WHEN_CANCELLED"))},i=function(){u(),o(new Error("WHEN_ABORTED"))},t==null||(l=t.signal)==null||l.addEventListener==null||l.addEventListener("abort",i)}).finally(function(){var s;return t==null||(s=t.signal)==null||s.removeEventListener==null?void 0:s.removeEventListener("abort",i)});return a.cancel=r,a}function Oh(e){return e[Kt]}var NRe={has:function(t,n){return Oh(t).has_(n)},get:function(t,n){return Oh(t).get_(n)},set:function(t,n,r){var i;return up(n)?(i=Oh(t).set_(n,r,!0))!=null?i:!0:!1},deleteProperty:function(t,n){var r;return up(n)?(r=Oh(t).delete_(n,!0))!=null?r:!0:!1},defineProperty:function(t,n,r){var i;return(i=Oh(t).defineProperty_(n,r))!=null?i:!0},ownKeys:function(t){return Oh(t).ownKeys_()},preventExtensions:function(t){hn(13)}};function IRe(e,t){var n,r;return hie(),e=Og(e,t),(r=(n=e[Kt]).proxy_)!=null?r:n.proxy_=new Proxy(e,NRe)}function oo(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function G0(e,t){var n=e.interceptors_||(e.interceptors_=[]);return n.push(t),mie(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function lo(e,t){var n=Tp();try{for(var r=[].concat(e.interceptors_||[]),i=0,a=r.length;i<a&&(t=r[i](t),t&&!t.type&&hn(14),!!t);i++);return t}finally{Uu(n)}}function Bo(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function K0(e,t){var n=e.changeListeners_||(e.changeListeners_=[]);return n.push(t),mie(function(){var r=n.indexOf(t);r!==-1&&n.splice(r,1)})}function Uo(e,t){var n=Tp(),r=e.changeListeners_;if(r){r=r.slice();for(var i=0,a=r.length;i<a;i++)r[i](t);Uu(n)}}function nae(e,t,n){return Ap(function(){var r,i=Og(e,n)[Kt];(r=t)!=null||(t=sOe(e)),qw(t).forEach(function(a){return i.make_(a,t[a])})}),e}var BH="splice",Tl="update",DRe=1e4,LRe={get:function(t,n){var r=t[Kt];return n===Kt?r:n==="length"?r.getArrayLength_():typeof n=="string"&&!isNaN(n)?r.get_(parseInt(n)):Bu(UE,n)?UE[n]:t[n]},set:function(t,n,r){var i=t[Kt];return n==="length"&&i.setArrayLength_(r),typeof n=="symbol"||isNaN(n)?t[n]=r:i.set_(parseInt(n),r),!0},preventExtensions:function(){hn(15)}},F3=(function(){function e(n,r,i,a){n===void 0&&(n="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=a,this.atom_=new Pd(n),this.enhancer_=function(s,o){return r(s,o,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.dehanceValues_=function(r){return this.dehancer!==void 0&&r.length>0?r.map(this.dehancer):r},t.intercept_=function(r){return G0(this,r)},t.observe_=function(r,i){return i===void 0&&(i=!1),i&&r({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),K0(this,r)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(r){(typeof r!="number"||isNaN(r)||r<0)&&hn("Out of range: "+r);var i=this.values_.length;if(r!==i)if(r>i){for(var a=new Array(r-i),s=0;s<r-i;s++)a[s]=void 0;this.spliceWithArray_(i,0,a)}else this.spliceWithArray_(r,i-r)},t.updateArrayLength_=function(r,i){r!==this.lastKnownLength_&&hn(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&lae(r+i+1)},t.spliceWithArray_=function(r,i,a){var s=this;this.atom_;var o=this.values_.length;if(r===void 0?r=0:r>o?r=o:r<0&&(r=Math.max(0,o+r)),arguments.length===1?i=o-r:i==null?i=0:i=Math.max(0,Math.min(i,o-r)),a===void 0&&(a=zD),oo(this)){var l=lo(this,{object:this.proxy_,type:BH,index:r,removedCount:i,added:a});if(!l)return zD;i=l.removedCount,a=l.added}if(a=a.length===0?a:a.map(function(d){return s.enhancer_(d,void 0)}),this.legacyMode_){var u=a.length-i;this.updateArrayLength_(o,u)}var p=this.spliceItemsIntoValues_(r,i,a);return(i!==0||a.length!==0)&&this.notifyArraySplice_(r,a,p),this.dehanceValues_(p)},t.spliceItemsIntoValues_=function(r,i,a){if(a.length<DRe){var s;return(s=this.values_).splice.apply(s,[r,i].concat(a))}else{var o=this.values_.slice(r,r+i),l=this.values_.slice(r+i);this.values_.length+=a.length-i;for(var u=0;u<a.length;u++)this.values_[r+u]=a[u];for(var p=0;p<l.length;p++)this.values_[r+a.length+p]=l[p];return o}},t.notifyArrayChildUpdate_=function(r,i,a){var s=!this.owned_&&Dv(),o=Bo(this),l=o||s?{observableKind:"array",object:this.proxy_,type:Tl,debugObjectName:this.atom_.name_,index:r,newValue:i,oldValue:a}:null;this.atom_.reportChanged(),o&&Uo(this,l)},t.notifyArraySplice_=function(r,i,a){var s=!this.owned_&&Dv(),o=Bo(this),l=o||s?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:BH,index:r,removed:a,added:i,removedCount:a.length,addedCount:i.length}:null;this.atom_.reportChanged(),o&&Uo(this,l)},t.get_=function(r){if(this.legacyMode_&&r>=this.values_.length){console.warn("[mobx] Out of bounds read: "+r);return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[r])},t.set_=function(r,i){var a=this.values_;if(this.legacyMode_&&r>a.length&&hn(17,r,a.length),r<a.length){this.atom_;var s=a[r];if(oo(this)){var o=lo(this,{type:Tl,object:this.proxy_,index:r,newValue:i});if(!o)return;i=o.newValue}i=this.enhancer_(i,s);var l=i!==s;l&&(a[r]=i,this.notifyArrayChildUpdate_(r,i,s))}else{for(var u=new Array(r+1-a.length),p=0;p<u.length-1;p++)u[p]=void 0;u[u.length-1]=i,this.spliceWithArray_(a.length,0,u)}},e})();function PRe(e,t,n,r){return n===void 0&&(n="ObservableArray"),r===void 0&&(r=!1),hie(),Ap(function(){var i=new F3(n,t,r,!1);bie(i.values_,Kt,i);var a=new Proxy(i.values_,LRe);return i.proxy_=a,e&&e.length&&i.spliceWithArray_(0,0,e),a})}var UE={clear:function(){return this.splice(0)},replace:function(t){var n=this[Kt];return n.spliceWithArray_(0,n.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];var s=this[Kt];switch(arguments.length){case 0:return[];case 1:return s.spliceWithArray_(t);case 2:return s.spliceWithArray_(t,n)}return s.spliceWithArray_(t,n,i)},spliceWithArray:function(t,n,r){return this[Kt].spliceWithArray_(t,n,r)},push:function(){for(var t=this[Kt],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,r),t.values_.length},pop:function(){return this.splice(Math.max(this[Kt].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[Kt],n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.spliceWithArray_(0,0,r),t.values_.length},reverse:function(){return mt.trackingDerivation&&hn(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){mt.trackingDerivation&&hn(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var n=this[Kt],r=n.dehanceValues_(n.values_).indexOf(t);return r>-1?(this.splice(r,1),!0):!1}};gr("at",Fs);gr("concat",Fs);gr("flat",Fs);gr("includes",Fs);gr("indexOf",Fs);gr("join",Fs);gr("lastIndexOf",Fs);gr("slice",Fs);gr("toString",Fs);gr("toLocaleString",Fs);gr("toSorted",Fs);gr("toSpliced",Fs);gr("with",Fs);gr("every",Qo);gr("filter",Qo);gr("find",Qo);gr("findIndex",Qo);gr("findLast",Qo);gr("findLastIndex",Qo);gr("flatMap",Qo);gr("forEach",Qo);gr("map",Qo);gr("some",Qo);gr("toReversed",Qo);gr("reduce",rae);gr("reduceRight",rae);function gr(e,t){typeof Array.prototype[e]=="function"&&(UE[e]=t(e))}function Fs(e){return function(){var t=this[Kt];t.atom_.reportObserved();var n=t.dehanceValues_(t.values_);return n[e].apply(n,arguments)}}function Qo(e){return function(t,n){var r=this,i=this[Kt];i.atom_.reportObserved();var a=i.dehanceValues_(i.values_);return a[e](function(s,o){return t.call(n,s,o,r)})}}function rae(e){return function(){var t=this,n=this[Kt];n.atom_.reportObserved();var r=n.dehanceValues_(n.values_),i=arguments[0];return arguments[0]=function(a,s,o){return i(a,s,o,t)},r[e].apply(r,arguments)}}var MRe=Ld("ObservableArrayAdministration",F3);function Vl(e){return Ww(e)&&MRe(e[Kt])}var jRe={},sd="add",$E="delete",B3=(function(){function e(n,r,i){var a=this;r===void 0&&(r=cp),i===void 0&&(i="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[Kt]=jRe,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=r,this.name_=i,Ms(Map)||hn(18),Ap(function(){a.keysAtom_=LE("ObservableMap.keys()"),a.data_=new Map,a.hasMap_=new Map,n&&a.merge(n)})}var t=e.prototype;return t.has_=function(r){return this.data_.has(r)},t.has=function(r){var i=this;if(!mt.trackingDerivation)return this.has_(r);var a=this.hasMap_.get(r);if(!a){var s=a=new vd(this.has_(r),Gw,"ObservableMap.key?",!1);this.hasMap_.set(r,s),qie(s,function(){return i.hasMap_.delete(r)})}return a.get()},t.set=function(r,i){var a=this.has_(r);if(oo(this)){var s=lo(this,{type:a?Tl:sd,object:this,newValue:i,name:r});if(!s)return this;i=s.newValue}return a?this.updateValue_(r,i):this.addValue_(r,i),this},t.delete=function(r){var i=this;if(this.keysAtom_,oo(this)){var a=lo(this,{type:$E,object:this,name:r});if(!a)return!1}if(this.has_(r)){var s=Dv(),o=Bo(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:$E,object:this,oldValue:this.data_.get(r).value_,name:r}:null;return Au(function(){var u;i.keysAtom_.reportChanged(),(u=i.hasMap_.get(r))==null||u.setNewValue_(!1);var p=i.data_.get(r);p.setNewValue_(void 0),i.data_.delete(r)}),o&&Uo(this,l),!0}return!1},t.updateValue_=function(r,i){var a=this.data_.get(r);if(i=a.prepareNewValue_(i),i!==mt.UNCHANGED){var s=Dv(),o=Bo(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:Tl,object:this,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),o&&Uo(this,l)}},t.addValue_=function(r,i){var a=this;this.keysAtom_,Au(function(){var u,p=new vd(i,a.enhancer_,"ObservableMap.key",!1);a.data_.set(r,p),i=p.value_,(u=a.hasMap_.get(r))==null||u.setNewValue_(!0),a.keysAtom_.reportChanged()});var s=Dv(),o=Bo(this),l=o||s?{observableKind:"map",debugObjectName:this.name_,type:sd,object:this,name:r,newValue:i}:null;o&&Uo(this,l)},t.get=function(r){return this.has(r)?this.dehanceValue_(this.data_.get(r).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var r=this,i=this.keys();return UH({next:function(){var s=i.next(),o=s.done,l=s.value;return{done:o,value:o?void 0:r.get(l)}}})},t.entries=function(){var r=this,i=this.keys();return UH({next:function(){var s=i.next(),o=s.done,l=s.value;return{done:o,value:o?void 0:[l,r.get(l)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(r,i){for(var a=zh(this),s;!(s=a()).done;){var o=s.value,l=o[0],u=o[1];r.call(i,u,l,this)}},t.merge=function(r){var i=this;return So(r)&&(r=new Map(r)),Au(function(){wd(r)?eOe(r).forEach(function(a){return i.set(a,r[a])}):Array.isArray(r)?r.forEach(function(a){var s=a[0],o=a[1];return i.set(s,o)}):Tg(r)?(J2e(r)||hn(19,r),r.forEach(function(a,s){return i.set(s,a)})):r!=null&&hn(20,r)}),this},t.clear=function(){var r=this;Au(function(){Iie(function(){for(var i=zh(r.keys()),a;!(a=i()).done;){var s=a.value;r.delete(s)}})})},t.replace=function(r){var i=this;return Au(function(){for(var a=FRe(r),s=new Map,o=!1,l=zh(i.data_.keys()),u;!(u=l()).done;){var p=u.value;if(!a.has(p)){var d=i.delete(p);if(d)o=!0;else{var m=i.data_.get(p);s.set(p,m)}}}for(var g=zh(a.entries()),x;!(x=g()).done;){var S=x.value,b=S[0],y=S[1],v=i.data_.has(b);if(i.set(b,y),i.data_.has(b)){var _=i.data_.get(b);s.set(b,_),v||(o=!0)}}if(!o)if(i.data_.size!==s.size)i.keysAtom_.reportChanged();else for(var C=i.data_.keys(),w=s.keys(),A=C.next(),R=w.next();!A.done;){if(A.value!==R.value){i.keysAtom_.reportChanged();break}A=C.next(),R=w.next()}i.data_=s}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(r,i){return K0(this,r)},t.intercept_=function(r){return G0(this,r)},Ag(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])})(),So=Ld("ObservableMap",B3);function UH(e){return e[Symbol.toStringTag]="MapIterator",$3(e)}function FRe(e){if(Tg(e)||So(e))return e;if(Array.isArray(e))return new Map(e);if(wd(e)){var t=new Map;for(var n in e)t.set(n,e[n]);return t}else return hn(21,e)}var BRe={},iae=(function(){function e(n,r,i){var a=this;r===void 0&&(r=cp),i===void 0&&(i="ObservableSet"),this.name_=void 0,this[Kt]=BRe,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Ms(Set)||hn(22),this.enhancer_=function(s,o){return r(s,o,i)},Ap(function(){a.atom_=LE(a.name_),n&&a.replace(n)})}var t=e.prototype;return t.dehanceValue_=function(r){return this.dehancer!==void 0?this.dehancer(r):r},t.clear=function(){var r=this;Au(function(){Iie(function(){for(var i=zh(r.data_.values()),a;!(a=i()).done;){var s=a.value;r.delete(s)}})})},t.forEach=function(r,i){for(var a=zh(this),s;!(s=a()).done;){var o=s.value;r.call(i,o,o,this)}},t.add=function(r){var i=this;if(this.atom_,oo(this)){var a=lo(this,{type:sd,object:this,newValue:r});if(!a)return this;r=a.newValue}if(!this.has(r)){Au(function(){i.data_.add(i.enhancer_(r,void 0)),i.atom_.reportChanged()});var s=!1,o=Bo(this),l=o||s?{observableKind:"set",debugObjectName:this.name_,type:sd,object:this,newValue:r}:null;o&&Uo(this,l)}return this},t.delete=function(r){var i=this;if(oo(this)){var a=lo(this,{type:$E,object:this,oldValue:r});if(!a)return!1}if(this.has(r)){var s=!1,o=Bo(this),l=o||s?{observableKind:"set",debugObjectName:this.name_,type:$E,object:this,oldValue:r}:null;return Au(function(){i.atom_.reportChanged(),i.data_.delete(r)}),o&&Uo(this,l),!0}return!1},t.has=function(r){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(r))},t.entries=function(){var r=this.values();return $H({next:function(){var a=r.next(),s=a.value,o=a.done;return o?{value:void 0,done:o}:{value:[s,s],done:o}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var r=this,i=this.data_.values();return $H({next:function(){var s=i.next(),o=s.value,l=s.done;return l?{value:void 0,done:l}:{value:r.dehanceValue_(o),done:l}}})},t.intersection=function(r){if(Tu(r)&&!wa(r))return r.intersection(this);var i=new Set(this);return i.intersection(r)},t.union=function(r){if(Tu(r)&&!wa(r))return r.union(this);var i=new Set(this);return i.union(r)},t.difference=function(r){return new Set(this).difference(r)},t.symmetricDifference=function(r){if(Tu(r)&&!wa(r))return r.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(r)},t.isSubsetOf=function(r){return new Set(this).isSubsetOf(r)},t.isSupersetOf=function(r){return new Set(this).isSupersetOf(r)},t.isDisjointFrom=function(r){if(Tu(r)&&!wa(r))return r.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(r)},t.replace=function(r){var i=this;return wa(r)&&(r=new Set(r)),Au(function(){Array.isArray(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):Tu(r)?(i.clear(),r.forEach(function(a){return i.add(a)})):r!=null&&hn("Cannot initialize set from "+r)}),this},t.observe_=function(r,i){return K0(this,r)},t.intercept_=function(r){return G0(this,r)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},Ag(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])})(),wa=Ld("ObservableSet",iae);function $H(e){return e[Symbol.toStringTag]="SetIterator",$3(e)}var zH=Object.create(null),HH="remove",aae=(function(){function e(n,r,i,a){r===void 0&&(r=new Map),a===void 0&&(a=ROe),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=n,this.values_=r,this.name_=i,this.defaultAnnotation_=a,this.keysAtom_=new Pd("ObservableObject.keys"),this.isPlainObject_=wd(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(r){return this.values_.get(r).get()},t.setObservablePropValue_=function(r,i){var a=this.values_.get(r);if(a instanceof qo)return a.set(i),!0;if(oo(this)){var s=lo(this,{type:Tl,object:this.proxy_||this.target_,name:r,newValue:i});if(!s)return null;i=s.newValue}if(i=a.prepareNewValue_(i),i!==mt.UNCHANGED){var o=Bo(this),l=!1,u=o||l?{type:Tl,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:a.value_,name:r,newValue:i}:null;a.setNewValue_(i),o&&Uo(this,u)}return!0},t.get_=function(r){return mt.trackingDerivation&&!Bu(this.target_,r)&&this.has_(r),this.target_[r]},t.set_=function(r,i,a){return a===void 0&&(a=!1),Bu(this.target_,r)?this.values_.has(r)?this.setObservablePropValue_(r,i):a?Reflect.set(this.target_,r,i):(this.target_[r]=i,!0):this.extend_(r,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,a)},t.has_=function(r){if(!mt.trackingDerivation)return r in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(r);return i||(i=new vd(r in this.target_,Gw,"ObservableObject.key?",!1),this.pendingKeys_.set(r,i)),i.get()},t.make_=function(r,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(!(r in this.target_)){var a;if((a=this.target_[yl])!=null&&a[r])return;hn(1,i.annotationType_,this.name_+"."+r.toString())}for(var s=this.target_;s&&s!==Hw;){var o=DE(s,r);if(o){var l=i.make_(this,r,o,s);if(l===0)return;if(l===1)break}s=Object.getPrototypeOf(s)}VH(this,i,r)}},t.extend_=function(r,i,a,s){if(s===void 0&&(s=!1),a===!0&&(a=this.defaultAnnotation_),a===!1)return this.defineProperty_(r,i,s);var o=a.extend_(this,r,i,s);return o&&VH(this,a,r),o},t.defineProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ya();var s=this.delete_(r);if(!s)return s;if(oo(this)){var o=lo(this,{object:this.proxy_||this.target_,name:r,type:sd,newValue:i.value});if(!o)return null;var l=o.newValue;i.value!==l&&(i=Cd({},i,{value:l}))}if(a){if(!Reflect.defineProperty(this.target_,r,i))return!1}else wl(this.target_,r,i);this.notifyPropertyAddition_(r,i.value)}finally{Xa()}return!0},t.defineObservableProperty_=function(r,i,a,s){s===void 0&&(s=!1),this.keysAtom_;try{Ya();var o=this.delete_(r);if(!o)return o;if(oo(this)){var l=lo(this,{object:this.proxy_||this.target_,name:r,type:sd,newValue:i});if(!l)return null;i=l.newValue}var u=WH(r),p={configurable:mt.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:u.get,set:u.set};if(s){if(!Reflect.defineProperty(this.target_,r,p))return!1}else wl(this.target_,r,p);var d=new vd(i,a,"ObservableObject.key",!1);this.values_.set(r,d),this.notifyPropertyAddition_(r,d.value_)}finally{Xa()}return!0},t.defineComputedProperty_=function(r,i,a){a===void 0&&(a=!1),this.keysAtom_;try{Ya();var s=this.delete_(r);if(!s)return s;if(oo(this)){var o=lo(this,{object:this.proxy_||this.target_,name:r,type:sd,newValue:void 0});if(!o)return null}i.name||(i.name="ObservableObject.key"),i.context=this.proxy_||this.target_;var l=WH(r),u={configurable:mt.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(a){if(!Reflect.defineProperty(this.target_,r,u))return!1}else wl(this.target_,r,u);this.values_.set(r,new qo(i)),this.notifyPropertyAddition_(r,void 0)}finally{Xa()}return!0},t.delete_=function(r,i){if(i===void 0&&(i=!1),this.keysAtom_,!Bu(this.target_,r))return!0;if(oo(this)){var a=lo(this,{object:this.proxy_||this.target_,name:r,type:HH});if(!a)return null}try{var s;Ya();var o=Bo(this),l=!1,u=this.values_.get(r),p=void 0;if(!u&&(o||l)){var d;p=(d=DE(this.target_,r))==null?void 0:d.value}if(i){if(!Reflect.deleteProperty(this.target_,r))return!1}else delete this.target_[r];if(u&&(this.values_.delete(r),u instanceof vd&&(p=u.value_),Fie(u)),this.keysAtom_.reportChanged(),(s=this.pendingKeys_)==null||(s=s.get(r))==null||s.set(r in this.target_),o||l){var m={type:HH,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:p,name:r};o&&Uo(this,m)}}finally{Xa()}return!0},t.observe_=function(r,i){return K0(this,r)},t.intercept_=function(r){return G0(this,r)},t.notifyPropertyAddition_=function(r,i){var a,s=Bo(this),o=!1;if(s||o){var l=s||o?{type:sd,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:r,newValue:i}:null;s&&Uo(this,l)}(a=this.pendingKeys_)==null||(a=a.get(r))==null||a.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),qw(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e})();function Og(e,t){var n;if(Bu(e,Kt))return e;var r=(n=t?.name)!=null?n:"ObservableObject",i=new aae(e,new Map,String(r),$Oe(t));return Vw(e,Kt,i),e}var URe=Ld("ObservableObjectAdministration",aae);function WH(e){return zH[e]||(zH[e]={get:function(){return this[Kt].getObservablePropValue_(e)},set:function(n){return this[Kt].setObservablePropValue_(e,n)}})}function Jo(e){return Ww(e)?URe(e[Kt]):!1}function VH(e,t,n){var r;(r=e.target_[yl])==null||delete r[n]}var $Re=oae(0),zRe=(function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1})(),e2=0,sae=function(){};function HRe(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}HRe(sae,Array.prototype);var U3=(function(e){function t(r,i,a,s){var o;return a===void 0&&(a="ObservableArray"),s===void 0&&(s=!1),o=e.call(this)||this,Ap(function(){var l=new F3(a,i,s,!0);l.proxy_=o,bie(o,Kt,l),r&&r.length&&o.spliceWithArray(0,0,r),zRe&&Object.defineProperty(o,"0",$Re)}),o}xie(t,e);var n=t.prototype;return n.concat=function(){this[Kt].atom_.reportObserved();for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return Array.prototype.concat.apply(this.slice(),a.map(function(o){return Vl(o)?o.slice():o}))},n[Symbol.iterator]=function(){var r=this,i=0;return $3({next:function(){return i<r.length?{value:r[i++],done:!1}:{done:!0,value:void 0}}})},Ag(t,[{key:"length",get:function(){return this[Kt].getArrayLength_()},set:function(i){this[Kt].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])})(sae);Object.entries(UE).forEach(function(e){var t=e[0],n=e[1];t!=="concat"&&Vw(U3.prototype,t,n)});function oae(e){return{enumerable:!1,configurable:!0,get:function(){return this[Kt].get_(e)},set:function(n){this[Kt].set_(e,n)}}}function WRe(e){wl(U3.prototype,""+e,oae(e))}function lae(e){if(e>e2){for(var t=e2;t<e+100;t++)WRe(t);e2=e}}lae(1e3);function VRe(e,t,n){return new U3(e,t,n)}function Im(e,t){if(typeof e=="object"&&e!==null){if(Vl(e))return t!==void 0&&hn(23),e[Kt].atom_;if(wa(e))return e.atom_;if(So(e)){if(t===void 0)return e.keysAtom_;var n=e.data_.get(t)||e.hasMap_.get(t);return n||hn(25,t,ZD(e)),n}if(Jo(e)){if(!t)return hn(26);var r=e[Kt].values_.get(t);return r||hn(27,t,ZD(e)),r}if(D3(e)||Zw(e)||FE(e))return e}else if(Ms(e)&&FE(e[Kt]))return e[Kt];hn(28)}function jl(e,t){if(e||hn(29),t!==void 0)return jl(Im(e,t));if(D3(e)||Zw(e)||FE(e)||So(e)||wa(e))return e;if(e[Kt])return e[Kt];hn(24,e)}function ZD(e,t){var n;if(t!==void 0)n=Im(e,t);else{if(Om(e))return e.name;Jo(e)||So(e)||wa(e)?n=jl(e):n=Im(e)}return n.name_}function Ap(e){var t=Tp(),n=Yw(!0);Ya();try{return e()}finally{Xa(),Xw(n),Uu(t)}}var qH=Hw.toString;function uae(e,t,n){return n===void 0&&(n=-1),QD(e,t,n)}function QD(e,t,n,r,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var a=typeof e;if(a!=="function"&&a!=="object"&&typeof t!="object")return!1;var s=qH.call(e);if(s!==qH.call(t))return!1;switch(s){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":n>=0&&n++;break}e=GH(e),t=GH(t);var o=s==="[object Array]";if(!o){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,u=t.constructor;if(l!==u&&!(Ms(l)&&l instanceof l&&Ms(u)&&u instanceof u)&&"constructor"in e&&"constructor"in t)return!1}if(n===0)return!1;n<0&&(n=-1),r=r||[],i=i||[];for(var p=r.length;p--;)if(r[p]===e)return i[p]===t;if(r.push(e),i.push(t),o){if(p=e.length,p!==t.length)return!1;for(;p--;)if(!QD(e[p],t[p],n-1,r,i))return!1}else{var d=Object.keys(e),m=d.length;if(Object.keys(t).length!==m)return!1;for(var g=0;g<m;g++){var x=d[g];if(!(Bu(t,x)&&QD(e[x],t[x],n-1,r,i)))return!1}}return r.pop(),i.pop(),!0}function GH(e){return Vl(e)?e.slice():Tg(e)||So(e)||Tu(e)||wa(e)?Array.from(e.entries()):e}var KH,qRe=((KH=zw().Iterator)==null?void 0:KH.prototype)||{};function $3(e){return e[Symbol.iterator]=GRe,Object.assign(Object.create(qRe),e)}function GRe(){return this}["Symbol","Map","Set"].forEach(function(e){var t=zw();typeof t[e]>"u"&&hn("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:sRe,extras:{getDebugName:ZD},$mobx:Kt});var YH={},KRe="warn";function YRe(){return KRe}var yi;(function(e){e.afterCreate="afterCreate",e.afterAttach="afterAttach",e.afterCreationFinalization="afterCreationFinalization",e.beforeDetach="beforeDetach",e.beforeDestroy="beforeDestroy"})(yi||(yi={}));var JD=function(e,t){return JD=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},JD(e,t)};function br(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");JD(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Za=function(){return Za=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},Za.apply(this,arguments)};function XRe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Lv(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yu(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return a}function Xu(e,t,n){if(arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function cae(e){return Bn(e).type}function ZRe(e,t){return Bn(e).onPatch(t)}function vy(e,t){Bn(e).applyPatches(Eae(t))}function XH(e,t){var n={patches:[],inversePatches:[]},r={},i,a={get recording(){return!!i},get patches(){return r.patches||(r.patches=n.patches.slice()),r.patches},get reversedInversePatches(){return r.reversedInversePatches||(r.reversedInversePatches=n.inversePatches.slice().reverse()),r.reversedInversePatches},get inversePatches(){return r.inversePatches||(r.inversePatches=n.inversePatches.slice()),r.inversePatches},stop:function(){i&&(i(),i=void 0)},resume:function(){i||(i=ZRe(e,function(s,o){n.patches.push(s),n.inversePatches.push(o),r.patches=void 0,r.inversePatches=void 0,r.reversedInversePatches=void 0}))},replay:function(s){vy(s||e,n.patches)},undo:function(s){vy(s||e,n.inversePatches.slice().reverse())}};return a.resume(),a}function QRe(e,t){t===void 0&&(t=!0);var n=Bn(e);return t?n.snapshot:n.type.getSnapshot(n,!1)}function dae(e){return Bn(e).root.storedValue}function JRe(e){return Bn(e).path}function eNe(e){return Bn(e).identifier}function zE(e){var t=Bn(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function eL(e){var t=Bn(e),n=t.root.environment;if(!n)throw new Lt("Failed to find the environment of ".concat(t," ").concat(t.path));return n}var fae=(function(){function e(t,n,r,i){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:qi.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=i,this.baseSetParent(n,r)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(t){var n=this.isAlive;this._state=t;var r=this.isAlive;this.aliveAtom&&n!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t){this._hookSubscribers&&this._hookSubscribers.emit(t,this,t)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return this._hookSubscribers||(this._hookSubscribers=new Cae),this._hookSubscribers.register(t,n)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){this._parent=t,this._subpath=n,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t&&(this.pathAtom||(this.pathAtom=LE("path")),this.pathAtom.reportObserved()),this.parent?(this._escapedSubpath===void 0&&(this._escapedSubpath=this._subpath?qf(this._subpath):""),this.parent.getEscapedPath(t)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return this.parent===null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==qi.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===qi.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=LE("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(t){if(this.state===qi.CREATED){if(this.parent){if(this.parent.state!==qi.FINALIZED)return;this.fireHook(yi.afterAttach)}this.state=qi.FINALIZED,t&&t()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=qi.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(yi.beforeDestroy)}}),e})(),yy=(function(e){br(t,e);function t(n,r,i,a,s){var o=e.call(this,n,r,i,a)||this;try{o.storedValue=n.createNewInstance(s)}catch(l){throw o.state=qi.DEAD,l}return o.state=qi.CREATED,o.finalizeCreation(),o}return Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new Lt("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this.parent!==n,a=this.subpath!==r;!i&&!a||(this.environment=void 0,this.baseSetParent(this.parent,r))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.getSnapshot()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(n).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===qi.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.fireInternalHook(n)}}),t})(fae);yy.prototype.die=xi(yy.prototype.die);var tNe=1,No;(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.CREATING=1]="CREATING",e[e.CREATED=2]="CREATED"})(No||(No={}));var ws;(function(e){e.Dispose="dispose",e.Patch="patch",e.Snapshot="snapshot"})(ws||(ws={}));var nNe={onError:function(e){throw e}},as=(function(e){br(t,e);function t(n,r,i,a,s){var o=e.call(this,n,r,i,a)||this;if(Object.defineProperty(o,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++tNe}),Object.defineProperty(o,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:No.UNINITIALIZED}),Object.defineProperty(o,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o._snapshotComputed=kg(function(){return o.getSnapshot()}),o.unbox=o.unbox.bind(o),o._initialSnapshot=s,o.identifierAttribute=n.identifierAttribute,r||(o.identifierCache=new pNe),o._childNodes=n.initializeChildNodes(o,o._initialSnapshot),o.identifier=null,o.unnormalizedIdentifier=null,o.identifierAttribute&&o._initialSnapshot){var l=o._initialSnapshot[o.identifierAttribute];if(l===void 0){var u=o._childNodes[o.identifierAttribute];u&&(l=u.value)}if(typeof l!="string"&&typeof l!="number")throw new Lt("Instance identifier '".concat(o.identifierAttribute,"' for type '").concat(o.type.name,"' must be a string or a number"));o.identifier=Y0(l),o.unnormalizedIdentifier=l}return r?r.root.identifierCache.addNodeToCache(o):o.identifierCache.addNodeToCache(o),o}return Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applyPatches(n)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.createObservableInstanceIfNeeded(),this._applySnapshot(n)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(n){n===void 0&&(n=!0),this._observableInstanceState===No.UNINITIALIZED&&this.createObservableInstance(n)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r,i,a,s;n===void 0&&(n=!0),this._observableInstanceState=No.CREATING;for(var o=[],l=this.parent;l&&l._observableInstanceState===No.UNINITIALIZED;)o.unshift(l),l=l.parent;try{for(var u=Lv(o),p=u.next();!p.done;p=u.next()){var d=p.value;d.createObservableInstanceIfNeeded(!1)}}catch(S){r={error:S}}finally{try{p&&!p.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}var m=this.type;try{this.storedValue=m.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,m.finalizeNewInstance(this,this.storedValue)}catch(S){throw this.state=qi.DEAD,S}finally{this._isRunningAction=!1}if(this._observableInstanceState=No.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=Pm,this.state=qi.CREATED,n){this.fireHook(yi.afterCreate),this.finalizeCreation();try{for(var g=Lv(o.reverse()),x=g.next();!x.done;x=g.next()){var d=x.value;d.fireHook(yi.afterCreate),d.finalizeCreation()}}catch(S){a={error:S}}finally{try{x&&!x.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var n=this.parent;return n?n.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(yi.beforeDetach);var n=this.state;this.state=qi.DETACHING;var r=this.root,i=r.environment,a=r.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=i,this.identifierCache=a}finally{this.state=n}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=n!==this.parent,a=r!==this.subpath;!i&&!a||(i?(this.environment=void 0,n.root.identifierCache.mergeCache(this),this.baseSetParent(n,r),this.fireHook(yi.afterAttach)):a&&this.baseSetParent(this.parent,r))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this;this.fireInternalHook(n);var i=this.storedValue&&typeof this.storedValue=="object"&&this.storedValue[n];typeof i=="function"&&(MH?MH(function(){i.apply(r.storedValue)}):i.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===No.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var n=this.type,r=this._childNodes,i=this._initialSnapshot;this._cachedInitialSnapshot=n.processInitialSnapshot(r,i),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isRunningAction?!0:this.isRoot?!1:this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=YRe();if(!this.isAlive&&r!=="ignore"){var i=this._getAssertAliveError(n);switch(r){case"error":throw new Lt(i);case"warn":CNe(i)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(n){var r=this.getEscapedPath(!1)||this.pathUponDeath||"",i=n.subpath&&qf(n.subpath)||"",a=n.actionContext||mae();a&&a.type!=="action"&&a.parentActionEvent&&(a=a.parentActionEvent);var s="";if(a&&a.name!=null){var o=a&&a.context&&JRe(a.context)||r;s="".concat(o,".").concat(a.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(r,"', Subpath: '").concat(i,"', Action: '").concat(s,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.assertAlive({subpath:n}),this._autoUnbox=!1;try{return this._observableInstanceState===No.CREATED?this.type.getChildNode(this,n):this._childNodes[n]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(Pm),this._autoUnbox=!1;try{return this._observableInstanceState===No.CREATED?this.type.getChildren(this):xae(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this.type.getChildType(n)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.assertAlive(n),!this.isRunningAction()&&this.isProtected)throw new Lt("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this.type.removeChild(this,n)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n&&(this.assertAlive({subpath:n.subpath||n.subpathUponDeath}),this._autoUnbox?n.value:n)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=(this.isAlive?this.path:this.pathUponDeath)||"<root>",r=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(n).concat(r).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this.baseFinalizeCreation(function(){var r,i;try{for(var a=Lv(n.getChildren()),s=a.next();!s.done;s=a.next()){var o=s.value;o.finalizeCreation()}}catch(l){r={error:l}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}n.fireInternalHook(yi.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new Lt("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;this._applyPatches=xy(this.storedValue,"@APPLY_PATCHES",function(r){r.forEach(function(i){if(!i.path){n.type.applySnapshot(n,i.value);return}var a=DNe(i.path),s=gNe(n,a.slice(0,-1));s.applyPatchLocally(a[a.length-1],i)})}),this._applySnapshot=xy(this.storedValue,"@APPLY_SNAPSHOT",function(r){if(r!==n.snapshot)return n.type.applySnapshot(n,r)}),Vf(this.storedValue,"$treenode",this),Vf(this.storedValue,"toJSON",mNe)}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){!this.isAlive||this.state===qi.DETACHING||(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==No.UNINITIALIZED&&(this.getChildren().forEach(function(n){n.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(ws.Dispose),this._internalEventsClear(ws.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(r){r.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var n=this.snapshot;this._snapshotUponDeath=n,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._addSnapshotReaction(),this._internalEventsRegister(ws.Snapshot,n)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEventsEmit(ws.Snapshot,n)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsRegister(ws.Patch,n)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){if(this._internalEventsHasSubscribers(ws.Patch)){var i=r.path.substr(this.path.length)+(n.path?"/"+n.path:""),a=ENe({},n,{path:i}),s=Yu(kNe(a),2),o=s[0],l=s[1];this._internalEventsEmit(ws.Patch,o,l)}this.parent&&this.parent.emitPatch(n,r)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return this._internalEventsHas(ws.Dispose,n)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this.hasDisposer(n)){this._internalEventsRegister(ws.Dispose,n,!0);return}throw new Lt("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(!this._internalEventsHas(ws.Dispose,n))throw new Lt("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(ws.Dispose,n)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(n){if(this.middlewares){var r=this.middlewares.indexOf(n);r>=0&&this.middlewares.splice(r,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){var i=this;r===void 0&&(r=!0);var a={handler:n,includeHooks:r};return this.middlewares?this.middlewares.push(a):this.middlewares=[a],function(){i.removeMiddleware(a)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this.assertWritable({subpath:n}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,n,r)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n=this;if(!this._hasSnapshotReaction){var r=Rm(function(){return n.snapshot},function(i){return n.emitSnapshot(i)},nNe);this.addDisposer(r),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return!!this._internalEvents&&this._internalEvents.hasSubscribers(n)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i){return i===void 0&&(i=!1),this._internalEvents||(this._internalEvents=new Cae),this._internalEvents.register(n,r,i)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!!this._internalEvents&&this._internalEvents.has(n,r)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){this._internalEvents&&this._internalEvents.unregister(n,r)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(n){for(var r,i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];this._internalEvents&&(r=this._internalEvents).emit.apply(r,Xu([n],Yu(i),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(n){this._internalEvents&&this._internalEvents.clear(n)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t})(fae);as.prototype.createObservableInstance=xi(as.prototype.createObservableInstance);as.prototype.detach=xi(as.prototype.detach);as.prototype.die=xi(as.prototype.die);var pae,kn;(function(e){e[e.String=1]="String",e[e.Number=2]="Number",e[e.Boolean=4]="Boolean",e[e.Date=8]="Date",e[e.Literal=16]="Literal",e[e.Array=32]="Array",e[e.Map=64]="Map",e[e.Object=128]="Object",e[e.Frozen=256]="Frozen",e[e.Optional=512]="Optional",e[e.Reference=1024]="Reference",e[e.Identifier=2048]="Identifier",e[e.Late=4096]="Late",e[e.Refinement=8192]="Refinement",e[e.Union=16384]="Union",e[e.Null=32768]="Null",e[e.Undefined=65536]="Undefined",e[e.Integer=131072]="Integer",e[e.Custom=262144]="Custom",e[e.SnapshotProcessor=524288]="SnapshotProcessor",e[e.Lazy=1048576]="Lazy",e[e.Finite=2097152]="Finite",e[e.Float=4194304]="Float"})(kn||(kn={}));var hae="cannotDetermine",rNe=Symbol("$type"),Zu=(function(){function e(t){Object.defineProperty(this,pae,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=t}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){return $u(this,t),this.instantiate(null,"",n,t).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){throw new Lt("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return t===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(t,n){var r=yae(t);if(r){var i=cae(t);return this.isAssignableFrom(i)?ss():us(n,t)}return this.isValidSnapshot(t,n)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.validate(t,[{path:"",type:this}]).length===0}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new Lt("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new Lt("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new Lt("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new Lt("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e})();pae=rNe;Zu.prototype.create=xi(Zu.prototype.create);var Dm=(function(e){br(t,e);function t(n){var r=e.call(this,n)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n===void 0&&(n=this.getDefaultSnapshot()),e.prototype.create.call(this,n,r)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.createObservableInstanceIfNeeded(),n.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return!n.identifierAttribute||n.identifier===Y0(r[n.identifierAttribute])}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r){return n.isDetaching?!1:n.snapshot===r||jr(r)&&Bn(r)===n?!0:n.type===this&&_ae(r)&&!jr(r)&&this.isMatchingSnapshotId(n,r)?(n.applySnapshot(r),!0):!1}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){var s=this.tryToReconcileNode(n,r);if(s)return n.setParent(i,a),n;if(n.die(),jr(r)&&this.isAssignableFrom(cae(r))){var o=Bn(r);return o.setParent(i,a),o}return this.instantiate(i,a,void 0,r)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t})(Zu);Dm.prototype.create=xi(Dm.prototype.create);var kp=(function(e){br(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(n,r,i,a){if(!n.isDetaching&&n.type===this&&n.storedValue===r)return n;var s=this.instantiate(i,a,void 0,r);return n.die(),s}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t})(Zu);function Qu(e){return typeof e=="object"&&e&&e.isType===!0}var iNe=1,Pv;function mae(){return Pv}function gae(){return iNe++}function tL(e,t){var n=Bn(e.context);e.type==="action"&&n.assertAlive({actionContext:e});var r=n._isRunningAction;n._isRunningAction=!0;var i=Pv;Pv=e;try{return sNe(n,e,t)}finally{Pv=i,n._isRunningAction=r}}function bae(e){if(e)return e.type==="action"?e:e.parentActionEvent}function xy(e,t,n){var r=function(){var i=gae(),a=Pv,s=bae(a);return tL({type:"action",name:t,id:i,args:Tae(arguments),context:e,tree:dae(e),rootId:a?a.rootId:i,parentId:a?a.id:0,allParentIds:a?Xu(Xu([],Yu(a.allParentIds),!1),[a.id],!1):[],parentEvent:a,parentActionEvent:s},n)};return r._isMSTAction=!0,r._isFlowAction=n._isFlowAction,r}var aNe=(function(){function e(t,n){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),n.$mst_middleware&&this.middlewares.push(n.$mst_middleware);for(var r=t;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var t=this.middlewares[this.arrayIndex];if(t){var n=t[this.inArrayIndex++];return n||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}}),e})();function sNe(e,t,n){var r=new aNe(e,n);if(r.isEmpty)return xi(n).apply(null,t.args);var i=null;function a(s){var o=r.getNextMiddleware(),l=o&&o.handler;if(!l)return xi(n).apply(null,s.args);if(!o.includeHooks&&yi[s.name])return a(s);function u(d,m){i=a(d),m&&(i=m(i))}function p(d){i=d}return l(s,u,p),i}return a(t)}function oNe(e){try{return JSON.stringify(e)}catch(t){return"<Unserializable: ".concat(t,">")}}function vae(e){return typeof e=="function"?"<function".concat(e.name?" "+e.name:"",">"):jr(e)?"<".concat(e,">"):"`".concat(oNe(e),"`")}function lNe(e){return e.length<280?e:"".concat(e.substring(0,272),"......").concat(e.substring(e.length-8))}function uNe(e){var t=e.value,n=e.context[e.context.length-1].type,r=e.context.map(function(o){var l=o.path;return l}).filter(function(o){return o.length>0}).join("/"),i=r.length>0?'at path "/'.concat(r,'" '):"",a=jr(t)?"value of type ".concat(Bn(t).type.name,":"):Sy(t)?"value":"snapshot",s=n&&jr(t)&&n.is(Bn(t).snapshot);return"".concat(i).concat(a," ").concat(vae(t)," is not assignable ").concat(n?"to type: `".concat(n.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(n?YNe(n)||Sy(t)?".":", expected an instance of `".concat(n.name,"` or a snapshot like `").concat(n.describe(),"` instead.")+(s?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function z3(e,t,n){return e.concat([{path:t,type:n}])}function ss(){return Lm}function us(e,t,n){return[{context:e,value:t,message:n}]}function Qw(e){return e.reduce(function(t,n){return t.concat(n)},[])}function $u(e,t){TNe()&&cNe(e,t)}function cNe(e,t){var n=e.validate(t,[{path:"",type:e}]);if(n.length>0)throw new Lt(dNe(e,t,n))}function dNe(e,t,n){if(n.length!==0)return"Error while converting ".concat(lNe(vae(t))," to `").concat(e.name,`\`:
32
32
 
package/dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/png" href="/logo.png" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vibora - Harness Attention. Ship.</title>
8
- <script type="module" crossorigin src="/assets/index-qlFZdJQI.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-jV_aEYsq.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-ZFlxFnMR.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibora",
3
- "version": "8.6.1",
3
+ "version": "8.6.2",
4
4
  "description": "Harness Attention. Orchestrate Agents. Ship.",
5
5
  "license": "PolyForm-Shield-1.0.0",
6
6
  "repository": {