@software-dlc/cli 0.193.1 → 0.193.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/cli.js +7 -2
- package/dist/cli.js.map +1 -1
- package/dist/local/app-contract-readers.d.ts +4 -1
- package/dist/local/app-contract-readers.d.ts.map +1 -1
- package/dist/local/app-contract-readers.js +29 -24
- package/dist/local/app-contract-readers.js.map +1 -1
- package/dist/local/app-tasks-read.d.ts +5 -0
- package/dist/local/app-tasks-read.d.ts.map +1 -1
- package/dist/local/app-tasks-read.js +6 -1
- package/dist/local/app-tasks-read.js.map +1 -1
- package/dist/local/managed-projection-change.d.ts +16 -0
- package/dist/local/managed-projection-change.d.ts.map +1 -1
- package/dist/local/managed-projection-change.js +66 -12
- package/dist/local/managed-projection-change.js.map +1 -1
- package/dist/local/open-anchor.d.ts +42 -0
- package/dist/local/open-anchor.d.ts.map +1 -0
- package/dist/local/open-anchor.js +193 -0
- package/dist/local/open-anchor.js.map +1 -0
- package/dist/local/projection.d.ts +16 -0
- package/dist/local/projection.d.ts.map +1 -1
- package/dist/local/projection.js +42 -0
- package/dist/local/projection.js.map +1 -1
- package/dist/local/store-busy.d.ts +4 -0
- package/dist/local/store-busy.d.ts.map +1 -0
- package/dist/local/store-busy.js +7 -0
- package/dist/local/store-busy.js.map +1 -0
- package/dist/local/workspace-cli.d.ts.map +1 -1
- package/dist/local/workspace-cli.js +7 -1
- package/dist/local/workspace-cli.js.map +1 -1
- package/dist/local/workspace-integration-runtime.d.ts +18 -1
- package/dist/local/workspace-integration-runtime.d.ts.map +1 -1
- package/dist/local/workspace-integration-runtime.js +259 -49
- package/dist/local/workspace-integration-runtime.js.map +1 -1
- package/dist/local/workspace-integration-trees.d.ts +106 -0
- package/dist/local/workspace-integration-trees.d.ts.map +1 -0
- package/dist/local/workspace-integration-trees.js +236 -0
- package/dist/local/workspace-integration-trees.js.map +1 -0
- package/dist/local/workspace-merge.d.ts +23 -0
- package/dist/local/workspace-merge.d.ts.map +1 -1
- package/dist/local/workspace-merge.js +55 -0
- package/dist/local/workspace-merge.js.map +1 -1
- package/dist/local/workspace-runtime.d.ts +2 -0
- package/dist/local/workspace-runtime.d.ts.map +1 -1
- package/dist/local/workspace-runtime.js +74 -1
- package/dist/local/workspace-runtime.js.map +1 -1
- package/dist/local/workspace-viewer-server.d.ts +6 -0
- package/dist/local/workspace-viewer-server.d.ts.map +1 -1
- package/dist/local/workspace-viewer-server.js +45 -5
- package/dist/local/workspace-viewer-server.js.map +1 -1
- package/dist/local/worktree-projection.d.ts +15 -1
- package/dist/local/worktree-projection.d.ts.map +1 -1
- package/dist/local/worktree-projection.js +25 -1
- package/dist/local/worktree-projection.js.map +1 -1
- package/dist/mcp/worktree.d.ts.map +1 -1
- package/dist/mcp/worktree.js +7 -2
- package/dist/mcp/worktree.js.map +1 -1
- package/package.json +1 -1
- package/viewer/assets/index-Bio9Q1RA.js +402 -0
- package/viewer/assets/index-DfiCo1QP.css +1 -0
- package/viewer/index.html +2 -2
- package/viewer/assets/index-BW6DmTkl.css +0 -1
- package/viewer/assets/index-CfeQSkRk.js +0 -401
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
function CS(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const l=Object.getOwnPropertyDescriptor(a,r);l&&Object.defineProperty(e,r,l.get?l:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function lj(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ij={exports:{}},td={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var RS=Symbol.for("react.transitional.element"),ES=Symbol.for("react.fragment");function oj(e,t,n){var a=null;if(n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:RS,type:e,key:a,ref:t!==void 0?t:null,props:n}}td.Fragment=ES;td.jsx=oj;td.jsxs=oj;ij.exports=td;var s=ij.exports,cj={exports:{}},Me={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Ym=Symbol.for("react.transitional.element"),TS=Symbol.for("react.portal"),AS=Symbol.for("react.fragment"),MS=Symbol.for("react.strict_mode"),$S=Symbol.for("react.profiler"),OS=Symbol.for("react.consumer"),DS=Symbol.for("react.context"),zS=Symbol.for("react.forward_ref"),LS=Symbol.for("react.suspense"),US=Symbol.for("react.memo"),uj=Symbol.for("react.lazy"),dg=Symbol.iterator;function BS(e){return e===null||typeof e!="object"?null:(e=dg&&e[dg]||e["@@iterator"],typeof e=="function"?e:null)}var dj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},fj=Object.assign,hj={};function Bl(e,t,n){this.props=e,this.context=t,this.refs=hj,this.updater=n||dj}Bl.prototype.isReactComponent={};Bl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Bl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function mj(){}mj.prototype=Bl.prototype;function Fm(e,t,n){this.props=e,this.context=t,this.refs=hj,this.updater=n||dj}var Km=Fm.prototype=new mj;Km.constructor=Fm;fj(Km,Bl.prototype);Km.isPureReactComponent=!0;var fg=Array.isArray,mt={H:null,A:null,T:null,S:null,V:null},pj=Object.prototype.hasOwnProperty;function Xm(e,t,n,a,r,l){return n=l.ref,{$$typeof:Ym,type:e,key:t,ref:n!==void 0?n:null,props:l}}function HS(e,t){return Xm(e.type,t,void 0,void 0,void 0,e.props)}function Qm(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ym}function IS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var hg=/\/+/g;function df(e,t){return typeof e=="object"&&e!==null&&e.key!=null?IS(""+e.key):t.toString(36)}function mg(){}function PS(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(mg,mg):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Kr(e,t,n,a,r){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(l){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Ym:case TS:i=!0;break;case uj:return i=e._init,Kr(i(e._payload),t,n,a,r)}}if(i)return r=r(e),i=a===""?"."+df(e,0):a,fg(r)?(n="",i!=null&&(n=i.replace(hg,"$&/")+"/"),Kr(r,t,n,"",function(d){return d})):r!=null&&(Qm(r)&&(r=HS(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(hg,"$&/")+"/")+i)),t.push(r)),1;i=0;var o=a===""?".":a+":";if(fg(e))for(var c=0;c<e.length;c++)a=e[c],l=o+df(a,c),i+=Kr(a,t,n,l,r);else if(c=BS(e),typeof c=="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,l=o+df(a,c++),i+=Kr(a,t,n,l,r);else if(l==="object"){if(typeof e.then=="function")return Kr(PS(e),t,n,a,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function ac(e,t,n){if(e==null)return e;var a=[],r=0;return Kr(e,a,"","",function(l){return t.call(n,l,r++)}),a}function qS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var pg=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function GS(){}Me.Children={map:ac,forEach:function(e,t,n){ac(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ac(e,function(){t++}),t},toArray:function(e){return ac(e,function(t){return t})||[]},only:function(e){if(!Qm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Me.Component=Bl;Me.Fragment=AS;Me.Profiler=$S;Me.PureComponent=Fm;Me.StrictMode=MS;Me.Suspense=LS;Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=mt;Me.__COMPILER_RUNTIME={__proto__:null,c:function(e){return mt.H.useMemoCache(e)}};Me.cache=function(e){return function(){return e.apply(null,arguments)}};Me.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=fj({},e.props),r=e.key,l=void 0;if(t!=null)for(i in t.ref!==void 0&&(l=void 0),t.key!==void 0&&(r=""+t.key),t)!pj.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(a[i]=t[i]);var i=arguments.length-2;if(i===1)a.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];a.children=o}return Xm(e.type,r,void 0,void 0,l,a)};Me.createContext=function(e){return e={$$typeof:DS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:OS,_context:e},e};Me.createElement=function(e,t,n){var a,r={},l=null;if(t!=null)for(a in t.key!==void 0&&(l=""+t.key),t)pj.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(r[a]=t[a]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];r.children=o}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)r[a]===void 0&&(r[a]=i[a]);return Xm(e,l,void 0,void 0,null,r)};Me.createRef=function(){return{current:null}};Me.forwardRef=function(e){return{$$typeof:zS,render:e}};Me.isValidElement=Qm;Me.lazy=function(e){return{$$typeof:uj,_payload:{_status:-1,_result:e},_init:qS}};Me.memo=function(e,t){return{$$typeof:US,type:e,compare:t===void 0?null:t}};Me.startTransition=function(e){var t=mt.T,n={};mt.T=n;try{var a=e(),r=mt.S;r!==null&&r(n,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(GS,pg)}catch(l){pg(l)}finally{mt.T=t}};Me.unstable_useCacheRefresh=function(){return mt.H.useCacheRefresh()};Me.use=function(e){return mt.H.use(e)};Me.useActionState=function(e,t,n){return mt.H.useActionState(e,t,n)};Me.useCallback=function(e,t){return mt.H.useCallback(e,t)};Me.useContext=function(e){return mt.H.useContext(e)};Me.useDebugValue=function(){};Me.useDeferredValue=function(e,t){return mt.H.useDeferredValue(e,t)};Me.useEffect=function(e,t,n){var a=mt.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return a.useEffect(e,t)};Me.useId=function(){return mt.H.useId()};Me.useImperativeHandle=function(e,t,n){return mt.H.useImperativeHandle(e,t,n)};Me.useInsertionEffect=function(e,t){return mt.H.useInsertionEffect(e,t)};Me.useLayoutEffect=function(e,t){return mt.H.useLayoutEffect(e,t)};Me.useMemo=function(e,t){return mt.H.useMemo(e,t)};Me.useOptimistic=function(e,t){return mt.H.useOptimistic(e,t)};Me.useReducer=function(e,t,n){return mt.H.useReducer(e,t,n)};Me.useRef=function(e){return mt.H.useRef(e)};Me.useState=function(e){return mt.H.useState(e)};Me.useSyncExternalStore=function(e,t,n){return mt.H.useSyncExternalStore(e,t,n)};Me.useTransition=function(){return mt.H.useTransition()};Me.version="19.1.0";cj.exports=Me;var u=cj.exports;const ya=lj(u),xj=CS({__proto__:null,default:ya},[u]);var gj={exports:{}},nd={},vj={exports:{}},yj={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(R,T){var k=R.length;R.push(T);e:for(;0<k;){var $=k-1>>>1,P=R[$];if(0<r(P,T))R[$]=T,R[k]=P,k=$;else break e}}function n(R){return R.length===0?null:R[0]}function a(R){if(R.length===0)return null;var T=R[0],k=R.pop();if(k!==T){R[0]=k;e:for(var $=0,P=R.length,E=P>>>1;$<E;){var I=2*($+1)-1,F=R[I],Q=I+1,oe=R[Q];if(0>r(F,k))Q<P&&0>r(oe,F)?(R[$]=oe,R[Q]=k,$=Q):(R[$]=F,R[I]=k,$=I);else if(Q<P&&0>r(oe,k))R[$]=oe,R[Q]=k,$=Q;else break e}}return T}function r(R,T){var k=R.sortIndex-T.sortIndex;return k!==0?k:R.id-T.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],d=[],f=1,m=null,h=3,x=!1,j=!1,v=!1,y=!1,g=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function w(R){for(var T=n(d);T!==null;){if(T.callback===null)a(d);else if(T.startTime<=R)a(d),T.sortIndex=T.expirationTime,t(c,T);else break;T=n(d)}}function N(R){if(v=!1,w(R),!j)if(n(c)!==null)j=!0,C||(C=!0,Y());else{var T=n(d);T!==null&&A(N,T.startTime-R)}}var C=!1,_=-1,S=5,D=-1;function O(){return y?!0:!(e.unstable_now()-D<S)}function B(){if(y=!1,C){var R=e.unstable_now();D=R;var T=!0;try{e:{j=!1,v&&(v=!1,p(_),_=-1),x=!0;var k=h;try{t:{for(w(R),m=n(c);m!==null&&!(m.expirationTime>R&&O());){var $=m.callback;if(typeof $=="function"){m.callback=null,h=m.priorityLevel;var P=$(m.expirationTime<=R);if(R=e.unstable_now(),typeof P=="function"){m.callback=P,w(R),T=!0;break t}m===n(c)&&a(c),w(R)}else a(c);m=n(c)}if(m!==null)T=!0;else{var E=n(d);E!==null&&A(N,E.startTime-R),T=!1}}break e}finally{m=null,h=k,x=!1}T=void 0}}finally{T?Y():C=!1}}}var Y;if(typeof b=="function")Y=function(){b(B)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,M=H.port2;H.port1.onmessage=B,Y=function(){M.postMessage(null)}}else Y=function(){g(B,0)};function A(R,T){_=g(function(){R(e.unstable_now())},T)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var T=3;break;default:T=h}var k=h;h=T;try{return R()}finally{h=k}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(R,T){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var k=h;h=R;try{return T()}finally{h=k}},e.unstable_scheduleCallback=function(R,T,k){var $=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?$+k:$):k=$,R){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=k+P,R={id:f++,callback:T,priorityLevel:R,startTime:k,expirationTime:P,sortIndex:-1},k>$?(R.sortIndex=k,t(d,R),n(c)===null&&R===n(d)&&(v?(p(_),_=-1):v=!0,A(N,k-$))):(R.sortIndex=P,t(c,R),j||x||(j=!0,C||(C=!0,Y()))),R},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(R){var T=h;return function(){var k=h;h=T;try{return R.apply(this,arguments)}finally{h=k}}}})(yj);vj.exports=yj;var VS=vj.exports,jj={exports:{}},fn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var YS=u;function bj(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function pa(){}var un={d:{f:pa,r:function(){throw Error(bj(522))},D:pa,C:pa,L:pa,m:pa,X:pa,S:pa,M:pa},p:0,findDOMNode:null},FS=Symbol.for("react.portal");function KS(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:FS,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var Oi=YS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function sd(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}fn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=un;fn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(bj(299));return KS(e,t,null,n)};fn.flushSync=function(e){var t=Oi.T,n=un.p;try{if(Oi.T=null,un.p=2,e)return e()}finally{Oi.T=t,un.p=n,un.d.f()}};fn.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,un.d.C(e,t))};fn.prefetchDNS=function(e){typeof e=="string"&&un.d.D(e)};fn.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,a=sd(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,l=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?un.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:r,fetchPriority:l}):n==="script"&&un.d.X(e,{crossOrigin:a,integrity:r,fetchPriority:l,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};fn.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=sd(t.as,t.crossOrigin);un.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&un.d.M(e)};fn.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,a=sd(n,t.crossOrigin);un.d.L(e,n,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};fn.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=sd(t.as,t.crossOrigin);un.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else un.d.m(e)};fn.requestFormReset=function(e){un.d.r(e)};fn.unstable_batchedUpdates=function(e,t){return e(t)};fn.useFormState=function(e,t,n){return Oi.H.useFormState(e,t,n)};fn.useFormStatus=function(){return Oi.H.useHostTransitionStatus()};fn.version="19.1.0";function wj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wj)}catch(e){console.error(e)}}wj(),jj.exports=fn;var Hl=jj.exports;const XS=lj(Hl);/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var qt=VS,_j=u,QS=Hl;function W(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function Nj(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function So(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function kj(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function xg(e){if(So(e)!==e)throw Error(W(188))}function WS(e){var t=e.alternate;if(!t){if(t=So(e),t===null)throw Error(W(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(r===null)break;var l=r.alternate;if(l===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===l.child){for(l=r.child;l;){if(l===n)return xg(r),e;if(l===a)return xg(r),t;l=l.sibling}throw Error(W(188))}if(n.return!==a.return)n=r,a=l;else{for(var i=!1,o=r.child;o;){if(o===n){i=!0,n=r,a=l;break}if(o===a){i=!0,a=r,n=l;break}o=o.sibling}if(!i){for(o=l.child;o;){if(o===n){i=!0,n=l,a=r;break}if(o===a){i=!0,a=l,n=r;break}o=o.sibling}if(!i)throw Error(W(189))}}if(n.alternate!==a)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function Sj(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Sj(e),t!==null)return t;e=e.sibling}return null}var dt=Object.assign,ZS=Symbol.for("react.element"),rc=Symbol.for("react.transitional.element"),_i=Symbol.for("react.portal"),Zr=Symbol.for("react.fragment"),Cj=Symbol.for("react.strict_mode"),yh=Symbol.for("react.profiler"),JS=Symbol.for("react.provider"),Rj=Symbol.for("react.consumer"),Js=Symbol.for("react.context"),Wm=Symbol.for("react.forward_ref"),jh=Symbol.for("react.suspense"),bh=Symbol.for("react.suspense_list"),Zm=Symbol.for("react.memo"),wa=Symbol.for("react.lazy"),wh=Symbol.for("react.activity"),e2=Symbol.for("react.memo_cache_sentinel"),gg=Symbol.iterator;function di(e){return e===null||typeof e!="object"?null:(e=gg&&e[gg]||e["@@iterator"],typeof e=="function"?e:null)}var t2=Symbol.for("react.client.reference");function _h(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===t2?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Zr:return"Fragment";case yh:return"Profiler";case Cj:return"StrictMode";case jh:return"Suspense";case bh:return"SuspenseList";case wh:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _i:return"Portal";case Js:return(e.displayName||"Context")+".Provider";case Rj:return(e._context.displayName||"Context")+".Consumer";case Wm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zm:return t=e.displayName||null,t!==null?t:_h(e.type)||"Memo";case wa:t=e._payload,e=e._init;try{return _h(e(t))}catch{}}return null}var Ni=Array.isArray,Re=_j.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Fe=QS.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,or={pending:!1,data:null,method:null,action:null},Nh=[],Jr=-1;function Is(e){return{current:e}}function Wt(e){0>Jr||(e.current=Nh[Jr],Nh[Jr]=null,Jr--)}function pt(e,t){Jr++,Nh[Jr]=e.current,e.current=t}var Os=Is(null),Zi=Is(null),Oa=Is(null),au=Is(null);function ru(e,t){switch(pt(Oa,t),pt(Zi,e),pt(Os,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?wv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=wv(t),e=Vw(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Wt(Os),pt(Os,e)}function kl(){Wt(Os),Wt(Zi),Wt(Oa)}function kh(e){e.memoizedState!==null&&pt(au,e);var t=Os.current,n=Vw(t,e.type);t!==n&&(pt(Zi,e),pt(Os,n))}function lu(e){Zi.current===e&&(Wt(Os),Wt(Zi)),au.current===e&&(Wt(au),oo._currentValue=or)}var Sh=Object.prototype.hasOwnProperty,Jm=qt.unstable_scheduleCallback,ff=qt.unstable_cancelCallback,n2=qt.unstable_shouldYield,s2=qt.unstable_requestPaint,Ds=qt.unstable_now,a2=qt.unstable_getCurrentPriorityLevel,Ej=qt.unstable_ImmediatePriority,Tj=qt.unstable_UserBlockingPriority,iu=qt.unstable_NormalPriority,r2=qt.unstable_LowPriority,Aj=qt.unstable_IdlePriority,l2=qt.log,i2=qt.unstable_setDisableYieldValue,Co=null,Hn=null;function Ra(e){if(typeof l2=="function"&&i2(e),Hn&&typeof Hn.setStrictMode=="function")try{Hn.setStrictMode(Co,e)}catch{}}var In=Math.clz32?Math.clz32:u2,o2=Math.log,c2=Math.LN2;function u2(e){return e>>>=0,e===0?32:31-(o2(e)/c2|0)|0}var lc=256,ic=4194304;function ar(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ad(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=a&134217727;return o!==0?(a=o&~l,a!==0?r=ar(a):(i&=o,i!==0?r=ar(i):n||(n=o&~e,n!==0&&(r=ar(n))))):(o=a&~l,o!==0?r=ar(o):i!==0?r=ar(i):n||(n=a&~e,n!==0&&(r=ar(n)))),r===0?0:t!==0&&t!==r&&!(t&l)&&(l=r&-r,n=t&-t,l>=n||l===32&&(n&4194048)!==0)?t:r}function Ro(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function d2(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mj(){var e=lc;return lc<<=1,!(lc&4194048)&&(lc=256),e}function $j(){var e=ic;return ic<<=1,!(ic&62914560)&&(ic=4194304),e}function hf(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Eo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function f2(e,t,n,a,r,l){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,d=e.hiddenUpdates;for(n=i&~n;0<n;){var f=31-In(n),m=1<<f;o[f]=0,c[f]=-1;var h=d[f];if(h!==null)for(d[f]=null,f=0;f<h.length;f++){var x=h[f];x!==null&&(x.lane&=-536870913)}n&=~m}a!==0&&Oj(e,a,0),l!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=l&~(i&~t))}function Oj(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-In(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&4194090}function Dj(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-In(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function ep(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function tp(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function zj(){var e=Fe.p;return e!==0?e:(e=window.event,e===void 0?32:t0(e.type))}function h2(e,t){var n=Fe.p;try{return Fe.p=e,t()}finally{Fe.p=n}}var Xa=Math.random().toString(36).slice(2),an="__reactFiber$"+Xa,wn="__reactProps$"+Xa,Il="__reactContainer$"+Xa,Ch="__reactEvents$"+Xa,m2="__reactListeners$"+Xa,p2="__reactHandles$"+Xa,vg="__reactResources$"+Xa,To="__reactMarker$"+Xa;function np(e){delete e[an],delete e[wn],delete e[Ch],delete e[m2],delete e[p2]}function el(e){var t=e[an];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Il]||n[an]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=kv(e);e!==null;){if(n=e[an])return n;e=kv(e)}return t}e=n,n=e.parentNode}return null}function Pl(e){if(e=e[an]||e[Il]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function ki(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(W(33))}function dl(e){var t=e[vg];return t||(t=e[vg]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Xt(e){e[To]=!0}var Lj=new Set,Uj={};function Rr(e,t){Sl(e,t),Sl(e+"Capture",t)}function Sl(e,t){for(Uj[e]=t,e=0;e<t.length;e++)Lj.add(t[e])}var x2=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yg={},jg={};function g2(e){return Sh.call(jg,e)?!0:Sh.call(yg,e)?!1:x2.test(e)?jg[e]=!0:(yg[e]=!0,!1)}function Lc(e,t,n){if(g2(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function oc(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ys(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}var mf,bg;function Xr(e){if(mf===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mf=t&&t[1]||"",bg=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+mf+e+bg}var pf=!1;function xf(e,t){if(!e||pf)return"";pf=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(x){var h=x}Reflect.construct(e,[],m)}else{try{m.call()}catch(x){h=x}e.call(m.prototype)}}else{try{throw Error()}catch(x){h=x}(m=e())&&typeof m.catch=="function"&&m.catch(function(){})}}catch(x){if(x&&h&&typeof x.stack=="string")return[x.stack,h.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var l=a.DetermineComponentFrameRoot(),i=l[0],o=l[1];if(i&&o){var c=i.split(`
|
|
44
|
+
`),d=o.split(`
|
|
45
|
+
`);for(r=a=0;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;for(;r<d.length&&!d[r].includes("DetermineComponentFrameRoot");)r++;if(a===c.length||r===d.length)for(a=c.length-1,r=d.length-1;1<=a&&0<=r&&c[a]!==d[r];)r--;for(;1<=a&&0<=r;a--,r--)if(c[a]!==d[r]){if(a!==1||r!==1)do if(a--,r--,0>r||c[a]!==d[r]){var f=`
|
|
46
|
+
`+c[a].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=a&&0<=r);break}}}finally{pf=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Xr(n):""}function v2(e){switch(e.tag){case 26:case 27:case 5:return Xr(e.type);case 16:return Xr("Lazy");case 13:return Xr("Suspense");case 19:return Xr("SuspenseList");case 0:case 15:return xf(e.type,!1);case 11:return xf(e.type.render,!1);case 1:return xf(e.type,!0);case 31:return Xr("Activity");default:return""}}function wg(e){try{var t="";do t+=v2(e),e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}function Qn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function y2(e){var t=Bj(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){a=""+i,l.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ou(e){e._valueTracker||(e._valueTracker=y2(e))}function Hj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Bj(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function cu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var j2=/[\n"\\]/g;function Jn(e){return e.replace(j2,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Rh(e,t,n,a,r,l,i,o){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Qn(t)):e.value!==""+Qn(t)&&(e.value=""+Qn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?Eh(e,i,Qn(t)):n!=null?Eh(e,i,Qn(n)):a!=null&&e.removeAttribute("value"),r==null&&l!=null&&(e.defaultChecked=!!l),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Qn(o):e.removeAttribute("name")}function Ij(e,t,n,a,r,l,i,o){if(l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.type=l),t!=null||n!=null){if(!(l!=="submit"&&l!=="reset"||t!=null))return;n=n!=null?""+Qn(n):"",t=t!=null?""+Qn(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=o?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i)}function Eh(e,t,n){t==="number"&&cu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function fl(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Qn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Pj(e,t,n){if(t!=null&&(t=""+Qn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Qn(n):""}function qj(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(W(92));if(Ni(a)){if(1<a.length)throw Error(W(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Qn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a)}function Cl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var b2=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function _g(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||b2.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Gj(e,t,n){if(t!=null&&typeof t!="object")throw Error(W(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&_g(e,r,a)}else for(var l in t)t.hasOwnProperty(l)&&_g(e,l,t[l])}function sp(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var w2=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),_2=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Uc(e){return _2.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Th=null;function ap(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var tl=null,hl=null;function Ng(e){var t=Pl(e);if(t&&(e=t.stateNode)){var n=e[wn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Rh(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Jn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[wn]||null;if(!r)throw Error(W(90));Rh(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Hj(a)}break e;case"textarea":Pj(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&fl(e,!!n.multiple,t,!1)}}}var gf=!1;function Vj(e,t,n){if(gf)return e(t,n);gf=!0;try{var a=e(t);return a}finally{if(gf=!1,(tl!==null||hl!==null)&&(md(),tl&&(t=tl,e=hl,hl=tl=null,Ng(t),e)))for(t=0;t<e.length;t++)Ng(e[t])}}function Ji(e,t){var n=e.stateNode;if(n===null)return null;var a=n[wn]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var la=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ah=!1;if(la)try{var fi={};Object.defineProperty(fi,"passive",{get:function(){Ah=!0}}),window.addEventListener("test",fi,fi),window.removeEventListener("test",fi,fi)}catch{Ah=!1}var Ea=null,rp=null,Bc=null;function Yj(){if(Bc)return Bc;var e,t=rp,n=t.length,a,r="value"in Ea?Ea.value:Ea.textContent,l=r.length;for(e=0;e<n&&t[e]===r[e];e++);var i=n-e;for(a=1;a<=i&&t[n-a]===r[l-a];a++);return Bc=r.slice(e,1<a?1-a:void 0)}function Hc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function cc(){return!0}function kg(){return!1}function _n(e){function t(n,a,r,l,i){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=l,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?cc:kg,this.isPropagationStopped=kg,this}return dt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=cc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=cc)},persist:function(){},isPersistent:cc}),t}var Er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rd=_n(Er),Ao=dt({},Er,{view:0,detail:0}),N2=_n(Ao),vf,yf,hi,ld=dt({},Ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lp,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==hi&&(hi&&e.type==="mousemove"?(vf=e.screenX-hi.screenX,yf=e.screenY-hi.screenY):yf=vf=0,hi=e),vf)},movementY:function(e){return"movementY"in e?e.movementY:yf}}),Sg=_n(ld),k2=dt({},ld,{dataTransfer:0}),S2=_n(k2),C2=dt({},Ao,{relatedTarget:0}),jf=_n(C2),R2=dt({},Er,{animationName:0,elapsedTime:0,pseudoElement:0}),E2=_n(R2),T2=dt({},Er,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),A2=_n(T2),M2=dt({},Er,{data:0}),Cg=_n(M2),$2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},O2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},D2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function z2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=D2[e])?!!t[e]:!1}function lp(){return z2}var L2=dt({},Ao,{key:function(e){if(e.key){var t=$2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Hc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?O2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lp,charCode:function(e){return e.type==="keypress"?Hc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Hc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),U2=_n(L2),B2=dt({},ld,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rg=_n(B2),H2=dt({},Ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lp}),I2=_n(H2),P2=dt({},Er,{propertyName:0,elapsedTime:0,pseudoElement:0}),q2=_n(P2),G2=dt({},ld,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),V2=_n(G2),Y2=dt({},Er,{newState:0,oldState:0}),F2=_n(Y2),K2=[9,13,27,32],ip=la&&"CompositionEvent"in window,Di=null;la&&"documentMode"in document&&(Di=document.documentMode);var X2=la&&"TextEvent"in window&&!Di,Fj=la&&(!ip||Di&&8<Di&&11>=Di),Eg=" ",Tg=!1;function Kj(e,t){switch(e){case"keyup":return K2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var nl=!1;function Q2(e,t){switch(e){case"compositionend":return Xj(t);case"keypress":return t.which!==32?null:(Tg=!0,Eg);case"textInput":return e=t.data,e===Eg&&Tg?null:e;default:return null}}function W2(e,t){if(nl)return e==="compositionend"||!ip&&Kj(e,t)?(e=Yj(),Bc=rp=Ea=null,nl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Fj&&t.locale!=="ko"?null:t.data;default:return null}}var Z2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ag(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Z2[e.type]:t==="textarea"}function Qj(e,t,n,a){tl?hl?hl.push(a):hl=[a]:tl=a,t=Cu(t,"onChange"),0<t.length&&(n=new rd("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var zi=null,eo=null;function J2(e){Pw(e,0)}function id(e){var t=ki(e);if(Hj(t))return e}function Mg(e,t){if(e==="change")return t}var Wj=!1;if(la){var bf;if(la){var wf="oninput"in document;if(!wf){var $g=document.createElement("div");$g.setAttribute("oninput","return;"),wf=typeof $g.oninput=="function"}bf=wf}else bf=!1;Wj=bf&&(!document.documentMode||9<document.documentMode)}function Og(){zi&&(zi.detachEvent("onpropertychange",Zj),eo=zi=null)}function Zj(e){if(e.propertyName==="value"&&id(eo)){var t=[];Qj(t,eo,e,ap(e)),Vj(J2,t)}}function eC(e,t,n){e==="focusin"?(Og(),zi=t,eo=n,zi.attachEvent("onpropertychange",Zj)):e==="focusout"&&Og()}function tC(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return id(eo)}function nC(e,t){if(e==="click")return id(t)}function sC(e,t){if(e==="input"||e==="change")return id(t)}function aC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vn=typeof Object.is=="function"?Object.is:aC;function to(e,t){if(Vn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Sh.call(t,r)||!Vn(e[r],t[r]))return!1}return!0}function Dg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zg(e,t){var n=Dg(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Dg(n)}}function Jj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Jj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eb(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=cu(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=cu(e.document)}return t}function op(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var rC=la&&"documentMode"in document&&11>=document.documentMode,sl=null,Mh=null,Li=null,$h=!1;function Lg(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$h||sl==null||sl!==cu(a)||(a=sl,"selectionStart"in a&&op(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Li&&to(Li,a)||(Li=a,a=Cu(Mh,"onSelect"),0<a.length&&(t=new rd("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=sl)))}function nr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var al={animationend:nr("Animation","AnimationEnd"),animationiteration:nr("Animation","AnimationIteration"),animationstart:nr("Animation","AnimationStart"),transitionrun:nr("Transition","TransitionRun"),transitionstart:nr("Transition","TransitionStart"),transitioncancel:nr("Transition","TransitionCancel"),transitionend:nr("Transition","TransitionEnd")},_f={},tb={};la&&(tb=document.createElement("div").style,"AnimationEvent"in window||(delete al.animationend.animation,delete al.animationiteration.animation,delete al.animationstart.animation),"TransitionEvent"in window||delete al.transitionend.transition);function Tr(e){if(_f[e])return _f[e];if(!al[e])return e;var t=al[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tb)return _f[e]=t[n];return e}var nb=Tr("animationend"),sb=Tr("animationiteration"),ab=Tr("animationstart"),lC=Tr("transitionrun"),iC=Tr("transitionstart"),oC=Tr("transitioncancel"),rb=Tr("transitionend"),lb=new Map,Oh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Oh.push("scrollEnd");function Ns(e,t){lb.set(e,t),Rr(t,[e])}var Ug=new WeakMap;function es(e,t){if(typeof e=="object"&&e!==null){var n=Ug.get(e);return n!==void 0?n:(t={value:e,source:t,stack:wg(t)},Ug.set(e,t),t)}return{value:e,source:t,stack:wg(t)}}var Xn=[],rl=0,cp=0;function od(){for(var e=rl,t=cp=rl=0;t<e;){var n=Xn[t];Xn[t++]=null;var a=Xn[t];Xn[t++]=null;var r=Xn[t];Xn[t++]=null;var l=Xn[t];if(Xn[t++]=null,a!==null&&r!==null){var i=a.pending;i===null?r.next=r:(r.next=i.next,i.next=r),a.pending=r}l!==0&&ib(n,r,l)}}function cd(e,t,n,a){Xn[rl++]=e,Xn[rl++]=t,Xn[rl++]=n,Xn[rl++]=a,cp|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function up(e,t,n,a){return cd(e,t,n,a),uu(e)}function ql(e,t){return cd(e,null,null,t),uu(e)}function ib(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,l=e.return;l!==null;)l.childLanes|=n,a=l.alternate,a!==null&&(a.childLanes|=n),l.tag===22&&(e=l.stateNode,e===null||e._visibility&1||(r=!0)),e=l,l=l.return;return e.tag===3?(l=e.stateNode,r&&t!==null&&(r=31-In(n),e=l.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),l):null}function uu(e){if(50<Fi)throw Fi=0,tm=null,Error(W(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ll={};function cC(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(e,t,n,a){return new cC(e,t,n,a)}function dp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function aa(e,t){var n=e.alternate;return n===null?(n=Bn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ob(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ic(e,t,n,a,r,l){var i=0;if(a=e,typeof e=="function")dp(e)&&(i=1);else if(typeof e=="string")i=dR(e,n,Os.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case wh:return e=Bn(31,n,t,r),e.elementType=wh,e.lanes=l,e;case Zr:return cr(n.children,r,l,t);case Cj:i=8,r|=24;break;case yh:return e=Bn(12,n,t,r|2),e.elementType=yh,e.lanes=l,e;case jh:return e=Bn(13,n,t,r),e.elementType=jh,e.lanes=l,e;case bh:return e=Bn(19,n,t,r),e.elementType=bh,e.lanes=l,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case JS:case Js:i=10;break e;case Rj:i=9;break e;case Wm:i=11;break e;case Zm:i=14;break e;case wa:i=16,a=null;break e}i=29,n=Error(W(130,e===null?"null":typeof e,"")),a=null}return t=Bn(i,n,t,r),t.elementType=e,t.type=a,t.lanes=l,t}function cr(e,t,n,a){return e=Bn(7,e,a,t),e.lanes=n,e}function Nf(e,t,n){return e=Bn(6,e,null,t),e.lanes=n,e}function kf(e,t,n){return t=Bn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var il=[],ol=0,du=null,fu=0,Wn=[],Zn=0,ur=null,ea=1,ta="";function rr(e,t){il[ol++]=fu,il[ol++]=du,du=e,fu=t}function cb(e,t,n){Wn[Zn++]=ea,Wn[Zn++]=ta,Wn[Zn++]=ur,ur=e;var a=ea;e=ta;var r=32-In(a)-1;a&=~(1<<r),n+=1;var l=32-In(t)+r;if(30<l){var i=r-r%5;l=(a&(1<<i)-1).toString(32),a>>=i,r-=i,ea=1<<32-In(t)+r|n<<r|a,ta=l+e}else ea=1<<l|n<<r|a,ta=e}function fp(e){e.return!==null&&(rr(e,1),cb(e,1,0))}function hp(e){for(;e===du;)du=il[--ol],il[ol]=null,fu=il[--ol],il[ol]=null;for(;e===ur;)ur=Wn[--Zn],Wn[Zn]=null,ta=Wn[--Zn],Wn[Zn]=null,ea=Wn[--Zn],Wn[Zn]=null}var cn=null,jt=null,Ye=!1,dr=null,Rs=!1,Dh=Error(W(519));function xr(e){var t=Error(W(418,""));throw no(es(t,e)),Dh}function Bg(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[an]=e,t[wn]=a,n){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(n=0;n<ro.length;n++)Be(ro[n],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),Ij(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),ou(t);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),qj(t,a.value,a.defaultValue,a.children),ou(t)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Gw(t.textContent,n)?(a.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),a.onScroll!=null&&Be("scroll",t),a.onScrollEnd!=null&&Be("scrollend",t),a.onClick!=null&&(t.onclick=gd),t=!0):t=!1,t||xr(e)}function Hg(e){for(cn=e.return;cn;)switch(cn.tag){case 5:case 13:Rs=!1;return;case 27:case 3:Rs=!0;return;default:cn=cn.return}}function mi(e){if(e!==cn)return!1;if(!Ye)return Hg(e),Ye=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||im(e.type,e.memoizedProps)),n=!n),n&&jt&&xr(e),Hg(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){jt=gs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}jt=null}}else t===27?(t=jt,Qa(e.type)?(e=um,um=null,jt=e):jt=t):jt=cn?gs(e.stateNode.nextSibling):null;return!0}function Mo(){jt=cn=null,Ye=!1}function Ig(){var e=dr;return e!==null&&(jn===null?jn=e:jn.push.apply(jn,e),dr=null),e}function no(e){dr===null?dr=[e]:dr.push(e)}var zh=Is(null),Ar=null,na=null;function Na(e,t,n){pt(zh,t._currentValue),t._currentValue=n}function ra(e){e._currentValue=zh.current,Wt(zh)}function Lh(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Uh(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var l=r.dependencies;if(l!==null){var i=r.child;l=l.firstContext;e:for(;l!==null;){var o=l;l=r;for(var c=0;c<t.length;c++)if(o.context===t[c]){l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),Lh(l.return,n,e),a||(i=null);break e}l=o.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(W(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Lh(i,n,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function $o(e,t,n,a){e=null;for(var r=t,l=!1;r!==null;){if(!l){if(r.flags&524288)l=!0;else if(r.flags&262144)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(W(387));if(i=i.memoizedProps,i!==null){var o=r.type;Vn(r.pendingProps.value,i.value)||(e!==null?e.push(o):e=[o])}}else if(r===au.current){if(i=r.alternate,i===null)throw Error(W(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(oo):e=[oo])}r=r.return}e!==null&&Uh(t,e,n,a),t.flags|=262144}function hu(e){for(e=e.firstContext;e!==null;){if(!Vn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function gr(e){Ar=e,na=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function rn(e){return ub(Ar,e)}function uc(e,t){return Ar===null&&gr(e),ub(e,t)}function ub(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},na===null){if(e===null)throw Error(W(308));na=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else na=na.next=t;return n}var uC=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},dC=qt.unstable_scheduleCallback,fC=qt.unstable_NormalPriority,It={$$typeof:Js,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mp(){return{controller:new uC,data:new Map,refCount:0}}function Oo(e){e.refCount--,e.refCount===0&&dC(fC,function(){e.controller.abort()})}var Ui=null,Bh=0,Rl=0,ml=null;function hC(e,t){if(Ui===null){var n=Ui=[];Bh=0,Rl=Lp(),ml={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Bh++,t.then(Pg,Pg),t}function Pg(){if(--Bh===0&&Ui!==null){ml!==null&&(ml.status="fulfilled");var e=Ui;Ui=null,Rl=0,ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function mC(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var qg=Re.S;Re.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&hC(e,t),qg!==null&&qg(e,t)};var fr=Is(null);function pp(){var e=fr.current;return e!==null?e:ot.pooledCache}function Pc(e,t){t===null?pt(fr,fr.current):pt(fr,t.pool)}function db(){var e=pp();return e===null?null:{parent:It._currentValue,pool:e}}var Do=Error(W(460)),fb=Error(W(474)),ud=Error(W(542)),Hh={then:function(){}};function Gg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function dc(){}function hb(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dc,dc),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Yg(e),e;default:if(typeof t.status=="string")t.then(dc,dc);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(W(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Yg(e),e}throw Bi=t,Do}}var Bi=null;function Vg(){if(Bi===null)throw Error(W(459));var e=Bi;return Bi=null,e}function Yg(e){if(e===Do||e===ud)throw Error(W(483))}var _a=!1;function xp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ih(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Da(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function za(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,tt&2){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=uu(e),ib(e,null,n),t}return cd(e,a,t,n),uu(e)}function Hi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Dj(e,n)}}function Sf(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};l===null?r=l=i:l=l.next=i,n=n.next}while(n!==null);l===null?r=l=t:l=l.next=t}else r=l=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:l,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ph=!1;function Ii(){if(Ph){var e=ml;if(e!==null)throw e}}function Pi(e,t,n,a){Ph=!1;var r=e.updateQueue;_a=!1;var l=r.firstBaseUpdate,i=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var c=o,d=c.next;c.next=null,i===null?l=d:i.next=d,i=c;var f=e.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==i&&(o===null?f.firstBaseUpdate=d:o.next=d,f.lastBaseUpdate=c))}if(l!==null){var m=r.baseState;i=0,f=d=c=null,o=l;do{var h=o.lane&-536870913,x=h!==o.lane;if(x?(Ie&h)===h:(a&h)===h){h!==0&&h===Rl&&(Ph=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var j=e,v=o;h=t;var y=n;switch(v.tag){case 1:if(j=v.payload,typeof j=="function"){m=j.call(y,m,h);break e}m=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=v.payload,h=typeof j=="function"?j.call(y,m,h):j,h==null)break e;m=dt({},m,h);break e;case 2:_a=!0}}h=o.callback,h!==null&&(e.flags|=64,x&&(e.flags|=8192),x=r.callbacks,x===null?r.callbacks=[h]:x.push(h))}else x={lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(d=f=x,c=m):f=f.next=x,i|=h;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;x=o,o=x.next,x.next=null,r.lastBaseUpdate=x,r.shared.pending=null}}while(!0);f===null&&(c=m),r.baseState=c,r.firstBaseUpdate=d,r.lastBaseUpdate=f,l===null&&(r.shared.lanes=0),Va|=i,e.lanes=i,e.memoizedState=m}}function mb(e,t){if(typeof e!="function")throw Error(W(191,e));e.call(t)}function pb(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)mb(n[e],t)}var El=Is(null),mu=Is(0);function Fg(e,t){e=ca,pt(mu,e),pt(El,t),ca=e|t.baseLanes}function qh(){pt(mu,ca),pt(El,El.current)}function gp(){ca=mu.current,Wt(El),Wt(mu)}var qa=0,Oe=null,at=null,Mt=null,pu=!1,pl=!1,vr=!1,xu=0,so=0,xl=null,pC=0;function St(){throw Error(W(321))}function vp(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vn(e[n],t[n]))return!1;return!0}function yp(e,t,n,a,r,l){return qa=l,Oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Re.H=e===null||e.memoizedState===null?Yb:Fb,vr=!1,l=n(a,r),vr=!1,pl&&(l=gb(t,n,a,r)),xb(e),l}function xb(e){Re.H=gu;var t=at!==null&&at.next!==null;if(qa=0,Mt=at=Oe=null,pu=!1,so=0,xl=null,t)throw Error(W(300));e===null||Qt||(e=e.dependencies,e!==null&&hu(e)&&(Qt=!0))}function gb(e,t,n,a){Oe=e;var r=0;do{if(pl&&(xl=null),so=0,pl=!1,25<=r)throw Error(W(301));if(r+=1,Mt=at=null,e.updateQueue!=null){var l=e.updateQueue;l.lastEffect=null,l.events=null,l.stores=null,l.memoCache!=null&&(l.memoCache.index=0)}Re.H=wC,l=t(n,a)}while(pl);return l}function xC(){var e=Re.H,t=e.useState()[0];return t=typeof t.then=="function"?zo(t):t,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(Oe.flags|=1024),t}function jp(){var e=xu!==0;return xu=0,e}function bp(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wp(e){if(pu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}pu=!1}qa=0,Mt=at=Oe=null,pl=!1,so=xu=0,xl=null}function vn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?Oe.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function Dt(){if(at===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=Mt===null?Oe.memoizedState:Mt.next;if(t!==null)Mt=t,at=e;else{if(e===null)throw Oe.alternate===null?Error(W(467)):Error(W(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Mt===null?Oe.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function _p(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zo(e){var t=so;return so+=1,xl===null&&(xl=[]),e=hb(xl,e,t),t=Oe,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,Re.H=t===null||t.memoizedState===null?Yb:Fb),e}function dd(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return zo(e);if(e.$$typeof===Js)return rn(e)}throw Error(W(438,String(e)))}function Np(e){var t=null,n=Oe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Oe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=_p(),Oe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=e2;return t.index++,n}function ia(e,t){return typeof t=="function"?t(e):t}function qc(e){var t=Dt();return kp(t,at,e)}function kp(e,t,n){var a=e.queue;if(a===null)throw Error(W(311));a.lastRenderedReducer=n;var r=e.baseQueue,l=a.pending;if(l!==null){if(r!==null){var i=r.next;r.next=l.next,l.next=i}t.baseQueue=r=l,a.pending=null}if(l=e.baseState,r===null)e.memoizedState=l;else{t=r.next;var o=i=null,c=null,d=t,f=!1;do{var m=d.lane&-536870913;if(m!==d.lane?(Ie&m)===m:(qa&m)===m){var h=d.revertLane;if(h===0)c!==null&&(c=c.next={lane:0,revertLane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),m===Rl&&(f=!0);else if((qa&h)===h){d=d.next,h===Rl&&(f=!0);continue}else m={lane:0,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(o=c=m,i=l):c=c.next=m,Oe.lanes|=h,Va|=h;m=d.action,vr&&n(l,m),l=d.hasEagerState?d.eagerState:n(l,m)}else h={lane:m,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(o=c=h,i=l):c=c.next=h,Oe.lanes|=m,Va|=m;d=d.next}while(d!==null&&d!==t);if(c===null?i=l:c.next=o,!Vn(l,e.memoizedState)&&(Qt=!0,f&&(n=ml,n!==null)))throw n;e.memoizedState=l,e.baseState=i,e.baseQueue=c,a.lastRenderedState=l}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Cf(e){var t=Dt(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,l=t.memoizedState;if(r!==null){n.pending=null;var i=r=r.next;do l=e(l,i.action),i=i.next;while(i!==r);Vn(l,t.memoizedState)||(Qt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,a]}function vb(e,t,n){var a=Oe,r=Dt(),l=Ye;if(l){if(n===void 0)throw Error(W(407));n=n()}else n=t();var i=!Vn((at||r).memoizedState,n);i&&(r.memoizedState=n,Qt=!0),r=r.queue;var o=bb.bind(null,a,r,e);if(Lo(2048,8,o,[e]),r.getSnapshot!==t||i||Mt!==null&&Mt.memoizedState.tag&1){if(a.flags|=2048,Tl(9,fd(),jb.bind(null,a,r,n,t),null),ot===null)throw Error(W(349));l||qa&124||yb(a,t,n)}return n}function yb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Oe.updateQueue,t===null?(t=_p(),Oe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jb(e,t,n,a){t.value=n,t.getSnapshot=a,wb(t)&&_b(e)}function bb(e,t,n){return n(function(){wb(t)&&_b(e)})}function wb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vn(e,n)}catch{return!0}}function _b(e){var t=ql(e,2);t!==null&&qn(t,e,2)}function Gh(e){var t=vn();if(typeof e=="function"){var n=e;if(e=n(),vr){Ra(!0);try{n()}finally{Ra(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:e},t}function Nb(e,t,n,a){return e.baseState=n,kp(e,at,typeof a=="function"?a:ia)}function gC(e,t,n,a,r){if(hd(e))throw Error(W(485));if(e=t.action,e!==null){var l={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){l.listeners.push(i)}};Re.T!==null?n(!0):l.isTransition=!1,a(l),n=t.pending,n===null?(l.next=t.pending=l,kb(t,l)):(l.next=n.next,t.pending=n.next=l)}}function kb(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var l=Re.T,i={};Re.T=i;try{var o=n(r,a),c=Re.S;c!==null&&c(i,o),Kg(e,t,o)}catch(d){Vh(e,t,d)}finally{Re.T=l}}else try{l=n(r,a),Kg(e,t,l)}catch(d){Vh(e,t,d)}}function Kg(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Xg(e,t,a)},function(a){return Vh(e,t,a)}):Xg(e,t,n)}function Xg(e,t,n){t.status="fulfilled",t.value=n,Sb(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,kb(e,n)))}function Vh(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Sb(t),t=t.next;while(t!==a)}e.action=null}function Sb(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cb(e,t){return t}function Qg(e,t){if(Ye){var n=ot.formState;if(n!==null){e:{var a=Oe;if(Ye){if(jt){t:{for(var r=jt,l=Rs;r.nodeType!==8;){if(!l){r=null;break t}if(r=gs(r.nextSibling),r===null){r=null;break t}}l=r.data,r=l==="F!"||l==="F"?r:null}if(r){jt=gs(r.nextSibling),a=r.data==="F!";break e}}xr(a)}a=!1}a&&(t=n[0])}}return n=vn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cb,lastRenderedState:t},n.queue=a,n=qb.bind(null,Oe,a),a.dispatch=n,a=Gh(!1),l=Ep.bind(null,Oe,!1,a.queue),a=vn(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=gC.bind(null,Oe,r,l,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function Wg(e){var t=Dt();return Rb(t,at,e)}function Rb(e,t,n){if(t=kp(e,t,Cb)[0],e=qc(ia)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=zo(t)}catch(i){throw i===Do?ud:i}else a=t;t=Dt();var r=t.queue,l=r.dispatch;return n!==t.memoizedState&&(Oe.flags|=2048,Tl(9,fd(),vC.bind(null,r,n),null)),[a,l,e]}function vC(e,t){e.action=t}function Zg(e){var t=Dt(),n=at;if(n!==null)return Rb(t,n,e);Dt(),t=t.memoizedState,n=Dt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Tl(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Oe.updateQueue,t===null&&(t=_p(),Oe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function fd(){return{destroy:void 0,resource:void 0}}function Eb(){return Dt().memoizedState}function Gc(e,t,n,a){var r=vn();a=a===void 0?null:a,Oe.flags|=e,r.memoizedState=Tl(1|t,fd(),n,a)}function Lo(e,t,n,a){var r=Dt();a=a===void 0?null:a;var l=r.memoizedState.inst;at!==null&&a!==null&&vp(a,at.memoizedState.deps)?r.memoizedState=Tl(t,l,n,a):(Oe.flags|=e,r.memoizedState=Tl(1|t,l,n,a))}function Jg(e,t){Gc(8390656,8,e,t)}function Tb(e,t){Lo(2048,8,e,t)}function Ab(e,t){return Lo(4,2,e,t)}function Mb(e,t){return Lo(4,4,e,t)}function $b(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ob(e,t,n){n=n!=null?n.concat([e]):null,Lo(4,4,$b.bind(null,t,e),n)}function Sp(){}function Db(e,t){var n=Dt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&vp(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function zb(e,t){var n=Dt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&vp(t,a[1]))return a[0];if(a=e(),vr){Ra(!0);try{e()}finally{Ra(!1)}}return n.memoizedState=[a,t],a}function Cp(e,t,n){return n===void 0||qa&1073741824?e.memoizedState=t:(e.memoizedState=n,e=Sw(),Oe.lanes|=e,Va|=e,n)}function Lb(e,t,n,a){return Vn(n,t)?n:El.current!==null?(e=Cp(e,n,a),Vn(e,t)||(Qt=!0),e):qa&42?(e=Sw(),Oe.lanes|=e,Va|=e,t):(Qt=!0,e.memoizedState=n)}function Ub(e,t,n,a,r){var l=Fe.p;Fe.p=l!==0&&8>l?l:8;var i=Re.T,o={};Re.T=o,Ep(e,!1,t,n);try{var c=r(),d=Re.S;if(d!==null&&d(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=mC(c,a);qi(e,t,f,Pn(e))}else qi(e,t,a,Pn(e))}catch(m){qi(e,t,{then:function(){},status:"rejected",reason:m},Pn())}finally{Fe.p=l,Re.T=i}}function yC(){}function Yh(e,t,n,a){if(e.tag!==5)throw Error(W(476));var r=Bb(e).queue;Ub(e,r,t,or,n===null?yC:function(){return Hb(e),n(a)})}function Bb(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:or,baseState:or,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:or},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ia,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Hb(e){var t=Bb(e).next.queue;qi(e,t,{},Pn())}function Rp(){return rn(oo)}function Ib(){return Dt().memoizedState}function Pb(){return Dt().memoizedState}function jC(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Pn();e=Da(n);var a=za(t,e,n);a!==null&&(qn(a,t,n),Hi(a,t,n)),t={cache:mp()},e.payload=t;return}t=t.return}}function bC(e,t,n){var a=Pn();n={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},hd(e)?Gb(t,n):(n=up(e,t,n,a),n!==null&&(qn(n,e,a),Vb(n,t,a)))}function qb(e,t,n){var a=Pn();qi(e,t,n,a)}function qi(e,t,n,a){var r={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(hd(e))Gb(t,r);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,o=l(i,n);if(r.hasEagerState=!0,r.eagerState=o,Vn(o,i))return cd(e,t,r,0),ot===null&&od(),!1}catch{}finally{}if(n=up(e,t,r,a),n!==null)return qn(n,e,a),Vb(n,t,a),!0}return!1}function Ep(e,t,n,a){if(a={lane:2,revertLane:Lp(),action:a,hasEagerState:!1,eagerState:null,next:null},hd(e)){if(t)throw Error(W(479))}else t=up(e,n,a,2),t!==null&&qn(t,e,2)}function hd(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function Gb(e,t){pl=pu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vb(e,t,n){if(n&4194048){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Dj(e,n)}}var gu={readContext:rn,use:dd,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St},Yb={readContext:rn,use:dd,useCallback:function(e,t){return vn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:Jg,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Gc(4194308,4,$b.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gc(4194308,4,e,t)},useInsertionEffect:function(e,t){Gc(4,2,e,t)},useMemo:function(e,t){var n=vn();t=t===void 0?null:t;var a=e();if(vr){Ra(!0);try{e()}finally{Ra(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=vn();if(n!==void 0){var r=n(t);if(vr){Ra(!0);try{n(t)}finally{Ra(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=bC.bind(null,Oe,e),[a.memoizedState,e]},useRef:function(e){var t=vn();return e={current:e},t.memoizedState=e},useState:function(e){e=Gh(e);var t=e.queue,n=qb.bind(null,Oe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Sp,useDeferredValue:function(e,t){var n=vn();return Cp(n,e,t)},useTransition:function(){var e=Gh(!1);return e=Ub.bind(null,Oe,e.queue,!0,!1),vn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Oe,r=vn();if(Ye){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),ot===null)throw Error(W(349));Ie&124||yb(a,t,n)}r.memoizedState=n;var l={value:n,getSnapshot:t};return r.queue=l,Jg(bb.bind(null,a,l,e),[e]),a.flags|=2048,Tl(9,fd(),jb.bind(null,a,l,n,t),null),n},useId:function(){var e=vn(),t=ot.identifierPrefix;if(Ye){var n=ta,a=ea;n=(a&~(1<<32-In(a)-1)).toString(32)+n,t="«"+t+"R"+n,n=xu++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=pC++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Rp,useFormState:Qg,useActionState:Qg,useOptimistic:function(e){var t=vn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ep.bind(null,Oe,!0,n),n.dispatch=t,[e,t]},useMemoCache:Np,useCacheRefresh:function(){return vn().memoizedState=jC.bind(null,Oe)}},Fb={readContext:rn,use:dd,useCallback:Db,useContext:rn,useEffect:Tb,useImperativeHandle:Ob,useInsertionEffect:Ab,useLayoutEffect:Mb,useMemo:zb,useReducer:qc,useRef:Eb,useState:function(){return qc(ia)},useDebugValue:Sp,useDeferredValue:function(e,t){var n=Dt();return Lb(n,at.memoizedState,e,t)},useTransition:function(){var e=qc(ia)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:zo(e),t]},useSyncExternalStore:vb,useId:Ib,useHostTransitionStatus:Rp,useFormState:Wg,useActionState:Wg,useOptimistic:function(e,t){var n=Dt();return Nb(n,at,e,t)},useMemoCache:Np,useCacheRefresh:Pb},wC={readContext:rn,use:dd,useCallback:Db,useContext:rn,useEffect:Tb,useImperativeHandle:Ob,useInsertionEffect:Ab,useLayoutEffect:Mb,useMemo:zb,useReducer:Cf,useRef:Eb,useState:function(){return Cf(ia)},useDebugValue:Sp,useDeferredValue:function(e,t){var n=Dt();return at===null?Cp(n,e,t):Lb(n,at.memoizedState,e,t)},useTransition:function(){var e=Cf(ia)[0],t=Dt().memoizedState;return[typeof e=="boolean"?e:zo(e),t]},useSyncExternalStore:vb,useId:Ib,useHostTransitionStatus:Rp,useFormState:Zg,useActionState:Zg,useOptimistic:function(e,t){var n=Dt();return at!==null?Nb(n,at,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Np,useCacheRefresh:Pb},gl=null,ao=0;function fc(e){var t=ao;return ao+=1,gl===null&&(gl=[]),hb(gl,e,t)}function pi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function hc(e,t){throw t.$$typeof===ZS?Error(W(525)):(e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ev(e){var t=e._init;return t(e._payload)}function Kb(e){function t(g,p){if(e){var b=g.deletions;b===null?(g.deletions=[p],g.flags|=16):b.push(p)}}function n(g,p){if(!e)return null;for(;p!==null;)t(g,p),p=p.sibling;return null}function a(g){for(var p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function r(g,p){return g=aa(g,p),g.index=0,g.sibling=null,g}function l(g,p,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<p?(g.flags|=67108866,p):b):(g.flags|=67108866,p)):(g.flags|=1048576,p)}function i(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,p,b,w){return p===null||p.tag!==6?(p=Nf(b,g.mode,w),p.return=g,p):(p=r(p,b),p.return=g,p)}function c(g,p,b,w){var N=b.type;return N===Zr?f(g,p,b.props.children,w,b.key):p!==null&&(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===wa&&ev(N)===p.type)?(p=r(p,b.props),pi(p,b),p.return=g,p):(p=Ic(b.type,b.key,b.props,null,g.mode,w),pi(p,b),p.return=g,p)}function d(g,p,b,w){return p===null||p.tag!==4||p.stateNode.containerInfo!==b.containerInfo||p.stateNode.implementation!==b.implementation?(p=kf(b,g.mode,w),p.return=g,p):(p=r(p,b.children||[]),p.return=g,p)}function f(g,p,b,w,N){return p===null||p.tag!==7?(p=cr(b,g.mode,w,N),p.return=g,p):(p=r(p,b),p.return=g,p)}function m(g,p,b){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Nf(""+p,g.mode,b),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case rc:return b=Ic(p.type,p.key,p.props,null,g.mode,b),pi(b,p),b.return=g,b;case _i:return p=kf(p,g.mode,b),p.return=g,p;case wa:var w=p._init;return p=w(p._payload),m(g,p,b)}if(Ni(p)||di(p))return p=cr(p,g.mode,b,null),p.return=g,p;if(typeof p.then=="function")return m(g,fc(p),b);if(p.$$typeof===Js)return m(g,uc(g,p),b);hc(g,p)}return null}function h(g,p,b,w){var N=p!==null?p.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return N!==null?null:o(g,p,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case rc:return b.key===N?c(g,p,b,w):null;case _i:return b.key===N?d(g,p,b,w):null;case wa:return N=b._init,b=N(b._payload),h(g,p,b,w)}if(Ni(b)||di(b))return N!==null?null:f(g,p,b,w,null);if(typeof b.then=="function")return h(g,p,fc(b),w);if(b.$$typeof===Js)return h(g,p,uc(g,b),w);hc(g,b)}return null}function x(g,p,b,w,N){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return g=g.get(b)||null,o(p,g,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case rc:return g=g.get(w.key===null?b:w.key)||null,c(p,g,w,N);case _i:return g=g.get(w.key===null?b:w.key)||null,d(p,g,w,N);case wa:var C=w._init;return w=C(w._payload),x(g,p,b,w,N)}if(Ni(w)||di(w))return g=g.get(b)||null,f(p,g,w,N,null);if(typeof w.then=="function")return x(g,p,b,fc(w),N);if(w.$$typeof===Js)return x(g,p,b,uc(p,w),N);hc(p,w)}return null}function j(g,p,b,w){for(var N=null,C=null,_=p,S=p=0,D=null;_!==null&&S<b.length;S++){_.index>S?(D=_,_=null):D=_.sibling;var O=h(g,_,b[S],w);if(O===null){_===null&&(_=D);break}e&&_&&O.alternate===null&&t(g,_),p=l(O,p,S),C===null?N=O:C.sibling=O,C=O,_=D}if(S===b.length)return n(g,_),Ye&&rr(g,S),N;if(_===null){for(;S<b.length;S++)_=m(g,b[S],w),_!==null&&(p=l(_,p,S),C===null?N=_:C.sibling=_,C=_);return Ye&&rr(g,S),N}for(_=a(_);S<b.length;S++)D=x(_,g,S,b[S],w),D!==null&&(e&&D.alternate!==null&&_.delete(D.key===null?S:D.key),p=l(D,p,S),C===null?N=D:C.sibling=D,C=D);return e&&_.forEach(function(B){return t(g,B)}),Ye&&rr(g,S),N}function v(g,p,b,w){if(b==null)throw Error(W(151));for(var N=null,C=null,_=p,S=p=0,D=null,O=b.next();_!==null&&!O.done;S++,O=b.next()){_.index>S?(D=_,_=null):D=_.sibling;var B=h(g,_,O.value,w);if(B===null){_===null&&(_=D);break}e&&_&&B.alternate===null&&t(g,_),p=l(B,p,S),C===null?N=B:C.sibling=B,C=B,_=D}if(O.done)return n(g,_),Ye&&rr(g,S),N;if(_===null){for(;!O.done;S++,O=b.next())O=m(g,O.value,w),O!==null&&(p=l(O,p,S),C===null?N=O:C.sibling=O,C=O);return Ye&&rr(g,S),N}for(_=a(_);!O.done;S++,O=b.next())O=x(_,g,S,O.value,w),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?S:O.key),p=l(O,p,S),C===null?N=O:C.sibling=O,C=O);return e&&_.forEach(function(Y){return t(g,Y)}),Ye&&rr(g,S),N}function y(g,p,b,w){if(typeof b=="object"&&b!==null&&b.type===Zr&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case rc:e:{for(var N=b.key;p!==null;){if(p.key===N){if(N=b.type,N===Zr){if(p.tag===7){n(g,p.sibling),w=r(p,b.props.children),w.return=g,g=w;break e}}else if(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===wa&&ev(N)===p.type){n(g,p.sibling),w=r(p,b.props),pi(w,b),w.return=g,g=w;break e}n(g,p);break}else t(g,p);p=p.sibling}b.type===Zr?(w=cr(b.props.children,g.mode,w,b.key),w.return=g,g=w):(w=Ic(b.type,b.key,b.props,null,g.mode,w),pi(w,b),w.return=g,g=w)}return i(g);case _i:e:{for(N=b.key;p!==null;){if(p.key===N)if(p.tag===4&&p.stateNode.containerInfo===b.containerInfo&&p.stateNode.implementation===b.implementation){n(g,p.sibling),w=r(p,b.children||[]),w.return=g,g=w;break e}else{n(g,p);break}else t(g,p);p=p.sibling}w=kf(b,g.mode,w),w.return=g,g=w}return i(g);case wa:return N=b._init,b=N(b._payload),y(g,p,b,w)}if(Ni(b))return j(g,p,b,w);if(di(b)){if(N=di(b),typeof N!="function")throw Error(W(150));return b=N.call(b),v(g,p,b,w)}if(typeof b.then=="function")return y(g,p,fc(b),w);if(b.$$typeof===Js)return y(g,p,uc(g,b),w);hc(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,p!==null&&p.tag===6?(n(g,p.sibling),w=r(p,b),w.return=g,g=w):(n(g,p),w=Nf(b,g.mode,w),w.return=g,g=w),i(g)):n(g,p)}return function(g,p,b,w){try{ao=0;var N=y(g,p,b,w);return gl=null,N}catch(_){if(_===Do||_===ud)throw _;var C=Bn(29,_,null,g.mode);return C.lanes=w,C.return=g,C}finally{}}}var Al=Kb(!0),Xb=Kb(!1),is=Is(null),zs=null;function ka(e){var t=e.alternate;pt(Pt,Pt.current&1),pt(is,e),zs===null&&(t===null||El.current!==null||t.memoizedState!==null)&&(zs=e)}function Qb(e){if(e.tag===22){if(pt(Pt,Pt.current),pt(is,e),zs===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(zs=e)}}else Sa()}function Sa(){pt(Pt,Pt.current),pt(is,is.current)}function sa(e){Wt(is),zs===e&&(zs=null),Wt(Pt)}var Pt=Is(0);function vu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||cm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Rf(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:dt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Fh={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Pn(),r=Da(a);r.payload=t,n!=null&&(r.callback=n),t=za(e,r,a),t!==null&&(qn(t,e,a),Hi(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Pn(),r=Da(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=za(e,r,a),t!==null&&(qn(t,e,a),Hi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pn(),a=Da(n);a.tag=2,t!=null&&(a.callback=t),t=za(e,a,n),t!==null&&(qn(t,e,n),Hi(t,e,n))}};function tv(e,t,n,a,r,l,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,l,i):t.prototype&&t.prototype.isPureReactComponent?!to(n,a)||!to(r,l):!0}function nv(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Fh.enqueueReplaceState(t,t.state,null)}function yr(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=dt({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var yu=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Wb(e){yu(e)}function Zb(e){console.error(e)}function Jb(e){yu(e)}function ju(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function sv(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Kh(e,t,n){return n=Da(n),n.tag=3,n.payload={element:null},n.callback=function(){ju(e,t)},n}function ew(e){return e=Da(e),e.tag=3,e}function tw(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var l=a.value;e.payload=function(){return r(l)},e.callback=function(){sv(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){sv(t,n,a),typeof r!="function"&&(La===null?La=new Set([this]):La.add(this));var o=a.stack;this.componentDidCatch(a.value,{componentStack:o!==null?o:""})})}function _C(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&$o(t,n,r,!0),n=is.current,n!==null){switch(n.tag){case 13:return zs===null?nm():n.alternate===null&&bt===0&&(bt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===Hh?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Bf(e,a,r)),!1;case 22:return n.flags|=65536,a===Hh?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),Bf(e,a,r)),!1}throw Error(W(435,n.tag))}return Bf(e,a,r),nm(),!1}if(Ye)return t=is.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==Dh&&(e=Error(W(422),{cause:a}),no(es(e,n)))):(a!==Dh&&(t=Error(W(423),{cause:a}),no(es(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=es(a,n),r=Kh(e.stateNode,a,r),Sf(e,r),bt!==4&&(bt=2)),!1;var l=Error(W(520),{cause:a});if(l=es(l,n),Yi===null?Yi=[l]:Yi.push(l),bt!==4&&(bt=2),t===null)return!0;a=es(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Kh(n.stateNode,a,e),Sf(n,e),!1;case 1:if(t=n.type,l=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||l!==null&&typeof l.componentDidCatch=="function"&&(La===null||!La.has(l))))return n.flags|=65536,r&=-r,n.lanes|=r,r=ew(r),tw(r,e,n,a),Sf(n,r),!1}n=n.return}while(n!==null);return!1}var nw=Error(W(461)),Qt=!1;function en(e,t,n,a){t.child=e===null?Xb(t,null,n,a):Al(t,e.child,n,a)}function av(e,t,n,a,r){n=n.render;var l=t.ref;if("ref"in a){var i={};for(var o in a)o!=="ref"&&(i[o]=a[o])}else i=a;return gr(t),a=yp(e,t,n,i,l,r),o=jp(),e!==null&&!Qt?(bp(e,t,r),oa(e,t,r)):(Ye&&o&&fp(t),t.flags|=1,en(e,t,a,r),t.child)}function rv(e,t,n,a,r){if(e===null){var l=n.type;return typeof l=="function"&&!dp(l)&&l.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=l,sw(e,t,l,a,r)):(e=Ic(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!Tp(e,r)){var i=l.memoizedProps;if(n=n.compare,n=n!==null?n:to,n(i,a)&&e.ref===t.ref)return oa(e,t,r)}return t.flags|=1,e=aa(l,a),e.ref=t.ref,e.return=t,t.child=e}function sw(e,t,n,a,r){if(e!==null){var l=e.memoizedProps;if(to(l,a)&&e.ref===t.ref)if(Qt=!1,t.pendingProps=a=l,Tp(e,r))e.flags&131072&&(Qt=!0);else return t.lanes=e.lanes,oa(e,t,r)}return Xh(e,t,n,a,r)}function aw(e,t,n){var a=t.pendingProps,r=a.children,l=e!==null?e.memoizedState:null;if(a.mode==="hidden"){if(t.flags&128){if(a=l!==null?l.baseLanes|n:n,e!==null){for(r=t.child=e.child,l=0;r!==null;)l=l|r.lanes|r.childLanes,r=r.sibling;t.childLanes=l&~a}else t.childLanes=0,t.child=null;return lv(e,t,a,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Pc(t,l!==null?l.cachePool:null),l!==null?Fg(t,l):qh(),Qb(t);else return t.lanes=t.childLanes=536870912,lv(e,t,l!==null?l.baseLanes|n:n,n)}else l!==null?(Pc(t,l.cachePool),Fg(t,l),Sa(),t.memoizedState=null):(e!==null&&Pc(t,null),qh(),Sa());return en(e,t,r,n),t.child}function lv(e,t,n,a){var r=pp();return r=r===null?null:{parent:It._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&Pc(t,null),qh(),Qb(t),e!==null&&$o(e,t,a,!0),null}function Vc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(W(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Xh(e,t,n,a,r){return gr(t),n=yp(e,t,n,a,void 0,r),a=jp(),e!==null&&!Qt?(bp(e,t,r),oa(e,t,r)):(Ye&&a&&fp(t),t.flags|=1,en(e,t,n,r),t.child)}function iv(e,t,n,a,r,l){return gr(t),t.updateQueue=null,n=gb(t,a,n,r),xb(e),a=jp(),e!==null&&!Qt?(bp(e,t,l),oa(e,t,l)):(Ye&&a&&fp(t),t.flags|=1,en(e,t,n,l),t.child)}function ov(e,t,n,a,r){if(gr(t),t.stateNode===null){var l=ll,i=n.contextType;typeof i=="object"&&i!==null&&(l=rn(i)),l=new n(a,l),t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Fh,t.stateNode=l,l._reactInternals=t,l=t.stateNode,l.props=a,l.state=t.memoizedState,l.refs={},xp(t),i=n.contextType,l.context=typeof i=="object"&&i!==null?rn(i):ll,l.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(Rf(t,n,i,a),l.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(i=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),i!==l.state&&Fh.enqueueReplaceState(l,l.state,null),Pi(t,a,l,r),Ii(),l.state=t.memoizedState),typeof l.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){l=t.stateNode;var o=t.memoizedProps,c=yr(n,o);l.props=c;var d=l.context,f=n.contextType;i=ll,typeof f=="object"&&f!==null&&(i=rn(f));var m=n.getDerivedStateFromProps;f=typeof m=="function"||typeof l.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,f||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o||d!==i)&&nv(t,l,a,i),_a=!1;var h=t.memoizedState;l.state=h,Pi(t,a,l,r),Ii(),d=t.memoizedState,o||h!==d||_a?(typeof m=="function"&&(Rf(t,n,m,a),d=t.memoizedState),(c=_a||tv(t,n,c,a,h,d,i))?(f||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=d),l.props=a,l.state=d,l.context=i,a=c):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{l=t.stateNode,Ih(e,t),i=t.memoizedProps,f=yr(n,i),l.props=f,m=t.pendingProps,h=l.context,d=n.contextType,c=ll,typeof d=="object"&&d!==null&&(c=rn(d)),o=n.getDerivedStateFromProps,(d=typeof o=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(i!==m||h!==c)&&nv(t,l,a,c),_a=!1,h=t.memoizedState,l.state=h,Pi(t,a,l,r),Ii();var x=t.memoizedState;i!==m||h!==x||_a||e!==null&&e.dependencies!==null&&hu(e.dependencies)?(typeof o=="function"&&(Rf(t,n,o,a),x=t.memoizedState),(f=_a||tv(t,n,f,a,h,x,c)||e!==null&&e.dependencies!==null&&hu(e.dependencies))?(d||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(a,x,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(a,x,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=x),l.props=a,l.state=x,l.context=c,a=f):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),a=!1)}return l=a,Vc(e,t),a=(t.flags&128)!==0,l||a?(l=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:l.render(),t.flags|=1,e!==null&&a?(t.child=Al(t,e.child,null,r),t.child=Al(t,null,n,r)):en(e,t,n,r),t.memoizedState=l.state,e=t.child):e=oa(e,t,r),e}function cv(e,t,n,a){return Mo(),t.flags|=256,en(e,t,n,a),t.child}var Ef={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Tf(e){return{baseLanes:e,cachePool:db()}}function Af(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=ts),e}function rw(e,t,n){var a=t.pendingProps,r=!1,l=(t.flags&128)!==0,i;if((i=l)||(i=e!==null&&e.memoizedState===null?!1:(Pt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ye){if(r?ka(t):Sa(),Ye){var o=jt,c;if(c=o){e:{for(c=o,o=Rs;c.nodeType!==8;){if(!o){o=null;break e}if(c=gs(c.nextSibling),c===null){o=null;break e}}o=c}o!==null?(t.memoizedState={dehydrated:o,treeContext:ur!==null?{id:ea,overflow:ta}:null,retryLane:536870912,hydrationErrors:null},c=Bn(18,null,null,0),c.stateNode=o,c.return=t,t.child=c,cn=t,jt=null,c=!0):c=!1}c||xr(t)}if(o=t.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return cm(o)?t.lanes=32:t.lanes=536870912,null;sa(t)}return o=a.children,a=a.fallback,r?(Sa(),r=t.mode,o=bu({mode:"hidden",children:o},r),a=cr(a,r,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,r=t.child,r.memoizedState=Tf(n),r.childLanes=Af(e,i,n),t.memoizedState=Ef,a):(ka(t),Qh(t,o))}if(c=e.memoizedState,c!==null&&(o=c.dehydrated,o!==null)){if(l)t.flags&256?(ka(t),t.flags&=-257,t=Mf(e,t,n)):t.memoizedState!==null?(Sa(),t.child=e.child,t.flags|=128,t=null):(Sa(),r=a.fallback,o=t.mode,a=bu({mode:"visible",children:a.children},o),r=cr(r,o,n,null),r.flags|=2,a.return=t,r.return=t,a.sibling=r,t.child=a,Al(t,e.child,null,n),a=t.child,a.memoizedState=Tf(n),a.childLanes=Af(e,i,n),t.memoizedState=Ef,t=r);else if(ka(t),cm(o)){if(i=o.nextSibling&&o.nextSibling.dataset,i)var d=i.dgst;i=d,a=Error(W(419)),a.stack="",a.digest=i,no({value:a,source:null,stack:null}),t=Mf(e,t,n)}else if(Qt||$o(e,t,n,!1),i=(n&e.childLanes)!==0,Qt||i){if(i=ot,i!==null&&(a=n&-n,a=a&42?1:ep(a),a=a&(i.suspendedLanes|n)?0:a,a!==0&&a!==c.retryLane))throw c.retryLane=a,ql(e,a),qn(i,e,a),nw;o.data==="$?"||nm(),t=Mf(e,t,n)}else o.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,jt=gs(o.nextSibling),cn=t,Ye=!0,dr=null,Rs=!1,e!==null&&(Wn[Zn++]=ea,Wn[Zn++]=ta,Wn[Zn++]=ur,ea=e.id,ta=e.overflow,ur=t),t=Qh(t,a.children),t.flags|=4096);return t}return r?(Sa(),r=a.fallback,o=t.mode,c=e.child,d=c.sibling,a=aa(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,d!==null?r=aa(d,r):(r=cr(r,o,n,null),r.flags|=2),r.return=t,a.return=t,a.sibling=r,t.child=a,a=r,r=t.child,o=e.child.memoizedState,o===null?o=Tf(n):(c=o.cachePool,c!==null?(d=It._currentValue,c=c.parent!==d?{parent:d,pool:d}:c):c=db(),o={baseLanes:o.baseLanes|n,cachePool:c}),r.memoizedState=o,r.childLanes=Af(e,i,n),t.memoizedState=Ef,a):(ka(t),n=e.child,e=n.sibling,n=aa(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(i=t.deletions,i===null?(t.deletions=[e],t.flags|=16):i.push(e)),t.child=n,t.memoizedState=null,n)}function Qh(e,t){return t=bu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function bu(e,t){return e=Bn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Mf(e,t,n){return Al(t,e.child,null,n),e=Qh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uv(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Lh(e.return,t,n)}function $f(e,t,n,a,r){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=a,l.tail=n,l.tailMode=r)}function lw(e,t,n){var a=t.pendingProps,r=a.revealOrder,l=a.tail;if(en(e,t,a.children,n),a=Pt.current,a&2)a=a&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uv(e,n,t);else if(e.tag===19)uv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}a&=1}switch(pt(Pt,a),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&vu(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),$f(t,!1,r,n,l);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&vu(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}$f(t,!0,n,null,l);break;case"together":$f(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function oa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Va|=t.lanes,!(n&t.childLanes))if(e!==null){if($o(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=aa(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=aa(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Tp(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&hu(e)))}function NC(e,t,n){switch(t.tag){case 3:ru(t,t.stateNode.containerInfo),Na(t,It,e.memoizedState.cache),Mo();break;case 27:case 5:kh(t);break;case 4:ru(t,t.stateNode.containerInfo);break;case 10:Na(t,t.type,t.memoizedProps.value);break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ka(t),t.flags|=128,null):n&t.child.childLanes?rw(e,t,n):(ka(t),e=oa(e,t,n),e!==null?e.sibling:null);ka(t);break;case 19:var r=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||($o(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return lw(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),pt(Pt,Pt.current),a)break;return null;case 22:case 23:return t.lanes=0,aw(e,t,n);case 24:Na(t,It,e.memoizedState.cache)}return oa(e,t,n)}function iw(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Qt=!0;else{if(!Tp(e,n)&&!(t.flags&128))return Qt=!1,NC(e,t,n);Qt=!!(e.flags&131072)}else Qt=!1,Ye&&t.flags&1048576&&cb(t,fu,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var a=t.elementType,r=a._init;if(a=r(a._payload),t.type=a,typeof a=="function")dp(a)?(e=yr(a,e),t.tag=1,t=ov(null,t,a,e,n)):(t.tag=0,t=Xh(null,t,a,e,n));else{if(a!=null){if(r=a.$$typeof,r===Wm){t.tag=11,t=av(null,t,a,e,n);break e}else if(r===Zm){t.tag=14,t=rv(null,t,a,e,n);break e}}throw t=_h(a)||a,Error(W(306,t,""))}}return t;case 0:return Xh(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=yr(a,t.pendingProps),ov(e,t,a,r,n);case 3:e:{if(ru(t,t.stateNode.containerInfo),e===null)throw Error(W(387));a=t.pendingProps;var l=t.memoizedState;r=l.element,Ih(e,t),Pi(t,a,null,n);var i=t.memoizedState;if(a=i.cache,Na(t,It,a),a!==l.cache&&Uh(t,[It],n,!0),Ii(),a=i.element,l.isDehydrated)if(l={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){t=cv(e,t,a,n);break e}else if(a!==r){r=es(Error(W(424)),t),no(r),t=cv(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(jt=gs(e.firstChild),cn=t,Ye=!0,dr=null,Rs=!0,n=Xb(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Mo(),a===r){t=oa(e,t,n);break e}en(e,t,a,n)}t=t.child}return t;case 26:return Vc(e,t),e===null?(n=Cv(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ye||(n=t.type,e=t.pendingProps,a=Ru(Oa.current).createElement(n),a[an]=t,a[wn]=e,nn(a,n,e),Xt(a),t.stateNode=a):t.memoizedState=Cv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return kh(t),e===null&&Ye&&(a=t.stateNode=Fw(t.type,t.pendingProps,Oa.current),cn=t,Rs=!0,r=jt,Qa(t.type)?(um=r,jt=gs(a.firstChild)):jt=r),en(e,t,t.pendingProps.children,n),Vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ye&&((r=a=jt)&&(a=ZC(a,t.type,t.pendingProps,Rs),a!==null?(t.stateNode=a,cn=t,jt=gs(a.firstChild),Rs=!1,r=!0):r=!1),r||xr(t)),kh(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,a=l.children,im(r,l)?a=null:i!==null&&im(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=yp(e,t,xC,null,null,n),oo._currentValue=r),Vc(e,t),en(e,t,a,n),t.child;case 6:return e===null&&Ye&&((e=n=jt)&&(n=JC(n,t.pendingProps,Rs),n!==null?(t.stateNode=n,cn=t,jt=null,e=!0):e=!1),e||xr(t)),null;case 13:return rw(e,t,n);case 4:return ru(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Al(t,null,a,n):en(e,t,a,n),t.child;case 11:return av(e,t,t.type,t.pendingProps,n);case 7:return en(e,t,t.pendingProps,n),t.child;case 8:return en(e,t,t.pendingProps.children,n),t.child;case 12:return en(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,Na(t,t.type,a.value),en(e,t,a.children,n),t.child;case 9:return r=t.type._context,a=t.pendingProps.children,gr(t),r=rn(r),a=a(r),t.flags|=1,en(e,t,a,n),t.child;case 14:return rv(e,t,t.type,t.pendingProps,n);case 15:return sw(e,t,t.type,t.pendingProps,n);case 19:return lw(e,t,n);case 31:return a=t.pendingProps,n=t.mode,a={mode:a.mode,children:a.children},e===null?(n=bu(a,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=aa(e.child,a),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return aw(e,t,n);case 24:return gr(t),a=rn(It),e===null?(r=pp(),r===null&&(r=ot,l=mp(),r.pooledCache=l,l.refCount++,l!==null&&(r.pooledCacheLanes|=n),r=l),t.memoizedState={parent:a,cache:r},xp(t),Na(t,It,r)):(e.lanes&n&&(Ih(e,t),Pi(t,null,null,n),Ii()),r=e.memoizedState,l=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Na(t,It,a)):(a=l.cache,Na(t,It,a),a!==r.cache&&Uh(t,[It],n,!0))),en(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(W(156,t.tag))}function Fs(e){e.flags|=4}function dv(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Qw(t)){if(t=is.current,t!==null&&((Ie&4194048)===Ie?zs!==null:(Ie&62914560)!==Ie&&!(Ie&536870912)||t!==zs))throw Bi=Hh,fb;e.flags|=8192}}function mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?$j():536870912,e.lanes|=t,Ml|=t)}function xi(e,t){if(!Ye)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&65011712,a|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function kC(e,t,n){var a=t.pendingProps;switch(hp(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ra(It),kl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(mi(t)?Fs(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ig())),gt(t),null;case 26:return n=t.memoizedState,e===null?(Fs(t),n!==null?(gt(t),dv(t,n)):(gt(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Fs(t),gt(t),dv(t,n)):(gt(t),t.flags&=-16777217):(e.memoizedProps!==a&&Fs(t),gt(t),t.flags&=-16777217),null;case 27:lu(t),n=Oa.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Fs(t);else{if(!a){if(t.stateNode===null)throw Error(W(166));return gt(t),null}e=Os.current,mi(t)?Bg(t):(e=Fw(r,a,n),t.stateNode=e,Fs(t))}return gt(t),null;case 5:if(lu(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Fs(t);else{if(!a){if(t.stateNode===null)throw Error(W(166));return gt(t),null}if(e=Os.current,mi(t))Bg(t);else{switch(r=Ru(Oa.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof a.is=="string"?r.createElement("select",{is:a.is}):r.createElement("select"),a.multiple?e.multiple=!0:a.size&&(e.size=a.size);break;default:e=typeof a.is=="string"?r.createElement(n,{is:a.is}):r.createElement(n)}}e[an]=t,e[wn]=a;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(nn(e,n,a),n){case"button":case"input":case"select":case"textarea":e=!!a.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Fs(t)}}return gt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Fs(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(W(166));if(e=Oa.current,mi(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=cn,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[an]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Gw(e.nodeValue,n)),e||xr(t)}else e=Ru(e).createTextNode(a),e[an]=t,t.stateNode=e}return gt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=mi(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(W(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(W(317));r[an]=t}else Mo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;gt(t),r=!1}else r=Ig(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(sa(t),t):(sa(t),null)}if(sa(t),t.flags&128)return t.lanes=n,t;if(n=a!==null,e=e!==null&&e.memoizedState!==null,n){a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool);var l=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==r&&(a.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),mc(t,t.updateQueue),gt(t),null;case 4:return kl(),e===null&&Up(t.stateNode.containerInfo),gt(t),null;case 10:return ra(t.type),gt(t),null;case 19:if(Wt(Pt),r=t.memoizedState,r===null)return gt(t),null;if(a=(t.flags&128)!==0,l=r.rendering,l===null)if(a)xi(r,!1);else{if(bt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=vu(e),l!==null){for(t.flags|=128,xi(r,!1),e=l.updateQueue,t.updateQueue=e,mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ob(n,e),n=n.sibling;return pt(Pt,Pt.current&1|2),t.child}e=e.sibling}r.tail!==null&&Ds()>_u&&(t.flags|=128,a=!0,xi(r,!1),t.lanes=4194304)}else{if(!a)if(e=vu(l),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,mc(t,e),xi(r,!0),r.tail===null&&r.tailMode==="hidden"&&!l.alternate&&!Ye)return gt(t),null}else 2*Ds()-r.renderingStartTime>_u&&n!==536870912&&(t.flags|=128,a=!0,xi(r,!1),t.lanes=4194304);r.isBackwards?(l.sibling=t.child,t.child=l):(e=r.last,e!==null?e.sibling=l:t.child=l,r.last=l)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Ds(),t.sibling=null,e=Pt.current,pt(Pt,a?e&1|2:e&1),t):(gt(t),null);case 22:case 23:return sa(t),gp(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?n&536870912&&!(t.flags&128)&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),n=t.updateQueue,n!==null&&mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Wt(fr),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ra(It),gt(t),null;case 25:return null;case 30:return null}throw Error(W(156,t.tag))}function SC(e,t){switch(hp(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ra(It),kl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return lu(t),null;case 13:if(sa(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Mo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wt(Pt),null;case 4:return kl(),null;case 10:return ra(t.type),null;case 22:case 23:return sa(t),gp(),e!==null&&Wt(fr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ra(It),null;case 25:return null;default:return null}}function ow(e,t){switch(hp(t),t.tag){case 3:ra(It),kl();break;case 26:case 27:case 5:lu(t);break;case 4:kl();break;case 13:sa(t);break;case 19:Wt(Pt);break;case 10:ra(t.type);break;case 22:case 23:sa(t),gp(),e!==null&&Wt(fr);break;case 24:ra(It)}}function Uo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var l=n.create,i=n.inst;a=l(),i.destroy=a}n=n.next}while(n!==r)}}catch(o){rt(t,t.return,o)}}function Ga(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var l=r.next;a=l;do{if((a.tag&e)===e){var i=a.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,r=t;var c=n,d=o;try{d()}catch(f){rt(r,c,f)}}}a=a.next}while(a!==l)}}catch(f){rt(t,t.return,f)}}function cw(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{pb(t,n)}catch(a){rt(e,e.return,a)}}}function uw(e,t,n){n.props=yr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){rt(e,t,a)}}function Gi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(r){rt(e,t,r)}}function As(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){rt(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){rt(e,t,r)}else n.current=null}function dw(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){rt(e,e.return,r)}}function Of(e,t,n){try{var a=e.stateNode;FC(a,e.type,n,t),a[wn]=t}catch(r){rt(e,e.return,r)}}function fw(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qa(e.type)||e.tag===4}function Df(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qa(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Wh(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=gd));else if(a!==4&&(a===27&&Qa(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Wh(e,t,n),e=e.sibling;e!==null;)Wh(e,t,n),e=e.sibling}function wu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Qa(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(wu(e,t,n),e=e.sibling;e!==null;)wu(e,t,n),e=e.sibling}function hw(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);nn(t,a,n),t[an]=e,t[wn]=n}catch(l){rt(e,e.return,l)}}var Zs=!1,Ct=!1,zf=!1,fv=typeof WeakSet=="function"?WeakSet:Set,Kt=null;function CC(e,t){if(e=e.containerInfo,rm=Mu,e=eb(e),op(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var r=a.anchorOffset,l=a.focusNode;a=a.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var i=0,o=-1,c=-1,d=0,f=0,m=e,h=null;t:for(;;){for(var x;m!==n||r!==0&&m.nodeType!==3||(o=i+r),m!==l||a!==0&&m.nodeType!==3||(c=i+a),m.nodeType===3&&(i+=m.nodeValue.length),(x=m.firstChild)!==null;)h=m,m=x;for(;;){if(m===e)break t;if(h===n&&++d===r&&(o=i),h===l&&++f===a&&(c=i),(x=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=x}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(lm={focusedElem:e,selectionRange:n},Mu=!1,Kt=t;Kt!==null;)if(t=Kt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Kt=e;else for(;Kt!==null;){switch(t=Kt,l=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&l!==null){e=void 0,n=t,r=l.memoizedProps,l=l.memoizedState,a=n.stateNode;try{var j=yr(n.type,r,n.elementType===n.type);e=a.getSnapshotBeforeUpdate(j,l),a.__reactInternalSnapshotBeforeUpdate=e}catch(v){rt(n,n.return,v)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)om(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":om(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(W(163))}if(e=t.sibling,e!==null){e.return=t.return,Kt=e;break}Kt=t.return}}function mw(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:xa(e,n),a&4&&Uo(5,n);break;case 1:if(xa(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){rt(n,n.return,i)}else{var r=yr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){rt(n,n.return,i)}}a&64&&cw(n),a&512&&Gi(n,n.return);break;case 3:if(xa(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{pb(e,t)}catch(i){rt(n,n.return,i)}}break;case 27:t===null&&a&4&&hw(n);case 26:case 5:xa(e,n),t===null&&a&4&&dw(n),a&512&&Gi(n,n.return);break;case 12:xa(e,n);break;case 13:xa(e,n),a&4&&gw(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=zC.bind(null,n),eR(e,n))));break;case 22:if(a=n.memoizedState!==null||Zs,!a){t=t!==null&&t.memoizedState!==null||Ct,r=Zs;var l=Ct;Zs=a,(Ct=t)&&!l?ja(e,n,(n.subtreeFlags&8772)!==0):xa(e,n),Zs=r,Ct=l}break;case 30:break;default:xa(e,n)}}function pw(e){var t=e.alternate;t!==null&&(e.alternate=null,pw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&np(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ht=null,yn=!1;function Ks(e,t,n){for(n=n.child;n!==null;)xw(e,t,n),n=n.sibling}function xw(e,t,n){if(Hn&&typeof Hn.onCommitFiberUnmount=="function")try{Hn.onCommitFiberUnmount(Co,n)}catch{}switch(n.tag){case 26:Ct||As(n,t),Ks(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ct||As(n,t);var a=ht,r=yn;Qa(n.type)&&(ht=n.stateNode,yn=!1),Ks(e,t,n),Ki(n.stateNode),ht=a,yn=r;break;case 5:Ct||As(n,t);case 6:if(a=ht,r=yn,ht=null,Ks(e,t,n),ht=a,yn=r,ht!==null)if(yn)try{(ht.nodeType===9?ht.body:ht.nodeName==="HTML"?ht.ownerDocument.body:ht).removeChild(n.stateNode)}catch(l){rt(n,t,l)}else try{ht.removeChild(n.stateNode)}catch(l){rt(n,t,l)}break;case 18:ht!==null&&(yn?(e=ht,Nv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),fo(e)):Nv(ht,n.stateNode));break;case 4:a=ht,r=yn,ht=n.stateNode.containerInfo,yn=!0,Ks(e,t,n),ht=a,yn=r;break;case 0:case 11:case 14:case 15:Ct||Ga(2,n,t),Ct||Ga(4,n,t),Ks(e,t,n);break;case 1:Ct||(As(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&uw(n,t,a)),Ks(e,t,n);break;case 21:Ks(e,t,n);break;case 22:Ct=(a=Ct)||n.memoizedState!==null,Ks(e,t,n),Ct=a;break;default:Ks(e,t,n)}}function gw(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fo(e)}catch(n){rt(t,t.return,n)}}function RC(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new fv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new fv),t;default:throw Error(W(435,e.tag))}}function Lf(e,t){var n=RC(e);t.forEach(function(a){var r=LC.bind(null,e,a);n.has(a)||(n.add(a),a.then(r,r))})}function On(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a],l=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 27:if(Qa(o.type)){ht=o.stateNode,yn=!1;break e}break;case 5:ht=o.stateNode,yn=!1;break e;case 3:case 4:ht=o.stateNode.containerInfo,yn=!0;break e}o=o.return}if(ht===null)throw Error(W(160));xw(l,i,r),ht=null,yn=!1,l=r.alternate,l!==null&&(l.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)vw(t,e),t=t.sibling}var hs=null;function vw(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:On(t,e),Dn(e),a&4&&(Ga(3,e,e.return),Uo(3,e),Ga(5,e,e.return));break;case 1:On(t,e),Dn(e),a&512&&(Ct||n===null||As(n,n.return)),a&64&&Zs&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var r=hs;if(On(t,e),Dn(e),a&512&&(Ct||n===null||As(n,n.return)),a&4){var l=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(a){case"title":l=r.getElementsByTagName("title")[0],(!l||l[To]||l[an]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=r.createElement(a),r.head.insertBefore(l,r.querySelector("head > title"))),nn(l,a,n),l[an]=e,Xt(l),a=l;break e;case"link":var i=Ev("link","href",r).get(a+(n.href||""));if(i){for(var o=0;o<i.length;o++)if(l=i[o],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(o,1);break t}}l=r.createElement(a),nn(l,a,n),r.head.appendChild(l);break;case"meta":if(i=Ev("meta","content",r).get(a+(n.content||""))){for(o=0;o<i.length;o++)if(l=i[o],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(o,1);break t}}l=r.createElement(a),nn(l,a,n),r.head.appendChild(l);break;default:throw Error(W(468,a))}l[an]=e,Xt(l),a=l}e.stateNode=a}else Tv(r,e.type,e.stateNode);else e.stateNode=Rv(r,a,e.memoizedProps);else l!==a?(l===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):l.count--,a===null?Tv(r,e.type,e.stateNode):Rv(r,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Of(e,e.memoizedProps,n.memoizedProps)}break;case 27:On(t,e),Dn(e),a&512&&(Ct||n===null||As(n,n.return)),n!==null&&a&4&&Of(e,e.memoizedProps,n.memoizedProps);break;case 5:if(On(t,e),Dn(e),a&512&&(Ct||n===null||As(n,n.return)),e.flags&32){r=e.stateNode;try{Cl(r,"")}catch(x){rt(e,e.return,x)}}a&4&&e.stateNode!=null&&(r=e.memoizedProps,Of(e,r,n!==null?n.memoizedProps:r)),a&1024&&(zf=!0);break;case 6:if(On(t,e),Dn(e),a&4){if(e.stateNode===null)throw Error(W(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(x){rt(e,e.return,x)}}break;case 3:if(Kc=null,r=hs,hs=Eu(t.containerInfo),On(t,e),hs=r,Dn(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{fo(t.containerInfo)}catch(x){rt(e,e.return,x)}zf&&(zf=!1,yw(e));break;case 4:a=hs,hs=Eu(e.stateNode.containerInfo),On(t,e),Dn(e),hs=a;break;case 12:On(t,e),Dn(e);break;case 13:On(t,e),Dn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Dp=Ds()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Lf(e,a)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=Zs,f=Ct;if(Zs=d||r,Ct=f||c,On(t,e),Ct=f,Zs=d,Dn(e),a&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||Zs||Ct||lr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(l=c.stateNode,r)i=l.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{o=c.stateNode;var m=c.memoizedProps.style,h=m!=null&&m.hasOwnProperty("display")?m.display:null;o.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(x){rt(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(x){rt(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Lf(e,n))));break;case 19:On(t,e),Dn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Lf(e,a)));break;case 30:break;case 21:break;default:On(t,e),Dn(e)}}function Dn(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(fw(a)){n=a;break}a=a.return}if(n==null)throw Error(W(160));switch(n.tag){case 27:var r=n.stateNode,l=Df(e);wu(e,l,r);break;case 5:var i=n.stateNode;n.flags&32&&(Cl(i,""),n.flags&=-33);var o=Df(e);wu(e,o,i);break;case 3:case 4:var c=n.stateNode.containerInfo,d=Df(e);Wh(e,d,c);break;default:throw Error(W(161))}}catch(f){rt(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yw(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yw(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)mw(e,t.alternate,t),t=t.sibling}function lr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ga(4,t,t.return),lr(t);break;case 1:As(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&uw(t,t.return,n),lr(t);break;case 27:Ki(t.stateNode);case 26:case 5:As(t,t.return),lr(t);break;case 22:t.memoizedState===null&&lr(t);break;case 30:lr(t);break;default:lr(t)}e=e.sibling}}function ja(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,r=e,l=t,i=l.flags;switch(l.tag){case 0:case 11:case 15:ja(r,l,n),Uo(4,l);break;case 1:if(ja(r,l,n),a=l,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(d){rt(a,a.return,d)}if(a=l,r=a.updateQueue,r!==null){var o=a.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)mb(c[r],o)}catch(d){rt(a,a.return,d)}}n&&i&64&&cw(l),Gi(l,l.return);break;case 27:hw(l);case 26:case 5:ja(r,l,n),n&&a===null&&i&4&&dw(l),Gi(l,l.return);break;case 12:ja(r,l,n);break;case 13:ja(r,l,n),n&&i&4&&gw(r,l);break;case 22:l.memoizedState===null&&ja(r,l,n),Gi(l,l.return);break;case 30:break;default:ja(r,l,n)}t=t.sibling}}function Ap(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Oo(n))}function Mp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oo(e))}function Ss(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)jw(e,t,n,a),t=t.sibling}function jw(e,t,n,a){var r=t.flags;switch(t.tag){case 0:case 11:case 15:Ss(e,t,n,a),r&2048&&Uo(9,t);break;case 1:Ss(e,t,n,a);break;case 3:Ss(e,t,n,a),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Oo(e)));break;case 12:if(r&2048){Ss(e,t,n,a),e=t.stateNode;try{var l=t.memoizedProps,i=l.id,o=l.onPostCommit;typeof o=="function"&&o(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){rt(t,t.return,c)}}else Ss(e,t,n,a);break;case 13:Ss(e,t,n,a);break;case 23:break;case 22:l=t.stateNode,i=t.alternate,t.memoizedState!==null?l._visibility&2?Ss(e,t,n,a):Vi(e,t):l._visibility&2?Ss(e,t,n,a):(l._visibility|=2,Qr(e,t,n,a,(t.subtreeFlags&10256)!==0)),r&2048&&Ap(i,t);break;case 24:Ss(e,t,n,a),r&2048&&Mp(t.alternate,t);break;default:Ss(e,t,n,a)}}function Qr(e,t,n,a,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var l=e,i=t,o=n,c=a,d=i.flags;switch(i.tag){case 0:case 11:case 15:Qr(l,i,o,c,r),Uo(8,i);break;case 23:break;case 22:var f=i.stateNode;i.memoizedState!==null?f._visibility&2?Qr(l,i,o,c,r):Vi(l,i):(f._visibility|=2,Qr(l,i,o,c,r)),r&&d&2048&&Ap(i.alternate,i);break;case 24:Qr(l,i,o,c,r),r&&d&2048&&Mp(i.alternate,i);break;default:Qr(l,i,o,c,r)}t=t.sibling}}function Vi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:Vi(n,a),r&2048&&Ap(a.alternate,a);break;case 24:Vi(n,a),r&2048&&Mp(a.alternate,a);break;default:Vi(n,a)}t=t.sibling}}var Si=8192;function Ur(e){if(e.subtreeFlags&Si)for(e=e.child;e!==null;)bw(e),e=e.sibling}function bw(e){switch(e.tag){case 26:Ur(e),e.flags&Si&&e.memoizedState!==null&&hR(hs,e.memoizedState,e.memoizedProps);break;case 5:Ur(e);break;case 3:case 4:var t=hs;hs=Eu(e.stateNode.containerInfo),Ur(e),hs=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Si,Si=16777216,Ur(e),Si=t):Ur(e));break;default:Ur(e)}}function ww(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function gi(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Kt=a,Nw(a,e)}ww(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_w(e),e=e.sibling}function _w(e){switch(e.tag){case 0:case 11:case 15:gi(e),e.flags&2048&&Ga(9,e,e.return);break;case 3:gi(e);break;case 12:gi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yc(e)):gi(e);break;default:gi(e)}}function Yc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Kt=a,Nw(a,e)}ww(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ga(8,t,t.return),Yc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yc(t));break;default:Yc(t)}e=e.sibling}}function Nw(e,t){for(;Kt!==null;){var n=Kt;switch(n.tag){case 0:case 11:case 15:Ga(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Oo(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Kt=a;else e:for(n=e;Kt!==null;){a=Kt;var r=a.sibling,l=a.return;if(pw(a),a===n){Kt=null;break e}if(r!==null){r.return=l,Kt=r;break e}Kt=l}}}var EC={getCacheForType:function(e){var t=rn(It),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},TC=typeof WeakMap=="function"?WeakMap:Map,tt=0,ot=null,He=null,Ie=0,et=0,Ln=null,Ta=!1,Gl=!1,$p=!1,ca=0,bt=0,Va=0,hr=0,Op=0,ts=0,Ml=0,Yi=null,jn=null,Zh=!1,Dp=0,_u=1/0,Nu=null,La=null,tn=0,Ua=null,$l=null,vl=0,Jh=0,em=null,kw=null,Fi=0,tm=null;function Pn(){if(tt&2&&Ie!==0)return Ie&-Ie;if(Re.T!==null){var e=Rl;return e!==0?e:Lp()}return zj()}function Sw(){ts===0&&(ts=!(Ie&536870912)||Ye?Mj():536870912);var e=is.current;return e!==null&&(e.flags|=32),ts}function qn(e,t,n){(e===ot&&(et===2||et===9)||e.cancelPendingCommit!==null)&&(Ol(e,0),Aa(e,Ie,ts,!1)),Eo(e,n),(!(tt&2)||e!==ot)&&(e===ot&&(!(tt&2)&&(hr|=n),bt===4&&Aa(e,Ie,ts,!1)),Ps(e))}function Cw(e,t,n){if(tt&6)throw Error(W(327));var a=!n&&(t&124)===0&&(t&e.expiredLanes)===0||Ro(e,t),r=a?$C(e,t):Uf(e,t,!0),l=a;do{if(r===0){Gl&&!a&&Aa(e,t,0,!1);break}else{if(n=e.current.alternate,l&&!AC(n)){r=Uf(e,t,!1),l=!1;continue}if(r===2){if(l=t,e.errorRecoveryDisabledLanes&l)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var o=e;r=Yi;var c=o.current.memoizedState.isDehydrated;if(c&&(Ol(o,i).flags|=256),i=Uf(o,i,!1),i!==2){if($p&&!c){o.errorRecoveryDisabledLanes|=l,hr|=l,r=4;break e}l=jn,jn=r,l!==null&&(jn===null?jn=l:jn.push.apply(jn,l))}r=i}if(l=!1,r!==2)continue}}if(r===1){Ol(e,0),Aa(e,t,0,!0);break}e:{switch(a=e,l=r,l){case 0:case 1:throw Error(W(345));case 4:if((t&4194048)!==t)break;case 6:Aa(a,t,ts,!Ta);break e;case 2:jn=null;break;case 3:case 5:break;default:throw Error(W(329))}if((t&62914560)===t&&(r=Dp+300-Ds(),10<r)){if(Aa(a,t,ts,!Ta),ad(a,0,!0)!==0)break e;a.timeoutHandle=Yw(hv.bind(null,a,n,jn,Nu,Zh,t,ts,hr,Ml,Ta,l,2,-0,0),r);break e}hv(a,n,jn,Nu,Zh,t,ts,hr,Ml,Ta,l,0,-0,0)}}break}while(!0);Ps(e)}function hv(e,t,n,a,r,l,i,o,c,d,f,m,h,x){if(e.timeoutHandle=-1,m=t.subtreeFlags,(m&8192||(m&16785408)===16785408)&&(io={stylesheets:null,count:0,unsuspend:fR},bw(t),m=mR(),m!==null)){e.cancelPendingCommit=m(pv.bind(null,e,t,l,n,a,r,i,o,c,f,1,h,x)),Aa(e,l,i,!d);return}pv(e,t,l,n,a,r,i,o,c)}function AC(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],l=r.getSnapshot;r=r.value;try{if(!Vn(l(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Aa(e,t,n,a){t&=~Op,t&=~hr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var l=31-In(r),i=1<<l;a[l]=-1,r&=~i}n!==0&&Oj(e,n,t)}function md(){return tt&6?!0:(Bo(0),!1)}function zp(){if(He!==null){if(et===0)var e=He.return;else e=He,na=Ar=null,wp(e),gl=null,ao=0,e=He;for(;e!==null;)ow(e.alternate,e),e=e.return;He=null}}function Ol(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,XC(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),zp(),ot=e,He=n=aa(e.current,null),Ie=t,et=0,Ln=null,Ta=!1,Gl=Ro(e,t),$p=!1,Ml=ts=Op=hr=Va=bt=0,jn=Yi=null,Zh=!1,t&8&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-In(a),l=1<<r;t|=e[r],a&=~l}return ca=t,od(),n}function Rw(e,t){Oe=null,Re.H=gu,t===Do||t===ud?(t=Vg(),et=3):t===fb?(t=Vg(),et=4):et=t===nw?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ln=t,He===null&&(bt=1,ju(e,es(t,e.current)))}function Ew(){var e=Re.H;return Re.H=gu,e===null?gu:e}function Tw(){var e=Re.A;return Re.A=EC,e}function nm(){bt=4,Ta||(Ie&4194048)!==Ie&&is.current!==null||(Gl=!0),!(Va&134217727)&&!(hr&134217727)||ot===null||Aa(ot,Ie,ts,!1)}function Uf(e,t,n){var a=tt;tt|=2;var r=Ew(),l=Tw();(ot!==e||Ie!==t)&&(Nu=null,Ol(e,t)),t=!1;var i=bt;e:do try{if(et!==0&&He!==null){var o=He,c=Ln;switch(et){case 8:zp(),i=6;break e;case 3:case 2:case 9:case 6:is.current===null&&(t=!0);var d=et;if(et=0,Ln=null,cl(e,o,c,d),n&&Gl){i=0;break e}break;default:d=et,et=0,Ln=null,cl(e,o,c,d)}}MC(),i=bt;break}catch(f){Rw(e,f)}while(!0);return t&&e.shellSuspendCounter++,na=Ar=null,tt=a,Re.H=r,Re.A=l,He===null&&(ot=null,Ie=0,od()),i}function MC(){for(;He!==null;)Aw(He)}function $C(e,t){var n=tt;tt|=2;var a=Ew(),r=Tw();ot!==e||Ie!==t?(Nu=null,_u=Ds()+500,Ol(e,t)):Gl=Ro(e,t);e:do try{if(et!==0&&He!==null){t=He;var l=Ln;t:switch(et){case 1:et=0,Ln=null,cl(e,t,l,1);break;case 2:case 9:if(Gg(l)){et=0,Ln=null,mv(t);break}t=function(){et!==2&&et!==9||ot!==e||(et=7),Ps(e)},l.then(t,t);break e;case 3:et=7;break e;case 4:et=5;break e;case 7:Gg(l)?(et=0,Ln=null,mv(t)):(et=0,Ln=null,cl(e,t,l,7));break;case 5:var i=null;switch(He.tag){case 26:i=He.memoizedState;case 5:case 27:var o=He;if(!i||Qw(i)){et=0,Ln=null;var c=o.sibling;if(c!==null)He=c;else{var d=o.return;d!==null?(He=d,pd(d)):He=null}break t}}et=0,Ln=null,cl(e,t,l,5);break;case 6:et=0,Ln=null,cl(e,t,l,6);break;case 8:zp(),bt=6;break e;default:throw Error(W(462))}}OC();break}catch(f){Rw(e,f)}while(!0);return na=Ar=null,Re.H=a,Re.A=r,tt=n,He!==null?0:(ot=null,Ie=0,od(),bt)}function OC(){for(;He!==null&&!n2();)Aw(He)}function Aw(e){var t=iw(e.alternate,e,ca);e.memoizedProps=e.pendingProps,t===null?pd(e):He=t}function mv(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=iv(n,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=iv(n,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:wp(t);default:ow(n,t),t=He=ob(t,ca),t=iw(n,t,ca)}e.memoizedProps=e.pendingProps,t===null?pd(e):He=t}function cl(e,t,n,a){na=Ar=null,wp(t),gl=null,ao=0;var r=t.return;try{if(_C(e,r,t,n,Ie)){bt=1,ju(e,es(n,e.current)),He=null;return}}catch(l){if(r!==null)throw He=r,l;bt=1,ju(e,es(n,e.current)),He=null;return}t.flags&32768?(Ye||a===1?e=!0:Gl||Ie&536870912?e=!1:(Ta=e=!0,(a===2||a===9||a===3||a===6)&&(a=is.current,a!==null&&a.tag===13&&(a.flags|=16384))),Mw(t,e)):pd(t)}function pd(e){var t=e;do{if(t.flags&32768){Mw(t,Ta);return}e=t.return;var n=kC(t.alternate,t,ca);if(n!==null){He=n;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);bt===0&&(bt=5)}function Mw(e,t){do{var n=SC(e.alternate,e);if(n!==null){n.flags&=32767,He=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){He=e;return}He=e=n}while(e!==null);bt=6,He=null}function pv(e,t,n,a,r,l,i,o,c){e.cancelPendingCommit=null;do xd();while(tn!==0);if(tt&6)throw Error(W(327));if(t!==null){if(t===e.current)throw Error(W(177));if(l=t.lanes|t.childLanes,l|=cp,f2(e,n,l,i,o,c),e===ot&&(He=ot=null,Ie=0),$l=t,Ua=e,vl=n,Jh=l,em=r,kw=a,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,UC(iu,function(){return Lw(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,t.subtreeFlags&13878||a){a=Re.T,Re.T=null,r=Fe.p,Fe.p=2,i=tt,tt|=4;try{CC(e,t,n)}finally{tt=i,Fe.p=r,Re.T=a}}tn=1,$w(),Ow(),Dw()}}function $w(){if(tn===1){tn=0;var e=Ua,t=$l,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Re.T,Re.T=null;var a=Fe.p;Fe.p=2;var r=tt;tt|=4;try{vw(t,e);var l=lm,i=eb(e.containerInfo),o=l.focusedElem,c=l.selectionRange;if(i!==o&&o&&o.ownerDocument&&Jj(o.ownerDocument.documentElement,o)){if(c!==null&&op(o)){var d=c.start,f=c.end;if(f===void 0&&(f=d),"selectionStart"in o)o.selectionStart=d,o.selectionEnd=Math.min(f,o.value.length);else{var m=o.ownerDocument||document,h=m&&m.defaultView||window;if(h.getSelection){var x=h.getSelection(),j=o.textContent.length,v=Math.min(c.start,j),y=c.end===void 0?v:Math.min(c.end,j);!x.extend&&v>y&&(i=y,y=v,v=i);var g=zg(o,v),p=zg(o,y);if(g&&p&&(x.rangeCount!==1||x.anchorNode!==g.node||x.anchorOffset!==g.offset||x.focusNode!==p.node||x.focusOffset!==p.offset)){var b=m.createRange();b.setStart(g.node,g.offset),x.removeAllRanges(),v>y?(x.addRange(b),x.extend(p.node,p.offset)):(b.setEnd(p.node,p.offset),x.addRange(b))}}}}for(m=[],x=o;x=x.parentNode;)x.nodeType===1&&m.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<m.length;o++){var w=m[o];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}Mu=!!rm,lm=rm=null}finally{tt=r,Fe.p=a,Re.T=n}}e.current=t,tn=2}}function Ow(){if(tn===2){tn=0;var e=Ua,t=$l,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Re.T,Re.T=null;var a=Fe.p;Fe.p=2;var r=tt;tt|=4;try{mw(e,t.alternate,t)}finally{tt=r,Fe.p=a,Re.T=n}}tn=3}}function Dw(){if(tn===4||tn===3){tn=0,s2();var e=Ua,t=$l,n=vl,a=kw;t.subtreeFlags&10256||t.flags&10256?tn=5:(tn=0,$l=Ua=null,zw(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(La=null),tp(n),t=t.stateNode,Hn&&typeof Hn.onCommitFiberRoot=="function")try{Hn.onCommitFiberRoot(Co,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=Re.T,r=Fe.p,Fe.p=2,Re.T=null;try{for(var l=e.onRecoverableError,i=0;i<a.length;i++){var o=a[i];l(o.value,{componentStack:o.stack})}}finally{Re.T=t,Fe.p=r}}vl&3&&xd(),Ps(e),r=e.pendingLanes,n&4194090&&r&42?e===tm?Fi++:(Fi=0,tm=e):Fi=0,Bo(0)}}function zw(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Oo(t)))}function xd(e){return $w(),Ow(),Dw(),Lw()}function Lw(){if(tn!==5)return!1;var e=Ua,t=Jh;Jh=0;var n=tp(vl),a=Re.T,r=Fe.p;try{Fe.p=32>n?32:n,Re.T=null,n=em,em=null;var l=Ua,i=vl;if(tn=0,$l=Ua=null,vl=0,tt&6)throw Error(W(331));var o=tt;if(tt|=4,_w(l.current),jw(l,l.current,i,n),tt=o,Bo(0,!1),Hn&&typeof Hn.onPostCommitFiberRoot=="function")try{Hn.onPostCommitFiberRoot(Co,l)}catch{}return!0}finally{Fe.p=r,Re.T=a,zw(e,t)}}function xv(e,t,n){t=es(n,t),t=Kh(e.stateNode,t,2),e=za(e,t,2),e!==null&&(Eo(e,2),Ps(e))}function rt(e,t,n){if(e.tag===3)xv(e,e,n);else for(;t!==null;){if(t.tag===3){xv(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(La===null||!La.has(a))){e=es(n,e),n=ew(2),a=za(t,n,2),a!==null&&(tw(n,a,t,e),Eo(a,2),Ps(a));break}}t=t.return}}function Bf(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new TC;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||($p=!0,r.add(n),e=DC.bind(null,e,t,n),t.then(e,e))}function DC(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ot===e&&(Ie&n)===n&&(bt===4||bt===3&&(Ie&62914560)===Ie&&300>Ds()-Dp?!(tt&2)&&Ol(e,0):Op|=n,Ml===Ie&&(Ml=0)),Ps(e)}function Uw(e,t){t===0&&(t=$j()),e=ql(e,t),e!==null&&(Eo(e,t),Ps(e))}function zC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Uw(e,n)}function LC(e,t){var n=0;switch(e.tag){case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(W(314))}a!==null&&a.delete(t),Uw(e,n)}function UC(e,t){return Jm(e,t)}var ku=null,Wr=null,sm=!1,Su=!1,Hf=!1,mr=0;function Ps(e){e!==Wr&&e.next===null&&(Wr===null?ku=Wr=e:Wr=Wr.next=e),Su=!0,sm||(sm=!0,HC())}function Bo(e,t){if(!Hf&&Su){Hf=!0;do for(var n=!1,a=ku;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var l=0;else{var i=a.suspendedLanes,o=a.pingedLanes;l=(1<<31-In(42|e)+1)-1,l&=r&~(i&~o),l=l&201326741?l&201326741|1:l?l|2:0}l!==0&&(n=!0,gv(a,l))}else l=Ie,l=ad(a,a===ot?l:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),!(l&3)||Ro(a,l)||(n=!0,gv(a,l));a=a.next}while(n);Hf=!1}}function BC(){Bw()}function Bw(){Su=sm=!1;var e=0;mr!==0&&(KC()&&(e=mr),mr=0);for(var t=Ds(),n=null,a=ku;a!==null;){var r=a.next,l=Hw(a,t);l===0?(a.next=null,n===null?ku=r:n.next=r,r===null&&(Wr=n)):(n=a,(e!==0||l&3)&&(Su=!0)),a=r}Bo(e)}function Hw(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,l=e.pendingLanes&-62914561;0<l;){var i=31-In(l),o=1<<i,c=r[i];c===-1?(!(o&n)||o&a)&&(r[i]=d2(o,t)):c<=t&&(e.expiredLanes|=o),l&=~o}if(t=ot,n=Ie,n=ad(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(et===2||et===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&ff(a),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ro(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&ff(a),tp(n)){case 2:case 8:n=Tj;break;case 32:n=iu;break;case 268435456:n=Aj;break;default:n=iu}return a=Iw.bind(null,e),n=Jm(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&ff(a),e.callbackPriority=2,e.callbackNode=null,2}function Iw(e,t){if(tn!==0&&tn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xd()&&e.callbackNode!==n)return null;var a=Ie;return a=ad(e,e===ot?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Cw(e,a,t),Hw(e,Ds()),e.callbackNode!=null&&e.callbackNode===n?Iw.bind(null,e):null)}function gv(e,t){if(xd())return null;Cw(e,t,!0)}function HC(){QC(function(){tt&6?Jm(Ej,BC):Bw()})}function Lp(){return mr===0&&(mr=Mj()),mr}function vv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Uc(""+e)}function yv(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function IC(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var l=vv((r[wn]||null).action),i=a.submitter;i&&(t=(t=i[wn]||null)?vv(t.formAction):i.getAttribute("formAction"),t!==null&&(l=t,i=null));var o=new rd("action","action",null,a,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(mr!==0){var c=i?yv(r,i):new FormData(r);Yh(n,{pending:!0,data:c,method:r.method,action:l},null,c)}}else typeof l=="function"&&(o.preventDefault(),c=i?yv(r,i):new FormData(r),Yh(n,{pending:!0,data:c,method:r.method,action:l},l,c))},currentTarget:r}]})}}for(var If=0;If<Oh.length;If++){var Pf=Oh[If],PC=Pf.toLowerCase(),qC=Pf[0].toUpperCase()+Pf.slice(1);Ns(PC,"on"+qC)}Ns(nb,"onAnimationEnd");Ns(sb,"onAnimationIteration");Ns(ab,"onAnimationStart");Ns("dblclick","onDoubleClick");Ns("focusin","onFocus");Ns("focusout","onBlur");Ns(lC,"onTransitionRun");Ns(iC,"onTransitionStart");Ns(oC,"onTransitionCancel");Ns(rb,"onTransitionEnd");Sl("onMouseEnter",["mouseout","mouseover"]);Sl("onMouseLeave",["mouseout","mouseover"]);Sl("onPointerEnter",["pointerout","pointerover"]);Sl("onPointerLeave",["pointerout","pointerover"]);Rr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Rr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Rr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Rr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Rr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Rr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ro="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),GC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ro));function Pw(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var l=void 0;if(t)for(var i=a.length-1;0<=i;i--){var o=a[i],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==l&&r.isPropagationStopped())break e;l=o,r.currentTarget=d;try{l(r)}catch(f){yu(f)}r.currentTarget=null,l=c}else for(i=0;i<a.length;i++){if(o=a[i],c=o.instance,d=o.currentTarget,o=o.listener,c!==l&&r.isPropagationStopped())break e;l=o,r.currentTarget=d;try{l(r)}catch(f){yu(f)}r.currentTarget=null,l=c}}}}function Be(e,t){var n=t[Ch];n===void 0&&(n=t[Ch]=new Set);var a=e+"__bubble";n.has(a)||(qw(t,e,2,!1),n.add(a))}function qf(e,t,n){var a=0;t&&(a|=4),qw(n,e,a,t)}var pc="_reactListening"+Math.random().toString(36).slice(2);function Up(e){if(!e[pc]){e[pc]=!0,Lj.forEach(function(n){n!=="selectionchange"&&(GC.has(n)||qf(n,!1,e),qf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[pc]||(t[pc]=!0,qf("selectionchange",!1,t))}}function qw(e,t,n,a){switch(t0(t)){case 2:var r=gR;break;case 8:r=vR;break;default:r=Pp}n=r.bind(null,t,n,e),r=void 0,!Ah||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Gf(e,t,n,a,r){var l=a;if(!(t&1)&&!(t&2)&&a!==null)e:for(;;){if(a===null)return;var i=a.tag;if(i===3||i===4){var o=a.stateNode.containerInfo;if(o===r)break;if(i===4)for(i=a.return;i!==null;){var c=i.tag;if((c===3||c===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;o!==null;){if(i=el(o),i===null)return;if(c=i.tag,c===5||c===6||c===26||c===27){a=l=i;continue e}o=o.parentNode}}a=a.return}Vj(function(){var d=l,f=ap(n),m=[];e:{var h=lb.get(e);if(h!==void 0){var x=rd,j=e;switch(e){case"keypress":if(Hc(n)===0)break e;case"keydown":case"keyup":x=U2;break;case"focusin":j="focus",x=jf;break;case"focusout":j="blur",x=jf;break;case"beforeblur":case"afterblur":x=jf;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=Sg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=S2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=I2;break;case nb:case sb:case ab:x=E2;break;case rb:x=q2;break;case"scroll":case"scrollend":x=N2;break;case"wheel":x=V2;break;case"copy":case"cut":case"paste":x=A2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Rg;break;case"toggle":case"beforetoggle":x=F2}var v=(t&4)!==0,y=!v&&(e==="scroll"||e==="scrollend"),g=v?h!==null?h+"Capture":null:h;v=[];for(var p=d,b;p!==null;){var w=p;if(b=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||b===null||g===null||(w=Ji(p,g),w!=null&&v.push(lo(p,w,b))),y)break;p=p.return}0<v.length&&(h=new x(h,j,null,n,f),m.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",h&&n!==Th&&(j=n.relatedTarget||n.fromElement)&&(el(j)||j[Il]))break e;if((x||h)&&(h=f.window===f?f:(h=f.ownerDocument)?h.defaultView||h.parentWindow:window,x?(j=n.relatedTarget||n.toElement,x=d,j=j?el(j):null,j!==null&&(y=So(j),v=j.tag,j!==y||v!==5&&v!==27&&v!==6)&&(j=null)):(x=null,j=d),x!==j)){if(v=Sg,w="onMouseLeave",g="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(v=Rg,w="onPointerLeave",g="onPointerEnter",p="pointer"),y=x==null?h:ki(x),b=j==null?h:ki(j),h=new v(w,p+"leave",x,n,f),h.target=y,h.relatedTarget=b,w=null,el(f)===d&&(v=new v(g,p+"enter",j,n,f),v.target=b,v.relatedTarget=y,w=v),y=w,x&&j)t:{for(v=x,g=j,p=0,b=v;b;b=Br(b))p++;for(b=0,w=g;w;w=Br(w))b++;for(;0<p-b;)v=Br(v),p--;for(;0<b-p;)g=Br(g),b--;for(;p--;){if(v===g||g!==null&&v===g.alternate)break t;v=Br(v),g=Br(g)}v=null}else v=null;x!==null&&jv(m,h,x,v,!1),j!==null&&y!==null&&jv(m,y,j,v,!0)}}e:{if(h=d?ki(d):window,x=h.nodeName&&h.nodeName.toLowerCase(),x==="select"||x==="input"&&h.type==="file")var N=Mg;else if(Ag(h))if(Wj)N=sC;else{N=tC;var C=eC}else x=h.nodeName,!x||x.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?d&&sp(d.elementType)&&(N=Mg):N=nC;if(N&&(N=N(e,d))){Qj(m,N,n,f);break e}C&&C(e,h,d),e==="focusout"&&d&&h.type==="number"&&d.memoizedProps.value!=null&&Eh(h,"number",h.value)}switch(C=d?ki(d):window,e){case"focusin":(Ag(C)||C.contentEditable==="true")&&(sl=C,Mh=d,Li=null);break;case"focusout":Li=Mh=sl=null;break;case"mousedown":$h=!0;break;case"contextmenu":case"mouseup":case"dragend":$h=!1,Lg(m,n,f);break;case"selectionchange":if(rC)break;case"keydown":case"keyup":Lg(m,n,f)}var _;if(ip)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else nl?Kj(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(Fj&&n.locale!=="ko"&&(nl||S!=="onCompositionStart"?S==="onCompositionEnd"&&nl&&(_=Yj()):(Ea=f,rp="value"in Ea?Ea.value:Ea.textContent,nl=!0)),C=Cu(d,S),0<C.length&&(S=new Cg(S,e,null,n,f),m.push({event:S,listeners:C}),_?S.data=_:(_=Xj(n),_!==null&&(S.data=_)))),(_=X2?Q2(e,n):W2(e,n))&&(S=Cu(d,"onBeforeInput"),0<S.length&&(C=new Cg("onBeforeInput","beforeinput",null,n,f),m.push({event:C,listeners:S}),C.data=_)),IC(m,e,d,n,f)}Pw(m,t)})}function lo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Cu(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,l=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||l===null||(r=Ji(e,n),r!=null&&a.unshift(lo(e,r,l)),r=Ji(e,t),r!=null&&a.push(lo(e,r,l))),e.tag===3)return a;e=e.return}return[]}function Br(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jv(e,t,n,a,r){for(var l=t._reactName,i=[];n!==null&&n!==a;){var o=n,c=o.alternate,d=o.stateNode;if(o=o.tag,c!==null&&c===a)break;o!==5&&o!==26&&o!==27||d===null||(c=d,r?(d=Ji(n,l),d!=null&&i.unshift(lo(n,d,c))):r||(d=Ji(n,l),d!=null&&i.push(lo(n,d,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var VC=/\r\n?/g,YC=/\u0000|\uFFFD/g;function bv(e){return(typeof e=="string"?e:""+e).replace(VC,`
|
|
49
|
+
`).replace(YC,"")}function Gw(e,t){return t=bv(t),bv(e)===t}function gd(){}function st(e,t,n,a,r,l){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Cl(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Cl(e,""+a);break;case"className":oc(e,"class",a);break;case"tabIndex":oc(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":oc(e,n,a);break;case"style":Gj(e,a,l);break;case"data":if(t!=="object"){oc(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Uc(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof l=="function"&&(n==="formAction"?(t!=="input"&&st(e,t,"name",r.name,r,null),st(e,t,"formEncType",r.formEncType,r,null),st(e,t,"formMethod",r.formMethod,r,null),st(e,t,"formTarget",r.formTarget,r,null)):(st(e,t,"encType",r.encType,r,null),st(e,t,"method",r.method,r,null),st(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=Uc(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=gd);break;case"onScroll":a!=null&&Be("scroll",e);break;case"onScrollEnd":a!=null&&Be("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(W(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(W(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=Uc(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Be("beforetoggle",e),Be("toggle",e),Lc(e,"popover",a);break;case"xlinkActuate":Ys(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ys(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ys(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ys(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ys(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ys(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ys(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ys(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ys(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Lc(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=w2.get(n)||n,Lc(e,n,a))}}function am(e,t,n,a,r,l){switch(n){case"style":Gj(e,a,l);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(W(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(W(60));e.innerHTML=n}}break;case"children":typeof a=="string"?Cl(e,a):(typeof a=="number"||typeof a=="bigint")&&Cl(e,""+a);break;case"onScroll":a!=null&&Be("scroll",e);break;case"onScrollEnd":a!=null&&Be("scrollend",e);break;case"onClick":a!=null&&(e.onclick=gd);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Uj.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),l=e[wn]||null,l=l!=null?l[n]:null,typeof l=="function"&&e.removeEventListener(t,l,r),typeof a=="function")){typeof l!="function"&&l!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,r);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):Lc(e,n,a)}}}function nn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var a=!1,r=!1,l;for(l in n)if(n.hasOwnProperty(l)){var i=n[l];if(i!=null)switch(l){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(W(137,t));default:st(e,t,l,i,n,null)}}r&&st(e,t,"srcSet",n.srcSet,n,null),a&&st(e,t,"src",n.src,n,null);return;case"input":Be("invalid",e);var o=l=i=r=null,c=null,d=null;for(a in n)if(n.hasOwnProperty(a)){var f=n[a];if(f!=null)switch(a){case"name":r=f;break;case"type":i=f;break;case"checked":c=f;break;case"defaultChecked":d=f;break;case"value":l=f;break;case"defaultValue":o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(W(137,t));break;default:st(e,t,a,f,n,null)}}Ij(e,l,o,c,d,i,r,!1),ou(e);return;case"select":Be("invalid",e),a=i=l=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":l=o;break;case"defaultValue":i=o;break;case"multiple":a=o;default:st(e,t,r,o,n,null)}t=l,n=i,e.multiple=!!a,t!=null?fl(e,!!a,t,!1):n!=null&&fl(e,!!a,n,!0);return;case"textarea":Be("invalid",e),l=r=a=null;for(i in n)if(n.hasOwnProperty(i)&&(o=n[i],o!=null))switch(i){case"value":a=o;break;case"defaultValue":r=o;break;case"children":l=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(W(91));break;default:st(e,t,i,o,n,null)}qj(e,a,r,l),ou(e);return;case"option":for(c in n)if(n.hasOwnProperty(c)&&(a=n[c],a!=null))switch(c){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:st(e,t,c,a,n,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(a=0;a<ro.length;a++)Be(ro[a],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(d in n)if(n.hasOwnProperty(d)&&(a=n[d],a!=null))switch(d){case"children":case"dangerouslySetInnerHTML":throw Error(W(137,t));default:st(e,t,d,a,n,null)}return;default:if(sp(t)){for(f in n)n.hasOwnProperty(f)&&(a=n[f],a!==void 0&&am(e,t,f,a,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(a=n[o],a!=null&&st(e,t,o,a,n,null))}function FC(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,l=null,i=null,o=null,c=null,d=null,f=null;for(x in n){var m=n[x];if(n.hasOwnProperty(x)&&m!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=m;default:a.hasOwnProperty(x)||st(e,t,x,null,a,m)}}for(var h in a){var x=a[h];if(m=n[h],a.hasOwnProperty(h)&&(x!=null||m!=null))switch(h){case"type":l=x;break;case"name":r=x;break;case"checked":d=x;break;case"defaultChecked":f=x;break;case"value":i=x;break;case"defaultValue":o=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(W(137,t));break;default:x!==m&&st(e,t,h,x,a,m)}}Rh(e,i,o,c,d,f,l,r);return;case"select":x=i=o=h=null;for(l in n)if(c=n[l],n.hasOwnProperty(l)&&c!=null)switch(l){case"value":break;case"multiple":x=c;default:a.hasOwnProperty(l)||st(e,t,l,null,a,c)}for(r in a)if(l=a[r],c=n[r],a.hasOwnProperty(r)&&(l!=null||c!=null))switch(r){case"value":h=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:l!==c&&st(e,t,r,l,a,c)}t=o,n=i,a=x,h!=null?fl(e,!!n,h,!1):!!a!=!!n&&(t!=null?fl(e,!!n,t,!0):fl(e,!!n,n?[]:"",!1));return;case"textarea":x=h=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!a.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:st(e,t,o,null,a,r)}for(i in a)if(r=a[i],l=n[i],a.hasOwnProperty(i)&&(r!=null||l!=null))switch(i){case"value":h=r;break;case"defaultValue":x=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(W(91));break;default:r!==l&&st(e,t,i,r,a,l)}Pj(e,h,x);return;case"option":for(var j in n)if(h=n[j],n.hasOwnProperty(j)&&h!=null&&!a.hasOwnProperty(j))switch(j){case"selected":e.selected=!1;break;default:st(e,t,j,null,a,h)}for(c in a)if(h=a[c],x=n[c],a.hasOwnProperty(c)&&h!==x&&(h!=null||x!=null))switch(c){case"selected":e.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:st(e,t,c,h,a,x)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var v in n)h=n[v],n.hasOwnProperty(v)&&h!=null&&!a.hasOwnProperty(v)&&st(e,t,v,null,a,h);for(d in a)if(h=a[d],x=n[d],a.hasOwnProperty(d)&&h!==x&&(h!=null||x!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(W(137,t));break;default:st(e,t,d,h,a,x)}return;default:if(sp(t)){for(var y in n)h=n[y],n.hasOwnProperty(y)&&h!==void 0&&!a.hasOwnProperty(y)&&am(e,t,y,void 0,a,h);for(f in a)h=a[f],x=n[f],!a.hasOwnProperty(f)||h===x||h===void 0&&x===void 0||am(e,t,f,h,a,x);return}}for(var g in n)h=n[g],n.hasOwnProperty(g)&&h!=null&&!a.hasOwnProperty(g)&&st(e,t,g,null,a,h);for(m in a)h=a[m],x=n[m],!a.hasOwnProperty(m)||h===x||h==null&&x==null||st(e,t,m,h,a,x)}var rm=null,lm=null;function Ru(e){return e.nodeType===9?e:e.ownerDocument}function wv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Vw(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function im(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vf=null;function KC(){var e=window.event;return e&&e.type==="popstate"?e===Vf?!1:(Vf=e,!0):(Vf=null,!1)}var Yw=typeof setTimeout=="function"?setTimeout:void 0,XC=typeof clearTimeout=="function"?clearTimeout:void 0,_v=typeof Promise=="function"?Promise:void 0,QC=typeof queueMicrotask=="function"?queueMicrotask:typeof _v<"u"?function(e){return _v.resolve(null).then(e).catch(WC)}:Yw;function WC(e){setTimeout(function(){throw e})}function Qa(e){return e==="head"}function Nv(e,t){var n=t,a=0,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(0<a&&8>a){n=a;var i=e.ownerDocument;if(n&1&&Ki(i.documentElement),n&2&&Ki(i.body),n&4)for(n=i.head,Ki(n),i=n.firstChild;i;){var o=i.nextSibling,c=i.nodeName;i[To]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}if(r===0){e.removeChild(l),fo(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:a=n.charCodeAt(0)-48;else a=0;n=l}while(n);fo(t)}function om(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":om(n),np(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function ZC(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[To])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(l=e.getAttribute("rel"),l==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(l!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(l=e.getAttribute("src"),(l!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&l&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var l=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===l)return e}else return e;if(e=gs(e.nextSibling),e===null)break}return null}function JC(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=gs(e.nextSibling),e===null))return null;return e}function cm(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function eR(e,t){var n=e.ownerDocument;if(e.data!=="$?"||n.readyState==="complete")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function gs(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}var um=null;function kv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function Fw(e,t,n){switch(t=Ru(n),e){case"html":if(e=t.documentElement,!e)throw Error(W(452));return e;case"head":if(e=t.head,!e)throw Error(W(453));return e;case"body":if(e=t.body,!e)throw Error(W(454));return e;default:throw Error(W(451))}}function Ki(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);np(e)}var os=new Map,Sv=new Set;function Eu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var fa=Fe.d;Fe.d={f:tR,r:nR,D:sR,C:aR,L:rR,m:lR,X:oR,S:iR,M:cR};function tR(){var e=fa.f(),t=md();return e||t}function nR(e){var t=Pl(e);t!==null&&t.tag===5&&t.type==="form"?Hb(t):fa.r(e)}var Vl=typeof document>"u"?null:document;function Kw(e,t,n){var a=Vl;if(a&&typeof t=="string"&&t){var r=Jn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Sv.has(r)||(Sv.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),nn(t,"link",e),Xt(t),a.head.appendChild(t)))}}function sR(e){fa.D(e),Kw("dns-prefetch",e,null)}function aR(e,t){fa.C(e,t),Kw("preconnect",e,t)}function rR(e,t,n){fa.L(e,t,n);var a=Vl;if(a&&e&&t){var r='link[rel="preload"][as="'+Jn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Jn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Jn(n.imageSizes)+'"]')):r+='[href="'+Jn(e)+'"]';var l=r;switch(t){case"style":l=Dl(e);break;case"script":l=Yl(e)}os.has(l)||(e=dt({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),os.set(l,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(Ho(l))||t==="script"&&a.querySelector(Io(l))||(t=a.createElement("link"),nn(t,"link",e),Xt(t),a.head.appendChild(t)))}}function lR(e,t){fa.m(e,t);var n=Vl;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Jn(a)+'"][href="'+Jn(e)+'"]',l=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":l=Yl(e)}if(!os.has(l)&&(e=dt({rel:"modulepreload",href:e},t),os.set(l,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Io(l)))return}a=n.createElement("link"),nn(a,"link",e),Xt(a),n.head.appendChild(a)}}}function iR(e,t,n){fa.S(e,t,n);var a=Vl;if(a&&e){var r=dl(a).hoistableStyles,l=Dl(e);t=t||"default";var i=r.get(l);if(!i){var o={loading:0,preload:null};if(i=a.querySelector(Ho(l)))o.loading=5;else{e=dt({rel:"stylesheet",href:e,"data-precedence":t},n),(n=os.get(l))&&Bp(e,n);var c=i=a.createElement("link");Xt(c),nn(c,"link",e),c._p=new Promise(function(d,f){c.onload=d,c.onerror=f}),c.addEventListener("load",function(){o.loading|=1}),c.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Fc(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:o},r.set(l,i)}}}function oR(e,t){fa.X(e,t);var n=Vl;if(n&&e){var a=dl(n).hoistableScripts,r=Yl(e),l=a.get(r);l||(l=n.querySelector(Io(r)),l||(e=dt({src:e,async:!0},t),(t=os.get(r))&&Hp(e,t),l=n.createElement("script"),Xt(l),nn(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},a.set(r,l))}}function cR(e,t){fa.M(e,t);var n=Vl;if(n&&e){var a=dl(n).hoistableScripts,r=Yl(e),l=a.get(r);l||(l=n.querySelector(Io(r)),l||(e=dt({src:e,async:!0,type:"module"},t),(t=os.get(r))&&Hp(e,t),l=n.createElement("script"),Xt(l),nn(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},a.set(r,l))}}function Cv(e,t,n,a){var r=(r=Oa.current)?Eu(r):null;if(!r)throw Error(W(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Dl(n.href),n=dl(r).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Dl(n.href);var l=dl(r).hoistableStyles,i=l.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},l.set(e,i),(l=r.querySelector(Ho(e)))&&!l._p&&(i.instance=l,i.state.loading=5),os.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},os.set(e,n),l||uR(r,e,n,i.state))),t&&a===null)throw Error(W(528,""));return i}if(t&&a!==null)throw Error(W(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Yl(n),n=dl(r).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(W(444,e))}}function Dl(e){return'href="'+Jn(e)+'"'}function Ho(e){return'link[rel="stylesheet"]['+e+"]"}function Xw(e){return dt({},e,{"data-precedence":e.precedence,precedence:null})}function uR(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),nn(t,"link",n),Xt(t),e.head.appendChild(t))}function Yl(e){return'[src="'+Jn(e)+'"]'}function Io(e){return"script[async]"+e}function Rv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Jn(n.href)+'"]');if(a)return t.instance=a,Xt(a),a;var r=dt({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Xt(a),nn(a,"style",r),Fc(a,n.precedence,e),t.instance=a;case"stylesheet":r=Dl(n.href);var l=e.querySelector(Ho(r));if(l)return t.state.loading|=4,t.instance=l,Xt(l),l;a=Xw(n),(r=os.get(r))&&Bp(a,r),l=(e.ownerDocument||e).createElement("link"),Xt(l);var i=l;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),nn(l,"link",a),t.state.loading|=4,Fc(l,n.precedence,e),t.instance=l;case"script":return l=Yl(n.src),(r=e.querySelector(Io(l)))?(t.instance=r,Xt(r),r):(a=n,(r=os.get(l))&&(a=dt({},n),Hp(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),Xt(r),nn(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(W(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(a=t.instance,t.state.loading|=4,Fc(a,n.precedence,e));return t.instance}function Fc(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,l=r,i=0;i<a.length;i++){var o=a[i];if(o.dataset.precedence===t)l=o;else if(l!==r)break}l?l.parentNode.insertBefore(e,l.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Bp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Hp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Kc=null;function Ev(e,t,n){if(Kc===null){var a=new Map,r=Kc=new Map;r.set(n,a)}else r=Kc,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var l=n[r];if(!(l[To]||l[an]||e==="link"&&l.getAttribute("rel")==="stylesheet")&&l.namespaceURI!=="http://www.w3.org/2000/svg"){var i=l.getAttribute(t)||"";i=e+i;var o=a.get(i);o?o.push(l):a.set(i,[l])}}return a}function Tv(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function dR(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Qw(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var io=null;function fR(){}function hR(e,t,n){if(io===null)throw Error(W(475));var a=io;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=Dl(n.href),l=e.querySelector(Ho(r));if(l){e=l._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(a.count++,a=Tu.bind(a),e.then(a,a)),t.state.loading|=4,t.instance=l,Xt(l);return}l=e.ownerDocument||e,n=Xw(n),(r=os.get(r))&&Bp(n,r),l=l.createElement("link"),Xt(l);var i=l;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),nn(l,"link",n),t.instance=l}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(a.count++,t=Tu.bind(a),e.addEventListener("load",t),e.addEventListener("error",t))}}function mR(){if(io===null)throw Error(W(475));var e=io;return e.stylesheets&&e.count===0&&dm(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&dm(e,e.stylesheets),e.unsuspend){var a=e.unsuspend;e.unsuspend=null,a()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}function Tu(){if(this.count--,this.count===0){if(this.stylesheets)dm(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Au=null;function dm(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Au=new Map,t.forEach(pR,e),Au=null,Tu.call(e))}function pR(e,t){if(!(t.state.loading&4)){var n=Au.get(e);if(n)var a=n.get(null);else{n=new Map,Au.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),l=0;l<r.length;l++){var i=r[l];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),a=i)}a&&n.set(null,a)}r=t.instance,i=r.getAttribute("data-precedence"),l=n.get(i)||a,l===a&&n.set(null,r),n.set(i,r),this.count++,a=Tu.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),l?l.parentNode.insertBefore(r,l.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var oo={$$typeof:Js,Provider:null,Consumer:null,_currentValue:or,_currentValue2:or,_threadCount:0};function xR(e,t,n,a,r,l,i,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=hf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hf(0),this.hiddenUpdates=hf(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=l,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Ww(e,t,n,a,r,l,i,o,c,d,f,m){return e=new xR(e,t,n,i,o,c,d,m),t=1,l===!0&&(t|=24),l=Bn(3,null,null,t),e.current=l,l.stateNode=e,t=mp(),t.refCount++,e.pooledCache=t,t.refCount++,l.memoizedState={element:a,isDehydrated:n,cache:t},xp(l),e}function Zw(e){return e?(e=ll,e):ll}function Jw(e,t,n,a,r,l){r=Zw(r),a.context===null?a.context=r:a.pendingContext=r,a=Da(t),a.payload={element:n},l=l===void 0?null:l,l!==null&&(a.callback=l),n=za(e,a,t),n!==null&&(qn(n,e,t),Hi(n,e,t))}function Av(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ip(e,t){Av(e,t),(e=e.alternate)&&Av(e,t)}function e0(e){if(e.tag===13){var t=ql(e,67108864);t!==null&&qn(t,e,67108864),Ip(e,67108864)}}var Mu=!0;function gR(e,t,n,a){var r=Re.T;Re.T=null;var l=Fe.p;try{Fe.p=2,Pp(e,t,n,a)}finally{Fe.p=l,Re.T=r}}function vR(e,t,n,a){var r=Re.T;Re.T=null;var l=Fe.p;try{Fe.p=8,Pp(e,t,n,a)}finally{Fe.p=l,Re.T=r}}function Pp(e,t,n,a){if(Mu){var r=fm(a);if(r===null)Gf(e,t,a,$u,n),Mv(e,a);else if(jR(r,e,t,n,a))a.stopPropagation();else if(Mv(e,a),t&4&&-1<yR.indexOf(e)){for(;r!==null;){var l=Pl(r);if(l!==null)switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var i=ar(l.pendingLanes);if(i!==0){var o=l;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var c=1<<31-In(i);o.entanglements[1]|=c,i&=~c}Ps(l),!(tt&6)&&(_u=Ds()+500,Bo(0))}}break;case 13:o=ql(l,2),o!==null&&qn(o,l,2),md(),Ip(l,2)}if(l=fm(a),l===null&&Gf(e,t,a,$u,n),l===r)break;r=l}r!==null&&a.stopPropagation()}else Gf(e,t,a,null,n)}}function fm(e){return e=ap(e),qp(e)}var $u=null;function qp(e){if($u=null,e=el(e),e!==null){var t=So(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=kj(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return $u=e,null}function t0(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(a2()){case Ej:return 2;case Tj:return 8;case iu:case r2:return 32;case Aj:return 268435456;default:return 32}default:return 32}}var hm=!1,Ba=null,Ha=null,Ia=null,co=new Map,uo=new Map,Ca=[],yR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Mv(e,t){switch(e){case"focusin":case"focusout":Ba=null;break;case"dragenter":case"dragleave":Ha=null;break;case"mouseover":case"mouseout":Ia=null;break;case"pointerover":case"pointerout":co.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":uo.delete(t.pointerId)}}function vi(e,t,n,a,r,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:l,targetContainers:[r]},t!==null&&(t=Pl(t),t!==null&&e0(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function jR(e,t,n,a,r){switch(t){case"focusin":return Ba=vi(Ba,e,t,n,a,r),!0;case"dragenter":return Ha=vi(Ha,e,t,n,a,r),!0;case"mouseover":return Ia=vi(Ia,e,t,n,a,r),!0;case"pointerover":var l=r.pointerId;return co.set(l,vi(co.get(l)||null,e,t,n,a,r)),!0;case"gotpointercapture":return l=r.pointerId,uo.set(l,vi(uo.get(l)||null,e,t,n,a,r)),!0}return!1}function n0(e){var t=el(e.target);if(t!==null){var n=So(t);if(n!==null){if(t=n.tag,t===13){if(t=kj(n),t!==null){e.blockedOn=t,h2(e.priority,function(){if(n.tag===13){var a=Pn();a=ep(a);var r=ql(n,a);r!==null&&qn(r,n,a),Ip(n,a)}});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fm(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Th=a,n.target.dispatchEvent(a),Th=null}else return t=Pl(n),t!==null&&e0(t),e.blockedOn=n,!1;t.shift()}return!0}function $v(e,t,n){Xc(e)&&n.delete(t)}function bR(){hm=!1,Ba!==null&&Xc(Ba)&&(Ba=null),Ha!==null&&Xc(Ha)&&(Ha=null),Ia!==null&&Xc(Ia)&&(Ia=null),co.forEach($v),uo.forEach($v)}function xc(e,t){e.blockedOn===t&&(e.blockedOn=null,hm||(hm=!0,qt.unstable_scheduleCallback(qt.unstable_NormalPriority,bR)))}var gc=null;function Ov(e){gc!==e&&(gc=e,qt.unstable_scheduleCallback(qt.unstable_NormalPriority,function(){gc===e&&(gc=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(qp(a||n)===null)continue;break}var l=Pl(n);l!==null&&(e.splice(t,3),t-=3,Yh(l,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function fo(e){function t(c){return xc(c,e)}Ba!==null&&xc(Ba,e),Ha!==null&&xc(Ha,e),Ia!==null&&xc(Ia,e),co.forEach(t),uo.forEach(t);for(var n=0;n<Ca.length;n++){var a=Ca[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ca.length&&(n=Ca[0],n.blockedOn===null);)n0(n),n.blockedOn===null&&Ca.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],l=n[a+1],i=r[wn]||null;if(typeof l=="function")i||Ov(n);else if(i){var o=null;if(l&&l.hasAttribute("formAction")){if(r=l,i=l[wn]||null)o=i.formAction;else if(qp(r)!==null)continue}else o=i.action;typeof o=="function"?n[a+1]=o:(n.splice(a,3),a-=3),Ov(n)}}}function Gp(e){this._internalRoot=e}vd.prototype.render=Gp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));var n=t.current,a=Pn();Jw(n,a,e,t,null,null)};vd.prototype.unmount=Gp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jw(e.current,2,null,e,null,null),md(),t[Il]=null}};function vd(e){this._internalRoot=e}vd.prototype.unstable_scheduleHydration=function(e){if(e){var t=zj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ca.length&&t!==0&&t<Ca[n].priority;n++);Ca.splice(n,0,e),n===0&&n0(e)}};var Dv=_j.version;if(Dv!=="19.1.0")throw Error(W(527,Dv,"19.1.0"));Fe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=WS(t),e=e!==null?Sj(e):null,e=e===null?null:e.stateNode,e};var wR={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:Re,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vc.isDisabled&&vc.supportsFiber)try{Co=vc.inject(wR),Hn=vc}catch{}}nd.createRoot=function(e,t){if(!Nj(e))throw Error(W(299));var n=!1,a="",r=Wb,l=Zb,i=Jb,o=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(l=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(o=t.unstable_transitionCallbacks)),t=Ww(e,1,!1,null,null,n,a,r,l,i,o,null),e[Il]=t.current,Up(e),new Gp(t)};nd.hydrateRoot=function(e,t,n){if(!Nj(e))throw Error(W(299));var a=!1,r="",l=Wb,i=Zb,o=Jb,c=null,d=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(l=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(c=n.unstable_transitionCallbacks),n.formState!==void 0&&(d=n.formState)),t=Ww(e,1,!0,t,n??null,a,r,l,i,o,c,d),t.context=Zw(null),n=t.current,a=Pn(),a=ep(a),r=Da(a),r.callback=null,za(n,r,a),n=a,t.current.lanes=n,Eo(t,n),Ps(t),e[Il]=t.current,Up(e),new vd(t)};nd.version="19.1.0";function s0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s0)}catch(e){console.error(e)}}s0(),gj.exports=nd;var _R=gj.exports;const a0=u.createContext(null);function r0({data:e,router:t,identity:n,notify:a,children:r}){return s.jsx(a0.Provider,{value:{data:e,router:t,identity:n,notify:a},children:r})}function yd(){const e=u.useContext(a0);if(!e)throw new Error("A shared app page rendered outside AppUiProvider.");return e}const NR={success:()=>{},error:()=>{}},Nn=()=>yd().data,Ze=()=>yd().router,jd=()=>yd().identity,Mr=()=>yd().notify??NR;function kR(){const{probe:e}=Nn(),{href:t,Link:n}=Ze(),a=jd(),[r,l]=u.useState(null),[i,o]=u.useState(!1);return u.useEffect(()=>{let c=!0;if(!e){o(!0);return}return e.source().then(d=>c&&l(d.label),()=>c&&o(!0)),()=>{c=!1}},[e]),s.jsxs("section",{"data-testid":"app-ui-probe",className:"m-6 flex max-w-xl flex-col gap-2 rounded-lg border border-border bg-card p-6 text-card-foreground",children:[s.jsx("h1",{className:"text-xl font-semibold",children:"Shared app UI"}),s.jsx("p",{"data-testid":"app-ui-probe-source",className:"text-sm text-muted-foreground",children:i?"Data source unavailable":r??"Loading…"}),s.jsxs("p",{"data-testid":"app-ui-probe-identity",className:"text-sm",children:[a.label," · ",a.can("tasks.write")?"can edit tasks":"read only"]}),s.jsx(n,{href:t("/tasks"),className:"rounded-sm text-sm text-primary underline outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:"Tasks"})]})}/**
|
|
50
|
+
* @license lucide-react v0.511.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const SR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),CR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),zv=e=>{const t=CR(e);return t.charAt(0).toUpperCase()+t.slice(1)},l0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),RR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
55
|
+
* @license lucide-react v0.511.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/var ER={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
60
|
+
* @license lucide-react v0.511.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const TR=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:l,iconNode:i,...o},c)=>u.createElement("svg",{ref:c,...ER,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:l0("lucide",r),...!l&&!RR(o)&&{"aria-hidden":"true"},...o},[...i.map(([d,f])=>u.createElement(d,f)),...Array.isArray(l)?l:[l]]));/**
|
|
65
|
+
* @license lucide-react v0.511.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const ke=(e,t)=>{const n=u.forwardRef(({className:a,...r},l)=>u.createElement(TR,{ref:l,iconNode:t,className:l0(`lucide-${SR(zv(e))}`,`lucide-${e}`,a),...r}));return n.displayName=zv(e),n};/**
|
|
70
|
+
* @license lucide-react v0.511.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const AR=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],MR=ke("archive-restore",AR);/**
|
|
75
|
+
* @license lucide-react v0.511.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const $R=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Lv=ke("archive",$R);/**
|
|
80
|
+
* @license lucide-react v0.511.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const OR=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],DR=ke("arrow-down",OR);/**
|
|
85
|
+
* @license lucide-react v0.511.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const zR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],i0=ke("arrow-left",zR);/**
|
|
90
|
+
* @license lucide-react v0.511.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const LR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],UR=ke("arrow-up",LR);/**
|
|
95
|
+
* @license lucide-react v0.511.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const BR=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Vp=ke("bot",BR);/**
|
|
100
|
+
* @license lucide-react v0.511.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const HR=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],IR=ke("briefcase",HR);/**
|
|
105
|
+
* @license lucide-react v0.511.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const PR=[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]],qR=ke("building-2",PR);/**
|
|
110
|
+
* @license lucide-react v0.511.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const GR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],$r=ke("check",GR);/**
|
|
115
|
+
* @license lucide-react v0.511.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const VR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Yp=ke("chevron-down",VR);/**
|
|
120
|
+
* @license lucide-react v0.511.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const YR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bd=ke("chevron-right",YR);/**
|
|
125
|
+
* @license lucide-react v0.511.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const FR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],KR=ke("chevron-up",FR);/**
|
|
130
|
+
* @license lucide-react v0.511.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const XR=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],o0=ke("chevrons-up-down",XR);/**
|
|
135
|
+
* @license lucide-react v0.511.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const QR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],lt=ke("circle-alert",QR);/**
|
|
140
|
+
* @license lucide-react v0.511.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const WR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],wd=ke("circle-check",WR);/**
|
|
145
|
+
* @license lucide-react v0.511.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const ZR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],JR=ke("circle",ZR);/**
|
|
150
|
+
* @license lucide-react v0.511.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const eE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],tE=ke("clock",eE);/**
|
|
155
|
+
* @license lucide-react v0.511.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const nE=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],c0=ke("copy",nE);/**
|
|
160
|
+
* @license lucide-react v0.511.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const sE=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Fp=ke("ellipsis",sE);/**
|
|
165
|
+
* @license lucide-react v0.511.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const aE=[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]],rE=ke("eraser",aE);/**
|
|
170
|
+
* @license lucide-react v0.511.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const lE=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Po=ke("eye",lE);/**
|
|
175
|
+
* @license lucide-react v0.511.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const iE=[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],u0=ke("folder-git-2",iE);/**
|
|
180
|
+
* @license lucide-react v0.511.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const oE=[["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M14 13h3",key:"1dgedf"}],["path",{d:"M7 13h3",key:"1pygq7"}]],cE=ke("folder-git",oE);/**
|
|
185
|
+
* @license lucide-react v0.511.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const uE=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]],dE=ke("git-fork",uE);/**
|
|
190
|
+
* @license lucide-react v0.511.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const fE=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]],mm=ke("git-pull-request-arrow",fE);/**
|
|
195
|
+
* @license lucide-react v0.511.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const hE=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],mE=ke("hard-drive",hE);/**
|
|
200
|
+
* @license lucide-react v0.511.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const pE=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],xE=ke("history",pE);/**
|
|
205
|
+
* @license lucide-react v0.511.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const gE=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],vE=ke("house",gE);/**
|
|
210
|
+
* @license lucide-react v0.511.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const yE=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],jE=ke("inbox",yE);/**
|
|
215
|
+
* @license lucide-react v0.511.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const bE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],cs=ke("info",bE);/**
|
|
220
|
+
* @license lucide-react v0.511.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const wE=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],_E=ke("laptop",wE);/**
|
|
225
|
+
* @license lucide-react v0.511.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const NE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],kE=ke("life-buoy",NE);/**
|
|
230
|
+
* @license lucide-react v0.511.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const SE=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],d0=ke("list-checks",SE);/**
|
|
235
|
+
* @license lucide-react v0.511.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const CE=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],f0=ke("list-ordered",CE);/**
|
|
240
|
+
* @license lucide-react v0.511.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const RE=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],EE=ke("loader-circle",RE);/**
|
|
245
|
+
* @license lucide-react v0.511.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const TE=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],AE=ke("lock",TE);/**
|
|
250
|
+
* @license lucide-react v0.511.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const ME=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],Ou=ke("messages-square",ME);/**
|
|
255
|
+
* @license lucide-react v0.511.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const $E=[["path",{d:"M5 12h14",key:"1ays0h"}]],OE=ke("minus",$E);/**
|
|
260
|
+
* @license lucide-react v0.511.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const DE=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],zE=ke("network",DE);/**
|
|
265
|
+
* @license lucide-react v0.511.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const LE=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],UE=ke("panel-left",LE);/**
|
|
270
|
+
* @license lucide-react v0.511.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const BE=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],h0=ke("pause",BE);/**
|
|
275
|
+
* @license lucide-react v0.511.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const HE=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],_d=ke("pencil",HE);/**
|
|
280
|
+
* @license lucide-react v0.511.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const IE=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],PE=ke("play",IE);/**
|
|
285
|
+
* @license lucide-react v0.511.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/const qE=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jr=ke("plus",qE);/**
|
|
290
|
+
* @license lucide-react v0.511.0 - ISC
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the ISC license.
|
|
293
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/const GE=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Or=ke("refresh-cw",GE);/**
|
|
295
|
+
* @license lucide-react v0.511.0 - ISC
|
|
296
|
+
*
|
|
297
|
+
* This source code is licensed under the ISC license.
|
|
298
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
+
*/const VE=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],YE=ke("rotate-ccw",VE);/**
|
|
300
|
+
* @license lucide-react v0.511.0 - ISC
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the ISC license.
|
|
303
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/const FE=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Nd=ke("search-x",FE);/**
|
|
305
|
+
* @license lucide-react v0.511.0 - ISC
|
|
306
|
+
*
|
|
307
|
+
* This source code is licensed under the ISC license.
|
|
308
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
+
*/const KE=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],XE=ke("search",KE);/**
|
|
310
|
+
* @license lucide-react v0.511.0 - ISC
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the ISC license.
|
|
313
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/const QE=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],WE=ke("shield-alert",QE);/**
|
|
315
|
+
* @license lucide-react v0.511.0 - ISC
|
|
316
|
+
*
|
|
317
|
+
* This source code is licensed under the ISC license.
|
|
318
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
+
*/const ZE=[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]],JE=ke("snowflake",ZE);/**
|
|
320
|
+
* @license lucide-react v0.511.0 - ISC
|
|
321
|
+
*
|
|
322
|
+
* This source code is licensed under the ISC license.
|
|
323
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
+
*/const eT=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Du=ke("tag",eT);/**
|
|
325
|
+
* @license lucide-react v0.511.0 - ISC
|
|
326
|
+
*
|
|
327
|
+
* This source code is licensed under the ISC license.
|
|
328
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
+
*/const tT=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ln=ke("triangle-alert",tT);/**
|
|
330
|
+
* @license lucide-react v0.511.0 - ISC
|
|
331
|
+
*
|
|
332
|
+
* This source code is licensed under the ISC license.
|
|
333
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
+
*/const nT=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],sT=ke("user-check",nT);/**
|
|
335
|
+
* @license lucide-react v0.511.0 - ISC
|
|
336
|
+
*
|
|
337
|
+
* This source code is licensed under the ISC license.
|
|
338
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
+
*/const aT=[["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m14.305 16.53.923-.382",key:"1itpsq"}],["path",{d:"m15.228 13.852-.923-.383",key:"eplpkm"}],["path",{d:"m16.852 12.228-.383-.923",key:"13v3q0"}],["path",{d:"m16.852 17.772-.383.924",key:"1i8mnm"}],["path",{d:"m19.148 12.228.383-.923",key:"1q8j1v"}],["path",{d:"m19.53 18.696-.382-.924",key:"vk1qj3"}],["path",{d:"m20.772 13.852.924-.383",key:"n880s0"}],["path",{d:"m20.772 16.148.924.383",key:"1g6xey"}],["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],rT=ke("user-cog",aT);/**
|
|
340
|
+
* @license lucide-react v0.511.0 - ISC
|
|
341
|
+
*
|
|
342
|
+
* This source code is licensed under the ISC license.
|
|
343
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
+
*/const lT=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Kp=ke("user",lT);/**
|
|
345
|
+
* @license lucide-react v0.511.0 - ISC
|
|
346
|
+
*
|
|
347
|
+
* This source code is licensed under the ISC license.
|
|
348
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
+
*/const iT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],kd=ke("x",iT),oT="Local only · this machine · not connected to SoftwareDLC",cT="Checking sync state…",uT="Sync state unknown",dT="Projects are the repositories this viewer reads on this machine. Nothing is shared unless you connect to SoftwareDLC.",br="Details are in the terminal running sdlc viewer.",fT="How to fix it is in the terminal running sdlc viewer.",Sd="Loading…",zu="Not available";function hT(e){if(!e.source)return null;if(e.source.kind==="repository")return"Repository · in no folder";const t=e.source.repositories;return`Folder · ${t} ${t===1?"repository":"repositories"}`}function Ci(e){return(typeof e=="string"?new Date(e):e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const mT={repository_registry:"this repository's registry",folder_registry:"the folder registry",issue_store:"the issue store",task_store:"the task store",workspace_store:"the local graph store"};function m0(e,t){const n=t?` this list was read at ${Ci(t)}.`:"";if(e.reason==="store_locked"){const a=e.store?mT[e.store]:"a local store",r=e.since?` since ${Ci(e.since)}`:"";return`Another sdlc command has held ${a}${r};${n||" nothing was read yet."} ${br}`}return e.status===0?`The viewer did not answer. Is sdlc viewer still running?${t?` This list was read at ${Ci(t)}.`:""}`:`The read failed.${t?` This list was read at ${Ci(t)}.`:""} ${br}`}const pT=e=>e.status===409,xT={not_a_home:"The repository this one's folder pointer names is not a folder's home.",folder_conflict:"This repository holds both a folder pointer and a folder's membership.",pointer_invalid:"This repository's folder pointer cannot be read, or names this repository as its own home.",membership_invalid:"The folder's records cannot be read.",folder_invalid:"This repository's folder records cannot be read."};function gT(e){const t=e.repository??"This repository";if(e.reason==="folder_member_unlisted"&&e.folder&&e.home&&e.member_path)return{kind:"unlisted",repository:t,folder:e.folder,home:e.home,member_path:e.member_path};if(e.reason==="member_moved"){const r=e.folder?`the folder ${e.folder}`:"its folder";return{kind:"moved_member",cause:`This repository, ${t}, is not where ${r} records it.`}}if(e.reason==="folder_moved")return{kind:"other",cause:e.folder?`The folder ${e.folder} has moved.`:"The folder has moved.",fix:!0};const n=e.reason?xT[e.reason]:void 0,a=n!==void 0&&e.reason!=="membership_invalid"&&e.reason!=="folder_invalid";return{kind:"other",cause:n??"This repository's folder cannot be read.",fix:a}}const Uv=["tasks","issues","releases"],Xp=u.createContext(null);function Yn(){const e=u.useContext(Xp);if(!e)throw new Error("A shell page rendered outside the app shell.");return e}function vT(){var e;return(e=u.useContext(Xp))==null?void 0:e.engine}const yT=10,jT=()=>new Date;function bT({shell:e,now:t=jT,children:n}){var H;const[a,r]=u.useState(null),[l,i]=u.useState(null),[o,c]=u.useState(null),[d,f]=u.useState(null),[m,h]=u.useState(null),[x,j]=u.useState(!0),[v,y]=u.useState(!1),[g,p]=u.useState(void 0),[b,w]=u.useState(!1),[N,C]=u.useState(Uv),_=u.useRef(!1),S=u.useRef(!1),D=u.useRef(null),O=u.useRef(!0),B=u.useCallback(async(M=!1)=>{D.current&&clearTimeout(D.current),D.current=null,y(!0);const[A,R]=await Promise.all([e.organizations.list(),e.projects.list()]);if(!O.current)return;if(y(!1),j(!1),A.ok&&R.ok){if(_.current=!0,S.current=!1,h(null),f(t()),A.data.organizations.length===0){c("not_in_git"),r(null),i(null);return}c(null),r(A.data.organizations[0]),i(R.data.projects);return}const T=A.ok?R.ok?null:R.refusal:A.refusal;if(!T)return;if(pT(T)){S.current=!1,h(null),c(T),r(null),i(null);return}const k=_.current&&!S.current&&!M;S.current=!0;const $=T.retry_after??yT;h({refusal:T,shown:!k,retryInSeconds:k?$:null}),k&&(D.current=setTimeout(()=>void B(!0),$*1e3))},[e,t]);u.useEffect(()=>(O.current=!0,B(),e.about.about().then(M=>{O.current&&(M.ok?p(M.data):M.refusal.status===404?p(null):w(!0))}),Promise.all(Uv.map(async M=>{var A;return[M,await((A=e[M])==null?void 0:A.access())]})).then(M=>{O.current&&C(M.filter(([,A])=>!(A!=null&&A.ok&&!A.data.can_view)).map(([A])=>A))}),()=>{O.current=!1,D.current&&clearTimeout(D.current)}),[e,B]);const Y={loading:x,org:a,projects:l,none:o,readAt:d,failure:m,about:g,aboutFailed:b,engine:(g==null?void 0:g.engine)===null?null:(H=g==null?void 0:g.engine)==null?void 0:H.source,domains:N,reading:v,refresh:()=>void B()};return s.jsx(Xp.Provider,{value:Y,children:n})}const p0=e=>`The ${e} page is not part of this sdlc install`,Fl="The sdlc engine here is too old for this page";function wT(e){return e==="checkout"?"Update the main checkout, then restart sdlc viewer.":"Update sdlc to its latest version, then restart sdlc viewer."}function us(){return wT(vT())}function x0(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=x0(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function g0(){for(var e,t,n=0,a="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=x0(e))&&(a&&(a+=" "),a+=t);return a}const Bv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Hv=g0,qo=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return Hv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:l}=t,i=Object.keys(r).map(d=>{const f=n==null?void 0:n[d],m=l==null?void 0:l[d];if(f===null)return null;const h=Bv(f)||Bv(m);return r[d][h]}),o=n&&Object.entries(n).reduce((d,f)=>{let[m,h]=f;return h===void 0||(d[m]=h),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,f)=>{let{class:m,className:h,...x}=f;return Object.entries(x).every(j=>{let[v,y]=j;return Array.isArray(y)?y.includes({...l,...o}[v]):{...l,...o}[v]===y})?[...d,m,h]:d},[]);return Hv(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Qp="-",_T=e=>{const t=kT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{const o=i.split(Qp);return o[0]===""&&o.length!==1&&o.shift(),v0(o,t)||NT(i)},getConflictingClassGroupIds:(i,o)=>{const c=n[i]||[];return o&&a[i]?[...c,...a[i]]:c}}},v0=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),r=a?v0(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;const l=e.join(Qp);return(i=t.validators.find(({validator:o})=>o(l)))==null?void 0:i.classGroupId},Iv=/^\[(.+)\]$/,NT=e=>{if(Iv.test(e)){const t=Iv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},kT=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const r in n)pm(n[r],a,r,t);return a},pm=(e,t,n,a)=>{e.forEach(r=>{if(typeof r=="string"){const l=r===""?t:Pv(t,r);l.classGroupId=n;return}if(typeof r=="function"){if(ST(r)){pm(r(a),t,n,a);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([l,i])=>{pm(i,Pv(t,l),n,a)})})},Pv=(e,t)=>{let n=e;return t.split(Qp).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},ST=e=>e.isThemeGetter,CT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const r=(l,i)=>{n.set(l,i),t++,t>e&&(t=0,a=n,n=new Map)};return{get(l){let i=n.get(l);if(i!==void 0)return i;if((i=a.get(l))!==void 0)return r(l,i),i},set(l,i){n.has(l)?n.set(l,i):r(l,i)}}},xm="!",gm=":",RT=gm.length,ET=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=r=>{const l=[];let i=0,o=0,c=0,d;for(let j=0;j<r.length;j++){let v=r[j];if(i===0&&o===0){if(v===gm){l.push(r.slice(c,j)),c=j+RT;continue}if(v==="/"){d=j;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=l.length===0?r:r.substring(c),m=TT(f),h=m!==f,x=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:x}};if(t){const r=t+gm,l=a;a=i=>i.startsWith(r)?l(i.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const r=a;a=l=>n({className:l,parseClassName:r})}return a},TT=e=>e.endsWith(xm)?e.substring(0,e.length-1):e.startsWith(xm)?e.substring(1):e,AT=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const r=[];let l=[];return a.forEach(i=>{i[0]==="["||t[i]?(r.push(...l.sort(),i),l=[]):l.push(i)}),r.push(...l.sort()),r}},MT=e=>({cache:CT(e.cacheSize),parseClassName:ET(e),sortModifiers:AT(e),..._T(e)}),$T=/\s+/,OT=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:l}=t,i=[],o=e.trim().split($T);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{isExternal:m,modifiers:h,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:v}=n(f);if(m){c=f+(c.length>0?" "+c:c);continue}let y=!!v,g=a(y?j.substring(0,v):j);if(!g){if(!y){c=f+(c.length>0?" "+c:c);continue}if(g=a(j),!g){c=f+(c.length>0?" "+c:c);continue}y=!1}const p=l(h).join(":"),b=x?p+xm:p,w=b+g;if(i.includes(w))continue;i.push(w);const N=r(g,y);for(let C=0;C<N.length;++C){const _=N[C];i.push(b+_)}c=f+(c.length>0?" "+c:c)}return c};function DT(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=y0(t))&&(a&&(a+=" "),a+=n);return a}const y0=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=y0(e[a]))&&(n&&(n+=" "),n+=t);return n};function zT(e,...t){let n,a,r,l=i;function i(c){const d=t.reduce((f,m)=>m(f),e());return n=MT(d),a=n.cache.get,r=n.cache.set,l=o,o(c)}function o(c){const d=a(c);if(d)return d;const f=OT(c,n);return r(c,f),f}return function(){return l(DT.apply(null,arguments))}}const Ht=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},j0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,b0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,LT=/^\d+\/\d+$/,UT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,BT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,HT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hr=e=>LT.test(e),$e=e=>!!e&&!Number.isNaN(Number(e)),ga=e=>!!e&&Number.isInteger(Number(e)),Yf=e=>e.endsWith("%")&&$e(e.slice(0,-1)),Xs=e=>UT.test(e),qT=()=>!0,GT=e=>BT.test(e)&&!HT.test(e),w0=()=>!1,VT=e=>IT.test(e),YT=e=>PT.test(e),FT=e=>!be(e)&&!we(e),KT=e=>Kl(e,k0,w0),be=e=>j0.test(e),sr=e=>Kl(e,S0,GT),Ff=e=>Kl(e,JT,$e),qv=e=>Kl(e,_0,w0),XT=e=>Kl(e,N0,YT),yc=e=>Kl(e,C0,VT),we=e=>b0.test(e),yi=e=>Xl(e,S0),QT=e=>Xl(e,eA),Gv=e=>Xl(e,_0),WT=e=>Xl(e,k0),ZT=e=>Xl(e,N0),jc=e=>Xl(e,C0,!0),Kl=(e,t,n)=>{const a=j0.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Xl=(e,t,n=!1)=>{const a=b0.exec(e);return a?a[1]?t(a[1]):n:!1},_0=e=>e==="position"||e==="percentage",N0=e=>e==="image"||e==="url",k0=e=>e==="length"||e==="size"||e==="bg-size",S0=e=>e==="length",JT=e=>e==="number",eA=e=>e==="family-name",C0=e=>e==="shadow",tA=()=>{const e=Ht("color"),t=Ht("font"),n=Ht("text"),a=Ht("font-weight"),r=Ht("tracking"),l=Ht("leading"),i=Ht("breakpoint"),o=Ht("container"),c=Ht("spacing"),d=Ht("radius"),f=Ht("shadow"),m=Ht("inset-shadow"),h=Ht("text-shadow"),x=Ht("drop-shadow"),j=Ht("blur"),v=Ht("perspective"),y=Ht("aspect"),g=Ht("ease"),p=Ht("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...w(),we,be],C=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],S=()=>[we,be,c],D=()=>[Hr,"full","auto",...S()],O=()=>[ga,"none","subgrid",we,be],B=()=>["auto",{span:["full",ga,we,be]},ga,we,be],Y=()=>[ga,"auto",we,be],H=()=>["auto","min","max","fr",we,be],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...S()],T=()=>[Hr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],k=()=>[e,we,be],$=()=>[...w(),Gv,qv,{position:[we,be]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",WT,KT,{size:[we,be]}],I=()=>[Yf,yi,sr],F=()=>["","none","full",d,we,be],Q=()=>["",$e,yi,sr],oe=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[$e,Yf,Gv,qv],J=()=>["","none",j,we,be],re=()=>["none",$e,we,be],ee=()=>["none",$e,we,be],fe=()=>[$e,we,be],ce=()=>[Hr,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xs],breakpoint:[Xs],color:[qT],container:[Xs],"drop-shadow":[Xs],ease:["in","out","in-out"],font:[FT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xs],shadow:[Xs],spacing:["px",$e],text:[Xs],"text-shadow":[Xs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Hr,be,we,y]}],container:["container"],columns:[{columns:[$e,be,we,o]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[ga,"auto",we,be]}],basis:[{basis:[Hr,"full","auto",o,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[$e,Hr,"auto","initial","none",be]}],grow:[{grow:["",$e,we,be]}],shrink:[{shrink:["",$e,we,be]}],order:[{order:[ga,"first","last","none",we,be]}],"grid-cols":[{"grid-cols":O()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":O()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],w:[{w:[o,"screen",...T()]}],"min-w":[{"min-w":[o,"screen","none",...T()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",n,yi,sr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,we,Ff]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Yf,be]}],"font-family":[{font:[QT,be,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,we,be]}],"line-clamp":[{"line-clamp":[$e,"none",we,Ff]}],leading:[{leading:[l,...S()]}],"list-image":[{"list-image":["none",we,be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",we,be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[$e,"from-font","auto",we,sr]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[$e,"auto",we,be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",we,be]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",we,be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ga,we,be],radial:["",we,be],conic:[ga,we,be]},ZT,XT]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[$e,we,be]}],"outline-w":[{outline:["",$e,yi,sr]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",f,jc,yc]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",m,jc,yc]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[$e,sr]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",h,jc,yc]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[$e,we,be]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[$e]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[we,be]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[$e]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",we,be]}],filter:[{filter:["","none",we,be]}],blur:[{blur:J()}],brightness:[{brightness:[$e,we,be]}],contrast:[{contrast:[$e,we,be]}],"drop-shadow":[{"drop-shadow":["","none",x,jc,yc]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",$e,we,be]}],"hue-rotate":[{"hue-rotate":[$e,we,be]}],invert:[{invert:["",$e,we,be]}],saturate:[{saturate:[$e,we,be]}],sepia:[{sepia:["",$e,we,be]}],"backdrop-filter":[{"backdrop-filter":["","none",we,be]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[$e,we,be]}],"backdrop-contrast":[{"backdrop-contrast":[$e,we,be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",$e,we,be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[$e,we,be]}],"backdrop-invert":[{"backdrop-invert":["",$e,we,be]}],"backdrop-opacity":[{"backdrop-opacity":[$e,we,be]}],"backdrop-saturate":[{"backdrop-saturate":[$e,we,be]}],"backdrop-sepia":[{"backdrop-sepia":["",$e,we,be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",we,be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[$e,"initial",we,be]}],ease:[{ease:["linear","initial",g,we,be]}],delay:[{delay:[$e,we,be]}],animate:[{animate:["none",p,we,be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,we,be]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ee()}],"scale-x":[{"scale-x":ee()}],"scale-y":[{"scale-y":ee()}],"scale-z":[{"scale-z":ee()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[we,be,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ce()}],"translate-x":[{"translate-x":ce()}],"translate-y":[{"translate-y":ce()}],"translate-z":[{"translate-z":ce()}],"translate-none":["translate-none"],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",we,be]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",we,be]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[$e,yi,sr,Ff]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nA=zT(tA);function ie(...e){return nA(g0(e))}const sA=qo("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground *:data-[slot=alert-description]:text-muted-foreground",info:"border-info/40 bg-info/10 text-info",success:"border-success/40 bg-success/10 text-success",warning:"border-warning/40 bg-warning/10 text-warning",destructive:"border-destructive/40 bg-destructive/10 text-destructive"}},defaultVariants:{variant:"default"}});function me({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:ie(sA({variant:t}),e),...n})}function Ne({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:ie("col-start-2 min-h-4 font-medium tracking-tight",e),...t})}function xe({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:ie("col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function ve(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Vv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Cd(...e){return t=>{let n=!1;const a=e.map(r=>{const l=Vv(r,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let r=0;r<a.length;r++){const l=a[r];typeof l=="function"?l():Vv(e[r],null)}}}}function Qe(...e){return u.useCallback(Cd(...e),e)}function aA(e,t){const n=u.createContext(t),a=l=>{const{children:i,...o}=l,c=u.useMemo(()=>o,Object.values(o));return s.jsx(n.Provider,{value:c,children:i})};a.displayName=e+"Provider";function r(l){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[a,r]}function qs(e,t=[]){let n=[];function a(l,i){const o=u.createContext(i),c=n.length;n=[...n,i];const d=m=>{var g;const{scope:h,children:x,...j}=m,v=((g=h==null?void 0:h[e])==null?void 0:g[c])||o,y=u.useMemo(()=>j,Object.values(j));return s.jsx(v.Provider,{value:y,children:x})};d.displayName=l+"Provider";function f(m,h){var v;const x=((v=h==null?void 0:h[e])==null?void 0:v[c])||o,j=u.useContext(x);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${m}\` must be used within \`${l}\``)}return[d,f]}const r=()=>{const l=n.map(i=>u.createContext(i));return function(o){const c=(o==null?void 0:o[e])||l;return u.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return r.scopeName=e,[a,rA(r,...t)]}function rA(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(l){const i=a.reduce((o,{useScope:c,scopeName:d})=>{const m=c(l)[`__scope${d}`];return{...o,...m}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var on=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},lA=xj[" useId ".trim().toString()]||(()=>{}),iA=0;function vs(e){const[t,n]=u.useState(lA());return on(()=>{n(a=>a??String(iA++))},[e]),t?`radix-${t}`:""}var oA=xj[" useInsertionEffect ".trim().toString()]||on;function Ya({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[r,l,i]=cA({defaultProp:t,onChange:n}),o=e!==void 0,c=o?e:r;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const m=f.current;m!==o&&console.warn(`${a} is changing from ${m?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=o},[o,a])}const d=u.useCallback(f=>{var m;if(o){const h=uA(f)?f(e):f;h!==e&&((m=i.current)==null||m.call(i,h))}else l(f)},[o,e,l,i]);return[c,d]}function cA({defaultProp:e,onChange:t}){const[n,a]=u.useState(e),r=u.useRef(n),l=u.useRef(t);return oA(()=>{l.current=t},[t]),u.useEffect(()=>{var i;r.current!==n&&((i=l.current)==null||i.call(l,n),r.current=n)},[n,r]),[n,a,l]}function uA(e){return typeof e=="function"}function wr(e){const t=fA(e),n=u.forwardRef((a,r)=>{const{children:l,...i}=a,o=u.Children.toArray(l),c=o.find(mA);if(c){const d=c.props.children,f=o.map(m=>m===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:m);return s.jsx(t,{...i,ref:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return s.jsx(t,{...i,ref:r,children:l})});return n.displayName=`${e}.Slot`,n}var dA=wr("Slot");function fA(e){const t=u.forwardRef((n,a)=>{const{children:r,...l}=n;if(u.isValidElement(r)){const i=xA(r),o=pA(l,r.props);return r.type!==u.Fragment&&(o.ref=a?Cd(a,i):i),u.cloneElement(r,o)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var R0=Symbol("radix.slottable");function hA(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=R0,t}function mA(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===R0}function pA(e,t){const n={...t};for(const a in t){const r=e[a],l=t[a];/^on[A-Z]/.test(a)?r&&l?n[a]=(...o)=>{const c=l(...o);return r(...o),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...l}:a==="className"&&(n[a]=[r,l].filter(Boolean).join(" "))}return{...e,...n}}function xA(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=gA.reduce((e,t)=>{const n=wr(`Primitive.${t}`),a=u.forwardRef((r,l)=>{const{asChild:i,...o}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...o,ref:l})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function E0(e,t){e&&Hl.flushSync(()=>e.dispatchEvent(t))}function Bs(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function vA(e,t=globalThis==null?void 0:globalThis.document){const n=Bs(e);u.useEffect(()=>{const a=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var yA="DismissableLayer",vm="dismissableLayer.update",jA="dismissableLayer.pointerDownOutside",bA="dismissableLayer.focusOutside",Yv,T0=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Go=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:l,onInteractOutside:i,onDismiss:o,...c}=e,d=u.useContext(T0),[f,m]=u.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=u.useState({}),j=Qe(t,_=>m(_)),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(y),p=f?v.indexOf(f):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,w=p>=g,N=NA(_=>{const S=_.target,D=[...d.branches].some(O=>O.contains(S));!w||D||(r==null||r(_),i==null||i(_),_.defaultPrevented||o==null||o())},h),C=kA(_=>{const S=_.target;[...d.branches].some(O=>O.contains(S))||(l==null||l(_),i==null||i(_),_.defaultPrevented||o==null||o())},h);return vA(_=>{p===d.layers.size-1&&(a==null||a(_),!_.defaultPrevented&&o&&(_.preventDefault(),o()))},h),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Yv=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Fv(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Yv)}},[f,h,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Fv())},[f,d]),u.useEffect(()=>{const _=()=>x({});return document.addEventListener(vm,_),()=>document.removeEventListener(vm,_)},[]),s.jsx(Te.div,{...c,ref:j,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:ve(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ve(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ve(e.onPointerDownCapture,N.onPointerDownCapture)})});Go.displayName=yA;var wA="DismissableLayerBranch",_A=u.forwardRef((e,t)=>{const n=u.useContext(T0),a=u.useRef(null),r=Qe(t,a);return u.useEffect(()=>{const l=a.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),s.jsx(Te.div,{...e,ref:r})});_A.displayName=wA;function NA(e,t=globalThis==null?void 0:globalThis.document){const n=Bs(e),a=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const l=o=>{if(o.target&&!a.current){let c=function(){A0(jA,n,d,{discrete:!0})};const d={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);a.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",l),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function kA(e,t=globalThis==null?void 0:globalThis.document){const n=Bs(e),a=u.useRef(!1);return u.useEffect(()=>{const r=l=>{l.target&&!a.current&&A0(bA,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Fv(){const e=new CustomEvent(vm);document.dispatchEvent(e)}function A0(e,t,n,{discrete:a}){const r=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),a?E0(r,l):r.dispatchEvent(l)}var Kf="focusScope.autoFocusOnMount",Xf="focusScope.autoFocusOnUnmount",Kv={bubbles:!1,cancelable:!0},SA="FocusScope",Rd=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:l,...i}=e,[o,c]=u.useState(null),d=Bs(r),f=Bs(l),m=u.useRef(null),h=Qe(t,v=>c(v)),x=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(a){let v=function(b){if(x.paused||!o)return;const w=b.target;o.contains(w)?m.current=w:ba(m.current,{select:!0})},y=function(b){if(x.paused||!o)return;const w=b.relatedTarget;w!==null&&(o.contains(w)||ba(m.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const N of b)N.removedNodes.length>0&&ba(o)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const p=new MutationObserver(g);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),p.disconnect()}}},[a,o,x.paused]),u.useEffect(()=>{if(o){Qv.add(x);const v=document.activeElement;if(!o.contains(v)){const g=new CustomEvent(Kf,Kv);o.addEventListener(Kf,d),o.dispatchEvent(g),g.defaultPrevented||(CA(MA(M0(o)),{select:!0}),document.activeElement===v&&ba(o))}return()=>{o.removeEventListener(Kf,d),setTimeout(()=>{const g=new CustomEvent(Xf,Kv);o.addEventListener(Xf,f),o.dispatchEvent(g),g.defaultPrevented||ba(v??document.body,{select:!0}),o.removeEventListener(Xf,f),Qv.remove(x)},0)}}},[o,d,f,x]);const j=u.useCallback(v=>{if(!n&&!a||x.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(y&&g){const p=v.currentTarget,[b,w]=RA(p);b&&w?!v.shiftKey&&g===w?(v.preventDefault(),n&&ba(b,{select:!0})):v.shiftKey&&g===b&&(v.preventDefault(),n&&ba(w,{select:!0})):g===p&&v.preventDefault()}},[n,a,x.paused]);return s.jsx(Te.div,{tabIndex:-1,...i,ref:h,onKeyDown:j})});Rd.displayName=SA;function CA(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ba(a,{select:t}),document.activeElement!==n)return}function RA(e){const t=M0(e),n=Xv(t,e),a=Xv(t.reverse(),e);return[n,a]}function M0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Xv(e,t){for(const n of e)if(!EA(n,{upTo:t}))return n}function EA(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function TA(e){return e instanceof HTMLInputElement&&"select"in e}function ba(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&TA(e)&&t&&e.select()}}var Qv=AA();function AA(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Wv(e,t),e.unshift(t)},remove(t){var n;e=Wv(e,t),(n=e[0])==null||n.resume()}}}function Wv(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function MA(e){return e.filter(t=>t.tagName!=="A")}var $A="Portal",Vo=u.forwardRef((e,t)=>{var o;const{container:n,...a}=e,[r,l]=u.useState(!1);on(()=>l(!0),[]);const i=n||r&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?XS.createPortal(s.jsx(Te.div,{...a,ref:t}),i):null});Vo.displayName=$A;function OA(e,t){return u.useReducer((n,a)=>t[n][a]??n,e)}var ds=e=>{const{present:t,children:n}=e,a=DA(t),r=typeof n=="function"?n({present:a.isPresent}):u.Children.only(n),l=Qe(a.ref,zA(r));return typeof n=="function"||a.isPresent?u.cloneElement(r,{ref:l}):null};ds.displayName="Presence";function DA(e){const[t,n]=u.useState(),a=u.useRef(null),r=u.useRef(e),l=u.useRef("none"),i=e?"mounted":"unmounted",[o,c]=OA(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=bc(a.current);l.current=o==="mounted"?d:"none"},[o]),on(()=>{const d=a.current,f=r.current;if(f!==e){const h=l.current,x=bc(d);e?c("MOUNT"):x==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&h!==x?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),on(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,m=x=>{const v=bc(a.current).includes(x.animationName);if(x.target===t&&v&&(c("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=x=>{x.target===t&&(l.current=bc(a.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:u.useCallback(d=>{a.current=d?getComputedStyle(d):null,n(d)},[])}}function bc(e){return(e==null?void 0:e.animationName)||"none"}function zA(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qf=0;function Wp(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Zv()),document.body.insertAdjacentElement("beforeend",e[1]??Zv()),Qf++,()=>{Qf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Qf--}},[])}function Zv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Es=function(){return Es=Object.assign||function(t){for(var n,a=1,r=arguments.length;a<r;a++){n=arguments[a];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Es.apply(this,arguments)};function $0(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n}function LA(e,t,n){if(n||arguments.length===2)for(var a=0,r=t.length,l;a<r;a++)(l||!(a in t))&&(l||(l=Array.prototype.slice.call(t,0,a)),l[a]=t[a]);return e.concat(l||Array.prototype.slice.call(t))}var Qc="right-scroll-bar-position",Wc="width-before-scroll-bar",UA="with-scroll-bars-hidden",BA="--removed-body-scroll-bar-size";function Wf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function HA(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var r=n.value;r!==a&&(n.value=a,n.callback(a,r))}}}})[0];return n.callback=t,n.facade}var IA=typeof window<"u"?u.useLayoutEffect:u.useEffect,Jv=new WeakMap;function PA(e,t){var n=HA(null,function(a){return e.forEach(function(r){return Wf(r,a)})});return IA(function(){var a=Jv.get(n);if(a){var r=new Set(a),l=new Set(e),i=n.current;r.forEach(function(o){l.has(o)||Wf(o,null)}),l.forEach(function(o){r.has(o)||Wf(o,i)})}Jv.set(n,e)},[e]),n}function qA(e){return e}function GA(e,t){t===void 0&&(t=qA);var n=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var i=t(l,a);return n.push(i),function(){n=n.filter(function(o){return o!==i})}},assignSyncMedium:function(l){for(a=!0;n.length;){var i=n;n=[],i.forEach(l)}n={push:function(o){return l(o)},filter:function(){return n}}},assignMedium:function(l){a=!0;var i=[];if(n.length){var o=n;n=[],o.forEach(l),i=n}var c=function(){var f=i;i=[],f.forEach(l)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return r}function VA(e){e===void 0&&(e={});var t=GA(null);return t.options=Es({async:!0,ssr:!1},e),t}var O0=function(e){var t=e.sideCar,n=$0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=t.read();if(!a)throw new Error("Sidecar medium not found");return u.createElement(a,Es({},n))};O0.isSideCarExport=!0;function YA(e,t){return e.useMedium(t),O0}var D0=VA(),Zf=function(){},Ed=u.forwardRef(function(e,t){var n=u.useRef(null),a=u.useState({onScrollCapture:Zf,onWheelCapture:Zf,onTouchMoveCapture:Zf}),r=a[0],l=a[1],i=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,m=e.shards,h=e.sideCar,x=e.noRelative,j=e.noIsolation,v=e.inert,y=e.allowPinchZoom,g=e.as,p=g===void 0?"div":g,b=e.gapMode,w=$0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,C=PA([n,t]),_=Es(Es({},w),r);return u.createElement(u.Fragment,null,f&&u.createElement(N,{sideCar:D0,removeScrollBar:d,shards:m,noRelative:x,noIsolation:j,inert:v,setCallbacks:l,allowPinchZoom:!!y,lockRef:n,gapMode:b}),i?u.cloneElement(u.Children.only(o),Es(Es({},_),{ref:C})):u.createElement(p,Es({},_,{className:c,ref:C}),o))});Ed.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ed.classNames={fullWidth:Wc,zeroRight:Qc};var FA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function KA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=FA();return t&&e.setAttribute("nonce",t),e}function XA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function QA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=KA())&&(XA(t,n),QA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ZA=function(){var e=WA();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},z0=function(){var e=ZA(),t=function(n){var a=n.styles,r=n.dynamic;return e(a,r),null};return t},JA={left:0,top:0,right:0,gap:0},Jf=function(e){return parseInt(e||"",10)||0},eM=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[Jf(n),Jf(a),Jf(r)]},tM=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return JA;var t=eM(e),n=document.documentElement.clientWidth,a=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,a-n+t[2]-t[0])}},nM=z0(),yl="data-scroll-locked",sM=function(e,t,n,a){var r=e.left,l=e.top,i=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
350
|
+
.`.concat(UA,` {
|
|
351
|
+
overflow: hidden `).concat(a,`;
|
|
352
|
+
padding-right: `).concat(o,"px ").concat(a,`;
|
|
353
|
+
}
|
|
354
|
+
body[`).concat(yl,`] {
|
|
355
|
+
overflow: hidden `).concat(a,`;
|
|
356
|
+
overscroll-behavior: contain;
|
|
357
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
358
|
+
padding-left: `.concat(r,`px;
|
|
359
|
+
padding-top: `).concat(l,`px;
|
|
360
|
+
padding-right: `).concat(i,`px;
|
|
361
|
+
margin-left:0;
|
|
362
|
+
margin-top:0;
|
|
363
|
+
margin-right: `).concat(o,"px ").concat(a,`;
|
|
364
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.`).concat(Qc,` {
|
|
368
|
+
right: `).concat(o,"px ").concat(a,`;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.`).concat(Wc,` {
|
|
372
|
+
margin-right: `).concat(o,"px ").concat(a,`;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.`).concat(Qc," .").concat(Qc,` {
|
|
376
|
+
right: 0 `).concat(a,`;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.`).concat(Wc," .").concat(Wc,` {
|
|
380
|
+
margin-right: 0 `).concat(a,`;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
body[`).concat(yl,`] {
|
|
384
|
+
`).concat(BA,": ").concat(o,`px;
|
|
385
|
+
}
|
|
386
|
+
`)},ey=function(){var e=parseInt(document.body.getAttribute(yl)||"0",10);return isFinite(e)?e:0},aM=function(){u.useEffect(function(){return document.body.setAttribute(yl,(ey()+1).toString()),function(){var e=ey()-1;e<=0?document.body.removeAttribute(yl):document.body.setAttribute(yl,e.toString())}},[])},rM=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;aM();var l=u.useMemo(function(){return tM(r)},[r]);return u.createElement(nM,{styles:sM(l,!t,r,n?"":"!important")})},ym=!1;if(typeof window<"u")try{var wc=Object.defineProperty({},"passive",{get:function(){return ym=!0,!0}});window.addEventListener("test",wc,wc),window.removeEventListener("test",wc,wc)}catch{ym=!1}var Ir=ym?{passive:!1}:!1,lM=function(e){return e.tagName==="TEXTAREA"},L0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lM(e)&&n[t]==="visible")},iM=function(e){return L0(e,"overflowY")},oM=function(e){return L0(e,"overflowX")},ty=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=U0(e,a);if(r){var l=B0(e,a),i=l[1],o=l[2];if(i>o)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},cM=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},uM=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},U0=function(e,t){return e==="v"?iM(t):oM(t)},B0=function(e,t){return e==="v"?cM(t):uM(t)},dM=function(e,t){return e==="h"&&t==="rtl"?-1:1},fM=function(e,t,n,a,r){var l=dM(e,window.getComputedStyle(t).direction),i=l*a,o=n.target,c=t.contains(o),d=!1,f=i>0,m=0,h=0;do{if(!o)break;var x=B0(e,o),j=x[0],v=x[1],y=x[2],g=v-y-l*j;(j||g)&&U0(e,o)&&(m+=g,h+=j);var p=o.parentNode;o=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(f&&Math.abs(m)<1||!f&&Math.abs(h)<1)&&(d=!0),d},_c=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ny=function(e){return[e.deltaX,e.deltaY]},sy=function(e){return e&&"current"in e?e.current:e},hM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},mM=function(e){return`
|
|
387
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
388
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
389
|
+
`)},pM=0,Pr=[];function xM(e){var t=u.useRef([]),n=u.useRef([0,0]),a=u.useRef(),r=u.useState(pM++)[0],l=u.useState(z0)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=LA([e.lockRef.current],(e.shards||[]).map(sy),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=u.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var g=_c(v),p=n.current,b="deltaX"in v?v.deltaX:p[0]-g[0],w="deltaY"in v?v.deltaY:p[1]-g[1],N,C=v.target,_=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in v&&_==="h"&&C.type==="range")return!1;var S=ty(_,C);if(!S)return!0;if(S?N=_:(N=_==="v"?"h":"v",S=ty(_,C)),!S)return!1;if(!a.current&&"changedTouches"in v&&(b||w)&&(a.current=N),!N)return!0;var D=a.current||N;return fM(D,y,v,D==="h"?b:w)},[]),c=u.useCallback(function(v){var y=v;if(!(!Pr.length||Pr[Pr.length-1]!==l)){var g="deltaY"in y?ny(y):_c(y),p=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&hM(N.delta,g)})[0];if(p&&p.should){y.cancelable&&y.preventDefault();return}if(!p){var b=(i.current.shards||[]).map(sy).filter(Boolean).filter(function(N){return N.contains(y.target)}),w=b.length>0?o(y,b[0]):!i.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),d=u.useCallback(function(v,y,g,p){var b={name:v,delta:y,target:g,should:p,shadowParent:gM(g)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(w){return w!==b})},1)},[]),f=u.useCallback(function(v){n.current=_c(v),a.current=void 0},[]),m=u.useCallback(function(v){d(v.type,ny(v),v.target,o(v,e.lockRef.current))},[]),h=u.useCallback(function(v){d(v.type,_c(v),v.target,o(v,e.lockRef.current))},[]);u.useEffect(function(){return Pr.push(l),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ir),document.addEventListener("touchmove",c,Ir),document.addEventListener("touchstart",f,Ir),function(){Pr=Pr.filter(function(v){return v!==l}),document.removeEventListener("wheel",c,Ir),document.removeEventListener("touchmove",c,Ir),document.removeEventListener("touchstart",f,Ir)}},[]);var x=e.removeScrollBar,j=e.inert;return u.createElement(u.Fragment,null,j?u.createElement(l,{styles:mM(r)}):null,x?u.createElement(rM,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function gM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vM=YA(D0,xM);var Td=u.forwardRef(function(e,t){return u.createElement(Ed,Es({},e,{ref:t,sideCar:vM}))});Td.classNames=Ed.classNames;var yM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qr=new WeakMap,Nc=new WeakMap,kc={},eh=0,H0=function(e){return e&&(e.host||H0(e.parentNode))},jM=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=H0(n);return a&&e.contains(a)?a:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},bM=function(e,t,n,a){var r=jM(t,Array.isArray(e)?e:[e]);kc[n]||(kc[n]=new WeakMap);var l=kc[n],i=[],o=new Set,c=new Set(r),d=function(m){!m||o.has(m)||(o.add(m),d(m.parentNode))};r.forEach(d);var f=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(h){if(o.has(h))f(h);else try{var x=h.getAttribute(a),j=x!==null&&x!=="false",v=(qr.get(h)||0)+1,y=(l.get(h)||0)+1;qr.set(h,v),l.set(h,y),i.push(h),v===1&&j&&Nc.set(h,!0),y===1&&h.setAttribute(n,"true"),j||h.setAttribute(a,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return f(t),o.clear(),eh++,function(){i.forEach(function(m){var h=qr.get(m)-1,x=l.get(m)-1;qr.set(m,h),l.set(m,x),h||(Nc.has(m)||m.removeAttribute(a),Nc.delete(m)),x||m.removeAttribute(n)}),eh--,eh||(qr=new WeakMap,qr=new WeakMap,Nc=new WeakMap,kc={})}},Zp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=yM(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),bM(a,r,n,"aria-hidden")):function(){return null}},Ad="Dialog",[I0]=qs(Ad),[wM,ks]=I0(Ad),P0=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:r,onOpenChange:l,modal:i=!0}=e,o=u.useRef(null),c=u.useRef(null),[d,f]=Ya({prop:a,defaultProp:r??!1,onChange:l,caller:Ad});return s.jsx(wM,{scope:t,triggerRef:o,contentRef:c,contentId:vs(),titleId:vs(),descriptionId:vs(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(m=>!m),[f]),modal:i,children:n})};P0.displayName=Ad;var q0="DialogTrigger",_M=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ks(q0,n),l=Qe(t,r.triggerRef);return s.jsx(Te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":tx(r.open),...a,ref:l,onClick:ve(e.onClick,r.onOpenToggle)})});_M.displayName=q0;var Jp="DialogPortal",[NM,G0]=I0(Jp,{forceMount:void 0}),V0=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:r}=e,l=ks(Jp,t);return s.jsx(NM,{scope:t,forceMount:n,children:u.Children.map(a,i=>s.jsx(ds,{present:n||l.open,children:s.jsx(Vo,{asChild:!0,container:r,children:i})}))})};V0.displayName=Jp;var Lu="DialogOverlay",Y0=u.forwardRef((e,t)=>{const n=G0(Lu,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,l=ks(Lu,e.__scopeDialog);return l.modal?s.jsx(ds,{present:a||l.open,children:s.jsx(SM,{...r,ref:t})}):null});Y0.displayName=Lu;var kM=wr("DialogOverlay.RemoveScroll"),SM=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ks(Lu,n);return s.jsx(Td,{as:kM,allowPinchZoom:!0,shards:[r.contentRef],children:s.jsx(Te.div,{"data-state":tx(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),_r="DialogContent",F0=u.forwardRef((e,t)=>{const n=G0(_r,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,l=ks(_r,e.__scopeDialog);return s.jsx(ds,{present:a||l.open,children:l.modal?s.jsx(CM,{...r,ref:t}):s.jsx(RM,{...r,ref:t})})});F0.displayName=_r;var CM=u.forwardRef((e,t)=>{const n=ks(_r,e.__scopeDialog),a=u.useRef(null),r=Qe(t,n.contentRef,a);return u.useEffect(()=>{const l=a.current;if(l)return Zp(l)},[]),s.jsx(K0,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ve(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ve(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&l.preventDefault()}),onFocusOutside:ve(e.onFocusOutside,l=>l.preventDefault())})}),RM=u.forwardRef((e,t)=>{const n=ks(_r,e.__scopeDialog),a=u.useRef(!1),r=u.useRef(!1);return s.jsx(K0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,o;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(a.current||(o=n.triggerRef.current)==null||o.focus(),l.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:l=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&r.current&&l.preventDefault()}})}),K0=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:l,...i}=e,o=ks(_r,n),c=u.useRef(null),d=Qe(t,c);return Wp(),s.jsxs(s.Fragment,{children:[s.jsx(Rd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:l,children:s.jsx(Go,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":tx(o.open),...i,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(EM,{titleId:o.titleId}),s.jsx(AM,{contentRef:c,descriptionId:o.descriptionId})]})]})}),ex="DialogTitle",X0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ks(ex,n);return s.jsx(Te.h2,{id:r.titleId,...a,ref:t})});X0.displayName=ex;var Q0="DialogDescription",W0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ks(Q0,n);return s.jsx(Te.p,{id:r.descriptionId,...a,ref:t})});W0.displayName=Q0;var Z0="DialogClose",J0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=ks(Z0,n);return s.jsx(Te.button,{type:"button",...a,ref:t,onClick:ve(e.onClick,()=>r.onOpenChange(!1))})});J0.displayName=Z0;function tx(e){return e?"open":"closed"}var e_="DialogTitleWarning",[V8,t_]=aA(e_,{contentName:_r,titleName:ex,docsSlug:"dialog"}),EM=({titleId:e})=>{const t=t_(e_),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
390
|
+
|
|
391
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
392
|
+
|
|
393
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},TM="DialogDescriptionWarning",AM=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${t_(TM).contentName}}.`;return u.useEffect(()=>{var l;const r=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},n_=P0,s_=V0,a_=Y0,r_=F0,l_=X0,i_=W0,nx=J0;function dn({className:e,...t}){return s.jsx(EE,{role:"status","aria-label":"Loading",className:ie("size-4 animate-spin",e),...t})}const jl="aria-pressed:border aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:text-accent-foreground",MM="border border-primary bg-accent text-accent-foreground hover:bg-accent",Md=qo("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",warning:"bg-warning text-warning-foreground hover:bg-warning/90",success:"bg-success text-success-foreground hover:bg-success/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",text:"underline-offset-2 hover:underline"},size:{"inline-sm":"p-1 text-sm",inline:"p-1 text-base",default:"h-9 px-4 py-2 text-sm",sm:"h-8 px-3 text-sm",control:"h-7 px-2 text-xs",lg:"h-10 px-6 text-base",icon:"size-9 text-sm","sm-icon":"size-8 text-sm","control-icon":"size-7 text-xs","xs-icon":"size-6 text-xs"}},defaultVariants:{variant:"default",size:"default"}}),q=u.forwardRef(({className:e,disabled:t,variant:n,size:a,asChild:r=!1,loading:l,children:i,...o},c)=>{const d=r?dA:"button",f=a==="icon"||a==="sm-icon"||a==="control-icon"||a==="xs-icon",m=s.jsx(dn,{"aria-hidden":"true","aria-label":void 0,role:void 0,className:ie(!f&&"mr-2")}),h=r?i:l&&f?m:s.jsxs(s.Fragment,{children:[l?m:null,i]});return s.jsx(d,{className:ie(Md({variant:n,size:a,className:e})),ref:c,disabled:t||l,...o,children:h})});q.displayName="Button";const o_=u.createContext(null);function $M({container:e,children:t}){return s.jsx(o_.Provider,{value:e,children:t})}function Yo(){return u.useContext(o_)??void 0}function sx(e){return s.jsx(n_,{"data-slot":"alert-dialog",...e})}function OM({className:e,...t}){return s.jsx(a_,{"data-slot":"alert-dialog-overlay",className:ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function ax({className:e,onOpenAutoFocus:t,onPointerDownOutside:n,onInteractOutside:a,...r}){return s.jsxs(s_,{container:Yo(),children:[s.jsx(OM,{}),s.jsx(r_,{"data-slot":"alert-dialog-content",role:"alertdialog",className:ie("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),onOpenAutoFocus:l=>{if(t==null||t(l),l.defaultPrevented)return;const i=l.currentTarget,o=i instanceof HTMLElement?i.querySelector('[data-slot="alert-dialog-cancel"]'):null;o&&(l.preventDefault(),o.focus())},onPointerDownOutside:l=>{n==null||n(l),l.preventDefault()},onInteractOutside:l=>{a==null||a(l),l.preventDefault()},...r})]})}function rx({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:ie("flex flex-col gap-2 text-center sm:text-left",e),...t})}function lx({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ix({className:e,...t}){return s.jsx(l_,{"data-slot":"alert-dialog-title",className:ie("text-lg font-semibold",e),...t})}function ox({className:e,...t}){return s.jsx(i_,{"data-slot":"alert-dialog-description",className:ie("text-muted-foreground text-sm",e),...t})}function c_({className:e,variant:t,...n}){return s.jsx(nx,{"data-slot":"alert-dialog-action",className:ie(Md({variant:t}),e),...n})}function cx({className:e,...t}){return s.jsx(nx,{"data-slot":"alert-dialog-cancel",className:ie(Md({variant:"outline"}),e),...t})}function DM(){if(typeof document>"u")return null;const e=document.activeElement;if(!(e instanceof HTMLElement)||e===document.body)return null;const t=e.closest('[role="menu"]');if(t!=null&&t.id){const n=document.querySelector(`[aria-controls="${CSS.escape(t.id)}"]`);if(n)return n}return e}function zM(e,t){t!=null&&t.isConnected&&(e.preventDefault(),t.focus())}function Ql(){const[e,t]=u.useState(null),n=u.useRef(null),a=u.useRef(null),r=u.useCallback(o=>{var c;(c=n.current)==null||c.resolve(o),n.current=null,t(null)},[]),l=u.useCallback(o=>new Promise(c=>{var f;(f=n.current)==null||f.resolve(!1),a.current=DM();const d={...o,resolve:c};n.current=d,t(d)}),[]);u.useEffect(()=>()=>{var o;return(o=n.current)==null?void 0:o.resolve(!1)},[]);const i=s.jsx(sx,{open:e!==null,onOpenChange:o=>{o||r(!1)},children:s.jsxs(ax,{onCloseAutoFocus:o=>zM(o,a.current),children:[s.jsxs(rx,{children:[s.jsx(ix,{children:e==null?void 0:e.title}),s.jsx(ox,{className:"whitespace-pre-line",children:e==null?void 0:e.description})]}),s.jsxs(lx,{children:[s.jsx(cx,{children:"Cancel"}),s.jsx(c_,{variant:e!=null&&e.destructive?"destructive":"default",onClick:()=>r(!0),children:e==null?void 0:e.action_label})]})]})});return{confirm:l,confirm_dialog:i}}const Qs="px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",LM=qo("inline-flex items-center rounded-md border transition-colors",{variants:{variant:{default:`${Qs} border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80`,secondary:`${Qs} border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`${Qs} border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80`,outline:`${Qs} text-foreground`,success:`${Qs} border-success/40 bg-success/10 text-success`,warning:`${Qs} border-warning/40 bg-warning/10 text-warning`,info:`${Qs} border-info/40 bg-info/10 text-info`,error:`${Qs} border-destructive/40 bg-destructive/10 text-destructive`,neutral:`${Qs} border-border bg-muted text-muted-foreground`,count:"h-5 min-w-5 justify-center border-transparent bg-primary px-1 text-2xs font-medium tabular-nums text-primary-foreground"},size:{default:"",dense:"px-1.5 py-0.5 text-2xs font-medium"}},defaultVariants:{variant:"default",size:"default"}});function pe({className:e,variant:t,size:n,...a}){return s.jsx("div",{className:ie(LM({variant:t,size:n}),e),...a})}function u_(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function d_(e){const[t,n]=u.useState(void 0);return on(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const l=r[0];let i,o;if("borderBoxSize"in l){const c=l.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,o=d.blockSize}else i=e.offsetWidth,o=e.offsetHeight;n({width:i,height:o})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var $d="Checkbox",[UM]=qs($d),[BM,ux]=UM($d);function HM(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:r,disabled:l,form:i,name:o,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:m}=e,[h,x]=Ya({prop:n,defaultProp:r??!1,onChange:c,caller:$d}),[j,v]=u.useState(null),[y,g]=u.useState(null),p=u.useRef(!1),b=j?!!i||!!j.closest("form"):!0,w={checked:h,disabled:l,setChecked:x,control:j,setControl:v,name:o,form:i,value:f,hasConsumerStoppedPropagationRef:p,required:d,defaultChecked:Pa(r)?!1:r,isFormControl:b,bubbleInput:y,setBubbleInput:g};return s.jsx(BM,{scope:t,...w,children:IM(m)?m(w):a})}var f_="CheckboxTrigger",h_=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},r)=>{const{control:l,value:i,disabled:o,checked:c,required:d,setControl:f,setChecked:m,hasConsumerStoppedPropagationRef:h,isFormControl:x,bubbleInput:j}=ux(f_,e),v=Qe(r,f),y=u.useRef(c);return u.useEffect(()=>{const g=l==null?void 0:l.form;if(g){const p=()=>m(y.current);return g.addEventListener("reset",p),()=>g.removeEventListener("reset",p)}},[l,m]),s.jsx(Te.button,{type:"button",role:"checkbox","aria-checked":Pa(c)?"mixed":c,"aria-required":d,"data-state":v_(c),"data-disabled":o?"":void 0,disabled:o,value:i,...a,ref:v,onKeyDown:ve(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:ve(n,g=>{m(p=>Pa(p)?!0:!p),j&&x&&(h.current=g.isPropagationStopped(),h.current||g.stopPropagation())})})});h_.displayName=f_;var dx=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:r,defaultChecked:l,required:i,disabled:o,value:c,onCheckedChange:d,form:f,...m}=e;return s.jsx(HM,{__scopeCheckbox:n,checked:r,defaultChecked:l,disabled:o,required:i,onCheckedChange:d,name:a,form:f,value:c,internal_do_not_use_render:({isFormControl:h})=>s.jsxs(s.Fragment,{children:[s.jsx(h_,{...m,ref:t,__scopeCheckbox:n}),h&&s.jsx(g_,{__scopeCheckbox:n})]})})});dx.displayName=$d;var m_="CheckboxIndicator",p_=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...r}=e,l=ux(m_,n);return s.jsx(ds,{present:a||Pa(l.checked)||l.checked===!0,children:s.jsx(Te.span,{"data-state":v_(l.checked),"data-disabled":l.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});p_.displayName=m_;var x_="CheckboxBubbleInput",g_=u.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:r,checked:l,defaultChecked:i,required:o,disabled:c,name:d,value:f,form:m,bubbleInput:h,setBubbleInput:x}=ux(x_,e),j=Qe(n,x),v=u_(l),y=d_(a);u.useEffect(()=>{const p=h;if(!p)return;const b=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(b,"checked").set,C=!r.current;if(v!==l&&N){const _=new Event("click",{bubbles:C});p.indeterminate=Pa(l),N.call(p,Pa(l)?!1:l),p.dispatchEvent(_)}},[h,v,l,r]);const g=u.useRef(Pa(l)?!1:l);return s.jsx(Te.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??g.current,required:o,disabled:c,name:d,value:f,form:m,...t,tabIndex:-1,ref:j,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});g_.displayName=x_;function IM(e){return typeof e=="function"}function Pa(e){return e==="indeterminate"}function v_(e){return Pa(e)?"indeterminate":e?"checked":"unchecked"}const Wl=u.forwardRef(({className:e,...t},n)=>s.jsx(dx,{ref:n,className:ie("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=indeterminate]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:text-primary-foreground",e),...t,children:s.jsx(p_,{className:ie("flex items-center justify-center text-current"),children:t.checked==="indeterminate"?s.jsx(OE,{className:"size-4","aria-hidden":"true"}):s.jsx($r,{className:"size-4","aria-hidden":"true"})})}));Wl.displayName=dx.displayName;const PM=qo("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200",{variants:{size:{sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-4xl","2xl":"sm:max-w-6xl",full:"sm:max-w-[calc(100%-2rem)]"}},defaultVariants:{size:"md"}});function kn({...e}){return s.jsx(n_,{"data-slot":"dialog",...e})}function qM({...e}){const t=Yo();return s.jsx(s_,{"data-slot":"dialog-portal",container:t,...e})}function GM({className:e,...t}){return s.jsx(a_,{"data-slot":"dialog-overlay",className:ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Sn({className:e,children:t,showCloseButton:n=!0,size:a,...r}){return s.jsxs(qM,{"data-slot":"dialog-portal",children:[s.jsx(GM,{}),s.jsxs(r_,{"data-slot":"dialog-content",className:ie(PM({size:a}),e),...r,children:[t,n&&s.jsxs(nx,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground text-muted-foreground hover:text-foreground absolute top-4 right-4 rounded-xs transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[s.jsx(kd,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Cn({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:ie("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Rn({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-footer",className:ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function En({className:e,...t}){return s.jsx(l_,{"data-slot":"dialog-title",className:ie("text-lg leading-none font-semibold",e),...t})}function Tn({className:e,...t}){return s.jsx(i_,{"data-slot":"dialog-description",className:ie("text-muted-foreground text-sm",e),...t})}function fx(e){const t=e+"CollectionProvider",[n,a]=qs(t),[r,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:y,children:g}=v,p=ya.useRef(null),b=ya.useRef(new Map).current;return s.jsx(r,{scope:y,itemMap:b,collectionRef:p,children:g})};i.displayName=t;const o=e+"CollectionSlot",c=wr(o),d=ya.forwardRef((v,y)=>{const{scope:g,children:p}=v,b=l(o,g),w=Qe(y,b.collectionRef);return s.jsx(c,{ref:w,children:p})});d.displayName=o;const f=e+"CollectionItemSlot",m="data-radix-collection-item",h=wr(f),x=ya.forwardRef((v,y)=>{const{scope:g,children:p,...b}=v,w=ya.useRef(null),N=Qe(y,w),C=l(f,g);return ya.useEffect(()=>(C.itemMap.set(w,{ref:w,...b}),()=>void C.itemMap.delete(w))),s.jsx(h,{[m]:"",ref:N,children:p})});x.displayName=f;function j(v){const y=l(e+"CollectionConsumer",v);return ya.useCallback(()=>{const p=y.collectionRef.current;if(!p)return[];const b=Array.from(p.querySelectorAll(`[${m}]`));return Array.from(y.itemMap.values()).sort((C,_)=>b.indexOf(C.ref.current)-b.indexOf(_.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:x},j,a]}var VM=u.createContext(void 0);function Od(e){const t=u.useContext(VM);return e||t||"ltr"}const YM=["top","right","bottom","left"],Fa=Math.min,Un=Math.max,Uu=Math.round,Sc=Math.floor,Ls=e=>({x:e,y:e}),FM={left:"right",right:"left",bottom:"top",top:"bottom"},KM={start:"end",end:"start"};function jm(e,t,n){return Un(e,Fa(t,n))}function ua(e,t){return typeof e=="function"?e(t):e}function da(e){return e.split("-")[0]}function Zl(e){return e.split("-")[1]}function hx(e){return e==="x"?"y":"x"}function mx(e){return e==="y"?"height":"width"}function Ms(e){return["top","bottom"].includes(da(e))?"y":"x"}function px(e){return hx(Ms(e))}function XM(e,t,n){n===void 0&&(n=!1);const a=Zl(e),r=px(e),l=mx(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=Bu(i)),[i,Bu(i)]}function QM(e){const t=Bu(e);return[bm(e),t,bm(t)]}function bm(e){return e.replace(/start|end/g,t=>KM[t])}function WM(e,t,n){const a=["left","right"],r=["right","left"],l=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:a:t?a:r;case"left":case"right":return t?l:i;default:return[]}}function ZM(e,t,n,a){const r=Zl(e);let l=WM(da(e),n==="start",a);return r&&(l=l.map(i=>i+"-"+r),t&&(l=l.concat(l.map(bm)))),l}function Bu(e){return e.replace(/left|right|bottom|top/g,t=>FM[t])}function JM(e){return{top:0,right:0,bottom:0,left:0,...e}}function y_(e){return typeof e!="number"?JM(e):{top:e,right:e,bottom:e,left:e}}function Hu(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}function ay(e,t,n){let{reference:a,floating:r}=e;const l=Ms(t),i=px(t),o=mx(i),c=da(t),d=l==="y",f=a.x+a.width/2-r.width/2,m=a.y+a.height/2-r.height/2,h=a[o]/2-r[o]/2;let x;switch(c){case"top":x={x:f,y:a.y-r.height};break;case"bottom":x={x:f,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:m};break;case"left":x={x:a.x-r.width,y:m};break;default:x={x:a.x,y:a.y}}switch(Zl(t)){case"start":x[i]-=h*(n&&d?-1:1);break;case"end":x[i]+=h*(n&&d?-1:1);break}return x}const e$=async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:l=[],platform:i}=n,o=l.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:m}=ay(d,a,c),h=a,x={},j=0;for(let v=0;v<o.length;v++){const{name:y,fn:g}=o[v],{x:p,y:b,data:w,reset:N}=await g({x:f,y:m,initialPlacement:a,placement:h,strategy:r,middlewareData:x,rects:d,platform:i,elements:{reference:e,floating:t}});f=p??f,m=b??m,x={...x,[y]:{...x[y],...w}},N&&j<=50&&(j++,typeof N=="object"&&(N.placement&&(h=N.placement),N.rects&&(d=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:f,y:m}=ay(d,h,c)),v=-1)}return{x:f,y:m,placement:h,strategy:r,middlewareData:x}};async function ho(e,t){var n;t===void 0&&(t={});const{x:a,y:r,platform:l,rects:i,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:m="floating",altBoundary:h=!1,padding:x=0}=ua(t,e),j=y_(x),y=o[h?m==="floating"?"reference":"floating":m],g=Hu(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(y)))==null||n?y:y.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(o.floating)),boundary:d,rootBoundary:f,strategy:c})),p=m==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,b=await(l.getOffsetParent==null?void 0:l.getOffsetParent(o.floating)),w=await(l.isElement==null?void 0:l.isElement(b))?await(l.getScale==null?void 0:l.getScale(b))||{x:1,y:1}:{x:1,y:1},N=Hu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:p,offsetParent:b,strategy:c}):p);return{top:(g.top-N.top+j.top)/w.y,bottom:(N.bottom-g.bottom+j.bottom)/w.y,left:(g.left-N.left+j.left)/w.x,right:(N.right-g.right+j.right)/w.x}}const t$=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:l,platform:i,elements:o,middlewareData:c}=t,{element:d,padding:f=0}=ua(e,t)||{};if(d==null)return{};const m=y_(f),h={x:n,y:a},x=px(r),j=mx(x),v=await i.getDimensions(d),y=x==="y",g=y?"top":"left",p=y?"bottom":"right",b=y?"clientHeight":"clientWidth",w=l.reference[j]+l.reference[x]-h[x]-l.floating[j],N=h[x]-l.reference[x],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let _=C?C[b]:0;(!_||!await(i.isElement==null?void 0:i.isElement(C)))&&(_=o.floating[b]||l.floating[j]);const S=w/2-N/2,D=_/2-v[j]/2-1,O=Fa(m[g],D),B=Fa(m[p],D),Y=O,H=_-v[j]-B,M=_/2-v[j]/2+S,A=jm(Y,M,H),R=!c.arrow&&Zl(r)!=null&&M!==A&&l.reference[j]/2-(M<Y?O:B)-v[j]/2<0,T=R?M<Y?M-Y:M-H:0;return{[x]:h[x]+T,data:{[x]:A,centerOffset:M-A-T,...R&&{alignmentOffset:T}},reset:R}}}),n$=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:r,middlewareData:l,rects:i,initialPlacement:o,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:v=!0,...y}=ua(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const g=da(r),p=Ms(o),b=da(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=h||(b||!v?[Bu(o)]:QM(o)),C=j!=="none";!h&&C&&N.push(...ZM(o,v,j,w));const _=[o,...N],S=await ho(t,y),D=[];let O=((a=l.flip)==null?void 0:a.overflows)||[];if(f&&D.push(S[g]),m){const M=XM(r,i,w);D.push(S[M[0]],S[M[1]])}if(O=[...O,{placement:r,overflows:D}],!D.every(M=>M<=0)){var B,Y;const M=(((B=l.flip)==null?void 0:B.index)||0)+1,A=_[M];if(A&&(!(m==="alignment"?p!==Ms(A):!1)||O.every(k=>k.overflows[0]>0&&Ms(k.placement)===p)))return{data:{index:M,overflows:O},reset:{placement:A}};let R=(Y=O.filter(T=>T.overflows[0]<=0).sort((T,k)=>T.overflows[1]-k.overflows[1])[0])==null?void 0:Y.placement;if(!R)switch(x){case"bestFit":{var H;const T=(H=O.filter(k=>{if(C){const $=Ms(k.placement);return $===p||$==="y"}return!0}).map(k=>[k.placement,k.overflows.filter($=>$>0).reduce(($,P)=>$+P,0)]).sort((k,$)=>k[1]-$[1])[0])==null?void 0:H[0];T&&(R=T);break}case"initialPlacement":R=o;break}if(r!==R)return{reset:{placement:R}}}return{}}}};function ry(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ly(e){return YM.some(t=>e[t]>=0)}const s$=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...r}=ua(e,t);switch(a){case"referenceHidden":{const l=await ho(t,{...r,elementContext:"reference"}),i=ry(l,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ly(i)}}}case"escaped":{const l=await ho(t,{...r,altBoundary:!0}),i=ry(l,n.floating);return{data:{escapedOffsets:i,escaped:ly(i)}}}default:return{}}}}};async function a$(e,t){const{placement:n,platform:a,elements:r}=e,l=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=da(n),o=Zl(n),c=Ms(n)==="y",d=["left","top"].includes(i)?-1:1,f=l&&c?-1:1,m=ua(t,e);let{mainAxis:h,crossAxis:x,alignmentAxis:j}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return o&&typeof j=="number"&&(x=o==="end"?j*-1:j),c?{x:x*f,y:h*d}:{x:h*d,y:x*f}}const r$=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:l,placement:i,middlewareData:o}=t,c=await a$(t,e);return i===((n=o.offset)==null?void 0:n.placement)&&(a=o.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:l+c.y,data:{...c,placement:i}}}}},l$=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r}=t,{mainAxis:l=!0,crossAxis:i=!1,limiter:o={fn:y=>{let{x:g,y:p}=y;return{x:g,y:p}}},...c}=ua(e,t),d={x:n,y:a},f=await ho(t,c),m=Ms(da(r)),h=hx(m);let x=d[h],j=d[m];if(l){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",p=x+f[y],b=x-f[g];x=jm(p,x,b)}if(i){const y=m==="y"?"top":"left",g=m==="y"?"bottom":"right",p=j+f[y],b=j-f[g];j=jm(p,j,b)}const v=o.fn({...t,[h]:x,[m]:j});return{...v,data:{x:v.x-n,y:v.y-a,enabled:{[h]:l,[m]:i}}}}}},i$=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:r,rects:l,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=ua(e,t),f={x:n,y:a},m=Ms(r),h=hx(m);let x=f[h],j=f[m];const v=ua(o,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const b=h==="y"?"height":"width",w=l.reference[h]-l.floating[b]+y.mainAxis,N=l.reference[h]+l.reference[b]-y.mainAxis;x<w?x=w:x>N&&(x=N)}if(d){var g,p;const b=h==="y"?"width":"height",w=["top","left"].includes(da(r)),N=l.reference[m]-l.floating[b]+(w&&((g=i.offset)==null?void 0:g[m])||0)+(w?0:y.crossAxis),C=l.reference[m]+l.reference[b]+(w?0:((p=i.offset)==null?void 0:p[m])||0)-(w?y.crossAxis:0);j<N?j=N:j>C&&(j=C)}return{[h]:x,[m]:j}}}},o$=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:r,rects:l,platform:i,elements:o}=t,{apply:c=()=>{},...d}=ua(e,t),f=await ho(t,d),m=da(r),h=Zl(r),x=Ms(r)==="y",{width:j,height:v}=l.floating;let y,g;m==="top"||m==="bottom"?(y=m,g=h===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=m,y=h==="end"?"top":"bottom");const p=v-f.top-f.bottom,b=j-f.left-f.right,w=Fa(v-f[y],p),N=Fa(j-f[g],b),C=!t.middlewareData.shift;let _=w,S=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(_=p),C&&!h){const O=Un(f.left,0),B=Un(f.right,0),Y=Un(f.top,0),H=Un(f.bottom,0);x?S=j-2*(O!==0||B!==0?O+B:Un(f.left,f.right)):_=v-2*(Y!==0||H!==0?Y+H:Un(f.top,f.bottom))}await c({...t,availableWidth:S,availableHeight:_});const D=await i.getDimensions(o.floating);return j!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function Dd(){return typeof window<"u"}function Jl(e){return j_(e)?(e.nodeName||"").toLowerCase():"#document"}function Gn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gs(e){var t;return(t=(j_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j_(e){return Dd()?e instanceof Node||e instanceof Gn(e).Node:!1}function bs(e){return Dd()?e instanceof Element||e instanceof Gn(e).Element:!1}function Hs(e){return Dd()?e instanceof HTMLElement||e instanceof Gn(e).HTMLElement:!1}function iy(e){return!Dd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Gn(e).ShadowRoot}function Fo(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=ws(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function c$(e){return["table","td","th"].includes(Jl(e))}function zd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function xx(e){const t=gx(),n=bs(e)?ws(e):e;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function u$(e){let t=Ka(e);for(;Hs(t)&&!zl(t);){if(xx(t))return t;if(zd(t))return null;t=Ka(t)}return null}function gx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zl(e){return["html","body","#document"].includes(Jl(e))}function ws(e){return Gn(e).getComputedStyle(e)}function Ld(e){return bs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ka(e){if(Jl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||iy(e)&&e.host||Gs(e);return iy(t)?t.host:t}function b_(e){const t=Ka(e);return zl(t)?e.ownerDocument?e.ownerDocument.body:e.body:Hs(t)&&Fo(t)?t:b_(t)}function mo(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=b_(e),l=r===((a=e.ownerDocument)==null?void 0:a.body),i=Gn(r);if(l){const o=wm(i);return t.concat(i,i.visualViewport||[],Fo(r)?r:[],o&&n?mo(o):[])}return t.concat(r,mo(r,[],n))}function wm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function w_(e){const t=ws(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=Hs(e),l=r?e.offsetWidth:n,i=r?e.offsetHeight:a,o=Uu(n)!==l||Uu(a)!==i;return o&&(n=l,a=i),{width:n,height:a,$:o}}function vx(e){return bs(e)?e:e.contextElement}function bl(e){const t=vx(e);if(!Hs(t))return Ls(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:l}=w_(t);let i=(l?Uu(n.width):n.width)/a,o=(l?Uu(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const d$=Ls(0);function __(e){const t=Gn(e);return!gx()||!t.visualViewport?d$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function f$(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Gn(e)?!1:t}function Nr(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),l=vx(e);let i=Ls(1);t&&(a?bs(a)&&(i=bl(a)):i=bl(e));const o=f$(l,n,a)?__(l):Ls(0);let c=(r.left+o.x)/i.x,d=(r.top+o.y)/i.y,f=r.width/i.x,m=r.height/i.y;if(l){const h=Gn(l),x=a&&bs(a)?Gn(a):a;let j=h,v=wm(j);for(;v&&a&&x!==j;){const y=bl(v),g=v.getBoundingClientRect(),p=ws(v),b=g.left+(v.clientLeft+parseFloat(p.paddingLeft))*y.x,w=g.top+(v.clientTop+parseFloat(p.paddingTop))*y.y;c*=y.x,d*=y.y,f*=y.x,m*=y.y,c+=b,d+=w,j=Gn(v),v=wm(j)}}return Hu({width:f,height:m,x:c,y:d})}function yx(e,t){const n=Ld(e).scrollLeft;return t?t.left+n:Nr(Gs(e)).left+n}function N_(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-(n?0:yx(e,a)),l=a.top+t.scrollTop;return{x:r,y:l}}function h$(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const l=r==="fixed",i=Gs(a),o=t?zd(t.floating):!1;if(a===i||o&&l)return n;let c={scrollLeft:0,scrollTop:0},d=Ls(1);const f=Ls(0),m=Hs(a);if((m||!m&&!l)&&((Jl(a)!=="body"||Fo(i))&&(c=Ld(a)),Hs(a))){const x=Nr(a);d=bl(a),f.x=x.x+a.clientLeft,f.y=x.y+a.clientTop}const h=i&&!m&&!l?N_(i,c,!0):Ls(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+h.x,y:n.y*d.y-c.scrollTop*d.y+f.y+h.y}}function m$(e){return Array.from(e.getClientRects())}function p$(e){const t=Gs(e),n=Ld(e),a=e.ownerDocument.body,r=Un(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),l=Un(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+yx(e);const o=-n.scrollTop;return ws(a).direction==="rtl"&&(i+=Un(t.clientWidth,a.clientWidth)-r),{width:r,height:l,x:i,y:o}}function x$(e,t){const n=Gn(e),a=Gs(e),r=n.visualViewport;let l=a.clientWidth,i=a.clientHeight,o=0,c=0;if(r){l=r.width,i=r.height;const d=gx();(!d||d&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:l,height:i,x:o,y:c}}function g$(e,t){const n=Nr(e,!0,t==="fixed"),a=n.top+e.clientTop,r=n.left+e.clientLeft,l=Hs(e)?bl(e):Ls(1),i=e.clientWidth*l.x,o=e.clientHeight*l.y,c=r*l.x,d=a*l.y;return{width:i,height:o,x:c,y:d}}function oy(e,t,n){let a;if(t==="viewport")a=x$(e,n);else if(t==="document")a=p$(Gs(e));else if(bs(t))a=g$(t,n);else{const r=__(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Hu(a)}function k_(e,t){const n=Ka(e);return n===t||!bs(n)||zl(n)?!1:ws(n).position==="fixed"||k_(n,t)}function v$(e,t){const n=t.get(e);if(n)return n;let a=mo(e,[],!1).filter(o=>bs(o)&&Jl(o)!=="body"),r=null;const l=ws(e).position==="fixed";let i=l?Ka(e):e;for(;bs(i)&&!zl(i);){const o=ws(i),c=xx(i);!c&&o.position==="fixed"&&(r=null),(l?!c&&!r:!c&&o.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Fo(i)&&!c&&k_(e,i))?a=a.filter(f=>f!==i):r=o,i=Ka(i)}return t.set(e,a),a}function y$(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const i=[...n==="clippingAncestors"?zd(t)?[]:v$(t,this._c):[].concat(n),a],o=i[0],c=i.reduce((d,f)=>{const m=oy(t,f,r);return d.top=Un(m.top,d.top),d.right=Fa(m.right,d.right),d.bottom=Fa(m.bottom,d.bottom),d.left=Un(m.left,d.left),d},oy(t,o,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function j$(e){const{width:t,height:n}=w_(e);return{width:t,height:n}}function b$(e,t,n){const a=Hs(t),r=Gs(t),l=n==="fixed",i=Nr(e,!0,l,t);let o={scrollLeft:0,scrollTop:0};const c=Ls(0);function d(){c.x=yx(r)}if(a||!a&&!l)if((Jl(t)!=="body"||Fo(r))&&(o=Ld(t)),a){const x=Nr(t,!0,l,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else r&&d();l&&!a&&r&&d();const f=r&&!a&&!l?N_(r,o):Ls(0),m=i.left+o.scrollLeft-c.x-f.x,h=i.top+o.scrollTop-c.y-f.y;return{x:m,y:h,width:i.width,height:i.height}}function th(e){return ws(e).position==="static"}function cy(e,t){if(!Hs(e)||ws(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Gs(e)===n&&(n=n.ownerDocument.body),n}function S_(e,t){const n=Gn(e);if(zd(e))return n;if(!Hs(e)){let r=Ka(e);for(;r&&!zl(r);){if(bs(r)&&!th(r))return r;r=Ka(r)}return n}let a=cy(e,t);for(;a&&c$(a)&&th(a);)a=cy(a,t);return a&&zl(a)&&th(a)&&!xx(a)?n:a||u$(e)||n}const w$=async function(e){const t=this.getOffsetParent||S_,n=this.getDimensions,a=await n(e.floating);return{reference:b$(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function _$(e){return ws(e).direction==="rtl"}const N$={convertOffsetParentRelativeRectToViewportRelativeRect:h$,getDocumentElement:Gs,getClippingRect:y$,getOffsetParent:S_,getElementRects:w$,getClientRects:m$,getDimensions:j$,getScale:bl,isElement:bs,isRTL:_$};function C_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function k$(e,t){let n=null,a;const r=Gs(e);function l(){var o;clearTimeout(a),(o=n)==null||o.disconnect(),n=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),l();const d=e.getBoundingClientRect(),{left:f,top:m,width:h,height:x}=d;if(o||t(),!h||!x)return;const j=Sc(m),v=Sc(r.clientWidth-(f+h)),y=Sc(r.clientHeight-(m+x)),g=Sc(f),b={rootMargin:-j+"px "+-v+"px "+-y+"px "+-g+"px",threshold:Un(0,Fa(1,c))||1};let w=!0;function N(C){const _=C[0].intersectionRatio;if(_!==c){if(!w)return i();_?i(!1,_):a=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!C_(d,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(N,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,b)}n.observe(e)}return i(!0),l}function S$(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=vx(e),f=r||l?[...d?mo(d):[],...mo(t)]:[];f.forEach(g=>{r&&g.addEventListener("scroll",n,{passive:!0}),l&&g.addEventListener("resize",n)});const m=d&&o?k$(d,n):null;let h=-1,x=null;i&&(x=new ResizeObserver(g=>{let[p]=g;p&&p.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=x)==null||b.observe(t)})),n()}),d&&!c&&x.observe(d),x.observe(t));let j,v=c?Nr(e):null;c&&y();function y(){const g=Nr(e);v&&!C_(v,g)&&n(),v=g,j=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(p=>{r&&p.removeEventListener("scroll",n),l&&p.removeEventListener("resize",n)}),m==null||m(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(j)}}const C$=r$,R$=l$,E$=n$,T$=o$,A$=s$,uy=t$,M$=i$,$$=(e,t,n)=>{const a=new Map,r={platform:N$,...n},l={...r.platform,_c:a};return e$(e,t,{...r,platform:l})};var O$=typeof document<"u",D$=function(){},Zc=O$?u.useLayoutEffect:D$;function Iu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!Iu(e[a],t[a]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,r[a]))return!1;for(a=n;a--!==0;){const l=r[a];if(!(l==="_owner"&&e.$$typeof)&&!Iu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function R_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dy(e,t){const n=R_(e);return Math.round(t*n)/n}function nh(e){const t=u.useRef(e);return Zc(()=>{t.current=e}),t}function z$(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:r,elements:{reference:l,floating:i}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[f,m]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,x]=u.useState(a);Iu(h,a)||x(a);const[j,v]=u.useState(null),[y,g]=u.useState(null),p=u.useCallback(k=>{k!==C.current&&(C.current=k,v(k))},[]),b=u.useCallback(k=>{k!==_.current&&(_.current=k,g(k))},[]),w=l||j,N=i||y,C=u.useRef(null),_=u.useRef(null),S=u.useRef(f),D=c!=null,O=nh(c),B=nh(r),Y=nh(d),H=u.useCallback(()=>{if(!C.current||!_.current)return;const k={placement:t,strategy:n,middleware:h};B.current&&(k.platform=B.current),$$(C.current,_.current,k).then($=>{const P={...$,isPositioned:Y.current!==!1};M.current&&!Iu(S.current,P)&&(S.current=P,Hl.flushSync(()=>{m(P)}))})},[h,t,n,B,Y]);Zc(()=>{d===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,m(k=>({...k,isPositioned:!1})))},[d]);const M=u.useRef(!1);Zc(()=>(M.current=!0,()=>{M.current=!1}),[]),Zc(()=>{if(w&&(C.current=w),N&&(_.current=N),w&&N){if(O.current)return O.current(w,N,H);H()}},[w,N,H,O,D]);const A=u.useMemo(()=>({reference:C,floating:_,setReference:p,setFloating:b}),[p,b]),R=u.useMemo(()=>({reference:w,floating:N}),[w,N]),T=u.useMemo(()=>{const k={position:n,left:0,top:0};if(!R.floating)return k;const $=dy(R.floating,f.x),P=dy(R.floating,f.y);return o?{...k,transform:"translate("+$+"px, "+P+"px)",...R_(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:P}},[n,o,R.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:H,refs:A,elements:R,floatingStyles:T}),[f,H,A,R,T])}const L$=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:r}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?uy({element:a.current,padding:r}).fn(n):{}:a?uy({element:a,padding:r}).fn(n):{}}}},U$=(e,t)=>({...C$(e),options:[e,t]}),B$=(e,t)=>({...R$(e),options:[e,t]}),H$=(e,t)=>({...M$(e),options:[e,t]}),I$=(e,t)=>({...E$(e),options:[e,t]}),P$=(e,t)=>({...T$(e),options:[e,t]}),q$=(e,t)=>({...A$(e),options:[e,t]}),G$=(e,t)=>({...L$(e),options:[e,t]});var V$="Arrow",E_=u.forwardRef((e,t)=>{const{children:n,width:a=10,height:r=5,...l}=e;return s.jsx(Te.svg,{...l,ref:t,width:a,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});E_.displayName=V$;var Y$=E_,jx="Popper",[T_,ei]=qs(jx),[F$,A_]=T_(jx),M_=e=>{const{__scopePopper:t,children:n}=e,[a,r]=u.useState(null);return s.jsx(F$,{scope:t,anchor:a,onAnchorChange:r,children:n})};M_.displayName=jx;var $_="PopperAnchor",O_=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...r}=e,l=A_($_,n),i=u.useRef(null),o=Qe(t,i);return u.useEffect(()=>{l.onAnchorChange((a==null?void 0:a.current)||i.current)}),a?null:s.jsx(Te.div,{...r,ref:o})});O_.displayName=$_;var bx="PopperContent",[K$,X$]=T_(bx),D_=u.forwardRef((e,t)=>{var Z,J,re,ee,fe,ce;const{__scopePopper:n,side:a="bottom",sideOffset:r=0,align:l="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:m="partial",hideWhenDetached:h=!1,updatePositionStrategy:x="optimized",onPlaced:j,...v}=e,y=A_(bx,n),[g,p]=u.useState(null),b=Qe(t,Ee=>p(Ee)),[w,N]=u.useState(null),C=d_(w),_=(C==null?void 0:C.width)??0,S=(C==null?void 0:C.height)??0,D=a+(l!=="center"?"-"+l:""),O=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},B=Array.isArray(d)?d:[d],Y=B.length>0,H={padding:O,boundary:B.filter(W$),altBoundary:Y},{refs:M,floatingStyles:A,placement:R,isPositioned:T,middlewareData:k}=z$({strategy:"fixed",placement:D,whileElementsMounted:(...Ee)=>S$(...Ee,{animationFrame:x==="always"}),elements:{reference:y.anchor},middleware:[U$({mainAxis:r+S,alignmentAxis:i}),c&&B$({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?H$():void 0,...H}),c&&I$({...H}),P$({...H,apply:({elements:Ee,rects:V,availableWidth:te,availableHeight:le})=>{const{width:Pe,height:Le}=V.reference,ue=Ee.floating.style;ue.setProperty("--radix-popper-available-width",`${te}px`),ue.setProperty("--radix-popper-available-height",`${le}px`),ue.setProperty("--radix-popper-anchor-width",`${Pe}px`),ue.setProperty("--radix-popper-anchor-height",`${Le}px`)}}),w&&G$({element:w,padding:o}),Z$({arrowWidth:_,arrowHeight:S}),h&&q$({strategy:"referenceHidden",...H})]}),[$,P]=U_(R),E=Bs(j);on(()=>{T&&(E==null||E())},[T,E]);const I=(Z=k.arrow)==null?void 0:Z.x,F=(J=k.arrow)==null?void 0:J.y,Q=((re=k.arrow)==null?void 0:re.centerOffset)!==0,[oe,ge]=u.useState();return on(()=>{g&&ge(window.getComputedStyle(g).zIndex)},[g]),s.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:T?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(ee=k.transformOrigin)==null?void 0:ee.x,(fe=k.transformOrigin)==null?void 0:fe.y].join(" "),...((ce=k.hide)==null?void 0:ce.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(K$,{scope:n,placedSide:$,onArrowChange:N,arrowX:I,arrowY:F,shouldHideArrow:Q,children:s.jsx(Te.div,{"data-side":$,"data-align":P,...v,ref:b,style:{...v.style,animation:T?void 0:"none"}})})})});D_.displayName=bx;var z_="PopperArrow",Q$={top:"bottom",right:"left",bottom:"top",left:"right"},L_=u.forwardRef(function(t,n){const{__scopePopper:a,...r}=t,l=X$(z_,a),i=Q$[l.placedSide];return s.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:s.jsx(Y$,{...r,ref:n,style:{...r.style,display:"block"}})})});L_.displayName=z_;function W$(e){return e!==null}var Z$=e=>({name:"transformOrigin",options:e,fn(t){var y,g,p;const{placement:n,rects:a,middlewareData:r}=t,i=((y=r.arrow)==null?void 0:y.centerOffset)!==0,o=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=U_(n),m={start:"0%",center:"50%",end:"100%"}[f],h=(((g=r.arrow)==null?void 0:g.x)??0)+o/2,x=(((p=r.arrow)==null?void 0:p.y)??0)+c/2;let j="",v="";return d==="bottom"?(j=i?m:`${h}px`,v=`${-c}px`):d==="top"?(j=i?m:`${h}px`,v=`${a.floating.height+c}px`):d==="right"?(j=`${-c}px`,v=i?m:`${x}px`):d==="left"&&(j=`${a.floating.width+c}px`,v=i?m:`${x}px`),{data:{x:j,y:v}}}});function U_(e){const[t,n="center"]=e.split("-");return[t,n]}var wx=M_,_x=O_,Nx=D_,kx=L_,sh="rovingFocusGroup.onEntryFocus",J$={bubbles:!1,cancelable:!0},Ko="RovingFocusGroup",[_m,B_,eO]=fx(Ko),[tO,Ud]=qs(Ko,[eO]),[nO,sO]=tO(Ko),H_=u.forwardRef((e,t)=>s.jsx(_m.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(_m.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(aO,{...e,ref:t})})}));H_.displayName=Ko;var aO=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:r=!1,dir:l,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...m}=e,h=u.useRef(null),x=Qe(t,h),j=Od(l),[v,y]=Ya({prop:i,defaultProp:o??null,onChange:c,caller:Ko}),[g,p]=u.useState(!1),b=Bs(d),w=B_(n),N=u.useRef(!1),[C,_]=u.useState(0);return u.useEffect(()=>{const S=h.current;if(S)return S.addEventListener(sh,b),()=>S.removeEventListener(sh,b)},[b]),s.jsx(nO,{scope:n,orientation:a,dir:j,loop:r,currentTabStopId:v,onItemFocus:u.useCallback(S=>y(S),[y]),onItemShiftTab:u.useCallback(()=>p(!0),[]),onFocusableItemAdd:u.useCallback(()=>_(S=>S+1),[]),onFocusableItemRemove:u.useCallback(()=>_(S=>S-1),[]),children:s.jsx(Te.div,{tabIndex:g||C===0?-1:0,"data-orientation":a,...m,ref:x,style:{outline:"none",...e.style},onMouseDown:ve(e.onMouseDown,()=>{N.current=!0}),onFocus:ve(e.onFocus,S=>{const D=!N.current;if(S.target===S.currentTarget&&D&&!g){const O=new CustomEvent(sh,J$);if(S.currentTarget.dispatchEvent(O),!O.defaultPrevented){const B=w().filter(R=>R.focusable),Y=B.find(R=>R.active),H=B.find(R=>R.id===v),A=[Y,H,...B].filter(Boolean).map(R=>R.ref.current);q_(A,f)}}N.current=!1}),onBlur:ve(e.onBlur,()=>p(!1))})})}),I_="RovingFocusGroupItem",P_=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:r=!1,tabStopId:l,children:i,...o}=e,c=vs(),d=l||c,f=sO(I_,n),m=f.currentTabStopId===d,h=B_(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:v}=f;return u.useEffect(()=>{if(a)return x(),()=>j()},[a,x,j]),s.jsx(_m.ItemSlot,{scope:n,id:d,focusable:a,active:r,children:s.jsx(Te.span,{tabIndex:m?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:ve(e.onMouseDown,y=>{a?f.onItemFocus(d):y.preventDefault()}),onFocus:ve(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:ve(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=iO(y,f.orientation,f.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let b=h().filter(w=>w.focusable).map(w=>w.ref.current);if(g==="last")b.reverse();else if(g==="prev"||g==="next"){g==="prev"&&b.reverse();const w=b.indexOf(y.currentTarget);b=f.loop?oO(b,w+1):b.slice(w+1)}setTimeout(()=>q_(b))}}),children:typeof i=="function"?i({isCurrentTabStop:m,hasTabStop:v!=null}):i})})});P_.displayName=I_;var rO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function iO(e,t,n){const a=lO(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return rO[a]}function q_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function oO(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var G_=H_,V_=P_,Nm=["Enter"," "],cO=["ArrowDown","PageUp","Home"],Y_=["ArrowUp","PageDown","End"],uO=[...cO,...Y_],dO={ltr:[...Nm,"ArrowRight"],rtl:[...Nm,"ArrowLeft"]},fO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Xo="Menu",[po,hO,mO]=fx(Xo),[Dr,F_]=qs(Xo,[mO,ei,Ud]),Bd=ei(),K_=Ud(),[pO,zr]=Dr(Xo),[xO,Qo]=Dr(Xo),X_=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:r,onOpenChange:l,modal:i=!0}=e,o=Bd(t),[c,d]=u.useState(null),f=u.useRef(!1),m=Bs(l),h=Od(r);return u.useEffect(()=>{const x=()=>{f.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>f.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(wx,{...o,children:s.jsx(pO,{scope:t,open:n,onOpenChange:m,content:c,onContentChange:d,children:s.jsx(xO,{scope:t,onClose:u.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:f,dir:h,modal:i,children:a})})})};X_.displayName=Xo;var gO="MenuAnchor",Sx=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=Bd(n);return s.jsx(_x,{...r,...a,ref:t})});Sx.displayName=gO;var Cx="MenuPortal",[vO,Q_]=Dr(Cx,{forceMount:void 0}),W_=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:r}=e,l=zr(Cx,t);return s.jsx(vO,{scope:t,forceMount:n,children:s.jsx(ds,{present:n||l.open,children:s.jsx(Vo,{asChild:!0,container:r,children:a})})})};W_.displayName=Cx;var ss="MenuContent",[yO,Rx]=Dr(ss),Z_=u.forwardRef((e,t)=>{const n=Q_(ss,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,l=zr(ss,e.__scopeMenu),i=Qo(ss,e.__scopeMenu);return s.jsx(po.Provider,{scope:e.__scopeMenu,children:s.jsx(ds,{present:a||l.open,children:s.jsx(po.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx(jO,{...r,ref:t}):s.jsx(bO,{...r,ref:t})})})})}),jO=u.forwardRef((e,t)=>{const n=zr(ss,e.__scopeMenu),a=u.useRef(null),r=Qe(t,a);return u.useEffect(()=>{const l=a.current;if(l)return Zp(l)},[]),s.jsx(Ex,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ve(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bO=u.forwardRef((e,t)=>{const n=zr(ss,e.__scopeMenu);return s.jsx(Ex,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),wO=wr("MenuContent.ScrollLock"),Ex=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:l,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:h,onDismiss:x,disableOutsideScroll:j,...v}=e,y=zr(ss,n),g=Qo(ss,n),p=Bd(n),b=K_(n),w=hO(n),[N,C]=u.useState(null),_=u.useRef(null),S=Qe(t,_,y.onContentChange),D=u.useRef(0),O=u.useRef(""),B=u.useRef(0),Y=u.useRef(null),H=u.useRef("right"),M=u.useRef(0),A=j?Td:u.Fragment,R=j?{as:wO,allowPinchZoom:!0}:void 0,T=$=>{var Z,J;const P=O.current+$,E=w().filter(re=>!re.disabled),I=document.activeElement,F=(Z=E.find(re=>re.ref.current===I))==null?void 0:Z.textValue,Q=E.map(re=>re.textValue),oe=OO(Q,P,F),ge=(J=E.find(re=>re.textValue===oe))==null?void 0:J.ref.current;(function re(ee){O.current=ee,window.clearTimeout(D.current),ee!==""&&(D.current=window.setTimeout(()=>re(""),1e3))})(P),ge&&setTimeout(()=>ge.focus())};u.useEffect(()=>()=>window.clearTimeout(D.current),[]),Wp();const k=u.useCallback($=>{var E,I;return H.current===((E=Y.current)==null?void 0:E.side)&&zO($,(I=Y.current)==null?void 0:I.area)},[]);return s.jsx(yO,{scope:n,searchRef:O,onItemEnter:u.useCallback($=>{k($)&&$.preventDefault()},[k]),onItemLeave:u.useCallback($=>{var P;k($)||((P=_.current)==null||P.focus(),C(null))},[k]),onTriggerLeave:u.useCallback($=>{k($)&&$.preventDefault()},[k]),pointerGraceTimerRef:B,onPointerGraceIntentChange:u.useCallback($=>{Y.current=$},[]),children:s.jsx(A,{...R,children:s.jsx(Rd,{asChild:!0,trapped:r,onMountAutoFocus:ve(l,$=>{var P;$.preventDefault(),(P=_.current)==null||P.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(Go,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:h,onDismiss:x,children:s.jsx(G_,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:a,currentTabStopId:N,onCurrentTabStopIdChange:C,onEntryFocus:ve(c,$=>{g.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Nx,{role:"menu","aria-orientation":"vertical","data-state":mN(y.open),"data-radix-menu-content":"",dir:g.dir,...p,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:ve(v.onKeyDown,$=>{const E=$.target.closest("[data-radix-menu-content]")===$.currentTarget,I=$.ctrlKey||$.altKey||$.metaKey,F=$.key.length===1;E&&($.key==="Tab"&&$.preventDefault(),!I&&F&&T($.key));const Q=_.current;if($.target!==Q||!uO.includes($.key))return;$.preventDefault();const ge=w().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);Y_.includes($.key)&&ge.reverse(),MO(ge)}),onBlur:ve(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:ve(e.onPointerMove,xo($=>{const P=$.target,E=M.current!==$.clientX;if($.currentTarget.contains(P)&&E){const I=$.clientX>M.current?"right":"left";H.current=I,M.current=$.clientX}}))})})})})})})});Z_.displayName=ss;var _O="MenuGroup",Tx=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Te.div,{role:"group",...a,ref:t})});Tx.displayName=_O;var NO="MenuLabel",J_=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Te.div,{...a,ref:t})});J_.displayName=NO;var Pu="MenuItem",fy="menu.itemSelect",Hd=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...r}=e,l=u.useRef(null),i=Qo(Pu,e.__scopeMenu),o=Rx(Pu,e.__scopeMenu),c=Qe(t,l),d=u.useRef(!1),f=()=>{const m=l.current;if(!n&&m){const h=new CustomEvent(fy,{bubbles:!0,cancelable:!0});m.addEventListener(fy,x=>a==null?void 0:a(x),{once:!0}),E0(m,h),h.defaultPrevented?d.current=!1:i.onClose()}};return s.jsx(eN,{...r,ref:c,disabled:n,onClick:ve(e.onClick,f),onPointerDown:m=>{var h;(h=e.onPointerDown)==null||h.call(e,m),d.current=!0},onPointerUp:ve(e.onPointerUp,m=>{var h;d.current||(h=m.currentTarget)==null||h.click()}),onKeyDown:ve(e.onKeyDown,m=>{const h=o.searchRef.current!=="";n||h&&m.key===" "||Nm.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Hd.displayName=Pu;var eN=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...l}=e,i=Rx(Pu,n),o=K_(n),c=u.useRef(null),d=Qe(t,c),[f,m]=u.useState(!1),[h,x]=u.useState("");return u.useEffect(()=>{const j=c.current;j&&x((j.textContent??"").trim())},[l.children]),s.jsx(po.ItemSlot,{scope:n,disabled:a,textValue:r??h,children:s.jsx(V_,{asChild:!0,...o,focusable:!a,children:s.jsx(Te.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...l,ref:d,onPointerMove:ve(e.onPointerMove,xo(j=>{a?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ve(e.onPointerLeave,xo(j=>i.onItemLeave(j))),onFocus:ve(e.onFocus,()=>m(!0)),onBlur:ve(e.onBlur,()=>m(!1))})})})}),kO="MenuCheckboxItem",tN=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...r}=e;return s.jsx(lN,{scope:e.__scopeMenu,checked:n,children:s.jsx(Hd,{role:"menuitemcheckbox","aria-checked":qu(n)?"mixed":n,...r,ref:t,"data-state":Mx(n),onSelect:ve(r.onSelect,()=>a==null?void 0:a(qu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tN.displayName=kO;var nN="MenuRadioGroup",[SO,CO]=Dr(nN,{value:void 0,onValueChange:()=>{}}),sN=u.forwardRef((e,t)=>{const{value:n,onValueChange:a,...r}=e,l=Bs(a);return s.jsx(SO,{scope:e.__scopeMenu,value:n,onValueChange:l,children:s.jsx(Tx,{...r,ref:t})})});sN.displayName=nN;var aN="MenuRadioItem",rN=u.forwardRef((e,t)=>{const{value:n,...a}=e,r=CO(aN,e.__scopeMenu),l=n===r.value;return s.jsx(lN,{scope:e.__scopeMenu,checked:l,children:s.jsx(Hd,{role:"menuitemradio","aria-checked":l,...a,ref:t,"data-state":Mx(l),onSelect:ve(a.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});rN.displayName=aN;var Ax="MenuItemIndicator",[lN,RO]=Dr(Ax,{checked:!1}),iN=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...r}=e,l=RO(Ax,n);return s.jsx(ds,{present:a||qu(l.checked)||l.checked===!0,children:s.jsx(Te.span,{...r,ref:t,"data-state":Mx(l.checked)})})});iN.displayName=Ax;var EO="MenuSeparator",oN=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Te.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});oN.displayName=EO;var TO="MenuArrow",cN=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=Bd(n);return s.jsx(kx,{...r,...a,ref:t})});cN.displayName=TO;var AO="MenuSub",[Y8,uN]=Dr(AO),Ri="MenuSubTrigger",dN=u.forwardRef((e,t)=>{const n=zr(Ri,e.__scopeMenu),a=Qo(Ri,e.__scopeMenu),r=uN(Ri,e.__scopeMenu),l=Rx(Ri,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=l,d={__scopeMenu:e.__scopeMenu},f=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>f,[f]),u.useEffect(()=>{const m=o.current;return()=>{window.clearTimeout(m),c(null)}},[o,c]),s.jsx(Sx,{asChild:!0,...d,children:s.jsx(eN,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":mN(n.open),...e,ref:Cd(t,r.onTriggerChange),onClick:m=>{var h;(h=e.onClick)==null||h.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ve(e.onPointerMove,xo(m=>{l.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(l.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:ve(e.onPointerLeave,xo(m=>{var x,j;f();const h=(x=n.content)==null?void 0:x.getBoundingClientRect();if(h){const v=(j=n.content)==null?void 0:j.dataset.side,y=v==="right",g=y?-5:5,p=h[y?"left":"right"],b=h[y?"right":"left"];l.onPointerGraceIntentChange({area:[{x:m.clientX+g,y:m.clientY},{x:p,y:h.top},{x:b,y:h.top},{x:b,y:h.bottom},{x:p,y:h.bottom}],side:v}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(m),m.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:ve(e.onKeyDown,m=>{var x;const h=l.searchRef.current!=="";e.disabled||h&&m.key===" "||dO[a.dir].includes(m.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),m.preventDefault())})})})});dN.displayName=Ri;var fN="MenuSubContent",hN=u.forwardRef((e,t)=>{const n=Q_(ss,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,l=zr(ss,e.__scopeMenu),i=Qo(ss,e.__scopeMenu),o=uN(fN,e.__scopeMenu),c=u.useRef(null),d=Qe(t,c);return s.jsx(po.Provider,{scope:e.__scopeMenu,children:s.jsx(ds,{present:a||l.open,children:s.jsx(po.Slot,{scope:e.__scopeMenu,children:s.jsx(Ex,{id:o.contentId,"aria-labelledby":o.triggerId,...r,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var m;i.isUsingKeyboardRef.current&&((m=c.current)==null||m.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ve(e.onFocusOutside,f=>{f.target!==o.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:ve(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:ve(e.onKeyDown,f=>{var x;const m=f.currentTarget.contains(f.target),h=fO[i.dir].includes(f.key);m&&h&&(l.onOpenChange(!1),(x=o.trigger)==null||x.focus(),f.preventDefault())})})})})})});hN.displayName=fN;function mN(e){return e?"open":"closed"}function qu(e){return e==="indeterminate"}function Mx(e){return qu(e)?"indeterminate":e?"checked":"unchecked"}function MO(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $O(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function OO(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let i=$O(e,Math.max(l,0));r.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function DO(e,t){const{x:n,y:a}=e;let r=!1;for(let l=0,i=t.length-1;l<t.length;i=l++){const o=t[l],c=t[i],d=o.x,f=o.y,m=c.x,h=c.y;f>a!=h>a&&n<(m-d)*(a-f)/(h-f)+d&&(r=!r)}return r}function zO(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return DO(n,t)}function xo(e){return t=>t.pointerType==="mouse"?e(t):void 0}var LO=X_,UO=Sx,BO=W_,HO=Z_,IO=Tx,PO=J_,qO=Hd,GO=tN,VO=sN,YO=rN,FO=iN,KO=oN,XO=cN,QO=dN,WO=hN,Id="DropdownMenu",[ZO]=qs(Id,[F_]),hn=F_(),[JO,pN]=ZO(Id),xN=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:r,defaultOpen:l,onOpenChange:i,modal:o=!0}=e,c=hn(t),d=u.useRef(null),[f,m]=Ya({prop:r,defaultProp:l??!1,onChange:i,caller:Id});return s.jsx(JO,{scope:t,triggerId:vs(),triggerRef:d,contentId:vs(),open:f,onOpenChange:m,onOpenToggle:u.useCallback(()=>m(h=>!h),[m]),modal:o,children:s.jsx(LO,{...c,open:f,onOpenChange:m,dir:a,modal:o,children:n})})};xN.displayName=Id;var gN="DropdownMenuTrigger",vN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=e,l=pN(gN,n),i=hn(n);return s.jsx(UO,{asChild:!0,...i,children:s.jsx(Te.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...r,ref:Cd(t,l.triggerRef),onPointerDown:ve(e.onPointerDown,o=>{!a&&o.button===0&&o.ctrlKey===!1&&(l.onOpenToggle(),l.open||o.preventDefault())}),onKeyDown:ve(e.onKeyDown,o=>{a||(["Enter"," "].includes(o.key)&&l.onOpenToggle(),o.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});vN.displayName=gN;var e4="DropdownMenuPortal",yN=e=>{const{__scopeDropdownMenu:t,...n}=e,a=hn(t);return s.jsx(BO,{...a,...n})};yN.displayName=e4;var jN="DropdownMenuContent",bN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=pN(jN,n),l=hn(n),i=u.useRef(!1);return s.jsx(HO,{id:r.contentId,"aria-labelledby":r.triggerId,...l,...a,ref:t,onCloseAutoFocus:ve(e.onCloseAutoFocus,o=>{var c;i.current||(c=r.triggerRef.current)==null||c.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:ve(e.onInteractOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bN.displayName=jN;var t4="DropdownMenuGroup",n4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(IO,{...r,...a,ref:t})});n4.displayName=t4;var s4="DropdownMenuLabel",wN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(PO,{...r,...a,ref:t})});wN.displayName=s4;var a4="DropdownMenuItem",_N=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(qO,{...r,...a,ref:t})});_N.displayName=a4;var r4="DropdownMenuCheckboxItem",NN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(GO,{...r,...a,ref:t})});NN.displayName=r4;var l4="DropdownMenuRadioGroup",i4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(VO,{...r,...a,ref:t})});i4.displayName=l4;var o4="DropdownMenuRadioItem",kN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(YO,{...r,...a,ref:t})});kN.displayName=o4;var c4="DropdownMenuItemIndicator",SN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(FO,{...r,...a,ref:t})});SN.displayName=c4;var u4="DropdownMenuSeparator",CN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(KO,{...r,...a,ref:t})});CN.displayName=u4;var d4="DropdownMenuArrow",f4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(XO,{...r,...a,ref:t})});f4.displayName=d4;var h4="DropdownMenuSubTrigger",RN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(QO,{...r,...a,ref:t})});RN.displayName=h4;var m4="DropdownMenuSubContent",EN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=hn(n);return s.jsx(WO,{...r,...a,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});EN.displayName=m4;var p4=xN,x4=vN,g4=yN,TN=bN,AN=wN,MN=_N,$N=NN,ON=kN,DN=SN,zN=CN,LN=RN,UN=EN;const Pd=p4,qd=x4,v4=u.forwardRef(({className:e,inset:t,children:n,...a},r)=>s.jsxs(LN,{ref:r,className:ie("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[n,s.jsx(bd,{className:"ml-auto"})]}));v4.displayName=LN.displayName;const y4=u.forwardRef(({className:e,...t},n)=>s.jsx(UN,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));y4.displayName=UN.displayName;const Wo=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>s.jsx(g4,{container:Yo(),children:s.jsx(TN,{ref:a,sideOffset:t,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Wo.displayName=TN.displayName;const Ll=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(MN,{ref:a,className:ie("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));Ll.displayName=MN.displayName;const j4=u.forwardRef(({className:e,children:t,checked:n,...a},r)=>s.jsxs($N,{ref:r,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...a,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(DN,{children:s.jsx($r,{className:"h-4 w-4"})})}),t]}));j4.displayName=$N.displayName;const b4=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(ON,{ref:a,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(DN,{children:s.jsx(JR,{className:"h-2 w-2 fill-current"})})}),t]}));b4.displayName=ON.displayName;const w4=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(AN,{ref:a,className:ie("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));w4.displayName=AN.displayName;const _4=u.forwardRef(({className:e,...t},n)=>s.jsx(zN,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));_4.displayName=zN.displayName;const N4={default:"h-9 px-3 py-1 text-sm",control:"h-7 px-2 py-1 text-xs"},Et=u.forwardRef(({className:e,type:t,inputSize:n="default",...a},r)=>s.jsx("input",{type:t,className:ie("flex w-full rounded-md border border-input bg-transparent shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-disabled-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 read-only:cursor-default read-only:bg-muted read-only:text-muted-foreground read-only:border-dashed",N4[n],e),ref:r,...a}));Et.displayName="Input";var k4="Label",BN=u.forwardRef((e,t)=>s.jsx(Te.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));BN.displayName=k4;var HN=BN;const S4=qo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ze=u.forwardRef(({className:e,...t},n)=>s.jsx(HN,{ref:n,className:ie(S4(),e),...t}));ze.displayName=HN.displayName;function Wa({title:e,description:t,backHref:n,backLabel:a,className:r,icon:l,link:i}){const o=s.jsx(q,{asChild:!0,variant:"outline",size:"sm",className:"mt-4 no-underline",children:s.jsx(i,{href:n,children:a})});return l?s.jsx("div",{className:ie("flex-1 px-4 py-8 sm:px-6 lg:px-8",r),children:s.jsxs("section",{className:"mx-auto flex max-w-xl flex-col items-center text-center","data-testid":"not-found-state",children:[s.jsx("div",{className:"text-foreground mb-2 [&_svg]:size-8",children:l}),s.jsx("h1",{className:"m-0 text-xl font-semibold tracking-tight",children:e}),s.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),o]})}):s.jsx("div",{className:ie("flex-1 px-4 py-8 sm:px-6 lg:px-8",r),children:s.jsxs("section",{className:"border-border bg-card mx-auto max-w-xl rounded-xl border p-6",children:[s.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:e}),s.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),o]})})}function mn({title:e,description:t,actions:n,className:a,children:r,...l}){return s.jsxs("header",{"data-slot":"page-header",className:ie("flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",a),...l,children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("h1",{className:"text-foreground text-2xl font-semibold tracking-tight",children:e}),t?s.jsx("p",{className:"text-muted-foreground text-sm",children:t}):null,r]}),n?s.jsx("div",{"data-slot":"page-header-actions",className:"flex shrink-0 items-center gap-2",children:n}):null]})}function xt({as:e="div",className:t,...n}){return s.jsx(e,{className:ie("rounded-lg border",t),...n})}function hy(e,[t,n]){return Math.min(n,Math.max(t,e))}var IN=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),C4="VisuallyHidden",PN=u.forwardRef((e,t)=>s.jsx(Te.span,{...e,ref:t,style:{...IN,...e.style}}));PN.displayName=C4;var R4=PN,E4=[" ","Enter","ArrowUp","ArrowDown"],T4=[" ","Enter"],kr="Select",[Gd,Vd,A4]=fx(kr),[ti]=qs(kr,[A4,ei]),Yd=ei(),[M4,Za]=ti(kr),[$4,O4]=ti(kr),qN=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:r,onOpenChange:l,value:i,defaultValue:o,onValueChange:c,dir:d,name:f,autoComplete:m,disabled:h,required:x,form:j}=e,v=Yd(t),[y,g]=u.useState(null),[p,b]=u.useState(null),[w,N]=u.useState(!1),C=Od(d),[_,S]=Ya({prop:a,defaultProp:r??!1,onChange:l,caller:kr}),[D,O]=Ya({prop:i,defaultProp:o,onChange:c,caller:kr}),B=u.useRef(null),Y=y?j||!!y.closest("form"):!0,[H,M]=u.useState(new Set),A=Array.from(H).map(R=>R.props.value).join(";");return s.jsx(wx,{...v,children:s.jsxs(M4,{required:x,scope:t,trigger:y,onTriggerChange:g,valueNode:p,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:N,contentId:vs(),value:D,onValueChange:O,open:_,onOpenChange:S,dir:C,triggerPointerDownPosRef:B,disabled:h,children:[s.jsx(Gd.Provider,{scope:t,children:s.jsx($4,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(R=>{M(T=>new Set(T).add(R))},[]),onNativeOptionRemove:u.useCallback(R=>{M(T=>{const k=new Set(T);return k.delete(R),k})},[]),children:n})}),Y?s.jsxs(hk,{"aria-hidden":!0,required:x,tabIndex:-1,name:f,autoComplete:m,value:D,onChange:R=>O(R.target.value),disabled:h,form:j,children:[D===void 0?s.jsx("option",{value:""}):null,Array.from(H)]},A):null]})})};qN.displayName=kr;var GN="SelectTrigger",VN=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...r}=e,l=Yd(n),i=Za(GN,n),o=i.disabled||a,c=Qe(t,i.onTriggerChange),d=Vd(n),f=u.useRef("touch"),[m,h,x]=pk(v=>{const y=d().filter(b=>!b.disabled),g=y.find(b=>b.value===i.value),p=xk(y,v,g);p!==void 0&&i.onValueChange(p.value)}),j=v=>{o||(i.onOpenChange(!0),x()),v&&(i.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return s.jsx(_x,{asChild:!0,...l,children:s.jsx(Te.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:o,"data-disabled":o?"":void 0,"data-placeholder":mk(i.value)?"":void 0,...r,ref:c,onClick:ve(r.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&j(v)}),onPointerDown:ve(r.onPointerDown,v=>{f.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(j(v),v.preventDefault())}),onKeyDown:ve(r.onKeyDown,v=>{const y=m.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&h(v.key),!(y&&v.key===" ")&&E4.includes(v.key)&&(j(),v.preventDefault())})})})});VN.displayName=GN;var YN="SelectValue",FN=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,children:l,placeholder:i="",...o}=e,c=Za(YN,n),{onValueNodeHasChildrenChange:d}=c,f=l!==void 0,m=Qe(t,c.onValueNodeChange);return on(()=>{d(f)},[d,f]),s.jsx(Te.span,{...o,ref:m,style:{pointerEvents:"none"},children:mk(c.value)?s.jsx(s.Fragment,{children:i}):l})});FN.displayName=YN;var D4="SelectIcon",KN=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...r}=e;return s.jsx(Te.span,{"aria-hidden":!0,...r,ref:t,children:a||"▼"})});KN.displayName=D4;var z4="SelectPortal",XN=e=>s.jsx(Vo,{asChild:!0,...e});XN.displayName=z4;var Sr="SelectContent",QN=u.forwardRef((e,t)=>{const n=Za(Sr,e.__scopeSelect),[a,r]=u.useState();if(on(()=>{r(new DocumentFragment)},[]),!n.open){const l=a;return l?Hl.createPortal(s.jsx(WN,{scope:e.__scopeSelect,children:s.jsx(Gd.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),l):null}return s.jsx(ZN,{...e,ref:t})});QN.displayName=Sr;var fs=10,[WN,Ja]=ti(Sr),L4="SelectContentImpl",U4=wr("SelectContent.RemoveScroll"),ZN=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:l,onPointerDownOutside:i,side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:x,sticky:j,hideWhenDetached:v,avoidCollisions:y,...g}=e,p=Za(Sr,n),[b,w]=u.useState(null),[N,C]=u.useState(null),_=Qe(t,Z=>w(Z)),[S,D]=u.useState(null),[O,B]=u.useState(null),Y=Vd(n),[H,M]=u.useState(!1),A=u.useRef(!1);u.useEffect(()=>{if(b)return Zp(b)},[b]),Wp();const R=u.useCallback(Z=>{const[J,...re]=Y().map(ce=>ce.ref.current),[ee]=re.slice(-1),fe=document.activeElement;for(const ce of Z)if(ce===fe||(ce==null||ce.scrollIntoView({block:"nearest"}),ce===J&&N&&(N.scrollTop=0),ce===ee&&N&&(N.scrollTop=N.scrollHeight),ce==null||ce.focus(),document.activeElement!==fe))return},[Y,N]),T=u.useCallback(()=>R([S,b]),[R,S,b]);u.useEffect(()=>{H&&T()},[H,T]);const{onOpenChange:k,triggerPointerDownPosRef:$}=p;u.useEffect(()=>{if(b){let Z={x:0,y:0};const J=ee=>{var fe,ce;Z={x:Math.abs(Math.round(ee.pageX)-(((fe=$.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(ee.pageY)-(((ce=$.current)==null?void 0:ce.y)??0))}},re=ee=>{Z.x<=10&&Z.y<=10?ee.preventDefault():b.contains(ee.target)||k(!1),document.removeEventListener("pointermove",J),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",re,{capture:!0})}}},[b,k,$]),u.useEffect(()=>{const Z=()=>k(!1);return window.addEventListener("blur",Z),window.addEventListener("resize",Z),()=>{window.removeEventListener("blur",Z),window.removeEventListener("resize",Z)}},[k]);const[P,E]=pk(Z=>{const J=Y().filter(fe=>!fe.disabled),re=J.find(fe=>fe.ref.current===document.activeElement),ee=xk(J,Z,re);ee&&setTimeout(()=>ee.ref.current.focus())}),I=u.useCallback((Z,J,re)=>{const ee=!A.current&&!re;(p.value!==void 0&&p.value===J||ee)&&(D(Z),ee&&(A.current=!0))},[p.value]),F=u.useCallback(()=>b==null?void 0:b.focus(),[b]),Q=u.useCallback((Z,J,re)=>{const ee=!A.current&&!re;(p.value!==void 0&&p.value===J||ee)&&B(Z)},[p.value]),oe=a==="popper"?km:JN,ge=oe===km?{side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:m,collisionBoundary:h,collisionPadding:x,sticky:j,hideWhenDetached:v,avoidCollisions:y}:{};return s.jsx(WN,{scope:n,content:b,viewport:N,onViewportChange:C,itemRefCallback:I,selectedItem:S,onItemLeave:F,itemTextRefCallback:Q,focusSelectedItem:T,selectedItemText:O,position:a,isPositioned:H,searchRef:P,children:s.jsx(Td,{as:U4,allowPinchZoom:!0,children:s.jsx(Rd,{asChild:!0,trapped:p.open,onMountAutoFocus:Z=>{Z.preventDefault()},onUnmountAutoFocus:ve(r,Z=>{var J;(J=p.trigger)==null||J.focus({preventScroll:!0}),Z.preventDefault()}),children:s.jsx(Go,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:Z=>Z.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:s.jsx(oe,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:Z=>Z.preventDefault(),...g,...ge,onPlaced:()=>M(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ve(g.onKeyDown,Z=>{const J=Z.ctrlKey||Z.altKey||Z.metaKey;if(Z.key==="Tab"&&Z.preventDefault(),!J&&Z.key.length===1&&E(Z.key),["ArrowUp","ArrowDown","Home","End"].includes(Z.key)){let ee=Y().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(Z.key)&&(ee=ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(Z.key)){const fe=Z.target,ce=ee.indexOf(fe);ee=ee.slice(ce+1)}setTimeout(()=>R(ee)),Z.preventDefault()}})})})})})})});ZN.displayName=L4;var B4="SelectItemAlignedPosition",JN=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...r}=e,l=Za(Sr,n),i=Ja(Sr,n),[o,c]=u.useState(null),[d,f]=u.useState(null),m=Qe(t,_=>f(_)),h=Vd(n),x=u.useRef(!1),j=u.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:g,focusSelectedItem:p}=i,b=u.useCallback(()=>{if(l.trigger&&l.valueNode&&o&&d&&v&&y&&g){const _=l.trigger.getBoundingClientRect(),S=d.getBoundingClientRect(),D=l.valueNode.getBoundingClientRect(),O=g.getBoundingClientRect();if(l.dir!=="rtl"){const fe=O.left-S.left,ce=D.left-fe,Ee=_.left-ce,V=_.width+Ee,te=Math.max(V,S.width),le=window.innerWidth-fs,Pe=hy(ce,[fs,Math.max(fs,le-te)]);o.style.minWidth=V+"px",o.style.left=Pe+"px"}else{const fe=S.right-O.right,ce=window.innerWidth-D.right-fe,Ee=window.innerWidth-_.right-ce,V=_.width+Ee,te=Math.max(V,S.width),le=window.innerWidth-fs,Pe=hy(ce,[fs,Math.max(fs,le-te)]);o.style.minWidth=V+"px",o.style.right=Pe+"px"}const B=h(),Y=window.innerHeight-fs*2,H=v.scrollHeight,M=window.getComputedStyle(d),A=parseInt(M.borderTopWidth,10),R=parseInt(M.paddingTop,10),T=parseInt(M.borderBottomWidth,10),k=parseInt(M.paddingBottom,10),$=A+R+H+k+T,P=Math.min(y.offsetHeight*5,$),E=window.getComputedStyle(v),I=parseInt(E.paddingTop,10),F=parseInt(E.paddingBottom,10),Q=_.top+_.height/2-fs,oe=Y-Q,ge=y.offsetHeight/2,Z=y.offsetTop+ge,J=A+R+Z,re=$-J;if(J<=Q){const fe=B.length>0&&y===B[B.length-1].ref.current;o.style.bottom="0px";const ce=d.clientHeight-v.offsetTop-v.offsetHeight,Ee=Math.max(oe,ge+(fe?F:0)+ce+T),V=J+Ee;o.style.height=V+"px"}else{const fe=B.length>0&&y===B[0].ref.current;o.style.top="0px";const Ee=Math.max(Q,A+v.offsetTop+(fe?I:0)+ge)+re;o.style.height=Ee+"px",v.scrollTop=J-Q+v.offsetTop}o.style.margin=`${fs}px 0`,o.style.minHeight=P+"px",o.style.maxHeight=Y+"px",a==null||a(),requestAnimationFrame(()=>x.current=!0)}},[h,l.trigger,l.valueNode,o,d,v,y,g,l.dir,a]);on(()=>b(),[b]);const[w,N]=u.useState();on(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const C=u.useCallback(_=>{_&&j.current===!0&&(b(),p==null||p(),j.current=!1)},[b,p]);return s.jsx(I4,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:x,onScrollButtonChange:C,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:s.jsx(Te.div,{...r,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});JN.displayName=B4;var H4="SelectPopperPosition",km=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:r=fs,...l}=e,i=Yd(n);return s.jsx(Nx,{...i,...l,ref:t,align:a,collisionPadding:r,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});km.displayName=H4;var[I4,$x]=ti(Sr,{}),Sm="SelectViewport",ek=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...r}=e,l=Ja(Sm,n),i=$x(Sm,n),o=Qe(t,l.onViewportChange),c=u.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(Gd.Slot,{scope:n,children:s.jsx(Te.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:ve(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&m){const x=Math.abs(c.current-f.scrollTop);if(x>0){const j=window.innerHeight-fs*2,v=parseFloat(m.style.minHeight),y=parseFloat(m.style.height),g=Math.max(v,y);if(g<j){const p=g+x,b=Math.min(j,p),w=p-b;m.style.height=b+"px",m.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,m.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});ek.displayName=Sm;var tk="SelectGroup",[P4,q4]=ti(tk),G4=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=vs();return s.jsx(P4,{scope:n,id:r,children:s.jsx(Te.div,{role:"group","aria-labelledby":r,...a,ref:t})})});G4.displayName=tk;var nk="SelectLabel",sk=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=q4(nk,n);return s.jsx(Te.div,{id:r.id,...a,ref:t})});sk.displayName=nk;var Gu="SelectItem",[V4,ak]=ti(Gu),rk=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:r=!1,textValue:l,...i}=e,o=Za(Gu,n),c=Ja(Gu,n),d=o.value===a,[f,m]=u.useState(l??""),[h,x]=u.useState(!1),j=Qe(t,p=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,p,a,r)}),v=vs(),y=u.useRef("touch"),g=()=>{r||(o.onValueChange(a),o.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(V4,{scope:n,value:a,disabled:r,textId:v,isSelected:d,onItemTextChange:u.useCallback(p=>{m(b=>b||((p==null?void 0:p.textContent)??"").trim())},[]),children:s.jsx(Gd.ItemSlot,{scope:n,value:a,disabled:r,textValue:f,children:s.jsx(Te.div,{role:"option","aria-labelledby":v,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:j,onFocus:ve(i.onFocus,()=>x(!0)),onBlur:ve(i.onBlur,()=>x(!1)),onClick:ve(i.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:ve(i.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:ve(i.onPointerDown,p=>{y.current=p.pointerType}),onPointerMove:ve(i.onPointerMove,p=>{var b;y.current=p.pointerType,r?(b=c.onItemLeave)==null||b.call(c):y.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ve(i.onPointerLeave,p=>{var b;p.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:ve(i.onKeyDown,p=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&p.key===" "||(T4.includes(p.key)&&g(),p.key===" "&&p.preventDefault())})})})})});rk.displayName=Gu;var Ei="SelectItemText",lk=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,...l}=e,i=Za(Ei,n),o=Ja(Ei,n),c=ak(Ei,n),d=O4(Ei,n),[f,m]=u.useState(null),h=Qe(t,g=>m(g),c.onItemTextChange,g=>{var p;return(p=o.itemTextRefCallback)==null?void 0:p.call(o,g,c.value,c.disabled)}),x=f==null?void 0:f.textContent,j=u.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return on(()=>(v(j),()=>y(j)),[v,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(Te.span,{id:c.textId,...l,ref:h}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Hl.createPortal(l.children,i.valueNode):null]})});lk.displayName=Ei;var ik="SelectItemIndicator",ok=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return ak(ik,n).isSelected?s.jsx(Te.span,{"aria-hidden":!0,...a,ref:t}):null});ok.displayName=ik;var Cm="SelectScrollUpButton",ck=u.forwardRef((e,t)=>{const n=Ja(Cm,e.__scopeSelect),a=$x(Cm,e.__scopeSelect),[r,l]=u.useState(!1),i=Qe(t,a.onScrollButtonChange);return on(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollTop>0;l(d)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),r?s.jsx(dk,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});ck.displayName=Cm;var Rm="SelectScrollDownButton",uk=u.forwardRef((e,t)=>{const n=Ja(Rm,e.__scopeSelect),a=$x(Rm,e.__scopeSelect),[r,l]=u.useState(!1),i=Qe(t,a.onScrollButtonChange);return on(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;l(f)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),r?s.jsx(dk,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});uk.displayName=Rm;var dk=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...r}=e,l=Ja("SelectScrollButton",n),i=u.useRef(null),o=Vd(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),on(()=>{var f;const d=o().find(m=>m.ref.current===document.activeElement);(f=d==null?void 0:d.ref.current)==null||f.scrollIntoView({block:"nearest"})},[o]),s.jsx(Te.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:ve(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(a,50))}),onPointerMove:ve(r.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),i.current===null&&(i.current=window.setInterval(a,50))}),onPointerLeave:ve(r.onPointerLeave,()=>{c()})})}),Y4="SelectSeparator",fk=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return s.jsx(Te.div,{"aria-hidden":!0,...a,ref:t})});fk.displayName=Y4;var Em="SelectArrow",F4=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=Yd(n),l=Za(Em,n),i=Ja(Em,n);return l.open&&i.position==="popper"?s.jsx(kx,{...r,...a,ref:t}):null});F4.displayName=Em;var K4="SelectBubbleInput",hk=u.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const r=u.useRef(null),l=Qe(a,r),i=u_(t);return u.useEffect(()=>{const o=r.current;if(!o)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const m=new Event("change",{bubbles:!0});f.call(o,t),o.dispatchEvent(m)}},[i,t]),s.jsx(Te.select,{...n,style:{...IN,...n.style},ref:l,defaultValue:t})});hk.displayName=K4;function mk(e){return e===""||e===void 0}function pk(e){const t=Bs(e),n=u.useRef(""),a=u.useRef(0),r=u.useCallback(i=>{const o=n.current+i;t(o),function c(d){n.current=d,window.clearTimeout(a.current),d!==""&&(a.current=window.setTimeout(()=>c(""),1e3))}(o)},[t]),l=u.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,r,l]}function xk(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let i=X4(e,Math.max(l,0));r.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function X4(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var Q4=qN,gk=VN,W4=FN,Z4=KN,J4=XN,vk=QN,eD=ek,yk=sk,jk=rk,tD=lk,nD=ok,bk=ck,wk=uk,_k=fk;const sD={default:"h-9 px-3 py-2 text-sm",control:"h-7 px-2 py-1 text-xs"},wt=Q4,_t=W4,vt=u.forwardRef(({className:e,children:t,triggerSize:n="default",...a},r)=>s.jsxs(gk,{ref:r,className:ie("flex w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent shadow-sm ring-offset-background data-[placeholder]:text-disabled-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",sD[n],e),...a,children:[t,s.jsx(Z4,{asChild:!0,children:s.jsx(o0,{className:"text-muted-foreground size-4","aria-hidden":"true"})})]}));vt.displayName=gk.displayName;const Nk=u.forwardRef(({className:e,...t},n)=>s.jsx(bk,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(KR,{className:"size-4","aria-hidden":"true"})}));Nk.displayName=bk.displayName;const kk=u.forwardRef(({className:e,...t},n)=>s.jsx(wk,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Yp,{className:"size-4","aria-hidden":"true"})}));kk.displayName=wk.displayName;const yt=u.forwardRef(({className:e,children:t,position:n="popper",...a},r)=>s.jsx(J4,{container:Yo(),children:s.jsxs(vk,{ref:r,className:ie("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[s.jsx(Nk,{}),s.jsx(eD,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(kk,{})]})}));yt.displayName=vk.displayName;const aD=u.forwardRef(({className:e,...t},n)=>s.jsx(yk,{ref:n,className:ie("px-2 py-1.5 text-sm font-semibold",e),...t}));aD.displayName=yk.displayName;const Ae=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(jk,{ref:a,className:ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(nD,{children:s.jsx($r,{className:"size-4","aria-hidden":"true"})})}),s.jsx(tD,{children:t})]}));Ae.displayName=jk.displayName;const rD=u.forwardRef(({className:e,...t},n)=>s.jsx(_k,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));rD.displayName=_k.displayName;function Rt({className:e,...t}){return s.jsx("div",{className:ie("animate-pulse rounded-md bg-primary/10",e),...t})}const Ke=u.forwardRef(({className:e,containerClassName:t,containerRef:n,containerTabIndex:a,containerAriaLabel:r,...l},i)=>s.jsx("div",{ref:n,tabIndex:a,"aria-label":r,className:ie("relative w-full overflow-auto",t),children:s.jsx("table",{ref:i,className:ie("w-full caption-bottom text-sm",e),...l})}));Ke.displayName="Table";const nt=u.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:ie("[&_tr]:border-b",e),...t}));nt.displayName="TableHeader";const Xe=u.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:ie("[&_tr:last-child]:border-0",e),...t}));Xe.displayName="TableBody";const lD=u.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:ie("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));lD.displayName="TableFooter";const he=u.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:ie("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));he.displayName="TableRow";const X=u.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:ie("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));X.displayName="TableHead";const K=u.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:ie("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));K.displayName="TableCell";const iD=u.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:ie("text-muted-foreground mt-4 text-sm",e),...t}));iD.displayName="TableCaption";var Fd="Tabs",[oD]=qs(Fd,[Ud]),Sk=Ud(),[cD,Ox]=oD(Fd),Ck=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:r,defaultValue:l,orientation:i="horizontal",dir:o,activationMode:c="automatic",...d}=e,f=Od(o),[m,h]=Ya({prop:a,onChange:r,defaultProp:l??"",caller:Fd});return s.jsx(cD,{scope:n,baseId:vs(),value:m,onValueChange:h,orientation:i,dir:f,activationMode:c,children:s.jsx(Te.div,{dir:f,"data-orientation":i,...d,ref:t})})});Ck.displayName=Fd;var Rk="TabsList",Ek=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...r}=e,l=Ox(Rk,n),i=Sk(n);return s.jsx(G_,{asChild:!0,...i,orientation:l.orientation,dir:l.dir,loop:a,children:s.jsx(Te.div,{role:"tablist","aria-orientation":l.orientation,...r,ref:t})})});Ek.displayName=Rk;var Tk="TabsTrigger",Ak=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:r=!1,...l}=e,i=Ox(Tk,n),o=Sk(n),c=Ok(i.baseId,a),d=Dk(i.baseId,a),f=a===i.value;return s.jsx(V_,{asChild:!0,...o,focusable:!r,active:f,children:s.jsx(Te.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...l,ref:t,onMouseDown:ve(e.onMouseDown,m=>{!r&&m.button===0&&m.ctrlKey===!1?i.onValueChange(a):m.preventDefault()}),onKeyDown:ve(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&i.onValueChange(a)}),onFocus:ve(e.onFocus,()=>{const m=i.activationMode!=="manual";!f&&!r&&m&&i.onValueChange(a)})})})});Ak.displayName=Tk;var Mk="TabsContent",$k=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:r,children:l,...i}=e,o=Ox(Mk,n),c=Ok(o.baseId,a),d=Dk(o.baseId,a),f=a===o.value,m=u.useRef(f);return u.useEffect(()=>{const h=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(h)},[]),s.jsx(ds,{present:r||f,children:({present:h})=>s.jsx(Te.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:h&&l})})});$k.displayName=Mk;function Ok(e,t){return`${e}-trigger-${t}`}function Dk(e,t){return`${e}-content-${t}`}var uD=Ck,zk=Ek,Lk=Ak,Uk=$k;const dD=uD,Bk=u.forwardRef(({className:e,...t},n)=>s.jsx(zk,{ref:n,className:ie("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));Bk.displayName=zk.displayName;const Tm=u.forwardRef(({className:e,...t},n)=>s.jsx(Lk,{ref:n,className:ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));Tm.displayName=Lk.displayName;const fD=u.forwardRef(({className:e,...t},n)=>s.jsx(Uk,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));fD.displayName=Uk.displayName;const Fn=u.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:ie("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-disabled-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 read-only:cursor-default read-only:bg-muted read-only:text-muted-foreground read-only:border-dashed",e),ref:n,...t}));Fn.displayName="Textarea";var[Kd]=qs("Tooltip",[ei]),Xd=ei(),Hk="TooltipProvider",hD=700,Am="tooltip.open",[mD,Dx]=Kd(Hk),Ik=e=>{const{__scopeTooltip:t,delayDuration:n=hD,skipDelayDuration:a=300,disableHoverableContent:r=!1,children:l}=e,i=u.useRef(!0),o=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(mD,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,a)},[a]),isPointerInTransitRef:o,onPointerInTransitChange:u.useCallback(d=>{o.current=d},[]),disableHoverableContent:r,children:l})};Ik.displayName=Hk;var go="Tooltip",[pD,Zo]=Kd(go),Pk=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:r,onOpenChange:l,disableHoverableContent:i,delayDuration:o}=e,c=Dx(go,e.__scopeTooltip),d=Xd(t),[f,m]=u.useState(null),h=vs(),x=u.useRef(0),j=i??c.disableHoverableContent,v=o??c.delayDuration,y=u.useRef(!1),[g,p]=Ya({prop:a,defaultProp:r??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(Am))):c.onClose(),l==null||l(_)},caller:go}),b=u.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),w=u.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y.current=!1,p(!0)},[p]),N=u.useCallback(()=>{window.clearTimeout(x.current),x.current=0,p(!1)},[p]),C=u.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{y.current=!0,p(!0),x.current=0},v)},[v,p]);return u.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),s.jsx(wx,{...d,children:s.jsx(pD,{scope:t,contentId:h,open:g,stateAttribute:b,trigger:f,onTriggerChange:m,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?C():w()},[c.isOpenDelayedRef,C,w]),onTriggerLeave:u.useCallback(()=>{j?N():(window.clearTimeout(x.current),x.current=0)},[N,j]),onOpen:w,onClose:N,disableHoverableContent:j,children:n})})};Pk.displayName=go;var Mm="TooltipTrigger",qk=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=Zo(Mm,n),l=Dx(Mm,n),i=Xd(n),o=u.useRef(null),c=Qe(t,o,r.onTriggerChange),d=u.useRef(!1),f=u.useRef(!1),m=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),s.jsx(_x,{asChild:!0,...i,children:s.jsx(Te.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...a,ref:c,onPointerMove:ve(e.onPointerMove,h=>{h.pointerType!=="touch"&&!f.current&&!l.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:ve(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:ve(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ve(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:ve(e.onBlur,r.onClose),onClick:ve(e.onClick,r.onClose)})})});qk.displayName=Mm;var zx="TooltipPortal",[xD,gD]=Kd(zx,{forceMount:void 0}),Gk=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:r}=e,l=Zo(zx,t);return s.jsx(xD,{scope:t,forceMount:n,children:s.jsx(ds,{present:n||l.open,children:s.jsx(Vo,{asChild:!0,container:r,children:a})})})};Gk.displayName=zx;var Ul="TooltipContent",Vk=u.forwardRef((e,t)=>{const n=gD(Ul,e.__scopeTooltip),{forceMount:a=n.forceMount,side:r="top",...l}=e,i=Zo(Ul,e.__scopeTooltip);return s.jsx(ds,{present:a||i.open,children:i.disableHoverableContent?s.jsx(Yk,{side:r,...l,ref:t}):s.jsx(vD,{side:r,...l,ref:t})})}),vD=u.forwardRef((e,t)=>{const n=Zo(Ul,e.__scopeTooltip),a=Dx(Ul,e.__scopeTooltip),r=u.useRef(null),l=Qe(t,r),[i,o]=u.useState(null),{trigger:c,onClose:d}=n,f=r.current,{onPointerInTransitChange:m}=a,h=u.useCallback(()=>{o(null),m(!1)},[m]),x=u.useCallback((j,v)=>{const y=j.currentTarget,g={x:j.clientX,y:j.clientY},p=_D(g,y.getBoundingClientRect()),b=ND(g,p),w=kD(v.getBoundingClientRect()),N=CD([...b,...w]);o(N),m(!0)},[m]);return u.useEffect(()=>()=>h(),[h]),u.useEffect(()=>{if(c&&f){const j=y=>x(y,f),v=y=>x(y,c);return c.addEventListener("pointerleave",j),f.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",j),f.removeEventListener("pointerleave",v)}}},[c,f,x,h]),u.useEffect(()=>{if(i){const j=v=>{const y=v.target,g={x:v.clientX,y:v.clientY},p=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),b=!SD(g,i);p?h():b&&(h(),d())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[c,f,i,d,h]),s.jsx(Yk,{...e,ref:l})}),[yD,jD]=Kd(go,{isInside:!1}),bD=hA("TooltipContent"),Yk=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":r,onEscapeKeyDown:l,onPointerDownOutside:i,...o}=e,c=Zo(Ul,n),d=Xd(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Am,f),()=>document.removeEventListener(Am,f)),[f]),u.useEffect(()=>{if(c.trigger){const m=h=>{const x=h.target;x!=null&&x.contains(c.trigger)&&f()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[c.trigger,f]),s.jsx(Go,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:m=>m.preventDefault(),onDismiss:f,children:s.jsxs(Nx,{"data-state":c.stateAttribute,...d,...o,ref:t,style:{...o.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(bD,{children:a}),s.jsx(yD,{scope:n,isInside:!0,children:s.jsx(R4,{id:c.contentId,role:"tooltip",children:r||a})})]})})});Vk.displayName=Ul;var Fk="TooltipArrow",wD=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=Xd(n);return jD(Fk,n).isInside?null:s.jsx(kx,{...r,...a,ref:t})});wD.displayName=Fk;function _D(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,a,r,l)){case l:return"left";case r:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function ND(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function kD(e){const{top:t,right:n,bottom:a,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:a},{x:r,y:a}]}function SD(e,t){const{x:n,y:a}=e;let r=!1;for(let l=0,i=t.length-1;l<t.length;i=l++){const o=t[l],c=t[i],d=o.x,f=o.y,m=c.x,h=c.y;f>a!=h>a&&n<(m-d)*(a-f)/(h-f)+d&&(r=!r)}return r}function CD(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),RD(t)}function RD(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const r=e[a];for(;t.length>=2;){const l=t[t.length-1],i=t[t.length-2];if((l.x-i.x)*(r.y-i.y)>=(l.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const r=e[a];for(;n.length>=2;){const l=n[n.length-1],i=n[n.length-2];if((l.x-i.x)*(r.y-i.y)>=(l.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var ED=Ik,TD=Pk,AD=qk,MD=Gk,Kk=Vk;const Lx=ED,Ux=TD,Bx=AD,Qd=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>{const r=Yo(),l=s.jsx(Kk,{ref:a,sideOffset:t,className:ie("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n});return r?s.jsx(MD,{container:r,children:l}):l});Qd.displayName=Kk.displayName;function ha({page:e,header:t}){return s.jsxs(s.Fragment,{children:[t??s.jsx(mn,{title:e}),s.jsx($D,{page:e})]})}function $D({page:e}){return s.jsxs(me,{variant:"info",role:"status",className:"mt-6","data-testid":"not-installed",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:p0(e)})]})}const OD=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,my="Opening. If macOS asks whether sdlc viewer may control Terminal, allow it.";function Hx(e,t){return`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(t)}`}const py=/^iss-\d{1,9}$/;function DD(e,t,n=null){if(e.kind==="open"||e.kind==="card")return null;if(n!==null)return py.test(n)?`claude "$(sdlc view --issue ${n} --prompt)"`:null;const a=e.kind==="start"?e.task??t:t;return a&&OD.test(a)?`claude "$(sdlc view --task ${a} --prompt)"`:e.kind==="start"&&py.test(e.issue)?`claude "$(sdlc view --issue ${e.issue} --prompt)"`:null}function Wd({org:e,action:t,task_id:n,issue:a=null,open_thread:r,labelled:l=!1}){const{href:i,Link:o}=Ze(),{confirm:c,confirm_dialog:d}=Ql(),f=us(),[m,h]=u.useState(!1),[x,j]=u.useState(!1),[v,y]=u.useState(null),g=u.useId(),p=`${n??""}
|
|
394
|
+
${a??""}
|
|
395
|
+
${(t==null?void 0:t.kind)??""}
|
|
396
|
+
${t&&"thread"in t?t.thread:""}`,[b,w]=u.useState(p),N=u.useRef(p);if(N.current=p,b!==p&&(w(p),h(!1),j(!1),y(null)),u.useEffect(()=>{if(!v)return;const B=()=>y(null);return document.addEventListener("pointerdown",B,!0),document.addEventListener("click",B,!0),()=>{document.removeEventListener("pointerdown",B,!0),document.removeEventListener("click",B,!0)}},[v]),!t)return{button:null,panel:null};const C=DD(t,n,a);if(t.kind==="open"||t.kind==="card"){const B=t.title,Y=l?s.jsxs(s.Fragment,{children:[s.jsx(Ou,{className:"mr-2 size-4","aria-hidden":"true"}),"Open thread"]}):s.jsx(Ou,{className:"size-4","aria-hidden":"true"}),H=l?"default":"icon";if(t.kind==="card"||!r)return{button:s.jsx(xy,{text:`Open thread: ${B}`,children:s.jsx("span",{className:"inline-flex",children:s.jsx(q,{asChild:!0,variant:"outline",size:H,children:s.jsx(o,{href:i(Hx(e,t.thread)),"aria-label":`Open thread: ${B}`,children:Y})})})}),panel:null};const M=async()=>{if(x)return;const R=p,T=()=>N.current===R;y(null),j(!0);const k=await r(t.thread,async $=>{j(!1);const P=await c({title:`Reopen ${B} in Terminal?`,description:`Its session is closed. It opens in a new Terminal window in ${$??"the thread's folder"}, running claude --resume.`,action_label:"Reopen"});return P&&T()&&j(!0),P});T()&&(j(!1),"note"in k&&y(k.note))},A=x?my:(v==null?void 0:v.role)==="muted"?Xk(v,f):"";return{button:s.jsxs(s.Fragment,{children:[s.jsx(xy,{text:`Open thread: ${B}`,children:s.jsx(q,{type:"button",variant:"outline",size:H,"aria-label":`Open thread: ${B}`,"aria-busy":x||void 0,"aria-disabled":x||void 0,onClick:()=>void M(),children:Y})}),s.jsx("span",{role:"status",className:"sr-only",children:A}),d]}),panel:x?s.jsxs(me,{variant:"info",role:"presentation",className:"mt-2",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{className:"text-current",children:my})]}):v?s.jsx(zD,{note:v,outdated_step:f}):null}}if(!C)return{button:null,panel:null};const _=t.kind==="continue"?"Continue":"Start a thread",S=t.kind==="continue"?`Continue ${t.title}`:t.kind==="start"?`Start a thread for ${t.issue}`:_,D=t.kind==="continue"?`Run in a terminal to continue ${t.title}:`:t.kind==="start"?`Run in a terminal to start a thread for ${t.issue}:`:"Run in a terminal in this checkout:",O=t.kind==="start"?jr:PE;return{button:s.jsxs(q,{type:"button",variant:"outline",size:l?"default":"sm","aria-label":S,"aria-expanded":m,"aria-controls":m?g:void 0,onClick:()=>h(B=>!B),children:[s.jsx(O,{className:"mr-2 size-4","aria-hidden":"true"}),_]}),panel:m?s.jsx(LD,{id:g,lead:D,command:C}):null}}function xy({text:e,children:t}){return s.jsx(Lx,{children:s.jsxs(Ux,{children:[s.jsx(Bx,{asChild:!0,children:t}),s.jsx(Qd,{children:e})]})})}function Xk(e,t){return e.outdated?`${e.text} ${t}`:e.text}function zD({note:e,outdated_step:t}){const n=Xk(e,t);return e.role==="muted"?s.jsxs(me,{variant:"default",role:"presentation",className:"mt-2",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:n})]}):e.role==="you"?s.jsxs(me,{variant:"warning",className:"mt-2",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{className:"text-current",children:n})]}):s.jsxs(me,{variant:"destructive",className:"mt-2",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{className:"text-current",children:n})]})}function LD({id:e,lead:t,command:n}){return s.jsxs("div",{id:e,className:"mt-2 grid max-w-full gap-1 text-left",children:[s.jsx("span",{className:"text-muted-foreground text-sm",children:t}),s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("pre",{className:"bg-muted min-w-0 flex-1 overflow-x-auto rounded-md border px-2 py-1 text-sm whitespace-pre",children:s.jsx("code",{className:"font-mono",children:n})}),s.jsx($m,{text:n,label:"Copy",aria_label:"Copy the command",what:"the command"})]})]})}function $m({text:e,label:t,aria_label:n,what:a,variant:r="outline",size:l="sm"}){const[i,o]=u.useState("idle");u.useEffect(()=>{if(i!=="copied")return;const d=()=>o("idle");return document.addEventListener("pointerdown",d,!0),document.addEventListener("keydown",d,!0),()=>{document.removeEventListener("pointerdown",d,!0),document.removeEventListener("keydown",d,!0)}},[i]);const c=async()=>{try{await navigator.clipboard.writeText(e),o("copied")}catch{o("failed")}};return s.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:[s.jsxs(q,{type:"button",variant:r,size:l,"aria-label":i==="copied"?void 0:n,onClick:()=>void c(),children:[i==="copied"?s.jsx($r,{className:"mr-2 size-4","aria-hidden":"true"}):s.jsx(c0,{className:"mr-2 size-4","aria-hidden":"true"}),i==="copied"?"Copied":t]}),s.jsxs("span",{role:"status","aria-live":"polite",className:"text-muted-foreground text-xs",children:[i==="failed"?`Copy failed: select ${a}`:null,i==="copied"?s.jsxs("span",{className:"sr-only",children:["Copied ",a]}):null]})]})}const gy=["none","read","comment","write","manage","admin"];function Vu(e,t){return gy.indexOf(e??"none")>=gy.indexOf(t)}function Ix(e){return e==="api_key"?"API key":e==="sdlc_login"?"sdlc login":null}function ah(e,t){const n=Ix(e);return e==="sdlc_login"&&t?`${n} on ${Qk(t)}`:n}const UD=String.fromCodePoint(8296),BD=String.fromCodePoint(8297);function Qk(e){return`${UD}${e}${BD}`}const vo={blocked:{label:"Blocked",tone:"warning"},waiting_for_user:{label:"Waiting for a member",tone:"warning"},waiting_for_external:{label:"Waiting outside",tone:"warning"},paused:{label:"Paused",tone:"neutral"}},HD={backlog:"neutral",planned:"neutral",in_progress:"info",completed:"success",canceled:"neutral"};function Wk(e){return e.name==="Blocked"?"warning":HD[e.category]}const vy=1800;function _s(e){return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function as(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function Px(e){return`${rs(e)}, ${as(e)}`}function ji(e){return e<90?`${Math.round(e)} s`:e<5400?`${Math.round(e/60)} min`:`${(e/3600).toFixed(1).replace(/\.0$/,"")} h`}function rs(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Zk(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function ID(e){if(e.open_holds===0)return null;if(e.released_holds===e.open_holds)return{label:`${e.released_holds} ready to resolve`,tone:"neutral"};const t=e.open_holds-e.released_holds;return{label:e.released_holds>0?`${t} open · ${e.released_holds} ready`:`${t} open`,tone:"warning"}}function PD(e){return{"task.created":"Created the task","task.title_changed":"Changed the title","task.description_changed":"Changed the description","task.status_changed":"Changed the status","task.priority_changed":"Changed the priority","task.primary_changed":"Changed the primary","task.custom_fields_changed":"Changed a field","task.archived":"Archived the task","task.restored":"Restored the task","task.reordered":"Moved the task","task.reparented":"Moved the task under another","task.contributor_added":"Added a contributor","task.contributor_removed":"Removed a contributor","task.checklist_item_added":"Added a checklist item","task.checklist_item_edited":"Edited a checklist item","task.checklist_item_toggled":"Checked off a checklist item","task.checklist_item_moved":"Moved a checklist item","task.checklist_item_archived":"Removed a checklist item","task.hold_opened":"Opened a hold","task.hold_released":"Released a hold","task.hold_resolved":"Resolved a hold","task.claimed":"Claimed the task","task.claim_released":"Released a claim","task.claim_completed":"Finished a claim","task.claim_expired":"Ended a lapsed claim","task.relation_added":"Linked a task","task.relation_archived":"Unlinked a task","task.project_linked":"Linked a project","task.project_unlinked":"Unlinked a project"}[e.event_type]??"Changed the task"}const va="not_set";function qD({open:e,commands:t,list_id:n,list_revision:a,default_status_id:r,statuses:l,priorities:i,members:o,on_close:c,on_created:d}){var Y;const f=Mr(),[m,h]=u.useState(""),[x,j]=u.useState(""),[v,y]=u.useState(r??((Y=l[0])==null?void 0:Y.id)??""),[g,p]=u.useState(va),[b,w]=u.useState(va),[N,C]=u.useState(!1),[_,S]=u.useState(null),[D,O]=u.useState(!1);u.useEffect(()=>{var H;e&&(h(""),j(""),y(r??((H=l[0])==null?void 0:H.id)??""),p(va),w(va),C(!1),S(null))},[e,r,l]);const B=async H=>{if(H.preventDefault(),!m.trim()){C(!0);return}O(!0),S(null);try{const M=await t.run("create_task",{list_id:n,expected_list_revision:a,title:m.trim(),description:x.trim()||null,status_id:v||null,priority_id:g===va?null:g,primary_user_id:b===va?null:b});if(!M.ok){S(M.refusal.message);return}f.success("Task created."),await d()}finally{O(!1)}};return s.jsx(kn,{open:e,onOpenChange:H=>H?null:c(),children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:H=>void B(H),noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"New task"}),s.jsx(Tn,{children:"Add a task to this List."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[_&&s.jsxs(me,{variant:"destructive",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:_})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"new-task-title",children:"Title"}),s.jsx(Et,{id:"new-task-title",placeholder:"What needs doing",value:m,required:!0,"aria-invalid":N,"aria-describedby":N?"new-task-title-error":void 0,onChange:H=>{h(H.target.value),C(!1)}}),N&&s.jsx("p",{id:"new-task-title-error",className:"text-destructive text-xs",children:"Give the task a title."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"new-task-description",children:"Description (optional)"}),s.jsx(Fn,{id:"new-task-description",rows:4,value:x,onChange:H=>j(H.target.value)})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"new-task-status",children:"Status"}),s.jsxs(wt,{value:v,onValueChange:y,children:[s.jsx(vt,{id:"new-task-status",children:s.jsx(_t,{})}),s.jsx(yt,{children:l.map(H=>s.jsx(Ae,{value:H.id,children:H.name},H.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"new-task-priority",children:"Priority"}),s.jsxs(wt,{value:g,onValueChange:p,children:[s.jsx(vt,{id:"new-task-priority",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:va,children:"Not set"}),i.map(H=>s.jsx(Ae,{value:H.id,children:H.name},H.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"new-task-primary",children:"Primary"}),s.jsxs(wt,{value:b,onValueChange:w,children:[s.jsx(vt,{id:"new-task-primary",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:va,children:"Not set"}),o.map(H=>s.jsx(Ae,{value:H.user_id,children:H.label},H.user_id))]})]})]})]})]}),s.jsxs(Rn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),s.jsx(q,{type:"submit",disabled:D,children:D?"Creating…":"Create task"})]})]})})})}const GD="Your organization's work, in queue order. Claim a task to show you are working on it.",Ti="any",Jk="none",VD=1,YD=250;function qx(){const e=Nn().tasks;if(!e)throw new Error("The Tasks page rendered without the tasks seam.");return e}function FD({org:e}){var j,v;const t=qx(),{href:n,Link:a}=Ze(),[r,l]=u.useState({state:"loading"}),[i,o]=u.useState([]),[c,d]=u.useState(null),f=u.useRef(0),m=u.useCallback(async y=>{const g=f.current+=1;y&&l({state:"loading"});const p=await t.availability({fresh:y});g===f.current&&l(p)},[t.availability]);u.useEffect(()=>{m(!1)},[m]);const h=u.useCallback(()=>void m(!0),[m]);if(u.useEffect(()=>{let y=!0;return t.members().then(g=>{y&&g.ok&&o(g.data)}),()=>{y=!1}},[t.members]),u.useEffect(()=>{if(!t.access)return;let y=!0;return t.access().then(g=>{y&&g.ok&&d(g.data)}),()=>{y=!1}},[t.access]),r.state==="off"&&((j=r.refusal)==null?void 0:j.reason)!=="engine_missing")return s.jsx(Wa,{title:"Page not found",description:"This page does not exist, or you do not have access to it.",backHref:n(`/org/${e}`),backLabel:"Back to the organization",link:a});const x=(c==null?void 0:c.read_only_reason)??GD;return s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:r.state==="active"?s.jsx(XD,{active:r,org:e,members:i,description:x,read_only_reason:c==null?void 0:c.read_only_reason,reload_configuration:h}):r.state==="off"&&((v=r.refusal)==null?void 0:v.reason)==="engine_missing"?s.jsx(ha,{page:"Tasks"}):s.jsxs(s.Fragment,{children:[s.jsx(mn,{title:"Tasks",description:x}),r.state==="loading"&&s.jsx(e1,{}),(r.state==="error"||r.state==="off")&&s.jsx(t1,{refusal:r.refusal,on_retry:h}),r.state==="available"&&s.jsx(KD,{on_done:h})]})})}function e1(){return s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading tasks",children:Array.from({length:6},(e,t)=>s.jsx(Rt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function t1({refusal:e,on_retry:t}){const n=us();return(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(me,{variant:"warning",className:"mt-6",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:Fl}),s.jsx(xe,{children:n})]}):s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Tasks could not be loaded"}),s.jsxs(xe,{children:[s.jsx("p",{children:e!=null&&e.reason?e.message:"Check your connection and try again."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function KD({on_done:e}){const{commands:t}=qx(),n=Mr(),[a,r]=u.useState(!1),l=t==null?void 0:t.activate,i=async()=>{if(!l)return;r(!0);const o=await l();if(r(!1),!o.ok){n.error(o.refusal.message);return}n.success("Tasks are on."),e()};return s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Tasks are not on for this organization"}),s.jsxs(xe,{children:[s.jsx("p",{children:"Turning them on creates one List with the default workflow. Members then see tasks as their access allows. It needs two-factor sign-in."}),l?s.jsx(q,{type:"button",size:"sm",className:"mt-2",disabled:a,onClick:()=>void i(),children:"Turn on Tasks"}):null]})]})}const rh=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function XD({active:e,org:t,members:n,description:a,read_only_reason:r,reload_configuration:l}){var ug;const{commands:i,listTasks:o,waitingOnYou:c,hierarchyRevision:d}=qx(),{href:f,Link:m}=Ze(),{self_id:h}=jd(),x=Mr(),{list:j,workspace:v}=e,y=j.offers,g=y!==void 0,p=u.useMemo(()=>{var G;return((G=v.workflows.find(se=>se.id===j.workflow_id))==null?void 0:G.statuses)??[]},[v,j]),b=v.priorities,w=!!i&&Vu(j.permission,"write"),N=w&&Vu(j.permission,"manage"),C=u.useMemo(()=>new Map(n.map(G=>[G.user_id,G])),[n]),_=G=>{var se;return G?G===h?"You":((se=C.get(G))==null?void 0:se.label)??"A member":""},[S,D]=u.useState("active"),[O,B]=u.useState(!1),[Y,H]=u.useState(""),[M,A]=u.useState("");u.useEffect(()=>{const G=setTimeout(()=>A(Y),YD);return()=>clearTimeout(G)},[Y]);const[R,T]=u.useState(null),[k,$]=u.useState(Ti),[P,E]=u.useState(!1),[I,F]=u.useState(!1),[Q,oe]=u.useState({}),[ge,Z]=u.useState([]),[J,re]=u.useState(null),[ee,fe]=u.useState([]),[ce,Ee]=u.useState(null),[V,te]=u.useState(0),[le,Pe]=u.useState(!1),[Le,ue]=u.useState(null),[zt,Je]=u.useState(null),ct=us(),[ye,We]=u.useState(!1),[Gt,An]=u.useState(null),[Nt,Ue]=u.useState({}),[Zt,Tt]=u.useState(""),{confirm:Vt,confirm_dialog:At}=Ql(),Yt=u.useRef(null),Lt=u.useRef(null),z=u.useRef(null),de=u.useRef(null),[je,it]=u.useState(void 0),Kn=!!(M.trim()||R||k!==Ti||P||I),Mn=u.useRef(0),Jt=u.useRef(0),U=u.useCallback(async(G,se=!1)=>{if(se&&Jt.current>0)return;const Ge=G?Mn.current:Mn.current+=1,ft={state:S,assigned_to_me:O||void 0,cursor:G,search:M.trim()||void 0,group:R??void 0,owner:k===Ti?void 0:k===Jk?"":k,urgent:P||void 0,over_estimate:I||void 0,...QD(Q,ge)},xn=gn=>o(j.id,{...ft,cursor:gn});G||(Jt.current+=1);let kt=await xn(G).finally(()=>{G||(Jt.current-=1)}),Ft=!!G;if(!kt.ok&&kt.refusal.code==="cursor_stale"&&(kt=await xn(),Ft=!1),Ge!==Mn.current)return;if(!kt.ok){Ee(kt.refusal),te(gn=>gn+1);return}const Bt=kt.data;Ee(null),te(0),!(se&&rh(Bt,z.current))&&(z.current=Bt,re(Bt),Bt.facets&&it(Bt.facets),fe(gn=>Ft?[...gn,...Bt.tasks]:Bt.tasks))},[o,j.id,S,O,M,R,k,P,I,Q,ge]),Se=u.useCallback(async()=>{const G=await c();if(Je(Ge=>G.ok?null:rh(Ge,G.refusal)?Ge:G.refusal),!G.ok&&g)return;const se=G.ok?G.data:null;rh(se,de.current)||(de.current=se,ue(se))},[c,g]);u.useEffect(()=>{z.current=null,re(null)},[S,O]),u.useEffect(()=>{U()},[U]),u.useEffect(()=>{Se()},[Se]);const De=u.useCallback(async()=>{await Promise.all([U(),Se()])},[U,Se]),ut=u.useRef(De);ut.current=De;const L=y==null?void 0:y.refresh_ms;u.useEffect(()=>{if(!L)return;const G=setInterval(()=>{U(void 0,!0),Se()},L);return()=>clearInterval(G)},[L,U,Se]);const ne=u.useCallback(async(G,se,Ge)=>{if(!i)return;const ft=await i.run(G,se);ft.ok?Ge&&x.success(Ge):(x.error(ft.refusal.message),ft.refusal.code==="revision_conflict"&&l()),await De()},[i,x,De,l]),ae=p.find(G=>G.category==="completed"),Ce=async(G,se,Ge)=>{const ft=se+Ge,xn=ee[ft];if(!xn||!J||!i)return;const kt=async(Ft,Bt)=>{const gn=await i.run(Ft,Bt);if(!gn.ok)throw gn.refusal;return gn.data};try{let Ft=J.list.order_revision,Bt=G.revision;if(xn.queue_rank===null){const gn=ee.findIndex(ma=>ma.queue_rank===null);for(const ma of ee.slice(gn,ft+1)){const ui=await kt("reorder",{task_id:ma.id,expected_revision:ma.revision,expected_order_revision:Ft,placement:"end"});Ft=ui.list.order_revision,ma.id===G.id&&(Bt=ui.task.revision)}}await kt("reorder",{task_id:G.id,expected_revision:Bt,expected_order_revision:Ft,placement:Ge<0?"before":"after",anchor_task_id:xn.id})}catch(Ft){x.error(Ft.message)}await De()},qe=G=>{ae&&ne("update_task",{task_id:G.id,expected_revision:G.revision,changes:{status_id:ae.id}},`${G.title} completed.`)},pn=async G=>{if(!J||!await Vt({title:"Archive this task?",description:"It leaves the queue and becomes read-only. Its claim, holds and history stay, and a manager can restore it.",action_label:"Archive task",destructive:!0}))return;const[Ge,ft]=await Promise.all([o(j.id,{limit:1}),d(v.id)]);if(!Ge.ok||!ft.ok){x.error(Ge.ok?ft.ok?"":ft.refusal.message:Ge.refusal.message);return}await ne("archive_task",{task_id:G.id,expected_revision:G.revision,expected_order_revision:Ge.data.list.order_revision,expected_hierarchy_revision:ft.data},`${G.title} archived.`)},_e=async G=>{await ne("release_hold",{hold_id:G},"Hold released.")},Ve=async(G,se,Ge,ft)=>{if(!(i!=null&&i.complete)||!await Vt({title:`Mark ${se} done?`,description:Ge.reason?`“${Ge.reason}”
|
|
397
|
+
|
|
398
|
+
It leaves the open tasks.`:"It leaves the open tasks.",action_label:"Mark done"}))return;An(G);const kt=await i.complete(Ge);if(An(null),!kt.ok){Ue(Ft=>({...Ft,[G]:kt.refusal.message}));return}Ue(({[G]:Ft,...Bt})=>Bt),Tt(`${se} marked done.`),await ut.current(),sn({next:ft})},[Ut,sn]=u.useState(null);u.useEffect(()=>{var ft;if(!Ut)return;sn(null);const G=Lt.current,se=typeof Ut.next=="function"?Ut.next():Ut.next;(ft=(se?(G==null?void 0:G.querySelector(`[data-done-key="${CSS.escape(se)}"]`))??(G==null?void 0:G.querySelector(`[data-title-key="${CSS.escape(se)}"] a`)):null)??Yt.current)==null||ft.focus()},[Ut]);const $n=()=>{var G;H(""),A(""),T(null),$(Ti),E(!1),F(!1),(G=Yt.current)==null||G.focus()},oi=new Map(p.map(G=>[G.id,G])),ci=new Map(b.map(G=>[G.id,G])),Vs=new Map(ee.map(G=>[G.id,G.title])),rf=w&&S==="active",yS=ee.some(G=>G.local_done),jS=ee.some(G=>G.local_action),lf=rf||yS||jS,of=!g||b.length>0,bS=!O&&!Kn,tc=5+(of?1:0)+(lf?1:0),wS=ce!==null&&(ce.reason==="store_locked"||ce.reason==="engine_failed")&&V<=VD,nc=(Le==null?void 0:Le.holds)??[],cf=J==null?void 0:J.groups,_S=WD(ee,cf,Q,(J==null?void 0:J.matched)===void 0?ge:[]),sc=cf?cf.length===0:ee.length===0,NS=(G,se)=>oe(Ge=>({...Ge,[G]:!se})),kS=G=>Z(se=>se.includes(G)?se.filter(Ge=>Ge!==G):[...se,G]),SS=nc.map(G=>G.id);return s.jsxs("div",{ref:Lt,className:"contents",children:[s.jsx(mn,{title:"Tasks",description:a,actions:w?s.jsxs(q,{type:"button",onClick:()=>We(!0),children:[s.jsx(jr,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]}):null}),g&&(J!=null&&J.open)?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[J.open," open"]}):null,L?s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",role:"status",children:ce?`Not reading · trying again every ${Math.round(L/1e3)}s`:J?`Live · refreshes every ${Math.round(L/1e3)}s`:"Connecting…"}):null,g?s.jsx("p",{className:"sr-only",role:"status",children:Zt}):null,(g||nc.length>0)&&s.jsxs(xt,{as:"section","aria-labelledby":"waiting-title",className:"mt-4 p-4","data-testid":"tasks-waiting",children:[s.jsx("h2",{id:"waiting-title",className:"text-lg font-semibold",children:"Waiting on you"}),nc.length>0?s.jsx("ul",{className:"mt-2 divide-y","aria-labelledby":"waiting-title",children:nc.map((G,se)=>{var kt,Ft;const Ge=vo[G.hold_type],ft=G.target.kind==="task"?`Because you claim ${Vs.get(G.target.task_id)??"the task it waits on"} · `:"",xn=G.local_done;return s.jsxs("li",{id:`waiting-${G.id}`,"data-title-key":G.id,className:"flex flex-wrap items-center gap-3 py-2",children:[G.task?s.jsx(m,{className:"text-primary min-w-40 flex-1 hover:underline",href:f(`/org/${t}/tasks/${G.task.id}`),children:G.task.title}):s.jsx("span",{className:"min-w-40 flex-1",children:G.reason}),s.jsx(pe,{variant:Ge.tone,children:G.local_label??Ge.label}),s.jsxs("div",{className:"min-w-48 flex-2",children:[G.task?s.jsx("div",{className:"text-sm",children:G.reason}):null,s.jsxs("div",{className:"text-muted-foreground text-xs",children:[ft,"From ",_(G.opened_by)," · ",rs(G.opened_at)]}),(kt=G.local_threads)!=null&&kt.length?s.jsxs("div",{className:"text-muted-foreground text-xs",children:["Answer it in"," ",s.jsx(m,{className:"text-primary hover:underline",href:f(`/org/${t}/threads`),children:"Threads"}),": ",G.local_threads.join(" · ")]}):null,Nt[G.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:Nt[G.id]}):null]}),xn&&(i!=null&&i.complete)?s.jsx(q,{type:"button",variant:"outline",size:"sm","data-done-key":G.id,"aria-label":`Mark ${((Ft=G.task)==null?void 0:Ft.title)??G.reason} done`,loading:Gt===G.id,onClick:()=>{var Bt;return void Ve(G.id,((Bt=G.task)==null?void 0:Bt.title)??G.reason,xn,SS[se+1]??null)},children:"Done"}):null,g?null:s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void _e(G.id),children:"Release"})]},G.id)})}):Le?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Nothing in this checkout waits on you."}):null,g&&zt?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status",children:zt.reason==="view_outdated"?`Waiting on you is not read here. ${ct}`:"Waiting on you could not be read. It is read again with the list."}):null,s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:g?"This checkout only. Teammates' agents are not listed here.":"Release a hold when you have done your part. Whoever can edit the task then resolves it."})]}),!w&&!r&&s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(Po,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"You can view these tasks"}),s.jsx(xe,{children:"Ask an organization admin for write access to change them."})]}),s.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-4",children:[(y==null?void 0:y.archived)!==!1?s.jsx(dD,{value:S,onValueChange:G=>D(G),children:s.jsxs(Bk,{"aria-label":"Which tasks",children:[s.jsx(Tm,{value:"active",children:"Active"}),s.jsx(Tm,{value:"archived",children:"Archived"})]})}):null,(y==null?void 0:y.assigned_to_me)!==!1?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Wl,{id:"tasks-mine",checked:O,onCheckedChange:G=>B(G===!0)}),s.jsx(ze,{htmlFor:"tasks-mine",children:"Assigned to me"})]}):null,y!=null&&y.search?s.jsx(Et,{ref:Yt,type:"search",className:"w-64","aria-label":"Search tasks",placeholder:"Search title, ID or detail",value:Y,onChange:G=>H(G.target.value)}):null,je!=null&&je.owners?s.jsx(az,{owners:je.owners,no_owner:je.no_owner,value:k,on_change:$}):null]}),(ug=je==null?void 0:je.groups)!=null&&ug.length?s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Status",children:[je.groups.map(G=>s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:jl,"aria-pressed":R===G.id,onClick:()=>T(se=>se===G.id?null:G.id),children:[G.label," ",G.count]},G.id)),je.marks?s.jsxs(s.Fragment,{children:[s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:jl,"aria-pressed":P,onClick:()=>E(G=>!G),children:["Urgent ",je.marks.urgent]}),s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:jl,"aria-pressed":I,onClick:()=>F(G=>!G),children:["Over estimate ",je.marks.over_estimate]})]}):null]}):null,Kn&&(J==null?void 0:J.matched)!==void 0&&J.total!==void 0?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:[J.matched," of ",J.total," match ·"," ",s.jsx(q,{type:"button",variant:"link",size:"inline-sm",onClick:$n,children:"Clear"})]}):null,wS?s.jsx("p",{className:"text-muted-foreground mt-4 text-sm",children:"Tasks are busy. Reading them again…"}):ce?s.jsx(t1,{refusal:ce,on_retry:()=>void U()}):null,!J&&!ce&&s.jsx(e1,{}),J&&sc&&Kn?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Nd,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No tasks match"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing open matches these filters."}),s.jsx(q,{type:"button",variant:"outline",onClick:$n,children:"Clear filters"})]}):J&&sc&&S==="active"&&!O&&g?s.jsx("p",{className:"text-muted-foreground mt-6 text-sm",children:"No tasks recorded yet."}):J&&sc&&S==="active"&&!O?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(d0,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No tasks yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Create the first task, or ask an agent to create one with the SDLC MCP tools."}),w&&s.jsxs(q,{type:"button",onClick:()=>We(!0),children:[s.jsx(jr,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]})]}):J?s.jsxs(s.Fragment,{children:[s.jsx(xt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Tasks",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Title"}),s.jsx(X,{children:"Status"}),of?s.jsx(X,{className:"hidden md:table-cell",children:"Priority"}):null,s.jsx(X,{className:"hidden md:table-cell",children:"Primary"}),s.jsx(X,{className:"hidden md:table-cell",children:"Holds"}),s.jsx(X,{children:"Claimed by"}),lf?s.jsx(X,{className:"text-right",children:"Actions"}):null]})}),s.jsxs(Xe,{children:[_S.map(G=>{if(G.kind==="group")return s.jsx(JD,{group:G.group,open:G.open,columns:tc,on_toggle:()=>NS(G.group.id,G.open)},`group:${G.group.id}`);if(G.kind==="more")return s.jsx(ez,{group:G.group,whole:ge.includes(G.group.id),columns:tc,on_toggle:()=>kS(G.group.id)},`more:${G.group.id}`);const{row:se,index:Ge}=G,ft=oi.get(se.status_id),xn=ID(se),kt=se.local_done;return s.jsx(nz,{columns:tc,thread:{org:t,action:se.local_action,task_id:se.no_page?null:se.id,open_thread:i==null?void 0:i.open_thread},children:(Ft,Bt)=>{var gn,ma;return s.jsxs(he,{"data-testid":"tasks-row",className:Bt?"border-b-0":void 0,children:[s.jsxs(K,{"data-title-key":se.id,children:[se.no_page&&se.local_thread?s.jsxs(m,{className:"text-primary inline-flex items-center gap-1 hover:underline",href:f(Hx(t,se.local_thread.key)),"aria-label":`${se.title}: open ${se.local_thread.title} in Threads`,children:[se.title,s.jsx(Ou,{className:"size-3.5 shrink-0","aria-hidden":"true"})]}):se.no_page?s.jsx("span",{children:se.title}):s.jsx(m,{className:"text-primary hover:underline",href:f(`/org/${t}/tasks/${se.id}`),children:se.title}),se.parent_task_id&&Vs.get(se.parent_task_id)?s.jsx("div",{className:"text-muted-foreground text-xs",children:Vs.get(se.parent_task_id)}):null,g?s.jsx(sz,{row:se}):null,Nt[se.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:Nt[se.id]}):null]}),s.jsx(K,{children:ft?s.jsx(pe,{variant:Wk(ft),children:ft.name}):null}),of?s.jsx(K,{className:"hidden md:table-cell",children:se.priority_id?((gn=ci.get(se.priority_id))==null?void 0:gn.name)??"":s.jsx("span",{className:"text-muted-foreground",children:"Not set"})}):null,s.jsx(K,{className:"hidden md:table-cell",children:se.owner_title?se.owner_title:se.primary_user_id?_(se.primary_user_id):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}),s.jsx(K,{className:"hidden md:table-cell",children:xn?s.jsx(pe,{variant:xn.tone,children:xn.label}):s.jsx("span",{className:"text-muted-foreground",children:"None"})}),s.jsx(K,{"data-testid":"tasks-claim",children:s.jsx(rz,{row:se,holder:_((ma=se.claim)==null?void 0:ma.user_id)})}),lf?s.jsx(K,{className:"text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[kt&&"hold"in kt?s.jsx("a",{className:"text-primary text-sm hover:underline",href:`#waiting-${kt.hold}`,children:"In Waiting on you"}):kt&&(i!=null&&i.complete)?s.jsx(q,{type:"button",variant:"outline",size:"sm","data-done-key":se.id,"aria-label":`Mark ${se.title} done`,loading:Gt===se.id,onClick:()=>void Ve(se.id,se.title,kt,()=>{var ui;return(((ui=z.current)==null?void 0:ui.tasks)??[]).map(uf=>uf.id).filter(uf=>uf!==se.id)[Ge]??null}),children:"Done"}):null,Ft,rf&&bS?s.jsxs(s.Fragment,{children:[s.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${se.title} up`,disabled:Ge===0,onClick:()=>void Ce(se,Ge,-1),children:s.jsx(UR,{className:"size-4","aria-hidden":"true"})}),s.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${se.title} down`,disabled:Ge===ee.length-1,onClick:()=>void Ce(se,Ge,1),children:s.jsx(DR,{className:"size-4","aria-hidden":"true"})})]}):null,rf?s.jsxs(Pd,{children:[s.jsx(qd,{asChild:!0,children:s.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`More actions for ${se.title}`,children:s.jsx(Fp,{className:"size-4","aria-hidden":"true"})})}),s.jsxs(Wo,{align:"end",children:[ae&&se.status_id!==ae.id?s.jsx(Ll,{onSelect:()=>qe(se),children:"Complete"}):null,N?s.jsx(Ll,{className:"text-destructive focus:text-destructive",onSelect:()=>void pn(se),children:"Archive"}):null]})]}):null]})}):null]})}},se.id)}),sc&&s.jsx(he,{children:s.jsx(K,{colSpan:tc,className:"text-muted-foreground h-24 text-center",children:S==="archived"?"No archived tasks.":"No tasks are assigned to you."})})]})]})}),J.next_cursor?s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2 self-start",disabled:le,onClick:async()=>{Pe(!0),await U(J.next_cursor??void 0),Pe(!1)},children:"Load more"}):null]}):null,w&&i&&s.jsx(qD,{open:ye,commands:i,list_id:j.id,list_revision:(J==null?void 0:J.list.revision)??j.revision,default_status_id:j.default_status_id,statuses:p,priorities:b,members:n,on_close:()=>We(!1),on_created:async()=>{We(!1),await De()}}),At]})}function QD(e,t){const n=Object.keys(e).filter(r=>e[r]),a=Object.keys(e).filter(r=>!e[r]);return{...n.length?{opened_groups:n}:{},...a.length?{closed_groups:a}:{},...t.length?{all_groups:t}:{}}}function WD(e,t,n,a){if(!t)return e.map((l,i)=>({kind:"row",row:l,index:i}));const r=[];for(const l of t){const i=n[l.id]??l.open;if(r.push({kind:"group",group:l,open:i}),!i||!l.open)continue;let o=0;e.forEach((c,d)=>{c.local_state===l.id&&(r.push({kind:"row",row:c,index:d}),o+=1)}),(l.hidden>0||a.includes(l.id)&&o>ZD)&&r.push({kind:"more",group:l})}return r}const ZD=10;function JD({group:e,open:t,columns:n,on_toggle:a}){const r=t?Yp:bd;return s.jsx(he,{"data-testid":"tasks-group",children:s.jsx(K,{colSpan:n,className:"p-1",children:s.jsxs(q,{type:"button",variant:"ghost",size:"sm",className:"w-full justify-start font-semibold","aria-expanded":t,onClick:a,children:[s.jsx(r,{className:"size-4","aria-hidden":"true"}),e.label," ",e.count]})})})}function ez({group:e,whole:t,columns:n,on_toggle:a}){return s.jsx(he,{"data-testid":"tasks-group-more",children:s.jsx(K,{colSpan:n,children:s.jsx(q,{type:"button",variant:"link",size:"sm",className:"px-0","aria-expanded":t,onClick:a,children:t?"Show fewer":`Show all ${e.count}`})})})}const tz={you:"text-warning",ok:"text-info",waiting:"text-info",blocked:"text-warning",neutral:"text-muted-foreground",muted:"text-muted-foreground"};function nz({thread:e,columns:t,children:n}){const{button:a,panel:r}=Wd(e);return s.jsxs(s.Fragment,{children:[n(a,!!r),r?s.jsx(he,{"data-testid":"tasks-row-panel",className:"hover:bg-transparent",children:s.jsx(K,{colSpan:t,className:"pt-0",children:s.jsx("div",{className:"max-w-180 pl-4 text-left whitespace-normal",children:r})})}):null]})}function sz({row:e}){var a;const t=e.local_after,n=e.local_detail;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"text-muted-foreground font-mono text-xs",children:[e.id,e.match?` · matched in ${e.match}`:""]}),t||n?s.jsxs("div",{className:"text-muted-foreground text-xs",children:[t,t&&n?" · ":"",n?s.jsx("span",{className:tz[e.local_tone??"muted"],children:n}):null]}):null,(a=e.local_marks)!=null&&a.length?s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.local_marks.map(r=>s.jsx(pe,{variant:r.tone??"neutral",children:r.label},r.label))}):null]})}function az({owners:e,no_owner:t,value:n,on_change:a}){return s.jsxs(wt,{value:n,onValueChange:a,children:[s.jsx(vt,{className:"w-56","aria-label":"Owner",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:Ti,children:"Any owner"}),e.map(r=>s.jsxs(Ae,{value:r.id,children:[r.label," (",r.count,")"]},r.id)),t!==void 0?s.jsxs(Ae,{value:Jk,children:["No owner (",t,")"]}):null]})]})}function rz({row:e,holder:t}){const n=e.claim;if(!n)return s.jsx("span",{className:"text-muted-foreground",children:"Nobody"});if(n.lapsed){const a=new Date(n.lease_expires_at)<=new Date;return s.jsxs("div",{children:[s.jsxs("div",{className:"text-warning",children:["Lapsed · ",t]}),s.jsx("div",{className:"text-muted-foreground text-xs",children:a?`Ran out at ${_s(n.lease_expires_at)}`:"Can no longer edit it"})]})}return s.jsxs("div",{className:"max-w-64",children:[s.jsxs("div",{children:[t,n.via?` · ${Ix(n.via)}`:""]}),s.jsxs("div",{className:"text-muted-foreground truncate text-xs",title:n.via==="sdlc_login"&&n.via_device?Qk(n.via_device):void 0,children:["Until ",_s(n.lease_expires_at),n.via==="sdlc_login"&&n.via_device?s.jsxs(s.Fragment,{children:[" · ",s.jsx("bdi",{children:n.via_device})]}):null]})]})}const lz={waiting_for_user:{label:"Waiting for",help:"The member who must act. They see this hold under Waiting on you."},blocked:{label:"Blocked by",help:"The task that must finish first."},waiting_for_external:{label:"Waiting for",help:"Who or what outside the organization."},paused:null};function iz({open:e,members:t,tasks:n,holds_my_web_claim:a,on_close:r,on_submit:l}){const[i,o]=u.useState("waiting_for_user"),[c,d]=u.useState(""),[f,m]=u.useState(""),[h,x]=u.useState(!1),[j,v]=u.useState({}),[y,g]=u.useState(null),[p,b]=u.useState(!1);u.useEffect(()=>{e&&(o("waiting_for_user"),d(""),m(""),x(!1),v({}),g(null))},[e]);const w=lz[i],N=async C=>{C.preventDefault();const _={target:w!==null&&!c.trim(),reason:!f.trim()};if(v(_),_.target||_.reason)return;b(!0);const S={hold_type:i,reason:f.trim(),release_claim:h};i==="waiting_for_user"&&(S.target_user_id=c),i==="blocked"&&(S.target_task_id=c),i==="waiting_for_external"&&(S.target_label=c.trim());const D=await l(S);b(!1),g(D)};return s.jsx(kn,{open:e,onOpenChange:C=>C?null:r(),children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:C=>void N(C),noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"Add hold"}),s.jsx(Tn,{children:"Say what this task is waiting for."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[y&&s.jsxs(me,{variant:"destructive",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:y})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"hold-type",children:"Type"}),s.jsxs(wt,{value:i,onValueChange:C=>{o(C),d(""),v({})},children:[s.jsx(vt,{id:"hold-type",children:s.jsx(_t,{})}),s.jsx(yt,{children:Object.keys(vo).map(C=>s.jsx(Ae,{value:C,children:vo[C].label},C))})]})]}),w?s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"hold-target",children:w.label}),i==="waiting_for_external"?s.jsx(Et,{id:"hold-target",value:c,"aria-invalid":j.target,onChange:C=>d(C.target.value)}):s.jsxs(wt,{value:c,onValueChange:d,children:[s.jsx(vt,{id:"hold-target","aria-invalid":j.target,children:s.jsx(_t,{placeholder:i==="blocked"?"Choose a task":"Choose a member"})}),s.jsx(yt,{children:i==="blocked"?n.map(C=>s.jsx(Ae,{value:C.id,children:C.title},C.id)):t.map(C=>s.jsx(Ae,{value:C.user_id,children:C.label},C.user_id))})]}),s.jsx("p",{className:j.target?"text-destructive text-xs":"text-muted-foreground text-xs",children:j.target?"Choose what it waits for.":w.help})]}):s.jsx("p",{className:"text-muted-foreground text-xs",children:"You resume it yourself."}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"hold-reason",children:"Reason"}),s.jsx(Fn,{id:"hold-reason",rows:3,placeholder:"What the task is waiting for",value:f,"aria-invalid":j.reason,onChange:C=>m(C.target.value)}),j.reason&&s.jsx("p",{className:"text-destructive text-xs",children:"Give a reason."})]}),a&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Wl,{id:"hold-release-claim",checked:h,onCheckedChange:C=>x(C===!0)}),s.jsx(ze,{htmlFor:"hold-release-claim",children:"Also release my claim"})]})]}),s.jsxs(Rn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),s.jsx(q,{type:"submit",disabled:p,children:p?"Adding…":"Add hold"})]})]})})})}function Jo(){const e=Nn().tasks;if(!e)throw new Error("The Task page rendered without the tasks seam.");return e}function Gx(){return s.jsxs("div",{className:"grid gap-3",role:"status","aria-label":"Loading task",children:[s.jsx(Rt,{className:"h-8 w-1/2"}),Array.from({length:7},(e,t)=>s.jsx(Rt,{className:t===6?"h-6 w-2/3":"h-6 w-full"},t))]})}function Yu({back:e,description:t}){const{href:n,Link:a}=Ze();return s.jsx(Wa,{title:"Task not found",description:t??"It may have been removed, or you may not have access to it.",backHref:n(e),backLabel:"Back to tasks",link:a})}const Gr="not_set",oz=10*60*1e3,yy=20;function cz(){const{members:e}=Jo(),[t,n]=u.useState([]);u.useEffect(()=>{let l=!0;return e().then(i=>{l&&i.ok&&n(i.data)}),()=>{l=!1}},[e]);const a=u.useMemo(()=>new Map(t.map(l=>[l.user_id,l])),[t]),r=u.useCallback((l,i)=>{var o;return l?l===i?"You":((o=a.get(l))==null?void 0:o.label)??"A member":""},[a]);return{members:t,name:r}}function uz({active:e,task_id:t,back:n}){const a=Jo(),{task:r,activity:l,listTasks:i,hierarchyRevision:o,commands:c}=a,{href:d,Link:f}=Ze(),m=Mr(),{self_id:h}=jd(),{members:x,name:j}=cz(),{workspace:v}=e,{confirm:y,confirm_dialog:g}=Ql(),[p,b]=u.useState(null),[w,N]=u.useState(!1),[C,_]=u.useState(!1),[S,D]=u.useState(null),[O,B]=u.useState([]),[Y,H]=u.useState(yy),[M,A]=u.useState([]),[R,T]=u.useState(!1),[k,$]=u.useState(null),[P,E]=u.useState(null),[I,F]=u.useState(""),[Q,oe]=u.useState(null),ge=u.useCallback(async()=>{if(!r)return;const U=await r(t);U.ok?(b(U.data),_(!1)):U.refusal.status===404||U.refusal.status===400?N(!0):_(!0)},[r,t]),Z=u.useRef(0),J=u.useCallback(async()=>{if(!l)return;const U=Z.current+=1;let Se=[],De;for(;;){const ut=await l(t,De);if(U!==Z.current||!ut.ok)return;if(Se=[...Se,...ut.data.events].slice(-1e3),!ut.data.more||!ut.data.next_cursor)break;De=ut.data.next_cursor}U===Z.current&&B(Se.reverse())},[l,t]);u.useEffect(()=>{ge(),J()},[ge,J]);const re=p?v.lists.find(U=>U.id===p.task.list_id):void 0,ee=u.useMemo(()=>{var U;return((U=v.workflows.find(Se=>Se.id===(p==null?void 0:p.task.workflow_id)))==null?void 0:U.statuses)??[]},[v,p==null?void 0:p.task.workflow_id]);u.useEffect(()=>{if(!p)return;let U=!0;return i(p.task.list_id,{limit:100}).then(Se=>{U&&A(Se.ok?Se.data.tasks.filter(De=>De.id!==p.task.id).map(De=>({id:De.id,title:De.title})):[])}),()=>{U=!1}},[i,p==null?void 0:p.task.list_id,p==null?void 0:p.task.id,p]);const fe=u.useCallback(async()=>{await Promise.all([ge(),J()])},[ge,J]),ce=u.useCallback((U,Se)=>c?c.run(U,Se):Promise.resolve({ok:!1,refusal:{status:0,message:"This page cannot change tasks."}}),[c]),Ee=u.useCallback(async(U,Se,De)=>{const ut=await ce(U,Se);return ut.ok?(De&&m.success(De),await fe(),ut.data):(ut.refusal.code==="revision_conflict"?D({tone:"warning",title:"This task changed while you were editing",body:"We reloaded it. Check the change, then save again."}):ut.refusal.code==="claim_held"?(await ge(),D({tone:"destructive",title:"Someone else claimed this task first",body:"Their claim is shown below. You can take it over if it lapses."})):m.error(ut.refusal.message),await fe(),null)},[ce,m,fe,ge]),V=(p==null?void 0:p.claim)??null,te=V!==null&&V.id===Q&&!V.lapsed&&!V.via?V.id:null;if(u.useEffect(()=>{if(!te)return;const U=window.setInterval(()=>{ce("renew_claim",{claim_id:te,lease_seconds:vy}).then(()=>ge())},oz);return()=>window.clearInterval(U)},[te,ce,ge]),w)return s.jsx(Yu,{back:n});if(C&&!p)return s.jsxs(me,{variant:"destructive",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This task could not be loaded"}),s.jsxs(xe,{children:[s.jsx("p",{children:"Check your connection and try again."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void ge(),children:"Retry"})]})]});if(!p)return s.jsx(Gx,{});const{task:le}=p,Pe=le.archived_at!==null,Le=Vu(p.permission,"write")&&!Pe,ue=Vu(p.permission,"manage"),zt=ee.find(U=>U.id===le.status_id),Je=ee.find(U=>U.category==="completed"),ct=v.priorities.find(U=>U.id===le.priority_id),ye=p.contributors.map(U=>U.user_id),We=V!==null&&V.user_id===h,Gt=V!==null&&!V.lapsed,An=p.checklist.filter(U=>U.is_complete).length,Nt=async()=>{const[U,Se]=await Promise.all([i(le.list_id,{limit:1}),o(v.id)]);return U.ok?Se.ok?{ok:!0,data:{task_id:le.id,expected_revision:le.revision,expected_order_revision:U.data.list.order_revision,expected_hierarchy_revision:Se.data}}:Se:U},Ue=(U,Se)=>Ee("update_task",{task_id:le.id,expected_revision:le.revision,changes:U},Se),Zt=U=>y(U.via==="sdlc_login"?{title:"Release this claim?",description:`You claimed it via ${ah(U.via,U.via_device)}. Its next renewal will be refused, and it will stop holding the task.`,action_label:"Release claim",destructive:!0}:{title:"Release your agent's claim?",description:"Your agent is still working on this task. Its next renewal will be refused, and it will stop holding the task.",action_label:"Release claim",destructive:!0}),Tt=async()=>{if(!Je)return;if(Gt&&(!We||V.via)){const Se=V.via==="api_key"?`${We?"Your":`${j(V.user_id)}'s`} agent is still working on it.`:V.via==="sdlc_login"?`${We?"You are":`${j(V.user_id)} is`} still working on it via ${ah(V.via,V.via_device)}.`:`${j(V.user_id)} is still working on it.`;if(!await y({title:"Complete this task?",description:Se,action_label:"Mark complete"}))return}await Ue({status_id:Je.id},"Task completed.")!==null&&V&&We&&Gt&&await Ee("end_claim",{claim_id:V.id,outcome:"completed"})},Vt=async(U,Se)=>{const De=await Nt();if(!De.ok){m.error(De.refusal.message);return}await Ee(U,De.data,Se)},At=async()=>{await y({title:"Archive this task?",description:"It leaves the queue and becomes read-only. Its claim, holds and history stay, and a manager can restore it.",action_label:"Archive task",destructive:!0})&&await Vt("archive_task","Task archived.")},Yt=async()=>{await Vt("restore_task","Task restored.")},Lt=async()=>{var ut;const U=V,Se=await Ee("claim_task",{task_id:le.id,lease_seconds:vy}),De=(ut=Se==null?void 0:Se.claim)==null?void 0:ut.id;De&&!(U&&U.id===De&&U.via)&&oe(De)},z=async()=>{V&&(V.via&&!await Zt(V)||(await Ee("end_claim",{claim_id:V.id,outcome:"released"},"Claim released."),oe(null)))},de=async()=>{V&&await Ee("end_claim",{claim_id:V.id,outcome:"expired"},"Claim cleared.")},je=async U=>{U.hold_type==="paused"&&h&&(U={...U,target_user_id:h});const Se=await ce("open_hold",{task_id:le.id,hold_type:U.hold_type,reason:U.reason,...U.target_user_id?{target_user_id:U.target_user_id}:{},...U.target_task_id?{target_task_id:U.target_task_id}:{},...U.target_label?{target_label:U.target_label}:{}});return Se.ok?(T(!1),m.success("Hold added."),U.release_claim&&V&&We&&!V.via&&(await Ee("end_claim",{claim_id:V.id,outcome:"released"}),oe(null)),await fe(),null):Se.refusal.message},it=U=>Ee("checklist",{task_id:le.id,expected_revision:le.revision,...U}),Kn=async U=>{for(const Se of U.filter(De=>!ye.includes(De)))await Ee("set_contributor",{task_id:le.id,expected_revision:le.revision,user_id:Se,action:"add"});for(const Se of p.contributors.filter(De=>!U.includes(De.user_id)))await Ee("set_contributor",{task_id:le.id,expected_revision:le.revision,user_id:Se.user_id,action:"remove",expected_contributor_revision:Se.revision})},Mn=U=>{var De;if(U.target.kind==="user")return j(U.target.user_id,h);if(U.target.kind==="external")return U.target.label;if(U.target.hidden||!U.target.task_id)return"A task you cannot see";const Se=U.target.task_id;return s.jsx(f,{className:"text-primary hover:underline",href:d(`${n}/${Se}`),children:((De=M.find(ut=>ut.id===Se))==null?void 0:De.title)??"Another task"})},Jt=U=>U.target.kind==="user"&&U.target.user_id===h&&!U.released_at?s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void Ee("release_hold",{hold_id:U.id},"Hold released."),children:"Release"}):Le?s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void Ee("resolve_hold",{hold_id:U.id},"Hold resolved."),children:"Resolve"}):null;return s.jsxs(s.Fragment,{children:[s.jsx(mn,{title:le.title,description:`Created ${rs(le.created_at)} by ${j(le.created_by,h)}`,actions:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Le&&s.jsxs(s.Fragment,{children:[s.jsxs(q,{type:"button",variant:"outline",onClick:()=>$(le.title),children:[s.jsx(_d,{className:"mr-2 size-4","aria-hidden":"true"}),"Edit title"]}),Je&&le.status_id!==Je.id&&s.jsxs(q,{type:"button",variant:"outline",onClick:()=>void Tt(),children:[s.jsx($r,{className:"mr-2 size-4","aria-hidden":"true"}),"Mark complete"]})]}),ue&&!Pe&&s.jsxs(q,{type:"button",variant:"outline",onClick:()=>void At(),children:[s.jsx(Lv,{className:"mr-2 size-4","aria-hidden":"true"}),"Archive"]})]}),children:k!==null?s.jsxs("form",{className:"flex flex-wrap items-center gap-2 pt-1",onSubmit:async U=>{U.preventDefault(),k.trim()&&await Ue({title:k.trim()})!==null&&$(null)},children:[s.jsx(ze,{htmlFor:"task-title",className:"sr-only",children:"Title"}),s.jsx(Et,{id:"task-title",className:"max-w-xl",value:k,onChange:U=>$(U.target.value)}),s.jsx(q,{type:"submit",size:"sm",children:"Save"}),s.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:()=>$(null),children:"Cancel"})]}):null}),S&&s.jsxs(me,{variant:S.tone,className:"mt-4","data-testid":"task-notice",children:[S.tone==="warning"?s.jsx(Or,{className:"size-4","aria-hidden":"true"}):s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:S.title}),s.jsx(xe,{children:S.body})]}),Pe?s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(Lv,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This task is archived"}),s.jsx(xe,{children:ue?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"It is out of the queue and cannot be claimed. Restore it to work on it again."}),s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void Yt(),children:[s.jsx(MR,{className:"mr-2 size-4","aria-hidden":"true"}),"Restore"]})]}):s.jsx("p",{children:"It is out of the queue and cannot be claimed. A manager can restore it."})})]}):Le?null:s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(Po,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"You can view this task"}),s.jsx(xe,{children:"Ask an organization admin for write access to change it."})]}),Le?s.jsxs("div",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"task-status",children:"Status"}),s.jsxs(wt,{value:le.status_id,onValueChange:U=>void Ue({status_id:U}),children:[s.jsx(vt,{id:"task-status",children:s.jsx(_t,{})}),s.jsx(yt,{children:ee.map(U=>s.jsx(Ae,{value:U.id,children:U.name},U.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"task-priority",children:"Priority"}),s.jsxs(wt,{value:le.priority_id??Gr,onValueChange:U=>void Ue({priority_id:U===Gr?null:U}),children:[s.jsx(vt,{id:"task-priority",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:Gr,children:"Not set"}),v.priorities.map(U=>s.jsx(Ae,{value:U.id,children:U.name},U.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"task-primary",children:"Primary"}),s.jsxs(wt,{value:le.primary_user_id??Gr,onValueChange:U=>void Ue({primary_user_id:U===Gr?null:U}),children:[s.jsx(vt,{id:"task-primary",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:Gr,children:"Not set"}),x.map(U=>s.jsx(Ae,{value:U.user_id,children:U.label},U.user_id))]})]})]}),s.jsx(dz,{members:x,selected:ye,on_change:U=>void Kn(U)})]}):s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(Cc,{label:"Status",value:(zt==null?void 0:zt.name)??""}),s.jsx(Cc,{label:"Priority",value:(ct==null?void 0:ct.name)??"Not set"}),s.jsx(Cc,{label:"Primary",value:le.primary_user_id?j(le.primary_user_id,h):"Not set"}),s.jsx(Cc,{label:"Contributors",value:ye.map(U=>j(U,h)).join(", ")||"None"})]}),!Pe&&s.jsx(fz,{claim:V,mine:We,holder:V?j(V.user_id):"",own:V!==null&&V.id===Q,can_write:Le,on_claim:()=>void Lt(),on_release:()=>void z(),on_clear:()=>void de()}),s.jsxs("section",{className:"mt-6","aria-labelledby":"task-description-title",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h2",{id:"task-description-title",className:"text-lg font-semibold",children:"Description"}),Le&&P===null&&s.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>E(le.description??""),children:"Edit description"})]}),P!==null?s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async U=>{U.preventDefault(),await Ue({description:P})!==null&&E(null)},children:[s.jsx(ze,{htmlFor:"task-description",className:"sr-only",children:"Description"}),s.jsx(Fn,{id:"task-description",rows:5,value:P,onChange:U=>E(U.target.value)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{type:"submit",size:"sm",children:"Save"}),s.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:()=>E(null),children:"Cancel"})]})]}):s.jsx("p",{className:"mt-2 text-sm whitespace-pre-wrap",children:le.description||s.jsx("span",{className:"text-muted-foreground",children:"No description."})})]}),s.jsxs("section",{className:"mt-6","aria-labelledby":"task-checklist-title",children:[s.jsxs("h2",{id:"task-checklist-title",className:"text-lg font-semibold",children:["Checklist",p.checklist.length>0?` · ${An} of ${p.checklist.length} done`:""]}),s.jsx("ul",{className:"mt-2 grid gap-1",children:p.checklist.map(U=>s.jsxs("li",{className:"flex items-center justify-between gap-2 py-1","data-testid":"task-checklist-item",children:[Le?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Wl,{id:`check-${U.id}`,checked:U.is_complete,onCheckedChange:Se=>void it({action:"toggle",item_id:U.id,expected_item_revision:U.revision,is_complete:Se===!0})}),s.jsx(ze,{htmlFor:`check-${U.id}`,className:"font-normal",children:U.label})]}):s.jsxs("span",{className:"text-sm",children:[U.is_complete?"Done: ":"To do: ",U.label]}),Le&&s.jsxs(Pd,{children:[s.jsx(qd,{asChild:!0,children:s.jsx(q,{type:"button",variant:"ghost",size:"icon","aria-label":`Item actions for ${U.label}`,children:s.jsx(Fp,{className:"size-4","aria-hidden":"true"})})}),s.jsx(Wo,{align:"end",children:s.jsx(Ll,{className:"text-destructive focus:text-destructive",onSelect:()=>void it({action:"archive",item_id:U.id,expected_item_revision:U.revision}),children:"Remove"})})]})]},U.id))}),p.checklist.length===0&&!Le&&s.jsx("p",{className:"text-muted-foreground text-sm",children:"No checklist items."}),Le&&s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async U=>{U.preventDefault(),I.trim()&&await it({action:"add",label:I.trim()})!==null&&F("")},children:[s.jsx(ze,{htmlFor:"task-new-item",children:"Add an item"}),s.jsx(Et,{id:"task-new-item",placeholder:"Add an item and press Enter",value:I,onChange:U=>F(U.target.value)})]})]}),s.jsxs("section",{className:"mt-6","aria-labelledby":"task-holds-title",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("h2",{id:"task-holds-title",className:"text-lg font-semibold",children:"Holds"}),Le&&s.jsxs(q,{type:"button",variant:"outline",size:"sm",onClick:()=>T(!0),children:[s.jsx(h0,{className:"mr-2 size-4","aria-hidden":"true"}),"Add hold"]})]}),s.jsx("div",{className:"mt-2 shrink-0 overflow-x-auto rounded-lg border",children:s.jsxs(Ke,{containerAriaLabel:"Holds",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Type"}),s.jsx(X,{children:"Reason"}),s.jsx(X,{children:"Waiting on"}),s.jsx(X,{className:"text-right",children:"Actions"})]})}),s.jsxs(Xe,{children:[p.holds.map(U=>{const Se=vo[U.hold_type];return s.jsxs(he,{"data-testid":"task-hold",children:[s.jsx(K,{children:s.jsx(pe,{variant:Se.tone,children:Se.label})}),s.jsxs(K,{children:[s.jsx("div",{children:U.reason}),s.jsx("div",{className:"text-muted-foreground text-xs",children:U.released_at?`Released by ${j(U.released_by,h)} · ${rs(U.released_at)} · Ready to resolve`:`Opened by ${j(U.opened_by,h)} · ${rs(U.opened_at)} · Open`})]}),s.jsx(K,{children:Mn(U)}),s.jsx(K,{className:"text-right",children:Jt(U)})]},U.id)}),p.holds.length===0&&s.jsx(he,{children:s.jsx(K,{colSpan:4,className:"text-muted-foreground h-16 text-center",children:"Nothing is holding this task."})})]})]})}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"A hold does not change the task's status. The person it waits on releases it; whoever can edit the task resolves it."})]}),s.jsxs("section",{className:"mt-6 pb-8","aria-labelledby":"task-activity-title",children:[s.jsx("h2",{id:"task-activity-title",className:"text-lg font-semibold",children:"Activity"}),s.jsxs("ul",{className:"mt-2 divide-y rounded-lg border",children:[O.slice(0,Y).map(U=>s.jsxs("li",{className:"grid grid-cols-[1fr_auto] gap-x-4 px-3 py-2 text-sm sm:grid-cols-[2fr_1fr_10rem]","data-testid":"task-activity",children:[s.jsx("span",{children:PD(U)}),s.jsxs("span",{className:"min-w-0 text-right sm:text-left",children:[s.jsx("span",{children:U.actor_id?j(U.actor_id,h):"The system"}),U.via?s.jsxs("span",{className:"text-muted-foreground block max-w-64 truncate text-xs sm:max-w-none",title:`via ${ah(U.via,U.via_device)}`,children:["via ",Ix(U.via),s.jsx(n1,{via:U.via,device:U.via_device})]}):null]}),s.jsx("span",{className:"text-muted-foreground col-span-2 sm:col-span-1 sm:text-right",children:Zk(U.created_at)})]},U.id)),O.length===0&&s.jsx("li",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No activity yet."})]}),O.length>Y&&s.jsx(q,{type:"button",variant:"ghost",size:"sm",className:"mt-2",onClick:()=>H(U=>U+yy),children:"Load more"})]}),Le&&re&&s.jsx(iz,{open:R,members:x,tasks:M,holds_my_web_claim:We&&Gt&&!(V!=null&&V.via),on_close:()=>T(!1),on_submit:je}),g]})}function Cc({label:e,value:t}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("dt",{className:"text-muted-foreground text-xs",children:e}),s.jsx("dd",{className:"text-sm",children:t})]})}function dz({members:e,selected:t,on_change:n}){return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"task-contributors",children:"Contributors"}),s.jsxs(Pd,{children:[s.jsx(qd,{asChild:!0,children:s.jsxs(q,{id:"task-contributors",type:"button",variant:"outline",className:"justify-between font-normal",children:[t.length===0?s.jsx("span",{className:"text-muted-foreground",children:"Add a contributor"}):s.jsx("span",{className:"truncate",children:e.filter(a=>t.includes(a.user_id)).map(a=>a.label).join(", ")}),s.jsx(o0,{className:"text-muted-foreground size-4","aria-hidden":"true"})]})}),s.jsx(Wo,{align:"start",children:e.map(a=>{const r=t.includes(a.user_id);return s.jsxs(Ll,{onSelect:()=>n(r?t.filter(l=>l!==a.user_id):[...t,a.user_id]),children:[r?s.jsx($r,{className:"mr-2 size-4","aria-hidden":"true"}):s.jsx("span",{className:"mr-2 size-4"}),a.label]},a.user_id)})})]})]})}function n1({via:e,device:t}){return e!=="sdlc_login"||!t?null:s.jsxs(s.Fragment,{children:[" on ",s.jsx("bdi",{children:t})]})}function fz({claim:e,mine:t,holder:n,own:a,can_write:r,on_claim:l,on_release:i,on_clear:o}){let c=s.jsx(Kp,{className:"size-4","aria-hidden":"true"}),d="Nobody is working on this",f=r?"Claim it to show others you are.":"",m=r?s.jsx(q,{type:"button",size:"sm",onClick:l,children:"Claim"}):null;if(e&&e.lapsed){const h=new Date(e.lease_expires_at)<=new Date;c=s.jsx(tE,{className:"size-4","aria-hidden":"true"}),d=h?`${t?"Your":`${n}'s`} claim lapsed at ${_s(e.lease_expires_at)}`:`${t?"Your":`${n}'s`} claim lapsed`,f=h?"Its time ran out.":`${n} can no longer edit this task.`,r&&(f+=" Take it over to work on it yourself, or clear it so anyone can claim it."),m=r?s.jsxs(s.Fragment,{children:[s.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:o,children:"Clear claim"}),s.jsx(q,{type:"button",size:"sm",onClick:l,children:"Take over"})]}):null}else if(e){const h=_s(e.lease_expires_at);c=e.via==="api_key"?s.jsx(Vp,{className:"size-4","aria-hidden":"true"}):e.via==="sdlc_login"?s.jsx(_E,{className:"size-4","aria-hidden":"true"}):s.jsx(sT,{className:"size-4","aria-hidden":"true"});const x=s.jsxs(s.Fragment,{children:["Claimed via sdlc login",s.jsx(n1,{via:e.via,device:e.via_device}),"."]});t&&e.via==="api_key"?(d=`Your agent is working on this until ${h}`,f="Claimed through one of your API keys. This page does not renew it. Releasing it, or Mark complete, ends the agent's claim after asking."):t&&e.via==="sdlc_login"?(d=`You are working on this until ${h}`,f=s.jsxs(s.Fragment,{children:[x," This page does not renew it. Releasing it, or Mark complete, ends that claim after asking."]})):e.via==="sdlc_login"?(d=`${n} is working on this until ${h}`,f=x):t?(d=`You are working on this until ${h}`,f=a?"Claimed on the web, and renewed while this page is open. Marking the task complete ends your claim.":"Claimed on the web. Marking the task complete ends your claim."):e.via==="api_key"?(d=`${n}'s agent is working on this until ${h}`,f="Claimed through an API key."):(d=`${n} is working on this until ${h}`,f=r?"Claimed on the web. You can take it over if the claim lapses.":"Claimed on the web."),m=t?s.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:i,children:"Release claim"}):null}return s.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-3 rounded-lg border p-3","data-testid":"task-claim",children:[c,s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-sm font-medium",children:d}),f?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:f}):null]}),m?s.jsx("div",{className:"flex items-center gap-2",children:m}):null]})}function Vx(e){const t=u.useRef(null),n=u.useRef(!1),[a,r]=u.useState(0),l=u.useCallback(i=>{var o;!i&&((o=t.current)!=null&&o.contains(document.activeElement))&&(n.current=!0,r(c=>c+1)),t.current=i},[]);return u.useEffect(()=>{var c;if(!n.current)return;n.current=!1;const i=document.activeElement;if(i&&i!==document.body)return;const o=(c=e.current)==null?void 0:c.querySelector("h1");o&&(o.tabIndex=-1,o.focus())},[a,e]),l}function s1(){const e=u.useRef(null);return u.useCallback(t=>{const n=e.current;if(e.current=t,t||!(n!=null&&n.contains(document.activeElement)))return;const a=(n.closest("main")??document).querySelector("h1");a&&Promise.resolve().then(()=>{const r=document.activeElement;r&&r!==document.body||!a.isConnected||(a.tabIndex=-1,a.focus())})},[])}const hz=10,a1=5,mz=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,r1="Not available",pz={added:"Added",changed:"Changed",removed:"Removed"},xz={thread:"Thread",task:"Task",issue:"Issue",release:"Release",test:"Test"},jy=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;function gz(e,t){const n=t!=null&&t.startsWith("task:")?t.slice(5):null;if(n&&mz.test(n))return{label:n,path:`/org/${e}/tasks/${n}`};const a=t!=null&&t.startsWith("issue:")?t.slice(6):null;if(a&&/^iss-\d{1,9}$/.test(a))return{label:a,path:`/org/${e}/issues/${a}`};const r=t!=null&&t.startsWith("release:")?t.slice(8):null;if(r&&jy.test(r))return{label:r==="candidate"?"Candidate":`Release ${r}`,path:`/releases?release=${r}`};const l=t!=null&&t.startsWith("planned:")?t.slice(8):null;return l&&jy.test(l)?{label:`Planned Release ${l}`,path:`/releases?planned=${l}`}:{label:"Tasks",path:`/org/${e}/tasks`}}const l1=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function vz({org:e,task_id:t,from:n}){var Yt,Lt;const a=Jo(),{href:r,Link:l}=Ze(),{confirm:i,confirm_dialog:o}=Ql(),c=gz(e,n),[d,f]=u.useState({state:"loading"}),[m,h]=u.useState([]),[x,j]=u.useState([]),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,w]=u.useState({state:"loading"}),[N,C]=u.useState({state:"loading"}),[_,S]=u.useState(null),[D,O]=u.useState(null),[B,Y]=u.useState(!1),H=u.useRef(null),M=us(),A=Wd({org:e,action:d.state==="ok"?d.detail.local_action:void 0,task_id:t,open_thread:(Yt=a.commands)==null?void 0:Yt.open_thread,labelled:!0}),R=u.useRef(null),T=u.useRef(null),k=u.useRef(null),$=u.useRef(null),P=u.useRef(!1),E=u.useRef(0),I=u.useRef(0),F=u.useCallback(async()=>{if(!a.taskSections)return;w({state:"loading"});const z=await a.taskSections(t);w(z.ok?{state:"ok",data:z.data}:{state:"failed",refusal:z.refusal})},[a.taskSections,t]),Q=u.useCallback(async()=>{if(!a.taskRelated)return;C({state:"loading"});const z=await a.taskRelated(t);C(z.ok?{state:"ok",data:z.data}:{state:"failed",refusal:z.refusal})},[a.taskRelated,t]),oe=u.useCallback(async()=>{var Kn,Mn;const z=I.current+=1;p(null),F(),Q();const[de,je]=await Promise.all([a.availability(),a.task?a.task(t):Promise.resolve(null)]);if(z!==I.current)return;de.state==="active"&&h(((Kn=de.workspace.workflows.find(Jt=>Jt.id===de.list.workflow_id))==null?void 0:Kn.statuses)??[]);const it=de.state==="off"&&((Mn=de.refusal)==null?void 0:Mn.reason)==="engine_missing"?de.refusal:null;if(!je||!je.ok&&je.refusal.reason==="engine_missing"||it){f({state:"engine_missing",refusal:it??(je&&!je.ok?je.refusal:{status:0,message:""})});return}if(je.ok){E.current=0,y(null),O(null),f({state:"ok",detail:je.data,at:new Date().toISOString()});return}if(je.refusal.status===404||je.refusal.reason==="not_found"){f({state:"missing"});return}if(E.current+=1,E.current===1&&l1(je.refusal)){p(je.refusal.retry_after??hz);return}y(je.refusal),f(Jt=>Jt.state==="loading"?{state:"loading"}:Jt)},[a,t,F,Q]);u.useEffect(()=>{oe()},[oe]),u.useEffect(()=>{if(g===null)return;const z=setTimeout(()=>void oe(),g*1e3);return()=>clearTimeout(z)},[g,oe]),u.useEffect(()=>{let z=!0;return a.members().then(de=>{z&&de.ok&&j(de.data)}),()=>{z=!1}},[a.members]),u.useEffect(()=>{var de;if(P.current||d.state!=="ok")return;P.current=!0;const z=(de=H.current)==null?void 0:de.querySelector("h1");z&&(z.tabIndex=-1,z.focus())},[d.state]),u.useEffect(()=>{var z;_&&((z=T.current)==null||z.focus())},[_]),u.useEffect(()=>{if(D===null)return;const z=setTimeout(()=>{var de;return(de=R.current)==null?void 0:de.focus()},0);return()=>clearTimeout(z)},[D]);const ge=u.useMemo(()=>new Map(x.map(z=>[z.user_id,z.label])),[x]),Z=z=>z?ge.get(z)??z:"",J=()=>{S(null),oe()},re=u.useRef(null),ee=z=>(re.current=z,z==="graph"?F():Q());if(u.useEffect(()=>{var je;const z=re.current;if(z===null||(z==="graph"?b:N).state==="loading")return;re.current=null;const de=(z==="graph"?k:$).current??((je=H.current)==null?void 0:je.querySelector("h1"));de==null||de.focus()},[b,N]),d.state==="missing")return s.jsx(Ma,{children:s.jsx(Yu,{back:`/org/${e}/tasks`,description:`No task ${t} in this checkout. It may have finished and been archived, or never been recorded.`})});const fe=s.jsx(q,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(l,{href:r(c.path),children:[s.jsx(i0,{className:"size-4","aria-hidden":"true"}),c.label]})});if(d.state==="engine_missing")return s.jsx(Ma,{children:s.jsx("div",{ref:H,className:"contents",children:s.jsx(ha,{page:"Task",header:s.jsx(Xi,{back:fe,id:null,title:t})})})});const ce=v?s.jsxs(me,{variant:"destructive",className:"mt-4",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read this task"}),s.jsxs(xe,{children:[s.jsxs("p",{children:[v.message,v.since?` Since ${as(v.since)}.`:"",d.state==="ok"?` This page was read at ${as(d.at)}.`:""," See the sdlc viewer terminal for more."]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:J,children:"Retry"})]})]}):null,Ee=g!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(dn,{"aria-hidden":"true"}),"Could not read this task. Trying again in ",g," seconds."]}):null,V=s.jsx("div",{role:"status","aria-live":"polite",children:Ee});if(d.state==="loading")return s.jsxs(Ma,{children:[V,ce,!v&&g===null?s.jsx(Gx,{}):null]});const{detail:te,at:le}=d,{task:Pe}=te,Le=m.find(z=>z.id===Pe.status_id),ue=te.local_done&&"task"in te.local_done?te.local_done:null,zt=te.local_waits??[],Je=ue?zt[0]??null:null,ct=Je?Z(Je.opened_by):te.owner_title??Z(te.thread),ye=b.state==="ok"?b.data:null,We=(ye==null?void 0:ye.lifecycle)==="finished",Gt=We&&(ye==null?void 0:ye.outcome)==="cancelled",An=We&&(ye==null?void 0:ye.outcome)==="complete",Nt=!!Pe.created_at,Ue=te.acceptance??[],Zt=te.local_owner_thread,Tt=Zt?s.jsx(l,{className:"text-primary hover:underline",href:r(Hx(e,Zt.key)),children:Zt.title}):te.owner_title??(Z(te.thread)||"None"),Vt=async()=>{var je;if(!ue||!((je=a.commands)!=null&&je.complete)||!await i({title:`Mark ${Pe.title} done?`,description:Je?`This answers ${ct}'s ask, “${Je.reason}”, closes that wait, and tells ${ct} to check and continue.`:`This tells ${ct||"its thread"} to check and continue.`,action_label:"Mark done"}))return;Y(!0);const de=await a.commands.complete(ue);if(Y(!1),!de.ok){O(de.refusal.message);return}await oe(),S({title:Pe.title,asker:ct||"Its thread"})},At=s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[ue&&!_?s.jsxs(s.Fragment,{children:[s.jsxs(q,{ref:R,type:"button",variant:"outline",disabled:B,"aria-disabled":D!==null?!0:void 0,"aria-describedby":D!==null?"task-done-why":void 0,onClick:()=>{D===null&&Vt()},children:[s.jsx($r,{className:"mr-2 size-4","aria-hidden":"true"}),"Done"]}),D!==null?s.jsx("span",{id:"task-done-why",className:"text-muted-foreground text-xs",children:"Read again first"}):null]}):null,A.button,s.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",as(le)]}),s.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:J,children:[s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsxs(Ma,{children:[s.jsxs("div",{ref:H,className:"contents",children:[s.jsx(Xi,{back:fe,id:Pe.id,copy:s.jsx($m,{text:Pe.id,label:"Copy ID",what:"the ID",variant:"ghost"}),badge:Le?s.jsx(pe,{variant:Wk(Le),children:Le.name}):null,title:Pe.title,created:Nt?`Created ${rs(Pe.created_at)}${ct||te.owner_title?` by ${te.owner_title??ct}`:""}`:null,actions:At}),A.panel?s.jsx("div",{className:"mt-1 max-w-180",children:A.panel}):null,V,ce,_?s.jsx("div",{ref:T,tabIndex:-1,role:"status","aria-live":"polite",className:"outline-none",children:s.jsxs(me,{variant:"success",className:"mt-4",children:[s.jsx(wd,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Marked ",_.title," done"]}),s.jsxs(xe,{children:[_.asker," is told to check and continue."]})]})}):null,D!==null?s.jsxs(me,{variant:"destructive",className:"mt-4",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Done was not recorded"}),s.jsxs(xe,{children:[D," Read again to see the task as it is now."]})]}):null,Je&&!_?s.jsxs(me,{variant:"warning",className:"mt-4",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:[ct," asks: ",Je.reason]}),s.jsxs(xe,{children:["Waiting on you since ",Px(Je.opened_at),". Done answers it and tells ",ct," to check and continue."]})]}):null,te.view_outdated?s.jsxs(me,{variant:"warning",className:"mt-4",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:Fl}),s.jsxs(xe,{children:[M," Until then this page cannot read the claim and holds."]})]}):null,s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx($s,{label:"Owner thread",value:Tt}),s.jsx($s,{label:"Release",value:te.release??"None"}),s.jsx($s,{label:"Session",value:b.state==="loading"?"Loading…":b.state==="failed"?"Not available":ye!=null&&ye.session?s.jsxs(s.Fragment,{children:[ye.session.provider," ",s.jsx("span",{className:"font-mono break-all",children:ye.session.id})]}):"None"}),s.jsx($s,{label:"Now",value:te.local_detail??(Le==null?void 0:Le.name)??""})]}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"Local tasks have no priority or contributors."}),s.jsx(yz,{detail:te,holder:Z((Lt=te.claim)==null?void 0:Lt.user_id),finished_at:We?(ye==null?void 0:ye.finished_at)??null:null,read_at:le}),s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(Po,{className:"text-info size-4","aria-hidden":"true"}),ue?s.jsxs(s.Fragment,{children:[s.jsx(Ne,{children:"Done is the one change this page makes"}),s.jsx(xe,{children:"Everything else about this task changes through its thread."})]}):s.jsxs(s.Fragment,{children:[s.jsx(Ne,{children:"This page only reads tasks"}),s.jsx(xe,{children:"A task changes through the agent thread working on it."})]})]}),Nt?ye!=null&&ye.record?s.jsxs("p",{className:"mt-4 flex flex-wrap items-center gap-2 text-sm",children:[s.jsxs("span",{children:["Record ",s.jsx("code",{className:"font-mono break-all",children:ye.record})]}),s.jsx($m,{text:ye.record,label:"Copy path",what:"the path",variant:"ghost"})]}):null:s.jsx("p",{className:"mt-4 text-sm",children:"No task record yet. This page shows what the threads and plans in this checkout say about it."}),ue?s.jsx($t,{id:"task-done-needs",title:"What Done needs",children:Ue.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-xs",children:["The task's acceptance; ",ct||"its thread"," checks these after Done."]}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:Ue.map(z=>s.jsx("li",{children:z},z))})]}):s.jsxs("p",{className:"text-sm",children:["Its thread gave no acceptance. Ask ",ct||"its thread"," what Done needs before marking it."]})}):Ue.length>0?s.jsxs($t,{id:"task-acceptance",title:"Acceptance",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:An?"All met: the task finished complete":Gt&&(ye!=null&&ye.finished_at)?`Cancelled ${rs(ye.finished_at)}`:"Met when the task finishes complete"}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:Ue.map(z=>s.jsx("li",{children:An?`Met: ${z}`:z},z))})]}):null,s.jsx(jz,{detail:te,waits:zt,given:ue!==null,threadName:Z,threadsLink:s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/threads`),children:"Threads"})}),b.state==="loading"?s.jsxs("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading the task's sections",children:[s.jsx(Rt,{className:"h-8 w-full"}),s.jsx(Rt,{className:"h-8 w-full"}),s.jsx(Rt,{className:"h-8 w-2/3"})]}):null,ye?s.jsx($t,{id:"task-stands",title:"Where it stands",children:s.jsxs("p",{className:"text-sm",children:[(Le==null?void 0:Le.name)??Pe.status_id,te.local_detail?` · ${te.local_detail}`:""]})}):null,ye!=null&&ye.time?s.jsx(bz,{time:ye.time}):null,s.jsx(wz,{sections:b,heading_ref:k,on_retry:()=>void ee("graph"),taskLink:z=>s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks/${z}?from=task:${Pe.id}`),children:z})}),ye!=null&&ye.files?s.jsx(_z,{files:ye.files,finished:We}):null,ye!=null&&ye.proof?s.jsx(Nz,{proof:ye.proof,finished_at:ye.finished_at,who:te.owner_title??null}):null,ye&&ye.history.length>0?s.jsx(kz,{history:ye.history}):null,s.jsx(i1,{related:N,heading_ref:$,on_retry:()=>void ee("related"),link:z=>{const de=z.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(z.id)}`:z.kind==="task"?`/org/${e}/tasks/${z.id}?from=task:${Pe.id}`:z.kind==="issue"?`/org/${e}/issues/${encodeURIComponent(z.id)}?from=task:${Pe.id}`:z.kind==="release"?`/releases?${z.planned?"planned":"release"}=${encodeURIComponent(z.id)}`:null;return de?s.jsx(l,{className:ie("text-primary hover:underline",z.kind!=="thread"&&z.label===z.id&&"font-mono"),href:r(de),children:z.label}):z.label}})]}),o]})}function Ma({children:e}){return s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 pb-8 sm:px-6 lg:px-8",children:e})}function Xi({back:e,id:t,copy:n,badge:a,title:r,created:l,actions:i}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("div",{children:e}),t?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[s.jsx("code",{className:"font-mono",children:t}),n,a]}):null,s.jsx(mn,{title:r,description:l??void 0,actions:i})]})}function $s({label:e,value:t}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("dt",{className:"text-muted-foreground text-xs",children:e}),s.jsx("dd",{className:"m-0 text-sm break-words",children:t})]})}function $t({id:e,title:t,aside:n,heading_ref:a,children:r}){return s.jsxs("section",{className:"mt-6","aria-labelledby":`${e}-title`,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[s.jsx("h2",{id:`${e}-title`,ref:a,tabIndex:a?-1:void 0,className:"text-lg font-semibold outline-none",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),s.jsx("div",{className:"mt-2",children:r})]})}function yz({detail:e,holder:t,finished_at:n,read_at:a}){const r=e.claim,[,l]=u.useReducer(f=>f+1,0),i=r&&!e.view_outdated?new Date(r.lease_expires_at).getTime():null;u.useEffect(()=>{if(i===null||!Number.isFinite(i))return;const f=i-Date.now();if(f<=0)return;const m=setTimeout(l,Math.min(f+50,2147483647));return()=>clearTimeout(m)},[i]);let o=s.jsx(Kp,{className:"size-4","aria-hidden":"true"}),c="Nobody is working on this",d=null;if(e.view_outdated)c=`Claimed by: ${r1}`;else if(r){const f=new Date(r.lease_expires_at)<=new Date(Math.max(Date.now(),new Date(a).getTime()));o=s.jsx(Vp,{className:"size-4","aria-hidden":"true"}),c=`${t} is working on this until ${as(r.lease_expires_at)}${f||r.lapsed?" · passed":""}`,d="Claimed in the coordination registry; its thread renews the claim."}else n&&(o=s.jsx(wd,{className:"size-4","aria-hidden":"true"}),d=`Finished ${rs(n)}. Its claim ended when it finished.`);return s.jsxs(xt,{className:"mt-4 flex flex-wrap items-center gap-3 p-3","data-testid":"task-claim",children:[o,s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-sm font-medium",children:c}),d?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:d}):null]})]})}function jz({detail:e,waits:t,given:n,threadName:a,threadsLink:r}){if(e.view_outdated)return s.jsx($t,{id:"task-holds",title:"Holds",children:s.jsx("p",{className:"text-sm",children:r1})});if(e.holds.length===0)return null;const l=new Map(t.map(i=>[i.id,i]));return s.jsxs($t,{id:"task-holds",title:`Holds · ${e.holds.length} open`,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"A hold does not change the task's status."}),s.jsx(xt,{className:"mt-2 overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Holds",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Type"}),s.jsx(X,{children:"Reason"}),s.jsx(X,{children:"Waiting on"}),s.jsx(X,{children:"Opened"})]})}),s.jsx(Xe,{children:e.holds.map(i=>{var f;const o=l.get(i.id),c=vo[i.hold_type],d=n?"Done above answers it":o!=null&&o.local_done?"In Waiting on you":(f=o==null?void 0:o.local_threads)!=null&&f.length?s.jsxs(s.Fragment,{children:["Answer it in ",r,": ",o.local_threads.join(" · ")]}):null;return s.jsxs(he,{"data-testid":"task-hold",children:[s.jsx(K,{children:s.jsx(pe,{variant:c.tone,children:(o==null?void 0:o.local_label)??c.label})}),s.jsxs(K,{children:[s.jsx("div",{children:i.reason}),s.jsxs("div",{className:"text-muted-foreground text-xs",children:["Opened by ",a(i.opened_by)]})]}),s.jsxs(K,{children:[s.jsx("div",{children:i.target.kind==="user"?"You":i.target.kind==="external"?i.target.label:"Another task"}),d?s.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null]}),s.jsx(K,{children:Px(i.opened_at)})]},i.id)})})]})})]})}function bz({time:e}){return s.jsx($t,{id:"task-time",title:"Time",children:s.jsxs("dl",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsx($s,{label:"Estimate",value:e.estimate?`${ji(e.estimate.low)}–${ji(e.estimate.high)}`:e.unknown_reason??"None"}),s.jsx($s,{label:"Time taken",value:e.elapsed!==null?`${ji(e.elapsed)}${e.over_estimate?" · over estimate":""}`:"Not started"}),e.forecast?s.jsx($s,{label:"Reforecast",value:s.jsxs("span",{className:"text-muted-foreground",children:[ji(e.forecast.low),"–",ji(e.forecast.high)," left",e.forecast.reason?` · ${e.forecast.reason}`:""]})}):null]})})}function Yx({what:e,again:t,refusal:n,on_retry:a}){const r=s1();return s.jsxs(me,{variant:"destructive",ref:r,children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Could not read ",e]}),s.jsxs(xe,{children:[s.jsx("p",{children:n.message}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:t})]})]})}function wz({sections:e,heading_ref:t,on_retry:n,taskLink:a}){const[r,l]=u.useState(!1);if(e.state==="loading")return null;const i=e.state==="failed"?e.refusal:e.data.graph.ok?null:e.data.graph.refusal;if(i)return s.jsx($t,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsx(Yx,{what:"graph changes",again:"Read graph changes again",refusal:i,on_retry:n})});const o=e.state==="ok"&&e.data.graph.ok?e.data.graph.data:null;if(!o)return null;if(o.exempt)return s.jsx($t,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsxs("p",{className:"text-sm",children:["This task changes no modeled design. Its plan says why: ",o.exempt,"."]})});if(o.changes.length===0)return null;const c=r?o.changes:o.changes.slice(0,a1),d=o.changes.length-c.length;return s.jsxs($t,{id:"task-graph",title:"Graph changes",aside:o.document,heading_ref:t,children:[s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Graph changes",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Change"}),s.jsx(X,{children:"Kind of change"}),s.jsx(X,{children:"Also in"}),s.jsx(X,{children:"In the plan"})]})}),s.jsx(Xe,{children:c.map(f=>s.jsxs(he,{children:[s.jsxs(K,{children:[s.jsx("div",{children:f.label}),s.jsx("div",{className:"text-muted-foreground text-xs",children:f.type})]}),s.jsx(K,{children:pz[f.change]}),s.jsx(K,{children:f.also_in.length===0?"No other task":f.also_in.map((m,h)=>s.jsxs(u.Fragment,{children:[h>0?", ":null,a(m.id)]},m.id))}),s.jsx(K,{children:f.planned?"Yes":s.jsx(pe,{variant:"warning",children:"No longer planned"})})]},`${f.id}:${f.planned}`))})]})}),d>0?s.jsxs("p",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm",children:[d," more changes in this task's plan slice.",s.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),children:["Show all ",o.changes.length]})]}):null]})}function _z({files:e,finished:t}){const[n,a]=u.useState(!1),r=n?e.paths:e.paths.slice(0,a1);return s.jsxs($t,{id:"task-files",title:"Files",children:[r.length>0?s.jsx("ul",{className:"grid gap-1 text-sm",children:r.map(l=>s.jsx("li",{children:s.jsx("span",{className:"font-mono break-all",children:l})},l))}):null,e.paths.length>r.length?s.jsxs(q,{type:"button",variant:"ghost",size:"sm",className:"mt-1",onClick:()=>a(!0),children:["Show all ",e.paths.length]}):null,e.landed?s.jsxs("p",{className:"mt-2 text-sm",children:["Landed ",s.jsx("span",{className:"font-mono",children:e.landed.sha.slice(0,10)})," · ",e.landed.files," files",t?"":" · becomes the proof when the task finishes"]}):null]})}function Nz({proof:e,finished_at:t,who:n}){return s.jsxs($t,{id:"task-proof",title:"Evidence and proof",children:[e.evidence?s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:e.evidence}):null,e.no_code?s.jsxs("p",{className:"mt-2 text-sm",children:["No code: ",e.no_code]}):e.commit?s.jsxs("p",{className:"mt-2 text-sm",children:["Proof ",s.jsx("span",{className:"font-mono",children:e.commit.slice(0,10)})," ·"," ",e.on_main?"on main":"not yet on main"]}):null,t?s.jsxs("p",{className:"text-muted-foreground mt-2 text-xs",children:["Finished ",rs(t),n?` by ${n}`:""]}):null]})}function kz({history:e}){return s.jsxs($t,{id:"task-history",title:"History",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"From the task record, newest first"}),s.jsx(xt,{className:"mt-2 overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"History",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"What"}),s.jsx(X,{children:"Who"}),s.jsx(X,{children:"When"})]})}),s.jsx(Xe,{children:e.map((t,n)=>s.jsxs(he,{children:[s.jsx(K,{children:t.what}),s.jsx(K,{children:t.who??"Its thread"}),s.jsx(K,{children:Px(t.at)})]},`${t.at}:${n}`))})]})})]})}function i1({id:e="task-related",related:t,heading_ref:n,on_retry:a,link:r,fixed:l=!1}){return t.state==="ok"&&t.data.length===0?null:s.jsx($t,{id:e,title:"Related",heading_ref:n,children:t.state==="loading"?s.jsxs("div",{className:"grid gap-2",role:"status","aria-label":"Loading related work",children:[s.jsx(Rt,{className:"h-8 w-full"}),s.jsx(Rt,{className:"h-8 w-full"}),s.jsx(Rt,{className:"h-8 w-2/3"})]}):t.state==="failed"?s.jsx(Yx,{what:"related work",again:"Read related work again",refusal:t.refusal,on_retry:a}):s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Related",className:l?"table-fixed":void 0,children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{className:l?"w-[14%]":void 0,children:"Kind"}),s.jsx(X,{className:l?"w-[45%]":void 0,children:"Item"}),s.jsx(X,{className:l?"w-[41%]":void 0,children:"How it relates"})]})}),s.jsx(Xe,{children:t.data.map(i=>s.jsxs(he,{children:[s.jsx(K,{children:xz[i.kind]}),s.jsx(K,{className:l?"break-words":void 0,children:r(i)}),s.jsx(K,{className:l?"break-words":void 0,children:i.relation})]},`${i.kind}:${i.planned?"planned:":""}${i.id}`))})]})})})}function Sz({org:e,task_id:t,from:n}){const a=Jo(),r=`/org/${e}/tasks`;return a.taskSections?s.jsx(vz,{org:e,task_id:t,from:n??null}):s.jsx(Cz,{task_id:t,back:r})}function Cz({task_id:e,back:t}){const{availability:n}=Jo(),[a,r]=u.useState({state:"loading"});return u.useEffect(()=>{let l=!0;return n().then(i=>{l&&r(i)}),()=>{l=!1}},[n]),a.state==="off"?s.jsx(Yu,{back:t}):s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:a.state==="active"?s.jsx(uz,{active:a,task_id:e,back:t}):a.state==="error"?s.jsxs(me,{variant:"destructive",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This task could not be loaded"}),s.jsx(xe,{children:"Check your connection and try again."})]}):a.state==="available"?s.jsx(Yu,{back:t}):s.jsx(Gx,{})})}function xs({children:e}){return s.jsx("p",{role:"alert",className:"text-destructive text-sm",children:e})}const Rz=["open","triaged","resolved","closed"],Fx=["low","normal","high","urgent"],Ez=["fixed","works_as_intended","planned","duplicate","wont_fix","cannot_reproduce"],Tz=["title","description","external_reference"],Fu={open:"Open",triaged:"Triaged",escalated:"Escalated",waiting_on_fix:"Waiting on fix",resolved:"Resolved",closed:"Closed"},o1={open:"warning",triaged:"info",escalated:"info",waiting_on_fix:"info",resolved:"success",closed:"neutral"},yo={low:"Low",normal:"Normal",high:"High",urgent:"Urgent"},Kx={fixed:"Fixed",works_as_intended:"Works as intended",planned:"Planned",duplicate:"Duplicate",wont_fix:"Won't fix",cannot_reproduce:"Cannot reproduce"},c1={title:"Title",description:"Description",external_reference:"External reference"},Az=[["year",365*24*3600],["month",30*24*3600],["week",7*24*3600],["day",24*3600],["hour",3600],["minute",60]];function Jc(e,t=Date.now()){const n=Math.round((new Date(e).getTime()-t)/1e3),a=new Intl.RelativeTimeFormat("en",{numeric:"auto"});for(const[r,l]of Az)if(Math.abs(n)>=l)return a.format(Math.round(n/l),r);return"just now"}function Om(e,t,n){const a=`/org/${encodeURIComponent(e)}/proj/${encodeURIComponent(t)}/support`;return n?`${a}/${encodeURIComponent(n)}`:a}function Xx(e,t){return e?t??"Not available":"A former member"}const Mz="the issue integration";function $z(e){return!e.created_by&&e.reporter_kind==="customer"?Mz:Xx(e.created_by,e.created_by_username)}function Oz(e,t){return!e.actor_id&&e.kind==="created"&&t.reporter_kind==="customer"?"The issue integration":Xx(e.actor_id,e.actor_username)}const Rc="not_set",Dz="Do not paste personal data. Leave out names, such as borrower names, and loan numbers; text shaped like an email address, phone number, or social security number is refused.";function zz({create:e,open:t,onOpenChange:n,onCreated:a}){const[r,l]=u.useState(""),[i,o]=u.useState(""),[c,d]=u.useState(!1),[f,m]=u.useState(""),[h,x]=u.useState(Rc),[j,v]=u.useState(!1),[y,g]=u.useState(null),p=u.useRef(null),b=()=>{l(""),o(""),d(!1),m(""),x(Rc),g(null),p.current=null},w=_=>{var S;return((S=y==null?void 0:y.personal_data)==null?void 0:S.field)===_?y.message:void 0},N=async _=>{if(_.preventDefault(),j)return;v(!0),p.current??(p.current=crypto.randomUUID());const S=await e({request_id:p.current,title:i.trim()||void 0,description:f||void 0,external_reference:r.trim()||void 0,priority:h===Rc?null:h});if(v(!1),!S.ok){S.refusal.status!==0&&(p.current=null),g(S.refusal);return}b(),a(S.data.issue,S.data.duplicates)},C=y&&!y.personal_data?y.message:void 0;return s.jsx(kn,{open:t,onOpenChange:_=>{_||b(),n(_)},children:s.jsx(Sn,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:N,className:"grid gap-4",children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"New support issue"}),s.jsx(Tn,{children:"Log one help-desk report. Text is shown exactly as entered."})]}),s.jsxs(me,{variant:"warning",children:[s.jsx(ln,{}),s.jsx(xe,{children:Dz})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-issue-reference",children:"External reference"}),s.jsx(Et,{id:"maintain-issue-reference",value:r,"aria-invalid":!!w("external_reference"),onChange:_=>{l(_.target.value),c||o(_.target.value)}}),w("external_reference")?s.jsx(xs,{children:w("external_reference")}):s.jsx("p",{className:"text-muted-foreground text-xs",children:"The help-desk ticket number."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-issue-title",children:"Title"}),s.jsx(Et,{id:"maintain-issue-title",value:i,"aria-invalid":!!w("title"),onChange:_=>{o(_.target.value),d(!0)}}),w("title")?s.jsx(xs,{children:w("title")}):s.jsx("p",{className:"text-muted-foreground text-xs",children:"Prefilled from the external reference; edit it if you like."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-issue-description",children:"Description"}),s.jsx(Fn,{id:"maintain-issue-description",rows:4,placeholder:"What the end user reported, without personal data",value:f,"aria-invalid":!!w("description"),onChange:_=>m(_.target.value)}),w("description")?s.jsx(xs,{children:w("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-issue-priority",children:"Priority"}),s.jsxs(wt,{value:h,onValueChange:x,children:[s.jsx(vt,{id:"maintain-issue-priority",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:Rc,children:"Not set"}),Fx.map(_=>s.jsx(Ae,{value:_,children:yo[_]},_))]})]})]}),C?s.jsx(xs,{children:C}):null,s.jsxs(Rn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>{b(),n(!1)},children:"Cancel"}),s.jsx(q,{type:"submit",loading:j,disabled:!i.trim()&&!r.trim(),children:"Log issue"})]})]})})})}const Lz=["supportAccess","assigneeCandidates","create","update","assign","transition","redact"];function u1(){return Uz(Nn().issues)}function Uz(e){return e&&Lz.every(t=>typeof e[t]=="function")?e:null}function d1(e){const[t,n]=u.useState(null);return u.useEffect(()=>{if(!e)return;let a=!1;return e.supportAccess().then(r=>{a||n({contract:e,state:r.ok?{state:"ready",access:r.data}:{state:"error"}})}),()=>{a=!0}},[e]),t&&e&&t.contract===e?t.state:{state:"loading"}}function f1({access:e,header:t,back_href:n,children:a}){const{href:r,Link:l}=Ze();return e.state==="loading"?s.jsxs("div",{className:"flex flex-1 items-center justify-center py-24",children:[s.jsx(dn,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Loading…"})]}):e.state==="error"||!e.access.enabled?s.jsx(Wa,{title:"Page not found",description:"This page does not exist or you do not have access to it.",backHref:r(n),backLabel:"Back to the project",link:l}):e.access.can_view?s.jsx(s.Fragment,{children:a(e.access)}):s.jsxs(s.Fragment,{children:[t,s.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[s.jsx(AE,{className:"text-muted-foreground size-8","aria-hidden":!0}),s.jsx("h2",{className:"text-lg font-semibold",children:"Support needs a Maintain seat"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:e.access.seat?"You need read permission on this project to see its support issues; ask an organization admin.":"You need a Maintain seat to see this project's support issues; ask an organization admin."})]})]})}function Bz(){const e=Ze();return t=>{e.navigate?e.navigate(t):window.location.assign(e.href(t))}}const zn="all",Ec=25;function Dm({action:e}){return s.jsx(mn,{title:"Support",description:"Help-desk reports logged against this project.",actions:e})}function Hz({org:e,project:t,query:n}){const a=u1(),r=d1(a),l=`/org/${e}/proj/${t}`;return s.jsx("div",{className:"flex w-full flex-1 flex-col gap-6 px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(f1,{access:r,header:s.jsx(Dm,{}),back_href:l,children:i=>a?s.jsx(Iz,{contract:a,access:i,org_name:e,proj_name:t,query:n}):null})})}function Iz({contract:e,access:t,org_name:n,proj_name:a,query:r}){const{href:l,Link:i}=Ze(),o=Bz(),[c,d]=u.useState(()=>new URLSearchParams(r).get("external_reference")??""),[f,m]=u.useState(zn),[h,x]=u.useState(zn),[j,v]=u.useState(zn),[y,g]=u.useState(0),[p,b]=u.useState(null),[w,N]=u.useState(0),[C,_]=u.useState(null),[S,D]=u.useState([]),[O,B]=u.useState(!1),Y=c.trim()!==""||f!==zn||h!==zn||j!==zn,H=u.useCallback(async()=>{const k=await e.list({external_reference:c.trim()||void 0,status:f===zn?void 0:f,priority:h===zn?void 0:h,assignee:j===zn?void 0:j,limit:Ec,offset:y*Ec});if(!k.ok){_(k.refusal.message);return}_(null),b(k.data.issues),N(k.data.total)},[e,c,f,h,j,y]);u.useEffect(()=>{const k=setTimeout(()=>void H(),200);return()=>clearTimeout(k)},[H]),u.useEffect(()=>{e.assigneeCandidates().then(k=>{k.ok&&D(k.data.candidates)})},[e]);const M=t.can_change?s.jsxs(q,{onClick:()=>B(!0),children:[s.jsx(jr,{className:"mr-2 size-4"}),"New issue"]}):void 0,A=s.jsx(zz,{create:e.create,open:O,onOpenChange:B,onCreated:(k,$)=>{B(!1);const P=Om(n,a,k.id);o($.length?`${P}?duplicates=${$.length}`:P)}});if(p!==null&&w===0&&!Y&&y===0)return s.jsxs(s.Fragment,{children:[s.jsx(Dm,{}),s.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[s.jsx(kE,{className:"text-muted-foreground size-8","aria-hidden":!0}),s.jsx("h2",{className:"text-lg font-semibold",children:"No support issues yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Log a help-desk report under its ticket number, so every report is counted once."}),t.can_change?s.jsxs(q,{onClick:()=>B(!0),children:[s.jsx(jr,{className:"mr-2 size-4"}),"Log the first issue"]}):null]}),A]});const R=w===0?0:y*Ec+1,T=Math.min(w,(y+1)*Ec);return s.jsxs(s.Fragment,{children:[s.jsx(Dm,{action:M}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"relative w-full max-w-sm",children:[s.jsx(XE,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2","aria-hidden":!0}),s.jsx(Et,{"aria-label":"Filter by external reference",placeholder:"Filter by external reference",className:"pl-9",value:c,onChange:k=>{d(k.target.value),g(0)}})]}),s.jsx(lh,{label:"Status",value:f,onChange:k=>{m(k),g(0)},options:Rz.map(k=>({value:k,label:Fu[k]}))}),s.jsx(lh,{label:"Priority",value:h,onChange:k=>{x(k),g(0)},options:Fx.map(k=>({value:k,label:yo[k]}))}),s.jsx(lh,{label:"Assignee",value:j,onChange:k=>{v(k),g(0)},options:[{value:"unassigned",label:"Unassigned"},{value:"cannot_act",label:"Assignee cannot act"},...S.map(k=>({value:k.user_id,label:k.username??"Not available"}))]})]}),C?s.jsx(xs,{children:C}):null,s.jsx("div",{className:"rounded-md border",children:s.jsxs(Ke,{children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Title"}),s.jsx(X,{children:"External reference"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Priority"}),s.jsx(X,{children:"Assignee"}),s.jsx(X,{children:"Updated"})]})}),s.jsx(Xe,{children:p===null?s.jsx(he,{children:s.jsx(K,{colSpan:6,className:"h-24 text-center",children:"Loading…"})}):p.length===0?s.jsx(he,{children:s.jsx(K,{colSpan:6,className:"h-24 text-center",children:"No issues match these filters."})}):p.map(k=>s.jsxs(he,{children:[s.jsx(K,{className:"max-w-md",children:s.jsx(i,{href:l(Om(n,a,k.id)),className:"font-medium hover:underline",children:k.title})}),s.jsx(K,{className:"font-mono text-xs",children:k.external_reference??""}),s.jsx(K,{children:s.jsx(pe,{variant:o1[k.status],children:Fu[k.status]})}),s.jsx(K,{children:k.priority?yo[k.priority]:""}),s.jsx(K,{children:s.jsx(Pz,{issue:k})}),s.jsx(K,{className:"text-muted-foreground",children:Jc(k.updated_at)})]},k.id))})]})}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:w===0?"No issues.":`Showing ${R}–${T} of ${w} issue${w===1?"":"s"}.`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{variant:"outline",size:"sm",disabled:y===0,onClick:()=>g(k=>Math.max(0,k-1)),children:"Previous"}),s.jsx(q,{variant:"outline",size:"sm",disabled:T>=w,onClick:()=>g(k=>k+1),children:"Next"})]})]}),A]})}function Pz({issue:e}){return e.assignee_id?s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{children:e.assignee_username??"Not available"}),e.assignee_can_act===!1?s.jsx(pe,{variant:"error",children:"Assignee cannot act"}):null]}):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}function lh({label:e,value:t,onChange:n,options:a}){var l;const r=u.useMemo(()=>t===zn||a.some(i=>i.value===t),[a,t]);return s.jsxs(wt,{value:r?t:zn,onValueChange:n,children:[s.jsx(vt,{className:"w-44","aria-label":e,children:s.jsx(_t,{placeholder:e,children:t===zn?e:(l=a.find(i=>i.value===t))==null?void 0:l.label})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:zn,children:"All"}),a.map(i=>s.jsx(Ae,{value:i.value,children:i.label},i.value))]})]})}function Cr(e,t){u.useEffect(()=>{const n=setInterval(()=>{document.visibilityState==="visible"&&e("tick")},t),a=()=>{document.visibilityState==="visible"&&e("shown")};return document.addEventListener("visibilitychange",a),()=>{clearInterval(n),document.removeEventListener("visibilitychange",a)}},[e,t])}const qz=5e3;function ys(){const e=u.useRef(0),t=u.useRef(null);return u.useEffect(()=>()=>{t.current!==null&&clearTimeout(t.current)},[]),u.useMemo(()=>({owed:()=>e.current>0,busy:()=>e.current>0||t.current!==null,track:async n=>{e.current+=1;try{return await n}finally{e.current-=1,t.current!==null&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null},qz)}}}),[])}function Qx(e,t){return n=>{(n==="shown"?e.owed():e.busy())||t()}}const h1=[{key:"local",label:"Local"},{key:"staging",label:"Staging"},{key:"production",label:"Production"}],Gz=/^iss-\d{1,9}$/,Vz=/^col-\d{1,9}$/,Yz=e=>e&&e[0].toUpperCase()+e.slice(1);function m1(e){const t=Yz(e.status_word??e.status.replace(/_/g," ")),n=e.group??(e.status==="resolved"?"resolved":"unplaced");return n==="resolved"?{label:t,tone:e.resolution_reason==="fixed"?"success":"neutral"}:n==="unowned"||n==="routed"?{label:t,tone:"warning"}:n==="fixing"?{label:t,tone:"info"}:{label:t,tone:"neutral"}}function Qi(e,t=Date.now()){if(!e)return"";const n=Math.max(0,(t-Date.parse(e))/1e3);return Number.isFinite(n)?n<60?"just now":n<3600?`${Math.round(n/60)}m ago`:n<86400?`${Math.round(n/3600)}h ago`:`${Math.round(n/86400)}d ago`:""}const zm={search:"",owner:null,urgent:!1,seen:[],label:null,collection:null};function eu(e){const t=new URLSearchParams(e),n=t.getAll("seen").filter(r=>h1.some(l=>l.key===r)),a=t.get("collection");return{search:t.get("search")??"",owner:t.get("owner")||null,urgent:t.get("urgent")==="1",seen:[...new Set(n)],label:t.get("label")||null,collection:a&&Vz.test(a)?a:null}}function ul(e){const t=new URLSearchParams;e.search&&t.set("search",e.search),e.owner&&t.set("owner",e.owner),e.urgent&&t.set("urgent","1");for(const n of e.seen)t.append("seen",n);return e.label&&t.set("label",e.label),e.collection&&t.set("collection",e.collection),t.toString()}function Fz(e){return{search:e.search.trim()||void 0,owner:e.owner??void 0,urgent:e.urgent||void 0,seen:e.seen.length?e.seen:void 0,label:e.label?[e.label]:void 0,collection:e.collection??void 0}}const by=e=>!!(e.search.trim()||e.owner||e.urgent||e.seen.length||e.label||e.collection),Kz={agent:"Filed by an agent",user:"Filed by you",tool:"Filed by a tool"},Xz={graph:"Placed on the graph by its anchors",files:"Placed by its files",unplaced:"Triaged, not placed yet"},Qz={handoff:"Handed to its owner",backlog:"Sent to the unowned backlog",batch:"Routed to a batch"};function Wz(e,t=""){const n=(e??t).trim();if(!n)return"";const a=n.indexOf(": "),r=(a===-1?n:n.slice(0,a)).trim(),l=a===-1?"":n.slice(a+2).trim(),i=o=>l?`${o} ${l}`:o;switch(r){case"filed":return Kz[l]??i("Filed by");case"labelled":return i("Labelled");case"unlabelled":return l?`Label removed: ${l}`:"Label removed";case"anchored":return l?`Anchored to ${l}`:"Anchored";case"triaged":return Xz[l]??(l?`Triaged: ${l}`:"Triaged");case"routed":return Qz[l]??(l?`Routed: ${l}`:"Routed");case"route closed":return l==="backlog"?"Taken off the unowned backlog":l?`Route closed: ${l}`:"Route closed";case"released":return l?`Released by its owner (task ${l})`:"Released by its owner";case"resolved":return l==="duplicate"?"Resolved as a duplicate":l?`Resolved · ${l.replace(/_/g," ")}`:"Resolved";case"reopened":return l?`Reopened: ${l}`:"Reopened";case"fix landed":return l?`Fix landed in ${l.slice(0,10)}`:"Fix landed";case"merged":return l?`Merged ${l} into this issue`:"Merged a duplicate into this issue";default:return n}}const Zz=e=>e.replace(/`+/g,"").replace(/\s+/g," ").trim(),p1="This page only reads issues",x1="File, route and resolve issues with the issue command or through the thread working on them.",Jz=10,g1=1e4,e3=250,Vr="__all",t3="none",n3=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function v1(){const e=Nn().issues;if(!e)throw new Error("The Issues page rendered without the issues seam.");return e}const s3=e=>({read_at:e,scope:"project",folder:null,groups:[],facets:{owners:[],labels:[],urgent:0,seen:{local:0,staging:0,production:0}},listed:0,collections:[]});function a3({org:e,project:t,query:n,onQuery:a}){var ce,Ee;const r=v1(),l=(ce=r.commands)==null?void 0:ce.open_thread,i=u.useMemo(()=>l?{org:e,open_thread:l}:void 0,[e,l]),{href:o,Link:c}=Ze(),d=u.useMemo(()=>eu(n),[n]),f=ul(d),m=by(d),[h,x]=u.useState({state:"loading"}),[j,v]=u.useState(null),[y,g]=u.useState(null),p=u.useRef(0),b=u.useRef(0),w=u.useRef(null),N=u.useRef(null),C=us(),_=u.useRef(!1),[S,D]=u.useState(d.search),O=u.useCallback(V=>a(ul({...d,...V})),[d,a]),B=ys(),Y=u.useCallback(async()=>{const V=b.current+=1;g(null);const te=await B.track(r.list(Fz(eu(f))));if(V!==b.current)return;if(te.ok){p.current=0,v(null),x({state:"ok",list:te.data,local:te.data.local??s3(new Date().toISOString()),key:f});return}const le=te.refusal.reason;if(le==="engine_missing")return x({state:"engine_missing",refusal:te.refusal});if(le==="view_outdated")return x({state:"view_outdated"});if(p.current+=1,p.current===1&&n3(te.refusal)){g(te.refusal.retry_after??Jz);return}v(te.refusal)},[r.list,f,B]);u.useEffect(()=>{Y()},[Y]);const H=u.useMemo(()=>Qx(B,()=>void Y()),[Y,B]);Cr(H,g1),u.useEffect(()=>{if(y===null)return;const V=setTimeout(()=>{document.visibilityState==="visible"&&Y()},y*1e3);return()=>clearTimeout(V)},[y,Y]),u.useEffect(()=>{document.activeElement!==w.current&&D(d.search)},[d.search]),u.useEffect(()=>{if(S===d.search)return;const V=setTimeout(()=>O({search:S}),e3);return()=>clearTimeout(V)},[S,d.search,O]),u.useEffect(()=>{const V=te=>{if(te.key!=="/"||te.metaKey||te.ctrlKey||te.altKey)return;const le=te.target;le&&(le.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(le.tagName))||w.current&&(te.preventDefault(),w.current.focus())};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[]);const M=()=>{var V;D(""),a(ul(zm)),(V=w.current)==null||V.focus()},A=()=>{p.current=0,Y()},R=()=>{_.current=!0,A()};u.useEffect(()=>{var te;if(!_.current||h.state==="loading"||y!==null)return;_.current=!1;const V=(te=N.current)==null?void 0:te.querySelector("h1");V&&(V.tabIndex=-1,V.focus())},[h,j,y]);const T=Vx(N),k=V=>`/proj/${encodeURIComponent(t)}/issues${V?`?${V}`:""}`,$=V=>`/proj/${encodeURIComponent(t)}/issues/${encodeURIComponent(V)}?from=issues${f?`&${f}`:""}`,P=s.jsx("div",{role:"status","aria-live":"polite",children:y!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(dn,{"aria-hidden":"true"}),"Issues are busy. Reading them again…"]}):null}),E=j?s.jsxs(me,{ref:T,variant:"destructive",className:"mt-4",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Issues could not be loaded"}),s.jsxs(xe,{children:[s.jsxs("p",{children:[j.message,j.since?` Since ${as(j.since)}.`:"",h.state==="ok"?` The list below was read at ${as(h.local.read_at)}.`:"",j.message.includes(br)?"":` ${br}`]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:R,children:"Retry"})]})]}):null,I=s.jsx(mn,{title:"Issues",description:"This repository's local issues: what agents and you reported, where triage placed each, and what fixes it.",actions:h.state==="ok"?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",as(h.local.read_at)]}),s.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:A,children:[s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]}):null});if(h.state==="engine_missing")return s.jsx(Tc,{ref:N,children:s.jsx(ha,{page:"Issues"})});if(h.state==="view_outdated")return s.jsxs(Tc,{ref:N,children:[I,s.jsxs(me,{variant:"warning",className:"mt-6",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:Fl}),s.jsx(xe,{children:C})]})]});if(h.state==="loading")return s.jsxs(Tc,{ref:N,children:[I,P,E,!j&&y===null?s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading issues",children:Array.from({length:6},(V,te)=>s.jsx(Rt,{className:te===5?"h-10 w-2/3":"h-10 w-full"},te))}):null]});const{list:F,local:Q}=h,oe=!j&&y===null&&(h.key!==f||S!==d.search),ge=by(eu(h.key)),Z=Q.scope==="folder",J=Q.listed===0&&!m,re=Math.max(0,Q.listed-Q.facets.owners.reduce((V,te)=>V+te.count,0)),ee=d.collection?((Ee=Q.collections.find(V=>V.collection===d.collection))==null?void 0:Ee.title)??d.collection:null,fe=new Map;for(const V of F.issues){const te=V.group??"unplaced";fe.set(te,[...fe.get(te)??[],V])}return s.jsxs(Tc,{ref:N,children:[I,Z&&Q.folder?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Issues of the folder ",Q.folder,", from its issue store."]}):null,s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(Po,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:p1}),s.jsx(xe,{children:x1})]}),P,E,J?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(jE,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No issues yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Issues filed in this repository with the issue command appear here."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-3",children:[s.jsx(Et,{ref:w,type:"search",className:"w-64","aria-label":"Search issues",placeholder:"Search issues",value:S,onChange:V=>D(V.target.value)}),s.jsxs(wt,{value:d.owner??Vr,onValueChange:V=>O({owner:V===Vr?null:V}),children:[s.jsx(vt,{className:"w-56","aria-label":"Owner",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:Vr,children:"All owners"}),s.jsxs(Ae,{value:t3,children:["Unowned (",re,")"]}),Q.facets.owners.map(V=>s.jsxs(Ae,{value:V.key,children:[V.title," (",V.count,")"]},V.key))]})]}),s.jsxs(wt,{value:d.label??Vr,onValueChange:V=>O({label:V===Vr?null:V}),children:[s.jsx(vt,{className:"w-48","aria-label":"Label",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:Vr,children:"All labels"}),Q.facets.labels.map(V=>s.jsxs(Ae,{value:V.label,children:[V.label," (",V.count,")"]},V.label))]})]})]}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-2",children:[s.jsx("div",{className:"flex flex-wrap items-center gap-2",role:"group","aria-label":"Marks",children:s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:jl,"aria-pressed":d.urgent,onClick:()=>O({urgent:!d.urgent}),children:["Urgent ",Q.facets.urgent]})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",role:"group","aria-label":"Seen on",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Seen on"}),h1.map(V=>{const te=d.seen.includes(V.key);return s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:jl,"aria-pressed":te,onClick:()=>O({seen:te?d.seen.filter(le=>le!==V.key):[...d.seen,V.key]}),children:[V.label," ",Q.facets.seen[V.key]]},V.key)}),ee!==null?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsxs("span",{"data-testid":"issues-collection-chip",className:ie(Md({variant:"outline",size:"sm"}),MM),children:["Collection ",ee]}),s.jsx(q,{type:"button",variant:"ghost",size:"sm-icon","aria-label":"Remove the collection filter",onClick:()=>{var V;O({collection:null}),(V=w.current)==null||V.focus()},children:s.jsx(kd,{className:"size-4","aria-hidden":"true"})})]}):null]})]}),s.jsx("div",{role:"status","aria-live":"polite",children:oe?s.jsxs("p",{className:"text-muted-foreground mt-3 flex items-center gap-2 text-sm",children:[s.jsx(dn,{"aria-hidden":"true"}),"Searching…"]}):m&&F.total>0?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:[F.total," of ",Q.listed," issues ·"," ",s.jsx(q,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:M,children:"Clear"})]}):null}),s.jsx("div",{"data-testid":"issues-results","aria-busy":oe||void 0,className:"shrink-0 transition-opacity aria-busy:opacity-50",children:ge&&F.total===0?s.jsxs("p",{className:"mt-6 flex items-center gap-2 text-sm",children:[s.jsx(Nd,{className:"text-muted-foreground size-4","aria-hidden":"true"}),"No issues match."," ",s.jsx(q,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:M,children:"Clear"})]}):Q.groups.map(V=>s.jsx(l3,{id:`issues-${V.key}`,title:`${V.label} · ${V.count}`,issues:fe.get(V.key)??[],folder:Z,threads:i,link:te=>s.jsx(c,{className:"text-primary hover:underline",href:o($(te.id)),children:te.title})},V.key))}),!m&&Q.collections.length>0?s.jsxs("section",{className:"mt-8","aria-labelledby":"issues-collections-title",children:[s.jsxs("h2",{id:"issues-collections-title",className:"text-lg font-semibold",children:["Collections · ",Q.collections.length]}),s.jsx(xt,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Collections",className:"table-fixed",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{className:"w-1/2",children:"Collection"}),s.jsx(X,{className:"w-1/4",children:"Resolved"}),s.jsx(X,{className:"w-1/4",children:"Updated"})]})}),s.jsx(Xe,{children:Q.collections.map(V=>s.jsxs(he,{children:[s.jsxs(K,{children:[s.jsx(c,{className:"text-primary hover:underline",href:o(k(ul({...zm,collection:V.collection}))),children:V.title}),s.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:V.collection})]}),s.jsxs(K,{children:[V.resolved," of ",V.total," resolved"]}),s.jsx(K,{className:"text-muted-foreground",children:Qi(V.updated_at)})]},V.collection))})]})})]}):null]})]})}const Tc=u.forwardRef(function({children:t},n){return s.jsx("div",{ref:n,className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 pb-8 sm:px-6 lg:px-8",children:t})}),r3={plain:{title:"w-[36%]",issue:"w-[10%]",project:"",status:"w-[16%]",urgent:"w-[8%]",owner:"w-[18%]",updated:"w-[12%]"},folder:{title:"w-[30%]",issue:"w-[10%]",project:"w-[12%]",status:"w-[16%]",urgent:"w-[8%]",owner:"w-[14%]",updated:"w-[12%]"},actions:{title:"w-[30%]",issue:"w-[9%]",project:"",status:"w-[14%]",urgent:"w-[7%]",owner:"w-[16%]",updated:"w-[10%]"},folderActions:{title:"w-[26%]",issue:"w-[8%]",project:"w-[11%]",status:"w-[13%]",urgent:"w-[7%]",owner:"w-[12%]",updated:"w-[9%]"}};function l3({id:e,title:t,issues:n,folder:a,link:r,threads:l}){const i=r3[l?a?"folderActions":"actions":a?"folder":"plain"],o=6+(a?1:0)+(l?1:0);return s.jsxs("section",{className:"mt-6","aria-labelledby":`${e}-title`,"data-testid":"issues-group",children:[s.jsx("h2",{id:`${e}-title`,className:"text-lg font-semibold",children:t}),s.jsx(xt,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:t,className:ie("table-fixed",l&&"min-w-5xl"),children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{className:i.title,children:"Title"}),s.jsx(X,{className:i.issue,children:"Issue"}),a?s.jsx(X,{className:i.project,children:"Project"}):null,s.jsx(X,{className:i.status,children:"Status"}),s.jsx(X,{className:i.urgent,children:"Urgent"}),s.jsx(X,{className:i.owner,children:"Owner"}),s.jsx(X,{className:i.updated,children:"Updated"}),l?s.jsx(X,{className:"w-[14%] text-right",children:"Actions"}):null]})}),s.jsx(Xe,{children:n.map(c=>s.jsx(i3,{issue:c,folder:a,link:r,threads:l,columns:o},c.id))})]})})]})}function i3({issue:e,folder:t,link:n,threads:a,columns:r}){var c;const{button:l,panel:i}=Wd({org:(a==null?void 0:a.org)??"",action:a?e.local_action:void 0,task_id:null,issue:e.id,open_thread:a==null?void 0:a.open_thread}),o=m1(e);return s.jsxs(s.Fragment,{children:[s.jsxs(he,{"data-testid":"issues-row",className:i?"border-b-0":void 0,children:[s.jsxs(K,{className:"break-words",children:[n(e),(c=e.labels)!=null&&c.length?s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.labels.map(d=>s.jsx(pe,{variant:"neutral",size:"dense",children:d},d))}):null]}),s.jsx(K,{className:"font-mono text-xs",children:e.id}),t?s.jsx(K,{className:"break-words",children:e.project_id??"Folder"}):null,s.jsx(K,{children:s.jsx(pe,{variant:o.tone,children:o.label})}),s.jsx(K,{children:e.urgent&&e.status!=="resolved"&&e.group!=="resolved"?s.jsx(pe,{variant:"warning",children:"Urgent"}):null}),s.jsx(K,{className:"break-words",children:e.owner_title?e.owner_title:s.jsx("span",{className:"text-muted-foreground",children:"Unowned"})}),s.jsx(K,{className:"text-muted-foreground",children:Qi(e.updated_at)}),a?s.jsx(K,{className:"text-right whitespace-nowrap",children:l}):null]}),i?s.jsx(he,{"data-testid":"issues-row-panel",className:"hover:bg-transparent",children:s.jsx(K,{colSpan:r,className:"pt-0",children:s.jsx("div",{className:"max-w-180 pl-4 text-left whitespace-normal",children:i})})}):null]})}function o3(e){var t;return(t=Nn().issues)!=null&&t.issueSections?s.jsx(a3,{...e}):s.jsx(Hz,{org:e.org,project:e.project,query:e.query})}function c3({update:e,issue:t,open:n,onOpenChange:a,onDone:r,onReload:l}){const[i,o]=u.useState(t.title),[c,d]=u.useState(t.description),[f,m]=u.useState(t.external_reference??""),[h,x]=u.useState(t),[j,v]=u.useState(null),[y,g]=u.useState(!1);u.useEffect(()=>{n&&(o(t.title),d(t.description),m(t.external_reference??""),x(t),v(null))},[n]);const p=N=>{var C;return((C=j==null?void 0:j.personal_data)==null?void 0:C.field)===N?j.message:void 0},b=async N=>{N.preventDefault(),g(!0);const C=await e(h.id,h.revision,{title:i,description:c,external_reference:f.trim()||null});if(g(!1),!C.ok){v(C.refusal);return}r(C.data.issue)},w=async()=>{const N=await l();N&&(x(N),v(null))};return s.jsx(kn,{open:n,onOpenChange:a,children:s.jsx(Sn,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:b,className:"grid gap-4",children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"Edit issue"}),s.jsx(Tn,{children:"Text is shown exactly as entered."})]}),j!=null&&j.conflict?s.jsxs(me,{variant:"destructive",children:[s.jsx(lt,{}),s.jsx(xe,{children:"Someone else saved this issue after you opened it, so nothing was saved. Your text is kept below; reload the latest issue, then save to apply it."})]}):null,s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-edit-title",children:"Title"}),s.jsx(Et,{id:"maintain-edit-title",value:i,"aria-invalid":!!p("title"),onChange:N=>o(N.target.value)}),p("title")?s.jsx(xs,{children:p("title")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-edit-description",children:"Description"}),s.jsx(Fn,{id:"maintain-edit-description",rows:4,value:c,"aria-invalid":!!p("description"),onChange:N=>d(N.target.value)}),p("description")?s.jsx(xs,{children:p("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-edit-reference",children:"External reference"}),s.jsx(Et,{id:"maintain-edit-reference",value:f,"aria-invalid":!!p("external_reference"),onChange:N=>m(N.target.value)}),p("external_reference")?s.jsx(xs,{children:p("external_reference")}):null]}),j&&!j.conflict&&!j.personal_data?s.jsx(xs,{children:j.message}):null,s.jsxs(Rn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),j!=null&&j.conflict?s.jsxs(q,{type:"button",variant:"outline",onClick:w,children:[s.jsx(Or,{className:"mr-2 size-4"}),"Reload latest"]}):null,s.jsx(q,{type:"submit",loading:y,disabled:!!(j!=null&&j.conflict),children:"Save"})]})]})})})}function wy(e){return e.map(t=>c1[t].toLowerCase()).join(", ")}function u3(e){switch(e.kind){case"created":return"Logged the issue";case"updated":return`Edited the ${wy(e.fields)}`;case"redacted":return`Redacted the ${wy(e.fields)}`;case"priority_set":return e.priority?`Set priority to ${yo[e.priority]}`:"Cleared the priority";case"assigned":return`Assigned to ${e.assignee_id?e.assignee_username??"someone whose name is not available":"a former member"}`;case"unassigned":return"Unassigned the issue";case"transitioned":{if(e.from_status==="resolved"&&e.to_status==="open")return"Reopened the issue";const t=e.to_status?Fu[e.to_status]:"";return e.resolution_reason?`Moved to ${t}: ${Kx[e.resolution_reason]}`:`Moved to ${t}`}}}function _y(e,t){return t==="external_reference"?e.external_reference??"":e[t]}function d3({redact:e,issue:t,open:n,onOpenChange:a,onDone:r,onReload:l}){const[i,o]=u.useState("description"),[c,d]=u.useState(""),[f,m]=u.useState(!1),[h,x]=u.useState(null),[j,v]=u.useState(t);u.useEffect(()=>{n&&(v(t),d(_y(t,i)),x(null))},[n]);const y=async g=>{g.preventDefault(),m(!0);const p=await e(j.id,j.revision,i,c);if(m(!1),!p.ok){if(p.refusal.conflict){const b=await l();b&&v(b),x("Someone else saved this issue after you opened it. The latest issue is loaded and your replacement is kept; redact again to apply it.");return}x(p.refusal.message);return}r(p.data.issue)};return s.jsx(kn,{open:n,onOpenChange:a,children:s.jsx(Sn,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:y,className:"grid gap-4",children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"Redact text"}),s.jsx(Tn,{children:"Replace text that holds personal data, such as a name."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-redact-field",children:"Field"}),s.jsxs(wt,{value:i,onValueChange:g=>{const p=g;o(p),d(_y(j,p))},children:[s.jsx(vt,{id:"maintain-redact-field",children:s.jsx(_t,{})}),s.jsx(yt,{children:Tz.map(g=>s.jsx(Ae,{value:g,children:c1[g]},g))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-redact-replacement",children:"Replacement text"}),s.jsx(Fn,{id:"maintain-redact-replacement",rows:4,value:c,onChange:g=>d(g.target.value)})]}),s.jsxs(me,{variant:"warning",children:[s.jsx(ln,{}),s.jsx(xe,{children:"This cannot be undone: the original text is removed for good. History records only that this field was redacted."})]}),h?s.jsx(xs,{children:h}):null,s.jsxs(Rn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(q,{type:"submit",variant:"destructive",loading:f,children:"Redact"})]})]})})})}function f3({transition:e,issue:t,open:n,onOpenChange:a,onDone:r}){const[l,i]=u.useState("fixed"),[o,c]=u.useState(!1),[d,f]=u.useState(null),m=async h=>{h.preventDefault(),c(!0);const x=await e(t.id,t.revision,"resolved",l);if(c(!1),!x.ok){if(x.refusal.conflict){r(null);return}f(x.refusal.message);return}f(null),r(x.data.issue)};return s.jsx(kn,{open:n,onOpenChange:a,children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:m,className:"grid gap-4",children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"Resolve issue"}),s.jsx(Tn,{children:"Choose how this report ended."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"maintain-resolution-reason",children:"Resolution reason *"}),s.jsxs(wt,{value:l,onValueChange:h=>i(h),children:[s.jsx(vt,{id:"maintain-resolution-reason",children:s.jsx(_t,{})}),s.jsx(yt,{children:Ez.map(h=>s.jsx(Ae,{value:h,children:Kx[h]},h))})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Reopening the issue clears its reason."})]}),d?s.jsx(xs,{children:d}):null,s.jsxs(Rn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(q,{type:"submit",loading:o,children:"Resolve"})]})]})})})}const Yr="not_set";function h3({org:e,project:t,issue_id:n,query:a}){const r=u1(),l=d1(r),i=Om(e,t);return s.jsx("div",{className:"flex w-full flex-1 flex-col gap-6 px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(f1,{access:l,header:s.jsx(mn,{title:"Support"}),back_href:i,children:o=>r?s.jsx(m3,{contract:r,issue_id:n,access:o,list_href:i,duplicates:Number(new URLSearchParams(a).get("duplicates")??0)}):null})})}function m3({contract:e,issue_id:t,access:n,list_href:a,duplicates:r}){const{href:l,Link:i}=Ze(),o=Mr(),[c,d]=u.useState(null),[f,m]=u.useState([]),[h,x]=u.useState(!1),[j,v]=u.useState([]),[y,g]=u.useState(null),p=u.useCallback(async()=>{const _=await e.issue(t);return _.ok?(d(_.data.issue),m(_.data.events),_.data.issue):(_.refusal.status===404?x(!0):o.error(_.refusal.message),null)},[e,t,o]);u.useEffect(()=>{let _=!1;return e.issue(t).then(S=>{if(!_){if(!S.ok){S.refusal.status===404?x(!0):o.error(S.refusal.message);return}d(S.data.issue),m(S.data.events)}}),()=>{_=!0}},[e,t]),u.useEffect(()=>{n.can_change&&e.assigneeCandidates().then(_=>{_.ok&&v(_.data.candidates)})},[e,n.can_change]);const b=async _=>{const S=await _;if(!S.ok){o.error(S.refusal.message),S.refusal.conflict&&await p();return}await p()};if(h)return s.jsx(Wa,{title:"Support issue not found",description:"This issue does not exist in this project.",backHref:l(a),backLabel:"Back to Support",link:i});if(!c)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"});const w=c.status==="closed",N=n.can_change,C=_=>b(e.transition(c.id,c.revision,_));return s.jsxs(s.Fragment,{children:[s.jsx(mn,{title:c.title,actions:N?s.jsxs(s.Fragment,{children:[w?null:s.jsxs(q,{variant:"outline",onClick:()=>g("edit"),children:[s.jsx(_d,{className:"mr-2 size-4"}),"Edit"]}),s.jsxs(q,{variant:"outline",onClick:()=>g("redact"),children:[s.jsx(rE,{className:"mr-2 size-4"}),"Redact"]}),c.status==="open"?s.jsx(q,{variant:"outline",disabled:!c.priority,"aria-description":c.priority?void 0:"Set a priority first.",onClick:()=>void C("triaged"),children:"Triage"}):null,c.status==="open"||c.status==="triaged"?s.jsxs(q,{onClick:()=>g("resolve"),children:[s.jsx(wd,{className:"mr-2 size-4"}),"Resolve"]}):null,c.status==="resolved"?s.jsxs(s.Fragment,{children:[s.jsxs(q,{variant:"outline",onClick:()=>void C("open"),children:[s.jsx(YE,{className:"mr-2 size-4"}),"Reopen"]}),s.jsx(q,{onClick:()=>void C("closed"),children:"Close"})]}):null]}):void 0,children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(pe,{variant:o1[c.status],children:Fu[c.status]}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Logged by ",$z(c)," ",Jc(c.created_at)]})]})}),s.jsxs("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-6",children:[r>0&&c.external_reference?s.jsxs(me,{variant:"info",children:[s.jsx(cs,{}),s.jsxs(xe,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[s.jsxs("span",{children:[c.external_reference," is already logged on"," ",r===1?"another issue":`${r} other issues`," in this project."]}),s.jsx(q,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(i,{href:l(`${a}?external_reference=${encodeURIComponent(c.external_reference)}`),children:"Show both"})})]})]}):null,s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Description"}),c.description?s.jsx("p",{className:"text-sm break-words whitespace-pre-wrap",children:c.description}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"No description."})]}),s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"History"}),s.jsx("div",{className:"rounded-md border",children:s.jsxs(Ke,{children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"When"}),s.jsx(X,{children:"Who"}),s.jsx(X,{children:"What"})]})}),s.jsx(Xe,{children:f.map(_=>s.jsxs(he,{children:[s.jsx(K,{className:"text-muted-foreground",children:Jc(_.created_at)}),s.jsx(K,{children:Oz(_,c)}),s.jsx(K,{children:u3(_)})]},_.id))})]})})]})]}),s.jsxs("aside",{className:"flex w-full shrink-0 flex-col gap-5 lg:w-72",children:[s.jsx(bi,{label:"External reference",children:c.external_reference?s.jsx("span",{className:"font-mono text-sm",children:c.external_reference}):s.jsx("span",{className:"text-muted-foreground text-sm",children:"None"})}),c.resolution_reason?s.jsx(bi,{label:"Resolution",children:s.jsx("span",{className:"text-sm",children:Kx[c.resolution_reason]})}):null,s.jsx(bi,{label:"Priority",id:"maintain-issue-priority",children:s.jsxs(wt,{value:c.priority??Yr,disabled:!N||w,onValueChange:_=>void b(e.update(c.id,c.revision,{priority:_===Yr?null:_})),children:[s.jsx(vt,{id:"maintain-issue-priority",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:Yr,children:"Not set"}),Fx.map(_=>s.jsx(Ae,{value:_,children:yo[_]},_))]})]})}),s.jsxs(bi,{label:"Assignee",id:"maintain-issue-assignee",children:[s.jsxs(wt,{value:c.assignee_id??Yr,disabled:!N||w,onValueChange:_=>void b(e.assign(c.id,c.revision,_===Yr?null:_)),children:[s.jsx(vt,{id:"maintain-issue-assignee",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[s.jsx(Ae,{value:Yr,children:"Not set"}),c.assignee_id&&!j.some(_=>_.user_id===c.assignee_id)?s.jsx(Ae,{value:c.assignee_id,children:Xx(c.assignee_id,c.assignee_username)}):null,j.map(_=>s.jsx(Ae,{value:_.user_id,children:_.username??"Not available"},_.user_id))]})]}),c.assignee_can_act===!1?s.jsx(pe,{variant:"error",className:"self-start",children:"Assignee cannot act"}):null]}),s.jsx(bi,{label:"Updated",children:s.jsx("span",{className:"text-sm",children:Jc(c.updated_at)})})]})]}),s.jsx(c3,{update:e.update,issue:c,open:y==="edit",onOpenChange:_=>g(_?"edit":null),onReload:p,onDone:()=>{g(null),p()}}),s.jsx(d3,{redact:e.redact,issue:c,open:y==="redact",onOpenChange:_=>g(_?"redact":null),onReload:p,onDone:()=>{g(null),o.success("The text was redacted."),p()}}),s.jsx(f3,{transition:e.transition,issue:c,open:y==="resolve",onOpenChange:_=>g(_?"resolve":null),onDone:_=>{g(null),_||o.error("Someone else changed this issue; it is reloaded."),p()}})]})}function bi({label:e,id:t,children:n}){return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[t?s.jsx("label",{htmlFor:t,className:"text-muted-foreground text-2xs font-medium tracking-wide uppercase",children:e}):s.jsx("span",{className:"text-muted-foreground text-2xs font-medium tracking-wide uppercase",children:e}),n]})}const p3=10,x3=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,Ny=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;function g3(e,t,n,a=""){const r=n!=null&&n.startsWith("task:")?n.slice(5):null;if(r&&x3.test(r))return{label:r,path:`/org/${e}/tasks/${r}`};const l=`/proj/${encodeURIComponent(t)}/releases`,i=n!=null&&n.startsWith("release:")?n.slice(8):null;if(i&&Ny.test(i))return{label:i==="candidate"?"Candidate":i,path:`${l}?release=${encodeURIComponent(i)}`};const o=n!=null&&n.startsWith("planned:")?n.slice(8):null;if(o&&Ny.test(o))return{label:o,path:`${l}?planned=${encodeURIComponent(o)}`};const c=ul(eu(a));return{label:"Issues",path:`/proj/${encodeURIComponent(t)}/issues${c?`?${c}`:""}`}}const v3=["Fixed in","Being fixed in","The release planned to fix it"];function y3(e){const t=e.filter(n=>n.kind==="release");for(const n of v3){const a=t.find(r=>r.relation===n);if(a)return a}return t[0]??null}function j3(e,t){const n=e.filter(a=>a.kind==="thread"&&(a.label===t||a.id===t));return n.find(a=>a.owns)??n[0]??null}function b3(e,t){const n=e.toLowerCase();return n==="file"&&t.trim()?{kind:"file",path:t}:n==="commit"&&/^[0-9a-f]{7,40}$/i.test(t)?{kind:"commit",sha:t}:null}function w3({org:e,project:t,issue_id:n,from:a,query:r=""}){var At,Yt,Lt;const l=v1(),{href:i,Link:o}=Ze(),c=g3(e,t,a,r),d=`/proj/${encodeURIComponent(t)}/issues`,f=z=>`${d}/${encodeURIComponent(z)}`,m=z=>`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(z)}`,h=z=>`/proj/${encodeURIComponent(t)}/releases?${z.planned?"planned":"release"}=${encodeURIComponent(z.id)}`,[x,j]=u.useState({state:"loading"}),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,w]=u.useState({state:"loading"}),[N,C]=u.useState({state:"loading"}),[_,S]=u.useState(null),D=u.useRef(0),O=u.useCallback(async z=>{if(!l.openAnchor)return;const de=z.kind==="file"?z.path:z.sha,je=D.current+=1;S({value:de,state:"opening",words:`Opening ${de}…`});const it=await l.openAnchor(z);je===D.current&&S(it.ok?{value:de,state:"opened",words:`Opened ${de} in ${it.data.with}`}:{value:de,state:"failed",words:`Could not open ${de}: ${it.refusal.message}`})},[l]);u.useEffect(()=>{D.current+=1,S(null)},[n]);const B=u.useRef(null),Y=us(),H=u.useRef(null),M=u.useRef(!1),A=u.useRef(0),R=u.useRef(0),T=u.useRef(!1),k=ys(),$=u.useRef(0),P=u.useRef(0),E=u.useCallback(async(z=!1)=>{if(!l.issueSections)return;const de=$.current+=1;z||w({state:"loading"});const je=await k.track(l.issueSections(n));de===$.current&&w(it=>je.ok?{state:"ok",data:je.data}:z&&it.state==="ok"?it:{state:"failed",refusal:je.refusal})},[l.issueSections,n,k]),I=u.useCallback(async(z=!1)=>{if(!l.issueRelated)return;const de=P.current+=1;z||C({state:"loading"});const je=await k.track(l.issueRelated(n));de===P.current&&C(it=>je.ok?{state:"ok",data:je.data}:z&&it.state==="ok"?it:{state:"failed",refusal:je.refusal})},[l.issueRelated,n,k]),F=u.useCallback(async(z=!1)=>{const de=R.current+=1;if(p(null),!Gz.test(n)){j({state:"missing"});return}E(z),I(z);const je=await k.track(l.issue(n));if(de!==R.current)return;if(je.ok){A.current=0,y(null),j({state:"ok",issue:je.data.issue,events:je.data.events,at:new Date().toISOString()});return}const it=je.refusal.reason;if(je.refusal.status===404||it==="not_found")return j({state:"missing"});if(it==="engine_missing")return j({state:"engine_missing",refusal:je.refusal});if(it==="view_outdated")return j({state:"view_outdated"});if(A.current+=1,A.current===1&&l1(je.refusal)){T.current=z,p(je.refusal.retry_after??p3);return}y(je.refusal)},[l.issue,n,E,I,k]);u.useEffect(()=>{F()},[F]);const Q=u.useMemo(()=>Qx(k,()=>void F(!0)),[F,k]);Cr(Q,g1),u.useEffect(()=>{if(g===null)return;const z=setTimeout(()=>{document.visibilityState==="visible"&&F(T.current)},g*1e3);return()=>clearTimeout(z)},[g,F]),u.useEffect(()=>{var de;if(M.current||x.state!=="ok")return;M.current=!0;const z=(de=B.current)==null?void 0:de.querySelector("h1");z&&(z.tabIndex=-1,z.focus())},[x.state]);const oe=u.useRef(null);u.useEffect(()=>{var je;const z=oe.current;if(z===null||(z==="sections"?b:N).state==="loading")return;oe.current=null;const de=(z==="related"?H.current:null)??((je=B.current)==null?void 0:je.querySelector("h1"));de==null||de.focus()},[b,N]);const ge=z=>{oe.current=z,z==="sections"?E():I()},Z=()=>{A.current=0,F()},J=Vx(B),re=u.useRef(!1),ee=()=>{re.current=!0,Z()};u.useEffect(()=>{var de;if(!re.current||x.state==="loading"||g!==null)return;re.current=!1;const z=(de=B.current)==null?void 0:de.querySelector("h1");z&&(z.tabIndex=-1,z.focus())},[x,v,g]);const fe=Wd({org:e,labelled:!0,action:(At=l.commands)!=null&&At.open_thread&&x.state==="ok"?x.issue.local_action:void 0,task_id:null,issue:n,open_thread:(Yt=l.commands)==null?void 0:Yt.open_thread});if(x.state==="missing")return s.jsx(Ma,{children:s.jsx(Wa,{icon:s.jsx(Nd,{"aria-hidden":"true"}),title:"Issue not found",description:`No issue ${n} in this repository's issue store.`,backHref:i(a==="issues"?c.path:d),backLabel:"Back to issues",link:o})});const ce=s.jsx(q,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(o,{href:i(c.path),children:[s.jsx(i0,{className:"size-4","aria-hidden":"true"}),c.label]})});if(x.state==="engine_missing"||x.state==="view_outdated")return s.jsx(Ma,{children:x.state==="engine_missing"?s.jsx(ha,{page:"Issue",header:s.jsx(Xi,{back:ce,id:null,title:n})}):s.jsxs(s.Fragment,{children:[s.jsx(Xi,{back:ce,id:null,title:n}),s.jsxs(me,{variant:"warning",className:"mt-4",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:Fl}),s.jsx(xe,{children:Y})]})]})});const Ee=v?s.jsxs(me,{ref:J,variant:"destructive",className:"mt-4",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This issue could not be loaded"}),s.jsxs(xe,{children:[s.jsxs("p",{children:[v.message,v.since?` Since ${as(v.since)}.`:"",x.state==="ok"?` This page was read at ${as(x.at)}.`:"",v.message.includes(br)?"":` ${br}`]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:ee,children:"Retry"})]})]}):null,V=s.jsx("div",{role:"status","aria-live":"polite",children:g!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(dn,{"aria-hidden":"true"}),"This issue is busy. Reading it again…"]}):null});if(x.state==="loading")return s.jsxs(Ma,{children:[s.jsx("div",{children:ce}),V,Ee,!v&&g===null?s.jsxs("div",{className:"mt-4 grid gap-3",role:"status","aria-label":"Loading issue",children:[s.jsx(Rt,{className:"h-6 w-40"}),s.jsx(Rt,{className:"h-9 w-2/3"}),s.jsx(Rt,{className:"h-24 w-full"})]}):null]});const{issue:te,events:le,at:Pe}=x,Le=m1(te),ue=b.state==="ok"?b.data:null,zt=(ue==null?void 0:ue.reporter)??te.created_by_username??null,Je=N.state==="ok"?y3(N.data):null,ct=te.status==="resolved"||te.group==="resolved",ye=!!(ue!=null&&ue.duplicate_of),We=(ue==null?void 0:ue.routing.owner)??te.owner_title??null,Gt=We&&N.state==="ok"?j3(N.data,We):null,An=b.state==="loading"?"Loading…":Gt?s.jsx(o,{className:"text-primary hover:underline",href:i(m(Gt.id)),children:We}):We??s.jsx("span",{className:"text-muted-foreground",children:"Unowned"}),Nt=z=>`${d}?${ul({...zm,collection:z})}`,Ue=ue==null?void 0:ue.report,Zt=!!(Ue&&(Ue.actual||Ue.expected||Ue.steps.length||Ue.where)),Tt=[...le].reverse(),Vt=s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[fe.button,s.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",as(Pe)]}),s.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:Z,children:[s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsx(Ma,{children:s.jsxs("div",{ref:B,className:"contents",children:[s.jsx(Xi,{back:ce,id:te.id,badge:s.jsxs(s.Fragment,{children:[s.jsx(pe,{variant:Le.tone,children:Le.label}),te.urgent&&!ct?s.jsx(pe,{variant:"warning",children:"Urgent"}):null]}),title:te.title,created:`Reported${zt?` by ${zt}`:""} · ${Qi(te.created_at)}`,actions:Vt}),ue!=null&&ue.duplicate_of?s.jsxs("p",{className:"mt-1 text-sm",children:["Duplicate of"," ",s.jsx(o,{className:"text-primary font-mono hover:underline",href:i(f(ue.duplicate_of)),children:ue.duplicate_of})]}):null,fe.panel?s.jsx("div",{className:"mt-1 max-w-180",children:fe.panel}):null,V,Ee,b.state==="loading"?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",role:"status",children:[s.jsx(dn,{"aria-hidden":"true"}),"Loading the issue's sections"]}):null,s.jsxs("dl",{className:"mt-4 mb-0 flex flex-wrap gap-x-12 gap-y-4","data-testid":"issue-facts",children:[s.jsx($s,{label:"Owner",value:An}),ye?null:s.jsx($s,{label:"Release",value:N.state==="loading"?"Loading…":Je?s.jsx(o,{className:ie("text-primary hover:underline",Je.label===Je.id&&"font-mono"),href:i(h(Je)),children:Je.label}):s.jsx("span",{className:"text-muted-foreground",children:"No release yet"})}),s.jsx($s,{label:"Reported",value:[zt,te.created_at?rs(te.created_at):null].filter(Boolean).join(" · ")})]}),s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(Po,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:p1}),s.jsx(xe,{children:x1})]}),b.state==="failed"?s.jsx("div",{className:"mt-6",children:s.jsx(Yx,{what:"this issue's sections",again:"Read the issue again",refusal:b.refusal,on_retry:()=>ge("sections")})}):null,ue&&Zt&&Ue?s.jsxs($t,{id:"issue-report",title:"What happens",children:[Ue.actual?s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:Ue.actual}):null,Ue.expected?s.jsxs("div",{className:"mt-3",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Expected"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:Ue.expected})]}):null,Ue.steps.length?s.jsxs("div",{className:"mt-3",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Steps"}),s.jsx("ol",{className:"list-decimal pl-5 text-sm",children:Ue.steps.map((z,de)=>s.jsx("li",{children:z},de))})]}):null,(Lt=Ue.where)!=null&&Lt.env?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:["Seen on ",Ue.where.env,Ue.where.sha?s.jsxs(s.Fragment,{children:[" ","at ",s.jsx("span",{className:"font-mono",children:Ue.where.sha})]}):null]}):null]}):null,ue&&(ue.placement.placed||ue.placement.unplaced_why)?s.jsx($t,{id:"issue-placement",title:"Placement",children:ue.placement.placed?s.jsxs("p",{className:"text-sm",children:["Placed in ",ue.placement.placed]}):s.jsxs(me,{variant:"warning",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Not placed yet: ",ue.placement.unplaced_why]})]})}):null,ue&&(ue.routing.route||ue.routing.owner||ue.routing.none)?s.jsxs($t,{id:"issue-routing",title:"Routing",children:[ue.routing.route?s.jsx("p",{className:"text-sm",children:ue.routing.route}):null,ue.routing.owner?s.jsxs("p",{className:"text-sm",children:["Owner: ",ue.routing.owner]}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"Owner: none yet"})]}):null,ue&&(ue.labels.length>0||ue.collections.length>0)?s.jsxs($t,{id:"issue-labels",title:"Labels and collections",children:[ue.labels.length?s.jsx("div",{className:"flex flex-wrap gap-1",children:ue.labels.map(z=>s.jsx(pe,{variant:"neutral",size:"dense",children:z},z))}):null,ue.collections.length?s.jsx("ul",{className:"mt-2 grid gap-1 text-sm",children:ue.collections.map(z=>s.jsxs("li",{children:[s.jsx(o,{className:"text-primary hover:underline",href:i(Nt(z.collection)),children:z.title}),z.ref?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",z.ref]}):null,s.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",z.resolved," of ",z.total," resolved"]})]},z.collection))}):null]}):null,ue&&ue.anchors.length>0?s.jsxs($t,{id:"issue-anchors",title:"Anchors",children:[s.jsx(ih,{label:"Anchors",heads:["Kind","Value","By"],rows:ue.anchors.map(z=>{const de=l.openAnchor?b3(z.kind,z.value):null;return[z.kind,de?s.jsx(q,{type:"button",variant:"link",size:"control",className:"h-auto min-h-7 justify-start px-0 text-left font-mono text-xs font-normal break-all whitespace-normal","aria-label":de.kind==="file"?`Open ${z.value}`:`Show commit ${z.value}`,onClick:()=>void O(de),children:z.value}):s.jsx("span",{className:"font-mono text-xs break-all",children:z.value}),z.by??""]})}),l.openAnchor?s.jsx("p",{role:"status","aria-live":"polite","data-testid":"issue-anchor-status",className:ie("mt-2 text-sm empty:hidden",(_==null?void 0:_.state)==="failed"?"text-destructive":(_==null?void 0:_.state)==="opened"?"text-success":"text-muted-foreground"),children:(_==null?void 0:_.words)??""}):null]}):null,ue&&ue.seen.length>0?s.jsx($t,{id:"issue-seen",title:"Seen",aside:`${ue.seen.length} of ${Math.max(te.occurrences??0,ue.seen.length)} sightings`,children:s.jsx(ih,{label:"Seen",heads:["When","Where","Who","Note"],rows:ue.seen.map(z=>[Qi(z.at),s.jsxs(s.Fragment,{children:[z.sha?s.jsx("div",{className:"font-mono text-xs",children:z.sha}):null,z.env?s.jsx("div",{className:"text-muted-foreground text-xs",children:z.env}):null]}),z.who??"",z.note??""])})}):null,Tt.length>0?s.jsx($t,{id:"issue-history",title:"History",aside:"From the issue store, newest first",children:s.jsx(ih,{label:"History",heads:["When","Who","What"],rows:Tt.map(z=>[Qi(z.created_at),z.actor_username??"",Wz(z.note,z.kind)])})}):null,s.jsx(i1,{id:"issue-related",related:N,heading_ref:H,on_retry:()=>ge("related"),fixed:!0,link:z=>{const de=z.kind==="thread"?m(z.id):z.kind==="task"?`/org/${e}/tasks/${encodeURIComponent(z.id)}?from=issue:${te.id}`:z.kind==="issue"?f(z.id):z.kind==="release"?h(z):null;if(z.kind==="task"&&de){const je=Zz(z.label);return s.jsxs("div",{className:"min-w-0",children:[s.jsx(o,{className:"text-primary font-mono text-xs hover:underline",href:i(de),children:z.id}),je&&je!==z.id?s.jsx("div",{className:"text-muted-foreground line-clamp-1 text-xs",title:je,"data-testid":"related-task-title",children:je}):null]})}return de?s.jsx(o,{className:ie("text-primary hover:underline",z.kind!=="thread"&&z.label===z.id&&"font-mono"),href:i(de),children:z.label}):z.label}})]})})}function ih({label:e,heads:t,rows:n}){return s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:e,children:[s.jsx(nt,{children:s.jsx(he,{children:t.map(a=>s.jsx(X,{children:a},a))})}),s.jsx(Xe,{children:n.map((a,r)=>s.jsx(he,{children:a.map((l,i)=>s.jsx(K,{className:"break-words",children:l},i))},r))})]})})}function _3({org:e,project:t,issue_id:n,from:a,query:r}){var l;return(l=Nn().issues)!=null&&l.issueSections?s.jsx(w3,{org:e,project:t,issue_id:n,from:a,query:r}):s.jsx(h3,{org:e,project:t,issue_id:n,query:r})}const y1={integration:"Integration",deploy:"Deploy",publish:"Publish",accept:"Accept",custom:"Custom"},N3={self_service:"Self-service",managed:"Managed",manager_only:"Manager only"},k3={self_service:"Self-service: each entry takes its own turn",managed:"Managed: a manager batches entries that allow it",manager_only:"Manager only: the manager runs every turn"},S3={in_batch:{label:"In the batch",tone:"info"},done:{label:"Done",tone:"success"},failed:{label:"Failed",tone:"error"},released:{label:"Released",tone:"neutral"},left:{label:"Left",tone:"neutral"},gone:{label:"Ended",tone:"neutral"},skipped:{label:"Skipped",tone:"neutral"},lapsed:{label:"Lapsed",tone:"warning"}};function C3(e){return S3[e??"in_batch"]}function R3(e){const t=e.turn==="next",n=t?"Next":"Waiting",a=e.batching==="managed"||e.batching==="released"?` · ${e.batching}`:"";return{label:`${n}${a}`,tone:t?"info":"neutral"}}const j1=(e,t)=>`Holds ${e.toLowerCase()}${t?`: ${t}`:""}`;function E3(e,t,n,a=!0){return e.fixing_since!==void 0?{label:`Fixing forward since ${ms(e.fixing_since)}`,tone:"warning"}:e.ref===t?{label:"Landing",tone:"info"}:a&&e.hold?{label:j1(n),tone:"info"}:{label:"Running",tone:"info"}}function ms(e){return new Date(e*1e3).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Fr(e){const t=Math.round(e/60);if(t<60)return`${t} min`;const n=Math.floor(t/60),a=t%60;return a?`${n} h ${a} min`:`${n} h`}function T3(e){var n;const t=e.binding;return(t==null?void 0:t.kind)==="repository_branch"?`${t.repository} · ${t.branch}`:(t==null?void 0:t.kind)==="label"?t.label:((n=e.layer)==null?void 0:n.kind)==="release"&&e.layer.promotes_to?`Promotes to ${e.layer.promotes_to}`:null}function A3(e,t){switch(e.kind){case"any_thread":return"Any thread in this checkout";case"task_writers":return"Anyone who can edit the entry's task";case"any_joiner":return"Anyone who may join";case"managers":return"Whoever may manage";case"admins":return"Workspace admins";case"none":return"Nobody";case"listed":{const n=e.users.map(t),a=e.teams.length;return a&&n.push(a===1?"1 team":`${a} teams`),n.length?n.join(", "):"Nobody"}}}function M3(e,t){var o,c;const{policy:n,management:a}=e,r=(o=e.layer)==null?void 0:o.kind,l=d=>A3(d,t),i=[["Mode",k3[a.mode]],["Who can join",l(a.joiners)]];return r==="implement"&&i.push(["Managers",l(a.managers)],["Manager lease",Fr(a.manager_lease_seconds)],["Batches",n.batch.enabled?`Up to ${n.batch.max_members} entries`:"Off"]),((c=e.layer)==null?void 0:c.kind)==="release"&&(e.layer.promotes_to&&i.push(["Promotes to",e.layer.promotes_to]),i.push(["Carries waiting entries",n.ride?"Yes: a done turn carries entries already contained in it":"No"],["Freeze",n.freeze.enabled?`Up to ${Fr(n.freeze.max_seconds)}, ${Fr(n.freeze.default_seconds)} by default`+(e.layer.freezers?` · ${l(e.layer.freezers)}`:""):"Off"],["Fix forward",n.fix_forward?"Yes: a failed turn keeps its turn until fixed":"No"],["Stalled turns",a.stall_takers.kind==="none"?"Nobody takes one":`${l(a.stall_takers)} may take one after ${Fr(n.stall_seconds)}`])),i.push(["Reorder",l(a.reorderers)]),n.max_turns>1&&i.push(["Turns at once",`Up to ${n.max_turns} independent turns`]),i.push(["Turn lease",Fr(n.lease_seconds)],["Time to start",`${Fr(n.start_grace_seconds)} after the turn comes`]),n.entry_limit!==null&&i.push(["Waiting entries",`Up to ${n.entry_limit}`]),n.footprint!=="off"&&i.push(["Footprint",n.footprint==="required"?"Required":"Optional"]),i}const b1="Where your organization's agents take turns at a shared branch, environment or proposal. One turn runs at a time in each queue.",w1="A task you cannot see",$3="A former member",O3="A member";function _1(){const e=Nn().queues;if(!e)throw new Error("The Queues page rendered without the queues seam.");return e}function D3({org:e,open:t,path:n}){var m,h;const a=_1(),{href:r,Link:l}=Ze(),i=a.availability,[o,c]=u.useState({state:"loading"}),d=u.useCallback(async x=>{i&&(x&&c({state:"loading"}),c(await i({fresh:x})))},[i]);u.useEffect(()=>{d(!1)},[d]);const f=!i||o.state==="active";return o.state==="off"&&((m=o.refusal)==null?void 0:m.reason)!=="engine_missing"?s.jsx(Wa,{title:"Page not found",description:"This page does not exist, or you do not have access to it.",backHref:r(`/org/${e}`),backLabel:"Back to the organization",link:l}):s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:f?s.jsx(L3,{org:e,open:t??null,path:n??`/org/${e}/tasks/queues`}):o.state==="off"&&((h=o.refusal)==null?void 0:h.reason)==="engine_missing"?s.jsx(ha,{page:"Queues"}):s.jsxs(s.Fragment,{children:[s.jsx(mn,{title:"Queues",description:a.description??b1}),o.state==="loading"&&s.jsx(N1,{}),(o.state==="error"||o.state==="off")&&s.jsx(Lm,{refusal:o.refusal,on_retry:()=>void d(!0)}),o.state==="available"&&s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Tasks are not on for this organization"}),s.jsxs(xe,{children:["Queues hold turns for tasks, so they show once Tasks are on."," ",s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks`),children:"Go to Tasks"})]})]})]})})}function N1(){return s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading queues",children:Array.from({length:3},(e,t)=>s.jsx(Rt,{className:t===2?"h-10 w-2/3":"h-10 w-full"},t))})}function Lm({refusal:e,on_retry:t}){const n=us();return(e==null?void 0:e.reason)==="store_locked"?s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"The local stores are busy"}),s.jsxs(xe,{children:[s.jsx("p",{children:e.message}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]}):(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(me,{variant:"warning",className:"mt-6",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:Fl}),s.jsx(xe,{children:n})]}):s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Queues could not be loaded"}),s.jsxs(xe,{children:[s.jsx("p",{children:"The read did not answer. Try again in a moment."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}const oh=e=>e.status===404||e.reason==="not_found"||e.code==="not_found";function z3(e,t,n,a){return t?e===null?`Not reading · trying again every ${n}s`:`Not reading since ${ms(e)} · trying again every ${n}s`:e===null?"Connecting…":`Live · read ${ms(e)} · refreshes every ${n}s${a?` · ${a}`:""}`}function L3({org:e,open:t,path:n}){var Z;const{listQueues:a,queue:r,members:l,refresh_ms:i,settings_note:o,description:c,read_scope:d,subject_label:f="Task",thread_subjects:m=!1}=_1(),{self_id:h}=jd(),[x,j]=u.useState(null),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,w]=u.useState(null),[N,C]=u.useState({state:"pending",members:[]});u.useEffect(()=>{let J=!0;return l().then(re=>{J&&C(ee=>re.ok?{state:"answered",members:re.data}:{state:"failed",members:ee.members})}),()=>{J=!1}},[l]);const _=u.useMemo(()=>new Map(N.members.map(J=>[J.user_id,J])),[N.members]),S=N.state==="answered"?$3:O3,D=u.useCallback((J,re)=>{var ee;return(re==null?void 0:re.title)??(m?(re==null?void 0:re.id)??J:J===h?"You":((ee=_.get(J))==null?void 0:ee.label)??S)},[_,S,h,m]),O=u.useRef({list:{last:null,fresh:!1},detail:{last:null,fresh:!1}}),[B,Y]=u.useState(null),[H,M]=u.useState(!1),A=u.useCallback((J,re)=>{O.current[J]={last:re,fresh:!0};const{list:ee,detail:fe}=O.current;M(ee.last==="failed"||fe.last==="failed"),ee.fresh&&fe.fresh&&ee.last==="ok"&&fe.last==="ok"&&Y(Date.now()/1e3)},[]),R=t??((Z=x==null?void 0:x.queues[0])==null?void 0:Z.id)??null,T=u.useRef(R);u.useEffect(()=>{T.current=R},[R]);const k=u.useRef(0),$=u.useCallback(async()=>{var ee;const J=k.current+=1;O.current.list.fresh=!1;const re=await a();if(J===k.current)if(re.ok){if(j(re.data),y(null),!t){const fe=((ee=re.data.queues[0])==null?void 0:ee.id)??null;fe===null?O.current.detail={last:"ok",fresh:!0}:fe!==T.current&&(O.current.detail.fresh=!1)}A("list","ok")}else y(re.refusal),A("list","failed")},[a,t,A]),P=u.useRef(0),E=u.useCallback(async()=>{const J=P.current+=1;if(!R)return;O.current.detail.fresh=!1;const re=await r(R);J===P.current&&(re.ok?(p(re.data),w(null),A("detail","ok")):(w(re.refusal),oh(re.refusal)&&p(null),A("detail",oh(re.refusal)?"ok":"failed")))},[R,r,A]);u.useEffect(()=>{$()},[$]),u.useEffect(()=>{p(null),w(null),E()},[E]);const I=u.useCallback(()=>{$(),E()},[$,E]),F=!x&&(v==null?void 0:v.reason)==="engine_missing",Q=u.useCallback(()=>{F||I()},[F,I]);if(Cr(Q,i),F)return s.jsx(ha,{page:"Queues"});const oe=Math.round(i/1e3),ge=b!==null&&oh(b);return s.jsxs(s.Fragment,{children:[s.jsxs(mn,{title:"Queues",description:c??b1,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:z3(B,H,oe,d)}),s.jsx("span",{className:"sr-only",role:"status",children:H?"Not reading":B===null?"Connecting":"Live"})]}),!x&&!v&&s.jsx(N1,{}),!x&&v&&s.jsx(Lm,{refusal:v,on_retry:I}),x&&x.queues.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(f0,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No queues yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Queues are created through the sdlc CLI, the MCP tools or the API. Once one exists, its turns and waiting work show here."})]}):x?s.jsxs(s.Fragment,{children:[s.jsx(B3,{path:n,queues:x.queues,open_id:R,name:D,held:m}),ge?s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This queue is no longer available"}),s.jsx(xe,{children:"It was archived, or you can no longer read its Workspace. Pick another queue above."})]}):g&&g.queue.id===R?s.jsx(H3,{org:e,detail:g,name:D,settings_note:o,subject_label:f,thread_subjects:m}):b?s.jsx(Lm,{refusal:b,on_retry:()=>void E()}):s.jsx(Rt,{className:"mt-6 h-40 w-full shrink-0",role:"status","aria-label":"Loading the queue"})]}):null]})}function Um({org:e,subject:t,link:n}){const{href:a,Link:r}=Ze();return!t||t.hidden?s.jsx("span",{className:"text-muted-foreground",children:w1}):t.kind==="task"&&n?s.jsx(r,{className:"text-primary hover:underline",href:a(`/org/${e}/tasks/${t.id}`),children:t.title??t.id}):t.kind==="thread"&&!n&&t.id&&!t.id.startsWith("exec-")?s.jsx(r,{className:"text-primary hover:underline",href:a(`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(t.id)}`),children:t.title??t.id}):s.jsx("span",{children:t.title??t.id})}function U3(e,t,n){const a=e.freeze?`frozen until ${ms(e.freeze.lease_until)}`:null;if(e.batch)return{primary:`Batch of ${e.batch.size} · ${t(e.batch.holder,e.batch.holder_subject)}`,secondary:[`Opened ${ms(e.batch.opened_at)}`,a].filter(Boolean).join(" · "),warn:!1};if(e.turn){const r=e.turn.subject,l=r.hidden?w1:r.title??r.id,i=(e.running_count??1)>1?`${e.running_count} turns · `:"",o=e.turn.landing?" landing":"",c=n&&!!e.turn.hold,d=[c?j1(e.name,e.turn.note):null,e.turn.fixing_since!==void 0?"Fixing forward":null,a].filter(Boolean);return c&&e.turn.fixing_since===void 0&&!a?{primary:`${i}${l}${o}`,secondary:ch(d.join(" · ")),warn:!1}:{primary:`${i}${l}${o}`,secondary:d.length?ch(d.join(" · ")):null,warn:d.length>0}}return{primary:"Nothing running",secondary:a?ch(a):null,warn:!!a}}const ch=e=>e.charAt(0).toUpperCase()+e.slice(1);function B3({path:e,queues:t,open_id:n,name:a,held:r}){const{href:l,Link:i}=Ze();return s.jsx(xt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Queues",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Queue"}),s.jsx(X,{className:"hidden md:table-cell",children:"Step"}),s.jsx(X,{children:"Running turn"}),s.jsx(X,{className:"hidden text-right md:table-cell",children:"Waiting"})]})}),s.jsx(Xe,{children:t.map(o=>{var h;const c=o.id===n,d=T3(o),f=U3(o,a,r),m=o.waiting-(((h=o.batch)==null?void 0:h.remaining)??0);return s.jsxs(he,{"data-testid":"queues-row",className:ie(c&&"bg-accent"),children:[s.jsxs(K,{children:[s.jsx(i,{className:"text-primary hover:underline",href:l(`${e}?queue=${encodeURIComponent(o.id)}`),"aria-current":c?"page":void 0,children:o.name}),d?s.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null,s.jsxs("div",{className:"text-muted-foreground text-xs md:hidden",children:[m," waiting"]})]}),s.jsx(K,{className:"hidden md:table-cell",children:s.jsx(pe,{variant:"neutral",children:y1[o.policy.step]})}),s.jsxs(K,{children:[s.jsx("div",{className:ie(!o.batch&&!o.turn&&"text-muted-foreground"),children:f.primary}),f.secondary?s.jsx("div",{className:ie("text-xs",f.warn?"text-warning":"text-muted-foreground"),children:f.secondary}):null]}),s.jsx(K,{className:"hidden text-right md:table-cell",children:m})]},o.id)})})]})})}function Ac({id:e,title:t,side:n,children:a}){return s.jsxs("section",{"aria-labelledby":e,className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{id:e,className:"text-sm font-semibold",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-xs",children:n}):null]}),a]})}function ky({org:e,entries:t,landing:n,queue_name:a,subject_label:r,held:l,label:i}){return s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Ke,{containerAriaLabel:i,children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:r}),s.jsx(X,{children:"State"})]})}),s.jsx(Xe,{children:t.map(o=>{const c=E3(o,n,a,l);return s.jsxs(he,{"data-testid":"queues-running",children:[s.jsxs(K,{children:[s.jsx(Um,{org:e,subject:o.subject,link:!l}),l&&o.hold&&o.note&&!o.subject.hidden?s.jsx("div",{className:"text-muted-foreground text-xs",children:o.note}):null]}),s.jsx(K,{children:s.jsx(pe,{variant:c.tone,children:c.label})})]},o.ref)})})]})})}function H3({org:e,detail:t,name:n,settings_note:a,subject_label:r,thread_subjects:l}){var w;const{queue:i,state:o}=t,c=N=>n(N),d=new Map(o.entries.map(N=>[N.ref,N.subject])),f=o.entries.filter(N=>N.turn==="running"),m=o.entries.filter(N=>N.turn!=="running"&&N.batching!=="in_batch"),h=o.batch,x=Math.max(1,f.filter(N=>N.batching!=="in_batch").length),j=h&&i.policy.independent_turns?f.filter(N=>N.batching!=="in_batch"&&N.ref!==h.holder):[],v=o.manager,y=o.freeze,g=((w=i.layer)==null?void 0:w.kind)==="release"?i.layer.stall_hold:void 0,p=g?{who:n(g.by),why:g.reason,until:g.until}:v!=null&&v.hold?{who:n(v.holder,v.holder_subject),why:v.hold.why,until:v.hold.until}:null,b=!h&&f.length===0&&m.length===0;return s.jsxs(xt,{as:"section","aria-labelledby":"queue-title",className:"mt-6 flex shrink-0 flex-col gap-4 p-4","data-testid":"queues-detail",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{id:"queue-title",className:"text-lg font-semibold",children:i.name}),s.jsx(pe,{variant:"neutral",children:y1[i.policy.step]}),s.jsx(pe,{variant:"neutral",children:N3[i.management.mode]})]}),i.purpose?s.jsx("p",{className:"text-muted-foreground text-sm",children:i.purpose}):null]}),v?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm","data-testid":"queues-manager",children:[s.jsx(rT,{className:"text-muted-foreground size-4","aria-hidden":"true"}),s.jsx("span",{className:"text-muted-foreground",children:"Manager"}),s.jsx("span",{className:"font-medium",children:n(v.holder,v.holder_subject)}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Lease until ",ms(v.lease_until),v.serving_until!==void 0?" · serving now":""]})]}):null,y?s.jsxs(me,{variant:"warning",children:[s.jsx(JE,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Frozen until ",ms(y.lease_until)]}),s.jsxs(xe,{children:[n(y.holder,y.holder_subject)," froze this queue at ",ms(y.since),y.label?`: ${y.label}`:"",". Only ",n(y.holder,y.holder_subject),"'s entries start until it thaws."]})]}):null,p?s.jsxs(me,{variant:"info",children:[s.jsx(h0,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Stall hold until ",ms(p.until)]}),s.jsxs(xe,{children:[p.who,p.why?`: ${p.why}`:"",". The first entry is not treated as stalled while it lasts."]})]}):null,b?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing running, and nothing waits in this queue."}):s.jsxs(s.Fragment,{children:[h?s.jsxs(Ac,{id:"queue-running",title:"Running turn",side:`Batch opened by ${n(h.holder,h.holder_subject)} at ${ms(h.opened_at)}`,children:[s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Ke,{containerAriaLabel:"Batch members",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Landing order"}),s.jsx(X,{children:r}),s.jsx(X,{children:"Outcome"})]})}),s.jsx(Xe,{children:h.members.map((N,C)=>{const _=C3(N.outcome);return s.jsxs(he,{"data-testid":"queues-member",children:[s.jsx(K,{children:C+1}),s.jsx(K,{children:s.jsx(Um,{org:e,subject:N.subject??d.get(N.ref)??(l?{kind:"thread",id:N.ref}:void 0),link:!l})}),s.jsx(K,{children:s.jsx(pe,{variant:_.tone,children:_.label})})]},N.ref)})})]})}),j.length>0?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"text-muted-foreground text-xs font-medium",children:"Also running"}),s.jsx(ky,{org:e,entries:j,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Turns running beside the batch"})]}):null]}):s.jsx(Ac,{id:"queue-running",title:f.length>1?"Running turns":"Running turn",children:f.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing running."}):s.jsx(ky,{org:e,entries:f,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Running turns"})}),s.jsx(Ac,{id:"queue-waiting",title:"Waiting",children:m.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing waits."}):s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Ke,{containerAriaLabel:"Waiting entries",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Position"}),s.jsx(X,{children:r}),s.jsx(X,{className:"hidden md:table-cell",children:"Joined"}),s.jsx(X,{children:"Turn"}),s.jsx(X,{className:"hidden md:table-cell",children:"Note"})]})}),s.jsx(Xe,{children:m.map((N,C)=>{const _=R3(N);return s.jsxs(he,{"data-testid":"queues-waiting",children:[s.jsx(K,{children:h?x+C+1:N.position}),s.jsx(K,{children:s.jsx(Um,{org:e,subject:N.subject,link:!l})}),s.jsx(K,{className:"hidden md:table-cell",children:ms(N.joined_at)}),s.jsx(K,{children:s.jsx(pe,{variant:_.tone,children:_.label})}),s.jsx(K,{className:"hidden md:table-cell",children:N.subject.hidden?"":N.note??""})]},N.ref)})})]})})})]}),s.jsx(Ac,{id:"queue-settings",title:"Settings",children:s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsx(Ke,{containerAriaLabel:"Queue settings",children:s.jsx(Xe,{children:M3(i,c).map(([N,C])=>s.jsxs(he,{children:[s.jsx(X,{scope:"row",className:"h-auto w-48 py-2 font-normal",children:N}),s.jsx(K,{children:C})]},N))})})})}),s.jsx("p",{className:"text-muted-foreground text-xs",children:a})]})}const Ts="__no_parent__";function k1(e,t){const n=new Set([t]);for(let a=!0;a;){a=!1;for(const r of e)r.parent&&n.has(r.parent)&&!n.has(r.key)&&(n.add(r.key),a=!0)}return n}const jo=(e,t)=>(e.label||e.key).localeCompare(t.label||t.key);function bn({id:e,label:t,help:n,error:a,children:r}){const l=[n?`${e}-help`:null,a?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:e,children:t}),r(l),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,a?s.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:a}):null]})}function Bm({label:e,children:t}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("span",{className:"text-sm leading-none font-medium",children:e}),s.jsx("span",{className:"text-muted-foreground text-sm break-words",children:t})]})}function Sy({id:e,label:t,help:n,checked:a,on_change:r}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Wl,{id:e,className:"mt-0.5",checked:a,"aria-describedby":n?`${e}-help`:void 0,onCheckedChange:l=>r(l===!0)}),s.jsx(ze,{htmlFor:e,className:"font-normal",children:t})]}),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground pl-6 text-xs",children:n}):null]})}function S1({id:e,legend:t,help:n,error:a,options:r,checked:l,on_change:i,empty:o,notes:c,scroll:d}){const f=[c!=null&&c.length?`${e}-notes`:null,n?`${e}-help`:null,a?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return s.jsxs("fieldset",{className:"m-0 grid min-w-0 gap-2 border-0 p-0","aria-describedby":f,"aria-invalid":a?!0:void 0,children:[s.jsx("legend",{className:"mb-2 text-sm leading-none font-medium",children:t}),c!=null&&c.length?s.jsxs("div",{id:`${e}-notes`,className:"text-warning flex items-start gap-2 text-xs",children:[s.jsx(ln,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),s.jsx("div",{className:"grid gap-0.5",children:c.map(m=>s.jsx("p",{children:m},m))})]}):null,r.length===0&&o?s.jsx("p",{className:"text-muted-foreground text-sm",children:o}):null,s.jsx("div",{className:d?"grid max-h-[200px] grid-cols-1 gap-2 overflow-y-auto rounded-md border p-3 sm:grid-cols-2":"grid grid-cols-1 gap-2 sm:grid-cols-2",tabIndex:d?0:void 0,role:d?"group":void 0,"aria-label":d?`${t} list`:void 0,children:r.map((m,h)=>s.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[s.jsx(Wl,{id:`${e}-${h}`,className:"mt-0.5",checked:l.has(m.value),onCheckedChange:x=>{const j=new Set(l);x===!0?j.add(m.value):j.delete(m.value),i(j)}}),s.jsx(ze,{htmlFor:`${e}-${h}`,className:"min-w-0 font-normal break-words",children:m.label})]},m.value))}),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,a?s.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:a}):null]})}function bo({context:e,action:t,title:n="Two-factor sign-in needed",changing:a="Changing the org"}){const r=e.two_factor==="enroll";return s.jsxs(me,{variant:"destructive",role:"alert",children:[s.jsx(WE,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:n}),s.jsxs(xe,{children:[s.jsx("p",{children:r?`Turn on two-factor sign-in in Account Settings, then come back here and ${t}.`:`${a} needs a two-factor sign-in. Sign in again with your authenticator in Account Settings, then come back here and ${t}.`}),s.jsx(q,{asChild:!0,variant:"outline",size:"sm",className:"mt-2 h-auto min-h-8 py-1.5 whitespace-normal text-left",children:s.jsx("a",{href:e.settings_href,target:"_blank",rel:"noreferrer",children:"Open Account Settings in a new tab"})})]})]})}const er=e=>e.two_factor==="ok";function ni({refusal:e,context:t,subject:n,action:a,changing:r,authority_title:l}){if((e==null?void 0:e.kind)==="two_factor")return s.jsx(bo,{context:t,action:a,changing:r,title:`Could not save ${n}`});const i=er(t)?null:s.jsx(bo,{context:t,action:a,changing:r});if(!e)return i;const o=e.kind==="changed"?"The org changed since you opened this":e.kind==="authority"?l??`Could not save ${n}`:null;return s.jsxs(s.Fragment,{children:[i,s.jsxs(me,{variant:"destructive",role:"alert",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),o?s.jsx(Ne,{children:o}):null,s.jsx(xe,{children:e.message})]})]})}function C1({id:e,value:t,on_change:n,none:a,options:r,described_by:l}){return s.jsxs(wt,{value:t,onValueChange:n,children:[s.jsx(vt,{id:e,"aria-describedby":l,children:s.jsx(_t,{placeholder:"Choose a team"})}),s.jsxs(yt,{children:[a?s.jsx(Ae,{value:Ts,children:a}):null,r.map(i=>s.jsx(Ae,{value:i.key,children:i.label||i.key},i.key))]})]})}function si(e){const[t,n]=u.useState(!1),[a,r]=u.useState(null);return{saving:t,refusal:a,set_refusal:r,run:async i=>{n(!0),r(null);try{const o=await i();o?r(o):e()}finally{n(!1)}}}}function ai({saving:e,blocked:t,described_by:n,children:a}){return s.jsx(q,{type:"submit",disabled:e,"aria-disabled":t||void 0,"aria-describedby":t?n:void 0,children:a})}const R1=(e,t)=>t==="hosted"?`Lowercase letters, digits, _ and -, starting with a letter. It names the ${e} in posts, and cannot change later.`:`Lowercase letters, digits, _ and -, starting with a letter. It names the ${e} in posts and in sdlc org, and cannot change later.`;function I3({open:e,chart:t,team:n,save:a,on_close:r,context:l=ri,scope:i="full",parents:o}){var k;const c=l.host==="hosted",[d,f]=u.useState(""),[m,h]=u.useState(""),[x,j]=u.useState(""),[v,y]=u.useState(Ts),[g,p]=u.useState({}),{saving:b,refusal:w,set_refusal:N,run:C}=si(r),_=((k=t.teams.find($=>$.parent===null))==null?void 0:k.key)??null;u.useEffect(()=>{e&&(f(""),h((n==null?void 0:n.label)??""),j((n==null?void 0:n.description)??""),y((n==null?void 0:n.parent)??(c&&_&&(!o||o.includes(_))?_:Ts)),p({}),N(null))},[e,n,N,c,_,o]);const S=$=>{const P=t.teams.find(E=>E.key===$);return P?P.label||P.key:$??""},D=n?k1(t.teams,n.key):new Set,O=[...t.teams].filter($=>!D.has($.key)&&(!o||o.includes($.key))).sort(($,P)=>$.key===_?-1:P.key===_?1:jo($,P)),B=n?n.label||n.key:"",Y=i==="description",H=!er(l),M=n?Y?"save the description":"save the team":"add the team",A=$=>{if($.preventDefault(),H)return;if(!n){const I=c?m.trim():d.trim();if(!I){p(c?{label:"Give the team a name."}:{key:"Give the team a key."});return}if(c&&v===Ts){p({parent:"Choose the parent team."});return}const F=c?I:m.trim()||I;C(()=>a({action:"add",kind:"team",key:I,...m.trim()?{label:m.trim()}:{},...x.trim()?{description:x.trim()}:{},...v!==Ts?{parent:v}:{}},`Team ${F} added.`));return}if(!Y&&!m.trim()){p({label:c?"Give the team a name.":"Give the team a label."});return}const P=v===Ts?null:v,E={...!Y&&m.trim()!==n.label.trim()?{label:m.trim()}:{},...x.trim()!==(n.description??"").trim()?{description:x.trim()}:{},...!c&&P!==n.parent?{parent:P}:{}};if(Object.keys(E).length===0){r();return}C(()=>a({action:"edit",kind:"team",key:n.key,...E},Y?`Saved the description of ${B}.`:`Team ${m.trim()} saved.`))},R=n?Y?`Edit the description of ${B}`:`Edit team ${B}`:"Add team";let T;return Y?T="Say what the team works on. Only the description is yours to change here.":c?T=n?"Rename the team or say what it works on.":"Add a team to the organization.":n?T=s.jsxs(s.Fragment,{children:["Its key, ",s.jsx("span",{className:"font-mono",children:n.key}),", names it in posts and in sdlc org and does not change."]}):T="Add a team to this repository's local org.",s.jsx(kn,{open:e,onOpenChange:$=>$||b?null:r(),children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:A,noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsx(En,{children:R}),s.jsx(Tn,{children:T})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(ni,{refusal:w,context:l,subject:Y?"the description":"the team",action:M}),!n&&!c?s.jsx(bn,{id:"org-team-key",label:"Key",help:R1("team",l.host),error:g.key,children:$=>s.jsx(Et,{id:"org-team-key",className:"font-mono",value:d,autoComplete:"off","aria-invalid":g.key?!0:void 0,"aria-describedby":$,onChange:P=>{f(P.target.value),p({})}})}):null,Y&&n?s.jsx(Bm,{label:"Name",children:n.parent?`${B} · under ${S(n.parent)}`:B}):s.jsx(bn,{id:"org-team-label",label:c?"Name":n?"Label":"Label (optional)",help:c?n?void 0:"Its key is made from the name.":n?void 0:"Shown on the chart; the key when left empty.",error:g.label,children:$=>s.jsx(Et,{id:"org-team-label",value:m,"aria-invalid":g.label?!0:void 0,"aria-describedby":$,onChange:P=>{h(P.target.value),p({})}})}),s.jsx(bn,{id:"org-team-description",label:Y?"Description":"Description (optional)",children:()=>s.jsx(Fn,{id:"org-team-description",rows:3,placeholder:"What the team does",value:x,onChange:$=>j($.target.value)})}),Y?null:c&&n?s.jsx(Bm,{label:"Parent team",children:n.parent?S(n.parent):"None: the organization itself"}):s.jsx(bn,{id:"org-team-parent",label:"Parent team",help:"Where the team sits; its posts report up through the team above.",error:g.parent,children:$=>s.jsx(C1,{id:"org-team-parent",value:v,on_change:P=>{y(P),p({})},none:c?void 0:"No parent (a root team)",options:O,described_by:$})})]}),s.jsxs(Rn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:b,onClick:r,children:"Cancel"}),s.jsx(ai,{saving:b,blocked:H,children:n?b?"Saving…":"Save":b?"Adding…":"Add team"})]})]})})})}const P3=(e,t)=>e.length===t.size&&e.every(n=>t.has(n));function q3({open:e,chart:t,job:n,save:a,on_close:r,context:l=ri}){const[i,o]=u.useState(""),[c,d]=u.useState(""),[f,m]=u.useState(""),[h,x]=u.useState(Ts),[j,v]=u.useState(new Set),[y,g]=u.useState(!1),[p,b]=u.useState(!0),[w,N]=u.useState({}),{saving:C,refusal:_,set_refusal:S,run:D}=si(r);u.useEffect(()=>{e&&(o(""),d((n==null?void 0:n.label)??""),m((n==null?void 0:n.description)??""),x((n==null?void 0:n.parent)??Ts),v(new Set((n==null?void 0:n.fills)??[])),g((n==null?void 0:n.requires_person)??!1),b((n==null?void 0:n.escalable)??!0),N({}),S(null))},[e,n,S]);const O=n?k1(t.job_functions,n.key):new Set,B=[...t.job_functions].filter(R=>!O.has(R.key)).sort(jo),Y=[...t.slots].sort(jo).map(R=>({value:R.key,label:R.label||R.key})),H=!er(l),M=n?"save the job function":"add the job function",A=R=>{if(R.preventDefault(),H)return;if(!n){if(!i.trim()){N({key:"Give the job function a key."});return}D(()=>a({action:"add",kind:"job_function",key:i.trim(),...c.trim()?{label:c.trim()}:{},...f.trim()?{description:f.trim()}:{},...h!==Ts?{parent:h}:{},fills:[...j],requires_person:y,escalable:p},`Job function ${c.trim()||i.trim()} added.`));return}if(!c.trim()){N({label:"Give the job function a label."});return}const T=h===Ts?null:h,k={...c.trim()!==n.label.trim()?{label:c.trim()}:{},...f.trim()!==(n.description??"").trim()?{description:f.trim()}:{},...T!==n.parent?{parent:T}:{},...P3(n.fills,j)?{}:{fills:[...j]},...y!==n.requires_person?{requires_person:y}:{},...p!==n.escalable?{escalable:p}:{}};if(Object.keys(k).length===0){r();return}D(()=>a({action:"edit",kind:"job_function",key:n.key,...k},`Job function ${c.trim()} saved.`))};return s.jsx(kn,{open:e,onOpenChange:R=>R||C?null:r(),children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:A,noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsx(En,{children:n?`Edit job function ${n.label||n.key}`:"Add job function"}),s.jsxs(Tn,{children:["Its job description: what it does, the slots it fills and who may hold its posts.",n?s.jsxs(s.Fragment,{children:[" ","Its key, ",s.jsx("span",{className:"font-mono",children:n.key}),", does not change."]}):null]})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(ni,{refusal:_,context:l,subject:"the job function",action:M}),n?null:s.jsx(bn,{id:"org-function-key",label:"Key",help:R1("job function",l.host),error:w.key,children:R=>s.jsx(Et,{id:"org-function-key",className:"font-mono",value:i,autoComplete:"off","aria-invalid":w.key?!0:void 0,"aria-describedby":R,onChange:T=>{o(T.target.value),N({})}})}),s.jsx(bn,{id:"org-function-label",label:n?"Label":"Label (optional)",error:w.label,children:R=>s.jsx(Et,{id:"org-function-label",value:c,"aria-invalid":w.label?!0:void 0,"aria-describedby":R,onChange:T=>{d(T.target.value),N({})}})}),s.jsx(bn,{id:"org-function-description",label:"Job description (optional)",children:()=>s.jsx(Fn,{id:"org-function-description",rows:3,placeholder:"What this job function does",value:f,onChange:R=>m(R.target.value)})}),s.jsx(bn,{id:"org-function-parent",label:"Parent function",help:"Its posts report to the post of the parent function.",children:R=>s.jsx(C1,{id:"org-function-parent",value:h,on_change:x,none:"No parent (a root function)",options:B,described_by:R})}),s.jsx(S1,{id:"org-function-fills",legend:"Slots it fills",options:Y,checked:j,on_change:v,empty:l.host==="hosted"?"This organization has no slots yet.":"This org has no slots yet; add them with sdlc org add slot."}),s.jsx(Sy,{id:"org-function-requires-person",label:"Requires a person",help:"Only a person may hold its posts.",checked:y,on_change:g}),s.jsx(Sy,{id:"org-function-escalable",label:"Escalable",help:"When no holder can decide, the decision goes up the reporting line. Off, it waits for a holder of this function.",checked:p,on_change:b})]}),s.jsxs(Rn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:C,onClick:r,children:"Cancel"}),s.jsx(ai,{saving:C,blocked:H,children:n?C?"Saving…":"Save":C?"Adding…":"Add job function"})]})]})})})}const G3=/^[a-z][a-z0-9_-]{0,63}$/;function V3(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[^a-z]+/,"").slice(0,64).replace(/-+$/,"")}function Y3({open:e,chart:t,slot:n,save:a,on_close:r,context:l=ri}){const[i,o]=u.useState(""),[c,d]=u.useState(""),[f,m]=u.useState(!1),[h,x]=u.useState(""),[j,v]=u.useState({}),{saving:y,refusal:g,set_refusal:p,run:b}=si(r);u.useEffect(()=>{e&&(o((n==null?void 0:n.label)??""),d((n==null?void 0:n.key)??""),m(!1),x((n==null?void 0:n.description)??""),v({}),p(null))},[e,n,p]);const w=!er(l),N=n?"save the slot":"add the slot",C=_=>{if(_.preventDefault(),w)return;const S=i.trim();if(n){if(!S){v({label:"Give the slot a label."});return}const O={...S!==(n.label??"").trim()?{label:S}:{},...h.trim()!==(n.description??"").trim()?{description:h.trim()}:{}};if(Object.keys(O).length===0){r();return}b(()=>a({action:"edit",kind:"slot",key:n.key,...O},`Saved slot ${S}.`));return}const D={...S?{}:{label:"Give the slot a label."},...G3.test(c)?t.slots.some(O=>O.key===c)?{key:`Slot ${c} already exists.`}:{}:{key:"Use lowercase letters, digits, _ and -, starting with a letter, at most 64 characters."}};v(D),!(D.label||D.key)&&b(()=>a({action:"add",kind:"slot",key:c,label:S,...h.trim()?{description:h.trim()}:{}},`Added slot ${S}.`))};return s.jsx(kn,{open:e,onOpenChange:_=>_||y?null:r(),children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:C,noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsx(En,{children:n?`Edit ${n.label||n.key}`:"Add slot"}),s.jsx(Tn,{children:"A slot is a workflow role a project fills from its team's posts. Job functions name the slots they fill."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(ni,{refusal:g,context:l,subject:"the slot",action:N}),s.jsx(bn,{id:"org-slot-label",label:"Label",help:"How the slot is named on the chart and in project settings.",error:j.label,children:_=>s.jsx(Et,{id:"org-slot-label",value:i,"aria-invalid":j.label?!0:void 0,"aria-describedby":_,onChange:S=>{o(S.target.value),!n&&!f&&d(V3(S.target.value)),v({})}})}),n?s.jsx(Bm,{label:"Key",children:s.jsx("span",{className:"font-mono",children:n.key})}):s.jsx(bn,{id:"org-slot-key",label:"Key",help:"Lowercase letters, digits, _ and -, starting with a letter, at most 64 characters. It can't be changed after you save.",error:j.key,children:_=>s.jsx(Et,{id:"org-slot-key",className:"font-mono",value:c,autoComplete:"off","aria-invalid":j.key?!0:void 0,"aria-describedby":_,onChange:S=>{d(S.target.value),m(!0),v({})}})}),s.jsx(bn,{id:"org-slot-description",label:"Description (optional)",children:()=>s.jsx(Fn,{id:"org-slot-description",rows:3,placeholder:"What this role does",value:h,onChange:_=>x(_.target.value)})})]}),s.jsxs(Rn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:y,onClick:r,children:"Cancel"}),s.jsx(ai,{saving:y,blocked:w,children:n?y?"Saving…":"Save":y?"Adding…":"Add slot"})]})]})})})}function F3({open:e,chart:t,binding:n,names:a,save:r,confirm:l,on_close:i,context:o=ri,hosted:c}){var H;const[d,f]=u.useState(new Set),[m,h]=u.useState(""),[x,j]=u.useState({}),{saving:v,refusal:y,set_refusal:g,run:p}=si(i),b=(n==null?void 0:n.slot)??null;if(u.useEffect(()=>{!e||!n||(f(new Set(c&&n.source!=="override"?[]:n.posts.map(M=>M.post))),h(n.source==="override"?n.reason??"":""),j({}),g(null))},[e,b,g]),!n)return null;const w=a.slot(n.slot),N=(H=t.project)!=null&&H.team?t.teams.find(M=>{var A;return M.key===((A=t.project)==null?void 0:A.team)}):void 0,C=N?N.label||N.key:"the owning team",_=new Set(t.job_functions.filter(M=>M.fills.includes(n.slot)).map(M=>M.key)),S=[...t.posts].map(M=>M.post).sort(a.byPost).map(M=>{const A=_.has(M.split("/")[1]??"")?`${a.post(M)} (fills ${w})`:a.post(M),R=c==null?void 0:c.holders(M);return{value:M,label:c?R?`${A}: ${R}`:`${A} (no holder)`:A}}),D=c?[...d].sort(a.byPost).flatMap(M=>[..._.has(M.split("/")[1]??"")?[]:[`${a.post(M)} is not in the job description of ${w}.`],...c.chain.has(M.split("/")[0]??"")?[]:[`${a.post(M)} is outside ${c.owner} and the teams above it.`]]):[],O=!er(o),B=M=>{M.preventDefault();const A={...d.size===0?{posts:"Choose at least one post."}:{},...m.trim()?{}:{reason:"Give the reason for the override."}};j(A),!(A.posts||A.reason||O)&&p(()=>r({action:"bind",slot:n.slot,posts:[...d],reason:m.trim()},`Override of ${w} saved.`))},Y=async()=>{await l({title:`Clear the override of ${w}?`,description:c?`${w} goes back to its team's posts: ${c.baseline}. The override and its reason stay in the audit trail.`:"It goes back to the posts its job descriptions name, and its reason is not kept.",action_label:c?"Clear override":"Clear",destructive:!0})&&p(()=>r({action:"unbind",slot:n.slot},`Override of ${w} cleared.`))};return s.jsx(kn,{open:e,onOpenChange:M=>M||v?null:i(),children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:B,noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsxs(En,{children:["Override ",w]}),s.jsxs(Tn,{children:["Bind ",w," in this project to the posts you choose instead of its"," ",c?"team’s":"job descriptions’"," posts. The override is reported with its reason, who set it and when."]})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[y||O?s.jsx("div",{id:"org-override-refusal",className:"grid gap-4",children:s.jsx(ni,{refusal:y,context:o,subject:"the override",action:c?"save":"save the override",changing:c?"Changing this project’s slots":void 0,authority_title:c?"Your changes were not saved":void 0})}):null,s.jsx(S1,{id:"org-override-posts",legend:"Posts",help:c?`(fills ${w}) marks the posts whose job function fills ${w}.`:"A post outside its job description is marked on the chart.",notes:D,scroll:!!c,error:x.posts,options:S,checked:d,on_change:M=>{f(M),j(A=>({...A,posts:void 0}))}}),s.jsx(bn,{id:"org-override-reason",label:"Reason",error:x.reason,children:M=>s.jsx(Fn,{id:"org-override-reason",rows:2,placeholder:"Why this slot needs other posts",value:m,"aria-invalid":x.reason?!0:void 0,"aria-describedby":M,onChange:A=>{h(A.target.value),j(R=>({...R,reason:void 0}))}})}),c?null:s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Made as ",s.jsx("span",{className:"font-mono",children:"person:user"}),", who must hold the lead post of ",C," or of a team above it."]})]}),s.jsxs(Rn,{className:"mt-6",children:[n.source==="override"?s.jsx(q,{type:"button",variant:"ghost",className:"sm:mr-auto",disabled:v,onClick:()=>void Y(),children:"Clear override"}):null,s.jsx(q,{type:"button",variant:"outline",disabled:v,onClick:i,children:"Cancel"}),s.jsx(ai,{saving:v,blocked:O,described_by:"org-override-refusal",children:v?"Saving…":"Save override"})]})]})})})}function K3(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function X3({open:e,chart:t,names:n,save:a,on_close:r,context:l}){var M;const i=t.authority,o=u.useMemo(()=>i?new Set(i.post_pairs):null,[i]),c=A=>!o||o.has(A),d=((M=t.teams.find(A=>A.parent===null))==null?void 0:M.key)??null,f=[...t.teams].filter(A=>!o||[...o].some(R=>R.startsWith(`${A.key}/`))).sort((A,R)=>A.key===d?-1:R.key===d?1:jo(A,R)),[m,h]=u.useState(""),[x,j]=u.useState(""),[v,y]=u.useState({}),{saving:g,refusal:p,set_refusal:b,run:w}=si(r);u.useEffect(()=>{var A;e&&(h(((A=f[0])==null?void 0:A.key)??""),j(""),y({}),b(null))},[e,b]);const N=new Set(t.posts.filter(A=>A.post.startsWith(`${m}/`)).map(A=>A.post.split("/")[1])),C=[],_=A=>{for(const R of[...t.job_functions].filter(T=>T.parent===A).sort(jo))C.push(R),_(R.key)};_(null);const S=C.filter(A=>c(`${m}/${A.key}`)&&!N.has(A.key)),D=m!==""&&S.length===0,O=!er(l)||D,B=A=>{if(A.preventDefault(),O)return;const R={...m?{}:{team:"Choose a team."},...x?{}:{job:"Choose a job function."}};y(R),!(R.team||R.job)&&w(()=>a({action:"add",kind:"post",key:`${m}/${x}`},`Added post ${n.job(x)} · ${n.team(m)}.`))},Y=D?"Every job function already has a post in this team.":"A team has one post per job function; functions already staffed in this team are left out.",H=(i==null?void 0:i.ask)??[];return s.jsx(kn,{open:e,onOpenChange:A=>A||g?null:r(),children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:B,noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"Add post"}),s.jsx(Tn,{children:"A post is a job function staffed in a team. People in this post report to the post above it."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(ni,{refusal:p,context:l,subject:"the post",action:"add the post"}),s.jsx(bn,{id:"org-post-team",label:"Team",help:"The team the post is in.",error:v.team,children:A=>s.jsxs(wt,{value:m,onValueChange:R=>{h(R),j(""),y({})},children:[s.jsx(vt,{id:"org-post-team","aria-describedby":A,"aria-invalid":v.team?!0:void 0,children:s.jsx(_t,{placeholder:"Choose a team"})}),s.jsx(yt,{children:f.map(R=>s.jsx(Ae,{value:R.key,children:R.label||R.key},R.key))})]})}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(bn,{id:"org-post-function",label:"Job function",help:Y,error:v.job,children:A=>s.jsxs(wt,{value:x,disabled:D,onValueChange:R=>{j(R),y({})},children:[s.jsx(vt,{id:"org-post-function","aria-describedby":A,"aria-invalid":v.job?!0:void 0,children:s.jsx(_t,{placeholder:D?"Every job function has a post here":"Choose a job function"})}),s.jsx(yt,{children:S.map(R=>s.jsx(Ae,{value:R.key,children:R.label||R.key},R.key))})]})}),i&&!i.administer?s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Only the job functions directly below a post you hold are listed.",H.length?` For others, ask ${K3(H)}.`:""]}):null]})]}),s.jsxs(Rn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:g,onClick:r,children:"Cancel"}),s.jsx(ai,{saving:g,blocked:O,described_by:D?"org-post-function-help":void 0,children:g?"Adding…":"Add post"})]})]})})})}function Q3({open:e,chart:t,post:n,names:a,members:r,save:l,on_close:i,context:o}){const[c,d]=u.useState({state:"loading"}),[f,m]=u.useState(""),[h,x]=u.useState(null),[j,v]=u.useState(-1),{saving:y,refusal:g,set_refusal:p,run:b}=si(i),w=u.useRef(0),N=u.useCallback(async()=>{const E=w.current+=1;d({state:"loading"});const I=await r();E===w.current&&d(I.ok?{state:"read",members:I.data}:{state:"failed"})},[r]);u.useEffect(()=>{e&&(m(""),x(null),v(-1),p(null),N())},[e,N,p]);const C=t.posts.find(E=>E.post===n);if(!n||!C)return null;const _=a.post(n),S=new Set(C.holders.map(E=>E.id)),O=t.posts.some(E=>E.reports_to===n)&&C.holders.length>0?C.holders[0]:null,B=f.trim().toLowerCase(),Y=c.state==="read"?c.members.filter(E=>!S.has(E.id)).filter(E=>!B||[E.label,E.detail,E.email].some(I=>I==null?void 0:I.toLowerCase().includes(B))):[],H=c.state==="read"&&c.members.every(E=>S.has(E.id)),M=c.state==="read"&&!H&&Y.length>0,A=M&&j>=0&&j<Y.length?Y[j]:null,R=E=>`org-holder-option-${E.id}`,T=!er(o)||!h||O!==null,k=E=>{if(!M)return;const I=Y.length-1,F=Q=>{var oe,ge;E.preventDefault(),v(Q),(ge=(oe=document.getElementById(R(Y[Q])))==null?void 0:oe.scrollIntoView)==null||ge.call(oe,{block:"nearest"})};E.key==="ArrowDown"?F(Math.min(A?j+1:0,I)):E.key==="ArrowUp"?F(A?Math.max(j-1,0):I):E.key==="Home"&&A?F(0):E.key==="End"&&A?F(I):E.key==="Enter"&&A&&(h==null?void 0:h.id)!==A.id&&(E.preventDefault(),x(A))},$=O?void 0:h?"Only members of the organization can hold its posts. Members who already hold it are left out.":"Choose a member to add.",P=E=>{E.preventDefault(),!(T||!h)&&b(()=>l({action:"hold",post:n,member:h.id},`Added ${h.label} to ${_}.`))};return s.jsx(kn,{open:e,onOpenChange:E=>E||y?null:i(),children:s.jsx(Sn,{children:s.jsxs("form",{onSubmit:P,noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsxs(En,{children:["Add holder to ",_]}),s.jsx(Tn,{children:"The member holds this post and reports as it does."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(ni,{refusal:g,context:o,subject:"the holder",action:"add the holder"}),O?s.jsxs(me,{variant:"info",id:"org-holder-one",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["This post takes one holder. Remove ",a.member(O)," first, then add the new holder."]})]}):null,s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"org-holder-member",children:"Member"}),s.jsx(Et,{id:"org-holder-member",role:"combobox","aria-expanded":M,"aria-controls":M?"org-holder-members":void 0,"aria-activedescendant":A?R(A):void 0,"aria-autocomplete":"list","aria-describedby":$?"org-holder-member-help":void 0,placeholder:"Search members by name, username or email",autoComplete:"off",value:f,disabled:O!==null,onChange:E=>{m(E.target.value),v(-1)},onKeyDown:k}),s.jsx("div",{className:"max-h-56 overflow-y-auto rounded-md border",children:c.state==="loading"?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-sm",role:"status",children:[s.jsx(dn,{className:"size-4","aria-hidden":"true"}),"Loading members…"]}):c.state==="failed"?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-2",children:[s.jsx("p",{className:"text-destructive text-sm",children:"Could not read the members."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void N(),children:"Retry"})]}):H?s.jsx("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"Every member already holds this post."}):Y.length===0?s.jsxs("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:["No member matches “",f.trim(),"”."]}):s.jsx("ul",{id:"org-holder-members",role:"listbox","aria-label":"Members",className:"m-0 list-none p-1",children:Y.map((E,I)=>{const F=(h==null?void 0:h.id)===E.id,Q=(A==null?void 0:A.id)===E.id;return s.jsxs("li",{id:R(E),role:"option","aria-selected":F,className:`cursor-pointer rounded-sm px-2 py-1.5 ${F?"bg-accent text-accent-foreground":Q?"bg-muted":"hover:bg-muted"} ${Q?"ring-ring ring-2 ring-inset":""}`,onClick:()=>{O||(v(I),x(E))},children:[s.jsxs("div",{className:"text-sm font-medium break-words",children:[E.label,E.detail&&Y.filter(oe=>oe.label===E.label).length>1?` (${E.detail})`:""]}),E.email?s.jsx("div",{className:"text-muted-foreground text-xs break-all",children:E.email}):null]},E.id)})})}),$?s.jsx("p",{id:"org-holder-member-help",className:"text-muted-foreground text-xs",children:$}):null]})]}),s.jsxs(Rn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:y,onClick:i,children:"Cancel"}),s.jsx(ai,{saving:y,blocked:T,described_by:O?"org-holder-one":$?"org-holder-member-help":void 0,children:y?"Adding…":"Add holder"})]})]})})})}function E1(e){const[t,n]=u.useState(null),a=u.useRef(t);u.useEffect(()=>{a.current=t},[t]);const r=u.useCallback(c=>{var d;(d=a.current)==null||d.resolve(c),n(null)},[]),l=u.useCallback(c=>new Promise(d=>{var f;(f=a.current)==null||f.resolve(!1),n({...c,resolve:d})}),[]);u.useEffect(()=>()=>{var c;return(c=a.current)==null?void 0:c.resolve(!1)},[]);const i=!er(e),o=s.jsx(sx,{open:t!==null,onOpenChange:c=>c?null:r(!1),children:s.jsxs(ax,{children:[s.jsxs(rx,{children:[s.jsx(ix,{children:t==null?void 0:t.title}),s.jsx(ox,{className:"whitespace-pre-line",children:t==null?void 0:t.description})]}),t&&i?s.jsx(bo,{context:e,action:t.action}):null,s.jsxs(lx,{children:[s.jsx(cx,{children:"Cancel"}),s.jsx(c_,{variant:t!=null&&t.destructive?"destructive":"default","aria-disabled":i||void 0,onClick:c=>{if(i){c.preventDefault();return}r(!0)},children:t==null?void 0:t.action_label})]})]})});return{confirm:l,confirm_dialog:o}}function wl({label:e,on_edit:t,on_remove:n,items:a}){const r=a??[...t?[{label:"Edit",on_select:t}]:[],...n?[{label:"Remove",on_select:n,destructive:!0}]:[]];return s.jsxs(Pd,{children:[s.jsx(qd,{asChild:!0,children:s.jsx(q,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`More actions for ${e}`,children:s.jsx(Fp,{className:"size-3.5","aria-hidden":"true"})})}),s.jsx(Wo,{align:"end",children:r.map(l=>s.jsx(Ll,{className:l.destructive?"text-destructive focus:text-destructive":void 0,onSelect:l.on_select,children:l.label},l.label))})]})}function W3({label:e,message:t,bound:n,on_dismiss:a}){return s.jsxs(me,{variant:"destructive",role:"alert",className:"mb-3",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:[e," was not removed"]}),s.jsxs(xe,{children:[s.jsx("p",{children:t}),n!=null&&n.projects.length?s.jsx("ul",{role:"list",className:"bg-card text-foreground m-0 mt-2 grid list-none gap-3 rounded-md border p-3",children:n.projects.map(r=>s.jsxs("li",{className:"grid gap-0.5",children:[s.jsxs("a",{className:"text-primary text-sm underline underline-offset-2",href:r.href,children:["Settings of ",r.name]}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Override set by ",r.set_by??"a former member"]})]},r.href))}):null,n&&n.more>0?s.jsxs("p",{className:"mt-2",children:["And ",n.more," more ",n.more===1?"project":"projects",". Clear these and try again to see the rest. An org owner can open any project you cannot."]}):null,s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:"Dismiss"})]})]})}const ri={host:"local",two_factor:"ok",settings_href:""},Ku={open:{label:"Open",tone:"info"},accepted:{label:"Accepted",tone:"success"},rejected:{label:"Rejected",tone:"error"},withdrawn:{label:"Withdrawn",tone:"neutral"}},Z3={added:{label:"Added",tone:"success"},changed:{label:"Changed",tone:"warning"},removed:{label:"Removed",tone:"error"}},J3={team:["team","teams"],job_function:["job function","job functions"],slot:["slot","slots"],post:["post","posts"],fill:["fill","fills"]},eL=["team","job_function","slot","post","fill"];function Wx(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function T1(e){const t=a=>Wx(eL.filter(r=>e[r][a]>0).map(r=>{const l=e[r][a];return`${l} ${J3[r][l===1?0:1]}`}));return[["Adds","adds",t("added")],["Changes","changes",t("changed")],["Removes","removes",t("removed")]].filter(([,,a])=>a).map(([a,r,l],i)=>`${i===0?a:r} ${l}`).join("; ")||"No changes"}function Xu(e){return new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function tL(e){const t=`Proposed by ${e.requested_by} on ${Xu(e.requested_at)}`;return e.status==="open"||!e.decided_at?t:`${t} · ${Ku[e.status].label} by ${e.decided_by??"a former member"} on ${Xu(e.decided_at)}`}function nL(e,t){const[n,a]=u.useState(e?{state:"loading"}:{state:"off"});return u.useEffect(()=>{if(!e||!t){e||a({state:"off"});return}let r=!0;return e.list().then(l=>{r&&(l.ok?a({state:"read",proposals:l.data}):l.refusal.status===404||l.refusal.reason==="not_found"?a({state:"off"}):a({state:"failed",message:l.refusal.message}))}),()=>{r=!1}},[e,t]),n}function Cy({proposal:e,on_open:t}){const n=Ku[e.status];return s.jsxs("li",{className:"border-b px-4 py-2.5 last:border-b-0","data-testid":"org-proposal",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(q,{type:"button",variant:"link",size:"sm",className:"h-auto p-0 text-left whitespace-normal",onClick:t,children:e.title}),s.jsx(pe,{variant:n.tone,children:n.label})]}),s.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:[e.status==="open"?`Proposed by ${e.requested_by} on ${Xu(e.requested_at)}`:`${n.label} by ${e.decided_by??"a former member"} on ${Xu(e.decided_at??e.requested_at)}`,` · ${T1(e.counts)}`]})]})}const sL="Changes members propose to the org's teams, job functions, posts and slots. Nothing changes until someone who may make the change accepts it.";function aL({listed:e,on_propose:t,on_open:n}){const[a,r]=u.useState(!1);if(e.state==="off"||e.state==="loading")return null;const l=e.state==="read"?e.proposals:[],i=l.filter(c=>c.status==="open"),o=l.filter(c=>c.status!=="open");return s.jsxs("section",{"aria-labelledby":"org-chart-proposals",className:"mt-6 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[s.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{id:"org-chart-proposals",className:"text-lg font-semibold",children:"Proposals"}),i.length?s.jsx(pe,{variant:"info",children:`${i.length} open`}):null]}),s.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:sL})]}),s.jsxs(q,{type:"button",variant:"outline",size:"sm",onClick:t,children:[s.jsx(mm,{className:"size-4","aria-hidden":"true"}),"Propose a change"]})]}),s.jsxs("div",{className:"mt-3 grid gap-2",children:[e.state==="failed"?s.jsxs("p",{className:"text-destructive text-sm",role:"alert",children:["Could not read the proposals. ",e.message]}):null,e.state==="read"&&l.length===0?s.jsxs(xt,{className:"flex flex-col items-center gap-2 p-6 text-center",children:[s.jsx(mm,{className:"text-muted-foreground size-5","aria-hidden":"true"}),s.jsx("p",{className:"text-sm font-medium",children:"No proposals yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Propose a change to the org's structure for someone with the authority to accept."})]}):null,i.length?s.jsx(xt,{className:"overflow-hidden",children:s.jsx("ul",{role:"list",className:"m-0 list-none p-0","aria-label":"Open proposals",children:i.map(c=>s.jsx(Cy,{proposal:c,on_open:()=>n(c)},c.id))})}):null,o.length?s.jsxs("div",{children:[s.jsxs(q,{type:"button",variant:"ghost",size:"sm","aria-expanded":a,"aria-controls":"org-chart-proposals-decided",onClick:()=>r(c=>!c),children:[a?s.jsx(Yp,{className:"size-4","aria-hidden":"true"}):s.jsx(bd,{className:"size-4","aria-hidden":"true"}),`Decided (${o.length})`]}),a?s.jsx(xt,{className:"mt-2 overflow-hidden",children:s.jsx("ul",{id:"org-chart-proposals-decided",role:"list",className:"m-0 list-none p-0","aria-label":"Decided proposals",children:o.map(c=>s.jsx(Cy,{proposal:c,on_open:()=>n(c)},c.id))})}):null]}):null]})]})}const rL="Nothing you change here is saved to the organization. Submit the proposal for review, or discard it. A proposal can add teams but not rename, move or remove them, and it never changes who holds a post.";function lL({draft:e,on_submit:t,on_discard:n}){var c;const a=((c=e.moved)==null?void 0:c.state)==="conflict"?e.moved.names:null,r=!!e.moved,l=e.total===0?"No changes yet":`${e.total} ${e.total===1?"change":"changes"}`,i=e.total===0||!!a,o=r?ln:mm;return s.jsxs(me,{variant:r?"warning":"info",role:"status",className:"mt-6",children:[s.jsx(o,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:r?"The org changed while you drafted":"You are drafting a proposal"}),s.jsxs(xe,{children:[s.jsx("p",{id:"org-draft-why",children:a?`The org changed what your draft changes: ${Wx(a)}. Discard the draft and start again from the org as it is now.`:r?"We moved your draft onto the org as it is now and kept your changes. Check the chart, then submit again.":rL}),s.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[s.jsx(q,{type:"button",size:"sm","aria-disabled":i||void 0,"aria-describedby":i?a?"org-draft-why":"org-draft-count":void 0,onClick:()=>i?void 0:t(),children:"Submit proposal"}),s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:n,children:"Discard draft"}),s.jsx("span",{id:"org-draft-count",className:"text-muted-foreground text-xs",children:l})]})]})]})}const iL={proposal_empty:"The proposal changes nothing in the org."};function oL({open:e,draft:t,submit:n,on_close:a,on_done:r}){const[l,i]=u.useState(""),[o,c]=u.useState(""),[d,f]=u.useState(null),[m,h]=u.useState(null),[x,j]=u.useState(!1),v=u.useRef(!1);u.useEffect(()=>{e&&(f(null),h(null))},[e]);const y=async g=>{if(g.preventDefault(),v.current)return;const p=l.trim();if(!p||p.length>200){f("Give the proposal a title of at most 200 characters.");return}f(null),h(null),j(!0),v.current=!0;try{const b=await n({title:p,...o.trim()?{note:o.trim()}:{}});if(!b.ok){h(iL[b.refusal.code??""]??b.refusal.message);return}b.data.state==="proposed"&&(i(""),c("")),r(b.data,p)}finally{v.current=!1,j(!1)}};return s.jsx(kn,{open:e,onOpenChange:g=>g?null:a(),children:s.jsx(Sn,{className:"sm:max-w-lg",children:s.jsxs("form",{onSubmit:g=>void y(g),className:"grid gap-4",noValidate:!0,children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"Submit proposal"}),s.jsx(Tn,{children:"Someone who may make these changes reviews it. Nothing in the organization changes until it is accepted."})]}),m?s.jsxs(me,{variant:"destructive",role:"alert",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not submit the proposal"}),s.jsx(xe,{children:s.jsx("p",{children:m})})]}):null,s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"org-proposal-title",children:"Title"}),s.jsx(Et,{id:"org-proposal-title",value:l,maxLength:200,"aria-invalid":d?!0:void 0,"aria-describedby":d?"org-proposal-title-error":void 0,onChange:g=>i(g.target.value)}),d?s.jsx("p",{id:"org-proposal-title-error",className:"text-destructive text-sm",children:d}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"org-proposal-note",children:"Note (optional)"}),s.jsx(Fn,{id:"org-proposal-note",value:o,rows:3,maxLength:4e3,placeholder:"Why the org should make this change","aria-describedby":"org-proposal-note-help",onChange:g=>c(g.target.value)}),s.jsx("p",{id:"org-proposal-note-help",className:"text-muted-foreground text-xs",children:"At most 4000 characters."})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:T1(t.counts)}),s.jsxs(Rn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:a,children:"Cancel"}),s.jsxs(q,{type:"submit","aria-disabled":x||void 0,children:[x?s.jsx(dn,{className:"size-4","aria-hidden":"true"}):null,x?"Submitting…":"Submit proposal"]})]})]})})})}const cL=[{kind:"team",title:"Teams"},{kind:"job_function",title:"Job functions"},{kind:"slot",title:"Slots"},{kind:"post",title:"Posts"},{kind:"fill",title:"Fills"}];function uL({entry:e,decided:t}){const n=!t&&e.state==="settled",a=Z3[e.change];return s.jsxs("li",{className:"grid gap-1 border-b py-2","data-testid":"org-proposal-entry",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[n&&e.change==="added"?null:s.jsx(pe,{variant:a.tone,children:a.label}),s.jsx("span",{className:"text-sm font-medium",children:e.name}),n?s.jsx(pe,{variant:"neutral",children:"Already in the org"}):null,!t&&e.state==="conflict"?s.jsx(pe,{variant:"error",children:"Changed in the org since"}):null]}),[...e.where,...e.fields,...!t&&e.now?[e.now]:[]].map(r=>s.jsx("p",{className:"text-muted-foreground text-xs break-words",children:r},r))]})}function Ry(e,t){if(t.code==="proposal_conflict"&&e){const n=e.entries.filter(a=>a.state==="conflict").map(a=>a.name);if(n.length){const a=`The org changed what this proposal changes: ${Wx(n)}.`;if(e.proposal.mine)return`${a} Withdraw it and propose again from the org as it is now.`;const r=`ask ${e.proposal.requested_by} to withdraw it and propose again.`;return e.may_reject?`${a} Reject it, or ${r}`:`${a} You can ${r}`}}return t.code==="revision_conflict"?"Someone else changed the org. We read it again; check the proposal and accept again.":t.message}function dL({proposal:e,contract:t,context:n,check_two_factor:a,on_close:r,on_decided:l}){const[i,o]=u.useState(null),[c,d]=u.useState(null),[f,m]=u.useState(null),[h,x]=u.useState(!1),[j,v]=u.useState(null),[y,g]=u.useState("ok"),[p,b]=u.useState(null),[w,N]=u.useState(""),C=(e==null?void 0:e.id)??null,_=u.useRef(C);_.current=C;const S=u.useCallback(async()=>{if(!C)return;const E=await t.read(C);_.current===C&&(E.ok?(o(E.data),d(null)):d(E.refusal.message))},[t,C]);u.useEffect(()=>{if(o(null),d(null),m(null),x(!1),N(""),!C)return;S(),a().then(g);const E=()=>void a().then(I=>_.current===C&&g(I));return window.addEventListener("focus",E),()=>window.removeEventListener("focus",E)},[C,S,a]);const D=(i==null?void 0:i.proposal)??e,O=(D==null?void 0:D.title)??"",B=(D==null?void 0:D.status)==="open",Y=(i==null?void 0:i.entries.some(E=>E.state==="conflict"))??!1,H=!!i&&(i.may_accept||i.may_reject),M=y==="ok",A={...n,two_factor:y},R=async E=>{if(C){v(E),m(null);try{const I=E==="accept"?await t.accept(C):E==="reject"?await t.reject(C,w.trim()||void 0):await t.withdraw(C);if(I.ok){b(null),l(E==="accept"?`Accepted ${O}.`:E==="reject"?`Rejected ${O}.`:`Withdrew ${O}.`);return}if(b(null),I.refusal.code==="mfa_challenge_required"||I.refusal.code==="mfa_enrollment_required"){g(I.refusal.code==="mfa_enrollment_required"?"enroll":"challenge");return}E==="accept"&&x(!0);const F=await t.read(C);if(_.current!==C)return;const Q=F.ok?F.data:i;F.ok&&o(F.data),m({title:`${O} was not ${E==="accept"?"accepted":E==="reject"?"rejected":"withdrawn"}`,message:Ry(Q,I.refusal)})}finally{v(null)}}},T=i&&Y&&!f?Ry(i,{code:"proposal_conflict",message:""}):null,k=B&&i&&i.may_reject&&!i.may_accept&&!Y?i.accept_refusal??null:null,$=!M||Y||!!k||j!==null,P=[M?null:"org-proposal-two-factor",Y?"org-proposal-refusal":null,k?"org-proposal-accept-refusal":null].filter(Boolean).join(" ");return s.jsxs(s.Fragment,{children:[s.jsx(kn,{open:e!==null,onOpenChange:E=>E?null:r(),children:s.jsxs(Sn,{className:"flex max-h-[90vh] flex-col overflow-hidden sm:max-w-2xl",children:[s.jsxs(Cn,{children:[s.jsx(En,{children:O}),s.jsx(Tn,{asChild:!0,children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[D?s.jsx(pe,{variant:Ku[D.status].tone,children:Ku[D.status].label}):null,s.jsx("span",{children:D?tL(D):null})]})})]}),s.jsxs("div",{className:"-mx-1 grid min-h-0 flex-1 gap-4 overflow-y-auto px-1","data-testid":"org-proposal-body",children:[D!=null&&D.note?s.jsx("p",{className:"text-sm whitespace-pre-line",children:D.note}):null,D!=null&&D.decision_note?s.jsxs("div",{className:"grid gap-1",children:[s.jsx("span",{className:"text-sm font-medium",children:"Decision note"}),s.jsx("p",{className:"text-muted-foreground text-sm whitespace-pre-line",children:D.decision_note})]}):null,c?s.jsxs(me,{variant:"destructive",role:"alert",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read the proposal"}),s.jsx(xe,{children:s.jsx("p",{children:c})})]}):null,!i&&!c?s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:"Reading the proposal…"}):null,i?cL.map(E=>{const I=i.entries.filter(F=>F.kind===E.kind);return I.length?s.jsxs("div",{className:"grid",children:[s.jsx("h3",{className:"text-muted-foreground text-sm font-medium",children:E.title}),s.jsx("ul",{role:"list",className:"m-0 list-none p-0",children:I.map(F=>s.jsx(uL,{entry:F,decided:!B},`${F.kind}:${F.name}`))})]},E.kind):null}):null,B&&i&&!H&&i.decide_refusal?s.jsxs(me,{variant:"info",role:"status",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"You can't accept or reject this proposal"}),s.jsx(xe,{children:s.jsx("p",{children:i.decide_refusal})})]}):null,k?s.jsxs(me,{id:"org-proposal-accept-refusal",variant:"info",role:"status",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"You can't accept this proposal"}),s.jsx(xe,{children:s.jsx("p",{children:k})})]}):null,B&&H&&!M?s.jsx("div",{id:"org-proposal-two-factor",children:s.jsx(bo,{context:A,action:"decide the proposal",changing:"Accepting or rejecting a proposal"})}):null,f||T?s.jsxs(me,{id:"org-proposal-refusal",variant:"destructive",role:"alert",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:(f==null?void 0:f.title)??(h?`${O} was not accepted`:`${O} can't be accepted`)}),s.jsx(xe,{children:s.jsx("p",{children:(f==null?void 0:f.message)??T})})]}):null]}),s.jsxs(Rn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:r,children:"Close"}),B&&(i!=null&&i.may_withdraw)?s.jsx(q,{type:"button",variant:"outline",onClick:()=>b("withdraw"),children:"Withdraw proposal"}):null,B&&(i!=null&&i.may_reject)?s.jsx(q,{type:"button",variant:"outline",onClick:()=>b("reject"),children:"Reject"}):null,B&&i&&(i.may_accept||i.may_reject&&(Y||k))?s.jsxs(q,{type:"button","aria-disabled":$||void 0,"aria-describedby":P||void 0,onClick:()=>$?void 0:void R("accept"),children:[j==="accept"?s.jsx(dn,{className:"size-4","aria-hidden":"true"}):null,j==="accept"?"Accepting…":"Accept"]}):null]})]})}),s.jsx(sx,{open:p!==null,onOpenChange:E=>E?null:b(null),children:s.jsxs(ax,{children:[s.jsxs(rx,{children:[s.jsx(ix,{children:p==="reject"?`Reject ${O}?`:`Withdraw ${O}?`}),s.jsx(ox,{children:p==="reject"?`${(D==null?void 0:D.requested_by)??"The requester"} sees your note on the proposal.`:"Nobody can accept it after this."})]}),p==="reject"&&!M?s.jsx("div",{id:"org-proposal-reject-two-factor",children:s.jsx(bo,{context:A,action:"reject the proposal",changing:"Accepting or rejecting a proposal"})}):null,p==="reject"?s.jsxs("div",{className:"grid gap-2",children:[s.jsx(ze,{htmlFor:"org-proposal-reject-note",children:"Note (optional)"}),s.jsx(Fn,{id:"org-proposal-reject-note",value:w,rows:2,maxLength:4e3,placeholder:"Why you are rejecting it",onChange:E=>N(E.target.value)})]}):null,s.jsxs(lx,{children:[s.jsx(cx,{children:"Cancel"}),p==="reject"?s.jsx(q,{type:"button",variant:"destructive","aria-disabled":!M||j!==null||void 0,"aria-describedby":M?void 0:"org-proposal-reject-two-factor",onClick:()=>!M||j?void 0:void R("reject"),children:j==="reject"?"Rejecting…":"Reject proposal"}):s.jsx(q,{type:"button","aria-disabled":j!==null||void 0,onClick:()=>j?void 0:void R("withdraw"),children:j==="withdraw"?"Withdrawing…":"Withdraw"})]})]})})]})}const fL={local:"Who holds each post and who reports to whom in this repository's local org, worked out from its teams, job functions and posts.",hosted:"Who holds each post and who reports to whom in this organization, worked out from its teams, job functions and posts."},hL="Covered: someone holds a post that fills the slot. Vacant: posts fill it but nobody holds them. Uncovered: no job function fills it.",mL=4,Zx=e=>({paddingLeft:16+24*Math.min(e,mL)}),Qu={covered:{label:"Covered",tone:"success"},vacant:{label:"Vacant",tone:"warning"},uncovered:{label:"Uncovered",tone:"error"}};function pL(){const e=Nn().org;if(!e)throw new Error("The Org chart page rendered without the org seam.");return e}function xL({host:e="local",org:t=""}={}){const n=pL(),[a,r]=u.useState({state:"loading"}),[l,i]=u.useState(null),o=u.useRef(0),c=u.useRef(null),d=u.useCallback(k=>{const $=async P=>{const E=o.current+=1;c.current&&clearTimeout(c.current);const I=await n.chart();if(E!==o.current)return;if(I.ok){i({chart:I.data,at:new Date().toISOString()}),r({state:"read"});return}const{refusal:F}=I;if(F.reason==="no_local_org"){i(null),r({state:"none",seedable:F.seedable!==!1});return}if(e==="hosted"&&(F.reason==="not_found"||F.status===404)){i(null),r({state:"missing"});return}if(F.retry&&F.reason==="store_locked"&&P>0){const Q=F.retry_after??10;r({state:"busy",retry_after:Q}),c.current=setTimeout(()=>void $(P-1),Q*1e3);return}r({state:"failed",refusal:F})};return $(k)},[n,e]);u.useEffect(()=>(d(1),()=>{o.current+=1,c.current&&clearTimeout(c.current)}),[d]);const f=()=>void d(1),m=a.state==="none"||a.state==="missing"?null:l,{href:h}=Ze(),x=Mr(),j=h("/settings/account"),v=n.proposals,y=nL(v,(m==null?void 0:m.at)??null),g=!!v&&y.state!=="off",[p,b]=u.useState(null),[w,N]=u.useState(!1),[C,_]=u.useState(null),{confirm:S,confirm_dialog:D}=E1(ri),O=u.useMemo(()=>p&&v?{draft:p,change:v.draft.change,on_draft:b}:null,[p,v]),B=kL(n,f,(p==null?void 0:p.chart)??(m==null?void 0:m.chart)??vL,e,j,O),Y=n.twoFactor,H=u.useCallback(async()=>Y?Y():"ok",[Y]),M=!!p&&p.total>0,A=u.useRef(()=>{});A.current=()=>{v==null||v.draft.discard(),b(null)},u.useEffect(()=>{if(!M)return;let k=!0;const $=I=>{I.preventDefault()},P=()=>{k=!1,window.removeEventListener("beforeunload",$),document.removeEventListener("click",E,!0)},E=I=>{var J,re;if(!k||I.defaultPrevented||I.button!==0||I.metaKey||I.ctrlKey||I.shiftKey||I.altKey)return;const F=I.target,Q=(J=F==null?void 0:F.closest)==null?void 0:J.call(F,"a[href]"),oe=Q?null:(re=F==null?void 0:F.closest)==null?void 0:re.call(F,gL);let ge=null;if(Q&&Q.target!=="_blank"&&!Q.hasAttribute("download")){const ee=new URL(Q.href,window.location.href),fe=ee.pathname===window.location.pathname&&ee.search===window.location.search;ee.origin===window.location.origin&&!fe&&(ge=()=>window.location.assign(ee.href))}else oe&&oe.getAttribute("aria-current")!=="page"&&oe.getAttribute("aria-disabled")!=="true"&&!oe.hasAttribute("disabled")&&(ge=()=>oe.click());if(!ge)return;I.preventDefault(),I.stopPropagation();const Z=ge;S({title:"Discard your draft?",description:"Your changes to the draft are lost. Nothing in the organization changed.",action_label:"Discard draft",destructive:!0,action:"discard the draft"}).then(ee=>{ee&&(P(),A.current(),Z())})};return window.addEventListener("beforeunload",$),document.addEventListener("click",E,!0),P},[M,S]);const R=async()=>{if(!v)return;const k=await v.draft.begin();k.ok?b(k.data):x.error(k.refusal.message)},T=async()=>{(!(p&&p.total>0)||await S({title:"Discard your draft?",description:"Your changes to the draft are lost. Nothing in the organization changed.",action_label:"Discard draft",destructive:!0,action:"discard the draft"}))&&(v==null||v.draft.discard(),b(null))};return a.state==="missing"?s.jsx(RL,{org:t}):s.jsx(Lx,{children:s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(mn,{title:"Org chart",description:fL[e]}),a.state==="busy"&&!m?s.jsxs("p",{className:"text-muted-foreground mt-4 text-sm",role:"status",children:["Another sdlc command holds the repository store; reading again in ",a.retry_after," s."]}):null,(a.state==="loading"||a.state==="busy")&&!m?s.jsx(SL,{quiet:a.state==="busy"}):null,a.state==="none"?s.jsx(CL,{edit:(B==null?void 0:B.actions)??null,seedable:a.seedable}):null,a.state==="failed"?s.jsx(TL,{host:e,kept_at:(m==null?void 0:m.at)??null,on_retry:f}):null,m&&p?s.jsx(lL,{draft:p,on_submit:()=>N(!0),on_discard:()=>void T()}):m&&g?s.jsx(aL,{listed:y,on_propose:()=>void R(),on_open:_}):null,m?s.jsx(AL,{chart:(p==null?void 0:p.chart)??m.chart,host:e,edit:(B==null?void 0:B.actions)??null}):null,(B==null?void 0:B.dialogs)??null,v&&p?s.jsx(oL,{open:w,draft:p,submit:v.draft.submit,on_close:()=>N(!1),on_done:(k,$)=>{if(N(!1),k.state==="moved"){b(k.draft);return}b(null),x.success(`Proposed ${$}.`),f()}}):null,v&&g?s.jsx(dL,{proposal:C,contract:v,context:{host:e,two_factor:"ok",settings_href:j},check_two_factor:H,on_close:()=>_(null),on_decided:k=>{x.success(k),_(null),f()}}):null,D]})})}const gL='[data-sidebar="menu-button"]:not([aria-expanded]), [data-sidebar="menu-sub-button"]',vL={org:"",workflow:!1,teams:[],job_functions:[],slots:[],posts:[],members:[],slot_resolution:[],project:{team:null,roots:[]}};function yL(e){var i;const t=e.authority;if(!t)return{functions:!0,team_add:!0,team:()=>"full",post_add:!1,post:()=>!1,override:!0,slots:!1};const n=((i=e.teams.find(o=>o.parent===null))==null?void 0:i.key)??null,a=new Set(t.teams),r=new Set(t.team_descriptions),l=new Set(t.posts);return{functions:t.administer,team_add:a.size>0,team:o=>o===n?t.administer?"root":r.has(o)?"description":null:a.has(o)?"full":r.has(o)?"description":null,post_add:t.post_pairs.length>0,post:o=>l.has(o),override:!1,slots:t.administer}}function jL(e){const t=e.authority;return t?t.administer||t.teams.length>0||t.team_descriptions.length>0||t.posts.length>0||t.post_pairs.length>0:!0}const bL={functions:!0,team_add:!0,team:()=>"description",post_add:!0,post:()=>!0,override:!1,slots:!0};function Zd({mark:e}){return e?e==="added"?s.jsx(pe,{variant:"success",children:"Added"}):s.jsx(pe,{variant:"warning",children:"Changed"}):null}const wL={local:"It leaves this repository's local org. If a post, a team or function under it, a holder, an override or the project still needs it, nothing is removed and you are told what needs it.",hosted:"It leaves the organization. If a post, a team or job function under it, or a holder still needs it, nothing is removed and you are told what needs it."},_L={mfa_challenge_required:"challenge",mfa_enrollment_required:"enroll"};function NL(e,t,n){var c;const a=t==="hosted"&&!!n.authority,r=((c=n.authority)==null?void 0:c.two_factor)??!0,[l,i]=u.useState("ok"),o=u.useCallback(async()=>{a&&i(e.twoFactor?await e.twoFactor():r?"ok":"challenge")},[e,a,r]);return u.useEffect(()=>{if(!a){i("ok");return}r?i("ok"):o();const d=()=>void o();return window.addEventListener("focus",d),()=>window.removeEventListener("focus",d)},[a,r,o]),{state:l,set_state:i,check:o}}function kL(e,t,n,a,r,l=null){const i=Mr(),o=A1(n),c=NL(e,a,n),d=l?{host:a,two_factor:"ok",settings_href:r}:a==="hosted"?{host:a,two_factor:c.state,settings_href:r}:ri,{confirm:f,confirm_dialog:m}=E1(d),[h,x]=u.useState(null),[j,v]=u.useState({}),y=T=>v(k=>{if(!k[T])return k;const{[T]:$,...P}=k;return P}),g=e.members,p=u.useCallback(async()=>{if(!g)return{ok:!1};const T=await g();return T.ok?{ok:!0,data:T.data}:{ok:!1}},[g]),b=l?async T=>{const k=await l.change(T);return k.ok?(l.on_draft(k.data),{ok:!0,data:{}}):k}:e.change;if(!b||!l&&a==="hosted"&&(!n.authority||!jL(n)))return null;const w=l?bL:yL(n),N=T=>{const k=T.code?_L[T.code]:void 0;return k?(c.set_state(k),{kind:"two_factor",message:T.message}):T.code==="revision_conflict"?(t(),{kind:"changed",message:T.message}):T.code==="outside_authority"?(t(),{kind:"authority",message:T.message}):{message:T.message}},C=T=>T.action==="hold"||T.action==="release"?"posts":"kind"in T?T.kind==="team"?"teams":T.kind==="post"?"posts":T.kind==="slot"?"slots":"functions":null,_=(T,k)=>{if(l)return;const $=T==null?void 0:T.warning;$?i.error($):i.success(k),t()},S=async(T,k)=>{const $=await b(T);if(!$.ok)return N($.refusal);const P=C(T);return P&&y(P),_($.data,k),null},D=T=>{c.check(),x(T)},O=async(T,k,$,P)=>{const E=await b($);if(!E.ok){const I=N(E.refusal),F=E.refusal.bound,Q=F?F.projects.length+F.more:0,oe=F?`${F.kind==="slot"?"Slot":"Post"} ${k} is still needed by the ${Q===1?"override of 1 project that binds":`overrides of ${Q} projects that bind`} it. Clear ${Q===1?"it":"them"} on each project's Settings first.`:I.message;v(ge=>({...ge,[T]:{label:k,message:oe,...F?{bound:F}:{}}}));return}y(T),_(E.data,P)},B=async(T,k,$)=>{const P=T==="team"?"team":"job function";c.check(),(l||await f({title:`Remove ${P} ${$}?`,description:wL[a],action_label:"Remove",destructive:!0,action:`remove the ${P}`}))&&await O(T==="team"?"teams":"functions",$,{action:"remove",kind:T,key:k},`${T==="team"?"Team":"Job function"} ${$} removed.`)},Y=async T=>{const k=T.label||T.key;c.check(),(l||await f({title:`Remove slot ${k}?`,description:"Projects stop showing it. This can't be undone.",action_label:"Remove slot",destructive:!0,action:"remove the slot"}))&&await O("slots",k,{action:"remove",kind:"slot",key:T.key},`Removed slot ${k}.`)},H=async T=>{const k=o.post(T);c.check(),(l||await f({title:`Remove post ${k}?`,description:"The post leaves the organization's chart. A post with holders is refused; remove its holders first.",action_label:"Remove",destructive:!0,action:"remove the post"}))&&await O("posts",k,{action:"remove",kind:"post",key:T},`Removed post ${k}.`)},M=async(T,k)=>{const $=o.post(T),P=o.member(k),E=n.posts.find(ge=>ge.post===T),F=((E==null?void 0:E.holders.length)??0)<=1?E!=null&&E.escalates_to?` The post becomes vacant. Until someone holds it, its reports and the slots it fills go to ${o.manager(E.escalates_to)}.`:" The post becomes vacant.":"";if(c.check(),!await f({title:`Remove ${P} from ${$}?`,description:`They stop holding this post and no longer report through it.${F}`,action_label:"Remove",action:"remove the holder"}))return;const oe=await b({action:"release",post:T,member:k.id});if(!oe.ok){i.error(N(oe.refusal).message),t();return}y("posts"),_(oe.data,`Removed ${P} from ${$}.`)},A=()=>x(null),R=(h==null?void 0:h.kind)==="override"&&n.project&&n.project.team!==null?n.project.slots.find(T=>T.slot===h.slot)??null:null;return{actions:{can:w,host:a,drafting:!!l,...l?{marks:l.draft.marks}:{},team:(T,k="full")=>D({kind:"team",team:T,scope:k}),job:T=>D({kind:"function",job:T}),override:T=>D({kind:"override",slot:T}),slot:T=>D({kind:"slot",slot:T}),slot_remove:T=>void Y(T),remove:(T,k,$)=>void B(T,k,$),post_add:()=>D({kind:"post"}),post_remove:T=>void H(T),holder_add:T=>D({kind:"holder",post:T}),holder_remove:(T,k)=>void M(T,k),refused:T=>{const k=j[T];return k?s.jsx(W3,{label:k.label,message:k.message,bound:k.bound,on_dismiss:()=>y(T)}):null}},dialogs:s.jsxs(s.Fragment,{children:[s.jsx(I3,{open:(h==null?void 0:h.kind)==="team",chart:n,team:(h==null?void 0:h.kind)==="team"?h.team:null,scope:(h==null?void 0:h.kind)==="team"?h.scope:"full",parents:!l&&n.authority?n.authority.teams:void 0,save:S,on_close:A,context:d}),s.jsx(q3,{open:(h==null?void 0:h.kind)==="function",chart:n,job:(h==null?void 0:h.kind)==="function"?h.job:null,save:S,on_close:A,context:d}),s.jsx(F3,{open:R!==null,chart:n,binding:R,names:o,save:S,confirm:T=>f({...T,action:"clear the override"}),on_close:A}),s.jsx(Y3,{open:(h==null?void 0:h.kind)==="slot",chart:n,slot:(h==null?void 0:h.kind)==="slot"?h.slot:null,save:S,on_close:A,context:d}),s.jsx(X3,{open:(h==null?void 0:h.kind)==="post",chart:n,names:o,save:S,on_close:A,context:d}),s.jsx(Q3,{open:(h==null?void 0:h.kind)==="holder",chart:n,post:(h==null?void 0:h.kind)==="holder"?h.post:null,names:o,members:p,save:S,on_close:A,context:d}),m]})}}function SL({quiet:e=!1}){return s.jsx("div",{className:"mt-6 grid gap-2",...e?{"aria-hidden":!0}:{role:"status","aria-label":"Loading the org chart"},children:Array.from({length:4},(t,n)=>s.jsx(Rt,{className:n===3?"h-10 w-2/3":"h-10 w-full"},n))})}function _l({children:e}){return s.jsx("pre",{className:"bg-muted text-foreground m-0 overflow-x-auto rounded-md border px-3 py-2 font-mono text-sm",children:s.jsx("code",{children:e})})}function CL({edit:e,seedable:t}){const n=t?e?"Plan one from this checkout's workflow roles with sdlc org seed, or start one with a team. This page shows it as soon as it exists.":"Plan one from this checkout's workflow roles, or start one with a team. This page shows it as soon as it exists.":"Start one with a team. This page shows it as soon as it exists.";return s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(cs,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This repository has no local org yet"}),s.jsxs(xe,{children:[s.jsx("p",{children:n}),t||!e?s.jsxs("div",{className:"mt-2 grid w-full gap-2",children:[t?s.jsx(_l,{children:"sdlc org seed"}):null,e?null:s.jsx(_l,{children:"sdlc org add team <key>"})]}):null,e?s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>e.team(null),children:[s.jsx(jr,{className:"size-4","aria-hidden":"true"}),"Add team"]}):null]})]})}function RL({org:e}){const{href:t,Link:n}=Ze();return s.jsx(Wa,{title:"Page not found",description:e?`There is no organization ${e}, or you are not one of its members.`:"This organization does not exist, or you are not one of its members.",backHref:t("/org"),backLabel:"Back to Organizations",link:n})}function EL(e){return new Date(e).toDateString()===new Date().toDateString()?`today at ${_s(e)}`:`on ${rs(e)} at ${_s(e)}`}function TL({host:e,kept_at:t,on_retry:n}){const a=t?`The chart read ${EL(t)} is kept below. `:"";return s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:e==="hosted"?"Could not read the org chart":"Could not read the local org"}),s.jsxs(xe,{children:[s.jsxs("p",{children:[a,e==="hosted"?a?"Try again in a moment.":"Try again in a moment. If it keeps failing, ask an organization owner.":"Details are in the terminal running sdlc viewer."]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function A1(e){return u.useMemo(()=>{const t=new Map(e.teams.map(y=>[y.key,y.label||y.key])),n=new Map(e.job_functions.map(y=>[y.key,y.label||y.key])),a=new Map(e.slots.map(y=>[y.key,y.label||y.key])),r=new Map(e.posts.map(y=>[y.post,y.holders])),l=y=>y.label||y.id,i=new Map;for(const y of[...e.members,...e.posts.flatMap(g=>g.holders)]){const g=l(y);i.set(g,(i.get(g)??new Set).add(`${y.kind}:${y.id}`))}const o=y=>{var g;return(((g=i.get(l(y)))==null?void 0:g.size)??0)>1},c=y=>{const g=o(y)?y.detail??y.id:null;return g&&g!==l(y)?g:null},d=y=>{const g=c(y);return g&&g!==l(y)?`${l(y)} (${g})`:l(y)},f=y=>{const[g="",p=""]=y.split("/");return{team:t.get(g)??g,job:n.get(p)??p}},m=y=>{const{team:g,job:p}=f(y);return`${p} · ${g}`},h=y=>{if(y==="top")return"Top of the org";if(typeof y!="string")return`A vacant ${n.get(y.vacant)??y.vacant}`;const g=(r.get(y)??[]).map(d);return g.length?`${m(y)} (${g.join(", ")})`:m(y)},x=new Map(e.teams.map(y=>[y.key,y.parent])),j=y=>{let g=0;for(let p=x.get(y);p&&g<e.teams.length;p=x.get(p))g+=1;return g};return{parts:f,post:m,member:d,memberLabel:l,memberDetail:c,manager:h,byPost:(y,g)=>{const[p="",b=""]=[y.split("/")[0],g.split("/")[0]],[w,N]=[f(y),f(g)];return j(p)-j(b)||w.team.localeCompare(N.team)||w.job.localeCompare(N.job)},slot:y=>a.get(y)??y,job:y=>n.get(y)??y,team:y=>t.get(y)??y}},[e])}function ir({id:e,title:t,description:n,actions:a,children:r,anchor:l}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;!l||typeof window>"u"||window.location.hash!==`#${l}`||((o=i.current)==null||o.scrollIntoView({block:"start"}),(c=i.current)==null||c.focus({preventScroll:!0}))},[l]),s.jsxs("section",{id:l,"aria-labelledby":e,className:"mt-8 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[s.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[s.jsx("h2",{id:e,ref:i,tabIndex:l?-1:void 0,className:"text-lg font-semibold",children:t}),s.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:n})]}),a?s.jsx("div",{className:"flex shrink-0 gap-2",children:a}):null]}),s.jsx("div",{className:"mt-3",children:r})]})}function Ai({children:e,on_click:t}){return s.jsxs(q,{type:"button",variant:"outline",size:"sm",onClick:t,children:[s.jsx(jr,{className:"size-4","aria-hidden":"true"}),e]})}const Ey={local:"A member's primary manager comes from the post highest in the function tree; the others are dotted lines.",hosted:"Members who hold a post. A member's primary manager comes from the post highest in the function tree; the others are dotted lines."};function AL({chart:e,host:t,edit:n}){const a=A1(e),r=e.members.some(l=>l.kind==="agent");return s.jsxs(s.Fragment,{children:[s.jsxs(ir,{id:"org-chart-lines",title:"Reporting lines",description:"Each post reports to the post of its parent job function in the same team, or else in the nearest team above it that has one.",actions:n!=null&&n.can.post_add?s.jsx(Ai,{on_click:n.post_add,children:"Add post"}):void 0,children:[n==null?void 0:n.refused("posts"),s.jsx(OL,{chart:e,names:a,agents:r,host:t,edit:n})]}),s.jsx(ir,{id:"org-chart-members",title:"Members",description:r?`${Ey[t]} Each agent answers to the nearest person in its reporting chain.`:Ey[t],children:s.jsx(BL,{chart:e,names:a,host:t,agents:r})}),n?s.jsxs(ir,{id:"org-chart-teams",title:"Teams",description:"Each team under its parent. A post is one of its job functions staffed in it.",actions:n.can.team_add?s.jsx(Ai,{on_click:()=>n.team(null),children:"Add team"}):void 0,children:[n.refused("teams"),s.jsx(ML,{chart:e,edit:n})]}):null,s.jsxs("div",{className:"grid items-start gap-x-6 xl:grid-cols-2",children:[s.jsxs(ir,{id:"org-chart-functions",title:"Function tree",description:"Each job function under its parent, with the slots it fills.",actions:n!=null&&n.can.functions?s.jsx(Ai,{on_click:()=>n.job(null),children:"Add job function"}):void 0,children:[n!=null&&n.can.functions?n.refused("functions"):null,s.jsx(HL,{chart:e,names:a,edit:n!=null&&n.can.functions?n:null})]}),s.jsxs(ir,{id:"org-chart-slots",anchor:"slots",title:"Slots",description:hL,actions:n!=null&&n.can.slots&&e.slot_resolution.length>0?s.jsx(Ai,{on_click:()=>n.slot(null),children:"Add slot"}):void 0,children:[n!=null&&n.can.slots?n.refused("slots"):null,e.workflow===!1?s.jsx("p",{className:"text-muted-foreground mb-3 text-xs",children:"This checkout has no workflow file, so no slot is marked as a gate."}):null,s.jsx(PL,{chart:e,names:a,host:t,edit:n!=null&&n.can.slots?n:null})]})]}),e.project?s.jsx(GL,{project:e.project,chart:e,names:a,edit:n!=null&&n.can.override?n:null}):null]})}function ML({chart:e,edit:t}){var c;const n=Jx([...e.teams].sort((d,f)=>(d.label||d.key).localeCompare(f.label||f.key)),d=>d.key,d=>d.parent);if(n.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"No teams yet."});const a=((c=e.project)==null?void 0:c.team)??null,r=t.host==="hosted",l=(d,f)=>{const m=t.can.team(d.key);return m==="full"?s.jsx(wl,{label:f,on_edit:()=>t.team(d),on_remove:()=>t.remove("team",d.key,f)}):m==="root"?s.jsx(wl,{label:f,on_edit:()=>t.team(d,"description")}):m==="description"&&t.drafting?s.jsx(wl,{label:f,items:[{label:"Edit description",on_select:()=>t.team(d,"description")}]}):m==="description"?s.jsx(q,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`Edit the description of ${f}`,onClick:()=>t.team(d,"description"),children:s.jsx(_d,{className:"size-3.5","aria-hidden":"true"})}):null},i=(d,f)=>s.jsx("ul",{role:"list",className:f===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:d.map(({item:m,children:h})=>{var j;const x=m.label||m.key;return s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:Zx(f),"data-testid":"org-chart-team",children:[s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:x}),s.jsx(Zd,{mark:(j=t.marks)==null?void 0:j.teams[m.key]})]}),s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[r?null:s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:m.key}),a===m.key?s.jsx(pe,{variant:"neutral",children:"Owns this project"}):null,l(m,x)]})]}),h.length>0?i(h,f+1):null]},m.key)})}),o=r&&e.teams.length===1;return s.jsxs(s.Fragment,{children:[s.jsx(xt,{className:"overflow-hidden",children:i(n,0)}),o?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["No teams below ",e.teams[0].label||e.teams[0].key," yet."]}):null]})}function Jx(e,t,n){const a=new Set(e.map(t)),r=new Map(e.map(i=>[t(i),{item:i,children:[]}])),l=[];for(const i of e){const o=n(i),c=r.get(t(i));o&&a.has(o)&&o!==t(i)?r.get(o).children.push(c):l.push(c)}return l}const $L={local:"No posts yet.",hosted:"No posts yet. An org admin can add them."};function OL({chart:e,names:t,agents:n,host:a,edit:r}){const l=Jx([...e.posts].sort((c,d)=>t.byPost(c.post,d.post)),c=>c.post,c=>typeof c.reports_to=="string"&&c.reports_to!=="top"?c.reports_to:null);if(l.length===0){const c=a==="hosted"&&(r==null?void 0:r.can.functions)&&!r.can.post_add;return s.jsx("p",{className:"text-muted-foreground text-sm",children:r!=null&&r.can.post_add?"No posts yet. Add a post to staff a job function in a team.":c?"No posts yet. Add a job function under Function tree first, then add a post to staff it in a team.":$L[a]})}const i=new Map(e.members.map(c=>[`${c.kind}:${c.id}`,c])),o=(c,d)=>s.jsx("ul",{role:"list",className:d===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:c.map(({item:f,children:m})=>{var v;const{team:h}=t.parts(f.post),x=typeof f.reports_to=="object"?f.reports_to:null,j=!!(r!=null&&r.can.post(f.post));return s.jsxs("li",{children:[s.jsxs("div",{className:"border-b py-2 pr-4",style:Zx(d),"data-testid":"org-chart-post",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(IR,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium",children:t.parts(f.post).job}),s.jsx("span",{className:"text-muted-foreground text-xs",children:x?`${h} · Reports to a vacant ${t.job(x.vacant)}`:h}),s.jsx(Zd,{mark:(v=r==null?void 0:r.marks)==null?void 0:v.posts[f.post]}),j&&r?s.jsx("span",{className:"ml-auto",children:s.jsx(wl,{label:t.post(f.post),items:[...r.drafting?[]:[{label:"Add holder",on_select:()=>r.holder_add(f.post)}],{label:"Remove post",on_select:()=>r.post_remove(f.post),destructive:!0}]})}):null]}),s.jsx("div",{className:"mt-1 grid min-w-0 gap-1 pl-6",children:f.holders.length===0?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(pe,{variant:Qu.vacant.tone,children:Qu.vacant.label}),s.jsx("span",{className:"text-muted-foreground text-xs",children:f.escalates_to?`No one holds this post. Its work goes to ${t.manager(f.escalates_to)}.`:"No one holds this post."})]}):f.holders.map(y=>s.jsx(LL,{holder:y,post:f.post,member:i.get(`${y.kind}:${y.id}`),names:t,agents:n,host:a,on_remove:j&&r&&!r.drafting?()=>r.holder_remove(f.post,y):void 0},`${y.kind}:${y.id}`))})]}),m.length>0?o(m,d+1):null]},f.post)})});return s.jsx(xt,{className:"overflow-hidden",children:o(l,0)})}function DL(e){return new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function zL(e){if(!e.held_since)return null;const t=DL(e.held_since);return e.added_by?e.added_by==="former_member"?`Added on ${t} by a former member`:`Added by ${e.added_by.name} on ${t}`:`Added on ${t}`}function LL({holder:e,post:t,member:n,names:a,agents:r,host:l,on_remove:i}){const o=e.kind==="person"?Kp:Vp,c=n==null?void 0:n.posts.find(j=>j.post===t),d=n==null?void 0:n.posts.find(j=>j.primary),f=a.memberDetail(e);let m=null;c!=null&&c.dotted&&d?m=`Dotted line: primary manager is ${a.manager(d.reports_to)}`:e.kind==="agent"&&n&&"accountable_person"in n&&(m=n.accountable_person?`Accountable person ${a.member(n.accountable_person)}`:"No accountable person");const h=l==="hosted"?zL(e):null,x=a.memberLabel(e);return s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx(o,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium break-all",children:x}),i?s.jsxs(Ux,{children:[s.jsx(Bx,{asChild:!0,children:s.jsx(q,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`Remove ${a.member(e)} from ${a.post(t)}`,onClick:i,children:s.jsx(kd,{className:"size-3.5","aria-hidden":"true"})})}),s.jsxs(Qd,{children:["Remove ",x]})]}):null,f?s.jsx("span",{className:"text-muted-foreground text-xs break-all",children:f}):null,r?s.jsx("span",{className:"text-muted-foreground text-xs",children:e.kind==="person"?"Person":"Agent"}):null]}),m?s.jsx("div",{className:"pl-5.5 text-xs",children:m}):null,h?s.jsx("div",{className:"text-muted-foreground pl-5.5 text-xs",children:h}):null]})}const UL=["sdlc org hold <team>/<function> --person <id>","sdlc org hold <team>/<function> --agent <id>"];function BL({chart:e,names:t,host:n,agents:a}){if(e.members.length===0)return n==="hosted"?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No one holds a post yet."}):s.jsxs("div",{className:"grid max-w-2xl gap-2",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"No one holds a post yet. Give a post to a person or an agent:"}),UL.map(l=>s.jsx(_l,{children:l},l))]});const r=[...e.members].sort((l,i)=>l.kind===i.kind?t.memberLabel(l).localeCompare(t.memberLabel(i))||l.id.localeCompare(i.id):l.kind==="person"?-1:1);return s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Members",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Member"}),s.jsx(X,{children:"Posts"}),s.jsx(X,{children:"Primary manager"}),s.jsx(X,{children:"Dotted lines"}),a?s.jsx(X,{children:"Accountable person"}):null]})}),s.jsx(Xe,{children:r.map(l=>{const i=l.posts.find(d=>d.primary),o=l.posts.filter(d=>d.dotted),c=t.memberDetail(l);return s.jsxs(he,{"data-testid":"org-chart-member",children:[s.jsxs(K,{children:[s.jsx("div",{className:"font-medium",children:t.memberLabel(l)}),c?s.jsx("div",{className:"text-muted-foreground text-xs",children:c}):null,a?s.jsx("div",{className:"text-muted-foreground text-xs",children:l.kind==="person"?"Person":"Agent"}):null]}),s.jsx(K,{children:l.posts.map(d=>t.post(d.post)).join(", ")}),s.jsx(K,{children:i?t.manager(i.reports_to):"None"}),s.jsx(K,{children:o.length?o.map(d=>t.manager(d.reports_to)).join(", "):"None"}),a?s.jsx(K,{children:l.kind==="person"?"Not an agent":l.accountable_person?t.member(l.accountable_person):"None"}):null]},`${l.kind}:${l.id}`)})})]})})}function HL({chart:e,names:t,edit:n}){const a=Jx([...e.job_functions].sort((l,i)=>(l.label||l.key).localeCompare(i.label||i.key)),l=>l.key,l=>l.parent);if(a.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:(n==null?void 0:n.host)==="hosted"?"No job functions yet. Add one to start the chart.":"No job functions yet."});const r=(l,i)=>s.jsx("ul",{role:"list",className:i===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:l.map(({item:o,children:c})=>{var d;return s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:Zx(i),"data-testid":"org-chart-function",children:[s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:o.label||o.key}),s.jsx(Zd,{mark:(d=n==null?void 0:n.marks)==null?void 0:d.job_functions[o.key]})]}),s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:o.fills.length?`Fills ${o.fills.map(t.slot).join(", ")}`:"No slot"}),o.requires_person?s.jsx(pe,{variant:"neutral",children:"Requires a person"}):null,n?s.jsx(wl,{label:o.label||o.key,on_edit:()=>n.job(o),on_remove:()=>n.remove("job_function",o.key,o.label||o.key)}):null]})]}),c.length>0?r(c,i+1):null]},o.key)})});return s.jsx(xt,{className:"overflow-hidden",children:r(a,0)})}function IL(e,t){return e.status==="uncovered"?"No job function fills this slot":e.status==="vacant"?`${e.posts.map(t.post).join(", ")} has no holder`:e.posts.map(n=>`${t.post(n.post)}: ${n.holders.map(t.member).join(", ")}`).join("; ")}const Wu={covered:0,vacant:1,uncovered:2};function M1(e){return new Map(e.slots.filter(t=>t.gate).map(t=>{var n;return[t.key,(n=t.gates)!=null&&n.length?`Gate: ${t.gates.join(", ")}`:"Gate slot"]}))}function PL({chart:e,names:t,host:n,edit:a}){var i;const r=M1(e),l=new Map(e.slots.map(o=>[o.key,o]));if(n==="hosted"&&e.slot_resolution.length===0){const o=((i=e.authority)==null?void 0:i.ask)??[];return s.jsxs(xt,{className:"grid justify-items-center gap-2 p-6 text-center",children:[s.jsx("span",{className:"text-sm font-medium",children:"No slots yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Add the workflow roles your projects fill, such as Implementer or Approver."}),a?s.jsx(Ai,{on_click:()=>a.slot(null),children:"Add slot"}):s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Only an org owner or admin adds slots."," ",o.length?`Ask ${o.slice(0,3).join(", ")} to make this change.`:"Ask an org owner to make this change."]})]})}return s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Slots",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Slot"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Resolves to"}),a?s.jsx(X,{className:"text-right",children:s.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),s.jsxs(Xe,{children:[[...e.slot_resolution].sort((o,c)=>Wu[o.status]-Wu[c.status]||t.slot(o.slot).localeCompare(t.slot(c.slot))).map(o=>{var d,f,m;const c=Qu[o.status];return s.jsxs(he,{"data-testid":"org-chart-slot",children:[s.jsxs(K,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"font-medium",children:t.slot(o.slot)}),s.jsx(Zd,{mark:(d=a==null?void 0:a.marks)==null?void 0:d.slots[o.slot]})]}),n==="hosted"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:o.slot}),(f=l.get(o.slot))!=null&&f.description?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:(m=l.get(o.slot))==null?void 0:m.description}):null]}):null,r.has(o.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:r.get(o.slot)}):null]}),s.jsx(K,{children:s.jsx(pe,{variant:c.tone,children:c.label})}),s.jsxs(K,{children:[IL(o,t),o.status==="covered"&&o.needs_person?s.jsx("div",{className:"text-muted-foreground text-xs",children:"Needs a person"}):null]}),a&&l.has(o.slot)?s.jsx(K,{className:"text-right",children:s.jsx(wl,{label:t.slot(o.slot),on_edit:()=>a.slot(l.get(o.slot)),on_remove:()=>a.slot_remove(l.get(o.slot))})}):null]},o.slot)}),e.slot_resolution.length===0?s.jsx(he,{children:s.jsx(K,{colSpan:3,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})})}const qL="Who fills each workflow slot for this repository's project: the posts of the owning team's job functions, else of the nearest team above, unless an override names other posts.",uh=["sdlc org own <team>","sdlc org bind <slot> <team>/<function>... --reason <text>","sdlc org unbind <slot>"];function GL({project:e,chart:t,names:n,edit:a}){if(e.team===null){const i=e.roots.map(n.team);return s.jsx(ir,{id:"org-chart-project",title:"This project",description:i.length?`This org has several root teams (${i.join(", ")}), so no team owns this repository's project yet and its slots are not bound. Name the owning team:`:"This org has no team yet, so no team owns this repository's project. Start one:",children:s.jsx("div",{className:"max-w-2xl",children:s.jsx(_l,{children:i.length?uh[0]:"sdlc org add team <key>"})})})}const r=M1(t),l=[...e.slots].sort((i,o)=>Wu[i.status]-Wu[o.status]||n.slot(i.slot).localeCompare(n.slot(o.slot)));return s.jsxs(ir,{id:"org-chart-project",title:"This project",description:qL,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Owning team"}),s.jsx("span",{className:"text-sm font-medium",children:n.team(e.team)})]}),s.jsx(xt,{className:"mt-3 overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Slots in this project",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Slot"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Bound to"}),s.jsx(X,{children:"Source"}),a?s.jsx(X,{className:"text-right",children:s.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),s.jsxs(Xe,{children:[l.map(i=>{const o=Qu[i.status];return s.jsxs(he,{"data-testid":"org-chart-project-slot",children:[s.jsxs(K,{children:[s.jsx("div",{className:"font-medium",children:n.slot(i.slot)}),r.has(i.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:r.get(i.slot)}):null]}),s.jsx(K,{children:s.jsx(pe,{variant:o.tone,children:o.label})}),s.jsx(K,{children:s.jsx(VL,{binding:i,names:n})}),s.jsx(K,{children:s.jsx(YL,{binding:i})}),a?s.jsx(K,{className:"text-right",children:s.jsx(q,{type:"button",variant:"ghost",size:"control-icon","aria-label":i.source==="override"?`Edit the override of ${n.slot(i.slot)}`:`Override ${n.slot(i.slot)}`,onClick:()=>a.override(i.slot),children:s.jsx(_d,{className:"size-3.5","aria-hidden":"true"})})}):null]},i.slot)}),l.length===0?s.jsx(he,{children:s.jsx(K,{colSpan:a?5:4,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})}),a?s.jsxs("div",{className:"mt-3 grid max-w-2xl gap-2",children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Overrides made here are made as ",s.jsx("span",{className:"font-mono",children:"person:user"}),", as sdlc org makes them without --as: that person must hold the lead post of the owning team or of a team above it."]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Change the owning team with sdlc org:"}),s.jsx(_l,{children:uh[0]})]}):s.jsxs("div",{className:"mt-3 grid max-w-2xl gap-2",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:"Change the owning team or a slot's binding with sdlc org; a lead post of the owning team or a team above it may:"}),uh.map(i=>s.jsx(_l,{children:i},i))]})]})}function VL({binding:e,names:t}){const n=[];e.status==="covered"&&e.needs_person&&n.push("Needs a person");for(const r of e.posts)r.off_description&&n.push(`${t.post(r.post)} does not fill ${t.slot(e.slot)} in its job description`);e.stale_posts&&n.push(e.stale_posts===1?"One post this override names is no longer in the org":`${e.stale_posts} posts this override names are no longer in the org`);let a;return e.posts.length===0?a=e.source==="override"?"The override names no post the org still has":"No job function fills this slot":e.status==="vacant"?a=`${e.posts.map(r=>t.post(r.post)).join(", ")} has no holder`:a=e.posts.map(r=>r.holders.length?`${t.post(r.post)}: ${r.holders.map(t.member).join(", ")}`:`${t.post(r.post)}: no holder`).join("; "),s.jsxs(s.Fragment,{children:[a,n.map(r=>s.jsx("div",{className:"text-muted-foreground text-xs",children:r},r))]})}function YL({binding:e}){var a;if(e.source==="baseline")return s.jsx(s.Fragment,{children:"From job descriptions"});const t=(a=e.set_by)==null?void 0:a.split(":").slice(1).join(":"),n=[e.reason,[t,e.set_at?rs(e.set_at):null].filter(Boolean).join(", ")].filter(Boolean).join(" · ");return s.jsxs(s.Fragment,{children:["Override",n?s.jsx("div",{className:"text-muted-foreground text-xs",children:n}):null]})}const FL={breaking:"Breaking",new:"New",improved:"Improved",other:"Other changes"},KL=["breaking","new","improved","other"],XL={http_operation:"API",rpc_operation:"API",graphql_operation:"API",async_operation:"Event",page:"Page",ui_frame:"Screen",ui_component_definition:"Component",table:"Data",function:"Function"};function $1(e){return XL[e]??e.replace(/_/g," ")}function QL(e){return e.bump==="major"?"breaking":e.change==="added"?"new":e.change==="changed"?"improved":"other"}function wo(e){const t=new Map;let n=0,a=0;for(const l of e){if(l.modeling_only){a+=1;continue}if(!l.bump){n+=1;continue}const i=QL(l);t.set(i,[...t.get(i)??[],l])}return{sections:KL.filter(l=>t.has(l)).map(l=>({key:l,label:FL[l],lines:t.get(l)})),breaking:t.has("breaking"),unlisted_count:n,modeling_only_count:a}}function WL(e,t){const n=[`## ${e}`];t.sections.length===0&&n.push("","No change affects the version.");for(const a of t.sections){n.push("",`### ${a.label}`,"");for(const r of a.lines){const l=r.why?`: ${r.why}`:"";n.push(`- ${r.label} (${$1(r.node_type)})${l}`)}}return`${n.join(`
|
|
399
|
+
`)}
|
|
400
|
+
`}const Cs="candidate";function eg(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}const ZL="Versioned records of this project's release branch, with notes from its graph changes.";function O1({description:e=ZL,actions:t}){return s.jsx(mn,{title:"Releases",description:e,actions:t})}function D1(e){var l;if(!e)return"";const t=(l=e.previous_release)==null?void 0:l.version,n=Number(e.version.split("-rc.")[1]??0),a=e.commits_since??n,r=`${e.commits_since===null?"At least ":""}${a} commit${a===1?"":"s"}`;return t?`${r} since ${t}`:`${r} before the first Release`}function tu({active:e,onClick:t,version:n,badges:a,caption:r,item_ref:l}){return s.jsxs("button",{ref:l,type:"button","aria-current":e?"true":void 0,onClick:t,className:ie("focus-visible:ring-ring flex flex-col gap-0.5 rounded-md px-3 py-2 text-left outline-none focus-visible:ring-2",e?"bg-muted":"hover:bg-muted/60"),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",children:[s.jsx("span",{className:"truncate",children:n}),a]}),s.jsx("span",{className:"text-muted-foreground text-xs",children:r})]})}function ns({children:e}){return s.jsx("section",{className:"border-border flex flex-col gap-4 rounded-xl border p-4",children:e})}function ls({title:e,error:t,onRetry:n}){const a=s1();return s.jsxs(me,{variant:"destructive",ref:a,children:[s.jsx(ln,{}),e?s.jsx(Ne,{children:e}):null,s.jsxs(xe,{className:"flex flex-col items-start gap-2",children:[t,n?s.jsx(q,{variant:"outline",size:"sm",onClick:n,children:"Try again"}):null]})]})}function JL({title:e,text:t}){return s.jsx(ns,{children:s.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-center",children:[s.jsx(wd,{className:"text-muted-foreground size-8","aria-hidden":!0}),s.jsx("h2",{className:"text-lg font-semibold",tabIndex:-1,children:e}),s.jsx("p",{className:"text-muted-foreground max-w-md text-sm",children:t})]})})}function e6(e,t){const n=t??"The release branch";return{title:e?`Nothing new since ${e}`:"Nothing to release yet",text:e?`${n}'s head is the commit ${e} was written at. Commits to ${n} make the next candidate.`:`${n} has no commits yet.`}}function Zu({changes:e}){const t=u.useMemo(()=>wo(e),[e]),[n,a]=u.useState(!1),r=t.unlisted_count+t.modeling_only_count;return s.jsxs("div",{className:"flex flex-col gap-4",children:[t.sections.map(l=>{const i=s.jsx("ul",{className:"flex flex-col gap-2",children:l.lines.map(o=>s.jsx(Ty,{line:o},`${o.node_id}:${o.change}`))});return l.key==="breaking"?s.jsxs(me,{variant:"destructive",className:"border-destructive/40",children:[s.jsx(ln,{}),s.jsx(Ne,{children:s.jsx("h3",{className:"text-destructive text-sm font-semibold",children:l.label})}),s.jsx(xe,{className:"text-foreground",children:i})]},l.key):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:l.label}),i]},l.key)}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Fixed"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Fixes that changed no part of the graph are not recorded yet; they arrive with landing notes."})]}),t.sections.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No change affects the version."}):null,r>0?s.jsxs("p",{className:"text-muted-foreground text-sm",children:[r," more change",r===1?"":"s"," do",r===1?"es":""," not affect the version."]}):null,e.length>0?s.jsx(q,{variant:"link",size:"sm",className:"self-start px-0","aria-expanded":n,onClick:()=>a(l=>!l),children:n?"Hide all changes":"Show all changes"}):null,n?s.jsx("ul",{className:"flex flex-col gap-2",children:e.map(l=>s.jsx(Ty,{line:l,detail:!0},`all:${l.node_id}:${l.change}:${l.modeling_only}`))}):null]})}function Ty({line:e,detail:t=!1}){const n=t?e.modeling_only?"modeling only: shipped before, left out of the version":e.why??`${e.change}; does not affect the version`:e.why;return s.jsxs("li",{className:"flex flex-col gap-0.5",children:[s.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:[e.label,s.jsx(pe,{variant:"outline",children:$1(e.node_type)})]}),n?s.jsx("span",{className:"text-muted-foreground text-xs",children:n}):null]})}const z1="Releases of this checkout: the roadmap of open Planned Releases, the next candidate, and each production release with its notes.",Jd=u.createContext(0);function _o(e,t){const n=u.useRef(e),a=u.useRef(t);u.useEffect(()=>{a.current=t}),u.useEffect(()=>{n.current!==e&&(n.current=e,a.current())},[e])}const Ay=e=>(e==null?void 0:e.status)===404||(e==null?void 0:e.reason)==="not_found",My=5,Hm="Not available",Im="planned:";function L1(){const e=us();return s.jsx("p",{className:"text-muted-foreground text-sm",children:`${Hm}. ${e}`})}const js=e=>`${Im}${e}`,t6=e=>e!=null&&e.startsWith(Im)?e.slice(Im.length):null,tg=e=>e?e.slice(0,7):"";function n6(e){return e?{title:`Nothing new since ${e}`,text:"Production runs what staging runs. Landings promoted to staging make the next candidate."}:{title:"Nothing to release yet",text:"Staging has run nothing production lacks."}}function s6(){return s.jsxs(me,{variant:"info",children:[s.jsx(cs,{}),s.jsx(Ne,{children:"This page only reads Releases"}),s.jsx(xe,{className:"text-info",children:"A Release is written when production runs a release candidate, once its commit is merged into origin/main."})]})}function a6(e){if(e.state==="unreadable")return{badges:s.jsx(pe,{variant:"error",children:"Could not be read"}),caption:""};if(e.state==="withdrawn")return{badges:s.jsx(pe,{variant:"warning",children:"Withdrawn"}),caption:e.replaced_by?`Replaced by ${e.replaced_by}`:"Withdrawn"};const t=s.jsxs(s.Fragment,{children:[s.jsx(pe,{variant:"neutral",children:e.app_changed===!1?"App unchanged":e.previous_release_id?e.bump??"patch":"First"}),e.breaking?s.jsx(pe,{variant:"error",children:"Breaking"}):null]}),n=e.written_at?eg(e.written_at):"",a=e.tracks&&e.tracks.length>0?` · ${e.tracks.join(", ")}`:"";return{badges:t,caption:`${n}${a}`}}function pr({query:e,select:t,onSelect:n,children:a,inline:r=!1}){return s.jsx("a",{href:`?${e}`,className:r?"text-primary underline":"text-primary hover:underline",onClick:l=>{l.preventDefault(),n(t)},children:a})}function ef({pairs:e}){const t=e.filter(([,n])=>n!=null&&n!=="");return t.length===0?null:s.jsx("dl",{className:"grid grid-cols-[max-content_1fr] gap-x-6 gap-y-1 text-sm",children:t.map(([n,a])=>s.jsxs(u.Fragment,{children:[s.jsx("dt",{className:"text-muted-foreground",children:n}),s.jsx("dd",{className:"min-w-0",children:a})]},n))})}const Us=({children:e})=>s.jsx("code",{className:"font-mono text-xs",children:e});function U1(e,t){if(e.judged_commit&&t&&e.judged_commit!==t)return`Judged ${tg(e.judged_commit)}, not this commit`;const n=e.verdict==="ready"?"Ready":e.verdict==="untested"?"Nothing tested yet":"Not ready",a=e.accepted>0?` · ${e.accepted} failed, accepted`:"";return`${n} · ${e.satisfied} of ${e.total} satisfied${a}`}function tf({title:e,count:t,heading_ref:n}){return s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h2",{ref:n,tabIndex:-1,className:"text-lg font-semibold outline-none",children:e}),t!==void 0?s.jsx("span",{className:"text-muted-foreground text-xs",children:t}):null]})}const r6={ready:"success",verifying:"info",fixing:"warning",abandoned:"warning",ready_older:"neutral",none:"neutral",unknown:"neutral"};function l6({batch:e}){if(e.state==="loading")return s.jsxs(me,{children:[s.jsx(Du,{}),s.jsxs(xe,{className:"flex flex-row items-center gap-2",role:"status",children:[s.jsx(dn,{"aria-hidden":!0})," Reading the release batch…"]})]});const t=e.state==="ready"?e.value:{state:"unknown",chip:"Batch unknown",text:`The release batch could not be read: ${e.error}`,help:null};return s.jsxs(me,{children:[s.jsx(Du,{}),s.jsxs(Ne,{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{children:t.text}),s.jsx(pe,{variant:r6[t.state],children:t.chip})]}),t.help?s.jsx(xe,{children:t.help}):null]})}function i6(e,t,n){return`/org/${e}/issues/${encodeURIComponent(t)}?from=${encodeURIComponent(n)}`}function B1({issues:e,error:t}){return t?s.jsx(ls,{title:"Known issues could not be read",error:t}):!e||e.length===0?null:s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(tf,{title:"Known issues",count:e.length}),s.jsx("ul",{className:"flex flex-col gap-2",children:e.map(n=>s.jsxs("li",{className:"flex flex-col gap-0.5 text-sm",children:[s.jsxs("span",{children:[n.id,": ",n.title]}),n.accepted_by?s.jsxs("span",{className:"text-muted-foreground text-xs",children:["accepted by ",n.accepted_by]}):null,n.file?s.jsx(Us,{children:n.file}):null]},n.key))})]})}function H1({tracks:e,error:t}){return t?s.jsx(ls,{title:"Tracks could not be read",error:t}):!e||e.length===0||e.length===1&&e[0].key==="app"?null:s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx(tf,{title:"Tracks",count:e.length}),e.map(n=>n.key==="app"||n.released_by==="release_batch"?s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:[n.label,n.version?s.jsx(Us,{children:n.version}):null,n.bump?s.jsx(pe,{variant:"neutral",children:n.bump}):null]}),s.jsx("span",{className:"text-muted-foreground text-xs",children:"Released with the release batch"})]},n.key):s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:[n.label,s.jsxs("span",{className:"text-muted-foreground text-xs",children:[n.packages.length," package",n.packages.length===1?"":"s"]})]}),s.jsx("ul",{className:"flex flex-col gap-1",children:n.packages.map(a=>s.jsxs("li",{className:"flex flex-col gap-0.5",children:[s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Us,{children:a.name}),s.jsxs(Us,{children:[a.from??"—"," → ",a.to??"—"]})]}),a.changes.map((r,l)=>s.jsxs("span",{className:"text-muted-foreground text-xs",children:[r.feature,": ",r.entry]},l))]},a.name))}),n.published&&!n.published.recorded?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[n.released_by??"Publish",": Not available. This Release does not say whether or when it moved latest."]}):null]},n.key))]})}function I1({delivery:e,candidate:t,onSelect:n}){if(!e||e.planned.length===0&&e.outside===0)return null;const a=r=>r.length===0?"—":r.map(l=>l.went?`${l.label} (${l.went})`:l.label).join(", ");return s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(tf,{title:"Planned Releases",count:e.planned.length}),s.jsx("p",{className:"text-muted-foreground text-xs",children:t?"What this candidate would deliver":"What this Release delivered"}),e.planned.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Planned Releases",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Planned Release"}),s.jsx(X,{children:"Delivered"}),s.jsx(X,{children:"Not delivered"})]})}),s.jsx(Xe,{children:e.planned.map(r=>s.jsxs(he,{children:[s.jsx(K,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.open&&t?s.jsx(pr,{query:`planned=${encodeURIComponent(r.id)}`,select:js(r.id),onSelect:n,children:r.name}):s.jsx("span",{children:r.name}),s.jsx(Us,{children:r.id})]})}),s.jsx(K,{children:a(r.delivered)}),s.jsx(K,{children:a(r.not_delivered)})]},r.id))})]})}):null,e.outside>0?s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.outside," landing",e.outside===1?"":"s"," served no Planned Release."]}):null]})}const o6={thread:"Thread",task:"Task",issue:"Issue",test:"Test"};function P1({rows:e,org:t,from:n,untasked:a}){const{href:r,Link:l}=Ze(),[i,o]=u.useState(!1),c=i?e:e.slice(0,My),d=f=>f.kind==="task"?s.jsx(l,{className:"text-primary font-mono text-xs hover:underline",href:r(`/org/${t}/tasks/${encodeURIComponent(f.id)}?from=${encodeURIComponent(n)}`),children:f.id}):f.kind==="issue"?s.jsx(l,{className:"text-primary font-mono text-xs hover:underline",href:r(i6(t,f.id,n)),children:f.id}):f.kind==="thread"?s.jsx(l,{className:"text-primary hover:underline",href:r(`${t?`/org/${t}`:""}/threads#thread-${encodeURIComponent(f.id)}`),children:f.label}):f.kind==="test"&&f.url?s.jsx("a",{className:"text-primary hover:underline",href:f.url,target:"_blank",rel:"noreferrer",children:f.label}):s.jsx("span",{children:f.label});return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Related",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Kind"}),s.jsx(X,{children:"Item"}),s.jsx(X,{children:"How it relates"})]})}),s.jsx(Xe,{children:c.map(f=>s.jsxs(he,{children:[s.jsx(K,{children:o6[f.kind]}),s.jsx(K,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[d(f),f.state&&f.kind!=="thread"?s.jsx("span",{className:"text-muted-foreground text-xs",children:f.state}):null]})}),s.jsx(K,{children:f.relation})]},`${f.kind}:${f.id}`))})]})}),e.length>My?s.jsx(q,{variant:"link",size:"sm",className:"self-start px-0","aria-expanded":i,onClick:()=>o(f=>!f),children:i?"Show fewer":`Show all ${e.length}`}):null,a?s.jsxs("p",{className:"text-muted-foreground text-xs",children:[a," landing",a===1?"":"s"," not tied to a task"]}):null]})}const q1=e=>(e==null?void 0:e.status)===409&&e.reason==="view_outdated";function G1(e){const t=ng(),[n,a]=u.useState(t!=null&&t.related?{state:"loading"}:null),r=u.useRef(0),l=ys(),i=u.useCallback(async(o=!1,c=!1)=>{if(!(t!=null&&t.related)||c&&l.busy())return;const d=++r.current;c||a({state:"loading"});const f=await l.track(t.related(e,o?{fresh:!0}:void 0));d===r.current&&a(m=>f.ok?{state:"ready",value:f.data}:c&&(m==null?void 0:m.state)==="ready"?m:{state:"error",error:f.refusal.message,refusal:f.refusal})},[t,e,l]);return u.useEffect(()=>{i()},[i]),_o(u.useContext(Jd),()=>void i(!1,!0)),{related:n,read:i}}function V1({related:e,org:t,from:n,onRetry:a}){const r=u.useRef(null),l=u.useRef(!1);if(u.useEffect(()=>{var o;l.current&&(e==null?void 0:e.state)!=="loading"&&(l.current=!1,(o=r.current)==null||o.focus())},[e]),!e)return null;const i=e.state==="ready"?e.value.rows.length:void 0;return s.jsxs("section",{className:"flex flex-col gap-2","aria-labelledby":"release-related",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h2",{id:"release-related",ref:r,tabIndex:-1,className:"text-lg font-semibold outline-none",children:"Related"}),i!==void 0?s.jsx("span",{className:"text-muted-foreground text-xs",children:i}):null]}),e.state==="loading"?s.jsxs("div",{className:"grid gap-2",role:"status","aria-label":"Loading related work",children:[s.jsx(Rt,{className:"h-8 w-full"}),s.jsx(Rt,{className:"h-8 w-full"}),s.jsx(Rt,{className:"h-8 w-2/3"})]}):e.state==="error"?q1(e.refusal)?s.jsx(L1,{}):s.jsx(ls,{title:"Related work could not be read",error:e.error,onRetry:()=>{l.current=!0,a()}}):e.value.rows.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing related yet."}):s.jsx(P1,{rows:e.value.rows,org:t,from:n,untasked:e.value.untasked})]})}function c6(e){if(!e||e.of===0)return null;if(e.tasks===0)return s.jsx("span",{className:"text-muted-foreground",children:"none"});const t=Object.entries(e.outcomes);return s.jsxs("span",{children:[e.tasks," of ",e.of," tasks",t.map(([n,a])=>s.jsxs("span",{className:n==="failed"?"text-destructive":void 0,children:[" · ",a," ",n]},n))]})}function Y1({planned:e,onSelect:t}){return e?e.open?s.jsx(pr,{query:`planned=${encodeURIComponent(e.id)}`,select:js(e.id),onSelect:t,children:e.name}):s.jsxs("span",{children:[e.name," ",s.jsx(Us,{children:e.id})]}):null}function u6({candidate:e,org:t,onSelect:n,notes:a}){const r=ng(),{related:l,read:i}=G1("candidate"),[o,c]=u.useState(r!=null&&r.candidateBatch?{state:"loading"}:null),d=u.useRef(0),f=ys(),m=u.useCallback(async x=>{if(!(r!=null&&r.candidateBatch)||x&&f.busy())return;const j=++d.current,v=await f.track(r.candidateBatch());j===d.current&&(v.ok?c(v.data.batch===null?null:{state:"ready",value:v.data.batch}):c(y=>x&&(y==null?void 0:y.state)==="ready"?y:{state:"error",error:v.refusal.message}))},[r,f]);u.useEffect(()=>(m(!1),()=>{d.current+=1}),[m]),_o(u.useContext(Jd),()=>void m(!0));const h=e.readiness??((l==null?void 0:l.state)==="ready"?l.value.readiness:null)??null;return s.jsxs(s.Fragment,{children:[s.jsx(ef,{pairs:[["Environment",e.environment??"staging"],["Commit",s.jsx(Us,{children:tg(e.head_commit_id)},"commit")],["Readiness",h?U1(h,e.head_commit_id):null],["Planned",e.planned_release?s.jsx(Y1,{planned:e.planned_release,onSelect:n}):null]]}),o?s.jsx(l6,{batch:o}):null,a,s.jsx(B1,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(H1,{tracks:e.tracks,error:e.tracks_error}),s.jsx(I1,{delivery:e.planned_delivery,candidate:!0,onSelect:n}),s.jsx(V1,{related:l,org:t,from:"release:candidate",onRetry:()=>i(!0)})]})}function d6({release:e,onSelect:t}){const n=e.label??e.version,a=!e.previous_release_id;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:n}),e.state==="withdrawn"?s.jsx(pe,{variant:"warning",children:"Withdrawn"}):s.jsx(pe,{variant:"neutral",children:e.app_changed===!1?"App unchanged":a?"First":e.bump}),e.breaking?s.jsx(pe,{variant:"error",children:"Breaking"}):null]}),e.state==="withdrawn"&&e.replaced_by?s.jsxs("p",{className:"text-sm",children:["Replaced by"," ",s.jsx(pr,{query:`release=${encodeURIComponent(e.replaced_by)}`,select:e.replaced_by,onSelect:t,inline:!0,children:e.replaced_by})]}):null]})}function f6({release:e,org:t,onSelect:n,notes:a}){const r=e.label??e.version,{related:l,read:i}=G1(r),o=(l==null?void 0:l.state)==="ready"?c6(l.value.previews):null;return s.jsxs(s.Fragment,{children:[s.jsx(ef,{pairs:[["Environment",e.environment??"production"],["Commit",e.commit?s.jsx(Us,{children:tg(e.commit)},"commit"):null],["Readiness",e.readiness?`${U1(e.readiness)} on staging`:null],["Previews",o],["Planned",e.planned_release?s.jsx(Y1,{planned:e.planned_release,onSelect:n}):null]]}),a,s.jsx(B1,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(H1,{tracks:e.tracks,error:e.tracks_error}),s.jsx(I1,{delivery:e.planned_delivery,candidate:!1,onSelect:n}),s.jsx(V1,{related:l,org:t,from:`release:${r}`,onRetry:()=>i(!0)})]})}function h6({id:e,summary:t,org:n,onNotFound:a,forecast:r}){const l=ng(),[i,o]=u.useState({state:"loading"}),c=u.useRef(0),d=ys(),f=u.useCallback(async(j=!1,v=!1)=>{if(v&&d.busy())return;const y=++c.current;if(!(l!=null&&l.plannedRelease)){o({state:"error",error:Hm,refusal:{status:409,message:Hm,reason:"view_outdated"}});return}v||o({state:"loading"});const g=await d.track(l.plannedRelease(e,j?{fresh:!0}:void 0));y===c.current&&o(p=>g.ok?{state:"ready",value:g.data}:v&&p.state==="ready"&&!Ay(g.refusal)?p:{state:"error",error:g.refusal.message,refusal:g.refusal})},[l,e,d]);u.useEffect(()=>{f()},[f]),_o(u.useContext(Jd),()=>void f(!1,!0));const m=i.state==="error"&&Ay(i.refusal);if(u.useEffect(()=>{m&&a()},[m,a]),i.state==="loading")return s.jsxs(ns,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:(t==null?void 0:t.name)??e}),s.jsx(pe,{variant:"neutral",children:"Planned"})]}),s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:"Loading the Planned Release…"})]});if(i.state==="error")return s.jsxs(ns,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:(t==null?void 0:t.name)??e}),q1(i.refusal)?s.jsx(L1,{}):m?null:s.jsx(ls,{error:i.error,onRetry:()=>void f(!0)})]});const h=i.value,x=h.order===null?null:h.order===1?`Next of ${h.open} open`:`${h.order} of ${h.open} open`;return s.jsxs(ns,{children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:h.name}),s.jsx(pe,{variant:"neutral",children:"Planned"})]}),h.goal?s.jsx("p",{className:"text-muted-foreground text-sm",children:h.goal}):null]}),s.jsx(ef,{pairs:[["Planned Release",s.jsx(Us,{children:h.id},"id")],["Date",h.date],["Order",x],["Members",String(h.members.length)]]}),r,s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"A Planned Release changes through release_plan.py:"}),s.jsxs("pre",{className:"bg-muted rounded-md px-3 py-2 font-mono text-xs",children:["sdlc view --planned ",h.id]})]}),s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(tf,{title:"Members",count:h.members.length}),h.members.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Members",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Member"}),s.jsx(X,{children:"Level"}),s.jsx(X,{children:"Tasks"}),s.jsx(X,{children:"State"})]})}),s.jsx(Xe,{children:h.members.map(j=>{const v=j.tasks.filter(g=>g.state==="done").length,y=j.tasks.filter(g=>g.state!=="done").map(g=>g.id);return s.jsxs(he,{children:[s.jsx(K,{children:j.label}),s.jsx(K,{children:j.level?s.jsx(pe,{variant:"neutral",children:m6(j.level)}):null}),s.jsx(K,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[j.tasks.length>0?s.jsxs("span",{children:[v," of ",j.tasks.length," done"]}):null,y.length>0?s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Open: ",s.jsx(Us,{children:y.join(", ")})]}):null,j.untracked>0?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[j.untracked," slice",j.untracked===1?" has":"s have"," no task yet"]}):null]})}),s.jsx(K,{children:j.state})]},j.item)})})]})}):null]}),s.jsxs("section",{className:"flex flex-col gap-2","aria-labelledby":"planned-related",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h2",{id:"planned-related",className:"text-lg font-semibold",children:"Related"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:h.related.length})]}),h.related.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing related yet."}):s.jsx(P1,{rows:h.related,org:n,from:`planned:${h.id}`})]})]})}const m6=e=>e.charAt(0).toUpperCase()+e.slice(1);function ng(){return Nn().releases}const ps={noRelease:"No open Planned Release. Create one: release_plan.py create --name <version>",noTask:"no open task of yours",noNext:"none",pending:"reading the roadmap",failedLead:"The roadmap could not be read",noEngineLead:"this engine has no roadmap read"},$y=3,p6=["in_progress","not_started","planned","blocked"],sg="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),Ot=e=>e.charAt(0).toUpperCase()+e.slice(1);function dh(e){const t=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(e??""));return t?`${Number(t[3])} ${sg[Number(t[2])-1]}`:String(e??"")}function F1(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${sg[t.getMonth()]} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function x6(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${sg[t.getMonth()]}`}function Ws(e){return e?e.from===e.to&&e.or_later?`${dh(e.from)} or later`:`${dh(e.from)} to ${dh(e.to)}${e.or_later?", or later":""}`:""}function g6(e){if(!e||!e.members)return"";const t=[`${e.sized??0} of ${e.members} members sized (${e.estimated??0} estimated, ${e.predicted??0} predicted)`];return e.not_sized&&t.push(`${e.not_sized} not sized`),t.join(" · ")}function K1(e){var m;const t=e??{},n=t.source??{},r=[t.no_date==="no date: no rate"&&n.rate_why?n.rate_why:"",/members estimated$/.test(t.no_date??"")?"":g6(t)].filter(Boolean).join(" · "),l=t.projected?Ws(t.projected):t.no_date??"",i=(m=t.projected)==null?void 0:m.raw,o=!!(i&&t.projected&&(i.from!==t.projected.from||i.to!==t.projected.to)),c=t.projected?n.rate_basis==="release"?"at this release's own rate":n.rate_basis==="machine"?`at the machine's rate${n.rate_why?`: ${n.rate_why}`:""}`:"":"",d=t.track_record,f=[r,c,o&&i&&t.projected?`corrected for past estimates: raw ${Ws({...i,or_later:t.projected.or_later})}`:"",d?`past forecasts at this coverage: ${d.inside} of ${d.of} inside their range`:""].filter(Boolean);return{lead:l?Ot(l):"",caption:f}}function v6(e){const t=e.kinds??[];return[t.includes("range")?"Not promised":"",e.goal??(t.includes("major")?"No goal yet":"")].filter(Boolean).join(" · ")}function y6(e){var c,d,f,m;const t=((c=e.counts)==null?void 0:c.members)??0,n=`${((d=e.counts)==null?void 0:d.done)??0} of ${t} member${t===1?"":"s"} done`,a=(e.blocked??[]).length,r=(e.needs_user??[]).length,l=!a&&!r?["none blocked · none waiting on you"]:[a?`${a} blocked`:"",r?`${r} waiting on you`:""],i=((f=e.tasks)==null?void 0:f.untracked_slices)??0;i&&l.push(`${i} slice${i===1?"":"s"} not tasks yet`);const o=((m=e.not_a_member)==null?void 0:m.count)??0;return o&&l.push(`${o} not a member yet`),{lead:n,rest:l.filter(Boolean).join(" · ")}}const X1=e=>String(e??"").replace(/_/g," ");function j6(e){const t=e??{},n=t.kinds??[],a=n.includes("slipped"),r=!a&&t.was&&t.now?Ws(t.was)===Ws(t.now)?`, range still ${Ws(t.now)}`:`, range was ${Ws(t.was)}, now ${Ws(t.now)}`:"",l=[a&&t.was?`was ${Ws(t.was)}`:"",n.includes("scope changed")?`scope changed${r}`:""].filter(Boolean),i=(t.what??[]).slice(-3).map(o=>{const c=o.by&&(o.by.title||o.by.thread||o.by.person);return`${[o.kind,o.label||o.item].filter(Boolean).join(" ")}${c?` by ${c}`:""}${o.why?`: ${o.why}`:""}`});return{head:l.length?Ot(l.join(" · ")):"",what:i}}const Nl="roadmap",Oy={reading:!1,value:null,refusal:null};function b6(e){const[t,n]=u.useState({all:Oy,mine:Oy}),a=u.useRef({all:0,mine:0}),r=ys(),l=ys(),i=u.useCallback(async(o,c=!1,d=!1)=>{if(!(e!=null&&e.roadmap))return;const f=o==="mine"?l:r;if(d&&f.busy())return;const m=++a.current[o];d||n(x=>({...x,[o]:{...x[o],reading:!0}}));const h=await f.track(e.roadmap({...c?{fresh:!0}:{},...o==="mine"?{mine:!0}:{}}));m===a.current[o]&&n(x=>({...x,[o]:h.ok?{reading:!1,value:h.data,refusal:null}:d?{...x[o],reading:!1}:{reading:!1,value:x[o].value,refusal:h.refusal}}))},[e,r,l]);return{reads:t,read:i,available:!!(e!=null&&e.roadmap)}}function w6(e,t){return`${e} open${t.length?` · ${t.join(", ")} moved since you looked`:""}`}function Wi({children:e}){return s.jsx("pre",{className:"bg-muted text-foreground rounded-md px-3 py-2 font-mono text-xs break-all whitespace-pre-wrap",children:e})}const Q1=({level:e})=>e?s.jsx(pe,{variant:"neutral",children:Ot(e)}):null;function W1({state:e}){const t=Ot(X1(e));return p6.includes(String(e))?s.jsx("span",{className:"font-medium",children:t}):s.jsx("span",{children:t})}function _6({reads:e,scope:t,onScope:n,onRead:a,org:r,onSelect:l}){var x,j;const i=e[t],o=i.value,c=us(),d=u.useRef(null),f=u.useRef(!1);u.useEffect(()=>{!i.reading&&!i.value&&!i.refusal&&a(t)},[t,i.reading,i.value,i.refusal,a]),u.useEffect(()=>{var v;f.current&&!i.reading&&(f.current=!1,(v=d.current)==null||v.focus())},[i.reading]);const m=()=>{f.current=!0,a(t,!0)},h=o?[o.as_of?`as of ${F1(o.as_of)}`:"",`${((x=o.source)==null?void 0:x.machine)||"this machine"}'s records`,((j=o.decider)==null?void 0:j.words)??""].filter(Boolean).join(" · "):"";return s.jsxs(ns,{children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx("h2",{ref:d,tabIndex:-1,className:"text-lg font-semibold outline-none",children:"Roadmap"}),h?s.jsx("p",{className:"text-muted-foreground text-xs",children:h}):null]}),s.jsx("div",{role:"group","aria-label":"Roadmap scope",className:"flex gap-2",children:["all","mine"].map(v=>s.jsx(q,{variant:"outline",size:"sm","aria-pressed":t===v,onClick:()=>n(v),children:v==="all"?"All":"Mine"},v))})]}),s.jsx("div",{"aria-live":"polite",children:i.reading?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status",children:[s.jsx(dn,{"aria-hidden":!0,className:"size-4"})," ",Ot(ps.pending),"…"]}):null}),i.refusal&&!i.reading?i.refusal.reason==="no_roadmap"?s.jsx(ls,{title:ps.failedLead,error:`${Ot(ps.noEngineLead)}. ${c}`}):i.refusal.reason==="refused"?s.jsx(ls,{title:ps.failedLead,error:i.refusal.message}):s.jsx(ls,{title:ps.failedLead,error:i.refusal.message,onRetry:m}):null,o?t==="mine"?s.jsx(T6,{mine:o.mine,org:r,onSelect:l}):s.jsx(k6,{read:o,org:r,onSelect:l}):null]})}function N6(e){if(!e||typeof e.seconds_per_day!="number")return"No rate";const t=x6(e.as_of);return`${Math.round(e.seconds_per_day/3600)} task hours a day over the ${e.days} days${t?` to ${t}`:""}`}function k6({read:e,org:t,onSelect:n}){var r,l;const a=e.releases??[];if(!a.length){const[i,o]=ps.noRelease.split(" Create one: ");return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm",children:i}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Create one in the terminal:"}),s.jsx(Wi,{children:o})]})}return s.jsxs(s.Fragment,{children:[s.jsx(ef,{pairs:[["Forecast from",Ot(`${((r=e.source)==null?void 0:r.machine)||"this machine"}'s task records and rate`)],["Rate",N6(e.rate)],["Not counted",Ot(((l=e.source)==null?void 0:l.not_counted)||"other machines' work")]]}),a.map(i=>s.jsx(S6,{row:i,org:t,onSelect:n},i.id))]})}function S6({row:e,org:t,onSelect:n}){var m,h,x;const a=K1(e.forecast),r=y6(e),l=v6(e),i=`roadmap-${e.id}`,o=e.moved?j6(e.told):null,c=(((m=e.counts)==null?void 0:m.members)??0)===0,d=((h=e.not_a_member)==null?void 0:h.count)??0,f=[l,c&&d?`${d} not a member yet`:""].filter(Boolean).join(" · ");return s.jsxs("section",{"aria-labelledby":i,className:"flex flex-col gap-2 border-t pt-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{id:i,className:"text-base font-semibold",children:s.jsx(pr,{query:`planned=${encodeURIComponent(e.id)}`,select:js(e.id),onSelect:n,children:e.name})}),e.kinds.map(j=>s.jsx(pe,{variant:"neutral",children:j},j))]}),a.lead||a.caption.length?s.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.lead?s.jsx("p",{className:"text-sm",children:a.lead}):null,a.caption.length?s.jsx("p",{className:"text-muted-foreground text-xs",children:Ot(a.caption.join(" · "))}):null]}):null,f?s.jsx("p",{className:"text-muted-foreground text-sm",children:f}):null,o?s.jsxs(me,{variant:"info",children:[s.jsx(xE,{"aria-hidden":!0}),s.jsx(Ne,{children:"Moved since you looked"}),s.jsxs(xe,{className:"text-info flex flex-col gap-0.5",children:[o.head?s.jsx("span",{children:o.head}):null,o.what.map((j,v)=>s.jsx("span",{className:"text-xs",children:j},v))]})]}):null,c?null:s.jsxs("p",{className:"text-sm",children:[r.lead,r.rest?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",r.rest]}):null]}),(x=e.stale_unchecked)!=null&&x.words?s.jsx("p",{className:"text-muted-foreground text-xs",children:Ot(e.stale_unchecked.words)}):null,e.for_you&&e.kinds.includes("major")?s.jsx(C6,{row:e}):null,s.jsx(E6,{row:e,org:t})]})}function C6({row:e}){const t=e.for_you;return!t||!t.proposals.length&&!t.committed_nobody_on.length&&!t.widens_most&&!t.set_goal?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"For you"}),t.proposals.map(a=>{const r=[a.proposed_by_title||a.proposed_by?`by ${a.proposed_by_title||a.proposed_by}`:"",a.reason??""].filter(Boolean).join(": ");return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("p",{className:"text-sm",children:["Proposed: ",a.label||a.item]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[r?`${Ot(r).replace(/\.$/,"")}. `:"","Accept or reject in the terminal:"]}),s.jsx(Wi,{children:a.accept}),s.jsx(Wi,{children:a.reject})]},a.item)}),t.committed_nobody_on.map(a=>s.jsxs("p",{className:"text-sm",children:["Nobody on this machine is on ",a.label||a.item,a.level?` (${a.level})`:""]},a.item)),t.widens_most?s.jsxs("p",{className:"text-sm",children:["Widens the range most: ",t.widens_most.label||t.widens_most.item,t.widens_most.high_seconds?s.jsxs("span",{className:"text-muted-foreground",children:[" · +",Math.round(t.widens_most.high_seconds/3600)," h of work at the late end"]}):null]}):null,t.set_goal?s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("p",{className:"text-sm",children:"Set its goal:"}),s.jsx(Wi,{children:t.set_goal})]}):null]})}function Z1({next:e,org:t}){const{href:n,Link:a}=Ze(),r=e.tasks[0],l=e.label||e.item;return r?s.jsx(a,{className:"text-primary hover:underline",href:n(`/org/${t}/tasks/${encodeURIComponent(r.id)}?from=roadmap`),children:l}):s.jsx("span",{children:l})}function R6(e,t){return e.threads.length?e.threads.map(n=>n.title||n.thread).join(", "):t.kinds.includes("range")?(t.tagged_threads??[]).map(n=>`${n.title}: ${n.words}`).join(", "):e.nobody?Ot(e.nobody):""}function E6({row:e,org:t}){const[n,a]=u.useState(!1),r=e.next??[];if(!r.length){const o=e.kinds.includes("range")?e.tagged_threads??[]:[];return o.length?s.jsx("p",{className:"text-muted-foreground text-sm",children:o.map(c=>`${c.title}: ${c.words}`).join(", ")}):null}const l=n?r:r.slice(0,$y),i=new Map((e.stale_estimates??[]).map(o=>[o.item,o]));return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"Next"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:`Next in ${e.name}`,children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Member"}),s.jsx(X,{children:"Level"}),s.jsx(X,{children:"State"}),s.jsx(X,{children:"Who is on it"})]})}),s.jsx(Xe,{children:l.map(o=>{const c=i.get(o.item);return s.jsxs(he,{children:[s.jsx(K,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(Z1,{next:o,org:t}),c?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[Ot(c.words),c.estimate_as_of?` (estimated ${F1(c.estimate_as_of)})`:""]}):null]})}),s.jsx(K,{children:s.jsx(Q1,{level:o.level})}),s.jsx(K,{children:s.jsx(W1,{state:o.state})}),s.jsx(K,{children:R6(o,e)})]},o.item)})})]})}),r.length>$y&&!n?s.jsxs(q,{variant:"outline",size:"sm",className:"self-start",onClick:()=>a(!0),children:["Show all ",r.length]}):null,l.some(o=>i.has(o.item))?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Re-forecast it in the terminal: task-record reforecast"}):null]})}function T6({mine:e,org:t,onSelect:n}){const{href:a,Link:r}=Ze();if(!e)return null;const l=e.tasks.filter(i=>i.propose);return s.jsxs(s.Fragment,{children:[s.jsxs("section",{"aria-labelledby":"roadmap-your-work",className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h3",{id:"roadmap-your-work",className:"text-base font-semibold",children:"Your work"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:e.title})]}),e.tasks.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:Ot(ps.noTask)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Your work",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Task"}),s.jsx(X,{children:"Release"}),s.jsx(X,{children:"Member"})]})}),s.jsx(Xe,{children:e.tasks.map(i=>{var o,c;return s.jsxs(he,{children:[s.jsx(K,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(r,{className:"text-primary font-mono text-xs hover:underline",href:a(`/org/${t}/tasks/${encodeURIComponent(i.id)}?from=roadmap`),children:i.id}),s.jsx("span",{className:"text-muted-foreground text-xs",children:[i.title||i.thread,Ot(X1(i.state))].filter(Boolean).join(" · ")})]})}),s.jsx(K,{children:(o=i.members)!=null&&o.length?i.members.map(d=>s.jsx("div",{children:s.jsx(pr,{query:`planned=${encodeURIComponent(d.planned_release)}`,select:js(d.planned_release),onSelect:n,children:d.name})},d.planned_release)):i.release?s.jsx(pr,{query:`planned=${encodeURIComponent(i.release.planned_release)}`,select:js(i.release.planned_release),onSelect:n,children:i.release.name}):s.jsx("span",{className:"text-muted-foreground",children:i.words?Ot(i.words):"—"})}),s.jsx(K,{children:(c=i.members)!=null&&c.length?i.members.map(d=>s.jsx(Q1,{level:d.level},d.planned_release)):i.not_a_member?s.jsx("span",{className:"text-muted-foreground",children:"Not a member yet"}):null})]},i.id)})})]})}),l.map(i=>{var o;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Propose ",i.id,"'s plan to ",((o=i.release)==null?void 0:o.name)??"its release"," in the terminal:"]}),s.jsx(Wi,{children:i.propose??""})]},i.id)})]}),s.jsxs("section",{"aria-labelledby":"roadmap-your-next",className:"flex flex-col gap-2",children:[s.jsx("h3",{id:"roadmap-your-next",className:"text-base font-semibold",children:"Your next members"}),e.next.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:Ot(ps.noNext)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Your next members",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Release"}),s.jsx(X,{children:"Member"}),s.jsx(X,{children:"State"})]})}),s.jsx(Xe,{children:e.next.map(i=>s.jsxs(he,{children:[s.jsx(K,{children:s.jsx(pr,{query:`planned=${encodeURIComponent(i.release)}`,select:js(i.release),onSelect:n,children:i.name})}),s.jsx(K,{children:s.jsx(Z1,{next:i,org:t})}),s.jsx(K,{children:s.jsx(W1,{state:i.state})})]},`${i.release}:${i.item}`))})]})})]})]})}function A6({state:e,id:t}){var l;const n=us();if(!e)return null;const a=(l=e.value)==null?void 0:l.releases.find(i=>i.id===t);if(!a){if(e.reading)return s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status",children:[s.jsx(dn,{"aria-hidden":!0,className:"size-4"})," ",Ot(ps.pending),"…"]});if(e.refusal){const i=e.refusal.reason==="no_roadmap"?`${Ot(ps.noEngineLead)}. ${n}`:e.refusal.message;return s.jsx("p",{className:"text-muted-foreground text-xs",children:`${ps.failedLead}: ${i}`})}return null}const r=K1(a.forecast);return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.lead?s.jsx("p",{className:"text-sm",children:r.lead}):null,r.caption.length?s.jsx("p",{className:"text-muted-foreground text-xs",children:Ot(r.caption.join(" · "))}):null]})}function J1(){const e=Nn().releases;if(!e)throw new Error("The Releases page rendered without a Releases contract.");return e}function M6({initial:e,environments:t,branch_options:n,chooseBranch:a,renderWrite:r,selection:l,org:i,onReadAgain:o,onNotFound:c,notice:d,focusOnMount:f,tick:m=0}){var U,Se,De,ut,L,ne,ae,Ce,qe,pn;const h=J1(),x=e.local??null,j=!!x,[v,y]=u.useState(e);u.useEffect(()=>{e.local&&y(e)},[e]);const[g,p]=u.useState(null),b=l?l.selected:g,w=l?l.onSelect:p,N=!!(x||v.release_branch),[C,_]=u.useState(x||e.release_branch?{state:"loading"}:{state:"ready",value:null}),[S,D]=u.useState({}),[O,B]=u.useState(null),[Y,H]=u.useState(!1),[M,A]=u.useState(null),[R,T]=u.useState(null),k=u.useRef(null),$=x?{fresh:!0}:void 0,P=u.useRef(0),E=ys(),I=u.useCallback(async(_e,Ve=!1)=>{if(Ve&&E.busy())return;const Ut=++P.current,sn=await E.track(h.candidate(_e));Ut===P.current&&_($n=>sn.ok?{state:"ready",value:sn.data.candidate}:Ve&&$n.state==="ready"?$n:{state:"error",error:sn.refusal.message,refusal:sn.refusal})},[h,E]),F=u.useCallback(async()=>{_({state:"loading"}),await I($)},[I,j]),Q=u.useCallback(async()=>{const _e=await h.list();_e.ok&&y(_e.data)},[h]),oe=((U=v.release_branch)==null?void 0:U.id)??null;u.useEffect(()=>{if(!(!j&&!oe))return I(),()=>{P.current+=1}},[oe,I,j]);const ge=u.useRef(new Set),Z=u.useCallback((_e,Ve)=>D(Ut=>({...Ut,[_e]:Ve.ok?{state:"ready",value:Ve.data.release}:{state:"error",error:Ve.refusal.message,refusal:Ve.refusal}})),[]),J=async _e=>{D(Ve=>({...Ve,[_e]:{state:"loading"}})),ge.current.add(_e),Z(_e,await h.release(_e,$))},re=C.state!=="ready"||C.value!==null,ee=t6(b),fe=b6(x?h:void 0),ce=fe.available&&b===Nl,[Ee,V]=u.useState("all"),te=v.release_branch||x?re?Cs:null:((Se=v.releases[0])==null?void 0:Se.version)??null,le=ee!==null||ce?null:b===Cs?re?Cs:null:b??te,[Pe,Le]=u.useState([]),ue=u.useRef(0),zt=u.useRef(0),Je=ys(),ct=u.useCallback(()=>{if(!j||!h.roadmapMoved)return;const _e=zt.current,Ve=ue.current;Je.track(h.roadmapMoved()).then(Ut=>{_e===zt.current&&Ut.ok&&Ve===ue.current&&Le(Ut.data.moved.map(sn=>sn.name))})},[h,j,Je]);u.useEffect(()=>(ct(),()=>{zt.current+=1}),[ct]),_o(m,()=>{Je.busy()||ct()});const ye=fe.reads.all,We=fe.read;u.useEffect(()=>{ee===null||!fe.available||!ye.value&&!ye.reading&&!ye.refusal&&We("all")},[ee,fe.available,ye,We]);const[Gt,An]=u.useState(0),Nt=u.useRef(0),Ue=_e=>{_e===Nl&&An(Ve=>Ve+1),w(_e)};u.useEffect(()=>{if(Gt!==Nt.current){if(!ce){Nt.current=Gt;return}Ee!=="all"||ye.reading||!ye.value||!h.roadmapSeen||(Nt.current=Gt,h.roadmapSeen(ye.value.as_of).then(_e=>{_e.ok&&(ue.current+=1,Le([]))}))}},[Gt,ce,Ee,ye,h]);const Zt=new Map((((De=ye.value)==null?void 0:De.releases)??[]).map(_e=>[_e.id,[_e.kinds.includes("range")?"range":"",_e.forecast.projected?Ws(_e.forecast.projected):"no date"].filter(Boolean).join(" · ")])),Tt=le===null||le===Cs||v.releases.some(_e=>_e.version===le);u.useEffect(()=>{!x||!c||le!==null&&le!==Cs&&!Tt&&c({kind:"release",id:le})},[x,c,le,Tt]),u.useEffect(()=>{!le||le===Cs||ge.current.has(le)||x&&!Tt||(ge.current.add(le),h.release(le).then(_e=>Z(le,_e)))},[le,h,Z,Tt]);const Vt=ys();_o(m,()=>{if(x){if(I(void 0,!0),le&&le!==Cs&&Tt&&!Vt.busy()){const _e=le;Vt.track(h.release(_e)).then(Ve=>{Ve.ok&&Z(_e,Ve)})}ce?We(Ee,!1,!0):ee!==null&&ye.value&&We("all",!1,!0)}});const At=u.useRef(b),Yt=u.useRef(!1),Lt=u.useRef(!!f),z=u.useRef(null);u.useEffect(()=>{var Ve,Ut;if(!x)return;if(Lt.current){const sn=(Ve=z.current)==null?void 0:Ve.querySelector('[aria-current="true"]');if(sn){Lt.current=!1,At.current=b,sn.focus();return}}if(At.current!==b&&(At.current=b,Yt.current=!0),!Yt.current)return;const _e=(Ut=k.current)==null?void 0:Ut.querySelector("h2");_e&&(Yt.current=!1,_e.tabIndex=-1,_e.focus())});const de=async _e=>{if(!a)return;B(null);const Ve=await a(_e);if(!Ve.ok){B(Ve.error);return}p(null),_({state:"loading"}),await Q()},je=async()=>{if(!v.next_before)return;T(null);const _e=await h.list({before:v.next_before});if(!_e.ok){T(_e.refusal.message);return}y(Ve=>({..._e.data,releases:[...Ve.releases,..._e.data.releases]}))},it=v.release_branch?s.jsx($6,{value:v.release_branch.id,label:v.release_branch.name,options:n??[],can_write:v.can_write,onChange:de}):null,Kn=x?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Read at ",as(x.read_at)]}),o?s.jsxs(q,{variant:"ghost",size:"sm",onClick:o,children:[s.jsx(Or,{className:"mr-1 size-4","aria-hidden":!0}),"Read again"]}):null]}):it,Mn=x?n6(((ut=v.releases[0])==null?void 0:ut.label)??((L=v.releases[0])==null?void 0:L.version)??null):e6(((ne=v.releases[0])==null?void 0:ne.version)??null,((ae=v.release_branch)==null?void 0:ae.name)??null),Jt={org:i??""};return s.jsxs(Jd.Provider,{value:m,children:[s.jsx(O1,{description:x?z1:void 0,actions:Kn}),d,x?s.jsx(s6,{}):null,O?s.jsx(ls,{error:O}):null,x?null:t,!x&&!v.release_branch?s.jsx(O6,{can_write:v.can_write,options:n??[],onChoose:de}):null,v.release_branch||v.releases.length>0||x?s.jsxs("div",{ref:z,className:"flex flex-col gap-6 md:flex-row md:items-start",children:[s.jsx(D6,{list:v,candidate:N?C:null,shown:ce?Nl:ee!==null?js(ee):le,onSelect:Ue,roadmap:fe.available?w6(((Ce=v.planned)==null?void 0:Ce.length)??0,Pe):null,planned_ranges:Zt,can_load_older:!!v.next_before,older_error:R,onLoadOlder:je}),s.jsx("div",{className:"min-w-0 flex-1",ref:k,children:ce?s.jsx(_6,{reads:fe.reads,scope:Ee,onScope:V,onRead:We,org:Jt.org,onSelect:w}):ee!==null?s.jsx(h6,{id:ee,summary:((qe=v.planned)==null?void 0:qe.find(_e=>_e.id===ee))??null,org:Jt.org,onNotFound:()=>c==null?void 0:c({kind:"planned",id:ee}),forecast:fe.available?s.jsx(A6,{state:ye,id:ee}):null}):le===Cs?s.jsx(L6,{candidate:C,branch_name:((pn=v.release_branch)==null?void 0:pn.name)??null,can_write:v.can_write&&!!r,local:!!x,org:Jt.org,onSelect:w,onRetry:F,onWrite:()=>H(!0)}):le?s.jsx(U6,{detail:S[le]??{state:"loading"},summary:v.releases.find(_e=>_e.version===le)??null,local:!!x,org:Jt.org,onSelect:w,onRetry:()=>J(le)}):(v.release_branch||x)&&C.state==="ready"?s.jsx(JL,{title:Mn.title,text:Mn.text}):null})]}):null,r&&C.state==="ready"&&C.value?r({candidate:C.value,open:Y,notice:M,onOpenChange:_e=>{_e||A(null),H(_e)},onStale:async _e=>{A(_e),await I()},onWritten:async _e=>{H(!1),A(null),await Q(),p(_e),await F()}}):null]})}function $6({value:e,label:t,options:n,can_write:a,onChange:r}){const l=n.some(i=>i.id===e);return s.jsxs("div",{className:"grid w-56 gap-2",children:[s.jsx(ze,{htmlFor:"release-branch",children:"Release branch"}),s.jsxs(wt,{value:e,onValueChange:r,disabled:!a,children:[s.jsx(vt,{id:"release-branch",children:s.jsx(_t,{})}),s.jsxs(yt,{children:[l?null:s.jsx(Ae,{value:e,children:t??"Unnamed branch"}),n.map(i=>s.jsx(Ae,{value:i.id,children:i.label},i.id))]})]}),a?null:s.jsx(eS,{})]})}function eS(){return s.jsx("p",{className:"text-muted-foreground text-xs",children:"You have read access; ask a member with write access to change it or write a Release."})}function O6({can_write:e,options:t,onChoose:n}){return s.jsxs("section",{className:"flex flex-col items-center gap-3 py-16 text-center",children:[s.jsx(Du,{className:"text-muted-foreground size-8","aria-hidden":!0}),s.jsx("h2",{className:"text-lg font-semibold",children:"Choose a release branch"}),s.jsx("p",{className:"text-muted-foreground max-w-md text-sm",children:"A Release records the graph change between two commits of one branch. Choose the branch you release from; you can change it later."}),s.jsxs("div",{className:"grid w-64 gap-2 text-left",children:[s.jsx(ze,{htmlFor:"release-branch-first",children:"Release branch"}),s.jsxs(wt,{onValueChange:n,disabled:!e,children:[s.jsx(vt,{id:"release-branch-first",children:s.jsx(_t,{placeholder:"Choose a branch"})}),s.jsx(yt,{children:t.map(a=>s.jsx(Ae,{value:a.id,children:a.label},a.id))})]})]}),e?null:s.jsx(eS,{})]})}function tS({children:e}){return s.jsx("p",{className:"text-muted-foreground px-3 pt-3 text-xs font-medium tracking-wide uppercase",children:e})}function D6({list:e,candidate:t,shown:n,onSelect:a,roadmap:r,planned_ranges:l,can_load_older:i,older_error:o,onLoadOlder:c}){var m,h;const d=!!e.local,f=(t==null?void 0:t.state)==="ready"&&t.value?wo(t.value.changes):null;return s.jsxs("nav",{"aria-label":"Releases",className:"flex w-full flex-col gap-1 md:sticky md:top-0 md:max-h-[calc(100vh-3.5rem)] md:w-72 md:shrink-0 md:overflow-y-auto",children:[d&&r?s.jsx(tu,{active:n===Nl,onClick:()=>a(Nl),version:"Roadmap",badges:null,caption:r}):null,t&&(t.state!=="ready"||t.value)?s.jsx(tu,{active:n===Cs,onClick:()=>a(Cs),version:t.state==="ready"&&t.value?t.value.version:"Next release",badges:s.jsxs(s.Fragment,{children:[s.jsx(pe,{variant:"info",children:"Candidate"}),f!=null&&f.breaking?s.jsx(pe,{variant:"error",children:"Breaking"}):t.state==="ready"&&((m=t.value)==null?void 0:m.app_changed)===!1?s.jsx(pe,{variant:"neutral",children:"App unchanged"}):t.state==="ready"&&((h=t.value)!=null&&h.classification)?s.jsx(pe,{variant:"neutral",children:t.value.classification.bump}):null]}),caption:t.state==="loading"?"Classifying…":t.state==="error"?"Could not be read":D1(t.value)}):null,d?s.jsx(z6,{list:e,shown:n,onSelect:a,ranges:l}):null,d&&e.releases.length>0?s.jsx(tS,{children:"Released"}):null,e.releases.map(x=>{const j=d?a6(x):null;return s.jsx(tu,{active:n===x.version,onClick:()=>a(x.version),version:x.label??x.version,badges:(j==null?void 0:j.badges)??s.jsxs(s.Fragment,{children:[s.jsx(pe,{variant:"neutral",children:x.previous_release_id?x.bump??"patch":"First"}),x.breaking?s.jsx(pe,{variant:"error",children:"Breaking"}):null]}),caption:(j==null?void 0:j.caption)??eg(x.written_at)},x.version)}),i?s.jsx(q,{variant:"link",size:"sm",className:"self-start",onClick:c,children:"Show older Releases"}):null,o?s.jsx("p",{className:"text-destructive text-xs",role:"alert",children:o}):null]})}function z6({list:e,shown:t,onSelect:n,ranges:a}){return!e.planned_error&&!(e.planned&&e.planned.length>0)?null:s.jsxs(s.Fragment,{children:[s.jsx(tS,{children:"Planned"}),e.planned_error?s.jsx(ls,{title:"Planned Releases could not be read",error:e.planned_error}):null,(e.planned??[]).map((r,l)=>s.jsx(tu,{active:t===js(r.id),onClick:()=>n(js(r.id)),version:r.name,badges:s.jsx(pe,{variant:"neutral",children:"Planned"}),caption:`${r.members===0?"no members":`${r.members} member${r.members===1?"":"s"}`}${l===0?" · next":""}${a!=null&&a.get(r.id)?` · ${a.get(r.id)}`:""}`},r.id))]})}function L6({candidate:e,branch_name:t,can_write:n,local:a,org:r,onSelect:l,onRetry:i,onWrite:o}){var h;if(e.state==="loading")return s.jsx(ns,{children:s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:"Classifying the changes since the last Release…"})});if(e.state==="error")return s.jsx(ns,{children:s.jsx(ls,{error:e.error,onRetry:i})});const c=e.value;if(!c)return null;const d=wo(c.changes),f=!c.previous_release,m=t??"the release branch";return s.jsxs(ns,{children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:c.version}),s.jsx(pe,{variant:"info",children:"Candidate"}),d.breaking?s.jsx(pe,{variant:"error",children:"Breaking"}):c.app_changed===!1?s.jsx(pe,{variant:"neutral",children:"App unchanged"}):c.classification?s.jsx(pe,{variant:"neutral",children:c.classification.bump}):null]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:[a?"What staging runs over production: ":`What the next Release holds at ${m}'s head: `,D1(c),". It is computed when you open it and never stored.",d.breaking&&c.next_version.startsWith("0.")?" Before 1.0.0 a major change raises the minor number.":""]}),f?s.jsxs("p",{className:"text-muted-foreground text-xs",children:["The first Release, ",c.next_version,", records the starting point and lists no changes."]}):s.jsx("p",{className:"text-muted-foreground text-xs",children:"Only graph changes are judged, so code that changed without a graph change is not counted."}),(h=c.classification)!=null&&h.marks_approximate?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Modeling-only marks could not all be read, so these notes may leave out a change made after a mark."}):null,c.commits_since===null?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Not every commit since the last Release could be walked, so the count and the rc number are at least what is shown."}):null]}),n?s.jsxs(q,{onClick:o,children:[s.jsx(Du,{className:"mr-2 size-4"}),"Write Release ",c.next_version]}):null]}),a?s.jsx(u6,{candidate:c,org:r,onSelect:l,notes:f?null:s.jsx(Zu,{changes:c.changes})}):f?null:s.jsx(Zu,{changes:c.changes})]})}function U6({detail:e,summary:t,local:n,org:a,onSelect:r,onRetry:l}){const[i,o]=u.useState(!1);if((t==null?void 0:t.state)==="unreadable")return s.jsxs(ns,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:t.label??t.version}),s.jsx(ls,{title:"This Release could not be read",error:t.error??"Its record cannot be read."})]});if(e.state==="loading")return s.jsx(ns,{children:s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:"Loading the Release…"})});if(e.state==="error")return s.jsx(ns,{children:s.jsx(ls,{error:e.error,onRetry:l})});const c=e.value,d=!c.previous_release_id,f=c.bump&&c.computed_bump&&c.bump!==c.computed_bump,m=c.label??c.version,h=async()=>{await navigator.clipboard.writeText(WL(m,wo(c.changes))),o(!0)};return s.jsxs(ns,{children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[n?s.jsx(d6,{release:c,onSelect:r}):s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:c.version}),s.jsx(pe,{variant:"neutral",children:d?"First":c.bump}),wo(c.changes).breaking?s.jsx(pe,{variant:"error",children:"Breaking"}):null]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Written ",eg(c.written_at),c.written_by_name?` by ${c.written_by_name}`:"",". A Release is permanent; a correction is a new Release."]}),n&&c.batch?s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Released when production ran release batch ",s.jsx("code",{className:"font-mono",children:c.batch}),".",c.app_changed===!1?` The app's version stays ${c.app_version??c.version}.`:""]}):null,f?s.jsxs("p",{className:"text-sm",children:["Computed ",c.computed_bump,", declared ",c.bump,c.declared_by_name?` by ${c.declared_by_name}`:"",c.declared_reason?`: “${c.declared_reason}”`:"."]}):null,c.version_line?s.jsx("p",{className:"text-sm",children:c.version_line}):null,c.marks_approximate?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Modeling-only marks could not all be read when it was written, so its notes may leave out a change made after a mark."}):null,d?s.jsx("p",{className:"text-muted-foreground text-xs",children:"The first Release records the starting point and lists no changes."}):c.source_judged?null:s.jsx("p",{className:"text-muted-foreground text-xs",children:"Only graph changes were judged, so code that changed without a graph change is not counted."})]}),d?null:s.jsxs(q,{variant:"outline",onClick:h,children:[s.jsx(c0,{className:"mr-2 size-4"}),i?"Copied":"Copy notes"]})]}),n?s.jsx(f6,{release:c,org:a,onSelect:r,notes:d?null:s.jsx(Zu,{changes:c.changes})}):d?null:s.jsx(Zu,{changes:c.changes})]})}const B6=5,H6=1e4,I6=e=>e.retry===!0||e.reason==="store_locked"||e.status===503;function P6({org:e,query:t,onSelect:n,home:a}){var k;const r=J1(),{href:l,Link:i}=Ze(),[o,c]=u.useState({state:"loading"}),[d,f]=u.useState(null),[m,h]=u.useState(null),[x,j]=u.useState(null),v=u.useRef(0),y=u.useRef(0),g=u.useRef(null),p=u.useRef(!1),b=u.useRef(!1),w=Vx(g),N=ys(),C=u.useCallback(async($,P=!1)=>{const E=y.current+=1;h(null);const I=await N.track(r.list($?{fresh:!0}:void 0));if(E===y.current){if(I.ok){v.current=0,f(null);const F=document.visibilityState==="visible"?1:0;c(Q=>Q.state==="ok"?P?{state:"ok",list:I.data,gen:Q.gen,tick:Q.tick+F}:{state:"ok",list:I.data,gen:Q.gen+1,tick:Q.tick}:{state:"ok",list:I.data,gen:0,tick:0});return}if(I.refusal.reason==="engine_missing"){c({state:"engine_missing",refusal:I.refusal});return}if(v.current+=1,v.current===1&&I6(I.refusal)){b.current=P,h(I.refusal.retry_after??B6);return}f(I.refusal)}},[r,N]);u.useEffect(()=>{C(!1)},[C]);const _=u.useMemo(()=>Qx(N,()=>void C(!1,!0)),[C,N]);Cr(_,H6),u.useEffect(()=>{if(m===null)return;const $=setTimeout(()=>{document.visibilityState==="visible"&&C(!1,b.current)},m*1e3);return()=>clearTimeout($)},[m,C]),u.useEffect(()=>{var P;if(!p.current||o.state==="loading"||d||m!==null)return;p.current=!1;const $=(P=g.current)==null?void 0:P.querySelector("h1");$&&($.tabIndex=-1,$.focus())});const S=()=>{p.current=!0,v.current=0,f(null),C(!0)},D=o.state==="ok"?o.list:null,O=t.roadmap?Nl:t.planned!==null?t.planned===""?(k=D==null?void 0:D.planned)!=null&&k[0]?js(D.planned[0].id):null:js(t.planned):t.release,B=`${t.release??""}|${t.planned??""}|${t.roadmap?"roadmap":""}`,Y=u.useRef(B);u.useEffect(()=>{Y.current!==B&&(Y.current=B,j(null))},[B]);const H=u.useRef(!1),M=u.useCallback($=>{H.current=!0,j($)},[]),A=!x&&o.state==="ok"&&H.current;if(u.useEffect(()=>{A&&(H.current=!1)},[A]),x)return s.jsx(Wa,{title:x.kind==="release"?`No Release ${x.id}`:`No open Planned Release ${x.id}`,description:"This project has no Release, candidate or open Planned Release by that name.",backHref:l(a),backLabel:"All Releases",link:i});const R=m!==null?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(dn,{"aria-hidden":!0})," The release records are busy; reading again in ",m," s…"]}):null,T=d?s.jsxs(me,{ref:w,variant:"destructive",children:[s.jsx(ln,{}),s.jsx(Ne,{children:"Releases could not be read"}),s.jsxs(xe,{className:"flex flex-col items-start gap-2",children:[s.jsxs("span",{children:[d.message,D?" The last Releases read stays below.":""]}),s.jsx(q,{variant:"outline",size:"sm",onClick:S,children:"Try again"})]})]}):null;return s.jsx("div",{ref:g,className:"flex w-full flex-1 flex-col gap-6 px-4 py-4 sm:px-6 lg:px-8",children:o.state==="ok"?s.jsx(M6,{initial:o.list,tick:o.tick,org:e,selection:{selected:O,onSelect:n},onReadAgain:S,onNotFound:M,notice:R||T?s.jsxs(s.Fragment,{children:[R,T]}):null,focusOnMount:A},o.gen):o.state==="engine_missing"?s.jsx(ha,{page:"Releases"}):s.jsxs(s.Fragment,{children:[s.jsx(O1,{description:z1}),T??R??s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(dn,{"aria-hidden":!0})," Loading Releases…"]})]})})}const q6={threads:"Threads",tasks:"Tasks",queues:"Queues",worktrees:"Worktrees",workspaces:"Workspaces",chart:"Org chart"},G6={tasks:"Tasks",issues:"Issues",releases:"Releases"};function nu(e,t){return e.kind==="home"?"Home":e.kind==="org"?q6[e.page]:e.kind==="project"?e.page?G6[e.page]:t??e.project:"Not found"}const V6="(max-width: 767px)";function Y6(){const e=typeof window<"u"&&window.matchMedia?window.matchMedia(V6):null,[t,n]=u.useState((e==null?void 0:e.matches)??!1);return u.useEffect(()=>{if(!e)return;const a=()=>n(e.matches);return e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[e]),t}function Mc({className:e=""}){return s.jsx("span",{"aria-hidden":"true",className:`block animate-pulse rounded-md bg-sidebar-accent ${e}`})}function Dy({label:e,children:t}){return s.jsxs("span",{role:"status",className:"flex flex-col gap-1",children:[s.jsx("span",{className:"sr-only",children:e}),t]})}function zy({item:e,collapsed:t}){const{Link:n}=Ze(),a=e.icon,r=e.title??(t?e.label:void 0),l=s.jsx("span",{className:"block",children:s.jsxs(n,{href:e.href,className:"flex h-8 items-center gap-2 overflow-hidden rounded-md px-2 text-sm text-sidebar-foreground no-underline outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring "+(e.current?"bg-sidebar-accent font-medium text-sidebar-accent-foreground":""),"aria-current":e.current?"page":void 0,"aria-label":t?e.label:void 0,children:[s.jsx(a,{className:"size-4 shrink-0","aria-hidden":"true"}),!t&&s.jsx("span",{className:"truncate",children:e.label})]})});return s.jsx("li",{children:r?s.jsxs(Ux,{children:[s.jsx(Bx,{asChild:!0,children:l}),s.jsx(Qd,{side:"right",children:r})]}):l})}const Ly="m-0 flex list-none flex-col gap-1 p-0";function Uy({label:e,collapsed:t,children:n}){return s.jsxs("div",{className:"flex flex-col gap-1 p-2",role:"group","aria-label":e,children:[!t&&s.jsx("p",{className:"m-0 px-2 text-xs font-medium text-sidebar-foreground/70",children:e}),n]})}function By({page:e,collapsed:t,sheet:n=!1}){var M;const{href:a}=Ze(),{worktrees:r}=Nn(),l=Yn(),{org:i,projects:o,loading:c,none:d,about:f,aboutFailed:m,domains:h,engine:x}=l,j=x===null,v=i?`/org/${i.slug}`:"",y=o==null?void 0:o.find(A=>A.current),g=((M=i==null?void 0:i.source)==null?void 0:M.kind)==="folder"&&y!==void 0,p=A=>g&&y?`${A} · ${y.name}`:A,b=p("Workspaces"),w=p("Tasks"),N=p("Queues"),C=A=>g?A:void 0,_=[{label:"Home",href:a(v||"/"),icon:vE,current:e.kind==="home"},...j?[]:[{label:"Threads",href:a(`${v}/threads`),icon:Ou,current:e.kind==="org"&&e.page==="threads"}],...h.includes("tasks")&&!j?[{label:w,title:C(w),href:a(`${v}/tasks`),icon:d0,current:e.kind==="org"&&e.page==="tasks"}]:[],...j?[]:[{label:N,title:C(N),href:a(`${v}/queues`),icon:f0,current:e.kind==="org"&&e.page==="queues"}],...r&&!j?[{label:"Worktrees",href:a(`${v}/worktrees`),icon:u0,current:e.kind==="org"&&e.page==="worktrees"}]:[],{label:b,title:C(b),href:a(`${v}/workspaces`),icon:dE,current:e.kind==="org"&&e.page==="workspaces"},{label:"Org chart",href:a(`${v}/chart`),icon:zE,current:e.kind==="org"&&e.page==="chart"}],S=c?null:d?"No organization":(i==null?void 0:i.name)??"Organization",D=i?hT(i):null,O=f==null?void 0:f.version,B=O?t?O:`sdlc ${O}`:m?zu:Sd,Y=m||(f==null?void 0:f.sync.state)==="unknown"?uT:f===void 0?cT:oT;let H;return c?H=s.jsx("div",{className:"px-2 py-1",children:s.jsxs(Dy,{label:"Loading projects",children:[s.jsx(Mc,{className:"h-4 w-32"}),s.jsx(Mc,{className:"h-4 w-24"})]})}):o?H=s.jsx("ul",{className:Ly,children:o.map(A=>s.jsx(zy,{collapsed:t,item:{label:A.name,title:A.name,href:a(`/proj/${encodeURIComponent(A.id)}`),icon:cE,current:e.kind==="project"&&e.project===A.id}},A.id))}):H=s.jsx("p",{className:"m-0 px-2 text-sm text-sidebar-foreground/70",children:d?"No projects":zu}),s.jsxs("div",{className:"flex h-full flex-col bg-sidebar text-sidebar-foreground",children:[s.jsxs("div",{className:`flex items-center gap-2 p-2 ${n?"pr-11":""}`,role:"group","aria-label":"Current organization",children:[s.jsx("div",{className:"flex aspect-square size-8 shrink-0 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground",children:s.jsx(qR,{className:"size-4","aria-hidden":"true"})}),!t&&s.jsx("div",{className:"grid min-w-0 flex-1 text-left text-sm leading-tight",children:S===null?s.jsxs(Dy,{label:"Loading organization",children:[s.jsx(Mc,{className:"h-4 w-28"}),s.jsx(Mc,{className:"h-3 w-24"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-semibold",title:S,children:S}),D&&s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/70",children:D})]})})]}),s.jsxs("nav",{"aria-label":"App",className:"min-h-0 flex-1 overflow-y-auto",children:[s.jsx(Uy,{label:"Organization",collapsed:t,children:s.jsx("ul",{className:Ly,children:_.map(A=>s.jsx(zy,{item:A,collapsed:t},A.label))})}),!t&&s.jsx(Uy,{label:"Projects",collapsed:t,children:H})]}),f!==null&&s.jsxs("div",{className:"flex flex-col gap-1 border-t border-sidebar-border p-2 text-xs text-sidebar-foreground/70",children:[s.jsx("p",{className:"m-0 truncate px-2",title:O?`sdlc ${O}`:void 0,children:B}),!t&&s.jsxs("p",{className:"m-0 flex items-start gap-2 px-2",children:[s.jsx(mE,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{children:Y})]})]})]})}const F6="outline-hidden rounded-sm focus-visible:ring-2 focus-visible:ring-ring";function K6({page:e}){var c;const{href:t,Link:n}=Ze(),{org:a,projects:r,loading:l,none:i}=Yn(),o=[];if(l)o.push({label:Sd});else if(i)o.push({label:"No organization"});else{const d=(a==null?void 0:a.name)??"Organization";if(o.push({label:d,href:e.kind==="home"?void 0:t(a?`/org/${a.slug}`:"/")}),e.kind==="project"){const f=((c=r==null?void 0:r.find(m=>m.id===e.project))==null?void 0:c.name)??e.project;o.push({label:f,href:e.page?t(`/proj/${encodeURIComponent(e.project)}`):void 0})}if(e.kind==="org"&&e.item!==void 0)o.push({label:nu(e),href:a?t(`/org/${a.slug}/${e.page}`):void 0}),o.push({label:e.item});else if(e.kind==="project"&&e.page&&e.item!==void 0){const f=`/proj/${encodeURIComponent(e.project)}/${e.page}${e.list_query?`?${e.list_query}`:""}`;o.push({label:nu(e),href:t(f)}),o.push({label:e.item})}else e.kind!=="home"&&!(e.kind==="project"&&!e.page)&&o.push({label:nu(e)})}return s.jsx("nav",{"aria-label":"Breadcrumb",className:"min-w-0",children:s.jsx("ol",{className:"m-0 flex min-w-0 list-none items-center gap-1.5 p-0 text-sm text-muted-foreground",children:o.map((d,f)=>s.jsxs("li",{className:"flex min-w-0 items-center gap-1.5",children:[f>0&&s.jsx(bd,{className:"size-3.5 shrink-0","aria-hidden":"true"}),d.href?s.jsx(n,{href:d.href,className:`truncate text-muted-foreground no-underline hover:text-foreground ${F6}`,children:d.label}):s.jsx("span",{className:"truncate font-normal text-foreground","aria-current":f===o.length-1?"page":void 0,children:d.label})]},`${f}-${d.label}`))})})}function X6({page:e,children:t}){var g;const n=Y6(),[a,r]=u.useState(!0),[l,i]=u.useState(!1),o=u.useRef(null),c=u.useRef(null),{org:d,projects:f,loading:m,none:h}=Yn(),x=e.kind==="project"?(g=f==null?void 0:f.find(p=>p.id===e.project))==null?void 0:g.name:void 0;u.useEffect(()=>{const p=m?Sd:h?"No organization":(d==null?void 0:d.name)??"Organization",b=(e.kind==="org"||e.kind==="project")&&e.item!==void 0?`${e.item} · `:"";document.title=`${b}${nu(e,x)} · ${p} · sdlc viewer`},[e,x,d,m,h]);const j=()=>{var p;i(!1),(p=o.current)==null||p.focus()};u.useEffect(()=>{n||i(!1)},[n]);const v=n&&l;u.useEffect(()=>{var w;const p=c.current;if(!v||!p)return;(w=p.querySelector("a, button"))==null||w.focus();const b=N=>{var O;if(N.key==="Escape"){i(!1),(O=o.current)==null||O.focus();return}if(N.key!=="Tab")return;const C=[...p.querySelectorAll("a[href], button:not([disabled])")];if(C.length===0)return;const _=C[0],S=C[C.length-1],D=p.contains(document.activeElement);N.shiftKey&&(document.activeElement===_||!D)?(N.preventDefault(),S.focus()):!N.shiftKey&&(document.activeElement===S||!D)&&(N.preventDefault(),_.focus())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[v]);const y=!n&&!a;return s.jsx(Lx,{children:s.jsxs("div",{className:"flex h-svh min-h-0 overflow-hidden bg-background text-foreground",children:[!n&&s.jsx("aside",{"aria-label":"Sidebar",className:`shrink-0 border-r border-sidebar-border transition-[width] ${y?"w-12":"w-64"}`,children:s.jsx(By,{page:e,collapsed:y})}),v&&s.jsxs("div",{className:"fixed inset-0 z-50 flex",children:[s.jsxs("aside",{ref:c,role:"dialog","aria-modal":"true","aria-label":"Sidebar",className:"relative w-72 max-w-[85vw] border-r border-sidebar-border",children:[s.jsx(By,{page:e,collapsed:!1,sheet:!0}),s.jsx("button",{type:"button","aria-label":"Close the sidebar",className:"absolute top-3 right-3 inline-flex size-7 items-center justify-center rounded-md border-0 bg-transparent text-sidebar-foreground/70 outline-hidden hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring",onClick:j,children:s.jsx(kd,{className:"size-4","aria-hidden":"true"})})]}),s.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"flex-1 border-0 bg-black/80 outline-hidden",onClick:j})]}),s.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:[s.jsxs("header",{className:`flex shrink-0 items-center gap-2 border-b border-border px-4 transition-[height] ${y?"h-12":"h-16"}`,children:[s.jsx("button",{ref:o,type:"button",className:"-ml-1 inline-flex size-7 items-center justify-center rounded-md border-0 bg-transparent text-foreground outline-hidden hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Toggle Sidebar","aria-expanded":n?l:a,onClick:()=>n?i(p=>!p):r(p=>!p),children:s.jsx(UE,{className:"size-4","aria-hidden":"true"})}),s.jsx("span",{"aria-hidden":"true",className:"mr-2 h-4 w-px bg-border"}),s.jsx(K6,{page:e})]}),s.jsx("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto",children:t})]})]})})}const ag="m-0 text-2xl font-semibold tracking-tight",rg="outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",lg=`rounded-sm font-medium text-primary no-underline hover:underline ${rg}`;function fh({children:e}){return s.jsx("pre",{className:"m-0 overflow-x-auto rounded-md border border-border bg-muted px-3 py-2 font-mono text-sm text-foreground",children:s.jsx("code",{children:e})})}function Q6({why:e}){return e.kind==="not_in_git"?s.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[s.jsx("p",{className:"m-0 text-sm",children:"This directory is not a Git repository. Start sdlc viewer inside one:"}),s.jsx(fh,{children:"sdlc viewer"})]}):e.kind==="unlisted"?s.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[s.jsx("p",{className:"m-0 text-sm",children:`This repository, ${e.repository}, points to the folder ${e.folder}, but that folder no longer lists it.`}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"To rejoin, leave the folder here:"}),s.jsx(fh,{children:"sdlc-agents folder leave"}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`then add it back from the folder's home repository, ${e.home}:`}),s.jsx(fh,{children:`sdlc-agents folder add ${e.member_path} --name ${e.repository}`}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"To work in this repository alone, leaving is enough."})]}):s.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[s.jsx("p",{className:"m-0 text-sm",children:e.cause}),e.kind==="moved_member"&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"Move this repository back to where the folder records it."}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:e.kind==="other"&&!e.fix?br:fT})]})}const Hy=`inline-flex h-9 items-center justify-center whitespace-nowrap rounded-md border border-input bg-background px-3 font-[inherit] text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 ${rg}`;function W6(){return s.jsxs("div",{role:"status",className:"flex flex-col gap-2",children:[s.jsx("span",{className:"sr-only",children:"Loading projects"}),[0,1,2].map(e=>s.jsx("span",{"aria-hidden":"true",className:"block h-9 animate-pulse rounded-md bg-muted"},e))]})}function li(){const{href:e,Link:t}=Ze(),{loading:n,projects:a,none:r,failure:l,readAt:i,refresh:o,reading:c}=Yn(),[d,f]=u.useState(""),m=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:ag,children:"Projects"}),!r&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:dT})]});if(r)return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[m,s.jsx(Q6,{why:r==="not_in_git"?{kind:"not_in_git"}:gT(r)})]});const h=l!=null&&l.shown?l:null,x=(a??[]).filter(j=>j.name.toLowerCase().includes(d.trim().toLowerCase()));return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[m,h&&s.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-4",children:[s.jsx("p",{className:"m-0 text-sm font-medium text-destructive",children:"The projects could not be refreshed"}),s.jsx("p",{className:"m-0 text-sm",children:m0(h.refusal,i)}),s.jsx("div",{children:s.jsx("button",{type:"button",className:Hy,onClick:o,disabled:c,children:"Retry"})})]}),(a||n)&&s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"search","aria-label":"Filter projects",placeholder:"Filter projects",value:d,onChange:j=>f(j.target.value),className:`h-9 w-full max-w-sm rounded-md border border-input bg-transparent px-3 font-[inherit] text-sm text-foreground placeholder:text-muted-foreground ${rg}`}),!h&&s.jsx("button",{type:"button",className:`${Hy} ml-auto`,onClick:o,disabled:c||n,children:"Refresh"})]}),l&&!l.shown&&i&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`Showing the list read at ${Ci(i)}; reading again in ${l.retryInSeconds??10} seconds.`})]}),n?s.jsx(W6,{}):a&&s.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:s.jsxs("table",{className:"w-full border-collapse text-sm",children:[s.jsx("thead",{className:"border-b border-border text-left text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",className:"h-10 px-3 font-medium",children:"Name"}),s.jsx("th",{scope:"col",className:"h-10 px-3 font-medium",children:"Location"}),s.jsx("th",{scope:"col",className:"h-10 px-3",children:s.jsx("span",{className:"sr-only",children:"Where this viewer runs"})})]})}),s.jsxs("tbody",{children:[x.map(j=>s.jsxs("tr",{className:"border-b border-border last:border-0",children:[s.jsx("td",{className:"px-3 py-2",children:s.jsx(t,{href:e(`/proj/${encodeURIComponent(j.id)}`),className:lg,children:j.name})}),s.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:j.location??zu}),s.jsx("td",{className:"px-3 py-2 text-right",children:j.current&&s.jsx("span",{className:"inline-flex items-center rounded-md border border-border px-2 py-0.5 text-xs font-medium",children:"This repository"})})]},j.id)),x.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:3,className:"px-3 py-6 text-center text-muted-foreground",children:"No projects found."})})]})]})})]})}function nS({title:e,children:t}){const{href:n,Link:a}=Ze();return s.jsx("div",{className:"p-6",children:s.jsxs("div",{className:"flex max-w-xl flex-col gap-2 rounded-xl border border-border bg-card p-6 text-card-foreground",children:[s.jsx("h1",{className:ag,children:e}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:t}),s.jsx("div",{children:s.jsx(a,{href:n("/"),className:`text-sm ${lg}`,children:"Back to the organization's Home"})})]})})}const Z6={tasks:"Tasks",issues:"Issues",releases:"Releases"};function No({project:e}){const{href:t,Link:n}=Ze(),{org:a,projects:r,loading:l,domains:i}=Yn(),o=r==null?void 0:r.find(c=>c.id===e);return l?s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:Sd}):r?o?s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:ag,children:o.name}),s.jsx("p",{className:"m-0 font-mono text-sm text-muted-foreground",children:o.location??zu})]}),o.current?i.length>0?s.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0 text-sm",children:i.map(c=>s.jsx("li",{children:s.jsx(n,{href:t(c==="tasks"?`${a?`/org/${a.slug}`:""}/tasks`:`/proj/${encodeURIComponent(o.id)}/${c}`),className:lg,children:Z6[c]})},c))}):null:s.jsx("p",{className:"m-0 max-w-2xl text-sm text-muted-foreground",children:`This viewer reads ${o.name}'s tasks, issues and Releases only from its own checkout: open it with sdlc viewer there.`})]}):s.jsx(nS,{title:"Project not found",children:`There is no project '${e}' in this organization.`}):s.jsx(li,{})}const nf=e=>e instanceof Error?e.message:String(e);async function sS(e=!1){try{const t=await fetch(e?"api/threads?archived=1":"api/threads",{cache:"no-store"});return t.status===404?{none:!0}:t.ok?{data:await t.json()}:{error:await t.text()||`HTTP ${t.status}`}}catch(t){return{error:nf(t)}}}async function J6(){var e;try{const t=await fetch("api/release-links?threads",{cache:"no-store"});if(!t.ok)return null;const n=await t.json(),a=(e=n==null?void 0:n.panel)==null?void 0:e.threads;if(!a||typeof a!="object"||Array.isArray(a))return null;const r={};for(const[l,i]of Object.entries(a)){const o=(Array.isArray(i)?i:[]).filter(c=>!!c&&typeof c.planned_release=="string"&&typeof c.name=="string"&&typeof c.level=="string");o.length&&(r[l]=o)}return r}catch{return null}}async function e5(){try{return(await fetch("api/pin",{method:"HEAD",cache:"no-store"})).ok}catch{return!1}}async function t5(){try{const e=await fetch("api/sessions",{cache:"no-store"});if(!e.ok)return null;const t=await e.json();return!t||typeof t.idle_over!="number"||!Array.isArray(t.sessions)?null:{idle_over:t.idle_over,memory_mb:Number(t.memory_mb)||0,sessions:t.sessions}}catch{return null}}async function n5(){try{const e=await fetch("api/sessions-release",{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:"{}"});if(!e.ok)return{error:await e.text()||`HTTP ${e.status}`};const t=await e.json();return{done:{released:t.released??[],kept:t.kept??[]}}}catch(e){return{error:nf(e)}}}async function aS(e,t){try{const n=await fetch("api/threads/open",{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,reopen:t})}),a=await n.text();let r={};try{r=JSON.parse(a)??{}}catch{}return n.ok?{done:r}:{refused:{reason:typeof r.reason=="string"?r.reason:"failed",error:typeof r.error=="string"?r.error:a||`HTTP ${n.status}`,...typeof r.where=="string"&&r.where?{where:r.where}:{}}}}catch(n){return{refused:{reason:"failed",error:nf(n)}}}}async function s5(e,t){try{const n=await fetch("api/pin",{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,on:t})});return n.ok?null:await n.text()||`HTTP ${n.status}`}catch(n){return nf(n)}}const a5={probe:{source:async()=>{const e=await sS();if("error"in e)throw new Error(e.error);return{label:"Local workspace"}}}},rS={href:e=>e.replace(/^\/+/,"")||"./",Link:({href:e,className:t,children:n,...a})=>s.jsx("a",{href:e,className:t,...a,children:n})},r5={label:"Local viewer",can:()=>!1};function l5(){return u.useEffect(()=>{document.title="Shared app UI · SDLC Workspace Viewer"},[]),s.jsx("div",{className:"app-ui dark",children:s.jsx(r0,{data:a5,router:rS,identity:r5,children:s.jsx(kR,{})})})}const i5="This repository's local planning workspaces: which workspace each forked from, what this checkout's workspace may change, and the integrations and Handoffs between them. This page only reads them; sdlc workspace and sdlc integrate change them.",o5=3e4,c5="Reading the workspaces. On a plan workspace this can take a few minutes.",u5="The read failed. Details are in the terminal running sdlc viewer.",d5={active:{label:"Active",tone:"success"},closed:{label:"Closed",tone:"neutral"},clean:{label:"Clean",tone:"success"},dirty:{label:"Uncommitted changes",tone:"warning"},unreadable:{label:"Unreadable",tone:"error"},queued:{label:"Queued",tone:"info"},integrated:{label:"Integrated",tone:"success"},reconciled:{label:"Reconciled",tone:"success"},stale_head:{label:"Retrying",tone:"warning"},current:{label:"Current",tone:"neutral"},blocked_conflict:{label:"Blocked: conflict",tone:"warning"},blocked_validation:{label:"Blocked: validation error",tone:"warning"},ready:{label:"Ready",tone:"success"},applied:{label:"Applied",tone:"success"},stale_base:{label:"Stale base",tone:"warning"},applied_recovery_required:{label:"Needs recovery",tone:"warning"},unavailable:{label:"Unavailable",tone:"warning"},needs_attention:{label:"Needs attention",tone:"warning"}},f5=e=>d5[e]??{label:e,tone:"neutral"},$a=e=>e.slice(0,8),lS={human:"Human",ai:"AI"},Pm=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function h5(){const e=Nn().workspaces;if(!e)throw new Error("The Workspaces page rendered without the workspaces seam.");return e}function m5(e){const t=h5(),[n,a]=u.useState(null),[r,l]=u.useState(null),[i,o]=u.useState(!1),c=u.useRef(null),d=u.useRef(!1),f=u.useRef(null),m=u.useCallback(()=>{if(f.current)return f.current;const y=(async()=>{const g=await t.overview();g.ok?(a(g.data),l(null),o(!1)):(l(g.refusal),o(!0))})().finally(()=>{f.current=null});return f.current=y,y},[t]);u.useEffect(()=>{m()},[m]),Cr(()=>void m(),o5),u.useEffect(()=>{var y;d.current&&(n||r)&&(d.current=!1,(y=c.current)==null||y.focus())},[n,r]);const h=()=>{d.current=!0,m()},x=n===null&&r===null,j=n===null&&r!==null,v=n?p5(n,i):null;return s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(mn,{title:"Workspaces",description:i5,actions:s.jsxs(s.Fragment,{children:[v?s.jsx("p",{className:"text-muted-foreground text-xs",children:v}):null,s.jsxs(q,{type:"button",variant:"outline",size:"sm","aria-disabled":x||void 0,"aria-describedby":x?"workspaces-reading":void 0,className:"gap-2",onClick:x?void 0:()=>void m(),children:[s.jsx(Or,{className:"size-4","aria-hidden":"true"}),"Read again"]}),x?s.jsx("span",{id:"workspaces-reading",className:"sr-only",children:"Reading…"}):null,s.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n?iS(n,i):""})]})}),s.jsxs("div",{ref:c,tabIndex:-1,className:"outline-none",children:[x?s.jsx(x5,{}):null,j&&r?s.jsx(g5,{refusal:r,on_retry:h}):null,n?s.jsx(v5,{overview:n}):null]})]})}function iS(e,t){var n,a;return t||((n=e.stale)==null?void 0:n.reason)==="failed"?"a newer read failed":((a=e.stale)==null?void 0:a.reason)==="running"?"a newer read is still running":""}function p5(e,t){const n=`Read at ${_s(new Date(e.read_at).toISOString())}`,a=iS(e,t);return a?`${n} · ${a}`:n}function x5(){return s.jsxs("div",{className:"mt-6",children:[s.jsx("div",{className:"grid gap-2",role:"status","aria-label":"Loading workspaces",children:Array.from({length:6},(e,t)=>s.jsx(Rt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))}),s.jsx("p",{className:"text-muted-foreground mt-3 text-sm","aria-live":"polite",children:c5})]})}function g5({refusal:e,on_retry:t}){const n=e.reason==="store_locked"?m0(e,null):u5;return s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read workspaces"}),s.jsxs(xe,{children:[s.jsx("p",{children:n}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function v5({overview:e}){const{counts:t}=e,n=[Pm(t.workspaces,"workspace"),`${t.active} active`,`${t.queued} queued`,`${t.blocked} blocked`].join(" · ");return s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status","aria-live":"polite",children:n}),s.jsxs("div",{className:"mt-4 grid gap-4 lg:grid-cols-[1.4fr_1fr]",children:[s.jsx($c,{id:"workspaces-lineage",title:"Lineage",caption:"Each workspace under the one it forked from",children:s.jsx(y5,{rows:e.workspaces})}),s.jsx($c,{id:"workspaces-authority",title:"Authority and resolver",caption:"What this checkout's workspace may change",children:s.jsx(j5,{authority:e.authority})})]}),s.jsx($c,{id:"workspaces-activity",className:"mt-4",title:"Integration activity",caption:"Newest first",children:e.activity.length===0?s.jsx(Iy,{children:"No integration or reconciliation attempts yet."}):s.jsx(w5,{rows:e.activity})}),s.jsx($c,{id:"workspaces-handoffs",className:"mt-4",title:"Handoffs",children:e.handoffs.length===0?s.jsx(Iy,{children:"No Handoffs prepared yet."}):s.jsx(_5,{rows:e.handoffs})})]})}function $c({id:e,title:t,caption:n,className:a,children:r}){return s.jsxs("section",{"aria-labelledby":e,className:ie("min-w-0",a),children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-baseline gap-x-2",children:[s.jsx("h2",{id:e,className:"text-lg font-semibold",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),r]})}const Iy=({children:e})=>s.jsx("p",{className:"text-muted-foreground text-sm",children:e}),Ju=({children:e,tone:t})=>s.jsx("div",{className:ie("text-xs",t==="error"?"text-destructive":"text-muted-foreground"),children:e});function ko({status:e}){const t=f5(e);return s.jsx(pe,{variant:t.tone,children:t.label})}function sf({label:e,children:t}){return s.jsx(xt,{role:"group","aria-label":e,tabIndex:0,className:"overflow-x-auto outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:t})}function y5({rows:e}){return s.jsx(sf,{label:"Workspaces",children:s.jsxs(Ke,{containerClassName:"overflow-visible",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Workspace"}),s.jsx(X,{children:"Actor"}),s.jsx(X,{children:"Forked from"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Projection"})]})}),s.jsx(Xe,{children:e.map(t=>s.jsxs(he,{"data-testid":"workspaces-row",children:[s.jsxs(K,{children:[s.jsx("div",{className:"font-mono font-medium",children:t.short_id}),s.jsx(Ju,{children:t.current?`${t.path} · This checkout`:t.path}),t.projection==="unreadable"&&t.projection_error&&s.jsx(Ju,{children:t.projection_error})]}),s.jsx(K,{children:lS[t.actor]}),s.jsx(K,{children:t.source_id?s.jsx("span",{className:"font-mono",children:$a(t.source_id)}):s.jsx("span",{className:"text-muted-foreground",children:"No source"})}),s.jsx(K,{children:s.jsx(ko,{status:t.status})}),s.jsx(K,{children:s.jsx(ko,{status:t.projection})})]},t.id))})]})})}function j5({authority:e}){const t=e.resolver,n=[["Workspace",s.jsx("span",{className:"font-mono",children:$a(e.workspace_id)},"id")],["Actor",lS[e.actor]],["Own head","Writes it"]];return e.source_head==="handoff_only"&&n.push(["Source head","Only through a Handoff"]),n.push(["Git refs","Read only"]),n.push(["Remotes",e.remotes>0?`${e.remotes} named ${e.remotes===1?"remote":"remotes"}`:s.jsx("span",{className:"text-muted-foreground",children:"None"},"none")]),n.push(["Push to remotes",e.push==="human_only"?"Only a person":"Not allowed"]),n.push(["Resolver",t.state==="not_configured"?s.jsx("span",{className:"text-muted-foreground",children:"Not configured"},"resolver"):s.jsx(ko,{status:t.state==="ready"?"ready":"needs_attention"},"resolver")]),t.state==="needs_attention"&&t.issue&&n.push(["Resolver issue",t.issue]),s.jsx(sf,{label:"Authority and resolver",children:s.jsx(Ke,{containerClassName:"overflow-visible",children:s.jsx(Xe,{children:n.map(([a,r])=>s.jsxs(he,{children:[s.jsx(X,{scope:"row",className:"text-muted-foreground font-normal",children:a}),s.jsx(K,{children:r})]},a))})})})}function b5(e){const t=[e.merge_attempts?Pm(e.merge_attempts,"merge attempt"):null,e.resolver_attempts?Pm(e.resolver_attempts,"resolver attempt"):null].filter(Boolean);if(t.length)return t.join(" · ");const n=e.kind==="reconciliation"?"No resolver attempts":"No merge attempts yet";return s.jsx("span",{className:"text-muted-foreground",children:n})}function w5({rows:e}){return s.jsx(sf,{label:"Integration activity",children:s.jsxs(Ke,{containerClassName:"overflow-visible",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"Change"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Attempts"}),s.jsx(X,{children:"Updated"})]})}),s.jsx(Xe,{children:e.map((t,n)=>s.jsxs(he,{children:[s.jsxs(K,{children:[s.jsx("div",{className:"font-medium",children:t.kind==="integration"?`Integrate ${$a(t.child_id)} into ${$a(t.other_id)}`:`Reconcile ${$a(t.child_id)} from ${$a(t.other_id)}`}),s.jsx(Ju,{children:t.kind==="integration"?"Integration":"Source reconciliation"})]}),s.jsx(K,{children:s.jsx(ko,{status:t.status})}),s.jsx(K,{children:b5(t)}),s.jsx(K,{children:Zk(t.updated_at)})]},`${t.kind}-${t.child_id}-${t.other_id}-${t.updated_at}-${n}`))})]})})}function _5({rows:e}){return s.jsx(sf,{label:"Handoffs",children:s.jsxs(Ke,{containerClassName:"overflow-visible",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{children:"From"}),s.jsx(X,{children:"To"}),s.jsx(X,{children:"Status"}),s.jsx(X,{children:"Pinned"})]})}),s.jsx(Xe,{children:e.map(t=>s.jsxs(he,{children:[s.jsxs(K,{children:[s.jsx("div",{className:"font-mono font-medium",children:$a(t.child_id)}),t.error?s.jsx(Ju,{children:t.error}):null]}),s.jsx(K,{className:"font-mono",children:$a(t.source_id)}),s.jsx(K,{children:s.jsx(ko,{status:t.status})}),s.jsx(K,{children:`${t.child_commit} onto ${t.source_commit}`})]},t.id))})]})})}const Py="This machine's worktrees of this repository.",N5="Merge sends one whose thread is at rest to the main queue.",k5=3e4,S5=3e3,C5=6e5,hh=[{id:"all",label:"All",empty:"worktree"},{id:"needs",label:"Needs landing",empty:"worktree needing landing"},{id:"orphan",label:"No thread to land it",empty:"worktree with no thread to land it"},{id:"queued",label:"In a queue",empty:"queued worktree"},{id:"landed",label:"Landed",empty:"landed worktree"},{id:"decide",label:"Yours to decide",empty:"worktree yours to decide"}],wi={not_landed:{label:"Not landed",tone:"neutral"},main:{label:"On main",tone:"success"},production:{label:"In production",tone:"success"},queued:{label:"Main queue",tone:"info"},needs_you:{label:"Needs you",tone:"warning"}},R5="no thread to land it",ig="its thread waits on you",oS="its thread is done",cS="its thread is retired",og=e=>e.archivable&&e.cleanup==="user",E5=e=>e.queue!==null||e.merge.offered===!1&&e.merge.why==="already in a promotion queue",T5=e=>!e.merge.offered&&(e.merge.why===oS||e.merge.why.startsWith(cS)),cg=e=>!e.merge.offered&&e.merge.why===R5||T5(e),mh=(e,t)=>t==="all"?!0:t==="decide"?og(e):(e.landed!==null?"landed":E5(e)?"queued":cg(e)?"orphan":"needs")===t,A5=e=>e.landed!==null?e.threads.some(t=>t.phase!=="done"):e.threads.length>0&&!cg(e);function su(e){return e>=1e9?`${(e/1e9).toFixed(1)} GB`:e>=1e6?`${Math.round(e/1e6)} MB`:`${Math.max(1,Math.round(e/1e3))} KB`}function uS(e){const t=e%100,n=t>=11&&t<=13?"th":{1:"st",2:"nd",3:"rd"}[e%10]??"th";return`${e}${n}`}function M5(e){if(e===null)return"No commits";if(e<1)return"Today";const t=Math.floor(e);return t===1?"1 day ago":`${t} days ago`}const ph=e=>_s(new Date(e*1e3).toISOString()),Mi=e=>e.charAt(0).toUpperCase()+e.slice(1);function $5(e,t){var r;const n=t.phase?Mi(t.phase):"No phase",a=e.merge;if(!a.offered&&a.why.startsWith(cS)){const l=(r=/; (.+) continues it$/.exec(a.why))==null?void 0:r[1];return l?`Retired · continued by ${l}`:"Retired"}return t.phase==="done"||!a.offered&&a.why===oS?e.landed===null?"Done · without landing this":"Done":a.offered?`${n} · at rest`:a.why.startsWith("its thread is at work")?`${n} · at work`:a.why===ig?`${n} · waits on you`:a.why.startsWith("its session is not running")?`${n} · session not running`:n}function O5(){const e=Nn().worktrees;if(!e)throw new Error("The Worktrees page rendered without the worktrees seam.");return e}function D5({org:e}){var $,P;const t=O5(),[n,a]=u.useState(null),[r,l]=u.useState(null),[i,o]=u.useState(null),[c,d]=u.useState(!1),[f,m]=u.useState("all"),[h,x]=u.useState(""),[j,v]=u.useState({}),y=u.useRef({}),{confirm:g,confirm_dialog:p}=Ql(),b=u.useRef(!1),w=u.useCallback(async()=>{if(b.current)return;b.current=!0;const E=await t.list();b.current=!1,E.ok?(a(E.data),l(null)):l(E.refusal)},[t]),N=u.useCallback(async()=>{const E=await t.sizes();d(!E.ok),E.ok&&o(E.data)},[t]);u.useEffect(()=>{w(),N()},[w,N]);const C=(n==null?void 0:n.rows.some(E=>{var I,F;return((I=E.write)==null?void 0:I.state)==="waiting"||((F=E.write)==null?void 0:F.state)==="running"}))??!1;Cr(()=>void w(),C?S5:k5),Cr(()=>void N(),C5);const _=(n==null?void 0:n.rows)??[],S=E=>i==null?void 0:i.sizes[E.path],D=_.filter(og),O=i?D.reduce((E,I)=>E+(S(I)??0),0):null,B=_.length===0?Py:`${Py} ${N5}${D.length?` ${D.length} ${D.length===1?"is":"are"} yours to decide${O!==null?`: removing them frees about ${su(O)}`:""}.`:""}`,Y=h.trim().toLowerCase(),H=E=>!Y||[E.name,E.path,E.branch??"",...E.threads.map(I=>I.title??I.thread)].some(I=>I.toLowerCase().includes(Y)),M=_.filter(E=>mh(E,f)&&H(E)).sort((E,I)=>{if(f==="decide")return(S(I)??0)-(S(E)??0);const F=Q=>A5(Q)?Q.merge.offered?0:1:2;return F(E)-F(I)||(E.idle_days??1/0)-(I.idle_days??1/0)}),A=async(E,I)=>{const F=await(E==="merge"?t.merge(I.path):t.remove(I.path));F.ok?v(({[I.path]:Q,...oe})=>oe):v(Q=>({...Q,[I.path]:F.refusal.message})),await w()},R=async E=>{if(!E.merge.offered)return;const I=E.threads.find(J=>J.thread===(E.merge.offered&&E.merge.thread)),F=(I==null?void 0:I.title)??E.merge.thread,Q=I!=null&&I.holds.length?`has ${I.holds.length} open hold(s) (${I.holds.join(", ")})`:"has no open holds",oe=E.merge.lands.by==="manager"?`on its turn the queue's merge manager, ${E.merge.lands.manager}, lands it on main`:"on its turn that thread lands it on main",ge=E.merge.caveat?`
|
|
401
|
+
|
|
402
|
+
Its session could not be read: ${E.merge.caveat}. A turn it does not start passes on.`:"";await g({title:`Send ${E.name} to the main queue`,description:`This joins the main promotion queue for its thread, ${F}, which ${Q} and is told of the join. The queue checks the branch first, and ${oe}. Nothing reaches main before then.${ge}`,action_label:"Join the main queue"})&&await A("merge",E)},T=async E=>{const I=S(E);await g({title:`Remove ${E.name}?`,description:`This deletes the folder ${E.path}${I!==void 0?` and frees about ${su(I)}`:""}.${E.branch?` Its branch ${E.branch} stays, so its work can be checked out again,`:""} and its task records are saved first; a landed plan workspace in it is closed. It stays with you because ${E.cleanup_why[0]??"the Local systems manager leaves it to you"}. The worktree is checked again just before, and nothing is deleted if that check finds work in it.`,action_label:"Remove worktree",destructive:!0})&&(I!==void 0&&(y.current[E.path]=I),await A("remove",E))},k=async E=>{await t.dismiss(E),await w()};return(r==null?void 0:r.reason)==="engine_missing"?s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(ha,{page:"Worktrees"})}):s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(mn,{title:"Worktrees",description:B}),!n&&!r&&s.jsx(z5,{}),r?s.jsx(L5,{refusal:r,read_at:n==null?void 0:n.read_at,on_retry:()=>void w()}):null,n!=null&&n.stale?s.jsxs(me,{variant:"destructive",className:"mt-4",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read worktrees"}),s.jsxs(xe,{children:[s.jsxs("p",{children:[n.stale.message," This list was read at ",_s(new Date(n.read_at).toISOString()),"."]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void w(),children:"Retry"})]})]}):null,n==null?void 0:n.removals.map(E=>s.jsxs(me,{variant:"success",className:"mt-4",role:"status",children:[s.jsx(Ne,{children:y.current[E.path]!==void 0?`Removed ${E.name} and freed ${su(y.current[E.path])}`:`Removed ${E.name}`}),s.jsxs(xe,{children:[s.jsx("p",{children:E.branch?`Its branch ${E.branch} stays, and its records were saved.`:"Its records were saved."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void k({removal:E.path}),children:"Dismiss"})]})]},E.path)),n&&_.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(u0,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Only the main checkout"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"No other worktrees. Agents make theirs in .sdlc-worktrees beside the main checkout."})]}):n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[s.jsx(Et,{type:"search",className:"w-64","aria-label":"Search worktrees",placeholder:"Search worktrees",value:h,onChange:E=>x(E.target.value)}),s.jsxs("p",{className:"text-muted-foreground ml-auto text-xs",children:["Read at ",_s(new Date(n.read_at).toISOString())," · rereads every 30 s"]})]}),s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Worktree state",children:hh.map(E=>s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:jl,"aria-pressed":f===E.id,onClick:()=>m(E.id),children:[E.label," ",_.filter(I=>mh(I,E.id)).length]},E.id))}),M.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Nd,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No worktrees match"}),Y?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",($=hh.find(E=>E.id===f))==null?void 0:$.empty," matches “",h,"”. Clear the search to see all"," ",_.filter(E=>mh(E,f)).length,"."]}),s.jsx(q,{type:"button",variant:"outline",onClick:()=>x(""),children:"Clear search"})]}):s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(P=hh.find(E=>E.id===f))==null?void 0:P.empty," right now."]})]}):s.jsx(xt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ke,{containerAriaLabel:"Worktrees",className:"table-fixed",children:[s.jsx(nt,{children:s.jsxs(he,{children:[s.jsx(X,{className:"w-[24%]",children:"Worktree"}),s.jsx(X,{className:"w-[24%]",children:"Threads"}),s.jsx(X,{className:"w-[12%]",children:"Landed"}),s.jsx(X,{className:"w-[18%]",children:"Cleanup"}),s.jsx(X,{className:"hidden w-[10%] md:table-cell",children:"Last commit"}),s.jsx(X,{className:"w-[12%] text-right",children:"Actions"})]})}),s.jsx(Xe,{children:M.map(E=>s.jsx(U5,{org:e,row:E,size:S(E),sizes:i!==null?"read":c?"failed":"measuring",can_write:n.can_write,sent:j[E.path],on_merge:()=>void R(E),on_remove:()=>void T(E),on_dismiss:I=>void k(I),on_clear_sent:()=>v(({[E.path]:I,...F})=>F)},E.path))})]})})]}):null,p]})}function z5(){return s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading worktrees",children:Array.from({length:6},(e,t)=>s.jsx(Rt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function L5({refusal:e,read_at:t,on_retry:n}){const a=us();return e.reason==="view_outdated"?s.jsxs(me,{variant:"warning",className:"mt-6",children:[s.jsx(ln,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:Fl}),s.jsx(xe,{children:a})]}):s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read worktrees"}),s.jsxs(xe,{children:[s.jsxs("p",{children:[e.message,t?` This list was read at ${_s(new Date(t).toISOString())}.`:""]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function Oc({children:e,muted:t=!0}){return s.jsx("div",{className:ie("truncate text-xs",t&&"text-muted-foreground"),title:e,children:e})}function U5({org:e,row:t,size:n,sizes:a,can_write:r,sent:l,on_merge:i,on_remove:o,on_dismiss:c,on_clear_sent:d}){const{href:f,Link:m}=Ze(),h=e?`/org/${encodeURIComponent(e)}`:"",x=f(`${h}/threads`),j=f(`${h}/tasks`),v=wi[t.landed??"not_landed"],y=og(t),g=t.write,p=(g==null?void 0:g.state)==="waiting"||(g==null?void 0:g.state)==="running",b=t.threads.find(B=>"thread"in t.merge&&B.thread===t.merge.thread)??t.threads[0],w=t.merge,N=!w.offered&&w.why===ig,C=r&&t.landed===null&&!t.queue&&!N&&!cg(t),_=n!==void 0?su(n):a==="measuring"?"Measuring size…":a==="failed"?"Size could not be read":null,S=y?{label:"Yours to decide",muted:!1,second:[_,t.cleanup_why[0]]}:t.archivable?{label:"The manager removes it",muted:!1,second:[_]}:{label:"Stays",muted:!0,second:[_,t.why[0]??null]},D=S.second.filter(Boolean).join(" · "),O=t.path.slice(0,t.path.length-t.name.length-1)||".";return s.jsxs(s.Fragment,{children:[s.jsxs(he,{"data-testid":"worktrees-row",children:[s.jsxs(K,{children:[s.jsx("div",{className:"truncate font-medium",title:t.name,children:t.name}),s.jsx(Oc,{children:t.branch??"Detached"}),O!==".sdlc-worktrees"?s.jsx(Oc,{children:`in ${O}`}):null]}),s.jsx(K,{children:b?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"truncate",title:b.title??b.thread,children:b.title??b.thread}),s.jsx(Oc,{children:`${$5(t,b)}${t.threads.length>1?` · ${t.threads.length-1} more`:""}`})]}):s.jsx("span",{className:"text-muted-foreground",children:"No thread"})}),s.jsx(K,{children:s.jsx(pe,{variant:v.tone,children:v.label})}),s.jsxs(K,{children:[s.jsx("div",{className:ie("truncate",S.muted&&"text-muted-foreground"),children:S.label}),D?s.jsx("div",{className:"hidden md:block",children:s.jsx(Oc,{children:D})}):null]}),s.jsx(K,{className:"hidden md:table-cell",children:M5(t.idle_days)}),s.jsx(K,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[p?s.jsx(q,{type:"button",variant:"outline",size:"sm",loading:!0,disabled:!0,children:(g==null?void 0:g.kind)==="merge"?g.state==="waiting"?"Waiting to join…":"Joining main…":(g==null?void 0:g.state)==="waiting"?"Waiting to remove…":"Removing…"}):t.queue?s.jsx(pe,{variant:wi.queued.tone,children:`${wi.queued.label} · ${uS(t.queue.position)}`}):N?s.jsx(m,{href:j,"aria-label":`${t.name}: its thread waits on you, in Waiting on you`,children:s.jsx(pe,{variant:wi.needs_you.tone,children:wi.needs_you.label})}):C?s.jsx(q,{type:"button",variant:"outline",size:"sm",title:w.offered?void 0:w.why,"aria-disabled":!w.offered||void 0,className:ie(!w.offered&&"cursor-not-allowed opacity-50"),"aria-label":`Send ${t.name} to the main queue`,"aria-describedby":w.offered?void 0:`why-${t.name}`,onClick:w.offered?i:void 0,children:"Merge"}):null,y&&r&&!p?s.jsx(q,{type:"button",variant:"outline",size:"sm","aria-label":`Remove ${t.name}`,onClick:o,children:"Remove"}):null]})})]}),s.jsx(B5,{row:t,threads:x,tasks:j,merge_shown:C,sent:l,on_dismiss:c,on_clear_sent:d})]})}function B5({row:e,threads:t,tasks:n,merge_shown:a,sent:r,on_dismiss:l,on_clear_sent:i}){var j,v,y,g;const{Link:o}=Ze(),c=(p="Open in Threads")=>s.jsx(o,{className:"text-primary text-sm hover:underline",href:t,children:p}),d=p=>s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:p,children:"Dismiss"}),f=e.write,m=e.threads.find(p=>p.thread===("thread"in e.merge?e.merge.thread:void 0))??e.threads[0],h=(m==null?void 0:m.title)??"Its thread";let x=null;if(r)x=s.jsxs(me,{variant:"destructive",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"It was not sent"}),s.jsxs(xe,{children:[s.jsx("p",{children:r}),d(i)]})]});else if((f==null?void 0:f.state)==="waiting")x=s.jsxs("p",{className:"text-muted-foreground text-sm",role:"status",children:["Another worktree's write runs first; ",e.name," ",f.kind==="merge"?"joins":"is removed"," next."]});else if((f==null?void 0:f.state)==="running")x=s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:f.kind==="merge"?`Joining the main queue for ${e.name}. The queue checks its branch first; this can take a few minutes.`:`Removing ${e.name}. It is checked again first.`});else if((f==null?void 0:f.state)==="joined"){const p=((j=f.lands)==null?void 0:j.by)==="manager"?`the merge manager, ${f.lands.manager}, lands it`:"it lands it on its turn";x=s.jsxs(me,{variant:f.told?"success":"warning",role:"status",children:[s.jsx(Ne,{children:`${e.name} joined the main queue, ${uS(f.position)}`}),s.jsxs(xe,{children:[s.jsx("p",{children:f.told?`${h} was left a notice, and ${p}.`:"Its thread could not be told, so it does not know its turn is coming. Tell it from Threads; the join itself is unchanged."}),((v=e.queue)==null?void 0:v.position)===1&&e.queue.turn==="next"&&e.queue.passes_at?s.jsx("p",{children:`It is first in the main queue. Its thread was left a notice but not woken: continue it in its session, or the turn passes on at ${ph(e.queue.passes_at)}.`}):null,s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),!f.told||((y=e.queue)==null?void 0:y.position)===1?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(f&&(f.state==="refused"||f.state==="failed")){const p=f.kind==="merge"?`The main queue refused ${e.name}`:`${e.name} was not removed`;x=s.jsxs(me,{variant:"destructive",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:f.kind==="merge"&&f.state==="failed"?`${e.name} did not join`:p}),s.jsxs(xe,{children:[s.jsx("p",{children:`${Mi(f.message)}${f.kind==="merge"?" Nothing was queued.":" Nothing was deleted."}`}),s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),f.kind==="merge"?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(e.last_turn){const p=e.last_turn;x=s.jsxs(me,{variant:"warning",children:[s.jsx(lt,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:`${e.name}'s turn ${p.outcome==="failed"?"failed":"passed on"} at ${ph(p.left_at)}`}),s.jsxs(xe,{children:[s.jsx("p",{children:`${Mi(p.reason)}. Continue the thread in its session; Merge sends it again once it is at rest.`}),s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({turn:{execution:p.execution,left_at:p.left_at}})),s.jsx("span",{className:"mt-2",children:c()})]})]})]})}else((g=e.queue)==null?void 0:g.position)===1&&e.queue.turn==="next"&&e.queue.passes_at?x=s.jsxs("p",{className:"text-sm",role:"status",children:[`Its turn now: ${e.name} is first in the main queue. Continue its thread in its session, or the turn passes on at ${ph(e.queue.passes_at)}. `,c()]}):!e.merge.offered&&e.merge.why===ig?x=s.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:["Its thread waits on you. Merge comes back once you answer it. ",s.jsx(o,{className:"text-primary hover:underline",href:n,children:"In Waiting on you"})]}):!e.merge.offered&&e.merge.successor&&!e.queue&&e.landed===null?x=s.jsx("p",{className:"text-sm",children:c("Open its successor in Threads")}):a&&!e.merge.offered?x=s.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:[`${Mi(e.merge.why)}. `,e.merge.thread&&!e.merge.why.startsWith("its thread is at work")?c():null]}):e.merge.offered&&e.merge.caveat&&(x=s.jsx("p",{className:"text-muted-foreground text-sm",children:`${Mi(e.merge.caveat)}.`}));return x?s.jsx(he,{className:"hover:bg-transparent",children:s.jsx(K,{colSpan:6,className:"pt-0",children:x})}):null}const H5=["reason","since","store","repository","folder","home","member_path"];function dS(e,t){const n={status:e,message:typeof(t==null?void 0:t.error)=="string"?t.error:"The read failed; see the sdlc viewer terminal."};(t==null?void 0:t.retry)===!0&&(n.retry=!0),typeof(t==null?void 0:t.retry_after)=="number"&&(n.retry_after=t.retry_after),typeof(t==null?void 0:t.seedable)=="boolean"&&(n.seedable=t.seedable);for(const a of H5){const r=t==null?void 0:t[a];typeof r=="string"&&(n[a]=r)}return n}function Lr({base:e="",fetcher:t=fetch}){return async(n,a={})=>{const r=new URLSearchParams;for(const[c,d]of Object.entries(a))if(Array.isArray(d))for(const f of d)r.append(c,f);else d!==void 0&&d!==!1&&d!==""&&r.set(c,String(d));const l=r.size>0?`?${r.toString()}`:"";let i;try{i=await t(`${e}api/app/${n}${l}`,{cache:"no-store"})}catch{return{ok:!1,refusal:{status:0,message:"The viewer did not answer. Is sdlc viewer still running?"}}}const o=await i.json().catch(()=>null);return i.ok?{ok:!0,data:o}:{ok:!1,refusal:dS(i.status,o)}}}function I5(e={}){const t=Lr(e),n=af(e),a=l=>async()=>{const i=await t("access");return i.ok?{ok:!0,data:i.data[l]}:i},r=encodeURIComponent;return{tasks:{access:a("tasks"),configuration:()=>t("tasks/configuration"),listTasks:l=>t(`tasks/lists/${r(l)}/tasks`),task:l=>t(`tasks/tasks/${r(l)}`)},issues:{access:a("issues"),list:(l={})=>t("issues",l),issue:l=>t(`issues/${r(l)}`),issueSections:l=>t(`issues/${r(l)}/sections`),issueRelated:l=>t(`issues/${r(l)}/related`),openAnchor:l=>n("open-anchor",l)},releases:{access:a("releases"),list:()=>t("releases"),release:l=>t(`releases/${r(l)}`),candidate:()=>t("releases/candidate")},organizations:{access:a("organizations"),list:()=>t("orgs")},projects:{access:a("projects"),list:()=>t("projects")},about:{about:()=>t("about")}}}function P5(e={}){const t=Lr(e);return{listQueues:()=>t("queues"),queue:n=>t(`queues/${encodeURIComponent(n)}`),members:async()=>({ok:!0,data:[]}),refresh_ms:15e3,settings_note:"Local queue settings are the engine's built-in policies. Turns change through promote.",thread_subjects:!0,description:"Where this checkout's threads take turns: landing on main, deploying to staging, publishing and accepting the graph.",read_scope:"this checkout only",subject_label:"Thread"}}const $i=e=>({ok:!1,refusal:{status:0,message:e}});function af({base:e="",fetcher:t=fetch}){return async(n,a)=>{let r;try{r=await t(`${e}api/${n}`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch{return $i("The viewer did not answer. Is sdlc viewer still running?")}const l=await r.json().catch(()=>null);return r.ok?{ok:!0,data:l}:{ok:!1,refusal:dS(r.status,l)}}}function q5(e={}){const t=Lr(e),n=af(e);return{chart:()=>t("org"),change:a=>n("org-change",a)}}function G5(e={}){const t=Lr(e),n=o=>`tasks/tasks/${encodeURIComponent(o)}`,{base:a="",fetcher:r=fetch}=e;return{access:async()=>{const o=await t("access");return o.ok?{ok:!0,data:o.data.tasks}:o},availability:async()=>{const o=await t("tasks/configuration");if(!o.ok)return o.refusal.reason==="engine_missing"?{state:"off",refusal:o.refusal}:{state:"error",refusal:o.refusal};const c=o.data;if(c.state!=="active")return{state:"available"};const d=c.workspaces.find(m=>m.is_default)??c.workspaces[0],f=d==null?void 0:d.lists[0];return!d||!f?{state:"error"}:{state:"active",configuration:c,workspace:d,list:f}},listTasks:(o,c={})=>{var d,f,m;return c.state==="archived"?Promise.resolve($i("This checkout keeps no archived tasks.")):c.assigned_to_me?Promise.resolve($i("Assigned to you is a status group here.")):t(`tasks/lists/${encodeURIComponent(o)}/tasks`,{search:c.search,owner:c.owner===""?"none":c.owner,group:c.group,urgent:c.urgent?"true":void 0,over_estimate:c.over_estimate?"true":void 0,opened:(d=c.opened_groups)!=null&&d.length?c.opened_groups.join(","):void 0,closed:(f=c.closed_groups)!=null&&f.length?c.closed_groups.join(","):void 0,all:(m=c.all_groups)!=null&&m.length?c.all_groups.join(","):void 0})},members:()=>t("tasks/members"),waitingOnYou:()=>t("tasks/waiting-on-you"),task:o=>t(n(o)),taskSections:o=>t(`${n(o)}/sections`),taskRelated:o=>t(`${n(o)}/related`),hierarchyRevision:async()=>({ok:!0,data:0}),commands:{run:async()=>$i("The local viewer changes tasks only with Done."),complete:async o=>{const c="task"in o?{task:o.task}:{hold:o.hold};let d;try{d=await r(`${a}api/task-done`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}catch{return $i("The viewer did not answer. Is sdlc viewer still running?")}if(d.ok)return{ok:!0,data:null};const f=await d.text().catch(()=>"");return{ok:!1,refusal:{status:d.status,message:f||`It was not recorded (HTTP ${d.status}).`}}}}}}function V5(e={}){const t=Lr(e),n=af(e),a=encodeURIComponent,r=l=>l!=null&&l.fresh?{fresh:1}:{};return{access:async()=>{const l=await t("access");return l.ok?{ok:!0,data:l.data.releases}:l},list:(l={})=>t("releases",r(l)),release:(l,i)=>t(`releases/${a(l)}`,r(i)),candidate:l=>t("releases/candidate",r(l)),candidateBatch:l=>t("releases/candidate/batch",r(l)),related:(l,i)=>t(`releases/${a(l)}/related`,r(i)),plannedRelease:(l,i)=>t(`releases/planned/${a(l)}`,r(i)),roadmap:l=>t("releases/roadmap",{...r(l),...l!=null&&l.mine?{mine:1}:{}}),roadmapMoved:l=>t("releases/roadmap/moved",r(l)),roadmapSeen:l=>n("roadmap/seen",{at:l})}}function Y5(e={}){const t=Lr(e),n=af(e);return{list:()=>t("worktrees"),sizes:()=>t("worktree-sizes"),merge:a=>n("worktree-merge",{path:a}),remove:a=>n("worktree-remove",{path:a}),dismiss:a=>n("worktree-dismiss",a)}}function F5(e={}){const t=Lr(e);return{overview:()=>t("workspaces")}}const K5=new Set(["not_terminal","another_process","continued","no_open","pending"]);function X5(e){return e==="terminal_denied"?"you":K5.has(e)?"muted":"alert"}function Q5(e){return e.replace(/\.*$/,".")}function qy(e){return e.commands?{...e,commands:{...e.commands,open_thread:(t,n)=>W5(t,n)}}:e}async function W5(e,t,n=aS){let a=!1;for(;;){const r=await n(e,a);if("done"in r)return{opened:!0};const{reason:l,error:i,where:o}=r.refused;if(l==="closed"&&!a){if(!await t(o))return{declined:!0};a=!0;continue}return{note:{text:Q5(i),role:X5(l),...l==="outdated"?{outdated:!0}:{}}}}}const fS=[["stage","Stage"],["blocker","Blocker"],["recent","Recent"]],Z5=10,hS="Threads you pinned; they stay first in every order";function qm(e,t,n){var Y,H;const{order:a,folded:r,showAll:l,narrowed:i,max:o=Z5}=n,c=new Map(e.map(M=>[M.key,M])),d=M=>M.pinned===!0,f=M=>{var R;if(d(M)||!M.blockedBy||!c.has(M.blockedBy))return!1;const A=new Set([M.key]);for(let T=M.blockedBy;T&&c.has(T);T=(R=c.get(T))==null?void 0:R.blockedBy){if(A.has(T))return!1;A.add(T)}return!0},m=new Map;for(const M of e){if(!f(M))continue;const A=m.get(M.blockedBy)??[];A.push(M),m.set(M.blockedBy,A)}const h=M=>m.get(M.key)??[],x=M=>Math.max(M.mtimeMs??0,...h(M).map(x)),j=M=>!!M.needsYou||h(M).some(j),v=M=>M.activeSince!==void 0,y=(M,A)=>v(M)!==v(A)?v(M)?-1:1:j(M)!==j(A)?j(M)?-1:1:v(M)?M.activeSince-A.activeSince||M.key.localeCompare(A.key):x(A)-x(M),g=(M,A)=>Number(v(A))-Number(v(M))||(v(M)?A.activeSince-M.activeSince:(A.mtimeMs??0)-(M.mtimeMs??0))||M.key.localeCompare(A.key),p=l||i,b=!i,w=(M,A=0)=>a==="blocker"?[{row:M,depth:A},...h(M).flatMap(R=>w(R,A+1))]:[{row:M,depth:0}],N=M=>a==="blocker"?1+h(M).reduce((A,R)=>A+N(R),0):1,C=M=>M.reduce((A,R)=>A+N(R),0),_=(M,A,R,T,k,$)=>{const P=!k||!r.has(M);return{key:M,label:A,...$?{hint:$}:{},count:T,folds:k,open:P,rows:P?R.flatMap(E=>w(E)):[]}},S=e.filter(d),D=e.filter(M=>!d(M)),O=[];S.length&&O.push(_("pinned","Pinned",S,C(S),b,hS));let B=null;if(a==="stage"){const M=new Set(t.map(([T])=>T)),A=new Map(t.map(([T])=>[T,[]]));for(const T of D)(Y=A.get(T.stage&&M.has(T.stage)?T.stage:"none"))==null||Y.push(T);for(const[T,k,$]of t){const P=(A.get(T)??[]).sort(y);if(!P.length)continue;const E=T==="none"&&!p?P.slice(0,o):P;O.push({..._(T,k,E,P.length,b&&T!=="none",$),count:P.length})}const R=((H=A.get("none"))==null?void 0:H.length)??0;!i&&R>o&&(B={total:R,unstaged:!0})}else{const M=a==="recent"?[...D].sort(g):D.filter(A=>!f(A)).sort(y);if(M.length){const A=p?M:M.slice(0,o),R=_("others",S.length?"Other threads":null,A,C(M),!!S.length&&b);O.push(R),!i&&R.open&&M.length>o&&(B={total:M.length,unstaged:!1})}}return{groups:O,more:B}}function J5(e,t,n,a){const l=qm(e,t,{...n,folded:new Set,showAll:!0}).groups.find(c=>c.rows.some(d=>d.row.key===a));if(!l)return null;const o=!qm(e,t,{...n,folded:new Set}).groups.some(c=>c.rows.some(d=>d.row.key===a));return{group:l.key,capped:o}}const e8=15e3,t8=10,Gy="idle-sessions-list",Vy="idle-sessions-heading",Yy="idle-sessions-confirm-text";function mS(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${Math.round(e)} MB`}const n8=e=>`${Number.isInteger(e)?e:e.toFixed(1)} h`,pS=e=>e===1?"1 session":`${e} sessions`;function s8(e){const t=e.released.length?`Closed ${pS(e.released.length)}.`:"Closed no sessions.";return e.kept.length?`${t} Kept ${e.kept.length}:`:t}function a8({row:e}){const t=[e.name,e.retired?"continued in another session":"",`idle ${n8(e.idle_hours)}`,mS(e.memory_mb)].filter(Boolean).join(" · ");return s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:e.title}),s.jsxs("p",{className:"caption",children:[s.jsxs("span",{className:"muted",children:[t,e.unfinished&&" ·"]}),e.unfinished&&s.jsx("span",{className:"idle-unfinished",children:" unfinished work"})]})]})}function r8(){const[e,t]=u.useState(null),[n,a]=u.useState(!1),[r,l]=u.useState(!1),[i,o]=u.useState(null),[c,d]=u.useState(null),[f,m]=u.useState(""),h=u.useRef(""),x=u.useRef(null),j=u.useRef(null),v=u.useRef(null),y=u.useRef(null),g=u.useRef(0),p=u.useRef(0),b=u.useCallback(async()=>{const H=++g.current,M=await t5();if(!M||H<p.current)return;p.current=H,m("");const A=JSON.stringify(M);A!==h.current&&(h.current=A,t(M))},[]);u.useEffect(()=>{const H=setTimeout(b,0),M=setInterval(b,e8);return()=>{clearTimeout(H),clearInterval(M)}},[b]),u.useEffect(()=>{var M;const H=y.current;H&&(y.current=null,(M={cancel:j,close:x,dismiss:v}[H].current)==null||M.focus())});const w=(e==null?void 0:e.sessions.length)??0;if(u.useEffect(()=>{r&&!w&&i===null&&l(!1)},[r,w,i]),!w&&!c&&!f&&i===null)return null;const N=()=>{i===null&&(l(!0),y.current="cancel")},C=()=>{i===null&&(l(!1),y.current="close")},_=async()=>{if(i!==null)return;o(w),d(null),m("");const H=await n5();p.current=g.current+1,await b(),o(null),l(!1),a(!1),"error"in H?(m(`The sessions were not closed: ${H.error.replace(/\.+$/,"")}.`),y.current="close"):(d(H.done),y.current="dismiss")},S=()=>{d(null),y.current="close"},D=H=>{H.key==="Escape"&&(H.preventDefault(),C())},O=i!==null?`Closing ${pS(i)}…`:c?s8(c):"",B=(e==null?void 0:e.sessions.slice(0,t8))??[],Y=w-B.length;return s.jsxs("div",{className:"idle",role:"group",...w?{"aria-labelledby":Vy}:{"aria-label":"Idle sessions"},children:[f&&s.jsx("div",{className:"alert",role:"alert",children:f}),w>0&&e&&s.jsxs("div",{className:"idle-head",children:[s.jsxs("div",{className:"idle-title",children:[s.jsxs("h2",{className:"group",id:Vy,"aria-label":`Idle sessions, ${w}`,children:["Idle sessions",s.jsx("span",{className:"count",children:w})]}),s.jsxs("p",{className:"caption muted",children:["over ",e.idle_over," h · ",mS(e.memory_mb)]})]}),s.jsxs("div",{className:"tools",children:[s.jsx("button",{type:"button",className:"pin","aria-expanded":n,"aria-controls":Gy,"aria-label":n?"Hide the idle sessions list":"Show the idle sessions list",onClick:()=>a(H=>!H),children:n?"Hide":"Show"}),s.jsx("button",{type:"button",className:"pin",ref:x,"aria-expanded":r,"aria-label":"Close idle sessions…",onClick:N,children:"Close idle…"})]})]}),w>0&&s.jsxs("ul",{className:"idle-list",id:Gy,hidden:!n,"aria-label":`Sessions idle over ${e==null?void 0:e.idle_over} hours, longest idle first`,children:[B.map(H=>s.jsx(a8,{row:H},H.session)),Y>0&&s.jsx("li",{children:s.jsxs("p",{className:"caption muted",children:["…and ",Y," more"]})})]}),r&&w>0&&s.jsxs("div",{className:"idle-confirm",role:"group","aria-label":"Close idle sessions","aria-describedby":Yy,onKeyDown:D,children:[s.jsxs("p",{id:Yy,children:[w===1?"Close this session?":`Close these ${w} sessions?`," Each transcript stays, so reopening a conversation resumes it, and a thread with unfinished work goes on with Continue on its card. A session that is busy or has background work running is kept."]}),s.jsxs("div",{className:"tools start",children:[s.jsx("button",{type:"button",className:"pin","aria-disabled":i!==null?!0:void 0,"aria-busy":i!==null?!0:void 0,onClick:_,children:i!==null?`Closing ${i}…`:`Close ${w}`}),s.jsx("button",{type:"button",className:"pin",ref:j,"aria-disabled":i!==null?!0:void 0,onClick:C,children:"Cancel"})]})]}),s.jsx("p",{className:"idle-status",role:"status",children:O}),c&&s.jsxs(s.Fragment,{children:[c.kept.length>0&&s.jsx("ul",{className:"idle-list","aria-label":"Kept sessions",children:c.kept.map(H=>s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:H.title}),s.jsx("p",{className:"caption muted",children:H.why})]},H.session))}),s.jsx("div",{className:"tools start",children:s.jsx("button",{type:"button",className:"pin",ref:v,"aria-label":"Dismiss the close result",onClick:S,children:"Dismiss"})})]})]})}const Fy={ok:"lime",you:"amber",alert:"red",waiting:"blue",blocked:"purple",muted:"grey",plain:"grey"};function ii(e){return e&&Object.hasOwn(Fy,e)?Fy[e]:"grey"}const l8=1e4,i8=6e4,o8=2,xh="#thread-",c8=["pin","details-toggle","holds-toggle"],u8=p0("Threads"),d8={working:"▶",prod:"↑",planned:"○"},Ky=3,Dc=2,Xy=["working","ready","prod","waiting","blocked","paused","planned"],f8={ready:"results ready",prod:"ready for prod"};function h8(e){const t=Xy.map(a=>[a,e.filter(r=>r.state===a).length]),n=[...new Set(e.map(a=>a.state).filter(a=>!Xy.includes(a)))].map(a=>[a,e.filter(r=>r.state===a).length]);return[...t,...n].filter(([,a])=>a>0).map(([a,r])=>`${r} ${f8[a]??a}`).join(" · ")}const m8={Terminal:"Opening in Terminal · if macOS asks whether sdlc viewer may control Terminal, allow it.","VS Code":"Opening in VS Code, in the window on this thread's folder.","Claude app":"Opening in the Claude app."};function p8(e){return e.agent!=="Claude"?null:e.where==="VS Code"?"Open in VS Code":e.where==="Claude app"?e.open?"Open in Claude app":null:e.where==="Terminal"?"Open in Terminal":null}const Gm=[["running","Running"],["you","Needs you"],["blocked","Blocked"],["paused","Paused"],["idle","Idle"]],Vm=[["claude","Claude"],["codex","Codex"]],Qy={paused:"Parked on purpose (status paused); waiting on nothing",idle:"Not running, not asking for you, not blocked, and not paused; includes done and ready for production, and threads in line in a promotion queue"},Wy=e=>e.kind??"idle",Zy=e=>e.agent==="Codex"?"codex":"claude";function Jy(e,t,n,a){const r=n.toLowerCase().split(/\s+/).filter(Boolean),l=Gm.map(([v])=>v).filter(v=>a.has(v)),i=Vm.map(([v])=>v).filter(v=>a.has(v)),o=v=>!l.length||l.includes(Wy(v)),c=v=>!i.length||i.includes(Zy(v)),d=v=>{if(!r.length)return!0;const y=v.search??v.title.toLowerCase();return r.every(g=>y.includes(g))},f=e.filter(d),m={};for(const[v]of Gm)m[v]=f.filter(y=>c(y)&&Wy(y)===v).length;for(const[v]of Vm)m[v]=f.filter(y=>o(y)&&Zy(y)===v).length;const h=[],x=[],j=[];return e.forEach((v,y)=>{j.length=Math.min(j.length,v.depth);const g=v.depth>0?j[v.depth-1]??null:null,p=d(v)&&o(v)&&c(v);let b=null;p&&(b=g?{depth:g.depth+1,pinned:g.pinned}:{depth:0,pinned:y<t&&v.pinned!==!1},(b.pinned?h:x).push({row:v,depth:b.depth})),j.push(b)}),{rows:[...h,...x],pinned:h.length,counts:m,narrowed:r.length+l.length+i.length>0}}const xS="sdlc-viewer:threads-arrange",ej={order:"blocker",compact:!1,folded:[],showAll:!1,archived:!1};function x8(){try{const e=JSON.parse(window.localStorage.getItem(xS)??"{}");return{order:fS.some(([t])=>t===e.order)?e.order:ej.order,compact:e.compact===!0,folded:Array.isArray(e.folded)?e.folded.filter(t=>typeof t=="string"):[],showAll:e.showAll===!0,archived:e.archived===!0}}catch{return ej}}function g8(e){try{window.localStorage.setItem(xS,JSON.stringify(e))}catch{}}const v8=new Set(["not_terminal","another_process","continued","no_open","pending"]);function gh({label:e,count:t,hint:n,fold:a}){const r=n?`hint-${e.toLowerCase().replace(/\W+/g,"-")}`:void 0;return s.jsxs(s.Fragment,{children:[a?s.jsx("h2",{className:"group",children:s.jsxs("button",{type:"button",className:"group-fold","aria-expanded":a.open,"aria-label":`${e}, ${t}`,"aria-describedby":r,onClick:a.onToggle,children:[s.jsx("span",{className:"chevron","aria-hidden":"true",children:a.open?"▾":"▸"}),e,s.jsx("span",{className:"count",children:t})]})}):s.jsxs("h2",{className:"group","aria-label":`${e}, ${t}`,"aria-describedby":r,children:[e,s.jsx("span",{className:"count",children:t})]}),n&&s.jsx("span",{className:"sr-only",id:r,children:n})]})}function zc({text:e,role:t}){return s.jsx("span",{className:`badge tone-${ii(t)}`,children:e})}function y8({serves:e}){const t=e.slice(0,o8),n=e.length-t.length;return s.jsxs("p",{className:"caption muted serves",children:[t.map((a,r)=>s.jsxs("span",{children:[r>0&&", ",s.jsxs("a",{href:`releases?planned=${encodeURIComponent(a.planned_release)}`,"aria-label":`serves ${a.name}, ${a.level}: open it in Planned releases`,children:["serves ",a.name," (",a.level,")"]})]},a.planned_release)),n>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{"aria-hidden":"true",children:[", +",n," more"]}),s.jsxs("span",{className:"sr-only",children:[", and ",n," more planned releases"]})]})]})}const j8=4;function tj({track:e}){return s.jsxs("span",{className:"track",children:[s.jsx("span",{className:"track-dots","aria-hidden":"true",children:Array.from({length:j8},(t,n)=>s.jsx("span",{className:["track-dot",n<=e.reached?"reached":"",n===e.target?"target":""].filter(Boolean).join(" ")},n))}),e.label,e.detail&&s.jsxs("span",{className:"sr-only",children:[". ",e.detail]})]})}function b8({tags:e,track:t,brief:n=!1}){const a=t?Math.min(Math.max(t.at??e.length,0),e.length):-1,r=n?e.filter(i=>!i.full):e,l=t?a-(n?e.slice(0,a).filter(i=>i.full).length:0):-1;return s.jsxs(s.Fragment,{children:[r.map((i,o)=>s.jsxs(u.Fragment,{children:[o===l&&t&&s.jsxs(s.Fragment,{children:[" ",s.jsx(tj,{track:t})]})," · ",s.jsxs("span",{className:`tag tone-${ii(i.role)}`,children:[i.text,i.detail&&s.jsxs("span",{className:"sr-only",children:[". ",i.detail]})]})]},`t${o}`)),l===r.length&&t&&s.jsxs(s.Fragment,{children:[" ",s.jsx(tj,{track:t})]})]})}function nj({id:e,href:t}){return t?s.jsx("a",{className:"id-link",href:t,children:e}):s.jsx("span",{className:"id-text",children:e})}function w8({onConnection:e,org:t=null,project:n=null}){const[a,r]=u.useState(null),[l,i]=u.useState(!1),[o,c]=u.useState(""),[d,f]=u.useState(!1),[m,h]=u.useState(null),[x,j]=u.useState(""),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,w]=u.useState(null),[N,C]=u.useState(""),[_,S]=u.useState(()=>new Set),[D,O]=u.useState(null),[B,Y]=u.useState(x8),H=L=>Y(ne=>{const ae={...ne,...L};return g8(ae),ae}),[M,A]=u.useState({groups:[],all:!1}),[R,T]=u.useState(()=>new Set),[k,$]=u.useState(()=>new Set),P=u.useRef(B.archived),E=u.useRef(0),I=u.useRef(null),F=u.useRef(""),Q=u.useRef(""),oe=u.useRef(""),ge=u.useRef(null),Z=u.useRef(null),J=u.useRef(null),re=L=>{var ae;if(!(L instanceof HTMLButtonElement)||!((ae=ge.current)!=null&&ae.contains(L))||!L.dataset.key)return null;const ne=c8.find(Ce=>L.classList.contains(Ce));return ne?`${ne} ${L.dataset.key}`:null},ee=L=>{J.current=re(L.target)},fe=()=>{setTimeout(()=>{re(document.activeElement)||(J.current=null)},0)},ce=u.useCallback(async()=>{const L=++E.current,ne=await sS(P.current);if(L!==E.current)return;if("none"in ne){i(!0),c(""),e("live");return}if("error"in ne){c(ne.error),e("disconnected");return}i(!1),c(""),j(""),e("live");const ae=JSON.stringify(ne.data);ae!==F.current&&(F.current=ae,r(ne.data))},[e]);u.useEffect(()=>{let L=!0;e5().then(Ce=>L&&f(Ce));const ne=setTimeout(ce,0),ae=setInterval(ce,l8);return()=>{L=!1,clearTimeout(ne),clearInterval(ae)}},[ce]),u.useEffect(()=>{let L=!0;const ne=()=>J6().then(Ce=>{L&&Ce&&y(qe=>JSON.stringify(qe)===JSON.stringify(Ce)?qe:Ce)});ne();const ae=setInterval(ne,i8);return()=>{L=!1,clearInterval(ae)}},[]),u.useEffect(()=>{const L=()=>{var pn,_e,Ve;const ae=window.location.hash;if(!ae.startsWith(xh)){w(null);return}if(ae===Q.current)return;let Ce;try{Ce=decodeURIComponent(ae.slice(xh.length))}catch{Ce=ae.slice(xh.length)}const qe=document.getElementById(`thread-${Ce}`);if(!qe||!((pn=ge.current)!=null&&pn.contains(qe))){if(!ge.current||!a)return;const Ut=oe.current!==ae;if(oe.current=ae,a.threads.some(sn=>sn.key===Ce)){const sn=(N||_.size)&&!Jy(a.threads,a.pinnedCount??0,N,_).rows.some(Vs=>Vs.row.key===Ce),$n=a.stages&&(Ut||!sn)?J5(a.threads,a.stages,{order:B.order,folded:new Set,showAll:!1,narrowed:!1},Ce):null,oi=$n!==null&&B.folded.includes($n.group)&&!M.groups.includes($n.group),ci=$n!==null&&$n.capped&&!B.showAll&&!M.all;Ut&&(N||_.size)&&(C(""),S(new Set)),Ut&&(N||_.size)||oi||ci?(oi||ci)&&A(Vs=>({groups:oi&&$n?[...Vs.groups,$n.group]:Vs.groups,all:Vs.all||ci})):Q.current=ae,w(null);return}w(Ce);return}Q.current=ae,w(null),p(Ce),(_e=qe.querySelector(".thread-title"))==null||_e.focus({preventScroll:!0}),(Ve=qe.scrollIntoView)==null||Ve.call(qe,{block:"center"})},ne=()=>{Q.current="",oe.current="",L()};return L(),window.addEventListener("hashchange",ne),()=>window.removeEventListener("hashchange",ne)},[a,N,_,B,M]),u.useEffect(()=>{if(!g)return;const L=()=>p(null);return document.addEventListener("pointerdown",L,!0),document.addEventListener("keydown",L,!0),()=>{document.removeEventListener("pointerdown",L,!0),document.removeEventListener("keydown",L,!0)}},[g]),u.useLayoutEffect(()=>{const L=J.current??(Z.current?`pin ${Z.current}`:null);if(!L||!ge.current)return;const[ne,ae]=[L.slice(0,L.indexOf(" ")),L.slice(L.indexOf(" ")+1)],Ce=document.activeElement;if(Ce&&Ce!==document.body&&!ge.current.contains(Ce)){J.current=null;return}const qe=[...ge.current.querySelectorAll(`button.${ne}`)].find(pn=>pn.dataset.key===ae);qe?Ce!==qe&&qe.focus({preventScroll:ae!==Z.current}):J.current=null});const Ee=async L=>{if(m)return;const ne=!L.pinned;Z.current=L.key,h(L.key);const ae=await s5(L.key,ne);h(null),ae||r(Ce=>Ce&&{...Ce,threads:Ce.threads.map(qe=>qe.key===L.key?{...qe,pinned:ne}:qe)}),await ce(),j(ae?`The pin was not saved: ${ae}`:""),Z.current===L.key&&(Z.current=null)},[V,te]=u.useState(()=>new Set),[le,Pe]=u.useState({}),Le=us(),{confirm:ue,confirm_dialog:zt}=Ql(),Je=(L,ne)=>Pe(ae=>{const{[L]:Ce,...qe}=ae;return ne?{...qe,[L]:ne}:qe}),ct=(L,ne)=>te(ae=>{const Ce=new Set(ae);return ne?Ce.add(L):Ce.delete(L),Ce}),ye=Object.keys(le).some(L=>!V.has(L));u.useEffect(()=>{if(!ye)return;const L=()=>Pe(ne=>Object.fromEntries(Object.entries(ne).filter(([ae])=>V.has(ae))));return document.addEventListener("pointerdown",L,!0),document.addEventListener("click",L,!0),()=>{document.removeEventListener("pointerdown",L,!0),document.removeEventListener("click",L,!0)}},[ye,V]);const We=L=>setTimeout(()=>{var ne,ae;return(ae=[...((ne=ge.current)==null?void 0:ne.querySelectorAll("button.open-thread"))??[]].find(Ce=>Ce.dataset.key===L))==null?void 0:ae.focus()},0),Gt=async(L,ne)=>{const ae=await ue({title:`Reopen ${L.title} in Terminal?`,description:`Its session is closed. It opens in a new Terminal window in ${ne??"the thread's folder"}, running claude --resume.`,action_label:"Reopen"});return We(L.key),ae},An=async L=>{if(V.has(L.key))return;let ne=!1;for(;;){ct(L.key,!0),Je(L.key,{key:L.key,text:m8[L.where??""]??"Opening.",role:"waiting"});const ae=await aS(L.key,ne);if(ct(L.key,!1),"done"in ae){Je(L.key,null);return}const{reason:Ce,error:qe,where:pn}=ae.refused;if(Ce==="closed"&&!ne){if(Je(L.key,null),!await Gt(L,pn))return;ne=!0;continue}const _e=Ce==="outdated"?`${qe.replace(/\.*$/,".")} ${Le}`:qe.replace(/\.*$/,"."),Ve=Ce==="terminal_denied"?"you":v8.has(Ce)?"muted":"alert";Je(L.key,{key:L.key,text:_e,role:Ve});return}},Nt=(a==null?void 0:a.threads)??[],Ue=!l&&Nt.length>0,Zt=Jy(Nt,(a==null?void 0:a.pinnedCount)??0,N,_),Tt=Zt.pinned,Vt=Zt.rows,At=Array.isArray(a==null?void 0:a.stages)?a.stages:null,Yt=new Set(B.folded.filter(L=>!M.groups.includes(L))),Lt=B.showAll||M.all,z=At?qm(Vt.map(L=>L.row),At,{order:B.order,folded:Yt,showAll:Lt,narrowed:Zt.narrowed}):null,de=At?(a==null?void 0:a.archived)??0:0,je=L=>{A(ne=>({...ne,groups:ne.groups.filter(ae=>ae!==L)})),H({folded:Yt.has(L)?B.folded.filter(ne=>ne!==L):[...B.folded.filter(ne=>ne!==L),L]})},it=()=>{A(L=>({...L,all:!1})),H({showAll:!Lt})},Kn=()=>{const L=!B.archived;P.current=L,H({archived:L}),ce()},Mn=L=>T(ne=>{const ae=new Set(ne);return ae.has(L)?ae.delete(L):ae.add(L),ae}),Jt=L=>$(ne=>{const ae=new Set(ne);return ae.has(L)?ae.delete(L):ae.add(L),ae}),U=(L,ne)=>s.jsx(_8,{depth:ne,row:v!=null&&v[L.key]?{...L,serves:v[L.key]}:L,arrived:g===L.key,pinnable:d&&typeof L.pinned=="boolean",pinning:m,onPin:()=>Ee(L),opening:V.has(L.key),note:le[L.key]??null,onOpen:()=>An(L),org:t,project:n,compact:!!At&&B.compact,detailsOpen:R.has(L.key),onDetails:()=>Mn(L.key),holdsOpen:k.has(L.key),onHolds:()=>Jt(L.key)});u.useEffect(()=>{if(!Ue)return;const L=ne=>{var Ce,qe;if(ne.key!=="/"||ne.ctrlKey||ne.metaKey||ne.altKey||ne.defaultPrevented)return;const ae=document.activeElement;ae&&(/^(INPUT|TEXTAREA|SELECT)$/.test(ae.tagName)||ae.isContentEditable)||document.querySelector('[role="dialog"], [role="alertdialog"], dialog[open]')||(ne.preventDefault(),(Ce=I.current)==null||Ce.focus(),(qe=I.current)==null||qe.select())};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[Ue]);const Se=L=>S(ne=>{const ae=new Set(ne);return ae.has(L)?ae.delete(L):ae.add(L),ae}),De=()=>{var L;C(""),S(new Set),(L=I.current)==null||L.focus()},ut=(L,ne)=>{const ae=Zt.counts[L]??0,Ce=_.has(L),qe=Qy[L];return s.jsxs("button",{type:"button",className:"filter-chip","aria-pressed":Ce,"aria-describedby":qe?`chip-hint-${L}`:void 0,disabled:ae===0&&!Ce&&D!==L,onFocus:()=>O(L),onBlur:()=>O(pn=>pn===L?null:pn),onClick:()=>Se(L),children:[ne," ",ae]},L)};return s.jsxs(s.Fragment,{children:[zt,s.jsxs("header",{className:"main-head",children:[s.jsx("h1",{children:"Threads"}),a&&!l&&s.jsx("p",{className:"muted",children:a.line})]}),s.jsxs("section",{className:"card threads","aria-label":"Threads",children:[s.jsx(r8,{}),o&&s.jsxs("div",{className:"alert",role:"alert",children:["Threads unavailable: ",o.replace(/\.+$/,""),". Retrying every 10 s."]}),x&&s.jsx("div",{className:"alert",role:"alert",children:x}),s.jsx("p",{className:"caption muted not-listed",role:"status",children:b!==null&&!l?At?s.jsxs(s.Fragment,{children:["Thread ",b," is not in this list.",!B.archived&&de>0?" Show archived lists archived threads.":null]}):s.jsxs(s.Fragment,{children:["Thread ",b," is not in this list. ",s.jsx("code",{children:"sdlc view --all"})," lists older threads."]}):null}),Ue&&s.jsxs("div",{className:"threads-toolbar",children:[s.jsxs("div",{className:"threads-find",children:[s.jsxs("div",{className:"search-field",children:[s.jsx("input",{ref:I,type:"search",placeholder:"Search threads","aria-label":"Search threads","aria-keyshortcuts":"/",value:N,onChange:L=>C(L.target.value),onKeyDown:L=>{L.key==="Escape"&&(L.preventDefault(),N?C(""):L.currentTarget.blur())}}),N&&s.jsx("button",{type:"button",className:"search-clear","aria-label":"Clear search",onClick:()=>{var L;C(""),(L=I.current)==null||L.focus()},children:s.jsx("span",{"aria-hidden":"true",children:"×"})})]}),At&&s.jsx("select",{className:"order-select","aria-label":"Order threads",value:B.order,onChange:L=>H({order:L.target.value}),children:fS.map(([L,ne])=>s.jsx("option",{value:L,children:ne},L))})]}),s.jsxs("div",{className:"filter-row",children:[s.jsx("div",{className:"filter-group",role:"group","aria-label":"Status",children:Gm.map(([L,ne])=>ut(L,ne))}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Agent",children:Vm.map(([L,ne])=>ut(L,ne))}),At&&s.jsx("button",{type:"button",className:"filter-chip","aria-pressed":B.compact,onClick:()=>H({compact:!B.compact}),children:"Compact"})]}),Object.entries(Qy).map(([L,ne])=>s.jsx("span",{className:"sr-only",id:`chip-hint-${L}`,children:ne},L)),s.jsx("p",{className:"caption muted narrowed",role:"status",children:Zt.narrowed?s.jsxs(s.Fragment,{children:[Vt.length," of ",Nt.length," threads ·"," ",s.jsx("button",{type:"button",className:"clear-filters","aria-label":"Clear search and filters",onClick:De,children:"Clear"})]}):null})]}),l?s.jsx("p",{className:"muted",children:u8}):s.jsxs("div",{className:"thread-list",ref:ge,onFocus:ee,onBlur:fe,children:[z==null?void 0:z.groups.map(L=>s.jsxs("div",{children:[L.label!==null&&s.jsx(gh,{label:L.label,count:L.count,hint:L.hint,fold:L.folds?{open:L.open,onToggle:()=>je(L.key)}:void 0}),L.rows.map(({row:ne,depth:ae})=>s.jsx("div",{children:U(ne,ae)},ne.key))]},`group-${L.key}`)),!z&&Vt.map(({row:L,depth:ne},ae)=>s.jsxs("div",{children:[Tt>0&&ae===0&&s.jsx(gh,{label:"Pinned",count:Tt,hint:hS}),Tt>0&&ae===Tt&&s.jsx(gh,{label:"Other threads",count:Vt.length-Tt}),U(L,ne)]},L.key)),a&&!Nt.length&&s.jsx("p",{className:"muted empty",children:"No threads at work or waiting."}),Nt.length>0&&!Vt.length&&s.jsx("p",{className:"muted empty",children:"No threads match."}),a&&a.hidden>0&&s.jsxs("p",{className:"caption muted",children:[a.hidden," older thread(s) not shown; sdlc view --all lists them."]}),(z==null?void 0:z.more)&&s.jsx("button",{type:"button",className:"list-more","aria-expanded":Lt,onClick:it,children:z.more.unstaged?Lt?"Show fewer without a stage":`Show all without a stage (${z.more.total})`:Lt?"Show fewer":`Show all (${z.more.total})`}),de>0&&s.jsx("button",{type:"button",className:"list-more",onClick:Kn,children:B.archived?"Hide archived":`Show ${de} archived`})]})]})]})}function _8({row:e,depth:t,arrived:n,pinnable:a,pinning:r,onPin:l,opening:i,note:o,onOpen:c,org:d,project:f,compact:m=!1,detailsOpen:h=!1,onDetails:x,holdsOpen:j=!1,onHolds:v}){const y=m&&!h,g=S=>d?`org/${encodeURIComponent(d)}/tasks/${encodeURIComponent(S)}`:null,p=S=>f?`proj/${encodeURIComponent(f)}/issues/${encodeURIComponent(S)}`:null,b=[e.where||e.agent,e.phase,e.age,e.waitsOn?`waits on ${e.waitsOn}`:""].filter(Boolean).join(" · "),w=p8(e),N=`open-note-${e.key}`,[C,_]=u.useState(!1);return s.jsxs("article",{className:["thread",n?"arrived":"",m?"compact-card":""].filter(Boolean).join(" "),id:`thread-${e.key}`,style:{marginLeft:Math.min(t*22,110)},children:[m&&s.jsx("button",{type:"button",className:"details-toggle","data-key":e.key,"aria-label":`Details of ${e.title}`,"aria-expanded":h,onClick:x,children:s.jsx("span",{"aria-hidden":"true",children:h?"▾":"▸"})}),s.jsxs("div",{className:"thread-head",children:[s.jsx("p",{className:"thread-title",tabIndex:-1,children:e.title}),s.jsxs("div",{className:"tools",children:[e.carried?s.jsxs(s.Fragment,{children:[s.jsx(zc,{text:e.carried,role:"waiting"}),e.carriedBatch&&s.jsx(zc,{text:e.carriedBatch.text,role:e.carriedBatch.role})]}):s.jsx(zc,{text:e.status,role:e.role}),e.archived&&s.jsx(zc,{text:"archived",role:"muted"}),w&&s.jsx("button",{type:"button",className:"open-thread","data-key":e.key,"aria-label":`${w}: ${e.title}`,"aria-describedby":N,"aria-disabled":i?!0:void 0,"aria-busy":i?!0:void 0,onClick:()=>{i||c()},children:i?"Opening…":w}),a&&s.jsx("button",{type:"button",className:e.pinned?"pin on":"pin","data-key":e.key,"aria-label":e.pinned?`Unpin ${e.title}`:`Pin ${e.title} to the top`,"aria-disabled":r?!0:void 0,"aria-busy":r===e.key?!0:void 0,onClick:()=>{r||l()},children:e.pinned?"Unpin":"Pin"})]})]}),s.jsxs("p",{className:y?"caption muted meta one-line":"caption muted meta",children:[b,s.jsx(b8,{tags:e.tags??[],track:e.track,brief:y})]}),w&&s.jsx("p",{id:N,className:`caption open-note tone-${ii((o==null?void 0:o.role)??"muted")}`,role:(o==null?void 0:o.role)==="alert"||(o==null?void 0:o.role)==="you"?"alert":"status",children:(o==null?void 0:o.text)??null}),!y&&e.serves&&e.serves.length>0&&s.jsx(y8,{serves:e.serves}),!y&&e.summary&&s.jsx("p",{className:"caption muted",children:e.summary}),!y&&e.carriedDetail&&s.jsx("p",{className:"line",children:e.carriedDetail}),!y&&e.step&&s.jsx(N8,{t:e}),e.lines.length>0&&s.jsx("p",{className:"caption muted lines-summary",children:h8(e.lines)}),y?null:s.jsx(k8,{t:e,nested:t>0,allLines:C,setAllLines:_,allHolds:j,onHolds:v,taskHref:g,issueHref:p})]})}function N8({t:e}){return s.jsxs("p",{className:`caption tone-${ii(e.stepRole??"muted")}`,children:["step: ",e.step,e.stepEvidence&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("span",{className:"id-text",children:e.stepEvidence})]}),e.stepRecent&&e.stepRecent.length>0&&s.jsxs("span",{className:"sr-only",children:[". Recent steps, newest first: ",e.stepRecent.join("; ")]})]})}function sj({text:e,role:t,under:n,detail:a,nested:r}){const l=r&&n?n:void 0,i=[l?e:"",a??""].filter(Boolean).join(". ");return s.jsxs("p",{className:`line tone-${ii(t)}`,children:[l??e,i&&s.jsxs("span",{className:"sr-only",children:[". ",i]})]})}function k8({t:e,nested:t,allLines:n,setAllLines:a,allHolds:r,onHolds:l,taskHref:i,issueHref:o}){return s.jsxs(s.Fragment,{children:[(n?e.lines:e.lines.slice(0,Ky)).map((c,d)=>s.jsxs("p",{className:`line tone-${ii(c.role)}`,children:[s.jsxs("span",{"aria-hidden":"true",children:[d8[c.state]??"•"," "]}),c.state==="working"&&s.jsx("span",{className:"sr-only",children:"Working: "}),c.task!==void 0&&s.jsx(nj,{id:c.task,href:i(c.task)}),c.task!==void 0&&c.text?" ":null,c.text]},`l${d}`)),e.lines.length>Ky&&s.jsx("button",{type:"button",className:"lines-more","aria-expanded":n,"aria-label":n?`Show fewer lines of work of ${e.title}`:`Show all ${e.lines.length} lines of work of ${e.title}`,onClick:()=>a(c=>!c),children:n?"Show fewer":`Show all ${e.lines.length}`}),(e.routed??[]).map(c=>s.jsxs("p",{className:"line",children:["routed ",s.jsx(nj,{id:c.issue,href:o(c.issue)}),c.title?` ${c.title}`:null]},`r${c.issue}`)),e.next&&s.jsxs("p",{className:"caption tone-amber",children:[s.jsx("span",{"aria-hidden":"true",children:"▸ "}),"next (",e.next.state,"): ",e.next.text,s.jsx("span",{className:"sr-only",children:". Say “nn” or approve it in the thread to start it."})]}),e.plannedFor&&s.jsxs("p",{className:"caption tone-grey",children:[s.jsx("span",{"aria-hidden":"true",children:"▸ "}),"planned for ",e.plannedFor.tag,": ",e.plannedFor.text]}),e.reason&&s.jsx(sj,{...e.reason,nested:t}),(r||!e.holdsAll?e.holds:e.holds.slice(0,Dc)).map((c,d)=>s.jsx(sj,{...c,nested:t},`h${d}`)),e.holdsAll&&e.holds.length>Dc&&s.jsx("button",{type:"button",className:"lines-more holds-toggle","data-key":e.key,"aria-expanded":r,"aria-label":r?`Show fewer holds of ${e.title}`:`+${e.holds.length-Dc} more holds of ${e.title}`,onClick:l,children:r?"Show fewer holds":`+${e.holds.length-Dc} more holds`}),(e.holdsMore??0)>0&&s.jsxs("p",{className:"caption tone-grey",children:["+",e.holdsMore," more holds"]}),e.plan&&s.jsx("p",{className:"caption muted",children:e.plan})]})}const S8=5e3;function C8(){const[e,t]=u.useState([]),n=u.useRef(0),a=u.useRef(new Map),r=u.useCallback(c=>{const d=a.current.get(c);d&&clearTimeout(d),a.current.delete(c),t(f=>f.filter(m=>m.id!==c))},[]),l=u.useCallback((c,d)=>{const f=n.current+=1;t(m=>[...m.filter(h=>h.tone!=="error").slice(-2),{id:f,tone:c,message:d}]),c==="success"&&a.current.set(f,setTimeout(()=>r(f),S8))},[r]);u.useEffect(()=>{const c=a.current;return()=>{for(const d of c.values())clearTimeout(d)}},[]);const i=u.useMemo(()=>({success:c=>l("success",c),error:c=>l("error",c)}),[l]),o=s.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"pointer-events-none fixed right-4 bottom-4 z-100 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-2",children:e.map(c=>s.jsxs("div",{"data-testid":"viewer-toast",className:"bg-popover text-popover-foreground pointer-events-auto flex w-80 max-w-full items-center gap-3 rounded-md border py-2 pr-2 pl-4 text-sm shadow-lg"+(c.tone==="error"?" border-destructive":""),children:[s.jsx("span",{className:"min-w-0 flex-1 break-words",children:c.message}),s.jsx(q,{type:"button",variant:"ghost",size:"control",className:"shrink-0",onClick:()=>r(c.id),children:"Dismiss"})]},c.id))});return{notify:i,toasts:o}}const gS=/^#(?:(releases)|release=(.+)|planned(?:=(.+))?)$/,R8=/^#task=(.+)$/,E8=/^#issue=(.+)$/,T8=/^iss-\d{1,9}$/;function vS(e){return e.split("/").filter(Boolean).slice(1).join("/")}function A8(e,t=""){const n=e.split("/").filter(Boolean);if(n.length===0)return{page:{kind:"home"}};if(n.length===1){const[o]=n;return o==="threads"?{page:{kind:"org",page:"threads"},threads:!0}:o==="chat"?{forward:"threads"}:o==="tasks"?{page:{kind:"org",page:"tasks"},tasks:!0}:o==="issues"?{page:{kind:"home"},issues:!0}:o==="chart"?{page:{kind:"org",page:"chart"},chart:!0}:o==="worktrees"?{page:{kind:"org",page:"worktrees"},worktrees:!0}:o==="workspaces"?{page:{kind:"org",page:"workspaces"},workspaces:!0}:o==="queues"?{page:{kind:"org",page:"queues"},queues:!0}:o==="releases"?{page:{kind:"home"},releasesForward:!0}:{page:{kind:"not_found"}}}const[a,r,l,i]=n;if(a==="org"&&l==="tasks"&&i==="queues"&&n.length===4)return{forward:`org/${r}/queues${t}`};if(a==="org"&&l==="chat"&&n.length<=4)return{forward:`org/${r}/threads${i===void 0?"":`#thread-${i}`}`};if(a==="org"&&l==="tasks"&&n.length===4){const o=decodeURIComponent(i);return{page:{kind:"org",page:"tasks",item:o},org:decodeURIComponent(r),task:o}}if(a==="org"&&l==="issues"&&n.length<=4){const o=decodeURIComponent(r);return i===void 0?{page:{kind:"home"},org:o,issues:!0}:{page:{kind:"home"},org:o,issues:!0,issue:decodeURIComponent(i)}}if(a==="proj"&&l==="issues"&&n.length<=4){const o=decodeURIComponent(r),c={kind:"project",project:o,page:"issues"};if(i===void 0)return{page:c,issues:!0,project:o};const d=decodeURIComponent(i),f=new URLSearchParams(t);f.delete("from");const m=f.toString();return{page:{...c,item:d,...m?{list_query:m}:{}},issues:!0,project:o,issue:d}}if(a==="org"&&n.length<=3){const o=decodeURIComponent(r);if(l===void 0)return{page:{kind:"home"},org:o};if(l==="threads")return{page:{kind:"org",page:"threads"},org:o,threads:!0};if(l==="tasks")return{page:{kind:"org",page:"tasks"},org:o,tasks:!0};if(l==="chart")return{page:{kind:"org",page:"chart"},org:o,chart:!0};if(l==="worktrees")return{page:{kind:"org",page:"worktrees"},org:o,worktrees:!0};if(l==="workspaces")return{page:{kind:"org",page:"workspaces"},org:o,workspaces:!0};if(l==="queues")return{page:{kind:"org",page:"queues"},org:o,queues:!0};if(l==="releases")return{page:{kind:"home"},org:o,releasesForward:!0}}if(a==="proj"&&n.length<=3){const o=decodeURIComponent(r);if(l===void 0)return{page:{kind:"project",project:o}};if(l==="tasks")return{page:{kind:"project",project:o,page:"tasks"},tasks:!0};if(l==="releases")return{page:{kind:"project",project:o,page:"releases"},releases:!0}}return{page:{kind:"not_found"}}}const M8={label:"Local viewer",can:()=>!1},$8={connecting:"Connecting…",live:"Live · refreshes every 10s",disconnected:"Disconnected"},aj=()=>s.jsx(nS,{title:"Page not found",children:"There is no page at this address in this viewer."});function O8({routeOrg:e}){const{org:t,engine:n}=Yn(),{project:a}=ec(),[r,l]=u.useState("connecting");return n===null?s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(ha,{page:"Threads"})}):s.jsxs("div",{className:"main viewer-panel",children:[s.jsxs("p",{className:"connection",role:"status",children:[s.jsx("span",{className:`dot ${r}`,"aria-hidden":"true"}),$8[r]]}),s.jsx(w8,{onConnection:l,org:(t==null?void 0:t.slug)??e??null,project:a})]})}const tr=()=>s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading…"});function D8({route:e,navigate:t}){var f;const{org:n,projects:a,loading:r,none:l}=Yn(),i=e.page.kind==="project"?e.page.project:null,o=i!==null&&a!==null&&!((f=a.find(m=>m.id===i))!=null&&f.current),c=e.org===void 0&&!o&&!r&&n!==null?`org/${encodeURIComponent(n.slug)}/tasks`:null;if(u.useEffect(()=>{c&&t(c)},[c,t]),i!==null&&o)return s.jsx(No,{project:i});if(c||e.org===void 0&&r)return s.jsx(tr,{});const d=(n==null?void 0:n.slug)??e.org;return d===void 0&&i!==null?s.jsx(No,{project:i}):d===void 0&&l?s.jsx(li,{}):d===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Tasks open once the organization reads."}):s.jsx(FD,{org:d})}function z8({route:e,navigate:t}){const{org:n,loading:a,none:r}=Yn(),l=e.org===void 0&&!a&&n!==null?`org/${encodeURIComponent(n.slug)}/queues${window.location.search}`:null;if(u.useEffect(()=>{l&&t(l)},[l,t]),l||e.org===void 0&&a)return s.jsx(tr,{});const i=(n==null?void 0:n.slug)??e.org;if(i===void 0&&r)return s.jsx(li,{});if(i===void 0)return s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Queues open once the organization reads."});const o=new URLSearchParams(window.location.search).get("queue");return s.jsx(D3,{org:i,open:o,path:`/org/${encodeURIComponent(i)}/queues`})}function L8({route:e,navigate:t}){var j;const{org:n,projects:a}=Yn(),{project:r,settled:l}=ec(),i=e.project??null,o=i!==null&&a!==null&&!((j=a.find(v=>v.id===i))!=null&&j.current),c=window.location.search,d=i===null&&r!==null?`proj/${encodeURIComponent(r)}/issues${e.issue?`/${encodeURIComponent(e.issue)}`:""}${c}`:null;u.useEffect(()=>{d&&t(d)},[d,t]);const[f,m]=u.useState(()=>window.location.search.replace(/^\?/,"")),h=u.useCallback(v=>{window.history.replaceState(window.history.state,"",`${window.location.pathname}${v?`?${v}`:""}`),m(v)},[]);if(i!==null&&o)return s.jsx(No,{project:i});if(d||i===null&&!l)return s.jsx(tr,{});if(i===null)return s.jsx(li,{});const x=encodeURIComponent((n==null?void 0:n.slug)??e.org??"");if(e.issue!==void 0){const v=new URLSearchParams(f).get("from");return s.jsx(_3,{org:x,project:i,issue_id:e.issue,from:v,query:f})}return s.jsx(o3,{org:x,project:i,query:f,onQuery:h})}function U8({issue:e,navigate:t,home:n}){const{project:a,settled:r}=ec(),l=a!==null?`proj/${encodeURIComponent(a)}/issues/${encodeURIComponent(e)}`:null;return u.useEffect(()=>{l&&t(l)},[l,t]),l||!r?s.jsx(tr,{}):n}function ec(){var l;const{projects:e,loading:t,none:n,failure:a}=Yn();return{project:((l=e==null?void 0:e.find(i=>i.current))==null?void 0:l.id)??null,settled:!t&&(e!==null||n!==null||!!(a!=null&&a.shown))}}function B8({navigate:e}){const{project:t,settled:n}=ec(),a=t!==null?`proj/${encodeURIComponent(t)}/releases${window.location.search}`:null;return u.useEffect(()=>{a&&e(a)},[a,e]),a||!n?s.jsx(tr,{}):s.jsx(li,{})}function rj(e){const t=new URLSearchParams(e);return{release:t.get("release"),planned:t.has("planned")?t.get("planned")??"":null}}function H8({route:e}){var f;const{org:t,projects:n,loading:a}=Yn(),r=e.page.kind==="project"?e.page.project:"",[l,i]=u.useState(()=>rj(window.location.search));if(a)return s.jsx(tr,{});if(n!==null&&!((f=n.find(m=>m.id===r))!=null&&f.current))return s.jsx(No,{project:r});const c=`/proj/${encodeURIComponent(r)}/releases`,d=m=>{const h=new URLSearchParams;m!=null&&m.startsWith("planned:")?h.set("planned",m.slice(8)):m&&h.set("release",m);const x=h.size>0?`?${h.toString()}`:"";window.history.replaceState(window.history.state,"",`${window.location.pathname}${x}`),i(rj(x))};return s.jsx(P6,{org:(t==null?void 0:t.slug)??"",query:l,onSelect:d,home:c})}function I8({hash:e,navigate:t,home:n}){const{project:a,settled:r}=ec(),l=gS.exec(e),i=l!=null&&l[2]?ed(l[2]):null,o=l!=null&&l[3]?ed(l[3]):null,c=i!==null?`?release=${encodeURIComponent(i)}`:e.startsWith("#planned")?`?planned${o!==null?`=${encodeURIComponent(o)}`:""}`:"",d=a!==null?`proj/${encodeURIComponent(a)}/releases${c}`:null;return u.useEffect(()=>{d&&t(d)},[d,t]),d||!r?s.jsx(tr,{}):n}function vh({route:e,navigate:t}){const{org:n}=Yn();let a=e.page;const r=e.org!==void 0&&n!==null&&e.org!==n.slug;r&&(a={kind:"not_found"});let l;if(r)l=s.jsx(aj,{});else if("threads"in e)l=s.jsx(O8,{routeOrg:e.org});else if("task"in e){const i=new URLSearchParams(window.location.search).get("from");l=s.jsx(Sz,{org:encodeURIComponent(e.org),task_id:e.task,from:i})}else"tasks"in e?l=s.jsx(D8,{route:e,navigate:t}):"issues"in e?l=s.jsx(L8,{route:e,navigate:t}):"chart"in e?l=s.jsx(xL,{}):"worktrees"in e?l=s.jsx(D5,{org:(n==null?void 0:n.slug)??e.org}):"workspaces"in e?l=s.jsx(m5,{org:(n==null?void 0:n.slug)??e.org}):"queues"in e?l=s.jsx(z8,{route:e,navigate:t}):"releasesForward"in e?l=s.jsx(B8,{navigate:t}):"releases"in e?l=s.jsx(H8,{route:e}):a.kind==="home"?l=s.jsx(li,{}):a.kind==="project"?l=s.jsx(No,{project:a.project}):l=s.jsx(aj,{});return s.jsx(X6,{page:a,children:l})}function P8({task:e,navigate:t,home:n}){const{org:a,loading:r,none:l,failure:i}=Yn(),o=a!==null?`org/${encodeURIComponent(a.slug)}/tasks/${encodeURIComponent(e)}`:null,c=!r&&(l!==null||!!(i!=null&&i.shown));return u.useEffect(()=>{o&&t(o)},[o,t]),o||!c?s.jsx(tr,{}):n}const q8=e=>window.location.replace(e);function ed(e){try{return decodeURIComponent(e)}catch{return null}}function G8({navigate:e=q8,data:t}){const n=A8(vS(window.location.pathname),window.location.search),[a,r]=u.useState(null),{notify:l,toasts:i}=C8(),o=R8.exec(window.location.hash),c=o?ed(o[1]):null,d=E8.exec(window.location.hash),f=d?ed(d[1]):null,m=f!==null&&T8.test(f)?f:null,h=gS.test(window.location.hash)?window.location.hash:null,x=o!==null&&c===null||d!==null&&m===null,j="forward"in n?n.forward:null;u.useEffect(()=>{j&&e(j)},[j,e]);const v=u.useMemo(()=>{if(t)return t;const g=I5();return{probe:{source:async()=>({label:"Local workspace"})},shell:g,issues:qy({...g.issues,commands:{}}),tasks:qy(G5()),org:q5(),worktrees:Y5(),workspaces:F5(),queues:P5(),releases:V5()}},[t]);if(j||"forward"in n||!v.shell)return null;const y=s.jsx(vh,{route:{page:{kind:"home"}},navigate:e});return s.jsx("div",{className:"app-ui dark",ref:r,children:s.jsxs($M,{container:a,children:[s.jsx(r0,{data:v,router:rS,identity:M8,notify:l,children:s.jsx(bT,{shell:v.shell,children:x?s.jsx(vh,{route:{page:{kind:"not_found"}},navigate:e}):c!==null?s.jsx(P8,{task:c,navigate:e,home:y}):m!==null?s.jsx(U8,{issue:m,navigate:e,home:y}):h!==null?s.jsx(I8,{hash:h,navigate:e,home:y}):s.jsx(vh,{route:n,navigate:e})})}),i]})})}_R.createRoot(document.getElementById("root")).render(s.jsx(u.StrictMode,{children:vS(window.location.pathname)==="app-ui-probe"?s.jsx(l5,{}):s.jsx(G8,{})}));
|