@software-dlc/cli 0.192.16 → 0.192.17
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.
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
function P1(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const r=Object.getOwnPropertyDescriptor(a,l);r&&Object.defineProperty(e,l,r.get?r:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function xy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gy={exports:{}},Du={};/**
|
|
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 q1=Symbol.for("react.transitional.element"),G1=Symbol.for("react.fragment");function vy(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 l in t)l!=="key"&&(n[l]=t[l])}else n=t;return t=n.ref,{$$typeof:q1,type:e,key:a,ref:t!==void 0?t:null,props:n}}Du.Fragment=G1;Du.jsx=vy;Du.jsxs=vy;gy.exports=Du;var s=gy.exports,yy={exports:{}},Ae={};/**
|
|
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"),V1=Symbol.for("react.portal"),Y1=Symbol.for("react.fragment"),F1=Symbol.for("react.strict_mode"),K1=Symbol.for("react.profiler"),X1=Symbol.for("react.consumer"),Q1=Symbol.for("react.context"),Z1=Symbol.for("react.forward_ref"),W1=Symbol.for("react.suspense"),J1=Symbol.for("react.memo"),by=Symbol.for("react.lazy"),Ax=Symbol.iterator;function eS(e){return e===null||typeof e!="object"?null:(e=Ax&&e[Ax]||e["@@iterator"],typeof e=="function"?e:null)}var jy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wy=Object.assign,_y={};function Nr(e,t,n){this.props=e,this.context=t,this.refs=_y,this.updater=n||jy}Nr.prototype.isReactComponent={};Nr.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")};Nr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ny(){}Ny.prototype=Nr.prototype;function bm(e,t,n){this.props=e,this.context=t,this.refs=_y,this.updater=n||jy}var jm=bm.prototype=new Ny;jm.constructor=bm;wy(jm,Nr.prototype);jm.isPureReactComponent=!0;var Mx=Array.isArray,it={H:null,A:null,T:null,S:null,V:null},ky=Object.prototype.hasOwnProperty;function wm(e,t,n,a,l,r){return n=r.ref,{$$typeof:ym,type:e,key:t,ref:n!==void 0?n:null,props:r}}function tS(e,t){return wm(e.type,t,void 0,void 0,void 0,e.props)}function _m(e){return typeof e=="object"&&e!==null&&e.$$typeof===ym}function nS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ox=/\/+/g;function Bd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?nS(""+e.key):t.toString(36)}function $x(){}function sS(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then($x,$x):(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 Ol(e,t,n,a,l){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(r){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case ym:case V1:i=!0;break;case by:return i=e._init,Ol(i(e._payload),t,n,a,l)}}if(i)return l=l(e),i=a===""?"."+Bd(e,0):a,Mx(l)?(n="",i!=null&&(n=i.replace(Ox,"$&/")+"/"),Ol(l,t,n,"",function(d){return d})):l!=null&&(_m(l)&&(l=tS(l,n+(l.key==null||e&&e.key===l.key?"":(""+l.key).replace(Ox,"$&/")+"/")+i)),t.push(l)),1;i=0;var o=a===""?".":a+":";if(Mx(e))for(var c=0;c<e.length;c++)a=e[c],r=o+Bd(a,c),i+=Ol(a,t,n,r,l);else if(c=eS(e),typeof c=="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,r=o+Bd(a,c++),i+=Ol(a,t,n,r,l);else if(r==="object"){if(typeof e.then=="function")return Ol(sS(e),t,n,a,l);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 Io(e,t,n){if(e==null)return e;var a=[],l=0;return Ol(e,a,"","",function(r){return t.call(n,r,l++)}),a}function aS(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 Dx=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 lS(){}Ae.Children={map:Io,forEach:function(e,t,n){Io(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Io(e,function(){t++}),t},toArray:function(e){return Io(e,function(t){return t})||[]},only:function(e){if(!_m(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ae.Component=Nr;Ae.Fragment=Y1;Ae.Profiler=K1;Ae.PureComponent=bm;Ae.StrictMode=F1;Ae.Suspense=W1;Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=it;Ae.__COMPILER_RUNTIME={__proto__:null,c:function(e){return it.H.useMemoCache(e)}};Ae.cache=function(e){return function(){return e.apply(null,arguments)}};Ae.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=wy({},e.props),l=e.key,r=void 0;if(t!=null)for(i in t.ref!==void 0&&(r=void 0),t.key!==void 0&&(l=""+t.key),t)!ky.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 wm(e.type,l,void 0,void 0,r,a)};Ae.createContext=function(e){return e={$$typeof:Q1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:X1,_context:e},e};Ae.createElement=function(e,t,n){var a,l={},r=null;if(t!=null)for(a in t.key!==void 0&&(r=""+t.key),t)ky.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(l[a]=t[a]);var i=arguments.length-2;if(i===1)l.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];l.children=o}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)l[a]===void 0&&(l[a]=i[a]);return wm(e,r,void 0,void 0,null,l)};Ae.createRef=function(){return{current:null}};Ae.forwardRef=function(e){return{$$typeof:Z1,render:e}};Ae.isValidElement=_m;Ae.lazy=function(e){return{$$typeof:by,_payload:{_status:-1,_result:e},_init:aS}};Ae.memo=function(e,t){return{$$typeof:J1,type:e,compare:t===void 0?null:t}};Ae.startTransition=function(e){var t=it.T,n={};it.T=n;try{var a=e(),l=it.S;l!==null&&l(n,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(lS,Dx)}catch(r){Dx(r)}finally{it.T=t}};Ae.unstable_useCacheRefresh=function(){return it.H.useCacheRefresh()};Ae.use=function(e){return it.H.use(e)};Ae.useActionState=function(e,t,n){return it.H.useActionState(e,t,n)};Ae.useCallback=function(e,t){return it.H.useCallback(e,t)};Ae.useContext=function(e){return it.H.useContext(e)};Ae.useDebugValue=function(){};Ae.useDeferredValue=function(e,t){return it.H.useDeferredValue(e,t)};Ae.useEffect=function(e,t,n){var a=it.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return a.useEffect(e,t)};Ae.useId=function(){return it.H.useId()};Ae.useImperativeHandle=function(e,t,n){return it.H.useImperativeHandle(e,t,n)};Ae.useInsertionEffect=function(e,t){return it.H.useInsertionEffect(e,t)};Ae.useLayoutEffect=function(e,t){return it.H.useLayoutEffect(e,t)};Ae.useMemo=function(e,t){return it.H.useMemo(e,t)};Ae.useOptimistic=function(e,t){return it.H.useOptimistic(e,t)};Ae.useReducer=function(e,t,n){return it.H.useReducer(e,t,n)};Ae.useRef=function(e){return it.H.useRef(e)};Ae.useState=function(e){return it.H.useState(e)};Ae.useSyncExternalStore=function(e,t,n){return it.H.useSyncExternalStore(e,t,n)};Ae.useTransition=function(){return it.H.useTransition()};Ae.version="19.1.0";yy.exports=Ae;var u=yy.exports;const ia=xy(u),Sy=P1({__proto__:null,default:ia},[u]);var Cy={exports:{}},zu={},Ry={exports:{}},Ty={};/**
|
|
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(S,E){var C=S.length;S.push(E);e:for(;0<C;){var $=C-1>>>1,X=S[$];if(0<l(X,E))S[$]=E,S[C]=X,C=$;else break e}}function n(S){return S.length===0?null:S[0]}function a(S){if(S.length===0)return null;var E=S[0],C=S.pop();if(C!==E){S[0]=C;e:for(var $=0,X=S.length,T=X>>>1;$<T;){var P=2*($+1)-1,J=S[P],ee=P+1,ve=S[ee];if(0>l(J,C))ee<X&&0>l(ve,J)?(S[$]=ve,S[ee]=C,$=ee):(S[$]=J,S[P]=C,$=P);else if(ee<X&&0>l(ve,C))S[$]=ve,S[ee]=C,$=ee;else break e}}return E}function l(S,E){var C=S.sortIndex-E.sortIndex;return C!==0?C:S.id-E.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],d=[],f=1,h=null,m=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(S){for(var E=n(d);E!==null;){if(E.callback===null)a(d);else if(E.startTime<=S)a(d),E.sortIndex=E.expirationTime,t(c,E);else break;E=n(d)}}function N(S){if(v=!1,w(S),!j)if(n(c)!==null)j=!0,R||(R=!0,V());else{var E=n(d);E!==null&&A(N,E.startTime-S)}}var R=!1,_=-1,k=5,U=-1;function z(){return y?!0:!(e.unstable_now()-U<k)}function K(){if(y=!1,R){var S=e.unstable_now();U=S;var E=!0;try{e:{j=!1,v&&(v=!1,p(_),_=-1),x=!0;var C=m;try{t:{for(w(S),h=n(c);h!==null&&!(h.expirationTime>S&&z());){var $=h.callback;if(typeof $=="function"){h.callback=null,m=h.priorityLevel;var X=$(h.expirationTime<=S);if(S=e.unstable_now(),typeof X=="function"){h.callback=X,w(S),E=!0;break t}h===n(c)&&a(c),w(S)}else a(c);h=n(c)}if(h!==null)E=!0;else{var T=n(d);T!==null&&A(N,T.startTime-S),E=!1}}break e}finally{h=null,m=C,x=!1}E=void 0}}finally{E?V():R=!1}}}var V;if(typeof b=="function")V=function(){b(K)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,M=L.port2;L.port1.onmessage=K,V=function(){M.postMessage(null)}}else V=function(){g(K,0)};function A(S,E){_=g(function(){S(e.unstable_now())},E)}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(S){S.callback=null},e.unstable_forceFrameRate=function(S){0>S||125<S?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<S?Math.floor(1e3/S):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(S){switch(m){case 1:case 2:case 3:var E=3;break;default:E=m}var C=m;m=E;try{return S()}finally{m=C}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(S,E){switch(S){case 1:case 2:case 3:case 4:case 5:break;default:S=3}var C=m;m=S;try{return E()}finally{m=C}},e.unstable_scheduleCallback=function(S,E,C){var $=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?$+C:$):C=$,S){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=C+X,S={id:f++,callback:E,priorityLevel:S,startTime:C,expirationTime:X,sortIndex:-1},C>$?(S.sortIndex=C,t(d,S),n(c)===null&&S===n(d)&&(v?(p(_),_=-1):v=!0,A(N,C-$))):(S.sortIndex=X,t(c,S),j||x||(j=!0,R||(R=!0,V()))),S},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(S){var E=m;return function(){var C=m;m=E;try{return S.apply(this,arguments)}finally{m=C}}}})(Ty);Ry.exports=Ty;var rS=Ry.exports,Ey={exports:{}},Xt={};/**
|
|
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 iS=u;function Ay(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 sa(){}var Kt={d:{f:sa,r:function(){throw Error(Ay(522))},D:sa,C:sa,L:sa,m:sa,X:sa,S:sa,M:sa},p:0,findDOMNode:null},oS=Symbol.for("react.portal");function cS(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:oS,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var xi=iS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Lu(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Kt;Xt.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(Ay(299));return cS(e,t,null,n)};Xt.flushSync=function(e){var t=xi.T,n=Kt.p;try{if(xi.T=null,Kt.p=2,e)return e()}finally{xi.T=t,Kt.p=n,Kt.d.f()}};Xt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Kt.d.C(e,t))};Xt.prefetchDNS=function(e){typeof e=="string"&&Kt.d.D(e)};Xt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,a=Lu(n,t.crossOrigin),l=typeof t.integrity=="string"?t.integrity:void 0,r=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Kt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:l,fetchPriority:r}):n==="script"&&Kt.d.X(e,{crossOrigin:a,integrity:l,fetchPriority:r,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Xt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Lu(t.as,t.crossOrigin);Kt.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&&Kt.d.M(e)};Xt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,a=Lu(n,t.crossOrigin);Kt.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})}};Xt.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Lu(t.as,t.crossOrigin);Kt.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 Kt.d.m(e)};Xt.requestFormReset=function(e){Kt.d.r(e)};Xt.unstable_batchedUpdates=function(e,t){return e(t)};Xt.useFormState=function(e,t,n){return xi.H.useFormState(e,t,n)};Xt.useFormStatus=function(){return xi.H.useHostTransitionStatus()};Xt.version="19.1.0";function My(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(My)}catch(e){console.error(e)}}My(),Ey.exports=Xt;var kr=Ey.exports;const uS=xy(kr);/**
|
|
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 $t=rS,Oy=u,dS=kr;function Z(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 $y(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ro(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 Dy(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 zx(e){if(ro(e)!==e)throw Error(Z(188))}function fS(e){var t=e.alternate;if(!t){if(t=ro(e),t===null)throw Error(Z(188));return t!==e?null:e}for(var n=e,a=t;;){var l=n.return;if(l===null)break;var r=l.alternate;if(r===null){if(a=l.return,a!==null){n=a;continue}break}if(l.child===r.child){for(r=l.child;r;){if(r===n)return zx(l),e;if(r===a)return zx(l),t;r=r.sibling}throw Error(Z(188))}if(n.return!==a.return)n=l,a=r;else{for(var i=!1,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){for(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)throw Error(Z(189))}}if(n.alternate!==a)throw Error(Z(190))}if(n.tag!==3)throw Error(Z(188));return n.stateNode.current===n?e:t}function zy(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=zy(e),t!==null)return t;e=e.sibling}return null}var st=Object.assign,hS=Symbol.for("react.element"),Po=Symbol.for("react.transitional.element"),li=Symbol.for("react.portal"),Ll=Symbol.for("react.fragment"),Ly=Symbol.for("react.strict_mode"),Kf=Symbol.for("react.profiler"),mS=Symbol.for("react.provider"),Uy=Symbol.for("react.consumer"),Ls=Symbol.for("react.context"),Nm=Symbol.for("react.forward_ref"),Xf=Symbol.for("react.suspense"),Qf=Symbol.for("react.suspense_list"),km=Symbol.for("react.memo"),ua=Symbol.for("react.lazy"),Zf=Symbol.for("react.activity"),pS=Symbol.for("react.memo_cache_sentinel"),Lx=Symbol.iterator;function Fr(e){return e===null||typeof e!="object"?null:(e=Lx&&e[Lx]||e["@@iterator"],typeof e=="function"?e:null)}var xS=Symbol.for("react.client.reference");function Wf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xS?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ll:return"Fragment";case Kf:return"Profiler";case Ly:return"StrictMode";case Xf:return"Suspense";case Qf:return"SuspenseList";case Zf:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case li:return"Portal";case Ls:return(e.displayName||"Context")+".Provider";case Uy:return(e._context.displayName||"Context")+".Consumer";case Nm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case km:return t=e.displayName||null,t!==null?t:Wf(e.type)||"Memo";case ua:t=e._payload,e=e._init;try{return Wf(e(t))}catch{}}return null}var ri=Array.isArray,Ce=Oy.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ve=dS.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Za={pending:!1,data:null,method:null,action:null},Jf=[],Ul=-1;function Ns(e){return{current:e}}function Bt(e){0>Ul||(e.current=Jf[Ul],Jf[Ul]=null,Ul--)}function ot(e,t){Ul++,Jf[Ul]=e.current,e.current=t}var gs=Ns(null),$i=Ns(null),wa=Ns(null),Hc=Ns(null);function Ic(e,t){switch(ot(wa,t),ot($i,e),ot(gs,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Pg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Pg(t),e=t0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Bt(gs),ot(gs,e)}function cr(){Bt(gs),Bt($i),Bt(wa)}function eh(e){e.memoizedState!==null&&ot(Hc,e);var t=gs.current,n=t0(t,e.type);t!==n&&(ot($i,e),ot(gs,n))}function Pc(e){$i.current===e&&(Bt(gs),Bt($i)),Hc.current===e&&(Bt(Hc),Gi._currentValue=Za)}var th=Object.prototype.hasOwnProperty,Sm=$t.unstable_scheduleCallback,Hd=$t.unstable_cancelCallback,gS=$t.unstable_shouldYield,vS=$t.unstable_requestPaint,vs=$t.unstable_now,yS=$t.unstable_getCurrentPriorityLevel,By=$t.unstable_ImmediatePriority,Hy=$t.unstable_UserBlockingPriority,qc=$t.unstable_NormalPriority,bS=$t.unstable_LowPriority,Iy=$t.unstable_IdlePriority,jS=$t.log,wS=$t.unstable_setDisableYieldValue,io=null,gn=null;function xa(e){if(typeof jS=="function"&&wS(e),gn&&typeof gn.setStrictMode=="function")try{gn.setStrictMode(io,e)}catch{}}var vn=Math.clz32?Math.clz32:kS,_S=Math.log,NS=Math.LN2;function kS(e){return e>>>=0,e===0?32:31-(_S(e)/NS|0)|0}var qo=256,Go=4194304;function Fa(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 Uu(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,r=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=a&134217727;return o!==0?(a=o&~r,a!==0?l=Fa(a):(i&=o,i!==0?l=Fa(i):n||(n=o&~e,n!==0&&(l=Fa(n))))):(o=a&~r,o!==0?l=Fa(o):i!==0?l=Fa(i):n||(n=a&~e,n!==0&&(l=Fa(n)))),l===0?0:t!==0&&t!==l&&!(t&r)&&(r=l&-l,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:l}function oo(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function SS(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 Py(){var e=qo;return qo<<=1,!(qo&4194048)&&(qo=256),e}function qy(){var e=Go;return Go<<=1,!(Go&62914560)&&(Go=4194304),e}function Id(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function co(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function CS(e,t,n,a,l,r){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-vn(n),h=1<<f;o[f]=0,c[f]=-1;var m=d[f];if(m!==null)for(d[f]=null,f=0;f<m.length;f++){var x=m[f];x!==null&&(x.lane&=-536870913)}n&=~h}a!==0&&Gy(e,a,0),r!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=r&~(i&~t))}function Gy(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-vn(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&4194090}function Vy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-vn(n),l=1<<a;l&t|e[a]&t&&(e[a]|=t),n&=~l}}function Cm(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 Rm(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Yy(){var e=Ve.p;return e!==0?e:(e=window.event,e===void 0?32:d0(e.type))}function RS(e,t){var n=Ve.p;try{return Ve.p=e,t()}finally{Ve.p=n}}var La=Math.random().toString(36).slice(2),qt="__reactFiber$"+La,ln="__reactProps$"+La,Sr="__reactContainer$"+La,nh="__reactEvents$"+La,TS="__reactListeners$"+La,ES="__reactHandles$"+La,Ux="__reactResources$"+La,uo="__reactMarker$"+La;function Tm(e){delete e[qt],delete e[ln],delete e[nh],delete e[TS],delete e[ES]}function Bl(e){var t=e[qt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sr]||n[qt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Vg(e);e!==null;){if(n=e[qt])return n;e=Vg(e)}return t}e=n,n=e.parentNode}return null}function Cr(e){if(e=e[qt]||e[Sr]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function ii(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Z(33))}function Ql(e){var t=e[Ux];return t||(t=e[Ux]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Lt(e){e[uo]=!0}var Fy=new Set,Ky={};function pl(e,t){ur(e,t),ur(e+"Capture",t)}function ur(e,t){for(Ky[e]=t,e=0;e<t.length;e++)Fy.add(t[e])}var AS=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]*$"),Bx={},Hx={};function MS(e){return th.call(Hx,e)?!0:th.call(Bx,e)?!1:AS.test(e)?Hx[e]=!0:(Bx[e]=!0,!1)}function vc(e,t,n){if(MS(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 Vo(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 Ts(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 Pd,Ix;function $l(e){if(Pd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Pd=t&&t[1]||"",Ix=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Pd+e+Ix}var qd=!1;function Gd(e,t){if(!e||qd)return"";qd=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(x){var m=x}Reflect.construct(e,[],h)}else{try{h.call()}catch(x){m=x}e.call(h.prototype)}}else{try{throw Error()}catch(x){m=x}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(x){if(x&&m&&typeof x.stack=="string")return[x.stack,m.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),i=r[0],o=r[1];if(i&&o){var c=i.split(`
|
|
44
|
-
`),d=o.split(`
|
|
45
|
-
`);for(l=a=0;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;for(;l<d.length&&!d[l].includes("DetermineComponentFrameRoot");)l++;if(a===c.length||l===d.length)for(a=c.length-1,l=d.length-1;1<=a&&0<=l&&c[a]!==d[l];)l--;for(;1<=a&&0<=l;a--,l--)if(c[a]!==d[l]){if(a!==1||l!==1)do if(a--,l--,0>l||c[a]!==d[l]){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<=l);break}}}finally{qd=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?$l(n):""}function OS(e){switch(e.tag){case 26:case 27:case 5:return $l(e.type);case 16:return $l("Lazy");case 13:return $l("Suspense");case 19:return $l("SuspenseList");case 0:case 15:return Gd(e.type,!1);case 11:return Gd(e.type.render,!1);case 1:return Gd(e.type,!0);case 31:return $l("Activity");default:return""}}function Px(e){try{var t="";do t+=OS(e),e=e.return;while(e);return t}catch(n){return`
|
|
47
|
-
Error generating stack: `+n.message+`
|
|
48
|
-
`+n.stack}}function Cn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $S(e){var t=Xy(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 l=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){a=""+i,r.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 Gc(e){e._valueTracker||(e._valueTracker=$S(e))}function Qy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Xy(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Vc(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 DS=/[\n"\\]/g;function En(e){return e.replace(DS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function sh(e,t,n,a,l,r,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=""+Cn(t)):e.value!==""+Cn(t)&&(e.value=""+Cn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?ah(e,i,Cn(t)):n!=null?ah(e,i,Cn(n)):a!=null&&e.removeAttribute("value"),l==null&&r!=null&&(e.defaultChecked=!!r),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Cn(o):e.removeAttribute("name")}function Zy(e,t,n,a,l,r,i,o){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null))return;n=n!=null?""+Cn(n):"",t=t!=null?""+Cn(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}a=a??l,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 ah(e,t,n){t==="number"&&Vc(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Zl(e,t,n,a){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Cn(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,a&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Wy(e,t,n){if(t!=null&&(t=""+Cn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Cn(n):""}function Jy(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(Z(92));if(ri(a)){if(1<a.length)throw Error(Z(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Cn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a)}function dr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zS=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 qx(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||zS.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function eb(e,t,n){if(t!=null&&typeof t!="object")throw Error(Z(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 l in t)a=t[l],t.hasOwnProperty(l)&&n[l]!==a&&qx(e,l,a)}else for(var r in t)t.hasOwnProperty(r)&&qx(e,r,t[r])}function Em(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 LS=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"]]),US=/^[\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 yc(e){return US.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var lh=null;function Am(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Hl=null,Wl=null;function Gx(e){var t=Cr(e);if(t&&(e=t.stateNode)){var n=e[ln]||null;e:switch(e=t.stateNode,t.type){case"input":if(sh(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="'+En(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var l=a[ln]||null;if(!l)throw Error(Z(90));sh(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Qy(a)}break e;case"textarea":Wy(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Zl(e,!!n.multiple,t,!1)}}}var Vd=!1;function tb(e,t,n){if(Vd)return e(t,n);Vd=!0;try{var a=e(t);return a}finally{if(Vd=!1,(Hl!==null||Wl!==null)&&(Ku(),Hl&&(t=Hl,e=Wl,Wl=Hl=null,Gx(t),e)))for(t=0;t<e.length;t++)Gx(e[t])}}function Di(e,t){var n=e.stateNode;if(n===null)return null;var a=n[ln]||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(Z(231,t,typeof n));return n}var Gs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rh=!1;if(Gs)try{var Kr={};Object.defineProperty(Kr,"passive",{get:function(){rh=!0}}),window.addEventListener("test",Kr,Kr),window.removeEventListener("test",Kr,Kr)}catch{rh=!1}var ga=null,Mm=null,bc=null;function nb(){if(bc)return bc;var e,t=Mm,n=t.length,a,l="value"in ga?ga.value:ga.textContent,r=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(a=1;a<=i&&t[n-a]===l[r-a];a++);return bc=l.slice(e,1<a?1-a:void 0)}function jc(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 Yo(){return!0}function Vx(){return!1}function on(e){function t(n,a,l,r,i){this._reactName=n,this._targetInst=l,this.type=a,this.nativeEvent=r,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(r):r[o]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Yo:Vx,this.isPropagationStopped=Vx,this}return st(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=Yo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yo)},persist:function(){},isPersistent:Yo}),t}var xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bu=on(xl),fo=st({},xl,{view:0,detail:0}),BS=on(fo),Yd,Fd,Xr,Hu=st({},fo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Om,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!==Xr&&(Xr&&e.type==="mousemove"?(Yd=e.screenX-Xr.screenX,Fd=e.screenY-Xr.screenY):Fd=Yd=0,Xr=e),Yd)},movementY:function(e){return"movementY"in e?e.movementY:Fd}}),Yx=on(Hu),HS=st({},Hu,{dataTransfer:0}),IS=on(HS),PS=st({},fo,{relatedTarget:0}),Kd=on(PS),qS=st({},xl,{animationName:0,elapsedTime:0,pseudoElement:0}),GS=on(qS),VS=st({},xl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),YS=on(VS),FS=st({},xl,{data:0}),Fx=on(FS),KS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XS={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"},QS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ZS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=QS[e])?!!t[e]:!1}function Om(){return ZS}var WS=st({},fo,{key:function(e){if(e.key){var t=KS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=jc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?XS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Om,charCode:function(e){return e.type==="keypress"?jc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?jc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),JS=on(WS),e2=st({},Hu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kx=on(e2),t2=st({},fo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Om}),n2=on(t2),s2=st({},xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),a2=on(s2),l2=st({},Hu,{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}),r2=on(l2),i2=st({},xl,{newState:0,oldState:0}),o2=on(i2),c2=[9,13,27,32],$m=Gs&&"CompositionEvent"in window,gi=null;Gs&&"documentMode"in document&&(gi=document.documentMode);var u2=Gs&&"TextEvent"in window&&!gi,sb=Gs&&(!$m||gi&&8<gi&&11>=gi),Xx=" ",Qx=!1;function ab(e,t){switch(e){case"keyup":return c2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Il=!1;function d2(e,t){switch(e){case"compositionend":return lb(t);case"keypress":return t.which!==32?null:(Qx=!0,Xx);case"textInput":return e=t.data,e===Xx&&Qx?null:e;default:return null}}function f2(e,t){if(Il)return e==="compositionend"||!$m&&ab(e,t)?(e=nb(),bc=Mm=ga=null,Il=!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 sb&&t.locale!=="ko"?null:t.data;default:return null}}var h2={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 Zx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!h2[e.type]:t==="textarea"}function rb(e,t,n,a){Hl?Wl?Wl.push(a):Wl=[a]:Hl=a,t=cu(t,"onChange"),0<t.length&&(n=new Bu("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var vi=null,zi=null;function m2(e){Wj(e,0)}function Iu(e){var t=ii(e);if(Qy(t))return e}function Wx(e,t){if(e==="change")return t}var ib=!1;if(Gs){var Xd;if(Gs){var Qd="oninput"in document;if(!Qd){var Jx=document.createElement("div");Jx.setAttribute("oninput","return;"),Qd=typeof Jx.oninput=="function"}Xd=Qd}else Xd=!1;ib=Xd&&(!document.documentMode||9<document.documentMode)}function eg(){vi&&(vi.detachEvent("onpropertychange",ob),zi=vi=null)}function ob(e){if(e.propertyName==="value"&&Iu(zi)){var t=[];rb(t,zi,e,Am(e)),tb(m2,t)}}function p2(e,t,n){e==="focusin"?(eg(),vi=t,zi=n,vi.attachEvent("onpropertychange",ob)):e==="focusout"&&eg()}function x2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Iu(zi)}function g2(e,t){if(e==="click")return Iu(t)}function v2(e,t){if(e==="input"||e==="change")return Iu(t)}function y2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wn=typeof Object.is=="function"?Object.is:y2;function Li(e,t){if(wn(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 l=n[a];if(!th.call(t,l)||!wn(e[l],t[l]))return!1}return!0}function tg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ng(e,t){var n=tg(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=tg(n)}}function cb(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?cb(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ub(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Vc(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=Vc(e.document)}return t}function Dm(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 b2=Gs&&"documentMode"in document&&11>=document.documentMode,Pl=null,ih=null,yi=null,oh=!1;function sg(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oh||Pl==null||Pl!==Vc(a)||(a=Pl,"selectionStart"in a&&Dm(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}),yi&&Li(yi,a)||(yi=a,a=cu(ih,"onSelect"),0<a.length&&(t=new Bu("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Pl)))}function Va(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ql={animationend:Va("Animation","AnimationEnd"),animationiteration:Va("Animation","AnimationIteration"),animationstart:Va("Animation","AnimationStart"),transitionrun:Va("Transition","TransitionRun"),transitionstart:Va("Transition","TransitionStart"),transitioncancel:Va("Transition","TransitionCancel"),transitionend:Va("Transition","TransitionEnd")},Zd={},db={};Gs&&(db=document.createElement("div").style,"AnimationEvent"in window||(delete ql.animationend.animation,delete ql.animationiteration.animation,delete ql.animationstart.animation),"TransitionEvent"in window||delete ql.transitionend.transition);function gl(e){if(Zd[e])return Zd[e];if(!ql[e])return e;var t=ql[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in db)return Zd[e]=t[n];return e}var fb=gl("animationend"),hb=gl("animationiteration"),mb=gl("animationstart"),j2=gl("transitionrun"),w2=gl("transitionstart"),_2=gl("transitioncancel"),pb=gl("transitionend"),xb=new Map,ch="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(" ");ch.push("scrollEnd");function as(e,t){xb.set(e,t),pl(t,[e])}var ag=new WeakMap;function An(e,t){if(typeof e=="object"&&e!==null){var n=ag.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Px(t)},ag.set(e,t),t)}return{value:e,source:t,stack:Px(t)}}var Sn=[],Gl=0,zm=0;function Pu(){for(var e=Gl,t=zm=Gl=0;t<e;){var n=Sn[t];Sn[t++]=null;var a=Sn[t];Sn[t++]=null;var l=Sn[t];Sn[t++]=null;var r=Sn[t];if(Sn[t++]=null,a!==null&&l!==null){var i=a.pending;i===null?l.next=l:(l.next=i.next,i.next=l),a.pending=l}r!==0&&gb(n,l,r)}}function qu(e,t,n,a){Sn[Gl++]=e,Sn[Gl++]=t,Sn[Gl++]=n,Sn[Gl++]=a,zm|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Lm(e,t,n,a){return qu(e,t,n,a),Yc(e)}function Rr(e,t){return qu(e,null,null,t),Yc(e)}function gb(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var l=!1,r=e.return;r!==null;)r.childLanes|=n,a=r.alternate,a!==null&&(a.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(l=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,l&&t!==null&&(l=31-vn(n),e=r.hiddenUpdates,a=e[l],a===null?e[l]=[t]:a.push(t),t.lane=n|536870912),r):null}function Yc(e){if(50<Ti)throw Ti=0,Eh=null,Error(Z(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Vl={};function N2(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 xn(e,t,n,a){return new N2(e,t,n,a)}function Um(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ps(e,t){var n=e.alternate;return n===null?(n=xn(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 vb(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 wc(e,t,n,a,l,r){var i=0;if(a=e,typeof e=="function")Um(e)&&(i=1);else if(typeof e=="string")i=SC(e,n,gs.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Zf:return e=xn(31,n,t,l),e.elementType=Zf,e.lanes=r,e;case Ll:return Wa(n.children,l,r,t);case Ly:i=8,l|=24;break;case Kf:return e=xn(12,n,t,l|2),e.elementType=Kf,e.lanes=r,e;case Xf:return e=xn(13,n,t,l),e.elementType=Xf,e.lanes=r,e;case Qf:return e=xn(19,n,t,l),e.elementType=Qf,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mS:case Ls:i=10;break e;case Uy:i=9;break e;case Nm:i=11;break e;case km:i=14;break e;case ua:i=16,a=null;break e}i=29,n=Error(Z(130,e===null?"null":typeof e,"")),a=null}return t=xn(i,n,t,l),t.elementType=e,t.type=a,t.lanes=r,t}function Wa(e,t,n,a){return e=xn(7,e,a,t),e.lanes=n,e}function Wd(e,t,n){return e=xn(6,e,null,t),e.lanes=n,e}function Jd(e,t,n){return t=xn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yl=[],Fl=0,Fc=null,Kc=0,Rn=[],Tn=0,Ja=null,Us=1,Bs="";function Ka(e,t){Yl[Fl++]=Kc,Yl[Fl++]=Fc,Fc=e,Kc=t}function yb(e,t,n){Rn[Tn++]=Us,Rn[Tn++]=Bs,Rn[Tn++]=Ja,Ja=e;var a=Us;e=Bs;var l=32-vn(a)-1;a&=~(1<<l),n+=1;var r=32-vn(t)+l;if(30<r){var i=l-l%5;r=(a&(1<<i)-1).toString(32),a>>=i,l-=i,Us=1<<32-vn(t)+l|n<<l|a,Bs=r+e}else Us=1<<r|n<<l|a,Bs=e}function Bm(e){e.return!==null&&(Ka(e,1),yb(e,1,0))}function Hm(e){for(;e===Fc;)Fc=Yl[--Fl],Yl[Fl]=null,Kc=Yl[--Fl],Yl[Fl]=null;for(;e===Ja;)Ja=Rn[--Tn],Rn[Tn]=null,Bs=Rn[--Tn],Rn[Tn]=null,Us=Rn[--Tn],Rn[Tn]=null}var Ft=null,mt=null,Ge=!1,el=null,ds=!1,uh=Error(Z(519));function ll(e){var t=Error(Z(418,""));throw Ui(An(t,e)),uh}function lg(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[qt]=e,t[ln]=a,n){case"dialog":De("cancel",t),De("close",t);break;case"iframe":case"object":case"embed":De("load",t);break;case"video":case"audio":for(n=0;n<Ii.length;n++)De(Ii[n],t);break;case"source":De("error",t);break;case"img":case"image":case"link":De("error",t),De("load",t);break;case"details":De("toggle",t);break;case"input":De("invalid",t),Zy(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),Gc(t);break;case"select":De("invalid",t);break;case"textarea":De("invalid",t),Jy(t,a.value,a.defaultValue,a.children),Gc(t)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||e0(t.textContent,n)?(a.popover!=null&&(De("beforetoggle",t),De("toggle",t)),a.onScroll!=null&&De("scroll",t),a.onScrollEnd!=null&&De("scrollend",t),a.onClick!=null&&(t.onclick=Zu),t=!0):t=!1,t||ll(e)}function rg(e){for(Ft=e.return;Ft;)switch(Ft.tag){case 5:case 13:ds=!1;return;case 27:case 3:ds=!0;return;default:Ft=Ft.return}}function Qr(e){if(e!==Ft)return!1;if(!Ge)return rg(e),Ge=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||zh(e.type,e.memoizedProps)),n=!n),n&&mt&&ll(e),rg(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){mt=Zn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}mt=null}}else t===27?(t=mt,Ua(e.type)?(e=Bh,Bh=null,mt=e):mt=t):mt=Ft?Zn(e.stateNode.nextSibling):null;return!0}function ho(){mt=Ft=null,Ge=!1}function ig(){var e=el;return e!==null&&(sn===null?sn=e:sn.push.apply(sn,e),el=null),e}function Ui(e){el===null?el=[e]:el.push(e)}var dh=Ns(null),vl=null,Hs=null;function fa(e,t,n){ot(dh,t._currentValue),t._currentValue=n}function qs(e){e._currentValue=dh.current,Bt(dh)}function fh(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 hh(e,t,n,a){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var r=l.dependencies;if(r!==null){var i=l.child;r=r.firstContext;e:for(;r!==null;){var o=r;r=l;for(var c=0;c<t.length;c++)if(o.context===t[c]){r.lanes|=n,o=r.alternate,o!==null&&(o.lanes|=n),fh(r.return,n,e),a||(i=null);break e}r=o.next}}else if(l.tag===18){if(i=l.return,i===null)throw Error(Z(341));i.lanes|=n,r=i.alternate,r!==null&&(r.lanes|=n),fh(i,n,e),i=null}else i=l.child;if(i!==null)i.return=l;else for(i=l;i!==null;){if(i===e){i=null;break}if(l=i.sibling,l!==null){l.return=i.return,i=l;break}i=i.return}l=i}}function mo(e,t,n,a){e=null;for(var l=t,r=!1;l!==null;){if(!r){if(l.flags&524288)r=!0;else if(l.flags&262144)break}if(l.tag===10){var i=l.alternate;if(i===null)throw Error(Z(387));if(i=i.memoizedProps,i!==null){var o=l.type;wn(l.pendingProps.value,i.value)||(e!==null?e.push(o):e=[o])}}else if(l===Hc.current){if(i=l.alternate,i===null)throw Error(Z(387));i.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(Gi):e=[Gi])}l=l.return}e!==null&&hh(t,e,n,a),t.flags|=262144}function Xc(e){for(e=e.firstContext;e!==null;){if(!wn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rl(e){vl=e,Hs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return bb(vl,e)}function Fo(e,t){return vl===null&&rl(e),bb(e,t)}function bb(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Hs===null){if(e===null)throw Error(Z(308));Hs=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Hs=Hs.next=t;return n}var k2=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()})}},S2=$t.unstable_scheduleCallback,C2=$t.unstable_NormalPriority,Mt={$$typeof:Ls,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Im(){return{controller:new k2,data:new Map,refCount:0}}function po(e){e.refCount--,e.refCount===0&&S2(C2,function(){e.controller.abort()})}var bi=null,mh=0,fr=0,Jl=null;function R2(e,t){if(bi===null){var n=bi=[];mh=0,fr=up(),Jl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return mh++,t.then(og,og),t}function og(){if(--mh===0&&bi!==null){Jl!==null&&(Jl.status="fulfilled");var e=bi;bi=null,fr=0,Jl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function T2(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var l=0;l<n.length;l++)(0,n[l])(t)},function(l){for(a.status="rejected",a.reason=l,l=0;l<n.length;l++)(0,n[l])(void 0)}),a}var cg=Ce.S;Ce.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&R2(e,t),cg!==null&&cg(e,t)};var tl=Ns(null);function Pm(){var e=tl.current;return e!==null?e:nt.pooledCache}function _c(e,t){t===null?ot(tl,tl.current):ot(tl,t.pool)}function jb(){var e=Pm();return e===null?null:{parent:Mt._currentValue,pool:e}}var xo=Error(Z(460)),wb=Error(Z(474)),Gu=Error(Z(542)),ph={then:function(){}};function ug(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ko(){}function _b(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ko,Ko),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,fg(e),e;default:if(typeof t.status=="string")t.then(Ko,Ko);else{if(e=nt,e!==null&&100<e.shellSuspendCounter)throw Error(Z(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=a}},function(a){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,fg(e),e}throw ji=t,xo}}var ji=null;function dg(){if(ji===null)throw Error(Z(459));var e=ji;return ji=null,e}function fg(e){if(e===xo||e===Gu)throw Error(Z(483))}var da=!1;function qm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xh(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 _a(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Na(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,Qe&2){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=Yc(e),gb(e,null,n),t}return qu(e,a,t,n),Yc(e)}function wi(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,Vy(e,n)}}function ef(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?l=r=i:r=r.next=i,n=n.next}while(n!==null);r===null?l=r=t:r=r.next=t}else l=r=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:r,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 gh=!1;function _i(){if(gh){var e=Jl;if(e!==null)throw e}}function Ni(e,t,n,a){gh=!1;var l=e.updateQueue;da=!1;var r=l.firstBaseUpdate,i=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var c=o,d=c.next;c.next=null,i===null?r=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(r!==null){var h=l.baseState;i=0,f=d=c=null,o=r;do{var m=o.lane&-536870913,x=m!==o.lane;if(x?(Ie&m)===m:(a&m)===m){m!==0&&m===fr&&(gh=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var j=e,v=o;m=t;var y=n;switch(v.tag){case 1:if(j=v.payload,typeof j=="function"){h=j.call(y,h,m);break e}h=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=v.payload,m=typeof j=="function"?j.call(y,h,m):j,m==null)break e;h=st({},h,m);break e;case 2:da=!0}}m=o.callback,m!==null&&(e.flags|=64,x&&(e.flags|=8192),x=l.callbacks,x===null?l.callbacks=[m]:x.push(m))}else x={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(d=f=x,c=h):f=f.next=x,i|=m;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;x=o,o=x.next,x.next=null,l.lastBaseUpdate=x,l.shared.pending=null}}while(!0);f===null&&(c=h),l.baseState=c,l.firstBaseUpdate=d,l.lastBaseUpdate=f,r===null&&(l.shared.lanes=0),Oa|=i,e.lanes=i,e.memoizedState=h}}function Nb(e,t){if(typeof e!="function")throw Error(Z(191,e));e.call(t)}function kb(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Nb(n[e],t)}var hr=Ns(null),Qc=Ns(0);function hg(e,t){e=Fs,ot(Qc,e),ot(hr,t),Fs=e|t.baseLanes}function vh(){ot(Qc,Fs),ot(hr,hr.current)}function Gm(){Fs=Qc.current,Bt(hr),Bt(Qc)}var Aa=0,$e=null,et=null,kt=null,Zc=!1,er=!1,il=!1,Wc=0,Bi=0,tr=null,E2=0;function bt(){throw Error(Z(321))}function Vm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wn(e[n],t[n]))return!1;return!0}function Ym(e,t,n,a,l,r){return Aa=r,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ce.H=e===null||e.memoizedState===null?nj:sj,il=!1,r=n(a,l),il=!1,er&&(r=Cb(t,n,a,l)),Sb(e),r}function Sb(e){Ce.H=Jc;var t=et!==null&&et.next!==null;if(Aa=0,kt=et=$e=null,Zc=!1,Bi=0,tr=null,t)throw Error(Z(300));e===null||Ut||(e=e.dependencies,e!==null&&Xc(e)&&(Ut=!0))}function Cb(e,t,n,a){$e=e;var l=0;do{if(er&&(tr=null),Bi=0,er=!1,25<=l)throw Error(Z(301));if(l+=1,kt=et=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}Ce.H=L2,r=t(n,a)}while(er);return r}function A2(){var e=Ce.H,t=e.useState()[0];return t=typeof t.then=="function"?go(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&($e.flags|=1024),t}function Fm(){var e=Wc!==0;return Wc=0,e}function Km(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Xm(e){if(Zc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Zc=!1}Aa=0,kt=et=$e=null,er=!1,Bi=Wc=0,tr=null}function tn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return kt===null?$e.memoizedState=kt=e:kt=kt.next=e,kt}function Rt(){if(et===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=kt===null?$e.memoizedState:kt.next;if(t!==null)kt=t,et=e;else{if(e===null)throw $e.alternate===null?Error(Z(467)):Error(Z(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},kt===null?$e.memoizedState=kt=e:kt=kt.next=e}return kt}function Qm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function go(e){var t=Bi;return Bi+=1,tr===null&&(tr=[]),e=_b(tr,e,t),t=$e,(kt===null?t.memoizedState:kt.next)===null&&(t=t.alternate,Ce.H=t===null||t.memoizedState===null?nj:sj),e}function Vu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return go(e);if(e.$$typeof===Ls)return Gt(e)}throw Error(Z(438,String(e)))}function Zm(e){var t=null,n=$e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=$e.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Qm(),$e.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]=pS;return t.index++,n}function Vs(e,t){return typeof t=="function"?t(e):t}function Nc(e){var t=Rt();return Wm(t,et,e)}function Wm(e,t,n){var a=e.queue;if(a===null)throw Error(Z(311));a.lastRenderedReducer=n;var l=e.baseQueue,r=a.pending;if(r!==null){if(l!==null){var i=l.next;l.next=r.next,r.next=i}t.baseQueue=l=r,a.pending=null}if(r=e.baseState,l===null)e.memoizedState=r;else{t=l.next;var o=i=null,c=null,d=t,f=!1;do{var h=d.lane&-536870913;if(h!==d.lane?(Ie&h)===h:(Aa&h)===h){var m=d.revertLane;if(m===0)c!==null&&(c=c.next={lane:0,revertLane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),h===fr&&(f=!0);else if((Aa&m)===m){d=d.next,m===fr&&(f=!0);continue}else h={lane:0,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(o=c=h,i=r):c=c.next=h,$e.lanes|=m,Oa|=m;h=d.action,il&&n(r,h),r=d.hasEagerState?d.eagerState:n(r,h)}else m={lane:h,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(o=c=m,i=r):c=c.next=m,$e.lanes|=h,Oa|=h;d=d.next}while(d!==null&&d!==t);if(c===null?i=r:c.next=o,!wn(r,e.memoizedState)&&(Ut=!0,f&&(n=Jl,n!==null)))throw n;e.memoizedState=r,e.baseState=i,e.baseQueue=c,a.lastRenderedState=r}return l===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function tf(e){var t=Rt(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var a=n.dispatch,l=n.pending,r=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do r=e(r,i.action),i=i.next;while(i!==l);wn(r,t.memoizedState)||(Ut=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,a]}function Rb(e,t,n){var a=$e,l=Rt(),r=Ge;if(r){if(n===void 0)throw Error(Z(407));n=n()}else n=t();var i=!wn((et||l).memoizedState,n);i&&(l.memoizedState=n,Ut=!0),l=l.queue;var o=Ab.bind(null,a,l,e);if(vo(2048,8,o,[e]),l.getSnapshot!==t||i||kt!==null&&kt.memoizedState.tag&1){if(a.flags|=2048,mr(9,Yu(),Eb.bind(null,a,l,n,t),null),nt===null)throw Error(Z(349));r||Aa&124||Tb(a,t,n)}return n}function Tb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t=Qm(),$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Eb(e,t,n,a){t.value=n,t.getSnapshot=a,Mb(t)&&Ob(e)}function Ab(e,t,n){return n(function(){Mb(t)&&Ob(e)})}function Mb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wn(e,n)}catch{return!0}}function Ob(e){var t=Rr(e,2);t!==null&&bn(t,e,2)}function yh(e){var t=tn();if(typeof e=="function"){var n=e;if(e=n(),il){xa(!0);try{n()}finally{xa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:e},t}function $b(e,t,n,a){return e.baseState=n,Wm(e,et,typeof a=="function"?a:Vs)}function M2(e,t,n,a,l){if(Fu(e))throw Error(Z(485));if(e=t.action,e!==null){var r={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){r.listeners.push(i)}};Ce.T!==null?n(!0):r.isTransition=!1,a(r),n=t.pending,n===null?(r.next=t.pending=r,Db(t,r)):(r.next=n.next,t.pending=n.next=r)}}function Db(e,t){var n=t.action,a=t.payload,l=e.state;if(t.isTransition){var r=Ce.T,i={};Ce.T=i;try{var o=n(l,a),c=Ce.S;c!==null&&c(i,o),mg(e,t,o)}catch(d){bh(e,t,d)}finally{Ce.T=r}}else try{r=n(l,a),mg(e,t,r)}catch(d){bh(e,t,d)}}function mg(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){pg(e,t,a)},function(a){return bh(e,t,a)}):pg(e,t,n)}function pg(e,t,n){t.status="fulfilled",t.value=n,zb(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Db(e,n)))}function bh(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,zb(t),t=t.next;while(t!==a)}e.action=null}function zb(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Lb(e,t){return t}function xg(e,t){if(Ge){var n=nt.formState;if(n!==null){e:{var a=$e;if(Ge){if(mt){t:{for(var l=mt,r=ds;l.nodeType!==8;){if(!r){l=null;break t}if(l=Zn(l.nextSibling),l===null){l=null;break t}}r=l.data,l=r==="F!"||r==="F"?l:null}if(l){mt=Zn(l.nextSibling),a=l.data==="F!";break e}}ll(a)}a=!1}a&&(t=n[0])}}return n=tn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lb,lastRenderedState:t},n.queue=a,n=Jb.bind(null,$e,a),a.dispatch=n,a=yh(!1),r=np.bind(null,$e,!1,a.queue),a=tn(),l={state:t,dispatch:null,action:e,pending:null},a.queue=l,n=M2.bind(null,$e,l,r,n),l.dispatch=n,a.memoizedState=e,[t,n,!1]}function gg(e){var t=Rt();return Ub(t,et,e)}function Ub(e,t,n){if(t=Wm(e,t,Lb)[0],e=Nc(Vs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=go(t)}catch(i){throw i===xo?Gu:i}else a=t;t=Rt();var l=t.queue,r=l.dispatch;return n!==t.memoizedState&&($e.flags|=2048,mr(9,Yu(),O2.bind(null,l,n),null)),[a,r,e]}function O2(e,t){e.action=t}function vg(e){var t=Rt(),n=et;if(n!==null)return Ub(t,n,e);Rt(),t=t.memoizedState,n=Rt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function mr(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=$e.updateQueue,t===null&&(t=Qm(),$e.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 Yu(){return{destroy:void 0,resource:void 0}}function Bb(){return Rt().memoizedState}function kc(e,t,n,a){var l=tn();a=a===void 0?null:a,$e.flags|=e,l.memoizedState=mr(1|t,Yu(),n,a)}function vo(e,t,n,a){var l=Rt();a=a===void 0?null:a;var r=l.memoizedState.inst;et!==null&&a!==null&&Vm(a,et.memoizedState.deps)?l.memoizedState=mr(t,r,n,a):($e.flags|=e,l.memoizedState=mr(1|t,r,n,a))}function yg(e,t){kc(8390656,8,e,t)}function Hb(e,t){vo(2048,8,e,t)}function Ib(e,t){return vo(4,2,e,t)}function Pb(e,t){return vo(4,4,e,t)}function qb(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 Gb(e,t,n){n=n!=null?n.concat([e]):null,vo(4,4,qb.bind(null,t,e),n)}function Jm(){}function Vb(e,t){var n=Rt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Vm(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Yb(e,t){var n=Rt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Vm(t,a[1]))return a[0];if(a=e(),il){xa(!0);try{e()}finally{xa(!1)}}return n.memoizedState=[a,t],a}function ep(e,t,n){return n===void 0||Aa&1073741824?e.memoizedState=t:(e.memoizedState=n,e=zj(),$e.lanes|=e,Oa|=e,n)}function Fb(e,t,n,a){return wn(n,t)?n:hr.current!==null?(e=ep(e,n,a),wn(e,t)||(Ut=!0),e):Aa&42?(e=zj(),$e.lanes|=e,Oa|=e,t):(Ut=!0,e.memoizedState=n)}function Kb(e,t,n,a,l){var r=Ve.p;Ve.p=r!==0&&8>r?r:8;var i=Ce.T,o={};Ce.T=o,np(e,!1,t,n);try{var c=l(),d=Ce.S;if(d!==null&&d(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=T2(c,a);ki(e,t,f,yn(e))}else ki(e,t,a,yn(e))}catch(h){ki(e,t,{then:function(){},status:"rejected",reason:h},yn())}finally{Ve.p=r,Ce.T=i}}function $2(){}function jh(e,t,n,a){if(e.tag!==5)throw Error(Z(476));var l=Xb(e).queue;Kb(e,l,t,Za,n===null?$2:function(){return Qb(e),n(a)})}function Xb(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Za,baseState:Za,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:Za},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Qb(e){var t=Xb(e).next.queue;ki(e,t,{},yn())}function tp(){return Gt(Gi)}function Zb(){return Rt().memoizedState}function Wb(){return Rt().memoizedState}function D2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=yn();e=_a(n);var a=Na(t,e,n);a!==null&&(bn(a,t,n),wi(a,t,n)),t={cache:Im()},e.payload=t;return}t=t.return}}function z2(e,t,n){var a=yn();n={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Fu(e)?ej(t,n):(n=Lm(e,t,n,a),n!==null&&(bn(n,e,a),tj(n,t,a)))}function Jb(e,t,n){var a=yn();ki(e,t,n,a)}function ki(e,t,n,a){var l={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fu(e))ej(t,l);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var i=t.lastRenderedState,o=r(i,n);if(l.hasEagerState=!0,l.eagerState=o,wn(o,i))return qu(e,t,l,0),nt===null&&Pu(),!1}catch{}finally{}if(n=Lm(e,t,l,a),n!==null)return bn(n,e,a),tj(n,t,a),!0}return!1}function np(e,t,n,a){if(a={lane:2,revertLane:up(),action:a,hasEagerState:!1,eagerState:null,next:null},Fu(e)){if(t)throw Error(Z(479))}else t=Lm(e,n,a,2),t!==null&&bn(t,e,2)}function Fu(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function ej(e,t){er=Zc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tj(e,t,n){if(n&4194048){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Vy(e,n)}}var Jc={readContext:Gt,use:Vu,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt},nj={readContext:Gt,use:Vu,useCallback:function(e,t){return tn().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:yg,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,kc(4194308,4,qb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return kc(4194308,4,e,t)},useInsertionEffect:function(e,t){kc(4,2,e,t)},useMemo:function(e,t){var n=tn();t=t===void 0?null:t;var a=e();if(il){xa(!0);try{e()}finally{xa(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=tn();if(n!==void 0){var l=n(t);if(il){xa(!0);try{n(t)}finally{xa(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=z2.bind(null,$e,e),[a.memoizedState,e]},useRef:function(e){var t=tn();return e={current:e},t.memoizedState=e},useState:function(e){e=yh(e);var t=e.queue,n=Jb.bind(null,$e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Jm,useDeferredValue:function(e,t){var n=tn();return ep(n,e,t)},useTransition:function(){var e=yh(!1);return e=Kb.bind(null,$e,e.queue,!0,!1),tn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=$e,l=tn();if(Ge){if(n===void 0)throw Error(Z(407));n=n()}else{if(n=t(),nt===null)throw Error(Z(349));Ie&124||Tb(a,t,n)}l.memoizedState=n;var r={value:n,getSnapshot:t};return l.queue=r,yg(Ab.bind(null,a,r,e),[e]),a.flags|=2048,mr(9,Yu(),Eb.bind(null,a,r,n,t),null),n},useId:function(){var e=tn(),t=nt.identifierPrefix;if(Ge){var n=Bs,a=Us;n=(a&~(1<<32-vn(a)-1)).toString(32)+n,t="«"+t+"R"+n,n=Wc++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=E2++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:tp,useFormState:xg,useActionState:xg,useOptimistic:function(e){var t=tn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=np.bind(null,$e,!0,n),n.dispatch=t,[e,t]},useMemoCache:Zm,useCacheRefresh:function(){return tn().memoizedState=D2.bind(null,$e)}},sj={readContext:Gt,use:Vu,useCallback:Vb,useContext:Gt,useEffect:Hb,useImperativeHandle:Gb,useInsertionEffect:Ib,useLayoutEffect:Pb,useMemo:Yb,useReducer:Nc,useRef:Bb,useState:function(){return Nc(Vs)},useDebugValue:Jm,useDeferredValue:function(e,t){var n=Rt();return Fb(n,et.memoizedState,e,t)},useTransition:function(){var e=Nc(Vs)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:go(e),t]},useSyncExternalStore:Rb,useId:Zb,useHostTransitionStatus:tp,useFormState:gg,useActionState:gg,useOptimistic:function(e,t){var n=Rt();return $b(n,et,e,t)},useMemoCache:Zm,useCacheRefresh:Wb},L2={readContext:Gt,use:Vu,useCallback:Vb,useContext:Gt,useEffect:Hb,useImperativeHandle:Gb,useInsertionEffect:Ib,useLayoutEffect:Pb,useMemo:Yb,useReducer:tf,useRef:Bb,useState:function(){return tf(Vs)},useDebugValue:Jm,useDeferredValue:function(e,t){var n=Rt();return et===null?ep(n,e,t):Fb(n,et.memoizedState,e,t)},useTransition:function(){var e=tf(Vs)[0],t=Rt().memoizedState;return[typeof e=="boolean"?e:go(e),t]},useSyncExternalStore:Rb,useId:Zb,useHostTransitionStatus:tp,useFormState:vg,useActionState:vg,useOptimistic:function(e,t){var n=Rt();return et!==null?$b(n,et,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Zm,useCacheRefresh:Wb},nr=null,Hi=0;function Xo(e){var t=Hi;return Hi+=1,nr===null&&(nr=[]),_b(nr,e,t)}function Zr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Qo(e,t){throw t.$$typeof===hS?Error(Z(525)):(e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function bg(e){var t=e._init;return t(e._payload)}function aj(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 l(g,p){return g=Ps(g,p),g.index=0,g.sibling=null,g}function r(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=Wd(b,g.mode,w),p.return=g,p):(p=l(p,b),p.return=g,p)}function c(g,p,b,w){var N=b.type;return N===Ll?f(g,p,b.props.children,w,b.key):p!==null&&(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ua&&bg(N)===p.type)?(p=l(p,b.props),Zr(p,b),p.return=g,p):(p=wc(b.type,b.key,b.props,null,g.mode,w),Zr(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=Jd(b,g.mode,w),p.return=g,p):(p=l(p,b.children||[]),p.return=g,p)}function f(g,p,b,w,N){return p===null||p.tag!==7?(p=Wa(b,g.mode,w,N),p.return=g,p):(p=l(p,b),p.return=g,p)}function h(g,p,b){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Wd(""+p,g.mode,b),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Po:return b=wc(p.type,p.key,p.props,null,g.mode,b),Zr(b,p),b.return=g,b;case li:return p=Jd(p,g.mode,b),p.return=g,p;case ua:var w=p._init;return p=w(p._payload),h(g,p,b)}if(ri(p)||Fr(p))return p=Wa(p,g.mode,b,null),p.return=g,p;if(typeof p.then=="function")return h(g,Xo(p),b);if(p.$$typeof===Ls)return h(g,Fo(g,p),b);Qo(g,p)}return null}function m(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 Po:return b.key===N?c(g,p,b,w):null;case li:return b.key===N?d(g,p,b,w):null;case ua:return N=b._init,b=N(b._payload),m(g,p,b,w)}if(ri(b)||Fr(b))return N!==null?null:f(g,p,b,w,null);if(typeof b.then=="function")return m(g,p,Xo(b),w);if(b.$$typeof===Ls)return m(g,p,Fo(g,b),w);Qo(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 Po:return g=g.get(w.key===null?b:w.key)||null,c(p,g,w,N);case li:return g=g.get(w.key===null?b:w.key)||null,d(p,g,w,N);case ua:var R=w._init;return w=R(w._payload),x(g,p,b,w,N)}if(ri(w)||Fr(w))return g=g.get(b)||null,f(p,g,w,N,null);if(typeof w.then=="function")return x(g,p,b,Xo(w),N);if(w.$$typeof===Ls)return x(g,p,b,Fo(p,w),N);Qo(p,w)}return null}function j(g,p,b,w){for(var N=null,R=null,_=p,k=p=0,U=null;_!==null&&k<b.length;k++){_.index>k?(U=_,_=null):U=_.sibling;var z=m(g,_,b[k],w);if(z===null){_===null&&(_=U);break}e&&_&&z.alternate===null&&t(g,_),p=r(z,p,k),R===null?N=z:R.sibling=z,R=z,_=U}if(k===b.length)return n(g,_),Ge&&Ka(g,k),N;if(_===null){for(;k<b.length;k++)_=h(g,b[k],w),_!==null&&(p=r(_,p,k),R===null?N=_:R.sibling=_,R=_);return Ge&&Ka(g,k),N}for(_=a(_);k<b.length;k++)U=x(_,g,k,b[k],w),U!==null&&(e&&U.alternate!==null&&_.delete(U.key===null?k:U.key),p=r(U,p,k),R===null?N=U:R.sibling=U,R=U);return e&&_.forEach(function(K){return t(g,K)}),Ge&&Ka(g,k),N}function v(g,p,b,w){if(b==null)throw Error(Z(151));for(var N=null,R=null,_=p,k=p=0,U=null,z=b.next();_!==null&&!z.done;k++,z=b.next()){_.index>k?(U=_,_=null):U=_.sibling;var K=m(g,_,z.value,w);if(K===null){_===null&&(_=U);break}e&&_&&K.alternate===null&&t(g,_),p=r(K,p,k),R===null?N=K:R.sibling=K,R=K,_=U}if(z.done)return n(g,_),Ge&&Ka(g,k),N;if(_===null){for(;!z.done;k++,z=b.next())z=h(g,z.value,w),z!==null&&(p=r(z,p,k),R===null?N=z:R.sibling=z,R=z);return Ge&&Ka(g,k),N}for(_=a(_);!z.done;k++,z=b.next())z=x(_,g,k,z.value,w),z!==null&&(e&&z.alternate!==null&&_.delete(z.key===null?k:z.key),p=r(z,p,k),R===null?N=z:R.sibling=z,R=z);return e&&_.forEach(function(V){return t(g,V)}),Ge&&Ka(g,k),N}function y(g,p,b,w){if(typeof b=="object"&&b!==null&&b.type===Ll&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Po:e:{for(var N=b.key;p!==null;){if(p.key===N){if(N=b.type,N===Ll){if(p.tag===7){n(g,p.sibling),w=l(p,b.props.children),w.return=g,g=w;break e}}else if(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ua&&bg(N)===p.type){n(g,p.sibling),w=l(p,b.props),Zr(w,b),w.return=g,g=w;break e}n(g,p);break}else t(g,p);p=p.sibling}b.type===Ll?(w=Wa(b.props.children,g.mode,w,b.key),w.return=g,g=w):(w=wc(b.type,b.key,b.props,null,g.mode,w),Zr(w,b),w.return=g,g=w)}return i(g);case li: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=l(p,b.children||[]),w.return=g,g=w;break e}else{n(g,p);break}else t(g,p);p=p.sibling}w=Jd(b,g.mode,w),w.return=g,g=w}return i(g);case ua:return N=b._init,b=N(b._payload),y(g,p,b,w)}if(ri(b))return j(g,p,b,w);if(Fr(b)){if(N=Fr(b),typeof N!="function")throw Error(Z(150));return b=N.call(b),v(g,p,b,w)}if(typeof b.then=="function")return y(g,p,Xo(b),w);if(b.$$typeof===Ls)return y(g,p,Fo(g,b),w);Qo(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=l(p,b),w.return=g,g=w):(n(g,p),w=Wd(b,g.mode,w),w.return=g,g=w),i(g)):n(g,p)}return function(g,p,b,w){try{Hi=0;var N=y(g,p,b,w);return nr=null,N}catch(_){if(_===xo||_===Gu)throw _;var R=xn(29,_,null,g.mode);return R.lanes=w,R.return=g,R}finally{}}}var pr=aj(!0),lj=aj(!1),Ln=Ns(null),ys=null;function ha(e){var t=e.alternate;ot(Ot,Ot.current&1),ot(Ln,e),ys===null&&(t===null||hr.current!==null||t.memoizedState!==null)&&(ys=e)}function rj(e){if(e.tag===22){if(ot(Ot,Ot.current),ot(Ln,e),ys===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(ys=e)}}else ma()}function ma(){ot(Ot,Ot.current),ot(Ln,Ln.current)}function Is(e){Bt(Ln),ys===e&&(ys=null),Bt(Ot)}var Ot=Ns(0);function eu(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==="$?"||Uh(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 nf(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:st({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var wh={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=yn(),l=_a(a);l.payload=t,n!=null&&(l.callback=n),t=Na(e,l,a),t!==null&&(bn(t,e,a),wi(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=yn(),l=_a(a);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=Na(e,l,a),t!==null&&(bn(t,e,a),wi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yn(),a=_a(n);a.tag=2,t!=null&&(a.callback=t),t=Na(e,a,n),t!==null&&(bn(t,e,n),wi(t,e,n))}};function jg(e,t,n,a,l,r,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,i):t.prototype&&t.prototype.isPureReactComponent?!Li(n,a)||!Li(l,r):!0}function wg(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&&wh.enqueueReplaceState(t,t.state,null)}function ol(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=st({},n));for(var l in e)n[l]===void 0&&(n[l]=e[l])}return n}var tu=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 ij(e){tu(e)}function oj(e){console.error(e)}function cj(e){tu(e)}function nu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function _g(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function _h(e,t,n){return n=_a(n),n.tag=3,n.payload={element:null},n.callback=function(){nu(e,t)},n}function uj(e){return e=_a(e),e.tag=3,e}function dj(e,t,n,a){var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var r=a.value;e.payload=function(){return l(r)},e.callback=function(){_g(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){_g(t,n,a),typeof l!="function"&&(ka===null?ka=new Set([this]):ka.add(this));var o=a.stack;this.componentDidCatch(a.value,{componentStack:o!==null?o:""})})}function U2(e,t,n,a,l){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&mo(t,n,l,!0),n=Ln.current,n!==null){switch(n.tag){case 13:return ys===null?Ah():n.alternate===null&&pt===0&&(pt=3),n.flags&=-257,n.flags|=65536,n.lanes=l,a===ph?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),mf(e,a,l)),!1;case 22:return n.flags|=65536,a===ph?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)),mf(e,a,l)),!1}throw Error(Z(435,n.tag))}return mf(e,a,l),Ah(),!1}if(Ge)return t=Ln.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=l,a!==uh&&(e=Error(Z(422),{cause:a}),Ui(An(e,n)))):(a!==uh&&(t=Error(Z(423),{cause:a}),Ui(An(t,n))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,a=An(a,n),l=_h(e.stateNode,a,l),ef(e,l),pt!==4&&(pt=2)),!1;var r=Error(Z(520),{cause:a});if(r=An(r,n),Ri===null?Ri=[r]:Ri.push(r),pt!==4&&(pt=2),t===null)return!0;a=An(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=l&-l,n.lanes|=e,e=_h(n.stateNode,a,e),ef(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(ka===null||!ka.has(r))))return n.flags|=65536,l&=-l,n.lanes|=l,l=uj(l),dj(l,e,n,a),ef(n,l),!1}n=n.return}while(n!==null);return!1}var fj=Error(Z(461)),Ut=!1;function Ht(e,t,n,a){t.child=e===null?lj(t,null,n,a):pr(t,e.child,n,a)}function Ng(e,t,n,a,l){n=n.render;var r=t.ref;if("ref"in a){var i={};for(var o in a)o!=="ref"&&(i[o]=a[o])}else i=a;return rl(t),a=Ym(e,t,n,i,r,l),o=Fm(),e!==null&&!Ut?(Km(e,t,l),Ys(e,t,l)):(Ge&&o&&Bm(t),t.flags|=1,Ht(e,t,a,l),t.child)}function kg(e,t,n,a,l){if(e===null){var r=n.type;return typeof r=="function"&&!Um(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,hj(e,t,r,a,l)):(e=wc(n.type,null,a,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!sp(e,l)){var i=r.memoizedProps;if(n=n.compare,n=n!==null?n:Li,n(i,a)&&e.ref===t.ref)return Ys(e,t,l)}return t.flags|=1,e=Ps(r,a),e.ref=t.ref,e.return=t,t.child=e}function hj(e,t,n,a,l){if(e!==null){var r=e.memoizedProps;if(Li(r,a)&&e.ref===t.ref)if(Ut=!1,t.pendingProps=a=r,sp(e,l))e.flags&131072&&(Ut=!0);else return t.lanes=e.lanes,Ys(e,t,l)}return Nh(e,t,n,a,l)}function mj(e,t,n){var a=t.pendingProps,l=a.children,r=e!==null?e.memoizedState:null;if(a.mode==="hidden"){if(t.flags&128){if(a=r!==null?r.baseLanes|n:n,e!==null){for(l=t.child=e.child,r=0;l!==null;)r=r|l.lanes|l.childLanes,l=l.sibling;t.childLanes=r&~a}else t.childLanes=0,t.child=null;return Sg(e,t,a,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&_c(t,r!==null?r.cachePool:null),r!==null?hg(t,r):vh(),rj(t);else return t.lanes=t.childLanes=536870912,Sg(e,t,r!==null?r.baseLanes|n:n,n)}else r!==null?(_c(t,r.cachePool),hg(t,r),ma(),t.memoizedState=null):(e!==null&&_c(t,null),vh(),ma());return Ht(e,t,l,n),t.child}function Sg(e,t,n,a){var l=Pm();return l=l===null?null:{parent:Mt._currentValue,pool:l},t.memoizedState={baseLanes:n,cachePool:l},e!==null&&_c(t,null),vh(),rj(t),e!==null&&mo(e,t,a,!0),null}function Sc(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(Z(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Nh(e,t,n,a,l){return rl(t),n=Ym(e,t,n,a,void 0,l),a=Fm(),e!==null&&!Ut?(Km(e,t,l),Ys(e,t,l)):(Ge&&a&&Bm(t),t.flags|=1,Ht(e,t,n,l),t.child)}function Cg(e,t,n,a,l,r){return rl(t),t.updateQueue=null,n=Cb(t,a,n,l),Sb(e),a=Fm(),e!==null&&!Ut?(Km(e,t,r),Ys(e,t,r)):(Ge&&a&&Bm(t),t.flags|=1,Ht(e,t,n,r),t.child)}function Rg(e,t,n,a,l){if(rl(t),t.stateNode===null){var r=Vl,i=n.contextType;typeof i=="object"&&i!==null&&(r=Gt(i)),r=new n(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=wh,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},qm(t),i=n.contextType,r.context=typeof i=="object"&&i!==null?Gt(i):Vl,r.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(nf(t,n,i,a),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(i=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),i!==r.state&&wh.enqueueReplaceState(r,r.state,null),Ni(t,a,r,l),_i(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var o=t.memoizedProps,c=ol(n,o);r.props=c;var d=r.context,f=n.contextType;i=Vl,typeof f=="object"&&f!==null&&(i=Gt(f));var h=n.getDerivedStateFromProps;f=typeof h=="function"||typeof r.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,f||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(o||d!==i)&&wg(t,r,a,i),da=!1;var m=t.memoizedState;r.state=m,Ni(t,a,r,l),_i(),d=t.memoizedState,o||m!==d||da?(typeof h=="function"&&(nf(t,n,h,a),d=t.memoizedState),(c=da||jg(t,n,c,a,m,d,i))?(f||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=d),r.props=a,r.state=d,r.context=i,a=c):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,xh(e,t),i=t.memoizedProps,f=ol(n,i),r.props=f,h=t.pendingProps,m=r.context,d=n.contextType,c=Vl,typeof d=="object"&&d!==null&&(c=Gt(d)),o=n.getDerivedStateFromProps,(d=typeof o=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(i!==h||m!==c)&&wg(t,r,a,c),da=!1,m=t.memoizedState,r.state=m,Ni(t,a,r,l),_i();var x=t.memoizedState;i!==h||m!==x||da||e!==null&&e.dependencies!==null&&Xc(e.dependencies)?(typeof o=="function"&&(nf(t,n,o,a),x=t.memoizedState),(f=da||jg(t,n,f,a,m,x,c)||e!==null&&e.dependencies!==null&&Xc(e.dependencies))?(d||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,x,c),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,x,c)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=x),r.props=a,r.state=x,r.context=c,a=f):(typeof r.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Sc(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=pr(t,e.child,null,l),t.child=pr(t,null,n,l)):Ht(e,t,n,l),t.memoizedState=r.state,e=t.child):e=Ys(e,t,l),e}function Tg(e,t,n,a){return ho(),t.flags|=256,Ht(e,t,n,a),t.child}var sf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function af(e){return{baseLanes:e,cachePool:jb()}}function lf(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Mn),e}function pj(e,t,n){var a=t.pendingProps,l=!1,r=(t.flags&128)!==0,i;if((i=r)||(i=e!==null&&e.memoizedState===null?!1:(Ot.current&2)!==0),i&&(l=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(l?ha(t):ma(),Ge){var o=mt,c;if(c=o){e:{for(c=o,o=ds;c.nodeType!==8;){if(!o){o=null;break e}if(c=Zn(c.nextSibling),c===null){o=null;break e}}o=c}o!==null?(t.memoizedState={dehydrated:o,treeContext:Ja!==null?{id:Us,overflow:Bs}:null,retryLane:536870912,hydrationErrors:null},c=xn(18,null,null,0),c.stateNode=o,c.return=t,t.child=c,Ft=t,mt=null,c=!0):c=!1}c||ll(t)}if(o=t.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return Uh(o)?t.lanes=32:t.lanes=536870912,null;Is(t)}return o=a.children,a=a.fallback,l?(ma(),l=t.mode,o=su({mode:"hidden",children:o},l),a=Wa(a,l,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,l=t.child,l.memoizedState=af(n),l.childLanes=lf(e,i,n),t.memoizedState=sf,a):(ha(t),kh(t,o))}if(c=e.memoizedState,c!==null&&(o=c.dehydrated,o!==null)){if(r)t.flags&256?(ha(t),t.flags&=-257,t=rf(e,t,n)):t.memoizedState!==null?(ma(),t.child=e.child,t.flags|=128,t=null):(ma(),l=a.fallback,o=t.mode,a=su({mode:"visible",children:a.children},o),l=Wa(l,o,n,null),l.flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,pr(t,e.child,null,n),a=t.child,a.memoizedState=af(n),a.childLanes=lf(e,i,n),t.memoizedState=sf,t=l);else if(ha(t),Uh(o)){if(i=o.nextSibling&&o.nextSibling.dataset,i)var d=i.dgst;i=d,a=Error(Z(419)),a.stack="",a.digest=i,Ui({value:a,source:null,stack:null}),t=rf(e,t,n)}else if(Ut||mo(e,t,n,!1),i=(n&e.childLanes)!==0,Ut||i){if(i=nt,i!==null&&(a=n&-n,a=a&42?1:Cm(a),a=a&(i.suspendedLanes|n)?0:a,a!==0&&a!==c.retryLane))throw c.retryLane=a,Rr(e,a),bn(i,e,a),fj;o.data==="$?"||Ah(),t=rf(e,t,n)}else o.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,mt=Zn(o.nextSibling),Ft=t,Ge=!0,el=null,ds=!1,e!==null&&(Rn[Tn++]=Us,Rn[Tn++]=Bs,Rn[Tn++]=Ja,Us=e.id,Bs=e.overflow,Ja=t),t=kh(t,a.children),t.flags|=4096);return t}return l?(ma(),l=a.fallback,o=t.mode,c=e.child,d=c.sibling,a=Ps(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,d!==null?l=Ps(d,l):(l=Wa(l,o,n,null),l.flags|=2),l.return=t,a.return=t,a.sibling=l,t.child=a,a=l,l=t.child,o=e.child.memoizedState,o===null?o=af(n):(c=o.cachePool,c!==null?(d=Mt._currentValue,c=c.parent!==d?{parent:d,pool:d}:c):c=jb(),o={baseLanes:o.baseLanes|n,cachePool:c}),l.memoizedState=o,l.childLanes=lf(e,i,n),t.memoizedState=sf,a):(ha(t),n=e.child,e=n.sibling,n=Ps(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 kh(e,t){return t=su({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function su(e,t){return e=xn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function rf(e,t,n){return pr(t,e.child,null,n),e=kh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Eg(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),fh(e.return,t,n)}function of(e,t,n,a,l){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:l}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=a,r.tail=n,r.tailMode=l)}function xj(e,t,n){var a=t.pendingProps,l=a.revealOrder,r=a.tail;if(Ht(e,t,a.children,n),a=Ot.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&&Eg(e,n,t);else if(e.tag===19)Eg(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(ot(Ot,a),l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&eu(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),of(t,!1,l,n,r);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&eu(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}of(t,!0,n,null,r);break;case"together":of(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ys(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Oa|=t.lanes,!(n&t.childLanes))if(e!==null){if(mo(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,n=Ps(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ps(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sp(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Xc(e)))}function B2(e,t,n){switch(t.tag){case 3:Ic(t,t.stateNode.containerInfo),fa(t,Mt,e.memoizedState.cache),ho();break;case 27:case 5:eh(t);break;case 4:Ic(t,t.stateNode.containerInfo);break;case 10:fa(t,t.type,t.memoizedProps.value);break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ha(t),t.flags|=128,null):n&t.child.childLanes?pj(e,t,n):(ha(t),e=Ys(e,t,n),e!==null?e.sibling:null);ha(t);break;case 19:var l=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(mo(e,t,n,!1),a=(n&t.childLanes)!==0),l){if(a)return xj(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),ot(Ot,Ot.current),a)break;return null;case 22:case 23:return t.lanes=0,mj(e,t,n);case 24:fa(t,Mt,e.memoizedState.cache)}return Ys(e,t,n)}function gj(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ut=!0;else{if(!sp(e,n)&&!(t.flags&128))return Ut=!1,B2(e,t,n);Ut=!!(e.flags&131072)}else Ut=!1,Ge&&t.flags&1048576&&yb(t,Kc,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var a=t.elementType,l=a._init;if(a=l(a._payload),t.type=a,typeof a=="function")Um(a)?(e=ol(a,e),t.tag=1,t=Rg(null,t,a,e,n)):(t.tag=0,t=Nh(null,t,a,e,n));else{if(a!=null){if(l=a.$$typeof,l===Nm){t.tag=11,t=Ng(null,t,a,e,n);break e}else if(l===km){t.tag=14,t=kg(null,t,a,e,n);break e}}throw t=Wf(a)||a,Error(Z(306,t,""))}}return t;case 0:return Nh(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,l=ol(a,t.pendingProps),Rg(e,t,a,l,n);case 3:e:{if(Ic(t,t.stateNode.containerInfo),e===null)throw Error(Z(387));a=t.pendingProps;var r=t.memoizedState;l=r.element,xh(e,t),Ni(t,a,null,n);var i=t.memoizedState;if(a=i.cache,fa(t,Mt,a),a!==r.cache&&hh(t,[Mt],n,!0),_i(),a=i.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Tg(e,t,a,n);break e}else if(a!==l){l=An(Error(Z(424)),t),Ui(l),t=Tg(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(mt=Zn(e.firstChild),Ft=t,Ge=!0,el=null,ds=!0,n=lj(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ho(),a===l){t=Ys(e,t,n);break e}Ht(e,t,a,n)}t=t.child}return t;case 26:return Sc(e,t),e===null?(n=Fg(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ge||(n=t.type,e=t.pendingProps,a=uu(wa.current).createElement(n),a[qt]=t,a[ln]=e,Pt(a,n,e),Lt(a),t.stateNode=a):t.memoizedState=Fg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return eh(t),e===null&&Ge&&(a=t.stateNode=s0(t.type,t.pendingProps,wa.current),Ft=t,ds=!0,l=mt,Ua(t.type)?(Bh=l,mt=Zn(a.firstChild)):mt=l),Ht(e,t,t.pendingProps.children,n),Sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((l=a=mt)&&(a=hC(a,t.type,t.pendingProps,ds),a!==null?(t.stateNode=a,Ft=t,mt=Zn(a.firstChild),ds=!1,l=!0):l=!1),l||ll(t)),eh(t),l=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,a=r.children,zh(l,r)?a=null:i!==null&&zh(l,i)&&(t.flags|=32),t.memoizedState!==null&&(l=Ym(e,t,A2,null,null,n),Gi._currentValue=l),Sc(e,t),Ht(e,t,a,n),t.child;case 6:return e===null&&Ge&&((e=n=mt)&&(n=mC(n,t.pendingProps,ds),n!==null?(t.stateNode=n,Ft=t,mt=null,e=!0):e=!1),e||ll(t)),null;case 13:return pj(e,t,n);case 4:return Ic(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=pr(t,null,a,n):Ht(e,t,a,n),t.child;case 11:return Ng(e,t,t.type,t.pendingProps,n);case 7:return Ht(e,t,t.pendingProps,n),t.child;case 8:return Ht(e,t,t.pendingProps.children,n),t.child;case 12:return Ht(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,fa(t,t.type,a.value),Ht(e,t,a.children,n),t.child;case 9:return l=t.type._context,a=t.pendingProps.children,rl(t),l=Gt(l),a=a(l),t.flags|=1,Ht(e,t,a,n),t.child;case 14:return kg(e,t,t.type,t.pendingProps,n);case 15:return hj(e,t,t.type,t.pendingProps,n);case 19:return xj(e,t,n);case 31:return a=t.pendingProps,n=t.mode,a={mode:a.mode,children:a.children},e===null?(n=su(a,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Ps(e.child,a),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return mj(e,t,n);case 24:return rl(t),a=Gt(Mt),e===null?(l=Pm(),l===null&&(l=nt,r=Im(),l.pooledCache=r,r.refCount++,r!==null&&(l.pooledCacheLanes|=n),l=r),t.memoizedState={parent:a,cache:l},qm(t),fa(t,Mt,l)):(e.lanes&n&&(xh(e,t),Ni(t,null,null,n),_i()),l=e.memoizedState,r=t.memoizedState,l.parent!==a?(l={parent:a,cache:a},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),fa(t,Mt,a)):(a=r.cache,fa(t,Mt,a),a!==l.cache&&hh(t,[Mt],n,!0))),Ht(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(Z(156,t.tag))}function Es(e){e.flags|=4}function Ag(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!r0(t)){if(t=Ln.current,t!==null&&((Ie&4194048)===Ie?ys!==null:(Ie&62914560)!==Ie&&!(Ie&536870912)||t!==ys))throw ji=ph,wb;e.flags|=8192}}function Zo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qy():536870912,e.lanes|=t,xr|=t)}function Wr(e,t){if(!Ge)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 ct(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags&65011712,a|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags,a|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function H2(e,t,n){var a=t.pendingProps;switch(Hm(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ct(t),null;case 1:return ct(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),qs(Mt),cr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Qr(t)?Es(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ig())),ct(t),null;case 26:return n=t.memoizedState,e===null?(Es(t),n!==null?(ct(t),Ag(t,n)):(ct(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Es(t),ct(t),Ag(t,n)):(ct(t),t.flags&=-16777217):(e.memoizedProps!==a&&Es(t),ct(t),t.flags&=-16777217),null;case 27:Pc(t),n=wa.current;var l=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Es(t);else{if(!a){if(t.stateNode===null)throw Error(Z(166));return ct(t),null}e=gs.current,Qr(t)?lg(t):(e=s0(l,a,n),t.stateNode=e,Es(t))}return ct(t),null;case 5:if(Pc(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Es(t);else{if(!a){if(t.stateNode===null)throw Error(Z(166));return ct(t),null}if(e=gs.current,Qr(t))lg(t);else{switch(l=uu(wa.current),e){case 1:e=l.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=l.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=l.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=l.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof a.is=="string"?l.createElement("select",{is:a.is}):l.createElement("select"),a.multiple?e.multiple=!0:a.size&&(e.size=a.size);break;default:e=typeof a.is=="string"?l.createElement(n,{is:a.is}):l.createElement(n)}}e[qt]=t,e[ln]=a;e:for(l=t.child;l!==null;){if(l.tag===5||l.tag===6)e.appendChild(l.stateNode);else if(l.tag!==4&&l.tag!==27&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;l.sibling===null;){if(l.return===null||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}t.stateNode=e;e:switch(Pt(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&&Es(t)}}return ct(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Es(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(Z(166));if(e=wa.current,Qr(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=Ft,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[qt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||e0(e.nodeValue,n)),e||ll(t)}else e=uu(e).createTextNode(a),e[qt]=t,t.stateNode=e}return ct(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Qr(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(Z(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(Z(317));l[qt]=t}else ho(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ct(t),l=!1}else l=ig(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(Is(t),t):(Is(t),null)}if(Is(t),t.flags&128)return t.lanes=n,t;if(n=a!==null,e=e!==null&&e.memoizedState!==null,n){a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool);var r=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==l&&(a.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Zo(t,t.updateQueue),ct(t),null;case 4:return cr(),e===null&&dp(t.stateNode.containerInfo),ct(t),null;case 10:return qs(t.type),ct(t),null;case 19:if(Bt(Ot),l=t.memoizedState,l===null)return ct(t),null;if(a=(t.flags&128)!==0,r=l.rendering,r===null)if(a)Wr(l,!1);else{if(pt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(r=eu(e),r!==null){for(t.flags|=128,Wr(l,!1),e=r.updateQueue,t.updateQueue=e,Zo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vb(n,e),n=n.sibling;return ot(Ot,Ot.current&1|2),t.child}e=e.sibling}l.tail!==null&&vs()>lu&&(t.flags|=128,a=!0,Wr(l,!1),t.lanes=4194304)}else{if(!a)if(e=eu(r),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Zo(t,e),Wr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!r.alternate&&!Ge)return ct(t),null}else 2*vs()-l.renderingStartTime>lu&&n!==536870912&&(t.flags|=128,a=!0,Wr(l,!1),t.lanes=4194304);l.isBackwards?(r.sibling=t.child,t.child=r):(e=l.last,e!==null?e.sibling=r:t.child=r,l.last=r)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=vs(),t.sibling=null,e=Ot.current,ot(Ot,a?e&1|2:e&1),t):(ct(t),null);case 22:case 23:return Is(t),Gm(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?n&536870912&&!(t.flags&128)&&(ct(t),t.subtreeFlags&6&&(t.flags|=8192)):ct(t),n=t.updateQueue,n!==null&&Zo(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&&Bt(tl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qs(Mt),ct(t),null;case 25:return null;case 30:return null}throw Error(Z(156,t.tag))}function I2(e,t){switch(Hm(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qs(Mt),cr(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pc(t),null;case 13:if(Is(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));ho()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bt(Ot),null;case 4:return cr(),null;case 10:return qs(t.type),null;case 22:case 23:return Is(t),Gm(),e!==null&&Bt(tl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qs(Mt),null;case 25:return null;default:return null}}function vj(e,t){switch(Hm(t),t.tag){case 3:qs(Mt),cr();break;case 26:case 27:case 5:Pc(t);break;case 4:cr();break;case 13:Is(t);break;case 19:Bt(Ot);break;case 10:qs(t.type);break;case 22:case 23:Is(t),Gm(),e!==null&&Bt(tl);break;case 24:qs(Mt)}}function yo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var r=n.create,i=n.inst;a=r(),i.destroy=a}n=n.next}while(n!==l)}}catch(o){tt(t,t.return,o)}}function Ma(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var r=l.next;a=r;do{if((a.tag&e)===e){var i=a.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,l=t;var c=n,d=o;try{d()}catch(f){tt(l,c,f)}}}a=a.next}while(a!==r)}}catch(f){tt(t,t.return,f)}}function yj(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{kb(t,n)}catch(a){tt(e,e.return,a)}}}function bj(e,t,n){n.props=ol(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){tt(e,t,a)}}function Si(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(l){tt(e,t,l)}}function ms(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){tt(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){tt(e,t,l)}else n.current=null}function jj(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(l){tt(e,e.return,l)}}function cf(e,t,n){try{var a=e.stateNode;oC(a,e.type,n,t),a[ln]=t}catch(l){tt(e,e.return,l)}}function wj(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ua(e.type)||e.tag===4}function uf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wj(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&&Ua(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 Sh(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=Zu));else if(a!==4&&(a===27&&Ua(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Sh(e,t,n),e=e.sibling;e!==null;)Sh(e,t,n),e=e.sibling}function au(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&&Ua(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(au(e,t,n),e=e.sibling;e!==null;)au(e,t,n),e=e.sibling}function _j(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);Pt(t,a,n),t[qt]=e,t[ln]=n}catch(r){tt(e,e.return,r)}}var zs=!1,jt=!1,df=!1,Mg=typeof WeakSet=="function"?WeakSet:Set,zt=null;function P2(e,t){if(e=e.containerInfo,$h=mu,e=ub(e),Dm(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 l=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var i=0,o=-1,c=-1,d=0,f=0,h=e,m=null;t:for(;;){for(var x;h!==n||l!==0&&h.nodeType!==3||(o=i+l),h!==r||a!==0&&h.nodeType!==3||(c=i+a),h.nodeType===3&&(i+=h.nodeValue.length),(x=h.firstChild)!==null;)m=h,h=x;for(;;){if(h===e)break t;if(m===n&&++d===l&&(o=i),m===r&&++f===a&&(c=i),(x=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=x}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Dh={focusedElem:e,selectionRange:n},mu=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,r=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&r!==null){e=void 0,n=t,l=r.memoizedProps,r=r.memoizedState,a=n.stateNode;try{var j=ol(n.type,l,n.elementType===n.type);e=a.getSnapshotBeforeUpdate(j,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(v){tt(n,n.return,v)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Lh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lh(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(Z(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function Nj(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:aa(e,n),a&4&&yo(5,n);break;case 1:if(aa(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){tt(n,n.return,i)}else{var l=ol(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){tt(n,n.return,i)}}a&64&&yj(n),a&512&&Si(n,n.return);break;case 3:if(aa(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{kb(e,t)}catch(i){tt(n,n.return,i)}}break;case 27:t===null&&a&4&&_j(n);case 26:case 5:aa(e,n),t===null&&a&4&&jj(n),a&512&&Si(n,n.return);break;case 12:aa(e,n);break;case 13:aa(e,n),a&4&&Cj(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Z2.bind(null,n),pC(e,n))));break;case 22:if(a=n.memoizedState!==null||zs,!a){t=t!==null&&t.memoizedState!==null||jt,l=zs;var r=jt;zs=a,(jt=t)&&!r?oa(e,n,(n.subtreeFlags&8772)!==0):aa(e,n),zs=l,jt=r}break;case 30:break;default:aa(e,n)}}function kj(e){var t=e.alternate;t!==null&&(e.alternate=null,kj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tm(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 rt=null,nn=!1;function As(e,t,n){for(n=n.child;n!==null;)Sj(e,t,n),n=n.sibling}function Sj(e,t,n){if(gn&&typeof gn.onCommitFiberUnmount=="function")try{gn.onCommitFiberUnmount(io,n)}catch{}switch(n.tag){case 26:jt||ms(n,t),As(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:jt||ms(n,t);var a=rt,l=nn;Ua(n.type)&&(rt=n.stateNode,nn=!1),As(e,t,n),Ei(n.stateNode),rt=a,nn=l;break;case 5:jt||ms(n,t);case 6:if(a=rt,l=nn,rt=null,As(e,t,n),rt=a,nn=l,rt!==null)if(nn)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(n.stateNode)}catch(r){tt(n,t,r)}else try{rt.removeChild(n.stateNode)}catch(r){tt(n,t,r)}break;case 18:rt!==null&&(nn?(e=rt,Gg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Fi(e)):Gg(rt,n.stateNode));break;case 4:a=rt,l=nn,rt=n.stateNode.containerInfo,nn=!0,As(e,t,n),rt=a,nn=l;break;case 0:case 11:case 14:case 15:jt||Ma(2,n,t),jt||Ma(4,n,t),As(e,t,n);break;case 1:jt||(ms(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&bj(n,t,a)),As(e,t,n);break;case 21:As(e,t,n);break;case 22:jt=(a=jt)||n.memoizedState!==null,As(e,t,n),jt=a;break;default:As(e,t,n)}}function Cj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fi(e)}catch(n){tt(t,t.return,n)}}function q2(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Mg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Mg),t;default:throw Error(Z(435,e.tag))}}function ff(e,t){var n=q2(e);t.forEach(function(a){var l=W2.bind(null,e,a);n.has(a)||(n.add(a),a.then(l,l))})}function dn(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var l=n[a],r=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 27:if(Ua(o.type)){rt=o.stateNode,nn=!1;break e}break;case 5:rt=o.stateNode,nn=!1;break e;case 3:case 4:rt=o.stateNode.containerInfo,nn=!0;break e}o=o.return}if(rt===null)throw Error(Z(160));Sj(r,i,l),rt=null,nn=!1,r=l.alternate,r!==null&&(r.return=null),l.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Rj(t,e),t=t.sibling}var Fn=null;function Rj(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dn(t,e),fn(e),a&4&&(Ma(3,e,e.return),yo(3,e),Ma(5,e,e.return));break;case 1:dn(t,e),fn(e),a&512&&(jt||n===null||ms(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 l=Fn;if(dn(t,e),fn(e),a&512&&(jt||n===null||ms(n,n.return)),a&4){var r=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,l=l.ownerDocument||l;t:switch(a){case"title":r=l.getElementsByTagName("title")[0],(!r||r[uo]||r[qt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=l.createElement(a),l.head.insertBefore(r,l.querySelector("head > title"))),Pt(r,a,n),r[qt]=e,Lt(r),a=r;break e;case"link":var i=Xg("link","href",l).get(a+(n.href||""));if(i){for(var o=0;o<i.length;o++)if(r=i[o],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(o,1);break t}}r=l.createElement(a),Pt(r,a,n),l.head.appendChild(r);break;case"meta":if(i=Xg("meta","content",l).get(a+(n.content||""))){for(o=0;o<i.length;o++)if(r=i[o],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(o,1);break t}}r=l.createElement(a),Pt(r,a,n),l.head.appendChild(r);break;default:throw Error(Z(468,a))}r[qt]=e,Lt(r),a=r}e.stateNode=a}else Qg(l,e.type,e.stateNode);else e.stateNode=Kg(l,a,e.memoizedProps);else r!==a?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,a===null?Qg(l,e.type,e.stateNode):Kg(l,a,e.memoizedProps)):a===null&&e.stateNode!==null&&cf(e,e.memoizedProps,n.memoizedProps)}break;case 27:dn(t,e),fn(e),a&512&&(jt||n===null||ms(n,n.return)),n!==null&&a&4&&cf(e,e.memoizedProps,n.memoizedProps);break;case 5:if(dn(t,e),fn(e),a&512&&(jt||n===null||ms(n,n.return)),e.flags&32){l=e.stateNode;try{dr(l,"")}catch(x){tt(e,e.return,x)}}a&4&&e.stateNode!=null&&(l=e.memoizedProps,cf(e,l,n!==null?n.memoizedProps:l)),a&1024&&(df=!0);break;case 6:if(dn(t,e),fn(e),a&4){if(e.stateNode===null)throw Error(Z(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(x){tt(e,e.return,x)}}break;case 3:if(Tc=null,l=Fn,Fn=du(t.containerInfo),dn(t,e),Fn=l,fn(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Fi(t.containerInfo)}catch(x){tt(e,e.return,x)}df&&(df=!1,Tj(e));break;case 4:a=Fn,Fn=du(e.stateNode.containerInfo),dn(t,e),fn(e),Fn=a;break;case 12:dn(t,e),fn(e);break;case 13:dn(t,e),fn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(op=vs()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ff(e,a)));break;case 22:l=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=zs,f=jt;if(zs=d||l,jt=f||c,dn(t,e),jt=f,zs=d,fn(e),a&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(n===null||c||zs||jt||Xa(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(r=c.stateNode,l)i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{o=c.stateNode;var h=c.memoizedProps.style,m=h!=null&&h.hasOwnProperty("display")?h.display:null;o.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(x){tt(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=l?"":c.memoizedProps}catch(x){tt(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,ff(e,n))));break;case 19:dn(t,e),fn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ff(e,a)));break;case 30:break;case 21:break;default:dn(t,e),fn(e)}}function fn(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(wj(a)){n=a;break}a=a.return}if(n==null)throw Error(Z(160));switch(n.tag){case 27:var l=n.stateNode,r=uf(e);au(e,r,l);break;case 5:var i=n.stateNode;n.flags&32&&(dr(i,""),n.flags&=-33);var o=uf(e);au(e,o,i);break;case 3:case 4:var c=n.stateNode.containerInfo,d=uf(e);Sh(e,d,c);break;default:throw Error(Z(161))}}catch(f){tt(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tj(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tj(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function aa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Nj(e,t.alternate,t),t=t.sibling}function Xa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ma(4,t,t.return),Xa(t);break;case 1:ms(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&bj(t,t.return,n),Xa(t);break;case 27:Ei(t.stateNode);case 26:case 5:ms(t,t.return),Xa(t);break;case 22:t.memoizedState===null&&Xa(t);break;case 30:Xa(t);break;default:Xa(t)}e=e.sibling}}function oa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,l=e,r=t,i=r.flags;switch(r.tag){case 0:case 11:case 15:oa(l,r,n),yo(4,r);break;case 1:if(oa(l,r,n),a=r,l=a.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(d){tt(a,a.return,d)}if(a=r,l=a.updateQueue,l!==null){var o=a.stateNode;try{var c=l.shared.hiddenCallbacks;if(c!==null)for(l.shared.hiddenCallbacks=null,l=0;l<c.length;l++)Nb(c[l],o)}catch(d){tt(a,a.return,d)}}n&&i&64&&yj(r),Si(r,r.return);break;case 27:_j(r);case 26:case 5:oa(l,r,n),n&&a===null&&i&4&&jj(r),Si(r,r.return);break;case 12:oa(l,r,n);break;case 13:oa(l,r,n),n&&i&4&&Cj(l,r);break;case 22:r.memoizedState===null&&oa(l,r,n),Si(r,r.return);break;case 30:break;default:oa(l,r,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&&po(n))}function lp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&po(e))}function us(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ej(e,t,n,a),t=t.sibling}function Ej(e,t,n,a){var l=t.flags;switch(t.tag){case 0:case 11:case 15:us(e,t,n,a),l&2048&&yo(9,t);break;case 1:us(e,t,n,a);break;case 3:us(e,t,n,a),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&po(e)));break;case 12:if(l&2048){us(e,t,n,a),e=t.stateNode;try{var r=t.memoizedProps,i=r.id,o=r.onPostCommit;typeof o=="function"&&o(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){tt(t,t.return,c)}}else us(e,t,n,a);break;case 13:us(e,t,n,a);break;case 23:break;case 22:r=t.stateNode,i=t.alternate,t.memoizedState!==null?r._visibility&2?us(e,t,n,a):Ci(e,t):r._visibility&2?us(e,t,n,a):(r._visibility|=2,Dl(e,t,n,a,(t.subtreeFlags&10256)!==0)),l&2048&&ap(i,t);break;case 24:us(e,t,n,a),l&2048&&lp(t.alternate,t);break;default:us(e,t,n,a)}}function Dl(e,t,n,a,l){for(l=l&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var r=e,i=t,o=n,c=a,d=i.flags;switch(i.tag){case 0:case 11:case 15:Dl(r,i,o,c,l),yo(8,i);break;case 23:break;case 22:var f=i.stateNode;i.memoizedState!==null?f._visibility&2?Dl(r,i,o,c,l):Ci(r,i):(f._visibility|=2,Dl(r,i,o,c,l)),l&&d&2048&&ap(i.alternate,i);break;case 24:Dl(r,i,o,c,l),l&&d&2048&&lp(i.alternate,i);break;default:Dl(r,i,o,c,l)}t=t.sibling}}function Ci(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,l=a.flags;switch(a.tag){case 22:Ci(n,a),l&2048&&ap(a.alternate,a);break;case 24:Ci(n,a),l&2048&&lp(a.alternate,a);break;default:Ci(n,a)}t=t.sibling}}var oi=8192;function _l(e){if(e.subtreeFlags&oi)for(e=e.child;e!==null;)Aj(e),e=e.sibling}function Aj(e){switch(e.tag){case 26:_l(e),e.flags&oi&&e.memoizedState!==null&&RC(Fn,e.memoizedState,e.memoizedProps);break;case 5:_l(e);break;case 3:case 4:var t=Fn;Fn=du(e.stateNode.containerInfo),_l(e),Fn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=oi,oi=16777216,_l(e),oi=t):_l(e));break;default:_l(e)}}function Mj(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 Jr(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];zt=a,$j(a,e)}Mj(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Oj(e),e=e.sibling}function Oj(e){switch(e.tag){case 0:case 11:case 15:Jr(e),e.flags&2048&&Ma(9,e,e.return);break;case 3:Jr(e);break;case 12:Jr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Cc(e)):Jr(e);break;default:Jr(e)}}function Cc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];zt=a,$j(a,e)}Mj(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ma(8,t,t.return),Cc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Cc(t));break;default:Cc(t)}e=e.sibling}}function $j(e,t){for(;zt!==null;){var n=zt;switch(n.tag){case 0:case 11:case 15:Ma(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:po(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,zt=a;else e:for(n=e;zt!==null;){a=zt;var l=a.sibling,r=a.return;if(kj(a),a===n){zt=null;break e}if(l!==null){l.return=r,zt=l;break e}zt=r}}}var G2={getCacheForType:function(e){var t=Gt(Mt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},V2=typeof WeakMap=="function"?WeakMap:Map,Qe=0,nt=null,ze=null,Ie=0,Xe=0,mn=null,va=!1,Tr=!1,rp=!1,Fs=0,pt=0,Oa=0,nl=0,ip=0,Mn=0,xr=0,Ri=null,sn=null,Ch=!1,op=0,lu=1/0,ru=null,ka=null,It=0,Sa=null,gr=null,sr=0,Rh=0,Th=null,Dj=null,Ti=0,Eh=null;function yn(){if(Qe&2&&Ie!==0)return Ie&-Ie;if(Ce.T!==null){var e=fr;return e!==0?e:up()}return Yy()}function zj(){Mn===0&&(Mn=!(Ie&536870912)||Ge?Py():536870912);var e=Ln.current;return e!==null&&(e.flags|=32),Mn}function bn(e,t,n){(e===nt&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)&&(vr(e,0),ya(e,Ie,Mn,!1)),co(e,n),(!(Qe&2)||e!==nt)&&(e===nt&&(!(Qe&2)&&(nl|=n),pt===4&&ya(e,Ie,Mn,!1)),ks(e))}function Lj(e,t,n){if(Qe&6)throw Error(Z(327));var a=!n&&(t&124)===0&&(t&e.expiredLanes)===0||oo(e,t),l=a?K2(e,t):hf(e,t,!0),r=a;do{if(l===0){Tr&&!a&&ya(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!Y2(n)){l=hf(e,t,!1),r=!1;continue}if(l===2){if(r=t,e.errorRecoveryDisabledLanes&r)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;l=Ri;var c=o.current.memoizedState.isDehydrated;if(c&&(vr(o,i).flags|=256),i=hf(o,i,!1),i!==2){if(rp&&!c){o.errorRecoveryDisabledLanes|=r,nl|=r,l=4;break e}r=sn,sn=l,r!==null&&(sn===null?sn=r:sn.push.apply(sn,r))}l=i}if(r=!1,l!==2)continue}}if(l===1){vr(e,0),ya(e,t,0,!0);break}e:{switch(a=e,r=l,r){case 0:case 1:throw Error(Z(345));case 4:if((t&4194048)!==t)break;case 6:ya(a,t,Mn,!va);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(Z(329))}if((t&62914560)===t&&(l=op+300-vs(),10<l)){if(ya(a,t,Mn,!va),Uu(a,0,!0)!==0)break e;a.timeoutHandle=n0(Og.bind(null,a,n,sn,ru,Ch,t,Mn,nl,xr,va,r,2,-0,0),l);break e}Og(a,n,sn,ru,Ch,t,Mn,nl,xr,va,r,0,-0,0)}}break}while(!0);ks(e)}function Og(e,t,n,a,l,r,i,o,c,d,f,h,m,x){if(e.timeoutHandle=-1,h=t.subtreeFlags,(h&8192||(h&16785408)===16785408)&&(qi={stylesheets:null,count:0,unsuspend:CC},Aj(t),h=TC(),h!==null)){e.cancelPendingCommit=h(Dg.bind(null,e,t,r,n,a,l,i,o,c,f,1,m,x)),ya(e,r,i,!d);return}Dg(e,t,r,n,a,l,i,o,c)}function Y2(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 l=n[a],r=l.getSnapshot;l=l.value;try{if(!wn(r(),l))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 ya(e,t,n,a){t&=~ip,t&=~nl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var l=t;0<l;){var r=31-vn(l),i=1<<r;a[r]=-1,l&=~i}n!==0&&Gy(e,n,t)}function Ku(){return Qe&6?!0:(bo(0),!1)}function cp(){if(ze!==null){if(Xe===0)var e=ze.return;else e=ze,Hs=vl=null,Xm(e),nr=null,Hi=0,e=ze;for(;e!==null;)vj(e.alternate,e),e=e.return;ze=null}}function vr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,uC(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cp(),nt=e,ze=n=Ps(e.current,null),Ie=t,Xe=0,mn=null,va=!1,Tr=oo(e,t),rp=!1,xr=Mn=ip=nl=Oa=pt=0,sn=Ri=null,Ch=!1,t&8&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-vn(a),r=1<<l;t|=e[l],a&=~r}return Fs=t,Pu(),n}function Uj(e,t){$e=null,Ce.H=Jc,t===xo||t===Gu?(t=dg(),Xe=3):t===wb?(t=dg(),Xe=4):Xe=t===fj?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,mn=t,ze===null&&(pt=1,nu(e,An(t,e.current)))}function Bj(){var e=Ce.H;return Ce.H=Jc,e===null?Jc:e}function Hj(){var e=Ce.A;return Ce.A=G2,e}function Ah(){pt=4,va||(Ie&4194048)!==Ie&&Ln.current!==null||(Tr=!0),!(Oa&134217727)&&!(nl&134217727)||nt===null||ya(nt,Ie,Mn,!1)}function hf(e,t,n){var a=Qe;Qe|=2;var l=Bj(),r=Hj();(nt!==e||Ie!==t)&&(ru=null,vr(e,t)),t=!1;var i=pt;e:do try{if(Xe!==0&&ze!==null){var o=ze,c=mn;switch(Xe){case 8:cp(),i=6;break e;case 3:case 2:case 9:case 6:Ln.current===null&&(t=!0);var d=Xe;if(Xe=0,mn=null,Kl(e,o,c,d),n&&Tr){i=0;break e}break;default:d=Xe,Xe=0,mn=null,Kl(e,o,c,d)}}F2(),i=pt;break}catch(f){Uj(e,f)}while(!0);return t&&e.shellSuspendCounter++,Hs=vl=null,Qe=a,Ce.H=l,Ce.A=r,ze===null&&(nt=null,Ie=0,Pu()),i}function F2(){for(;ze!==null;)Ij(ze)}function K2(e,t){var n=Qe;Qe|=2;var a=Bj(),l=Hj();nt!==e||Ie!==t?(ru=null,lu=vs()+500,vr(e,t)):Tr=oo(e,t);e:do try{if(Xe!==0&&ze!==null){t=ze;var r=mn;t:switch(Xe){case 1:Xe=0,mn=null,Kl(e,t,r,1);break;case 2:case 9:if(ug(r)){Xe=0,mn=null,$g(t);break}t=function(){Xe!==2&&Xe!==9||nt!==e||(Xe=7),ks(e)},r.then(t,t);break e;case 3:Xe=7;break e;case 4:Xe=5;break e;case 7:ug(r)?(Xe=0,mn=null,$g(t)):(Xe=0,mn=null,Kl(e,t,r,7));break;case 5:var i=null;switch(ze.tag){case 26:i=ze.memoizedState;case 5:case 27:var o=ze;if(!i||r0(i)){Xe=0,mn=null;var c=o.sibling;if(c!==null)ze=c;else{var d=o.return;d!==null?(ze=d,Xu(d)):ze=null}break t}}Xe=0,mn=null,Kl(e,t,r,5);break;case 6:Xe=0,mn=null,Kl(e,t,r,6);break;case 8:cp(),pt=6;break e;default:throw Error(Z(462))}}X2();break}catch(f){Uj(e,f)}while(!0);return Hs=vl=null,Ce.H=a,Ce.A=l,Qe=n,ze!==null?0:(nt=null,Ie=0,Pu(),pt)}function X2(){for(;ze!==null&&!gS();)Ij(ze)}function Ij(e){var t=gj(e.alternate,e,Fs);e.memoizedProps=e.pendingProps,t===null?Xu(e):ze=t}function $g(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Cg(n,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=Cg(n,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:Xm(t);default:vj(n,t),t=ze=vb(t,Fs),t=gj(n,t,Fs)}e.memoizedProps=e.pendingProps,t===null?Xu(e):ze=t}function Kl(e,t,n,a){Hs=vl=null,Xm(t),nr=null,Hi=0;var l=t.return;try{if(U2(e,l,t,n,Ie)){pt=1,nu(e,An(n,e.current)),ze=null;return}}catch(r){if(l!==null)throw ze=l,r;pt=1,nu(e,An(n,e.current)),ze=null;return}t.flags&32768?(Ge||a===1?e=!0:Tr||Ie&536870912?e=!1:(va=e=!0,(a===2||a===9||a===3||a===6)&&(a=Ln.current,a!==null&&a.tag===13&&(a.flags|=16384))),Pj(t,e)):Xu(t)}function Xu(e){var t=e;do{if(t.flags&32768){Pj(t,va);return}e=t.return;var n=H2(t.alternate,t,Fs);if(n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);pt===0&&(pt=5)}function Pj(e,t){do{var n=I2(e.alternate,e);if(n!==null){n.flags&=32767,ze=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=n}while(e!==null);pt=6,ze=null}function Dg(e,t,n,a,l,r,i,o,c){e.cancelPendingCommit=null;do Qu();while(It!==0);if(Qe&6)throw Error(Z(327));if(t!==null){if(t===e.current)throw Error(Z(177));if(r=t.lanes|t.childLanes,r|=zm,CS(e,n,r,i,o,c),e===nt&&(ze=nt=null,Ie=0),gr=t,Sa=e,sr=n,Rh=r,Th=l,Dj=a,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,J2(qc,function(){return Fj(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,t.subtreeFlags&13878||a){a=Ce.T,Ce.T=null,l=Ve.p,Ve.p=2,i=Qe,Qe|=4;try{P2(e,t,n)}finally{Qe=i,Ve.p=l,Ce.T=a}}It=1,qj(),Gj(),Vj()}}function qj(){if(It===1){It=0;var e=Sa,t=gr,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=Ce.T,Ce.T=null;var a=Ve.p;Ve.p=2;var l=Qe;Qe|=4;try{Rj(t,e);var r=Dh,i=ub(e.containerInfo),o=r.focusedElem,c=r.selectionRange;if(i!==o&&o&&o.ownerDocument&&cb(o.ownerDocument.documentElement,o)){if(c!==null&&Dm(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 h=o.ownerDocument||document,m=h&&h.defaultView||window;if(m.getSelection){var x=m.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=ng(o,v),p=ng(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=h.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(h=[],x=o;x=x.parentNode;)x.nodeType===1&&h.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<h.length;o++){var w=h[o];w.element.scrollLeft=w.left,w.element.scrollTop=w.top}}mu=!!$h,Dh=$h=null}finally{Qe=l,Ve.p=a,Ce.T=n}}e.current=t,It=2}}function Gj(){if(It===2){It=0;var e=Sa,t=gr,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=Ce.T,Ce.T=null;var a=Ve.p;Ve.p=2;var l=Qe;Qe|=4;try{Nj(e,t.alternate,t)}finally{Qe=l,Ve.p=a,Ce.T=n}}It=3}}function Vj(){if(It===4||It===3){It=0,vS();var e=Sa,t=gr,n=sr,a=Dj;t.subtreeFlags&10256||t.flags&10256?It=5:(It=0,gr=Sa=null,Yj(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(ka=null),Rm(n),t=t.stateNode,gn&&typeof gn.onCommitFiberRoot=="function")try{gn.onCommitFiberRoot(io,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=Ce.T,l=Ve.p,Ve.p=2,Ce.T=null;try{for(var r=e.onRecoverableError,i=0;i<a.length;i++){var o=a[i];r(o.value,{componentStack:o.stack})}}finally{Ce.T=t,Ve.p=l}}sr&3&&Qu(),ks(e),l=e.pendingLanes,n&4194090&&l&42?e===Eh?Ti++:(Ti=0,Eh=e):Ti=0,bo(0)}}function Yj(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,po(t)))}function Qu(e){return qj(),Gj(),Vj(),Fj()}function Fj(){if(It!==5)return!1;var e=Sa,t=Rh;Rh=0;var n=Rm(sr),a=Ce.T,l=Ve.p;try{Ve.p=32>n?32:n,Ce.T=null,n=Th,Th=null;var r=Sa,i=sr;if(It=0,gr=Sa=null,sr=0,Qe&6)throw Error(Z(331));var o=Qe;if(Qe|=4,Oj(r.current),Ej(r,r.current,i,n),Qe=o,bo(0,!1),gn&&typeof gn.onPostCommitFiberRoot=="function")try{gn.onPostCommitFiberRoot(io,r)}catch{}return!0}finally{Ve.p=l,Ce.T=a,Yj(e,t)}}function zg(e,t,n){t=An(n,t),t=_h(e.stateNode,t,2),e=Na(e,t,2),e!==null&&(co(e,2),ks(e))}function tt(e,t,n){if(e.tag===3)zg(e,e,n);else for(;t!==null;){if(t.tag===3){zg(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ka===null||!ka.has(a))){e=An(n,e),n=uj(2),a=Na(t,n,2),a!==null&&(dj(n,a,t,e),co(a,2),ks(a));break}}t=t.return}}function mf(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new V2;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(rp=!0,l.add(n),e=Q2.bind(null,e,t,n),t.then(e,e))}function Q2(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,nt===e&&(Ie&n)===n&&(pt===4||pt===3&&(Ie&62914560)===Ie&&300>vs()-op?!(Qe&2)&&vr(e,0):ip|=n,xr===Ie&&(xr=0)),ks(e)}function Kj(e,t){t===0&&(t=qy()),e=Rr(e,t),e!==null&&(co(e,t),ks(e))}function Z2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Kj(e,n)}function W2(e,t){var n=0;switch(e.tag){case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(Z(314))}a!==null&&a.delete(t),Kj(e,n)}function J2(e,t){return Sm(e,t)}var iu=null,zl=null,Mh=!1,ou=!1,pf=!1,sl=0;function ks(e){e!==zl&&e.next===null&&(zl===null?iu=zl=e:zl=zl.next=e),ou=!0,Mh||(Mh=!0,tC())}function bo(e,t){if(!pf&&ou){pf=!0;do for(var n=!1,a=iu;a!==null;){if(e!==0){var l=a.pendingLanes;if(l===0)var r=0;else{var i=a.suspendedLanes,o=a.pingedLanes;r=(1<<31-vn(42|e)+1)-1,r&=l&~(i&~o),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Lg(a,r))}else r=Ie,r=Uu(a,a===nt?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),!(r&3)||oo(a,r)||(n=!0,Lg(a,r));a=a.next}while(n);pf=!1}}function eC(){Xj()}function Xj(){ou=Mh=!1;var e=0;sl!==0&&(cC()&&(e=sl),sl=0);for(var t=vs(),n=null,a=iu;a!==null;){var l=a.next,r=Qj(a,t);r===0?(a.next=null,n===null?iu=l:n.next=l,l===null&&(zl=n)):(n=a,(e!==0||r&3)&&(ou=!0)),a=l}bo(e)}function Qj(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var i=31-vn(r),o=1<<i,c=l[i];c===-1?(!(o&n)||o&a)&&(l[i]=SS(o,t)):c<=t&&(e.expiredLanes|=o),r&=~o}if(t=nt,n=Ie,n=Uu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Xe===2||Xe===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Hd(a),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||oo(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Hd(a),Rm(n)){case 2:case 8:n=Hy;break;case 32:n=qc;break;case 268435456:n=Iy;break;default:n=qc}return a=Zj.bind(null,e),n=Sm(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Hd(a),e.callbackPriority=2,e.callbackNode=null,2}function Zj(e,t){if(It!==0&&It!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qu()&&e.callbackNode!==n)return null;var a=Ie;return a=Uu(e,e===nt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Lj(e,a,t),Qj(e,vs()),e.callbackNode!=null&&e.callbackNode===n?Zj.bind(null,e):null)}function Lg(e,t){if(Qu())return null;Lj(e,t,!0)}function tC(){dC(function(){Qe&6?Sm(By,eC):Xj()})}function up(){return sl===0&&(sl=Py()),sl}function Ug(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:yc(""+e)}function Bg(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 nC(e,t,n,a,l){if(t==="submit"&&n&&n.stateNode===l){var r=Ug((l[ln]||null).action),i=a.submitter;i&&(t=(t=i[ln]||null)?Ug(t.formAction):i.getAttribute("formAction"),t!==null&&(r=t,i=null));var o=new Bu("action","action",null,a,l);e.push({event:o,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(sl!==0){var c=i?Bg(l,i):new FormData(l);jh(n,{pending:!0,data:c,method:l.method,action:r},null,c)}}else typeof r=="function"&&(o.preventDefault(),c=i?Bg(l,i):new FormData(l),jh(n,{pending:!0,data:c,method:l.method,action:r},r,c))},currentTarget:l}]})}}for(var xf=0;xf<ch.length;xf++){var gf=ch[xf],sC=gf.toLowerCase(),aC=gf[0].toUpperCase()+gf.slice(1);as(sC,"on"+aC)}as(fb,"onAnimationEnd");as(hb,"onAnimationIteration");as(mb,"onAnimationStart");as("dblclick","onDoubleClick");as("focusin","onFocus");as("focusout","onBlur");as(j2,"onTransitionRun");as(w2,"onTransitionStart");as(_2,"onTransitionCancel");as(pb,"onTransitionEnd");ur("onMouseEnter",["mouseout","mouseover"]);ur("onMouseLeave",["mouseout","mouseover"]);ur("onPointerEnter",["pointerout","pointerover"]);ur("onPointerLeave",["pointerout","pointerover"]);pl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pl("onBeforeInput",["compositionend","keypress","textInput","paste"]);pl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ii="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(" "),lC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ii));function Wj(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],l=a.event;a=a.listeners;e:{var r=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!==r&&l.isPropagationStopped())break e;r=o,l.currentTarget=d;try{r(l)}catch(f){tu(f)}l.currentTarget=null,r=c}else for(i=0;i<a.length;i++){if(o=a[i],c=o.instance,d=o.currentTarget,o=o.listener,c!==r&&l.isPropagationStopped())break e;r=o,l.currentTarget=d;try{r(l)}catch(f){tu(f)}l.currentTarget=null,r=c}}}}function De(e,t){var n=t[nh];n===void 0&&(n=t[nh]=new Set);var a=e+"__bubble";n.has(a)||(Jj(t,e,2,!1),n.add(a))}function vf(e,t,n){var a=0;t&&(a|=4),Jj(n,e,a,t)}var Wo="_reactListening"+Math.random().toString(36).slice(2);function dp(e){if(!e[Wo]){e[Wo]=!0,Fy.forEach(function(n){n!=="selectionchange"&&(lC.has(n)||vf(n,!1,e),vf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wo]||(t[Wo]=!0,vf("selectionchange",!1,t))}}function Jj(e,t,n,a){switch(d0(t)){case 2:var l=MC;break;case 8:l=OC;break;default:l=pp}n=l.bind(null,t,n,e),l=void 0,!rh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),a?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function yf(e,t,n,a,l){var r=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===l)break;if(i===4)for(i=a.return;i!==null;){var c=i.tag;if((c===3||c===4)&&i.stateNode.containerInfo===l)return;i=i.return}for(;o!==null;){if(i=Bl(o),i===null)return;if(c=i.tag,c===5||c===6||c===26||c===27){a=r=i;continue e}o=o.parentNode}}a=a.return}tb(function(){var d=r,f=Am(n),h=[];e:{var m=xb.get(e);if(m!==void 0){var x=Bu,j=e;switch(e){case"keypress":if(jc(n)===0)break e;case"keydown":case"keyup":x=JS;break;case"focusin":j="focus",x=Kd;break;case"focusout":j="blur",x=Kd;break;case"beforeblur":case"afterblur":x=Kd;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=Yx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=IS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=n2;break;case fb:case hb:case mb:x=GS;break;case pb:x=a2;break;case"scroll":case"scrollend":x=BS;break;case"wheel":x=r2;break;case"copy":case"cut":case"paste":x=YS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Kx;break;case"toggle":case"beforetoggle":x=o2}var v=(t&4)!==0,y=!v&&(e==="scroll"||e==="scrollend"),g=v?m!==null?m+"Capture":null:m;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=Di(p,g),w!=null&&v.push(Pi(p,w,b))),y)break;p=p.return}0<v.length&&(m=new x(m,j,null,n,f),h.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",m&&n!==lh&&(j=n.relatedTarget||n.fromElement)&&(Bl(j)||j[Sr]))break e;if((x||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,x?(j=n.relatedTarget||n.toElement,x=d,j=j?Bl(j):null,j!==null&&(y=ro(j),v=j.tag,j!==y||v!==5&&v!==27&&v!==6)&&(j=null)):(x=null,j=d),x!==j)){if(v=Yx,w="onMouseLeave",g="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(v=Kx,w="onPointerLeave",g="onPointerEnter",p="pointer"),y=x==null?m:ii(x),b=j==null?m:ii(j),m=new v(w,p+"leave",x,n,f),m.target=y,m.relatedTarget=b,w=null,Bl(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=Nl(b))p++;for(b=0,w=g;w;w=Nl(w))b++;for(;0<p-b;)v=Nl(v),p--;for(;0<b-p;)g=Nl(g),b--;for(;p--;){if(v===g||g!==null&&v===g.alternate)break t;v=Nl(v),g=Nl(g)}v=null}else v=null;x!==null&&Hg(h,m,x,v,!1),j!==null&&y!==null&&Hg(h,y,j,v,!0)}}e:{if(m=d?ii(d):window,x=m.nodeName&&m.nodeName.toLowerCase(),x==="select"||x==="input"&&m.type==="file")var N=Wx;else if(Zx(m))if(ib)N=v2;else{N=x2;var R=p2}else x=m.nodeName,!x||x.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?d&&Em(d.elementType)&&(N=Wx):N=g2;if(N&&(N=N(e,d))){rb(h,N,n,f);break e}R&&R(e,m,d),e==="focusout"&&d&&m.type==="number"&&d.memoizedProps.value!=null&&ah(m,"number",m.value)}switch(R=d?ii(d):window,e){case"focusin":(Zx(R)||R.contentEditable==="true")&&(Pl=R,ih=d,yi=null);break;case"focusout":yi=ih=Pl=null;break;case"mousedown":oh=!0;break;case"contextmenu":case"mouseup":case"dragend":oh=!1,sg(h,n,f);break;case"selectionchange":if(b2)break;case"keydown":case"keyup":sg(h,n,f)}var _;if($m)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Il?ab(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(sb&&n.locale!=="ko"&&(Il||k!=="onCompositionStart"?k==="onCompositionEnd"&&Il&&(_=nb()):(ga=f,Mm="value"in ga?ga.value:ga.textContent,Il=!0)),R=cu(d,k),0<R.length&&(k=new Fx(k,e,null,n,f),h.push({event:k,listeners:R}),_?k.data=_:(_=lb(n),_!==null&&(k.data=_)))),(_=u2?d2(e,n):f2(e,n))&&(k=cu(d,"onBeforeInput"),0<k.length&&(R=new Fx("onBeforeInput","beforeinput",null,n,f),h.push({event:R,listeners:k}),R.data=_)),nC(h,e,d,n,f)}Wj(h,t)})}function Pi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function cu(e,t){for(var n=t+"Capture",a=[];e!==null;){var l=e,r=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||r===null||(l=Di(e,n),l!=null&&a.unshift(Pi(e,l,r)),l=Di(e,t),l!=null&&a.push(Pi(e,l,r))),e.tag===3)return a;e=e.return}return[]}function Nl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Hg(e,t,n,a,l){for(var r=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,l?(d=Di(n,r),d!=null&&i.unshift(Pi(n,d,c))):l||(d=Di(n,r),d!=null&&i.push(Pi(n,d,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var rC=/\r\n?/g,iC=/\u0000|\uFFFD/g;function Ig(e){return(typeof e=="string"?e:""+e).replace(rC,`
|
|
49
|
-
`).replace(iC,"")}function e0(e,t){return t=Ig(t),Ig(e)===t}function Zu(){}function Je(e,t,n,a,l,r){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||dr(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&dr(e,""+a);break;case"className":Vo(e,"class",a);break;case"tabIndex":Vo(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Vo(e,n,a);break;case"style":eb(e,a,r);break;case"data":if(t!=="object"){Vo(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=yc(""+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 r=="function"&&(n==="formAction"?(t!=="input"&&Je(e,t,"name",l.name,l,null),Je(e,t,"formEncType",l.formEncType,l,null),Je(e,t,"formMethod",l.formMethod,l,null),Je(e,t,"formTarget",l.formTarget,l,null)):(Je(e,t,"encType",l.encType,l,null),Je(e,t,"method",l.method,l,null),Je(e,t,"target",l.target,l,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=yc(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Zu);break;case"onScroll":a!=null&&De("scroll",e);break;case"onScrollEnd":a!=null&&De("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(Z(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(Z(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=yc(""+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":De("beforetoggle",e),De("toggle",e),vc(e,"popover",a);break;case"xlinkActuate":Ts(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ts(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ts(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ts(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ts(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ts(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ts(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ts(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ts(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":vc(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=LS.get(n)||n,vc(e,n,a))}}function Oh(e,t,n,a,l,r){switch(n){case"style":eb(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(Z(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(Z(60));e.innerHTML=n}}break;case"children":typeof a=="string"?dr(e,a):(typeof a=="number"||typeof a=="bigint")&&dr(e,""+a);break;case"onScroll":a!=null&&De("scroll",e);break;case"onScrollEnd":a!=null&&De("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Zu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ky.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),t=n.slice(2,l?n.length-7:void 0),r=e[ln]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,l),typeof a=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,l);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):vc(e,n,a)}}}function Pt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":De("error",e),De("load",e);var a=!1,l=!1,r;for(r in n)if(n.hasOwnProperty(r)){var i=n[r];if(i!=null)switch(r){case"src":a=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Z(137,t));default:Je(e,t,r,i,n,null)}}l&&Je(e,t,"srcSet",n.srcSet,n,null),a&&Je(e,t,"src",n.src,n,null);return;case"input":De("invalid",e);var o=r=i=l=null,c=null,d=null;for(a in n)if(n.hasOwnProperty(a)){var f=n[a];if(f!=null)switch(a){case"name":l=f;break;case"type":i=f;break;case"checked":c=f;break;case"defaultChecked":d=f;break;case"value":r=f;break;case"defaultValue":o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(Z(137,t));break;default:Je(e,t,a,f,n,null)}}Zy(e,r,o,c,d,i,l,!1),Gc(e);return;case"select":De("invalid",e),a=i=r=null;for(l in n)if(n.hasOwnProperty(l)&&(o=n[l],o!=null))switch(l){case"value":r=o;break;case"defaultValue":i=o;break;case"multiple":a=o;default:Je(e,t,l,o,n,null)}t=r,n=i,e.multiple=!!a,t!=null?Zl(e,!!a,t,!1):n!=null&&Zl(e,!!a,n,!0);return;case"textarea":De("invalid",e),r=l=a=null;for(i in n)if(n.hasOwnProperty(i)&&(o=n[i],o!=null))switch(i){case"value":a=o;break;case"defaultValue":l=o;break;case"children":r=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(Z(91));break;default:Je(e,t,i,o,n,null)}Jy(e,a,l,r),Gc(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:Je(e,t,c,a,n,null)}return;case"dialog":De("beforetoggle",e),De("toggle",e),De("cancel",e),De("close",e);break;case"iframe":case"object":De("load",e);break;case"video":case"audio":for(a=0;a<Ii.length;a++)De(Ii[a],e);break;case"image":De("error",e),De("load",e);break;case"details":De("toggle",e);break;case"embed":case"source":case"link":De("error",e),De("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(Z(137,t));default:Je(e,t,d,a,n,null)}return;default:if(Em(t)){for(f in n)n.hasOwnProperty(f)&&(a=n[f],a!==void 0&&Oh(e,t,f,a,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(a=n[o],a!=null&&Je(e,t,o,a,n,null))}function oC(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 l=null,r=null,i=null,o=null,c=null,d=null,f=null;for(x in n){var h=n[x];if(n.hasOwnProperty(x)&&h!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=h;default:a.hasOwnProperty(x)||Je(e,t,x,null,a,h)}}for(var m in a){var x=a[m];if(h=n[m],a.hasOwnProperty(m)&&(x!=null||h!=null))switch(m){case"type":r=x;break;case"name":l=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(Z(137,t));break;default:x!==h&&Je(e,t,m,x,a,h)}}sh(e,i,o,c,d,f,r,l);return;case"select":x=i=o=m=null;for(r in n)if(c=n[r],n.hasOwnProperty(r)&&c!=null)switch(r){case"value":break;case"multiple":x=c;default:a.hasOwnProperty(r)||Je(e,t,r,null,a,c)}for(l in a)if(r=a[l],c=n[l],a.hasOwnProperty(l)&&(r!=null||c!=null))switch(l){case"value":m=r;break;case"defaultValue":o=r;break;case"multiple":i=r;default:r!==c&&Je(e,t,l,r,a,c)}t=o,n=i,a=x,m!=null?Zl(e,!!n,m,!1):!!a!=!!n&&(t!=null?Zl(e,!!n,t,!0):Zl(e,!!n,n?[]:"",!1));return;case"textarea":x=m=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null&&!a.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Je(e,t,o,null,a,l)}for(i in a)if(l=a[i],r=n[i],a.hasOwnProperty(i)&&(l!=null||r!=null))switch(i){case"value":m=l;break;case"defaultValue":x=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(Z(91));break;default:l!==r&&Je(e,t,i,l,a,r)}Wy(e,m,x);return;case"option":for(var j in n)if(m=n[j],n.hasOwnProperty(j)&&m!=null&&!a.hasOwnProperty(j))switch(j){case"selected":e.selected=!1;break;default:Je(e,t,j,null,a,m)}for(c in a)if(m=a[c],x=n[c],a.hasOwnProperty(c)&&m!==x&&(m!=null||x!=null))switch(c){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Je(e,t,c,m,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)m=n[v],n.hasOwnProperty(v)&&m!=null&&!a.hasOwnProperty(v)&&Je(e,t,v,null,a,m);for(d in a)if(m=a[d],x=n[d],a.hasOwnProperty(d)&&m!==x&&(m!=null||x!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(Z(137,t));break;default:Je(e,t,d,m,a,x)}return;default:if(Em(t)){for(var y in n)m=n[y],n.hasOwnProperty(y)&&m!==void 0&&!a.hasOwnProperty(y)&&Oh(e,t,y,void 0,a,m);for(f in a)m=a[f],x=n[f],!a.hasOwnProperty(f)||m===x||m===void 0&&x===void 0||Oh(e,t,f,m,a,x);return}}for(var g in n)m=n[g],n.hasOwnProperty(g)&&m!=null&&!a.hasOwnProperty(g)&&Je(e,t,g,null,a,m);for(h in a)m=a[h],x=n[h],!a.hasOwnProperty(h)||m===x||m==null&&x==null||Je(e,t,h,m,a,x)}var $h=null,Dh=null;function uu(e){return e.nodeType===9?e:e.ownerDocument}function Pg(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 t0(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 zh(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 bf=null;function cC(){var e=window.event;return e&&e.type==="popstate"?e===bf?!1:(bf=e,!0):(bf=null,!1)}var n0=typeof setTimeout=="function"?setTimeout:void 0,uC=typeof clearTimeout=="function"?clearTimeout:void 0,qg=typeof Promise=="function"?Promise:void 0,dC=typeof queueMicrotask=="function"?queueMicrotask:typeof qg<"u"?function(e){return qg.resolve(null).then(e).catch(fC)}:n0;function fC(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function Gg(e,t){var n=t,a=0,l=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(0<a&&8>a){n=a;var i=e.ownerDocument;if(n&1&&Ei(i.documentElement),n&2&&Ei(i.body),n&4)for(n=i.head,Ei(n),i=n.firstChild;i;){var o=i.nextSibling,c=i.nodeName;i[uo]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}if(l===0){e.removeChild(r),Fi(t);return}l--}else n==="$"||n==="$?"||n==="$!"?l++:a=n.charCodeAt(0)-48;else a=0;n=r}while(n);Fi(t)}function Lh(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":Lh(n),Tm(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function hC(e,t,n,a){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[uo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Zn(e.nextSibling),e===null)break}return null}function mC(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Zn(e.nextSibling),e===null))return null;return e}function Uh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function pC(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 Zn(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 Bh=null;function Vg(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 s0(e,t,n){switch(t=uu(n),e){case"html":if(e=t.documentElement,!e)throw Error(Z(452));return e;case"head":if(e=t.head,!e)throw Error(Z(453));return e;case"body":if(e=t.body,!e)throw Error(Z(454));return e;default:throw Error(Z(451))}}function Ei(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tm(e)}var Un=new Map,Yg=new Set;function du(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Qs=Ve.d;Ve.d={f:xC,r:gC,D:vC,C:yC,L:bC,m:jC,X:_C,S:wC,M:NC};function xC(){var e=Qs.f(),t=Ku();return e||t}function gC(e){var t=Cr(e);t!==null&&t.tag===5&&t.type==="form"?Qb(t):Qs.r(e)}var Er=typeof document>"u"?null:document;function a0(e,t,n){var a=Er;if(a&&typeof t=="string"&&t){var l=En(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),Yg.has(l)||(Yg.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement("link"),Pt(t,"link",e),Lt(t),a.head.appendChild(t)))}}function vC(e){Qs.D(e),a0("dns-prefetch",e,null)}function yC(e,t){Qs.C(e,t),a0("preconnect",e,t)}function bC(e,t,n){Qs.L(e,t,n);var a=Er;if(a&&e&&t){var l='link[rel="preload"][as="'+En(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+En(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+En(n.imageSizes)+'"]')):l+='[href="'+En(e)+'"]';var r=l;switch(t){case"style":r=yr(e);break;case"script":r=Ar(e)}Un.has(r)||(e=st({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Un.set(r,e),a.querySelector(l)!==null||t==="style"&&a.querySelector(jo(r))||t==="script"&&a.querySelector(wo(r))||(t=a.createElement("link"),Pt(t,"link",e),Lt(t),a.head.appendChild(t)))}}function jC(e,t){Qs.m(e,t);var n=Er;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+En(a)+'"][href="'+En(e)+'"]',r=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Ar(e)}if(!Un.has(r)&&(e=st({rel:"modulepreload",href:e},t),Un.set(r,e),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wo(r)))return}a=n.createElement("link"),Pt(a,"link",e),Lt(a),n.head.appendChild(a)}}}function wC(e,t,n){Qs.S(e,t,n);var a=Er;if(a&&e){var l=Ql(a).hoistableStyles,r=yr(e);t=t||"default";var i=l.get(r);if(!i){var o={loading:0,preload:null};if(i=a.querySelector(jo(r)))o.loading=5;else{e=st({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Un.get(r))&&fp(e,n);var c=i=a.createElement("link");Lt(c),Pt(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,Rc(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:o},l.set(r,i)}}}function _C(e,t){Qs.X(e,t);var n=Er;if(n&&e){var a=Ql(n).hoistableScripts,l=Ar(e),r=a.get(l);r||(r=n.querySelector(wo(l)),r||(e=st({src:e,async:!0},t),(t=Un.get(l))&&hp(e,t),r=n.createElement("script"),Lt(r),Pt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(l,r))}}function NC(e,t){Qs.M(e,t);var n=Er;if(n&&e){var a=Ql(n).hoistableScripts,l=Ar(e),r=a.get(l);r||(r=n.querySelector(wo(l)),r||(e=st({src:e,async:!0,type:"module"},t),(t=Un.get(l))&&hp(e,t),r=n.createElement("script"),Lt(r),Pt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(l,r))}}function Fg(e,t,n,a){var l=(l=wa.current)?du(l):null;if(!l)throw Error(Z(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=yr(n.href),n=Ql(l).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=yr(n.href);var r=Ql(l).hoistableStyles,i=r.get(e);if(i||(l=l.ownerDocument||l,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,i),(r=l.querySelector(jo(e)))&&!r._p&&(i.instance=r,i.state.loading=5),Un.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},Un.set(e,n),r||kC(l,e,n,i.state))),t&&a===null)throw Error(Z(528,""));return i}if(t&&a!==null)throw Error(Z(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ar(n),n=Ql(l).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(Z(444,e))}}function yr(e){return'href="'+En(e)+'"'}function jo(e){return'link[rel="stylesheet"]['+e+"]"}function l0(e){return st({},e,{"data-precedence":e.precedence,precedence:null})}function kC(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}),Pt(t,"link",n),Lt(t),e.head.appendChild(t))}function Ar(e){return'[src="'+En(e)+'"]'}function wo(e){return"script[async]"+e}function Kg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+En(n.href)+'"]');if(a)return t.instance=a,Lt(a),a;var l=st({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Lt(a),Pt(a,"style",l),Rc(a,n.precedence,e),t.instance=a;case"stylesheet":l=yr(n.href);var r=e.querySelector(jo(l));if(r)return t.state.loading|=4,t.instance=r,Lt(r),r;a=l0(n),(l=Un.get(l))&&fp(a,l),r=(e.ownerDocument||e).createElement("link"),Lt(r);var i=r;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),Pt(r,"link",a),t.state.loading|=4,Rc(r,n.precedence,e),t.instance=r;case"script":return r=Ar(n.src),(l=e.querySelector(wo(r)))?(t.instance=l,Lt(l),l):(a=n,(l=Un.get(r))&&(a=st({},n),hp(a,l)),e=e.ownerDocument||e,l=e.createElement("script"),Lt(l),Pt(l,"link",a),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(Z(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(a=t.instance,t.state.loading|=4,Rc(a,n.precedence,e));return t.instance}function Rc(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,r=l,i=0;i<a.length;i++){var o=a[i];if(o.dataset.precedence===t)r=o;else if(r!==l)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function fp(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 Tc=null;function Xg(e,t,n){if(Tc===null){var a=new Map,l=Tc=new Map;l.set(n,a)}else l=Tc,a=l.get(n),a||(a=new Map,l.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),l=0;l<n.length;l++){var r=n[l];if(!(r[uo]||r[qt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var i=r.getAttribute(t)||"";i=e+i;var o=a.get(i);o?o.push(r):a.set(i,[r])}}return a}function Qg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function SC(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 r0(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var qi=null;function CC(){}function RC(e,t,n){if(qi===null)throw Error(Z(475));var a=qi;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var l=yr(n.href),r=e.querySelector(jo(l));if(r){e=r._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(a.count++,a=fu.bind(a),e.then(a,a)),t.state.loading|=4,t.instance=r,Lt(r);return}r=e.ownerDocument||e,n=l0(n),(l=Un.get(l))&&fp(n,l),r=r.createElement("link"),Lt(r);var i=r;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),Pt(r,"link",n),t.instance=r}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(a.count++,t=fu.bind(a),e.addEventListener("load",t),e.addEventListener("error",t))}}function TC(){if(qi===null)throw Error(Z(475));var e=qi;return e.stylesheets&&e.count===0&&Hh(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Hh(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 fu(){if(this.count--,this.count===0){if(this.stylesheets)Hh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var hu=null;function Hh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hu=new Map,t.forEach(EC,e),hu=null,fu.call(e))}function EC(e,t){if(!(t.state.loading&4)){var n=hu.get(e);if(n)var a=n.get(null);else{n=new Map,hu.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<l.length;r++){var i=l[r];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),a=i)}a&&n.set(null,a)}l=t.instance,i=l.getAttribute("data-precedence"),r=n.get(i)||a,r===a&&n.set(null,l),n.set(i,l),this.count++,a=fu.bind(this),l.addEventListener("load",a),l.addEventListener("error",a),r?r.parentNode.insertBefore(l,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var Gi={$$typeof:Ls,Provider:null,Consumer:null,_currentValue:Za,_currentValue2:Za,_threadCount:0};function AC(e,t,n,a,l,r,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=Id(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Id(0),this.hiddenUpdates=Id(null),this.identifierPrefix=a,this.onUncaughtError=l,this.onCaughtError=r,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function i0(e,t,n,a,l,r,i,o,c,d,f,h){return e=new AC(e,t,n,i,o,c,d,h),t=1,r===!0&&(t|=24),r=xn(3,null,null,t),e.current=r,r.stateNode=e,t=Im(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:n,cache:t},qm(r),e}function o0(e){return e?(e=Vl,e):Vl}function c0(e,t,n,a,l,r){l=o0(l),a.context===null?a.context=l:a.pendingContext=l,a=_a(t),a.payload={element:n},r=r===void 0?null:r,r!==null&&(a.callback=r),n=Na(e,a,t),n!==null&&(bn(n,e,t),wi(n,e,t))}function Zg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mp(e,t){Zg(e,t),(e=e.alternate)&&Zg(e,t)}function u0(e){if(e.tag===13){var t=Rr(e,67108864);t!==null&&bn(t,e,67108864),mp(e,67108864)}}var mu=!0;function MC(e,t,n,a){var l=Ce.T;Ce.T=null;var r=Ve.p;try{Ve.p=2,pp(e,t,n,a)}finally{Ve.p=r,Ce.T=l}}function OC(e,t,n,a){var l=Ce.T;Ce.T=null;var r=Ve.p;try{Ve.p=8,pp(e,t,n,a)}finally{Ve.p=r,Ce.T=l}}function pp(e,t,n,a){if(mu){var l=Ih(a);if(l===null)yf(e,t,a,pu,n),Wg(e,a);else if(DC(l,e,t,n,a))a.stopPropagation();else if(Wg(e,a),t&4&&-1<$C.indexOf(e)){for(;l!==null;){var r=Cr(l);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var i=Fa(r.pendingLanes);if(i!==0){var o=r;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var c=1<<31-vn(i);o.entanglements[1]|=c,i&=~c}ks(r),!(Qe&6)&&(lu=vs()+500,bo(0))}}break;case 13:o=Rr(r,2),o!==null&&bn(o,r,2),Ku(),mp(r,2)}if(r=Ih(a),r===null&&yf(e,t,a,pu,n),r===l)break;l=r}l!==null&&a.stopPropagation()}else yf(e,t,a,null,n)}}function Ih(e){return e=Am(e),xp(e)}var pu=null;function xp(e){if(pu=null,e=Bl(e),e!==null){var t=ro(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=Dy(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 pu=e,null}function d0(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(yS()){case By:return 2;case Hy:return 8;case qc:case bS:return 32;case Iy:return 268435456;default:return 32}default:return 32}}var Ph=!1,Ca=null,Ra=null,Ta=null,Vi=new Map,Yi=new Map,pa=[],$C="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 Wg(e,t){switch(e){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Ra=null;break;case"mouseover":case"mouseout":Ta=null;break;case"pointerover":case"pointerout":Vi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yi.delete(t.pointerId)}}function ei(e,t,n,a,l,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[l]},t!==null&&(t=Cr(t),t!==null&&u0(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function DC(e,t,n,a,l){switch(t){case"focusin":return Ca=ei(Ca,e,t,n,a,l),!0;case"dragenter":return Ra=ei(Ra,e,t,n,a,l),!0;case"mouseover":return Ta=ei(Ta,e,t,n,a,l),!0;case"pointerover":var r=l.pointerId;return Vi.set(r,ei(Vi.get(r)||null,e,t,n,a,l)),!0;case"gotpointercapture":return r=l.pointerId,Yi.set(r,ei(Yi.get(r)||null,e,t,n,a,l)),!0}return!1}function f0(e){var t=Bl(e.target);if(t!==null){var n=ro(t);if(n!==null){if(t=n.tag,t===13){if(t=Dy(n),t!==null){e.blockedOn=t,RS(e.priority,function(){if(n.tag===13){var a=yn();a=Cm(a);var l=Rr(n,a);l!==null&&bn(l,n,a),mp(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 Ec(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ih(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);lh=a,n.target.dispatchEvent(a),lh=null}else return t=Cr(n),t!==null&&u0(t),e.blockedOn=n,!1;t.shift()}return!0}function Jg(e,t,n){Ec(e)&&n.delete(t)}function zC(){Ph=!1,Ca!==null&&Ec(Ca)&&(Ca=null),Ra!==null&&Ec(Ra)&&(Ra=null),Ta!==null&&Ec(Ta)&&(Ta=null),Vi.forEach(Jg),Yi.forEach(Jg)}function Jo(e,t){e.blockedOn===t&&(e.blockedOn=null,Ph||(Ph=!0,$t.unstable_scheduleCallback($t.unstable_NormalPriority,zC)))}var ec=null;function ev(e){ec!==e&&(ec=e,$t.unstable_scheduleCallback($t.unstable_NormalPriority,function(){ec===e&&(ec=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],l=e[t+2];if(typeof a!="function"){if(xp(a||n)===null)continue;break}var r=Cr(n);r!==null&&(e.splice(t,3),t-=3,jh(r,{pending:!0,data:l,method:n.method,action:a},a,l))}}))}function Fi(e){function t(c){return Jo(c,e)}Ca!==null&&Jo(Ca,e),Ra!==null&&Jo(Ra,e),Ta!==null&&Jo(Ta,e),Vi.forEach(t),Yi.forEach(t);for(var n=0;n<pa.length;n++){var a=pa[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<pa.length&&(n=pa[0],n.blockedOn===null);)f0(n),n.blockedOn===null&&pa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var l=n[a],r=n[a+1],i=l[ln]||null;if(typeof r=="function")i||ev(n);else if(i){var o=null;if(r&&r.hasAttribute("formAction")){if(l=r,i=r[ln]||null)o=i.formAction;else if(xp(l)!==null)continue}else o=i.action;typeof o=="function"?n[a+1]=o:(n.splice(a,3),a-=3),ev(n)}}}function gp(e){this._internalRoot=e}Wu.prototype.render=gp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));var n=t.current,a=yn();c0(n,a,e,t,null,null)};Wu.prototype.unmount=gp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;c0(e.current,2,null,e,null,null),Ku(),t[Sr]=null}};function Wu(e){this._internalRoot=e}Wu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<pa.length&&t!==0&&t<pa[n].priority;n++);pa.splice(n,0,e),n===0&&f0(e)}};var tv=Oy.version;if(tv!=="19.1.0")throw Error(Z(527,tv,"19.1.0"));Ve.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=fS(t),e=e!==null?zy(e):null,e=e===null?null:e.stateNode,e};var LC={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:Ce,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tc.isDisabled&&tc.supportsFiber)try{io=tc.inject(LC),gn=tc}catch{}}zu.createRoot=function(e,t){if(!$y(e))throw Error(Z(299));var n=!1,a="",l=ij,r=oj,i=cj,o=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(o=t.unstable_transitionCallbacks)),t=i0(e,1,!1,null,null,n,a,l,r,i,o,null),e[Sr]=t.current,dp(e),new gp(t)};zu.hydrateRoot=function(e,t,n){if(!$y(e))throw Error(Z(299));var a=!1,l="",r=ij,i=oj,o=cj,c=null,d=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=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=i0(e,1,!0,t,n??null,a,l,r,i,o,c,d),t.context=o0(null),n=t.current,a=yn(),a=Cm(a),l=_a(a),l.callback=null,Na(n,l,a),n=a,t.current.lanes=n,co(t,n),ks(t),e[Sr]=t.current,dp(e),new Wu(t)};zu.version="19.1.0";function h0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(h0)}catch(e){console.error(e)}}h0(),Cy.exports=zu;var UC=Cy.exports;const m0=u.createContext(null);function p0({data:e,router:t,identity:n,notify:a,children:l}){return s.jsx(m0.Provider,{value:{data:e,router:t,identity:n,notify:a},children:l})}function Ju(){const e=u.useContext(m0);if(!e)throw new Error("A shared app page rendered outside AppUiProvider.");return e}const BC={success:()=>{},error:()=>{}},cn=()=>Ju().data,We=()=>Ju().router,ed=()=>Ju().identity,Mr=()=>Ju().notify??BC;function HC(){const{probe:e}=cn(),{href:t,Link:n}=We(),a=ed(),[l,r]=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&&r(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":l??"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 IC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),PC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),nv=e=>{const t=PC(e);return t.charAt(0).toUpperCase()+t.slice(1)},x0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),qC=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 GC={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 VC=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:r,iconNode:i,...o},c)=>u.createElement("svg",{ref:c,...GC,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:x0("lucide",l),...!r&&!qC(o)&&{"aria-hidden":"true"},...o},[...i.map(([d,f])=>u.createElement(d,f)),...Array.isArray(r)?r:[r]]));/**
|
|
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 be=(e,t)=>{const n=u.forwardRef(({className:a,...l},r)=>u.createElement(VC,{ref:r,iconNode:t,className:x0(`lucide-${IC(nv(e))}`,`lucide-${e}`,a),...l}));return n.displayName=nv(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 YC=[["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"}]],FC=be("archive-restore",YC);/**
|
|
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 KC=[["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"}]],sv=be("archive",KC);/**
|
|
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 XC=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],QC=be("arrow-down",XC);/**
|
|
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 ZC=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],g0=be("arrow-left",ZC);/**
|
|
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 WC=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],JC=be("arrow-up",WC);/**
|
|
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 eR=[["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=be("bot",eR);/**
|
|
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 tR=[["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"}]],nR=be("briefcase",tR);/**
|
|
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 sR=[["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"}]],aR=be("building-2",sR);/**
|
|
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 lR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Or=be("check",lR);/**
|
|
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 rR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],v0=be("chevron-down",rR);/**
|
|
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 iR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],yp=be("chevron-right",iR);/**
|
|
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 oR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],cR=be("chevron-up",oR);/**
|
|
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 uR=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],y0=be("chevrons-up-down",uR);/**
|
|
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 dR=[["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"}]],ut=be("circle-alert",dR);/**
|
|
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 fR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],td=be("circle-check",fR);/**
|
|
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 hR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],mR=be("circle",hR);/**
|
|
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 pR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],xR=be("clock",pR);/**
|
|
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 gR=[["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"}]],vR=be("copy",gR);/**
|
|
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 yR=[["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"}]],bp=be("ellipsis",yR);/**
|
|
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 bR=[["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"}]],jR=be("eraser",bR);/**
|
|
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 wR=[["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"}]],_o=be("eye",wR);/**
|
|
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 _R=[["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"}]],b0=be("folder-git-2",_R);/**
|
|
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 NR=[["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"}]],kR=be("folder-git",NR);/**
|
|
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 SR=[["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"}]],CR=be("git-fork",SR);/**
|
|
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 RR=[["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"}]],TR=be("hard-drive",RR);/**
|
|
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 ER=[["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"}]],AR=be("history",ER);/**
|
|
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 MR=[["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"}]],OR=be("house",MR);/**
|
|
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 $R=[["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"}]],DR=be("inbox",$R);/**
|
|
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 zR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ba=be("info",zR);/**
|
|
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 LR=[["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"}]],UR=be("laptop",LR);/**
|
|
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 BR=[["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"}]],HR=be("life-buoy",BR);/**
|
|
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 IR=[["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"}]],j0=be("list-checks",IR);/**
|
|
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 PR=[["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"}]],w0=be("list-ordered",PR);/**
|
|
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 qR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],GR=be("loader-circle",qR);/**
|
|
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 VR=[["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"}]],YR=be("lock",VR);/**
|
|
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 FR=[["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"}]],KR=be("messages-square",FR);/**
|
|
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 XR=[["path",{d:"M5 12h14",key:"1ays0h"}]],QR=be("minus",XR);/**
|
|
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 ZR=[["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"}]],WR=be("network",ZR);/**
|
|
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 JR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],eT=be("panel-left",JR);/**
|
|
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 tT=[["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"}]],_0=be("pause",tT);/**
|
|
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 nT=[["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"}]],nd=be("pencil",nT);/**
|
|
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 sT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],br=be("plus",sT);/**
|
|
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 aT=[["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"}]],yl=be("refresh-cw",aT);/**
|
|
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 lT=[["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"}]],rT=be("rotate-ccw",lT);/**
|
|
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 iT=[["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"}]],sd=be("search-x",iT);/**
|
|
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 oT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],cT=be("search",oT);/**
|
|
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 uT=[["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"}]],dT=be("shield-alert",uT);/**
|
|
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 fT=[["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"}]],hT=be("snowflake",fT);/**
|
|
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 mT=[["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"}]],xu=be("tag",mT);/**
|
|
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 pT=[["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"}]],rn=be("triangle-alert",pT);/**
|
|
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 xT=[["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"}]],gT=be("user-check",xT);/**
|
|
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 vT=[["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"}]],yT=be("user-cog",vT);/**
|
|
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 bT=[["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"}]],jp=be("user",bT);/**
|
|
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 jT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ad=be("x",jT),wT="Local only · this machine · not connected to SoftwareDLC",_T="Checking sync state…",NT="Sync state unknown",kT="Projects are the repositories this viewer reads on this machine. Nothing is shared unless you connect to SoftwareDLC.",cl="Details are in the terminal running sdlc viewer.",ST="How to fix it is in the terminal running sdlc viewer.",ld="Loading…",gu="Not available";function CT(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 RT={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 N0(e,t){const n=t?` this list was read at ${ci(t)}.`:"";if(e.reason==="store_locked"){const a=e.store?RT[e.store]:"a local store",l=e.since?` since ${ci(e.since)}`:"";return`Another sdlc command has held ${a}${l};${n||" nothing was read yet."} ${cl}`}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)}.`:""} ${cl}`}const TT=e=>e.status===409,ET={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 AT(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 l=e.folder?`the folder ${e.folder}`:"its folder";return{kind:"moved_member",cause:`This repository, ${t}, is not where ${l} 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?ET[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 av=["tasks","issues","releases"],wp=u.createContext(null);function Nn(){const e=u.useContext(wp);if(!e)throw new Error("A shell page rendered outside the app shell.");return e}function MT(){var e;return(e=u.useContext(wp))==null?void 0:e.engine}const OT=10,$T=()=>new Date;function DT({shell:e,now:t=$T,children:n}){var L;const[a,l]=u.useState(null),[r,i]=u.useState(null),[o,c]=u.useState(null),[d,f]=u.useState(null),[h,m]=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,R]=u.useState(av),_=u.useRef(!1),k=u.useRef(!1),U=u.useRef(null),z=u.useRef(!0),K=u.useCallback(async(M=!1)=>{U.current&&clearTimeout(U.current),U.current=null,y(!0);const[A,S]=await Promise.all([e.organizations.list(),e.projects.list()]);if(!z.current)return;if(y(!1),j(!1),A.ok&&S.ok){if(_.current=!0,k.current=!1,m(null),f(t()),A.data.organizations.length===0){c("not_in_git"),l(null),i(null);return}c(null),l(A.data.organizations[0]),i(S.data.projects);return}const E=A.ok?S.ok?null:S.refusal:A.refusal;if(!E)return;if(TT(E)){k.current=!1,m(null),c(E),l(null),i(null);return}const C=_.current&&!k.current&&!M;k.current=!0;const $=E.retry_after??OT;m({refusal:E,shown:!C,retryInSeconds:C?$:null}),C&&(U.current=setTimeout(()=>void K(!0),$*1e3))},[e,t]);u.useEffect(()=>(z.current=!0,K(),e.about.about().then(M=>{z.current&&(M.ok?p(M.data):M.refusal.status===404?p(null):w(!0))}),Promise.all(av.map(async M=>{var A;return[M,await((A=e[M])==null?void 0:A.access())]})).then(M=>{z.current&&R(M.filter(([,A])=>!(A!=null&&A.ok&&!A.data.can_view)).map(([A])=>A))}),()=>{z.current=!1,U.current&&clearTimeout(U.current)}),[e,K]);const V={loading:x,org:a,projects:r,none:o,readAt:d,failure:h,about:g,aboutFailed:b,engine:(g==null?void 0:g.engine)===null?null:(L=g==null?void 0:g.engine)==null?void 0:L.source,domains:N,reading:v,refresh:()=>void K()};return s.jsx(wp.Provider,{value:V,children:n})}const k0=e=>`The ${e} page is not part of this sdlc install`,$r="The sdlc engine here is too old for this page";function zT(e){return e==="checkout"?"Update the main checkout, then restart sdlc viewer.":"Update sdlc to its latest version, then restart sdlc viewer."}function ls(){return zT(MT())}function S0(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=S0(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function C0(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=S0(e))&&(a&&(a+=" "),a+=t);return a}const lv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rv=C0,No=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return rv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:r}=t,i=Object.keys(l).map(d=>{const f=n==null?void 0:n[d],h=r==null?void 0:r[d];if(f===null)return null;const m=lv(f)||lv(h);return l[d][m]}),o=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,f)=>{let{class:h,className:m,...x}=f;return Object.entries(x).every(j=>{let[v,y]=j;return Array.isArray(y)?y.includes({...r,...o}[v]):{...r,...o}[v]===y})?[...d,h,m]:d},[]);return rv(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},_p="-",LT=e=>{const t=BT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{const o=i.split(_p);return o[0]===""&&o.length!==1&&o.shift(),R0(o,t)||UT(i)},getConflictingClassGroupIds:(i,o)=>{const c=n[i]||[];return o&&a[i]?[...c,...a[i]]:c}}},R0=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),l=a?R0(e.slice(1),a):void 0;if(l)return l;if(t.validators.length===0)return;const r=e.join(_p);return(i=t.validators.find(({validator:o})=>o(r)))==null?void 0:i.classGroupId},iv=/^\[(.+)\]$/,UT=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}},BT=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const l in n)qh(n[l],a,l,t);return a},qh=(e,t,n,a)=>{e.forEach(l=>{if(typeof l=="string"){const r=l===""?t:ov(t,l);r.classGroupId=n;return}if(typeof l=="function"){if(HT(l)){qh(l(a),t,n,a);return}t.validators.push({validator:l,classGroupId:n});return}Object.entries(l).forEach(([r,i])=>{qh(i,ov(t,r),n,a)})})},ov=(e,t)=>{let n=e;return t.split(_p).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},HT=e=>e.isThemeGetter,IT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const l=(r,i)=>{n.set(r,i),t++,t>e&&(t=0,a=n,n=new Map)};return{get(r){let i=n.get(r);if(i!==void 0)return i;if((i=a.get(r))!==void 0)return l(r,i),i},set(r,i){n.has(r)?n.set(r,i):l(r,i)}}},Gh="!",Vh=":",PT=Vh.length,qT=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const r=[];let i=0,o=0,c=0,d;for(let j=0;j<l.length;j++){let v=l[j];if(i===0&&o===0){if(v===Vh){r.push(l.slice(c,j)),c=j+PT;continue}if(v==="/"){d=j;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=r.length===0?l:l.substring(c),h=GT(f),m=h!==f,x=d&&d>c?d-c:void 0;return{modifiers:r,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:x}};if(t){const l=t+Vh,r=a;a=i=>i.startsWith(l)?r(i.substring(l.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const l=a;a=r=>n({className:r,parseClassName:l})}return a},GT=e=>e.endsWith(Gh)?e.substring(0,e.length-1):e.startsWith(Gh)?e.substring(1):e,VT=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const l=[];let r=[];return a.forEach(i=>{i[0]==="["||t[i]?(l.push(...r.sort(),i),r=[]):r.push(i)}),l.push(...r.sort()),l}},YT=e=>({cache:IT(e.cacheSize),parseClassName:qT(e),sortModifiers:VT(e),...LT(e)}),FT=/\s+/,KT=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:r}=t,i=[],o=e.trim().split(FT);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{isExternal:h,modifiers:m,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:v}=n(f);if(h){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=r(m).join(":"),b=x?p+Gh:p,w=b+g;if(i.includes(w))continue;i.push(w);const N=l(g,y);for(let R=0;R<N.length;++R){const _=N[R];i.push(b+_)}c=f+(c.length>0?" "+c:c)}return c};function XT(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=T0(t))&&(a&&(a+=" "),a+=n);return a}const T0=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=T0(e[a]))&&(n&&(n+=" "),n+=t);return n};function QT(e,...t){let n,a,l,r=i;function i(c){const d=t.reduce((f,h)=>h(f),e());return n=YT(d),a=n.cache.get,l=n.cache.set,r=o,o(c)}function o(c){const d=a(c);if(d)return d;const f=KT(c,n);return l(c,f),f}return function(){return r(XT.apply(null,arguments))}}const At=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},E0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ZT=/^\d+\/\d+$/,WT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JT=/\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$/,eE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kl=e=>ZT.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),la=e=>!!e&&Number.isInteger(Number(e)),jf=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),Ms=e=>WT.test(e),sE=()=>!0,aE=e=>JT.test(e)&&!eE.test(e),M0=()=>!1,lE=e=>tE.test(e),rE=e=>nE.test(e),iE=e=>!fe(e)&&!he(e),oE=e=>Dr(e,D0,M0),fe=e=>E0.test(e),Ya=e=>Dr(e,z0,aE),wf=e=>Dr(e,hE,Oe),cv=e=>Dr(e,O0,M0),cE=e=>Dr(e,$0,rE),nc=e=>Dr(e,L0,lE),he=e=>A0.test(e),ti=e=>zr(e,z0),uE=e=>zr(e,mE),uv=e=>zr(e,O0),dE=e=>zr(e,D0),fE=e=>zr(e,$0),sc=e=>zr(e,L0,!0),Dr=(e,t,n)=>{const a=E0.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},zr=(e,t,n=!1)=>{const a=A0.exec(e);return a?a[1]?t(a[1]):n:!1},O0=e=>e==="position"||e==="percentage",$0=e=>e==="image"||e==="url",D0=e=>e==="length"||e==="size"||e==="bg-size",z0=e=>e==="length",hE=e=>e==="number",mE=e=>e==="family-name",L0=e=>e==="shadow",pE=()=>{const e=At("color"),t=At("font"),n=At("text"),a=At("font-weight"),l=At("tracking"),r=At("leading"),i=At("breakpoint"),o=At("container"),c=At("spacing"),d=At("radius"),f=At("shadow"),h=At("inset-shadow"),m=At("text-shadow"),x=At("drop-shadow"),j=At("blur"),v=At("perspective"),y=At("aspect"),g=At("ease"),p=At("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(),he,fe],R=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],k=()=>[he,fe,c],U=()=>[kl,"full","auto",...k()],z=()=>[la,"none","subgrid",he,fe],K=()=>["auto",{span:["full",la,he,fe]},la,he,fe],V=()=>[la,"auto",he,fe],L=()=>["auto","min","max","fr",he,fe],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],S=()=>["auto",...k()],E=()=>[kl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],C=()=>[e,he,fe],$=()=>[...w(),uv,cv,{position:[he,fe]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",dE,oE,{size:[he,fe]}],P=()=>[jf,ti,Ya],J=()=>["","none","full",d,he,fe],ee=()=>["",Oe,ti,Ya],ve=()=>["solid","dashed","dotted","double"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[Oe,jf,uv,cv],H=()=>["","none",j,he,fe],te=()=>["none",Oe,he,fe],re=()=>["none",Oe,he,fe],ye=()=>[Oe,he,fe],ae=()=>[kl,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ms],breakpoint:[Ms],color:[sE],container:[Ms],"drop-shadow":[Ms],ease:["in","out","in-out"],font:[iE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ms],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ms],shadow:[Ms],spacing:["px",Oe],text:[Ms],"text-shadow":[Ms],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",kl,fe,he,y]}],container:["container"],columns:[{columns:[Oe,fe,he,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:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:U()}],"inset-x":[{"inset-x":U()}],"inset-y":[{"inset-y":U()}],start:[{start:U()}],end:[{end:U()}],top:[{top:U()}],right:[{right:U()}],bottom:[{bottom:U()}],left:[{left:U()}],visibility:["visible","invisible","collapse"],z:[{z:[la,"auto",he,fe]}],basis:[{basis:[kl,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,kl,"auto","initial","none",fe]}],grow:[{grow:["",Oe,he,fe]}],shrink:[{shrink:["",Oe,he,fe]}],order:[{order:[la,"first","last","none",he,fe]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"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:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[o,"screen",...E()]}],"min-w":[{"min-w":[o,"screen","none",...E()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",n,ti,Ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,he,wf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jf,fe]}],"font-family":[{font:[uE,fe,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:[l,he,fe]}],"line-clamp":[{"line-clamp":[Oe,"none",he,wf]}],leading:[{leading:[r,...k()]}],"list-image":[{"list-image":["none",he,fe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,fe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:C()}],"text-color":[{text:C()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",he,Ya]}],"text-decoration-color":[{decoration:C()}],"underline-offset":[{"underline-offset":[Oe,"auto",he,fe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he,fe]}],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",he,fe]}],"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:X()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},la,he,fe],radial:["",he,fe],conic:[la,he,fe]},fE,cE]}],"bg-color":[{bg:C()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:C()}],"gradient-via":[{via:C()}],"gradient-to":[{to:C()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:C()}],"border-color-x":[{"border-x":C()}],"border-color-y":[{"border-y":C()}],"border-color-s":[{"border-s":C()}],"border-color-e":[{"border-e":C()}],"border-color-t":[{"border-t":C()}],"border-color-r":[{"border-r":C()}],"border-color-b":[{"border-b":C()}],"border-color-l":[{"border-l":C()}],"divide-color":[{divide:C()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,he,fe]}],"outline-w":[{outline:["",Oe,ti,Ya]}],"outline-color":[{outline:C()}],shadow:[{shadow:["","none",f,sc,nc]}],"shadow-color":[{shadow:C()}],"inset-shadow":[{"inset-shadow":["none",h,sc,nc]}],"inset-shadow-color":[{"inset-shadow":C()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:C()}],"ring-offset-w":[{"ring-offset":[Oe,Ya]}],"ring-offset-color":[{"ring-offset":C()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":C()}],"text-shadow":[{"text-shadow":["none",m,sc,nc]}],"text-shadow-color":[{"text-shadow":C()}],opacity:[{opacity:[Oe,he,fe]}],"mix-blend":[{"mix-blend":[...Q(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Q()}],"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":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":C()}],"mask-image-linear-to-color":[{"mask-linear-to":C()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":C()}],"mask-image-t-to-color":[{"mask-t-to":C()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":C()}],"mask-image-r-to-color":[{"mask-r-to":C()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":C()}],"mask-image-b-to-color":[{"mask-b-to":C()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":C()}],"mask-image-l-to-color":[{"mask-l-to":C()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":C()}],"mask-image-x-to-color":[{"mask-x-to":C()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":C()}],"mask-image-y-to-color":[{"mask-y-to":C()}],"mask-image-radial":[{"mask-radial":[he,fe]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":C()}],"mask-image-radial-to-color":[{"mask-radial-to":C()}],"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":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":C()}],"mask-image-conic-to-color":[{"mask-conic-to":C()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,fe]}],filter:[{filter:["","none",he,fe]}],blur:[{blur:H()}],brightness:[{brightness:[Oe,he,fe]}],contrast:[{contrast:[Oe,he,fe]}],"drop-shadow":[{"drop-shadow":["","none",x,sc,nc]}],"drop-shadow-color":[{"drop-shadow":C()}],grayscale:[{grayscale:["",Oe,he,fe]}],"hue-rotate":[{"hue-rotate":[Oe,he,fe]}],invert:[{invert:["",Oe,he,fe]}],saturate:[{saturate:[Oe,he,fe]}],sepia:[{sepia:["",Oe,he,fe]}],"backdrop-filter":[{"backdrop-filter":["","none",he,fe]}],"backdrop-blur":[{"backdrop-blur":H()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,he,fe]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,he,fe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,he,fe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,he,fe]}],"backdrop-invert":[{"backdrop-invert":["",Oe,he,fe]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,he,fe]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,he,fe]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,he,fe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",he,fe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",he,fe]}],ease:[{ease:["linear","initial",g,he,fe]}],delay:[{delay:[Oe,he,fe]}],animate:[{animate:["none",p,he,fe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,he,fe]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[he,fe,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":["translate-none"],accent:[{accent:C()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:C()}],"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",he,fe]}],"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":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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",he,fe]}],fill:[{fill:["none",...C()]}],"stroke-w":[{stroke:[Oe,ti,Ya,wf]}],stroke:[{stroke:["none",...C()]}],"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"]}},xE=QT(pE);function le(...e){return xE(C0(e))}const gE=No("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 xe({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:le(gE({variant:t}),e),...n})}function Ne({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:le("col-start-2 min-h-4 font-medium tracking-tight",e),...t})}function ge({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:le("col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function de(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function dv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function rd(...e){return t=>{let n=!1;const a=e.map(l=>{const r=dv(l,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let l=0;l<a.length;l++){const r=a[l];typeof r=="function"?r():dv(e[l],null)}}}}function Ke(...e){return u.useCallback(rd(...e),e)}function vE(e,t){const n=u.createContext(t),a=r=>{const{children:i,...o}=r,c=u.useMemo(()=>o,Object.values(o));return s.jsx(n.Provider,{value:c,children:i})};a.displayName=e+"Provider";function l(r){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}return[a,l]}function Ss(e,t=[]){let n=[];function a(r,i){const o=u.createContext(i),c=n.length;n=[...n,i];const d=h=>{var g;const{scope:m,children:x,...j}=h,v=((g=m==null?void 0:m[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=r+"Provider";function f(h,m){var v;const x=((v=m==null?void 0:m[e])==null?void 0:v[c])||o,j=u.useContext(x);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${r}\``)}return[d,f]}const l=()=>{const r=n.map(i=>u.createContext(i));return function(o){const c=(o==null?void 0:o[e])||r;return u.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return l.scopeName=e,[a,yE(l,...t)]}function yE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(r){const i=a.reduce((o,{useScope:c,scopeName:d})=>{const h=c(r)[`__scope${d}`];return{...o,...h}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Vt=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},bE=Sy[" useId ".trim().toString()]||(()=>{}),jE=0;function Wn(e){const[t,n]=u.useState(bE());return Vt(()=>{n(a=>a??String(jE++))},[e]),t?`radix-${t}`:""}var wE=Sy[" useInsertionEffect ".trim().toString()]||Vt;function $a({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,r,i]=_E({defaultProp:t,onChange:n}),o=e!==void 0,c=o?e:l;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const h=f.current;h!==o&&console.warn(`${a} is changing from ${h?"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 h;if(o){const m=NE(f)?f(e):f;m!==e&&((h=i.current)==null||h.call(i,m))}else r(f)},[o,e,r,i]);return[c,d]}function _E({defaultProp:e,onChange:t}){const[n,a]=u.useState(e),l=u.useRef(n),r=u.useRef(t);return wE(()=>{r.current=t},[t]),u.useEffect(()=>{var i;l.current!==n&&((i=r.current)==null||i.call(r,n),l.current=n)},[n,l]),[n,a,r]}function NE(e){return typeof e=="function"}function ul(e){const t=SE(e),n=u.forwardRef((a,l)=>{const{children:r,...i}=a,o=u.Children.toArray(r),c=o.find(RE);if(c){const d=c.props.children,f=o.map(h=>h===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:h);return s.jsx(t,{...i,ref:l,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return s.jsx(t,{...i,ref:l,children:r})});return n.displayName=`${e}.Slot`,n}var kE=ul("Slot");function SE(e){const t=u.forwardRef((n,a)=>{const{children:l,...r}=n;if(u.isValidElement(l)){const i=EE(l),o=TE(r,l.props);return l.type!==u.Fragment&&(o.ref=a?rd(a,i):i),u.cloneElement(l,o)}return u.Children.count(l)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var U0=Symbol("radix.slottable");function CE(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=U0,t}function RE(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===U0}function TE(e,t){const n={...t};for(const a in t){const l=e[a],r=t[a];/^on[A-Z]/.test(a)?l&&r?n[a]=(...o)=>{const c=r(...o);return l(...o),c}:l&&(n[a]=l):a==="style"?n[a]={...l,...r}:a==="className"&&(n[a]=[l,r].filter(Boolean).join(" "))}return{...e,...n}}function EE(e){var a,l;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=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var AE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=AE.reduce((e,t)=>{const n=ul(`Primitive.${t}`),a=u.forwardRef((l,r)=>{const{asChild:i,...o}=l,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...o,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function B0(e,t){e&&kr.flushSync(()=>e.dispatchEvent(t))}function ws(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 ME(e,t=globalThis==null?void 0:globalThis.document){const n=ws(e);u.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var OE="DismissableLayer",Yh="dismissableLayer.update",$E="dismissableLayer.pointerDownOutside",DE="dismissableLayer.focusOutside",fv,H0=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ko=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:r,onInteractOutside:i,onDismiss:o,...c}=e,d=u.useContext(H0),[f,h]=u.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=u.useState({}),j=Ke(t,_=>h(_)),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=UE(_=>{const k=_.target,U=[...d.branches].some(z=>z.contains(k));!w||U||(l==null||l(_),i==null||i(_),_.defaultPrevented||o==null||o())},m),R=BE(_=>{const k=_.target;[...d.branches].some(z=>z.contains(k))||(r==null||r(_),i==null||i(_),_.defaultPrevented||o==null||o())},m);return ME(_=>{p===d.layers.size-1&&(a==null||a(_),!_.defaultPrevented&&o&&(_.preventDefault(),o()))},m),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(fv=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),hv(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=fv)}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),hv())},[f,d]),u.useEffect(()=>{const _=()=>x({});return document.addEventListener(Yh,_),()=>document.removeEventListener(Yh,_)},[]),s.jsx(Te.div,{...c,ref:j,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:de(e.onFocusCapture,R.onFocusCapture),onBlurCapture:de(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:de(e.onPointerDownCapture,N.onPointerDownCapture)})});ko.displayName=OE;var zE="DismissableLayerBranch",LE=u.forwardRef((e,t)=>{const n=u.useContext(H0),a=u.useRef(null),l=Ke(t,a);return u.useEffect(()=>{const r=a.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),s.jsx(Te.div,{...e,ref:l})});LE.displayName=zE;function UE(e,t=globalThis==null?void 0:globalThis.document){const n=ws(e),a=u.useRef(!1),l=u.useRef(()=>{});return u.useEffect(()=>{const r=o=>{if(o.target&&!a.current){let c=function(){I0($E,n,d,{discrete:!0})};const d={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=c,t.addEventListener("click",l.current,{once:!0})):c()}else t.removeEventListener("click",l.current);a.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",r),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function BE(e,t=globalThis==null?void 0:globalThis.document){const n=ws(e),a=u.useRef(!1);return u.useEffect(()=>{const l=r=>{r.target&&!a.current&&I0(DE,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function hv(){const e=new CustomEvent(Yh);document.dispatchEvent(e)}function I0(e,t,n,{discrete:a}){const l=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?B0(l,r):l.dispatchEvent(r)}var _f="focusScope.autoFocusOnMount",Nf="focusScope.autoFocusOnUnmount",mv={bubbles:!1,cancelable:!0},HE="FocusScope",id=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:r,...i}=e,[o,c]=u.useState(null),d=ws(l),f=ws(r),h=u.useRef(null),m=Ke(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)?h.current=w:ca(h.current,{select:!0})},y=function(b){if(x.paused||!o)return;const w=b.relatedTarget;w!==null&&(o.contains(w)||ca(h.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const N of b)N.removedNodes.length>0&&ca(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){xv.add(x);const v=document.activeElement;if(!o.contains(v)){const g=new CustomEvent(_f,mv);o.addEventListener(_f,d),o.dispatchEvent(g),g.defaultPrevented||(IE(YE(P0(o)),{select:!0}),document.activeElement===v&&ca(o))}return()=>{o.removeEventListener(_f,d),setTimeout(()=>{const g=new CustomEvent(Nf,mv);o.addEventListener(Nf,f),o.dispatchEvent(g),g.defaultPrevented||ca(v??document.body,{select:!0}),o.removeEventListener(Nf,f),xv.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]=PE(p);b&&w?!v.shiftKey&&g===w?(v.preventDefault(),n&&ca(b,{select:!0})):v.shiftKey&&g===b&&(v.preventDefault(),n&&ca(w,{select:!0})):g===p&&v.preventDefault()}},[n,a,x.paused]);return s.jsx(Te.div,{tabIndex:-1,...i,ref:m,onKeyDown:j})});id.displayName=HE;function IE(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ca(a,{select:t}),document.activeElement!==n)return}function PE(e){const t=P0(e),n=pv(t,e),a=pv(t.reverse(),e);return[n,a]}function P0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function pv(e,t){for(const n of e)if(!qE(n,{upTo:t}))return n}function qE(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 GE(e){return e instanceof HTMLInputElement&&"select"in e}function ca(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&GE(e)&&t&&e.select()}}var xv=VE();function VE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=gv(e,t),e.unshift(t)},remove(t){var n;e=gv(e,t),(n=e[0])==null||n.resume()}}}function gv(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function YE(e){return e.filter(t=>t.tagName!=="A")}var FE="Portal",So=u.forwardRef((e,t)=>{var o;const{container:n,...a}=e,[l,r]=u.useState(!1);Vt(()=>r(!0),[]);const i=n||l&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?uS.createPortal(s.jsx(Te.div,{...a,ref:t}),i):null});So.displayName=FE;function KE(e,t){return u.useReducer((n,a)=>t[n][a]??n,e)}var Bn=e=>{const{present:t,children:n}=e,a=XE(t),l=typeof n=="function"?n({present:a.isPresent}):u.Children.only(n),r=Ke(a.ref,QE(l));return typeof n=="function"||a.isPresent?u.cloneElement(l,{ref:r}):null};Bn.displayName="Presence";function XE(e){const[t,n]=u.useState(),a=u.useRef(null),l=u.useRef(e),r=u.useRef("none"),i=e?"mounted":"unmounted",[o,c]=KE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=ac(a.current);r.current=o==="mounted"?d:"none"},[o]),Vt(()=>{const d=a.current,f=l.current;if(f!==e){const m=r.current,x=ac(d);e?c("MOUNT"):x==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&m!==x?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,c]),Vt(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=x=>{const v=ac(a.current).includes(x.animationName);if(x.target===t&&v&&(c("ANIMATION_END"),!l.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=x=>{x.target===t&&(r.current=ac(a.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:u.useCallback(d=>{a.current=d?getComputedStyle(d):null,n(d)},[])}}function ac(e){return(e==null?void 0:e.animationName)||"none"}function QE(e){var a,l;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=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kf=0;function Np(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??vv()),document.body.insertAdjacentElement("beforeend",e[1]??vv()),kf++,()=>{kf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kf--}},[])}function vv(){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 fs=function(){return fs=Object.assign||function(t){for(var n,a=1,l=arguments.length;a<l;a++){n=arguments[a];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},fs.apply(this,arguments)};function q0(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 l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]]);return n}function ZE(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,r;a<l;a++)(r||!(a in t))&&(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}var Ac="right-scroll-bar-position",Mc="width-before-scroll-bar",WE="with-scroll-bars-hidden",JE="--removed-body-scroll-bar-size";function Sf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function eA(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var tA=typeof window<"u"?u.useLayoutEffect:u.useEffect,yv=new WeakMap;function nA(e,t){var n=eA(null,function(a){return e.forEach(function(l){return Sf(l,a)})});return tA(function(){var a=yv.get(n);if(a){var l=new Set(a),r=new Set(e),i=n.current;l.forEach(function(o){r.has(o)||Sf(o,null)}),r.forEach(function(o){l.has(o)||Sf(o,i)})}yv.set(n,e)},[e]),n}function sA(e){return e}function aA(e,t){t===void 0&&(t=sA);var n=[],a=!1,l={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(r){var i=t(r,a);return n.push(i),function(){n=n.filter(function(o){return o!==i})}},assignSyncMedium:function(r){for(a=!0;n.length;){var i=n;n=[],i.forEach(r)}n={push:function(o){return r(o)},filter:function(){return n}}},assignMedium:function(r){a=!0;var i=[];if(n.length){var o=n;n=[],o.forEach(r),i=n}var c=function(){var f=i;i=[],f.forEach(r)},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 l}function lA(e){e===void 0&&(e={});var t=aA(null);return t.options=fs({async:!0,ssr:!1},e),t}var G0=function(e){var t=e.sideCar,n=q0(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,fs({},n))};G0.isSideCarExport=!0;function rA(e,t){return e.useMedium(t),G0}var V0=lA(),Cf=function(){},od=u.forwardRef(function(e,t){var n=u.useRef(null),a=u.useState({onScrollCapture:Cf,onWheelCapture:Cf,onTouchMoveCapture:Cf}),l=a[0],r=a[1],i=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,h=e.shards,m=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=q0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,R=nA([n,t]),_=fs(fs({},w),l);return u.createElement(u.Fragment,null,f&&u.createElement(N,{sideCar:V0,removeScrollBar:d,shards:h,noRelative:x,noIsolation:j,inert:v,setCallbacks:r,allowPinchZoom:!!y,lockRef:n,gapMode:b}),i?u.cloneElement(u.Children.only(o),fs(fs({},_),{ref:R})):u.createElement(p,fs({},_,{className:c,ref:R}),o))});od.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};od.classNames={fullWidth:Mc,zeroRight:Ac};var iA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function oA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iA();return t&&e.setAttribute("nonce",t),e}function cA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function uA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var dA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=oA())&&(cA(t,n),uA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},fA=function(){var e=dA();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Y0=function(){var e=fA(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},hA={left:0,top:0,right:0,gap:0},Rf=function(e){return parseInt(e||"",10)||0},mA=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[Rf(n),Rf(a),Rf(l)]},pA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return hA;var t=mA(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])}},xA=Y0(),ar="data-scroll-locked",gA=function(e,t,n,a){var l=e.left,r=e.top,i=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
340
|
-
.`.concat(WE,` {
|
|
341
|
-
overflow: hidden `).concat(a,`;
|
|
342
|
-
padding-right: `).concat(o,"px ").concat(a,`;
|
|
343
|
-
}
|
|
344
|
-
body[`).concat(ar,`] {
|
|
345
|
-
overflow: hidden `).concat(a,`;
|
|
346
|
-
overscroll-behavior: contain;
|
|
347
|
-
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
348
|
-
padding-left: `.concat(l,`px;
|
|
349
|
-
padding-top: `).concat(r,`px;
|
|
350
|
-
padding-right: `).concat(i,`px;
|
|
351
|
-
margin-left:0;
|
|
352
|
-
margin-top:0;
|
|
353
|
-
margin-right: `).concat(o,"px ").concat(a,`;
|
|
354
|
-
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.`).concat(Ac,` {
|
|
358
|
-
right: `).concat(o,"px ").concat(a,`;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.`).concat(Mc,` {
|
|
362
|
-
margin-right: `).concat(o,"px ").concat(a,`;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.`).concat(Ac," .").concat(Ac,` {
|
|
366
|
-
right: 0 `).concat(a,`;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.`).concat(Mc," .").concat(Mc,` {
|
|
370
|
-
margin-right: 0 `).concat(a,`;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
body[`).concat(ar,`] {
|
|
374
|
-
`).concat(JE,": ").concat(o,`px;
|
|
375
|
-
}
|
|
376
|
-
`)},bv=function(){var e=parseInt(document.body.getAttribute(ar)||"0",10);return isFinite(e)?e:0},vA=function(){u.useEffect(function(){return document.body.setAttribute(ar,(bv()+1).toString()),function(){var e=bv()-1;e<=0?document.body.removeAttribute(ar):document.body.setAttribute(ar,e.toString())}},[])},yA=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;vA();var r=u.useMemo(function(){return pA(l)},[l]);return u.createElement(xA,{styles:gA(r,!t,l,n?"":"!important")})},Fh=!1;if(typeof window<"u")try{var lc=Object.defineProperty({},"passive",{get:function(){return Fh=!0,!0}});window.addEventListener("test",lc,lc),window.removeEventListener("test",lc,lc)}catch{Fh=!1}var Sl=Fh?{passive:!1}:!1,bA=function(e){return e.tagName==="TEXTAREA"},F0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!bA(e)&&n[t]==="visible")},jA=function(e){return F0(e,"overflowY")},wA=function(e){return F0(e,"overflowX")},jv=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=K0(e,a);if(l){var r=X0(e,a),i=r[1],o=r[2];if(i>o)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},_A=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},NA=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},K0=function(e,t){return e==="v"?jA(t):wA(t)},X0=function(e,t){return e==="v"?_A(t):NA(t)},kA=function(e,t){return e==="h"&&t==="rtl"?-1:1},SA=function(e,t,n,a,l){var r=kA(e,window.getComputedStyle(t).direction),i=r*a,o=n.target,c=t.contains(o),d=!1,f=i>0,h=0,m=0;do{if(!o)break;var x=X0(e,o),j=x[0],v=x[1],y=x[2],g=v-y-r*j;(j||g)&&K0(e,o)&&(h+=g,m+=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(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},rc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},wv=function(e){return[e.deltaX,e.deltaY]},_v=function(e){return e&&"current"in e?e.current:e},CA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},RA=function(e){return`
|
|
377
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
378
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
379
|
-
`)},TA=0,Cl=[];function EA(e){var t=u.useRef([]),n=u.useRef([0,0]),a=u.useRef(),l=u.useState(TA++)[0],r=u.useState(Y0)[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(l));var v=ZE([e.lockRef.current],(e.shards||[]).map(_v),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(l))})}}},[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=rc(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,R=v.target,_=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in v&&_==="h"&&R.type==="range")return!1;var k=jv(_,R);if(!k)return!0;if(k?N=_:(N=_==="v"?"h":"v",k=jv(_,R)),!k)return!1;if(!a.current&&"changedTouches"in v&&(b||w)&&(a.current=N),!N)return!0;var U=a.current||N;return SA(U,y,v,U==="h"?b:w)},[]),c=u.useCallback(function(v){var y=v;if(!(!Cl.length||Cl[Cl.length-1]!==r)){var g="deltaY"in y?wv(y):rc(y),p=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&CA(N.delta,g)})[0];if(p&&p.should){y.cancelable&&y.preventDefault();return}if(!p){var b=(i.current.shards||[]).map(_v).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:AA(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=rc(v),a.current=void 0},[]),h=u.useCallback(function(v){d(v.type,wv(v),v.target,o(v,e.lockRef.current))},[]),m=u.useCallback(function(v){d(v.type,rc(v),v.target,o(v,e.lockRef.current))},[]);u.useEffect(function(){return Cl.push(r),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Sl),document.addEventListener("touchmove",c,Sl),document.addEventListener("touchstart",f,Sl),function(){Cl=Cl.filter(function(v){return v!==r}),document.removeEventListener("wheel",c,Sl),document.removeEventListener("touchmove",c,Sl),document.removeEventListener("touchstart",f,Sl)}},[]);var x=e.removeScrollBar,j=e.inert;return u.createElement(u.Fragment,null,j?u.createElement(r,{styles:RA(l)}):null,x?u.createElement(yA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function AA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const MA=rA(V0,EA);var cd=u.forwardRef(function(e,t){return u.createElement(od,fs({},e,{ref:t,sideCar:MA}))});cd.classNames=od.classNames;var OA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rl=new WeakMap,ic=new WeakMap,oc={},Tf=0,Q0=function(e){return e&&(e.host||Q0(e.parentNode))},$A=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=Q0(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})},DA=function(e,t,n,a){var l=$A(t,Array.isArray(e)?e:[e]);oc[n]||(oc[n]=new WeakMap);var r=oc[n],i=[],o=new Set,c=new Set(l),d=function(h){!h||o.has(h)||(o.add(h),d(h.parentNode))};l.forEach(d);var f=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(o.has(m))f(m);else try{var x=m.getAttribute(a),j=x!==null&&x!=="false",v=(Rl.get(m)||0)+1,y=(r.get(m)||0)+1;Rl.set(m,v),r.set(m,y),i.push(m),v===1&&j&&ic.set(m,!0),y===1&&m.setAttribute(n,"true"),j||m.setAttribute(a,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return f(t),o.clear(),Tf++,function(){i.forEach(function(h){var m=Rl.get(h)-1,x=r.get(h)-1;Rl.set(h,m),r.set(h,x),m||(ic.has(h)||h.removeAttribute(a),ic.delete(h)),x||h.removeAttribute(n)}),Tf--,Tf||(Rl=new WeakMap,Rl=new WeakMap,ic=new WeakMap,oc={})}},kp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=OA(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),DA(a,l,n,"aria-hidden")):function(){return null}},ud="Dialog",[Z0]=Ss(ud),[zA,rs]=Z0(ud),W0=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:r,modal:i=!0}=e,o=u.useRef(null),c=u.useRef(null),[d,f]=$a({prop:a,defaultProp:l??!1,onChange:r,caller:ud});return s.jsx(zA,{scope:t,triggerRef:o,contentRef:c,contentId:Wn(),titleId:Wn(),descriptionId:Wn(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(h=>!h),[f]),modal:i,children:n})};W0.displayName=ud;var J0="DialogTrigger",LA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=rs(J0,n),r=Ke(t,l.triggerRef);return s.jsx(Te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Rp(l.open),...a,ref:r,onClick:de(e.onClick,l.onOpenToggle)})});LA.displayName=J0;var Sp="DialogPortal",[UA,ew]=Z0(Sp,{forceMount:void 0}),tw=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,r=rs(Sp,t);return s.jsx(UA,{scope:t,forceMount:n,children:u.Children.map(a,i=>s.jsx(Bn,{present:n||r.open,children:s.jsx(So,{asChild:!0,container:l,children:i})}))})};tw.displayName=Sp;var vu="DialogOverlay",nw=u.forwardRef((e,t)=>{const n=ew(vu,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,r=rs(vu,e.__scopeDialog);return r.modal?s.jsx(Bn,{present:a||r.open,children:s.jsx(HA,{...l,ref:t})}):null});nw.displayName=vu;var BA=ul("DialogOverlay.RemoveScroll"),HA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=rs(vu,n);return s.jsx(cd,{as:BA,allowPinchZoom:!0,shards:[l.contentRef],children:s.jsx(Te.div,{"data-state":Rp(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),dl="DialogContent",sw=u.forwardRef((e,t)=>{const n=ew(dl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,r=rs(dl,e.__scopeDialog);return s.jsx(Bn,{present:a||r.open,children:r.modal?s.jsx(IA,{...l,ref:t}):s.jsx(PA,{...l,ref:t})})});sw.displayName=dl;var IA=u.forwardRef((e,t)=>{const n=rs(dl,e.__scopeDialog),a=u.useRef(null),l=Ke(t,n.contentRef,a);return u.useEffect(()=>{const r=a.current;if(r)return kp(r)},[]),s.jsx(aw,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:de(e.onCloseAutoFocus,r=>{var i;r.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:de(e.onPointerDownOutside,r=>{const i=r.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&r.preventDefault()}),onFocusOutside:de(e.onFocusOutside,r=>r.preventDefault())})}),PA=u.forwardRef((e,t)=>{const n=rs(dl,e.__scopeDialog),a=u.useRef(!1),l=u.useRef(!1);return s.jsx(aw,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var i,o;(i=e.onCloseAutoFocus)==null||i.call(e,r),r.defaultPrevented||(a.current||(o=n.triggerRef.current)==null||o.focus(),r.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:r=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const i=r.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&l.current&&r.preventDefault()}})}),aw=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:r,...i}=e,o=rs(dl,n),c=u.useRef(null),d=Ke(t,c);return Np(),s.jsxs(s.Fragment,{children:[s.jsx(id,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:r,children:s.jsx(ko,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Rp(o.open),...i,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(qA,{titleId:o.titleId}),s.jsx(VA,{contentRef:c,descriptionId:o.descriptionId})]})]})}),Cp="DialogTitle",lw=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=rs(Cp,n);return s.jsx(Te.h2,{id:l.titleId,...a,ref:t})});lw.displayName=Cp;var rw="DialogDescription",iw=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=rs(rw,n);return s.jsx(Te.p,{id:l.descriptionId,...a,ref:t})});iw.displayName=rw;var ow="DialogClose",cw=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=rs(ow,n);return s.jsx(Te.button,{type:"button",...a,ref:t,onClick:de(e.onClick,()=>l.onOpenChange(!1))})});cw.displayName=ow;function Rp(e){return e?"open":"closed"}var uw="DialogTitleWarning",[w5,dw]=vE(uw,{contentName:dl,titleName:Cp,docsSlug:"dialog"}),qA=({titleId:e})=>{const t=dw(uw),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
380
|
-
|
|
381
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
382
|
-
|
|
383
|
-
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},GA="DialogDescriptionWarning",VA=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${dw(GA).contentName}}.`;return u.useEffect(()=>{var r;const l=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},fw=W0,hw=tw,mw=nw,pw=sw,xw=lw,gw=iw,Tp=cw;function _n({className:e,...t}){return s.jsx(GR,{role:"status","aria-label":"Loading",className:le("size-4 animate-spin",e),...t})}const lr="aria-pressed:border aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:text-accent-foreground",YA="border border-primary bg-accent text-accent-foreground hover:bg-accent",dd=No("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"}}),G=u.forwardRef(({className:e,disabled:t,variant:n,size:a,asChild:l=!1,loading:r,children:i,...o},c)=>{const d=l?kE:"button",f=a==="icon"||a==="sm-icon"||a==="control-icon"||a==="xs-icon",h=s.jsx(_n,{"aria-hidden":"true","aria-label":void 0,role:void 0,className:le(!f&&"mr-2")}),m=l?i:r&&f?h:s.jsxs(s.Fragment,{children:[r?h:null,i]});return s.jsx(d,{className:le(dd({variant:n,size:a,className:e})),ref:c,disabled:t||r,...o,children:m})});G.displayName="Button";const vw=u.createContext(null);function FA({container:e,children:t}){return s.jsx(vw.Provider,{value:e,children:t})}function Co(){return u.useContext(vw)??void 0}function yw(e){return s.jsx(fw,{"data-slot":"alert-dialog",...e})}function KA({className:e,...t}){return s.jsx(mw,{"data-slot":"alert-dialog-overlay",className:le("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 bw({className:e,onOpenAutoFocus:t,onPointerDownOutside:n,onInteractOutside:a,...l}){return s.jsxs(hw,{container:Co(),children:[s.jsx(KA,{}),s.jsx(pw,{"data-slot":"alert-dialog-content",role:"alertdialog",className:le("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:r=>{if(t==null||t(r),r.defaultPrevented)return;const i=r.currentTarget,o=i instanceof HTMLElement?i.querySelector('[data-slot="alert-dialog-cancel"]'):null;o&&(r.preventDefault(),o.focus())},onPointerDownOutside:r=>{n==null||n(r),r.preventDefault()},onInteractOutside:r=>{a==null||a(r),r.preventDefault()},...l})]})}function jw({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:le("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ww({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:le("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function _w({className:e,...t}){return s.jsx(xw,{"data-slot":"alert-dialog-title",className:le("text-lg font-semibold",e),...t})}function Nw({className:e,...t}){return s.jsx(gw,{"data-slot":"alert-dialog-description",className:le("text-muted-foreground text-sm",e),...t})}function kw({className:e,variant:t,...n}){return s.jsx(Tp,{"data-slot":"alert-dialog-action",className:le(dd({variant:t}),e),...n})}function Sw({className:e,...t}){return s.jsx(Tp,{"data-slot":"alert-dialog-cancel",className:le(dd({variant:"outline"}),e),...t})}function XA(){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 QA(e,t){t!=null&&t.isConnected&&(e.preventDefault(),t.focus())}function Ro(){const[e,t]=u.useState(null),n=u.useRef(null),a=u.useRef(null),l=u.useCallback(o=>{var c;(c=n.current)==null||c.resolve(o),n.current=null,t(null)},[]),r=u.useCallback(o=>new Promise(c=>{var f;(f=n.current)==null||f.resolve(!1),a.current=XA();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(yw,{open:e!==null,onOpenChange:o=>{o||l(!1)},children:s.jsxs(bw,{onCloseAutoFocus:o=>QA(o,a.current),children:[s.jsxs(jw,{children:[s.jsx(_w,{children:e==null?void 0:e.title}),s.jsx(Nw,{className:"whitespace-pre-line",children:e==null?void 0:e.description})]}),s.jsxs(ww,{children:[s.jsx(Sw,{children:"Cancel"}),s.jsx(kw,{variant:e!=null&&e.destructive?"destructive":"default",onClick:()=>l(!0),children:e==null?void 0:e.action_label})]})]})});return{confirm:r,confirm_dialog:i}}const Os="px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",ZA=No("inline-flex items-center rounded-md border transition-colors",{variants:{variant:{default:`${Os} border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80`,secondary:`${Os} border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`${Os} border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80`,outline:`${Os} text-foreground`,success:`${Os} border-success/40 bg-success/10 text-success`,warning:`${Os} border-warning/40 bg-warning/10 text-warning`,info:`${Os} border-info/40 bg-info/10 text-info`,error:`${Os} border-destructive/40 bg-destructive/10 text-destructive`,neutral:`${Os} 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 me({className:e,variant:t,size:n,...a}){return s.jsx("div",{className:le(ZA({variant:t,size:n}),e),...a})}function Cw(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 Rw(e){const[t,n]=u.useState(void 0);return Vt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const r=l[0];let i,o;if("borderBoxSize"in r){const c=r.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 fd="Checkbox",[WA]=Ss(fd),[JA,Ep]=WA(fd);function eM(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:l,disabled:r,form:i,name:o,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:h}=e,[m,x]=$a({prop:n,defaultProp:l??!1,onChange:c,caller:fd}),[j,v]=u.useState(null),[y,g]=u.useState(null),p=u.useRef(!1),b=j?!!i||!!j.closest("form"):!0,w={checked:m,disabled:r,setChecked:x,control:j,setControl:v,name:o,form:i,value:f,hasConsumerStoppedPropagationRef:p,required:d,defaultChecked:Ea(l)?!1:l,isFormControl:b,bubbleInput:y,setBubbleInput:g};return s.jsx(JA,{scope:t,...w,children:tM(h)?h(w):a})}var Tw="CheckboxTrigger",Ew=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},l)=>{const{control:r,value:i,disabled:o,checked:c,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,isFormControl:x,bubbleInput:j}=Ep(Tw,e),v=Ke(l,f),y=u.useRef(c);return u.useEffect(()=>{const g=r==null?void 0:r.form;if(g){const p=()=>h(y.current);return g.addEventListener("reset",p),()=>g.removeEventListener("reset",p)}},[r,h]),s.jsx(Te.button,{type:"button",role:"checkbox","aria-checked":Ea(c)?"mixed":c,"aria-required":d,"data-state":Dw(c),"data-disabled":o?"":void 0,disabled:o,value:i,...a,ref:v,onKeyDown:de(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:de(n,g=>{h(p=>Ea(p)?!0:!p),j&&x&&(m.current=g.isPropagationStopped(),m.current||g.stopPropagation())})})});Ew.displayName=Tw;var Ap=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:l,defaultChecked:r,required:i,disabled:o,value:c,onCheckedChange:d,form:f,...h}=e;return s.jsx(eM,{__scopeCheckbox:n,checked:l,defaultChecked:r,disabled:o,required:i,onCheckedChange:d,name:a,form:f,value:c,internal_do_not_use_render:({isFormControl:m})=>s.jsxs(s.Fragment,{children:[s.jsx(Ew,{...h,ref:t,__scopeCheckbox:n}),m&&s.jsx($w,{__scopeCheckbox:n})]})})});Ap.displayName=fd;var Aw="CheckboxIndicator",Mw=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...l}=e,r=Ep(Aw,n);return s.jsx(Bn,{present:a||Ea(r.checked)||r.checked===!0,children:s.jsx(Te.span,{"data-state":Dw(r.checked),"data-disabled":r.disabled?"":void 0,...l,ref:t,style:{pointerEvents:"none",...e.style}})})});Mw.displayName=Aw;var Ow="CheckboxBubbleInput",$w=u.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:l,checked:r,defaultChecked:i,required:o,disabled:c,name:d,value:f,form:h,bubbleInput:m,setBubbleInput:x}=Ep(Ow,e),j=Ke(n,x),v=Cw(r),y=Rw(a);u.useEffect(()=>{const p=m;if(!p)return;const b=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(b,"checked").set,R=!l.current;if(v!==r&&N){const _=new Event("click",{bubbles:R});p.indeterminate=Ea(r),N.call(p,Ea(r)?!1:r),p.dispatchEvent(_)}},[m,v,r,l]);const g=u.useRef(Ea(r)?!1:r);return s.jsx(Te.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??g.current,required:o,disabled:c,name:d,value:f,form:h,...t,tabIndex:-1,ref:j,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});$w.displayName=Ow;function tM(e){return typeof e=="function"}function Ea(e){return e==="indeterminate"}function Dw(e){return Ea(e)?"indeterminate":e?"checked":"unchecked"}const Lr=u.forwardRef(({className:e,...t},n)=>s.jsx(Ap,{ref:n,className:le("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(Mw,{className:le("flex items-center justify-center text-current"),children:t.checked==="indeterminate"?s.jsx(QR,{className:"size-4","aria-hidden":"true"}):s.jsx(Or,{className:"size-4","aria-hidden":"true"})})}));Lr.displayName=Ap.displayName;const nM=No("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 Hn({...e}){return s.jsx(fw,{"data-slot":"dialog",...e})}function sM({...e}){const t=Co();return s.jsx(hw,{"data-slot":"dialog-portal",container:t,...e})}function aM({className:e,...t}){return s.jsx(mw,{"data-slot":"dialog-overlay",className:le("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 In({className:e,children:t,showCloseButton:n=!0,size:a,...l}){return s.jsxs(sM,{"data-slot":"dialog-portal",children:[s.jsx(aM,{}),s.jsxs(pw,{"data-slot":"dialog-content",className:le(nM({size:a}),e),...l,children:[t,n&&s.jsxs(Tp,{"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(ad,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Pn({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:le("flex flex-col gap-2 text-center sm:text-left",e),...t})}function qn({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-footer",className:le("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Gn({className:e,...t}){return s.jsx(xw,{"data-slot":"dialog-title",className:le("text-lg leading-none font-semibold",e),...t})}function Vn({className:e,...t}){return s.jsx(gw,{"data-slot":"dialog-description",className:le("text-muted-foreground text-sm",e),...t})}function Mp(e){const t=e+"CollectionProvider",[n,a]=Ss(t),[l,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:y,children:g}=v,p=ia.useRef(null),b=ia.useRef(new Map).current;return s.jsx(l,{scope:y,itemMap:b,collectionRef:p,children:g})};i.displayName=t;const o=e+"CollectionSlot",c=ul(o),d=ia.forwardRef((v,y)=>{const{scope:g,children:p}=v,b=r(o,g),w=Ke(y,b.collectionRef);return s.jsx(c,{ref:w,children:p})});d.displayName=o;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=ul(f),x=ia.forwardRef((v,y)=>{const{scope:g,children:p,...b}=v,w=ia.useRef(null),N=Ke(y,w),R=r(f,g);return ia.useEffect(()=>(R.itemMap.set(w,{ref:w,...b}),()=>void R.itemMap.delete(w))),s.jsx(m,{[h]:"",ref:N,children:p})});x.displayName=f;function j(v){const y=r(e+"CollectionConsumer",v);return ia.useCallback(()=>{const p=y.collectionRef.current;if(!p)return[];const b=Array.from(p.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((R,_)=>b.indexOf(R.ref.current)-b.indexOf(_.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:x},j,a]}var lM=u.createContext(void 0);function hd(e){const t=u.useContext(lM);return e||t||"ltr"}const rM=["top","right","bottom","left"],Da=Math.min,pn=Math.max,yu=Math.round,cc=Math.floor,bs=e=>({x:e,y:e}),iM={left:"right",right:"left",bottom:"top",top:"bottom"},oM={start:"end",end:"start"};function Kh(e,t,n){return pn(e,Da(t,n))}function Ks(e,t){return typeof e=="function"?e(t):e}function Xs(e){return e.split("-")[0]}function Ur(e){return e.split("-")[1]}function Op(e){return e==="x"?"y":"x"}function $p(e){return e==="y"?"height":"width"}function ps(e){return["top","bottom"].includes(Xs(e))?"y":"x"}function Dp(e){return Op(ps(e))}function cM(e,t,n){n===void 0&&(n=!1);const a=Ur(e),l=Dp(e),r=$p(l);let i=l==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=bu(i)),[i,bu(i)]}function uM(e){const t=bu(e);return[Xh(e),t,Xh(t)]}function Xh(e){return e.replace(/start|end/g,t=>oM[t])}function dM(e,t,n){const a=["left","right"],l=["right","left"],r=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?l:a:t?a:l;case"left":case"right":return t?r:i;default:return[]}}function fM(e,t,n,a){const l=Ur(e);let r=dM(Xs(e),n==="start",a);return l&&(r=r.map(i=>i+"-"+l),t&&(r=r.concat(r.map(Xh)))),r}function bu(e){return e.replace(/left|right|bottom|top/g,t=>iM[t])}function hM(e){return{top:0,right:0,bottom:0,left:0,...e}}function zw(e){return typeof e!="number"?hM(e):{top:e,right:e,bottom:e,left:e}}function ju(e){const{x:t,y:n,width:a,height:l}=e;return{width:a,height:l,top:n,left:t,right:t+a,bottom:n+l,x:t,y:n}}function Nv(e,t,n){let{reference:a,floating:l}=e;const r=ps(t),i=Dp(t),o=$p(i),c=Xs(t),d=r==="y",f=a.x+a.width/2-l.width/2,h=a.y+a.height/2-l.height/2,m=a[o]/2-l[o]/2;let x;switch(c){case"top":x={x:f,y:a.y-l.height};break;case"bottom":x={x:f,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:h};break;case"left":x={x:a.x-l.width,y:h};break;default:x={x:a.x,y:a.y}}switch(Ur(t)){case"start":x[i]-=m*(n&&d?-1:1);break;case"end":x[i]+=m*(n&&d?-1:1);break}return x}const mM=async(e,t,n)=>{const{placement:a="bottom",strategy:l="absolute",middleware:r=[],platform:i}=n,o=r.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:l}),{x:f,y:h}=Nv(d,a,c),m=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:h,initialPlacement:a,placement:m,strategy:l,middlewareData:x,rects:d,platform:i,elements:{reference:e,floating:t}});f=p??f,h=b??h,x={...x,[y]:{...x[y],...w}},N&&j<=50&&(j++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(d=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:l}):N.rects),{x:f,y:h}=Nv(d,m,c)),v=-1)}return{x:f,y:h,placement:m,strategy:l,middlewareData:x}};async function Ki(e,t){var n;t===void 0&&(t={});const{x:a,y:l,platform:r,rects:i,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:x=0}=Ks(t,e),j=zw(x),y=o[m?h==="floating"?"reference":"floating":h],g=ju(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(y)))==null||n?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(o.floating)),boundary:d,rootBoundary:f,strategy:c})),p=h==="floating"?{x:a,y:l,width:i.floating.width,height:i.floating.height}:i.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(o.floating)),w=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},N=ju(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.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 pM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:l,rects:r,platform:i,elements:o,middlewareData:c}=t,{element:d,padding:f=0}=Ks(e,t)||{};if(d==null)return{};const h=zw(f),m={x:n,y:a},x=Dp(l),j=$p(x),v=await i.getDimensions(d),y=x==="y",g=y?"top":"left",p=y?"bottom":"right",b=y?"clientHeight":"clientWidth",w=r.reference[j]+r.reference[x]-m[x]-r.floating[j],N=m[x]-r.reference[x],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let _=R?R[b]:0;(!_||!await(i.isElement==null?void 0:i.isElement(R)))&&(_=o.floating[b]||r.floating[j]);const k=w/2-N/2,U=_/2-v[j]/2-1,z=Da(h[g],U),K=Da(h[p],U),V=z,L=_-v[j]-K,M=_/2-v[j]/2+k,A=Kh(V,M,L),S=!c.arrow&&Ur(l)!=null&&M!==A&&r.reference[j]/2-(M<V?z:K)-v[j]/2<0,E=S?M<V?M-V:M-L:0;return{[x]:m[x]+E,data:{[x]:A,centerOffset:M-A-E,...S&&{alignmentOffset:E}},reset:S}}}),xM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:l,middlewareData:r,rects:i,initialPlacement:o,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:v=!0,...y}=Ks(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const g=Xs(l),p=ps(o),b=Xs(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=m||(b||!v?[bu(o)]:uM(o)),R=j!=="none";!m&&R&&N.push(...fM(o,v,j,w));const _=[o,...N],k=await Ki(t,y),U=[];let z=((a=r.flip)==null?void 0:a.overflows)||[];if(f&&U.push(k[g]),h){const M=cM(l,i,w);U.push(k[M[0]],k[M[1]])}if(z=[...z,{placement:l,overflows:U}],!U.every(M=>M<=0)){var K,V;const M=(((K=r.flip)==null?void 0:K.index)||0)+1,A=_[M];if(A&&(!(h==="alignment"?p!==ps(A):!1)||z.every(C=>C.overflows[0]>0&&ps(C.placement)===p)))return{data:{index:M,overflows:z},reset:{placement:A}};let S=(V=z.filter(E=>E.overflows[0]<=0).sort((E,C)=>E.overflows[1]-C.overflows[1])[0])==null?void 0:V.placement;if(!S)switch(x){case"bestFit":{var L;const E=(L=z.filter(C=>{if(R){const $=ps(C.placement);return $===p||$==="y"}return!0}).map(C=>[C.placement,C.overflows.filter($=>$>0).reduce(($,X)=>$+X,0)]).sort((C,$)=>C[1]-$[1])[0])==null?void 0:L[0];E&&(S=E);break}case"initialPlacement":S=o;break}if(l!==S)return{reset:{placement:S}}}return{}}}};function kv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Sv(e){return rM.some(t=>e[t]>=0)}const gM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...l}=Ks(e,t);switch(a){case"referenceHidden":{const r=await Ki(t,{...l,elementContext:"reference"}),i=kv(r,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Sv(i)}}}case"escaped":{const r=await Ki(t,{...l,altBoundary:!0}),i=kv(r,n.floating);return{data:{escapedOffsets:i,escaped:Sv(i)}}}default:return{}}}}};async function vM(e,t){const{placement:n,platform:a,elements:l}=e,r=await(a.isRTL==null?void 0:a.isRTL(l.floating)),i=Xs(n),o=Ur(n),c=ps(n)==="y",d=["left","top"].includes(i)?-1:1,f=r&&c?-1:1,h=Ks(t,e);let{mainAxis:m,crossAxis:x,alignmentAxis:j}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof j=="number"&&(x=o==="end"?j*-1:j),c?{x:x*f,y:m*d}:{x:m*d,y:x*f}}const yM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:l,y:r,placement:i,middlewareData:o}=t,c=await vM(t,e);return i===((n=o.offset)==null?void 0:n.placement)&&(a=o.arrow)!=null&&a.alignmentOffset?{}:{x:l+c.x,y:r+c.y,data:{...c,placement:i}}}}},bM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:l}=t,{mainAxis:r=!0,crossAxis:i=!1,limiter:o={fn:y=>{let{x:g,y:p}=y;return{x:g,y:p}}},...c}=Ks(e,t),d={x:n,y:a},f=await Ki(t,c),h=ps(Xs(l)),m=Op(h);let x=d[m],j=d[h];if(r){const y=m==="y"?"top":"left",g=m==="y"?"bottom":"right",p=x+f[y],b=x-f[g];x=Kh(p,x,b)}if(i){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",p=j+f[y],b=j-f[g];j=Kh(p,j,b)}const v=o.fn({...t,[m]:x,[h]:j});return{...v,data:{x:v.x-n,y:v.y-a,enabled:{[m]:r,[h]:i}}}}}},jM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:l,rects:r,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=Ks(e,t),f={x:n,y:a},h=ps(l),m=Op(h);let x=f[m],j=f[h];const v=Ks(o,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const b=m==="y"?"height":"width",w=r.reference[m]-r.floating[b]+y.mainAxis,N=r.reference[m]+r.reference[b]-y.mainAxis;x<w?x=w:x>N&&(x=N)}if(d){var g,p;const b=m==="y"?"width":"height",w=["top","left"].includes(Xs(l)),N=r.reference[h]-r.floating[b]+(w&&((g=i.offset)==null?void 0:g[h])||0)+(w?0:y.crossAxis),R=r.reference[h]+r.reference[b]+(w?0:((p=i.offset)==null?void 0:p[h])||0)-(w?y.crossAxis:0);j<N?j=N:j>R&&(j=R)}return{[m]:x,[h]:j}}}},wM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:l,rects:r,platform:i,elements:o}=t,{apply:c=()=>{},...d}=Ks(e,t),f=await Ki(t,d),h=Xs(l),m=Ur(l),x=ps(l)==="y",{width:j,height:v}=r.floating;let y,g;h==="top"||h==="bottom"?(y=h,g=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=h,y=m==="end"?"top":"bottom");const p=v-f.top-f.bottom,b=j-f.left-f.right,w=Da(v-f[y],p),N=Da(j-f[g],b),R=!t.middlewareData.shift;let _=w,k=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=b),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(_=p),R&&!m){const z=pn(f.left,0),K=pn(f.right,0),V=pn(f.top,0),L=pn(f.bottom,0);x?k=j-2*(z!==0||K!==0?z+K:pn(f.left,f.right)):_=v-2*(V!==0||L!==0?V+L:pn(f.top,f.bottom))}await c({...t,availableWidth:k,availableHeight:_});const U=await i.getDimensions(o.floating);return j!==U.width||v!==U.height?{reset:{rects:!0}}:{}}}};function md(){return typeof window<"u"}function Br(e){return Lw(e)?(e.nodeName||"").toLowerCase():"#document"}function jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cs(e){var t;return(t=(Lw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Lw(e){return md()?e instanceof Node||e instanceof jn(e).Node:!1}function ts(e){return md()?e instanceof Element||e instanceof jn(e).Element:!1}function _s(e){return md()?e instanceof HTMLElement||e instanceof jn(e).HTMLElement:!1}function Cv(e){return!md()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof jn(e).ShadowRoot}function To(e){const{overflow:t,overflowX:n,overflowY:a,display:l}=ns(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(l)}function _M(e){return["table","td","th"].includes(Br(e))}function pd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function zp(e){const t=Lp(),n=ts(e)?ns(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 NM(e){let t=za(e);for(;_s(t)&&!jr(t);){if(zp(t))return t;if(pd(t))return null;t=za(t)}return null}function Lp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jr(e){return["html","body","#document"].includes(Br(e))}function ns(e){return jn(e).getComputedStyle(e)}function xd(e){return ts(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function za(e){if(Br(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cv(e)&&e.host||Cs(e);return Cv(t)?t.host:t}function Uw(e){const t=za(e);return jr(t)?e.ownerDocument?e.ownerDocument.body:e.body:_s(t)&&To(t)?t:Uw(t)}function Xi(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const l=Uw(e),r=l===((a=e.ownerDocument)==null?void 0:a.body),i=jn(l);if(r){const o=Qh(i);return t.concat(i,i.visualViewport||[],To(l)?l:[],o&&n?Xi(o):[])}return t.concat(l,Xi(l,[],n))}function Qh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bw(e){const t=ns(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const l=_s(e),r=l?e.offsetWidth:n,i=l?e.offsetHeight:a,o=yu(n)!==r||yu(a)!==i;return o&&(n=r,a=i),{width:n,height:a,$:o}}function Up(e){return ts(e)?e:e.contextElement}function rr(e){const t=Up(e);if(!_s(t))return bs(1);const n=t.getBoundingClientRect(),{width:a,height:l,$:r}=Bw(t);let i=(r?yu(n.width):n.width)/a,o=(r?yu(n.height):n.height)/l;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const kM=bs(0);function Hw(e){const t=jn(e);return!Lp()||!t.visualViewport?kM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function SM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==jn(e)?!1:t}function fl(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect(),r=Up(e);let i=bs(1);t&&(a?ts(a)&&(i=rr(a)):i=rr(e));const o=SM(r,n,a)?Hw(r):bs(0);let c=(l.left+o.x)/i.x,d=(l.top+o.y)/i.y,f=l.width/i.x,h=l.height/i.y;if(r){const m=jn(r),x=a&&ts(a)?jn(a):a;let j=m,v=Qh(j);for(;v&&a&&x!==j;){const y=rr(v),g=v.getBoundingClientRect(),p=ns(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,h*=y.y,c+=b,d+=w,j=jn(v),v=Qh(j)}}return ju({width:f,height:h,x:c,y:d})}function Bp(e,t){const n=xd(e).scrollLeft;return t?t.left+n:fl(Cs(e)).left+n}function Iw(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=a.left+t.scrollLeft-(n?0:Bp(e,a)),r=a.top+t.scrollTop;return{x:l,y:r}}function CM(e){let{elements:t,rect:n,offsetParent:a,strategy:l}=e;const r=l==="fixed",i=Cs(a),o=t?pd(t.floating):!1;if(a===i||o&&r)return n;let c={scrollLeft:0,scrollTop:0},d=bs(1);const f=bs(0),h=_s(a);if((h||!h&&!r)&&((Br(a)!=="body"||To(i))&&(c=xd(a)),_s(a))){const x=fl(a);d=rr(a),f.x=x.x+a.clientLeft,f.y=x.y+a.clientTop}const m=i&&!h&&!r?Iw(i,c,!0):bs(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-c.scrollTop*d.y+f.y+m.y}}function RM(e){return Array.from(e.getClientRects())}function TM(e){const t=Cs(e),n=xd(e),a=e.ownerDocument.body,l=pn(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),r=pn(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+Bp(e);const o=-n.scrollTop;return ns(a).direction==="rtl"&&(i+=pn(t.clientWidth,a.clientWidth)-l),{width:l,height:r,x:i,y:o}}function EM(e,t){const n=jn(e),a=Cs(e),l=n.visualViewport;let r=a.clientWidth,i=a.clientHeight,o=0,c=0;if(l){r=l.width,i=l.height;const d=Lp();(!d||d&&t==="fixed")&&(o=l.offsetLeft,c=l.offsetTop)}return{width:r,height:i,x:o,y:c}}function AM(e,t){const n=fl(e,!0,t==="fixed"),a=n.top+e.clientTop,l=n.left+e.clientLeft,r=_s(e)?rr(e):bs(1),i=e.clientWidth*r.x,o=e.clientHeight*r.y,c=l*r.x,d=a*r.y;return{width:i,height:o,x:c,y:d}}function Rv(e,t,n){let a;if(t==="viewport")a=EM(e,n);else if(t==="document")a=TM(Cs(e));else if(ts(t))a=AM(t,n);else{const l=Hw(e);a={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return ju(a)}function Pw(e,t){const n=za(e);return n===t||!ts(n)||jr(n)?!1:ns(n).position==="fixed"||Pw(n,t)}function MM(e,t){const n=t.get(e);if(n)return n;let a=Xi(e,[],!1).filter(o=>ts(o)&&Br(o)!=="body"),l=null;const r=ns(e).position==="fixed";let i=r?za(e):e;for(;ts(i)&&!jr(i);){const o=ns(i),c=zp(i);!c&&o.position==="fixed"&&(l=null),(r?!c&&!l:!c&&o.position==="static"&&!!l&&["absolute","fixed"].includes(l.position)||To(i)&&!c&&Pw(e,i))?a=a.filter(f=>f!==i):l=o,i=za(i)}return t.set(e,a),a}function OM(e){let{element:t,boundary:n,rootBoundary:a,strategy:l}=e;const i=[...n==="clippingAncestors"?pd(t)?[]:MM(t,this._c):[].concat(n),a],o=i[0],c=i.reduce((d,f)=>{const h=Rv(t,f,l);return d.top=pn(h.top,d.top),d.right=Da(h.right,d.right),d.bottom=Da(h.bottom,d.bottom),d.left=pn(h.left,d.left),d},Rv(t,o,l));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function $M(e){const{width:t,height:n}=Bw(e);return{width:t,height:n}}function DM(e,t,n){const a=_s(t),l=Cs(t),r=n==="fixed",i=fl(e,!0,r,t);let o={scrollLeft:0,scrollTop:0};const c=bs(0);function d(){c.x=Bp(l)}if(a||!a&&!r)if((Br(t)!=="body"||To(l))&&(o=xd(t)),a){const x=fl(t,!0,r,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else l&&d();r&&!a&&l&&d();const f=l&&!a&&!r?Iw(l,o):bs(0),h=i.left+o.scrollLeft-c.x-f.x,m=i.top+o.scrollTop-c.y-f.y;return{x:h,y:m,width:i.width,height:i.height}}function Ef(e){return ns(e).position==="static"}function Tv(e,t){if(!_s(e)||ns(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Cs(e)===n&&(n=n.ownerDocument.body),n}function qw(e,t){const n=jn(e);if(pd(e))return n;if(!_s(e)){let l=za(e);for(;l&&!jr(l);){if(ts(l)&&!Ef(l))return l;l=za(l)}return n}let a=Tv(e,t);for(;a&&_M(a)&&Ef(a);)a=Tv(a,t);return a&&jr(a)&&Ef(a)&&!zp(a)?n:a||NM(e)||n}const zM=async function(e){const t=this.getOffsetParent||qw,n=this.getDimensions,a=await n(e.floating);return{reference:DM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function LM(e){return ns(e).direction==="rtl"}const UM={convertOffsetParentRelativeRectToViewportRelativeRect:CM,getDocumentElement:Cs,getClippingRect:OM,getOffsetParent:qw,getElementRects:zM,getClientRects:RM,getDimensions:$M,getScale:rr,isElement:ts,isRTL:LM};function Gw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function BM(e,t){let n=null,a;const l=Cs(e);function r(){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),r();const d=e.getBoundingClientRect(),{left:f,top:h,width:m,height:x}=d;if(o||t(),!m||!x)return;const j=cc(h),v=cc(l.clientWidth-(f+m)),y=cc(l.clientHeight-(h+x)),g=cc(f),b={rootMargin:-j+"px "+-v+"px "+-y+"px "+-g+"px",threshold:pn(0,Da(1,c))||1};let w=!0;function N(R){const _=R[0].intersectionRatio;if(_!==c){if(!w)return i();_?i(!1,_):a=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!Gw(d,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(N,{...b,root:l.ownerDocument})}catch{n=new IntersectionObserver(N,b)}n.observe(e)}return i(!0),r}function HM(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=Up(e),f=l||r?[...d?Xi(d):[],...Xi(t)]:[];f.forEach(g=>{l&&g.addEventListener("scroll",n,{passive:!0}),r&&g.addEventListener("resize",n)});const h=d&&o?BM(d,n):null;let m=-1,x=null;i&&(x=new ResizeObserver(g=>{let[p]=g;p&&p.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=x)==null||b.observe(t)})),n()}),d&&!c&&x.observe(d),x.observe(t));let j,v=c?fl(e):null;c&&y();function y(){const g=fl(e);v&&!Gw(v,g)&&n(),v=g,j=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(p=>{l&&p.removeEventListener("scroll",n),r&&p.removeEventListener("resize",n)}),h==null||h(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(j)}}const IM=yM,PM=bM,qM=xM,GM=wM,VM=gM,Ev=pM,YM=jM,FM=(e,t,n)=>{const a=new Map,l={platform:UM,...n},r={...l.platform,_c:a};return mM(e,t,{...l,platform:r})};var KM=typeof document<"u",XM=function(){},Oc=KM?u.useLayoutEffect:XM;function wu(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,l;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(!wu(e[a],t[a]))return!1;return!0}if(l=Object.keys(e),n=l.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,l[a]))return!1;for(a=n;a--!==0;){const r=l[a];if(!(r==="_owner"&&e.$$typeof)&&!wu(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function Vw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Av(e,t){const n=Vw(e);return Math.round(t*n)/n}function Af(e){const t=u.useRef(e);return Oc(()=>{t.current=e}),t}function QM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:l,elements:{reference:r,floating:i}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[f,h]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,x]=u.useState(a);wu(m,a)||x(a);const[j,v]=u.useState(null),[y,g]=u.useState(null),p=u.useCallback(C=>{C!==R.current&&(R.current=C,v(C))},[]),b=u.useCallback(C=>{C!==_.current&&(_.current=C,g(C))},[]),w=r||j,N=i||y,R=u.useRef(null),_=u.useRef(null),k=u.useRef(f),U=c!=null,z=Af(c),K=Af(l),V=Af(d),L=u.useCallback(()=>{if(!R.current||!_.current)return;const C={placement:t,strategy:n,middleware:m};K.current&&(C.platform=K.current),FM(R.current,_.current,C).then($=>{const X={...$,isPositioned:V.current!==!1};M.current&&!wu(k.current,X)&&(k.current=X,kr.flushSync(()=>{h(X)}))})},[m,t,n,K,V]);Oc(()=>{d===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,h(C=>({...C,isPositioned:!1})))},[d]);const M=u.useRef(!1);Oc(()=>(M.current=!0,()=>{M.current=!1}),[]),Oc(()=>{if(w&&(R.current=w),N&&(_.current=N),w&&N){if(z.current)return z.current(w,N,L);L()}},[w,N,L,z,U]);const A=u.useMemo(()=>({reference:R,floating:_,setReference:p,setFloating:b}),[p,b]),S=u.useMemo(()=>({reference:w,floating:N}),[w,N]),E=u.useMemo(()=>{const C={position:n,left:0,top:0};if(!S.floating)return C;const $=Av(S.floating,f.x),X=Av(S.floating,f.y);return o?{...C,transform:"translate("+$+"px, "+X+"px)",...Vw(S.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:X}},[n,o,S.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:L,refs:A,elements:S,floatingStyles:E}),[f,L,A,S,E])}const ZM=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:l}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?Ev({element:a.current,padding:l}).fn(n):{}:a?Ev({element:a,padding:l}).fn(n):{}}}},WM=(e,t)=>({...IM(e),options:[e,t]}),JM=(e,t)=>({...PM(e),options:[e,t]}),eO=(e,t)=>({...YM(e),options:[e,t]}),tO=(e,t)=>({...qM(e),options:[e,t]}),nO=(e,t)=>({...GM(e),options:[e,t]}),sO=(e,t)=>({...VM(e),options:[e,t]}),aO=(e,t)=>({...ZM(e),options:[e,t]});var lO="Arrow",Yw=u.forwardRef((e,t)=>{const{children:n,width:a=10,height:l=5,...r}=e;return s.jsx(Te.svg,{...r,ref:t,width:a,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});Yw.displayName=lO;var rO=Yw,Hp="Popper",[Fw,Hr]=Ss(Hp),[iO,Kw]=Fw(Hp),Xw=e=>{const{__scopePopper:t,children:n}=e,[a,l]=u.useState(null);return s.jsx(iO,{scope:t,anchor:a,onAnchorChange:l,children:n})};Xw.displayName=Hp;var Qw="PopperAnchor",Zw=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...l}=e,r=Kw(Qw,n),i=u.useRef(null),o=Ke(t,i);return u.useEffect(()=>{r.onAnchorChange((a==null?void 0:a.current)||i.current)}),a?null:s.jsx(Te.div,{...l,ref:o})});Zw.displayName=Qw;var Ip="PopperContent",[oO,cO]=Fw(Ip),Ww=u.forwardRef((e,t)=>{var O,H,te,re,ye,ae;const{__scopePopper:n,side:a="bottom",sideOffset:l=0,align:r="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:x="optimized",onPlaced:j,...v}=e,y=Kw(Ip,n),[g,p]=u.useState(null),b=Ke(t,je=>p(je)),[w,N]=u.useState(null),R=Rw(w),_=(R==null?void 0:R.width)??0,k=(R==null?void 0:R.height)??0,U=a+(r!=="center"?"-"+r:""),z=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(d)?d:[d],V=K.length>0,L={padding:z,boundary:K.filter(dO),altBoundary:V},{refs:M,floatingStyles:A,placement:S,isPositioned:E,middlewareData:C}=QM({strategy:"fixed",placement:U,whileElementsMounted:(...je)=>HM(...je,{animationFrame:x==="always"}),elements:{reference:y.anchor},middleware:[WM({mainAxis:l+k,alignmentAxis:i}),c&&JM({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?eO():void 0,...L}),c&&tO({...L}),nO({...L,apply:({elements:je,rects:ne,availableWidth:at,availableHeight:ue})=>{const{width:Be,height:Y}=ne.reference,Re=je.floating.style;Re.setProperty("--radix-popper-available-width",`${at}px`),Re.setProperty("--radix-popper-available-height",`${ue}px`),Re.setProperty("--radix-popper-anchor-width",`${Be}px`),Re.setProperty("--radix-popper-anchor-height",`${Y}px`)}}),w&&aO({element:w,padding:o}),fO({arrowWidth:_,arrowHeight:k}),m&&sO({strategy:"referenceHidden",...L})]}),[$,X]=t_(S),T=ws(j);Vt(()=>{E&&(T==null||T())},[E,T]);const P=(O=C.arrow)==null?void 0:O.x,J=(H=C.arrow)==null?void 0:H.y,ee=((te=C.arrow)==null?void 0:te.centerOffset)!==0,[ve,Q]=u.useState();return Vt(()=>{g&&Q(window.getComputedStyle(g).zIndex)},[g]),s.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:E?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[(re=C.transformOrigin)==null?void 0:re.x,(ye=C.transformOrigin)==null?void 0:ye.y].join(" "),...((ae=C.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(oO,{scope:n,placedSide:$,onArrowChange:N,arrowX:P,arrowY:J,shouldHideArrow:ee,children:s.jsx(Te.div,{"data-side":$,"data-align":X,...v,ref:b,style:{...v.style,animation:E?void 0:"none"}})})})});Ww.displayName=Ip;var Jw="PopperArrow",uO={top:"bottom",right:"left",bottom:"top",left:"right"},e_=u.forwardRef(function(t,n){const{__scopePopper:a,...l}=t,r=cO(Jw,a),i=uO[r.placedSide];return s.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:s.jsx(rO,{...l,ref:n,style:{...l.style,display:"block"}})})});e_.displayName=Jw;function dO(e){return e!==null}var fO=e=>({name:"transformOrigin",options:e,fn(t){var y,g,p;const{placement:n,rects:a,middlewareData:l}=t,i=((y=l.arrow)==null?void 0:y.centerOffset)!==0,o=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=t_(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((g=l.arrow)==null?void 0:g.x)??0)+o/2,x=(((p=l.arrow)==null?void 0:p.y)??0)+c/2;let j="",v="";return d==="bottom"?(j=i?h:`${m}px`,v=`${-c}px`):d==="top"?(j=i?h:`${m}px`,v=`${a.floating.height+c}px`):d==="right"?(j=`${-c}px`,v=i?h:`${x}px`):d==="left"&&(j=`${a.floating.width+c}px`,v=i?h:`${x}px`),{data:{x:j,y:v}}}});function t_(e){const[t,n="center"]=e.split("-");return[t,n]}var Pp=Xw,qp=Zw,Gp=Ww,Vp=e_,Mf="rovingFocusGroup.onEntryFocus",hO={bubbles:!1,cancelable:!0},Eo="RovingFocusGroup",[Zh,n_,mO]=Mp(Eo),[pO,gd]=Ss(Eo,[mO]),[xO,gO]=pO(Eo),s_=u.forwardRef((e,t)=>s.jsx(Zh.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Zh.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(vO,{...e,ref:t})})}));s_.displayName=Eo;var vO=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:l=!1,dir:r,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=u.useRef(null),x=Ke(t,m),j=hd(r),[v,y]=$a({prop:i,defaultProp:o??null,onChange:c,caller:Eo}),[g,p]=u.useState(!1),b=ws(d),w=n_(n),N=u.useRef(!1),[R,_]=u.useState(0);return u.useEffect(()=>{const k=m.current;if(k)return k.addEventListener(Mf,b),()=>k.removeEventListener(Mf,b)},[b]),s.jsx(xO,{scope:n,orientation:a,dir:j,loop:l,currentTabStopId:v,onItemFocus:u.useCallback(k=>y(k),[y]),onItemShiftTab:u.useCallback(()=>p(!0),[]),onFocusableItemAdd:u.useCallback(()=>_(k=>k+1),[]),onFocusableItemRemove:u.useCallback(()=>_(k=>k-1),[]),children:s.jsx(Te.div,{tabIndex:g||R===0?-1:0,"data-orientation":a,...h,ref:x,style:{outline:"none",...e.style},onMouseDown:de(e.onMouseDown,()=>{N.current=!0}),onFocus:de(e.onFocus,k=>{const U=!N.current;if(k.target===k.currentTarget&&U&&!g){const z=new CustomEvent(Mf,hO);if(k.currentTarget.dispatchEvent(z),!z.defaultPrevented){const K=w().filter(S=>S.focusable),V=K.find(S=>S.active),L=K.find(S=>S.id===v),A=[V,L,...K].filter(Boolean).map(S=>S.ref.current);r_(A,f)}}N.current=!1}),onBlur:de(e.onBlur,()=>p(!1))})})}),a_="RovingFocusGroupItem",l_=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:l=!1,tabStopId:r,children:i,...o}=e,c=Wn(),d=r||c,f=gO(a_,n),h=f.currentTabStopId===d,m=n_(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:v}=f;return u.useEffect(()=>{if(a)return x(),()=>j()},[a,x,j]),s.jsx(Zh.ItemSlot,{scope:n,id:d,focusable:a,active:l,children:s.jsx(Te.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:de(e.onMouseDown,y=>{a?f.onItemFocus(d):y.preventDefault()}),onFocus:de(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:de(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=jO(y,f.orientation,f.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let b=m().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?wO(b,w+1):b.slice(w+1)}setTimeout(()=>r_(b))}}),children:typeof i=="function"?i({isCurrentTabStop:h,hasTabStop:v!=null}):i})})});l_.displayName=a_;var yO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function bO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function jO(e,t,n){const a=bO(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return yO[a]}function r_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function wO(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var i_=s_,o_=l_,Wh=["Enter"," "],_O=["ArrowDown","PageUp","Home"],c_=["ArrowUp","PageDown","End"],NO=[..._O,...c_],kO={ltr:[...Wh,"ArrowRight"],rtl:[...Wh,"ArrowLeft"]},SO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ao="Menu",[Qi,CO,RO]=Mp(Ao),[bl,u_]=Ss(Ao,[RO,Hr,gd]),vd=Hr(),d_=gd(),[TO,jl]=bl(Ao),[EO,Mo]=bl(Ao),f_=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:l,onOpenChange:r,modal:i=!0}=e,o=vd(t),[c,d]=u.useState(null),f=u.useRef(!1),h=ws(r),m=hd(l);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(Pp,{...o,children:s.jsx(TO,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:s.jsx(EO,{scope:t,onClose:u.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:i,children:a})})})};f_.displayName=Ao;var AO="MenuAnchor",Yp=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=vd(n);return s.jsx(qp,{...l,...a,ref:t})});Yp.displayName=AO;var Fp="MenuPortal",[MO,h_]=bl(Fp,{forceMount:void 0}),m_=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:l}=e,r=jl(Fp,t);return s.jsx(MO,{scope:t,forceMount:n,children:s.jsx(Bn,{present:n||r.open,children:s.jsx(So,{asChild:!0,container:l,children:a})})})};m_.displayName=Fp;var $n="MenuContent",[OO,Kp]=bl($n),p_=u.forwardRef((e,t)=>{const n=h_($n,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,r=jl($n,e.__scopeMenu),i=Mo($n,e.__scopeMenu);return s.jsx(Qi.Provider,{scope:e.__scopeMenu,children:s.jsx(Bn,{present:a||r.open,children:s.jsx(Qi.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx($O,{...l,ref:t}):s.jsx(DO,{...l,ref:t})})})})}),$O=u.forwardRef((e,t)=>{const n=jl($n,e.__scopeMenu),a=u.useRef(null),l=Ke(t,a);return u.useEffect(()=>{const r=a.current;if(r)return kp(r)},[]),s.jsx(Xp,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:de(e.onFocusOutside,r=>r.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),DO=u.forwardRef((e,t)=>{const n=jl($n,e.__scopeMenu);return s.jsx(Xp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zO=ul("MenuContent.ScrollLock"),Xp=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:l,onOpenAutoFocus:r,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:x,disableOutsideScroll:j,...v}=e,y=jl($n,n),g=Mo($n,n),p=vd(n),b=d_(n),w=CO(n),[N,R]=u.useState(null),_=u.useRef(null),k=Ke(t,_,y.onContentChange),U=u.useRef(0),z=u.useRef(""),K=u.useRef(0),V=u.useRef(null),L=u.useRef("right"),M=u.useRef(0),A=j?cd:u.Fragment,S=j?{as:zO,allowPinchZoom:!0}:void 0,E=$=>{var O,H;const X=z.current+$,T=w().filter(te=>!te.disabled),P=document.activeElement,J=(O=T.find(te=>te.ref.current===P))==null?void 0:O.textValue,ee=T.map(te=>te.textValue),ve=KO(ee,X,J),Q=(H=T.find(te=>te.textValue===ve))==null?void 0:H.ref.current;(function te(re){z.current=re,window.clearTimeout(U.current),re!==""&&(U.current=window.setTimeout(()=>te(""),1e3))})(X),Q&&setTimeout(()=>Q.focus())};u.useEffect(()=>()=>window.clearTimeout(U.current),[]),Np();const C=u.useCallback($=>{var T,P;return L.current===((T=V.current)==null?void 0:T.side)&&QO($,(P=V.current)==null?void 0:P.area)},[]);return s.jsx(OO,{scope:n,searchRef:z,onItemEnter:u.useCallback($=>{C($)&&$.preventDefault()},[C]),onItemLeave:u.useCallback($=>{var X;C($)||((X=_.current)==null||X.focus(),R(null))},[C]),onTriggerLeave:u.useCallback($=>{C($)&&$.preventDefault()},[C]),pointerGraceTimerRef:K,onPointerGraceIntentChange:u.useCallback($=>{V.current=$},[]),children:s.jsx(A,{...S,children:s.jsx(id,{asChild:!0,trapped:l,onMountAutoFocus:de(r,$=>{var X;$.preventDefault(),(X=_.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(ko,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:x,children:s.jsx(i_,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:a,currentTabStopId:N,onCurrentTabStopIdChange:R,onEntryFocus:de(c,$=>{g.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Gp,{role:"menu","aria-orientation":"vertical","data-state":A_(y.open),"data-radix-menu-content":"",dir:g.dir,...p,...v,ref:k,style:{outline:"none",...v.style},onKeyDown:de(v.onKeyDown,$=>{const T=$.target.closest("[data-radix-menu-content]")===$.currentTarget,P=$.ctrlKey||$.altKey||$.metaKey,J=$.key.length===1;T&&($.key==="Tab"&&$.preventDefault(),!P&&J&&E($.key));const ee=_.current;if($.target!==ee||!NO.includes($.key))return;$.preventDefault();const Q=w().filter(O=>!O.disabled).map(O=>O.ref.current);c_.includes($.key)&&Q.reverse(),YO(Q)}),onBlur:de(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(U.current),z.current="")}),onPointerMove:de(e.onPointerMove,Zi($=>{const X=$.target,T=M.current!==$.clientX;if($.currentTarget.contains(X)&&T){const P=$.clientX>M.current?"right":"left";L.current=P,M.current=$.clientX}}))})})})})})})});p_.displayName=$n;var LO="MenuGroup",Qp=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Te.div,{role:"group",...a,ref:t})});Qp.displayName=LO;var UO="MenuLabel",x_=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Te.div,{...a,ref:t})});x_.displayName=UO;var _u="MenuItem",Mv="menu.itemSelect",yd=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...l}=e,r=u.useRef(null),i=Mo(_u,e.__scopeMenu),o=Kp(_u,e.__scopeMenu),c=Ke(t,r),d=u.useRef(!1),f=()=>{const h=r.current;if(!n&&h){const m=new CustomEvent(Mv,{bubbles:!0,cancelable:!0});h.addEventListener(Mv,x=>a==null?void 0:a(x),{once:!0}),B0(h,m),m.defaultPrevented?d.current=!1:i.onClose()}};return s.jsx(g_,{...l,ref:c,disabled:n,onClick:de(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:de(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:de(e.onKeyDown,h=>{const m=o.searchRef.current!=="";n||m&&h.key===" "||Wh.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});yd.displayName=_u;var g_=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:l,...r}=e,i=Kp(_u,n),o=d_(n),c=u.useRef(null),d=Ke(t,c),[f,h]=u.useState(!1),[m,x]=u.useState("");return u.useEffect(()=>{const j=c.current;j&&x((j.textContent??"").trim())},[r.children]),s.jsx(Qi.ItemSlot,{scope:n,disabled:a,textValue:l??m,children:s.jsx(o_,{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,...r,ref:d,onPointerMove:de(e.onPointerMove,Zi(j=>{a?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:de(e.onPointerLeave,Zi(j=>i.onItemLeave(j))),onFocus:de(e.onFocus,()=>h(!0)),onBlur:de(e.onBlur,()=>h(!1))})})})}),BO="MenuCheckboxItem",v_=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...l}=e;return s.jsx(__,{scope:e.__scopeMenu,checked:n,children:s.jsx(yd,{role:"menuitemcheckbox","aria-checked":Nu(n)?"mixed":n,...l,ref:t,"data-state":Wp(n),onSelect:de(l.onSelect,()=>a==null?void 0:a(Nu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});v_.displayName=BO;var y_="MenuRadioGroup",[HO,IO]=bl(y_,{value:void 0,onValueChange:()=>{}}),b_=u.forwardRef((e,t)=>{const{value:n,onValueChange:a,...l}=e,r=ws(a);return s.jsx(HO,{scope:e.__scopeMenu,value:n,onValueChange:r,children:s.jsx(Qp,{...l,ref:t})})});b_.displayName=y_;var j_="MenuRadioItem",w_=u.forwardRef((e,t)=>{const{value:n,...a}=e,l=IO(j_,e.__scopeMenu),r=n===l.value;return s.jsx(__,{scope:e.__scopeMenu,checked:r,children:s.jsx(yd,{role:"menuitemradio","aria-checked":r,...a,ref:t,"data-state":Wp(r),onSelect:de(a.onSelect,()=>{var i;return(i=l.onValueChange)==null?void 0:i.call(l,n)},{checkForDefaultPrevented:!1})})})});w_.displayName=j_;var Zp="MenuItemIndicator",[__,PO]=bl(Zp,{checked:!1}),N_=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...l}=e,r=PO(Zp,n);return s.jsx(Bn,{present:a||Nu(r.checked)||r.checked===!0,children:s.jsx(Te.span,{...l,ref:t,"data-state":Wp(r.checked)})})});N_.displayName=Zp;var qO="MenuSeparator",k_=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Te.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});k_.displayName=qO;var GO="MenuArrow",S_=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=vd(n);return s.jsx(Vp,{...l,...a,ref:t})});S_.displayName=GO;var VO="MenuSub",[_5,C_]=bl(VO),ui="MenuSubTrigger",R_=u.forwardRef((e,t)=>{const n=jl(ui,e.__scopeMenu),a=Mo(ui,e.__scopeMenu),l=C_(ui,e.__scopeMenu),r=Kp(ui,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=r,d={__scopeMenu:e.__scopeMenu},f=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>f,[f]),u.useEffect(()=>{const h=o.current;return()=>{window.clearTimeout(h),c(null)}},[o,c]),s.jsx(Yp,{asChild:!0,...d,children:s.jsx(g_,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":A_(n.open),...e,ref:rd(t,l.onTriggerChange),onClick:h=>{var m;(m=e.onClick)==null||m.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:de(e.onPointerMove,Zi(h=>{r.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(r.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:de(e.onPointerLeave,Zi(h=>{var x,j;f();const m=(x=n.content)==null?void 0:x.getBoundingClientRect();if(m){const v=(j=n.content)==null?void 0:j.dataset.side,y=v==="right",g=y?-5:5,p=m[y?"left":"right"],b=m[y?"right":"left"];r.onPointerGraceIntentChange({area:[{x:h.clientX+g,y:h.clientY},{x:p,y:m.top},{x:b,y:m.top},{x:b,y:m.bottom},{x:p,y:m.bottom}],side:v}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>r.onPointerGraceIntentChange(null),300)}else{if(r.onTriggerLeave(h),h.defaultPrevented)return;r.onPointerGraceIntentChange(null)}})),onKeyDown:de(e.onKeyDown,h=>{var x;const m=r.searchRef.current!=="";e.disabled||m&&h.key===" "||kO[a.dir].includes(h.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),h.preventDefault())})})})});R_.displayName=ui;var T_="MenuSubContent",E_=u.forwardRef((e,t)=>{const n=h_($n,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,r=jl($n,e.__scopeMenu),i=Mo($n,e.__scopeMenu),o=C_(T_,e.__scopeMenu),c=u.useRef(null),d=Ke(t,c);return s.jsx(Qi.Provider,{scope:e.__scopeMenu,children:s.jsx(Bn,{present:a||r.open,children:s.jsx(Qi.Slot,{scope:e.__scopeMenu,children:s.jsx(Xp,{id:o.contentId,"aria-labelledby":o.triggerId,...l,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;i.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:de(e.onFocusOutside,f=>{f.target!==o.trigger&&r.onOpenChange(!1)}),onEscapeKeyDown:de(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:de(e.onKeyDown,f=>{var x;const h=f.currentTarget.contains(f.target),m=SO[i.dir].includes(f.key);h&&m&&(r.onOpenChange(!1),(x=o.trigger)==null||x.focus(),f.preventDefault())})})})})})});E_.displayName=T_;function A_(e){return e?"open":"closed"}function Nu(e){return e==="indeterminate"}function Wp(e){return Nu(e)?"indeterminate":e?"checked":"unchecked"}function YO(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function FO(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function KO(e,t,n){const l=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let i=FO(e,Math.max(r,0));l.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(l.toLowerCase()));return c!==n?c:void 0}function XO(e,t){const{x:n,y:a}=e;let l=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){const o=t[r],c=t[i],d=o.x,f=o.y,h=c.x,m=c.y;f>a!=m>a&&n<(h-d)*(a-f)/(m-f)+d&&(l=!l)}return l}function QO(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return XO(n,t)}function Zi(e){return t=>t.pointerType==="mouse"?e(t):void 0}var ZO=f_,WO=Yp,JO=m_,e4=p_,t4=Qp,n4=x_,s4=yd,a4=v_,l4=b_,r4=w_,i4=N_,o4=k_,c4=S_,u4=R_,d4=E_,bd="DropdownMenu",[f4]=Ss(bd,[u_]),Qt=u_(),[h4,M_]=f4(bd),O_=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:l,defaultOpen:r,onOpenChange:i,modal:o=!0}=e,c=Qt(t),d=u.useRef(null),[f,h]=$a({prop:l,defaultProp:r??!1,onChange:i,caller:bd});return s.jsx(h4,{scope:t,triggerId:Wn(),triggerRef:d,contentId:Wn(),open:f,onOpenChange:h,onOpenToggle:u.useCallback(()=>h(m=>!m),[h]),modal:o,children:s.jsx(ZO,{...c,open:f,onOpenChange:h,dir:a,modal:o,children:n})})};O_.displayName=bd;var $_="DropdownMenuTrigger",D_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...l}=e,r=M_($_,n),i=Qt(n);return s.jsx(WO,{asChild:!0,...i,children:s.jsx(Te.button,{type:"button",id:r.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":r.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...l,ref:rd(t,r.triggerRef),onPointerDown:de(e.onPointerDown,o=>{!a&&o.button===0&&o.ctrlKey===!1&&(r.onOpenToggle(),r.open||o.preventDefault())}),onKeyDown:de(e.onKeyDown,o=>{a||(["Enter"," "].includes(o.key)&&r.onOpenToggle(),o.key==="ArrowDown"&&r.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});D_.displayName=$_;var m4="DropdownMenuPortal",z_=e=>{const{__scopeDropdownMenu:t,...n}=e,a=Qt(t);return s.jsx(JO,{...a,...n})};z_.displayName=m4;var L_="DropdownMenuContent",U_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=M_(L_,n),r=Qt(n),i=u.useRef(!1);return s.jsx(e4,{id:l.contentId,"aria-labelledby":l.triggerId,...r,...a,ref:t,onCloseAutoFocus:de(e.onCloseAutoFocus,o=>{var c;i.current||(c=l.triggerRef.current)==null||c.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:de(e.onInteractOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!l.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)"}})});U_.displayName=L_;var p4="DropdownMenuGroup",x4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(t4,{...l,...a,ref:t})});x4.displayName=p4;var g4="DropdownMenuLabel",B_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(n4,{...l,...a,ref:t})});B_.displayName=g4;var v4="DropdownMenuItem",H_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(s4,{...l,...a,ref:t})});H_.displayName=v4;var y4="DropdownMenuCheckboxItem",I_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(a4,{...l,...a,ref:t})});I_.displayName=y4;var b4="DropdownMenuRadioGroup",j4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(l4,{...l,...a,ref:t})});j4.displayName=b4;var w4="DropdownMenuRadioItem",P_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(r4,{...l,...a,ref:t})});P_.displayName=w4;var _4="DropdownMenuItemIndicator",q_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(i4,{...l,...a,ref:t})});q_.displayName=_4;var N4="DropdownMenuSeparator",G_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(o4,{...l,...a,ref:t})});G_.displayName=N4;var k4="DropdownMenuArrow",S4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(c4,{...l,...a,ref:t})});S4.displayName=k4;var C4="DropdownMenuSubTrigger",V_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(u4,{...l,...a,ref:t})});V_.displayName=C4;var R4="DropdownMenuSubContent",Y_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Qt(n);return s.jsx(d4,{...l,...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)"}})});Y_.displayName=R4;var T4=O_,E4=D_,A4=z_,F_=U_,K_=B_,X_=H_,Q_=I_,Z_=P_,W_=q_,J_=G_,eN=V_,tN=Y_;const jd=T4,wd=E4,M4=u.forwardRef(({className:e,inset:t,children:n,...a},l)=>s.jsxs(eN,{ref:l,className:le("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(yp,{className:"ml-auto"})]}));M4.displayName=eN.displayName;const O4=u.forwardRef(({className:e,...t},n)=>s.jsx(tN,{ref:n,className:le("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}));O4.displayName=tN.displayName;const Oo=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>s.jsx(A4,{container:Co(),children:s.jsx(F_,{ref:a,sideOffset:t,className:le("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})}));Oo.displayName=F_.displayName;const wr=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(X_,{ref:a,className:le("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}));wr.displayName=X_.displayName;const $4=u.forwardRef(({className:e,children:t,checked:n,...a},l)=>s.jsxs(Q_,{ref:l,className:le("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(W_,{children:s.jsx(Or,{className:"h-4 w-4"})})}),t]}));$4.displayName=Q_.displayName;const D4=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(Z_,{ref:a,className:le("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(W_,{children:s.jsx(mR,{className:"h-2 w-2 fill-current"})})}),t]}));D4.displayName=Z_.displayName;const z4=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(K_,{ref:a,className:le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));z4.displayName=K_.displayName;const L4=u.forwardRef(({className:e,...t},n)=>s.jsx(J_,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));L4.displayName=J_.displayName;const U4={default:"h-9 px-3 py-1 text-sm",control:"h-7 px-2 py-1 text-xs"},Tt=u.forwardRef(({className:e,type:t,inputSize:n="default",...a},l)=>s.jsx("input",{type:t,className:le("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",U4[n],e),ref:l,...a}));Tt.displayName="Input";var B4="Label",nN=u.forwardRef((e,t)=>s.jsx(Te.label,{...e,ref:t,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));nN.displayName=B4;var sN=nN;const H4=No("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ue=u.forwardRef(({className:e,...t},n)=>s.jsx(sN,{ref:n,className:le(H4(),e),...t}));Ue.displayName=sN.displayName;function Ha({title:e,description:t,backHref:n,backLabel:a,className:l,icon:r,link:i}){const o=s.jsx(G,{asChild:!0,variant:"outline",size:"sm",className:"mt-4 no-underline",children:s.jsx(i,{href:n,children:a})});return r?s.jsx("div",{className:le("flex-1 px-4 py-8 sm:px-6 lg:px-8",l),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:r}),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:le("flex-1 px-4 py-8 sm:px-6 lg:px-8",l),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 Zt({title:e,description:t,actions:n,className:a,children:l,...r}){return s.jsxs("header",{"data-slot":"page-header",className:le("flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",a),...r,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,l]}),n?s.jsx("div",{"data-slot":"page-header-actions",className:"flex shrink-0 items-center gap-2",children:n}):null]})}function _t({as:e="div",className:t,...n}){return s.jsx(e,{className:le("rounded-lg border",t),...n})}function Ov(e,[t,n]){return Math.min(n,Math.max(t,e))}var aN=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"}),I4="VisuallyHidden",lN=u.forwardRef((e,t)=>s.jsx(Te.span,{...e,ref:t,style:{...aN,...e.style}}));lN.displayName=I4;var P4=lN,q4=[" ","Enter","ArrowUp","ArrowDown"],G4=[" ","Enter"],hl="Select",[_d,Nd,V4]=Mp(hl),[Ir]=Ss(hl,[V4,Hr]),kd=Hr(),[Y4,Ia]=Ir(hl),[F4,K4]=Ir(hl),rN=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:l,onOpenChange:r,value:i,defaultValue:o,onValueChange:c,dir:d,name:f,autoComplete:h,disabled:m,required:x,form:j}=e,v=kd(t),[y,g]=u.useState(null),[p,b]=u.useState(null),[w,N]=u.useState(!1),R=hd(d),[_,k]=$a({prop:a,defaultProp:l??!1,onChange:r,caller:hl}),[U,z]=$a({prop:i,defaultProp:o,onChange:c,caller:hl}),K=u.useRef(null),V=y?j||!!y.closest("form"):!0,[L,M]=u.useState(new Set),A=Array.from(L).map(S=>S.props.value).join(";");return s.jsx(Pp,{...v,children:s.jsxs(Y4,{required:x,scope:t,trigger:y,onTriggerChange:g,valueNode:p,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:N,contentId:Wn(),value:U,onValueChange:z,open:_,onOpenChange:k,dir:R,triggerPointerDownPosRef:K,disabled:m,children:[s.jsx(_d.Provider,{scope:t,children:s.jsx(F4,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(S=>{M(E=>new Set(E).add(S))},[]),onNativeOptionRemove:u.useCallback(S=>{M(E=>{const C=new Set(E);return C.delete(S),C})},[]),children:n})}),V?s.jsxs(EN,{"aria-hidden":!0,required:x,tabIndex:-1,name:f,autoComplete:h,value:U,onChange:S=>z(S.target.value),disabled:m,form:j,children:[U===void 0?s.jsx("option",{value:""}):null,Array.from(L)]},A):null]})})};rN.displayName=hl;var iN="SelectTrigger",oN=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...l}=e,r=kd(n),i=Ia(iN,n),o=i.disabled||a,c=Ke(t,i.onTriggerChange),d=Nd(n),f=u.useRef("touch"),[h,m,x]=MN(v=>{const y=d().filter(b=>!b.disabled),g=y.find(b=>b.value===i.value),p=ON(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(qp,{asChild:!0,...r,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":AN(i.value)?"":void 0,...l,ref:c,onClick:de(l.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&j(v)}),onPointerDown:de(l.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:de(l.onKeyDown,v=>{const y=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(y&&v.key===" ")&&q4.includes(v.key)&&(j(),v.preventDefault())})})})});oN.displayName=iN;var cN="SelectValue",uN=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:l,children:r,placeholder:i="",...o}=e,c=Ia(cN,n),{onValueNodeHasChildrenChange:d}=c,f=r!==void 0,h=Ke(t,c.onValueNodeChange);return Vt(()=>{d(f)},[d,f]),s.jsx(Te.span,{...o,ref:h,style:{pointerEvents:"none"},children:AN(c.value)?s.jsx(s.Fragment,{children:i}):r})});uN.displayName=cN;var X4="SelectIcon",dN=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...l}=e;return s.jsx(Te.span,{"aria-hidden":!0,...l,ref:t,children:a||"▼"})});dN.displayName=X4;var Q4="SelectPortal",fN=e=>s.jsx(So,{asChild:!0,...e});fN.displayName=Q4;var ml="SelectContent",hN=u.forwardRef((e,t)=>{const n=Ia(ml,e.__scopeSelect),[a,l]=u.useState();if(Vt(()=>{l(new DocumentFragment)},[]),!n.open){const r=a;return r?kr.createPortal(s.jsx(mN,{scope:e.__scopeSelect,children:s.jsx(_d.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),r):null}return s.jsx(pN,{...e,ref:t})});hN.displayName=ml;var Yn=10,[mN,Pa]=Ir(ml),Z4="SelectContentImpl",W4=ul("SelectContent.RemoveScroll"),pN=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:r,onPointerDownOutside:i,side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:x,sticky:j,hideWhenDetached:v,avoidCollisions:y,...g}=e,p=Ia(ml,n),[b,w]=u.useState(null),[N,R]=u.useState(null),_=Ke(t,O=>w(O)),[k,U]=u.useState(null),[z,K]=u.useState(null),V=Nd(n),[L,M]=u.useState(!1),A=u.useRef(!1);u.useEffect(()=>{if(b)return kp(b)},[b]),Np();const S=u.useCallback(O=>{const[H,...te]=V().map(ae=>ae.ref.current),[re]=te.slice(-1),ye=document.activeElement;for(const ae of O)if(ae===ye||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===H&&N&&(N.scrollTop=0),ae===re&&N&&(N.scrollTop=N.scrollHeight),ae==null||ae.focus(),document.activeElement!==ye))return},[V,N]),E=u.useCallback(()=>S([k,b]),[S,k,b]);u.useEffect(()=>{L&&E()},[L,E]);const{onOpenChange:C,triggerPointerDownPosRef:$}=p;u.useEffect(()=>{if(b){let O={x:0,y:0};const H=re=>{var ye,ae;O={x:Math.abs(Math.round(re.pageX)-(((ye=$.current)==null?void 0:ye.x)??0)),y:Math.abs(Math.round(re.pageY)-(((ae=$.current)==null?void 0:ae.y)??0))}},te=re=>{O.x<=10&&O.y<=10?re.preventDefault():b.contains(re.target)||C(!1),document.removeEventListener("pointermove",H),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",H),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",te,{capture:!0})}}},[b,C,$]),u.useEffect(()=>{const O=()=>C(!1);return window.addEventListener("blur",O),window.addEventListener("resize",O),()=>{window.removeEventListener("blur",O),window.removeEventListener("resize",O)}},[C]);const[X,T]=MN(O=>{const H=V().filter(ye=>!ye.disabled),te=H.find(ye=>ye.ref.current===document.activeElement),re=ON(H,O,te);re&&setTimeout(()=>re.ref.current.focus())}),P=u.useCallback((O,H,te)=>{const re=!A.current&&!te;(p.value!==void 0&&p.value===H||re)&&(U(O),re&&(A.current=!0))},[p.value]),J=u.useCallback(()=>b==null?void 0:b.focus(),[b]),ee=u.useCallback((O,H,te)=>{const re=!A.current&&!te;(p.value!==void 0&&p.value===H||re)&&K(O)},[p.value]),ve=a==="popper"?Jh:xN,Q=ve===Jh?{side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:x,sticky:j,hideWhenDetached:v,avoidCollisions:y}:{};return s.jsx(mN,{scope:n,content:b,viewport:N,onViewportChange:R,itemRefCallback:P,selectedItem:k,onItemLeave:J,itemTextRefCallback:ee,focusSelectedItem:E,selectedItemText:z,position:a,isPositioned:L,searchRef:X,children:s.jsx(cd,{as:W4,allowPinchZoom:!0,children:s.jsx(id,{asChild:!0,trapped:p.open,onMountAutoFocus:O=>{O.preventDefault()},onUnmountAutoFocus:de(l,O=>{var H;(H=p.trigger)==null||H.focus({preventScroll:!0}),O.preventDefault()}),children:s.jsx(ko,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:O=>O.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:s.jsx(ve,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:O=>O.preventDefault(),...g,...Q,onPlaced:()=>M(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:de(g.onKeyDown,O=>{const H=O.ctrlKey||O.altKey||O.metaKey;if(O.key==="Tab"&&O.preventDefault(),!H&&O.key.length===1&&T(O.key),["ArrowUp","ArrowDown","Home","End"].includes(O.key)){let re=V().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(O.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(O.key)){const ye=O.target,ae=re.indexOf(ye);re=re.slice(ae+1)}setTimeout(()=>S(re)),O.preventDefault()}})})})})})})});pN.displayName=Z4;var J4="SelectItemAlignedPosition",xN=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...l}=e,r=Ia(ml,n),i=Pa(ml,n),[o,c]=u.useState(null),[d,f]=u.useState(null),h=Ke(t,_=>f(_)),m=Nd(n),x=u.useRef(!1),j=u.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:g,focusSelectedItem:p}=i,b=u.useCallback(()=>{if(r.trigger&&r.valueNode&&o&&d&&v&&y&&g){const _=r.trigger.getBoundingClientRect(),k=d.getBoundingClientRect(),U=r.valueNode.getBoundingClientRect(),z=g.getBoundingClientRect();if(r.dir!=="rtl"){const ye=z.left-k.left,ae=U.left-ye,je=_.left-ae,ne=_.width+je,at=Math.max(ne,k.width),ue=window.innerWidth-Yn,Be=Ov(ae,[Yn,Math.max(Yn,ue-at)]);o.style.minWidth=ne+"px",o.style.left=Be+"px"}else{const ye=k.right-z.right,ae=window.innerWidth-U.right-ye,je=window.innerWidth-_.right-ae,ne=_.width+je,at=Math.max(ne,k.width),ue=window.innerWidth-Yn,Be=Ov(ae,[Yn,Math.max(Yn,ue-at)]);o.style.minWidth=ne+"px",o.style.right=Be+"px"}const K=m(),V=window.innerHeight-Yn*2,L=v.scrollHeight,M=window.getComputedStyle(d),A=parseInt(M.borderTopWidth,10),S=parseInt(M.paddingTop,10),E=parseInt(M.borderBottomWidth,10),C=parseInt(M.paddingBottom,10),$=A+S+L+C+E,X=Math.min(y.offsetHeight*5,$),T=window.getComputedStyle(v),P=parseInt(T.paddingTop,10),J=parseInt(T.paddingBottom,10),ee=_.top+_.height/2-Yn,ve=V-ee,Q=y.offsetHeight/2,O=y.offsetTop+Q,H=A+S+O,te=$-H;if(H<=ee){const ye=K.length>0&&y===K[K.length-1].ref.current;o.style.bottom="0px";const ae=d.clientHeight-v.offsetTop-v.offsetHeight,je=Math.max(ve,Q+(ye?J:0)+ae+E),ne=H+je;o.style.height=ne+"px"}else{const ye=K.length>0&&y===K[0].ref.current;o.style.top="0px";const je=Math.max(ee,A+v.offsetTop+(ye?P:0)+Q)+te;o.style.height=je+"px",v.scrollTop=H-ee+v.offsetTop}o.style.margin=`${Yn}px 0`,o.style.minHeight=X+"px",o.style.maxHeight=V+"px",a==null||a(),requestAnimationFrame(()=>x.current=!0)}},[m,r.trigger,r.valueNode,o,d,v,y,g,r.dir,a]);Vt(()=>b(),[b]);const[w,N]=u.useState();Vt(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const R=u.useCallback(_=>{_&&j.current===!0&&(b(),p==null||p(),j.current=!1)},[b,p]);return s.jsx(t$,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:x,onScrollButtonChange:R,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:s.jsx(Te.div,{...l,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});xN.displayName=J4;var e$="SelectPopperPosition",Jh=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:l=Yn,...r}=e,i=kd(n);return s.jsx(Gp,{...i,...r,ref:t,align:a,collisionPadding:l,style:{boxSizing:"border-box",...r.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)"}})});Jh.displayName=e$;var[t$,Jp]=Ir(ml,{}),em="SelectViewport",gN=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...l}=e,r=Pa(em,n),i=Jp(em,n),o=Ke(t,r.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(_d.Slot,{scope:n,children:s.jsx(Te.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:de(l.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&h){const x=Math.abs(c.current-f.scrollTop);if(x>0){const j=window.innerHeight-Yn*2,v=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),g=Math.max(v,y);if(g<j){const p=g+x,b=Math.min(j,p),w=p-b;h.style.height=b+"px",h.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,h.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});gN.displayName=em;var vN="SelectGroup",[n$,s$]=Ir(vN),a$=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,l=Wn();return s.jsx(n$,{scope:n,id:l,children:s.jsx(Te.div,{role:"group","aria-labelledby":l,...a,ref:t})})});a$.displayName=vN;var yN="SelectLabel",bN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,l=s$(yN,n);return s.jsx(Te.div,{id:l.id,...a,ref:t})});bN.displayName=yN;var ku="SelectItem",[l$,jN]=Ir(ku),wN=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:l=!1,textValue:r,...i}=e,o=Ia(ku,n),c=Pa(ku,n),d=o.value===a,[f,h]=u.useState(r??""),[m,x]=u.useState(!1),j=Ke(t,p=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,p,a,l)}),v=Wn(),y=u.useRef("touch"),g=()=>{l||(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(l$,{scope:n,value:a,disabled:l,textId:v,isSelected:d,onItemTextChange:u.useCallback(p=>{h(b=>b||((p==null?void 0:p.textContent)??"").trim())},[]),children:s.jsx(_d.ItemSlot,{scope:n,value:a,disabled:l,textValue:f,children:s.jsx(Te.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...i,ref:j,onFocus:de(i.onFocus,()=>x(!0)),onBlur:de(i.onBlur,()=>x(!1)),onClick:de(i.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:de(i.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:de(i.onPointerDown,p=>{y.current=p.pointerType}),onPointerMove:de(i.onPointerMove,p=>{var b;y.current=p.pointerType,l?(b=c.onItemLeave)==null||b.call(c):y.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:de(i.onPointerLeave,p=>{var b;p.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:de(i.onKeyDown,p=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&p.key===" "||(G4.includes(p.key)&&g(),p.key===" "&&p.preventDefault())})})})})});wN.displayName=ku;var di="SelectItemText",_N=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:l,...r}=e,i=Ia(di,n),o=Pa(di,n),c=jN(di,n),d=K4(di,n),[f,h]=u.useState(null),m=Ke(t,g=>h(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 Vt(()=>(v(j),()=>y(j)),[v,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(Te.span,{id:c.textId,...r,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?kr.createPortal(r.children,i.valueNode):null]})});_N.displayName=di;var NN="SelectItemIndicator",kN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return jN(NN,n).isSelected?s.jsx(Te.span,{"aria-hidden":!0,...a,ref:t}):null});kN.displayName=NN;var tm="SelectScrollUpButton",SN=u.forwardRef((e,t)=>{const n=Pa(tm,e.__scopeSelect),a=Jp(tm,e.__scopeSelect),[l,r]=u.useState(!1),i=Ke(t,a.onScrollButtonChange);return Vt(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollTop>0;r(d)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),l?s.jsx(RN,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});SN.displayName=tm;var nm="SelectScrollDownButton",CN=u.forwardRef((e,t)=>{const n=Pa(nm,e.__scopeSelect),a=Jp(nm,e.__scopeSelect),[l,r]=u.useState(!1),i=Ke(t,a.onScrollButtonChange);return Vt(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;r(f)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),l?s.jsx(RN,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});CN.displayName=nm;var RN=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...l}=e,r=Pa("SelectScrollButton",n),i=u.useRef(null),o=Nd(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),Vt(()=>{var f;const d=o().find(h=>h.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,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:de(l.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(a,50))}),onPointerMove:de(l.onPointerMove,()=>{var d;(d=r.onItemLeave)==null||d.call(r),i.current===null&&(i.current=window.setInterval(a,50))}),onPointerLeave:de(l.onPointerLeave,()=>{c()})})}),r$="SelectSeparator",TN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return s.jsx(Te.div,{"aria-hidden":!0,...a,ref:t})});TN.displayName=r$;var sm="SelectArrow",i$=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,l=kd(n),r=Ia(sm,n),i=Pa(sm,n);return r.open&&i.position==="popper"?s.jsx(Vp,{...l,...a,ref:t}):null});i$.displayName=sm;var o$="SelectBubbleInput",EN=u.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const l=u.useRef(null),r=Ke(a,l),i=Cw(t);return u.useEffect(()=>{const o=l.current;if(!o)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const h=new Event("change",{bubbles:!0});f.call(o,t),o.dispatchEvent(h)}},[i,t]),s.jsx(Te.select,{...n,style:{...aN,...n.style},ref:r,defaultValue:t})});EN.displayName=o$;function AN(e){return e===""||e===void 0}function MN(e){const t=ws(e),n=u.useRef(""),a=u.useRef(0),l=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]),r=u.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,l,r]}function ON(e,t,n){const l=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let i=c$(e,Math.max(r,0));l.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return c!==n?c:void 0}function c$(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var u$=rN,$N=oN,d$=uN,f$=dN,h$=fN,DN=hN,m$=gN,zN=bN,LN=wN,p$=_N,x$=kN,UN=SN,BN=CN,HN=TN;const g$={default:"h-9 px-3 py-2 text-sm",control:"h-7 px-2 py-1 text-xs"},xt=u$,gt=d$,dt=u.forwardRef(({className:e,children:t,triggerSize:n="default",...a},l)=>s.jsxs($N,{ref:l,className:le("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",g$[n],e),...a,children:[t,s.jsx(f$,{asChild:!0,children:s.jsx(y0,{className:"text-muted-foreground size-4","aria-hidden":"true"})})]}));dt.displayName=$N.displayName;const IN=u.forwardRef(({className:e,...t},n)=>s.jsx(UN,{ref:n,className:le("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(cR,{className:"size-4","aria-hidden":"true"})}));IN.displayName=UN.displayName;const PN=u.forwardRef(({className:e,...t},n)=>s.jsx(BN,{ref:n,className:le("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(v0,{className:"size-4","aria-hidden":"true"})}));PN.displayName=BN.displayName;const ft=u.forwardRef(({className:e,children:t,position:n="popper",...a},l)=>s.jsx(h$,{container:Co(),children:s.jsxs(DN,{ref:l,className:le("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(IN,{}),s.jsx(m$,{className:le("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(PN,{})]})}));ft.displayName=DN.displayName;const v$=u.forwardRef(({className:e,...t},n)=>s.jsx(zN,{ref:n,className:le("px-2 py-1.5 text-sm font-semibold",e),...t}));v$.displayName=zN.displayName;const Ee=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(LN,{ref:a,className:le("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(x$,{children:s.jsx(Or,{className:"size-4","aria-hidden":"true"})})}),s.jsx(p$,{children:t})]}));Ee.displayName=LN.displayName;const y$=u.forwardRef(({className:e,...t},n)=>s.jsx(HN,{ref:n,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));y$.displayName=HN.displayName;function wt({className:e,...t}){return s.jsx("div",{className:le("animate-pulse rounded-md bg-primary/10",e),...t})}const Ye=u.forwardRef(({className:e,containerClassName:t,containerRef:n,containerTabIndex:a,containerAriaLabel:l,...r},i)=>s.jsx("div",{ref:n,tabIndex:a,"aria-label":l,className:le("relative w-full overflow-auto",t),children:s.jsx("table",{ref:i,className:le("w-full caption-bottom text-sm",e),...r})}));Ye.displayName="Table";const Ze=u.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:le("[&_tr]:border-b",e),...t}));Ze.displayName="TableHeader";const Fe=u.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:le("[&_tr:last-child]:border-0",e),...t}));Fe.displayName="TableBody";const b$=u.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:le("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));b$.displayName="TableFooter";const ce=u.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:le("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));ce.displayName="TableRow";const F=u.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:le("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}));F.displayName="TableHead";const q=u.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:le("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));q.displayName="TableCell";const j$=u.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:le("text-muted-foreground mt-4 text-sm",e),...t}));j$.displayName="TableCaption";var Sd="Tabs",[w$]=Ss(Sd,[gd]),qN=gd(),[_$,ex]=w$(Sd),GN=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:l,defaultValue:r,orientation:i="horizontal",dir:o,activationMode:c="automatic",...d}=e,f=hd(o),[h,m]=$a({prop:a,onChange:l,defaultProp:r??"",caller:Sd});return s.jsx(_$,{scope:n,baseId:Wn(),value:h,onValueChange:m,orientation:i,dir:f,activationMode:c,children:s.jsx(Te.div,{dir:f,"data-orientation":i,...d,ref:t})})});GN.displayName=Sd;var VN="TabsList",YN=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...l}=e,r=ex(VN,n),i=qN(n);return s.jsx(i_,{asChild:!0,...i,orientation:r.orientation,dir:r.dir,loop:a,children:s.jsx(Te.div,{role:"tablist","aria-orientation":r.orientation,...l,ref:t})})});YN.displayName=VN;var FN="TabsTrigger",KN=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:l=!1,...r}=e,i=ex(FN,n),o=qN(n),c=ZN(i.baseId,a),d=WN(i.baseId,a),f=a===i.value;return s.jsx(o_,{asChild:!0,...o,focusable:!l,active:f,children:s.jsx(Te.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...r,ref:t,onMouseDown:de(e.onMouseDown,h=>{!l&&h.button===0&&h.ctrlKey===!1?i.onValueChange(a):h.preventDefault()}),onKeyDown:de(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(a)}),onFocus:de(e.onFocus,()=>{const h=i.activationMode!=="manual";!f&&!l&&h&&i.onValueChange(a)})})})});KN.displayName=FN;var XN="TabsContent",QN=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:l,children:r,...i}=e,o=ex(XN,n),c=ZN(o.baseId,a),d=WN(o.baseId,a),f=a===o.value,h=u.useRef(f);return u.useEffect(()=>{const m=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(m)},[]),s.jsx(Bn,{present:l||f,children:({present:m})=>s.jsx(Te.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&r})})});QN.displayName=XN;function ZN(e,t){return`${e}-trigger-${t}`}function WN(e,t){return`${e}-content-${t}`}var N$=GN,JN=YN,ek=KN,tk=QN;const k$=N$,nk=u.forwardRef(({className:e,...t},n)=>s.jsx(JN,{ref:n,className:le("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));nk.displayName=JN.displayName;const am=u.forwardRef(({className:e,...t},n)=>s.jsx(ek,{ref:n,className:le("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}));am.displayName=ek.displayName;const S$=u.forwardRef(({className:e,...t},n)=>s.jsx(tk,{ref:n,className:le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));S$.displayName=tk.displayName;const is=u.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:le("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}));is.displayName="Textarea";var[Cd]=Ss("Tooltip",[Hr]),Rd=Hr(),sk="TooltipProvider",C$=700,lm="tooltip.open",[R$,tx]=Cd(sk),ak=e=>{const{__scopeTooltip:t,delayDuration:n=C$,skipDelayDuration:a=300,disableHoverableContent:l=!1,children:r}=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(R$,{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:l,children:r})};ak.displayName=sk;var Wi="Tooltip",[T$,$o]=Cd(Wi),lk=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:l,onOpenChange:r,disableHoverableContent:i,delayDuration:o}=e,c=tx(Wi,e.__scopeTooltip),d=Rd(t),[f,h]=u.useState(null),m=Wn(),x=u.useRef(0),j=i??c.disableHoverableContent,v=o??c.delayDuration,y=u.useRef(!1),[g,p]=$a({prop:a,defaultProp:l??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(lm))):c.onClose(),r==null||r(_)},caller:Wi}),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]),R=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(Pp,{...d,children:s.jsx(T$,{scope:t,contentId:m,open:g,stateAttribute:b,trigger:f,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?R():w()},[c.isOpenDelayedRef,R,w]),onTriggerLeave:u.useCallback(()=>{j?N():(window.clearTimeout(x.current),x.current=0)},[N,j]),onOpen:w,onClose:N,disableHoverableContent:j,children:n})})};lk.displayName=Wi;var rm="TooltipTrigger",rk=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=$o(rm,n),r=tx(rm,n),i=Rd(n),o=u.useRef(null),c=Ke(t,o,l.onTriggerChange),d=u.useRef(!1),f=u.useRef(!1),h=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(qp,{asChild:!0,...i,children:s.jsx(Te.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...a,ref:c,onPointerMove:de(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!r.isPointerInTransitRef.current&&(l.onTriggerEnter(),f.current=!0)}),onPointerLeave:de(e.onPointerLeave,()=>{l.onTriggerLeave(),f.current=!1}),onPointerDown:de(e.onPointerDown,()=>{l.open&&l.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:de(e.onFocus,()=>{d.current||l.onOpen()}),onBlur:de(e.onBlur,l.onClose),onClick:de(e.onClick,l.onClose)})})});rk.displayName=rm;var nx="TooltipPortal",[E$,A$]=Cd(nx,{forceMount:void 0}),ik=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:l}=e,r=$o(nx,t);return s.jsx(E$,{scope:t,forceMount:n,children:s.jsx(Bn,{present:n||r.open,children:s.jsx(So,{asChild:!0,container:l,children:a})})})};ik.displayName=nx;var _r="TooltipContent",ok=u.forwardRef((e,t)=>{const n=A$(_r,e.__scopeTooltip),{forceMount:a=n.forceMount,side:l="top",...r}=e,i=$o(_r,e.__scopeTooltip);return s.jsx(Bn,{present:a||i.open,children:i.disableHoverableContent?s.jsx(ck,{side:l,...r,ref:t}):s.jsx(M$,{side:l,...r,ref:t})})}),M$=u.forwardRef((e,t)=>{const n=$o(_r,e.__scopeTooltip),a=tx(_r,e.__scopeTooltip),l=u.useRef(null),r=Ke(t,l),[i,o]=u.useState(null),{trigger:c,onClose:d}=n,f=l.current,{onPointerInTransitChange:h}=a,m=u.useCallback(()=>{o(null),h(!1)},[h]),x=u.useCallback((j,v)=>{const y=j.currentTarget,g={x:j.clientX,y:j.clientY},p=L$(g,y.getBoundingClientRect()),b=U$(g,p),w=B$(v.getBoundingClientRect()),N=I$([...b,...w]);o(N),h(!0)},[h]);return u.useEffect(()=>()=>m(),[m]),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,m]),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=!H$(g,i);p?m():b&&(m(),d())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[c,f,i,d,m]),s.jsx(ck,{...e,ref:r})}),[O$,$$]=Cd(Wi,{isInside:!1}),D$=CE("TooltipContent"),ck=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":l,onEscapeKeyDown:r,onPointerDownOutside:i,...o}=e,c=$o(_r,n),d=Rd(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(lm,f),()=>document.removeEventListener(lm,f)),[f]),u.useEffect(()=>{if(c.trigger){const h=m=>{const x=m.target;x!=null&&x.contains(c.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,f]),s.jsx(ko,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:s.jsxs(Gp,{"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(D$,{children:a}),s.jsx(O$,{scope:n,isInside:!0,children:s.jsx(P4,{id:c.contentId,role:"tooltip",children:l||a})})]})})});ok.displayName=_r;var uk="TooltipArrow",z$=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=Rd(n);return $$(uk,n).isInside?null:s.jsx(Vp,{...l,...a,ref:t})});z$.displayName=uk;function L$(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,a,l,r)){case r:return"left";case l:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function U$(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 B$(e){const{top:t,right:n,bottom:a,left:l}=e;return[{x:l,y:t},{x:n,y:t},{x:n,y:a},{x:l,y:a}]}function H$(e,t){const{x:n,y:a}=e;let l=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){const o=t[r],c=t[i],d=o.x,f=o.y,h=c.x,m=c.y;f>a!=m>a&&n<(h-d)*(a-f)/(m-f)+d&&(l=!l)}return l}function I$(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),P$(t)}function P$(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const l=e[a];for(;t.length>=2;){const r=t[t.length-1],i=t[t.length-2];if((r.x-i.x)*(l.y-i.y)>=(r.y-i.y)*(l.x-i.x))t.pop();else break}t.push(l)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const l=e[a];for(;n.length>=2;){const r=n[n.length-1],i=n[n.length-2];if((r.x-i.x)*(l.y-i.y)>=(r.y-i.y)*(l.x-i.x))n.pop();else break}n.push(l)}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 q$=ak,G$=lk,V$=rk,Y$=ik,dk=ok;const fk=q$,hk=G$,mk=V$,sx=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>{const l=Co(),r=s.jsx(dk,{ref:a,sideOffset:t,className:le("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 l?s.jsx(Y$,{container:l,children:r}):r});sx.displayName=dk.displayName;function Zs({page:e,header:t}){return s.jsxs(s.Fragment,{children:[t??s.jsx(Zt,{title:e}),s.jsx(F$,{page:e})]})}function F$({page:e}){return s.jsxs(xe,{variant:"info",role:"status",className:"mt-6","data-testid":"not-installed",children:[s.jsx(Ba,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:k0(e)})]})}const $v=["none","read","comment","write","manage","admin"];function Su(e,t){return $v.indexOf(e??"none")>=$v.indexOf(t)}function ax(e){return e==="api_key"?"API key":e==="sdlc_login"?"sdlc login":null}function Of(e,t){const n=ax(e);return e==="sdlc_login"&&t?`${n} on ${pk(t)}`:n}const K$=String.fromCodePoint(8296),X$=String.fromCodePoint(8297);function pk(e){return`${K$}${e}${X$}`}const Ji={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"}},Q$={backlog:"neutral",planned:"neutral",in_progress:"info",completed:"success",canceled:"neutral"};function xk(e){return e.name==="Blocked"?"warning":Q$[e.category]}const Dv=1800;function ss(e){return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Jn(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function lx(e){return`${Dn(e)}, ${Jn(e)}`}function ni(e){return e<90?`${Math.round(e)} s`:e<5400?`${Math.round(e/60)} min`:`${(e/3600).toFixed(1).replace(/\.0$/,"")} h`}function Dn(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function gk(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Z$(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 W$(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 ra="not_set";function J$({open:e,commands:t,list_id:n,list_revision:a,default_status_id:l,statuses:r,priorities:i,members:o,on_close:c,on_created:d}){var V;const f=Mr(),[h,m]=u.useState(""),[x,j]=u.useState(""),[v,y]=u.useState(l??((V=r[0])==null?void 0:V.id)??""),[g,p]=u.useState(ra),[b,w]=u.useState(ra),[N,R]=u.useState(!1),[_,k]=u.useState(null),[U,z]=u.useState(!1);u.useEffect(()=>{var L;e&&(m(""),j(""),y(l??((L=r[0])==null?void 0:L.id)??""),p(ra),w(ra),R(!1),k(null))},[e,l,r]);const K=async L=>{if(L.preventDefault(),!h.trim()){R(!0);return}z(!0),k(null);try{const M=await t.run("create_task",{list_id:n,expected_list_revision:a,title:h.trim(),description:x.trim()||null,status_id:v||null,priority_id:g===ra?null:g,primary_user_id:b===ra?null:b});if(!M.ok){k(M.refusal.message);return}f.success("Task created."),await d()}finally{z(!1)}};return s.jsx(Hn,{open:e,onOpenChange:L=>L?null:c(),children:s.jsx(In,{children:s.jsxs("form",{onSubmit:L=>void K(L),noValidate:!0,children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:"New task"}),s.jsx(Vn,{children:"Add a task to this List."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[_&&s.jsxs(xe,{variant:"destructive",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(ge,{children:_})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"new-task-title",children:"Title"}),s.jsx(Tt,{id:"new-task-title",placeholder:"What needs doing",value:h,required:!0,"aria-invalid":N,"aria-describedby":N?"new-task-title-error":void 0,onChange:L=>{m(L.target.value),R(!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(Ue,{htmlFor:"new-task-description",children:"Description (optional)"}),s.jsx(is,{id:"new-task-description",rows:4,value:x,onChange:L=>j(L.target.value)})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"new-task-status",children:"Status"}),s.jsxs(xt,{value:v,onValueChange:y,children:[s.jsx(dt,{id:"new-task-status",children:s.jsx(gt,{})}),s.jsx(ft,{children:r.map(L=>s.jsx(Ee,{value:L.id,children:L.name},L.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"new-task-priority",children:"Priority"}),s.jsxs(xt,{value:g,onValueChange:p,children:[s.jsx(dt,{id:"new-task-priority",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:ra,children:"Not set"}),i.map(L=>s.jsx(Ee,{value:L.id,children:L.name},L.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"new-task-primary",children:"Primary"}),s.jsxs(xt,{value:b,onValueChange:w,children:[s.jsx(dt,{id:"new-task-primary",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:ra,children:"Not set"}),o.map(L=>s.jsx(Ee,{value:L.user_id,children:L.label},L.user_id))]})]})]})]})]}),s.jsxs(qn,{className:"mt-6",children:[s.jsx(G,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),s.jsx(G,{type:"submit",disabled:U,children:U?"Creating…":"Create task"})]})]})})})}const eD="Your organization's work, in queue order. Claim a task to show you are working on it.",fi="any",vk="none",tD=1,nD=250;function rx(){const e=cn().tasks;if(!e)throw new Error("The Tasks page rendered without the tasks seam.");return e}function sD({org:e}){var j,v;const t=rx(),{href:n,Link:a}=We(),[l,r]=u.useState({state:"loading"}),[i,o]=u.useState([]),[c,d]=u.useState(null),f=u.useRef(0),h=u.useCallback(async y=>{const g=f.current+=1;y&&r({state:"loading"});const p=await t.availability({fresh:y});g===f.current&&r(p)},[t.availability]);u.useEffect(()=>{h(!1)},[h]);const m=u.useCallback(()=>void h(!0),[h]);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]),l.state==="off"&&((j=l.refusal)==null?void 0:j.reason)!=="engine_missing")return s.jsx(Ha,{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)??eD;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:l.state==="active"?s.jsx(lD,{active:l,org:e,members:i,description:x,read_only_reason:c==null?void 0:c.read_only_reason,reload_configuration:m}):l.state==="off"&&((v=l.refusal)==null?void 0:v.reason)==="engine_missing"?s.jsx(Zs,{page:"Tasks"}):s.jsxs(s.Fragment,{children:[s.jsx(Zt,{title:"Tasks",description:x}),l.state==="loading"&&s.jsx(yk,{}),(l.state==="error"||l.state==="off")&&s.jsx(bk,{refusal:l.refusal,on_retry:m}),l.state==="available"&&s.jsx(aD,{on_done:m})]})})}function yk(){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(wt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function bk({refusal:e,on_retry:t}){const n=ls();return(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(xe,{variant:"warning",className:"mt-6",children:[s.jsx(rn,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:$r}),s.jsx(ge,{children:n})]}):s.jsxs(xe,{variant:"destructive",className:"mt-6",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Tasks could not be loaded"}),s.jsxs(ge,{children:[s.jsx("p",{children:e!=null&&e.reason?e.message:"Check your connection and try again."}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function aD({on_done:e}){const{commands:t}=rx(),n=Mr(),[a,l]=u.useState(!1),r=t==null?void 0:t.activate,i=async()=>{if(!r)return;l(!0);const o=await r();if(l(!1),!o.ok){n.error(o.refusal.message);return}n.success("Tasks are on."),e()};return s.jsxs(xe,{variant:"info",className:"mt-6",children:[s.jsx(Ba,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Tasks are not on for this organization"}),s.jsxs(ge,{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."}),r?s.jsx(G,{type:"button",size:"sm",className:"mt-2",disabled:a,onClick:()=>void i(),children:"Turn on Tasks"}):null]})]})}const $f=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function lD({active:e,org:t,members:n,description:a,read_only_reason:l,reload_configuration:r}){var Tx;const{commands:i,listTasks:o,waitingOnYou:c,hierarchyRevision:d}=rx(),{href:f,Link:h}=We(),{self_id:m}=ed(),x=Mr(),{list:j,workspace:v}=e,y=j.offers,g=y!==void 0,p=u.useMemo(()=>{var B;return((B=v.workflows.find(ie=>ie.id===j.workflow_id))==null?void 0:B.statuses)??[]},[v,j]),b=v.priorities,w=!!i&&Su(j.permission,"write"),N=w&&Su(j.permission,"manage"),R=u.useMemo(()=>new Map(n.map(B=>[B.user_id,B])),[n]),_=B=>{var ie;return B?B===m?"You":((ie=R.get(B))==null?void 0:ie.label)??"A member":""},[k,U]=u.useState("active"),[z,K]=u.useState(!1),[V,L]=u.useState(""),[M,A]=u.useState("");u.useEffect(()=>{const B=setTimeout(()=>A(V),nD);return()=>clearTimeout(B)},[V]);const[S,E]=u.useState(null),[C,$]=u.useState(fi),[X,T]=u.useState(!1),[P,J]=u.useState(!1),[ee,ve]=u.useState({}),[Q,O]=u.useState([]),[H,te]=u.useState(null),[re,ye]=u.useState([]),[ae,je]=u.useState(null),[ne,at]=u.useState(0),[ue,Be]=u.useState(!1),[Y,Re]=u.useState(null),[Le,vt]=u.useState(null),_e=ls(),[Dt,I]=u.useState(!1),[oe,pe]=u.useState(null),[ke,Me]=u.useState({}),[Yt,un]=u.useState(""),{confirm:se,confirm_dialog:He}=Ro(),qe=u.useRef(null),os=u.useRef(null),kn=u.useRef(null),cs=u.useRef(null),[ht,Ws]=u.useState(void 0),Js=!!(M.trim()||S||C!==fi||X||P),ea=u.useRef(0),ta=u.useRef(0),D=u.useCallback(async(B,ie=!1)=>{if(ie&&ta.current>0)return;const Pe=B?ea.current:ea.current+=1,lt={state:k,assigned_to_me:z||void 0,cursor:B,search:M.trim()||void 0,group:S??void 0,owner:C===fi?void 0:C===vk?"":C,urgent:X||void 0,over_estimate:P||void 0,...rD(ee,Q)},Jt=en=>o(j.id,{...lt,cursor:en});B||(ta.current+=1);let yt=await Jt(B).finally(()=>{B||(ta.current-=1)}),Et=!!B;if(!yt.ok&&yt.refusal.code==="cursor_stale"&&(yt=await Jt(),Et=!1),Pe!==ea.current)return;if(!yt.ok){je(yt.refusal),at(en=>en+1);return}const Nt=yt.data;je(null),at(0),!(ie&&$f(Nt,kn.current))&&(kn.current=Nt,te(Nt),Nt.facets&&Ws(Nt.facets),ye(en=>Et?[...en,...Nt.tasks]:Nt.tasks))},[o,j.id,k,z,M,S,C,X,P,ee,Q]),we=u.useCallback(async()=>{const B=await c();if(vt(Pe=>B.ok?null:$f(Pe,B.refusal)?Pe:B.refusal),!B.ok&&g)return;const ie=B.ok?B.data:null;$f(ie,cs.current)||(cs.current=ie,Re(ie))},[c,g]);u.useEffect(()=>{kn.current=null,te(null)},[k,z]),u.useEffect(()=>{D()},[D]),u.useEffect(()=>{we()},[we]);const W=u.useCallback(async()=>{await Promise.all([D(),we()])},[D,we]),Se=u.useRef(W);Se.current=W;const Wt=y==null?void 0:y.refresh_ms;u.useEffect(()=>{if(!Wt)return;const B=setInterval(()=>{D(void 0,!0),we()},Wt);return()=>clearInterval(B)},[Wt,D,we]);const na=u.useCallback(async(B,ie,Pe)=>{if(!i)return;const lt=await i.run(B,ie);lt.ok?Pe&&x.success(Pe):(x.error(lt.refusal.message),lt.refusal.code==="revision_conflict"&&r()),await W()},[i,x,W,r]),Uo=p.find(B=>B.category==="completed"),kx=async(B,ie,Pe)=>{const lt=ie+Pe,Jt=re[lt];if(!Jt||!H||!i)return;const yt=async(Et,Nt)=>{const en=await i.run(Et,Nt);if(!en.ok)throw en.refusal;return en.data};try{let Et=H.list.order_revision,Nt=B.revision;if(Jt.queue_rank===null){const en=re.findIndex(Rs=>Rs.queue_rank===null);for(const Rs of re.slice(en,lt+1)){const Ex=await yt("reorder",{task_id:Rs.id,expected_revision:Rs.revision,expected_order_revision:Et,placement:"end"});Et=Ex.list.order_revision,Rs.id===B.id&&(Nt=Ex.task.revision)}}await yt("reorder",{task_id:B.id,expected_revision:Nt,expected_order_revision:Et,placement:Pe<0?"before":"after",anchor_task_id:Jt.id})}catch(Et){x.error(Et.message)}await W()},E1=B=>{Uo&&na("update_task",{task_id:B.id,expected_revision:B.revision,changes:{status_id:Uo.id}},`${B.title} completed.`)},A1=async B=>{if(!H||!await se({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[Pe,lt]=await Promise.all([o(j.id,{limit:1}),d(v.id)]);if(!Pe.ok||!lt.ok){x.error(Pe.ok?lt.ok?"":lt.refusal.message:Pe.refusal.message);return}await na("archive_task",{task_id:B.id,expected_revision:B.revision,expected_order_revision:Pe.data.list.order_revision,expected_hierarchy_revision:lt.data},`${B.title} archived.`)},M1=async B=>{await na("release_hold",{hold_id:B},"Hold released.")},Sx=async(B,ie,Pe,lt)=>{if(!(i!=null&&i.complete)||!await se({title:`Mark ${ie} done?`,description:Pe.reason?`“${Pe.reason}”
|
|
384
|
-
|
|
385
|
-
It leaves the open tasks.`:"It leaves the open tasks.",action_label:"Mark done"}))return;pe(B);const yt=await i.complete(Pe);if(pe(null),!yt.ok){Me(Et=>({...Et,[B]:yt.refusal.message}));return}Me(({[B]:Et,...Nt})=>Nt),un(`${ie} marked done.`),await Se.current(),Cx({next:lt})},[Yr,Cx]=u.useState(null);u.useEffect(()=>{var lt;if(!Yr)return;Cx(null);const B=os.current,ie=typeof Yr.next=="function"?Yr.next():Yr.next;(lt=(ie?(B==null?void 0:B.querySelector(`[data-done-key="${CSS.escape(ie)}"]`))??(B==null?void 0:B.querySelector(`[data-title-key="${CSS.escape(ie)}"] a`)):null)??qe.current)==null||lt.focus()},[Yr]);const Rx=()=>{var B;L(""),A(""),E(null),$(fi),T(!1),J(!1),(B=qe.current)==null||B.focus()},O1=new Map(p.map(B=>[B.id,B])),$1=new Map(b.map(B=>[B.id,B])),Od=new Map(re.map(B=>[B.id,B.title])),$d=w&&k==="active",D1=re.some(B=>B.local_done),Dd=$d||D1,zd=!g||b.length>0,z1=!z&&!Js,Ld=5+(zd?1:0)+(Dd?1:0),L1=ae!==null&&(ae.reason==="store_locked"||ae.reason==="engine_failed")&&ne<=tD,Bo=(Y==null?void 0:Y.holds)??[],Ud=H==null?void 0:H.groups,U1=iD(re,Ud,ee,(H==null?void 0:H.matched)===void 0?Q:[]),Ho=Ud?Ud.length===0:re.length===0,B1=(B,ie)=>ve(Pe=>({...Pe,[B]:!ie})),H1=B=>O(ie=>ie.includes(B)?ie.filter(Pe=>Pe!==B):[...ie,B]),I1=Bo.map(B=>B.id);return s.jsxs("div",{ref:os,className:"contents",children:[s.jsx(Zt,{title:"Tasks",description:a,actions:w?s.jsxs(G,{type:"button",onClick:()=>I(!0),children:[s.jsx(br,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]}):null}),g&&(H!=null&&H.open)?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[H.open," open"]}):null,Wt?s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",role:"status",children:ae?`Not reading · trying again every ${Math.round(Wt/1e3)}s`:H?`Live · refreshes every ${Math.round(Wt/1e3)}s`:"Connecting…"}):null,g?s.jsx("p",{className:"sr-only",role:"status",children:Yt}):null,(g||Bo.length>0)&&s.jsxs(_t,{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"}),Bo.length>0?s.jsx("ul",{className:"mt-2 divide-y","aria-labelledby":"waiting-title",children:Bo.map((B,ie)=>{var yt,Et;const Pe=Ji[B.hold_type],lt=B.target.kind==="task"?`Because you claim ${Od.get(B.target.task_id)??"the task it waits on"} · `:"",Jt=B.local_done;return s.jsxs("li",{id:`waiting-${B.id}`,"data-title-key":B.id,className:"flex flex-wrap items-center gap-3 py-2",children:[B.task?s.jsx(h,{className:"text-primary min-w-40 flex-1 hover:underline",href:f(`/org/${t}/tasks/${B.task.id}`),children:B.task.title}):s.jsx("span",{className:"min-w-40 flex-1",children:B.reason}),s.jsx(me,{variant:Pe.tone,children:B.local_label??Pe.label}),s.jsxs("div",{className:"min-w-48 flex-2",children:[B.task?s.jsx("div",{className:"text-sm",children:B.reason}):null,s.jsxs("div",{className:"text-muted-foreground text-xs",children:[lt,"From ",_(B.opened_by)," · ",Dn(B.opened_at)]}),(yt=B.local_threads)!=null&&yt.length?s.jsxs("div",{className:"text-muted-foreground text-xs",children:["Answer it in"," ",s.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/threads`),children:"Threads"}),": ",B.local_threads.join(" · ")]}):null,ke[B.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:ke[B.id]}):null]}),Jt&&(i!=null&&i.complete)?s.jsx(G,{type:"button",variant:"outline",size:"sm","data-done-key":B.id,"aria-label":`Mark ${((Et=B.task)==null?void 0:Et.title)??B.reason} done`,loading:oe===B.id,onClick:()=>{var Nt;return void Sx(B.id,((Nt=B.task)==null?void 0:Nt.title)??B.reason,Jt,I1[ie+1]??null)},children:"Done"}):null,g?null:s.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:()=>void M1(B.id),children:"Release"})]},B.id)})}):Y?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Nothing in this checkout waits on you."}):null,g&&Le?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status",children:Le.reason==="view_outdated"?`Waiting on you is not read here. ${_e}`:"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&&!l&&s.jsxs(xe,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"You can view these tasks"}),s.jsx(ge,{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(k$,{value:k,onValueChange:B=>U(B),children:s.jsxs(nk,{"aria-label":"Which tasks",children:[s.jsx(am,{value:"active",children:"Active"}),s.jsx(am,{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(Lr,{id:"tasks-mine",checked:z,onCheckedChange:B=>K(B===!0)}),s.jsx(Ue,{htmlFor:"tasks-mine",children:"Assigned to me"})]}):null,y!=null&&y.search?s.jsx(Tt,{ref:qe,type:"search",className:"w-64","aria-label":"Search tasks",placeholder:"Search title, ID or detail",value:V,onChange:B=>L(B.target.value)}):null,ht!=null&&ht.owners?s.jsx(fD,{owners:ht.owners,no_owner:ht.no_owner,value:C,on_change:$}):null]}),(Tx=ht==null?void 0:ht.groups)!=null&&Tx.length?s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Status",children:[ht.groups.map(B=>s.jsxs(G,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":S===B.id,onClick:()=>E(ie=>ie===B.id?null:B.id),children:[B.label," ",B.count]},B.id)),ht.marks?s.jsxs(s.Fragment,{children:[s.jsxs(G,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":X,onClick:()=>T(B=>!B),children:["Urgent ",ht.marks.urgent]}),s.jsxs(G,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":P,onClick:()=>J(B=>!B),children:["Over estimate ",ht.marks.over_estimate]})]}):null]}):null,Js&&(H==null?void 0:H.matched)!==void 0&&H.total!==void 0?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:[H.matched," of ",H.total," match ·"," ",s.jsx(G,{type:"button",variant:"link",size:"inline-sm",onClick:Rx,children:"Clear"})]}):null,L1?s.jsx("p",{className:"text-muted-foreground mt-4 text-sm",children:"Tasks are busy. Reading them again…"}):ae?s.jsx(bk,{refusal:ae,on_retry:()=>void D()}):null,!H&&!ae&&s.jsx(yk,{}),H&&Ho&&Js?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(sd,{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(G,{type:"button",variant:"outline",onClick:Rx,children:"Clear filters"})]}):H&&Ho&&k==="active"&&!z&&g?s.jsx("p",{className:"text-muted-foreground mt-6 text-sm",children:"No tasks recorded yet."}):H&&Ho&&k==="active"&&!z?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(j0,{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(G,{type:"button",onClick:()=>I(!0),children:[s.jsx(br,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]})]}):H?s.jsxs(s.Fragment,{children:[s.jsx(_t,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Tasks",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Title"}),s.jsx(F,{children:"Status"}),zd?s.jsx(F,{className:"hidden md:table-cell",children:"Priority"}):null,s.jsx(F,{className:"hidden md:table-cell",children:"Primary"}),s.jsx(F,{className:"hidden md:table-cell",children:"Holds"}),s.jsx(F,{children:"Claimed by"}),Dd?s.jsx(F,{className:"text-right",children:"Actions"}):null]})}),s.jsxs(Fe,{children:[U1.map(B=>{var Et,Nt;if(B.kind==="group")return s.jsx(cD,{group:B.group,open:B.open,columns:Ld,on_toggle:()=>B1(B.group.id,B.open)},`group:${B.group.id}`);if(B.kind==="more")return s.jsx(uD,{group:B.group,whole:Q.includes(B.group.id),columns:Ld,on_toggle:()=>H1(B.group.id)},`more:${B.group.id}`);const{row:ie,index:Pe}=B,lt=O1.get(ie.status_id),Jt=Z$(ie),yt=ie.local_done;return s.jsxs(ce,{"data-testid":"tasks-row",children:[s.jsxs(q,{"data-title-key":ie.id,children:[ie.no_page?s.jsx("span",{children:ie.title}):s.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/tasks/${ie.id}`),children:ie.title}),ie.parent_task_id&&Od.get(ie.parent_task_id)?s.jsx("div",{className:"text-muted-foreground text-xs",children:Od.get(ie.parent_task_id)}):null,g?s.jsx(dD,{row:ie}):null,ke[ie.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:ke[ie.id]}):null]}),s.jsx(q,{children:lt?s.jsx(me,{variant:xk(lt),children:lt.name}):null}),zd?s.jsx(q,{className:"hidden md:table-cell",children:ie.priority_id?((Et=$1.get(ie.priority_id))==null?void 0:Et.name)??"":s.jsx("span",{className:"text-muted-foreground",children:"Not set"})}):null,s.jsx(q,{className:"hidden md:table-cell",children:ie.owner_title?ie.owner_title:ie.primary_user_id?_(ie.primary_user_id):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}),s.jsx(q,{className:"hidden md:table-cell",children:Jt?s.jsx(me,{variant:Jt.tone,children:Jt.label}):s.jsx("span",{className:"text-muted-foreground",children:"None"})}),s.jsx(q,{"data-testid":"tasks-claim",children:s.jsx(hD,{row:ie,holder:_((Nt=ie.claim)==null?void 0:Nt.user_id)})}),Dd?s.jsx(q,{className:"text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[yt&&"hold"in yt?s.jsx("a",{className:"text-primary text-sm hover:underline",href:`#waiting-${yt.hold}`,children:"In Waiting on you"}):yt&&(i!=null&&i.complete)?s.jsx(G,{type:"button",variant:"outline",size:"sm","data-done-key":ie.id,"aria-label":`Mark ${ie.title} done`,loading:oe===ie.id,onClick:()=>void Sx(ie.id,ie.title,yt,()=>{var en;return(((en=kn.current)==null?void 0:en.tasks)??[]).map(Rs=>Rs.id).filter(Rs=>Rs!==ie.id)[Pe]??null}),children:"Done"}):null,$d&&z1?s.jsxs(s.Fragment,{children:[s.jsx(G,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${ie.title} up`,disabled:Pe===0,onClick:()=>void kx(ie,Pe,-1),children:s.jsx(JC,{className:"size-4","aria-hidden":"true"})}),s.jsx(G,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${ie.title} down`,disabled:Pe===re.length-1,onClick:()=>void kx(ie,Pe,1),children:s.jsx(QC,{className:"size-4","aria-hidden":"true"})})]}):null,$d?s.jsxs(jd,{children:[s.jsx(wd,{asChild:!0,children:s.jsx(G,{type:"button",variant:"outline",size:"icon","aria-label":`More actions for ${ie.title}`,children:s.jsx(bp,{className:"size-4","aria-hidden":"true"})})}),s.jsxs(Oo,{align:"end",children:[Uo&&ie.status_id!==Uo.id?s.jsx(wr,{onSelect:()=>E1(ie),children:"Complete"}):null,N?s.jsx(wr,{className:"text-destructive focus:text-destructive",onSelect:()=>void A1(ie),children:"Archive"}):null]})]}):null]})}):null]},ie.id)}),Ho&&s.jsx(ce,{children:s.jsx(q,{colSpan:Ld,className:"text-muted-foreground h-24 text-center",children:k==="archived"?"No archived tasks.":"No tasks are assigned to you."})})]})]})}),H.next_cursor?s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2 self-start",disabled:ue,onClick:async()=>{Be(!0),await D(H.next_cursor??void 0),Be(!1)},children:"Load more"}):null]}):null,w&&i&&s.jsx(J$,{open:Dt,commands:i,list_id:j.id,list_revision:(H==null?void 0:H.list.revision)??j.revision,default_status_id:j.default_status_id,statuses:p,priorities:b,members:n,on_close:()=>I(!1),on_created:async()=>{I(!1),await W()}}),He]})}function rD(e,t){const n=Object.keys(e).filter(l=>e[l]),a=Object.keys(e).filter(l=>!e[l]);return{...n.length?{opened_groups:n}:{},...a.length?{closed_groups:a}:{},...t.length?{all_groups:t}:{}}}function iD(e,t,n,a){if(!t)return e.map((r,i)=>({kind:"row",row:r,index:i}));const l=[];for(const r of t){const i=n[r.id]??r.open;if(l.push({kind:"group",group:r,open:i}),!i||!r.open)continue;let o=0;e.forEach((c,d)=>{c.local_state===r.id&&(l.push({kind:"row",row:c,index:d}),o+=1)}),(r.hidden>0||a.includes(r.id)&&o>oD)&&l.push({kind:"more",group:r})}return l}const oD=10;function cD({group:e,open:t,columns:n,on_toggle:a}){const l=t?v0:yp;return s.jsx(ce,{"data-testid":"tasks-group",children:s.jsx(q,{colSpan:n,className:"p-1",children:s.jsxs(G,{type:"button",variant:"ghost",size:"sm",className:"w-full justify-start font-semibold","aria-expanded":t,onClick:a,children:[s.jsx(l,{className:"size-4","aria-hidden":"true"}),e.label," ",e.count]})})})}function uD({group:e,whole:t,columns:n,on_toggle:a}){return s.jsx(ce,{"data-testid":"tasks-group-more",children:s.jsx(q,{colSpan:n,children:s.jsx(G,{type:"button",variant:"link",size:"sm",className:"px-0","aria-expanded":t,onClick:a,children:t?"Show fewer":`Show all ${e.count}`})})})}function dD({row:e}){var n;const t=[e.local_after,e.local_detail].filter(Boolean).join(" · ");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?s.jsx("div",{className:"text-muted-foreground text-xs",children:t}):null,(n=e.local_marks)!=null&&n.length?s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.local_marks.map(a=>s.jsx(me,{variant:a.tone??"neutral",children:a.label},a.label))}):null]})}function fD({owners:e,no_owner:t,value:n,on_change:a}){return s.jsxs(xt,{value:n,onValueChange:a,children:[s.jsx(dt,{className:"w-56","aria-label":"Owner",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:fi,children:"Any owner"}),e.map(l=>s.jsxs(Ee,{value:l.id,children:[l.label," (",l.count,")"]},l.id)),t!==void 0?s.jsxs(Ee,{value:vk,children:["No owner (",t,")"]}):null]})]})}function hD({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 ${ss(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?` · ${ax(n.via)}`:""]}),s.jsxs("div",{className:"text-muted-foreground truncate text-xs",title:n.via==="sdlc_login"&&n.via_device?pk(n.via_device):void 0,children:["Until ",ss(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 mD={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 pD({open:e,members:t,tasks:n,holds_my_web_claim:a,on_close:l,on_submit:r}){const[i,o]=u.useState("waiting_for_user"),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,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(""),h(""),x(!1),v({}),g(null))},[e]);const w=mD[i],N=async R=>{R.preventDefault();const _={target:w!==null&&!c.trim(),reason:!f.trim()};if(v(_),_.target||_.reason)return;b(!0);const k={hold_type:i,reason:f.trim(),release_claim:m};i==="waiting_for_user"&&(k.target_user_id=c),i==="blocked"&&(k.target_task_id=c),i==="waiting_for_external"&&(k.target_label=c.trim());const U=await r(k);b(!1),g(U)};return s.jsx(Hn,{open:e,onOpenChange:R=>R?null:l(),children:s.jsx(In,{children:s.jsxs("form",{onSubmit:R=>void N(R),noValidate:!0,children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:"Add hold"}),s.jsx(Vn,{children:"Say what this task is waiting for."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[y&&s.jsxs(xe,{variant:"destructive",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(ge,{children:y})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"hold-type",children:"Type"}),s.jsxs(xt,{value:i,onValueChange:R=>{o(R),d(""),v({})},children:[s.jsx(dt,{id:"hold-type",children:s.jsx(gt,{})}),s.jsx(ft,{children:Object.keys(Ji).map(R=>s.jsx(Ee,{value:R,children:Ji[R].label},R))})]})]}),w?s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"hold-target",children:w.label}),i==="waiting_for_external"?s.jsx(Tt,{id:"hold-target",value:c,"aria-invalid":j.target,onChange:R=>d(R.target.value)}):s.jsxs(xt,{value:c,onValueChange:d,children:[s.jsx(dt,{id:"hold-target","aria-invalid":j.target,children:s.jsx(gt,{placeholder:i==="blocked"?"Choose a task":"Choose a member"})}),s.jsx(ft,{children:i==="blocked"?n.map(R=>s.jsx(Ee,{value:R.id,children:R.title},R.id)):t.map(R=>s.jsx(Ee,{value:R.user_id,children:R.label},R.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(Ue,{htmlFor:"hold-reason",children:"Reason"}),s.jsx(is,{id:"hold-reason",rows:3,placeholder:"What the task is waiting for",value:f,"aria-invalid":j.reason,onChange:R=>h(R.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(Lr,{id:"hold-release-claim",checked:m,onCheckedChange:R=>x(R===!0)}),s.jsx(Ue,{htmlFor:"hold-release-claim",children:"Also release my claim"})]})]}),s.jsxs(qn,{className:"mt-6",children:[s.jsx(G,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),s.jsx(G,{type:"submit",disabled:p,children:p?"Adding…":"Add hold"})]})]})})})}function Do(){const e=cn().tasks;if(!e)throw new Error("The Task page rendered without the tasks seam.");return e}function ix(){return s.jsxs("div",{className:"grid gap-3",role:"status","aria-label":"Loading task",children:[s.jsx(wt,{className:"h-8 w-1/2"}),Array.from({length:7},(e,t)=>s.jsx(wt,{className:t===6?"h-6 w-2/3":"h-6 w-full"},t))]})}function Cu({back:e,description:t}){const{href:n,Link:a}=We();return s.jsx(Ha,{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 Tl="not_set",xD=10*60*1e3,zv=20;function gD(){const{members:e}=Do(),[t,n]=u.useState([]);u.useEffect(()=>{let r=!0;return e().then(i=>{r&&i.ok&&n(i.data)}),()=>{r=!1}},[e]);const a=u.useMemo(()=>new Map(t.map(r=>[r.user_id,r])),[t]),l=u.useCallback((r,i)=>{var o;return r?r===i?"You":((o=a.get(r))==null?void 0:o.label)??"A member":""},[a]);return{members:t,name:l}}function vD({active:e,task_id:t,back:n}){const a=Do(),{task:l,activity:r,listTasks:i,hierarchyRevision:o,commands:c}=a,{href:d,Link:f}=We(),h=Mr(),{self_id:m}=ed(),{members:x,name:j}=gD(),{workspace:v}=e,{confirm:y,confirm_dialog:g}=Ro(),[p,b]=u.useState(null),[w,N]=u.useState(!1),[R,_]=u.useState(!1),[k,U]=u.useState(null),[z,K]=u.useState([]),[V,L]=u.useState(zv),[M,A]=u.useState([]),[S,E]=u.useState(!1),[C,$]=u.useState(null),[X,T]=u.useState(null),[P,J]=u.useState(""),[ee,ve]=u.useState(null),Q=u.useCallback(async()=>{if(!l)return;const D=await l(t);D.ok?(b(D.data),_(!1)):D.refusal.status===404||D.refusal.status===400?N(!0):_(!0)},[l,t]),O=u.useRef(0),H=u.useCallback(async()=>{if(!r)return;const D=O.current+=1;let we=[],W;for(;;){const Se=await r(t,W);if(D!==O.current||!Se.ok)return;if(we=[...we,...Se.data.events].slice(-1e3),!Se.data.more||!Se.data.next_cursor)break;W=Se.data.next_cursor}D===O.current&&K(we.reverse())},[r,t]);u.useEffect(()=>{Q(),H()},[Q,H]);const te=p?v.lists.find(D=>D.id===p.task.list_id):void 0,re=u.useMemo(()=>{var D;return((D=v.workflows.find(we=>we.id===(p==null?void 0:p.task.workflow_id)))==null?void 0:D.statuses)??[]},[v,p==null?void 0:p.task.workflow_id]);u.useEffect(()=>{if(!p)return;let D=!0;return i(p.task.list_id,{limit:100}).then(we=>{D&&A(we.ok?we.data.tasks.filter(W=>W.id!==p.task.id).map(W=>({id:W.id,title:W.title})):[])}),()=>{D=!1}},[i,p==null?void 0:p.task.list_id,p==null?void 0:p.task.id,p]);const ye=u.useCallback(async()=>{await Promise.all([Q(),H()])},[Q,H]),ae=u.useCallback((D,we)=>c?c.run(D,we):Promise.resolve({ok:!1,refusal:{status:0,message:"This page cannot change tasks."}}),[c]),je=u.useCallback(async(D,we,W)=>{const Se=await ae(D,we);return Se.ok?(W&&h.success(W),await ye(),Se.data):(Se.refusal.code==="revision_conflict"?U({tone:"warning",title:"This task changed while you were editing",body:"We reloaded it. Check the change, then save again."}):Se.refusal.code==="claim_held"?(await Q(),U({tone:"destructive",title:"Someone else claimed this task first",body:"Their claim is shown below. You can take it over if it lapses."})):h.error(Se.refusal.message),await ye(),null)},[ae,h,ye,Q]),ne=(p==null?void 0:p.claim)??null,at=ne!==null&&ne.id===ee&&!ne.lapsed&&!ne.via?ne.id:null;if(u.useEffect(()=>{if(!at)return;const D=window.setInterval(()=>{ae("renew_claim",{claim_id:at,lease_seconds:Dv}).then(()=>Q())},xD);return()=>window.clearInterval(D)},[at,ae,Q]),w)return s.jsx(Cu,{back:n});if(R&&!p)return s.jsxs(xe,{variant:"destructive",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This task could not be loaded"}),s.jsxs(ge,{children:[s.jsx("p",{children:"Check your connection and try again."}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void Q(),children:"Retry"})]})]});if(!p)return s.jsx(ix,{});const{task:ue}=p,Be=ue.archived_at!==null,Y=Su(p.permission,"write")&&!Be,Re=Su(p.permission,"manage"),Le=re.find(D=>D.id===ue.status_id),vt=re.find(D=>D.category==="completed"),_e=v.priorities.find(D=>D.id===ue.priority_id),Dt=p.contributors.map(D=>D.user_id),I=ne!==null&&ne.user_id===m,oe=ne!==null&&!ne.lapsed,pe=p.checklist.filter(D=>D.is_complete).length,ke=async()=>{const[D,we]=await Promise.all([i(ue.list_id,{limit:1}),o(v.id)]);return D.ok?we.ok?{ok:!0,data:{task_id:ue.id,expected_revision:ue.revision,expected_order_revision:D.data.list.order_revision,expected_hierarchy_revision:we.data}}:we:D},Me=(D,we)=>je("update_task",{task_id:ue.id,expected_revision:ue.revision,changes:D},we),Yt=D=>y(D.via==="sdlc_login"?{title:"Release this claim?",description:`You claimed it via ${Of(D.via,D.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}),un=async()=>{if(!vt)return;if(oe&&(!I||ne.via)){const we=ne.via==="api_key"?`${I?"Your":`${j(ne.user_id)}'s`} agent is still working on it.`:ne.via==="sdlc_login"?`${I?"You are":`${j(ne.user_id)} is`} still working on it via ${Of(ne.via,ne.via_device)}.`:`${j(ne.user_id)} is still working on it.`;if(!await y({title:"Complete this task?",description:we,action_label:"Mark complete"}))return}await Me({status_id:vt.id},"Task completed.")!==null&&ne&&I&&oe&&await je("end_claim",{claim_id:ne.id,outcome:"completed"})},se=async(D,we)=>{const W=await ke();if(!W.ok){h.error(W.refusal.message);return}await je(D,W.data,we)},He=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 se("archive_task","Task archived.")},qe=async()=>{await se("restore_task","Task restored.")},os=async()=>{var Se;const D=ne,we=await je("claim_task",{task_id:ue.id,lease_seconds:Dv}),W=(Se=we==null?void 0:we.claim)==null?void 0:Se.id;W&&!(D&&D.id===W&&D.via)&&ve(W)},kn=async()=>{ne&&(ne.via&&!await Yt(ne)||(await je("end_claim",{claim_id:ne.id,outcome:"released"},"Claim released."),ve(null)))},cs=async()=>{ne&&await je("end_claim",{claim_id:ne.id,outcome:"expired"},"Claim cleared.")},ht=async D=>{D.hold_type==="paused"&&m&&(D={...D,target_user_id:m});const we=await ae("open_hold",{task_id:ue.id,hold_type:D.hold_type,reason:D.reason,...D.target_user_id?{target_user_id:D.target_user_id}:{},...D.target_task_id?{target_task_id:D.target_task_id}:{},...D.target_label?{target_label:D.target_label}:{}});return we.ok?(E(!1),h.success("Hold added."),D.release_claim&&ne&&I&&!ne.via&&(await je("end_claim",{claim_id:ne.id,outcome:"released"}),ve(null)),await ye(),null):we.refusal.message},Ws=D=>je("checklist",{task_id:ue.id,expected_revision:ue.revision,...D}),Js=async D=>{for(const we of D.filter(W=>!Dt.includes(W)))await je("set_contributor",{task_id:ue.id,expected_revision:ue.revision,user_id:we,action:"add"});for(const we of p.contributors.filter(W=>!D.includes(W.user_id)))await je("set_contributor",{task_id:ue.id,expected_revision:ue.revision,user_id:we.user_id,action:"remove",expected_contributor_revision:we.revision})},ea=D=>{var W;if(D.target.kind==="user")return j(D.target.user_id,m);if(D.target.kind==="external")return D.target.label;if(D.target.hidden||!D.target.task_id)return"A task you cannot see";const we=D.target.task_id;return s.jsx(f,{className:"text-primary hover:underline",href:d(`${n}/${we}`),children:((W=M.find(Se=>Se.id===we))==null?void 0:W.title)??"Another task"})},ta=D=>D.target.kind==="user"&&D.target.user_id===m&&!D.released_at?s.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:()=>void je("release_hold",{hold_id:D.id},"Hold released."),children:"Release"}):Y?s.jsx(G,{type:"button",variant:"outline",size:"sm",onClick:()=>void je("resolve_hold",{hold_id:D.id},"Hold resolved."),children:"Resolve"}):null;return s.jsxs(s.Fragment,{children:[s.jsx(Zt,{title:ue.title,description:`Created ${Dn(ue.created_at)} by ${j(ue.created_by,m)}`,actions:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Y&&s.jsxs(s.Fragment,{children:[s.jsxs(G,{type:"button",variant:"outline",onClick:()=>$(ue.title),children:[s.jsx(nd,{className:"mr-2 size-4","aria-hidden":"true"}),"Edit title"]}),vt&&ue.status_id!==vt.id&&s.jsxs(G,{type:"button",variant:"outline",onClick:()=>void un(),children:[s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}),"Mark complete"]})]}),Re&&!Be&&s.jsxs(G,{type:"button",variant:"outline",onClick:()=>void He(),children:[s.jsx(sv,{className:"mr-2 size-4","aria-hidden":"true"}),"Archive"]})]}),children:C!==null?s.jsxs("form",{className:"flex flex-wrap items-center gap-2 pt-1",onSubmit:async D=>{D.preventDefault(),C.trim()&&await Me({title:C.trim()})!==null&&$(null)},children:[s.jsx(Ue,{htmlFor:"task-title",className:"sr-only",children:"Title"}),s.jsx(Tt,{id:"task-title",className:"max-w-xl",value:C,onChange:D=>$(D.target.value)}),s.jsx(G,{type:"submit",size:"sm",children:"Save"}),s.jsx(G,{type:"button",size:"sm",variant:"outline",onClick:()=>$(null),children:"Cancel"})]}):null}),k&&s.jsxs(xe,{variant:k.tone,className:"mt-4","data-testid":"task-notice",children:[k.tone==="warning"?s.jsx(yl,{className:"size-4","aria-hidden":"true"}):s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:k.title}),s.jsx(ge,{children:k.body})]}),Be?s.jsxs(xe,{variant:"info",className:"mt-4",children:[s.jsx(sv,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This task is archived"}),s.jsx(ge,{children:Re?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(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void qe(),children:[s.jsx(FC,{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."})})]}):Y?null:s.jsxs(xe,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"You can view this task"}),s.jsx(ge,{children:"Ask an organization admin for write access to change it."})]}),Y?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(Ue,{htmlFor:"task-status",children:"Status"}),s.jsxs(xt,{value:ue.status_id,onValueChange:D=>void Me({status_id:D}),children:[s.jsx(dt,{id:"task-status",children:s.jsx(gt,{})}),s.jsx(ft,{children:re.map(D=>s.jsx(Ee,{value:D.id,children:D.name},D.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"task-priority",children:"Priority"}),s.jsxs(xt,{value:ue.priority_id??Tl,onValueChange:D=>void Me({priority_id:D===Tl?null:D}),children:[s.jsx(dt,{id:"task-priority",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:Tl,children:"Not set"}),v.priorities.map(D=>s.jsx(Ee,{value:D.id,children:D.name},D.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"task-primary",children:"Primary"}),s.jsxs(xt,{value:ue.primary_user_id??Tl,onValueChange:D=>void Me({primary_user_id:D===Tl?null:D}),children:[s.jsx(dt,{id:"task-primary",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:Tl,children:"Not set"}),x.map(D=>s.jsx(Ee,{value:D.user_id,children:D.label},D.user_id))]})]})]}),s.jsx(yD,{members:x,selected:Dt,on_change:D=>void Js(D)})]}):s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(uc,{label:"Status",value:(Le==null?void 0:Le.name)??""}),s.jsx(uc,{label:"Priority",value:(_e==null?void 0:_e.name)??"Not set"}),s.jsx(uc,{label:"Primary",value:ue.primary_user_id?j(ue.primary_user_id,m):"Not set"}),s.jsx(uc,{label:"Contributors",value:Dt.map(D=>j(D,m)).join(", ")||"None"})]}),!Be&&s.jsx(bD,{claim:ne,mine:I,holder:ne?j(ne.user_id):"",own:ne!==null&&ne.id===ee,can_write:Y,on_claim:()=>void os(),on_release:()=>void kn(),on_clear:()=>void cs()}),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"}),Y&&X===null&&s.jsx(G,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(ue.description??""),children:"Edit description"})]}),X!==null?s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async D=>{D.preventDefault(),await Me({description:X})!==null&&T(null)},children:[s.jsx(Ue,{htmlFor:"task-description",className:"sr-only",children:"Description"}),s.jsx(is,{id:"task-description",rows:5,value:X,onChange:D=>T(D.target.value)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(G,{type:"submit",size:"sm",children:"Save"}),s.jsx(G,{type:"button",size:"sm",variant:"outline",onClick:()=>T(null),children:"Cancel"})]})]}):s.jsx("p",{className:"mt-2 text-sm whitespace-pre-wrap",children:ue.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?` · ${pe} of ${p.checklist.length} done`:""]}),s.jsx("ul",{className:"mt-2 grid gap-1",children:p.checklist.map(D=>s.jsxs("li",{className:"flex items-center justify-between gap-2 py-1","data-testid":"task-checklist-item",children:[Y?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lr,{id:`check-${D.id}`,checked:D.is_complete,onCheckedChange:we=>void Ws({action:"toggle",item_id:D.id,expected_item_revision:D.revision,is_complete:we===!0})}),s.jsx(Ue,{htmlFor:`check-${D.id}`,className:"font-normal",children:D.label})]}):s.jsxs("span",{className:"text-sm",children:[D.is_complete?"Done: ":"To do: ",D.label]}),Y&&s.jsxs(jd,{children:[s.jsx(wd,{asChild:!0,children:s.jsx(G,{type:"button",variant:"ghost",size:"icon","aria-label":`Item actions for ${D.label}`,children:s.jsx(bp,{className:"size-4","aria-hidden":"true"})})}),s.jsx(Oo,{align:"end",children:s.jsx(wr,{className:"text-destructive focus:text-destructive",onSelect:()=>void Ws({action:"archive",item_id:D.id,expected_item_revision:D.revision}),children:"Remove"})})]})]},D.id))}),p.checklist.length===0&&!Y&&s.jsx("p",{className:"text-muted-foreground text-sm",children:"No checklist items."}),Y&&s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async D=>{D.preventDefault(),P.trim()&&await Ws({action:"add",label:P.trim()})!==null&&J("")},children:[s.jsx(Ue,{htmlFor:"task-new-item",children:"Add an item"}),s.jsx(Tt,{id:"task-new-item",placeholder:"Add an item and press Enter",value:P,onChange:D=>J(D.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"}),Y&&s.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!0),children:[s.jsx(_0,{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(Ye,{containerAriaLabel:"Holds",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Type"}),s.jsx(F,{children:"Reason"}),s.jsx(F,{children:"Waiting on"}),s.jsx(F,{className:"text-right",children:"Actions"})]})}),s.jsxs(Fe,{children:[p.holds.map(D=>{const we=Ji[D.hold_type];return s.jsxs(ce,{"data-testid":"task-hold",children:[s.jsx(q,{children:s.jsx(me,{variant:we.tone,children:we.label})}),s.jsxs(q,{children:[s.jsx("div",{children:D.reason}),s.jsx("div",{className:"text-muted-foreground text-xs",children:D.released_at?`Released by ${j(D.released_by,m)} · ${Dn(D.released_at)} · Ready to resolve`:`Opened by ${j(D.opened_by,m)} · ${Dn(D.opened_at)} · Open`})]}),s.jsx(q,{children:ea(D)}),s.jsx(q,{className:"text-right",children:ta(D)})]},D.id)}),p.holds.length===0&&s.jsx(ce,{children:s.jsx(q,{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:[z.slice(0,V).map(D=>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:W$(D)}),s.jsxs("span",{className:"min-w-0 text-right sm:text-left",children:[s.jsx("span",{children:D.actor_id?j(D.actor_id,m):"The system"}),D.via?s.jsxs("span",{className:"text-muted-foreground block max-w-64 truncate text-xs sm:max-w-none",title:`via ${Of(D.via,D.via_device)}`,children:["via ",ax(D.via),s.jsx(jk,{via:D.via,device:D.via_device})]}):null]}),s.jsx("span",{className:"text-muted-foreground col-span-2 sm:col-span-1 sm:text-right",children:gk(D.created_at)})]},D.id)),z.length===0&&s.jsx("li",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No activity yet."})]}),z.length>V&&s.jsx(G,{type:"button",variant:"ghost",size:"sm",className:"mt-2",onClick:()=>L(D=>D+zv),children:"Load more"})]}),Y&&te&&s.jsx(pD,{open:S,members:x,tasks:M,holds_my_web_claim:I&&oe&&!(ne!=null&&ne.via),on_close:()=>E(!1),on_submit:ht}),g]})}function uc({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 yD({members:e,selected:t,on_change:n}){return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"task-contributors",children:"Contributors"}),s.jsxs(jd,{children:[s.jsx(wd,{asChild:!0,children:s.jsxs(G,{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(y0,{className:"text-muted-foreground size-4","aria-hidden":"true"})]})}),s.jsx(Oo,{align:"start",children:e.map(a=>{const l=t.includes(a.user_id);return s.jsxs(wr,{onSelect:()=>n(l?t.filter(r=>r!==a.user_id):[...t,a.user_id]),children:[l?s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}):s.jsx("span",{className:"mr-2 size-4"}),a.label]},a.user_id)})})]})]})}function jk({via:e,device:t}){return e!=="sdlc_login"||!t?null:s.jsxs(s.Fragment,{children:[" on ",s.jsx("bdi",{children:t})]})}function bD({claim:e,mine:t,holder:n,own:a,can_write:l,on_claim:r,on_release:i,on_clear:o}){let c=s.jsx(jp,{className:"size-4","aria-hidden":"true"}),d="Nobody is working on this",f=l?"Claim it to show others you are.":"",h=l?s.jsx(G,{type:"button",size:"sm",onClick:r,children:"Claim"}):null;if(e&&e.lapsed){const m=new Date(e.lease_expires_at)<=new Date;c=s.jsx(xR,{className:"size-4","aria-hidden":"true"}),d=m?`${t?"Your":`${n}'s`} claim lapsed at ${ss(e.lease_expires_at)}`:`${t?"Your":`${n}'s`} claim lapsed`,f=m?"Its time ran out.":`${n} can no longer edit this task.`,l&&(f+=" Take it over to work on it yourself, or clear it so anyone can claim it."),h=l?s.jsxs(s.Fragment,{children:[s.jsx(G,{type:"button",size:"sm",variant:"outline",onClick:o,children:"Clear claim"}),s.jsx(G,{type:"button",size:"sm",onClick:r,children:"Take over"})]}):null}else if(e){const m=ss(e.lease_expires_at);c=e.via==="api_key"?s.jsx(vp,{className:"size-4","aria-hidden":"true"}):e.via==="sdlc_login"?s.jsx(UR,{className:"size-4","aria-hidden":"true"}):s.jsx(gT,{className:"size-4","aria-hidden":"true"});const x=s.jsxs(s.Fragment,{children:["Claimed via sdlc login",s.jsx(jk,{via:e.via,device:e.via_device}),"."]});t&&e.via==="api_key"?(d=`Your agent is working on this until ${m}`,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 ${m}`,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 ${m}`,f=x):t?(d=`You are working on this until ${m}`,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 ${m}`,f="Claimed through an API key."):(d=`${n} is working on this until ${m}`,f=l?"Claimed on the web. You can take it over if the claim lapses.":"Claimed on the web."),h=t?s.jsx(G,{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]}),h?s.jsx("div",{className:"flex items-center gap-2",children:h}):null]})}const jD=10,wk=5,wD=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,_k="Not available",_D={added:"Added",changed:"Changed",removed:"Removed"},ND={thread:"Thread",task:"Task",issue:"Issue",release:"Release",test:"Test"},Lv=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;function kD(e,t){const n=t!=null&&t.startsWith("task:")?t.slice(5):null;if(n&&wD.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 l=t!=null&&t.startsWith("release:")?t.slice(8):null;if(l&&Lv.test(l))return{label:l==="candidate"?"Candidate":`Release ${l}`,path:`/releases?release=${l}`};const r=t!=null&&t.startsWith("planned:")?t.slice(8):null;return r&&Lv.test(r)?{label:`Planned Release ${r}`,path:`/releases?planned=${r}`}:{label:"Tasks",path:`/org/${e}/tasks`}}const Nk=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function SD({org:e,task_id:t,from:n}){var un;const a=Do(),{href:l,Link:r}=We(),{confirm:i,confirm_dialog:o}=Ro(),c=kD(e,n),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState([]),[x,j]=u.useState([]),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,w]=u.useState({state:"loading"}),[N,R]=u.useState({state:"loading"}),[_,k]=u.useState(null),[U,z]=u.useState(null),[K,V]=u.useState(!1),L=u.useRef(null),M=ls(),A=u.useRef(null),S=u.useRef(null),E=u.useRef(null),C=u.useRef(null),$=u.useRef(!1),X=u.useRef(0),T=u.useRef(0),P=u.useCallback(async()=>{if(!a.taskSections)return;w({state:"loading"});const se=await a.taskSections(t);w(se.ok?{state:"ok",data:se.data}:{state:"failed",refusal:se.refusal})},[a.taskSections,t]),J=u.useCallback(async()=>{if(!a.taskRelated)return;R({state:"loading"});const se=await a.taskRelated(t);R(se.ok?{state:"ok",data:se.data}:{state:"failed",refusal:se.refusal})},[a.taskRelated,t]),ee=u.useCallback(async()=>{var kn,cs;const se=T.current+=1;p(null),P(),J();const[He,qe]=await Promise.all([a.availability(),a.task?a.task(t):Promise.resolve(null)]);if(se!==T.current)return;He.state==="active"&&m(((kn=He.workspace.workflows.find(ht=>ht.id===He.list.workflow_id))==null?void 0:kn.statuses)??[]);const os=He.state==="off"&&((cs=He.refusal)==null?void 0:cs.reason)==="engine_missing"?He.refusal:null;if(!qe||!qe.ok&&qe.refusal.reason==="engine_missing"||os){f({state:"engine_missing",refusal:os??(qe&&!qe.ok?qe.refusal:{status:0,message:""})});return}if(qe.ok){X.current=0,y(null),z(null),f({state:"ok",detail:qe.data,at:new Date().toISOString()});return}if(qe.refusal.status===404||qe.refusal.reason==="not_found"){f({state:"missing"});return}if(X.current+=1,X.current===1&&Nk(qe.refusal)){p(qe.refusal.retry_after??jD);return}y(qe.refusal),f(ht=>ht.state==="loading"?{state:"loading"}:ht)},[a,t,P,J]);u.useEffect(()=>{ee()},[ee]),u.useEffect(()=>{if(g===null)return;const se=setTimeout(()=>void ee(),g*1e3);return()=>clearTimeout(se)},[g,ee]),u.useEffect(()=>{let se=!0;return a.members().then(He=>{se&&He.ok&&j(He.data)}),()=>{se=!1}},[a.members]),u.useEffect(()=>{var He;if($.current||d.state!=="ok")return;$.current=!0;const se=(He=L.current)==null?void 0:He.querySelector("h1");se&&(se.tabIndex=-1,se.focus())},[d.state]),u.useEffect(()=>{var se;_&&((se=S.current)==null||se.focus())},[_]),u.useEffect(()=>{if(U===null)return;const se=setTimeout(()=>{var He;return(He=A.current)==null?void 0:He.focus()},0);return()=>clearTimeout(se)},[U]);const ve=u.useMemo(()=>new Map(x.map(se=>[se.user_id,se.label])),[x]),Q=se=>se?ve.get(se)??se:"",O=()=>{k(null),ee()},H=u.useRef(null),te=se=>(H.current=se,se==="graph"?P():J());if(u.useEffect(()=>{var qe;const se=H.current;if(se===null||(se==="graph"?b:N).state==="loading")return;H.current=null;const He=(se==="graph"?E:C).current??((qe=L.current)==null?void 0:qe.querySelector("h1"));He==null||He.focus()},[b,N]),d.state==="missing")return s.jsx(ba,{children:s.jsx(Cu,{back:`/org/${e}/tasks`,description:`No task ${t} in this checkout. It may have finished and been archived, or never been recorded.`})});const re=s.jsx(G,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(r,{href:l(c.path),children:[s.jsx(g0,{className:"size-4","aria-hidden":"true"}),c.label]})});if(d.state==="engine_missing")return s.jsx(ba,{children:s.jsx("div",{ref:L,className:"contents",children:s.jsx(Zs,{page:"Task",header:s.jsx(Ai,{back:re,id:null,title:t})})})});const ye=v?s.jsxs(xe,{variant:"destructive",className:"mt-4",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read this task"}),s.jsxs(ge,{children:[s.jsxs("p",{children:[v.message,v.since?` Since ${Jn(v.since)}.`:"",d.state==="ok"?` This page was read at ${Jn(d.at)}.`:""," See the sdlc viewer terminal for more."]}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:O,children:"Retry"})]})]}):null,ae=g!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(_n,{"aria-hidden":"true"}),"Could not read this task. Trying again in ",g," seconds."]}):null,je=s.jsx("div",{role:"status","aria-live":"polite",children:ae});if(d.state==="loading")return s.jsxs(ba,{children:[je,ye,!v&&g===null?s.jsx(ix,{}):null]});const{detail:ne,at}=d,{task:ue}=ne,Be=h.find(se=>se.id===ue.status_id),Y=ne.local_done&&"task"in ne.local_done?ne.local_done:null,Re=ne.local_waits??[],Le=Y?Re[0]??null:null,vt=Le?Q(Le.opened_by):ne.owner_title??Q(ne.thread),_e=b.state==="ok"?b.data:null,Dt=(_e==null?void 0:_e.lifecycle)==="finished",I=Dt&&(_e==null?void 0:_e.outcome)==="cancelled",oe=Dt&&(_e==null?void 0:_e.outcome)==="complete",pe=!!ue.created_at,ke=ne.acceptance??[],Me=async()=>{var qe;if(!Y||!((qe=a.commands)!=null&&qe.complete)||!await i({title:`Mark ${ue.title} done?`,description:Le?`This answers ${vt}'s ask, “${Le.reason}”, closes that wait, and tells ${vt} to check and continue.`:`This tells ${vt||"its thread"} to check and continue.`,action_label:"Mark done"}))return;V(!0);const He=await a.commands.complete(Y);if(V(!1),!He.ok){z(He.refusal.message);return}await ee(),k({title:ue.title,asker:vt||"Its thread"})},Yt=s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[Y&&!_?s.jsxs(s.Fragment,{children:[s.jsxs(G,{ref:A,type:"button",variant:"outline",disabled:K,"aria-disabled":U!==null?!0:void 0,"aria-describedby":U!==null?"task-done-why":void 0,onClick:()=>{U===null&&Me()},children:[s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}),"Done"]}),U!==null?s.jsx("span",{id:"task-done-why",className:"text-muted-foreground text-xs",children:"Read again first"}):null]}):null,s.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",Jn(at)]}),s.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:O,children:[s.jsx(yl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsxs(ba,{children:[s.jsxs("div",{ref:L,className:"contents",children:[s.jsx(Ai,{back:re,id:ue.id,badge:Be?s.jsx(me,{variant:xk(Be),children:Be.name}):null,title:ue.title,created:pe?`Created ${Dn(ue.created_at)}${vt||ne.owner_title?` by ${ne.owner_title??vt}`:""}`:null,actions:Yt}),je,ye,_?s.jsx("div",{ref:S,tabIndex:-1,role:"status","aria-live":"polite",className:"outline-none",children:s.jsxs(xe,{variant:"success",className:"mt-4",children:[s.jsx(td,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Marked ",_.title," done"]}),s.jsxs(ge,{children:[_.asker," is told to check and continue."]})]})}):null,U!==null?s.jsxs(xe,{variant:"destructive",className:"mt-4",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Done was not recorded"}),s.jsxs(ge,{children:[U," Read again to see the task as it is now."]})]}):null,Le&&!_?s.jsxs(xe,{variant:"warning",className:"mt-4",children:[s.jsx(rn,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:[vt," asks: ",Le.reason]}),s.jsxs(ge,{children:["Waiting on you since ",lx(Le.opened_at),". Done answers it and tells ",vt," to check and continue."]})]}):null,ne.view_outdated?s.jsxs(xe,{variant:"warning",className:"mt-4",children:[s.jsx(rn,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:$r}),s.jsxs(ge,{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(xs,{label:"Owner thread",value:ne.owner_title??(Q(ne.thread)||"None")}),s.jsx(xs,{label:"Release",value:ne.release??"None"}),s.jsx(xs,{label:"Session",value:b.state==="loading"?"Loading…":b.state==="failed"?"Not available":_e!=null&&_e.session?s.jsxs(s.Fragment,{children:[_e.session.provider," ",s.jsx("span",{className:"font-mono break-all",children:_e.session.id})]}):"None"}),s.jsx(xs,{label:"Now",value:ne.local_detail??(Be==null?void 0:Be.name)??""})]}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"Local tasks have no priority or contributors."}),s.jsx(CD,{detail:ne,holder:Q((un=ne.claim)==null?void 0:un.user_id),finished_at:Dt?(_e==null?void 0:_e.finished_at)??null:null,read_at:at}),s.jsxs(xe,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"text-info size-4","aria-hidden":"true"}),Y?s.jsxs(s.Fragment,{children:[s.jsx(Ne,{children:"Done is the one change this page makes"}),s.jsx(ge,{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(ge,{children:"A task changes through the agent thread working on it."})]})]}),pe?_e!=null&&_e.record?s.jsxs("p",{className:"mt-4 text-sm",children:["Record ",s.jsx("span",{className:"font-mono break-all",children:_e.record})]}):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."}),Y?s.jsx(St,{id:"task-done-needs",title:"What Done needs",children:ke.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-xs",children:["The task's acceptance; ",vt||"its thread"," checks these after Done."]}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:ke.map(se=>s.jsx("li",{children:se},se))})]}):s.jsxs("p",{className:"text-sm",children:["Its thread gave no acceptance. Ask ",vt||"its thread"," what Done needs before marking it."]})}):ke.length>0?s.jsxs(St,{id:"task-acceptance",title:"Acceptance",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:oe?"All met: the task finished complete":I&&(_e!=null&&_e.finished_at)?`Cancelled ${Dn(_e.finished_at)}`:"Met when the task finishes complete"}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:ke.map(se=>s.jsx("li",{children:oe?`Met: ${se}`:se},se))})]}):null,s.jsx(RD,{detail:ne,waits:Re,given:Y!==null,threadName:Q,threadsLink:s.jsx(r,{className:"text-primary hover:underline",href:l(`/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(wt,{className:"h-8 w-full"}),s.jsx(wt,{className:"h-8 w-full"}),s.jsx(wt,{className:"h-8 w-2/3"})]}):null,_e?s.jsx(St,{id:"task-stands",title:"Where it stands",children:s.jsxs("p",{className:"text-sm",children:[(Be==null?void 0:Be.name)??ue.status_id,ne.local_detail?` · ${ne.local_detail}`:""]})}):null,_e!=null&&_e.time?s.jsx(TD,{time:_e.time}):null,s.jsx(ED,{sections:b,heading_ref:E,on_retry:()=>void te("graph"),taskLink:se=>s.jsx(r,{className:"text-primary hover:underline",href:l(`/org/${e}/tasks/${se}?from=task:${ue.id}`),children:se})}),_e!=null&&_e.files?s.jsx(AD,{files:_e.files,finished:Dt}):null,_e!=null&&_e.proof?s.jsx(MD,{proof:_e.proof,finished_at:_e.finished_at,who:ne.owner_title??null}):null,_e&&_e.history.length>0?s.jsx(OD,{history:_e.history}):null,s.jsx(kk,{related:N,heading_ref:C,on_retry:()=>void te("related"),link:se=>{const He=se.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(se.id)}`:se.kind==="task"?`/org/${e}/tasks/${se.id}?from=task:${ue.id}`:se.kind==="issue"?`/org/${e}/issues/${encodeURIComponent(se.id)}?from=task:${ue.id}`:se.kind==="release"?`/releases?${se.planned?"planned":"release"}=${encodeURIComponent(se.id)}`:null;return He?s.jsx(r,{className:le("text-primary hover:underline",se.kind!=="thread"&&se.label===se.id&&"font-mono"),href:l(He),children:se.label}):se.label}})]}),o]})}function ba({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 Ai({back:e,id:t,badge:n,title:a,created:l,actions:r}){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("span",{className:"font-mono",children:t}),n]}):null,s.jsx(Zt,{title:a,description:l??void 0,actions:r})]})}function xs({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 St({id:e,title:t,aside:n,heading_ref:a,children:l}){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:l})]})}function CD({detail:e,holder:t,finished_at:n,read_at:a}){const l=e.claim,[,r]=u.useReducer(f=>f+1,0),i=l&&!e.view_outdated?new Date(l.lease_expires_at).getTime():null;u.useEffect(()=>{if(i===null||!Number.isFinite(i))return;const f=i-Date.now();if(f<=0)return;const h=setTimeout(r,Math.min(f+50,2147483647));return()=>clearTimeout(h)},[i]);let o=s.jsx(jp,{className:"size-4","aria-hidden":"true"}),c="Nobody is working on this",d=null;if(e.view_outdated)c=`Claimed by: ${_k}`;else if(l){const f=new Date(l.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 ${Jn(l.lease_expires_at)}${f||l.lapsed?" · passed":""}`,d="Claimed in the coordination registry; its thread renews the claim."}else n&&(o=s.jsx(td,{className:"size-4","aria-hidden":"true"}),d=`Finished ${Dn(n)}. Its claim ended when it finished.`);return s.jsxs(_t,{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 RD({detail:e,waits:t,given:n,threadName:a,threadsLink:l}){if(e.view_outdated)return s.jsx(St,{id:"task-holds",title:"Holds",children:s.jsx("p",{className:"text-sm",children:_k})});if(e.holds.length===0)return null;const r=new Map(t.map(i=>[i.id,i]));return s.jsxs(St,{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(_t,{className:"mt-2 overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Holds",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Type"}),s.jsx(F,{children:"Reason"}),s.jsx(F,{children:"Waiting on"}),s.jsx(F,{children:"Opened"})]})}),s.jsx(Fe,{children:e.holds.map(i=>{var f;const o=r.get(i.id),c=Ji[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 ",l,": ",o.local_threads.join(" · ")]}):null;return s.jsxs(ce,{"data-testid":"task-hold",children:[s.jsx(q,{children:s.jsx(me,{variant:c.tone,children:(o==null?void 0:o.local_label)??c.label})}),s.jsxs(q,{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(q,{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(q,{children:lx(i.opened_at)})]},i.id)})})]})})]})}function TD({time:e}){return s.jsx(St,{id:"task-time",title:"Time",children:s.jsxs("dl",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsx(xs,{label:"Estimate",value:e.estimate?`${ni(e.estimate.low)}–${ni(e.estimate.high)}`:e.unknown_reason??"None"}),s.jsx(xs,{label:"Time taken",value:e.elapsed!==null?`${ni(e.elapsed)}${e.over_estimate?" · over estimate":""}`:"Not started"}),e.forecast?s.jsx(xs,{label:"Reforecast",value:s.jsxs("span",{className:"text-muted-foreground",children:[ni(e.forecast.low),"–",ni(e.forecast.high)," left",e.forecast.reason?` · ${e.forecast.reason}`:""]})}):null]})})}function ox({what:e,again:t,refusal:n,on_retry:a}){return s.jsxs(xe,{variant:"destructive",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Could not read ",e]}),s.jsxs(ge,{children:[s.jsx("p",{children:n.message}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:t})]})]})}function ED({sections:e,heading_ref:t,on_retry:n,taskLink:a}){const[l,r]=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(St,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsx(ox,{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(St,{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=l?o.changes:o.changes.slice(0,wk),d=o.changes.length-c.length;return s.jsxs(St,{id:"task-graph",title:"Graph changes",aside:o.document,heading_ref:t,children:[s.jsx(_t,{className:"overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Graph changes",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Change"}),s.jsx(F,{children:"Kind of change"}),s.jsx(F,{children:"Also in"}),s.jsx(F,{children:"In the plan"})]})}),s.jsx(Fe,{children:c.map(f=>s.jsxs(ce,{children:[s.jsxs(q,{children:[s.jsx("div",{children:f.label}),s.jsx("div",{className:"text-muted-foreground text-xs",children:f.type})]}),s.jsx(q,{children:_D[f.change]}),s.jsx(q,{children:f.also_in.length===0?"No other task":f.also_in.map((h,m)=>s.jsxs(u.Fragment,{children:[m>0?", ":null,a(h.id)]},h.id))}),s.jsx(q,{children:f.planned?"Yes":s.jsx(me,{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(G,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(!0),children:["Show all ",o.changes.length]})]}):null]})}function AD({files:e,finished:t}){const[n,a]=u.useState(!1),l=n?e.paths:e.paths.slice(0,wk);return s.jsxs(St,{id:"task-files",title:"Files",children:[l.length>0?s.jsx("ul",{className:"grid gap-1 text-sm",children:l.map(r=>s.jsx("li",{children:s.jsx("span",{className:"font-mono break-all",children:r})},r))}):null,e.paths.length>l.length?s.jsxs(G,{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 MD({proof:e,finished_at:t,who:n}){return s.jsxs(St,{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 ",Dn(t),n?` by ${n}`:""]}):null]})}function OD({history:e}){return s.jsxs(St,{id:"task-history",title:"History",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"From the task record, newest first"}),s.jsx(_t,{className:"mt-2 overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"History",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"What"}),s.jsx(F,{children:"Who"}),s.jsx(F,{children:"When"})]})}),s.jsx(Fe,{children:e.map((t,n)=>s.jsxs(ce,{children:[s.jsx(q,{children:t.what}),s.jsx(q,{children:t.who??"Its thread"}),s.jsx(q,{children:lx(t.at)})]},`${t.at}:${n}`))})]})})]})}function kk({id:e="task-related",related:t,heading_ref:n,on_retry:a,link:l,fixed:r=!1}){return t.state==="ok"&&t.data.length===0?null:s.jsx(St,{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(wt,{className:"h-8 w-full"}),s.jsx(wt,{className:"h-8 w-full"}),s.jsx(wt,{className:"h-8 w-2/3"})]}):t.state==="failed"?s.jsx(ox,{what:"related work",again:"Read related work again",refusal:t.refusal,on_retry:a}):s.jsx(_t,{className:"overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Related",className:r?"table-fixed":void 0,children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{className:r?"w-[14%]":void 0,children:"Kind"}),s.jsx(F,{className:r?"w-[45%]":void 0,children:"Item"}),s.jsx(F,{className:r?"w-[41%]":void 0,children:"How it relates"})]})}),s.jsx(Fe,{children:t.data.map(i=>s.jsxs(ce,{children:[s.jsx(q,{children:ND[i.kind]}),s.jsx(q,{className:r?"break-words":void 0,children:l(i)}),s.jsx(q,{className:r?"break-words":void 0,children:i.relation})]},`${i.kind}:${i.planned?"planned:":""}${i.id}`))})]})})})}function $D({org:e,task_id:t,from:n}){const a=Do(),l=`/org/${e}/tasks`;return a.taskSections?s.jsx(SD,{org:e,task_id:t,from:n??null}):s.jsx(DD,{task_id:t,back:l})}function DD({task_id:e,back:t}){const{availability:n}=Do(),[a,l]=u.useState({state:"loading"});return u.useEffect(()=>{let r=!0;return n().then(i=>{r&&l(i)}),()=>{r=!1}},[n]),a.state==="off"?s.jsx(Cu,{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(vD,{active:a,task_id:e,back:t}):a.state==="error"?s.jsxs(xe,{variant:"destructive",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This task could not be loaded"}),s.jsx(ge,{children:"Check your connection and try again."})]}):a.state==="available"?s.jsx(Cu,{back:t}):s.jsx(ix,{})})}function Qn({children:e}){return s.jsx("p",{role:"alert",className:"text-destructive text-sm",children:e})}const zD=["open","triaged","resolved","closed"],cx=["low","normal","high","urgent"],LD=["fixed","works_as_intended","planned","duplicate","wont_fix","cannot_reproduce"],UD=["title","description","external_reference"],Ru={open:"Open",triaged:"Triaged",escalated:"Escalated",waiting_on_fix:"Waiting on fix",resolved:"Resolved",closed:"Closed"},Sk={open:"warning",triaged:"info",escalated:"info",waiting_on_fix:"info",resolved:"success",closed:"neutral"},eo={low:"Low",normal:"Normal",high:"High",urgent:"Urgent"},ux={fixed:"Fixed",works_as_intended:"Works as intended",planned:"Planned",duplicate:"Duplicate",wont_fix:"Won't fix",cannot_reproduce:"Cannot reproduce"},Ck={title:"Title",description:"Description",external_reference:"External reference"},BD=[["year",365*24*3600],["month",30*24*3600],["week",7*24*3600],["day",24*3600],["hour",3600],["minute",60]];function $c(e,t=Date.now()){const n=Math.round((new Date(e).getTime()-t)/1e3),a=new Intl.RelativeTimeFormat("en",{numeric:"auto"});for(const[l,r]of BD)if(Math.abs(n)>=r)return a.format(Math.round(n/r),l);return"just now"}function im(e,t,n){const a=`/org/${encodeURIComponent(e)}/proj/${encodeURIComponent(t)}/support`;return n?`${a}/${encodeURIComponent(n)}`:a}function dx(e,t){return e?t??"Not available":"A former member"}const HD="the issue integration";function ID(e){return!e.created_by&&e.reporter_kind==="customer"?HD:dx(e.created_by,e.created_by_username)}function PD(e,t){return!e.actor_id&&e.kind==="created"&&t.reporter_kind==="customer"?"The issue integration":dx(e.actor_id,e.actor_username)}const dc="not_set",qD="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 GD({create:e,open:t,onOpenChange:n,onCreated:a}){const[l,r]=u.useState(""),[i,o]=u.useState(""),[c,d]=u.useState(!1),[f,h]=u.useState(""),[m,x]=u.useState(dc),[j,v]=u.useState(!1),[y,g]=u.useState(null),p=u.useRef(null),b=()=>{r(""),o(""),d(!1),h(""),x(dc),g(null),p.current=null},w=_=>{var k;return((k=y==null?void 0:y.personal_data)==null?void 0:k.field)===_?y.message:void 0},N=async _=>{if(_.preventDefault(),j)return;v(!0),p.current??(p.current=crypto.randomUUID());const k=await e({request_id:p.current,title:i.trim()||void 0,description:f||void 0,external_reference:l.trim()||void 0,priority:m===dc?null:m});if(v(!1),!k.ok){k.refusal.status!==0&&(p.current=null),g(k.refusal);return}b(),a(k.data.issue,k.data.duplicates)},R=y&&!y.personal_data?y.message:void 0;return s.jsx(Hn,{open:t,onOpenChange:_=>{_||b(),n(_)},children:s.jsx(In,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:N,className:"grid gap-4",children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:"New support issue"}),s.jsx(Vn,{children:"Log one help-desk report. Text is shown exactly as entered."})]}),s.jsxs(xe,{variant:"warning",children:[s.jsx(rn,{}),s.jsx(ge,{children:qD})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"maintain-issue-reference",children:"External reference"}),s.jsx(Tt,{id:"maintain-issue-reference",value:l,"aria-invalid":!!w("external_reference"),onChange:_=>{r(_.target.value),c||o(_.target.value)}}),w("external_reference")?s.jsx(Qn,{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(Ue,{htmlFor:"maintain-issue-title",children:"Title"}),s.jsx(Tt,{id:"maintain-issue-title",value:i,"aria-invalid":!!w("title"),onChange:_=>{o(_.target.value),d(!0)}}),w("title")?s.jsx(Qn,{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(Ue,{htmlFor:"maintain-issue-description",children:"Description"}),s.jsx(is,{id:"maintain-issue-description",rows:4,placeholder:"What the end user reported, without personal data",value:f,"aria-invalid":!!w("description"),onChange:_=>h(_.target.value)}),w("description")?s.jsx(Qn,{children:w("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"maintain-issue-priority",children:"Priority"}),s.jsxs(xt,{value:m,onValueChange:x,children:[s.jsx(dt,{id:"maintain-issue-priority",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:dc,children:"Not set"}),cx.map(_=>s.jsx(Ee,{value:_,children:eo[_]},_))]})]})]}),R?s.jsx(Qn,{children:R}):null,s.jsxs(qn,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>{b(),n(!1)},children:"Cancel"}),s.jsx(G,{type:"submit",loading:j,disabled:!i.trim()&&!l.trim(),children:"Log issue"})]})]})})})}const VD=["supportAccess","assigneeCandidates","create","update","assign","transition","redact"];function Rk(){return YD(cn().issues)}function YD(e){return e&&VD.every(t=>typeof e[t]=="function")?e:null}function Tk(e){const[t,n]=u.useState(null);return u.useEffect(()=>{if(!e)return;let a=!1;return e.supportAccess().then(l=>{a||n({contract:e,state:l.ok?{state:"ready",access:l.data}:{state:"error"}})}),()=>{a=!0}},[e]),t&&e&&t.contract===e?t.state:{state:"loading"}}function Ek({access:e,header:t,back_href:n,children:a}){const{href:l,Link:r}=We();return e.state==="loading"?s.jsxs("div",{className:"flex flex-1 items-center justify-center py-24",children:[s.jsx(_n,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Loading…"})]}):e.state==="error"||!e.access.enabled?s.jsx(Ha,{title:"Page not found",description:"This page does not exist or you do not have access to it.",backHref:l(n),backLabel:"Back to the project",link:r}):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(YR,{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 FD(){const e=We();return t=>{e.navigate?e.navigate(t):window.location.assign(e.href(t))}}const hn="all",fc=25;function om({action:e}){return s.jsx(Zt,{title:"Support",description:"Help-desk reports logged against this project.",actions:e})}function KD({org:e,project:t,query:n}){const a=Rk(),l=Tk(a),r=`/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(Ek,{access:l,header:s.jsx(om,{}),back_href:r,children:i=>a?s.jsx(XD,{contract:a,access:i,org_name:e,proj_name:t,query:n}):null})})}function XD({contract:e,access:t,org_name:n,proj_name:a,query:l}){const{href:r,Link:i}=We(),o=FD(),[c,d]=u.useState(()=>new URLSearchParams(l).get("external_reference")??""),[f,h]=u.useState(hn),[m,x]=u.useState(hn),[j,v]=u.useState(hn),[y,g]=u.useState(0),[p,b]=u.useState(null),[w,N]=u.useState(0),[R,_]=u.useState(null),[k,U]=u.useState([]),[z,K]=u.useState(!1),V=c.trim()!==""||f!==hn||m!==hn||j!==hn,L=u.useCallback(async()=>{const C=await e.list({external_reference:c.trim()||void 0,status:f===hn?void 0:f,priority:m===hn?void 0:m,assignee:j===hn?void 0:j,limit:fc,offset:y*fc});if(!C.ok){_(C.refusal.message);return}_(null),b(C.data.issues),N(C.data.total)},[e,c,f,m,j,y]);u.useEffect(()=>{const C=setTimeout(()=>void L(),200);return()=>clearTimeout(C)},[L]),u.useEffect(()=>{e.assigneeCandidates().then(C=>{C.ok&&U(C.data.candidates)})},[e]);const M=t.can_change?s.jsxs(G,{onClick:()=>K(!0),children:[s.jsx(br,{className:"mr-2 size-4"}),"New issue"]}):void 0,A=s.jsx(GD,{create:e.create,open:z,onOpenChange:K,onCreated:(C,$)=>{K(!1);const X=im(n,a,C.id);o($.length?`${X}?duplicates=${$.length}`:X)}});if(p!==null&&w===0&&!V&&y===0)return s.jsxs(s.Fragment,{children:[s.jsx(om,{}),s.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[s.jsx(HR,{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(G,{onClick:()=>K(!0),children:[s.jsx(br,{className:"mr-2 size-4"}),"Log the first issue"]}):null]}),A]});const S=w===0?0:y*fc+1,E=Math.min(w,(y+1)*fc);return s.jsxs(s.Fragment,{children:[s.jsx(om,{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(cT,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2","aria-hidden":!0}),s.jsx(Tt,{"aria-label":"Filter by external reference",placeholder:"Filter by external reference",className:"pl-9",value:c,onChange:C=>{d(C.target.value),g(0)}})]}),s.jsx(Df,{label:"Status",value:f,onChange:C=>{h(C),g(0)},options:zD.map(C=>({value:C,label:Ru[C]}))}),s.jsx(Df,{label:"Priority",value:m,onChange:C=>{x(C),g(0)},options:cx.map(C=>({value:C,label:eo[C]}))}),s.jsx(Df,{label:"Assignee",value:j,onChange:C=>{v(C),g(0)},options:[{value:"unassigned",label:"Unassigned"},{value:"cannot_act",label:"Assignee cannot act"},...k.map(C=>({value:C.user_id,label:C.username??"Not available"}))]})]}),R?s.jsx(Qn,{children:R}):null,s.jsx("div",{className:"rounded-md border",children:s.jsxs(Ye,{children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Title"}),s.jsx(F,{children:"External reference"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Priority"}),s.jsx(F,{children:"Assignee"}),s.jsx(F,{children:"Updated"})]})}),s.jsx(Fe,{children:p===null?s.jsx(ce,{children:s.jsx(q,{colSpan:6,className:"h-24 text-center",children:"Loading…"})}):p.length===0?s.jsx(ce,{children:s.jsx(q,{colSpan:6,className:"h-24 text-center",children:"No issues match these filters."})}):p.map(C=>s.jsxs(ce,{children:[s.jsx(q,{className:"max-w-md",children:s.jsx(i,{href:r(im(n,a,C.id)),className:"font-medium hover:underline",children:C.title})}),s.jsx(q,{className:"font-mono text-xs",children:C.external_reference??""}),s.jsx(q,{children:s.jsx(me,{variant:Sk[C.status],children:Ru[C.status]})}),s.jsx(q,{children:C.priority?eo[C.priority]:""}),s.jsx(q,{children:s.jsx(QD,{issue:C})}),s.jsx(q,{className:"text-muted-foreground",children:$c(C.updated_at)})]},C.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 ${S}–${E} of ${w} issue${w===1?"":"s"}.`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(G,{variant:"outline",size:"sm",disabled:y===0,onClick:()=>g(C=>Math.max(0,C-1)),children:"Previous"}),s.jsx(G,{variant:"outline",size:"sm",disabled:E>=w,onClick:()=>g(C=>C+1),children:"Next"})]})]}),A]})}function QD({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(me,{variant:"error",children:"Assignee cannot act"}):null]}):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}function Df({label:e,value:t,onChange:n,options:a}){var r;const l=u.useMemo(()=>t===hn||a.some(i=>i.value===t),[a,t]);return s.jsxs(xt,{value:l?t:hn,onValueChange:n,children:[s.jsx(dt,{className:"w-44","aria-label":e,children:s.jsx(gt,{placeholder:e,children:t===hn?e:(r=a.find(i=>i.value===t))==null?void 0:r.label})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:hn,children:"All"}),a.map(i=>s.jsx(Ee,{value:i.value,children:i.label},i.value))]})]})}const Ak=[{key:"local",label:"Local"},{key:"staging",label:"Staging"},{key:"production",label:"Production"}],ZD=/^iss-\d{1,9}$/,WD=/^col-\d{1,9}$/,JD=e=>e&&e[0].toUpperCase()+e.slice(1);function Mk(e){const t=JD(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 Mi(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 cm={search:"",owner:null,urgent:!1,seen:[],label:null,collection:null};function Dc(e){const t=new URLSearchParams(e),n=t.getAll("seen").filter(l=>Ak.some(r=>r.key===l)),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&&WD.test(a)?a:null}}function Xl(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 e3(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 Uv=e=>!!(e.search.trim()||e.owner||e.urgent||e.seen.length||e.label||e.collection),t3={agent:"Filed by an agent",user:"Filed by you",tool:"Filed by a tool"},n3={graph:"Placed on the graph by its anchors",files:"Placed by its files",unplaced:"Triaged, not placed yet"},s3={handoff:"Handed to its owner",backlog:"Sent to the unowned backlog",batch:"Routed to a batch"};function a3(e,t=""){const n=(e??t).trim();if(!n)return"";const a=n.indexOf(": "),l=(a===-1?n:n.slice(0,a)).trim(),r=a===-1?"":n.slice(a+2).trim(),i=o=>r?`${o} ${r}`:o;switch(l){case"filed":return t3[r]??i("Filed by");case"labelled":return i("Labelled");case"unlabelled":return r?`Label removed: ${r}`:"Label removed";case"anchored":return r?`Anchored to ${r}`:"Anchored";case"triaged":return n3[r]??(r?`Triaged: ${r}`:"Triaged");case"routed":return s3[r]??(r?`Routed: ${r}`:"Routed");case"route closed":return r==="backlog"?"Taken off the unowned backlog":r?`Route closed: ${r}`:"Route closed";case"released":return r?`Released by its owner (task ${r})`:"Released by its owner";case"resolved":return r==="duplicate"?"Resolved as a duplicate":r?`Resolved · ${r.replace(/_/g," ")}`:"Resolved";case"reopened":return r?`Reopened: ${r}`:"Reopened";case"fix landed":return r?`Fix landed in ${r.slice(0,10)}`:"Fix landed";case"merged":return r?`Merged ${r} into this issue`:"Merged a duplicate into this issue";default:return n}}const l3=e=>e.replace(/`+/g,"").replace(/\s+/g," ").trim(),Ok="This page only reads issues",$k="File, route and resolve issues with the issue command or through the thread working on them.",r3=10,i3=250,El="__all",o3="none",c3=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function Dk(){const e=cn().issues;if(!e)throw new Error("The Issues page rendered without the issues seam.");return e}const u3=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 d3({project:e,query:t,onQuery:n}){var Q;const a=Dk(),{href:l,Link:r}=We(),i=u.useMemo(()=>Dc(t),[t]),o=Xl(i),c=Uv(i),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState(null),[x,j]=u.useState(null),v=u.useRef(0),y=u.useRef(0),g=u.useRef(null),p=u.useRef(null),b=ls(),w=u.useRef(!1),[N,R]=u.useState(i.search),_=u.useCallback(O=>n(Xl({...i,...O})),[i,n]),k=u.useCallback(async()=>{const O=y.current+=1;j(null);const H=await a.list(e3(Dc(o)));if(O!==y.current)return;if(H.ok){v.current=0,m(null),f({state:"ok",list:H.data,local:H.data.local??u3(new Date().toISOString()),key:o});return}const te=H.refusal.reason;if(te==="engine_missing")return f({state:"engine_missing",refusal:H.refusal});if(te==="view_outdated")return f({state:"view_outdated"});if(v.current+=1,v.current===1&&c3(H.refusal)){j(H.refusal.retry_after??r3);return}m(H.refusal)},[a.list,o]);u.useEffect(()=>{k()},[k]),u.useEffect(()=>{if(x===null)return;const O=setTimeout(()=>void k(),x*1e3);return()=>clearTimeout(O)},[x,k]),u.useEffect(()=>{document.activeElement!==g.current&&R(i.search)},[i.search]),u.useEffect(()=>{if(N===i.search)return;const O=setTimeout(()=>_({search:N}),i3);return()=>clearTimeout(O)},[N,i.search,_]),u.useEffect(()=>{const O=H=>{if(H.key!=="/"||H.metaKey||H.ctrlKey||H.altKey)return;const te=H.target;te&&(te.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(te.tagName))||g.current&&(H.preventDefault(),g.current.focus())};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[]);const U=()=>{var O;R(""),n(Xl(cm)),(O=g.current)==null||O.focus()},z=()=>{v.current=0,k()},K=()=>{w.current=!0,z()};u.useEffect(()=>{var H;if(!w.current||d.state==="loading"||x!==null)return;w.current=!1;const O=(H=p.current)==null?void 0:H.querySelector("h1");O&&(O.tabIndex=-1,O.focus())},[d,h,x]);const V=O=>`/proj/${encodeURIComponent(e)}/issues${O?`?${O}`:""}`,L=O=>`/proj/${encodeURIComponent(e)}/issues/${encodeURIComponent(O)}?from=issues${o?`&${o}`:""}`,M=s.jsx("div",{role:"status","aria-live":"polite",children:x!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(_n,{"aria-hidden":"true"}),"Issues are busy. Reading them again…"]}):null}),A=h?s.jsxs(xe,{variant:"destructive",className:"mt-4",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Issues could not be loaded"}),s.jsxs(ge,{children:[s.jsxs("p",{children:[h.message,h.since?` Since ${Jn(h.since)}.`:"",d.state==="ok"?` The list below was read at ${Jn(d.local.read_at)}.`:"",h.message.includes(cl)?"":` ${cl}`]}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:K,children:"Retry"})]})]}):null,S=s.jsx(Zt,{title:"Issues",description:"This repository's local issues: what agents and you reported, where triage placed each, and what fixes it.",actions:d.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 ",Jn(d.local.read_at)]}),s.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:z,children:[s.jsx(yl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]}):null});if(d.state==="engine_missing")return s.jsx(hc,{ref:p,children:s.jsx(Zs,{page:"Issues"})});if(d.state==="view_outdated")return s.jsxs(hc,{ref:p,children:[S,s.jsxs(xe,{variant:"warning",className:"mt-6",children:[s.jsx(rn,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:$r}),s.jsx(ge,{children:b})]})]});if(d.state==="loading")return s.jsxs(hc,{ref:p,children:[S,M,A,!h&&x===null?s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading issues",children:Array.from({length:6},(O,H)=>s.jsx(wt,{className:H===5?"h-10 w-2/3":"h-10 w-full"},H))}):null]});const{list:E,local:C}=d,$=!h&&x===null&&(d.key!==o||N!==i.search),X=Uv(Dc(d.key)),T=C.scope==="folder",P=C.listed===0&&!c,J=Math.max(0,C.listed-C.facets.owners.reduce((O,H)=>O+H.count,0)),ee=i.collection?((Q=C.collections.find(O=>O.collection===i.collection))==null?void 0:Q.title)??i.collection:null,ve=new Map;for(const O of E.issues){const H=O.group??"unplaced";ve.set(H,[...ve.get(H)??[],O])}return s.jsxs(hc,{ref:p,children:[S,T&&C.folder?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Issues of the folder ",C.folder,", from its issue store."]}):null,s.jsxs(xe,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:Ok}),s.jsx(ge,{children:$k})]}),M,A,P?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(DR,{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(Tt,{ref:g,type:"search",className:"w-64","aria-label":"Search issues",placeholder:"Search issues",value:N,onChange:O=>R(O.target.value)}),s.jsxs(xt,{value:i.owner??El,onValueChange:O=>_({owner:O===El?null:O}),children:[s.jsx(dt,{className:"w-56","aria-label":"Owner",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:El,children:"All owners"}),s.jsxs(Ee,{value:o3,children:["Unowned (",J,")"]}),C.facets.owners.map(O=>s.jsxs(Ee,{value:O.key,children:[O.title," (",O.count,")"]},O.key))]})]}),s.jsxs(xt,{value:i.label??El,onValueChange:O=>_({label:O===El?null:O}),children:[s.jsx(dt,{className:"w-48","aria-label":"Label",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:El,children:"All labels"}),C.facets.labels.map(O=>s.jsxs(Ee,{value:O.label,children:[O.label," (",O.count,")"]},O.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(G,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":i.urgent,onClick:()=>_({urgent:!i.urgent}),children:["Urgent ",C.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"}),Ak.map(O=>{const H=i.seen.includes(O.key);return s.jsxs(G,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":H,onClick:()=>_({seen:H?i.seen.filter(te=>te!==O.key):[...i.seen,O.key]}),children:[O.label," ",C.facets.seen[O.key]]},O.key)}),ee!==null?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsxs("span",{"data-testid":"issues-collection-chip",className:le(dd({variant:"outline",size:"sm"}),YA),children:["Collection ",ee]}),s.jsx(G,{type:"button",variant:"ghost",size:"sm-icon","aria-label":"Remove the collection filter",onClick:()=>{var O;_({collection:null}),(O=g.current)==null||O.focus()},children:s.jsx(ad,{className:"size-4","aria-hidden":"true"})})]}):null]})]}),s.jsx("div",{role:"status","aria-live":"polite",children:$?s.jsxs("p",{className:"text-muted-foreground mt-3 flex items-center gap-2 text-sm",children:[s.jsx(_n,{"aria-hidden":"true"}),"Searching…"]}):c&&E.total>0?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:[E.total," of ",C.listed," issues ·"," ",s.jsx(G,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:U,children:"Clear"})]}):null}),s.jsx("div",{"data-testid":"issues-results","aria-busy":$||void 0,className:"shrink-0 transition-opacity aria-busy:opacity-50",children:X&&E.total===0?s.jsxs("p",{className:"mt-6 flex items-center gap-2 text-sm",children:[s.jsx(sd,{className:"text-muted-foreground size-4","aria-hidden":"true"}),"No issues match."," ",s.jsx(G,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:U,children:"Clear"})]}):C.groups.map(O=>s.jsx(f3,{id:`issues-${O.key}`,title:`${O.label} · ${O.count}`,issues:ve.get(O.key)??[],folder:T,link:H=>s.jsx(r,{className:"text-primary hover:underline",href:l(L(H.id)),children:H.title})},O.key))}),!c&&C.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 · ",C.collections.length]}),s.jsx(_t,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Collections",className:"table-fixed",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{className:"w-1/2",children:"Collection"}),s.jsx(F,{className:"w-1/4",children:"Resolved"}),s.jsx(F,{className:"w-1/4",children:"Updated"})]})}),s.jsx(Fe,{children:C.collections.map(O=>s.jsxs(ce,{children:[s.jsxs(q,{children:[s.jsx(r,{className:"text-primary hover:underline",href:l(V(Xl({...cm,collection:O.collection}))),children:O.title}),s.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:O.collection})]}),s.jsxs(q,{children:[O.resolved," of ",O.total," resolved"]}),s.jsx(q,{className:"text-muted-foreground",children:Mi(O.updated_at)})]},O.collection))})]})})]}):null]})]})}const hc=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})});function f3({id:e,title:t,issues:n,folder:a,link:l}){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(_t,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:t,className:"table-fixed",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{className:a?"w-[30%]":"w-[36%]",children:"Title"}),s.jsx(F,{className:"w-[10%]",children:"Issue"}),a?s.jsx(F,{className:"w-[12%]",children:"Project"}):null,s.jsx(F,{className:"w-[16%]",children:"Status"}),s.jsx(F,{className:"w-[8%]",children:"Urgent"}),s.jsx(F,{className:a?"w-[14%]":"w-[18%]",children:"Owner"}),s.jsx(F,{className:"w-[12%]",children:"Updated"})]})}),s.jsx(Fe,{children:n.map(r=>{var o;const i=Mk(r);return s.jsxs(ce,{"data-testid":"issues-row",children:[s.jsxs(q,{className:"break-words",children:[l(r),(o=r.labels)!=null&&o.length?s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:r.labels.map(c=>s.jsx(me,{variant:"neutral",size:"dense",children:c},c))}):null]}),s.jsx(q,{className:"font-mono text-xs",children:r.id}),a?s.jsx(q,{className:"break-words",children:r.project_id??"Folder"}):null,s.jsx(q,{children:s.jsx(me,{variant:i.tone,children:i.label})}),s.jsx(q,{children:r.urgent&&r.status!=="resolved"&&r.group!=="resolved"?s.jsx(me,{variant:"warning",children:"Urgent"}):null}),s.jsx(q,{className:"break-words",children:r.owner_title?r.owner_title:s.jsx("span",{className:"text-muted-foreground",children:"Unowned"})}),s.jsx(q,{className:"text-muted-foreground",children:Mi(r.updated_at)})]},r.id)})})]})})]})}function h3(e){var t;return(t=cn().issues)!=null&&t.issueSections?s.jsx(d3,{...e}):s.jsx(KD,{org:e.org,project:e.project,query:e.query})}function m3({update:e,issue:t,open:n,onOpenChange:a,onDone:l,onReload:r}){const[i,o]=u.useState(t.title),[c,d]=u.useState(t.description),[f,h]=u.useState(t.external_reference??""),[m,x]=u.useState(t),[j,v]=u.useState(null),[y,g]=u.useState(!1);u.useEffect(()=>{n&&(o(t.title),d(t.description),h(t.external_reference??""),x(t),v(null))},[n]);const p=N=>{var R;return((R=j==null?void 0:j.personal_data)==null?void 0:R.field)===N?j.message:void 0},b=async N=>{N.preventDefault(),g(!0);const R=await e(m.id,m.revision,{title:i,description:c,external_reference:f.trim()||null});if(g(!1),!R.ok){v(R.refusal);return}l(R.data.issue)},w=async()=>{const N=await r();N&&(x(N),v(null))};return s.jsx(Hn,{open:n,onOpenChange:a,children:s.jsx(In,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:b,className:"grid gap-4",children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:"Edit issue"}),s.jsx(Vn,{children:"Text is shown exactly as entered."})]}),j!=null&&j.conflict?s.jsxs(xe,{variant:"destructive",children:[s.jsx(ut,{}),s.jsx(ge,{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(Ue,{htmlFor:"maintain-edit-title",children:"Title"}),s.jsx(Tt,{id:"maintain-edit-title",value:i,"aria-invalid":!!p("title"),onChange:N=>o(N.target.value)}),p("title")?s.jsx(Qn,{children:p("title")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"maintain-edit-description",children:"Description"}),s.jsx(is,{id:"maintain-edit-description",rows:4,value:c,"aria-invalid":!!p("description"),onChange:N=>d(N.target.value)}),p("description")?s.jsx(Qn,{children:p("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"maintain-edit-reference",children:"External reference"}),s.jsx(Tt,{id:"maintain-edit-reference",value:f,"aria-invalid":!!p("external_reference"),onChange:N=>h(N.target.value)}),p("external_reference")?s.jsx(Qn,{children:p("external_reference")}):null]}),j&&!j.conflict&&!j.personal_data?s.jsx(Qn,{children:j.message}):null,s.jsxs(qn,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),j!=null&&j.conflict?s.jsxs(G,{type:"button",variant:"outline",onClick:w,children:[s.jsx(yl,{className:"mr-2 size-4"}),"Reload latest"]}):null,s.jsx(G,{type:"submit",loading:y,disabled:!!(j!=null&&j.conflict),children:"Save"})]})]})})})}function Bv(e){return e.map(t=>Ck[t].toLowerCase()).join(", ")}function p3(e){switch(e.kind){case"created":return"Logged the issue";case"updated":return`Edited the ${Bv(e.fields)}`;case"redacted":return`Redacted the ${Bv(e.fields)}`;case"priority_set":return e.priority?`Set priority to ${eo[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?Ru[e.to_status]:"";return e.resolution_reason?`Moved to ${t}: ${ux[e.resolution_reason]}`:`Moved to ${t}`}}}function Hv(e,t){return t==="external_reference"?e.external_reference??"":e[t]}function x3({redact:e,issue:t,open:n,onOpenChange:a,onDone:l,onReload:r}){const[i,o]=u.useState("description"),[c,d]=u.useState(""),[f,h]=u.useState(!1),[m,x]=u.useState(null),[j,v]=u.useState(t);u.useEffect(()=>{n&&(v(t),d(Hv(t,i)),x(null))},[n]);const y=async g=>{g.preventDefault(),h(!0);const p=await e(j.id,j.revision,i,c);if(h(!1),!p.ok){if(p.refusal.conflict){const b=await r();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}l(p.data.issue)};return s.jsx(Hn,{open:n,onOpenChange:a,children:s.jsx(In,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:y,className:"grid gap-4",children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:"Redact text"}),s.jsx(Vn,{children:"Replace text that holds personal data, such as a name."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"maintain-redact-field",children:"Field"}),s.jsxs(xt,{value:i,onValueChange:g=>{const p=g;o(p),d(Hv(j,p))},children:[s.jsx(dt,{id:"maintain-redact-field",children:s.jsx(gt,{})}),s.jsx(ft,{children:UD.map(g=>s.jsx(Ee,{value:g,children:Ck[g]},g))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"maintain-redact-replacement",children:"Replacement text"}),s.jsx(is,{id:"maintain-redact-replacement",rows:4,value:c,onChange:g=>d(g.target.value)})]}),s.jsxs(xe,{variant:"warning",children:[s.jsx(rn,{}),s.jsx(ge,{children:"This cannot be undone: the original text is removed for good. History records only that this field was redacted."})]}),m?s.jsx(Qn,{children:m}):null,s.jsxs(qn,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(G,{type:"submit",variant:"destructive",loading:f,children:"Redact"})]})]})})})}function g3({transition:e,issue:t,open:n,onOpenChange:a,onDone:l}){const[r,i]=u.useState("fixed"),[o,c]=u.useState(!1),[d,f]=u.useState(null),h=async m=>{m.preventDefault(),c(!0);const x=await e(t.id,t.revision,"resolved",r);if(c(!1),!x.ok){if(x.refusal.conflict){l(null);return}f(x.refusal.message);return}f(null),l(x.data.issue)};return s.jsx(Hn,{open:n,onOpenChange:a,children:s.jsx(In,{children:s.jsxs("form",{onSubmit:h,className:"grid gap-4",children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:"Resolve issue"}),s.jsx(Vn,{children:"Choose how this report ended."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"maintain-resolution-reason",children:"Resolution reason *"}),s.jsxs(xt,{value:r,onValueChange:m=>i(m),children:[s.jsx(dt,{id:"maintain-resolution-reason",children:s.jsx(gt,{})}),s.jsx(ft,{children:LD.map(m=>s.jsx(Ee,{value:m,children:ux[m]},m))})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Reopening the issue clears its reason."})]}),d?s.jsx(Qn,{children:d}):null,s.jsxs(qn,{children:[s.jsx(G,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(G,{type:"submit",loading:o,children:"Resolve"})]})]})})})}const Al="not_set";function v3({org:e,project:t,issue_id:n,query:a}){const l=Rk(),r=Tk(l),i=im(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(Ek,{access:r,header:s.jsx(Zt,{title:"Support"}),back_href:i,children:o=>l?s.jsx(y3,{contract:l,issue_id:n,access:o,list_href:i,duplicates:Number(new URLSearchParams(a).get("duplicates")??0)}):null})})}function y3({contract:e,issue_id:t,access:n,list_href:a,duplicates:l}){const{href:r,Link:i}=We(),o=Mr(),[c,d]=u.useState(null),[f,h]=u.useState([]),[m,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),h(_.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(k=>{if(!_){if(!k.ok){k.refusal.status===404?x(!0):o.error(k.refusal.message);return}d(k.data.issue),h(k.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 k=await _;if(!k.ok){o.error(k.refusal.message),k.refusal.conflict&&await p();return}await p()};if(m)return s.jsx(Ha,{title:"Support issue not found",description:"This issue does not exist in this project.",backHref:r(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,R=_=>b(e.transition(c.id,c.revision,_));return s.jsxs(s.Fragment,{children:[s.jsx(Zt,{title:c.title,actions:N?s.jsxs(s.Fragment,{children:[w?null:s.jsxs(G,{variant:"outline",onClick:()=>g("edit"),children:[s.jsx(nd,{className:"mr-2 size-4"}),"Edit"]}),s.jsxs(G,{variant:"outline",onClick:()=>g("redact"),children:[s.jsx(jR,{className:"mr-2 size-4"}),"Redact"]}),c.status==="open"?s.jsx(G,{variant:"outline",disabled:!c.priority,"aria-description":c.priority?void 0:"Set a priority first.",onClick:()=>void R("triaged"),children:"Triage"}):null,c.status==="open"||c.status==="triaged"?s.jsxs(G,{onClick:()=>g("resolve"),children:[s.jsx(td,{className:"mr-2 size-4"}),"Resolve"]}):null,c.status==="resolved"?s.jsxs(s.Fragment,{children:[s.jsxs(G,{variant:"outline",onClick:()=>void R("open"),children:[s.jsx(rT,{className:"mr-2 size-4"}),"Reopen"]}),s.jsx(G,{onClick:()=>void R("closed"),children:"Close"})]}):null]}):void 0,children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(me,{variant:Sk[c.status],children:Ru[c.status]}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Logged by ",ID(c)," ",$c(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:[l>0&&c.external_reference?s.jsxs(xe,{variant:"info",children:[s.jsx(Ba,{}),s.jsxs(ge,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[s.jsxs("span",{children:[c.external_reference," is already logged on"," ",l===1?"another issue":`${l} other issues`," in this project."]}),s.jsx(G,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(i,{href:r(`${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(Ye,{children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"When"}),s.jsx(F,{children:"Who"}),s.jsx(F,{children:"What"})]})}),s.jsx(Fe,{children:f.map(_=>s.jsxs(ce,{children:[s.jsx(q,{className:"text-muted-foreground",children:$c(_.created_at)}),s.jsx(q,{children:PD(_,c)}),s.jsx(q,{children:p3(_)})]},_.id))})]})})]})]}),s.jsxs("aside",{className:"flex w-full shrink-0 flex-col gap-5 lg:w-72",children:[s.jsx(si,{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(si,{label:"Resolution",children:s.jsx("span",{className:"text-sm",children:ux[c.resolution_reason]})}):null,s.jsx(si,{label:"Priority",id:"maintain-issue-priority",children:s.jsxs(xt,{value:c.priority??Al,disabled:!N||w,onValueChange:_=>void b(e.update(c.id,c.revision,{priority:_===Al?null:_})),children:[s.jsx(dt,{id:"maintain-issue-priority",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:Al,children:"Not set"}),cx.map(_=>s.jsx(Ee,{value:_,children:eo[_]},_))]})]})}),s.jsxs(si,{label:"Assignee",id:"maintain-issue-assignee",children:[s.jsxs(xt,{value:c.assignee_id??Al,disabled:!N||w,onValueChange:_=>void b(e.assign(c.id,c.revision,_===Al?null:_)),children:[s.jsx(dt,{id:"maintain-issue-assignee",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[s.jsx(Ee,{value:Al,children:"Not set"}),c.assignee_id&&!j.some(_=>_.user_id===c.assignee_id)?s.jsx(Ee,{value:c.assignee_id,children:dx(c.assignee_id,c.assignee_username)}):null,j.map(_=>s.jsx(Ee,{value:_.user_id,children:_.username??"Not available"},_.user_id))]})]}),c.assignee_can_act===!1?s.jsx(me,{variant:"error",className:"self-start",children:"Assignee cannot act"}):null]}),s.jsx(si,{label:"Updated",children:s.jsx("span",{className:"text-sm",children:$c(c.updated_at)})})]})]}),s.jsx(m3,{update:e.update,issue:c,open:y==="edit",onOpenChange:_=>g(_?"edit":null),onReload:p,onDone:()=>{g(null),p()}}),s.jsx(x3,{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(g3,{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 si({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 b3=10,j3=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,Iv=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;function w3(e,t,n,a=""){const l=n!=null&&n.startsWith("task:")?n.slice(5):null;if(l&&j3.test(l))return{label:l,path:`/org/${e}/tasks/${l}`};const r=`/proj/${encodeURIComponent(t)}/releases`,i=n!=null&&n.startsWith("release:")?n.slice(8):null;if(i&&Iv.test(i))return{label:i==="candidate"?"Candidate":i,path:`${r}?release=${encodeURIComponent(i)}`};const o=n!=null&&n.startsWith("planned:")?n.slice(8):null;if(o&&Iv.test(o))return{label:o,path:`${r}?planned=${encodeURIComponent(o)}`};const c=Xl(Dc(a));return{label:"Issues",path:`/proj/${encodeURIComponent(t)}/issues${c?`?${c}`:""}`}}const _3=["Fixed in","Being fixed in","The release planned to fix it"];function N3(e){const t=e.filter(n=>n.kind==="release");for(const n of _3){const a=t.find(l=>l.relation===n);if(a)return a}return t[0]??null}function k3({org:e,project:t,issue_id:n,from:a,query:l=""}){var Be;const r=Dk(),{href:i,Link:o}=We(),c=w3(e,t,a,l),d=`/proj/${encodeURIComponent(t)}/issues`,f=Y=>`${d}/${encodeURIComponent(Y)}`,[h,m]=u.useState({state:"loading"}),[x,j]=u.useState(null),[v,y]=u.useState(null),[g,p]=u.useState({state:"loading"}),[b,w]=u.useState({state:"loading"}),N=u.useRef(null),R=ls(),_=u.useRef(null),k=u.useRef(!1),U=u.useRef(0),z=u.useRef(0),K=u.useCallback(async()=>{if(!r.issueSections)return;p({state:"loading"});const Y=await r.issueSections(n);p(Y.ok?{state:"ok",data:Y.data}:{state:"failed",refusal:Y.refusal})},[r.issueSections,n]),V=u.useCallback(async()=>{if(!r.issueRelated)return;w({state:"loading"});const Y=await r.issueRelated(n);w(Y.ok?{state:"ok",data:Y.data}:{state:"failed",refusal:Y.refusal})},[r.issueRelated,n]),L=u.useCallback(async()=>{const Y=z.current+=1;if(y(null),!ZD.test(n)){m({state:"missing"});return}K(),V();const Re=await r.issue(n);if(Y!==z.current)return;if(Re.ok){U.current=0,j(null),m({state:"ok",issue:Re.data.issue,events:Re.data.events,at:new Date().toISOString()});return}const Le=Re.refusal.reason;if(Re.refusal.status===404||Le==="not_found")return m({state:"missing"});if(Le==="engine_missing")return m({state:"engine_missing",refusal:Re.refusal});if(Le==="view_outdated")return m({state:"view_outdated"});if(U.current+=1,U.current===1&&Nk(Re.refusal)){y(Re.refusal.retry_after??b3);return}j(Re.refusal)},[r.issue,n,K,V]);u.useEffect(()=>{L()},[L]),u.useEffect(()=>{if(v===null)return;const Y=setTimeout(()=>void L(),v*1e3);return()=>clearTimeout(Y)},[v,L]),u.useEffect(()=>{var Re;if(k.current||h.state!=="ok")return;k.current=!0;const Y=(Re=N.current)==null?void 0:Re.querySelector("h1");Y&&(Y.tabIndex=-1,Y.focus())},[h.state]);const M=u.useRef(null);u.useEffect(()=>{var Le;const Y=M.current;if(Y===null||(Y==="sections"?g:b).state==="loading")return;M.current=null;const Re=(Y==="related"?_.current:null)??((Le=N.current)==null?void 0:Le.querySelector("h1"));Re==null||Re.focus()},[g,b]);const A=Y=>{M.current=Y,Y==="sections"?K():V()},S=()=>{U.current=0,L()},E=u.useRef(!1),C=()=>{E.current=!0,S()};if(u.useEffect(()=>{var Re;if(!E.current||h.state==="loading"||v!==null)return;E.current=!1;const Y=(Re=N.current)==null?void 0:Re.querySelector("h1");Y&&(Y.tabIndex=-1,Y.focus())},[h,x,v]),h.state==="missing")return s.jsx(ba,{children:s.jsx(Ha,{icon:s.jsx(sd,{"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 $=s.jsx(G,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(o,{href:i(c.path),children:[s.jsx(g0,{className:"size-4","aria-hidden":"true"}),c.label]})});if(h.state==="engine_missing"||h.state==="view_outdated")return s.jsx(ba,{children:h.state==="engine_missing"?s.jsx(Zs,{page:"Issue",header:s.jsx(Ai,{back:$,id:null,title:n})}):s.jsxs(s.Fragment,{children:[s.jsx(Ai,{back:$,id:null,title:n}),s.jsxs(xe,{variant:"warning",className:"mt-4",children:[s.jsx(rn,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:$r}),s.jsx(ge,{children:R})]})]})});const X=x?s.jsxs(xe,{variant:"destructive",className:"mt-4",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This issue could not be loaded"}),s.jsxs(ge,{children:[s.jsxs("p",{children:[x.message,x.since?` Since ${Jn(x.since)}.`:"",h.state==="ok"?` This page was read at ${Jn(h.at)}.`:"",x.message.includes(cl)?"":` ${cl}`]}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:C,children:"Retry"})]})]}):null,T=s.jsx("div",{role:"status","aria-live":"polite",children:v!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(_n,{"aria-hidden":"true"}),"This issue is busy. Reading it again…"]}):null});if(h.state==="loading")return s.jsxs(ba,{children:[s.jsx("div",{children:$}),T,X,!x&&v===null?s.jsxs("div",{className:"mt-4 grid gap-3",role:"status","aria-label":"Loading issue",children:[s.jsx(wt,{className:"h-6 w-40"}),s.jsx(wt,{className:"h-9 w-2/3"}),s.jsx(wt,{className:"h-24 w-full"})]}):null]});const{issue:P,events:J,at:ee}=h,ve=Mk(P),Q=g.state==="ok"?g.data:null,O=(Q==null?void 0:Q.reporter)??P.created_by_username??null,H=b.state==="ok"?N3(b.data):null,te=P.status==="resolved"||P.group==="resolved",re=!!(Q!=null&&Q.duplicate_of),ye=g.state==="loading"?"Loading…":(Q==null?void 0:Q.routing.owner)??P.owner_title??s.jsx("span",{className:"text-muted-foreground",children:"Unowned"}),ae=Y=>`${d}?${Xl({...cm,collection:Y})}`,je=Q==null?void 0:Q.report,ne=!!(je&&(je.actual||je.expected||je.steps.length||je.where)),at=[...J].reverse(),ue=s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[s.jsxs("span",{className:"text-muted-foreground text-sm",children:["Read at ",Jn(ee)]}),s.jsxs(G,{type:"button",variant:"ghost",size:"sm",onClick:S,children:[s.jsx(yl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsx(ba,{children:s.jsxs("div",{ref:N,className:"contents",children:[s.jsx(Ai,{back:$,id:P.id,badge:s.jsxs(s.Fragment,{children:[s.jsx(me,{variant:ve.tone,children:ve.label}),P.urgent&&!te?s.jsx(me,{variant:"warning",children:"Urgent"}):null]}),title:P.title,created:`Reported${O?` by ${O}`:""} · ${Mi(P.created_at)}`,actions:ue}),Q!=null&&Q.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(Q.duplicate_of)),children:Q.duplicate_of})]}):null,T,X,g.state==="loading"?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",role:"status",children:[s.jsx(_n,{"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(xs,{label:"Owner",value:ye}),re?null:s.jsx(xs,{label:"Release",value:b.state==="loading"?"Loading…":H?s.jsx("span",{className:le(H.label===H.id&&"font-mono"),children:H.label}):s.jsx("span",{className:"text-muted-foreground",children:"No release yet"})}),s.jsx(xs,{label:"Reported",value:[O,P.created_at?Dn(P.created_at):null].filter(Boolean).join(" · ")})]}),s.jsxs(xe,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:Ok}),s.jsx(ge,{children:$k})]}),g.state==="failed"?s.jsx("div",{className:"mt-6",children:s.jsx(ox,{what:"this issue's sections",again:"Read the issue again",refusal:g.refusal,on_retry:()=>A("sections")})}):null,Q&&ne&&je?s.jsxs(St,{id:"issue-report",title:"What happens",children:[je.actual?s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:je.actual}):null,je.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:je.expected})]}):null,je.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:je.steps.map((Y,Re)=>s.jsx("li",{children:Y},Re))})]}):null,(Be=je.where)!=null&&Be.env?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:["Seen on ",je.where.env,je.where.sha?s.jsxs(s.Fragment,{children:[" ","at ",s.jsx("span",{className:"font-mono",children:je.where.sha})]}):null]}):null]}):null,Q&&(Q.placement.placed||Q.placement.unplaced_why)?s.jsx(St,{id:"issue-placement",title:"Placement",children:Q.placement.placed?s.jsxs("p",{className:"text-sm",children:["Placed in ",Q.placement.placed]}):s.jsxs(xe,{variant:"warning",children:[s.jsx(rn,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Not placed yet: ",Q.placement.unplaced_why]})]})}):null,Q&&(Q.routing.route||Q.routing.owner||Q.routing.none)?s.jsxs(St,{id:"issue-routing",title:"Routing",children:[Q.routing.route?s.jsx("p",{className:"text-sm",children:Q.routing.route}):null,Q.routing.owner?s.jsxs("p",{className:"text-sm",children:["Owner: ",Q.routing.owner]}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"Owner: none yet"})]}):null,Q&&(Q.labels.length>0||Q.collections.length>0)?s.jsxs(St,{id:"issue-labels",title:"Labels and collections",children:[Q.labels.length?s.jsx("div",{className:"flex flex-wrap gap-1",children:Q.labels.map(Y=>s.jsx(me,{variant:"neutral",size:"dense",children:Y},Y))}):null,Q.collections.length?s.jsx("ul",{className:"mt-2 grid gap-1 text-sm",children:Q.collections.map(Y=>s.jsxs("li",{children:[s.jsx(o,{className:"text-primary hover:underline",href:i(ae(Y.collection)),children:Y.title}),Y.ref?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",Y.ref]}):null,s.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",Y.resolved," of ",Y.total," resolved"]})]},Y.collection))}):null]}):null,Q&&Q.anchors.length>0?s.jsx(St,{id:"issue-anchors",title:"Anchors",children:s.jsx(zf,{label:"Anchors",heads:["Kind","Value","By"],rows:Q.anchors.map(Y=>[Y.kind,s.jsx("span",{className:"font-mono text-xs break-all",children:Y.value}),Y.by??""])})}):null,Q&&Q.seen.length>0?s.jsx(St,{id:"issue-seen",title:"Seen",aside:`${Q.seen.length} of ${Math.max(P.occurrences??0,Q.seen.length)} sightings`,children:s.jsx(zf,{label:"Seen",heads:["When","Where","Who","Note"],rows:Q.seen.map(Y=>[Mi(Y.at),s.jsxs(s.Fragment,{children:[Y.sha?s.jsx("div",{className:"font-mono text-xs",children:Y.sha}):null,Y.env?s.jsx("div",{className:"text-muted-foreground text-xs",children:Y.env}):null]}),Y.who??"",Y.note??""])})}):null,at.length>0?s.jsx(St,{id:"issue-history",title:"History",aside:"From the issue store, newest first",children:s.jsx(zf,{label:"History",heads:["When","Who","What"],rows:at.map(Y=>[Mi(Y.created_at),Y.actor_username??"",a3(Y.note,Y.kind)])})}):null,s.jsx(kk,{id:"issue-related",related:b,heading_ref:_,on_retry:()=>A("related"),fixed:!0,link:Y=>{const Re=Y.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(Y.id)}`:Y.kind==="task"?`/org/${e}/tasks/${encodeURIComponent(Y.id)}?from=issue:${P.id}`:Y.kind==="issue"?f(Y.id):Y.kind==="release"?`/proj/${encodeURIComponent(t)}/releases?${Y.planned?"planned":"release"}=${encodeURIComponent(Y.id)}`:null;if(Y.kind==="task"&&Re){const Le=l3(Y.label);return s.jsxs("div",{className:"min-w-0",children:[s.jsx(o,{className:"text-primary font-mono text-xs hover:underline",href:i(Re),children:Y.id}),Le&&Le!==Y.id?s.jsx("div",{className:"text-muted-foreground line-clamp-1 text-xs",title:Le,"data-testid":"related-task-title",children:Le}):null]})}return Re?s.jsx(o,{className:le("text-primary hover:underline",Y.kind!=="thread"&&Y.label===Y.id&&"font-mono"),href:i(Re),children:Y.label}):Y.label}})]})})}function zf({label:e,heads:t,rows:n}){return s.jsx(_t,{className:"overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:e,children:[s.jsx(Ze,{children:s.jsx(ce,{children:t.map(a=>s.jsx(F,{children:a},a))})}),s.jsx(Fe,{children:n.map((a,l)=>s.jsx(ce,{children:a.map((r,i)=>s.jsx(q,{className:"break-words",children:r},i))},l))})]})})}function S3({org:e,project:t,issue_id:n,from:a,query:l}){var r;return(r=cn().issues)!=null&&r.issueSections?s.jsx(k3,{org:e,project:t,issue_id:n,from:a,query:l}):s.jsx(v3,{org:e,project:t,issue_id:n,query:l})}function Tu(e,t){u.useEffect(()=>{const n=setInterval(()=>{document.visibilityState==="visible"&&e()},t),a=()=>{document.visibilityState==="visible"&&e()};return document.addEventListener("visibilitychange",a),()=>{clearInterval(n),document.removeEventListener("visibilitychange",a)}},[e,t])}const zk={integration:"Integration",deploy:"Deploy",publish:"Publish",accept:"Accept",custom:"Custom"},C3={self_service:"Self-service",managed:"Managed",manager_only:"Manager only"},R3={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"},T3={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 E3(e){return T3[e??"in_batch"]}function A3(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 Lk=(e,t)=>`Holds ${e.toLowerCase()}${t?`: ${t}`:""}`;function M3(e,t,n,a=!0){return e.fixing_since!==void 0?{label:`Fixing forward since ${Kn(e.fixing_since)}`,tone:"warning"}:e.ref===t?{label:"Landing",tone:"info"}:a&&e.hold?{label:Lk(n),tone:"info"}:{label:"Running",tone:"info"}}function Kn(e){return new Date(e*1e3).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ml(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 O3(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 $3(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 D3(e,t){var o,c;const{policy:n,management:a}=e,l=(o=e.layer)==null?void 0:o.kind,r=d=>$3(d,t),i=[["Mode",R3[a.mode]],["Who can join",r(a.joiners)]];return l==="implement"&&i.push(["Managers",r(a.managers)],["Manager lease",Ml(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 ${Ml(n.freeze.max_seconds)}, ${Ml(n.freeze.default_seconds)} by default`+(e.layer.freezers?` · ${r(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":`${r(a.stall_takers)} may take one after ${Ml(n.stall_seconds)}`])),i.push(["Reorder",r(a.reorderers)]),n.max_turns>1&&i.push(["Turns at once",`Up to ${n.max_turns} independent turns`]),i.push(["Turn lease",Ml(n.lease_seconds)],["Time to start",`${Ml(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 Uk="Where your organization's agents take turns at a shared branch, environment or proposal. One turn runs at a time in each queue.",Bk="A task you cannot see",z3="A former member",L3="A member";function Hk(){const e=cn().queues;if(!e)throw new Error("The Queues page rendered without the queues seam.");return e}function U3({org:e,open:t,path:n}){var h,m;const a=Hk(),{href:l,Link:r}=We(),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"&&((h=o.refusal)==null?void 0:h.reason)!=="engine_missing"?s.jsx(Ha,{title:"Page not found",description:"This page does not exist, or you do not have access to it.",backHref:l(`/org/${e}`),backLabel:"Back to the organization",link:r}):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(H3,{org:e,open:t??null,path:n??`/org/${e}/tasks/queues`}):o.state==="off"&&((m=o.refusal)==null?void 0:m.reason)==="engine_missing"?s.jsx(Zs,{page:"Queues"}):s.jsxs(s.Fragment,{children:[s.jsx(Zt,{title:"Queues",description:a.description??Uk}),o.state==="loading"&&s.jsx(Ik,{}),(o.state==="error"||o.state==="off")&&s.jsx(um,{refusal:o.refusal,on_retry:()=>void d(!0)}),o.state==="available"&&s.jsxs(xe,{variant:"info",className:"mt-6",children:[s.jsx(Ba,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Tasks are not on for this organization"}),s.jsxs(ge,{children:["Queues hold turns for tasks, so they show once Tasks are on."," ",s.jsx(r,{className:"text-primary hover:underline",href:l(`/org/${e}/tasks`),children:"Go to Tasks"})]})]})]})})}function Ik(){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(wt,{className:t===2?"h-10 w-2/3":"h-10 w-full"},t))})}function um({refusal:e,on_retry:t}){const n=ls();return(e==null?void 0:e.reason)==="store_locked"?s.jsxs(xe,{variant:"info",className:"mt-6",children:[s.jsx(Ba,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"The local stores are busy"}),s.jsxs(ge,{children:[s.jsx("p",{children:e.message}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]}):(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(xe,{variant:"warning",className:"mt-6",children:[s.jsx(rn,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:$r}),s.jsx(ge,{children:n})]}):s.jsxs(xe,{variant:"destructive",className:"mt-6",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Queues could not be loaded"}),s.jsxs(ge,{children:[s.jsx("p",{children:"The read did not answer. Try again in a moment."}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}const Lf=e=>e.status===404||e.reason==="not_found"||e.code==="not_found";function B3(e,t,n,a){return t?e===null?`Not reading · trying again every ${n}s`:`Not reading since ${Kn(e)} · trying again every ${n}s`:e===null?"Connecting…":`Live · read ${Kn(e)} · refreshes every ${n}s${a?` · ${a}`:""}`}function H3({org:e,open:t,path:n}){var O;const{listQueues:a,queue:l,members:r,refresh_ms:i,settings_note:o,description:c,read_scope:d,subject_label:f="Task",thread_subjects:h=!1}=Hk(),{self_id:m}=ed(),[x,j]=u.useState(null),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,w]=u.useState(null),[N,R]=u.useState({state:"pending",members:[]});u.useEffect(()=>{let H=!0;return r().then(te=>{H&&R(re=>te.ok?{state:"answered",members:te.data}:{state:"failed",members:re.members})}),()=>{H=!1}},[r]);const _=u.useMemo(()=>new Map(N.members.map(H=>[H.user_id,H])),[N.members]),k=N.state==="answered"?z3:L3,U=u.useCallback((H,te)=>{var re;return(te==null?void 0:te.title)??(h?(te==null?void 0:te.id)??H:H===m?"You":((re=_.get(H))==null?void 0:re.label)??k)},[_,k,m,h]),z=u.useRef({list:{last:null,fresh:!1},detail:{last:null,fresh:!1}}),[K,V]=u.useState(null),[L,M]=u.useState(!1),A=u.useCallback((H,te)=>{z.current[H]={last:te,fresh:!0};const{list:re,detail:ye}=z.current;M(re.last==="failed"||ye.last==="failed"),re.fresh&&ye.fresh&&re.last==="ok"&&ye.last==="ok"&&V(Date.now()/1e3)},[]),S=t??((O=x==null?void 0:x.queues[0])==null?void 0:O.id)??null,E=u.useRef(S);u.useEffect(()=>{E.current=S},[S]);const C=u.useRef(0),$=u.useCallback(async()=>{var re;const H=C.current+=1;z.current.list.fresh=!1;const te=await a();if(H===C.current)if(te.ok){if(j(te.data),y(null),!t){const ye=((re=te.data.queues[0])==null?void 0:re.id)??null;ye===null?z.current.detail={last:"ok",fresh:!0}:ye!==E.current&&(z.current.detail.fresh=!1)}A("list","ok")}else y(te.refusal),A("list","failed")},[a,t,A]),X=u.useRef(0),T=u.useCallback(async()=>{const H=X.current+=1;if(!S)return;z.current.detail.fresh=!1;const te=await l(S);H===X.current&&(te.ok?(p(te.data),w(null),A("detail","ok")):(w(te.refusal),Lf(te.refusal)&&p(null),A("detail",Lf(te.refusal)?"ok":"failed")))},[S,l,A]);u.useEffect(()=>{$()},[$]),u.useEffect(()=>{p(null),w(null),T()},[T]);const P=u.useCallback(()=>{$(),T()},[$,T]),J=!x&&(v==null?void 0:v.reason)==="engine_missing",ee=u.useCallback(()=>{J||P()},[J,P]);if(Tu(ee,i),J)return s.jsx(Zs,{page:"Queues"});const ve=Math.round(i/1e3),Q=b!==null&&Lf(b);return s.jsxs(s.Fragment,{children:[s.jsxs(Zt,{title:"Queues",description:c??Uk,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:B3(K,L,ve,d)}),s.jsx("span",{className:"sr-only",role:"status",children:L?"Not reading":K===null?"Connecting":"Live"})]}),!x&&!v&&s.jsx(Ik,{}),!x&&v&&s.jsx(um,{refusal:v,on_retry:P}),x&&x.queues.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(w0,{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(P3,{path:n,queues:x.queues,open_id:S,name:U,held:h}),Q?s.jsxs(xe,{variant:"info",className:"mt-6",children:[s.jsx(Ba,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This queue is no longer available"}),s.jsx(ge,{children:"It was archived, or you can no longer read its Workspace. Pick another queue above."})]}):g&&g.queue.id===S?s.jsx(q3,{org:e,detail:g,name:U,settings_note:o,subject_label:f,thread_subjects:h}):b?s.jsx(um,{refusal:b,on_retry:()=>void T()}):s.jsx(wt,{className:"mt-6 h-40 w-full shrink-0",role:"status","aria-label":"Loading the queue"})]}):null]})}function dm({org:e,subject:t,link:n}){const{href:a,Link:l}=We();return!t||t.hidden?s.jsx("span",{className:"text-muted-foreground",children:Bk}):t.kind==="task"&&n?s.jsx(l,{className:"text-primary hover:underline",href:a(`/org/${e}/tasks/${t.id}`),children:t.title??t.id}):s.jsx("span",{children:t.title??t.id})}function I3(e,t,n){const a=e.freeze?`frozen until ${Kn(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 ${Kn(e.batch.opened_at)}`,a].filter(Boolean).join(" · "),warn:!1};if(e.turn){const l=e.turn.subject,r=l.hidden?Bk:l.title??l.id,i=(e.running_count??1)>1?`${e.running_count} turns · `:"",o=e.turn.landing?" landing":"",c=n&&!!e.turn.hold,d=[c?Lk(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}${r}${o}`,secondary:Uf(d.join(" · ")),warn:!1}:{primary:`${i}${r}${o}`,secondary:d.length?Uf(d.join(" · ")):null,warn:d.length>0}}return{primary:"Nothing running",secondary:a?Uf(a):null,warn:!!a}}const Uf=e=>e.charAt(0).toUpperCase()+e.slice(1);function P3({path:e,queues:t,open_id:n,name:a,held:l}){const{href:r,Link:i}=We();return s.jsx(_t,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Queues",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Queue"}),s.jsx(F,{className:"hidden md:table-cell",children:"Step"}),s.jsx(F,{children:"Running turn"}),s.jsx(F,{className:"hidden text-right md:table-cell",children:"Waiting"})]})}),s.jsx(Fe,{children:t.map(o=>{var m;const c=o.id===n,d=O3(o),f=I3(o,a,l),h=o.waiting-(((m=o.batch)==null?void 0:m.remaining)??0);return s.jsxs(ce,{"data-testid":"queues-row",className:le(c&&"bg-accent"),children:[s.jsxs(q,{children:[s.jsx(i,{className:"text-primary hover:underline",href:r(`${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:[h," waiting"]})]}),s.jsx(q,{className:"hidden md:table-cell",children:s.jsx(me,{variant:"neutral",children:zk[o.policy.step]})}),s.jsxs(q,{children:[s.jsx("div",{className:le(!o.batch&&!o.turn&&"text-muted-foreground"),children:f.primary}),f.secondary?s.jsx("div",{className:le("text-xs",f.warn?"text-warning":"text-muted-foreground"),children:f.secondary}):null]}),s.jsx(q,{className:"hidden text-right md:table-cell",children:h})]},o.id)})})]})})}function mc({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 Pv({org:e,entries:t,landing:n,queue_name:a,subject_label:l,held:r,label:i}){return s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Ye,{containerAriaLabel:i,children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:l}),s.jsx(F,{children:"State"})]})}),s.jsx(Fe,{children:t.map(o=>{const c=M3(o,n,a,r);return s.jsxs(ce,{"data-testid":"queues-running",children:[s.jsxs(q,{children:[s.jsx(dm,{org:e,subject:o.subject,link:!r}),r&&o.hold&&o.note&&!o.subject.hidden?s.jsx("div",{className:"text-muted-foreground text-xs",children:o.note}):null]}),s.jsx(q,{children:s.jsx(me,{variant:c.tone,children:c.label})})]},o.ref)})})]})})}function q3({org:e,detail:t,name:n,settings_note:a,subject_label:l,thread_subjects:r}){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"),h=o.entries.filter(N=>N.turn!=="running"&&N.batching!=="in_batch"),m=o.batch,x=Math.max(1,f.filter(N=>N.batching!=="in_batch").length),j=m&&i.policy.independent_turns?f.filter(N=>N.batching!=="in_batch"&&N.ref!==m.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=!m&&f.length===0&&h.length===0;return s.jsxs(_t,{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(me,{variant:"neutral",children:zk[i.policy.step]}),s.jsx(me,{variant:"neutral",children:C3[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(yT,{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 ",Kn(v.lease_until),v.serving_until!==void 0?" · serving now":""]})]}):null,y?s.jsxs(xe,{variant:"warning",children:[s.jsx(hT,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Frozen until ",Kn(y.lease_until)]}),s.jsxs(ge,{children:[n(y.holder,y.holder_subject)," froze this queue at ",Kn(y.since),y.label?`: ${y.label}`:"",". Only ",n(y.holder,y.holder_subject),"'s entries start until it thaws."]})]}):null,p?s.jsxs(xe,{variant:"info",children:[s.jsx(_0,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:["Stall hold until ",Kn(p.until)]}),s.jsxs(ge,{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:[m?s.jsxs(mc,{id:"queue-running",title:"Running turn",side:`Batch opened by ${n(m.holder,m.holder_subject)} at ${Kn(m.opened_at)}`,children:[s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Ye,{containerAriaLabel:"Batch members",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Landing order"}),s.jsx(F,{children:l}),s.jsx(F,{children:"Outcome"})]})}),s.jsx(Fe,{children:m.members.map((N,R)=>{const _=E3(N.outcome);return s.jsxs(ce,{"data-testid":"queues-member",children:[s.jsx(q,{children:R+1}),s.jsx(q,{children:s.jsx(dm,{org:e,subject:N.subject??d.get(N.ref)??(r?{kind:"thread",id:N.ref}:void 0),link:!r})}),s.jsx(q,{children:s.jsx(me,{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(Pv,{org:e,entries:j,landing:o.landing,queue_name:i.name,subject_label:l,held:r,label:"Turns running beside the batch"})]}):null]}):s.jsx(mc,{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(Pv,{org:e,entries:f,landing:o.landing,queue_name:i.name,subject_label:l,held:r,label:"Running turns"})}),s.jsx(mc,{id:"queue-waiting",title:"Waiting",children:h.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(Ye,{containerAriaLabel:"Waiting entries",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Position"}),s.jsx(F,{children:l}),s.jsx(F,{className:"hidden md:table-cell",children:"Joined"}),s.jsx(F,{children:"Turn"}),s.jsx(F,{className:"hidden md:table-cell",children:"Note"})]})}),s.jsx(Fe,{children:h.map((N,R)=>{const _=A3(N);return s.jsxs(ce,{"data-testid":"queues-waiting",children:[s.jsx(q,{children:m?x+R+1:N.position}),s.jsx(q,{children:s.jsx(dm,{org:e,subject:N.subject,link:!r})}),s.jsx(q,{className:"hidden md:table-cell",children:Kn(N.joined_at)}),s.jsx(q,{children:s.jsx(me,{variant:_.tone,children:_.label})}),s.jsx(q,{className:"hidden md:table-cell",children:N.subject.hidden?"":N.note??""})]},N.ref)})})]})})})]}),s.jsx(mc,{id:"queue-settings",title:"Settings",children:s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsx(Ye,{containerAriaLabel:"Queue settings",children:s.jsx(Fe,{children:D3(i,c).map(([N,R])=>s.jsxs(ce,{children:[s.jsx(F,{scope:"row",className:"h-auto w-48 py-2 font-normal",children:N}),s.jsx(q,{children:R})]},N))})})})}),s.jsx("p",{className:"text-muted-foreground text-xs",children:a})]})}const hs="__no_parent__";function Pk(e,t){const n=new Set([t]);for(let a=!0;a;){a=!1;for(const l of e)l.parent&&n.has(l.parent)&&!n.has(l.key)&&(n.add(l.key),a=!0)}return n}const to=(e,t)=>(e.label||e.key).localeCompare(t.label||t.key);function an({id:e,label:t,help:n,error:a,children:l}){const r=[n?`${e}-help`:null,a?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:e,children:t}),l(r),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 fm({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 qv({id:e,label:t,help:n,checked:a,on_change:l}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Lr,{id:e,className:"mt-0.5",checked:a,"aria-describedby":n?`${e}-help`:void 0,onCheckedChange:r=>l(r===!0)}),s.jsx(Ue,{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 qk({id:e,legend:t,help:n,error:a,options:l,checked:r,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(rn,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),s.jsx("div",{className:"grid gap-0.5",children:c.map(h=>s.jsx("p",{children:h},h))})]}):null,l.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:l.map((h,m)=>s.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[s.jsx(Lr,{id:`${e}-${m}`,className:"mt-0.5",checked:r.has(h.value),onCheckedChange:x=>{const j=new Set(r);x===!0?j.add(h.value):j.delete(h.value),i(j)}}),s.jsx(Ue,{htmlFor:`${e}-${m}`,className:"min-w-0 font-normal break-words",children:h.label})]},h.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 hm({context:e,action:t,title:n="Two-factor sign-in needed",changing:a="Changing the org"}){const l=e.two_factor==="enroll";return s.jsxs(xe,{variant:"destructive",role:"alert",children:[s.jsx(dT,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:n}),s.jsxs(ge,{children:[s.jsx("p",{children:l?`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(G,{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 qa=e=>e.two_factor==="ok";function Pr({refusal:e,context:t,subject:n,action:a,changing:l,authority_title:r}){if((e==null?void 0:e.kind)==="two_factor")return s.jsx(hm,{context:t,action:a,changing:l,title:`Could not save ${n}`});const i=qa(t)?null:s.jsx(hm,{context:t,action:a,changing:l});if(!e)return i;const o=e.kind==="changed"?"The org changed since you opened this":e.kind==="authority"?r??`Could not save ${n}`:null;return s.jsxs(s.Fragment,{children:[i,s.jsxs(xe,{variant:"destructive",role:"alert",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),o?s.jsx(Ne,{children:o}):null,s.jsx(ge,{children:e.message})]})]})}function Gk({id:e,value:t,on_change:n,none:a,options:l,described_by:r}){return s.jsxs(xt,{value:t,onValueChange:n,children:[s.jsx(dt,{id:e,"aria-describedby":r,children:s.jsx(gt,{placeholder:"Choose a team"})}),s.jsxs(ft,{children:[a?s.jsx(Ee,{value:hs,children:a}):null,l.map(i=>s.jsx(Ee,{value:i.key,children:i.label||i.key},i.key))]})]})}function qr(e){const[t,n]=u.useState(!1),[a,l]=u.useState(null);return{saving:t,refusal:a,set_refusal:l,run:async i=>{n(!0),l(null);try{const o=await i();o?l(o):e()}finally{n(!1)}}}}function Gr({saving:e,blocked:t,described_by:n,children:a}){return s.jsx(G,{type:"submit",disabled:e,"aria-disabled":t||void 0,"aria-describedby":t?n:void 0,children:a})}const Vk=(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 G3({open:e,chart:t,team:n,save:a,on_close:l,context:r=zo,scope:i="full",parents:o}){var C;const c=r.host==="hosted",[d,f]=u.useState(""),[h,m]=u.useState(""),[x,j]=u.useState(""),[v,y]=u.useState(hs),[g,p]=u.useState({}),{saving:b,refusal:w,set_refusal:N,run:R}=qr(l),_=((C=t.teams.find($=>$.parent===null))==null?void 0:C.key)??null;u.useEffect(()=>{e&&(f(""),m((n==null?void 0:n.label)??""),j((n==null?void 0:n.description)??""),y((n==null?void 0:n.parent)??(c&&_&&(!o||o.includes(_))?_:hs)),p({}),N(null))},[e,n,N,c,_,o]);const k=$=>{const X=t.teams.find(T=>T.key===$);return X?X.label||X.key:$??""},U=n?Pk(t.teams,n.key):new Set,z=[...t.teams].filter($=>!U.has($.key)&&(!o||o.includes($.key))).sort(($,X)=>$.key===_?-1:X.key===_?1:to($,X)),K=n?n.label||n.key:"",V=i==="description",L=!qa(r),M=n?V?"save the description":"save the team":"add the team",A=$=>{if($.preventDefault(),L)return;if(!n){const P=c?h.trim():d.trim();if(!P){p(c?{label:"Give the team a name."}:{key:"Give the team a key."});return}if(c&&v===hs){p({parent:"Choose the parent team."});return}const J=c?P:h.trim()||P;R(()=>a({action:"add",kind:"team",key:P,...h.trim()?{label:h.trim()}:{},...x.trim()?{description:x.trim()}:{},...v!==hs?{parent:v}:{}},`Team ${J} added.`));return}if(!V&&!h.trim()){p({label:c?"Give the team a name.":"Give the team a label."});return}const X=v===hs?null:v,T={...!V&&h.trim()!==n.label.trim()?{label:h.trim()}:{},...x.trim()!==(n.description??"").trim()?{description:x.trim()}:{},...!c&&X!==n.parent?{parent:X}:{}};if(Object.keys(T).length===0){l();return}R(()=>a({action:"edit",kind:"team",key:n.key,...T},V?`Saved the description of ${K}.`:`Team ${h.trim()} saved.`))},S=n?V?`Edit the description of ${K}`:`Edit team ${K}`:"Add team";let E;return V?E="Say what the team works on. Only the description is yours to change here.":c?E=n?"Rename the team or say what it works on.":"Add a team to the organization.":n?E=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."]}):E="Add a team to this repository's local org.",s.jsx(Hn,{open:e,onOpenChange:$=>$||b?null:l(),children:s.jsx(In,{children:s.jsxs("form",{onSubmit:A,noValidate:!0,children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:S}),s.jsx(Vn,{children:E})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Pr,{refusal:w,context:r,subject:V?"the description":"the team",action:M}),!n&&!c?s.jsx(an,{id:"org-team-key",label:"Key",help:Vk("team",r.host),error:g.key,children:$=>s.jsx(Tt,{id:"org-team-key",className:"font-mono",value:d,autoComplete:"off","aria-invalid":g.key?!0:void 0,"aria-describedby":$,onChange:X=>{f(X.target.value),p({})}})}):null,V&&n?s.jsx(fm,{label:"Name",children:n.parent?`${K} · under ${k(n.parent)}`:K}):s.jsx(an,{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(Tt,{id:"org-team-label",value:h,"aria-invalid":g.label?!0:void 0,"aria-describedby":$,onChange:X=>{m(X.target.value),p({})}})}),s.jsx(an,{id:"org-team-description",label:V?"Description":"Description (optional)",children:()=>s.jsx(is,{id:"org-team-description",rows:3,placeholder:"What the team does",value:x,onChange:$=>j($.target.value)})}),V?null:c&&n?s.jsx(fm,{label:"Parent team",children:n.parent?k(n.parent):"None: the organization itself"}):s.jsx(an,{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(Gk,{id:"org-team-parent",value:v,on_change:X=>{y(X),p({})},none:c?void 0:"No parent (a root team)",options:z,described_by:$})})]}),s.jsxs(qn,{className:"mt-6",children:[s.jsx(G,{type:"button",variant:"outline",disabled:b,onClick:l,children:"Cancel"}),s.jsx(Gr,{saving:b,blocked:L,children:n?b?"Saving…":"Save":b?"Adding…":"Add team"})]})]})})})}const V3=(e,t)=>e.length===t.size&&e.every(n=>t.has(n));function Y3({open:e,chart:t,job:n,save:a,on_close:l,context:r=zo}){const[i,o]=u.useState(""),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,x]=u.useState(hs),[j,v]=u.useState(new Set),[y,g]=u.useState(!1),[p,b]=u.useState(!0),[w,N]=u.useState({}),{saving:R,refusal:_,set_refusal:k,run:U}=qr(l);u.useEffect(()=>{e&&(o(""),d((n==null?void 0:n.label)??""),h((n==null?void 0:n.description)??""),x((n==null?void 0:n.parent)??hs),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({}),k(null))},[e,n,k]);const z=n?Pk(t.job_functions,n.key):new Set,K=[...t.job_functions].filter(S=>!z.has(S.key)).sort(to),V=[...t.slots].sort(to).map(S=>({value:S.key,label:S.label||S.key})),L=!qa(r),M=n?"save the job function":"add the job function",A=S=>{if(S.preventDefault(),L)return;if(!n){if(!i.trim()){N({key:"Give the job function a key."});return}U(()=>a({action:"add",kind:"job_function",key:i.trim(),...c.trim()?{label:c.trim()}:{},...f.trim()?{description:f.trim()}:{},...m!==hs?{parent:m}:{},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 E=m===hs?null:m,C={...c.trim()!==n.label.trim()?{label:c.trim()}:{},...f.trim()!==(n.description??"").trim()?{description:f.trim()}:{},...E!==n.parent?{parent:E}:{},...V3(n.fills,j)?{}:{fills:[...j]},...y!==n.requires_person?{requires_person:y}:{},...p!==n.escalable?{escalable:p}:{}};if(Object.keys(C).length===0){l();return}U(()=>a({action:"edit",kind:"job_function",key:n.key,...C},`Job function ${c.trim()} saved.`))};return s.jsx(Hn,{open:e,onOpenChange:S=>S||R?null:l(),children:s.jsx(In,{children:s.jsxs("form",{onSubmit:A,noValidate:!0,children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:n?`Edit job function ${n.label||n.key}`:"Add job function"}),s.jsxs(Vn,{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(Pr,{refusal:_,context:r,subject:"the job function",action:M}),n?null:s.jsx(an,{id:"org-function-key",label:"Key",help:Vk("job function",r.host),error:w.key,children:S=>s.jsx(Tt,{id:"org-function-key",className:"font-mono",value:i,autoComplete:"off","aria-invalid":w.key?!0:void 0,"aria-describedby":S,onChange:E=>{o(E.target.value),N({})}})}),s.jsx(an,{id:"org-function-label",label:n?"Label":"Label (optional)",error:w.label,children:S=>s.jsx(Tt,{id:"org-function-label",value:c,"aria-invalid":w.label?!0:void 0,"aria-describedby":S,onChange:E=>{d(E.target.value),N({})}})}),s.jsx(an,{id:"org-function-description",label:"Job description (optional)",children:()=>s.jsx(is,{id:"org-function-description",rows:3,placeholder:"What this job function does",value:f,onChange:S=>h(S.target.value)})}),s.jsx(an,{id:"org-function-parent",label:"Parent function",help:"Its posts report to the post of the parent function.",children:S=>s.jsx(Gk,{id:"org-function-parent",value:m,on_change:x,none:"No parent (a root function)",options:K,described_by:S})}),s.jsx(qk,{id:"org-function-fills",legend:"Slots it fills",options:V,checked:j,on_change:v,empty:r.host==="hosted"?"This organization has no slots yet.":"This org has no slots yet; add them with sdlc org add slot."}),s.jsx(qv,{id:"org-function-requires-person",label:"Requires a person",help:"Only a person may hold its posts.",checked:y,on_change:g}),s.jsx(qv,{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(qn,{className:"mt-6",children:[s.jsx(G,{type:"button",variant:"outline",disabled:R,onClick:l,children:"Cancel"}),s.jsx(Gr,{saving:R,blocked:L,children:n?R?"Saving…":"Save":R?"Adding…":"Add job function"})]})]})})})}const F3=/^[a-z][a-z0-9_-]{0,63}$/;function K3(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[^a-z]+/,"").slice(0,64).replace(/-+$/,"")}function X3({open:e,chart:t,slot:n,save:a,on_close:l,context:r=zo}){const[i,o]=u.useState(""),[c,d]=u.useState(""),[f,h]=u.useState(!1),[m,x]=u.useState(""),[j,v]=u.useState({}),{saving:y,refusal:g,set_refusal:p,run:b}=qr(l);u.useEffect(()=>{e&&(o((n==null?void 0:n.label)??""),d((n==null?void 0:n.key)??""),h(!1),x((n==null?void 0:n.description)??""),v({}),p(null))},[e,n,p]);const w=!qa(r),N=n?"save the slot":"add the slot",R=_=>{if(_.preventDefault(),w)return;const k=i.trim();if(n){if(!k){v({label:"Give the slot a label."});return}const z={...k!==(n.label??"").trim()?{label:k}:{},...m.trim()!==(n.description??"").trim()?{description:m.trim()}:{}};if(Object.keys(z).length===0){l();return}b(()=>a({action:"edit",kind:"slot",key:n.key,...z},`Saved slot ${k}.`));return}const U={...k?{}:{label:"Give the slot a label."},...F3.test(c)?t.slots.some(z=>z.key===c)?{key:`Slot ${c} already exists.`}:{}:{key:"Use lowercase letters, digits, _ and -, starting with a letter, at most 64 characters."}};v(U),!(U.label||U.key)&&b(()=>a({action:"add",kind:"slot",key:c,label:k,...m.trim()?{description:m.trim()}:{}},`Added slot ${k}.`))};return s.jsx(Hn,{open:e,onOpenChange:_=>_||y?null:l(),children:s.jsx(In,{children:s.jsxs("form",{onSubmit:R,noValidate:!0,children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:n?`Edit ${n.label||n.key}`:"Add slot"}),s.jsx(Vn,{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(Pr,{refusal:g,context:r,subject:"the slot",action:N}),s.jsx(an,{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(Tt,{id:"org-slot-label",value:i,"aria-invalid":j.label?!0:void 0,"aria-describedby":_,onChange:k=>{o(k.target.value),!n&&!f&&d(K3(k.target.value)),v({})}})}),n?s.jsx(fm,{label:"Key",children:s.jsx("span",{className:"font-mono",children:n.key})}):s.jsx(an,{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(Tt,{id:"org-slot-key",className:"font-mono",value:c,autoComplete:"off","aria-invalid":j.key?!0:void 0,"aria-describedby":_,onChange:k=>{d(k.target.value),h(!0),v({})}})}),s.jsx(an,{id:"org-slot-description",label:"Description (optional)",children:()=>s.jsx(is,{id:"org-slot-description",rows:3,placeholder:"What this role does",value:m,onChange:_=>x(_.target.value)})})]}),s.jsxs(qn,{className:"mt-6",children:[s.jsx(G,{type:"button",variant:"outline",disabled:y,onClick:l,children:"Cancel"}),s.jsx(Gr,{saving:y,blocked:w,children:n?y?"Saving…":"Save":y?"Adding…":"Add slot"})]})]})})})}function Q3({open:e,chart:t,binding:n,names:a,save:l,confirm:r,on_close:i,context:o=zo,hosted:c}){var L;const[d,f]=u.useState(new Set),[h,m]=u.useState(""),[x,j]=u.useState({}),{saving:v,refusal:y,set_refusal:g,run:p}=qr(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))),m(n.source==="override"?n.reason??"":""),j({}),g(null))},[e,b,g]),!n)return null;const w=a.slot(n.slot),N=(L=t.project)!=null&&L.team?t.teams.find(M=>{var A;return M.key===((A=t.project)==null?void 0:A.team)}):void 0,R=N?N.label||N.key:"the owning team",_=new Set(t.job_functions.filter(M=>M.fills.includes(n.slot)).map(M=>M.key)),k=[...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),S=c==null?void 0:c.holders(M);return{value:M,label:c?S?`${A}: ${S}`:`${A} (no holder)`:A}}),U=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.`]]):[],z=!qa(o),K=M=>{M.preventDefault();const A={...d.size===0?{posts:"Choose at least one post."}:{},...h.trim()?{}:{reason:"Give the reason for the override."}};j(A),!(A.posts||A.reason||z)&&p(()=>l({action:"bind",slot:n.slot,posts:[...d],reason:h.trim()},`Override of ${w} saved.`))},V=async()=>{await r({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(()=>l({action:"unbind",slot:n.slot},`Override of ${w} cleared.`))};return s.jsx(Hn,{open:e,onOpenChange:M=>M||v?null:i(),children:s.jsx(In,{children:s.jsxs("form",{onSubmit:K,noValidate:!0,children:[s.jsxs(Pn,{children:[s.jsxs(Gn,{children:["Override ",w]}),s.jsxs(Vn,{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||z?s.jsx("div",{id:"org-override-refusal",className:"grid gap-4",children:s.jsx(Pr,{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(qk,{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:U,scroll:!!c,error:x.posts,options:k,checked:d,on_change:M=>{f(M),j(A=>({...A,posts:void 0}))}}),s.jsx(an,{id:"org-override-reason",label:"Reason",error:x.reason,children:M=>s.jsx(is,{id:"org-override-reason",rows:2,placeholder:"Why this slot needs other posts",value:h,"aria-invalid":x.reason?!0:void 0,"aria-describedby":M,onChange:A=>{m(A.target.value),j(S=>({...S,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 ",R," or of a team above it."]})]}),s.jsxs(qn,{className:"mt-6",children:[n.source==="override"?s.jsx(G,{type:"button",variant:"ghost",className:"sm:mr-auto",disabled:v,onClick:()=>void V(),children:"Clear override"}):null,s.jsx(G,{type:"button",variant:"outline",disabled:v,onClick:i,children:"Cancel"}),s.jsx(Gr,{saving:v,blocked:z,described_by:"org-override-refusal",children:v?"Saving…":"Save override"})]})]})})})}function Z3(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function W3({open:e,chart:t,names:n,save:a,on_close:l,context:r}){var L;const i=t.authority,o=u.useMemo(()=>new Set((i==null?void 0:i.post_pairs)??[]),[i]),c=((L=t.teams.find(M=>M.parent===null))==null?void 0:L.key)??null,d=[...t.teams].filter(M=>[...o].some(A=>A.startsWith(`${M.key}/`))).sort((M,A)=>M.key===c?-1:A.key===c?1:to(M,A)),[f,h]=u.useState(""),[m,x]=u.useState(""),[j,v]=u.useState({}),{saving:y,refusal:g,set_refusal:p,run:b}=qr(l);u.useEffect(()=>{var M;e&&(h(((M=d[0])==null?void 0:M.key)??""),x(""),v({}),p(null))},[e,p]);const w=new Set(t.posts.filter(M=>M.post.startsWith(`${f}/`)).map(M=>M.post.split("/")[1])),N=[],R=M=>{for(const A of[...t.job_functions].filter(S=>S.parent===M).sort(to))N.push(A),R(A.key)};R(null);const _=N.filter(M=>o.has(`${f}/${M.key}`)&&!w.has(M.key)),k=f!==""&&_.length===0,U=!qa(r)||k,z=M=>{if(M.preventDefault(),U)return;const A={...f?{}:{team:"Choose a team."},...m?{}:{job:"Choose a job function."}};v(A),!(A.team||A.job)&&b(()=>a({action:"add",kind:"post",key:`${f}/${m}`},`Added post ${n.job(m)} · ${n.team(f)}.`))},K=k?"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.",V=(i==null?void 0:i.ask)??[];return s.jsx(Hn,{open:e,onOpenChange:M=>M||y?null:l(),children:s.jsx(In,{children:s.jsxs("form",{onSubmit:z,noValidate:!0,children:[s.jsxs(Pn,{children:[s.jsx(Gn,{children:"Add post"}),s.jsx(Vn,{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(Pr,{refusal:g,context:r,subject:"the post",action:"add the post"}),s.jsx(an,{id:"org-post-team",label:"Team",help:"The team the post is in.",error:j.team,children:M=>s.jsxs(xt,{value:f,onValueChange:A=>{h(A),x(""),v({})},children:[s.jsx(dt,{id:"org-post-team","aria-describedby":M,"aria-invalid":j.team?!0:void 0,children:s.jsx(gt,{placeholder:"Choose a team"})}),s.jsx(ft,{children:d.map(A=>s.jsx(Ee,{value:A.key,children:A.label||A.key},A.key))})]})}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(an,{id:"org-post-function",label:"Job function",help:K,error:j.job,children:M=>s.jsxs(xt,{value:m,disabled:k,onValueChange:A=>{x(A),v({})},children:[s.jsx(dt,{id:"org-post-function","aria-describedby":M,"aria-invalid":j.job?!0:void 0,children:s.jsx(gt,{placeholder:k?"Every job function has a post here":"Choose a job function"})}),s.jsx(ft,{children:_.map(A=>s.jsx(Ee,{value:A.key,children:A.label||A.key},A.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.",V.length?` For others, ask ${Z3(V)}.`:""]}):null]})]}),s.jsxs(qn,{className:"mt-6",children:[s.jsx(G,{type:"button",variant:"outline",disabled:y,onClick:l,children:"Cancel"}),s.jsx(Gr,{saving:y,blocked:U,described_by:k?"org-post-function-help":void 0,children:y?"Adding…":"Add post"})]})]})})})}function J3({open:e,chart:t,post:n,names:a,members:l,save:r,on_close:i,context:o}){const[c,d]=u.useState({state:"loading"}),[f,h]=u.useState(""),[m,x]=u.useState(null),[j,v]=u.useState(-1),{saving:y,refusal:g,set_refusal:p,run:b}=qr(i),w=u.useRef(0),N=u.useCallback(async()=>{const T=w.current+=1;d({state:"loading"});const P=await l();T===w.current&&d(P.ok?{state:"read",members:P.data}:{state:"failed"})},[l]);u.useEffect(()=>{e&&(h(""),x(null),v(-1),p(null),N())},[e,N,p]);const R=t.posts.find(T=>T.post===n);if(!n||!R)return null;const _=a.post(n),k=new Set(R.holders.map(T=>T.id)),z=t.posts.some(T=>T.reports_to===n)&&R.holders.length>0?R.holders[0]:null,K=f.trim().toLowerCase(),V=c.state==="read"?c.members.filter(T=>!k.has(T.id)).filter(T=>!K||[T.label,T.detail,T.email].some(P=>P==null?void 0:P.toLowerCase().includes(K))):[],L=c.state==="read"&&c.members.every(T=>k.has(T.id)),M=c.state==="read"&&!L&&V.length>0,A=M&&j>=0&&j<V.length?V[j]:null,S=T=>`org-holder-option-${T.id}`,E=!qa(o)||!m||z!==null,C=T=>{if(!M)return;const P=V.length-1,J=ee=>{var ve,Q;T.preventDefault(),v(ee),(Q=(ve=document.getElementById(S(V[ee])))==null?void 0:ve.scrollIntoView)==null||Q.call(ve,{block:"nearest"})};T.key==="ArrowDown"?J(Math.min(A?j+1:0,P)):T.key==="ArrowUp"?J(A?Math.max(j-1,0):P):T.key==="Home"&&A?J(0):T.key==="End"&&A?J(P):T.key==="Enter"&&A&&(m==null?void 0:m.id)!==A.id&&(T.preventDefault(),x(A))},$=z?void 0:m?"Only members of the organization can hold its posts. Members who already hold it are left out.":"Choose a member to add.",X=T=>{T.preventDefault(),!(E||!m)&&b(()=>r({action:"hold",post:n,member:m.id},`Added ${m.label} to ${_}.`))};return s.jsx(Hn,{open:e,onOpenChange:T=>T||y?null:i(),children:s.jsx(In,{children:s.jsxs("form",{onSubmit:X,noValidate:!0,children:[s.jsxs(Pn,{children:[s.jsxs(Gn,{children:["Add holder to ",_]}),s.jsx(Vn,{children:"The member holds this post and reports as it does."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Pr,{refusal:g,context:o,subject:"the holder",action:"add the holder"}),z?s.jsxs(xe,{variant:"info",id:"org-holder-one",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsxs(ge,{children:["This post takes one holder. Remove ",a.member(z)," first, then add the new holder."]})]}):null,s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Ue,{htmlFor:"org-holder-member",children:"Member"}),s.jsx(Tt,{id:"org-holder-member",role:"combobox","aria-expanded":M,"aria-controls":M?"org-holder-members":void 0,"aria-activedescendant":A?S(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:z!==null,onChange:T=>{h(T.target.value),v(-1)},onKeyDown:C}),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(_n,{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(G,{type:"button",variant:"outline",size:"sm",onClick:()=>void N(),children:"Retry"})]}):L?s.jsx("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"Every member already holds this post."}):V.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:V.map((T,P)=>{const J=(m==null?void 0:m.id)===T.id,ee=(A==null?void 0:A.id)===T.id;return s.jsxs("li",{id:S(T),role:"option","aria-selected":J,className:`cursor-pointer rounded-sm px-2 py-1.5 ${J?"bg-accent text-accent-foreground":ee?"bg-muted":"hover:bg-muted"} ${ee?"ring-ring ring-2 ring-inset":""}`,onClick:()=>{z||(v(P),x(T))},children:[s.jsxs("div",{className:"text-sm font-medium break-words",children:[T.label,T.detail&&V.filter(ve=>ve.label===T.label).length>1?` (${T.detail})`:""]}),T.email?s.jsx("div",{className:"text-muted-foreground text-xs break-all",children:T.email}):null]},T.id)})})}),$?s.jsx("p",{id:"org-holder-member-help",className:"text-muted-foreground text-xs",children:$}):null]})]}),s.jsxs(qn,{className:"mt-6",children:[s.jsx(G,{type:"button",variant:"outline",disabled:y,onClick:i,children:"Cancel"}),s.jsx(Gr,{saving:y,blocked:E,described_by:z?"org-holder-one":$?"org-holder-member-help":void 0,children:y?"Adding…":"Add holder"})]})]})})})}function ez(e){const[t,n]=u.useState(null),a=u.useRef(t);u.useEffect(()=>{a.current=t},[t]);const l=u.useCallback(c=>{var d;(d=a.current)==null||d.resolve(c),n(null)},[]),r=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=!qa(e),o=s.jsx(yw,{open:t!==null,onOpenChange:c=>c?null:l(!1),children:s.jsxs(bw,{children:[s.jsxs(jw,{children:[s.jsx(_w,{children:t==null?void 0:t.title}),s.jsx(Nw,{className:"whitespace-pre-line",children:t==null?void 0:t.description})]}),t&&i?s.jsx(hm,{context:e,action:t.action}):null,s.jsxs(ww,{children:[s.jsx(Sw,{children:"Cancel"}),s.jsx(kw,{variant:t!=null&&t.destructive?"destructive":"default","aria-disabled":i||void 0,onClick:c=>{if(i){c.preventDefault();return}l(!0)},children:t==null?void 0:t.action_label})]})]})});return{confirm:r,confirm_dialog:o}}function no({label:e,on_edit:t,on_remove:n,items:a}){const l=a??[...t?[{label:"Edit",on_select:t}]:[],...n?[{label:"Remove",on_select:n,destructive:!0}]:[]];return s.jsxs(jd,{children:[s.jsx(wd,{asChild:!0,children:s.jsx(G,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`More actions for ${e}`,children:s.jsx(bp,{className:"size-3.5","aria-hidden":"true"})})}),s.jsx(Oo,{align:"end",children:l.map(r=>s.jsx(wr,{className:r.destructive?"text-destructive focus:text-destructive":void 0,onSelect:r.on_select,children:r.label},r.label))})]})}function tz({label:e,message:t,bound:n,on_dismiss:a}){return s.jsxs(xe,{variant:"destructive",role:"alert",className:"mb-3",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsxs(Ne,{children:[e," was not removed"]}),s.jsxs(ge,{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(l=>s.jsxs("li",{className:"grid gap-0.5",children:[s.jsxs("a",{className:"text-primary text-sm underline underline-offset-2",href:l.href,children:["Settings of ",l.name]}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Override set by ",l.set_by??"a former member"]})]},l.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(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:"Dismiss"})]})]})}const zo={host:"local",two_factor:"ok",settings_href:""},nz={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."},sz="Covered: someone holds a post that fills the slot. Vacant: posts fill it but nobody holds them. Uncovered: no job function fills it.",az=4,fx=e=>({paddingLeft:16+24*Math.min(e,az)}),Eu={covered:{label:"Covered",tone:"success"},vacant:{label:"Vacant",tone:"warning"},uncovered:{label:"Uncovered",tone:"error"}};function lz(){const e=cn().org;if(!e)throw new Error("The Org chart page rendered without the org seam.");return e}function rz({host:e="local",org:t=""}={}){const n=lz(),[a,l]=u.useState({state:"loading"}),[r,i]=u.useState(null),o=u.useRef(0),c=u.useRef(null),d=u.useCallback(j=>{const v=async y=>{const g=o.current+=1;c.current&&clearTimeout(c.current);const p=await n.chart();if(g!==o.current)return;if(p.ok){i({chart:p.data,at:new Date().toISOString()}),l({state:"read"});return}const{refusal:b}=p;if(b.reason==="no_local_org"){i(null),l({state:"none",seedable:b.seedable!==!1});return}if(e==="hosted"&&(b.reason==="not_found"||b.status===404)){i(null),l({state:"missing"});return}if(b.retry&&b.reason==="store_locked"&&y>0){const w=b.retry_after??10;l({state:"busy",retry_after:w}),c.current=setTimeout(()=>void v(y-1),w*1e3);return}l({state:"failed",refusal:b})};return v(j)},[n,e]);u.useEffect(()=>(d(1),()=>{o.current+=1,c.current&&clearTimeout(c.current)}),[d]);const f=()=>void d(1),h=a.state==="none"||a.state==="missing"?null:r,{href:m}=We(),x=hz(n,()=>void d(1),(h==null?void 0:h.chart)??iz,e,m("/settings/account"));return a.state==="missing"?s.jsx(xz,{org:t}):s.jsx(fk,{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(Zt,{title:"Org chart",description:nz[e]}),a.state==="busy"&&!h?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")&&!h?s.jsx(mz,{quiet:a.state==="busy"}):null,a.state==="none"?s.jsx(pz,{edit:(x==null?void 0:x.actions)??null,seedable:a.seedable}):null,a.state==="failed"?s.jsx(vz,{host:e,kept_at:(h==null?void 0:h.at)??null,on_retry:f}):null,h?s.jsx(yz,{chart:h.chart,host:e,edit:(x==null?void 0:x.actions)??null}):null,(x==null?void 0:x.dialogs)??null]})})}const iz={org:"",workflow:!1,teams:[],job_functions:[],slots:[],posts:[],members:[],slot_resolution:[],project:{team:null,roots:[]}};function oz(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),l=new Set(t.team_descriptions),r=new Set(t.posts);return{functions:t.administer,team_add:a.size>0,team:o=>o===n?t.administer?"root":l.has(o)?"description":null:a.has(o)?"full":l.has(o)?"description":null,post_add:t.post_pairs.length>0,post:o=>r.has(o),override:!1,slots:t.administer}}function cz(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 uz={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."},dz={mfa_challenge_required:"challenge",mfa_enrollment_required:"enroll"};function fz(e,t,n){var c;const a=t==="hosted"&&!!n.authority,l=((c=n.authority)==null?void 0:c.two_factor)??!0,[r,i]=u.useState("ok"),o=u.useCallback(async()=>{a&&i(e.twoFactor?await e.twoFactor():l?"ok":"challenge")},[e,a,l]);return u.useEffect(()=>{if(!a){i("ok");return}l?i("ok"):o();const d=()=>void o();return window.addEventListener("focus",d),()=>window.removeEventListener("focus",d)},[a,l,o]),{state:r,set_state:i,check:o}}function hz(e,t,n,a,l){const r=Mr(),i=Yk(n),o=fz(e,a,n),c=a==="hosted"?{host:a,two_factor:o.state,settings_href:l}:zo,{confirm:d,confirm_dialog:f}=ez(c),[h,m]=u.useState(null),[x,j]=u.useState({}),v=S=>j(E=>{if(!E[S])return E;const{[S]:C,...$}=E;return $}),y=e.members,g=u.useCallback(async()=>{if(!y)return{ok:!1};const S=await y();return S.ok?{ok:!0,data:S.data}:{ok:!1}},[y]),p=e.change;if(!p||a==="hosted"&&(!n.authority||!cz(n)))return null;const b=oz(n),w=S=>{const E=S.code?dz[S.code]:void 0;return E?(o.set_state(E),{kind:"two_factor",message:S.message}):S.code==="revision_conflict"?(t(),{kind:"changed",message:S.message}):S.code==="outside_authority"?(t(),{kind:"authority",message:S.message}):{message:S.message}},N=S=>S.action==="hold"||S.action==="release"?"posts":"kind"in S?S.kind==="team"?"teams":S.kind==="post"?"posts":S.kind==="slot"?"slots":"functions":null,R=(S,E)=>{const C=S==null?void 0:S.warning;C?r.error(C):r.success(E),t()},_=async(S,E)=>{const C=await p(S);if(!C.ok)return w(C.refusal);const $=N(S);return $&&v($),R(C.data,E),null},k=S=>{o.check(),m(S)},U=async(S,E,C,$)=>{const X=await p(C);if(!X.ok){const T=w(X.refusal),P=X.refusal.bound,J=P?P.projects.length+P.more:0,ee=P?`${P.kind==="slot"?"Slot":"Post"} ${E} is still needed by the ${J===1?"override of 1 project that binds":`overrides of ${J} projects that bind`} it. Clear ${J===1?"it":"them"} on each project's Settings first.`:T.message;j(ve=>({...ve,[S]:{label:E,message:ee,...P?{bound:P}:{}}}));return}v(S),R(X.data,$)},z=async(S,E,C)=>{const $=S==="team"?"team":"job function";o.check(),await d({title:`Remove ${$} ${C}?`,description:uz[a],action_label:"Remove",destructive:!0,action:`remove the ${$}`})&&await U(S==="team"?"teams":"functions",C,{action:"remove",kind:S,key:E},`${S==="team"?"Team":"Job function"} ${C} removed.`)},K=async S=>{const E=S.label||S.key;o.check(),await d({title:`Remove slot ${E}?`,description:"Projects stop showing it. This can't be undone.",action_label:"Remove slot",destructive:!0,action:"remove the slot"})&&await U("slots",E,{action:"remove",kind:"slot",key:S.key},`Removed slot ${E}.`)},V=async S=>{const E=i.post(S);o.check(),await d({title:`Remove post ${E}?`,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 U("posts",E,{action:"remove",kind:"post",key:S},`Removed post ${E}.`)},L=async(S,E)=>{const C=i.post(S),$=i.member(E),X=n.posts.find(ve=>ve.post===S),P=((X==null?void 0:X.holders.length)??0)<=1?X!=null&&X.escalates_to?` The post becomes vacant. Until someone holds it, its reports and the slots it fills go to ${i.manager(X.escalates_to)}.`:" The post becomes vacant.":"";if(o.check(),!await d({title:`Remove ${$} from ${C}?`,description:`They stop holding this post and no longer report through it.${P}`,action_label:"Remove",action:"remove the holder"}))return;const ee=await p({action:"release",post:S,member:E.id});if(!ee.ok){r.error(w(ee.refusal).message),t();return}v("posts"),R(ee.data,`Removed ${$} from ${C}.`)},M=()=>m(null),A=(h==null?void 0:h.kind)==="override"&&n.project&&n.project.team!==null?n.project.slots.find(S=>S.slot===h.slot)??null:null;return{actions:{can:b,host:a,team:(S,E="full")=>k({kind:"team",team:S,scope:E}),job:S=>k({kind:"function",job:S}),override:S=>k({kind:"override",slot:S}),slot:S=>k({kind:"slot",slot:S}),slot_remove:S=>void K(S),remove:(S,E,C)=>void z(S,E,C),post_add:()=>k({kind:"post"}),post_remove:S=>void V(S),holder_add:S=>k({kind:"holder",post:S}),holder_remove:(S,E)=>void L(S,E),refused:S=>{const E=x[S];return E?s.jsx(tz,{label:E.label,message:E.message,bound:E.bound,on_dismiss:()=>v(S)}):null}},dialogs:s.jsxs(s.Fragment,{children:[s.jsx(G3,{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:n.authority?n.authority.teams:void 0,save:_,on_close:M,context:c}),s.jsx(Y3,{open:(h==null?void 0:h.kind)==="function",chart:n,job:(h==null?void 0:h.kind)==="function"?h.job:null,save:_,on_close:M,context:c}),s.jsx(Q3,{open:A!==null,chart:n,binding:A,names:i,save:_,confirm:S=>d({...S,action:"clear the override"}),on_close:M}),s.jsx(X3,{open:(h==null?void 0:h.kind)==="slot",chart:n,slot:(h==null?void 0:h.kind)==="slot"?h.slot:null,save:_,on_close:M,context:c}),s.jsx(W3,{open:(h==null?void 0:h.kind)==="post",chart:n,names:i,save:_,on_close:M,context:c}),s.jsx(J3,{open:(h==null?void 0:h.kind)==="holder",chart:n,post:(h==null?void 0:h.kind)==="holder"?h.post:null,names:i,members:g,save:_,on_close:M,context:c}),f]})}}function mz({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(wt,{className:n===3?"h-10 w-2/3":"h-10 w-full"},n))})}function ir({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 pz({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(xe,{variant:"info",className:"mt-6",children:[s.jsx(Ba,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"This repository has no local org yet"}),s.jsxs(ge,{children:[s.jsx("p",{children:n}),t||!e?s.jsxs("div",{className:"mt-2 grid w-full gap-2",children:[t?s.jsx(ir,{children:"sdlc org seed"}):null,e?null:s.jsx(ir,{children:"sdlc org add team <key>"})]}):null,e?s.jsxs(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>e.team(null),children:[s.jsx(br,{className:"size-4","aria-hidden":"true"}),"Add team"]}):null]})]})}function xz({org:e}){const{href:t,Link:n}=We();return s.jsx(Ha,{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 gz(e){return new Date(e).toDateString()===new Date().toDateString()?`today at ${ss(e)}`:`on ${Dn(e)} at ${ss(e)}`}function vz({host:e,kept_at:t,on_retry:n}){const a=t?`The chart read ${gz(t)} is kept below. `:"";return s.jsxs(xe,{variant:"destructive",className:"mt-6",children:[s.jsx(ut,{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(ge,{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(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function Yk(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])),l=new Map(e.posts.map(y=>[y.post,y.holders])),r=y=>y.label||y.id,i=new Map;for(const y of[...e.members,...e.posts.flatMap(g=>g.holders)]){const g=r(y);i.set(g,(i.get(g)??new Set).add(`${y.kind}:${y.id}`))}const o=y=>{var g;return(((g=i.get(r(y)))==null?void 0:g.size)??0)>1},c=y=>{const g=o(y)?y.detail??y.id:null;return g&&g!==r(y)?g:null},d=y=>{const g=c(y);return g&&g!==r(y)?`${r(y)} (${g})`:r(y)},f=y=>{const[g="",p=""]=y.split("/");return{team:t.get(g)??g,job:n.get(p)??p}},h=y=>{const{team:g,job:p}=f(y);return`${p} · ${g}`},m=y=>{if(y==="top")return"Top of the org";if(typeof y!="string")return`A vacant ${n.get(y.vacant)??y.vacant}`;const g=(l.get(y)??[]).map(d);return g.length?`${h(y)} (${g.join(", ")})`:h(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:h,member:d,memberLabel:r,memberDetail:c,manager:m,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 Qa({id:e,title:t,description:n,actions:a,children:l,anchor:r}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;!r||typeof window>"u"||window.location.hash!==`#${r}`||((o=i.current)==null||o.scrollIntoView({block:"start"}),(c=i.current)==null||c.focus({preventScroll:!0}))},[r]),s.jsxs("section",{id:r,"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:r?-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:l})]})}function hi({children:e,on_click:t}){return s.jsxs(G,{type:"button",variant:"outline",size:"sm",onClick:t,children:[s.jsx(br,{className:"size-4","aria-hidden":"true"}),e]})}const Gv={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 yz({chart:e,host:t,edit:n}){const a=Yk(e),l=e.members.some(r=>r.kind==="agent");return s.jsxs(s.Fragment,{children:[s.jsxs(Qa,{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(hi,{on_click:n.post_add,children:"Add post"}):void 0,children:[n==null?void 0:n.refused("posts"),s.jsx(wz,{chart:e,names:a,agents:l,host:t,edit:n})]}),s.jsx(Qa,{id:"org-chart-members",title:"Members",description:l?`${Gv[t]} Each agent answers to the nearest person in its reporting chain.`:Gv[t],children:s.jsx(Cz,{chart:e,names:a,host:t,agents:l})}),n?s.jsxs(Qa,{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(hi,{on_click:()=>n.team(null),children:"Add team"}):void 0,children:[n.refused("teams"),s.jsx(bz,{chart:e,edit:n})]}):null,s.jsxs("div",{className:"grid items-start gap-x-6 xl:grid-cols-2",children:[s.jsxs(Qa,{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(hi,{on_click:()=>n.job(null),children:"Add job function"}):void 0,children:[n!=null&&n.can.functions?n.refused("functions"):null,s.jsx(Rz,{chart:e,names:a,edit:n!=null&&n.can.functions?n:null})]}),s.jsxs(Qa,{id:"org-chart-slots",anchor:"slots",title:"Slots",description:sz,actions:n!=null&&n.can.slots&&e.slot_resolution.length>0?s.jsx(hi,{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(Ez,{chart:e,names:a,host:t,edit:n!=null&&n.can.slots?n:null})]})]}),e.project?s.jsx(Mz,{project:e.project,chart:e,names:a,edit:n!=null&&n.can.override?n:null}):null]})}function bz({chart:e,edit:t}){var c;const n=hx([...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,l=t.host==="hosted",r=(d,f)=>{const h=t.can.team(d.key);return h==="full"?s.jsx(no,{label:f,on_edit:()=>t.team(d),on_remove:()=>t.remove("team",d.key,f)}):h==="root"?s.jsx(no,{label:f,on_edit:()=>t.team(d,"description")}):h==="description"?s.jsx(G,{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(nd,{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:h,children:m})=>{const x=h.label||h.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:fx(f),"data-testid":"org-chart-team",children:[s.jsx("span",{className:"text-sm font-medium",children:x}),s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[l?null:s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:h.key}),a===h.key?s.jsx(me,{variant:"neutral",children:"Owns this project"}):null,r(h,x)]})]}),m.length>0?i(m,f+1):null]},h.key)})}),o=l&&e.teams.length===1;return s.jsxs(s.Fragment,{children:[s.jsx(_t,{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 hx(e,t,n){const a=new Set(e.map(t)),l=new Map(e.map(i=>[t(i),{item:i,children:[]}])),r=[];for(const i of e){const o=n(i),c=l.get(t(i));o&&a.has(o)&&o!==t(i)?l.get(o).children.push(c):r.push(c)}return r}const jz={local:"No posts yet.",hosted:"No posts yet. An org admin can add them."};function wz({chart:e,names:t,agents:n,host:a,edit:l}){const r=hx([...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(r.length===0){const c=a==="hosted"&&(l==null?void 0:l.can.functions)&&!l.can.post_add;return s.jsx("p",{className:"text-muted-foreground text-sm",children:l!=null&&l.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.":jz[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:h})=>{const{team:m}=t.parts(f.post),x=typeof f.reports_to=="object"?f.reports_to:null,j=!!(l!=null&&l.can.post(f.post));return s.jsxs("li",{children:[s.jsxs("div",{className:"border-b py-2 pr-4",style:fx(d),"data-testid":"org-chart-post",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(nR,{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?`${m} · Reports to a vacant ${t.job(x.vacant)}`:m}),j&&l?s.jsx("span",{className:"ml-auto",children:s.jsx(no,{label:t.post(f.post),items:[{label:"Add holder",on_select:()=>l.holder_add(f.post)},{label:"Remove post",on_select:()=>l.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(me,{variant:Eu.vacant.tone,children:Eu.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(v=>s.jsx(kz,{holder:v,post:f.post,member:i.get(`${v.kind}:${v.id}`),names:t,agents:n,host:a,on_remove:j&&l?()=>l.holder_remove(f.post,v):void 0},`${v.kind}:${v.id}`))})]}),h.length>0?o(h,d+1):null]},f.post)})});return s.jsx(_t,{className:"overflow-hidden",children:o(r,0)})}function _z(e){return new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function Nz(e){if(!e.held_since)return null;const t=_z(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 kz({holder:e,post:t,member:n,names:a,agents:l,host:r,on_remove:i}){const o=e.kind==="person"?jp: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 h=null;c!=null&&c.dotted&&d?h=`Dotted line: primary manager is ${a.manager(d.reports_to)}`:e.kind==="agent"&&n&&"accountable_person"in n&&(h=n.accountable_person?`Accountable person ${a.member(n.accountable_person)}`:"No accountable person");const m=r==="hosted"?Nz(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(hk,{children:[s.jsx(mk,{asChild:!0,children:s.jsx(G,{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(ad,{className:"size-3.5","aria-hidden":"true"})})}),s.jsxs(sx,{children:["Remove ",x]})]}):null,f?s.jsx("span",{className:"text-muted-foreground text-xs break-all",children:f}):null,l?s.jsx("span",{className:"text-muted-foreground text-xs",children:e.kind==="person"?"Person":"Agent"}):null]}),h?s.jsx("div",{className:"pl-5.5 text-xs",children:h}):null,m?s.jsx("div",{className:"text-muted-foreground pl-5.5 text-xs",children:m}):null]})}const Sz=["sdlc org hold <team>/<function> --person <id>","sdlc org hold <team>/<function> --agent <id>"];function Cz({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:"}),Sz.map(r=>s.jsx(ir,{children:r},r))]});const l=[...e.members].sort((r,i)=>r.kind===i.kind?t.memberLabel(r).localeCompare(t.memberLabel(i))||r.id.localeCompare(i.id):r.kind==="person"?-1:1);return s.jsx(_t,{className:"overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Members",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Member"}),s.jsx(F,{children:"Posts"}),s.jsx(F,{children:"Primary manager"}),s.jsx(F,{children:"Dotted lines"}),a?s.jsx(F,{children:"Accountable person"}):null]})}),s.jsx(Fe,{children:l.map(r=>{const i=r.posts.find(d=>d.primary),o=r.posts.filter(d=>d.dotted),c=t.memberDetail(r);return s.jsxs(ce,{"data-testid":"org-chart-member",children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-medium",children:t.memberLabel(r)}),c?s.jsx("div",{className:"text-muted-foreground text-xs",children:c}):null,a?s.jsx("div",{className:"text-muted-foreground text-xs",children:r.kind==="person"?"Person":"Agent"}):null]}),s.jsx(q,{children:r.posts.map(d=>t.post(d.post)).join(", ")}),s.jsx(q,{children:i?t.manager(i.reports_to):"None"}),s.jsx(q,{children:o.length?o.map(d=>t.manager(d.reports_to)).join(", "):"None"}),a?s.jsx(q,{children:r.kind==="person"?"Not an agent":r.accountable_person?t.member(r.accountable_person):"None"}):null]},`${r.kind}:${r.id}`)})})]})})}function Rz({chart:e,names:t,edit:n}){const a=hx([...e.job_functions].sort((r,i)=>(r.label||r.key).localeCompare(i.label||i.key)),r=>r.key,r=>r.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 l=(r,i)=>s.jsx("ul",{role:"list",className:i===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:r.map(({item:o,children:c})=>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:fx(i),"data-testid":"org-chart-function",children:[s.jsx("span",{className:"text-sm font-medium",children:o.label||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(me,{variant:"neutral",children:"Requires a person"}):null,n?s.jsx(no,{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?l(c,i+1):null]},o.key))});return s.jsx(_t,{className:"overflow-hidden",children:l(a,0)})}function Tz(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 Au={covered:0,vacant:1,uncovered:2};function Fk(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 Ez({chart:e,names:t,host:n,edit:a}){var i;const l=Fk(e),r=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(_t,{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(hi,{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(_t,{className:"overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Slots",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Slot"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Resolves to"}),a?s.jsx(F,{className:"text-right",children:s.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),s.jsxs(Fe,{children:[[...e.slot_resolution].sort((o,c)=>Au[o.status]-Au[c.status]||t.slot(o.slot).localeCompare(t.slot(c.slot))).map(o=>{var d,f;const c=Eu[o.status];return s.jsxs(ce,{"data-testid":"org-chart-slot",children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-medium",children:t.slot(o.slot)}),n==="hosted"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:o.slot}),(d=r.get(o.slot))!=null&&d.description?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:(f=r.get(o.slot))==null?void 0:f.description}):null]}):null,l.has(o.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:l.get(o.slot)}):null]}),s.jsx(q,{children:s.jsx(me,{variant:c.tone,children:c.label})}),s.jsxs(q,{children:[Tz(o,t),o.status==="covered"&&o.needs_person?s.jsx("div",{className:"text-muted-foreground text-xs",children:"Needs a person"}):null]}),a&&r.has(o.slot)?s.jsx(q,{className:"text-right",children:s.jsx(no,{label:t.slot(o.slot),on_edit:()=>a.slot(r.get(o.slot)),on_remove:()=>a.slot_remove(r.get(o.slot))})}):null]},o.slot)}),e.slot_resolution.length===0?s.jsx(ce,{children:s.jsx(q,{colSpan:3,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})})}const Az="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.",Bf=["sdlc org own <team>","sdlc org bind <slot> <team>/<function>... --reason <text>","sdlc org unbind <slot>"];function Mz({project:e,chart:t,names:n,edit:a}){if(e.team===null){const i=e.roots.map(n.team);return s.jsx(Qa,{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(ir,{children:i.length?Bf[0]:"sdlc org add team <key>"})})})}const l=Fk(t),r=[...e.slots].sort((i,o)=>Au[i.status]-Au[o.status]||n.slot(i.slot).localeCompare(n.slot(o.slot)));return s.jsxs(Qa,{id:"org-chart-project",title:"This project",description:Az,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(_t,{className:"mt-3 overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Slots in this project",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Slot"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Bound to"}),s.jsx(F,{children:"Source"}),a?s.jsx(F,{className:"text-right",children:s.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),s.jsxs(Fe,{children:[r.map(i=>{const o=Eu[i.status];return s.jsxs(ce,{"data-testid":"org-chart-project-slot",children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-medium",children:n.slot(i.slot)}),l.has(i.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:l.get(i.slot)}):null]}),s.jsx(q,{children:s.jsx(me,{variant:o.tone,children:o.label})}),s.jsx(q,{children:s.jsx(Oz,{binding:i,names:n})}),s.jsx(q,{children:s.jsx($z,{binding:i})}),a?s.jsx(q,{className:"text-right",children:s.jsx(G,{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(nd,{className:"size-3.5","aria-hidden":"true"})})}):null]},i.slot)}),r.length===0?s.jsx(ce,{children:s.jsx(q,{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(ir,{children:Bf[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:"}),Bf.map(i=>s.jsx(ir,{children:i},i))]})]})}function Oz({binding:e,names:t}){const n=[];e.status==="covered"&&e.needs_person&&n.push("Needs a person");for(const l of e.posts)l.off_description&&n.push(`${t.post(l.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(l=>t.post(l.post)).join(", ")} has no holder`:a=e.posts.map(l=>l.holders.length?`${t.post(l.post)}: ${l.holders.map(t.member).join(", ")}`:`${t.post(l.post)}: no holder`).join("; "),s.jsxs(s.Fragment,{children:[a,n.map(l=>s.jsx("div",{className:"text-muted-foreground text-xs",children:l},l))]})}function $z({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?Dn(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 Dz={breaking:"Breaking",new:"New",improved:"Improved",other:"Other changes"},zz=["breaking","new","improved","other"],Lz={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 Kk(e){return Lz[e]??e.replace(/_/g," ")}function Uz(e){return e.bump==="major"?"breaking":e.change==="added"?"new":e.change==="changed"?"improved":"other"}function so(e){const t=new Map;let n=0,a=0;for(const r of e){if(r.modeling_only){a+=1;continue}if(!r.bump){n+=1;continue}const i=Uz(r);t.set(i,[...t.get(i)??[],r])}return{sections:zz.filter(r=>t.has(r)).map(r=>({key:r,label:Dz[r],lines:t.get(r)})),breaking:t.has("breaking"),unlisted_count:n,modeling_only_count:a}}function Bz(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 l of a.lines){const r=l.why?`: ${l.why}`:"";n.push(`- ${l.label} (${Kk(l.node_type)})${r}`)}}return`${n.join(`
|
|
386
|
-
`)}
|
|
387
|
-
`}const $s="candidate";function mx(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}const Hz="Versioned records of this project's release branch, with notes from its graph changes.";function Xk({description:e=Hz,actions:t}){return s.jsx(Zt,{title:"Releases",description:e,actions:t})}function Qk(e){var r;if(!e)return"";const t=(r=e.previous_release)==null?void 0:r.version,n=Number(e.version.split("-rc.")[1]??0),a=e.commits_since??n,l=`${e.commits_since===null?"At least ":""}${a} commit${a===1?"":"s"}`;return t?`${l} since ${t}`:`${l} before the first Release`}function zc({active:e,onClick:t,version:n,badges:a,caption:l,item_ref:r}){return s.jsxs("button",{ref:r,type:"button","aria-current":e?"true":void 0,onClick:t,className:le("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:l})]})}function On({children:e}){return s.jsx("section",{className:"border-border flex flex-col gap-4 rounded-xl border p-4",children:e})}function zn({title:e,error:t,onRetry:n}){return s.jsxs(xe,{variant:"destructive",children:[s.jsx(rn,{}),e?s.jsx(Ne,{children:e}):null,s.jsxs(ge,{className:"flex flex-col items-start gap-2",children:[t,n?s.jsx(G,{variant:"outline",size:"sm",onClick:n,children:"Try again"}):null]})]})}function Iz({title:e,text:t}){return s.jsx(On,{children:s.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-center",children:[s.jsx(td,{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 Pz(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 Mu({changes:e}){const t=u.useMemo(()=>so(e),[e]),[n,a]=u.useState(!1),l=t.unlisted_count+t.modeling_only_count;return s.jsxs("div",{className:"flex flex-col gap-4",children:[t.sections.map(r=>{const i=s.jsx("ul",{className:"flex flex-col gap-2",children:r.lines.map(o=>s.jsx(Vv,{line:o},`${o.node_id}:${o.change}`))});return r.key==="breaking"?s.jsxs(xe,{variant:"destructive",className:"border-destructive/40",children:[s.jsx(rn,{}),s.jsx(Ne,{children:s.jsx("h3",{className:"text-destructive text-sm font-semibold",children:r.label})}),s.jsx(ge,{className:"text-foreground",children:i})]},r.key):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:r.label}),i]},r.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,l>0?s.jsxs("p",{className:"text-muted-foreground text-sm",children:[l," more change",l===1?"":"s"," do",l===1?"es":""," not affect the version."]}):null,e.length>0?s.jsx(G,{variant:"link",size:"sm",className:"self-start px-0","aria-expanded":n,onClick:()=>a(r=>!r),children:n?"Hide all changes":"Show all changes"}):null,n?s.jsx("ul",{className:"flex flex-col gap-2",children:e.map(r=>s.jsx(Vv,{line:r,detail:!0},`all:${r.node_id}:${r.change}:${r.modeling_only}`))}):null]})}function Vv({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(me,{variant:"outline",children:Kk(e.node_type)})]}),n?s.jsx("span",{className:"text-muted-foreground text-xs",children:n}):null]})}const Zk="Releases of this checkout: the roadmap of open Planned Releases, the next candidate, and each production release with its notes.",Yv=5,mm="Not available",pm="planned:";function Wk(){const e=ls();return s.jsx("p",{className:"text-muted-foreground text-sm",children:`${mm}. ${e}`})}const es=e=>`${pm}${e}`,qz=e=>e!=null&&e.startsWith(pm)?e.slice(pm.length):null,px=e=>e?e.slice(0,7):"";function Gz(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 Vz(){return s.jsxs(xe,{variant:"info",children:[s.jsx(Ba,{}),s.jsx(Ne,{children:"This page only reads Releases"}),s.jsx(ge,{className:"text-info",children:"A Release is written when production runs a release candidate, once its commit is merged into origin/main."})]})}function Yz(e){if(e.state==="unreadable")return{badges:s.jsx(me,{variant:"error",children:"Could not be read"}),caption:""};if(e.state==="withdrawn")return{badges:s.jsx(me,{variant:"warning",children:"Withdrawn"}),caption:e.replaced_by?`Replaced by ${e.replaced_by}`:"Withdrawn"};const t=s.jsxs(s.Fragment,{children:[s.jsx(me,{variant:"neutral",children:e.app_changed===!1?"App unchanged":e.previous_release_id?e.bump??"patch":"First"}),e.breaking?s.jsx(me,{variant:"error",children:"Breaking"}):null]}),n=e.written_at?mx(e.written_at):"",a=e.tracks&&e.tracks.length>0?` · ${e.tracks.join(", ")}`:"";return{badges:t,caption:`${n}${a}`}}function al({query:e,select:t,onSelect:n,children:a,inline:l=!1}){return s.jsx("a",{href:`?${e}`,className:l?"text-primary underline":"text-primary hover:underline",onClick:r=>{r.preventDefault(),n(t)},children:a})}function Td({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 js=({children:e})=>s.jsx("code",{className:"font-mono text-xs",children:e});function Jk(e,t){if(e.judged_commit&&t&&e.judged_commit!==t)return`Judged ${px(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 Ed({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 Fz={ready:"success",verifying:"info",fixing:"warning",abandoned:"warning",ready_older:"neutral",none:"neutral",unknown:"neutral"};function Kz({batch:e}){if(e.state==="loading")return s.jsxs(xe,{children:[s.jsx(xu,{}),s.jsxs(ge,{className:"flex flex-row items-center gap-2",role:"status",children:[s.jsx(_n,{"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(xe,{children:[s.jsx(xu,{}),s.jsxs(Ne,{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{children:t.text}),s.jsx(me,{variant:Fz[t.state],children:t.chip})]}),t.help?s.jsx(ge,{children:t.help}):null]})}function Xz(e,t,n){return`/org/${e}/issues/${encodeURIComponent(t)}?from=${encodeURIComponent(n)}`}function e1({issues:e,error:t}){return t?s.jsx(zn,{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(Ed,{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(js,{children:n.file}):null]},n.key))})]})}function t1({tracks:e,error:t}){return t?s.jsx(zn,{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(Ed,{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(js,{children:n.version}):null,n.bump?s.jsx(me,{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(js,{children:a.name}),s.jsxs(js,{children:[a.from??"—"," → ",a.to??"—"]})]}),a.changes.map((l,r)=>s.jsxs("span",{className:"text-muted-foreground text-xs",children:[l.feature,": ",l.entry]},r))]},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 n1({delivery:e,candidate:t,onSelect:n}){if(!e||e.planned.length===0&&e.outside===0)return null;const a=l=>l.length===0?"—":l.map(r=>r.went?`${r.label} (${r.went})`:r.label).join(", ");return s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(Ed,{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(Ye,{containerAriaLabel:"Planned Releases",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Planned Release"}),s.jsx(F,{children:"Delivered"}),s.jsx(F,{children:"Not delivered"})]})}),s.jsx(Fe,{children:e.planned.map(l=>s.jsxs(ce,{children:[s.jsx(q,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.open&&t?s.jsx(al,{query:`planned=${encodeURIComponent(l.id)}`,select:es(l.id),onSelect:n,children:l.name}):s.jsx("span",{children:l.name}),s.jsx(js,{children:l.id})]})}),s.jsx(q,{children:a(l.delivered)}),s.jsx(q,{children:a(l.not_delivered)})]},l.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 Qz={thread:"Thread",task:"Task",issue:"Issue",test:"Test"};function s1({rows:e,org:t,from:n,untasked:a}){const{href:l,Link:r}=We(),[i,o]=u.useState(!1),c=i?e:e.slice(0,Yv),d=f=>f.kind==="task"?s.jsx(r,{className:"text-primary font-mono text-xs hover:underline",href:l(`/org/${t}/tasks/${encodeURIComponent(f.id)}?from=${encodeURIComponent(n)}`),children:f.id}):f.kind==="issue"?s.jsx(r,{className:"text-primary font-mono text-xs hover:underline",href:l(Xz(t,f.id,n)),children:f.id}):f.kind==="thread"?s.jsx(r,{className:"text-primary hover:underline",href:l(`${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(Ye,{containerAriaLabel:"Related",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Kind"}),s.jsx(F,{children:"Item"}),s.jsx(F,{children:"How it relates"})]})}),s.jsx(Fe,{children:c.map(f=>s.jsxs(ce,{children:[s.jsx(q,{children:Qz[f.kind]}),s.jsx(q,{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(q,{children:f.relation})]},`${f.kind}:${f.id}`))})]})}),e.length>Yv?s.jsx(G,{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 a1=e=>(e==null?void 0:e.status)===409&&e.reason==="view_outdated";function l1(e){const t=xx(),[n,a]=u.useState(t!=null&&t.related?{state:"loading"}:null),l=u.useRef(0),r=u.useCallback(async(i=!1)=>{if(!(t!=null&&t.related))return;const o=++l.current;a({state:"loading"});const c=await t.related(e,i?{fresh:!0}:void 0);o===l.current&&a(c.ok?{state:"ready",value:c.data}:{state:"error",error:c.refusal.message,refusal:c.refusal})},[t,e]);return u.useEffect(()=>{r()},[r]),{related:n,read:r}}function r1({related:e,org:t,from:n,onRetry:a}){const l=u.useRef(null),r=u.useRef(!1);if(u.useEffect(()=>{var o;r.current&&(e==null?void 0:e.state)!=="loading"&&(r.current=!1,(o=l.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:l,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(wt,{className:"h-8 w-full"}),s.jsx(wt,{className:"h-8 w-full"}),s.jsx(wt,{className:"h-8 w-2/3"})]}):e.state==="error"?a1(e.refusal)?s.jsx(Wk,{}):s.jsx(zn,{title:"Related work could not be read",error:e.error,onRetry:()=>{r.current=!0,a()}}):e.value.rows.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing related yet."}):s.jsx(s1,{rows:e.value.rows,org:t,from:n,untasked:e.value.untasked})]})}function Zz(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 i1({planned:e,onSelect:t}){return e?e.open?s.jsx(al,{query:`planned=${encodeURIComponent(e.id)}`,select:es(e.id),onSelect:t,children:e.name}):s.jsxs("span",{children:[e.name," ",s.jsx(js,{children:e.id})]}):null}function Wz({candidate:e,org:t,onSelect:n,notes:a}){const l=xx(),{related:r,read:i}=l1("candidate"),[o,c]=u.useState(l!=null&&l.candidateBatch?{state:"loading"}:null);u.useEffect(()=>{if(!(l!=null&&l.candidateBatch))return;let f=!0;return l.candidateBatch().then(h=>{f&&(h.ok?c(h.data.batch===null?null:{state:"ready",value:h.data.batch}):c({state:"error",error:h.refusal.message}))}),()=>{f=!1}},[l]);const d=e.readiness??((r==null?void 0:r.state)==="ready"?r.value.readiness:null)??null;return s.jsxs(s.Fragment,{children:[s.jsx(Td,{pairs:[["Environment",e.environment??"staging"],["Commit",s.jsx(js,{children:px(e.head_commit_id)},"commit")],["Readiness",d?Jk(d,e.head_commit_id):null],["Planned",e.planned_release?s.jsx(i1,{planned:e.planned_release,onSelect:n}):null]]}),o?s.jsx(Kz,{batch:o}):null,a,s.jsx(e1,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(t1,{tracks:e.tracks,error:e.tracks_error}),s.jsx(n1,{delivery:e.planned_delivery,candidate:!0,onSelect:n}),s.jsx(r1,{related:r,org:t,from:"release:candidate",onRetry:()=>i(!0)})]})}function Jz({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(me,{variant:"warning",children:"Withdrawn"}):s.jsx(me,{variant:"neutral",children:e.app_changed===!1?"App unchanged":a?"First":e.bump}),e.breaking?s.jsx(me,{variant:"error",children:"Breaking"}):null]}),e.state==="withdrawn"&&e.replaced_by?s.jsxs("p",{className:"text-sm",children:["Replaced by"," ",s.jsx(al,{query:`release=${encodeURIComponent(e.replaced_by)}`,select:e.replaced_by,onSelect:t,inline:!0,children:e.replaced_by})]}):null]})}function eL({release:e,org:t,onSelect:n,notes:a}){const l=e.label??e.version,{related:r,read:i}=l1(l),o=(r==null?void 0:r.state)==="ready"?Zz(r.value.previews):null;return s.jsxs(s.Fragment,{children:[s.jsx(Td,{pairs:[["Environment",e.environment??"production"],["Commit",e.commit?s.jsx(js,{children:px(e.commit)},"commit"):null],["Readiness",e.readiness?`${Jk(e.readiness)} on staging`:null],["Previews",o],["Planned",e.planned_release?s.jsx(i1,{planned:e.planned_release,onSelect:n}):null]]}),a,s.jsx(e1,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(t1,{tracks:e.tracks,error:e.tracks_error}),s.jsx(n1,{delivery:e.planned_delivery,candidate:!1,onSelect:n}),s.jsx(r1,{related:r,org:t,from:`release:${l}`,onRetry:()=>i(!0)})]})}function tL({id:e,summary:t,org:n,onNotFound:a,forecast:l}){var x,j;const r=xx(),[i,o]=u.useState({state:"loading"}),c=u.useRef(0),d=u.useCallback(async(v=!1)=>{const y=++c.current;if(!(r!=null&&r.plannedRelease)){o({state:"error",error:mm,refusal:{status:409,message:mm,reason:"view_outdated"}});return}o({state:"loading"});const g=await r.plannedRelease(e,v?{fresh:!0}:void 0);y===c.current&&o(g.ok?{state:"ready",value:g.data}:{state:"error",error:g.refusal.message,refusal:g.refusal})},[r,e]);u.useEffect(()=>{d()},[d]);const f=i.state==="error"&&(((x=i.refusal)==null?void 0:x.status)===404||((j=i.refusal)==null?void 0:j.reason)==="not_found");if(u.useEffect(()=>{f&&a()},[f,a]),i.state==="loading")return s.jsxs(On,{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(me,{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(On,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:(t==null?void 0:t.name)??e}),a1(i.refusal)?s.jsx(Wk,{}):f?null:s.jsx(zn,{error:i.error,onRetry:()=>void d(!0)})]});const h=i.value,m=h.order===null?null:h.order===1?`Next of ${h.open} open`:`${h.order} of ${h.open} open`;return s.jsxs(On,{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(me,{variant:"neutral",children:"Planned"})]}),h.goal?s.jsx("p",{className:"text-muted-foreground text-sm",children:h.goal}):null]}),s.jsx(Td,{pairs:[["Planned Release",s.jsx(js,{children:h.id},"id")],["Date",h.date],["Order",m],["Members",String(h.members.length)]]}),l,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(Ed,{title:"Members",count:h.members.length}),h.members.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Members",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Member"}),s.jsx(F,{children:"Level"}),s.jsx(F,{children:"Tasks"}),s.jsx(F,{children:"State"})]})}),s.jsx(Fe,{children:h.members.map(v=>{const y=v.tasks.filter(p=>p.state==="done").length,g=v.tasks.filter(p=>p.state!=="done").map(p=>p.id);return s.jsxs(ce,{children:[s.jsx(q,{children:v.label}),s.jsx(q,{children:v.level?s.jsx(me,{variant:"neutral",children:nL(v.level)}):null}),s.jsx(q,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v.tasks.length>0?s.jsxs("span",{children:[y," of ",v.tasks.length," done"]}):null,g.length>0?s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Open: ",s.jsx(js,{children:g.join(", ")})]}):null,v.untracked>0?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[v.untracked," slice",v.untracked===1?" has":"s have"," no task yet"]}):null]})}),s.jsx(q,{children:v.state})]},v.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(s1,{rows:h.related,org:n,from:`planned:${h.id}`})]})]})}const nL=e=>e.charAt(0).toUpperCase()+e.slice(1);function xx(){return cn().releases}const Xn={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"},Fv=3,sL=["in_progress","not_started","planned","blocked"],gx="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),Ct=e=>e.charAt(0).toUpperCase()+e.slice(1);function Hf(e){const t=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(e??""));return t?`${Number(t[3])} ${gx[Number(t[2])-1]}`:String(e??"")}function o1(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${gx[t.getMonth()]} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function aL(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${gx[t.getMonth()]}`}function Ds(e){return e?e.from===e.to&&e.or_later?`${Hf(e.from)} or later`:`${Hf(e.from)} to ${Hf(e.to)}${e.or_later?", or later":""}`:""}function lL(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 c1(e){var h;const t=e??{},n=t.source??{},l=[t.no_date==="no date: no rate"&&n.rate_why?n.rate_why:"",/members estimated$/.test(t.no_date??"")?"":lL(t)].filter(Boolean).join(" · "),r=t.projected?Ds(t.projected):t.no_date??"",i=(h=t.projected)==null?void 0:h.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=[l,c,o&&i&&t.projected?`corrected for past estimates: raw ${Ds({...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:r?Ct(r):"",caption:f}}function rL(e){const t=e.kinds??[];return[t.includes("range")?"Not promised":"",e.goal??(t.includes("major")?"No goal yet":"")].filter(Boolean).join(" · ")}function iL(e){var c,d,f,h;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,l=(e.needs_user??[]).length,r=!a&&!l?["none blocked · none waiting on you"]:[a?`${a} blocked`:"",l?`${l} waiting on you`:""],i=((f=e.tasks)==null?void 0:f.untracked_slices)??0;i&&r.push(`${i} slice${i===1?"":"s"} not tasks yet`);const o=((h=e.not_a_member)==null?void 0:h.count)??0;return o&&r.push(`${o} not a member yet`),{lead:n,rest:r.filter(Boolean).join(" · ")}}const u1=e=>String(e??"").replace(/_/g," ");function oL(e){const t=e??{},n=t.kinds??[],a=n.includes("slipped"),l=!a&&t.was&&t.now?Ds(t.was)===Ds(t.now)?`, range still ${Ds(t.now)}`:`, range was ${Ds(t.was)}, now ${Ds(t.now)}`:"",r=[a&&t.was?`was ${Ds(t.was)}`:"",n.includes("scope changed")?`scope changed${l}`:""].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:r.length?Ct(r.join(" · ")):"",what:i}}const or="roadmap",Kv={reading:!1,value:null,refusal:null};function cL(e){const[t,n]=u.useState({all:Kv,mine:Kv}),a=u.useRef({all:0,mine:0}),l=u.useCallback(async(r,i=!1)=>{if(!(e!=null&&e.roadmap))return;const o=++a.current[r];n(d=>({...d,[r]:{...d[r],reading:!0}}));const c=await e.roadmap({...i?{fresh:!0}:{},...r==="mine"?{mine:!0}:{}});o===a.current[r]&&n(d=>({...d,[r]:c.ok?{reading:!1,value:c.data,refusal:null}:{reading:!1,value:d[r].value,refusal:c.refusal}}))},[e]);return{reads:t,read:l,available:!!(e!=null&&e.roadmap)}}function uL(e,t){return`${e} open${t.length?` · ${t.join(", ")} moved since you looked`:""}`}function Oi({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 d1=({level:e})=>e?s.jsx(me,{variant:"neutral",children:Ct(e)}):null;function f1({state:e}){const t=Ct(u1(e));return sL.includes(String(e))?s.jsx("span",{className:"font-medium",children:t}):s.jsx("span",{children:t})}function dL({reads:e,scope:t,onScope:n,onRead:a,org:l,onSelect:r}){var x,j;const i=e[t],o=i.value,c=ls(),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 h=()=>{f.current=!0,a(t,!0)},m=o?[o.as_of?`as of ${o1(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(On,{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"}),m?s.jsx("p",{className:"text-muted-foreground text-xs",children:m}):null]}),s.jsx("div",{role:"group","aria-label":"Roadmap scope",className:"flex gap-2",children:["all","mine"].map(v=>s.jsx(G,{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(_n,{"aria-hidden":!0,className:"size-4"})," ",Ct(Xn.pending),"…"]}):null}),i.refusal&&!i.reading?i.refusal.reason==="no_roadmap"?s.jsx(zn,{title:Xn.failedLead,error:`${Ct(Xn.noEngineLead)}. ${c}`}):i.refusal.reason==="refused"?s.jsx(zn,{title:Xn.failedLead,error:i.refusal.message}):s.jsx(zn,{title:Xn.failedLead,error:i.refusal.message,onRetry:h}):null,o?t==="mine"?s.jsx(vL,{mine:o.mine,org:l,onSelect:r}):s.jsx(hL,{read:o,org:l,onSelect:r}):null]})}function fL(e){if(!e||typeof e.seconds_per_day!="number")return"No rate";const t=aL(e.as_of);return`${Math.round(e.seconds_per_day/3600)} task hours a day over the ${e.days} days${t?` to ${t}`:""}`}function hL({read:e,org:t,onSelect:n}){var l,r;const a=e.releases??[];if(!a.length){const[i,o]=Xn.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(Oi,{children:o})]})}return s.jsxs(s.Fragment,{children:[s.jsx(Td,{pairs:[["Forecast from",Ct(`${((l=e.source)==null?void 0:l.machine)||"this machine"}'s task records and rate`)],["Rate",fL(e.rate)],["Not counted",Ct(((r=e.source)==null?void 0:r.not_counted)||"other machines' work")]]}),a.map(i=>s.jsx(mL,{row:i,org:t,onSelect:n},i.id))]})}function mL({row:e,org:t,onSelect:n}){var h,m,x;const a=c1(e.forecast),l=iL(e),r=rL(e),i=`roadmap-${e.id}`,o=e.moved?oL(e.told):null,c=(((h=e.counts)==null?void 0:h.members)??0)===0,d=((m=e.not_a_member)==null?void 0:m.count)??0,f=[r,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(al,{query:`planned=${encodeURIComponent(e.id)}`,select:es(e.id),onSelect:n,children:e.name})}),e.kinds.map(j=>s.jsx(me,{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:Ct(a.caption.join(" · "))}):null]}):null,f?s.jsx("p",{className:"text-muted-foreground text-sm",children:f}):null,o?s.jsxs(xe,{variant:"info",children:[s.jsx(AR,{"aria-hidden":!0}),s.jsx(Ne,{children:"Moved since you looked"}),s.jsxs(ge,{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:[l.lead,l.rest?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",l.rest]}):null]}),(x=e.stale_unchecked)!=null&&x.words?s.jsx("p",{className:"text-muted-foreground text-xs",children:Ct(e.stale_unchecked.words)}):null,e.for_you&&e.kinds.includes("major")?s.jsx(pL,{row:e}):null,s.jsx(gL,{row:e,org:t})]})}function pL({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 l=[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:[l?`${Ct(l).replace(/\.$/,"")}. `:"","Accept or reject in the terminal:"]}),s.jsx(Oi,{children:a.accept}),s.jsx(Oi,{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(Oi,{children:t.set_goal})]}):null]})}function h1({next:e,org:t}){const{href:n,Link:a}=We(),l=e.tasks[0],r=e.label||e.item;return l?s.jsx(a,{className:"text-primary hover:underline",href:n(`/org/${t}/tasks/${encodeURIComponent(l.id)}?from=roadmap`),children:r}):s.jsx("span",{children:r})}function xL(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?Ct(e.nobody):""}function gL({row:e,org:t}){const[n,a]=u.useState(!1),l=e.next??[];if(!l.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 r=n?l:l.slice(0,Fv),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(Ye,{containerAriaLabel:`Next in ${e.name}`,children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Member"}),s.jsx(F,{children:"Level"}),s.jsx(F,{children:"State"}),s.jsx(F,{children:"Who is on it"})]})}),s.jsx(Fe,{children:r.map(o=>{const c=i.get(o.item);return s.jsxs(ce,{children:[s.jsx(q,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(h1,{next:o,org:t}),c?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[Ct(c.words),c.estimate_as_of?` (estimated ${o1(c.estimate_as_of)})`:""]}):null]})}),s.jsx(q,{children:s.jsx(d1,{level:o.level})}),s.jsx(q,{children:s.jsx(f1,{state:o.state})}),s.jsx(q,{children:xL(o,e)})]},o.item)})})]})}),l.length>Fv&&!n?s.jsxs(G,{variant:"outline",size:"sm",className:"self-start",onClick:()=>a(!0),children:["Show all ",l.length]}):null,r.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 vL({mine:e,org:t,onSelect:n}){const{href:a,Link:l}=We();if(!e)return null;const r=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:Ct(Xn.noTask)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Your work",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Task"}),s.jsx(F,{children:"Release"}),s.jsx(F,{children:"Member"})]})}),s.jsx(Fe,{children:e.tasks.map(i=>{var o,c;return s.jsxs(ce,{children:[s.jsx(q,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(l,{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,Ct(u1(i.state))].filter(Boolean).join(" · ")})]})}),s.jsx(q,{children:(o=i.members)!=null&&o.length?i.members.map(d=>s.jsx("div",{children:s.jsx(al,{query:`planned=${encodeURIComponent(d.planned_release)}`,select:es(d.planned_release),onSelect:n,children:d.name})},d.planned_release)):i.release?s.jsx(al,{query:`planned=${encodeURIComponent(i.release.planned_release)}`,select:es(i.release.planned_release),onSelect:n,children:i.release.name}):s.jsx("span",{className:"text-muted-foreground",children:i.words?Ct(i.words):"—"})}),s.jsx(q,{children:(c=i.members)!=null&&c.length?i.members.map(d=>s.jsx(d1,{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)})})]})}),r.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(Oi,{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:Ct(Xn.noNext)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Your next members",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Release"}),s.jsx(F,{children:"Member"}),s.jsx(F,{children:"State"})]})}),s.jsx(Fe,{children:e.next.map(i=>s.jsxs(ce,{children:[s.jsx(q,{children:s.jsx(al,{query:`planned=${encodeURIComponent(i.release)}`,select:es(i.release),onSelect:n,children:i.name})}),s.jsx(q,{children:s.jsx(h1,{next:i,org:t})}),s.jsx(q,{children:s.jsx(f1,{state:i.state})})]},`${i.release}:${i.item}`))})]})})]})]})}function yL({state:e,id:t}){var r;const n=ls();if(!e)return null;const a=(r=e.value)==null?void 0:r.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(_n,{"aria-hidden":!0,className:"size-4"})," ",Ct(Xn.pending),"…"]});if(e.refusal){const i=e.refusal.reason==="no_roadmap"?`${Ct(Xn.noEngineLead)}. ${n}`:e.refusal.message;return s.jsx("p",{className:"text-muted-foreground text-xs",children:`${Xn.failedLead}: ${i}`})}return null}const l=c1(a.forecast);return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.lead?s.jsx("p",{className:"text-sm",children:l.lead}):null,l.caption.length?s.jsx("p",{className:"text-muted-foreground text-xs",children:Ct(l.caption.join(" · "))}):null]})}function m1(){const e=cn().releases;if(!e)throw new Error("The Releases page rendered without a Releases contract.");return e}function bL({initial:e,environments:t,branch_options:n,chooseBranch:a,renderWrite:l,selection:r,org:i,onReadAgain:o,onNotFound:c,notice:d,focusOnMount:f}){var os,kn,cs,ht,Ws,Js,ea,ta,D,we;const h=m1(),m=e.local??null,[x,j]=u.useState(e),[v,y]=u.useState(null),g=r?r.selected:v,p=r?r.onSelect:y,b=!!(m||x.release_branch),[w,N]=u.useState(m||e.release_branch?{state:"loading"}:{state:"ready",value:null}),[R,_]=u.useState({}),[k,U]=u.useState(null),[z,K]=u.useState(!1),[V,L]=u.useState(null),[M,A]=u.useState(null),S=u.useRef(null),E=m?{fresh:!0}:void 0,C=u.useCallback(async W=>{const Se=await h.candidate(W);N(Se.ok?{state:"ready",value:Se.data.candidate}:{state:"error",error:Se.refusal.message,refusal:Se.refusal})},[h]),$=u.useCallback(async()=>{N({state:"loading"}),await C(E)},[C,m]),X=u.useCallback(async()=>{const W=await h.list();W.ok&&j(W.data)},[h]),T=((os=x.release_branch)==null?void 0:os.id)??null;u.useEffect(()=>{if(!m&&!T)return;let W=!1;return h.candidate().then(Se=>{W||N(Se.ok?{state:"ready",value:Se.data.candidate}:{state:"error",error:Se.refusal.message,refusal:Se.refusal})}),()=>{W=!0}},[T,h,m]);const P=u.useRef(new Set),J=u.useCallback((W,Se)=>_(Wt=>({...Wt,[W]:Se.ok?{state:"ready",value:Se.data.release}:{state:"error",error:Se.refusal.message,refusal:Se.refusal}})),[]),ee=async W=>{_(Se=>({...Se,[W]:{state:"loading"}})),P.current.add(W),J(W,await h.release(W,E))},ve=w.state!=="ready"||w.value!==null,Q=qz(g),O=cL(m?h:void 0),H=O.available&&g===or,[te,re]=u.useState("all"),ye=x.release_branch||m?ve?$s:null:((kn=x.releases[0])==null?void 0:kn.version)??null,ae=Q!==null||H?null:g===$s?ve?$s:null:g??ye,[je,ne]=u.useState([]),at=u.useRef(0);u.useEffect(()=>{if(!m||!h.roadmapMoved)return;let W=!0;const Se=at.current;return h.roadmapMoved().then(Wt=>{W&&Wt.ok&&Se===at.current&&ne(Wt.data.moved.map(na=>na.name))}),()=>{W=!1}},[h,m]);const ue=O.reads.all,Be=O.read;u.useEffect(()=>{Q===null||!O.available||!ue.value&&!ue.reading&&!ue.refusal&&Be("all")},[Q,O.available,ue,Be]);const[Y,Re]=u.useState(0),Le=u.useRef(0),vt=W=>{W===or&&Re(Se=>Se+1),p(W)};u.useEffect(()=>{if(Y!==Le.current){if(!H){Le.current=Y;return}te!=="all"||ue.reading||!ue.value||!h.roadmapSeen||(Le.current=Y,h.roadmapSeen(ue.value.as_of).then(W=>{W.ok&&(at.current+=1,ne([]))}))}},[Y,H,te,ue,h]);const _e=new Map((((cs=ue.value)==null?void 0:cs.releases)??[]).map(W=>[W.id,[W.kinds.includes("range")?"range":"",W.forecast.projected?Ds(W.forecast.projected):"no date"].filter(Boolean).join(" · ")])),Dt=ae===null||ae===$s||x.releases.some(W=>W.version===ae);u.useEffect(()=>{!m||!c||ae!==null&&ae!==$s&&!Dt&&c({kind:"release",id:ae})},[m,c,ae,Dt]),u.useEffect(()=>{!ae||ae===$s||P.current.has(ae)||m&&!Dt||(P.current.add(ae),h.release(ae).then(W=>J(ae,W)))},[ae,h,J,Dt]);const I=u.useRef(g),oe=u.useRef(!1),pe=u.useRef(!!f),ke=u.useRef(null);u.useEffect(()=>{var Se,Wt;if(!m)return;if(pe.current){const na=(Se=ke.current)==null?void 0:Se.querySelector('[aria-current="true"]');if(na){pe.current=!1,I.current=g,na.focus();return}}if(I.current!==g&&(I.current=g,oe.current=!0),!oe.current)return;const W=(Wt=S.current)==null?void 0:Wt.querySelector("h2");W&&(oe.current=!1,W.tabIndex=-1,W.focus())});const Me=async W=>{if(!a)return;U(null);const Se=await a(W);if(!Se.ok){U(Se.error);return}y(null),N({state:"loading"}),await X()},Yt=async()=>{if(!x.next_before)return;A(null);const W=await h.list({before:x.next_before});if(!W.ok){A(W.refusal.message);return}j(Se=>({...W.data,releases:[...Se.releases,...W.data.releases]}))},un=x.release_branch?s.jsx(wL,{value:x.release_branch.id,label:x.release_branch.name,options:n??[],can_write:x.can_write,onChange:Me}):null,se=m?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Read at ",jL(m.read_at)]}),o?s.jsxs(G,{variant:"ghost",size:"sm",onClick:o,children:[s.jsx(yl,{className:"mr-1 size-4","aria-hidden":!0}),"Read again"]}):null]}):un,He=m?Gz(((ht=x.releases[0])==null?void 0:ht.label)??((Ws=x.releases[0])==null?void 0:Ws.version)??null):Pz(((Js=x.releases[0])==null?void 0:Js.version)??null,((ea=x.release_branch)==null?void 0:ea.name)??null),qe={org:i??""};return s.jsxs(s.Fragment,{children:[s.jsx(Xk,{description:m?Zk:void 0,actions:se}),d,m?s.jsx(Vz,{}):null,k?s.jsx(zn,{error:k}):null,m?null:t,!m&&!x.release_branch?s.jsx(_L,{can_write:x.can_write,options:n??[],onChoose:Me}):null,x.release_branch||x.releases.length>0||m?s.jsxs("div",{ref:ke,className:"flex flex-col gap-6 md:flex-row md:items-start",children:[s.jsx(NL,{list:x,candidate:b?w:null,shown:H?or:Q!==null?es(Q):ae,onSelect:vt,roadmap:O.available?uL(((ta=x.planned)==null?void 0:ta.length)??0,je):null,planned_ranges:_e,can_load_older:!!x.next_before,older_error:M,onLoadOlder:Yt}),s.jsx("div",{className:"min-w-0 flex-1",ref:S,children:H?s.jsx(dL,{reads:O.reads,scope:te,onScope:re,onRead:Be,org:qe.org,onSelect:p}):Q!==null?s.jsx(tL,{id:Q,summary:((D=x.planned)==null?void 0:D.find(W=>W.id===Q))??null,org:qe.org,onNotFound:()=>c==null?void 0:c({kind:"planned",id:Q}),forecast:O.available?s.jsx(yL,{state:ue,id:Q}):null}):ae===$s?s.jsx(SL,{candidate:w,branch_name:((we=x.release_branch)==null?void 0:we.name)??null,can_write:x.can_write&&!!l,local:!!m,org:qe.org,onSelect:p,onRetry:$,onWrite:()=>K(!0)}):ae?s.jsx(CL,{detail:R[ae]??{state:"loading"},summary:x.releases.find(W=>W.version===ae)??null,local:!!m,org:qe.org,onSelect:p,onRetry:()=>ee(ae)}):(x.release_branch||m)&&w.state==="ready"?s.jsx(Iz,{title:He.title,text:He.text}):null})]}):null,l&&w.state==="ready"&&w.value?l({candidate:w.value,open:z,notice:V,onOpenChange:W=>{W||L(null),K(W)},onStale:async W=>{L(W),await C()},onWritten:async W=>{K(!1),L(null),await X(),y(W),await $()}}):null]})}function jL(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function wL({value:e,label:t,options:n,can_write:a,onChange:l}){const r=n.some(i=>i.id===e);return s.jsxs("div",{className:"grid w-56 gap-2",children:[s.jsx(Ue,{htmlFor:"release-branch",children:"Release branch"}),s.jsxs(xt,{value:e,onValueChange:l,disabled:!a,children:[s.jsx(dt,{id:"release-branch",children:s.jsx(gt,{})}),s.jsxs(ft,{children:[r?null:s.jsx(Ee,{value:e,children:t??"Unnamed branch"}),n.map(i=>s.jsx(Ee,{value:i.id,children:i.label},i.id))]})]}),a?null:s.jsx(p1,{})]})}function p1(){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 _L({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(xu,{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(Ue,{htmlFor:"release-branch-first",children:"Release branch"}),s.jsxs(xt,{onValueChange:n,disabled:!e,children:[s.jsx(dt,{id:"release-branch-first",children:s.jsx(gt,{placeholder:"Choose a branch"})}),s.jsx(ft,{children:t.map(a=>s.jsx(Ee,{value:a.id,children:a.label},a.id))})]})]}),e?null:s.jsx(p1,{})]})}function x1({children:e}){return s.jsx("p",{className:"text-muted-foreground px-3 pt-3 text-xs font-medium tracking-wide uppercase",children:e})}function NL({list:e,candidate:t,shown:n,onSelect:a,roadmap:l,planned_ranges:r,can_load_older:i,older_error:o,onLoadOlder:c}){var h,m;const d=!!e.local,f=(t==null?void 0:t.state)==="ready"&&t.value?so(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&&l?s.jsx(zc,{active:n===or,onClick:()=>a(or),version:"Roadmap",badges:null,caption:l}):null,t&&(t.state!=="ready"||t.value)?s.jsx(zc,{active:n===$s,onClick:()=>a($s),version:t.state==="ready"&&t.value?t.value.version:"Next release",badges:s.jsxs(s.Fragment,{children:[s.jsx(me,{variant:"info",children:"Candidate"}),f!=null&&f.breaking?s.jsx(me,{variant:"error",children:"Breaking"}):t.state==="ready"&&((h=t.value)==null?void 0:h.app_changed)===!1?s.jsx(me,{variant:"neutral",children:"App unchanged"}):t.state==="ready"&&((m=t.value)!=null&&m.classification)?s.jsx(me,{variant:"neutral",children:t.value.classification.bump}):null]}),caption:t.state==="loading"?"Classifying…":t.state==="error"?"Could not be read":Qk(t.value)}):null,d?s.jsx(kL,{list:e,shown:n,onSelect:a,ranges:r}):null,d&&e.releases.length>0?s.jsx(x1,{children:"Released"}):null,e.releases.map(x=>{const j=d?Yz(x):null;return s.jsx(zc,{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(me,{variant:"neutral",children:x.previous_release_id?x.bump??"patch":"First"}),x.breaking?s.jsx(me,{variant:"error",children:"Breaking"}):null]}),caption:(j==null?void 0:j.caption)??mx(x.written_at)},x.version)}),i?s.jsx(G,{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 kL({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(x1,{children:"Planned"}),e.planned_error?s.jsx(zn,{title:"Planned Releases could not be read",error:e.planned_error}):null,(e.planned??[]).map((l,r)=>s.jsx(zc,{active:t===es(l.id),onClick:()=>n(es(l.id)),version:l.name,badges:s.jsx(me,{variant:"neutral",children:"Planned"}),caption:`${l.members===0?"no members":`${l.members} member${l.members===1?"":"s"}`}${r===0?" · next":""}${a!=null&&a.get(l.id)?` · ${a.get(l.id)}`:""}`},l.id))]})}function SL({candidate:e,branch_name:t,can_write:n,local:a,org:l,onSelect:r,onRetry:i,onWrite:o}){var m;if(e.state==="loading")return s.jsx(On,{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(On,{children:s.jsx(zn,{error:e.error,onRetry:i})});const c=e.value;if(!c)return null;const d=so(c.changes),f=!c.previous_release,h=t??"the release branch";return s.jsxs(On,{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(me,{variant:"info",children:"Candidate"}),d.breaking?s.jsx(me,{variant:"error",children:"Breaking"}):c.app_changed===!1?s.jsx(me,{variant:"neutral",children:"App unchanged"}):c.classification?s.jsx(me,{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 ${h}'s head: `,Qk(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."}),(m=c.classification)!=null&&m.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(G,{onClick:o,children:[s.jsx(xu,{className:"mr-2 size-4"}),"Write Release ",c.next_version]}):null]}),a?s.jsx(Wz,{candidate:c,org:l,onSelect:r,notes:f?null:s.jsx(Mu,{changes:c.changes})}):f?null:s.jsx(Mu,{changes:c.changes})]})}function CL({detail:e,summary:t,local:n,org:a,onSelect:l,onRetry:r}){const[i,o]=u.useState(!1);if((t==null?void 0:t.state)==="unreadable")return s.jsxs(On,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:t.label??t.version}),s.jsx(zn,{title:"This Release could not be read",error:t.error??"Its record cannot be read."})]});if(e.state==="loading")return s.jsx(On,{children:s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:"Loading the Release…"})});if(e.state==="error")return s.jsx(On,{children:s.jsx(zn,{error:e.error,onRetry:r})});const c=e.value,d=!c.previous_release_id,f=c.bump&&c.computed_bump&&c.bump!==c.computed_bump,h=c.label??c.version,m=async()=>{await navigator.clipboard.writeText(Bz(h,so(c.changes))),o(!0)};return s.jsxs(On,{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(Jz,{release:c,onSelect:l}):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(me,{variant:"neutral",children:d?"First":c.bump}),so(c.changes).breaking?s.jsx(me,{variant:"error",children:"Breaking"}):null]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Written ",mx(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(G,{variant:"outline",onClick:m,children:[s.jsx(vR,{className:"mr-2 size-4"}),i?"Copied":"Copy notes"]})]}),n?s.jsx(eL,{release:c,org:a,onSelect:l,notes:d?null:s.jsx(Mu,{changes:c.changes})}):d?null:s.jsx(Mu,{changes:c.changes})]})}const RL=5,TL=e=>e.retry===!0||e.reason==="store_locked"||e.status===503;function EL({org:e,query:t,onSelect:n,home:a}){var M,A;const l=m1(),{href:r,Link:i}=We(),[o,c]=u.useState({state:"loading"}),[d,f]=u.useState(null),[h,m]=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.useCallback(async S=>{const E=y.current+=1;m(null);const C=await l.list(S?{fresh:!0}:void 0);if(E===y.current){if(C.ok){v.current=0,f(null),c({state:"ok",list:C.data});return}if(C.refusal.reason==="engine_missing"){c({state:"engine_missing",refusal:C.refusal});return}if(v.current+=1,v.current===1&&TL(C.refusal)){m(C.refusal.retry_after??RL);return}f(C.refusal)}},[l]);u.useEffect(()=>{b(!1)},[b]),u.useEffect(()=>{if(h===null)return;const S=setTimeout(()=>void b(!1),h*1e3);return()=>clearTimeout(S)},[h,b]),u.useEffect(()=>{var E;if(!p.current||o.state==="loading"||d||h!==null)return;p.current=!1;const S=(E=g.current)==null?void 0:E.querySelector("h1");S&&(S.tabIndex=-1,S.focus())});const w=()=>{p.current=!0,v.current=0,f(null),b(!0)},N=o.state==="ok"?o.list:null,R=t.roadmap?or:t.planned!==null?t.planned===""?(M=N==null?void 0:N.planned)!=null&&M[0]?es(N.planned[0].id):null:es(t.planned):t.release,_=`${t.release??""}|${t.planned??""}|${t.roadmap?"roadmap":""}`,k=u.useRef(_);u.useEffect(()=>{k.current!==_&&(k.current=_,j(null))},[_]);const U=u.useRef(!1),z=u.useCallback(S=>{U.current=!0,j(S)},[]),K=!x&&o.state==="ok"&&U.current;if(u.useEffect(()=>{K&&(U.current=!1)},[K]),x)return s.jsx(Ha,{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:r(a),backLabel:"All Releases",link:i});const V=h!==null?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(_n,{"aria-hidden":!0})," The release records are busy; reading again in ",h," s…"]}):null,L=d?s.jsxs(xe,{variant:"destructive",children:[s.jsx(rn,{}),s.jsx(Ne,{children:"Releases could not be read"}),s.jsxs(ge,{className:"flex flex-col items-start gap-2",children:[s.jsxs("span",{children:[d.message,N?" The last Releases read stay below.":""]}),s.jsx(G,{variant:"outline",size:"sm",onClick:w,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(bL,{initial:o.list,org:e,selection:{selected:R,onSelect:n},onReadAgain:w,onNotFound:z,notice:V||L?s.jsxs(s.Fragment,{children:[V,L]}):null,focusOnMount:K},((A=o.list.local)==null?void 0:A.read_at)??"list"):o.state==="engine_missing"?s.jsx(Zs,{page:"Releases"}):s.jsxs(s.Fragment,{children:[s.jsx(Xk,{description:Zk}),L??V??s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(_n,{"aria-hidden":!0})," Loading Releases…"]})]})})}const AL={threads:"Threads",tasks:"Tasks",queues:"Queues",worktrees:"Worktrees",workspaces:"Workspaces",chart:"Org chart"},ML={tasks:"Tasks",issues:"Issues",releases:"Releases"};function Lc(e,t){return e.kind==="home"?"Home":e.kind==="org"?AL[e.page]:e.kind==="project"?e.page?ML[e.page]:t??e.project:"Not found"}const OL="(max-width: 767px)";function $L(){const e=typeof window<"u"&&window.matchMedia?window.matchMedia(OL):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 pc({className:e=""}){return s.jsx("span",{"aria-hidden":"true",className:`block animate-pulse rounded-md bg-sidebar-accent ${e}`})}function Xv({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 Qv({item:e,collapsed:t}){const{Link:n}=We(),a=e.icon,l=e.title??(t?e.label:void 0),r=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:l?s.jsxs(hk,{children:[s.jsx(mk,{asChild:!0,children:r}),s.jsx(sx,{side:"right",children:l})]}):r})}const Zv="m-0 flex list-none flex-col gap-1 p-0";function Wv({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 Jv({page:e,collapsed:t,sheet:n=!1}){var M;const{href:a}=We(),{worktrees:l}=cn(),r=Nn(),{org:i,projects:o,loading:c,none:d,about:f,aboutFailed:h,domains:m,engine:x}=r,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"),R=A=>g?A:void 0,_=[{label:"Home",href:a(v||"/"),icon:OR,current:e.kind==="home"},...j?[]:[{label:"Threads",href:a(`${v}/threads`),icon:KR,current:e.kind==="org"&&e.page==="threads"}],...m.includes("tasks")&&!j?[{label:w,title:R(w),href:a(`${v}/tasks`),icon:j0,current:e.kind==="org"&&e.page==="tasks"}]:[],...j?[]:[{label:N,title:R(N),href:a(`${v}/queues`),icon:w0,current:e.kind==="org"&&e.page==="queues"}],...l&&!j?[{label:"Worktrees",href:a(`${v}/worktrees`),icon:b0,current:e.kind==="org"&&e.page==="worktrees"}]:[],{label:b,title:R(b),href:a(`${v}/workspaces`),icon:CR,current:e.kind==="org"&&e.page==="workspaces"},{label:"Org chart",href:a(`${v}/chart`),icon:WR,current:e.kind==="org"&&e.page==="chart"}],k=c?null:d?"No organization":(i==null?void 0:i.name)??"Organization",U=i?CT(i):null,z=f==null?void 0:f.version,K=z?t?z:`sdlc ${z}`:h?gu:ld,V=h||(f==null?void 0:f.sync.state)==="unknown"?NT:f===void 0?_T:wT;let L;return c?L=s.jsx("div",{className:"px-2 py-1",children:s.jsxs(Xv,{label:"Loading projects",children:[s.jsx(pc,{className:"h-4 w-32"}),s.jsx(pc,{className:"h-4 w-24"})]})}):o?L=s.jsx("ul",{className:Zv,children:o.map(A=>s.jsx(Qv,{collapsed:t,item:{label:A.name,title:A.name,href:a(`/proj/${encodeURIComponent(A.id)}`),icon:kR,current:e.kind==="project"&&e.project===A.id}},A.id))}):L=s.jsx("p",{className:"m-0 px-2 text-sm text-sidebar-foreground/70",children:d?"No projects":gu}),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(aR,{className:"size-4","aria-hidden":"true"})}),!t&&s.jsx("div",{className:"grid min-w-0 flex-1 text-left text-sm leading-tight",children:k===null?s.jsxs(Xv,{label:"Loading organization",children:[s.jsx(pc,{className:"h-4 w-28"}),s.jsx(pc,{className:"h-3 w-24"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-semibold",title:k,children:k}),U&&s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/70",children:U})]})})]}),s.jsxs("nav",{"aria-label":"App",className:"min-h-0 flex-1 overflow-y-auto",children:[s.jsx(Wv,{label:"Organization",collapsed:t,children:s.jsx("ul",{className:Zv,children:_.map(A=>s.jsx(Qv,{item:A,collapsed:t},A.label))})}),!t&&s.jsx(Wv,{label:"Projects",collapsed:t,children:L})]}),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:z?`sdlc ${z}`:void 0,children:K}),!t&&s.jsxs("p",{className:"m-0 flex items-start gap-2 px-2",children:[s.jsx(TR,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{children:V})]})]})]})}const DL="outline-hidden rounded-sm focus-visible:ring-2 focus-visible:ring-ring";function zL({page:e}){var c;const{href:t,Link:n}=We(),{org:a,projects:l,loading:r,none:i}=Nn(),o=[];if(r)o.push({label:ld});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=l==null?void 0:l.find(h=>h.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:Lc(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:Lc(e),href:t(f)}),o.push({label:e.item})}else e.kind!=="home"&&!(e.kind==="project"&&!e.page)&&o.push({label:Lc(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(yp,{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 ${DL}`,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 LL({page:e,children:t}){var g;const n=$L(),[a,l]=u.useState(!0),[r,i]=u.useState(!1),o=u.useRef(null),c=u.useRef(null),{org:d,projects:f,loading:h,none:m}=Nn(),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=h?ld:m?"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}${Lc(e,x)} · ${p} · sdlc viewer`},[e,x,d,h,m]);const j=()=>{var p;i(!1),(p=o.current)==null||p.focus()};u.useEffect(()=>{n||i(!1)},[n]);const v=n&&r;u.useEffect(()=>{var w;const p=c.current;if(!v||!p)return;(w=p.querySelector("a, button"))==null||w.focus();const b=N=>{var z;if(N.key==="Escape"){i(!1),(z=o.current)==null||z.focus();return}if(N.key!=="Tab")return;const R=[...p.querySelectorAll("a[href], button:not([disabled])")];if(R.length===0)return;const _=R[0],k=R[R.length-1],U=p.contains(document.activeElement);N.shiftKey&&(document.activeElement===_||!U)?(N.preventDefault(),k.focus()):!N.shiftKey&&(document.activeElement===k||!U)&&(N.preventDefault(),_.focus())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[v]);const y=!n&&!a;return s.jsx(fk,{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(Jv,{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(Jv,{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(ad,{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?r:a,onClick:()=>n?i(p=>!p):l(p=>!p),children:s.jsx(eT,{className:"size-4","aria-hidden":"true"})}),s.jsx("span",{"aria-hidden":"true",className:"mr-2 h-4 w-px bg-border"}),s.jsx(zL,{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 vx="m-0 text-2xl font-semibold tracking-tight",yx="outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",bx=`rounded-sm font-medium text-primary no-underline hover:underline ${yx}`;function If({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 UL({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(If,{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(If,{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(If,{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?cl:ST})]})}const ey=`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 ${yx}`;function BL(){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 Vr(){const{href:e,Link:t}=We(),{loading:n,projects:a,none:l,failure:r,readAt:i,refresh:o,reading:c}=Nn(),[d,f]=u.useState(""),h=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:vx,children:"Projects"}),!l&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:kT})]});if(l)return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,s.jsx(UL,{why:l==="not_in_git"?{kind:"not_in_git"}:AT(l)})]});const m=r!=null&&r.shown?r: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:[h,m&&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:N0(m.refusal,i)}),s.jsx("div",{children:s.jsx("button",{type:"button",className:ey,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 ${yx}`}),!m&&s.jsx("button",{type:"button",className:`${ey} ml-auto`,onClick:o,disabled:c||n,children:"Refresh"})]}),r&&!r.shown&&i&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`Showing the list read at ${ci(i)}; reading again in ${r.retryInSeconds??10} seconds.`})]}),n?s.jsx(BL,{}):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:bx,children:j.name})}),s.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:j.location??gu}),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 g1({title:e,children:t}){const{href:n,Link:a}=We();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:vx,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 ${bx}`,children:"Back to the organization's Home"})})]})})}const HL={tasks:"Tasks",issues:"Issues",releases:"Releases"};function ao({project:e}){const{href:t,Link:n}=We(),{org:a,projects:l,loading:r,domains:i}=Nn(),o=l==null?void 0:l.find(c=>c.id===e);return r?s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:ld}):l?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:vx,children:o.name}),s.jsx("p",{className:"m-0 font-mono text-sm text-muted-foreground",children:o.location??gu})]}),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:bx,children:HL[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(g1,{title:"Project not found",children:`There is no project '${e}' in this organization.`}):s.jsx(Vr,{})}const Ad=e=>e instanceof Error?e.message:String(e);async function v1(){try{const e=await fetch("api/threads",{cache:"no-store"});return e.status===404?{none:!0}:e.ok?{data:await e.json()}:{error:await e.text()||`HTTP ${e.status}`}}catch(e){return{error:Ad(e)}}}async function IL(){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 l={};for(const[r,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&&(l[r]=o)}return l}catch{return null}}async function PL(){try{return(await fetch("api/pin",{method:"HEAD",cache:"no-store"})).ok}catch{return!1}}async function qL(){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 GL(){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:Ad(e)}}}async function VL(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 l={};try{l=JSON.parse(a)??{}}catch{}return n.ok?{done:l}:{refused:{reason:typeof l.reason=="string"?l.reason:"failed",error:typeof l.error=="string"?l.error:a||`HTTP ${n.status}`,...typeof l.where=="string"&&l.where?{where:l.where}:{}}}}catch(n){return{refused:{reason:"failed",error:Ad(n)}}}}async function YL(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 Ad(n)}}const FL={probe:{source:async()=>{const e=await v1();if("error"in e)throw new Error(e.error);return{label:"Local workspace"}}}},y1={href:e=>e.replace(/^\/+/,"")||"./",Link:({href:e,className:t,children:n,...a})=>s.jsx("a",{href:e,className:t,...a,children:n})},KL={label:"Local viewer",can:()=>!1};function XL(){return u.useEffect(()=>{document.title="Shared app UI · SDLC Workspace Viewer"},[]),s.jsx("div",{className:"app-ui dark",children:s.jsx(p0,{data:FL,router:y1,identity:KL,children:s.jsx(HC,{})})})}const QL="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.",ZL=3e4,WL="Reading the workspaces. On a plan workspace this can take a few minutes.",JL="The read failed. Details are in the terminal running sdlc viewer.",e6={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"}},t6=e=>e6[e]??{label:e,tone:"neutral"},ja=e=>e.slice(0,8),b1={human:"Human",ai:"AI"},xm=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function n6(){const e=cn().workspaces;if(!e)throw new Error("The Workspaces page rendered without the workspaces seam.");return e}function s6(e){const t=n6(),[n,a]=u.useState(null),[l,r]=u.useState(null),[i,o]=u.useState(!1),c=u.useRef(null),d=u.useRef(!1),f=u.useRef(null),h=u.useCallback(()=>{if(f.current)return f.current;const y=(async()=>{const g=await t.overview();g.ok?(a(g.data),r(null),o(!1)):(r(g.refusal),o(!0))})().finally(()=>{f.current=null});return f.current=y,y},[t]);u.useEffect(()=>{h()},[h]),Tu(()=>void h(),ZL),u.useEffect(()=>{var y;d.current&&(n||l)&&(d.current=!1,(y=c.current)==null||y.focus())},[n,l]);const m=()=>{d.current=!0,h()},x=n===null&&l===null,j=n===null&&l!==null,v=n?a6(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(Zt,{title:"Workspaces",description:QL,actions:s.jsxs(s.Fragment,{children:[v?s.jsx("p",{className:"text-muted-foreground text-xs",children:v}):null,s.jsxs(G,{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 h(),children:[s.jsx(yl,{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?j1(n,i):""})]})}),s.jsxs("div",{ref:c,tabIndex:-1,className:"outline-none",children:[x?s.jsx(l6,{}):null,j&&l?s.jsx(r6,{refusal:l,on_retry:m}):null,n?s.jsx(i6,{overview:n}):null]})]})}function j1(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 a6(e,t){const n=`Read at ${ss(new Date(e.read_at).toISOString())}`,a=j1(e,t);return a?`${n} · ${a}`:n}function l6(){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(wt,{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:WL})]})}function r6({refusal:e,on_retry:t}){const n=e.reason==="store_locked"?N0(e,null):JL;return s.jsxs(xe,{variant:"destructive",className:"mt-6",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read workspaces"}),s.jsxs(ge,{children:[s.jsx("p",{children:n}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function i6({overview:e}){const{counts:t}=e,n=[xm(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(xc,{id:"workspaces-lineage",title:"Lineage",caption:"Each workspace under the one it forked from",children:s.jsx(o6,{rows:e.workspaces})}),s.jsx(xc,{id:"workspaces-authority",title:"Authority and resolver",caption:"What this checkout's workspace may change",children:s.jsx(c6,{authority:e.authority})})]}),s.jsx(xc,{id:"workspaces-activity",className:"mt-4",title:"Integration activity",caption:"Newest first",children:e.activity.length===0?s.jsx(ty,{children:"No integration or reconciliation attempts yet."}):s.jsx(d6,{rows:e.activity})}),s.jsx(xc,{id:"workspaces-handoffs",className:"mt-4",title:"Handoffs",children:e.handoffs.length===0?s.jsx(ty,{children:"No Handoffs prepared yet."}):s.jsx(f6,{rows:e.handoffs})})]})}function xc({id:e,title:t,caption:n,className:a,children:l}){return s.jsxs("section",{"aria-labelledby":e,className:le("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]}),l]})}const ty=({children:e})=>s.jsx("p",{className:"text-muted-foreground text-sm",children:e}),Ou=({children:e,tone:t})=>s.jsx("div",{className:le("text-xs",t==="error"?"text-destructive":"text-muted-foreground"),children:e});function lo({status:e}){const t=t6(e);return s.jsx(me,{variant:t.tone,children:t.label})}function Md({label:e,children:t}){return s.jsx(_t,{role:"group","aria-label":e,tabIndex:0,className:"overflow-x-auto outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:t})}function o6({rows:e}){return s.jsx(Md,{label:"Workspaces",children:s.jsxs(Ye,{containerClassName:"overflow-visible",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Workspace"}),s.jsx(F,{children:"Actor"}),s.jsx(F,{children:"Forked from"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Projection"})]})}),s.jsx(Fe,{children:e.map(t=>s.jsxs(ce,{"data-testid":"workspaces-row",children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-mono font-medium",children:t.short_id}),s.jsx(Ou,{children:t.current?`${t.path} · This checkout`:t.path}),t.projection==="unreadable"&&t.projection_error&&s.jsx(Ou,{children:t.projection_error})]}),s.jsx(q,{children:b1[t.actor]}),s.jsx(q,{children:t.source_id?s.jsx("span",{className:"font-mono",children:ja(t.source_id)}):s.jsx("span",{className:"text-muted-foreground",children:"No source"})}),s.jsx(q,{children:s.jsx(lo,{status:t.status})}),s.jsx(q,{children:s.jsx(lo,{status:t.projection})})]},t.id))})]})})}function c6({authority:e}){const t=e.resolver,n=[["Workspace",s.jsx("span",{className:"font-mono",children:ja(e.workspace_id)},"id")],["Actor",b1[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(lo,{status:t.state==="ready"?"ready":"needs_attention"},"resolver")]),t.state==="needs_attention"&&t.issue&&n.push(["Resolver issue",t.issue]),s.jsx(Md,{label:"Authority and resolver",children:s.jsx(Ye,{containerClassName:"overflow-visible",children:s.jsx(Fe,{children:n.map(([a,l])=>s.jsxs(ce,{children:[s.jsx(F,{scope:"row",className:"text-muted-foreground font-normal",children:a}),s.jsx(q,{children:l})]},a))})})})}function u6(e){const t=[e.merge_attempts?xm(e.merge_attempts,"merge attempt"):null,e.resolver_attempts?xm(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 d6({rows:e}){return s.jsx(Md,{label:"Integration activity",children:s.jsxs(Ye,{containerClassName:"overflow-visible",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"Change"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Attempts"}),s.jsx(F,{children:"Updated"})]})}),s.jsx(Fe,{children:e.map((t,n)=>s.jsxs(ce,{children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-medium",children:t.kind==="integration"?`Integrate ${ja(t.child_id)} into ${ja(t.other_id)}`:`Reconcile ${ja(t.child_id)} from ${ja(t.other_id)}`}),s.jsx(Ou,{children:t.kind==="integration"?"Integration":"Source reconciliation"})]}),s.jsx(q,{children:s.jsx(lo,{status:t.status})}),s.jsx(q,{children:u6(t)}),s.jsx(q,{children:gk(t.updated_at)})]},`${t.kind}-${t.child_id}-${t.other_id}-${t.updated_at}-${n}`))})]})})}function f6({rows:e}){return s.jsx(Md,{label:"Handoffs",children:s.jsxs(Ye,{containerClassName:"overflow-visible",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{children:"From"}),s.jsx(F,{children:"To"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Pinned"})]})}),s.jsx(Fe,{children:e.map(t=>s.jsxs(ce,{children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-mono font-medium",children:ja(t.child_id)}),t.error?s.jsx(Ou,{children:t.error}):null]}),s.jsx(q,{className:"font-mono",children:ja(t.source_id)}),s.jsx(q,{children:s.jsx(lo,{status:t.status})}),s.jsx(q,{children:`${t.child_commit} onto ${t.source_commit}`})]},t.id))})]})})}const ny="This machine's worktrees of this repository.",h6="Merge sends one whose thread is at rest to the main queue.",m6=3e4,p6=3e3,x6=6e5,Pf=[{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"}],ai={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"}},g6="no thread to land it",jx="its thread waits on you",w1="its thread is done",_1="its thread is retired",wx=e=>e.archivable&&e.cleanup==="user",v6=e=>e.queue!==null||e.merge.offered===!1&&e.merge.why==="already in a promotion queue",y6=e=>!e.merge.offered&&(e.merge.why===w1||e.merge.why.startsWith(_1)),_x=e=>!e.merge.offered&&e.merge.why===g6||y6(e),qf=(e,t)=>t==="all"?!0:t==="decide"?wx(e):(e.landed!==null?"landed":v6(e)?"queued":_x(e)?"orphan":"needs")===t,b6=e=>e.landed!==null?e.threads.some(t=>t.phase!=="done"):e.threads.length>0&&!_x(e);function Uc(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 N1(e){const t=e%100,n=t>=11&&t<=13?"th":{1:"st",2:"nd",3:"rd"}[e%10]??"th";return`${e}${n}`}function j6(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 Gf=e=>ss(new Date(e*1e3).toISOString()),mi=e=>e.charAt(0).toUpperCase()+e.slice(1);function w6(e,t){var l;const n=t.phase?mi(t.phase):"No phase",a=e.merge;if(!a.offered&&a.why.startsWith(_1)){const r=(l=/; (.+) continues it$/.exec(a.why))==null?void 0:l[1];return r?`Retired · continued by ${r}`:"Retired"}return t.phase==="done"||!a.offered&&a.why===w1?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===jx?`${n} · waits on you`:a.why.startsWith("its session is not running")?`${n} · session not running`:n}function _6(){const e=cn().worktrees;if(!e)throw new Error("The Worktrees page rendered without the worktrees seam.");return e}function N6({org:e}){var $,X;const t=_6(),[n,a]=u.useState(null),[l,r]=u.useState(null),[i,o]=u.useState(null),[c,d]=u.useState(!1),[f,h]=u.useState("all"),[m,x]=u.useState(""),[j,v]=u.useState({}),y=u.useRef({}),{confirm:g,confirm_dialog:p}=Ro(),b=u.useRef(!1),w=u.useCallback(async()=>{if(b.current)return;b.current=!0;const T=await t.list();b.current=!1,T.ok?(a(T.data),r(null)):r(T.refusal)},[t]),N=u.useCallback(async()=>{const T=await t.sizes();d(!T.ok),T.ok&&o(T.data)},[t]);u.useEffect(()=>{w(),N()},[w,N]);const R=(n==null?void 0:n.rows.some(T=>{var P,J;return((P=T.write)==null?void 0:P.state)==="waiting"||((J=T.write)==null?void 0:J.state)==="running"}))??!1;Tu(()=>void w(),R?p6:m6),Tu(()=>void N(),x6);const _=(n==null?void 0:n.rows)??[],k=T=>i==null?void 0:i.sizes[T.path],U=_.filter(wx),z=i?U.reduce((T,P)=>T+(k(P)??0),0):null,K=_.length===0?ny:`${ny} ${h6}${U.length?` ${U.length} ${U.length===1?"is":"are"} yours to decide${z!==null?`: removing them frees about ${Uc(z)}`:""}.`:""}`,V=m.trim().toLowerCase(),L=T=>!V||[T.name,T.path,T.branch??"",...T.threads.map(P=>P.title??P.thread)].some(P=>P.toLowerCase().includes(V)),M=_.filter(T=>qf(T,f)&&L(T)).sort((T,P)=>{if(f==="decide")return(k(P)??0)-(k(T)??0);const J=ee=>b6(ee)?ee.merge.offered?0:1:2;return J(T)-J(P)||(T.idle_days??1/0)-(P.idle_days??1/0)}),A=async(T,P)=>{const J=await(T==="merge"?t.merge(P.path):t.remove(P.path));J.ok?v(({[P.path]:ee,...ve})=>ve):v(ee=>({...ee,[P.path]:J.refusal.message})),await w()},S=async T=>{if(!T.merge.offered)return;const P=T.threads.find(H=>H.thread===(T.merge.offered&&T.merge.thread)),J=(P==null?void 0:P.title)??T.merge.thread,ee=P!=null&&P.holds.length?`has ${P.holds.length} open hold(s) (${P.holds.join(", ")})`:"has no open holds",ve=T.merge.lands.by==="manager"?`on its turn the queue's merge manager, ${T.merge.lands.manager}, lands it on main`:"on its turn that thread lands it on main",Q=T.merge.caveat?`
|
|
388
|
-
|
|
389
|
-
Its session could not be read: ${T.merge.caveat}. A turn it does not start passes on.`:"";await g({title:`Send ${T.name} to the main queue`,description:`This joins the main promotion queue for its thread, ${J}, which ${ee} and is told of the join. The queue checks the branch first, and ${ve}. Nothing reaches main before then.${Q}`,action_label:"Join the main queue"})&&await A("merge",T)},E=async T=>{const P=k(T);await g({title:`Remove ${T.name}?`,description:`This deletes the folder ${T.path}${P!==void 0?` and frees about ${Uc(P)}`:""}.${T.branch?` Its branch ${T.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 ${T.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})&&(P!==void 0&&(y.current[T.path]=P),await A("remove",T))},C=async T=>{await t.dismiss(T),await w()};return(l==null?void 0:l.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(Zs,{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(Zt,{title:"Worktrees",description:K}),!n&&!l&&s.jsx(k6,{}),l?s.jsx(S6,{refusal:l,read_at:n==null?void 0:n.read_at,on_retry:()=>void w()}):null,n!=null&&n.stale?s.jsxs(xe,{variant:"destructive",className:"mt-4",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read worktrees"}),s.jsxs(ge,{children:[s.jsxs("p",{children:[n.stale.message," This list was read at ",ss(new Date(n.read_at).toISOString()),"."]}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void w(),children:"Retry"})]})]}):null,n==null?void 0:n.removals.map(T=>s.jsxs(xe,{variant:"success",className:"mt-4",role:"status",children:[s.jsx(Ne,{children:y.current[T.path]!==void 0?`Removed ${T.name} and freed ${Uc(y.current[T.path])}`:`Removed ${T.name}`}),s.jsxs(ge,{children:[s.jsx("p",{children:T.branch?`Its branch ${T.branch} stays, and its records were saved.`:"Its records were saved."}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void C({removal:T.path}),children:"Dismiss"})]})]},T.path)),n&&_.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(b0,{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(Tt,{type:"search",className:"w-64","aria-label":"Search worktrees",placeholder:"Search worktrees",value:m,onChange:T=>x(T.target.value)}),s.jsxs("p",{className:"text-muted-foreground ml-auto text-xs",children:["Read at ",ss(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:Pf.map(T=>s.jsxs(G,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":f===T.id,onClick:()=>h(T.id),children:[T.label," ",_.filter(P=>qf(P,T.id)).length]},T.id))}),M.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(sd,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No worktrees match"}),V?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",($=Pf.find(T=>T.id===f))==null?void 0:$.empty," matches “",m,"”. Clear the search to see all"," ",_.filter(T=>qf(T,f)).length,"."]}),s.jsx(G,{type:"button",variant:"outline",onClick:()=>x(""),children:"Clear search"})]}):s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(X=Pf.find(T=>T.id===f))==null?void 0:X.empty," right now."]})]}):s.jsx(_t,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ye,{containerAriaLabel:"Worktrees",className:"table-fixed",children:[s.jsx(Ze,{children:s.jsxs(ce,{children:[s.jsx(F,{className:"w-[24%]",children:"Worktree"}),s.jsx(F,{className:"w-[24%]",children:"Threads"}),s.jsx(F,{className:"w-[12%]",children:"Landed"}),s.jsx(F,{className:"w-[18%]",children:"Cleanup"}),s.jsx(F,{className:"hidden w-[10%] md:table-cell",children:"Last commit"}),s.jsx(F,{className:"w-[12%] text-right",children:"Actions"})]})}),s.jsx(Fe,{children:M.map(T=>s.jsx(C6,{org:e,row:T,size:k(T),sizes:i!==null?"read":c?"failed":"measuring",can_write:n.can_write,sent:j[T.path],on_merge:()=>void S(T),on_remove:()=>void E(T),on_dismiss:P=>void C(P),on_clear_sent:()=>v(({[T.path]:P,...J})=>J)},T.path))})]})})]}):null,p]})}function k6(){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(wt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function S6({refusal:e,read_at:t,on_retry:n}){const a=ls();return e.reason==="view_outdated"?s.jsxs(xe,{variant:"warning",className:"mt-6",children:[s.jsx(rn,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:$r}),s.jsx(ge,{children:a})]}):s.jsxs(xe,{variant:"destructive",className:"mt-6",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"Could not read worktrees"}),s.jsxs(ge,{children:[s.jsxs("p",{children:[e.message,t?` This list was read at ${ss(new Date(t).toISOString())}.`:""]}),s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function gc({children:e,muted:t=!0}){return s.jsx("div",{className:le("truncate text-xs",t&&"text-muted-foreground"),title:e,children:e})}function C6({org:e,row:t,size:n,sizes:a,can_write:l,sent:r,on_merge:i,on_remove:o,on_dismiss:c,on_clear_sent:d}){const{href:f,Link:h}=We(),m=e?`/org/${encodeURIComponent(e)}`:"",x=f(`${m}/threads`),j=f(`${m}/tasks`),v=ai[t.landed??"not_landed"],y=wx(t),g=t.write,p=(g==null?void 0:g.state)==="waiting"||(g==null?void 0:g.state)==="running",b=t.threads.find(K=>"thread"in t.merge&&K.thread===t.merge.thread)??t.threads[0],w=t.merge,N=!w.offered&&w.why===jx,R=l&&t.landed===null&&!t.queue&&!N&&!_x(t),_=n!==void 0?Uc(n):a==="measuring"?"Measuring size…":a==="failed"?"Size could not be read":null,k=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]},U=k.second.filter(Boolean).join(" · "),z=t.path.slice(0,t.path.length-t.name.length-1)||".";return s.jsxs(s.Fragment,{children:[s.jsxs(ce,{"data-testid":"worktrees-row",children:[s.jsxs(q,{children:[s.jsx("div",{className:"truncate font-medium",title:t.name,children:t.name}),s.jsx(gc,{children:t.branch??"Detached"}),z!==".sdlc-worktrees"?s.jsx(gc,{children:`in ${z}`}):null]}),s.jsx(q,{children:b?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"truncate",title:b.title??b.thread,children:b.title??b.thread}),s.jsx(gc,{children:`${w6(t,b)}${t.threads.length>1?` · ${t.threads.length-1} more`:""}`})]}):s.jsx("span",{className:"text-muted-foreground",children:"No thread"})}),s.jsx(q,{children:s.jsx(me,{variant:v.tone,children:v.label})}),s.jsxs(q,{children:[s.jsx("div",{className:le("truncate",k.muted&&"text-muted-foreground"),children:k.label}),U?s.jsx("div",{className:"hidden md:block",children:s.jsx(gc,{children:U})}):null]}),s.jsx(q,{className:"hidden md:table-cell",children:j6(t.idle_days)}),s.jsx(q,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[p?s.jsx(G,{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(me,{variant:ai.queued.tone,children:`${ai.queued.label} · ${N1(t.queue.position)}`}):N?s.jsx(h,{href:j,"aria-label":`${t.name}: its thread waits on you, in Waiting on you`,children:s.jsx(me,{variant:ai.needs_you.tone,children:ai.needs_you.label})}):R?s.jsx(G,{type:"button",variant:"outline",size:"sm",title:w.offered?void 0:w.why,"aria-disabled":!w.offered||void 0,className:le(!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&&l&&!p?s.jsx(G,{type:"button",variant:"outline",size:"sm","aria-label":`Remove ${t.name}`,onClick:o,children:"Remove"}):null]})})]}),s.jsx(R6,{row:t,threads:x,tasks:j,merge_shown:R,sent:r,on_dismiss:c,on_clear_sent:d})]})}function R6({row:e,threads:t,tasks:n,merge_shown:a,sent:l,on_dismiss:r,on_clear_sent:i}){var j,v,y,g;const{Link:o}=We(),c=(p="Open in Threads")=>s.jsx(o,{className:"text-primary text-sm hover:underline",href:t,children:p}),d=p=>s.jsx(G,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:p,children:"Dismiss"}),f=e.write,h=e.threads.find(p=>p.thread===("thread"in e.merge?e.merge.thread:void 0))??e.threads[0],m=(h==null?void 0:h.title)??"Its thread";let x=null;if(l)x=s.jsxs(xe,{variant:"destructive",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:"It was not sent"}),s.jsxs(ge,{children:[s.jsx("p",{children:l}),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(xe,{variant:f.told?"success":"warning",role:"status",children:[s.jsx(Ne,{children:`${e.name} joined the main queue, ${N1(f.position)}`}),s.jsxs(ge,{children:[s.jsx("p",{children:f.told?`${m} 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 ${Gf(e.queue.passes_at)}.`}):null,s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>r({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(xe,{variant:"destructive",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:f.kind==="merge"&&f.state==="failed"?`${e.name} did not join`:p}),s.jsxs(ge,{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(()=>r({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(xe,{variant:"warning",children:[s.jsx(ut,{className:"size-4","aria-hidden":"true"}),s.jsx(Ne,{children:`${e.name}'s turn ${p.outcome==="failed"?"failed":"passed on"} at ${Gf(p.left_at)}`}),s.jsxs(ge,{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(()=>r({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 ${Gf(e.queue.passes_at)}. `,c()]}):!e.merge.offered&&e.merge.why===jx?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(ce,{className:"hover:bg-transparent",children:s.jsx(q,{colSpan:6,className:"pt-0",children:x})}):null}const T6=["reason","since","store","repository","folder","home","member_path"];function k1(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 T6){const l=t==null?void 0:t[a];typeof l=="string"&&(n[a]=l)}return n}function wl({base:e="",fetcher:t=fetch}){return async(n,a={})=>{const l=new URLSearchParams;for(const[c,d]of Object.entries(a))if(Array.isArray(d))for(const f of d)l.append(c,f);else d!==void 0&&d!==!1&&d!==""&&l.set(c,String(d));const r=l.size>0?`?${l.toString()}`:"";let i;try{i=await t(`${e}api/app/${n}${r}`,{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:k1(i.status,o)}}}function E6(e={}){const t=wl(e),n=l=>async()=>{const r=await t("access");return r.ok?{ok:!0,data:r.data[l]}:r},a=encodeURIComponent;return{tasks:{access:n("tasks"),configuration:()=>t("tasks/configuration"),listTasks:l=>t(`tasks/lists/${a(l)}/tasks`),task:l=>t(`tasks/tasks/${a(l)}`)},issues:{access:n("issues"),list:(l={})=>t("issues",l),issue:l=>t(`issues/${a(l)}`),issueSections:l=>t(`issues/${a(l)}/sections`),issueRelated:l=>t(`issues/${a(l)}/related`)},releases:{access:n("releases"),list:()=>t("releases"),release:l=>t(`releases/${a(l)}`),candidate:()=>t("releases/candidate")},organizations:{access:n("organizations"),list:()=>t("orgs")},projects:{access:n("projects"),list:()=>t("projects")},about:{about:()=>t("about")}}}function A6(e={}){const t=wl(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 pi=e=>({ok:!1,refusal:{status:0,message:e}});function Nx({base:e="",fetcher:t=fetch}){return async(n,a)=>{let l;try{l=await t(`${e}api/${n}`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch{return pi("The viewer did not answer. Is sdlc viewer still running?")}const r=await l.json().catch(()=>null);return l.ok?{ok:!0,data:r}:{ok:!1,refusal:k1(l.status,r)}}}function M6(e={}){const t=wl(e),n=Nx(e);return{chart:()=>t("org"),change:a=>n("org-change",a)}}function O6(e={}){const t=wl(e),n=o=>`tasks/tasks/${encodeURIComponent(o)}`,{base:a="",fetcher:l=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(h=>h.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,h;return c.state==="archived"?Promise.resolve(pi("This checkout keeps no archived tasks.")):c.assigned_to_me?Promise.resolve(pi("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:(h=c.all_groups)!=null&&h.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()=>pi("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 l(`${a}api/task-done`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}catch{return pi("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 $6(e={}){const t=wl(e),n=Nx(e),a=encodeURIComponent,l=r=>r!=null&&r.fresh?{fresh:1}:{};return{access:async()=>{const r=await t("access");return r.ok?{ok:!0,data:r.data.releases}:r},list:(r={})=>t("releases",l(r)),release:(r,i)=>t(`releases/${a(r)}`,l(i)),candidate:r=>t("releases/candidate",l(r)),candidateBatch:r=>t("releases/candidate/batch",l(r)),related:(r,i)=>t(`releases/${a(r)}/related`,l(i)),plannedRelease:(r,i)=>t(`releases/planned/${a(r)}`,l(i)),roadmap:r=>t("releases/roadmap",{...l(r),...r!=null&&r.mine?{mine:1}:{}}),roadmapMoved:r=>t("releases/roadmap/moved",l(r)),roadmapSeen:r=>n("roadmap/seen",{at:r})}}function D6(e={}){const t=wl(e),n=Nx(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 z6(e={}){const t=wl(e);return{overview:()=>t("workspaces")}}const L6=15e3,U6=10,sy="idle-sessions-list",ay="idle-sessions-heading",ly="idle-sessions-confirm-text";function S1(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${Math.round(e)} MB`}const B6=e=>`${Number.isInteger(e)?e:e.toFixed(1)} h`,C1=e=>e===1?"1 session":`${e} sessions`;function H6(e){const t=e.released.length?`Closed ${C1(e.released.length)}.`:"Closed no sessions.";return e.kept.length?`${t} Kept ${e.kept.length}:`:t}function I6({row:e}){const t=[e.name,e.retired?"continued in another session":"",`idle ${B6(e.idle_hours)}`,S1(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 P6(){const[e,t]=u.useState(null),[n,a]=u.useState(!1),[l,r]=u.useState(!1),[i,o]=u.useState(null),[c,d]=u.useState(null),[f,h]=u.useState(""),m=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 L=++g.current,M=await qL();if(!M||L<p.current)return;p.current=L,h("");const A=JSON.stringify(M);A!==m.current&&(m.current=A,t(M))},[]);u.useEffect(()=>{const L=setTimeout(b,0),M=setInterval(b,L6);return()=>{clearTimeout(L),clearInterval(M)}},[b]),u.useEffect(()=>{var M;const L=y.current;L&&(y.current=null,(M={cancel:j,close:x,dismiss:v}[L].current)==null||M.focus())});const w=(e==null?void 0:e.sessions.length)??0;if(u.useEffect(()=>{l&&!w&&i===null&&r(!1)},[l,w,i]),!w&&!c&&!f&&i===null)return null;const N=()=>{i===null&&(r(!0),y.current="cancel")},R=()=>{i===null&&(r(!1),y.current="close")},_=async()=>{if(i!==null)return;o(w),d(null),h("");const L=await GL();p.current=g.current+1,await b(),o(null),r(!1),a(!1),"error"in L?(h(`The sessions were not closed: ${L.error.replace(/\.+$/,"")}.`),y.current="close"):(d(L.done),y.current="dismiss")},k=()=>{d(null),y.current="close"},U=L=>{L.key==="Escape"&&(L.preventDefault(),R())},z=i!==null?`Closing ${C1(i)}…`:c?H6(c):"",K=(e==null?void 0:e.sessions.slice(0,U6))??[],V=w-K.length;return s.jsxs("div",{className:"idle",role:"group",...w?{"aria-labelledby":ay}:{"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:ay,"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 · ",S1(e.memory_mb)]})]}),s.jsxs("div",{className:"tools",children:[s.jsx("button",{type:"button",className:"pin","aria-expanded":n,"aria-controls":sy,"aria-label":n?"Hide the idle sessions list":"Show the idle sessions list",onClick:()=>a(L=>!L),children:n?"Hide":"Show"}),s.jsx("button",{type:"button",className:"pin",ref:x,"aria-expanded":l,"aria-label":"Close idle sessions…",onClick:N,children:"Close idle…"})]})]}),w>0&&s.jsxs("ul",{className:"idle-list",id:sy,hidden:!n,"aria-label":`Sessions idle over ${e==null?void 0:e.idle_over} hours, longest idle first`,children:[K.map(L=>s.jsx(I6,{row:L},L.session)),V>0&&s.jsx("li",{children:s.jsxs("p",{className:"caption muted",children:["…and ",V," more"]})})]}),l&&w>0&&s.jsxs("div",{className:"idle-confirm",role:"group","aria-label":"Close idle sessions","aria-describedby":ly,onKeyDown:U,children:[s.jsxs("p",{id:ly,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:R,children:"Cancel"})]})]}),s.jsx("p",{className:"idle-status",role:"status",children:z}),c&&s.jsxs(s.Fragment,{children:[c.kept.length>0&&s.jsx("ul",{className:"idle-list","aria-label":"Kept sessions",children:c.kept.map(L=>s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:L.title}),s.jsx("p",{className:"caption muted",children:L.why})]},L.session))}),s.jsx("div",{className:"tools start",children:s.jsx("button",{type:"button",className:"pin",ref:v,"aria-label":"Dismiss the close result",onClick:k,children:"Dismiss"})})]})]})}const ry={ok:"lime",you:"amber",alert:"red",waiting:"blue",blocked:"purple",muted:"grey",plain:"grey"};function Bc(e){return e&&Object.hasOwn(ry,e)?ry[e]:"grey"}const q6=1e4,G6=6e4,V6=2,Vf="#thread-",Y6=k0("Threads"),F6={working:"▶",prod:"↑",planned:"○"},iy=3,oy=["working","ready","prod","waiting","blocked","paused","planned"],K6={ready:"results ready",prod:"ready for prod"};function X6(e){const t=oy.map(a=>[a,e.filter(l=>l.state===a).length]),n=[...new Set(e.map(a=>a.state).filter(a=>!oy.includes(a)))].map(a=>[a,e.filter(l=>l.state===a).length]);return[...t,...n].filter(([,a])=>a>0).map(([a,l])=>`${l} ${K6[a]??a}`).join(" · ")}const Q6={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 Z6(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"]],cy={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"},uy=e=>e.kind??"idle",dy=e=>e.agent==="Codex"?"codex":"claude";function W6(e,t,n,a){const l=n.toLowerCase().split(/\s+/).filter(Boolean),r=gm.map(([v])=>v).filter(v=>a.has(v)),i=vm.map(([v])=>v).filter(v=>a.has(v)),o=v=>!r.length||r.includes(uy(v)),c=v=>!i.length||i.includes(dy(v)),d=v=>{if(!l.length)return!0;const y=v.search??v.title.toLowerCase();return l.every(g=>y.includes(g))},f=e.filter(d),h={};for(const[v]of gm)h[v]=f.filter(y=>c(y)&&uy(y)===v).length;for(const[v]of vm)h[v]=f.filter(y=>o(y)&&dy(y)===v).length;const m=[],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?m:x).push({row:v,depth:b.depth})),j.push(b)}),{rows:[...m,...x],pinned:m.length,counts:h,narrowed:l.length+r.length+i.length>0}}const J6=new Set(["not_terminal","another_process","continued","no_open","pending"]);function fy({label:e,count:t,hint:n}){const a=n?`hint-${e.toLowerCase().replace(/\W+/g,"-")}`:void 0;return s.jsxs(s.Fragment,{children:[s.jsxs("h2",{className:"group","aria-label":`${e}, ${t}`,"aria-describedby":a,children:[e,s.jsx("span",{className:"count",children:t})]}),n&&s.jsx("span",{className:"sr-only",id:a,children:n})]})}function Yf({text:e,role:t}){return s.jsx("span",{className:`badge tone-${Bc(t)}`,children:e})}function e5({serves:e}){const t=e.slice(0,V6),n=e.length-t.length;return s.jsxs("p",{className:"caption muted serves",children:[t.map((a,l)=>s.jsxs("span",{children:[l>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"]})]})]})}function hy({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 t5({onConnection:e,org:t=null,project:n=null}){const[a,l]=u.useState(null),[r,i]=u.useState(!1),[o,c]=u.useState(""),[d,f]=u.useState(!1),[h,m]=u.useState(null),[x,j]=u.useState(""),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,w]=u.useState(null),[N,R]=u.useState(""),[_,k]=u.useState(()=>new Set),[U,z]=u.useState(null),K=u.useRef(null),V=u.useRef(""),L=u.useRef(""),M=u.useRef(""),A=u.useRef(null),S=u.useRef(null),E=u.useRef(null),C=I=>{var oe;return I instanceof HTMLButtonElement&&I.classList.contains("pin")&&((oe=A.current)!=null&&oe.contains(I))?I.dataset.key??null:null},$=I=>{E.current=C(I.target)},X=()=>{setTimeout(()=>{C(document.activeElement)||(E.current=null)},0)},T=u.useCallback(async()=>{const I=await v1();if("none"in I){i(!0),c(""),e("live");return}if("error"in I){c(I.error),e("disconnected");return}i(!1),c(""),j(""),e("live");const oe=JSON.stringify(I.data);oe!==V.current&&(V.current=oe,l(I.data))},[e]);u.useEffect(()=>{let I=!0;PL().then(ke=>I&&f(ke));const oe=setTimeout(T,0),pe=setInterval(T,q6);return()=>{I=!1,clearTimeout(oe),clearInterval(pe)}},[T]),u.useEffect(()=>{let I=!0;const oe=()=>IL().then(ke=>{I&&ke&&y(Me=>JSON.stringify(Me)===JSON.stringify(ke)?Me:ke)});oe();const pe=setInterval(oe,G6);return()=>{I=!1,clearInterval(pe)}},[]),u.useEffect(()=>{const I=()=>{var Yt,un,se;const pe=window.location.hash;if(!pe.startsWith(Vf)){w(null);return}if(pe===L.current)return;let ke;try{ke=decodeURIComponent(pe.slice(Vf.length))}catch{ke=pe.slice(Vf.length)}const Me=document.getElementById(`thread-${ke}`);if(!Me||!((Yt=A.current)!=null&&Yt.contains(Me))){if(!A.current||!a)return;const He=M.current!==pe;if(M.current=pe,a.threads.some(qe=>qe.key===ke)){He&&(N||_.size)?(R(""),k(new Set)):L.current=pe,w(null);return}w(ke);return}L.current=pe,w(null),p(ke),(un=Me.querySelector(".thread-title"))==null||un.focus({preventScroll:!0}),(se=Me.scrollIntoView)==null||se.call(Me,{block:"center"})},oe=()=>{L.current="",M.current="",I()};return I(),window.addEventListener("hashchange",oe),()=>window.removeEventListener("hashchange",oe)},[a,N,_]),u.useEffect(()=>{if(!g)return;const I=()=>p(null);return document.addEventListener("pointerdown",I,!0),document.addEventListener("keydown",I,!0),()=>{document.removeEventListener("pointerdown",I,!0),document.removeEventListener("keydown",I,!0)}},[g]),u.useLayoutEffect(()=>{const I=E.current??S.current;if(!I||!A.current)return;const oe=document.activeElement;if(oe&&oe!==document.body&&!A.current.contains(oe)){E.current=null;return}const pe=[...A.current.querySelectorAll("button.pin")].find(ke=>ke.dataset.key===I);pe?oe!==pe&&pe.focus({preventScroll:I!==S.current}):E.current=null});const P=async I=>{if(h)return;const oe=!I.pinned;S.current=I.key,m(I.key);const pe=await YL(I.key,oe);m(null),pe||l(ke=>ke&&{...ke,threads:ke.threads.map(Me=>Me.key===I.key?{...Me,pinned:oe}:Me)}),await T(),j(pe?`The pin was not saved: ${pe}`:""),S.current===I.key&&(S.current=null)},[J,ee]=u.useState(()=>new Set),[ve,Q]=u.useState({}),O=ls(),{confirm:H,confirm_dialog:te}=Ro(),re=(I,oe)=>Q(pe=>{const{[I]:ke,...Me}=pe;return oe?{...Me,[I]:oe}:Me}),ye=(I,oe)=>ee(pe=>{const ke=new Set(pe);return oe?ke.add(I):ke.delete(I),ke}),ae=Object.keys(ve).some(I=>!J.has(I));u.useEffect(()=>{if(!ae)return;const I=()=>Q(oe=>Object.fromEntries(Object.entries(oe).filter(([pe])=>J.has(pe))));return document.addEventListener("pointerdown",I,!0),document.addEventListener("click",I,!0),()=>{document.removeEventListener("pointerdown",I,!0),document.removeEventListener("click",I,!0)}},[ae,J]);const je=I=>setTimeout(()=>{var oe,pe;return(pe=[...((oe=A.current)==null?void 0:oe.querySelectorAll("button.open-thread"))??[]].find(ke=>ke.dataset.key===I))==null?void 0:pe.focus()},0),ne=async(I,oe)=>{const pe=await H({title:`Reopen ${I.title} in Terminal?`,description:`Its session is closed. It opens in a new Terminal window in ${oe??"the thread's folder"}, running claude --resume.`,action_label:"Reopen"});return je(I.key),pe},at=async I=>{if(J.has(I.key))return;let oe=!1;for(;;){ye(I.key,!0),re(I.key,{key:I.key,text:Q6[I.where??""]??"Opening.",role:"waiting"});const pe=await VL(I.key,oe);if(ye(I.key,!1),"done"in pe){re(I.key,null);return}const{reason:ke,error:Me,where:Yt}=pe.refused;if(ke==="closed"&&!oe){if(re(I.key,null),!await ne(I,Yt))return;oe=!0;continue}const un=ke==="outdated"?`${Me.replace(/\.*$/,".")} ${O}`:Me.replace(/\.*$/,"."),se=ke==="terminal_denied"?"you":J6.has(ke)?"muted":"alert";re(I.key,{key:I.key,text:un,role:se});return}},ue=(a==null?void 0:a.threads)??[],Be=!r&&ue.length>0,Y=W6(ue,(a==null?void 0:a.pinnedCount)??0,N,_),Re=Y.pinned,Le=Y.rows;u.useEffect(()=>{if(!Be)return;const I=oe=>{var ke,Me;if(oe.key!=="/"||oe.ctrlKey||oe.metaKey||oe.altKey||oe.defaultPrevented)return;const pe=document.activeElement;pe&&(/^(INPUT|TEXTAREA|SELECT)$/.test(pe.tagName)||pe.isContentEditable)||document.querySelector('[role="dialog"], [role="alertdialog"], dialog[open]')||(oe.preventDefault(),(ke=K.current)==null||ke.focus(),(Me=K.current)==null||Me.select())};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[Be]);const vt=I=>k(oe=>{const pe=new Set(oe);return pe.has(I)?pe.delete(I):pe.add(I),pe}),_e=()=>{var I;R(""),k(new Set),(I=K.current)==null||I.focus()},Dt=(I,oe)=>{const pe=Y.counts[I]??0,ke=_.has(I),Me=cy[I];return s.jsxs("button",{type:"button",className:"filter-chip","aria-pressed":ke,"aria-describedby":Me?`chip-hint-${I}`:void 0,disabled:pe===0&&!ke&&U!==I,onFocus:()=>z(I),onBlur:()=>z(Yt=>Yt===I?null:Yt),onClick:()=>vt(I),children:[oe," ",pe]},I)};return s.jsxs(s.Fragment,{children:[te,s.jsxs("header",{className:"main-head",children:[s.jsx("h1",{children:"Threads"}),a&&!r&&s.jsx("p",{className:"muted",children:a.line})]}),s.jsxs("section",{className:"card threads","aria-label":"Threads",children:[s.jsx(P6,{}),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&&!r?s.jsxs(s.Fragment,{children:["Thread ",b," is not in this list. ",s.jsx("code",{children:"sdlc view --all"})," lists older threads."]}):null}),Be&&s.jsxs("div",{className:"threads-toolbar",children:[s.jsxs("div",{className:"search-field",children:[s.jsx("input",{ref:K,type:"search",placeholder:"Search threads","aria-label":"Search threads","aria-keyshortcuts":"/",value:N,onChange:I=>R(I.target.value),onKeyDown:I=>{I.key==="Escape"&&(I.preventDefault(),N?R(""):I.currentTarget.blur())}}),N&&s.jsx("button",{type:"button",className:"search-clear","aria-label":"Clear search",onClick:()=>{var I;R(""),(I=K.current)==null||I.focus()},children:s.jsx("span",{"aria-hidden":"true",children:"×"})})]}),s.jsxs("div",{className:"filter-row",children:[s.jsx("div",{className:"filter-group",role:"group","aria-label":"Status",children:gm.map(([I,oe])=>Dt(I,oe))}),s.jsx("div",{className:"filter-group",role:"group","aria-label":"Agent",children:vm.map(([I,oe])=>Dt(I,oe))})]}),Object.entries(cy).map(([I,oe])=>s.jsx("span",{className:"sr-only",id:`chip-hint-${I}`,children:oe},I)),s.jsx("p",{className:"caption muted narrowed",role:"status",children:Y.narrowed?s.jsxs(s.Fragment,{children:[Le.length," of ",ue.length," threads ·"," ",s.jsx("button",{type:"button",className:"clear-filters","aria-label":"Clear search and filters",onClick:_e,children:"Clear"})]}):null})]}),r?s.jsx("p",{className:"muted",children:Y6}):s.jsxs("div",{className:"thread-list",ref:A,onFocus:$,onBlur:X,children:[Le.map(({row:I,depth:oe},pe)=>s.jsxs("div",{children:[Re>0&&pe===0&&s.jsx(fy,{label:"Pinned",count:Re,hint:"Threads you pinned; they stay first in every order"}),Re>0&&pe===Re&&s.jsx(fy,{label:"Other threads",count:Le.length-Re}),s.jsx(n5,{depth:oe,row:v!=null&&v[I.key]?{...I,serves:v[I.key]}:I,arrived:g===I.key,pinnable:d&&typeof I.pinned=="boolean",pinning:h,onPin:()=>P(I),opening:J.has(I.key),note:ve[I.key]??null,onOpen:()=>at(I),org:t,project:n})]},I.key)),a&&!ue.length&&s.jsx("p",{className:"muted empty",children:"No threads at work or waiting."}),ue.length>0&&!Le.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."]})]})]})]})}function n5({row:e,depth:t,arrived:n,pinnable:a,pinning:l,onPin:r,opening:i,note:o,onOpen:c,org:d,project:f}){const h=p=>d?`org/${encodeURIComponent(d)}/tasks/${encodeURIComponent(p)}`:null,m=p=>f?`proj/${encodeURIComponent(f)}/issues/${encodeURIComponent(p)}`:null,x=[e.where||e.agent,e.phase,e.age,e.waitsOn?`waits on ${e.waitsOn}`:""].filter(Boolean).join(" · "),j=Z6(e),v=`open-note-${e.key}`,[y,g]=u.useState(!1);return s.jsxs("article",{className:n?"thread arrived":"thread",id:`thread-${e.key}`,style:{marginLeft:Math.min(t*22,110)},children:[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(Yf,{text:e.carried,role:"waiting"}),e.carriedBatch&&s.jsx(Yf,{text:e.carriedBatch.text,role:e.carriedBatch.role})]}):s.jsx(Yf,{text:e.status,role:e.role}),j&&s.jsx("button",{type:"button",className:"open-thread","data-key":e.key,"aria-label":`${j}: ${e.title}`,"aria-describedby":v,"aria-disabled":i?!0:void 0,"aria-busy":i?!0:void 0,onClick:()=>{i||c()},children:i?"Opening…":j}),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":l?!0:void 0,"aria-busy":l===e.key?!0:void 0,onClick:()=>{l||r()},children:e.pinned?"Unpin":"Pin"})]})]}),s.jsx("p",{className:"caption muted",children:x}),j&&s.jsx("p",{id:v,className:`caption open-note tone-${Bc((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}),e.serves&&e.serves.length>0&&s.jsx(e5,{serves:e.serves}),e.summary&&s.jsx("p",{className:"caption muted",children:e.summary}),e.carriedDetail&&s.jsx("p",{className:"line",children:e.carriedDetail}),e.step&&s.jsxs("p",{className:"caption muted",children:["step: ",e.step]}),e.lines.length>0&&s.jsx("p",{className:"caption muted lines-summary",children:X6(e.lines)}),(y?e.lines:e.lines.slice(0,iy)).map((p,b)=>s.jsxs("p",{className:`line tone-${Bc(p.role)}`,children:[s.jsxs("span",{"aria-hidden":"true",children:[F6[p.state]??"•"," "]}),p.state==="working"&&s.jsx("span",{className:"sr-only",children:"Working: "}),p.task!==void 0&&s.jsx(hy,{id:p.task,href:h(p.task)}),p.task!==void 0&&p.text?" ":null,p.text]},`l${b}`)),e.lines.length>iy&&s.jsx("button",{type:"button",className:"lines-more","aria-expanded":y,"aria-label":y?`Show fewer lines of work of ${e.title}`:`Show all ${e.lines.length} lines of work of ${e.title}`,onClick:()=>g(p=>!p),children:y?"Show fewer":`Show all ${e.lines.length}`}),(e.routed??[]).map(p=>s.jsxs("p",{className:"line",children:["routed ",s.jsx(hy,{id:p.issue,href:m(p.issue)}),p.title?` ${p.title}`:null]},`r${p.issue}`)),e.holds.map((p,b)=>s.jsx("p",{className:`line tone-${Bc(p.role)}`,children:p.text},`h${b}`)),e.plan&&s.jsx("p",{className:"caption muted",children:e.plan})]})}const s5=5e3;function a5(){const[e,t]=u.useState([]),n=u.useRef(0),a=u.useRef(new Map),l=u.useCallback(c=>{const d=a.current.get(c);d&&clearTimeout(d),a.current.delete(c),t(f=>f.filter(h=>h.id!==c))},[]),r=u.useCallback((c,d)=>{const f=n.current+=1;t(h=>[...h.filter(m=>m.tone!=="error").slice(-2),{id:f,tone:c,message:d}]),c==="success"&&a.current.set(f,setTimeout(()=>l(f),s5))},[l]);u.useEffect(()=>{const c=a.current;return()=>{for(const d of c.values())clearTimeout(d)}},[]);const i=u.useMemo(()=>({success:c=>r("success",c),error:c=>r("error",c)}),[r]),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(G,{type:"button",variant:"ghost",size:"control",className:"shrink-0",onClick:()=>l(c.id),children:"Dismiss"})]},c.id))});return{notify:i,toasts:o}}const R1=/^#(?:(releases)|release=(.+)|planned(?:=(.+))?)$/,l5=/^#task=(.+)$/,r5=/^#issue=(.+)$/,i5=/^iss-\d{1,9}$/;function T1(e){return e.split("/").filter(Boolean).slice(1).join("/")}function o5(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,l,r,i]=n;if(a==="org"&&r==="tasks"&&i==="queues"&&n.length===4)return{forward:`org/${l}/queues${t}`};if(a==="org"&&r==="chat"&&n.length<=4)return{forward:`org/${l}/threads${i===void 0?"":`#thread-${i}`}`};if(a==="org"&&r==="tasks"&&n.length===4){const o=decodeURIComponent(i);return{page:{kind:"org",page:"tasks",item:o},org:decodeURIComponent(l),task:o}}if(a==="org"&&r==="issues"&&n.length<=4){const o=decodeURIComponent(l);return i===void 0?{page:{kind:"home"},org:o,issues:!0}:{page:{kind:"home"},org:o,issues:!0,issue:decodeURIComponent(i)}}if(a==="proj"&&r==="issues"&&n.length<=4){const o=decodeURIComponent(l),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 h=f.toString();return{page:{...c,item:d,...h?{list_query:h}:{}},issues:!0,project:o,issue:d}}if(a==="org"&&n.length<=3){const o=decodeURIComponent(l);if(r===void 0)return{page:{kind:"home"},org:o};if(r==="threads")return{page:{kind:"org",page:"threads"},org:o,threads:!0};if(r==="tasks")return{page:{kind:"org",page:"tasks"},org:o,tasks:!0};if(r==="chart")return{page:{kind:"org",page:"chart"},org:o,chart:!0};if(r==="worktrees")return{page:{kind:"org",page:"worktrees"},org:o,worktrees:!0};if(r==="workspaces")return{page:{kind:"org",page:"workspaces"},org:o,workspaces:!0};if(r==="queues")return{page:{kind:"org",page:"queues"},org:o,queues:!0};if(r==="releases")return{page:{kind:"home"},org:o,releasesForward:!0}}if(a==="proj"&&n.length<=3){const o=decodeURIComponent(l);if(r===void 0)return{page:{kind:"project",project:o}};if(r==="tasks")return{page:{kind:"project",project:o,page:"tasks"},tasks:!0};if(r==="releases")return{page:{kind:"project",project:o,page:"releases"},releases:!0}}return{page:{kind:"not_found"}}}const c5={label:"Local viewer",can:()=>!1},u5={connecting:"Connecting…",live:"Live · refreshes every 10s",disconnected:"Disconnected"},my=()=>s.jsx(g1,{title:"Page not found",children:"There is no page at this address in this viewer."});function d5({routeOrg:e}){const{org:t,engine:n}=Nn(),{project:a}=Lo(),[l,r]=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(Zs,{page:"Threads"})}):s.jsxs("div",{className:"main viewer-panel",children:[s.jsxs("p",{className:"connection",role:"status",children:[s.jsx("span",{className:`dot ${l}`,"aria-hidden":"true"}),u5[l]]}),s.jsx(t5,{onConnection:r,org:(t==null?void 0:t.slug)??e??null,project:a})]})}const Ga=()=>s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading…"});function f5({route:e,navigate:t}){var f;const{org:n,projects:a,loading:l,none:r}=Nn(),i=e.page.kind==="project"?e.page.project:null,o=i!==null&&a!==null&&!((f=a.find(h=>h.id===i))!=null&&f.current),c=e.org===void 0&&!o&&!l&&n!==null?`org/${encodeURIComponent(n.slug)}/tasks`:null;if(u.useEffect(()=>{c&&t(c)},[c,t]),i!==null&&o)return s.jsx(ao,{project:i});if(c||e.org===void 0&&l)return s.jsx(Ga,{});const d=(n==null?void 0:n.slug)??e.org;return d===void 0&&i!==null?s.jsx(ao,{project:i}):d===void 0&&r?s.jsx(Vr,{}):d===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Tasks open once the organization reads."}):s.jsx(sD,{org:d})}function h5({route:e,navigate:t}){const{org:n,loading:a,none:l}=Nn(),r=e.org===void 0&&!a&&n!==null?`org/${encodeURIComponent(n.slug)}/queues${window.location.search}`:null;if(u.useEffect(()=>{r&&t(r)},[r,t]),r||e.org===void 0&&a)return s.jsx(Ga,{});const i=(n==null?void 0:n.slug)??e.org;if(i===void 0&&l)return s.jsx(Vr,{});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(U3,{org:i,open:o,path:`/org/${encodeURIComponent(i)}/queues`})}function m5({route:e,navigate:t}){var j;const{org:n,projects:a}=Nn(),{project:l,settled:r}=Lo(),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&&l!==null?`proj/${encodeURIComponent(l)}/issues${e.issue?`/${encodeURIComponent(e.issue)}`:""}${c}`:null;u.useEffect(()=>{d&&t(d)},[d,t]);const[f,h]=u.useState(()=>window.location.search.replace(/^\?/,"")),m=u.useCallback(v=>{window.history.replaceState(window.history.state,"",`${window.location.pathname}${v?`?${v}`:""}`),h(v)},[]);if(i!==null&&o)return s.jsx(ao,{project:i});if(d||i===null&&!r)return s.jsx(Ga,{});if(i===null)return s.jsx(Vr,{});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(S3,{org:x,project:i,issue_id:e.issue,from:v,query:f})}return s.jsx(h3,{org:x,project:i,query:f,onQuery:m})}function p5({issue:e,navigate:t,home:n}){const{project:a,settled:l}=Lo(),r=a!==null?`proj/${encodeURIComponent(a)}/issues/${encodeURIComponent(e)}`:null;return u.useEffect(()=>{r&&t(r)},[r,t]),r||!l?s.jsx(Ga,{}):n}function Lo(){var r;const{projects:e,loading:t,none:n,failure:a}=Nn();return{project:((r=e==null?void 0:e.find(i=>i.current))==null?void 0:r.id)??null,settled:!t&&(e!==null||n!==null||!!(a!=null&&a.shown))}}function x5({navigate:e}){const{project:t,settled:n}=Lo(),a=t!==null?`proj/${encodeURIComponent(t)}/releases${window.location.search}`:null;return u.useEffect(()=>{a&&e(a)},[a,e]),a||!n?s.jsx(Ga,{}):s.jsx(Vr,{})}function py(e){const t=new URLSearchParams(e);return{release:t.get("release"),planned:t.has("planned")?t.get("planned")??"":null}}function g5({route:e}){var f;const{org:t,projects:n,loading:a}=Nn(),l=e.page.kind==="project"?e.page.project:"",[r,i]=u.useState(()=>py(window.location.search));if(a)return s.jsx(Ga,{});if(n!==null&&!((f=n.find(h=>h.id===l))!=null&&f.current))return s.jsx(ao,{project:l});const c=`/proj/${encodeURIComponent(l)}/releases`,d=h=>{const m=new URLSearchParams;h!=null&&h.startsWith("planned:")?m.set("planned",h.slice(8)):h&&m.set("release",h);const x=m.size>0?`?${m.toString()}`:"";window.history.replaceState(window.history.state,"",`${window.location.pathname}${x}`),i(py(x))};return s.jsx(EL,{org:(t==null?void 0:t.slug)??"",query:r,onSelect:d,home:c})}function v5({hash:e,navigate:t,home:n}){const{project:a,settled:l}=Lo(),r=R1.exec(e),i=r!=null&&r[2]?$u(r[2]):null,o=r!=null&&r[3]?$u(r[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||!l?s.jsx(Ga,{}):n}function Ff({route:e,navigate:t}){const{org:n}=Nn();let a=e.page;const l=e.org!==void 0&&n!==null&&e.org!==n.slug;l&&(a={kind:"not_found"});let r;if(l)r=s.jsx(my,{});else if("threads"in e)r=s.jsx(d5,{routeOrg:e.org});else if("task"in e){const i=new URLSearchParams(window.location.search).get("from");r=s.jsx($D,{org:encodeURIComponent(e.org),task_id:e.task,from:i})}else"tasks"in e?r=s.jsx(f5,{route:e,navigate:t}):"issues"in e?r=s.jsx(m5,{route:e,navigate:t}):"chart"in e?r=s.jsx(rz,{}):"worktrees"in e?r=s.jsx(N6,{org:(n==null?void 0:n.slug)??e.org}):"workspaces"in e?r=s.jsx(s6,{org:(n==null?void 0:n.slug)??e.org}):"queues"in e?r=s.jsx(h5,{route:e,navigate:t}):"releasesForward"in e?r=s.jsx(x5,{navigate:t}):"releases"in e?r=s.jsx(g5,{route:e}):a.kind==="home"?r=s.jsx(Vr,{}):a.kind==="project"?r=s.jsx(ao,{project:a.project}):r=s.jsx(my,{});return s.jsx(LL,{page:a,children:r})}function y5({task:e,navigate:t,home:n}){const{org:a,loading:l,none:r,failure:i}=Nn(),o=a!==null?`org/${encodeURIComponent(a.slug)}/tasks/${encodeURIComponent(e)}`:null,c=!l&&(r!==null||!!(i!=null&&i.shown));return u.useEffect(()=>{o&&t(o)},[o,t]),o||!c?s.jsx(Ga,{}):n}const b5=e=>window.location.replace(e);function $u(e){try{return decodeURIComponent(e)}catch{return null}}function j5({navigate:e=b5,data:t}){const n=o5(T1(window.location.pathname),window.location.search),[a,l]=u.useState(null),{notify:r,toasts:i}=a5(),o=l5.exec(window.location.hash),c=o?$u(o[1]):null,d=r5.exec(window.location.hash),f=d?$u(d[1]):null,h=f!==null&&i5.test(f)?f:null,m=R1.test(window.location.hash)?window.location.hash:null,x=o!==null&&c===null||d!==null&&h===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=E6();return{probe:{source:async()=>({label:"Local workspace"})},shell:g,issues:g.issues,tasks:O6(),org:M6(),worktrees:D6(),workspaces:z6(),queues:A6(),releases:$6()}},[t]);if(j||"forward"in n||!v.shell)return null;const y=s.jsx(Ff,{route:{page:{kind:"home"}},navigate:e});return s.jsx("div",{className:"app-ui dark",ref:l,children:s.jsxs(FA,{container:a,children:[s.jsx(p0,{data:v,router:y1,identity:c5,notify:r,children:s.jsx(DT,{shell:v.shell,children:x?s.jsx(Ff,{route:{page:{kind:"not_found"}},navigate:e}):c!==null?s.jsx(y5,{task:c,navigate:e,home:y}):h!==null?s.jsx(p5,{issue:h,navigate:e,home:y}):m!==null?s.jsx(v5,{hash:m,navigate:e,home:y}):s.jsx(Ff,{route:n,navigate:e})})}),i]})})}UC.createRoot(document.getElementById("root")).render(s.jsx(u.StrictMode,{children:T1(window.location.pathname)==="app-ui-probe"?s.jsx(XL,{}):s.jsx(j5,{})}));
|