@software-dlc/cli 0.184.2 → 0.185.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/local/app-contract-readers.d.ts +5 -1
- package/dist/local/app-contract-readers.d.ts.map +1 -1
- package/dist/local/app-contract-readers.js +83 -20
- package/dist/local/app-contract-readers.js.map +1 -1
- package/dist/local/app-releases.d.ts +2 -0
- package/dist/local/app-releases.d.ts.map +1 -1
- package/dist/local/app-releases.js +13 -3
- package/dist/local/app-releases.js.map +1 -1
- package/dist/local/app-shell-readers.d.ts +3 -0
- package/dist/local/app-shell-readers.d.ts.map +1 -1
- package/dist/local/app-shell-readers.js +5 -2
- package/dist/local/app-shell-readers.js.map +1 -1
- package/dist/local/workspace-viewer-server.d.ts +5 -0
- package/dist/local/workspace-viewer-server.d.ts.map +1 -1
- package/dist/local/workspace-viewer-server.js +20 -6
- package/dist/local/workspace-viewer-server.js.map +1 -1
- package/package.json +1 -1
- package/viewer/assets/index-CPNiXwOB.css +1 -0
- package/viewer/assets/index-CaGh17Q6.js +399 -0
- package/viewer/index.html +2 -2
- package/viewer/assets/index-1kZwI0H1.css +0 -1
- package/viewer/assets/index-U1V2mRrp.js +0 -394
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
function w1(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const r in a)if(r!=="default"&&!(r in e)){const l=Object.getOwnPropertyDescriptor(a,r);l&&Object.defineProperty(e,r,l.get?l:{enumerable:!0,get:()=>a[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function ny(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sy={exports:{}},wu={};/**
|
|
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 N1=Symbol.for("react.transitional.element"),_1=Symbol.for("react.fragment");function ay(e,t,n){var a=null;if(n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),"key"in t){n={};for(var r in t)r!=="key"&&(n[r]=t[r])}else n=t;return t=n.ref,{$$typeof:N1,type:e,key:a,ref:t!==void 0?t:null,props:n}}wu.Fragment=_1;wu.jsx=ay;wu.jsxs=ay;sy.exports=wu;var s=sy.exports,ry={exports:{}},Se={};/**
|
|
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 sm=Symbol.for("react.transitional.element"),k1=Symbol.for("react.portal"),S1=Symbol.for("react.fragment"),C1=Symbol.for("react.strict_mode"),T1=Symbol.for("react.profiler"),R1=Symbol.for("react.consumer"),E1=Symbol.for("react.context"),A1=Symbol.for("react.forward_ref"),M1=Symbol.for("react.suspense"),O1=Symbol.for("react.memo"),ly=Symbol.for("react.lazy"),pp=Symbol.iterator;function D1(e){return e===null||typeof e!="object"?null:(e=pp&&e[pp]||e["@@iterator"],typeof e=="function"?e:null)}var iy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oy=Object.assign,cy={};function Nl(e,t,n){this.props=e,this.context=t,this.refs=cy,this.updater=n||iy}Nl.prototype.isReactComponent={};Nl.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")};Nl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function uy(){}uy.prototype=Nl.prototype;function am(e,t,n){this.props=e,this.context=t,this.refs=cy,this.updater=n||iy}var rm=am.prototype=new uy;rm.constructor=am;oy(rm,Nl.prototype);rm.isPureReactComponent=!0;var gp=Array.isArray,et={H:null,A:null,T:null,S:null,V:null},dy=Object.prototype.hasOwnProperty;function lm(e,t,n,a,r,l){return n=l.ref,{$$typeof:sm,type:e,key:t,ref:n!==void 0?n:null,props:l}}function $1(e,t){return lm(e.type,t,void 0,void 0,void 0,e.props)}function im(e){return typeof e=="object"&&e!==null&&e.$$typeof===sm}function z1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vp=/\/+/g;function _d(e,t){return typeof e=="object"&&e!==null&&e.key!=null?z1(""+e.key):t.toString(36)}function yp(){}function L1(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(yp,yp):(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 Mr(e,t,n,a,r){var l=typeof e;(l==="undefined"||l==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(l){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case sm:case k1:i=!0;break;case ly:return i=e._init,Mr(i(e._payload),t,n,a,r)}}if(i)return r=r(e),i=a===""?"."+_d(e,0):a,gp(r)?(n="",i!=null&&(n=i.replace(vp,"$&/")+"/"),Mr(r,t,n,"",function(d){return d})):r!=null&&(im(r)&&(r=$1(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(vp,"$&/")+"/")+i)),t.push(r)),1;i=0;var o=a===""?".":a+":";if(gp(e))for(var c=0;c<e.length;c++)a=e[c],l=o+_d(a,c),i+=Mr(a,t,n,l,r);else if(c=D1(e),typeof c=="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,l=o+_d(a,c++),i+=Mr(a,t,n,l,r);else if(l==="object"){if(typeof e.then=="function")return Mr(L1(e),t,n,a,r);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function To(e,t,n){if(e==null)return e;var a=[],r=0;return Mr(e,a,"","",function(l){return t.call(n,l,r++)}),a}function U1(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 bp=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 B1(){}Se.Children={map:To,forEach:function(e,t,n){To(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return To(e,function(){t++}),t},toArray:function(e){return To(e,function(t){return t})||[]},only:function(e){if(!im(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Se.Component=Nl;Se.Fragment=S1;Se.Profiler=T1;Se.PureComponent=am;Se.StrictMode=C1;Se.Suspense=M1;Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=et;Se.__COMPILER_RUNTIME={__proto__:null,c:function(e){return et.H.useMemoCache(e)}};Se.cache=function(e){return function(){return e.apply(null,arguments)}};Se.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=oy({},e.props),r=e.key,l=void 0;if(t!=null)for(i in t.ref!==void 0&&(l=void 0),t.key!==void 0&&(r=""+t.key),t)!dy.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 lm(e.type,r,void 0,void 0,l,a)};Se.createContext=function(e){return e={$$typeof:E1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:R1,_context:e},e};Se.createElement=function(e,t,n){var a,r={},l=null;if(t!=null)for(a in t.key!==void 0&&(l=""+t.key),t)dy.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(r[a]=t[a]);var i=arguments.length-2;if(i===1)r.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];r.children=o}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)r[a]===void 0&&(r[a]=i[a]);return lm(e,l,void 0,void 0,null,r)};Se.createRef=function(){return{current:null}};Se.forwardRef=function(e){return{$$typeof:A1,render:e}};Se.isValidElement=im;Se.lazy=function(e){return{$$typeof:ly,_payload:{_status:-1,_result:e},_init:U1}};Se.memo=function(e,t){return{$$typeof:O1,type:e,compare:t===void 0?null:t}};Se.startTransition=function(e){var t=et.T,n={};et.T=n;try{var a=e(),r=et.S;r!==null&&r(n,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(B1,bp)}catch(l){bp(l)}finally{et.T=t}};Se.unstable_useCacheRefresh=function(){return et.H.useCacheRefresh()};Se.use=function(e){return et.H.use(e)};Se.useActionState=function(e,t,n){return et.H.useActionState(e,t,n)};Se.useCallback=function(e,t){return et.H.useCallback(e,t)};Se.useContext=function(e){return et.H.useContext(e)};Se.useDebugValue=function(){};Se.useDeferredValue=function(e,t){return et.H.useDeferredValue(e,t)};Se.useEffect=function(e,t,n){var a=et.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return a.useEffect(e,t)};Se.useId=function(){return et.H.useId()};Se.useImperativeHandle=function(e,t,n){return et.H.useImperativeHandle(e,t,n)};Se.useInsertionEffect=function(e,t){return et.H.useInsertionEffect(e,t)};Se.useLayoutEffect=function(e,t){return et.H.useLayoutEffect(e,t)};Se.useMemo=function(e,t){return et.H.useMemo(e,t)};Se.useOptimistic=function(e,t){return et.H.useOptimistic(e,t)};Se.useReducer=function(e,t,n){return et.H.useReducer(e,t,n)};Se.useRef=function(e){return et.H.useRef(e)};Se.useState=function(e){return et.H.useState(e)};Se.useSyncExternalStore=function(e,t,n){return et.H.useSyncExternalStore(e,t,n)};Se.useTransition=function(){return et.H.useTransition()};Se.version="19.1.0";ry.exports=Se;var u=ry.exports;const ia=ny(u),fy=w1({__proto__:null,default:ia},[u]);var hy={exports:{}},Nu={},my={exports:{}},xy={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(R,E){var C=R.length;R.push(E);e:for(;0<C;){var U=C-1>>>1,X=R[U];if(0<r(X,E))R[U]=E,R[C]=X,C=U;else break e}}function n(R){return R.length===0?null:R[0]}function a(R){if(R.length===0)return null;var E=R[0],C=R.pop();if(C!==E){R[0]=C;e:for(var U=0,X=R.length,M=X>>>1;U<M;){var Q=2*(U+1)-1,se=R[Q],W=Q+1,K=R[W];if(0>r(se,C))W<X&&0>r(K,se)?(R[U]=K,R[W]=C,U=W):(R[U]=se,R[Q]=C,U=Q);else if(W<X&&0>r(K,C))R[U]=K,R[W]=C,U=W;else break e}}return E}function r(R,E){var C=R.sortIndex-E.sortIndex;return C!==0?C:R.id-E.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],d=[],f=1,h=null,m=3,g=!1,j=!1,v=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function w(R){for(var E=n(d);E!==null;){if(E.callback===null)a(d);else if(E.startTime<=R)a(d),E.sortIndex=E.expirationTime,t(c,E);else break;E=n(d)}}function _(R){if(v=!1,w(R),!j)if(n(c)!==null)j=!0,k||(k=!0,Y());else{var E=n(d);E!==null&&F(_,E.startTime-R)}}var k=!1,N=-1,S=5,A=-1;function D(){return y?!0:!(e.unstable_now()-A<S)}function G(){if(y=!1,k){var R=e.unstable_now();A=R;var E=!0;try{e:{j=!1,v&&(v=!1,p(N),N=-1),g=!0;var C=m;try{t:{for(w(R),h=n(c);h!==null&&!(h.expirationTime>R&&D());){var U=h.callback;if(typeof U=="function"){h.callback=null,m=h.priorityLevel;var X=U(h.expirationTime<=R);if(R=e.unstable_now(),typeof X=="function"){h.callback=X,w(R),E=!0;break t}h===n(c)&&a(c),w(R)}else a(c);h=n(c)}if(h!==null)E=!0;else{var M=n(d);M!==null&&F(_,M.startTime-R),E=!1}}break e}finally{h=null,m=C,g=!1}E=void 0}}finally{E?Y():k=!1}}}var Y;if(typeof b=="function")Y=function(){b(G)};else if(typeof MessageChannel<"u"){var T=new MessageChannel,B=T.port2;T.port1.onmessage=G,Y=function(){B.postMessage(null)}}else Y=function(){x(G,0)};function F(R,E){N=x(function(){R(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(R){R.callback=null},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(R){switch(m){case 1:case 2:case 3:var E=3;break;default:E=m}var C=m;m=E;try{return R()}finally{m=C}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(R,E){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var C=m;m=R;try{return E()}finally{m=C}},e.unstable_scheduleCallback=function(R,E,C){var U=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?U+C:U):C=U,R){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,R={id:f++,callback:E,priorityLevel:R,startTime:C,expirationTime:X,sortIndex:-1},C>U?(R.sortIndex=C,t(d,R),n(c)===null&&R===n(d)&&(v?(p(N),N=-1):v=!0,F(_,C-U))):(R.sortIndex=X,t(c,R),j||g||(j=!0,k||(k=!0,Y()))),R},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(R){var E=m;return function(){var C=m;m=E;try{return R.apply(this,arguments)}finally{m=C}}}})(xy);my.exports=xy;var H1=my.exports,py={exports:{}},Yt={};/**
|
|
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 I1=u;function gy(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 Gt={d:{f:sa,r:function(){throw Error(gy(522))},D:sa,C:sa,L:sa,m:sa,X:sa,S:sa,M:sa},p:0,findDOMNode:null},P1=Symbol.for("react.portal");function q1(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:P1,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var ci=I1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function _u(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Gt;Yt.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(gy(299));return q1(e,t,null,n)};Yt.flushSync=function(e){var t=ci.T,n=Gt.p;try{if(ci.T=null,Gt.p=2,e)return e()}finally{ci.T=t,Gt.p=n,Gt.d.f()}};Yt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Gt.d.C(e,t))};Yt.prefetchDNS=function(e){typeof e=="string"&&Gt.d.D(e)};Yt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,a=_u(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,l=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Gt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:r,fetchPriority:l}):n==="script"&&Gt.d.X(e,{crossOrigin:a,integrity:r,fetchPriority:l,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Yt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=_u(t.as,t.crossOrigin);Gt.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&&Gt.d.M(e)};Yt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,a=_u(n,t.crossOrigin);Gt.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})}};Yt.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=_u(t.as,t.crossOrigin);Gt.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 Gt.d.m(e)};Yt.requestFormReset=function(e){Gt.d.r(e)};Yt.unstable_batchedUpdates=function(e,t){return e(t)};Yt.useFormState=function(e,t,n){return ci.H.useFormState(e,t,n)};Yt.useFormStatus=function(){return ci.H.useHostTransitionStatus()};Yt.version="19.1.0";function vy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vy)}catch(e){console.error(e)}}vy(),py.exports=Yt;var _l=py.exports;const G1=ny(_l);/**
|
|
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=H1,yy=u,V1=_l;function q(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 by(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Qi(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 jy(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 jp(e){if(Qi(e)!==e)throw Error(q(188))}function Y1(e){var t=e.alternate;if(!t){if(t=Qi(e),t===null)throw Error(q(188));return t!==e?null:e}for(var n=e,a=t;;){var r=n.return;if(r===null)break;var l=r.alternate;if(l===null){if(a=r.return,a!==null){n=a;continue}break}if(r.child===l.child){for(l=r.child;l;){if(l===n)return jp(r),e;if(l===a)return jp(r),t;l=l.sibling}throw Error(q(188))}if(n.return!==a.return)n=r,a=l;else{for(var i=!1,o=r.child;o;){if(o===n){i=!0,n=r,a=l;break}if(o===a){i=!0,a=r,n=l;break}o=o.sibling}if(!i){for(o=l.child;o;){if(o===n){i=!0,n=l,a=r;break}if(o===a){i=!0,a=l,n=r;break}o=o.sibling}if(!i)throw Error(q(189))}}if(n.alternate!==a)throw Error(q(190))}if(n.tag!==3)throw Error(q(188));return n.stateNode.current===n?e:t}function wy(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=wy(e),t!==null)return t;e=e.sibling}return null}var Ze=Object.assign,F1=Symbol.for("react.element"),Ro=Symbol.for("react.transitional.element"),Jl=Symbol.for("react.portal"),zr=Symbol.for("react.fragment"),Ny=Symbol.for("react.strict_mode"),$f=Symbol.for("react.profiler"),X1=Symbol.for("react.provider"),_y=Symbol.for("react.consumer"),Es=Symbol.for("react.context"),om=Symbol.for("react.forward_ref"),zf=Symbol.for("react.suspense"),Lf=Symbol.for("react.suspense_list"),cm=Symbol.for("react.memo"),ua=Symbol.for("react.lazy"),Uf=Symbol.for("react.activity"),K1=Symbol.for("react.memo_cache_sentinel"),wp=Symbol.iterator;function Il(e){return e===null||typeof e!="object"?null:(e=wp&&e[wp]||e["@@iterator"],typeof e=="function"?e:null)}var Q1=Symbol.for("react.client.reference");function Bf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q1?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case zr:return"Fragment";case $f:return"Profiler";case Ny:return"StrictMode";case zf:return"Suspense";case Lf:return"SuspenseList";case Uf:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case Jl:return"Portal";case Es:return(e.displayName||"Context")+".Provider";case _y:return(e._context.displayName||"Context")+".Consumer";case om:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case cm:return t=e.displayName||null,t!==null?t:Bf(e.type)||"Memo";case ua:t=e._payload,e=e._init;try{return Bf(e(t))}catch{}}return null}var ei=Array.isArray,be=yy.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le=V1.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Xa={pending:!1,data:null,method:null,action:null},Hf=[],Lr=-1;function ps(e){return{current:e}}function Et(e){0>Lr||(e.current=Hf[Lr],Hf[Lr]=null,Lr--)}function tt(e,t){Lr++,Hf[Lr]=e.current,e.current=t}var cs=ps(null),Si=ps(null),wa=ps(null),Sc=ps(null);function Cc(e,t){switch(tt(wa,t),tt(Si,e),tt(cs,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cg(t),e=Ij(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Et(cs),tt(cs,e)}function cl(){Et(cs),Et(Si),Et(wa)}function If(e){e.memoizedState!==null&&tt(Sc,e);var t=cs.current,n=Ij(t,e.type);t!==n&&(tt(Si,e),tt(cs,n))}function Tc(e){Si.current===e&&(Et(cs),Et(Si)),Sc.current===e&&(Et(Sc),zi._currentValue=Xa)}var Pf=Object.prototype.hasOwnProperty,um=_t.unstable_scheduleCallback,kd=_t.unstable_cancelCallback,W1=_t.unstable_shouldYield,Z1=_t.unstable_requestPaint,us=_t.unstable_now,J1=_t.unstable_getCurrentPriorityLevel,ky=_t.unstable_ImmediatePriority,Sy=_t.unstable_UserBlockingPriority,Rc=_t.unstable_NormalPriority,eS=_t.unstable_LowPriority,Cy=_t.unstable_IdlePriority,tS=_t.log,nS=_t.unstable_setDisableYieldValue,Wi=null,fn=null;function pa(e){if(typeof tS=="function"&&nS(e),fn&&typeof fn.setStrictMode=="function")try{fn.setStrictMode(Wi,e)}catch{}}var hn=Math.clz32?Math.clz32:rS,sS=Math.log,aS=Math.LN2;function rS(e){return e>>>=0,e===0?32:31-(sS(e)/aS|0)|0}var Eo=256,Ao=4194304;function Ga(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 ku(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=a&134217727;return o!==0?(a=o&~l,a!==0?r=Ga(a):(i&=o,i!==0?r=Ga(i):n||(n=o&~e,n!==0&&(r=Ga(n))))):(o=a&~l,o!==0?r=Ga(o):i!==0?r=Ga(i):n||(n=a&~e,n!==0&&(r=Ga(n)))),r===0?0:t!==0&&t!==r&&!(t&l)&&(l=r&-r,n=t&-t,l>=n||l===32&&(n&4194048)!==0)?t:r}function Zi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lS(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 Ty(){var e=Eo;return Eo<<=1,!(Eo&4194048)&&(Eo=256),e}function Ry(){var e=Ao;return Ao<<=1,!(Ao&62914560)&&(Ao=4194304),e}function Sd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ji(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function iS(e,t,n,a,r,l){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,d=e.hiddenUpdates;for(n=i&~n;0<n;){var f=31-hn(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 g=m[f];g!==null&&(g.lane&=-536870913)}n&=~h}a!==0&&Ey(e,a,0),l!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=l&~(i&~t))}function Ey(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-hn(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&4194090}function Ay(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-hn(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function dm(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 fm(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function My(){var e=Le.p;return e!==0?e:(e=window.event,e===void 0?32:Wj(e.type))}function oS(e,t){var n=Le.p;try{return Le.p=e,t()}finally{Le.p=n}}var La=Math.random().toString(36).slice(2),Ut="__reactFiber$"+La,Jt="__reactProps$"+La,kl="__reactContainer$"+La,qf="__reactEvents$"+La,cS="__reactListeners$"+La,uS="__reactHandles$"+La,Np="__reactResources$"+La,eo="__reactMarker$"+La;function hm(e){delete e[Ut],delete e[Jt],delete e[qf],delete e[cS],delete e[uS]}function Ur(e){var t=e[Ut];if(t)return t;for(var n=e.parentNode;n;){if(t=n[kl]||n[Ut]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Eg(e);e!==null;){if(n=e[Ut])return n;e=Eg(e)}return t}e=n,n=e.parentNode}return null}function Sl(e){if(e=e[Ut]||e[kl]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function ti(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(q(33))}function Kr(e){var t=e[Np];return t||(t=e[Np]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[eo]=!0}var Oy=new Set,Dy={};function hr(e,t){ul(e,t),ul(e+"Capture",t)}function ul(e,t){for(Dy[e]=t,e=0;e<t.length;e++)Oy.add(t[e])}var dS=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]*$"),_p={},kp={};function fS(e){return Pf.call(kp,e)?!0:Pf.call(_p,e)?!1:dS.test(e)?kp[e]=!0:(_p[e]=!0,!1)}function ac(e,t,n){if(fS(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 Mo(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 ws(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 Cd,Sp;function Or(e){if(Cd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Cd=t&&t[1]||"",Sp=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Cd+e+Sp}var Td=!1;function Rd(e,t){if(!e||Td)return"";Td=!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(g){var m=g}Reflect.construct(e,[],h)}else{try{h.call()}catch(g){m=g}e.call(h.prototype)}}else{try{throw Error()}catch(g){m=g}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(g){if(g&&m&&typeof g.stack=="string")return[g.stack,m.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var l=a.DetermineComponentFrameRoot(),i=l[0],o=l[1];if(i&&o){var c=i.split(`
|
|
44
|
+
`),d=o.split(`
|
|
45
|
+
`);for(r=a=0;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;for(;r<d.length&&!d[r].includes("DetermineComponentFrameRoot");)r++;if(a===c.length||r===d.length)for(a=c.length-1,r=d.length-1;1<=a&&0<=r&&c[a]!==d[r];)r--;for(;1<=a&&0<=r;a--,r--)if(c[a]!==d[r]){if(a!==1||r!==1)do if(a--,r--,0>r||c[a]!==d[r]){var f=`
|
|
46
|
+
`+c[a].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=a&&0<=r);break}}}finally{Td=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Or(n):""}function hS(e){switch(e.tag){case 26:case 27:case 5:return Or(e.type);case 16:return Or("Lazy");case 13:return Or("Suspense");case 19:return Or("SuspenseList");case 0:case 15:return Rd(e.type,!1);case 11:return Rd(e.type.render,!1);case 1:return Rd(e.type,!0);case 31:return Or("Activity");default:return""}}function Cp(e){try{var t="";do t+=hS(e),e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}function Nn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $y(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mS(e){var t=$y(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(i){a=""+i,l.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ec(e){e._valueTracker||(e._valueTracker=mS(e))}function zy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=$y(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Ac(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 xS=/[\n"\\]/g;function Sn(e){return e.replace(xS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Gf(e,t,n,a,r,l,i,o){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nn(t)):e.value!==""+Nn(t)&&(e.value=""+Nn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?Vf(e,i,Nn(t)):n!=null?Vf(e,i,Nn(n)):a!=null&&e.removeAttribute("value"),r==null&&l!=null&&(e.defaultChecked=!!l),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Nn(o):e.removeAttribute("name")}function Ly(e,t,n,a,r,l,i,o){if(l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"&&(e.type=l),t!=null||n!=null){if(!(l!=="submit"&&l!=="reset"||t!=null))return;n=n!=null?""+Nn(n):"",t=t!=null?""+Nn(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}a=a??r,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=o?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i)}function Vf(e,t,n){t==="number"&&Ac(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Qr(e,t,n,a){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&a&&(e[n].defaultSelected=!0)}else{for(n=""+Nn(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,a&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Uy(e,t,n){if(t!=null&&(t=""+Nn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Nn(n):""}function By(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(q(92));if(ei(a)){if(1<a.length)throw Error(q(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=Nn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a)}function dl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pS=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 Tp(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||pS.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Hy(e,t,n){if(t!=null&&typeof t!="object")throw Error(q(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var r in t)a=t[r],t.hasOwnProperty(r)&&n[r]!==a&&Tp(e,r,a)}else for(var l in t)t.hasOwnProperty(l)&&Tp(e,l,t[l])}function mm(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 gS=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"]]),vS=/^[\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 rc(e){return vS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Yf=null;function xm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Br=null,Wr=null;function Rp(e){var t=Sl(e);if(t&&(e=t.stateNode)){var n=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Gf(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="'+Sn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var r=a[Jt]||null;if(!r)throw Error(q(90));Gf(a,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&zy(a)}break e;case"textarea":Uy(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Qr(e,!!n.multiple,t,!1)}}}var Ed=!1;function Iy(e,t,n){if(Ed)return e(t,n);Ed=!0;try{var a=e(t);return a}finally{if(Ed=!1,(Br!==null||Wr!==null)&&($u(),Br&&(t=Br,e=Wr,Wr=Br=null,Rp(t),e)))for(t=0;t<e.length;t++)Rp(e[t])}}function Ci(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Jt]||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(q(231,t,typeof n));return n}var Bs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ff=!1;if(Bs)try{var Pl={};Object.defineProperty(Pl,"passive",{get:function(){Ff=!0}}),window.addEventListener("test",Pl,Pl),window.removeEventListener("test",Pl,Pl)}catch{Ff=!1}var ga=null,pm=null,lc=null;function Py(){if(lc)return lc;var e,t=pm,n=t.length,a,r="value"in ga?ga.value:ga.textContent,l=r.length;for(e=0;e<n&&t[e]===r[e];e++);var i=n-e;for(a=1;a<=i&&t[n-a]===r[l-a];a++);return lc=r.slice(e,1<a?1-a:void 0)}function ic(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 Oo(){return!0}function Ep(){return!1}function tn(e){function t(n,a,r,l,i){this._reactName=n,this._targetInst=r,this.type=a,this.nativeEvent=l,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(l):l[o]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Oo:Ep,this.isPropagationStopped=Ep,this}return Ze(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=Oo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Oo)},persist:function(){},isPersistent:Oo}),t}var mr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Su=tn(mr),to=Ze({},mr,{view:0,detail:0}),yS=tn(to),Ad,Md,ql,Cu=Ze({},to,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gm,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!==ql&&(ql&&e.type==="mousemove"?(Ad=e.screenX-ql.screenX,Md=e.screenY-ql.screenY):Md=Ad=0,ql=e),Ad)},movementY:function(e){return"movementY"in e?e.movementY:Md}}),Ap=tn(Cu),bS=Ze({},Cu,{dataTransfer:0}),jS=tn(bS),wS=Ze({},to,{relatedTarget:0}),Od=tn(wS),NS=Ze({},mr,{animationName:0,elapsedTime:0,pseudoElement:0}),_S=tn(NS),kS=Ze({},mr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),SS=tn(kS),CS=Ze({},mr,{data:0}),Mp=tn(CS),TS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},RS={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"},ES={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ES[e])?!!t[e]:!1}function gm(){return AS}var MS=Ze({},to,{key:function(e){if(e.key){var t=TS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ic(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?RS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gm,charCode:function(e){return e.type==="keypress"?ic(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ic(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),OS=tn(MS),DS=Ze({},Cu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Op=tn(DS),$S=Ze({},to,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gm}),zS=tn($S),LS=Ze({},mr,{propertyName:0,elapsedTime:0,pseudoElement:0}),US=tn(LS),BS=Ze({},Cu,{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}),HS=tn(BS),IS=Ze({},mr,{newState:0,oldState:0}),PS=tn(IS),qS=[9,13,27,32],vm=Bs&&"CompositionEvent"in window,ui=null;Bs&&"documentMode"in document&&(ui=document.documentMode);var GS=Bs&&"TextEvent"in window&&!ui,qy=Bs&&(!vm||ui&&8<ui&&11>=ui),Dp=" ",$p=!1;function Gy(e,t){switch(e){case"keyup":return qS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hr=!1;function VS(e,t){switch(e){case"compositionend":return Vy(t);case"keypress":return t.which!==32?null:($p=!0,Dp);case"textInput":return e=t.data,e===Dp&&$p?null:e;default:return null}}function YS(e,t){if(Hr)return e==="compositionend"||!vm&&Gy(e,t)?(e=Py(),lc=pm=ga=null,Hr=!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 qy&&t.locale!=="ko"?null:t.data;default:return null}}var FS={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 zp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!FS[e.type]:t==="textarea"}function Yy(e,t,n,a){Br?Wr?Wr.push(a):Wr=[a]:Br=a,t=Kc(t,"onChange"),0<t.length&&(n=new Su("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var di=null,Ti=null;function XS(e){Uj(e,0)}function Tu(e){var t=ti(e);if(zy(t))return e}function Lp(e,t){if(e==="change")return t}var Fy=!1;if(Bs){var Dd;if(Bs){var $d="oninput"in document;if(!$d){var Up=document.createElement("div");Up.setAttribute("oninput","return;"),$d=typeof Up.oninput=="function"}Dd=$d}else Dd=!1;Fy=Dd&&(!document.documentMode||9<document.documentMode)}function Bp(){di&&(di.detachEvent("onpropertychange",Xy),Ti=di=null)}function Xy(e){if(e.propertyName==="value"&&Tu(Ti)){var t=[];Yy(t,Ti,e,xm(e)),Iy(XS,t)}}function KS(e,t,n){e==="focusin"?(Bp(),di=t,Ti=n,di.attachEvent("onpropertychange",Xy)):e==="focusout"&&Bp()}function QS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Tu(Ti)}function WS(e,t){if(e==="click")return Tu(t)}function ZS(e,t){if(e==="input"||e==="change")return Tu(t)}function JS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gn=typeof Object.is=="function"?Object.is:JS;function Ri(e,t){if(gn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Pf.call(t,r)||!gn(e[r],t[r]))return!1}return!0}function Hp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ip(e,t){var n=Hp(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=Hp(n)}}function Ky(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ky(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qy(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ac(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=Ac(e.document)}return t}function ym(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 e2=Bs&&"documentMode"in document&&11>=document.documentMode,Ir=null,Xf=null,fi=null,Kf=!1;function Pp(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kf||Ir==null||Ir!==Ac(a)||(a=Ir,"selectionStart"in a&&ym(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}),fi&&Ri(fi,a)||(fi=a,a=Kc(Xf,"onSelect"),0<a.length&&(t=new Su("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ir)))}function Pa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Pr={animationend:Pa("Animation","AnimationEnd"),animationiteration:Pa("Animation","AnimationIteration"),animationstart:Pa("Animation","AnimationStart"),transitionrun:Pa("Transition","TransitionRun"),transitionstart:Pa("Transition","TransitionStart"),transitioncancel:Pa("Transition","TransitionCancel"),transitionend:Pa("Transition","TransitionEnd")},zd={},Wy={};Bs&&(Wy=document.createElement("div").style,"AnimationEvent"in window||(delete Pr.animationend.animation,delete Pr.animationiteration.animation,delete Pr.animationstart.animation),"TransitionEvent"in window||delete Pr.transitionend.transition);function xr(e){if(zd[e])return zd[e];if(!Pr[e])return e;var t=Pr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Wy)return zd[e]=t[n];return e}var Zy=xr("animationend"),Jy=xr("animationiteration"),eb=xr("animationstart"),t2=xr("transitionrun"),n2=xr("transitionstart"),s2=xr("transitioncancel"),tb=xr("transitionend"),nb=new Map,Qf="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(" ");Qf.push("scrollEnd");function Zn(e,t){nb.set(e,t),hr(t,[e])}var qp=new WeakMap;function Cn(e,t){if(typeof e=="object"&&e!==null){var n=qp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Cp(t)},qp.set(e,t),t)}return{value:e,source:t,stack:Cp(t)}}var wn=[],qr=0,bm=0;function Ru(){for(var e=qr,t=bm=qr=0;t<e;){var n=wn[t];wn[t++]=null;var a=wn[t];wn[t++]=null;var r=wn[t];wn[t++]=null;var l=wn[t];if(wn[t++]=null,a!==null&&r!==null){var i=a.pending;i===null?r.next=r:(r.next=i.next,i.next=r),a.pending=r}l!==0&&sb(n,r,l)}}function Eu(e,t,n,a){wn[qr++]=e,wn[qr++]=t,wn[qr++]=n,wn[qr++]=a,bm|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function jm(e,t,n,a){return Eu(e,t,n,a),Mc(e)}function Cl(e,t){return Eu(e,null,null,t),Mc(e)}function sb(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var r=!1,l=e.return;l!==null;)l.childLanes|=n,a=l.alternate,a!==null&&(a.childLanes|=n),l.tag===22&&(e=l.stateNode,e===null||e._visibility&1||(r=!0)),e=l,l=l.return;return e.tag===3?(l=e.stateNode,r&&t!==null&&(r=31-hn(n),e=l.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),l):null}function Mc(e){if(50<wi)throw wi=0,gh=null,Error(q(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Gr={};function a2(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 dn(e,t,n,a){return new a2(e,t,n,a)}function wm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ls(e,t){var n=e.alternate;return n===null?(n=dn(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 ab(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 oc(e,t,n,a,r,l){var i=0;if(a=e,typeof e=="function")wm(e)&&(i=1);else if(typeof e=="string")i=lC(e,n,cs.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Uf:return e=dn(31,n,t,r),e.elementType=Uf,e.lanes=l,e;case zr:return Ka(n.children,r,l,t);case Ny:i=8,r|=24;break;case $f:return e=dn(12,n,t,r|2),e.elementType=$f,e.lanes=l,e;case zf:return e=dn(13,n,t,r),e.elementType=zf,e.lanes=l,e;case Lf:return e=dn(19,n,t,r),e.elementType=Lf,e.lanes=l,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X1:case Es:i=10;break e;case _y:i=9;break e;case om:i=11;break e;case cm:i=14;break e;case ua:i=16,a=null;break e}i=29,n=Error(q(130,e===null?"null":typeof e,"")),a=null}return t=dn(i,n,t,r),t.elementType=e,t.type=a,t.lanes=l,t}function Ka(e,t,n,a){return e=dn(7,e,a,t),e.lanes=n,e}function Ld(e,t,n){return e=dn(6,e,null,t),e.lanes=n,e}function Ud(e,t,n){return t=dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vr=[],Yr=0,Oc=null,Dc=0,_n=[],kn=0,Qa=null,As=1,Ms="";function Va(e,t){Vr[Yr++]=Dc,Vr[Yr++]=Oc,Oc=e,Dc=t}function rb(e,t,n){_n[kn++]=As,_n[kn++]=Ms,_n[kn++]=Qa,Qa=e;var a=As;e=Ms;var r=32-hn(a)-1;a&=~(1<<r),n+=1;var l=32-hn(t)+r;if(30<l){var i=r-r%5;l=(a&(1<<i)-1).toString(32),a>>=i,r-=i,As=1<<32-hn(t)+r|n<<r|a,Ms=l+e}else As=1<<l|n<<r|a,Ms=e}function Nm(e){e.return!==null&&(Va(e,1),rb(e,1,0))}function _m(e){for(;e===Oc;)Oc=Vr[--Yr],Vr[Yr]=null,Dc=Vr[--Yr],Vr[Yr]=null;for(;e===Qa;)Qa=_n[--kn],_n[kn]=null,Ms=_n[--kn],_n[kn]=null,As=_n[--kn],_n[kn]=null}var qt=null,it=null,ze=!1,Wa=null,ss=!1,Wf=Error(q(519));function nr(e){var t=Error(q(418,""));throw Ei(Cn(t,e)),Wf}function Gp(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Ut]=e,t[Jt]=a,n){case"dialog":Ee("cancel",t),Ee("close",t);break;case"iframe":case"object":case"embed":Ee("load",t);break;case"video":case"audio":for(n=0;n<Oi.length;n++)Ee(Oi[n],t);break;case"source":Ee("error",t);break;case"img":case"image":case"link":Ee("error",t),Ee("load",t);break;case"details":Ee("toggle",t);break;case"input":Ee("invalid",t),Ly(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),Ec(t);break;case"select":Ee("invalid",t);break;case"textarea":Ee("invalid",t),By(t,a.value,a.defaultValue,a.children),Ec(t)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Hj(t.textContent,n)?(a.popover!=null&&(Ee("beforetoggle",t),Ee("toggle",t)),a.onScroll!=null&&Ee("scroll",t),a.onScrollEnd!=null&&Ee("scrollend",t),a.onClick!=null&&(t.onclick=Uu),t=!0):t=!1,t||nr(e)}function Vp(e){for(qt=e.return;qt;)switch(qt.tag){case 5:case 13:ss=!1;return;case 27:case 3:ss=!0;return;default:qt=qt.return}}function Gl(e){if(e!==qt)return!1;if(!ze)return Vp(e),ze=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Nh(e.type,e.memoizedProps)),n=!n),n&&it&&nr(e),Vp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){it=Vn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}it=null}}else t===27?(t=it,Ua(e.type)?(e=Sh,Sh=null,it=e):it=t):it=qt?Vn(e.stateNode.nextSibling):null;return!0}function no(){it=qt=null,ze=!1}function Yp(){var e=Wa;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),Wa=null),e}function Ei(e){Wa===null?Wa=[e]:Wa.push(e)}var Zf=ps(null),pr=null,Os=null;function fa(e,t,n){tt(Zf,t._currentValue),t._currentValue=n}function Us(e){e._currentValue=Zf.current,Et(Zf)}function Jf(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 eh(e,t,n,a){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var l=r.dependencies;if(l!==null){var i=r.child;l=l.firstContext;e:for(;l!==null;){var o=l;l=r;for(var c=0;c<t.length;c++)if(o.context===t[c]){l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),Jf(l.return,n,e),a||(i=null);break e}l=o.next}}else if(r.tag===18){if(i=r.return,i===null)throw Error(q(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Jf(i,n,e),i=null}else i=r.child;if(i!==null)i.return=r;else for(i=r;i!==null;){if(i===e){i=null;break}if(r=i.sibling,r!==null){r.return=i.return,i=r;break}i=i.return}r=i}}function so(e,t,n,a){e=null;for(var r=t,l=!1;r!==null;){if(!l){if(r.flags&524288)l=!0;else if(r.flags&262144)break}if(r.tag===10){var i=r.alternate;if(i===null)throw Error(q(387));if(i=i.memoizedProps,i!==null){var o=r.type;gn(r.pendingProps.value,i.value)||(e!==null?e.push(o):e=[o])}}else if(r===Sc.current){if(i=r.alternate,i===null)throw Error(q(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(zi):e=[zi])}r=r.return}e!==null&&eh(t,e,n,a),t.flags|=262144}function $c(e){for(e=e.firstContext;e!==null;){if(!gn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function sr(e){pr=e,Os=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bt(e){return lb(pr,e)}function Do(e,t){return pr===null&&sr(e),lb(e,t)}function lb(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Os===null){if(e===null)throw Error(q(308));Os=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Os=Os.next=t;return n}var r2=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()})}},l2=_t.unstable_scheduleCallback,i2=_t.unstable_NormalPriority,jt={$$typeof:Es,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function km(){return{controller:new r2,data:new Map,refCount:0}}function ao(e){e.refCount--,e.refCount===0&&l2(i2,function(){e.controller.abort()})}var hi=null,th=0,fl=0,Zr=null;function o2(e,t){if(hi===null){var n=hi=[];th=0,fl=Xm(),Zr={status:"pending",value:void 0,then:function(a){n.push(a)}}}return th++,t.then(Fp,Fp),t}function Fp(){if(--th===0&&hi!==null){Zr!==null&&(Zr.status="fulfilled");var e=hi;hi=null,fl=0,Zr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function c2(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(a.status="rejected",a.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),a}var Xp=be.S;be.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&o2(e,t),Xp!==null&&Xp(e,t)};var Za=ps(null);function Sm(){var e=Za.current;return e!==null?e:We.pooledCache}function cc(e,t){t===null?tt(Za,Za.current):tt(Za,t.pool)}function ib(){var e=Sm();return e===null?null:{parent:jt._currentValue,pool:e}}var ro=Error(q(460)),ob=Error(q(474)),Au=Error(q(542)),nh={then:function(){}};function Kp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $o(){}function cb(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($o,$o),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wp(e),e;default:if(typeof t.status=="string")t.then($o,$o);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(q(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=a}},function(a){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Wp(e),e}throw mi=t,ro}}var mi=null;function Qp(){if(mi===null)throw Error(q(459));var e=mi;return mi=null,e}function Wp(e){if(e===ro||e===Au)throw Error(q(483))}var da=!1;function Cm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sh(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 Na(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _a(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,qe&2){var r=a.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),a.pending=t,t=Mc(e),sb(e,null,n),t}return Eu(e,a,t,n),Mc(e)}function xi(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,Ay(e,n)}}function Bd(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};l===null?r=l=i:l=l.next=i,n=n.next}while(n!==null);l===null?r=l=t:l=l.next=t}else r=l=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:l,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ah=!1;function pi(){if(ah){var e=Zr;if(e!==null)throw e}}function gi(e,t,n,a){ah=!1;var r=e.updateQueue;da=!1;var l=r.firstBaseUpdate,i=r.lastBaseUpdate,o=r.shared.pending;if(o!==null){r.shared.pending=null;var c=o,d=c.next;c.next=null,i===null?l=d:i.next=d,i=c;var f=e.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==i&&(o===null?f.firstBaseUpdate=d:o.next=d,f.lastBaseUpdate=c))}if(l!==null){var h=r.baseState;i=0,f=d=c=null,o=l;do{var m=o.lane&-536870913,g=m!==o.lane;if(g?(De&m)===m:(a&m)===m){m!==0&&m===fl&&(ah=!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=Ze({},h,m);break e;case 2:da=!0}}m=o.callback,m!==null&&(e.flags|=64,g&&(e.flags|=8192),g=r.callbacks,g===null?r.callbacks=[m]:g.push(m))}else g={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(d=f=g,c=h):f=f.next=g,i|=m;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;g=o,o=g.next,g.next=null,r.lastBaseUpdate=g,r.shared.pending=null}}while(!0);f===null&&(c=h),r.baseState=c,r.firstBaseUpdate=d,r.lastBaseUpdate=f,l===null&&(r.shared.lanes=0),Oa|=i,e.lanes=i,e.memoizedState=h}}function ub(e,t){if(typeof e!="function")throw Error(q(191,e));e.call(t)}function db(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ub(n[e],t)}var hl=ps(null),zc=ps(0);function Zp(e,t){e=Ps,tt(zc,e),tt(hl,t),Ps=e|t.baseLanes}function rh(){tt(zc,Ps),tt(hl,hl.current)}function Tm(){Ps=zc.current,Et(hl),Et(zc)}var Aa=0,Te=null,Fe=null,pt=null,Lc=!1,Jr=!1,ar=!1,Uc=0,Ai=0,el=null,u2=0;function ft(){throw Error(q(321))}function Rm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gn(e[n],t[n]))return!1;return!0}function Em(e,t,n,a,r,l){return Aa=l,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,be.H=e===null||e.memoizedState===null?Pb:qb,ar=!1,l=n(a,r),ar=!1,Jr&&(l=hb(t,n,a,r)),fb(e),l}function fb(e){be.H=Bc;var t=Fe!==null&&Fe.next!==null;if(Aa=0,pt=Fe=Te=null,Lc=!1,Ai=0,el=null,t)throw Error(q(300));e===null||Rt||(e=e.dependencies,e!==null&&$c(e)&&(Rt=!0))}function hb(e,t,n,a){Te=e;var r=0;do{if(Jr&&(el=null),Ai=0,Jr=!1,25<=r)throw Error(q(301));if(r+=1,pt=Fe=null,e.updateQueue!=null){var l=e.updateQueue;l.lastEffect=null,l.events=null,l.stores=null,l.memoCache!=null&&(l.memoCache.index=0)}be.H=g2,l=t(n,a)}while(Jr);return l}function d2(){var e=be.H,t=e.useState()[0];return t=typeof t.then=="function"?lo(t):t,e=e.useState()[0],(Fe!==null?Fe.memoizedState:null)!==e&&(Te.flags|=1024),t}function Am(){var e=Uc!==0;return Uc=0,e}function Mm(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Om(e){if(Lc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lc=!1}Aa=0,pt=Fe=Te=null,Jr=!1,Ai=Uc=0,el=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Te.memoizedState=pt=e:pt=pt.next=e,pt}function vt(){if(Fe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=pt===null?Te.memoizedState:pt.next;if(t!==null)pt=t,Fe=e;else{if(e===null)throw Te.alternate===null?Error(q(467)):Error(q(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},pt===null?Te.memoizedState=pt=e:pt=pt.next=e}return pt}function Dm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lo(e){var t=Ai;return Ai+=1,el===null&&(el=[]),e=cb(el,e,t),t=Te,(pt===null?t.memoizedState:pt.next)===null&&(t=t.alternate,be.H=t===null||t.memoizedState===null?Pb:qb),e}function Mu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return lo(e);if(e.$$typeof===Es)return Bt(e)}throw Error(q(438,String(e)))}function $m(e){var t=null,n=Te.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Te.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Dm(),Te.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]=K1;return t.index++,n}function Hs(e,t){return typeof t=="function"?t(e):t}function uc(e){var t=vt();return zm(t,Fe,e)}function zm(e,t,n){var a=e.queue;if(a===null)throw Error(q(311));a.lastRenderedReducer=n;var r=e.baseQueue,l=a.pending;if(l!==null){if(r!==null){var i=r.next;r.next=l.next,l.next=i}t.baseQueue=r=l,a.pending=null}if(l=e.baseState,r===null)e.memoizedState=l;else{t=r.next;var o=i=null,c=null,d=t,f=!1;do{var h=d.lane&-536870913;if(h!==d.lane?(De&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===fl&&(f=!0);else if((Aa&m)===m){d=d.next,m===fl&&(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=l):c=c.next=h,Te.lanes|=m,Oa|=m;h=d.action,ar&&n(l,h),l=d.hasEagerState?d.eagerState:n(l,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=l):c=c.next=m,Te.lanes|=h,Oa|=h;d=d.next}while(d!==null&&d!==t);if(c===null?i=l:c.next=o,!gn(l,e.memoizedState)&&(Rt=!0,f&&(n=Zr,n!==null)))throw n;e.memoizedState=l,e.baseState=i,e.baseQueue=c,a.lastRenderedState=l}return r===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Hd(e){var t=vt(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var a=n.dispatch,r=n.pending,l=t.memoizedState;if(r!==null){n.pending=null;var i=r=r.next;do l=e(l,i.action),i=i.next;while(i!==r);gn(l,t.memoizedState)||(Rt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,a]}function mb(e,t,n){var a=Te,r=vt(),l=ze;if(l){if(n===void 0)throw Error(q(407));n=n()}else n=t();var i=!gn((Fe||r).memoizedState,n);i&&(r.memoizedState=n,Rt=!0),r=r.queue;var o=gb.bind(null,a,r,e);if(io(2048,8,o,[e]),r.getSnapshot!==t||i||pt!==null&&pt.memoizedState.tag&1){if(a.flags|=2048,ml(9,Ou(),pb.bind(null,a,r,n,t),null),We===null)throw Error(q(349));l||Aa&124||xb(a,t,n)}return n}function xb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Te.updateQueue,t===null?(t=Dm(),Te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function pb(e,t,n,a){t.value=n,t.getSnapshot=a,vb(t)&&yb(e)}function gb(e,t,n){return n(function(){vb(t)&&yb(e)})}function vb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gn(e,n)}catch{return!0}}function yb(e){var t=Cl(e,2);t!==null&&xn(t,e,2)}function lh(e){var t=Qt();if(typeof e=="function"){var n=e;if(e=n(),ar){pa(!0);try{n()}finally{pa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:e},t}function bb(e,t,n,a){return e.baseState=n,zm(e,Fe,typeof a=="function"?a:Hs)}function f2(e,t,n,a,r){if(Du(e))throw Error(q(485));if(e=t.action,e!==null){var l={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){l.listeners.push(i)}};be.T!==null?n(!0):l.isTransition=!1,a(l),n=t.pending,n===null?(l.next=t.pending=l,jb(t,l)):(l.next=n.next,t.pending=n.next=l)}}function jb(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var l=be.T,i={};be.T=i;try{var o=n(r,a),c=be.S;c!==null&&c(i,o),Jp(e,t,o)}catch(d){ih(e,t,d)}finally{be.T=l}}else try{l=n(r,a),Jp(e,t,l)}catch(d){ih(e,t,d)}}function Jp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){eg(e,t,a)},function(a){return ih(e,t,a)}):eg(e,t,n)}function eg(e,t,n){t.status="fulfilled",t.value=n,wb(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,jb(e,n)))}function ih(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,wb(t),t=t.next;while(t!==a)}e.action=null}function wb(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Nb(e,t){return t}function tg(e,t){if(ze){var n=We.formState;if(n!==null){e:{var a=Te;if(ze){if(it){t:{for(var r=it,l=ss;r.nodeType!==8;){if(!l){r=null;break t}if(r=Vn(r.nextSibling),r===null){r=null;break t}}l=r.data,r=l==="F!"||l==="F"?r:null}if(r){it=Vn(r.nextSibling),a=r.data==="F!";break e}}nr(a)}a=!1}a&&(t=n[0])}}return n=Qt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Nb,lastRenderedState:t},n.queue=a,n=Bb.bind(null,Te,a),a.dispatch=n,a=lh(!1),l=Hm.bind(null,Te,!1,a.queue),a=Qt(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=f2.bind(null,Te,r,l,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function ng(e){var t=vt();return _b(t,Fe,e)}function _b(e,t,n){if(t=zm(e,t,Nb)[0],e=uc(Hs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=lo(t)}catch(i){throw i===ro?Au:i}else a=t;t=vt();var r=t.queue,l=r.dispatch;return n!==t.memoizedState&&(Te.flags|=2048,ml(9,Ou(),h2.bind(null,r,n),null)),[a,l,e]}function h2(e,t){e.action=t}function sg(e){var t=vt(),n=Fe;if(n!==null)return _b(t,n,e);vt(),t=t.memoizedState,n=vt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function ml(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Dm(),Te.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 Ou(){return{destroy:void 0,resource:void 0}}function kb(){return vt().memoizedState}function dc(e,t,n,a){var r=Qt();a=a===void 0?null:a,Te.flags|=e,r.memoizedState=ml(1|t,Ou(),n,a)}function io(e,t,n,a){var r=vt();a=a===void 0?null:a;var l=r.memoizedState.inst;Fe!==null&&a!==null&&Rm(a,Fe.memoizedState.deps)?r.memoizedState=ml(t,l,n,a):(Te.flags|=e,r.memoizedState=ml(1|t,l,n,a))}function ag(e,t){dc(8390656,8,e,t)}function Sb(e,t){io(2048,8,e,t)}function Cb(e,t){return io(4,2,e,t)}function Tb(e,t){return io(4,4,e,t)}function Rb(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 Eb(e,t,n){n=n!=null?n.concat([e]):null,io(4,4,Rb.bind(null,t,e),n)}function Lm(){}function Ab(e,t){var n=vt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Rm(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Mb(e,t){var n=vt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Rm(t,a[1]))return a[0];if(a=e(),ar){pa(!0);try{e()}finally{pa(!1)}}return n.memoizedState=[a,t],a}function Um(e,t,n){return n===void 0||Aa&1073741824?e.memoizedState=t:(e.memoizedState=n,e=wj(),Te.lanes|=e,Oa|=e,n)}function Ob(e,t,n,a){return gn(n,t)?n:hl.current!==null?(e=Um(e,n,a),gn(e,t)||(Rt=!0),e):Aa&42?(e=wj(),Te.lanes|=e,Oa|=e,t):(Rt=!0,e.memoizedState=n)}function Db(e,t,n,a,r){var l=Le.p;Le.p=l!==0&&8>l?l:8;var i=be.T,o={};be.T=o,Hm(e,!1,t,n);try{var c=r(),d=be.S;if(d!==null&&d(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=c2(c,a);vi(e,t,f,mn(e))}else vi(e,t,a,mn(e))}catch(h){vi(e,t,{then:function(){},status:"rejected",reason:h},mn())}finally{Le.p=l,be.T=i}}function m2(){}function oh(e,t,n,a){if(e.tag!==5)throw Error(q(476));var r=$b(e).queue;Db(e,r,t,Xa,n===null?m2:function(){return zb(e),n(a)})}function $b(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Xa,baseState:Xa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:Xa},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zb(e){var t=$b(e).next.queue;vi(e,t,{},mn())}function Bm(){return Bt(zi)}function Lb(){return vt().memoizedState}function Ub(){return vt().memoizedState}function x2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mn();e=Na(n);var a=_a(t,e,n);a!==null&&(xn(a,t,n),xi(a,t,n)),t={cache:km()},e.payload=t;return}t=t.return}}function p2(e,t,n){var a=mn();n={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Du(e)?Hb(t,n):(n=jm(e,t,n,a),n!==null&&(xn(n,e,a),Ib(n,t,a)))}function Bb(e,t,n){var a=mn();vi(e,t,n,a)}function vi(e,t,n,a){var r={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Du(e))Hb(t,r);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,o=l(i,n);if(r.hasEagerState=!0,r.eagerState=o,gn(o,i))return Eu(e,t,r,0),We===null&&Ru(),!1}catch{}finally{}if(n=jm(e,t,r,a),n!==null)return xn(n,e,a),Ib(n,t,a),!0}return!1}function Hm(e,t,n,a){if(a={lane:2,revertLane:Xm(),action:a,hasEagerState:!1,eagerState:null,next:null},Du(e)){if(t)throw Error(q(479))}else t=jm(e,n,a,2),t!==null&&xn(t,e,2)}function Du(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Hb(e,t){Jr=Lc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ib(e,t,n){if(n&4194048){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ay(e,n)}}var Bc={readContext:Bt,use:Mu,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft},Pb={readContext:Bt,use:Mu,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Bt,useEffect:ag,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,dc(4194308,4,Rb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return dc(4194308,4,e,t)},useInsertionEffect:function(e,t){dc(4,2,e,t)},useMemo:function(e,t){var n=Qt();t=t===void 0?null:t;var a=e();if(ar){pa(!0);try{e()}finally{pa(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Qt();if(n!==void 0){var r=n(t);if(ar){pa(!0);try{n(t)}finally{pa(!1)}}}else r=t;return a.memoizedState=a.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},a.queue=e,e=e.dispatch=p2.bind(null,Te,e),[a.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=lh(e);var t=e.queue,n=Bb.bind(null,Te,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Lm,useDeferredValue:function(e,t){var n=Qt();return Um(n,e,t)},useTransition:function(){var e=lh(!1);return e=Db.bind(null,Te,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Te,r=Qt();if(ze){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),We===null)throw Error(q(349));De&124||xb(a,t,n)}r.memoizedState=n;var l={value:n,getSnapshot:t};return r.queue=l,ag(gb.bind(null,a,l,e),[e]),a.flags|=2048,ml(9,Ou(),pb.bind(null,a,l,n,t),null),n},useId:function(){var e=Qt(),t=We.identifierPrefix;if(ze){var n=Ms,a=As;n=(a&~(1<<32-hn(a)-1)).toString(32)+n,t="«"+t+"R"+n,n=Uc++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=u2++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Bm,useFormState:tg,useActionState:tg,useOptimistic:function(e){var t=Qt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Hm.bind(null,Te,!0,n),n.dispatch=t,[e,t]},useMemoCache:$m,useCacheRefresh:function(){return Qt().memoizedState=x2.bind(null,Te)}},qb={readContext:Bt,use:Mu,useCallback:Ab,useContext:Bt,useEffect:Sb,useImperativeHandle:Eb,useInsertionEffect:Cb,useLayoutEffect:Tb,useMemo:Mb,useReducer:uc,useRef:kb,useState:function(){return uc(Hs)},useDebugValue:Lm,useDeferredValue:function(e,t){var n=vt();return Ob(n,Fe.memoizedState,e,t)},useTransition:function(){var e=uc(Hs)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:lo(e),t]},useSyncExternalStore:mb,useId:Lb,useHostTransitionStatus:Bm,useFormState:ng,useActionState:ng,useOptimistic:function(e,t){var n=vt();return bb(n,Fe,e,t)},useMemoCache:$m,useCacheRefresh:Ub},g2={readContext:Bt,use:Mu,useCallback:Ab,useContext:Bt,useEffect:Sb,useImperativeHandle:Eb,useInsertionEffect:Cb,useLayoutEffect:Tb,useMemo:Mb,useReducer:Hd,useRef:kb,useState:function(){return Hd(Hs)},useDebugValue:Lm,useDeferredValue:function(e,t){var n=vt();return Fe===null?Um(n,e,t):Ob(n,Fe.memoizedState,e,t)},useTransition:function(){var e=Hd(Hs)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:lo(e),t]},useSyncExternalStore:mb,useId:Lb,useHostTransitionStatus:Bm,useFormState:sg,useActionState:sg,useOptimistic:function(e,t){var n=vt();return Fe!==null?bb(n,Fe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:$m,useCacheRefresh:Ub},tl=null,Mi=0;function zo(e){var t=Mi;return Mi+=1,tl===null&&(tl=[]),cb(tl,e,t)}function Vl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Lo(e,t){throw t.$$typeof===F1?Error(q(525)):(e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function rg(e){var t=e._init;return t(e._payload)}function Gb(e){function t(x,p){if(e){var b=x.deletions;b===null?(x.deletions=[p],x.flags|=16):b.push(p)}}function n(x,p){if(!e)return null;for(;p!==null;)t(x,p),p=p.sibling;return null}function a(x){for(var p=new Map;x!==null;)x.key!==null?p.set(x.key,x):p.set(x.index,x),x=x.sibling;return p}function r(x,p){return x=Ls(x,p),x.index=0,x.sibling=null,x}function l(x,p,b){return x.index=b,e?(b=x.alternate,b!==null?(b=b.index,b<p?(x.flags|=67108866,p):b):(x.flags|=67108866,p)):(x.flags|=1048576,p)}function i(x){return e&&x.alternate===null&&(x.flags|=67108866),x}function o(x,p,b,w){return p===null||p.tag!==6?(p=Ld(b,x.mode,w),p.return=x,p):(p=r(p,b),p.return=x,p)}function c(x,p,b,w){var _=b.type;return _===zr?f(x,p,b.props.children,w,b.key):p!==null&&(p.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===ua&&rg(_)===p.type)?(p=r(p,b.props),Vl(p,b),p.return=x,p):(p=oc(b.type,b.key,b.props,null,x.mode,w),Vl(p,b),p.return=x,p)}function d(x,p,b,w){return p===null||p.tag!==4||p.stateNode.containerInfo!==b.containerInfo||p.stateNode.implementation!==b.implementation?(p=Ud(b,x.mode,w),p.return=x,p):(p=r(p,b.children||[]),p.return=x,p)}function f(x,p,b,w,_){return p===null||p.tag!==7?(p=Ka(b,x.mode,w,_),p.return=x,p):(p=r(p,b),p.return=x,p)}function h(x,p,b){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Ld(""+p,x.mode,b),p.return=x,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ro:return b=oc(p.type,p.key,p.props,null,x.mode,b),Vl(b,p),b.return=x,b;case Jl:return p=Ud(p,x.mode,b),p.return=x,p;case ua:var w=p._init;return p=w(p._payload),h(x,p,b)}if(ei(p)||Il(p))return p=Ka(p,x.mode,b,null),p.return=x,p;if(typeof p.then=="function")return h(x,zo(p),b);if(p.$$typeof===Es)return h(x,Do(x,p),b);Lo(x,p)}return null}function m(x,p,b,w){var _=p!==null?p.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return _!==null?null:o(x,p,""+b,w);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ro:return b.key===_?c(x,p,b,w):null;case Jl:return b.key===_?d(x,p,b,w):null;case ua:return _=b._init,b=_(b._payload),m(x,p,b,w)}if(ei(b)||Il(b))return _!==null?null:f(x,p,b,w,null);if(typeof b.then=="function")return m(x,p,zo(b),w);if(b.$$typeof===Es)return m(x,p,Do(x,b),w);Lo(x,b)}return null}function g(x,p,b,w,_){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return x=x.get(b)||null,o(p,x,""+w,_);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ro:return x=x.get(w.key===null?b:w.key)||null,c(p,x,w,_);case Jl:return x=x.get(w.key===null?b:w.key)||null,d(p,x,w,_);case ua:var k=w._init;return w=k(w._payload),g(x,p,b,w,_)}if(ei(w)||Il(w))return x=x.get(b)||null,f(p,x,w,_,null);if(typeof w.then=="function")return g(x,p,b,zo(w),_);if(w.$$typeof===Es)return g(x,p,b,Do(p,w),_);Lo(p,w)}return null}function j(x,p,b,w){for(var _=null,k=null,N=p,S=p=0,A=null;N!==null&&S<b.length;S++){N.index>S?(A=N,N=null):A=N.sibling;var D=m(x,N,b[S],w);if(D===null){N===null&&(N=A);break}e&&N&&D.alternate===null&&t(x,N),p=l(D,p,S),k===null?_=D:k.sibling=D,k=D,N=A}if(S===b.length)return n(x,N),ze&&Va(x,S),_;if(N===null){for(;S<b.length;S++)N=h(x,b[S],w),N!==null&&(p=l(N,p,S),k===null?_=N:k.sibling=N,k=N);return ze&&Va(x,S),_}for(N=a(N);S<b.length;S++)A=g(N,x,S,b[S],w),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?S:A.key),p=l(A,p,S),k===null?_=A:k.sibling=A,k=A);return e&&N.forEach(function(G){return t(x,G)}),ze&&Va(x,S),_}function v(x,p,b,w){if(b==null)throw Error(q(151));for(var _=null,k=null,N=p,S=p=0,A=null,D=b.next();N!==null&&!D.done;S++,D=b.next()){N.index>S?(A=N,N=null):A=N.sibling;var G=m(x,N,D.value,w);if(G===null){N===null&&(N=A);break}e&&N&&G.alternate===null&&t(x,N),p=l(G,p,S),k===null?_=G:k.sibling=G,k=G,N=A}if(D.done)return n(x,N),ze&&Va(x,S),_;if(N===null){for(;!D.done;S++,D=b.next())D=h(x,D.value,w),D!==null&&(p=l(D,p,S),k===null?_=D:k.sibling=D,k=D);return ze&&Va(x,S),_}for(N=a(N);!D.done;S++,D=b.next())D=g(N,x,S,D.value,w),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?S:D.key),p=l(D,p,S),k===null?_=D:k.sibling=D,k=D);return e&&N.forEach(function(Y){return t(x,Y)}),ze&&Va(x,S),_}function y(x,p,b,w){if(typeof b=="object"&&b!==null&&b.type===zr&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Ro:e:{for(var _=b.key;p!==null;){if(p.key===_){if(_=b.type,_===zr){if(p.tag===7){n(x,p.sibling),w=r(p,b.props.children),w.return=x,x=w;break e}}else if(p.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===ua&&rg(_)===p.type){n(x,p.sibling),w=r(p,b.props),Vl(w,b),w.return=x,x=w;break e}n(x,p);break}else t(x,p);p=p.sibling}b.type===zr?(w=Ka(b.props.children,x.mode,w,b.key),w.return=x,x=w):(w=oc(b.type,b.key,b.props,null,x.mode,w),Vl(w,b),w.return=x,x=w)}return i(x);case Jl:e:{for(_=b.key;p!==null;){if(p.key===_)if(p.tag===4&&p.stateNode.containerInfo===b.containerInfo&&p.stateNode.implementation===b.implementation){n(x,p.sibling),w=r(p,b.children||[]),w.return=x,x=w;break e}else{n(x,p);break}else t(x,p);p=p.sibling}w=Ud(b,x.mode,w),w.return=x,x=w}return i(x);case ua:return _=b._init,b=_(b._payload),y(x,p,b,w)}if(ei(b))return j(x,p,b,w);if(Il(b)){if(_=Il(b),typeof _!="function")throw Error(q(150));return b=_.call(b),v(x,p,b,w)}if(typeof b.then=="function")return y(x,p,zo(b),w);if(b.$$typeof===Es)return y(x,p,Do(x,b),w);Lo(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,p!==null&&p.tag===6?(n(x,p.sibling),w=r(p,b),w.return=x,x=w):(n(x,p),w=Ld(b,x.mode,w),w.return=x,x=w),i(x)):n(x,p)}return function(x,p,b,w){try{Mi=0;var _=y(x,p,b,w);return tl=null,_}catch(N){if(N===ro||N===Au)throw N;var k=dn(29,N,null,x.mode);return k.lanes=w,k.return=x,k}finally{}}}var xl=Gb(!0),Vb=Gb(!1),On=ps(null),ds=null;function ha(e){var t=e.alternate;tt(wt,wt.current&1),tt(On,e),ds===null&&(t===null||hl.current!==null||t.memoizedState!==null)&&(ds=e)}function Yb(e){if(e.tag===22){if(tt(wt,wt.current),tt(On,e),ds===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(ds=e)}}else ma()}function ma(){tt(wt,wt.current),tt(On,On.current)}function Ds(e){Et(On),ds===e&&(ds=null),Et(wt)}var wt=ps(0);function Hc(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==="$?"||kh(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 Id(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:Ze({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ch={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=mn(),r=Na(a);r.payload=t,n!=null&&(r.callback=n),t=_a(e,r,a),t!==null&&(xn(t,e,a),xi(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=mn(),r=Na(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=_a(e,r,a),t!==null&&(xn(t,e,a),xi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mn(),a=Na(n);a.tag=2,t!=null&&(a.callback=t),t=_a(e,a,n),t!==null&&(xn(t,e,n),xi(t,e,n))}};function lg(e,t,n,a,r,l,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,l,i):t.prototype&&t.prototype.isPureReactComponent?!Ri(n,a)||!Ri(r,l):!0}function ig(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&&ch.enqueueReplaceState(t,t.state,null)}function rr(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=Ze({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var Ic=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 Fb(e){Ic(e)}function Xb(e){console.error(e)}function Kb(e){Ic(e)}function Pc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function og(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function uh(e,t,n){return n=Na(n),n.tag=3,n.payload={element:null},n.callback=function(){Pc(e,t)},n}function Qb(e){return e=Na(e),e.tag=3,e}function Wb(e,t,n,a){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var l=a.value;e.payload=function(){return r(l)},e.callback=function(){og(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){og(t,n,a),typeof r!="function"&&(ka===null?ka=new Set([this]):ka.add(this));var o=a.stack;this.componentDidCatch(a.value,{componentStack:o!==null?o:""})})}function v2(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&so(t,n,r,!0),n=On.current,n!==null){switch(n.tag){case 13:return ds===null?vh():n.alternate===null&&ot===0&&(ot=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===nh?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Zd(e,a,r)),!1;case 22:return n.flags|=65536,a===nh?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)),Zd(e,a,r)),!1}throw Error(q(435,n.tag))}return Zd(e,a,r),vh(),!1}if(ze)return t=On.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==Wf&&(e=Error(q(422),{cause:a}),Ei(Cn(e,n)))):(a!==Wf&&(t=Error(q(423),{cause:a}),Ei(Cn(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=Cn(a,n),r=uh(e.stateNode,a,r),Bd(e,r),ot!==4&&(ot=2)),!1;var l=Error(q(520),{cause:a});if(l=Cn(l,n),ji===null?ji=[l]:ji.push(l),ot!==4&&(ot=2),t===null)return!0;a=Cn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=uh(n.stateNode,a,e),Bd(n,e),!1;case 1:if(t=n.type,l=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||l!==null&&typeof l.componentDidCatch=="function"&&(ka===null||!ka.has(l))))return n.flags|=65536,r&=-r,n.lanes|=r,r=Qb(r),Wb(r,e,n,a),Bd(n,r),!1}n=n.return}while(n!==null);return!1}var Zb=Error(q(461)),Rt=!1;function Mt(e,t,n,a){t.child=e===null?Vb(t,null,n,a):xl(t,e.child,n,a)}function cg(e,t,n,a,r){n=n.render;var l=t.ref;if("ref"in a){var i={};for(var o in a)o!=="ref"&&(i[o]=a[o])}else i=a;return sr(t),a=Em(e,t,n,i,l,r),o=Am(),e!==null&&!Rt?(Mm(e,t,r),Is(e,t,r)):(ze&&o&&Nm(t),t.flags|=1,Mt(e,t,a,r),t.child)}function ug(e,t,n,a,r){if(e===null){var l=n.type;return typeof l=="function"&&!wm(l)&&l.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=l,Jb(e,t,l,a,r)):(e=oc(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!Im(e,r)){var i=l.memoizedProps;if(n=n.compare,n=n!==null?n:Ri,n(i,a)&&e.ref===t.ref)return Is(e,t,r)}return t.flags|=1,e=Ls(l,a),e.ref=t.ref,e.return=t,t.child=e}function Jb(e,t,n,a,r){if(e!==null){var l=e.memoizedProps;if(Ri(l,a)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=a=l,Im(e,r))e.flags&131072&&(Rt=!0);else return t.lanes=e.lanes,Is(e,t,r)}return dh(e,t,n,a,r)}function ej(e,t,n){var a=t.pendingProps,r=a.children,l=e!==null?e.memoizedState:null;if(a.mode==="hidden"){if(t.flags&128){if(a=l!==null?l.baseLanes|n:n,e!==null){for(r=t.child=e.child,l=0;r!==null;)l=l|r.lanes|r.childLanes,r=r.sibling;t.childLanes=l&~a}else t.childLanes=0,t.child=null;return dg(e,t,a,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&cc(t,l!==null?l.cachePool:null),l!==null?Zp(t,l):rh(),Yb(t);else return t.lanes=t.childLanes=536870912,dg(e,t,l!==null?l.baseLanes|n:n,n)}else l!==null?(cc(t,l.cachePool),Zp(t,l),ma(),t.memoizedState=null):(e!==null&&cc(t,null),rh(),ma());return Mt(e,t,r,n),t.child}function dg(e,t,n,a){var r=Sm();return r=r===null?null:{parent:jt._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&cc(t,null),rh(),Yb(t),e!==null&&so(e,t,a,!0),null}function fc(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(q(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dh(e,t,n,a,r){return sr(t),n=Em(e,t,n,a,void 0,r),a=Am(),e!==null&&!Rt?(Mm(e,t,r),Is(e,t,r)):(ze&&a&&Nm(t),t.flags|=1,Mt(e,t,n,r),t.child)}function fg(e,t,n,a,r,l){return sr(t),t.updateQueue=null,n=hb(t,a,n,r),fb(e),a=Am(),e!==null&&!Rt?(Mm(e,t,l),Is(e,t,l)):(ze&&a&&Nm(t),t.flags|=1,Mt(e,t,n,l),t.child)}function hg(e,t,n,a,r){if(sr(t),t.stateNode===null){var l=Gr,i=n.contextType;typeof i=="object"&&i!==null&&(l=Bt(i)),l=new n(a,l),t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=ch,t.stateNode=l,l._reactInternals=t,l=t.stateNode,l.props=a,l.state=t.memoizedState,l.refs={},Cm(t),i=n.contextType,l.context=typeof i=="object"&&i!==null?Bt(i):Gr,l.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(Id(t,n,i,a),l.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof l.getSnapshotBeforeUpdate=="function"||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(i=l.state,typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount(),i!==l.state&&ch.enqueueReplaceState(l,l.state,null),gi(t,a,l,r),pi(),l.state=t.memoizedState),typeof l.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){l=t.stateNode;var o=t.memoizedProps,c=rr(n,o);l.props=c;var d=l.context,f=n.contextType;i=Gr,typeof f=="object"&&f!==null&&(i=Bt(f));var h=n.getDerivedStateFromProps;f=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,f||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(o||d!==i)&&ig(t,l,a,i),da=!1;var m=t.memoizedState;l.state=m,gi(t,a,l,r),pi(),d=t.memoizedState,o||m!==d||da?(typeof h=="function"&&(Id(t,n,h,a),d=t.memoizedState),(c=da||lg(t,n,c,a,m,d,i))?(f||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=d),l.props=a,l.state=d,l.context=i,a=c):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{l=t.stateNode,sh(e,t),i=t.memoizedProps,f=rr(n,i),l.props=f,h=t.pendingProps,m=l.context,d=n.contextType,c=Gr,typeof d=="object"&&d!==null&&(c=Bt(d)),o=n.getDerivedStateFromProps,(d=typeof o=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(i!==h||m!==c)&&ig(t,l,a,c),da=!1,m=t.memoizedState,l.state=m,gi(t,a,l,r),pi();var g=t.memoizedState;i!==h||m!==g||da||e!==null&&e.dependencies!==null&&$c(e.dependencies)?(typeof o=="function"&&(Id(t,n,o,a),g=t.memoizedState),(f=da||lg(t,n,f,a,m,g,c)||e!==null&&e.dependencies!==null&&$c(e.dependencies))?(d||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(a,g,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(a,g,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=g),l.props=a,l.state=g,l.context=c,a=f):(typeof l.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),a=!1)}return l=a,fc(e,t),a=(t.flags&128)!==0,l||a?(l=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:l.render(),t.flags|=1,e!==null&&a?(t.child=xl(t,e.child,null,r),t.child=xl(t,null,n,r)):Mt(e,t,n,r),t.memoizedState=l.state,e=t.child):e=Is(e,t,r),e}function mg(e,t,n,a){return no(),t.flags|=256,Mt(e,t,n,a),t.child}var Pd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qd(e){return{baseLanes:e,cachePool:ib()}}function Gd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Tn),e}function tj(e,t,n){var a=t.pendingProps,r=!1,l=(t.flags&128)!==0,i;if((i=l)||(i=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(r?ha(t):ma(),ze){var o=it,c;if(c=o){e:{for(c=o,o=ss;c.nodeType!==8;){if(!o){o=null;break e}if(c=Vn(c.nextSibling),c===null){o=null;break e}}o=c}o!==null?(t.memoizedState={dehydrated:o,treeContext:Qa!==null?{id:As,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},c=dn(18,null,null,0),c.stateNode=o,c.return=t,t.child=c,qt=t,it=null,c=!0):c=!1}c||nr(t)}if(o=t.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return kh(o)?t.lanes=32:t.lanes=536870912,null;Ds(t)}return o=a.children,a=a.fallback,r?(ma(),r=t.mode,o=qc({mode:"hidden",children:o},r),a=Ka(a,r,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,r=t.child,r.memoizedState=qd(n),r.childLanes=Gd(e,i,n),t.memoizedState=Pd,a):(ha(t),fh(t,o))}if(c=e.memoizedState,c!==null&&(o=c.dehydrated,o!==null)){if(l)t.flags&256?(ha(t),t.flags&=-257,t=Vd(e,t,n)):t.memoizedState!==null?(ma(),t.child=e.child,t.flags|=128,t=null):(ma(),r=a.fallback,o=t.mode,a=qc({mode:"visible",children:a.children},o),r=Ka(r,o,n,null),r.flags|=2,a.return=t,r.return=t,a.sibling=r,t.child=a,xl(t,e.child,null,n),a=t.child,a.memoizedState=qd(n),a.childLanes=Gd(e,i,n),t.memoizedState=Pd,t=r);else if(ha(t),kh(o)){if(i=o.nextSibling&&o.nextSibling.dataset,i)var d=i.dgst;i=d,a=Error(q(419)),a.stack="",a.digest=i,Ei({value:a,source:null,stack:null}),t=Vd(e,t,n)}else if(Rt||so(e,t,n,!1),i=(n&e.childLanes)!==0,Rt||i){if(i=We,i!==null&&(a=n&-n,a=a&42?1:dm(a),a=a&(i.suspendedLanes|n)?0:a,a!==0&&a!==c.retryLane))throw c.retryLane=a,Cl(e,a),xn(i,e,a),Zb;o.data==="$?"||vh(),t=Vd(e,t,n)}else o.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,it=Vn(o.nextSibling),qt=t,ze=!0,Wa=null,ss=!1,e!==null&&(_n[kn++]=As,_n[kn++]=Ms,_n[kn++]=Qa,As=e.id,Ms=e.overflow,Qa=t),t=fh(t,a.children),t.flags|=4096);return t}return r?(ma(),r=a.fallback,o=t.mode,c=e.child,d=c.sibling,a=Ls(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,d!==null?r=Ls(d,r):(r=Ka(r,o,n,null),r.flags|=2),r.return=t,a.return=t,a.sibling=r,t.child=a,a=r,r=t.child,o=e.child.memoizedState,o===null?o=qd(n):(c=o.cachePool,c!==null?(d=jt._currentValue,c=c.parent!==d?{parent:d,pool:d}:c):c=ib(),o={baseLanes:o.baseLanes|n,cachePool:c}),r.memoizedState=o,r.childLanes=Gd(e,i,n),t.memoizedState=Pd,a):(ha(t),n=e.child,e=n.sibling,n=Ls(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 fh(e,t){return t=qc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function qc(e,t){return e=dn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Vd(e,t,n){return xl(t,e.child,null,n),e=fh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xg(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Jf(e.return,t,n)}function Yd(e,t,n,a,r){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:r}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=a,l.tail=n,l.tailMode=r)}function nj(e,t,n){var a=t.pendingProps,r=a.revealOrder,l=a.tail;if(Mt(e,t,a.children,n),a=wt.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&&xg(e,n,t);else if(e.tag===19)xg(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(tt(wt,a),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Hc(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Yd(t,!1,r,n,l);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Hc(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Yd(t,!0,n,null,l);break;case"together":Yd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Is(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Oa|=t.lanes,!(n&t.childLanes))if(e!==null){if(so(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,n=Ls(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ls(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Im(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&$c(e)))}function y2(e,t,n){switch(t.tag){case 3:Cc(t,t.stateNode.containerInfo),fa(t,jt,e.memoizedState.cache),no();break;case 27:case 5:If(t);break;case 4:Cc(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?tj(e,t,n):(ha(t),e=Is(e,t,n),e!==null?e.sibling:null);ha(t);break;case 19:var r=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(so(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return nj(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),tt(wt,wt.current),a)break;return null;case 22:case 23:return t.lanes=0,ej(e,t,n);case 24:fa(t,jt,e.memoizedState.cache)}return Is(e,t,n)}function sj(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!Im(e,n)&&!(t.flags&128))return Rt=!1,y2(e,t,n);Rt=!!(e.flags&131072)}else Rt=!1,ze&&t.flags&1048576&&rb(t,Dc,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var a=t.elementType,r=a._init;if(a=r(a._payload),t.type=a,typeof a=="function")wm(a)?(e=rr(a,e),t.tag=1,t=hg(null,t,a,e,n)):(t.tag=0,t=dh(null,t,a,e,n));else{if(a!=null){if(r=a.$$typeof,r===om){t.tag=11,t=cg(null,t,a,e,n);break e}else if(r===cm){t.tag=14,t=ug(null,t,a,e,n);break e}}throw t=Bf(a)||a,Error(q(306,t,""))}}return t;case 0:return dh(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=rr(a,t.pendingProps),hg(e,t,a,r,n);case 3:e:{if(Cc(t,t.stateNode.containerInfo),e===null)throw Error(q(387));a=t.pendingProps;var l=t.memoizedState;r=l.element,sh(e,t),gi(t,a,null,n);var i=t.memoizedState;if(a=i.cache,fa(t,jt,a),a!==l.cache&&eh(t,[jt],n,!0),pi(),a=i.element,l.isDehydrated)if(l={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){t=mg(e,t,a,n);break e}else if(a!==r){r=Cn(Error(q(424)),t),Ei(r),t=mg(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(it=Vn(e.firstChild),qt=t,ze=!0,Wa=null,ss=!0,n=Vb(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(no(),a===r){t=Is(e,t,n);break e}Mt(e,t,a,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=Mg(t.type,null,t.pendingProps,null))?t.memoizedState=n:ze||(n=t.type,e=t.pendingProps,a=Qc(wa.current).createElement(n),a[Ut]=t,a[Jt]=e,Dt(a,n,e),Tt(a),t.stateNode=a):t.memoizedState=Mg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return If(t),e===null&&ze&&(a=t.stateNode=qj(t.type,t.pendingProps,wa.current),qt=t,ss=!0,r=it,Ua(t.type)?(Sh=r,it=Vn(a.firstChild)):it=r),Mt(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((r=a=it)&&(a=F2(a,t.type,t.pendingProps,ss),a!==null?(t.stateNode=a,qt=t,it=Vn(a.firstChild),ss=!1,r=!0):r=!1),r||nr(t)),If(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,a=l.children,Nh(r,l)?a=null:i!==null&&Nh(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=Em(e,t,d2,null,null,n),zi._currentValue=r),fc(e,t),Mt(e,t,a,n),t.child;case 6:return e===null&&ze&&((e=n=it)&&(n=X2(n,t.pendingProps,ss),n!==null?(t.stateNode=n,qt=t,it=null,e=!0):e=!1),e||nr(t)),null;case 13:return tj(e,t,n);case 4:return Cc(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=xl(t,null,a,n):Mt(e,t,a,n),t.child;case 11:return cg(e,t,t.type,t.pendingProps,n);case 7:return Mt(e,t,t.pendingProps,n),t.child;case 8:return Mt(e,t,t.pendingProps.children,n),t.child;case 12:return Mt(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,fa(t,t.type,a.value),Mt(e,t,a.children,n),t.child;case 9:return r=t.type._context,a=t.pendingProps.children,sr(t),r=Bt(r),a=a(r),t.flags|=1,Mt(e,t,a,n),t.child;case 14:return ug(e,t,t.type,t.pendingProps,n);case 15:return Jb(e,t,t.type,t.pendingProps,n);case 19:return nj(e,t,n);case 31:return a=t.pendingProps,n=t.mode,a={mode:a.mode,children:a.children},e===null?(n=qc(a,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Ls(e.child,a),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return ej(e,t,n);case 24:return sr(t),a=Bt(jt),e===null?(r=Sm(),r===null&&(r=We,l=km(),r.pooledCache=l,l.refCount++,l!==null&&(r.pooledCacheLanes|=n),r=l),t.memoizedState={parent:a,cache:r},Cm(t),fa(t,jt,r)):(e.lanes&n&&(sh(e,t),gi(t,null,null,n),pi()),r=e.memoizedState,l=t.memoizedState,r.parent!==a?(r={parent:a,cache:a},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),fa(t,jt,a)):(a=l.cache,fa(t,jt,a),a!==r.cache&&eh(t,[jt],n,!0))),Mt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(q(156,t.tag))}function Ns(e){e.flags|=4}function pg(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yj(t)){if(t=On.current,t!==null&&((De&4194048)===De?ds!==null:(De&62914560)!==De&&!(De&536870912)||t!==ds))throw mi=nh,ob;e.flags|=8192}}function Uo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ry():536870912,e.lanes|=t,pl|=t)}function Yl(e,t){if(!ze)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 lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags&65011712,a|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,a|=r.subtreeFlags,a|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function b2(e,t,n){var a=t.pendingProps;switch(_m(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Us(jt),cl(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Gl(t)?Ns(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yp())),lt(t),null;case 26:return n=t.memoizedState,e===null?(Ns(t),n!==null?(lt(t),pg(t,n)):(lt(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Ns(t),lt(t),pg(t,n)):(lt(t),t.flags&=-16777217):(e.memoizedProps!==a&&Ns(t),lt(t),t.flags&=-16777217),null;case 27:Tc(t),n=wa.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ns(t);else{if(!a){if(t.stateNode===null)throw Error(q(166));return lt(t),null}e=cs.current,Gl(t)?Gp(t):(e=qj(r,a,n),t.stateNode=e,Ns(t))}return lt(t),null;case 5:if(Tc(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ns(t);else{if(!a){if(t.stateNode===null)throw Error(q(166));return lt(t),null}if(e=cs.current,Gl(t))Gp(t);else{switch(r=Qc(wa.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof a.is=="string"?r.createElement("select",{is:a.is}):r.createElement("select"),a.multiple?e.multiple=!0:a.size&&(e.size=a.size);break;default:e=typeof a.is=="string"?r.createElement(n,{is:a.is}):r.createElement(n)}}e[Ut]=t,e[Jt]=a;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(Dt(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&&Ns(t)}}return lt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Ns(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(q(166));if(e=wa.current,Gl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=qt,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[Ut]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Hj(e.nodeValue,n)),e||nr(t)}else e=Qc(e).createTextNode(a),e[Ut]=t,t.stateNode=e}return lt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Gl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!r)throw Error(q(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(q(317));r[Ut]=t}else no(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),r=!1}else r=Yp(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Ds(t),t):(Ds(t),null)}if(Ds(t),t.flags&128)return t.lanes=n,t;if(n=a!==null,e=e!==null&&e.memoizedState!==null,n){a=t.child,r=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(r=a.alternate.memoizedState.cachePool.pool);var l=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),l!==r&&(a.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Uo(t,t.updateQueue),lt(t),null;case 4:return cl(),e===null&&Km(t.stateNode.containerInfo),lt(t),null;case 10:return Us(t.type),lt(t),null;case 19:if(Et(wt),r=t.memoizedState,r===null)return lt(t),null;if(a=(t.flags&128)!==0,l=r.rendering,l===null)if(a)Yl(r,!1);else{if(ot!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Hc(e),l!==null){for(t.flags|=128,Yl(r,!1),e=l.updateQueue,t.updateQueue=e,Uo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ab(n,e),n=n.sibling;return tt(wt,wt.current&1|2),t.child}e=e.sibling}r.tail!==null&&us()>Vc&&(t.flags|=128,a=!0,Yl(r,!1),t.lanes=4194304)}else{if(!a)if(e=Hc(l),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Uo(t,e),Yl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!l.alternate&&!ze)return lt(t),null}else 2*us()-r.renderingStartTime>Vc&&n!==536870912&&(t.flags|=128,a=!0,Yl(r,!1),t.lanes=4194304);r.isBackwards?(l.sibling=t.child,t.child=l):(e=r.last,e!==null?e.sibling=l:t.child=l,r.last=l)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=us(),t.sibling=null,e=wt.current,tt(wt,a?e&1|2:e&1),t):(lt(t),null);case 22:case 23:return Ds(t),Tm(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?n&536870912&&!(t.flags&128)&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),n=t.updateQueue,n!==null&&Uo(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&&Et(Za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Us(jt),lt(t),null;case 25:return null;case 30:return null}throw Error(q(156,t.tag))}function j2(e,t){switch(_m(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Us(jt),cl(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Tc(t),null;case 13:if(Ds(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));no()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Et(wt),null;case 4:return cl(),null;case 10:return Us(t.type),null;case 22:case 23:return Ds(t),Tm(),e!==null&&Et(Za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Us(jt),null;case 25:return null;default:return null}}function aj(e,t){switch(_m(t),t.tag){case 3:Us(jt),cl();break;case 26:case 27:case 5:Tc(t);break;case 4:cl();break;case 13:Ds(t);break;case 19:Et(wt);break;case 10:Us(t.type);break;case 22:case 23:Ds(t),Tm(),e!==null&&Et(Za);break;case 24:Us(jt)}}function oo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var r=a.next;n=r;do{if((n.tag&e)===e){a=void 0;var l=n.create,i=n.inst;a=l(),i.destroy=a}n=n.next}while(n!==r)}}catch(o){Ke(t,t.return,o)}}function Ma(e,t,n){try{var a=t.updateQueue,r=a!==null?a.lastEffect:null;if(r!==null){var l=r.next;a=l;do{if((a.tag&e)===e){var i=a.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,r=t;var c=n,d=o;try{d()}catch(f){Ke(r,c,f)}}}a=a.next}while(a!==l)}}catch(f){Ke(t,t.return,f)}}function rj(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{db(t,n)}catch(a){Ke(e,e.return,a)}}}function lj(e,t,n){n.props=rr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Ke(e,t,a)}}function yi(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(r){Ke(e,t,r)}}function ls(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(r){Ke(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Ke(e,t,r)}else n.current=null}function ij(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(r){Ke(e,e.return,r)}}function Fd(e,t,n){try{var a=e.stateNode;P2(a,e.type,n,t),a[Jt]=t}catch(r){Ke(e,e.return,r)}}function oj(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ua(e.type)||e.tag===4}function Xd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oj(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 hh(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=Uu));else if(a!==4&&(a===27&&Ua(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(hh(e,t,n),e=e.sibling;e!==null;)hh(e,t,n),e=e.sibling}function Gc(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(Gc(e,t,n),e=e.sibling;e!==null;)Gc(e,t,n),e=e.sibling}function cj(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);Dt(t,a,n),t[Ut]=e,t[Jt]=n}catch(l){Ke(e,e.return,l)}}var Rs=!1,ht=!1,Kd=!1,gg=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function w2(e,t){if(e=e.containerInfo,jh=eu,e=Qy(e),ym(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var r=a.anchorOffset,l=a.focusNode;a=a.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var i=0,o=-1,c=-1,d=0,f=0,h=e,m=null;t:for(;;){for(var g;h!==n||r!==0&&h.nodeType!==3||(o=i+r),h!==l||a!==0&&h.nodeType!==3||(c=i+a),h.nodeType===3&&(i+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===e)break t;if(m===n&&++d===r&&(o=i),m===l&&++f===a&&(c=i),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(wh={focusedElem:e,selectionRange:n},eu=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){switch(t=Ct,l=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&l!==null){e=void 0,n=t,r=l.memoizedProps,l=l.memoizedState,a=n.stateNode;try{var j=rr(n.type,r,n.elementType===n.type);e=a.getSnapshotBeforeUpdate(j,l),a.__reactInternalSnapshotBeforeUpdate=e}catch(v){Ke(n,n.return,v)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)_h(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_h(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(q(163))}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}}function uj(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:aa(e,n),a&4&&oo(5,n);break;case 1:if(aa(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Ke(n,n.return,i)}else{var r=rr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Ke(n,n.return,i)}}a&64&&rj(n),a&512&&yi(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{db(e,t)}catch(i){Ke(n,n.return,i)}}break;case 27:t===null&&a&4&&cj(n);case 26:case 5:aa(e,n),t===null&&a&4&&ij(n),a&512&&yi(n,n.return);break;case 12:aa(e,n);break;case 13:aa(e,n),a&4&&hj(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=A2.bind(null,n),K2(e,n))));break;case 22:if(a=n.memoizedState!==null||Rs,!a){t=t!==null&&t.memoizedState!==null||ht,r=Rs;var l=ht;Rs=a,(ht=t)&&!l?oa(e,n,(n.subtreeFlags&8772)!==0):aa(e,n),Rs=r,ht=l}break;case 30:break;default:aa(e,n)}}function dj(e){var t=e.alternate;t!==null&&(e.alternate=null,dj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&hm(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 Je=null,Wt=!1;function _s(e,t,n){for(n=n.child;n!==null;)fj(e,t,n),n=n.sibling}function fj(e,t,n){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(Wi,n)}catch{}switch(n.tag){case 26:ht||ls(n,t),_s(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ht||ls(n,t);var a=Je,r=Wt;Ua(n.type)&&(Je=n.stateNode,Wt=!1),_s(e,t,n),Ni(n.stateNode),Je=a,Wt=r;break;case 5:ht||ls(n,t);case 6:if(a=Je,r=Wt,Je=null,_s(e,t,n),Je=a,Wt=r,Je!==null)if(Wt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(n.stateNode)}catch(l){Ke(n,t,l)}else try{Je.removeChild(n.stateNode)}catch(l){Ke(n,t,l)}break;case 18:Je!==null&&(Wt?(e=Je,Rg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Bi(e)):Rg(Je,n.stateNode));break;case 4:a=Je,r=Wt,Je=n.stateNode.containerInfo,Wt=!0,_s(e,t,n),Je=a,Wt=r;break;case 0:case 11:case 14:case 15:ht||Ma(2,n,t),ht||Ma(4,n,t),_s(e,t,n);break;case 1:ht||(ls(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&lj(n,t,a)),_s(e,t,n);break;case 21:_s(e,t,n);break;case 22:ht=(a=ht)||n.memoizedState!==null,_s(e,t,n),ht=a;break;default:_s(e,t,n)}}function hj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bi(e)}catch(n){Ke(t,t.return,n)}}function N2(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new gg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new gg),t;default:throw Error(q(435,e.tag))}}function Qd(e,t){var n=N2(e);t.forEach(function(a){var r=M2.bind(null,e,a);n.has(a)||(n.add(a),a.then(r,r))})}function rn(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var r=n[a],l=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 27:if(Ua(o.type)){Je=o.stateNode,Wt=!1;break e}break;case 5:Je=o.stateNode,Wt=!1;break e;case 3:case 4:Je=o.stateNode.containerInfo,Wt=!0;break e}o=o.return}if(Je===null)throw Error(q(160));fj(l,i,r),Je=null,Wt=!1,l=r.alternate,l!==null&&(l.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)mj(t,e),t=t.sibling}var Pn=null;function mj(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:rn(t,e),ln(e),a&4&&(Ma(3,e,e.return),oo(3,e),Ma(5,e,e.return));break;case 1:rn(t,e),ln(e),a&512&&(ht||n===null||ls(n,n.return)),a&64&&Rs&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var r=Pn;if(rn(t,e),ln(e),a&512&&(ht||n===null||ls(n,n.return)),a&4){var l=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,r=r.ownerDocument||r;t:switch(a){case"title":l=r.getElementsByTagName("title")[0],(!l||l[eo]||l[Ut]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=r.createElement(a),r.head.insertBefore(l,r.querySelector("head > title"))),Dt(l,a,n),l[Ut]=e,Tt(l),a=l;break e;case"link":var i=Dg("link","href",r).get(a+(n.href||""));if(i){for(var o=0;o<i.length;o++)if(l=i[o],l.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&l.getAttribute("rel")===(n.rel==null?null:n.rel)&&l.getAttribute("title")===(n.title==null?null:n.title)&&l.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(o,1);break t}}l=r.createElement(a),Dt(l,a,n),r.head.appendChild(l);break;case"meta":if(i=Dg("meta","content",r).get(a+(n.content||""))){for(o=0;o<i.length;o++)if(l=i[o],l.getAttribute("content")===(n.content==null?null:""+n.content)&&l.getAttribute("name")===(n.name==null?null:n.name)&&l.getAttribute("property")===(n.property==null?null:n.property)&&l.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&l.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(o,1);break t}}l=r.createElement(a),Dt(l,a,n),r.head.appendChild(l);break;default:throw Error(q(468,a))}l[Ut]=e,Tt(l),a=l}e.stateNode=a}else $g(r,e.type,e.stateNode);else e.stateNode=Og(r,a,e.memoizedProps);else l!==a?(l===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):l.count--,a===null?$g(r,e.type,e.stateNode):Og(r,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Fd(e,e.memoizedProps,n.memoizedProps)}break;case 27:rn(t,e),ln(e),a&512&&(ht||n===null||ls(n,n.return)),n!==null&&a&4&&Fd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(rn(t,e),ln(e),a&512&&(ht||n===null||ls(n,n.return)),e.flags&32){r=e.stateNode;try{dl(r,"")}catch(g){Ke(e,e.return,g)}}a&4&&e.stateNode!=null&&(r=e.memoizedProps,Fd(e,r,n!==null?n.memoizedProps:r)),a&1024&&(Kd=!0);break;case 6:if(rn(t,e),ln(e),a&4){if(e.stateNode===null)throw Error(q(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(g){Ke(e,e.return,g)}}break;case 3:if(xc=null,r=Pn,Pn=Wc(t.containerInfo),rn(t,e),Pn=r,ln(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Bi(t.containerInfo)}catch(g){Ke(e,e.return,g)}Kd&&(Kd=!1,xj(e));break;case 4:a=Pn,Pn=Wc(e.stateNode.containerInfo),rn(t,e),ln(e),Pn=a;break;case 12:rn(t,e),ln(e);break;case 13:rn(t,e),ln(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ym=us()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Qd(e,a)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=Rs,f=ht;if(Rs=d||r,ht=f||c,rn(t,e),ht=f,Rs=d,ln(e),a&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||Rs||ht||Ya(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(l=c.stateNode,r)i=l.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{o=c.stateNode;var h=c.memoizedProps.style,m=h!=null&&h.hasOwnProperty("display")?h.display:null;o.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(g){Ke(c,c.return,g)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(g){Ke(c,c.return,g)}}}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,Qd(e,n))));break;case 19:rn(t,e),ln(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Qd(e,a)));break;case 30:break;case 21:break;default:rn(t,e),ln(e)}}function ln(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(oj(a)){n=a;break}a=a.return}if(n==null)throw Error(q(160));switch(n.tag){case 27:var r=n.stateNode,l=Xd(e);Gc(e,l,r);break;case 5:var i=n.stateNode;n.flags&32&&(dl(i,""),n.flags&=-33);var o=Xd(e);Gc(e,o,i);break;case 3:case 4:var c=n.stateNode.containerInfo,d=Xd(e);hh(e,d,c);break;default:throw Error(q(161))}}catch(f){Ke(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xj(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xj(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;)uj(e,t.alternate,t),t=t.sibling}function Ya(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),Ya(t);break;case 1:ls(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&lj(t,t.return,n),Ya(t);break;case 27:Ni(t.stateNode);case 26:case 5:ls(t,t.return),Ya(t);break;case 22:t.memoizedState===null&&Ya(t);break;case 30:Ya(t);break;default:Ya(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,r=e,l=t,i=l.flags;switch(l.tag){case 0:case 11:case 15:oa(r,l,n),oo(4,l);break;case 1:if(oa(r,l,n),a=l,r=a.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(d){Ke(a,a.return,d)}if(a=l,r=a.updateQueue,r!==null){var o=a.stateNode;try{var c=r.shared.hiddenCallbacks;if(c!==null)for(r.shared.hiddenCallbacks=null,r=0;r<c.length;r++)ub(c[r],o)}catch(d){Ke(a,a.return,d)}}n&&i&64&&rj(l),yi(l,l.return);break;case 27:cj(l);case 26:case 5:oa(r,l,n),n&&a===null&&i&4&&ij(l),yi(l,l.return);break;case 12:oa(r,l,n);break;case 13:oa(r,l,n),n&&i&4&&hj(r,l);break;case 22:l.memoizedState===null&&oa(r,l,n),yi(l,l.return);break;case 30:break;default:oa(r,l,n)}t=t.sibling}}function Pm(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&&ao(n))}function qm(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ao(e))}function ns(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)pj(e,t,n,a),t=t.sibling}function pj(e,t,n,a){var r=t.flags;switch(t.tag){case 0:case 11:case 15:ns(e,t,n,a),r&2048&&oo(9,t);break;case 1:ns(e,t,n,a);break;case 3:ns(e,t,n,a),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ao(e)));break;case 12:if(r&2048){ns(e,t,n,a),e=t.stateNode;try{var l=t.memoizedProps,i=l.id,o=l.onPostCommit;typeof o=="function"&&o(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Ke(t,t.return,c)}}else ns(e,t,n,a);break;case 13:ns(e,t,n,a);break;case 23:break;case 22:l=t.stateNode,i=t.alternate,t.memoizedState!==null?l._visibility&2?ns(e,t,n,a):bi(e,t):l._visibility&2?ns(e,t,n,a):(l._visibility|=2,Dr(e,t,n,a,(t.subtreeFlags&10256)!==0)),r&2048&&Pm(i,t);break;case 24:ns(e,t,n,a),r&2048&&qm(t.alternate,t);break;default:ns(e,t,n,a)}}function Dr(e,t,n,a,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var l=e,i=t,o=n,c=a,d=i.flags;switch(i.tag){case 0:case 11:case 15:Dr(l,i,o,c,r),oo(8,i);break;case 23:break;case 22:var f=i.stateNode;i.memoizedState!==null?f._visibility&2?Dr(l,i,o,c,r):bi(l,i):(f._visibility|=2,Dr(l,i,o,c,r)),r&&d&2048&&Pm(i.alternate,i);break;case 24:Dr(l,i,o,c,r),r&&d&2048&&qm(i.alternate,i);break;default:Dr(l,i,o,c,r)}t=t.sibling}}function bi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,r=a.flags;switch(a.tag){case 22:bi(n,a),r&2048&&Pm(a.alternate,a);break;case 24:bi(n,a),r&2048&&qm(a.alternate,a);break;default:bi(n,a)}t=t.sibling}}var ni=8192;function wr(e){if(e.subtreeFlags&ni)for(e=e.child;e!==null;)gj(e),e=e.sibling}function gj(e){switch(e.tag){case 26:wr(e),e.flags&ni&&e.memoizedState!==null&&oC(Pn,e.memoizedState,e.memoizedProps);break;case 5:wr(e);break;case 3:case 4:var t=Pn;Pn=Wc(e.stateNode.containerInfo),wr(e),Pn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ni,ni=16777216,wr(e),ni=t):wr(e));break;default:wr(e)}}function vj(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 Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Ct=a,bj(a,e)}vj(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yj(e),e=e.sibling}function yj(e){switch(e.tag){case 0:case 11:case 15:Fl(e),e.flags&2048&&Ma(9,e,e.return);break;case 3:Fl(e);break;case 12:Fl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,hc(e)):Fl(e);break;default:Fl(e)}}function hc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Ct=a,bj(a,e)}vj(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ma(8,t,t.return),hc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,hc(t));break;default:hc(t)}e=e.sibling}}function bj(e,t){for(;Ct!==null;){var n=Ct;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:ao(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Ct=a;else e:for(n=e;Ct!==null;){a=Ct;var r=a.sibling,l=a.return;if(dj(a),a===n){Ct=null;break e}if(r!==null){r.return=l,Ct=r;break e}Ct=l}}}var _2={getCacheForType:function(e){var t=Bt(jt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},k2=typeof WeakMap=="function"?WeakMap:Map,qe=0,We=null,Ae=null,De=0,Pe=0,cn=null,va=!1,Tl=!1,Gm=!1,Ps=0,ot=0,Oa=0,Ja=0,Vm=0,Tn=0,pl=0,ji=null,Zt=null,mh=!1,Ym=0,Vc=1/0,Yc=null,ka=null,Ot=0,Sa=null,gl=null,nl=0,xh=0,ph=null,jj=null,wi=0,gh=null;function mn(){if(qe&2&&De!==0)return De&-De;if(be.T!==null){var e=fl;return e!==0?e:Xm()}return My()}function wj(){Tn===0&&(Tn=!(De&536870912)||ze?Ty():536870912);var e=On.current;return e!==null&&(e.flags|=32),Tn}function xn(e,t,n){(e===We&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(vl(e,0),ya(e,De,Tn,!1)),Ji(e,n),(!(qe&2)||e!==We)&&(e===We&&(!(qe&2)&&(Ja|=n),ot===4&&ya(e,De,Tn,!1)),gs(e))}function Nj(e,t,n){if(qe&6)throw Error(q(327));var a=!n&&(t&124)===0&&(t&e.expiredLanes)===0||Zi(e,t),r=a?T2(e,t):Wd(e,t,!0),l=a;do{if(r===0){Tl&&!a&&ya(e,t,0,!1);break}else{if(n=e.current.alternate,l&&!S2(n)){r=Wd(e,t,!1),l=!1;continue}if(r===2){if(l=t,e.errorRecoveryDisabledLanes&l)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var o=e;r=ji;var c=o.current.memoizedState.isDehydrated;if(c&&(vl(o,i).flags|=256),i=Wd(o,i,!1),i!==2){if(Gm&&!c){o.errorRecoveryDisabledLanes|=l,Ja|=l,r=4;break e}l=Zt,Zt=r,l!==null&&(Zt===null?Zt=l:Zt.push.apply(Zt,l))}r=i}if(l=!1,r!==2)continue}}if(r===1){vl(e,0),ya(e,t,0,!0);break}e:{switch(a=e,l=r,l){case 0:case 1:throw Error(q(345));case 4:if((t&4194048)!==t)break;case 6:ya(a,t,Tn,!va);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(q(329))}if((t&62914560)===t&&(r=Ym+300-us(),10<r)){if(ya(a,t,Tn,!va),ku(a,0,!0)!==0)break e;a.timeoutHandle=Pj(vg.bind(null,a,n,Zt,Yc,mh,t,Tn,Ja,pl,va,l,2,-0,0),r);break e}vg(a,n,Zt,Yc,mh,t,Tn,Ja,pl,va,l,0,-0,0)}}break}while(!0);gs(e)}function vg(e,t,n,a,r,l,i,o,c,d,f,h,m,g){if(e.timeoutHandle=-1,h=t.subtreeFlags,(h&8192||(h&16785408)===16785408)&&($i={stylesheets:null,count:0,unsuspend:iC},gj(t),h=cC(),h!==null)){e.cancelPendingCommit=h(bg.bind(null,e,t,l,n,a,r,i,o,c,f,1,m,g)),ya(e,l,i,!d);return}bg(e,t,l,n,a,r,i,o,c)}function S2(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],l=r.getSnapshot;r=r.value;try{if(!gn(l(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ya(e,t,n,a){t&=~Vm,t&=~Ja,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var l=31-hn(r),i=1<<l;a[l]=-1,r&=~i}n!==0&&Ey(e,n,t)}function $u(){return qe&6?!0:(co(0),!1)}function Fm(){if(Ae!==null){if(Pe===0)var e=Ae.return;else e=Ae,Os=pr=null,Om(e),tl=null,Mi=0,e=Ae;for(;e!==null;)aj(e.alternate,e),e=e.return;Ae=null}}function vl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,G2(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Fm(),We=e,Ae=n=Ls(e.current,null),De=t,Pe=0,cn=null,va=!1,Tl=Zi(e,t),Gm=!1,pl=Tn=Vm=Ja=Oa=ot=0,Zt=ji=null,mh=!1,t&8&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-hn(a),l=1<<r;t|=e[r],a&=~l}return Ps=t,Ru(),n}function _j(e,t){Te=null,be.H=Bc,t===ro||t===Au?(t=Qp(),Pe=3):t===ob?(t=Qp(),Pe=4):Pe=t===Zb?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,cn=t,Ae===null&&(ot=1,Pc(e,Cn(t,e.current)))}function kj(){var e=be.H;return be.H=Bc,e===null?Bc:e}function Sj(){var e=be.A;return be.A=_2,e}function vh(){ot=4,va||(De&4194048)!==De&&On.current!==null||(Tl=!0),!(Oa&134217727)&&!(Ja&134217727)||We===null||ya(We,De,Tn,!1)}function Wd(e,t,n){var a=qe;qe|=2;var r=kj(),l=Sj();(We!==e||De!==t)&&(Yc=null,vl(e,t)),t=!1;var i=ot;e:do try{if(Pe!==0&&Ae!==null){var o=Ae,c=cn;switch(Pe){case 8:Fm(),i=6;break e;case 3:case 2:case 9:case 6:On.current===null&&(t=!0);var d=Pe;if(Pe=0,cn=null,Fr(e,o,c,d),n&&Tl){i=0;break e}break;default:d=Pe,Pe=0,cn=null,Fr(e,o,c,d)}}C2(),i=ot;break}catch(f){_j(e,f)}while(!0);return t&&e.shellSuspendCounter++,Os=pr=null,qe=a,be.H=r,be.A=l,Ae===null&&(We=null,De=0,Ru()),i}function C2(){for(;Ae!==null;)Cj(Ae)}function T2(e,t){var n=qe;qe|=2;var a=kj(),r=Sj();We!==e||De!==t?(Yc=null,Vc=us()+500,vl(e,t)):Tl=Zi(e,t);e:do try{if(Pe!==0&&Ae!==null){t=Ae;var l=cn;t:switch(Pe){case 1:Pe=0,cn=null,Fr(e,t,l,1);break;case 2:case 9:if(Kp(l)){Pe=0,cn=null,yg(t);break}t=function(){Pe!==2&&Pe!==9||We!==e||(Pe=7),gs(e)},l.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Kp(l)?(Pe=0,cn=null,yg(t)):(Pe=0,cn=null,Fr(e,t,l,7));break;case 5:var i=null;switch(Ae.tag){case 26:i=Ae.memoizedState;case 5:case 27:var o=Ae;if(!i||Yj(i)){Pe=0,cn=null;var c=o.sibling;if(c!==null)Ae=c;else{var d=o.return;d!==null?(Ae=d,zu(d)):Ae=null}break t}}Pe=0,cn=null,Fr(e,t,l,5);break;case 6:Pe=0,cn=null,Fr(e,t,l,6);break;case 8:Fm(),ot=6;break e;default:throw Error(q(462))}}R2();break}catch(f){_j(e,f)}while(!0);return Os=pr=null,be.H=a,be.A=r,qe=n,Ae!==null?0:(We=null,De=0,Ru(),ot)}function R2(){for(;Ae!==null&&!W1();)Cj(Ae)}function Cj(e){var t=sj(e.alternate,e,Ps);e.memoizedProps=e.pendingProps,t===null?zu(e):Ae=t}function yg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fg(n,t,t.pendingProps,t.type,void 0,De);break;case 11:t=fg(n,t,t.pendingProps,t.type.render,t.ref,De);break;case 5:Om(t);default:aj(n,t),t=Ae=ab(t,Ps),t=sj(n,t,Ps)}e.memoizedProps=e.pendingProps,t===null?zu(e):Ae=t}function Fr(e,t,n,a){Os=pr=null,Om(t),tl=null,Mi=0;var r=t.return;try{if(v2(e,r,t,n,De)){ot=1,Pc(e,Cn(n,e.current)),Ae=null;return}}catch(l){if(r!==null)throw Ae=r,l;ot=1,Pc(e,Cn(n,e.current)),Ae=null;return}t.flags&32768?(ze||a===1?e=!0:Tl||De&536870912?e=!1:(va=e=!0,(a===2||a===9||a===3||a===6)&&(a=On.current,a!==null&&a.tag===13&&(a.flags|=16384))),Tj(t,e)):zu(t)}function zu(e){var t=e;do{if(t.flags&32768){Tj(t,va);return}e=t.return;var n=b2(t.alternate,t,Ps);if(n!==null){Ae=n;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ot===0&&(ot=5)}function Tj(e,t){do{var n=j2(e.alternate,e);if(n!==null){n.flags&=32767,Ae=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=n}while(e!==null);ot=6,Ae=null}function bg(e,t,n,a,r,l,i,o,c){e.cancelPendingCommit=null;do Lu();while(Ot!==0);if(qe&6)throw Error(q(327));if(t!==null){if(t===e.current)throw Error(q(177));if(l=t.lanes|t.childLanes,l|=bm,iS(e,n,l,i,o,c),e===We&&(Ae=We=null,De=0),gl=t,Sa=e,nl=n,xh=l,ph=r,jj=a,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,O2(Rc,function(){return Oj(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,t.subtreeFlags&13878||a){a=be.T,be.T=null,r=Le.p,Le.p=2,i=qe,qe|=4;try{w2(e,t,n)}finally{qe=i,Le.p=r,be.T=a}}Ot=1,Rj(),Ej(),Aj()}}function Rj(){if(Ot===1){Ot=0;var e=Sa,t=gl,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=be.T,be.T=null;var a=Le.p;Le.p=2;var r=qe;qe|=4;try{mj(t,e);var l=wh,i=Qy(e.containerInfo),o=l.focusedElem,c=l.selectionRange;if(i!==o&&o&&o.ownerDocument&&Ky(o.ownerDocument.documentElement,o)){if(c!==null&&ym(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 g=m.getSelection(),j=o.textContent.length,v=Math.min(c.start,j),y=c.end===void 0?v:Math.min(c.end,j);!g.extend&&v>y&&(i=y,y=v,v=i);var x=Ip(o,v),p=Ip(o,y);if(x&&p&&(g.rangeCount!==1||g.anchorNode!==x.node||g.anchorOffset!==x.offset||g.focusNode!==p.node||g.focusOffset!==p.offset)){var b=h.createRange();b.setStart(x.node,x.offset),g.removeAllRanges(),v>y?(g.addRange(b),g.extend(p.node,p.offset)):(b.setEnd(p.node,p.offset),g.addRange(b))}}}}for(h=[],g=o;g=g.parentNode;)g.nodeType===1&&h.push({element:g,left:g.scrollLeft,top:g.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}}eu=!!jh,wh=jh=null}finally{qe=r,Le.p=a,be.T=n}}e.current=t,Ot=2}}function Ej(){if(Ot===2){Ot=0;var e=Sa,t=gl,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=be.T,be.T=null;var a=Le.p;Le.p=2;var r=qe;qe|=4;try{uj(e,t.alternate,t)}finally{qe=r,Le.p=a,be.T=n}}Ot=3}}function Aj(){if(Ot===4||Ot===3){Ot=0,Z1();var e=Sa,t=gl,n=nl,a=jj;t.subtreeFlags&10256||t.flags&10256?Ot=5:(Ot=0,gl=Sa=null,Mj(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(ka=null),fm(n),t=t.stateNode,fn&&typeof fn.onCommitFiberRoot=="function")try{fn.onCommitFiberRoot(Wi,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=be.T,r=Le.p,Le.p=2,be.T=null;try{for(var l=e.onRecoverableError,i=0;i<a.length;i++){var o=a[i];l(o.value,{componentStack:o.stack})}}finally{be.T=t,Le.p=r}}nl&3&&Lu(),gs(e),r=e.pendingLanes,n&4194090&&r&42?e===gh?wi++:(wi=0,gh=e):wi=0,co(0)}}function Mj(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ao(t)))}function Lu(e){return Rj(),Ej(),Aj(),Oj()}function Oj(){if(Ot!==5)return!1;var e=Sa,t=xh;xh=0;var n=fm(nl),a=be.T,r=Le.p;try{Le.p=32>n?32:n,be.T=null,n=ph,ph=null;var l=Sa,i=nl;if(Ot=0,gl=Sa=null,nl=0,qe&6)throw Error(q(331));var o=qe;if(qe|=4,yj(l.current),pj(l,l.current,i,n),qe=o,co(0,!1),fn&&typeof fn.onPostCommitFiberRoot=="function")try{fn.onPostCommitFiberRoot(Wi,l)}catch{}return!0}finally{Le.p=r,be.T=a,Mj(e,t)}}function jg(e,t,n){t=Cn(n,t),t=uh(e.stateNode,t,2),e=_a(e,t,2),e!==null&&(Ji(e,2),gs(e))}function Ke(e,t,n){if(e.tag===3)jg(e,e,n);else for(;t!==null;){if(t.tag===3){jg(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=Cn(n,e),n=Qb(2),a=_a(t,n,2),a!==null&&(Wb(n,a,t,e),Ji(a,2),gs(a));break}}t=t.return}}function Zd(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new k2;var r=new Set;a.set(t,r)}else r=a.get(t),r===void 0&&(r=new Set,a.set(t,r));r.has(n)||(Gm=!0,r.add(n),e=E2.bind(null,e,t,n),t.then(e,e))}function E2(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,We===e&&(De&n)===n&&(ot===4||ot===3&&(De&62914560)===De&&300>us()-Ym?!(qe&2)&&vl(e,0):Vm|=n,pl===De&&(pl=0)),gs(e)}function Dj(e,t){t===0&&(t=Ry()),e=Cl(e,t),e!==null&&(Ji(e,t),gs(e))}function A2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dj(e,n)}function M2(e,t){var n=0;switch(e.tag){case 13:var a=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(q(314))}a!==null&&a.delete(t),Dj(e,n)}function O2(e,t){return um(e,t)}var Fc=null,$r=null,yh=!1,Xc=!1,Jd=!1,er=0;function gs(e){e!==$r&&e.next===null&&($r===null?Fc=$r=e:$r=$r.next=e),Xc=!0,yh||(yh=!0,$2())}function co(e,t){if(!Jd&&Xc){Jd=!0;do for(var n=!1,a=Fc;a!==null;){if(e!==0){var r=a.pendingLanes;if(r===0)var l=0;else{var i=a.suspendedLanes,o=a.pingedLanes;l=(1<<31-hn(42|e)+1)-1,l&=r&~(i&~o),l=l&201326741?l&201326741|1:l?l|2:0}l!==0&&(n=!0,wg(a,l))}else l=De,l=ku(a,a===We?l:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),!(l&3)||Zi(a,l)||(n=!0,wg(a,l));a=a.next}while(n);Jd=!1}}function D2(){$j()}function $j(){Xc=yh=!1;var e=0;er!==0&&(q2()&&(e=er),er=0);for(var t=us(),n=null,a=Fc;a!==null;){var r=a.next,l=zj(a,t);l===0?(a.next=null,n===null?Fc=r:n.next=r,r===null&&($r=n)):(n=a,(e!==0||l&3)&&(Xc=!0)),a=r}co(e)}function zj(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,l=e.pendingLanes&-62914561;0<l;){var i=31-hn(l),o=1<<i,c=r[i];c===-1?(!(o&n)||o&a)&&(r[i]=lS(o,t)):c<=t&&(e.expiredLanes|=o),l&=~o}if(t=We,n=De,n=ku(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&kd(a),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Zi(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&kd(a),fm(n)){case 2:case 8:n=Sy;break;case 32:n=Rc;break;case 268435456:n=Cy;break;default:n=Rc}return a=Lj.bind(null,e),n=um(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&kd(a),e.callbackPriority=2,e.callbackNode=null,2}function Lj(e,t){if(Ot!==0&&Ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Lu()&&e.callbackNode!==n)return null;var a=De;return a=ku(e,e===We?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Nj(e,a,t),zj(e,us()),e.callbackNode!=null&&e.callbackNode===n?Lj.bind(null,e):null)}function wg(e,t){if(Lu())return null;Nj(e,t,!0)}function $2(){V2(function(){qe&6?um(ky,D2):$j()})}function Xm(){return er===0&&(er=Ty()),er}function Ng(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:rc(""+e)}function _g(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 z2(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var l=Ng((r[Jt]||null).action),i=a.submitter;i&&(t=(t=i[Jt]||null)?Ng(t.formAction):i.getAttribute("formAction"),t!==null&&(l=t,i=null));var o=new Su("action","action",null,a,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(er!==0){var c=i?_g(r,i):new FormData(r);oh(n,{pending:!0,data:c,method:r.method,action:l},null,c)}}else typeof l=="function"&&(o.preventDefault(),c=i?_g(r,i):new FormData(r),oh(n,{pending:!0,data:c,method:r.method,action:l},l,c))},currentTarget:r}]})}}for(var ef=0;ef<Qf.length;ef++){var tf=Qf[ef],L2=tf.toLowerCase(),U2=tf[0].toUpperCase()+tf.slice(1);Zn(L2,"on"+U2)}Zn(Zy,"onAnimationEnd");Zn(Jy,"onAnimationIteration");Zn(eb,"onAnimationStart");Zn("dblclick","onDoubleClick");Zn("focusin","onFocus");Zn("focusout","onBlur");Zn(t2,"onTransitionRun");Zn(n2,"onTransitionStart");Zn(s2,"onTransitionCancel");Zn(tb,"onTransitionEnd");ul("onMouseEnter",["mouseout","mouseover"]);ul("onMouseLeave",["mouseout","mouseover"]);ul("onPointerEnter",["pointerout","pointerover"]);ul("onPointerLeave",["pointerout","pointerover"]);hr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));hr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hr("onBeforeInput",["compositionend","keypress","textInput","paste"]);hr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oi="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(" "),B2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oi));function Uj(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],r=a.event;a=a.listeners;e:{var l=void 0;if(t)for(var i=a.length-1;0<=i;i--){var o=a[i],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==l&&r.isPropagationStopped())break e;l=o,r.currentTarget=d;try{l(r)}catch(f){Ic(f)}r.currentTarget=null,l=c}else for(i=0;i<a.length;i++){if(o=a[i],c=o.instance,d=o.currentTarget,o=o.listener,c!==l&&r.isPropagationStopped())break e;l=o,r.currentTarget=d;try{l(r)}catch(f){Ic(f)}r.currentTarget=null,l=c}}}}function Ee(e,t){var n=t[qf];n===void 0&&(n=t[qf]=new Set);var a=e+"__bubble";n.has(a)||(Bj(t,e,2,!1),n.add(a))}function nf(e,t,n){var a=0;t&&(a|=4),Bj(n,e,a,t)}var Bo="_reactListening"+Math.random().toString(36).slice(2);function Km(e){if(!e[Bo]){e[Bo]=!0,Oy.forEach(function(n){n!=="selectionchange"&&(B2.has(n)||nf(n,!1,e),nf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bo]||(t[Bo]=!0,nf("selectionchange",!1,t))}}function Bj(e,t,n,a){switch(Wj(t)){case 2:var r=fC;break;case 8:r=hC;break;default:r=Jm}n=r.bind(null,t,n,e),r=void 0,!Ff||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function sf(e,t,n,a,r){var l=a;if(!(t&1)&&!(t&2)&&a!==null)e:for(;;){if(a===null)return;var i=a.tag;if(i===3||i===4){var o=a.stateNode.containerInfo;if(o===r)break;if(i===4)for(i=a.return;i!==null;){var c=i.tag;if((c===3||c===4)&&i.stateNode.containerInfo===r)return;i=i.return}for(;o!==null;){if(i=Ur(o),i===null)return;if(c=i.tag,c===5||c===6||c===26||c===27){a=l=i;continue e}o=o.parentNode}}a=a.return}Iy(function(){var d=l,f=xm(n),h=[];e:{var m=nb.get(e);if(m!==void 0){var g=Su,j=e;switch(e){case"keypress":if(ic(n)===0)break e;case"keydown":case"keyup":g=OS;break;case"focusin":j="focus",g=Od;break;case"focusout":j="blur",g=Od;break;case"beforeblur":case"afterblur":g=Od;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":g=Ap;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=jS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=zS;break;case Zy:case Jy:case eb:g=_S;break;case tb:g=US;break;case"scroll":case"scrollend":g=yS;break;case"wheel":g=HS;break;case"copy":case"cut":case"paste":g=SS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Op;break;case"toggle":case"beforetoggle":g=PS}var v=(t&4)!==0,y=!v&&(e==="scroll"||e==="scrollend"),x=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||x===null||(w=Ci(p,x),w!=null&&v.push(Di(p,w,b))),y)break;p=p.return}0<v.length&&(m=new g(m,j,null,n,f),h.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",m&&n!==Yf&&(j=n.relatedTarget||n.fromElement)&&(Ur(j)||j[kl]))break e;if((g||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,g?(j=n.relatedTarget||n.toElement,g=d,j=j?Ur(j):null,j!==null&&(y=Qi(j),v=j.tag,j!==y||v!==5&&v!==27&&v!==6)&&(j=null)):(g=null,j=d),g!==j)){if(v=Ap,w="onMouseLeave",x="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(v=Op,w="onPointerLeave",x="onPointerEnter",p="pointer"),y=g==null?m:ti(g),b=j==null?m:ti(j),m=new v(w,p+"leave",g,n,f),m.target=y,m.relatedTarget=b,w=null,Ur(f)===d&&(v=new v(x,p+"enter",j,n,f),v.target=b,v.relatedTarget=y,w=v),y=w,g&&j)t:{for(v=g,x=j,p=0,b=v;b;b=Nr(b))p++;for(b=0,w=x;w;w=Nr(w))b++;for(;0<p-b;)v=Nr(v),p--;for(;0<b-p;)x=Nr(x),b--;for(;p--;){if(v===x||x!==null&&v===x.alternate)break t;v=Nr(v),x=Nr(x)}v=null}else v=null;g!==null&&kg(h,m,g,v,!1),j!==null&&y!==null&&kg(h,y,j,v,!0)}}e:{if(m=d?ti(d):window,g=m.nodeName&&m.nodeName.toLowerCase(),g==="select"||g==="input"&&m.type==="file")var _=Lp;else if(zp(m))if(Fy)_=ZS;else{_=QS;var k=KS}else g=m.nodeName,!g||g.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?d&&mm(d.elementType)&&(_=Lp):_=WS;if(_&&(_=_(e,d))){Yy(h,_,n,f);break e}k&&k(e,m,d),e==="focusout"&&d&&m.type==="number"&&d.memoizedProps.value!=null&&Vf(m,"number",m.value)}switch(k=d?ti(d):window,e){case"focusin":(zp(k)||k.contentEditable==="true")&&(Ir=k,Xf=d,fi=null);break;case"focusout":fi=Xf=Ir=null;break;case"mousedown":Kf=!0;break;case"contextmenu":case"mouseup":case"dragend":Kf=!1,Pp(h,n,f);break;case"selectionchange":if(e2)break;case"keydown":case"keyup":Pp(h,n,f)}var N;if(vm)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Hr?Gy(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(qy&&n.locale!=="ko"&&(Hr||S!=="onCompositionStart"?S==="onCompositionEnd"&&Hr&&(N=Py()):(ga=f,pm="value"in ga?ga.value:ga.textContent,Hr=!0)),k=Kc(d,S),0<k.length&&(S=new Mp(S,e,null,n,f),h.push({event:S,listeners:k}),N?S.data=N:(N=Vy(n),N!==null&&(S.data=N)))),(N=GS?VS(e,n):YS(e,n))&&(S=Kc(d,"onBeforeInput"),0<S.length&&(k=new Mp("onBeforeInput","beforeinput",null,n,f),h.push({event:k,listeners:S}),k.data=N)),z2(h,e,d,n,f)}Uj(h,t)})}function Di(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Kc(e,t){for(var n=t+"Capture",a=[];e!==null;){var r=e,l=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||l===null||(r=Ci(e,n),r!=null&&a.unshift(Di(e,r,l)),r=Ci(e,t),r!=null&&a.push(Di(e,r,l))),e.tag===3)return a;e=e.return}return[]}function Nr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function kg(e,t,n,a,r){for(var l=t._reactName,i=[];n!==null&&n!==a;){var o=n,c=o.alternate,d=o.stateNode;if(o=o.tag,c!==null&&c===a)break;o!==5&&o!==26&&o!==27||d===null||(c=d,r?(d=Ci(n,l),d!=null&&i.unshift(Di(n,d,c))):r||(d=Ci(n,l),d!=null&&i.push(Di(n,d,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var H2=/\r\n?/g,I2=/\u0000|\uFFFD/g;function Sg(e){return(typeof e=="string"?e:""+e).replace(H2,`
|
|
49
|
+
`).replace(I2,"")}function Hj(e,t){return t=Sg(t),Sg(e)===t}function Uu(){}function Ye(e,t,n,a,r,l){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||dl(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&dl(e,""+a);break;case"className":Mo(e,"class",a);break;case"tabIndex":Mo(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Mo(e,n,a);break;case"style":Hy(e,a,l);break;case"data":if(t!=="object"){Mo(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=rc(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof l=="function"&&(n==="formAction"?(t!=="input"&&Ye(e,t,"name",r.name,r,null),Ye(e,t,"formEncType",r.formEncType,r,null),Ye(e,t,"formMethod",r.formMethod,r,null),Ye(e,t,"formTarget",r.formTarget,r,null)):(Ye(e,t,"encType",r.encType,r,null),Ye(e,t,"method",r.method,r,null),Ye(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=rc(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Uu);break;case"onScroll":a!=null&&Ee("scroll",e);break;case"onScrollEnd":a!=null&&Ee("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(q(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(q(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=rc(""+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":Ee("beforetoggle",e),Ee("toggle",e),ac(e,"popover",a);break;case"xlinkActuate":ws(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":ws(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":ws(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":ws(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":ws(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":ws(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":ws(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":ws(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":ws(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ac(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=gS.get(n)||n,ac(e,n,a))}}function bh(e,t,n,a,r,l){switch(n){case"style":Hy(e,a,l);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(q(61));if(n=a.__html,n!=null){if(r.children!=null)throw Error(q(60));e.innerHTML=n}}break;case"children":typeof a=="string"?dl(e,a):(typeof a=="number"||typeof a=="bigint")&&dl(e,""+a);break;case"onScroll":a!=null&&Ee("scroll",e);break;case"onScrollEnd":a!=null&&Ee("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Uu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dy.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),t=n.slice(2,r?n.length-7:void 0),l=e[Jt]||null,l=l!=null?l[n]:null,typeof l=="function"&&e.removeEventListener(t,l,r),typeof a=="function")){typeof l!="function"&&l!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,r);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):ac(e,n,a)}}}function Dt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ee("error",e),Ee("load",e);var a=!1,r=!1,l;for(l in n)if(n.hasOwnProperty(l)){var i=n[l];if(i!=null)switch(l){case"src":a=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(q(137,t));default:Ye(e,t,l,i,n,null)}}r&&Ye(e,t,"srcSet",n.srcSet,n,null),a&&Ye(e,t,"src",n.src,n,null);return;case"input":Ee("invalid",e);var o=l=i=r=null,c=null,d=null;for(a in n)if(n.hasOwnProperty(a)){var f=n[a];if(f!=null)switch(a){case"name":r=f;break;case"type":i=f;break;case"checked":c=f;break;case"defaultChecked":d=f;break;case"value":l=f;break;case"defaultValue":o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(q(137,t));break;default:Ye(e,t,a,f,n,null)}}Ly(e,l,o,c,d,i,r,!1),Ec(e);return;case"select":Ee("invalid",e),a=i=l=null;for(r in n)if(n.hasOwnProperty(r)&&(o=n[r],o!=null))switch(r){case"value":l=o;break;case"defaultValue":i=o;break;case"multiple":a=o;default:Ye(e,t,r,o,n,null)}t=l,n=i,e.multiple=!!a,t!=null?Qr(e,!!a,t,!1):n!=null&&Qr(e,!!a,n,!0);return;case"textarea":Ee("invalid",e),l=r=a=null;for(i in n)if(n.hasOwnProperty(i)&&(o=n[i],o!=null))switch(i){case"value":a=o;break;case"defaultValue":r=o;break;case"children":l=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(q(91));break;default:Ye(e,t,i,o,n,null)}By(e,a,r,l),Ec(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:Ye(e,t,c,a,n,null)}return;case"dialog":Ee("beforetoggle",e),Ee("toggle",e),Ee("cancel",e),Ee("close",e);break;case"iframe":case"object":Ee("load",e);break;case"video":case"audio":for(a=0;a<Oi.length;a++)Ee(Oi[a],e);break;case"image":Ee("error",e),Ee("load",e);break;case"details":Ee("toggle",e);break;case"embed":case"source":case"link":Ee("error",e),Ee("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(q(137,t));default:Ye(e,t,d,a,n,null)}return;default:if(mm(t)){for(f in n)n.hasOwnProperty(f)&&(a=n[f],a!==void 0&&bh(e,t,f,a,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(a=n[o],a!=null&&Ye(e,t,o,a,n,null))}function P2(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,l=null,i=null,o=null,c=null,d=null,f=null;for(g in n){var h=n[g];if(n.hasOwnProperty(g)&&h!=null)switch(g){case"checked":break;case"value":break;case"defaultValue":c=h;default:a.hasOwnProperty(g)||Ye(e,t,g,null,a,h)}}for(var m in a){var g=a[m];if(h=n[m],a.hasOwnProperty(m)&&(g!=null||h!=null))switch(m){case"type":l=g;break;case"name":r=g;break;case"checked":d=g;break;case"defaultChecked":f=g;break;case"value":i=g;break;case"defaultValue":o=g;break;case"children":case"dangerouslySetInnerHTML":if(g!=null)throw Error(q(137,t));break;default:g!==h&&Ye(e,t,m,g,a,h)}}Gf(e,i,o,c,d,f,l,r);return;case"select":g=i=o=m=null;for(l in n)if(c=n[l],n.hasOwnProperty(l)&&c!=null)switch(l){case"value":break;case"multiple":g=c;default:a.hasOwnProperty(l)||Ye(e,t,l,null,a,c)}for(r in a)if(l=a[r],c=n[r],a.hasOwnProperty(r)&&(l!=null||c!=null))switch(r){case"value":m=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:l!==c&&Ye(e,t,r,l,a,c)}t=o,n=i,a=g,m!=null?Qr(e,!!n,m,!1):!!a!=!!n&&(t!=null?Qr(e,!!n,t,!0):Qr(e,!!n,n?[]:"",!1));return;case"textarea":g=m=null;for(o in n)if(r=n[o],n.hasOwnProperty(o)&&r!=null&&!a.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Ye(e,t,o,null,a,r)}for(i in a)if(r=a[i],l=n[i],a.hasOwnProperty(i)&&(r!=null||l!=null))switch(i){case"value":m=r;break;case"defaultValue":g=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(q(91));break;default:r!==l&&Ye(e,t,i,r,a,l)}Uy(e,m,g);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:Ye(e,t,j,null,a,m)}for(c in a)if(m=a[c],g=n[c],a.hasOwnProperty(c)&&m!==g&&(m!=null||g!=null))switch(c){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Ye(e,t,c,m,a,g)}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)&&Ye(e,t,v,null,a,m);for(d in a)if(m=a[d],g=n[d],a.hasOwnProperty(d)&&m!==g&&(m!=null||g!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(q(137,t));break;default:Ye(e,t,d,m,a,g)}return;default:if(mm(t)){for(var y in n)m=n[y],n.hasOwnProperty(y)&&m!==void 0&&!a.hasOwnProperty(y)&&bh(e,t,y,void 0,a,m);for(f in a)m=a[f],g=n[f],!a.hasOwnProperty(f)||m===g||m===void 0&&g===void 0||bh(e,t,f,m,a,g);return}}for(var x in n)m=n[x],n.hasOwnProperty(x)&&m!=null&&!a.hasOwnProperty(x)&&Ye(e,t,x,null,a,m);for(h in a)m=a[h],g=n[h],!a.hasOwnProperty(h)||m===g||m==null&&g==null||Ye(e,t,h,m,a,g)}var jh=null,wh=null;function Qc(e){return e.nodeType===9?e:e.ownerDocument}function Cg(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 Ij(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 Nh(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 af=null;function q2(){var e=window.event;return e&&e.type==="popstate"?e===af?!1:(af=e,!0):(af=null,!1)}var Pj=typeof setTimeout=="function"?setTimeout:void 0,G2=typeof clearTimeout=="function"?clearTimeout:void 0,Tg=typeof Promise=="function"?Promise:void 0,V2=typeof queueMicrotask=="function"?queueMicrotask:typeof Tg<"u"?function(e){return Tg.resolve(null).then(e).catch(Y2)}:Pj;function Y2(e){setTimeout(function(){throw e})}function Ua(e){return e==="head"}function Rg(e,t){var n=t,a=0,r=0;do{var l=n.nextSibling;if(e.removeChild(n),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(0<a&&8>a){n=a;var i=e.ownerDocument;if(n&1&&Ni(i.documentElement),n&2&&Ni(i.body),n&4)for(n=i.head,Ni(n),i=n.firstChild;i;){var o=i.nextSibling,c=i.nodeName;i[eo]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}if(r===0){e.removeChild(l),Bi(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:a=n.charCodeAt(0)-48;else a=0;n=l}while(n);Bi(t)}function _h(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":_h(n),hm(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function F2(e,t,n,a){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[eo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(l=e.getAttribute("rel"),l==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(l!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(l=e.getAttribute("src"),(l!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&l&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var l=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===l)return e}else return e;if(e=Vn(e.nextSibling),e===null)break}return null}function X2(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Vn(e.nextSibling),e===null))return null;return e}function kh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function K2(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 Vn(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 Sh=null;function Eg(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 qj(e,t,n){switch(t=Qc(n),e){case"html":if(e=t.documentElement,!e)throw Error(q(452));return e;case"head":if(e=t.head,!e)throw Error(q(453));return e;case"body":if(e=t.body,!e)throw Error(q(454));return e;default:throw Error(q(451))}}function Ni(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);hm(e)}var Dn=new Map,Ag=new Set;function Wc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Vs=Le.d;Le.d={f:Q2,r:W2,D:Z2,C:J2,L:eC,m:tC,X:sC,S:nC,M:aC};function Q2(){var e=Vs.f(),t=$u();return e||t}function W2(e){var t=Sl(e);t!==null&&t.tag===5&&t.type==="form"?zb(t):Vs.r(e)}var Rl=typeof document>"u"?null:document;function Gj(e,t,n){var a=Rl;if(a&&typeof t=="string"&&t){var r=Sn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Ag.has(r)||(Ag.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),Dt(t,"link",e),Tt(t),a.head.appendChild(t)))}}function Z2(e){Vs.D(e),Gj("dns-prefetch",e,null)}function J2(e,t){Vs.C(e,t),Gj("preconnect",e,t)}function eC(e,t,n){Vs.L(e,t,n);var a=Rl;if(a&&e&&t){var r='link[rel="preload"][as="'+Sn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Sn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Sn(n.imageSizes)+'"]')):r+='[href="'+Sn(e)+'"]';var l=r;switch(t){case"style":l=yl(e);break;case"script":l=El(e)}Dn.has(l)||(e=Ze({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Dn.set(l,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(uo(l))||t==="script"&&a.querySelector(fo(l))||(t=a.createElement("link"),Dt(t,"link",e),Tt(t),a.head.appendChild(t)))}}function tC(e,t){Vs.m(e,t);var n=Rl;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Sn(a)+'"][href="'+Sn(e)+'"]',l=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":l=El(e)}if(!Dn.has(l)&&(e=Ze({rel:"modulepreload",href:e},t),Dn.set(l,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(fo(l)))return}a=n.createElement("link"),Dt(a,"link",e),Tt(a),n.head.appendChild(a)}}}function nC(e,t,n){Vs.S(e,t,n);var a=Rl;if(a&&e){var r=Kr(a).hoistableStyles,l=yl(e);t=t||"default";var i=r.get(l);if(!i){var o={loading:0,preload:null};if(i=a.querySelector(uo(l)))o.loading=5;else{e=Ze({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Dn.get(l))&&Qm(e,n);var c=i=a.createElement("link");Tt(c),Dt(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,mc(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:o},r.set(l,i)}}}function sC(e,t){Vs.X(e,t);var n=Rl;if(n&&e){var a=Kr(n).hoistableScripts,r=El(e),l=a.get(r);l||(l=n.querySelector(fo(r)),l||(e=Ze({src:e,async:!0},t),(t=Dn.get(r))&&Wm(e,t),l=n.createElement("script"),Tt(l),Dt(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},a.set(r,l))}}function aC(e,t){Vs.M(e,t);var n=Rl;if(n&&e){var a=Kr(n).hoistableScripts,r=El(e),l=a.get(r);l||(l=n.querySelector(fo(r)),l||(e=Ze({src:e,async:!0,type:"module"},t),(t=Dn.get(r))&&Wm(e,t),l=n.createElement("script"),Tt(l),Dt(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},a.set(r,l))}}function Mg(e,t,n,a){var r=(r=wa.current)?Wc(r):null;if(!r)throw Error(q(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=yl(n.href),n=Kr(r).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=yl(n.href);var l=Kr(r).hoistableStyles,i=l.get(e);if(i||(r=r.ownerDocument||r,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},l.set(e,i),(l=r.querySelector(uo(e)))&&!l._p&&(i.instance=l,i.state.loading=5),Dn.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},Dn.set(e,n),l||rC(r,e,n,i.state))),t&&a===null)throw Error(q(528,""));return i}if(t&&a!==null)throw Error(q(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=El(n),n=Kr(r).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(q(444,e))}}function yl(e){return'href="'+Sn(e)+'"'}function uo(e){return'link[rel="stylesheet"]['+e+"]"}function Vj(e){return Ze({},e,{"data-precedence":e.precedence,precedence:null})}function rC(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}),Dt(t,"link",n),Tt(t),e.head.appendChild(t))}function El(e){return'[src="'+Sn(e)+'"]'}function fo(e){return"script[async]"+e}function Og(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Sn(n.href)+'"]');if(a)return t.instance=a,Tt(a),a;var r=Ze({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Tt(a),Dt(a,"style",r),mc(a,n.precedence,e),t.instance=a;case"stylesheet":r=yl(n.href);var l=e.querySelector(uo(r));if(l)return t.state.loading|=4,t.instance=l,Tt(l),l;a=Vj(n),(r=Dn.get(r))&&Qm(a,r),l=(e.ownerDocument||e).createElement("link"),Tt(l);var i=l;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),Dt(l,"link",a),t.state.loading|=4,mc(l,n.precedence,e),t.instance=l;case"script":return l=El(n.src),(r=e.querySelector(fo(l)))?(t.instance=r,Tt(r),r):(a=n,(r=Dn.get(l))&&(a=Ze({},n),Wm(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),Tt(r),Dt(r,"link",a),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(q(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(a=t.instance,t.state.loading|=4,mc(a,n.precedence,e));return t.instance}function mc(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=a.length?a[a.length-1]:null,l=r,i=0;i<a.length;i++){var o=a[i];if(o.dataset.precedence===t)l=o;else if(l!==r)break}l?l.parentNode.insertBefore(e,l.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qm(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Wm(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var xc=null;function Dg(e,t,n){if(xc===null){var a=new Map,r=xc=new Map;r.set(n,a)}else r=xc,a=r.get(n),a||(a=new Map,r.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var l=n[r];if(!(l[eo]||l[Ut]||e==="link"&&l.getAttribute("rel")==="stylesheet")&&l.namespaceURI!=="http://www.w3.org/2000/svg"){var i=l.getAttribute(t)||"";i=e+i;var o=a.get(i);o?o.push(l):a.set(i,[l])}}return a}function $g(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function lC(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 Yj(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var $i=null;function iC(){}function oC(e,t,n){if($i===null)throw Error(q(475));var a=$i;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=yl(n.href),l=e.querySelector(uo(r));if(l){e=l._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(a.count++,a=Zc.bind(a),e.then(a,a)),t.state.loading|=4,t.instance=l,Tt(l);return}l=e.ownerDocument||e,n=Vj(n),(r=Dn.get(r))&&Qm(n,r),l=l.createElement("link"),Tt(l);var i=l;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),Dt(l,"link",n),t.instance=l}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(a.count++,t=Zc.bind(a),e.addEventListener("load",t),e.addEventListener("error",t))}}function cC(){if($i===null)throw Error(q(475));var e=$i;return e.stylesheets&&e.count===0&&Ch(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Ch(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 Zc(){if(this.count--,this.count===0){if(this.stylesheets)Ch(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Jc=null;function Ch(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Jc=new Map,t.forEach(uC,e),Jc=null,Zc.call(e))}function uC(e,t){if(!(t.state.loading&4)){var n=Jc.get(e);if(n)var a=n.get(null);else{n=new Map,Jc.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),l=0;l<r.length;l++){var i=r[l];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),a=i)}a&&n.set(null,a)}r=t.instance,i=r.getAttribute("data-precedence"),l=n.get(i)||a,l===a&&n.set(null,r),n.set(i,r),this.count++,a=Zc.bind(this),r.addEventListener("load",a),r.addEventListener("error",a),l?l.parentNode.insertBefore(r,l.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var zi={$$typeof:Es,Provider:null,Consumer:null,_currentValue:Xa,_currentValue2:Xa,_threadCount:0};function dC(e,t,n,a,r,l,i,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sd(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sd(0),this.hiddenUpdates=Sd(null),this.identifierPrefix=a,this.onUncaughtError=r,this.onCaughtError=l,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Fj(e,t,n,a,r,l,i,o,c,d,f,h){return e=new dC(e,t,n,i,o,c,d,h),t=1,l===!0&&(t|=24),l=dn(3,null,null,t),e.current=l,l.stateNode=e,t=km(),t.refCount++,e.pooledCache=t,t.refCount++,l.memoizedState={element:a,isDehydrated:n,cache:t},Cm(l),e}function Xj(e){return e?(e=Gr,e):Gr}function Kj(e,t,n,a,r,l){r=Xj(r),a.context===null?a.context=r:a.pendingContext=r,a=Na(t),a.payload={element:n},l=l===void 0?null:l,l!==null&&(a.callback=l),n=_a(e,a,t),n!==null&&(xn(n,e,t),xi(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 Zm(e,t){zg(e,t),(e=e.alternate)&&zg(e,t)}function Qj(e){if(e.tag===13){var t=Cl(e,67108864);t!==null&&xn(t,e,67108864),Zm(e,67108864)}}var eu=!0;function fC(e,t,n,a){var r=be.T;be.T=null;var l=Le.p;try{Le.p=2,Jm(e,t,n,a)}finally{Le.p=l,be.T=r}}function hC(e,t,n,a){var r=be.T;be.T=null;var l=Le.p;try{Le.p=8,Jm(e,t,n,a)}finally{Le.p=l,be.T=r}}function Jm(e,t,n,a){if(eu){var r=Th(a);if(r===null)sf(e,t,a,tu,n),Lg(e,a);else if(xC(r,e,t,n,a))a.stopPropagation();else if(Lg(e,a),t&4&&-1<mC.indexOf(e)){for(;r!==null;){var l=Sl(r);if(l!==null)switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var i=Ga(l.pendingLanes);if(i!==0){var o=l;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var c=1<<31-hn(i);o.entanglements[1]|=c,i&=~c}gs(l),!(qe&6)&&(Vc=us()+500,co(0))}}break;case 13:o=Cl(l,2),o!==null&&xn(o,l,2),$u(),Zm(l,2)}if(l=Th(a),l===null&&sf(e,t,a,tu,n),l===r)break;r=l}r!==null&&a.stopPropagation()}else sf(e,t,a,null,n)}}function Th(e){return e=xm(e),ex(e)}var tu=null;function ex(e){if(tu=null,e=Ur(e),e!==null){var t=Qi(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=jy(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 tu=e,null}function Wj(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(J1()){case ky:return 2;case Sy:return 8;case Rc:case eS:return 32;case Cy:return 268435456;default:return 32}default:return 32}}var Rh=!1,Ca=null,Ta=null,Ra=null,Li=new Map,Ui=new Map,xa=[],mC="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 Lg(e,t){switch(e){case"focusin":case"focusout":Ca=null;break;case"dragenter":case"dragleave":Ta=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":Li.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ui.delete(t.pointerId)}}function Xl(e,t,n,a,r,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:l,targetContainers:[r]},t!==null&&(t=Sl(t),t!==null&&Qj(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function xC(e,t,n,a,r){switch(t){case"focusin":return Ca=Xl(Ca,e,t,n,a,r),!0;case"dragenter":return Ta=Xl(Ta,e,t,n,a,r),!0;case"mouseover":return Ra=Xl(Ra,e,t,n,a,r),!0;case"pointerover":var l=r.pointerId;return Li.set(l,Xl(Li.get(l)||null,e,t,n,a,r)),!0;case"gotpointercapture":return l=r.pointerId,Ui.set(l,Xl(Ui.get(l)||null,e,t,n,a,r)),!0}return!1}function Zj(e){var t=Ur(e.target);if(t!==null){var n=Qi(t);if(n!==null){if(t=n.tag,t===13){if(t=jy(n),t!==null){e.blockedOn=t,oS(e.priority,function(){if(n.tag===13){var a=mn();a=dm(a);var r=Cl(n,a);r!==null&&xn(r,n,a),Zm(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 pc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Th(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);Yf=a,n.target.dispatchEvent(a),Yf=null}else return t=Sl(n),t!==null&&Qj(t),e.blockedOn=n,!1;t.shift()}return!0}function Ug(e,t,n){pc(e)&&n.delete(t)}function pC(){Rh=!1,Ca!==null&&pc(Ca)&&(Ca=null),Ta!==null&&pc(Ta)&&(Ta=null),Ra!==null&&pc(Ra)&&(Ra=null),Li.forEach(Ug),Ui.forEach(Ug)}function Ho(e,t){e.blockedOn===t&&(e.blockedOn=null,Rh||(Rh=!0,_t.unstable_scheduleCallback(_t.unstable_NormalPriority,pC)))}var Io=null;function Bg(e){Io!==e&&(Io=e,_t.unstable_scheduleCallback(_t.unstable_NormalPriority,function(){Io===e&&(Io=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],r=e[t+2];if(typeof a!="function"){if(ex(a||n)===null)continue;break}var l=Sl(n);l!==null&&(e.splice(t,3),t-=3,oh(l,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function Bi(e){function t(c){return Ho(c,e)}Ca!==null&&Ho(Ca,e),Ta!==null&&Ho(Ta,e),Ra!==null&&Ho(Ra,e),Li.forEach(t),Ui.forEach(t);for(var n=0;n<xa.length;n++){var a=xa[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<xa.length&&(n=xa[0],n.blockedOn===null);)Zj(n),n.blockedOn===null&&xa.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var r=n[a],l=n[a+1],i=r[Jt]||null;if(typeof l=="function")i||Bg(n);else if(i){var o=null;if(l&&l.hasAttribute("formAction")){if(r=l,i=l[Jt]||null)o=i.formAction;else if(ex(r)!==null)continue}else o=i.action;typeof o=="function"?n[a+1]=o:(n.splice(a,3),a-=3),Bg(n)}}}function tx(e){this._internalRoot=e}Bu.prototype.render=tx.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));var n=t.current,a=mn();Kj(n,a,e,t,null,null)};Bu.prototype.unmount=tx.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kj(e.current,2,null,e,null,null),$u(),t[kl]=null}};function Bu(e){this._internalRoot=e}Bu.prototype.unstable_scheduleHydration=function(e){if(e){var t=My();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xa.length&&t!==0&&t<xa[n].priority;n++);xa.splice(n,0,e),n===0&&Zj(e)}};var Hg=yy.version;if(Hg!=="19.1.0")throw Error(q(527,Hg,"19.1.0"));Le.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=Y1(t),e=e!==null?wy(e):null,e=e===null?null:e.stateNode,e};var gC={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:be,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{Wi=Po.inject(gC),fn=Po}catch{}}Nu.createRoot=function(e,t){if(!by(e))throw Error(q(299));var n=!1,a="",r=Fb,l=Xb,i=Kb,o=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(l=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(o=t.unstable_transitionCallbacks)),t=Fj(e,1,!1,null,null,n,a,r,l,i,o,null),e[kl]=t.current,Km(e),new tx(t)};Nu.hydrateRoot=function(e,t,n){if(!by(e))throw Error(q(299));var a=!1,r="",l=Fb,i=Xb,o=Kb,c=null,d=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(l=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(c=n.unstable_transitionCallbacks),n.formState!==void 0&&(d=n.formState)),t=Fj(e,1,!0,t,n??null,a,r,l,i,o,c,d),t.context=Xj(null),n=t.current,a=mn(),a=dm(a),r=Na(a),r.callback=null,_a(n,r,a),n=a,t.current.lanes=n,Ji(t,n),gs(t),e[kl]=t.current,Km(e),new Bu(t)};Nu.version="19.1.0";function Jj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jj)}catch(e){console.error(e)}}Jj(),hy.exports=Nu;var vC=hy.exports;const e0=u.createContext(null);function t0({data:e,router:t,identity:n,notify:a,children:r}){return s.jsx(e0.Provider,{value:{data:e,router:t,identity:n,notify:a},children:r})}function Hu(){const e=u.useContext(e0);if(!e)throw new Error("A shared app page rendered outside AppUiProvider.");return e}const yC={success:()=>{},error:()=>{}},nn=()=>Hu().data,Xe=()=>Hu().router,Iu=()=>Hu().identity,Al=()=>Hu().notify??yC;function bC(){const{probe:e}=nn(),{href:t,Link:n}=Xe(),a=Iu(),[r,l]=u.useState(null),[i,o]=u.useState(!1);return u.useEffect(()=>{let c=!0;if(!e){o(!0);return}return e.source().then(d=>c&&l(d.label),()=>c&&o(!0)),()=>{c=!1}},[e]),s.jsxs("section",{"data-testid":"app-ui-probe",className:"m-6 flex max-w-xl flex-col gap-2 rounded-lg border border-border bg-card p-6 text-card-foreground",children:[s.jsx("h1",{className:"text-xl font-semibold",children:"Shared app UI"}),s.jsx("p",{"data-testid":"app-ui-probe-source",className:"text-sm text-muted-foreground",children:i?"Data source unavailable":r??"Loading…"}),s.jsxs("p",{"data-testid":"app-ui-probe-identity",className:"text-sm",children:[a.label," · ",a.can("tasks.write")?"can edit tasks":"read only"]}),s.jsx(n,{href:t("/tasks"),className:"rounded-sm text-sm text-primary underline outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:"Tasks"})]})}/**
|
|
50
|
+
* @license lucide-react v0.511.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const jC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),wC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),Ig=e=>{const t=wC(e);return t.charAt(0).toUpperCase()+t.slice(1)},n0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),NC=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 _C={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 kC=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:r="",children:l,iconNode:i,...o},c)=>u.createElement("svg",{ref:c,..._C,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:n0("lucide",r),...!l&&!NC(o)&&{"aria-hidden":"true"},...o},[...i.map(([d,f])=>u.createElement(d,f)),...Array.isArray(l)?l:[l]]));/**
|
|
65
|
+
* @license lucide-react v0.511.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const he=(e,t)=>{const n=u.forwardRef(({className:a,...r},l)=>u.createElement(kC,{ref:l,iconNode:t,className:n0(`lucide-${jC(Ig(e))}`,`lucide-${e}`,a),...r}));return n.displayName=Ig(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 SC=[["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"}]],CC=he("archive-restore",SC);/**
|
|
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 TC=[["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"}]],Pg=he("archive",TC);/**
|
|
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 RC=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],EC=he("arrow-down",RC);/**
|
|
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 AC=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],nx=he("arrow-left",AC);/**
|
|
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 MC=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],OC=he("arrow-up",MC);/**
|
|
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 DC=[["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"}]],sx=he("bot",DC);/**
|
|
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 $C=[["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"}]],zC=he("briefcase",$C);/**
|
|
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 LC=[["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"}]],UC=he("building-2",LC);/**
|
|
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 BC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ml=he("check",BC);/**
|
|
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 HC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],IC=he("chevron-down",HC);/**
|
|
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 PC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],s0=he("chevron-right",PC);/**
|
|
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 qC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],GC=he("chevron-up",qC);/**
|
|
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 VC=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],a0=he("chevrons-up-down",VC);/**
|
|
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 YC=[["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"}]],nt=he("circle-alert",YC);/**
|
|
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 FC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Pu=he("circle-check",FC);/**
|
|
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 XC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],KC=he("circle",XC);/**
|
|
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 QC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],WC=he("clock",QC);/**
|
|
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 ZC=[["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"}]],JC=he("copy",ZC);/**
|
|
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 eT=[["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"}]],ax=he("ellipsis",eT);/**
|
|
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 tT=[["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"}]],nT=he("eraser",tT);/**
|
|
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 sT=[["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"}]],ho=he("eye",sT);/**
|
|
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 aT=[["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"}]],r0=he("folder-git-2",aT);/**
|
|
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 rT=[["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"}]],lT=he("folder-git",rT);/**
|
|
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 iT=[["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"}]],oT=he("git-fork",iT);/**
|
|
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 cT=[["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"}]],uT=he("hard-drive",cT);/**
|
|
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 dT=[["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"}]],fT=he("history",dT);/**
|
|
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 hT=[["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"}]],mT=he("house",hT);/**
|
|
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 xT=[["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"}]],pT=he("inbox",xT);/**
|
|
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 gT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],en=he("info",gT);/**
|
|
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 vT=[["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"}]],yT=he("laptop",vT);/**
|
|
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 bT=[["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"}]],jT=he("life-buoy",bT);/**
|
|
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 wT=[["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"}]],l0=he("list-checks",wT);/**
|
|
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 NT=[["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"}]],i0=he("list-ordered",NT);/**
|
|
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 _T=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],kT=he("loader-circle",_T);/**
|
|
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 ST=[["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"}]],CT=he("lock",ST);/**
|
|
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 TT=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],RT=he("message-circle",TT);/**
|
|
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 ET=[["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"}]],AT=he("messages-square",ET);/**
|
|
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 MT=[["path",{d:"M5 12h14",key:"1ays0h"}]],OT=he("minus",MT);/**
|
|
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 DT=[["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"}]],$T=he("network",DT);/**
|
|
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 zT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],LT=he("panel-left",zT);/**
|
|
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 UT=[["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"}]],o0=he("pause",UT);/**
|
|
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 BT=[["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"}]],rx=he("pencil",BT);/**
|
|
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 HT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],bl=he("plus",HT);/**
|
|
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 IT=[["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"}]],gr=he("refresh-cw",IT);/**
|
|
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 PT=[["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"}]],qT=he("rotate-ccw",PT);/**
|
|
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 GT=[["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"}]],qu=he("search-x",GT);/**
|
|
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 VT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],YT=he("search",VT);/**
|
|
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:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],XT=he("send",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 KT=[["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"}]],QT=he("snowflake",KT);/**
|
|
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 WT=[["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"}]],nu=he("tag",WT);/**
|
|
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 ZT=[["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"}]],Vt=he("triangle-alert",ZT);/**
|
|
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 JT=[["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"}]],eR=he("user-check",JT);/**
|
|
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 tR=[["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"}]],nR=he("user-cog",tR);/**
|
|
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 sR=[["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"}]],lx=he("user",sR);/**
|
|
340
|
+
* @license lucide-react v0.511.0 - ISC
|
|
341
|
+
*
|
|
342
|
+
* This source code is licensed under the ISC license.
|
|
343
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
+
*/const aR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ix=he("x",aR);/**
|
|
345
|
+
* @license lucide-react v0.511.0 - ISC
|
|
346
|
+
*
|
|
347
|
+
* This source code is licensed under the ISC license.
|
|
348
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
+
*/const rR=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],lR=he("wrench",rR);function c0(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=c0(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function u0(){for(var e,t,n=0,a="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=c0(e))&&(a&&(a+=" "),a+=t);return a}const qg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Gg=u0,mo=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return Gg(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:l}=t,i=Object.keys(r).map(d=>{const f=n==null?void 0:n[d],h=l==null?void 0:l[d];if(f===null)return null;const m=qg(f)||qg(h);return r[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,...g}=f;return Object.entries(g).every(j=>{let[v,y]=j;return Array.isArray(y)?y.includes({...l,...o}[v]):{...l,...o}[v]===y})?[...d,h,m]:d},[]);return Gg(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},ox="-",iR=e=>{const t=cR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{const o=i.split(ox);return o[0]===""&&o.length!==1&&o.shift(),d0(o,t)||oR(i)},getConflictingClassGroupIds:(i,o)=>{const c=n[i]||[];return o&&a[i]?[...c,...a[i]]:c}}},d0=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),r=a?d0(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;const l=e.join(ox);return(i=t.validators.find(({validator:o})=>o(l)))==null?void 0:i.classGroupId},Vg=/^\[(.+)\]$/,oR=e=>{if(Vg.test(e)){const t=Vg.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},cR=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const r in n)Eh(n[r],a,r,t);return a},Eh=(e,t,n,a)=>{e.forEach(r=>{if(typeof r=="string"){const l=r===""?t:Yg(t,r);l.classGroupId=n;return}if(typeof r=="function"){if(uR(r)){Eh(r(a),t,n,a);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([l,i])=>{Eh(i,Yg(t,l),n,a)})})},Yg=(e,t)=>{let n=e;return t.split(ox).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},uR=e=>e.isThemeGetter,dR=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const r=(l,i)=>{n.set(l,i),t++,t>e&&(t=0,a=n,n=new Map)};return{get(l){let i=n.get(l);if(i!==void 0)return i;if((i=a.get(l))!==void 0)return r(l,i),i},set(l,i){n.has(l)?n.set(l,i):r(l,i)}}},Ah="!",Mh=":",fR=Mh.length,hR=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=r=>{const l=[];let i=0,o=0,c=0,d;for(let j=0;j<r.length;j++){let v=r[j];if(i===0&&o===0){if(v===Mh){l.push(r.slice(c,j)),c=j+fR;continue}if(v==="/"){d=j;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=l.length===0?r:r.substring(c),h=mR(f),m=h!==f,g=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:g}};if(t){const r=t+Mh,l=a;a=i=>i.startsWith(r)?l(i.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const r=a;a=l=>n({className:l,parseClassName:r})}return a},mR=e=>e.endsWith(Ah)?e.substring(0,e.length-1):e.startsWith(Ah)?e.substring(1):e,xR=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const r=[];let l=[];return a.forEach(i=>{i[0]==="["||t[i]?(r.push(...l.sort(),i),l=[]):l.push(i)}),r.push(...l.sort()),r}},pR=e=>({cache:dR(e.cacheSize),parseClassName:hR(e),sortModifiers:xR(e),...iR(e)}),gR=/\s+/,vR=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:l}=t,i=[],o=e.trim().split(gR);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{isExternal:h,modifiers:m,hasImportantModifier:g,baseClassName:j,maybePostfixModifierPosition:v}=n(f);if(h){c=f+(c.length>0?" "+c:c);continue}let y=!!v,x=a(y?j.substring(0,v):j);if(!x){if(!y){c=f+(c.length>0?" "+c:c);continue}if(x=a(j),!x){c=f+(c.length>0?" "+c:c);continue}y=!1}const p=l(m).join(":"),b=g?p+Ah:p,w=b+x;if(i.includes(w))continue;i.push(w);const _=r(x,y);for(let k=0;k<_.length;++k){const N=_[k];i.push(b+N)}c=f+(c.length>0?" "+c:c)}return c};function yR(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=f0(t))&&(a&&(a+=" "),a+=n);return a}const f0=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=f0(e[a]))&&(n&&(n+=" "),n+=t);return n};function bR(e,...t){let n,a,r,l=i;function i(c){const d=t.reduce((f,h)=>h(f),e());return n=pR(d),a=n.cache.get,r=n.cache.set,l=o,o(c)}function o(c){const d=a(c);if(d)return d;const f=vR(c,n);return r(c,f),f}return function(){return l(yR.apply(null,arguments))}}const bt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},h0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,m0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jR=/^\d+\/\d+$/,wR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,NR=/\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$/,_R=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_r=e=>jR.test(e),Ce=e=>!!e&&!Number.isNaN(Number(e)),ra=e=>!!e&&Number.isInteger(Number(e)),rf=e=>e.endsWith("%")&&Ce(e.slice(0,-1)),ks=e=>wR.test(e),CR=()=>!0,TR=e=>NR.test(e)&&!_R.test(e),x0=()=>!1,RR=e=>kR.test(e),ER=e=>SR.test(e),AR=e=>!oe(e)&&!ce(e),MR=e=>Ol(e,v0,x0),oe=e=>h0.test(e),qa=e=>Ol(e,y0,TR),lf=e=>Ol(e,LR,Ce),Fg=e=>Ol(e,p0,x0),OR=e=>Ol(e,g0,ER),qo=e=>Ol(e,b0,RR),ce=e=>m0.test(e),Kl=e=>Dl(e,y0),DR=e=>Dl(e,UR),Xg=e=>Dl(e,p0),$R=e=>Dl(e,v0),zR=e=>Dl(e,g0),Go=e=>Dl(e,b0,!0),Ol=(e,t,n)=>{const a=h0.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Dl=(e,t,n=!1)=>{const a=m0.exec(e);return a?a[1]?t(a[1]):n:!1},p0=e=>e==="position"||e==="percentage",g0=e=>e==="image"||e==="url",v0=e=>e==="length"||e==="size"||e==="bg-size",y0=e=>e==="length",LR=e=>e==="number",UR=e=>e==="family-name",b0=e=>e==="shadow",BR=()=>{const e=bt("color"),t=bt("font"),n=bt("text"),a=bt("font-weight"),r=bt("tracking"),l=bt("leading"),i=bt("breakpoint"),o=bt("container"),c=bt("spacing"),d=bt("radius"),f=bt("shadow"),h=bt("inset-shadow"),m=bt("text-shadow"),g=bt("drop-shadow"),j=bt("blur"),v=bt("perspective"),y=bt("aspect"),x=bt("ease"),p=bt("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"],_=()=>[...w(),ce,oe],k=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],S=()=>[ce,oe,c],A=()=>[_r,"full","auto",...S()],D=()=>[ra,"none","subgrid",ce,oe],G=()=>["auto",{span:["full",ra,ce,oe]},ra,ce,oe],Y=()=>[ra,"auto",ce,oe],T=()=>["auto","min","max","fr",ce,oe],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],F=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...S()],E=()=>[_r,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],C=()=>[e,ce,oe],U=()=>[...w(),Xg,Fg,{position:[ce,oe]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",$R,MR,{size:[ce,oe]}],Q=()=>[rf,Kl,qa],se=()=>["","none","full",d,ce,oe],W=()=>["",Ce,Kl,qa],K=()=>["solid","dashed","dotted","double"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>[Ce,rf,Xg,Fg],ee=()=>["","none",j,ce,oe],pe=()=>["none",Ce,ce,oe],je=()=>["none",Ce,ce,oe],Ne=()=>[Ce,ce,oe],Z=()=>[_r,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ks],breakpoint:[ks],color:[CR],container:[ks],"drop-shadow":[ks],ease:["in","out","in-out"],font:[AR],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ks],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ks],shadow:[ks],spacing:["px",Ce],text:[ks],"text-shadow":[ks],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_r,oe,ce,y]}],container:["container"],columns:[{columns:[Ce,oe,ce,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:_()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{start:A()}],end:[{end:A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[ra,"auto",ce,oe]}],basis:[{basis:[_r,"full","auto",o,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,_r,"auto","initial","none",oe]}],grow:[{grow:["",Ce,ce,oe]}],shrink:[{shrink:["",Ce,ce,oe]}],order:[{order:[ra,"first","last","none",ce,oe]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...F(),"normal"]}],"justify-self":[{"justify-self":["auto",...F()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...F(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...F(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...F(),"baseline"]}],"place-self":[{"place-self":["auto",...F()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":S()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":S()}],"space-y-reverse":["space-y-reverse"],size:[{size: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,Kl,qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ce,lf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rf,oe]}],"font-family":[{font:[DR,oe,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,ce,oe]}],"line-clamp":[{"line-clamp":[Ce,"none",ce,lf]}],leading:[{leading:[l,...S()]}],"list-image":[{"list-image":["none",ce,oe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,oe]}],"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:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",ce,qa]}],"text-decoration-color":[{decoration:C()}],"underline-offset":[{"underline-offset":[Ce,"auto",ce,oe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,oe]}],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",ce,oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ra,ce,oe],radial:["",ce,oe],conic:[ra,ce,oe]},zR,OR]}],"bg-color":[{bg:C()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:C()}],"gradient-via":[{via:C()}],"gradient-to":[{to:C()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"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:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,ce,oe]}],"outline-w":[{outline:["",Ce,Kl,qa]}],"outline-color":[{outline:C()}],shadow:[{shadow:["","none",f,Go,qo]}],"shadow-color":[{shadow:C()}],"inset-shadow":[{"inset-shadow":["none",h,Go,qo]}],"inset-shadow-color":[{"inset-shadow":C()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:C()}],"ring-offset-w":[{"ring-offset":[Ce,qa]}],"ring-offset-color":[{"ring-offset":C()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":C()}],"text-shadow":[{"text-shadow":["none",m,Go,qo]}],"text-shadow-color":[{"text-shadow":C()}],opacity:[{opacity:[Ce,ce,oe]}],"mix-blend":[{"mix-blend":[...z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":z()}],"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":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"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":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"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":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"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":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"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":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"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":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"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":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":C()}],"mask-image-y-to-color":[{"mask-y-to":C()}],"mask-image-radial":[{"mask-radial":[ce,oe]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"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":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"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:U()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,oe]}],filter:[{filter:["","none",ce,oe]}],blur:[{blur:ee()}],brightness:[{brightness:[Ce,ce,oe]}],contrast:[{contrast:[Ce,ce,oe]}],"drop-shadow":[{"drop-shadow":["","none",g,Go,qo]}],"drop-shadow-color":[{"drop-shadow":C()}],grayscale:[{grayscale:["",Ce,ce,oe]}],"hue-rotate":[{"hue-rotate":[Ce,ce,oe]}],invert:[{invert:["",Ce,ce,oe]}],saturate:[{saturate:[Ce,ce,oe]}],sepia:[{sepia:["",Ce,ce,oe]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,oe]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,ce,oe]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,ce,oe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,ce,oe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,ce,oe]}],"backdrop-invert":[{"backdrop-invert":["",Ce,ce,oe]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,ce,oe]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,ce,oe]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,ce,oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,oe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",ce,oe]}],ease:[{ease:["linear","initial",x,ce,oe]}],delay:[{delay:[Ce,ce,oe]}],animate:[{animate:["none",p,ce,oe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,ce,oe]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:je()}],"scale-x":[{"scale-x":je()}],"scale-y":[{"scale-y":je()}],"scale-z":[{"scale-z":je()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[ce,oe,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Z()}],"translate-x":[{"translate-x":Z()}],"translate-y":[{"translate-y":Z()}],"translate-z":[{"translate-z":Z()}],"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",ce,oe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,oe]}],fill:[{fill:["none",...C()]}],"stroke-w":[{stroke:[Ce,Kl,qa,lf]}],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"]}},HR=bR(BR);function ne(...e){return HR(u0(e))}const IR=mo("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 le({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:ne(IR({variant:t}),e),...n})}function xe({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:ne("col-start-2 min-h-4 font-medium tracking-tight",e),...t})}function ae({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:ne("col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Kg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Gu(...e){return t=>{let n=!1;const a=e.map(r=>{const l=Kg(r,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let r=0;r<a.length;r++){const l=a[r];typeof l=="function"?l():Kg(e[r],null)}}}}function He(...e){return u.useCallback(Gu(...e),e)}function PR(e,t){const n=u.createContext(t),a=l=>{const{children:i,...o}=l,c=u.useMemo(()=>o,Object.values(o));return s.jsx(n.Provider,{value:c,children:i})};a.displayName=e+"Provider";function r(l){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[a,r]}function vs(e,t=[]){let n=[];function a(l,i){const o=u.createContext(i),c=n.length;n=[...n,i];const d=h=>{var x;const{scope:m,children:g,...j}=h,v=((x=m==null?void 0:m[e])==null?void 0:x[c])||o,y=u.useMemo(()=>j,Object.values(j));return s.jsx(v.Provider,{value:y,children:g})};d.displayName=l+"Provider";function f(h,m){var v;const g=((v=m==null?void 0:m[e])==null?void 0:v[c])||o,j=u.useContext(g);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${l}\``)}return[d,f]}const r=()=>{const l=n.map(i=>u.createContext(i));return function(o){const c=(o==null?void 0:o[e])||l;return u.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return r.scopeName=e,[a,qR(r,...t)]}function qR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(l){const i=a.reduce((o,{useScope:c,scopeName:d})=>{const h=c(l)[`__scope${d}`];return{...o,...h}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Ht=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},GR=fy[" useId ".trim().toString()]||(()=>{}),VR=0;function Yn(e){const[t,n]=u.useState(GR());return Ht(()=>{n(a=>a??String(VR++))},[e]),t?`radix-${t}`:""}var YR=fy[" useInsertionEffect ".trim().toString()]||Ht;function Da({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[r,l,i]=FR({defaultProp:t,onChange:n}),o=e!==void 0,c=o?e:r;{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=XR(f)?f(e):f;m!==e&&((h=i.current)==null||h.call(i,m))}else l(f)},[o,e,l,i]);return[c,d]}function FR({defaultProp:e,onChange:t}){const[n,a]=u.useState(e),r=u.useRef(n),l=u.useRef(t);return YR(()=>{l.current=t},[t]),u.useEffect(()=>{var i;r.current!==n&&((i=l.current)==null||i.call(l,n),r.current=n)},[n,r]),[n,a,l]}function XR(e){return typeof e=="function"}function lr(e){const t=QR(e),n=u.forwardRef((a,r)=>{const{children:l,...i}=a,o=u.Children.toArray(l),c=o.find(ZR);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:r,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return s.jsx(t,{...i,ref:r,children:l})});return n.displayName=`${e}.Slot`,n}var KR=lr("Slot");function QR(e){const t=u.forwardRef((n,a)=>{const{children:r,...l}=n;if(u.isValidElement(r)){const i=eE(r),o=JR(l,r.props);return r.type!==u.Fragment&&(o.ref=a?Gu(a,i):i),u.cloneElement(r,o)}return u.Children.count(r)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var j0=Symbol("radix.slottable");function WR(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=j0,t}function ZR(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===j0}function JR(e,t){const n={...t};for(const a in t){const r=e[a],l=t[a];/^on[A-Z]/.test(a)?r&&l?n[a]=(...o)=>{const c=l(...o);return r(...o),c}:r&&(n[a]=r):a==="style"?n[a]={...r,...l}:a==="className"&&(n[a]=[r,l].filter(Boolean).join(" "))}return{...e,...n}}function eE(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var tE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_e=tE.reduce((e,t)=>{const n=lr(`Primitive.${t}`),a=u.forwardRef((r,l)=>{const{asChild:i,...o}=r,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...o,ref:l})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function w0(e,t){e&&_l.flushSync(()=>e.dispatchEvent(t))}function ms(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 nE(e,t=globalThis==null?void 0:globalThis.document){const n=ms(e);u.useEffect(()=>{const a=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var sE="DismissableLayer",Oh="dismissableLayer.update",aE="dismissableLayer.pointerDownOutside",rE="dismissableLayer.focusOutside",Qg,N0=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xo=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:l,onInteractOutside:i,onDismiss:o,...c}=e,d=u.useContext(N0),[f,h]=u.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=u.useState({}),j=He(t,N=>h(N)),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(y),p=f?v.indexOf(f):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,w=p>=x,_=oE(N=>{const S=N.target,A=[...d.branches].some(D=>D.contains(S));!w||A||(r==null||r(N),i==null||i(N),N.defaultPrevented||o==null||o())},m),k=cE(N=>{const S=N.target;[...d.branches].some(D=>D.contains(S))||(l==null||l(N),i==null||i(N),N.defaultPrevented||o==null||o())},m);return nE(N=>{p===d.layers.size-1&&(a==null||a(N),!N.defaultPrevented&&o&&(N.preventDefault(),o()))},m),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Qg=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Wg(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Qg)}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Wg())},[f,d]),u.useEffect(()=>{const N=()=>g({});return document.addEventListener(Oh,N),()=>document.removeEventListener(Oh,N)},[]),s.jsx(_e.div,{...c,ref:j,style:{pointerEvents:b?w?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,k.onFocusCapture),onBlurCapture:re(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,_.onPointerDownCapture)})});xo.displayName=sE;var lE="DismissableLayerBranch",iE=u.forwardRef((e,t)=>{const n=u.useContext(N0),a=u.useRef(null),r=He(t,a);return u.useEffect(()=>{const l=a.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),s.jsx(_e.div,{...e,ref:r})});iE.displayName=lE;function oE(e,t=globalThis==null?void 0:globalThis.document){const n=ms(e),a=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const l=o=>{if(o.target&&!a.current){let c=function(){_0(aE,n,d,{discrete:!0})};const d={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=c,t.addEventListener("click",r.current,{once:!0})):c()}else t.removeEventListener("click",r.current);a.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",l),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function cE(e,t=globalThis==null?void 0:globalThis.document){const n=ms(e),a=u.useRef(!1);return u.useEffect(()=>{const r=l=>{l.target&&!a.current&&_0(rE,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Wg(){const e=new CustomEvent(Oh);document.dispatchEvent(e)}function _0(e,t,n,{discrete:a}){const r=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),a?w0(r,l):r.dispatchEvent(l)}var of="focusScope.autoFocusOnMount",cf="focusScope.autoFocusOnUnmount",Zg={bubbles:!1,cancelable:!0},uE="FocusScope",Vu=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:l,...i}=e,[o,c]=u.useState(null),d=ms(r),f=ms(l),h=u.useRef(null),m=He(t,v=>c(v)),g=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(a){let v=function(b){if(g.paused||!o)return;const w=b.target;o.contains(w)?h.current=w:ca(h.current,{select:!0})},y=function(b){if(g.paused||!o)return;const w=b.relatedTarget;w!==null&&(o.contains(w)||ca(h.current,{select:!0}))},x=function(b){if(document.activeElement===document.body)for(const _ of b)_.removedNodes.length>0&&ca(o)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const p=new MutationObserver(x);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),p.disconnect()}}},[a,o,g.paused]),u.useEffect(()=>{if(o){ev.add(g);const v=document.activeElement;if(!o.contains(v)){const x=new CustomEvent(of,Zg);o.addEventListener(of,d),o.dispatchEvent(x),x.defaultPrevented||(dE(pE(k0(o)),{select:!0}),document.activeElement===v&&ca(o))}return()=>{o.removeEventListener(of,d),setTimeout(()=>{const x=new CustomEvent(cf,Zg);o.addEventListener(cf,f),o.dispatchEvent(x),x.defaultPrevented||ca(v??document.body,{select:!0}),o.removeEventListener(cf,f),ev.remove(g)},0)}}},[o,d,f,g]);const j=u.useCallback(v=>{if(!n&&!a||g.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(y&&x){const p=v.currentTarget,[b,w]=fE(p);b&&w?!v.shiftKey&&x===w?(v.preventDefault(),n&&ca(b,{select:!0})):v.shiftKey&&x===b&&(v.preventDefault(),n&&ca(w,{select:!0})):x===p&&v.preventDefault()}},[n,a,g.paused]);return s.jsx(_e.div,{tabIndex:-1,...i,ref:m,onKeyDown:j})});Vu.displayName=uE;function dE(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(ca(a,{select:t}),document.activeElement!==n)return}function fE(e){const t=k0(e),n=Jg(t,e),a=Jg(t.reverse(),e);return[n,a]}function k0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const r=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||r?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Jg(e,t){for(const n of e)if(!hE(n,{upTo:t}))return n}function hE(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 mE(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&&mE(e)&&t&&e.select()}}var ev=xE();function xE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=tv(e,t),e.unshift(t)},remove(t){var n;e=tv(e,t),(n=e[0])==null||n.resume()}}}function tv(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function pE(e){return e.filter(t=>t.tagName!=="A")}var gE="Portal",po=u.forwardRef((e,t)=>{var o;const{container:n,...a}=e,[r,l]=u.useState(!1);Ht(()=>l(!0),[]);const i=n||r&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?G1.createPortal(s.jsx(_e.div,{...a,ref:t}),i):null});po.displayName=gE;function vE(e,t){return u.useReducer((n,a)=>t[n][a]??n,e)}var $n=e=>{const{present:t,children:n}=e,a=yE(t),r=typeof n=="function"?n({present:a.isPresent}):u.Children.only(n),l=He(a.ref,bE(r));return typeof n=="function"||a.isPresent?u.cloneElement(r,{ref:l}):null};$n.displayName="Presence";function yE(e){const[t,n]=u.useState(),a=u.useRef(null),r=u.useRef(e),l=u.useRef("none"),i=e?"mounted":"unmounted",[o,c]=vE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=Vo(a.current);l.current=o==="mounted"?d:"none"},[o]),Ht(()=>{const d=a.current,f=r.current;if(f!==e){const m=l.current,g=Vo(d);e?c("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&m!==g?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),Ht(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=g=>{const v=Vo(a.current).includes(g.animationName);if(g.target===t&&v&&(c("ANIMATION_END"),!r.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=g=>{g.target===t&&(l.current=Vo(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 Vo(e){return(e==null?void 0:e.animationName)||"none"}function bE(e){var a,r;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uf=0;function cx(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nv()),document.body.insertAdjacentElement("beforeend",e[1]??nv()),uf++,()=>{uf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),uf--}},[])}function nv(){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 as=function(){return as=Object.assign||function(t){for(var n,a=1,r=arguments.length;a<r;a++){n=arguments[a];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},as.apply(this,arguments)};function S0(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(n[a[r]]=e[a[r]]);return n}function jE(e,t,n){if(n||arguments.length===2)for(var a=0,r=t.length,l;a<r;a++)(l||!(a in t))&&(l||(l=Array.prototype.slice.call(t,0,a)),l[a]=t[a]);return e.concat(l||Array.prototype.slice.call(t))}var gc="right-scroll-bar-position",vc="width-before-scroll-bar",wE="with-scroll-bars-hidden",NE="--removed-body-scroll-bar-size";function df(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function _E(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var r=n.value;r!==a&&(n.value=a,n.callback(a,r))}}}})[0];return n.callback=t,n.facade}var kE=typeof window<"u"?u.useLayoutEffect:u.useEffect,sv=new WeakMap;function SE(e,t){var n=_E(null,function(a){return e.forEach(function(r){return df(r,a)})});return kE(function(){var a=sv.get(n);if(a){var r=new Set(a),l=new Set(e),i=n.current;r.forEach(function(o){l.has(o)||df(o,null)}),l.forEach(function(o){r.has(o)||df(o,i)})}sv.set(n,e)},[e]),n}function CE(e){return e}function TE(e,t){t===void 0&&(t=CE);var n=[],a=!1,r={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var i=t(l,a);return n.push(i),function(){n=n.filter(function(o){return o!==i})}},assignSyncMedium:function(l){for(a=!0;n.length;){var i=n;n=[],i.forEach(l)}n={push:function(o){return l(o)},filter:function(){return n}}},assignMedium:function(l){a=!0;var i=[];if(n.length){var o=n;n=[],o.forEach(l),i=n}var c=function(){var f=i;i=[],f.forEach(l)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return r}function RE(e){e===void 0&&(e={});var t=TE(null);return t.options=as({async:!0,ssr:!1},e),t}var C0=function(e){var t=e.sideCar,n=S0(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,as({},n))};C0.isSideCarExport=!0;function EE(e,t){return e.useMedium(t),C0}var T0=RE(),ff=function(){},Yu=u.forwardRef(function(e,t){var n=u.useRef(null),a=u.useState({onScrollCapture:ff,onWheelCapture:ff,onTouchMoveCapture:ff}),r=a[0],l=a[1],i=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,g=e.noRelative,j=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,p=x===void 0?"div":x,b=e.gapMode,w=S0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=m,k=SE([n,t]),N=as(as({},w),r);return u.createElement(u.Fragment,null,f&&u.createElement(_,{sideCar:T0,removeScrollBar:d,shards:h,noRelative:g,noIsolation:j,inert:v,setCallbacks:l,allowPinchZoom:!!y,lockRef:n,gapMode:b}),i?u.cloneElement(u.Children.only(o),as(as({},N),{ref:k})):u.createElement(p,as({},N,{className:c,ref:k}),o))});Yu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Yu.classNames={fullWidth:vc,zeroRight:gc};var AE=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ME(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=AE();return t&&e.setAttribute("nonce",t),e}function OE(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DE(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $E=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ME())&&(OE(t,n),DE(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zE=function(){var e=$E();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},R0=function(){var e=zE(),t=function(n){var a=n.styles,r=n.dynamic;return e(a,r),null};return t},LE={left:0,top:0,right:0,gap:0},hf=function(e){return parseInt(e||"",10)||0},UE=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[hf(n),hf(a),hf(r)]},BE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return LE;var t=UE(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])}},HE=R0(),sl="data-scroll-locked",IE=function(e,t,n,a){var r=e.left,l=e.top,i=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
350
|
+
.`.concat(wE,` {
|
|
351
|
+
overflow: hidden `).concat(a,`;
|
|
352
|
+
padding-right: `).concat(o,"px ").concat(a,`;
|
|
353
|
+
}
|
|
354
|
+
body[`).concat(sl,`] {
|
|
355
|
+
overflow: hidden `).concat(a,`;
|
|
356
|
+
overscroll-behavior: contain;
|
|
357
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
358
|
+
padding-left: `.concat(r,`px;
|
|
359
|
+
padding-top: `).concat(l,`px;
|
|
360
|
+
padding-right: `).concat(i,`px;
|
|
361
|
+
margin-left:0;
|
|
362
|
+
margin-top:0;
|
|
363
|
+
margin-right: `).concat(o,"px ").concat(a,`;
|
|
364
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.`).concat(gc,` {
|
|
368
|
+
right: `).concat(o,"px ").concat(a,`;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.`).concat(vc,` {
|
|
372
|
+
margin-right: `).concat(o,"px ").concat(a,`;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.`).concat(gc," .").concat(gc,` {
|
|
376
|
+
right: 0 `).concat(a,`;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.`).concat(vc," .").concat(vc,` {
|
|
380
|
+
margin-right: 0 `).concat(a,`;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
body[`).concat(sl,`] {
|
|
384
|
+
`).concat(NE,": ").concat(o,`px;
|
|
385
|
+
}
|
|
386
|
+
`)},av=function(){var e=parseInt(document.body.getAttribute(sl)||"0",10);return isFinite(e)?e:0},PE=function(){u.useEffect(function(){return document.body.setAttribute(sl,(av()+1).toString()),function(){var e=av()-1;e<=0?document.body.removeAttribute(sl):document.body.setAttribute(sl,e.toString())}},[])},qE=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;PE();var l=u.useMemo(function(){return BE(r)},[r]);return u.createElement(HE,{styles:IE(l,!t,r,n?"":"!important")})},Dh=!1;if(typeof window<"u")try{var Yo=Object.defineProperty({},"passive",{get:function(){return Dh=!0,!0}});window.addEventListener("test",Yo,Yo),window.removeEventListener("test",Yo,Yo)}catch{Dh=!1}var kr=Dh?{passive:!1}:!1,GE=function(e){return e.tagName==="TEXTAREA"},E0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!GE(e)&&n[t]==="visible")},VE=function(e){return E0(e,"overflowY")},YE=function(e){return E0(e,"overflowX")},rv=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=A0(e,a);if(r){var l=M0(e,a),i=l[1],o=l[2];if(i>o)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},FE=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},XE=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},A0=function(e,t){return e==="v"?VE(t):YE(t)},M0=function(e,t){return e==="v"?FE(t):XE(t)},KE=function(e,t){return e==="h"&&t==="rtl"?-1:1},QE=function(e,t,n,a,r){var l=KE(e,window.getComputedStyle(t).direction),i=l*a,o=n.target,c=t.contains(o),d=!1,f=i>0,h=0,m=0;do{if(!o)break;var g=M0(e,o),j=g[0],v=g[1],y=g[2],x=v-y-l*j;(j||x)&&A0(e,o)&&(h+=x,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},Fo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lv=function(e){return[e.deltaX,e.deltaY]},iv=function(e){return e&&"current"in e?e.current:e},WE=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZE=function(e){return`
|
|
387
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
388
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
389
|
+
`)},JE=0,Sr=[];function eA(e){var t=u.useRef([]),n=u.useRef([0,0]),a=u.useRef(),r=u.useState(JE++)[0],l=u.useState(R0)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var v=jE([e.lockRef.current],(e.shards||[]).map(iv),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=u.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var x=Fo(v),p=n.current,b="deltaX"in v?v.deltaX:p[0]-x[0],w="deltaY"in v?v.deltaY:p[1]-x[1],_,k=v.target,N=Math.abs(b)>Math.abs(w)?"h":"v";if("touches"in v&&N==="h"&&k.type==="range")return!1;var S=rv(N,k);if(!S)return!0;if(S?_=N:(_=N==="v"?"h":"v",S=rv(N,k)),!S)return!1;if(!a.current&&"changedTouches"in v&&(b||w)&&(a.current=_),!_)return!0;var A=a.current||_;return QE(A,y,v,A==="h"?b:w)},[]),c=u.useCallback(function(v){var y=v;if(!(!Sr.length||Sr[Sr.length-1]!==l)){var x="deltaY"in y?lv(y):Fo(y),p=t.current.filter(function(_){return _.name===y.type&&(_.target===y.target||y.target===_.shadowParent)&&WE(_.delta,x)})[0];if(p&&p.should){y.cancelable&&y.preventDefault();return}if(!p){var b=(i.current.shards||[]).map(iv).filter(Boolean).filter(function(_){return _.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,x,p){var b={name:v,delta:y,target:x,should:p,shadowParent:tA(x)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(w){return w!==b})},1)},[]),f=u.useCallback(function(v){n.current=Fo(v),a.current=void 0},[]),h=u.useCallback(function(v){d(v.type,lv(v),v.target,o(v,e.lockRef.current))},[]),m=u.useCallback(function(v){d(v.type,Fo(v),v.target,o(v,e.lockRef.current))},[]);u.useEffect(function(){return Sr.push(l),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,kr),document.addEventListener("touchmove",c,kr),document.addEventListener("touchstart",f,kr),function(){Sr=Sr.filter(function(v){return v!==l}),document.removeEventListener("wheel",c,kr),document.removeEventListener("touchmove",c,kr),document.removeEventListener("touchstart",f,kr)}},[]);var g=e.removeScrollBar,j=e.inert;return u.createElement(u.Fragment,null,j?u.createElement(l,{styles:ZE(r)}):null,g?u.createElement(qE,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const nA=EE(T0,eA);var Fu=u.forwardRef(function(e,t){return u.createElement(Yu,as({},e,{ref:t,sideCar:nA}))});Fu.classNames=Yu.classNames;var sA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cr=new WeakMap,Xo=new WeakMap,Ko={},mf=0,O0=function(e){return e&&(e.host||O0(e.parentNode))},aA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=O0(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})},rA=function(e,t,n,a){var r=aA(t,Array.isArray(e)?e:[e]);Ko[n]||(Ko[n]=new WeakMap);var l=Ko[n],i=[],o=new Set,c=new Set(r),d=function(h){!h||o.has(h)||(o.add(h),d(h.parentNode))};r.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 g=m.getAttribute(a),j=g!==null&&g!=="false",v=(Cr.get(m)||0)+1,y=(l.get(m)||0)+1;Cr.set(m,v),l.set(m,y),i.push(m),v===1&&j&&Xo.set(m,!0),y===1&&m.setAttribute(n,"true"),j||m.setAttribute(a,"true")}catch(x){console.error("aria-hidden: cannot operate on ",m,x)}})};return f(t),o.clear(),mf++,function(){i.forEach(function(h){var m=Cr.get(h)-1,g=l.get(h)-1;Cr.set(h,m),l.set(h,g),m||(Xo.has(h)||h.removeAttribute(a),Xo.delete(h)),g||h.removeAttribute(n)}),mf--,mf||(Cr=new WeakMap,Cr=new WeakMap,Xo=new WeakMap,Ko={})}},ux=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=sA(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),rA(a,r,n,"aria-hidden")):function(){return null}},Xu="Dialog",[D0]=vs(Xu),[lA,Jn]=D0(Xu),$0=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:r,onOpenChange:l,modal:i=!0}=e,o=u.useRef(null),c=u.useRef(null),[d,f]=Da({prop:a,defaultProp:r??!1,onChange:l,caller:Xu});return s.jsx(lA,{scope:t,triggerRef:o,contentRef:c,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(h=>!h),[f]),modal:i,children:n})};$0.displayName=Xu;var z0="DialogTrigger",iA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Jn(z0,n),l=He(t,r.triggerRef);return s.jsx(_e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":hx(r.open),...a,ref:l,onClick:re(e.onClick,r.onOpenToggle)})});iA.displayName=z0;var dx="DialogPortal",[oA,L0]=D0(dx,{forceMount:void 0}),U0=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:r}=e,l=Jn(dx,t);return s.jsx(oA,{scope:t,forceMount:n,children:u.Children.map(a,i=>s.jsx($n,{present:n||l.open,children:s.jsx(po,{asChild:!0,container:r,children:i})}))})};U0.displayName=dx;var su="DialogOverlay",B0=u.forwardRef((e,t)=>{const n=L0(su,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,l=Jn(su,e.__scopeDialog);return l.modal?s.jsx($n,{present:a||l.open,children:s.jsx(uA,{...r,ref:t})}):null});B0.displayName=su;var cA=lr("DialogOverlay.RemoveScroll"),uA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Jn(su,n);return s.jsx(Fu,{as:cA,allowPinchZoom:!0,shards:[r.contentRef],children:s.jsx(_e.div,{"data-state":hx(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),ir="DialogContent",H0=u.forwardRef((e,t)=>{const n=L0(ir,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,l=Jn(ir,e.__scopeDialog);return s.jsx($n,{present:a||l.open,children:l.modal?s.jsx(dA,{...r,ref:t}):s.jsx(fA,{...r,ref:t})})});H0.displayName=ir;var dA=u.forwardRef((e,t)=>{const n=Jn(ir,e.__scopeDialog),a=u.useRef(null),r=He(t,n.contentRef,a);return u.useEffect(()=>{const l=a.current;if(l)return ux(l)},[]),s.jsx(I0,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&l.preventDefault()}),onFocusOutside:re(e.onFocusOutside,l=>l.preventDefault())})}),fA=u.forwardRef((e,t)=>{const n=Jn(ir,e.__scopeDialog),a=u.useRef(!1),r=u.useRef(!1);return s.jsx(I0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i,o;(i=e.onCloseAutoFocus)==null||i.call(e,l),l.defaultPrevented||(a.current||(o=n.triggerRef.current)==null||o.focus(),l.preventDefault()),a.current=!1,r.current=!1},onInteractOutside:l=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,l),l.defaultPrevented||(a.current=!0,l.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const i=l.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&r.current&&l.preventDefault()}})}),I0=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:l,...i}=e,o=Jn(ir,n),c=u.useRef(null),d=He(t,c);return cx(),s.jsxs(s.Fragment,{children:[s.jsx(Vu,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:l,children:s.jsx(xo,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":hx(o.open),...i,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(hA,{titleId:o.titleId}),s.jsx(xA,{contentRef:c,descriptionId:o.descriptionId})]})]})}),fx="DialogTitle",P0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Jn(fx,n);return s.jsx(_e.h2,{id:r.titleId,...a,ref:t})});P0.displayName=fx;var q0="DialogDescription",G0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Jn(q0,n);return s.jsx(_e.p,{id:r.descriptionId,...a,ref:t})});G0.displayName=q0;var V0="DialogClose",Y0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Jn(V0,n);return s.jsx(_e.button,{type:"button",...a,ref:t,onClick:re(e.onClick,()=>r.onOpenChange(!1))})});Y0.displayName=V0;function hx(e){return e?"open":"closed"}var F0="DialogTitleWarning",[k5,X0]=PR(F0,{contentName:ir,titleName:fx,docsSlug:"dialog"}),hA=({titleId:e})=>{const t=X0(F0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
390
|
+
|
|
391
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
392
|
+
|
|
393
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},mA="DialogDescriptionWarning",xA=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${X0(mA).contentName}}.`;return u.useEffect(()=>{var l;const r=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},K0=$0,Q0=U0,W0=B0,Z0=H0,J0=P0,ew=G0,mx=Y0;function vn({className:e,...t}){return s.jsx(kT,{role:"status","aria-label":"Loading",className:ne("size-4 animate-spin",e),...t})}const al="aria-pressed:border aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:text-accent-foreground",pA="border border-primary bg-accent text-accent-foreground hover:bg-accent",Ku=mo("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"}}),H=u.forwardRef(({className:e,disabled:t,variant:n,size:a,asChild:r=!1,loading:l,children:i,...o},c)=>{const d=r?KR:"button",f=a==="icon"||a==="sm-icon"||a==="control-icon"||a==="xs-icon",h=s.jsx(vn,{"aria-hidden":"true","aria-label":void 0,role:void 0,className:ne(!f&&"mr-2")}),m=r?i:l&&f?h:s.jsxs(s.Fragment,{children:[l?h:null,i]});return s.jsx(d,{className:ne(Ku({variant:n,size:a,className:e})),ref:c,disabled:t||l,...o,children:m})});H.displayName="Button";const tw=u.createContext(null);function gA({container:e,children:t}){return s.jsx(tw.Provider,{value:e,children:t})}function go(){return u.useContext(tw)??void 0}function vA(e){return s.jsx(K0,{"data-slot":"alert-dialog",...e})}function yA({className:e,...t}){return s.jsx(W0,{"data-slot":"alert-dialog-overlay",className:ne("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 bA({className:e,onOpenAutoFocus:t,onPointerDownOutside:n,onInteractOutside:a,...r}){return s.jsxs(Q0,{container:go(),children:[s.jsx(yA,{}),s.jsx(Z0,{"data-slot":"alert-dialog-content",role:"alertdialog",className:ne("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),onOpenAutoFocus:l=>{if(t==null||t(l),l.defaultPrevented)return;const i=l.currentTarget,o=i instanceof HTMLElement?i.querySelector('[data-slot="alert-dialog-cancel"]'):null;o&&(l.preventDefault(),o.focus())},onPointerDownOutside:l=>{n==null||n(l),l.preventDefault()},onInteractOutside:l=>{a==null||a(l),l.preventDefault()},...r})]})}function jA({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function wA({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function NA({className:e,...t}){return s.jsx(J0,{"data-slot":"alert-dialog-title",className:ne("text-lg font-semibold",e),...t})}function _A({className:e,...t}){return s.jsx(ew,{"data-slot":"alert-dialog-description",className:ne("text-muted-foreground text-sm",e),...t})}function kA({className:e,variant:t,...n}){return s.jsx(mx,{"data-slot":"alert-dialog-action",className:ne(Ku({variant:t}),e),...n})}function SA({className:e,...t}){return s.jsx(mx,{"data-slot":"alert-dialog-cancel",className:ne(Ku({variant:"outline"}),e),...t})}function CA(){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 TA(e,t){t!=null&&t.isConnected&&(e.preventDefault(),t.focus())}function $l(){const[e,t]=u.useState(null),n=u.useRef(null),a=u.useRef(null),r=u.useCallback(o=>{var c;(c=n.current)==null||c.resolve(o),n.current=null,t(null)},[]),l=u.useCallback(o=>new Promise(c=>{var f;(f=n.current)==null||f.resolve(!1),a.current=CA();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(vA,{open:e!==null,onOpenChange:o=>{o||r(!1)},children:s.jsxs(bA,{onCloseAutoFocus:o=>TA(o,a.current),children:[s.jsxs(jA,{children:[s.jsx(NA,{children:e==null?void 0:e.title}),s.jsx(_A,{className:"whitespace-pre-line",children:e==null?void 0:e.description})]}),s.jsxs(wA,{children:[s.jsx(SA,{children:"Cancel"}),s.jsx(kA,{variant:e!=null&&e.destructive?"destructive":"default",onClick:()=>r(!0),children:e==null?void 0:e.action_label})]})]})});return{confirm:l,confirm_dialog:i}}const Ss="px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",RA=mo("inline-flex items-center rounded-md border transition-colors",{variants:{variant:{default:`${Ss} border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80`,secondary:`${Ss} border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`${Ss} border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80`,outline:`${Ss} text-foreground`,success:`${Ss} border-success/40 bg-success/10 text-success`,warning:`${Ss} border-warning/40 bg-warning/10 text-warning`,info:`${Ss} border-info/40 bg-info/10 text-info`,error:`${Ss} border-destructive/40 bg-destructive/10 text-destructive`,neutral:`${Ss} 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 de({className:e,variant:t,size:n,...a}){return s.jsx("div",{className:ne(RA({variant:t,size:n}),e),...a})}function nw(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 sw(e){const[t,n]=u.useState(void 0);return Ht(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const l=r[0];let i,o;if("borderBoxSize"in l){const c=l.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,o=d.blockSize}else i=e.offsetWidth,o=e.offsetHeight;n({width:i,height:o})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var Qu="Checkbox",[EA]=vs(Qu),[AA,xx]=EA(Qu);function MA(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:r,disabled:l,form:i,name:o,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:h}=e,[m,g]=Da({prop:n,defaultProp:r??!1,onChange:c,caller:Qu}),[j,v]=u.useState(null),[y,x]=u.useState(null),p=u.useRef(!1),b=j?!!i||!!j.closest("form"):!0,w={checked:m,disabled:l,setChecked:g,control:j,setControl:v,name:o,form:i,value:f,hasConsumerStoppedPropagationRef:p,required:d,defaultChecked:Ea(r)?!1:r,isFormControl:b,bubbleInput:y,setBubbleInput:x};return s.jsx(AA,{scope:t,...w,children:OA(h)?h(w):a})}var aw="CheckboxTrigger",rw=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},r)=>{const{control:l,value:i,disabled:o,checked:c,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:j}=xx(aw,e),v=He(r,f),y=u.useRef(c);return u.useEffect(()=>{const x=l==null?void 0:l.form;if(x){const p=()=>h(y.current);return x.addEventListener("reset",p),()=>x.removeEventListener("reset",p)}},[l,h]),s.jsx(_e.button,{type:"button",role:"checkbox","aria-checked":Ea(c)?"mixed":c,"aria-required":d,"data-state":uw(c),"data-disabled":o?"":void 0,disabled:o,value:i,...a,ref:v,onKeyDown:re(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:re(n,x=>{h(p=>Ea(p)?!0:!p),j&&g&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})});rw.displayName=aw;var px=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:r,defaultChecked:l,required:i,disabled:o,value:c,onCheckedChange:d,form:f,...h}=e;return s.jsx(MA,{__scopeCheckbox:n,checked:r,defaultChecked:l,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(rw,{...h,ref:t,__scopeCheckbox:n}),m&&s.jsx(cw,{__scopeCheckbox:n})]})})});px.displayName=Qu;var lw="CheckboxIndicator",iw=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...r}=e,l=xx(lw,n);return s.jsx($n,{present:a||Ea(l.checked)||l.checked===!0,children:s.jsx(_e.span,{"data-state":uw(l.checked),"data-disabled":l.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});iw.displayName=lw;var ow="CheckboxBubbleInput",cw=u.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:r,checked:l,defaultChecked:i,required:o,disabled:c,name:d,value:f,form:h,bubbleInput:m,setBubbleInput:g}=xx(ow,e),j=He(n,g),v=nw(l),y=sw(a);u.useEffect(()=>{const p=m;if(!p)return;const b=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(b,"checked").set,k=!r.current;if(v!==l&&_){const N=new Event("click",{bubbles:k});p.indeterminate=Ea(l),_.call(p,Ea(l)?!1:l),p.dispatchEvent(N)}},[m,v,l,r]);const x=u.useRef(Ea(l)?!1:l);return s.jsx(_e.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.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%)"}})});cw.displayName=ow;function OA(e){return typeof e=="function"}function Ea(e){return e==="indeterminate"}function uw(e){return Ea(e)?"indeterminate":e?"checked":"unchecked"}const zl=u.forwardRef(({className:e,...t},n)=>s.jsx(px,{ref:n,className:ne("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(iw,{className:ne("flex items-center justify-center text-current"),children:t.checked==="indeterminate"?s.jsx(OT,{className:"size-4","aria-hidden":"true"}):s.jsx(Ml,{className:"size-4","aria-hidden":"true"})})}));zl.displayName=px.displayName;const DA=mo("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 Ys({...e}){return s.jsx(K0,{"data-slot":"dialog",...e})}function $A({...e}){const t=go();return s.jsx(Q0,{"data-slot":"dialog-portal",container:t,...e})}function zA({className:e,...t}){return s.jsx(W0,{"data-slot":"dialog-overlay",className:ne("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 Fs({className:e,children:t,showCloseButton:n=!0,size:a,...r}){return s.jsxs($A,{"data-slot":"dialog-portal",children:[s.jsx(zA,{}),s.jsxs(Z0,{"data-slot":"dialog-content",className:ne(DA({size:a}),e),...r,children:[t,n&&s.jsxs(mx,{"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(ix,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Xs({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Ks({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-footer",className:ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Qs({className:e,...t}){return s.jsx(J0,{"data-slot":"dialog-title",className:ne("text-lg leading-none font-semibold",e),...t})}function Ws({className:e,...t}){return s.jsx(ew,{"data-slot":"dialog-description",className:ne("text-muted-foreground text-sm",e),...t})}function gx(e){const t=e+"CollectionProvider",[n,a]=vs(t),[r,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:y,children:x}=v,p=ia.useRef(null),b=ia.useRef(new Map).current;return s.jsx(r,{scope:y,itemMap:b,collectionRef:p,children:x})};i.displayName=t;const o=e+"CollectionSlot",c=lr(o),d=ia.forwardRef((v,y)=>{const{scope:x,children:p}=v,b=l(o,x),w=He(y,b.collectionRef);return s.jsx(c,{ref:w,children:p})});d.displayName=o;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=lr(f),g=ia.forwardRef((v,y)=>{const{scope:x,children:p,...b}=v,w=ia.useRef(null),_=He(y,w),k=l(f,x);return ia.useEffect(()=>(k.itemMap.set(w,{ref:w,...b}),()=>void k.itemMap.delete(w))),s.jsx(m,{[h]:"",ref:_,children:p})});g.displayName=f;function j(v){const y=l(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((k,N)=>b.indexOf(k.ref.current)-b.indexOf(N.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:g},j,a]}var LA=u.createContext(void 0);function Wu(e){const t=u.useContext(LA);return e||t||"ltr"}const UA=["top","right","bottom","left"],$a=Math.min,un=Math.max,au=Math.round,Qo=Math.floor,fs=e=>({x:e,y:e}),BA={left:"right",right:"left",bottom:"top",top:"bottom"},HA={start:"end",end:"start"};function $h(e,t,n){return un(e,$a(t,n))}function qs(e,t){return typeof e=="function"?e(t):e}function Gs(e){return e.split("-")[0]}function Ll(e){return e.split("-")[1]}function vx(e){return e==="x"?"y":"x"}function yx(e){return e==="y"?"height":"width"}function is(e){return["top","bottom"].includes(Gs(e))?"y":"x"}function bx(e){return vx(is(e))}function IA(e,t,n){n===void 0&&(n=!1);const a=Ll(e),r=bx(e),l=yx(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=ru(i)),[i,ru(i)]}function PA(e){const t=ru(e);return[zh(e),t,zh(t)]}function zh(e){return e.replace(/start|end/g,t=>HA[t])}function qA(e,t,n){const a=["left","right"],r=["right","left"],l=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:a:t?a:r;case"left":case"right":return t?l:i;default:return[]}}function GA(e,t,n,a){const r=Ll(e);let l=qA(Gs(e),n==="start",a);return r&&(l=l.map(i=>i+"-"+r),t&&(l=l.concat(l.map(zh)))),l}function ru(e){return e.replace(/left|right|bottom|top/g,t=>BA[t])}function VA(e){return{top:0,right:0,bottom:0,left:0,...e}}function dw(e){return typeof e!="number"?VA(e):{top:e,right:e,bottom:e,left:e}}function lu(e){const{x:t,y:n,width:a,height:r}=e;return{width:a,height:r,top:n,left:t,right:t+a,bottom:n+r,x:t,y:n}}function ov(e,t,n){let{reference:a,floating:r}=e;const l=is(t),i=bx(t),o=yx(i),c=Gs(t),d=l==="y",f=a.x+a.width/2-r.width/2,h=a.y+a.height/2-r.height/2,m=a[o]/2-r[o]/2;let g;switch(c){case"top":g={x:f,y:a.y-r.height};break;case"bottom":g={x:f,y:a.y+a.height};break;case"right":g={x:a.x+a.width,y:h};break;case"left":g={x:a.x-r.width,y:h};break;default:g={x:a.x,y:a.y}}switch(Ll(t)){case"start":g[i]-=m*(n&&d?-1:1);break;case"end":g[i]+=m*(n&&d?-1:1);break}return g}const YA=async(e,t,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:l=[],platform:i}=n,o=l.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:h}=ov(d,a,c),m=a,g={},j=0;for(let v=0;v<o.length;v++){const{name:y,fn:x}=o[v],{x:p,y:b,data:w,reset:_}=await x({x:f,y:h,initialPlacement:a,placement:m,strategy:r,middlewareData:g,rects:d,platform:i,elements:{reference:e,floating:t}});f=p??f,h=b??h,g={...g,[y]:{...g[y],...w}},_&&j<=50&&(j++,typeof _=="object"&&(_.placement&&(m=_.placement),_.rects&&(d=_.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):_.rects),{x:f,y:h}=ov(d,m,c)),v=-1)}return{x:f,y:h,placement:m,strategy:r,middlewareData:g}};async function Hi(e,t){var n;t===void 0&&(t={});const{x:a,y:r,platform:l,rects:i,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=qs(t,e),j=dw(g),y=o[m?h==="floating"?"reference":"floating":h],x=lu(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(y)))==null||n?y:y.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(o.floating)),boundary:d,rootBoundary:f,strategy:c})),p=h==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,b=await(l.getOffsetParent==null?void 0:l.getOffsetParent(o.floating)),w=await(l.isElement==null?void 0:l.isElement(b))?await(l.getScale==null?void 0:l.getScale(b))||{x:1,y:1}:{x:1,y:1},_=lu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:p,offsetParent:b,strategy:c}):p);return{top:(x.top-_.top+j.top)/w.y,bottom:(_.bottom-x.bottom+j.bottom)/w.y,left:(x.left-_.left+j.left)/w.x,right:(_.right-x.right+j.right)/w.x}}const FA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:r,rects:l,platform:i,elements:o,middlewareData:c}=t,{element:d,padding:f=0}=qs(e,t)||{};if(d==null)return{};const h=dw(f),m={x:n,y:a},g=bx(r),j=yx(g),v=await i.getDimensions(d),y=g==="y",x=y?"top":"left",p=y?"bottom":"right",b=y?"clientHeight":"clientWidth",w=l.reference[j]+l.reference[g]-m[g]-l.floating[j],_=m[g]-l.reference[g],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let N=k?k[b]:0;(!N||!await(i.isElement==null?void 0:i.isElement(k)))&&(N=o.floating[b]||l.floating[j]);const S=w/2-_/2,A=N/2-v[j]/2-1,D=$a(h[x],A),G=$a(h[p],A),Y=D,T=N-v[j]-G,B=N/2-v[j]/2+S,F=$h(Y,B,T),R=!c.arrow&&Ll(r)!=null&&B!==F&&l.reference[j]/2-(B<Y?D:G)-v[j]/2<0,E=R?B<Y?B-Y:B-T:0;return{[g]:m[g]+E,data:{[g]:F,centerOffset:B-F-E,...R&&{alignmentOffset:E}},reset:R}}}),XA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:r,middlewareData:l,rects:i,initialPlacement:o,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:v=!0,...y}=qs(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const x=Gs(r),p=is(o),b=Gs(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=m||(b||!v?[ru(o)]:PA(o)),k=j!=="none";!m&&k&&_.push(...GA(o,v,j,w));const N=[o,..._],S=await Hi(t,y),A=[];let D=((a=l.flip)==null?void 0:a.overflows)||[];if(f&&A.push(S[x]),h){const B=IA(r,i,w);A.push(S[B[0]],S[B[1]])}if(D=[...D,{placement:r,overflows:A}],!A.every(B=>B<=0)){var G,Y;const B=(((G=l.flip)==null?void 0:G.index)||0)+1,F=N[B];if(F&&(!(h==="alignment"?p!==is(F):!1)||D.every(C=>C.overflows[0]>0&&is(C.placement)===p)))return{data:{index:B,overflows:D},reset:{placement:F}};let R=(Y=D.filter(E=>E.overflows[0]<=0).sort((E,C)=>E.overflows[1]-C.overflows[1])[0])==null?void 0:Y.placement;if(!R)switch(g){case"bestFit":{var T;const E=(T=D.filter(C=>{if(k){const U=is(C.placement);return U===p||U==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(U=>U>0).reduce((U,X)=>U+X,0)]).sort((C,U)=>C[1]-U[1])[0])==null?void 0:T[0];E&&(R=E);break}case"initialPlacement":R=o;break}if(r!==R)return{reset:{placement:R}}}return{}}}};function cv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uv(e){return UA.some(t=>e[t]>=0)}const KA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...r}=qs(e,t);switch(a){case"referenceHidden":{const l=await Hi(t,{...r,elementContext:"reference"}),i=cv(l,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:uv(i)}}}case"escaped":{const l=await Hi(t,{...r,altBoundary:!0}),i=cv(l,n.floating);return{data:{escapedOffsets:i,escaped:uv(i)}}}default:return{}}}}};async function QA(e,t){const{placement:n,platform:a,elements:r}=e,l=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=Gs(n),o=Ll(n),c=is(n)==="y",d=["left","top"].includes(i)?-1:1,f=l&&c?-1:1,h=qs(t,e);let{mainAxis:m,crossAxis:g,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"&&(g=o==="end"?j*-1:j),c?{x:g*f,y:m*d}:{x:m*d,y:g*f}}const WA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:r,y:l,placement:i,middlewareData:o}=t,c=await QA(t,e);return i===((n=o.offset)==null?void 0:n.placement)&&(a=o.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:l+c.y,data:{...c,placement:i}}}}},ZA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:r}=t,{mainAxis:l=!0,crossAxis:i=!1,limiter:o={fn:y=>{let{x,y:p}=y;return{x,y:p}}},...c}=qs(e,t),d={x:n,y:a},f=await Hi(t,c),h=is(Gs(r)),m=vx(h);let g=d[m],j=d[h];if(l){const y=m==="y"?"top":"left",x=m==="y"?"bottom":"right",p=g+f[y],b=g-f[x];g=$h(p,g,b)}if(i){const y=h==="y"?"top":"left",x=h==="y"?"bottom":"right",p=j+f[y],b=j-f[x];j=$h(p,j,b)}const v=o.fn({...t,[m]:g,[h]:j});return{...v,data:{x:v.x-n,y:v.y-a,enabled:{[m]:l,[h]:i}}}}}},JA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:r,rects:l,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=qs(e,t),f={x:n,y:a},h=is(r),m=vx(h);let g=f[m],j=f[h];const v=qs(o,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const b=m==="y"?"height":"width",w=l.reference[m]-l.floating[b]+y.mainAxis,_=l.reference[m]+l.reference[b]-y.mainAxis;g<w?g=w:g>_&&(g=_)}if(d){var x,p;const b=m==="y"?"width":"height",w=["top","left"].includes(Gs(r)),_=l.reference[h]-l.floating[b]+(w&&((x=i.offset)==null?void 0:x[h])||0)+(w?0:y.crossAxis),k=l.reference[h]+l.reference[b]+(w?0:((p=i.offset)==null?void 0:p[h])||0)-(w?y.crossAxis:0);j<_?j=_:j>k&&(j=k)}return{[m]:g,[h]:j}}}},eM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:r,rects:l,platform:i,elements:o}=t,{apply:c=()=>{},...d}=qs(e,t),f=await Hi(t,d),h=Gs(r),m=Ll(r),g=is(r)==="y",{width:j,height:v}=l.floating;let y,x;h==="top"||h==="bottom"?(y=h,x=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(x=h,y=m==="end"?"top":"bottom");const p=v-f.top-f.bottom,b=j-f.left-f.right,w=$a(v-f[y],p),_=$a(j-f[x],b),k=!t.middlewareData.shift;let N=w,S=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=b),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(N=p),k&&!m){const D=un(f.left,0),G=un(f.right,0),Y=un(f.top,0),T=un(f.bottom,0);g?S=j-2*(D!==0||G!==0?D+G:un(f.left,f.right)):N=v-2*(Y!==0||T!==0?Y+T:un(f.top,f.bottom))}await c({...t,availableWidth:S,availableHeight:N});const A=await i.getDimensions(o.floating);return j!==A.width||v!==A.height?{reset:{rects:!0}}:{}}}};function Zu(){return typeof window<"u"}function Ul(e){return fw(e)?(e.nodeName||"").toLowerCase():"#document"}function pn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ys(e){var t;return(t=(fw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fw(e){return Zu()?e instanceof Node||e instanceof pn(e).Node:!1}function Kn(e){return Zu()?e instanceof Element||e instanceof pn(e).Element:!1}function xs(e){return Zu()?e instanceof HTMLElement||e instanceof pn(e).HTMLElement:!1}function dv(e){return!Zu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pn(e).ShadowRoot}function vo(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=Qn(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function tM(e){return["table","td","th"].includes(Ul(e))}function Ju(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function jx(e){const t=wx(),n=Kn(e)?Qn(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(;xs(t)&&!jl(t);){if(jx(t))return t;if(Ju(t))return null;t=za(t)}return null}function wx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jl(e){return["html","body","#document"].includes(Ul(e))}function Qn(e){return pn(e).getComputedStyle(e)}function ed(e){return Kn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function za(e){if(Ul(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dv(e)&&e.host||ys(e);return dv(t)?t.host:t}function hw(e){const t=za(e);return jl(t)?e.ownerDocument?e.ownerDocument.body:e.body:xs(t)&&vo(t)?t:hw(t)}function Ii(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=hw(e),l=r===((a=e.ownerDocument)==null?void 0:a.body),i=pn(r);if(l){const o=Lh(i);return t.concat(i,i.visualViewport||[],vo(r)?r:[],o&&n?Ii(o):[])}return t.concat(r,Ii(r,[],n))}function Lh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mw(e){const t=Qn(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=xs(e),l=r?e.offsetWidth:n,i=r?e.offsetHeight:a,o=au(n)!==l||au(a)!==i;return o&&(n=l,a=i),{width:n,height:a,$:o}}function Nx(e){return Kn(e)?e:e.contextElement}function rl(e){const t=Nx(e);if(!xs(t))return fs(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:l}=mw(t);let i=(l?au(n.width):n.width)/a,o=(l?au(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const sM=fs(0);function xw(e){const t=pn(e);return!wx()||!t.visualViewport?sM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pn(e)?!1:t}function or(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),l=Nx(e);let i=fs(1);t&&(a?Kn(a)&&(i=rl(a)):i=rl(e));const o=aM(l,n,a)?xw(l):fs(0);let c=(r.left+o.x)/i.x,d=(r.top+o.y)/i.y,f=r.width/i.x,h=r.height/i.y;if(l){const m=pn(l),g=a&&Kn(a)?pn(a):a;let j=m,v=Lh(j);for(;v&&a&&g!==j;){const y=rl(v),x=v.getBoundingClientRect(),p=Qn(v),b=x.left+(v.clientLeft+parseFloat(p.paddingLeft))*y.x,w=x.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=pn(v),v=Lh(j)}}return lu({width:f,height:h,x:c,y:d})}function _x(e,t){const n=ed(e).scrollLeft;return t?t.left+n:or(ys(e)).left+n}function pw(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-(n?0:_x(e,a)),l=a.top+t.scrollTop;return{x:r,y:l}}function rM(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const l=r==="fixed",i=ys(a),o=t?Ju(t.floating):!1;if(a===i||o&&l)return n;let c={scrollLeft:0,scrollTop:0},d=fs(1);const f=fs(0),h=xs(a);if((h||!h&&!l)&&((Ul(a)!=="body"||vo(i))&&(c=ed(a)),xs(a))){const g=or(a);d=rl(a),f.x=g.x+a.clientLeft,f.y=g.y+a.clientTop}const m=i&&!h&&!l?pw(i,c,!0):fs(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 lM(e){return Array.from(e.getClientRects())}function iM(e){const t=ys(e),n=ed(e),a=e.ownerDocument.body,r=un(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),l=un(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+_x(e);const o=-n.scrollTop;return Qn(a).direction==="rtl"&&(i+=un(t.clientWidth,a.clientWidth)-r),{width:r,height:l,x:i,y:o}}function oM(e,t){const n=pn(e),a=ys(e),r=n.visualViewport;let l=a.clientWidth,i=a.clientHeight,o=0,c=0;if(r){l=r.width,i=r.height;const d=wx();(!d||d&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:l,height:i,x:o,y:c}}function cM(e,t){const n=or(e,!0,t==="fixed"),a=n.top+e.clientTop,r=n.left+e.clientLeft,l=xs(e)?rl(e):fs(1),i=e.clientWidth*l.x,o=e.clientHeight*l.y,c=r*l.x,d=a*l.y;return{width:i,height:o,x:c,y:d}}function fv(e,t,n){let a;if(t==="viewport")a=oM(e,n);else if(t==="document")a=iM(ys(e));else if(Kn(t))a=cM(t,n);else{const r=xw(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return lu(a)}function gw(e,t){const n=za(e);return n===t||!Kn(n)||jl(n)?!1:Qn(n).position==="fixed"||gw(n,t)}function uM(e,t){const n=t.get(e);if(n)return n;let a=Ii(e,[],!1).filter(o=>Kn(o)&&Ul(o)!=="body"),r=null;const l=Qn(e).position==="fixed";let i=l?za(e):e;for(;Kn(i)&&!jl(i);){const o=Qn(i),c=jx(i);!c&&o.position==="fixed"&&(r=null),(l?!c&&!r:!c&&o.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||vo(i)&&!c&&gw(e,i))?a=a.filter(f=>f!==i):r=o,i=za(i)}return t.set(e,a),a}function dM(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const i=[...n==="clippingAncestors"?Ju(t)?[]:uM(t,this._c):[].concat(n),a],o=i[0],c=i.reduce((d,f)=>{const h=fv(t,f,r);return d.top=un(h.top,d.top),d.right=$a(h.right,d.right),d.bottom=$a(h.bottom,d.bottom),d.left=un(h.left,d.left),d},fv(t,o,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function fM(e){const{width:t,height:n}=mw(e);return{width:t,height:n}}function hM(e,t,n){const a=xs(t),r=ys(t),l=n==="fixed",i=or(e,!0,l,t);let o={scrollLeft:0,scrollTop:0};const c=fs(0);function d(){c.x=_x(r)}if(a||!a&&!l)if((Ul(t)!=="body"||vo(r))&&(o=ed(t)),a){const g=or(t,!0,l,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}else r&&d();l&&!a&&r&&d();const f=r&&!a&&!l?pw(r,o):fs(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 xf(e){return Qn(e).position==="static"}function hv(e,t){if(!xs(e)||Qn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ys(e)===n&&(n=n.ownerDocument.body),n}function vw(e,t){const n=pn(e);if(Ju(e))return n;if(!xs(e)){let r=za(e);for(;r&&!jl(r);){if(Kn(r)&&!xf(r))return r;r=za(r)}return n}let a=hv(e,t);for(;a&&tM(a)&&xf(a);)a=hv(a,t);return a&&jl(a)&&xf(a)&&!jx(a)?n:a||nM(e)||n}const mM=async function(e){const t=this.getOffsetParent||vw,n=this.getDimensions,a=await n(e.floating);return{reference:hM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function xM(e){return Qn(e).direction==="rtl"}const pM={convertOffsetParentRelativeRectToViewportRelativeRect:rM,getDocumentElement:ys,getClippingRect:dM,getOffsetParent:vw,getElementRects:mM,getClientRects:lM,getDimensions:fM,getScale:rl,isElement:Kn,isRTL:xM};function yw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function gM(e,t){let n=null,a;const r=ys(e);function l(){var o;clearTimeout(a),(o=n)==null||o.disconnect(),n=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),l();const d=e.getBoundingClientRect(),{left:f,top:h,width:m,height:g}=d;if(o||t(),!m||!g)return;const j=Qo(h),v=Qo(r.clientWidth-(f+m)),y=Qo(r.clientHeight-(h+g)),x=Qo(f),b={rootMargin:-j+"px "+-v+"px "+-y+"px "+-x+"px",threshold:un(0,$a(1,c))||1};let w=!0;function _(k){const N=k[0].intersectionRatio;if(N!==c){if(!w)return i();N?i(!1,N):a=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!yw(d,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(_,{...b,root:r.ownerDocument})}catch{n=new IntersectionObserver(_,b)}n.observe(e)}return i(!0),l}function vM(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=Nx(e),f=r||l?[...d?Ii(d):[],...Ii(t)]:[];f.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),l&&x.addEventListener("resize",n)});const h=d&&o?gM(d,n):null;let m=-1,g=null;i&&(g=new ResizeObserver(x=>{let[p]=x;p&&p.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=g)==null||b.observe(t)})),n()}),d&&!c&&g.observe(d),g.observe(t));let j,v=c?or(e):null;c&&y();function y(){const x=or(e);v&&!yw(v,x)&&n(),v=x,j=requestAnimationFrame(y)}return n(),()=>{var x;f.forEach(p=>{r&&p.removeEventListener("scroll",n),l&&p.removeEventListener("resize",n)}),h==null||h(),(x=g)==null||x.disconnect(),g=null,c&&cancelAnimationFrame(j)}}const yM=WA,bM=ZA,jM=XA,wM=eM,NM=KA,mv=FA,_M=JA,kM=(e,t,n)=>{const a=new Map,r={platform:pM,...n},l={...r.platform,_c:a};return YA(e,t,{...r,platform:l})};var SM=typeof document<"u",CM=function(){},yc=SM?u.useLayoutEffect:CM;function iu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!iu(e[a],t[a]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,r[a]))return!1;for(a=n;a--!==0;){const l=r[a];if(!(l==="_owner"&&e.$$typeof)&&!iu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function bw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xv(e,t){const n=bw(e);return Math.round(t*n)/n}function pf(e){const t=u.useRef(e);return yc(()=>{t.current=e}),t}function TM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:r,elements:{reference:l,floating:i}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[f,h]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=u.useState(a);iu(m,a)||g(a);const[j,v]=u.useState(null),[y,x]=u.useState(null),p=u.useCallback(C=>{C!==k.current&&(k.current=C,v(C))},[]),b=u.useCallback(C=>{C!==N.current&&(N.current=C,x(C))},[]),w=l||j,_=i||y,k=u.useRef(null),N=u.useRef(null),S=u.useRef(f),A=c!=null,D=pf(c),G=pf(r),Y=pf(d),T=u.useCallback(()=>{if(!k.current||!N.current)return;const C={placement:t,strategy:n,middleware:m};G.current&&(C.platform=G.current),kM(k.current,N.current,C).then(U=>{const X={...U,isPositioned:Y.current!==!1};B.current&&!iu(S.current,X)&&(S.current=X,_l.flushSync(()=>{h(X)}))})},[m,t,n,G,Y]);yc(()=>{d===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,h(C=>({...C,isPositioned:!1})))},[d]);const B=u.useRef(!1);yc(()=>(B.current=!0,()=>{B.current=!1}),[]),yc(()=>{if(w&&(k.current=w),_&&(N.current=_),w&&_){if(D.current)return D.current(w,_,T);T()}},[w,_,T,D,A]);const F=u.useMemo(()=>({reference:k,floating:N,setReference:p,setFloating:b}),[p,b]),R=u.useMemo(()=>({reference:w,floating:_}),[w,_]),E=u.useMemo(()=>{const C={position:n,left:0,top:0};if(!R.floating)return C;const U=xv(R.floating,f.x),X=xv(R.floating,f.y);return o?{...C,transform:"translate("+U+"px, "+X+"px)",...bw(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:X}},[n,o,R.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:T,refs:F,elements:R,floatingStyles:E}),[f,T,F,R,E])}const RM=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:r}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?mv({element:a.current,padding:r}).fn(n):{}:a?mv({element:a,padding:r}).fn(n):{}}}},EM=(e,t)=>({...yM(e),options:[e,t]}),AM=(e,t)=>({...bM(e),options:[e,t]}),MM=(e,t)=>({..._M(e),options:[e,t]}),OM=(e,t)=>({...jM(e),options:[e,t]}),DM=(e,t)=>({...wM(e),options:[e,t]}),$M=(e,t)=>({...NM(e),options:[e,t]}),zM=(e,t)=>({...RM(e),options:[e,t]});var LM="Arrow",jw=u.forwardRef((e,t)=>{const{children:n,width:a=10,height:r=5,...l}=e;return s.jsx(_e.svg,{...l,ref:t,width:a,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});jw.displayName=LM;var UM=jw,kx="Popper",[ww,Bl]=vs(kx),[BM,Nw]=ww(kx),_w=e=>{const{__scopePopper:t,children:n}=e,[a,r]=u.useState(null);return s.jsx(BM,{scope:t,anchor:a,onAnchorChange:r,children:n})};_w.displayName=kx;var kw="PopperAnchor",Sw=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...r}=e,l=Nw(kw,n),i=u.useRef(null),o=He(t,i);return u.useEffect(()=>{l.onAnchorChange((a==null?void 0:a.current)||i.current)}),a?null:s.jsx(_e.div,{...r,ref:o})});Sw.displayName=kw;var Sx="PopperContent",[HM,IM]=ww(Sx),Cw=u.forwardRef((e,t)=>{var $,ee,pe,je,Ne,Z;const{__scopePopper:n,side:a="bottom",sideOffset:r=0,align:l="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:j,...v}=e,y=Nw(Sx,n),[x,p]=u.useState(null),b=He(t,me=>p(me)),[w,_]=u.useState(null),k=sw(w),N=(k==null?void 0:k.width)??0,S=(k==null?void 0:k.height)??0,A=a+(l!=="center"?"-"+l:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},G=Array.isArray(d)?d:[d],Y=G.length>0,T={padding:D,boundary:G.filter(qM),altBoundary:Y},{refs:B,floatingStyles:F,placement:R,isPositioned:E,middlewareData:C}=TM({strategy:"fixed",placement:A,whileElementsMounted:(...me)=>vM(...me,{animationFrame:g==="always"}),elements:{reference:y.anchor},middleware:[EM({mainAxis:r+S,alignmentAxis:i}),c&&AM({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?MM():void 0,...T}),c&&OM({...T}),DM({...T,apply:({elements:me,rects:ue,availableWidth:Ie,availableHeight:fe})=>{const{width:V,height:ve}=ue.reference,Me=me.floating.style;Me.setProperty("--radix-popper-available-width",`${Ie}px`),Me.setProperty("--radix-popper-available-height",`${fe}px`),Me.setProperty("--radix-popper-anchor-width",`${V}px`),Me.setProperty("--radix-popper-anchor-height",`${ve}px`)}}),w&&zM({element:w,padding:o}),GM({arrowWidth:N,arrowHeight:S}),m&&$M({strategy:"referenceHidden",...T})]}),[U,X]=Ew(R),M=ms(j);Ht(()=>{E&&(M==null||M())},[E,M]);const Q=($=C.arrow)==null?void 0:$.x,se=(ee=C.arrow)==null?void 0:ee.y,W=((pe=C.arrow)==null?void 0:pe.centerOffset)!==0,[K,z]=u.useState();return Ht(()=>{x&&z(window.getComputedStyle(x).zIndex)},[x]),s.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:E?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(je=C.transformOrigin)==null?void 0:je.x,(Ne=C.transformOrigin)==null?void 0:Ne.y].join(" "),...((Z=C.hide)==null?void 0:Z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(HM,{scope:n,placedSide:U,onArrowChange:_,arrowX:Q,arrowY:se,shouldHideArrow:W,children:s.jsx(_e.div,{"data-side":U,"data-align":X,...v,ref:b,style:{...v.style,animation:E?void 0:"none"}})})})});Cw.displayName=Sx;var Tw="PopperArrow",PM={top:"bottom",right:"left",bottom:"top",left:"right"},Rw=u.forwardRef(function(t,n){const{__scopePopper:a,...r}=t,l=IM(Tw,a),i=PM[l.placedSide];return s.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:s.jsx(UM,{...r,ref:n,style:{...r.style,display:"block"}})})});Rw.displayName=Tw;function qM(e){return e!==null}var GM=e=>({name:"transformOrigin",options:e,fn(t){var y,x,p;const{placement:n,rects:a,middlewareData:r}=t,i=((y=r.arrow)==null?void 0:y.centerOffset)!==0,o=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=Ew(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((x=r.arrow)==null?void 0:x.x)??0)+o/2,g=(((p=r.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:`${g}px`):d==="left"&&(j=`${a.floating.width+c}px`,v=i?h:`${g}px`),{data:{x:j,y:v}}}});function Ew(e){const[t,n="center"]=e.split("-");return[t,n]}var Cx=_w,Tx=Sw,Rx=Cw,Ex=Rw,gf="rovingFocusGroup.onEntryFocus",VM={bubbles:!1,cancelable:!0},yo="RovingFocusGroup",[Uh,Aw,YM]=gx(yo),[FM,td]=vs(yo,[YM]),[XM,KM]=FM(yo),Mw=u.forwardRef((e,t)=>s.jsx(Uh.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Uh.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(QM,{...e,ref:t})})}));Mw.displayName=yo;var QM=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:r=!1,dir:l,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=u.useRef(null),g=He(t,m),j=Wu(l),[v,y]=Da({prop:i,defaultProp:o??null,onChange:c,caller:yo}),[x,p]=u.useState(!1),b=ms(d),w=Aw(n),_=u.useRef(!1),[k,N]=u.useState(0);return u.useEffect(()=>{const S=m.current;if(S)return S.addEventListener(gf,b),()=>S.removeEventListener(gf,b)},[b]),s.jsx(XM,{scope:n,orientation:a,dir:j,loop:r,currentTabStopId:v,onItemFocus:u.useCallback(S=>y(S),[y]),onItemShiftTab:u.useCallback(()=>p(!0),[]),onFocusableItemAdd:u.useCallback(()=>N(S=>S+1),[]),onFocusableItemRemove:u.useCallback(()=>N(S=>S-1),[]),children:s.jsx(_e.div,{tabIndex:x||k===0?-1:0,"data-orientation":a,...h,ref:g,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{_.current=!0}),onFocus:re(e.onFocus,S=>{const A=!_.current;if(S.target===S.currentTarget&&A&&!x){const D=new CustomEvent(gf,VM);if(S.currentTarget.dispatchEvent(D),!D.defaultPrevented){const G=w().filter(R=>R.focusable),Y=G.find(R=>R.active),T=G.find(R=>R.id===v),F=[Y,T,...G].filter(Boolean).map(R=>R.ref.current);$w(F,f)}}_.current=!1}),onBlur:re(e.onBlur,()=>p(!1))})})}),Ow="RovingFocusGroupItem",Dw=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:r=!1,tabStopId:l,children:i,...o}=e,c=Yn(),d=l||c,f=KM(Ow,n),h=f.currentTabStopId===d,m=Aw(n),{onFocusableItemAdd:g,onFocusableItemRemove:j,currentTabStopId:v}=f;return u.useEffect(()=>{if(a)return g(),()=>j()},[a,g,j]),s.jsx(Uh.ItemSlot,{scope:n,id:d,focusable:a,active:r,children:s.jsx(_e.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:re(e.onMouseDown,y=>{a?f.onItemFocus(d):y.preventDefault()}),onFocus:re(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const x=JM(y,f.orientation,f.dir);if(x!==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(x==="last")b.reverse();else if(x==="prev"||x==="next"){x==="prev"&&b.reverse();const w=b.indexOf(y.currentTarget);b=f.loop?e4(b,w+1):b.slice(w+1)}setTimeout(()=>$w(b))}}),children:typeof i=="function"?i({isCurrentTabStop:h,hasTabStop:v!=null}):i})})});Dw.displayName=Ow;var WM={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ZM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function JM(e,t,n){const a=ZM(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return WM[a]}function $w(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function e4(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var zw=Mw,Lw=Dw,Bh=["Enter"," "],t4=["ArrowDown","PageUp","Home"],Uw=["ArrowUp","PageDown","End"],n4=[...t4,...Uw],s4={ltr:[...Bh,"ArrowRight"],rtl:[...Bh,"ArrowLeft"]},a4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},bo="Menu",[Pi,r4,l4]=gx(bo),[vr,Bw]=vs(bo,[l4,Bl,td]),nd=Bl(),Hw=td(),[i4,yr]=vr(bo),[o4,jo]=vr(bo),Iw=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:r,onOpenChange:l,modal:i=!0}=e,o=nd(t),[c,d]=u.useState(null),f=u.useRef(!1),h=ms(l),m=Wu(r);return u.useEffect(()=>{const g=()=>{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",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Cx,{...o,children:s.jsx(i4,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:s.jsx(o4,{scope:t,onClose:u.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:i,children:a})})})};Iw.displayName=bo;var c4="MenuAnchor",Ax=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=nd(n);return s.jsx(Tx,{...r,...a,ref:t})});Ax.displayName=c4;var Mx="MenuPortal",[u4,Pw]=vr(Mx,{forceMount:void 0}),qw=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:r}=e,l=yr(Mx,t);return s.jsx(u4,{scope:t,forceMount:n,children:s.jsx($n,{present:n||l.open,children:s.jsx(po,{asChild:!0,container:r,children:a})})})};qw.displayName=Mx;var En="MenuContent",[d4,Ox]=vr(En),Gw=u.forwardRef((e,t)=>{const n=Pw(En,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,l=yr(En,e.__scopeMenu),i=jo(En,e.__scopeMenu);return s.jsx(Pi.Provider,{scope:e.__scopeMenu,children:s.jsx($n,{present:a||l.open,children:s.jsx(Pi.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx(f4,{...r,ref:t}):s.jsx(h4,{...r,ref:t})})})})}),f4=u.forwardRef((e,t)=>{const n=yr(En,e.__scopeMenu),a=u.useRef(null),r=He(t,a);return u.useEffect(()=>{const l=a.current;if(l)return ux(l)},[]),s.jsx(Dx,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:re(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),h4=u.forwardRef((e,t)=>{const n=yr(En,e.__scopeMenu);return s.jsx(Dx,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),m4=lr("MenuContent.ScrollLock"),Dx=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:r,onOpenAutoFocus:l,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,disableOutsideScroll:j,...v}=e,y=yr(En,n),x=jo(En,n),p=nd(n),b=Hw(n),w=r4(n),[_,k]=u.useState(null),N=u.useRef(null),S=He(t,N,y.onContentChange),A=u.useRef(0),D=u.useRef(""),G=u.useRef(0),Y=u.useRef(null),T=u.useRef("right"),B=u.useRef(0),F=j?Fu:u.Fragment,R=j?{as:m4,allowPinchZoom:!0}:void 0,E=U=>{var $,ee;const X=D.current+U,M=w().filter(pe=>!pe.disabled),Q=document.activeElement,se=($=M.find(pe=>pe.ref.current===Q))==null?void 0:$.textValue,W=M.map(pe=>pe.textValue),K=S4(W,X,se),z=(ee=M.find(pe=>pe.textValue===K))==null?void 0:ee.ref.current;(function pe(je){D.current=je,window.clearTimeout(A.current),je!==""&&(A.current=window.setTimeout(()=>pe(""),1e3))})(X),z&&setTimeout(()=>z.focus())};u.useEffect(()=>()=>window.clearTimeout(A.current),[]),cx();const C=u.useCallback(U=>{var M,Q;return T.current===((M=Y.current)==null?void 0:M.side)&&T4(U,(Q=Y.current)==null?void 0:Q.area)},[]);return s.jsx(d4,{scope:n,searchRef:D,onItemEnter:u.useCallback(U=>{C(U)&&U.preventDefault()},[C]),onItemLeave:u.useCallback(U=>{var X;C(U)||((X=N.current)==null||X.focus(),k(null))},[C]),onTriggerLeave:u.useCallback(U=>{C(U)&&U.preventDefault()},[C]),pointerGraceTimerRef:G,onPointerGraceIntentChange:u.useCallback(U=>{Y.current=U},[]),children:s.jsx(F,{...R,children:s.jsx(Vu,{asChild:!0,trapped:r,onMountAutoFocus:re(l,U=>{var X;U.preventDefault(),(X=N.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(xo,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:g,children:s.jsx(zw,{asChild:!0,...b,dir:x.dir,orientation:"vertical",loop:a,currentTabStopId:_,onCurrentTabStopIdChange:k,onEntryFocus:re(c,U=>{x.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Rx,{role:"menu","aria-orientation":"vertical","data-state":lN(y.open),"data-radix-menu-content":"",dir:x.dir,...p,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:re(v.onKeyDown,U=>{const M=U.target.closest("[data-radix-menu-content]")===U.currentTarget,Q=U.ctrlKey||U.altKey||U.metaKey,se=U.key.length===1;M&&(U.key==="Tab"&&U.preventDefault(),!Q&&se&&E(U.key));const W=N.current;if(U.target!==W||!n4.includes(U.key))return;U.preventDefault();const z=w().filter($=>!$.disabled).map($=>$.ref.current);Uw.includes(U.key)&&z.reverse(),_4(z)}),onBlur:re(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(A.current),D.current="")}),onPointerMove:re(e.onPointerMove,qi(U=>{const X=U.target,M=B.current!==U.clientX;if(U.currentTarget.contains(X)&&M){const Q=U.clientX>B.current?"right":"left";T.current=Q,B.current=U.clientX}}))})})})})})})});Gw.displayName=En;var x4="MenuGroup",$x=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(_e.div,{role:"group",...a,ref:t})});$x.displayName=x4;var p4="MenuLabel",Vw=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(_e.div,{...a,ref:t})});Vw.displayName=p4;var ou="MenuItem",pv="menu.itemSelect",sd=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...r}=e,l=u.useRef(null),i=jo(ou,e.__scopeMenu),o=Ox(ou,e.__scopeMenu),c=He(t,l),d=u.useRef(!1),f=()=>{const h=l.current;if(!n&&h){const m=new CustomEvent(pv,{bubbles:!0,cancelable:!0});h.addEventListener(pv,g=>a==null?void 0:a(g),{once:!0}),w0(h,m),m.defaultPrevented?d.current=!1:i.onClose()}};return s.jsx(Yw,{...r,ref:c,disabled:n,onClick:re(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:re(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:re(e.onKeyDown,h=>{const m=o.searchRef.current!=="";n||m&&h.key===" "||Bh.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});sd.displayName=ou;var Yw=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...l}=e,i=Ox(ou,n),o=Hw(n),c=u.useRef(null),d=He(t,c),[f,h]=u.useState(!1),[m,g]=u.useState("");return u.useEffect(()=>{const j=c.current;j&&g((j.textContent??"").trim())},[l.children]),s.jsx(Pi.ItemSlot,{scope:n,disabled:a,textValue:r??m,children:s.jsx(Lw,{asChild:!0,...o,focusable:!a,children:s.jsx(_e.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...l,ref:d,onPointerMove:re(e.onPointerMove,qi(j=>{a?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re(e.onPointerLeave,qi(j=>i.onItemLeave(j))),onFocus:re(e.onFocus,()=>h(!0)),onBlur:re(e.onBlur,()=>h(!1))})})})}),g4="MenuCheckboxItem",Fw=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...r}=e;return s.jsx(Zw,{scope:e.__scopeMenu,checked:n,children:s.jsx(sd,{role:"menuitemcheckbox","aria-checked":cu(n)?"mixed":n,...r,ref:t,"data-state":Lx(n),onSelect:re(r.onSelect,()=>a==null?void 0:a(cu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Fw.displayName=g4;var Xw="MenuRadioGroup",[v4,y4]=vr(Xw,{value:void 0,onValueChange:()=>{}}),Kw=u.forwardRef((e,t)=>{const{value:n,onValueChange:a,...r}=e,l=ms(a);return s.jsx(v4,{scope:e.__scopeMenu,value:n,onValueChange:l,children:s.jsx($x,{...r,ref:t})})});Kw.displayName=Xw;var Qw="MenuRadioItem",Ww=u.forwardRef((e,t)=>{const{value:n,...a}=e,r=y4(Qw,e.__scopeMenu),l=n===r.value;return s.jsx(Zw,{scope:e.__scopeMenu,checked:l,children:s.jsx(sd,{role:"menuitemradio","aria-checked":l,...a,ref:t,"data-state":Lx(l),onSelect:re(a.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});Ww.displayName=Qw;var zx="MenuItemIndicator",[Zw,b4]=vr(zx,{checked:!1}),Jw=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...r}=e,l=b4(zx,n);return s.jsx($n,{present:a||cu(l.checked)||l.checked===!0,children:s.jsx(_e.span,{...r,ref:t,"data-state":Lx(l.checked)})})});Jw.displayName=zx;var j4="MenuSeparator",eN=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(_e.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});eN.displayName=j4;var w4="MenuArrow",tN=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=nd(n);return s.jsx(Ex,{...r,...a,ref:t})});tN.displayName=w4;var N4="MenuSub",[S5,nN]=vr(N4),si="MenuSubTrigger",sN=u.forwardRef((e,t)=>{const n=yr(si,e.__scopeMenu),a=jo(si,e.__scopeMenu),r=nN(si,e.__scopeMenu),l=Ox(si,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=l,d={__scopeMenu:e.__scopeMenu},f=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>f,[f]),u.useEffect(()=>{const h=o.current;return()=>{window.clearTimeout(h),c(null)}},[o,c]),s.jsx(Ax,{asChild:!0,...d,children:s.jsx(Yw,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":lN(n.open),...e,ref:Gu(t,r.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:re(e.onPointerMove,qi(h=>{l.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(l.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:re(e.onPointerLeave,qi(h=>{var g,j;f();const m=(g=n.content)==null?void 0:g.getBoundingClientRect();if(m){const v=(j=n.content)==null?void 0:j.dataset.side,y=v==="right",x=y?-5:5,p=m[y?"left":"right"],b=m[y?"right":"left"];l.onPointerGraceIntentChange({area:[{x:h.clientX+x,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(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(h),h.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:re(e.onKeyDown,h=>{var g;const m=l.searchRef.current!=="";e.disabled||m&&h.key===" "||s4[a.dir].includes(h.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),h.preventDefault())})})})});sN.displayName=si;var aN="MenuSubContent",rN=u.forwardRef((e,t)=>{const n=Pw(En,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,l=yr(En,e.__scopeMenu),i=jo(En,e.__scopeMenu),o=nN(aN,e.__scopeMenu),c=u.useRef(null),d=He(t,c);return s.jsx(Pi.Provider,{scope:e.__scopeMenu,children:s.jsx($n,{present:a||l.open,children:s.jsx(Pi.Slot,{scope:e.__scopeMenu,children:s.jsx(Dx,{id:o.contentId,"aria-labelledby":o.triggerId,...r,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;i.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:re(e.onFocusOutside,f=>{f.target!==o.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:re(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:re(e.onKeyDown,f=>{var g;const h=f.currentTarget.contains(f.target),m=a4[i.dir].includes(f.key);h&&m&&(l.onOpenChange(!1),(g=o.trigger)==null||g.focus(),f.preventDefault())})})})})})});rN.displayName=aN;function lN(e){return e?"open":"closed"}function cu(e){return e==="indeterminate"}function Lx(e){return cu(e)?"indeterminate":e?"checked":"unchecked"}function _4(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function k4(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function S4(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let i=k4(e,Math.max(l,0));r.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function C4(e,t){const{x:n,y:a}=e;let r=!1;for(let l=0,i=t.length-1;l<t.length;i=l++){const o=t[l],c=t[i],d=o.x,f=o.y,h=c.x,m=c.y;f>a!=m>a&&n<(h-d)*(a-f)/(m-f)+d&&(r=!r)}return r}function T4(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return C4(n,t)}function qi(e){return t=>t.pointerType==="mouse"?e(t):void 0}var R4=Iw,E4=Ax,A4=qw,M4=Gw,O4=$x,D4=Vw,$4=sd,z4=Fw,L4=Kw,U4=Ww,B4=Jw,H4=eN,I4=tN,P4=sN,q4=rN,ad="DropdownMenu",[G4]=vs(ad,[Bw]),Ft=Bw(),[V4,iN]=G4(ad),oN=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:r,defaultOpen:l,onOpenChange:i,modal:o=!0}=e,c=Ft(t),d=u.useRef(null),[f,h]=Da({prop:r,defaultProp:l??!1,onChange:i,caller:ad});return s.jsx(V4,{scope:t,triggerId:Yn(),triggerRef:d,contentId:Yn(),open:f,onOpenChange:h,onOpenToggle:u.useCallback(()=>h(m=>!m),[h]),modal:o,children:s.jsx(R4,{...c,open:f,onOpenChange:h,dir:a,modal:o,children:n})})};oN.displayName=ad;var cN="DropdownMenuTrigger",uN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=e,l=iN(cN,n),i=Ft(n);return s.jsx(E4,{asChild:!0,...i,children:s.jsx(_e.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...r,ref:Gu(t,l.triggerRef),onPointerDown:re(e.onPointerDown,o=>{!a&&o.button===0&&o.ctrlKey===!1&&(l.onOpenToggle(),l.open||o.preventDefault())}),onKeyDown:re(e.onKeyDown,o=>{a||(["Enter"," "].includes(o.key)&&l.onOpenToggle(),o.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});uN.displayName=cN;var Y4="DropdownMenuPortal",dN=e=>{const{__scopeDropdownMenu:t,...n}=e,a=Ft(t);return s.jsx(A4,{...a,...n})};dN.displayName=Y4;var fN="DropdownMenuContent",hN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=iN(fN,n),l=Ft(n),i=u.useRef(!1);return s.jsx(M4,{id:r.contentId,"aria-labelledby":r.triggerId,...l,...a,ref:t,onCloseAutoFocus:re(e.onCloseAutoFocus,o=>{var c;i.current||(c=r.triggerRef.current)==null||c.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:re(e.onInteractOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!r.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});hN.displayName=fN;var F4="DropdownMenuGroup",X4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(O4,{...r,...a,ref:t})});X4.displayName=F4;var K4="DropdownMenuLabel",mN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(D4,{...r,...a,ref:t})});mN.displayName=K4;var Q4="DropdownMenuItem",xN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx($4,{...r,...a,ref:t})});xN.displayName=Q4;var W4="DropdownMenuCheckboxItem",pN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(z4,{...r,...a,ref:t})});pN.displayName=W4;var Z4="DropdownMenuRadioGroup",J4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(L4,{...r,...a,ref:t})});J4.displayName=Z4;var eO="DropdownMenuRadioItem",gN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(U4,{...r,...a,ref:t})});gN.displayName=eO;var tO="DropdownMenuItemIndicator",vN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(B4,{...r,...a,ref:t})});vN.displayName=tO;var nO="DropdownMenuSeparator",yN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(H4,{...r,...a,ref:t})});yN.displayName=nO;var sO="DropdownMenuArrow",aO=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(I4,{...r,...a,ref:t})});aO.displayName=sO;var rO="DropdownMenuSubTrigger",bN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(P4,{...r,...a,ref:t})});bN.displayName=rO;var lO="DropdownMenuSubContent",jN=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Ft(n);return s.jsx(q4,{...r,...a,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});jN.displayName=lO;var iO=oN,oO=uN,cO=dN,wN=hN,NN=mN,_N=xN,kN=pN,SN=gN,CN=vN,TN=yN,RN=bN,EN=jN;const rd=iO,ld=oO,uO=u.forwardRef(({className:e,inset:t,children:n,...a},r)=>s.jsxs(RN,{ref:r,className:ne("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(s0,{className:"ml-auto"})]}));uO.displayName=RN.displayName;const dO=u.forwardRef(({className:e,...t},n)=>s.jsx(EN,{ref:n,className:ne("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}));dO.displayName=EN.displayName;const wo=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>s.jsx(cO,{container:go(),children:s.jsx(wN,{ref:a,sideOffset:t,className:ne("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));wo.displayName=wN.displayName;const cr=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(_N,{ref:a,className:ne("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}));cr.displayName=_N.displayName;const fO=u.forwardRef(({className:e,children:t,checked:n,...a},r)=>s.jsxs(kN,{ref:r,className:ne("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(CN,{children:s.jsx(Ml,{className:"h-4 w-4"})})}),t]}));fO.displayName=kN.displayName;const hO=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(SN,{ref:a,className:ne("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(CN,{children:s.jsx(KC,{className:"h-2 w-2 fill-current"})})}),t]}));hO.displayName=SN.displayName;const mO=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(NN,{ref:a,className:ne("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));mO.displayName=NN.displayName;const xO=u.forwardRef(({className:e,...t},n)=>s.jsx(TN,{ref:n,className:ne("-mx-1 my-1 h-px bg-muted",e),...t}));xO.displayName=TN.displayName;const pO={default:"h-9 px-3 py-1 text-sm",control:"h-7 px-2 py-1 text-xs"},At=u.forwardRef(({className:e,type:t,inputSize:n="default",...a},r)=>s.jsx("input",{type:t,className:ne("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",pO[n],e),ref:r,...a}));At.displayName="Input";var gO="Label",AN=u.forwardRef((e,t)=>s.jsx(_e.label,{...e,ref:t,onMouseDown:n=>{var r;n.target.closest("button, input, select, textarea")||((r=e.onMouseDown)==null||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));AN.displayName=gO;var MN=AN;const vO=mo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oe=u.forwardRef(({className:e,...t},n)=>s.jsx(MN,{ref:n,className:ne(vO(),e),...t}));Oe.displayName=MN.displayName;function Zs({title:e,description:t,backHref:n,backLabel:a,className:r,icon:l,link:i}){const o=s.jsx(H,{asChild:!0,variant:"outline",size:"sm",className:"mt-4 no-underline",children:s.jsx(i,{href:n,children:a})});return l?s.jsx("div",{className:ne("flex-1 px-4 py-8 sm:px-6 lg:px-8",r),children:s.jsxs("section",{className:"mx-auto flex max-w-xl flex-col items-center text-center","data-testid":"not-found-state",children:[s.jsx("div",{className:"text-foreground mb-2 [&_svg]:size-8",children:l}),s.jsx("h1",{className:"m-0 text-xl font-semibold tracking-tight",children:e}),s.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),o]})}):s.jsx("div",{className:ne("flex-1 px-4 py-8 sm:px-6 lg:px-8",r),children:s.jsxs("section",{className:"border-border bg-card mx-auto max-w-xl rounded-xl border p-6",children:[s.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:e}),s.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),o]})})}function Xt({title:e,description:t,actions:n,className:a,children:r,...l}){return s.jsxs("header",{"data-slot":"page-header",className:ne("flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",a),...l,children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("h1",{className:"text-foreground text-2xl font-semibold tracking-tight",children:e}),t?s.jsx("p",{className:"text-muted-foreground text-sm",children:t}):null,r]}),n?s.jsx("div",{"data-slot":"page-header-actions",className:"flex shrink-0 items-center gap-2",children:n}):null]})}function yt({as:e="div",className:t,...n}){return s.jsx(e,{className:ne("rounded-lg border",t),...n})}function gv(e,[t,n]){return Math.min(n,Math.max(t,e))}var ON=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"}),yO="VisuallyHidden",DN=u.forwardRef((e,t)=>s.jsx(_e.span,{...e,ref:t,style:{...ON,...e.style}}));DN.displayName=yO;var bO=DN,jO=[" ","Enter","ArrowUp","ArrowDown"],wO=[" ","Enter"],ur="Select",[id,od,NO]=gx(ur),[Hl]=vs(ur,[NO,Bl]),cd=Bl(),[_O,Ba]=Hl(ur),[kO,SO]=Hl(ur),$N=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:r,onOpenChange:l,value:i,defaultValue:o,onValueChange:c,dir:d,name:f,autoComplete:h,disabled:m,required:g,form:j}=e,v=cd(t),[y,x]=u.useState(null),[p,b]=u.useState(null),[w,_]=u.useState(!1),k=Wu(d),[N,S]=Da({prop:a,defaultProp:r??!1,onChange:l,caller:ur}),[A,D]=Da({prop:i,defaultProp:o,onChange:c,caller:ur}),G=u.useRef(null),Y=y?j||!!y.closest("form"):!0,[T,B]=u.useState(new Set),F=Array.from(T).map(R=>R.props.value).join(";");return s.jsx(Cx,{...v,children:s.jsxs(_O,{required:g,scope:t,trigger:y,onTriggerChange:x,valueNode:p,onValueNodeChange:b,valueNodeHasChildren:w,onValueNodeHasChildrenChange:_,contentId:Yn(),value:A,onValueChange:D,open:N,onOpenChange:S,dir:k,triggerPointerDownPosRef:G,disabled:m,children:[s.jsx(id.Provider,{scope:t,children:s.jsx(kO,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(R=>{B(E=>new Set(E).add(R))},[]),onNativeOptionRemove:u.useCallback(R=>{B(E=>{const C=new Set(E);return C.delete(R),C})},[]),children:n})}),Y?s.jsxs(r_,{"aria-hidden":!0,required:g,tabIndex:-1,name:f,autoComplete:h,value:A,onChange:R=>D(R.target.value),disabled:m,form:j,children:[A===void 0?s.jsx("option",{value:""}):null,Array.from(T)]},F):null]})})};$N.displayName=ur;var zN="SelectTrigger",LN=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...r}=e,l=cd(n),i=Ba(zN,n),o=i.disabled||a,c=He(t,i.onTriggerChange),d=od(n),f=u.useRef("touch"),[h,m,g]=i_(v=>{const y=d().filter(b=>!b.disabled),x=y.find(b=>b.value===i.value),p=o_(y,v,x);p!==void 0&&i.onValueChange(p.value)}),j=v=>{o||(i.onOpenChange(!0),g()),v&&(i.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return s.jsx(Tx,{asChild:!0,...l,children:s.jsx(_e.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":l_(i.value)?"":void 0,...r,ref:c,onClick:re(r.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&j(v)}),onPointerDown:re(r.onPointerDown,v=>{f.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(j(v),v.preventDefault())}),onKeyDown:re(r.onKeyDown,v=>{const y=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(y&&v.key===" ")&&jO.includes(v.key)&&(j(),v.preventDefault())})})})});LN.displayName=zN;var UN="SelectValue",BN=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,children:l,placeholder:i="",...o}=e,c=Ba(UN,n),{onValueNodeHasChildrenChange:d}=c,f=l!==void 0,h=He(t,c.onValueNodeChange);return Ht(()=>{d(f)},[d,f]),s.jsx(_e.span,{...o,ref:h,style:{pointerEvents:"none"},children:l_(c.value)?s.jsx(s.Fragment,{children:i}):l})});BN.displayName=UN;var CO="SelectIcon",HN=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...r}=e;return s.jsx(_e.span,{"aria-hidden":!0,...r,ref:t,children:a||"▼"})});HN.displayName=CO;var TO="SelectPortal",IN=e=>s.jsx(po,{asChild:!0,...e});IN.displayName=TO;var dr="SelectContent",PN=u.forwardRef((e,t)=>{const n=Ba(dr,e.__scopeSelect),[a,r]=u.useState();if(Ht(()=>{r(new DocumentFragment)},[]),!n.open){const l=a;return l?_l.createPortal(s.jsx(qN,{scope:e.__scopeSelect,children:s.jsx(id.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),l):null}return s.jsx(GN,{...e,ref:t})});PN.displayName=dr;var In=10,[qN,Ha]=Hl(dr),RO="SelectContentImpl",EO=lr("SelectContent.RemoveScroll"),GN=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:l,onPointerDownOutside:i,side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:j,hideWhenDetached:v,avoidCollisions:y,...x}=e,p=Ba(dr,n),[b,w]=u.useState(null),[_,k]=u.useState(null),N=He(t,$=>w($)),[S,A]=u.useState(null),[D,G]=u.useState(null),Y=od(n),[T,B]=u.useState(!1),F=u.useRef(!1);u.useEffect(()=>{if(b)return ux(b)},[b]),cx();const R=u.useCallback($=>{const[ee,...pe]=Y().map(Z=>Z.ref.current),[je]=pe.slice(-1),Ne=document.activeElement;for(const Z of $)if(Z===Ne||(Z==null||Z.scrollIntoView({block:"nearest"}),Z===ee&&_&&(_.scrollTop=0),Z===je&&_&&(_.scrollTop=_.scrollHeight),Z==null||Z.focus(),document.activeElement!==Ne))return},[Y,_]),E=u.useCallback(()=>R([S,b]),[R,S,b]);u.useEffect(()=>{T&&E()},[T,E]);const{onOpenChange:C,triggerPointerDownPosRef:U}=p;u.useEffect(()=>{if(b){let $={x:0,y:0};const ee=je=>{var Ne,Z;$={x:Math.abs(Math.round(je.pageX)-(((Ne=U.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(je.pageY)-(((Z=U.current)==null?void 0:Z.y)??0))}},pe=je=>{$.x<=10&&$.y<=10?je.preventDefault():b.contains(je.target)||C(!1),document.removeEventListener("pointermove",ee),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",pe,{capture:!0})}}},[b,C,U]),u.useEffect(()=>{const $=()=>C(!1);return window.addEventListener("blur",$),window.addEventListener("resize",$),()=>{window.removeEventListener("blur",$),window.removeEventListener("resize",$)}},[C]);const[X,M]=i_($=>{const ee=Y().filter(Ne=>!Ne.disabled),pe=ee.find(Ne=>Ne.ref.current===document.activeElement),je=o_(ee,$,pe);je&&setTimeout(()=>je.ref.current.focus())}),Q=u.useCallback(($,ee,pe)=>{const je=!F.current&&!pe;(p.value!==void 0&&p.value===ee||je)&&(A($),je&&(F.current=!0))},[p.value]),se=u.useCallback(()=>b==null?void 0:b.focus(),[b]),W=u.useCallback(($,ee,pe)=>{const je=!F.current&&!pe;(p.value!==void 0&&p.value===ee||je)&&G($)},[p.value]),K=a==="popper"?Hh:VN,z=K===Hh?{side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:g,sticky:j,hideWhenDetached:v,avoidCollisions:y}:{};return s.jsx(qN,{scope:n,content:b,viewport:_,onViewportChange:k,itemRefCallback:Q,selectedItem:S,onItemLeave:se,itemTextRefCallback:W,focusSelectedItem:E,selectedItemText:D,position:a,isPositioned:T,searchRef:X,children:s.jsx(Fu,{as:EO,allowPinchZoom:!0,children:s.jsx(Vu,{asChild:!0,trapped:p.open,onMountAutoFocus:$=>{$.preventDefault()},onUnmountAutoFocus:re(r,$=>{var ee;(ee=p.trigger)==null||ee.focus({preventScroll:!0}),$.preventDefault()}),children:s.jsx(xo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:$=>$.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:s.jsx(K,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:$=>$.preventDefault(),...x,...z,onPlaced:()=>B(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:re(x.onKeyDown,$=>{const ee=$.ctrlKey||$.altKey||$.metaKey;if($.key==="Tab"&&$.preventDefault(),!ee&&$.key.length===1&&M($.key),["ArrowUp","ArrowDown","Home","End"].includes($.key)){let je=Y().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes($.key)&&(je=je.slice().reverse()),["ArrowUp","ArrowDown"].includes($.key)){const Ne=$.target,Z=je.indexOf(Ne);je=je.slice(Z+1)}setTimeout(()=>R(je)),$.preventDefault()}})})})})})})});GN.displayName=RO;var AO="SelectItemAlignedPosition",VN=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...r}=e,l=Ba(dr,n),i=Ha(dr,n),[o,c]=u.useState(null),[d,f]=u.useState(null),h=He(t,N=>f(N)),m=od(n),g=u.useRef(!1),j=u.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:x,focusSelectedItem:p}=i,b=u.useCallback(()=>{if(l.trigger&&l.valueNode&&o&&d&&v&&y&&x){const N=l.trigger.getBoundingClientRect(),S=d.getBoundingClientRect(),A=l.valueNode.getBoundingClientRect(),D=x.getBoundingClientRect();if(l.dir!=="rtl"){const Ne=D.left-S.left,Z=A.left-Ne,me=N.left-Z,ue=N.width+me,Ie=Math.max(ue,S.width),fe=window.innerWidth-In,V=gv(Z,[In,Math.max(In,fe-Ie)]);o.style.minWidth=ue+"px",o.style.left=V+"px"}else{const Ne=S.right-D.right,Z=window.innerWidth-A.right-Ne,me=window.innerWidth-N.right-Z,ue=N.width+me,Ie=Math.max(ue,S.width),fe=window.innerWidth-In,V=gv(Z,[In,Math.max(In,fe-Ie)]);o.style.minWidth=ue+"px",o.style.right=V+"px"}const G=m(),Y=window.innerHeight-In*2,T=v.scrollHeight,B=window.getComputedStyle(d),F=parseInt(B.borderTopWidth,10),R=parseInt(B.paddingTop,10),E=parseInt(B.borderBottomWidth,10),C=parseInt(B.paddingBottom,10),U=F+R+T+C+E,X=Math.min(y.offsetHeight*5,U),M=window.getComputedStyle(v),Q=parseInt(M.paddingTop,10),se=parseInt(M.paddingBottom,10),W=N.top+N.height/2-In,K=Y-W,z=y.offsetHeight/2,$=y.offsetTop+z,ee=F+R+$,pe=U-ee;if(ee<=W){const Ne=G.length>0&&y===G[G.length-1].ref.current;o.style.bottom="0px";const Z=d.clientHeight-v.offsetTop-v.offsetHeight,me=Math.max(K,z+(Ne?se:0)+Z+E),ue=ee+me;o.style.height=ue+"px"}else{const Ne=G.length>0&&y===G[0].ref.current;o.style.top="0px";const me=Math.max(W,F+v.offsetTop+(Ne?Q:0)+z)+pe;o.style.height=me+"px",v.scrollTop=ee-W+v.offsetTop}o.style.margin=`${In}px 0`,o.style.minHeight=X+"px",o.style.maxHeight=Y+"px",a==null||a(),requestAnimationFrame(()=>g.current=!0)}},[m,l.trigger,l.valueNode,o,d,v,y,x,l.dir,a]);Ht(()=>b(),[b]);const[w,_]=u.useState();Ht(()=>{d&&_(window.getComputedStyle(d).zIndex)},[d]);const k=u.useCallback(N=>{N&&j.current===!0&&(b(),p==null||p(),j.current=!1)},[b,p]);return s.jsx(OO,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:g,onScrollButtonChange:k,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:s.jsx(_e.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});VN.displayName=AO;var MO="SelectPopperPosition",Hh=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:r=In,...l}=e,i=cd(n);return s.jsx(Rx,{...i,...l,ref:t,align:a,collisionPadding:r,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Hh.displayName=MO;var[OO,Ux]=Hl(dr,{}),Ih="SelectViewport",YN=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...r}=e,l=Ha(Ih,n),i=Ux(Ih,n),o=He(t,l.onViewportChange),c=u.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(id.Slot,{scope:n,children:s.jsx(_e.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:re(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&h){const g=Math.abs(c.current-f.scrollTop);if(g>0){const j=window.innerHeight-In*2,v=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),x=Math.max(v,y);if(x<j){const p=x+g,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})})})]})});YN.displayName=Ih;var FN="SelectGroup",[DO,$O]=Hl(FN),zO=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=Yn();return s.jsx(DO,{scope:n,id:r,children:s.jsx(_e.div,{role:"group","aria-labelledby":r,...a,ref:t})})});zO.displayName=FN;var XN="SelectLabel",KN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=$O(XN,n);return s.jsx(_e.div,{id:r.id,...a,ref:t})});KN.displayName=XN;var uu="SelectItem",[LO,QN]=Hl(uu),WN=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:r=!1,textValue:l,...i}=e,o=Ba(uu,n),c=Ha(uu,n),d=o.value===a,[f,h]=u.useState(l??""),[m,g]=u.useState(!1),j=He(t,p=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,p,a,r)}),v=Yn(),y=u.useRef("touch"),x=()=>{r||(o.onValueChange(a),o.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(LO,{scope:n,value:a,disabled:r,textId:v,isSelected:d,onItemTextChange:u.useCallback(p=>{h(b=>b||((p==null?void 0:p.textContent)??"").trim())},[]),children:s.jsx(id.ItemSlot,{scope:n,value:a,disabled:r,textValue:f,children:s.jsx(_e.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...i,ref:j,onFocus:re(i.onFocus,()=>g(!0)),onBlur:re(i.onBlur,()=>g(!1)),onClick:re(i.onClick,()=>{y.current!=="mouse"&&x()}),onPointerUp:re(i.onPointerUp,()=>{y.current==="mouse"&&x()}),onPointerDown:re(i.onPointerDown,p=>{y.current=p.pointerType}),onPointerMove:re(i.onPointerMove,p=>{var b;y.current=p.pointerType,r?(b=c.onItemLeave)==null||b.call(c):y.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:re(i.onPointerLeave,p=>{var b;p.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:re(i.onKeyDown,p=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&p.key===" "||(wO.includes(p.key)&&x(),p.key===" "&&p.preventDefault())})})})})});WN.displayName=uu;var ai="SelectItemText",ZN=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,...l}=e,i=Ba(ai,n),o=Ha(ai,n),c=QN(ai,n),d=SO(ai,n),[f,h]=u.useState(null),m=He(t,x=>h(x),c.onItemTextChange,x=>{var p;return(p=o.itemTextRefCallback)==null?void 0:p.call(o,x,c.value,c.disabled)}),g=f==null?void 0:f.textContent,j=u.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return Ht(()=>(v(j),()=>y(j)),[v,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(_e.span,{id:c.textId,...l,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?_l.createPortal(l.children,i.valueNode):null]})});ZN.displayName=ai;var JN="SelectItemIndicator",e_=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return QN(JN,n).isSelected?s.jsx(_e.span,{"aria-hidden":!0,...a,ref:t}):null});e_.displayName=JN;var Ph="SelectScrollUpButton",t_=u.forwardRef((e,t)=>{const n=Ha(Ph,e.__scopeSelect),a=Ux(Ph,e.__scopeSelect),[r,l]=u.useState(!1),i=He(t,a.onScrollButtonChange);return Ht(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollTop>0;l(d)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),r?s.jsx(s_,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});t_.displayName=Ph;var qh="SelectScrollDownButton",n_=u.forwardRef((e,t)=>{const n=Ha(qh,e.__scopeSelect),a=Ux(qh,e.__scopeSelect),[r,l]=u.useState(!1),i=He(t,a.onScrollButtonChange);return Ht(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;l(f)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),r?s.jsx(s_,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});n_.displayName=qh;var s_=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...r}=e,l=Ha("SelectScrollButton",n),i=u.useRef(null),o=od(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),Ht(()=>{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(_e.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:re(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(a,50))}),onPointerMove:re(r.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),i.current===null&&(i.current=window.setInterval(a,50))}),onPointerLeave:re(r.onPointerLeave,()=>{c()})})}),UO="SelectSeparator",a_=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return s.jsx(_e.div,{"aria-hidden":!0,...a,ref:t})});a_.displayName=UO;var Gh="SelectArrow",BO=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=cd(n),l=Ba(Gh,n),i=Ha(Gh,n);return l.open&&i.position==="popper"?s.jsx(Ex,{...r,...a,ref:t}):null});BO.displayName=Gh;var HO="SelectBubbleInput",r_=u.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const r=u.useRef(null),l=He(a,r),i=nw(t);return u.useEffect(()=>{const o=r.current;if(!o)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const h=new Event("change",{bubbles:!0});f.call(o,t),o.dispatchEvent(h)}},[i,t]),s.jsx(_e.select,{...n,style:{...ON,...n.style},ref:l,defaultValue:t})});r_.displayName=HO;function l_(e){return e===""||e===void 0}function i_(e){const t=ms(e),n=u.useRef(""),a=u.useRef(0),r=u.useCallback(i=>{const o=n.current+i;t(o),function c(d){n.current=d,window.clearTimeout(a.current),d!==""&&(a.current=window.setTimeout(()=>c(""),1e3))}(o)},[t]),l=u.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,r,l]}function o_(e,t,n){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let i=IO(e,Math.max(l,0));r.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function IO(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var PO=$N,c_=LN,qO=BN,GO=HN,VO=IN,u_=PN,YO=YN,d_=KN,f_=WN,FO=ZN,XO=e_,h_=t_,m_=n_,x_=a_;const KO={default:"h-9 px-3 py-2 text-sm",control:"h-7 px-2 py-1 text-xs"},mt=PO,xt=qO,ct=u.forwardRef(({className:e,children:t,triggerSize:n="default",...a},r)=>s.jsxs(c_,{ref:r,className:ne("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",KO[n],e),...a,children:[t,s.jsx(GO,{asChild:!0,children:s.jsx(a0,{className:"text-muted-foreground size-4","aria-hidden":"true"})})]}));ct.displayName=c_.displayName;const p_=u.forwardRef(({className:e,...t},n)=>s.jsx(h_,{ref:n,className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(GC,{className:"size-4","aria-hidden":"true"})}));p_.displayName=h_.displayName;const g_=u.forwardRef(({className:e,...t},n)=>s.jsx(m_,{ref:n,className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(IC,{className:"size-4","aria-hidden":"true"})}));g_.displayName=m_.displayName;const ut=u.forwardRef(({className:e,children:t,position:n="popper",...a},r)=>s.jsx(VO,{container:go(),children:s.jsxs(u_,{ref:r,className:ne("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(p_,{}),s.jsx(YO,{className:ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(g_,{})]})}));ut.displayName=u_.displayName;const QO=u.forwardRef(({className:e,...t},n)=>s.jsx(d_,{ref:n,className:ne("px-2 py-1.5 text-sm font-semibold",e),...t}));QO.displayName=d_.displayName;const ke=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(f_,{ref:a,className:ne("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(XO,{children:s.jsx(Ml,{className:"size-4","aria-hidden":"true"})})}),s.jsx(FO,{children:t})]}));ke.displayName=f_.displayName;const WO=u.forwardRef(({className:e,...t},n)=>s.jsx(x_,{ref:n,className:ne("-mx-1 my-1 h-px bg-muted",e),...t}));WO.displayName=x_.displayName;function st({className:e,...t}){return s.jsx("div",{className:ne("animate-pulse rounded-md bg-primary/10",e),...t})}const Ue=u.forwardRef(({className:e,containerClassName:t,containerRef:n,containerTabIndex:a,containerAriaLabel:r,...l},i)=>s.jsx("div",{ref:n,tabIndex:a,"aria-label":r,className:ne("relative w-full overflow-auto",t),children:s.jsx("table",{ref:i,className:ne("w-full caption-bottom text-sm",e),...l})}));Ue.displayName="Table";const Ge=u.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:ne("[&_tr]:border-b",e),...t}));Ge.displayName="TableHeader";const Be=u.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:ne("[&_tr:last-child]:border-0",e),...t}));Be.displayName="TableBody";const ZO=u.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:ne("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));ZO.displayName="TableFooter";const ie=u.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:ne("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));ie.displayName="TableRow";const P=u.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:ne("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}));P.displayName="TableHead";const I=u.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:ne("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));I.displayName="TableCell";const JO=u.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:ne("text-muted-foreground mt-4 text-sm",e),...t}));JO.displayName="TableCaption";var ud="Tabs",[eD]=vs(ud,[td]),v_=td(),[tD,Bx]=eD(ud),y_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:r,defaultValue:l,orientation:i="horizontal",dir:o,activationMode:c="automatic",...d}=e,f=Wu(o),[h,m]=Da({prop:a,onChange:r,defaultProp:l??"",caller:ud});return s.jsx(tD,{scope:n,baseId:Yn(),value:h,onValueChange:m,orientation:i,dir:f,activationMode:c,children:s.jsx(_e.div,{dir:f,"data-orientation":i,...d,ref:t})})});y_.displayName=ud;var b_="TabsList",j_=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...r}=e,l=Bx(b_,n),i=v_(n);return s.jsx(zw,{asChild:!0,...i,orientation:l.orientation,dir:l.dir,loop:a,children:s.jsx(_e.div,{role:"tablist","aria-orientation":l.orientation,...r,ref:t})})});j_.displayName=b_;var w_="TabsTrigger",N_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:r=!1,...l}=e,i=Bx(w_,n),o=v_(n),c=S_(i.baseId,a),d=C_(i.baseId,a),f=a===i.value;return s.jsx(Lw,{asChild:!0,...o,focusable:!r,active:f,children:s.jsx(_e.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...l,ref:t,onMouseDown:re(e.onMouseDown,h=>{!r&&h.button===0&&h.ctrlKey===!1?i.onValueChange(a):h.preventDefault()}),onKeyDown:re(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(a)}),onFocus:re(e.onFocus,()=>{const h=i.activationMode!=="manual";!f&&!r&&h&&i.onValueChange(a)})})})});N_.displayName=w_;var __="TabsContent",k_=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:r,children:l,...i}=e,o=Bx(__,n),c=S_(o.baseId,a),d=C_(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($n,{present:r||f,children:({present:m})=>s.jsx(_e.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&&l})})});k_.displayName=__;function S_(e,t){return`${e}-trigger-${t}`}function C_(e,t){return`${e}-content-${t}`}var nD=y_,T_=j_,R_=N_,E_=k_;const sD=nD,A_=u.forwardRef(({className:e,...t},n)=>s.jsx(T_,{ref:n,className:ne("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));A_.displayName=T_.displayName;const Vh=u.forwardRef(({className:e,...t},n)=>s.jsx(R_,{ref:n,className:ne("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}));Vh.displayName=R_.displayName;const aD=u.forwardRef(({className:e,...t},n)=>s.jsx(E_,{ref:n,className:ne("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));aD.displayName=E_.displayName;const es=u.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:ne("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}));es.displayName="Textarea";var[dd]=vs("Tooltip",[Bl]),fd=Bl(),M_="TooltipProvider",rD=700,Yh="tooltip.open",[lD,Hx]=dd(M_),O_=e=>{const{__scopeTooltip:t,delayDuration:n=rD,skipDelayDuration:a=300,disableHoverableContent:r=!1,children:l}=e,i=u.useRef(!0),o=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(lD,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,a)},[a]),isPointerInTransitRef:o,onPointerInTransitChange:u.useCallback(d=>{o.current=d},[]),disableHoverableContent:r,children:l})};O_.displayName=M_;var Gi="Tooltip",[iD,No]=dd(Gi),D_=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:r,onOpenChange:l,disableHoverableContent:i,delayDuration:o}=e,c=Hx(Gi,e.__scopeTooltip),d=fd(t),[f,h]=u.useState(null),m=Yn(),g=u.useRef(0),j=i??c.disableHoverableContent,v=o??c.delayDuration,y=u.useRef(!1),[x,p]=Da({prop:a,defaultProp:r??!1,onChange:N=>{N?(c.onOpen(),document.dispatchEvent(new CustomEvent(Yh))):c.onClose(),l==null||l(N)},caller:Gi}),b=u.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),w=u.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,p(!0)},[p]),_=u.useCallback(()=>{window.clearTimeout(g.current),g.current=0,p(!1)},[p]),k=u.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,p(!0),g.current=0},v)},[v,p]);return u.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),s.jsx(Cx,{...d,children:s.jsx(iD,{scope:t,contentId:m,open:x,stateAttribute:b,trigger:f,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?k():w()},[c.isOpenDelayedRef,k,w]),onTriggerLeave:u.useCallback(()=>{j?_():(window.clearTimeout(g.current),g.current=0)},[_,j]),onOpen:w,onClose:_,disableHoverableContent:j,children:n})})};D_.displayName=Gi;var Fh="TooltipTrigger",$_=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=No(Fh,n),l=Hx(Fh,n),i=fd(n),o=u.useRef(null),c=He(t,o,r.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(Tx,{asChild:!0,...i,children:s.jsx(_e.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...a,ref:c,onPointerMove:re(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!l.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:re(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:re(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:re(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:re(e.onBlur,r.onClose),onClick:re(e.onClick,r.onClose)})})});$_.displayName=Fh;var Ix="TooltipPortal",[oD,cD]=dd(Ix,{forceMount:void 0}),z_=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:r}=e,l=No(Ix,t);return s.jsx(oD,{scope:t,forceMount:n,children:s.jsx($n,{present:n||l.open,children:s.jsx(po,{asChild:!0,container:r,children:a})})})};z_.displayName=Ix;var wl="TooltipContent",L_=u.forwardRef((e,t)=>{const n=cD(wl,e.__scopeTooltip),{forceMount:a=n.forceMount,side:r="top",...l}=e,i=No(wl,e.__scopeTooltip);return s.jsx($n,{present:a||i.open,children:i.disableHoverableContent?s.jsx(U_,{side:r,...l,ref:t}):s.jsx(uD,{side:r,...l,ref:t})})}),uD=u.forwardRef((e,t)=>{const n=No(wl,e.__scopeTooltip),a=Hx(wl,e.__scopeTooltip),r=u.useRef(null),l=He(t,r),[i,o]=u.useState(null),{trigger:c,onClose:d}=n,f=r.current,{onPointerInTransitChange:h}=a,m=u.useCallback(()=>{o(null),h(!1)},[h]),g=u.useCallback((j,v)=>{const y=j.currentTarget,x={x:j.clientX,y:j.clientY},p=xD(x,y.getBoundingClientRect()),b=pD(x,p),w=gD(v.getBoundingClientRect()),_=yD([...b,...w]);o(_),h(!0)},[h]);return u.useEffect(()=>()=>m(),[m]),u.useEffect(()=>{if(c&&f){const j=y=>g(y,f),v=y=>g(y,c);return c.addEventListener("pointerleave",j),f.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",j),f.removeEventListener("pointerleave",v)}}},[c,f,g,m]),u.useEffect(()=>{if(i){const j=v=>{const y=v.target,x={x:v.clientX,y:v.clientY},p=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),b=!vD(x,i);p?m():b&&(m(),d())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[c,f,i,d,m]),s.jsx(U_,{...e,ref:l})}),[dD,fD]=dd(Gi,{isInside:!1}),hD=WR("TooltipContent"),U_=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":r,onEscapeKeyDown:l,onPointerDownOutside:i,...o}=e,c=No(wl,n),d=fd(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(Yh,f),()=>document.removeEventListener(Yh,f)),[f]),u.useEffect(()=>{if(c.trigger){const h=m=>{const g=m.target;g!=null&&g.contains(c.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,f]),s.jsx(xo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:s.jsxs(Rx,{"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(hD,{children:a}),s.jsx(dD,{scope:n,isInside:!0,children:s.jsx(bO,{id:c.contentId,role:"tooltip",children:r||a})})]})})});L_.displayName=wl;var B_="TooltipArrow",mD=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=fd(n);return fD(B_,n).isInside?null:s.jsx(Ex,{...r,...a,ref:t})});mD.displayName=B_;function xD(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,a,r,l)){case l:return"left";case r:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function pD(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 gD(e){const{top:t,right:n,bottom:a,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:a},{x:r,y:a}]}function vD(e,t){const{x:n,y:a}=e;let r=!1;for(let l=0,i=t.length-1;l<t.length;i=l++){const o=t[l],c=t[i],d=o.x,f=o.y,h=c.x,m=c.y;f>a!=m>a&&n<(h-d)*(a-f)/(m-f)+d&&(r=!r)}return r}function yD(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),bD(t)}function bD(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const r=e[a];for(;t.length>=2;){const l=t[t.length-1],i=t[t.length-2];if((l.x-i.x)*(r.y-i.y)>=(l.y-i.y)*(r.x-i.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const r=e[a];for(;n.length>=2;){const l=n[n.length-1],i=n[n.length-2];if((l.x-i.x)*(r.y-i.y)>=(l.y-i.y)*(r.x-i.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var jD=O_,wD=D_,ND=$_,_D=z_,H_=L_;const kD=jD,SD=wD,CD=ND,I_=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>{const r=go(),l=s.jsx(H_,{ref:a,sideOffset:t,className:ne("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n});return r?s.jsx(_D,{container:r,children:l}):l});I_.displayName=H_.displayName;const vv=["none","read","comment","write","manage","admin"];function du(e,t){return vv.indexOf(e??"none")>=vv.indexOf(t)}function Px(e){return e==="api_key"?"API key":e==="sdlc_login"?"sdlc login":null}function vf(e,t){const n=Px(e);return e==="sdlc_login"&&t?`${n} on ${P_(t)}`:n}const TD=String.fromCodePoint(8296),RD=String.fromCodePoint(8297);function P_(e){return`${TD}${e}${RD}`}const Vi={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"}},ED={backlog:"neutral",planned:"neutral",in_progress:"info",completed:"success",canceled:"neutral"};function q_(e){return e.name==="Blocked"?"warning":ED[e.category]}const yv=1800;function Wn(e){return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Fn(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function qx(e){return`${An(e)}, ${Fn(e)}`}function Ql(e){return e<90?`${Math.round(e)} s`:e<5400?`${Math.round(e/60)} min`:`${(e/3600).toFixed(1).replace(/\.0$/,"")} h`}function An(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function G_(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function AD(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 MD(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 la="not_set";function OD({open:e,commands:t,list_id:n,list_revision:a,default_status_id:r,statuses:l,priorities:i,members:o,on_close:c,on_created:d}){var Y;const f=Al(),[h,m]=u.useState(""),[g,j]=u.useState(""),[v,y]=u.useState(r??((Y=l[0])==null?void 0:Y.id)??""),[x,p]=u.useState(la),[b,w]=u.useState(la),[_,k]=u.useState(!1),[N,S]=u.useState(null),[A,D]=u.useState(!1);u.useEffect(()=>{var T;e&&(m(""),j(""),y(r??((T=l[0])==null?void 0:T.id)??""),p(la),w(la),k(!1),S(null))},[e,r,l]);const G=async T=>{if(T.preventDefault(),!h.trim()){k(!0);return}D(!0),S(null);try{const B=await t.run("create_task",{list_id:n,expected_list_revision:a,title:h.trim(),description:g.trim()||null,status_id:v||null,priority_id:x===la?null:x,primary_user_id:b===la?null:b});if(!B.ok){S(B.refusal.message);return}f.success("Task created."),await d()}finally{D(!1)}};return s.jsx(Ys,{open:e,onOpenChange:T=>T?null:c(),children:s.jsx(Fs,{children:s.jsxs("form",{onSubmit:T=>void G(T),noValidate:!0,children:[s.jsxs(Xs,{children:[s.jsx(Qs,{children:"New task"}),s.jsx(Ws,{children:"Add a task to this List."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[N&&s.jsxs(le,{variant:"destructive",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(ae,{children:N})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"new-task-title",children:"Title"}),s.jsx(At,{id:"new-task-title",placeholder:"What needs doing",value:h,required:!0,"aria-invalid":_,"aria-describedby":_?"new-task-title-error":void 0,onChange:T=>{m(T.target.value),k(!1)}}),_&&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(Oe,{htmlFor:"new-task-description",children:"Description (optional)"}),s.jsx(es,{id:"new-task-description",rows:4,value:g,onChange:T=>j(T.target.value)})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"new-task-status",children:"Status"}),s.jsxs(mt,{value:v,onValueChange:y,children:[s.jsx(ct,{id:"new-task-status",children:s.jsx(xt,{})}),s.jsx(ut,{children:l.map(T=>s.jsx(ke,{value:T.id,children:T.name},T.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"new-task-priority",children:"Priority"}),s.jsxs(mt,{value:x,onValueChange:p,children:[s.jsx(ct,{id:"new-task-priority",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:la,children:"Not set"}),i.map(T=>s.jsx(ke,{value:T.id,children:T.name},T.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"new-task-primary",children:"Primary"}),s.jsxs(mt,{value:b,onValueChange:w,children:[s.jsx(ct,{id:"new-task-primary",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:la,children:"Not set"}),o.map(T=>s.jsx(ke,{value:T.user_id,children:T.label},T.user_id))]})]})]})]})]}),s.jsxs(Ks,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:A,children:A?"Creating…":"Create task"})]})]})})})}const DD="Your organization's work, in queue order. Claim a task to show you are working on it.",ri="any",V_="none",$D=1,zD=250,LD="The sdlc engine here is too old for this page",Y_="Update the main checkout, then restart sdlc viewer.";function Gx(){const e=nn().tasks;if(!e)throw new Error("The Tasks page rendered without the tasks seam.");return e}function UD({org:e}){var j;const t=Gx(),{href:n,Link:a}=Xe(),[r,l]=u.useState({state:"loading"}),[i,o]=u.useState([]),[c,d]=u.useState(null),f=u.useRef(0),h=u.useCallback(async v=>{const y=f.current+=1;v&&l({state:"loading"});const x=await t.availability({fresh:v});y===f.current&&l(x)},[t.availability]);u.useEffect(()=>{h(!1)},[h]);const m=u.useCallback(()=>void h(!0),[h]);if(u.useEffect(()=>{let v=!0;return t.members().then(y=>{v&&y.ok&&o(y.data)}),()=>{v=!1}},[t.members]),u.useEffect(()=>{if(!t.access)return;let v=!0;return t.access().then(y=>{v&&y.ok&&d(y.data)}),()=>{v=!1}},[t.access]),r.state==="off"&&((j=r.refusal)==null?void 0:j.reason)!=="engine_missing")return s.jsx(Zs,{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 g=(c==null?void 0:c.read_only_reason)??DD;return s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:r.state==="active"?s.jsx(HD,{active:r,org:e,members:i,description:g,read_only_reason:c==null?void 0:c.read_only_reason,reload_configuration:m}):s.jsxs(s.Fragment,{children:[s.jsx(Xt,{title:"Tasks",description:g}),r.state==="loading"&&s.jsx(F_,{}),(r.state==="error"||r.state==="off")&&s.jsx(X_,{refusal:r.refusal,on_retry:m}),r.state==="available"&&s.jsx(BD,{on_done:m})]})})}function F_(){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(st,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function X_({refusal:e,on_retry:t}){return(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(le,{variant:"destructive",className:"mt-6",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:LD}),s.jsx(ae,{children:Y_})]}):(e==null?void 0:e.reason)==="engine_missing"?s.jsxs(le,{variant:"info",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Tasks need the sdlc engine"}),s.jsx(ae,{children:e.message})]}):s.jsxs(le,{variant:"destructive",className:"mt-6",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Tasks could not be loaded"}),s.jsxs(ae,{children:[s.jsx("p",{children:e!=null&&e.reason?e.message:"Check your connection and try again."}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function BD({on_done:e}){const{commands:t}=Gx(),n=Al(),[a,r]=u.useState(!1),l=t==null?void 0:t.activate,i=async()=>{if(!l)return;r(!0);const o=await l();if(r(!1),!o.ok){n.error(o.refusal.message);return}n.success("Tasks are on."),e()};return s.jsxs(le,{variant:"info",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Tasks are not on for this organization"}),s.jsxs(ae,{children:[s.jsx("p",{children:"Turning them on creates one List with the default workflow. Members then see tasks as their access allows. It needs two-factor sign-in."}),l?s.jsx(H,{type:"button",size:"sm",className:"mt-2",disabled:a,onClick:()=>void i(),children:"Turn on Tasks"}):null]})]})}const yf=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function HD({active:e,org:t,members:n,description:a,read_only_reason:r,reload_configuration:l}){var xp;const{commands:i,listTasks:o,waitingOnYou:c,hierarchyRevision:d}=Gx(),{href:f,Link:h}=Xe(),{self_id:m}=Iu(),g=Al(),{list:j,workspace:v}=e,y=j.offers,x=y!==void 0,p=u.useMemo(()=>{var L;return((L=v.workflows.find(Ve=>Ve.id===j.workflow_id))==null?void 0:L.statuses)??[]},[v,j]),b=v.priorities,w=!!i&&du(j.permission,"write"),_=w&&du(j.permission,"manage"),k=u.useMemo(()=>new Map(n.map(L=>[L.user_id,L])),[n]),N=L=>{var Ve;return L?L===m?"You":((Ve=k.get(L))==null?void 0:Ve.label)??"A member":""},[S,A]=u.useState("active"),[D,G]=u.useState(!1),[Y,T]=u.useState(""),[B,F]=u.useState("");u.useEffect(()=>{const L=setTimeout(()=>F(Y),zD);return()=>clearTimeout(L)},[Y]);const[R,E]=u.useState(null),[C,U]=u.useState(ri),[X,M]=u.useState(!1),[Q,se]=u.useState(!1),[W,K]=u.useState(null),[z,$]=u.useState([]),[ee,pe]=u.useState(null),[je,Ne]=u.useState(0),[Z,me]=u.useState(!1),[ue,Ie]=u.useState(null),[fe,V]=u.useState(null),[ve,Me]=u.useState(!1),[dt,ge]=u.useState(null),[It,an]=u.useState({}),[$t,yn]=u.useState(""),{confirm:bn,confirm_dialog:ea}=$l(),Pt=u.useRef(null),bs=u.useRef(null),te=u.useRef(null),$e=u.useRef(null),[Re,zn]=u.useState(void 0),Ln=!!(B.trim()||R||C!==ri||X||Q),Un=u.useRef(0),kt=u.useCallback(async(L,Ve=!1)=>{const Qe=L?Un.current:Un.current+=1,at={state:S,assigned_to_me:D||void 0,cursor:L,search:B.trim()||void 0,group:R??void 0,owner:C===ri?void 0:C===V_?"":C,urgent:X||void 0,over_estimate:Q||void 0},zt=Kt=>o(j.id,{...at,cursor:Kt});let St=await zt(L),rt=!!L;if(!St.ok&&St.refusal.code==="cursor_stale"&&(St=await zt(),rt=!1),Qe!==Un.current)return;if(!St.ok){pe(St.refusal),Ne(Kt=>Kt+1);return}const Lt=St.data;pe(null),Ne(0),!(Ve&&yf(Lt,te.current))&&(te.current=Lt,K(Lt),Lt.facets&&zn(Lt.facets),$(Kt=>rt?[...Kt,...Lt.tasks]:Lt.tasks))},[o,j.id,S,D,B,R,C,X,Q]),Bn=u.useCallback(async()=>{const L=await c();if(V(Qe=>L.ok?null:yf(Qe,L.refusal)?Qe:L.refusal),!L.ok&&x)return;const Ve=L.ok?L.data:null;yf(Ve,$e.current)||($e.current=Ve,Ie(Ve))},[c,x]);u.useEffect(()=>{te.current=null,K(null)},[S,D]),u.useEffect(()=>{kt()},[kt]),u.useEffect(()=>{Bn()},[Bn]);const jn=u.useCallback(async()=>{await Promise.all([kt(),Bn()])},[kt,Bn]),Hn=y==null?void 0:y.refresh_ms;u.useEffect(()=>{if(!Hn)return;const L=setInterval(()=>{kt(void 0,!0),Bn()},Hn);return()=>clearInterval(L)},[Hn,kt,Bn]);const ta=u.useCallback(async(L,Ve,Qe)=>{if(!i)return;const at=await i.run(L,Ve);at.ok?Qe&&g.success(Qe):(g.error(at.refusal.message),at.refusal.code==="revision_conflict"&&l()),await jn()},[i,g,jn,l]),js=p.find(L=>L.category==="completed"),O=async(L,Ve,Qe)=>{const at=Ve+Qe,zt=z[at];if(!zt||!W||!i)return;const St=async(rt,Lt)=>{const Kt=await i.run(rt,Lt);if(!Kt.ok)throw Kt.refusal;return Kt.data};try{let rt=W.list.order_revision,Lt=L.revision;if(zt.queue_rank===null){const Kt=z.findIndex(na=>na.queue_rank===null);for(const na of z.slice(Kt,at+1)){const Co=await St("reorder",{task_id:na.id,expected_revision:na.revision,expected_order_revision:rt,placement:"end"});rt=Co.list.order_revision,na.id===L.id&&(Lt=Co.task.revision)}}await St("reorder",{task_id:L.id,expected_revision:Lt,expected_order_revision:rt,placement:Qe<0?"before":"after",anchor_task_id:zt.id})}catch(rt){g.error(rt.message)}await jn()},ye=L=>{js&&ta("update_task",{task_id:L.id,expected_revision:L.revision,changes:{status_id:js.id}},`${L.title} completed.`)},J=async L=>{if(!W||!await bn({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[Qe,at]=await Promise.all([o(j.id,{limit:1}),d(v.id)]);if(!Qe.ok||!at.ok){g.error(Qe.ok?at.ok?"":at.refusal.message:Qe.refusal.message);return}await ta("archive_task",{task_id:L.id,expected_revision:L.revision,expected_order_revision:Qe.data.list.order_revision,expected_hierarchy_revision:at.data},`${L.title} archived.`)},we=async L=>{await ta("release_hold",{hold_id:L},"Hold released.")},ts=async(L,Ve,Qe,at)=>{var Kt;if(!(i!=null&&i.complete)||!await bn({title:`Mark ${Ve} done?`,description:Qe.reason?`“${Qe.reason}”
|
|
394
|
+
|
|
395
|
+
It leaves the open tasks.`:"It leaves the open tasks.",action_label:"Mark done"}))return;ge(L);const St=await i.complete(Qe);if(ge(null),!St.ok){an(na=>({...na,[L]:St.refusal.message}));return}an(({[L]:na,...Co})=>Co),yn(`${Ve} marked done.`),await jn();const rt=bs.current;(Kt=(at?(rt==null?void 0:rt.querySelector(`[data-done-key="${CSS.escape(at)}"]`))??(rt==null?void 0:rt.querySelector(`[data-title-key="${CSS.escape(at)}"] a`)):null)??Pt.current)==null||Kt.focus()},Ia=()=>{var L;T(""),F(""),E(null),U(ri),M(!1),se(!1),(L=Pt.current)==null||L.focus()},m1=new Map(p.map(L=>[L.id,L])),x1=new Map(b.map(L=>[L.id,L])),bd=new Map(z.map(L=>[L.id,L.title])),jd=w&&S==="active",p1=z.some(L=>L.local_done),wd=jd||p1,Nd=!x||b.length>0,g1=!D&&!Ln,v1=5+(Nd?1:0)+(wd?1:0),y1=ee!==null&&(ee.reason==="store_locked"||ee.reason==="engine_failed")&&je<=$D,So=(ue==null?void 0:ue.holds)??[],b1=z.map(L=>L.id),j1=So.map(L=>L.id);return s.jsxs("div",{ref:bs,className:"contents",children:[s.jsx(Xt,{title:"Tasks",description:a,actions:w?s.jsxs(H,{type:"button",onClick:()=>Me(!0),children:[s.jsx(bl,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]}):null}),x&&(W!=null&&W.open)?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[W.open," open"]}):null,Hn?s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",role:"status",children:ee?`Not reading · trying again every ${Math.round(Hn/1e3)}s`:W?`Live · refreshes every ${Math.round(Hn/1e3)}s`:"Connecting…"}):null,x?s.jsx("p",{className:"sr-only",role:"status",children:$t}):null,(x||So.length>0)&&s.jsxs(yt,{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"}),So.length>0?s.jsx("ul",{className:"mt-2 divide-y","aria-labelledby":"waiting-title",children:So.map((L,Ve)=>{var St,rt;const Qe=Vi[L.hold_type],at=L.target.kind==="task"?`Because you claim ${bd.get(L.target.task_id)??"the task it waits on"} · `:"",zt=L.local_done;return s.jsxs("li",{id:`waiting-${L.id}`,"data-title-key":L.id,className:"flex flex-wrap items-center gap-3 py-2",children:[L.task?s.jsx(h,{className:"text-primary min-w-40 flex-1 hover:underline",href:f(`/org/${t}/tasks/${L.task.id}`),children:L.task.title}):s.jsx("span",{className:"min-w-40 flex-1",children:L.reason}),s.jsx(de,{variant:Qe.tone,children:L.local_label??Qe.label}),s.jsxs("div",{className:"min-w-48 flex-2",children:[L.task?s.jsx("div",{className:"text-sm",children:L.reason}):null,s.jsxs("div",{className:"text-muted-foreground text-xs",children:[at,"From ",N(L.opened_by)," · ",An(L.opened_at)]}),(St=L.local_threads)!=null&&St.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"}),": ",L.local_threads.join(" · ")]}):null,It[L.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:It[L.id]}):null]}),zt&&(i!=null&&i.complete)?s.jsx(H,{type:"button",variant:"outline",size:"sm","data-done-key":L.id,"aria-label":`Mark ${((rt=L.task)==null?void 0:rt.title)??L.reason} done`,loading:dt===L.id,onClick:()=>{var Lt;return void ts(L.id,((Lt=L.task)==null?void 0:Lt.title)??L.reason,zt,j1[Ve+1]??null)},children:"Done"}):null,x?null:s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void we(L.id),children:"Release"})]},L.id)})}):ue?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Nothing in this checkout waits on you."}):null,x&&fe?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status",children:fe.reason==="view_outdated"?`Waiting on you is not read here. ${Y_}`:"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:x?"This checkout only. Teammates' agents are not listed here.":"Release a hold when you have done your part. Whoever can edit the task then resolves it."})]}),!w&&!r&&s.jsxs(le,{variant:"info",className:"mt-4",children:[s.jsx(ho,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"You can view these tasks"}),s.jsx(ae,{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(sD,{value:S,onValueChange:L=>A(L),children:s.jsxs(A_,{"aria-label":"Which tasks",children:[s.jsx(Vh,{value:"active",children:"Active"}),s.jsx(Vh,{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(zl,{id:"tasks-mine",checked:D,onCheckedChange:L=>G(L===!0)}),s.jsx(Oe,{htmlFor:"tasks-mine",children:"Assigned to me"})]}):null,y!=null&&y.search?s.jsx(At,{ref:Pt,type:"search",className:"w-64","aria-label":"Search tasks",placeholder:"Search title, ID or detail",value:Y,onChange:L=>T(L.target.value)}):null,Re!=null&&Re.owners?s.jsx(PD,{owners:Re.owners,no_owner:Re.no_owner,value:C,on_change:U}):null]}),(xp=Re==null?void 0:Re.groups)!=null&&xp.length?s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Status",children:[Re.groups.map(L=>s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:al,"aria-pressed":R===L.id,onClick:()=>E(Ve=>Ve===L.id?null:L.id),children:[L.label," ",L.count]},L.id)),Re.marks?s.jsxs(s.Fragment,{children:[s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:al,"aria-pressed":X,onClick:()=>M(L=>!L),children:["Urgent ",Re.marks.urgent]}),s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:al,"aria-pressed":Q,onClick:()=>se(L=>!L),children:["Over estimate ",Re.marks.over_estimate]})]}):null]}):null,Ln&&(W==null?void 0:W.matched)!==void 0&&W.total!==void 0?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:[W.matched," of ",W.total," match ·"," ",s.jsx(H,{type:"button",variant:"link",size:"inline-sm",onClick:Ia,children:"Clear"})]}):null,y1?s.jsx("p",{className:"text-muted-foreground mt-4 text-sm",children:"Tasks are busy. Reading them again…"}):ee?s.jsx(X_,{refusal:ee,on_retry:()=>void kt()}):null,!W&&!ee&&s.jsx(F_,{}),W&&z.length===0&&Ln?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(qu,{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(H,{type:"button",variant:"outline",onClick:Ia,children:"Clear filters"})]}):W&&z.length===0&&S==="active"&&!D&&x?s.jsx("p",{className:"text-muted-foreground mt-6 text-sm",children:"No tasks recorded yet."}):W&&z.length===0&&S==="active"&&!D?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(l0,{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(H,{type:"button",onClick:()=>Me(!0),children:[s.jsx(bl,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]})]}):W?s.jsxs(s.Fragment,{children:[s.jsx(yt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Tasks",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Title"}),s.jsx(P,{children:"Status"}),Nd?s.jsx(P,{className:"hidden md:table-cell",children:"Priority"}):null,s.jsx(P,{className:"hidden md:table-cell",children:"Primary"}),s.jsx(P,{className:"hidden md:table-cell",children:"Holds"}),s.jsx(P,{children:"Claimed by"}),wd?s.jsx(P,{className:"text-right",children:"Actions"}):null]})}),s.jsxs(Be,{children:[z.map((L,Ve)=>{var St,rt;const Qe=m1.get(L.status_id),at=AD(L),zt=L.local_done;return s.jsxs(ie,{"data-testid":"tasks-row",children:[s.jsxs(I,{"data-title-key":L.id,children:[L.no_page?s.jsx("span",{children:L.title}):s.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/tasks/${L.id}`),children:L.title}),L.parent_task_id&&bd.get(L.parent_task_id)?s.jsx("div",{className:"text-muted-foreground text-xs",children:bd.get(L.parent_task_id)}):null,x?s.jsx(ID,{row:L}):null,It[L.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:It[L.id]}):null]}),s.jsx(I,{children:Qe?s.jsx(de,{variant:q_(Qe),children:Qe.name}):null}),Nd?s.jsx(I,{className:"hidden md:table-cell",children:L.priority_id?((St=x1.get(L.priority_id))==null?void 0:St.name)??"":s.jsx("span",{className:"text-muted-foreground",children:"Not set"})}):null,s.jsx(I,{className:"hidden md:table-cell",children:L.owner_title?L.owner_title:L.primary_user_id?N(L.primary_user_id):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}),s.jsx(I,{className:"hidden md:table-cell",children:at?s.jsx(de,{variant:at.tone,children:at.label}):s.jsx("span",{className:"text-muted-foreground",children:"None"})}),s.jsx(I,{"data-testid":"tasks-claim",children:s.jsx(qD,{row:L,holder:N((rt=L.claim)==null?void 0:rt.user_id)})}),wd?s.jsx(I,{className:"text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[zt&&"hold"in zt?s.jsx("a",{className:"text-primary text-sm hover:underline",href:`#waiting-${zt.hold}`,children:"In Waiting on you"}):zt&&(i!=null&&i.complete)?s.jsx(H,{type:"button",variant:"outline",size:"sm","data-done-key":L.id,"aria-label":`Mark ${L.title} done`,loading:dt===L.id,onClick:()=>void ts(L.id,L.title,zt,b1[Ve+1]??null),children:"Done"}):null,jd&&g1?s.jsxs(s.Fragment,{children:[s.jsx(H,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${L.title} up`,disabled:Ve===0,onClick:()=>void O(L,Ve,-1),children:s.jsx(OC,{className:"size-4","aria-hidden":"true"})}),s.jsx(H,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${L.title} down`,disabled:Ve===z.length-1,onClick:()=>void O(L,Ve,1),children:s.jsx(EC,{className:"size-4","aria-hidden":"true"})})]}):null,jd?s.jsxs(rd,{children:[s.jsx(ld,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon","aria-label":`More actions for ${L.title}`,children:s.jsx(ax,{className:"size-4","aria-hidden":"true"})})}),s.jsxs(wo,{align:"end",children:[js&&L.status_id!==js.id?s.jsx(cr,{onSelect:()=>ye(L),children:"Complete"}):null,_?s.jsx(cr,{className:"text-destructive focus:text-destructive",onSelect:()=>void J(L),children:"Archive"}):null]})]}):null]})}):null]},L.id)}),z.length===0&&s.jsx(ie,{children:s.jsx(I,{colSpan:v1,className:"text-muted-foreground h-24 text-center",children:S==="archived"?"No archived tasks.":"No tasks are assigned to you."})})]})]})}),W.next_cursor?s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2 self-start",disabled:Z,onClick:async()=>{me(!0),await kt(W.next_cursor??void 0),me(!1)},children:"Load more"}):null]}):null,w&&i&&s.jsx(OD,{open:ve,commands:i,list_id:j.id,list_revision:(W==null?void 0:W.list.revision)??j.revision,default_status_id:j.default_status_id,statuses:p,priorities:b,members:n,on_close:()=>Me(!1),on_created:async()=>{Me(!1),await jn()}}),ea]})}function ID({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(de,{variant:a.tone??"neutral",children:a.label},a.label))}):null]})}function PD({owners:e,no_owner:t,value:n,on_change:a}){return s.jsxs(mt,{value:n,onValueChange:a,children:[s.jsx(ct,{className:"w-56","aria-label":"Owner",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:ri,children:"Any owner"}),e.map(r=>s.jsxs(ke,{value:r.id,children:[r.label," (",r.count,")"]},r.id)),t!==void 0?s.jsxs(ke,{value:V_,children:["No owner (",t,")"]}):null]})]})}function qD({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 ${Wn(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?` · ${Px(n.via)}`:""]}),s.jsxs("div",{className:"text-muted-foreground truncate text-xs",title:n.via==="sdlc_login"&&n.via_device?P_(n.via_device):void 0,children:["Until ",Wn(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 GD={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 VD({open:e,members:t,tasks:n,holds_my_web_claim:a,on_close:r,on_submit:l}){const[i,o]=u.useState("waiting_for_user"),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,g]=u.useState(!1),[j,v]=u.useState({}),[y,x]=u.useState(null),[p,b]=u.useState(!1);u.useEffect(()=>{e&&(o("waiting_for_user"),d(""),h(""),g(!1),v({}),x(null))},[e]);const w=GD[i],_=async k=>{k.preventDefault();const N={target:w!==null&&!c.trim(),reason:!f.trim()};if(v(N),N.target||N.reason)return;b(!0);const S={hold_type:i,reason:f.trim(),release_claim:m};i==="waiting_for_user"&&(S.target_user_id=c),i==="blocked"&&(S.target_task_id=c),i==="waiting_for_external"&&(S.target_label=c.trim());const A=await l(S);b(!1),x(A)};return s.jsx(Ys,{open:e,onOpenChange:k=>k?null:r(),children:s.jsx(Fs,{children:s.jsxs("form",{onSubmit:k=>void _(k),noValidate:!0,children:[s.jsxs(Xs,{children:[s.jsx(Qs,{children:"Add hold"}),s.jsx(Ws,{children:"Say what this task is waiting for."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[y&&s.jsxs(le,{variant:"destructive",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(ae,{children:y})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"hold-type",children:"Type"}),s.jsxs(mt,{value:i,onValueChange:k=>{o(k),d(""),v({})},children:[s.jsx(ct,{id:"hold-type",children:s.jsx(xt,{})}),s.jsx(ut,{children:Object.keys(Vi).map(k=>s.jsx(ke,{value:k,children:Vi[k].label},k))})]})]}),w?s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"hold-target",children:w.label}),i==="waiting_for_external"?s.jsx(At,{id:"hold-target",value:c,"aria-invalid":j.target,onChange:k=>d(k.target.value)}):s.jsxs(mt,{value:c,onValueChange:d,children:[s.jsx(ct,{id:"hold-target","aria-invalid":j.target,children:s.jsx(xt,{placeholder:i==="blocked"?"Choose a task":"Choose a member"})}),s.jsx(ut,{children:i==="blocked"?n.map(k=>s.jsx(ke,{value:k.id,children:k.title},k.id)):t.map(k=>s.jsx(ke,{value:k.user_id,children:k.label},k.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(Oe,{htmlFor:"hold-reason",children:"Reason"}),s.jsx(es,{id:"hold-reason",rows:3,placeholder:"What the task is waiting for",value:f,"aria-invalid":j.reason,onChange:k=>h(k.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(zl,{id:"hold-release-claim",checked:m,onCheckedChange:k=>g(k===!0)}),s.jsx(Oe,{htmlFor:"hold-release-claim",children:"Also release my claim"})]})]}),s.jsxs(Ks,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:p,children:p?"Adding…":"Add hold"})]})]})})})}function _o(){const e=nn().tasks;if(!e)throw new Error("The Task page rendered without the tasks seam.");return e}function Vx(){return s.jsxs("div",{className:"grid gap-3",role:"status","aria-label":"Loading task",children:[s.jsx(st,{className:"h-8 w-1/2"}),Array.from({length:7},(e,t)=>s.jsx(st,{className:t===6?"h-6 w-2/3":"h-6 w-full"},t))]})}function fu({back:e,description:t}){const{href:n,Link:a}=Xe();return s.jsx(Zs,{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 Tr="not_set",YD=10*60*1e3,bv=20;function FD(){const{members:e}=_o(),[t,n]=u.useState([]);u.useEffect(()=>{let l=!0;return e().then(i=>{l&&i.ok&&n(i.data)}),()=>{l=!1}},[e]);const a=u.useMemo(()=>new Map(t.map(l=>[l.user_id,l])),[t]),r=u.useCallback((l,i)=>{var o;return l?l===i?"You":((o=a.get(l))==null?void 0:o.label)??"A member":""},[a]);return{members:t,name:r}}function XD({active:e,task_id:t,back:n}){const a=_o(),{task:r,activity:l,listTasks:i,hierarchyRevision:o,commands:c}=a,{href:d,Link:f}=Xe(),h=Al(),{self_id:m}=Iu(),{members:g,name:j}=FD(),{workspace:v}=e,{confirm:y,confirm_dialog:x}=$l(),[p,b]=u.useState(null),[w,_]=u.useState(!1),[k,N]=u.useState(!1),[S,A]=u.useState(null),[D,G]=u.useState([]),[Y,T]=u.useState(bv),[B,F]=u.useState([]),[R,E]=u.useState(!1),[C,U]=u.useState(null),[X,M]=u.useState(null),[Q,se]=u.useState(""),[W,K]=u.useState(null),z=u.useCallback(async()=>{if(!r)return;const O=await r(t);O.ok?(b(O.data),N(!1)):O.refusal.status===404||O.refusal.status===400?_(!0):N(!0)},[r,t]),$=u.useRef(0),ee=u.useCallback(async()=>{if(!l)return;const O=$.current+=1;let ye=[],J;for(;;){const we=await l(t,J);if(O!==$.current||!we.ok)return;if(ye=[...ye,...we.data.events].slice(-1e3),!we.data.more||!we.data.next_cursor)break;J=we.data.next_cursor}O===$.current&&G(ye.reverse())},[l,t]);u.useEffect(()=>{z(),ee()},[z,ee]);const pe=p?v.lists.find(O=>O.id===p.task.list_id):void 0,je=u.useMemo(()=>{var O;return((O=v.workflows.find(ye=>ye.id===(p==null?void 0:p.task.workflow_id)))==null?void 0:O.statuses)??[]},[v,p==null?void 0:p.task.workflow_id]);u.useEffect(()=>{if(!p)return;let O=!0;return i(p.task.list_id,{limit:100}).then(ye=>{O&&F(ye.ok?ye.data.tasks.filter(J=>J.id!==p.task.id).map(J=>({id:J.id,title:J.title})):[])}),()=>{O=!1}},[i,p==null?void 0:p.task.list_id,p==null?void 0:p.task.id,p]);const Ne=u.useCallback(async()=>{await Promise.all([z(),ee()])},[z,ee]),Z=u.useCallback((O,ye)=>c?c.run(O,ye):Promise.resolve({ok:!1,refusal:{status:0,message:"This page cannot change tasks."}}),[c]),me=u.useCallback(async(O,ye,J)=>{const we=await Z(O,ye);return we.ok?(J&&h.success(J),await Ne(),we.data):(we.refusal.code==="revision_conflict"?A({tone:"warning",title:"This task changed while you were editing",body:"We reloaded it. Check the change, then save again."}):we.refusal.code==="claim_held"?(await z(),A({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(we.refusal.message),await Ne(),null)},[Z,h,Ne,z]),ue=(p==null?void 0:p.claim)??null,Ie=ue!==null&&ue.id===W&&!ue.lapsed&&!ue.via?ue.id:null;if(u.useEffect(()=>{if(!Ie)return;const O=window.setInterval(()=>{Z("renew_claim",{claim_id:Ie,lease_seconds:yv}).then(()=>z())},YD);return()=>window.clearInterval(O)},[Ie,Z,z]),w)return s.jsx(fu,{back:n});if(k&&!p)return s.jsxs(le,{variant:"destructive",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This task could not be loaded"}),s.jsxs(ae,{children:[s.jsx("p",{children:"Check your connection and try again."}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void z(),children:"Retry"})]})]});if(!p)return s.jsx(Vx,{});const{task:fe}=p,V=fe.archived_at!==null,ve=du(p.permission,"write")&&!V,Me=du(p.permission,"manage"),dt=je.find(O=>O.id===fe.status_id),ge=je.find(O=>O.category==="completed"),It=v.priorities.find(O=>O.id===fe.priority_id),an=p.contributors.map(O=>O.user_id),$t=ue!==null&&ue.user_id===m,yn=ue!==null&&!ue.lapsed,bn=p.checklist.filter(O=>O.is_complete).length,ea=async()=>{const[O,ye]=await Promise.all([i(fe.list_id,{limit:1}),o(v.id)]);return O.ok?ye.ok?{ok:!0,data:{task_id:fe.id,expected_revision:fe.revision,expected_order_revision:O.data.list.order_revision,expected_hierarchy_revision:ye.data}}:ye:O},Pt=(O,ye)=>me("update_task",{task_id:fe.id,expected_revision:fe.revision,changes:O},ye),bs=O=>y(O.via==="sdlc_login"?{title:"Release this claim?",description:`You claimed it via ${vf(O.via,O.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}),te=async()=>{if(!ge)return;if(yn&&(!$t||ue.via)){const ye=ue.via==="api_key"?`${$t?"Your":`${j(ue.user_id)}'s`} agent is still working on it.`:ue.via==="sdlc_login"?`${$t?"You are":`${j(ue.user_id)} is`} still working on it via ${vf(ue.via,ue.via_device)}.`:`${j(ue.user_id)} is still working on it.`;if(!await y({title:"Complete this task?",description:ye,action_label:"Mark complete"}))return}await Pt({status_id:ge.id},"Task completed.")!==null&&ue&&$t&&yn&&await me("end_claim",{claim_id:ue.id,outcome:"completed"})},$e=async(O,ye)=>{const J=await ea();if(!J.ok){h.error(J.refusal.message);return}await me(O,J.data,ye)},Re=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 $e("archive_task","Task archived.")},zn=async()=>{await $e("restore_task","Task restored.")},Ln=async()=>{var we;const O=ue,ye=await me("claim_task",{task_id:fe.id,lease_seconds:yv}),J=(we=ye==null?void 0:ye.claim)==null?void 0:we.id;J&&!(O&&O.id===J&&O.via)&&K(J)},Un=async()=>{ue&&(ue.via&&!await bs(ue)||(await me("end_claim",{claim_id:ue.id,outcome:"released"},"Claim released."),K(null)))},kt=async()=>{ue&&await me("end_claim",{claim_id:ue.id,outcome:"expired"},"Claim cleared.")},Bn=async O=>{O.hold_type==="paused"&&m&&(O={...O,target_user_id:m});const ye=await Z("open_hold",{task_id:fe.id,hold_type:O.hold_type,reason:O.reason,...O.target_user_id?{target_user_id:O.target_user_id}:{},...O.target_task_id?{target_task_id:O.target_task_id}:{},...O.target_label?{target_label:O.target_label}:{}});return ye.ok?(E(!1),h.success("Hold added."),O.release_claim&&ue&&$t&&!ue.via&&(await me("end_claim",{claim_id:ue.id,outcome:"released"}),K(null)),await Ne(),null):ye.refusal.message},jn=O=>me("checklist",{task_id:fe.id,expected_revision:fe.revision,...O}),Hn=async O=>{for(const ye of O.filter(J=>!an.includes(J)))await me("set_contributor",{task_id:fe.id,expected_revision:fe.revision,user_id:ye,action:"add"});for(const ye of p.contributors.filter(J=>!O.includes(J.user_id)))await me("set_contributor",{task_id:fe.id,expected_revision:fe.revision,user_id:ye.user_id,action:"remove",expected_contributor_revision:ye.revision})},ta=O=>{var J;if(O.target.kind==="user")return j(O.target.user_id,m);if(O.target.kind==="external")return O.target.label;if(O.target.hidden||!O.target.task_id)return"A task you cannot see";const ye=O.target.task_id;return s.jsx(f,{className:"text-primary hover:underline",href:d(`${n}/${ye}`),children:((J=B.find(we=>we.id===ye))==null?void 0:J.title)??"Another task"})},js=O=>O.target.kind==="user"&&O.target.user_id===m&&!O.released_at?s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void me("release_hold",{hold_id:O.id},"Hold released."),children:"Release"}):ve?s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void me("resolve_hold",{hold_id:O.id},"Hold resolved."),children:"Resolve"}):null;return s.jsxs(s.Fragment,{children:[s.jsx(Xt,{title:fe.title,description:`Created ${An(fe.created_at)} by ${j(fe.created_by,m)}`,actions:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[ve&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{type:"button",variant:"outline",onClick:()=>U(fe.title),children:[s.jsx(rx,{className:"mr-2 size-4","aria-hidden":"true"}),"Edit title"]}),ge&&fe.status_id!==ge.id&&s.jsxs(H,{type:"button",variant:"outline",onClick:()=>void te(),children:[s.jsx(Ml,{className:"mr-2 size-4","aria-hidden":"true"}),"Mark complete"]})]}),Me&&!V&&s.jsxs(H,{type:"button",variant:"outline",onClick:()=>void Re(),children:[s.jsx(Pg,{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 O=>{O.preventDefault(),C.trim()&&await Pt({title:C.trim()})!==null&&U(null)},children:[s.jsx(Oe,{htmlFor:"task-title",className:"sr-only",children:"Title"}),s.jsx(At,{id:"task-title",className:"max-w-xl",value:C,onChange:O=>U(O.target.value)}),s.jsx(H,{type:"submit",size:"sm",children:"Save"}),s.jsx(H,{type:"button",size:"sm",variant:"outline",onClick:()=>U(null),children:"Cancel"})]}):null}),S&&s.jsxs(le,{variant:S.tone,className:"mt-4","data-testid":"task-notice",children:[S.tone==="warning"?s.jsx(gr,{className:"size-4","aria-hidden":"true"}):s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:S.title}),s.jsx(ae,{children:S.body})]}),V?s.jsxs(le,{variant:"info",className:"mt-4",children:[s.jsx(Pg,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This task is archived"}),s.jsx(ae,{children:Me?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(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void zn(),children:[s.jsx(CC,{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."})})]}):ve?null:s.jsxs(le,{variant:"info",className:"mt-4",children:[s.jsx(ho,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"You can view this task"}),s.jsx(ae,{children:"Ask an organization admin for write access to change it."})]}),ve?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(Oe,{htmlFor:"task-status",children:"Status"}),s.jsxs(mt,{value:fe.status_id,onValueChange:O=>void Pt({status_id:O}),children:[s.jsx(ct,{id:"task-status",children:s.jsx(xt,{})}),s.jsx(ut,{children:je.map(O=>s.jsx(ke,{value:O.id,children:O.name},O.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"task-priority",children:"Priority"}),s.jsxs(mt,{value:fe.priority_id??Tr,onValueChange:O=>void Pt({priority_id:O===Tr?null:O}),children:[s.jsx(ct,{id:"task-priority",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:Tr,children:"Not set"}),v.priorities.map(O=>s.jsx(ke,{value:O.id,children:O.name},O.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"task-primary",children:"Primary"}),s.jsxs(mt,{value:fe.primary_user_id??Tr,onValueChange:O=>void Pt({primary_user_id:O===Tr?null:O}),children:[s.jsx(ct,{id:"task-primary",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:Tr,children:"Not set"}),g.map(O=>s.jsx(ke,{value:O.user_id,children:O.label},O.user_id))]})]})]}),s.jsx(KD,{members:g,selected:an,on_change:O=>void Hn(O)})]}):s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(Wo,{label:"Status",value:(dt==null?void 0:dt.name)??""}),s.jsx(Wo,{label:"Priority",value:(It==null?void 0:It.name)??"Not set"}),s.jsx(Wo,{label:"Primary",value:fe.primary_user_id?j(fe.primary_user_id,m):"Not set"}),s.jsx(Wo,{label:"Contributors",value:an.map(O=>j(O,m)).join(", ")||"None"})]}),!V&&s.jsx(QD,{claim:ue,mine:$t,holder:ue?j(ue.user_id):"",own:ue!==null&&ue.id===W,can_write:ve,on_claim:()=>void Ln(),on_release:()=>void Un(),on_clear:()=>void kt()}),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"}),ve&&X===null&&s.jsx(H,{type:"button",variant:"ghost",size:"sm",onClick:()=>M(fe.description??""),children:"Edit description"})]}),X!==null?s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async O=>{O.preventDefault(),await Pt({description:X})!==null&&M(null)},children:[s.jsx(Oe,{htmlFor:"task-description",className:"sr-only",children:"Description"}),s.jsx(es,{id:"task-description",rows:5,value:X,onChange:O=>M(O.target.value)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(H,{type:"submit",size:"sm",children:"Save"}),s.jsx(H,{type:"button",size:"sm",variant:"outline",onClick:()=>M(null),children:"Cancel"})]})]}):s.jsx("p",{className:"mt-2 text-sm whitespace-pre-wrap",children:fe.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?` · ${bn} of ${p.checklist.length} done`:""]}),s.jsx("ul",{className:"mt-2 grid gap-1",children:p.checklist.map(O=>s.jsxs("li",{className:"flex items-center justify-between gap-2 py-1","data-testid":"task-checklist-item",children:[ve?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(zl,{id:`check-${O.id}`,checked:O.is_complete,onCheckedChange:ye=>void jn({action:"toggle",item_id:O.id,expected_item_revision:O.revision,is_complete:ye===!0})}),s.jsx(Oe,{htmlFor:`check-${O.id}`,className:"font-normal",children:O.label})]}):s.jsxs("span",{className:"text-sm",children:[O.is_complete?"Done: ":"To do: ",O.label]}),ve&&s.jsxs(rd,{children:[s.jsx(ld,{asChild:!0,children:s.jsx(H,{type:"button",variant:"ghost",size:"icon","aria-label":`Item actions for ${O.label}`,children:s.jsx(ax,{className:"size-4","aria-hidden":"true"})})}),s.jsx(wo,{align:"end",children:s.jsx(cr,{className:"text-destructive focus:text-destructive",onSelect:()=>void jn({action:"archive",item_id:O.id,expected_item_revision:O.revision}),children:"Remove"})})]})]},O.id))}),p.checklist.length===0&&!ve&&s.jsx("p",{className:"text-muted-foreground text-sm",children:"No checklist items."}),ve&&s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async O=>{O.preventDefault(),Q.trim()&&await jn({action:"add",label:Q.trim()})!==null&&se("")},children:[s.jsx(Oe,{htmlFor:"task-new-item",children:"Add an item"}),s.jsx(At,{id:"task-new-item",placeholder:"Add an item and press Enter",value:Q,onChange:O=>se(O.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"}),ve&&s.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!0),children:[s.jsx(o0,{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(Ue,{containerAriaLabel:"Holds",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Type"}),s.jsx(P,{children:"Reason"}),s.jsx(P,{children:"Waiting on"}),s.jsx(P,{className:"text-right",children:"Actions"})]})}),s.jsxs(Be,{children:[p.holds.map(O=>{const ye=Vi[O.hold_type];return s.jsxs(ie,{"data-testid":"task-hold",children:[s.jsx(I,{children:s.jsx(de,{variant:ye.tone,children:ye.label})}),s.jsxs(I,{children:[s.jsx("div",{children:O.reason}),s.jsx("div",{className:"text-muted-foreground text-xs",children:O.released_at?`Released by ${j(O.released_by,m)} · ${An(O.released_at)} · Ready to resolve`:`Opened by ${j(O.opened_by,m)} · ${An(O.opened_at)} · Open`})]}),s.jsx(I,{children:ta(O)}),s.jsx(I,{className:"text-right",children:js(O)})]},O.id)}),p.holds.length===0&&s.jsx(ie,{children:s.jsx(I,{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:[D.slice(0,Y).map(O=>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:MD(O)}),s.jsxs("span",{className:"min-w-0 text-right sm:text-left",children:[s.jsx("span",{children:O.actor_id?j(O.actor_id,m):"The system"}),O.via?s.jsxs("span",{className:"text-muted-foreground block max-w-64 truncate text-xs sm:max-w-none",title:`via ${vf(O.via,O.via_device)}`,children:["via ",Px(O.via),s.jsx(K_,{via:O.via,device:O.via_device})]}):null]}),s.jsx("span",{className:"text-muted-foreground col-span-2 sm:col-span-1 sm:text-right",children:G_(O.created_at)})]},O.id)),D.length===0&&s.jsx("li",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No activity yet."})]}),D.length>Y&&s.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"mt-2",onClick:()=>T(O=>O+bv),children:"Load more"})]}),ve&&pe&&s.jsx(VD,{open:R,members:g,tasks:B,holds_my_web_claim:$t&&yn&&!(ue!=null&&ue.via),on_close:()=>E(!1),on_submit:Bn}),x]})}function Wo({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 KD({members:e,selected:t,on_change:n}){return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"task-contributors",children:"Contributors"}),s.jsxs(rd,{children:[s.jsx(ld,{asChild:!0,children:s.jsxs(H,{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(a0,{className:"text-muted-foreground size-4","aria-hidden":"true"})]})}),s.jsx(wo,{align:"start",children:e.map(a=>{const r=t.includes(a.user_id);return s.jsxs(cr,{onSelect:()=>n(r?t.filter(l=>l!==a.user_id):[...t,a.user_id]),children:[r?s.jsx(Ml,{className:"mr-2 size-4","aria-hidden":"true"}):s.jsx("span",{className:"mr-2 size-4"}),a.label]},a.user_id)})})]})]})}function K_({via:e,device:t}){return e!=="sdlc_login"||!t?null:s.jsxs(s.Fragment,{children:[" on ",s.jsx("bdi",{children:t})]})}function QD({claim:e,mine:t,holder:n,own:a,can_write:r,on_claim:l,on_release:i,on_clear:o}){let c=s.jsx(lx,{className:"size-4","aria-hidden":"true"}),d="Nobody is working on this",f=r?"Claim it to show others you are.":"",h=r?s.jsx(H,{type:"button",size:"sm",onClick:l,children:"Claim"}):null;if(e&&e.lapsed){const m=new Date(e.lease_expires_at)<=new Date;c=s.jsx(WC,{className:"size-4","aria-hidden":"true"}),d=m?`${t?"Your":`${n}'s`} claim lapsed at ${Wn(e.lease_expires_at)}`:`${t?"Your":`${n}'s`} claim lapsed`,f=m?"Its time ran out.":`${n} can no longer edit this task.`,r&&(f+=" Take it over to work on it yourself, or clear it so anyone can claim it."),h=r?s.jsxs(s.Fragment,{children:[s.jsx(H,{type:"button",size:"sm",variant:"outline",onClick:o,children:"Clear claim"}),s.jsx(H,{type:"button",size:"sm",onClick:l,children:"Take over"})]}):null}else if(e){const m=Wn(e.lease_expires_at);c=e.via==="api_key"?s.jsx(sx,{className:"size-4","aria-hidden":"true"}):e.via==="sdlc_login"?s.jsx(yT,{className:"size-4","aria-hidden":"true"}):s.jsx(eR,{className:"size-4","aria-hidden":"true"});const g=s.jsxs(s.Fragment,{children:["Claimed via sdlc login",s.jsx(K_,{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:[g," 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=g):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=r?"Claimed on the web. You can take it over if the claim lapses.":"Claimed on the web."),h=t?s.jsx(H,{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 WD=10,Q_=5,ZD=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,JD="The sdlc engine here is too old for this page",e$="Update the main checkout, then restart sdlc viewer.",W_="Not available",t$={added:"Added",changed:"Changed",removed:"Removed"},n$={thread:"Thread",task:"Task",issue:"Issue",release:"Release",test:"Test"},jv=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;function s$(e,t){const n=t!=null&&t.startsWith("task:")?t.slice(5):null;if(n&&ZD.test(n))return{label:n,path:`/org/${e}/tasks/${n}`};const a=t!=null&&t.startsWith("issue:")?t.slice(6):null;if(a&&/^iss-\d{1,9}$/.test(a))return{label:a,path:`/org/${e}/issues/${a}`};const r=t!=null&&t.startsWith("release:")?t.slice(8):null;if(r&&jv.test(r))return{label:r==="candidate"?"Candidate":`Release ${r}`,path:`/releases?release=${r}`};const l=t!=null&&t.startsWith("planned:")?t.slice(8):null;return l&&jv.test(l)?{label:`Planned Release ${l}`,path:`/releases?planned=${l}`}:{label:"Tasks",path:`/org/${e}/tasks`}}const Z_=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function a$({org:e,task_id:t,from:n}){var bs;const a=_o(),{href:r,Link:l}=Xe(),{confirm:i,confirm_dialog:o}=$l(),c=s$(e,n),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState([]),[g,j]=u.useState([]),[v,y]=u.useState(null),[x,p]=u.useState(null),[b,w]=u.useState({state:"loading"}),[_,k]=u.useState({state:"loading"}),[N,S]=u.useState(null),[A,D]=u.useState(null),[G,Y]=u.useState(!1),T=u.useRef(null),B=u.useRef(null),F=u.useRef(null),R=u.useRef(null),E=u.useRef(null),C=u.useRef(!1),U=u.useRef(0),X=u.useRef(0),M=u.useCallback(async()=>{if(!a.taskSections)return;w({state:"loading"});const te=await a.taskSections(t);w(te.ok?{state:"ok",data:te.data}:{state:"failed",refusal:te.refusal})},[a.taskSections,t]),Q=u.useCallback(async()=>{if(!a.taskRelated)return;k({state:"loading"});const te=await a.taskRelated(t);k(te.ok?{state:"ok",data:te.data}:{state:"failed",refusal:te.refusal})},[a.taskRelated,t]),se=u.useCallback(async()=>{var Ln,Un;const te=X.current+=1;p(null),M(),Q();const[$e,Re]=await Promise.all([a.availability(),a.task?a.task(t):Promise.resolve(null)]);if(te!==X.current)return;$e.state==="active"&&m(((Ln=$e.workspace.workflows.find(kt=>kt.id===$e.list.workflow_id))==null?void 0:Ln.statuses)??[]);const zn=$e.state==="off"&&((Un=$e.refusal)==null?void 0:Un.reason)==="engine_missing"?$e.refusal:null;if(!Re||!Re.ok&&Re.refusal.reason==="engine_missing"||zn){f({state:"engine_missing",refusal:zn??(Re&&!Re.ok?Re.refusal:{status:0,message:""})});return}if(Re.ok){U.current=0,y(null),D(null),f({state:"ok",detail:Re.data,at:new Date().toISOString()});return}if(Re.refusal.status===404||Re.refusal.reason==="not_found"){f({state:"missing"});return}if(U.current+=1,U.current===1&&Z_(Re.refusal)){p(Re.refusal.retry_after??WD);return}y(Re.refusal),f(kt=>kt.state==="loading"?{state:"loading"}:kt)},[a,t,M,Q]);u.useEffect(()=>{se()},[se]),u.useEffect(()=>{if(x===null)return;const te=setTimeout(()=>void se(),x*1e3);return()=>clearTimeout(te)},[x,se]),u.useEffect(()=>{let te=!0;return a.members().then($e=>{te&&$e.ok&&j($e.data)}),()=>{te=!1}},[a.members]),u.useEffect(()=>{var $e;if(C.current||d.state!=="ok")return;C.current=!0;const te=($e=T.current)==null?void 0:$e.querySelector("h1");te&&(te.tabIndex=-1,te.focus())},[d.state]),u.useEffect(()=>{var te;N&&((te=F.current)==null||te.focus())},[N]),u.useEffect(()=>{if(A===null)return;const te=setTimeout(()=>{var $e;return($e=B.current)==null?void 0:$e.focus()},0);return()=>clearTimeout(te)},[A]);const W=u.useMemo(()=>new Map(g.map(te=>[te.user_id,te.label])),[g]),K=te=>te?W.get(te)??te:"",z=()=>{S(null),se()},$=u.useRef(null),ee=te=>($.current=te,te==="graph"?M():Q());if(u.useEffect(()=>{var Re;const te=$.current;if(te===null||(te==="graph"?b:_).state==="loading")return;$.current=null;const $e=(te==="graph"?R:E).current??((Re=T.current)==null?void 0:Re.querySelector("h1"));$e==null||$e.focus()},[b,_]),d.state==="missing")return s.jsx(ba,{children:s.jsx(fu,{back:`/org/${e}/tasks`,description:`No task ${t} in this checkout. It may have finished and been archived, or never been recorded.`})});const pe=s.jsx(H,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(l,{href:r(c.path),children:[s.jsx(nx,{className:"size-4","aria-hidden":"true"}),c.label]})});if(d.state==="engine_missing")return s.jsx(ba,{children:s.jsxs("div",{ref:T,className:"contents",children:[s.jsx(hu,{back:pe,id:null,title:t}),s.jsxs(le,{variant:"info",className:"mt-4",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Tasks need the sdlc engine"}),s.jsx(ae,{children:d.refusal.message})]})]})});const je=v?s.jsxs(le,{variant:"destructive",className:"mt-4",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Could not read this task"}),s.jsxs(ae,{children:[s.jsxs("p",{children:[v.message,v.since?` Since ${Fn(v.since)}.`:"",d.state==="ok"?` This page was read at ${Fn(d.at)}.`:""," See the sdlc viewer terminal for more."]}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:z,children:"Retry"})]})]}):null,Ne=x!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(vn,{"aria-hidden":"true"}),"Could not read this task. Trying again in ",x," seconds."]}):null,Z=s.jsx("div",{role:"status","aria-live":"polite",children:Ne});if(d.state==="loading")return s.jsxs(ba,{children:[Z,je,!v&&x===null?s.jsx(Vx,{}):null]});const{detail:me,at:ue}=d,{task:Ie}=me,fe=h.find(te=>te.id===Ie.status_id),V=me.local_done&&"task"in me.local_done?me.local_done:null,ve=me.local_waits??[],Me=V?ve[0]??null:null,dt=Me?K(Me.opened_by):me.owner_title??K(me.thread),ge=b.state==="ok"?b.data:null,It=(ge==null?void 0:ge.lifecycle)==="finished",an=It&&(ge==null?void 0:ge.outcome)==="cancelled",$t=It&&(ge==null?void 0:ge.outcome)==="complete",yn=!!Ie.created_at,bn=me.acceptance??[],ea=async()=>{var Re;if(!V||!((Re=a.commands)!=null&&Re.complete)||!await i({title:`Mark ${Ie.title} done?`,description:Me?`This answers ${dt}'s ask, “${Me.reason}”, closes that wait, and tells ${dt} to check and continue.`:`This tells ${dt||"its thread"} to check and continue.`,action_label:"Mark done"}))return;Y(!0);const $e=await a.commands.complete(V);if(Y(!1),!$e.ok){D($e.refusal.message);return}await se(),S({title:Ie.title,asker:dt||"Its thread"})},Pt=s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[V&&!N?s.jsxs(s.Fragment,{children:[s.jsxs(H,{ref:B,type:"button",variant:"outline",disabled:G,"aria-disabled":A!==null?!0:void 0,"aria-describedby":A!==null?"task-done-why":void 0,onClick:()=>{A===null&&ea()},children:[s.jsx(Ml,{className:"mr-2 size-4","aria-hidden":"true"}),"Done"]}),A!==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 ",Fn(ue)]}),s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:z,children:[s.jsx(gr,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsxs(ba,{children:[s.jsxs("div",{ref:T,className:"contents",children:[s.jsx(hu,{back:pe,id:Ie.id,badge:fe?s.jsx(de,{variant:q_(fe),children:fe.name}):null,title:Ie.title,created:yn?`Created ${An(Ie.created_at)}${dt||me.owner_title?` by ${me.owner_title??dt}`:""}`:null,actions:Pt}),Z,je,N?s.jsx("div",{ref:F,tabIndex:-1,role:"status","aria-live":"polite",className:"outline-none",children:s.jsxs(le,{variant:"success",className:"mt-4",children:[s.jsx(Pu,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Marked ",N.title," done"]}),s.jsxs(ae,{children:[N.asker," is told to check and continue."]})]})}):null,A!==null?s.jsxs(le,{variant:"destructive",className:"mt-4",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Done was not recorded"}),s.jsxs(ae,{children:[A," Read again to see the task as it is now."]})]}):null,Me&&!N?s.jsxs(le,{variant:"warning",className:"mt-4",children:[s.jsx(Vt,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:[dt," asks: ",Me.reason]}),s.jsxs(ae,{children:["Waiting on you since ",qx(Me.opened_at),". Done answers it and tells ",dt," to check and continue."]})]}):null,me.view_outdated?s.jsxs(le,{variant:"warning",className:"mt-4",children:[s.jsx(Vt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:JD}),s.jsxs(ae,{children:[e$," 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(os,{label:"Owner thread",value:me.owner_title??(K(me.thread)||"None")}),s.jsx(os,{label:"Release",value:me.release??"None"}),s.jsx(os,{label:"Session",value:b.state==="loading"?"Loading…":b.state==="failed"?"Not available":ge!=null&&ge.session?s.jsxs(s.Fragment,{children:[ge.session.provider," ",s.jsx("span",{className:"font-mono break-all",children:ge.session.id})]}):"None"}),s.jsx(os,{label:"Now",value:me.local_detail??(fe==null?void 0:fe.name)??""})]}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"Local tasks have no priority or contributors."}),s.jsx(r$,{detail:me,holder:K((bs=me.claim)==null?void 0:bs.user_id),finished_at:It?(ge==null?void 0:ge.finished_at)??null:null,read_at:ue}),s.jsxs(le,{variant:"info",className:"mt-4",children:[s.jsx(ho,{className:"text-info size-4","aria-hidden":"true"}),V?s.jsxs(s.Fragment,{children:[s.jsx(xe,{children:"Done is the one change this page makes"}),s.jsx(ae,{children:"Everything else about this task changes through its thread."})]}):s.jsxs(s.Fragment,{children:[s.jsx(xe,{children:"This page only reads tasks"}),s.jsx(ae,{children:"A task changes through the agent thread working on it."})]})]}),yn?ge!=null&&ge.record?s.jsxs("p",{className:"mt-4 text-sm",children:["Record ",s.jsx("span",{className:"font-mono break-all",children:ge.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."}),V?s.jsx(gt,{id:"task-done-needs",title:"What Done needs",children:bn.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-xs",children:["The task's acceptance; ",dt||"its thread"," checks these after Done."]}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:bn.map(te=>s.jsx("li",{children:te},te))})]}):s.jsxs("p",{className:"text-sm",children:["Its thread gave no acceptance. Ask ",dt||"its thread"," what Done needs before marking it."]})}):bn.length>0?s.jsxs(gt,{id:"task-acceptance",title:"Acceptance",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:$t?"All met: the task finished complete":an&&(ge!=null&&ge.finished_at)?`Cancelled ${An(ge.finished_at)}`:"Met when the task finishes complete"}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:bn.map(te=>s.jsx("li",{children:$t?`Met: ${te}`:te},te))})]}):null,s.jsx(l$,{detail:me,waits:ve,given:V!==null,threadName:K,threadsLink:s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/threads`),children:"Threads"})}),b.state==="loading"?s.jsxs("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading the task's sections",children:[s.jsx(st,{className:"h-8 w-full"}),s.jsx(st,{className:"h-8 w-full"}),s.jsx(st,{className:"h-8 w-2/3"})]}):null,ge?s.jsx(gt,{id:"task-stands",title:"Where it stands",children:s.jsxs("p",{className:"text-sm",children:[(fe==null?void 0:fe.name)??Ie.status_id,me.local_detail?` · ${me.local_detail}`:""]})}):null,ge!=null&&ge.time?s.jsx(i$,{time:ge.time}):null,s.jsx(o$,{sections:b,heading_ref:R,on_retry:()=>void ee("graph"),taskLink:te=>s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks/${te}?from=task:${Ie.id}`),children:te})}),ge!=null&&ge.files?s.jsx(c$,{files:ge.files,finished:It}):null,ge!=null&&ge.proof?s.jsx(u$,{proof:ge.proof,finished_at:ge.finished_at,who:me.owner_title??null}):null,ge&&ge.history.length>0?s.jsx(d$,{history:ge.history}):null,s.jsx(J_,{related:_,heading_ref:E,on_retry:()=>void ee("related"),link:te=>{const $e=te.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(te.id)}`:te.kind==="task"?`/org/${e}/tasks/${te.id}?from=task:${Ie.id}`:te.kind==="issue"?`/org/${e}/issues/${encodeURIComponent(te.id)}?from=task:${Ie.id}`:te.kind==="release"?`/releases?${te.planned?"planned":"release"}=${encodeURIComponent(te.id)}`:null;return $e?s.jsx(l,{className:ne("text-primary hover:underline",te.kind!=="thread"&&te.label===te.id&&"font-mono"),href:r($e),children:te.label}):te.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 hu({back:e,id:t,badge:n,title:a,created:r,actions:l}){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(Xt,{title:a,description:r??void 0,actions:l})]})}function os({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 gt({id:e,title:t,aside:n,heading_ref:a,children:r}){return s.jsxs("section",{className:"mt-6","aria-labelledby":`${e}-title`,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[s.jsx("h2",{id:`${e}-title`,ref:a,tabIndex:a?-1:void 0,className:"text-lg font-semibold outline-none",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),s.jsx("div",{className:"mt-2",children:r})]})}function r$({detail:e,holder:t,finished_at:n,read_at:a}){const r=e.claim,[,l]=u.useReducer(f=>f+1,0),i=r&&!e.view_outdated?new Date(r.lease_expires_at).getTime():null;u.useEffect(()=>{if(i===null||!Number.isFinite(i))return;const f=i-Date.now();if(f<=0)return;const h=setTimeout(l,Math.min(f+50,2147483647));return()=>clearTimeout(h)},[i]);let o=s.jsx(lx,{className:"size-4","aria-hidden":"true"}),c="Nobody is working on this",d=null;if(e.view_outdated)c=`Claimed by: ${W_}`;else if(r){const f=new Date(r.lease_expires_at)<=new Date(Math.max(Date.now(),new Date(a).getTime()));o=s.jsx(sx,{className:"size-4","aria-hidden":"true"}),c=`${t} is working on this until ${Fn(r.lease_expires_at)}${f||r.lapsed?" · passed":""}`,d="Claimed in the coordination registry; its thread renews the claim."}else n&&(o=s.jsx(Pu,{className:"size-4","aria-hidden":"true"}),d=`Finished ${An(n)}. Its claim ended when it finished.`);return s.jsxs(yt,{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 l$({detail:e,waits:t,given:n,threadName:a,threadsLink:r}){if(e.view_outdated)return s.jsx(gt,{id:"task-holds",title:"Holds",children:s.jsx("p",{className:"text-sm",children:W_})});if(e.holds.length===0)return null;const l=new Map(t.map(i=>[i.id,i]));return s.jsxs(gt,{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(yt,{className:"mt-2 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Holds",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Type"}),s.jsx(P,{children:"Reason"}),s.jsx(P,{children:"Waiting on"}),s.jsx(P,{children:"Opened"})]})}),s.jsx(Be,{children:e.holds.map(i=>{var f;const o=l.get(i.id),c=Vi[i.hold_type],d=n?"Done above answers it":o!=null&&o.local_done?"In Waiting on you":(f=o==null?void 0:o.local_threads)!=null&&f.length?s.jsxs(s.Fragment,{children:["Answer it in ",r,": ",o.local_threads.join(" · ")]}):null;return s.jsxs(ie,{"data-testid":"task-hold",children:[s.jsx(I,{children:s.jsx(de,{variant:c.tone,children:(o==null?void 0:o.local_label)??c.label})}),s.jsxs(I,{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(I,{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(I,{children:qx(i.opened_at)})]},i.id)})})]})})]})}function i$({time:e}){return s.jsx(gt,{id:"task-time",title:"Time",children:s.jsxs("dl",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsx(os,{label:"Estimate",value:e.estimate?`${Ql(e.estimate.low)}–${Ql(e.estimate.high)}`:e.unknown_reason??"None"}),s.jsx(os,{label:"Time taken",value:e.elapsed!==null?`${Ql(e.elapsed)}${e.over_estimate?" · over estimate":""}`:"Not started"}),e.forecast?s.jsx(os,{label:"Reforecast",value:s.jsxs("span",{className:"text-muted-foreground",children:[Ql(e.forecast.low),"–",Ql(e.forecast.high)," left",e.forecast.reason?` · ${e.forecast.reason}`:""]})}):null]})})}function Yx({what:e,again:t,refusal:n,on_retry:a}){return s.jsxs(le,{variant:"destructive",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Could not read ",e]}),s.jsxs(ae,{children:[s.jsx("p",{children:n.message}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:t})]})]})}function o$({sections:e,heading_ref:t,on_retry:n,taskLink:a}){const[r,l]=u.useState(!1);if(e.state==="loading")return null;const i=e.state==="failed"?e.refusal:e.data.graph.ok?null:e.data.graph.refusal;if(i)return s.jsx(gt,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsx(Yx,{what:"graph changes",again:"Read graph changes again",refusal:i,on_retry:n})});const o=e.state==="ok"&&e.data.graph.ok?e.data.graph.data:null;if(!o)return null;if(o.exempt)return s.jsx(gt,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsxs("p",{className:"text-sm",children:["This task changes no modeled design. Its plan says why: ",o.exempt,"."]})});if(o.changes.length===0)return null;const c=r?o.changes:o.changes.slice(0,Q_),d=o.changes.length-c.length;return s.jsxs(gt,{id:"task-graph",title:"Graph changes",aside:o.document,heading_ref:t,children:[s.jsx(yt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Graph changes",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Change"}),s.jsx(P,{children:"Kind of change"}),s.jsx(P,{children:"Also in"}),s.jsx(P,{children:"In the plan"})]})}),s.jsx(Be,{children:c.map(f=>s.jsxs(ie,{children:[s.jsxs(I,{children:[s.jsx("div",{children:f.label}),s.jsx("div",{className:"text-muted-foreground text-xs",children:f.type})]}),s.jsx(I,{children:t$[f.change]}),s.jsx(I,{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(I,{children:f.planned?"Yes":s.jsx(de,{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(H,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),children:["Show all ",o.changes.length]})]}):null]})}function c$({files:e,finished:t}){const[n,a]=u.useState(!1),r=n?e.paths:e.paths.slice(0,Q_);return s.jsxs(gt,{id:"task-files",title:"Files",children:[r.length>0?s.jsx("ul",{className:"grid gap-1 text-sm",children:r.map(l=>s.jsx("li",{children:s.jsx("span",{className:"font-mono break-all",children:l})},l))}):null,e.paths.length>r.length?s.jsxs(H,{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 u$({proof:e,finished_at:t,who:n}){return s.jsxs(gt,{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 ",An(t),n?` by ${n}`:""]}):null]})}function d$({history:e}){return s.jsxs(gt,{id:"task-history",title:"History",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"From the task record, newest first"}),s.jsx(yt,{className:"mt-2 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"History",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"What"}),s.jsx(P,{children:"Who"}),s.jsx(P,{children:"When"})]})}),s.jsx(Be,{children:e.map((t,n)=>s.jsxs(ie,{children:[s.jsx(I,{children:t.what}),s.jsx(I,{children:t.who??"Its thread"}),s.jsx(I,{children:qx(t.at)})]},`${t.at}:${n}`))})]})})]})}function J_({id:e="task-related",related:t,heading_ref:n,on_retry:a,link:r,fixed:l=!1}){return t.state==="ok"&&t.data.length===0?null:s.jsx(gt,{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(st,{className:"h-8 w-full"}),s.jsx(st,{className:"h-8 w-full"}),s.jsx(st,{className:"h-8 w-2/3"})]}):t.state==="failed"?s.jsx(Yx,{what:"related work",again:"Read related work again",refusal:t.refusal,on_retry:a}):s.jsx(yt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Related",className:l?"table-fixed":void 0,children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{className:l?"w-[14%]":void 0,children:"Kind"}),s.jsx(P,{className:l?"w-[45%]":void 0,children:"Item"}),s.jsx(P,{className:l?"w-[41%]":void 0,children:"How it relates"})]})}),s.jsx(Be,{children:t.data.map(i=>s.jsxs(ie,{children:[s.jsx(I,{children:n$[i.kind]}),s.jsx(I,{className:l?"break-words":void 0,children:r(i)}),s.jsx(I,{className:l?"break-words":void 0,children:i.relation})]},`${i.kind}:${i.planned?"planned:":""}${i.id}`))})]})})})}function f$({org:e,task_id:t,from:n}){const a=_o(),r=`/org/${e}/tasks`;return a.taskSections?s.jsx(a$,{org:e,task_id:t,from:n??null}):s.jsx(h$,{task_id:t,back:r})}function h$({task_id:e,back:t}){const{availability:n}=_o(),[a,r]=u.useState({state:"loading"});return u.useEffect(()=>{let l=!0;return n().then(i=>{l&&r(i)}),()=>{l=!1}},[n]),a.state==="off"?s.jsx(fu,{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(XD,{active:a,task_id:e,back:t}):a.state==="error"?s.jsxs(le,{variant:"destructive",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This task could not be loaded"}),s.jsx(ae,{children:"Check your connection and try again."})]}):a.state==="available"?s.jsx(fu,{back:t}):s.jsx(Vx,{})})}function Gn({children:e}){return s.jsx("p",{role:"alert",className:"text-destructive text-sm",children:e})}const m$=["open","triaged","resolved","closed"],Fx=["low","normal","high","urgent"],x$=["fixed","works_as_intended","planned","duplicate","wont_fix","cannot_reproduce"],p$=["title","description","external_reference"],mu={open:"Open",triaged:"Triaged",escalated:"Escalated",waiting_on_fix:"Waiting on fix",resolved:"Resolved",closed:"Closed"},ek={open:"warning",triaged:"info",escalated:"info",waiting_on_fix:"info",resolved:"success",closed:"neutral"},Yi={low:"Low",normal:"Normal",high:"High",urgent:"Urgent"},Xx={fixed:"Fixed",works_as_intended:"Works as intended",planned:"Planned",duplicate:"Duplicate",wont_fix:"Won't fix",cannot_reproduce:"Cannot reproduce"},tk={title:"Title",description:"Description",external_reference:"External reference"},g$=[["year",365*24*3600],["month",30*24*3600],["week",7*24*3600],["day",24*3600],["hour",3600],["minute",60]];function bc(e,t=Date.now()){const n=Math.round((new Date(e).getTime()-t)/1e3),a=new Intl.RelativeTimeFormat("en",{numeric:"auto"});for(const[r,l]of g$)if(Math.abs(n)>=l)return a.format(Math.round(n/l),r);return"just now"}function Xh(e,t,n){const a=`/org/${encodeURIComponent(e)}/proj/${encodeURIComponent(t)}/support`;return n?`${a}/${encodeURIComponent(n)}`:a}function Kx(e,t){return e?t??"Not available":"A former member"}const v$="the issue integration";function y$(e){return!e.created_by&&e.reporter_kind==="customer"?v$:Kx(e.created_by,e.created_by_username)}function b$(e,t){return!e.actor_id&&e.kind==="created"&&t.reporter_kind==="customer"?"The issue integration":Kx(e.actor_id,e.actor_username)}const Zo="not_set",j$="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 w$({create:e,open:t,onOpenChange:n,onCreated:a}){const[r,l]=u.useState(""),[i,o]=u.useState(""),[c,d]=u.useState(!1),[f,h]=u.useState(""),[m,g]=u.useState(Zo),[j,v]=u.useState(!1),[y,x]=u.useState(null),p=u.useRef(null),b=()=>{l(""),o(""),d(!1),h(""),g(Zo),x(null),p.current=null},w=N=>{var S;return((S=y==null?void 0:y.personal_data)==null?void 0:S.field)===N?y.message:void 0},_=async N=>{if(N.preventDefault(),j)return;v(!0),p.current??(p.current=crypto.randomUUID());const S=await e({request_id:p.current,title:i.trim()||void 0,description:f||void 0,external_reference:r.trim()||void 0,priority:m===Zo?null:m});if(v(!1),!S.ok){S.refusal.status!==0&&(p.current=null),x(S.refusal);return}b(),a(S.data.issue,S.data.duplicates)},k=y&&!y.personal_data?y.message:void 0;return s.jsx(Ys,{open:t,onOpenChange:N=>{N||b(),n(N)},children:s.jsx(Fs,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:_,className:"grid gap-4",children:[s.jsxs(Xs,{children:[s.jsx(Qs,{children:"New support issue"}),s.jsx(Ws,{children:"Log one help-desk report. Text is shown exactly as entered."})]}),s.jsxs(le,{variant:"warning",children:[s.jsx(Vt,{}),s.jsx(ae,{children:j$})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"maintain-issue-reference",children:"External reference"}),s.jsx(At,{id:"maintain-issue-reference",value:r,"aria-invalid":!!w("external_reference"),onChange:N=>{l(N.target.value),c||o(N.target.value)}}),w("external_reference")?s.jsx(Gn,{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(Oe,{htmlFor:"maintain-issue-title",children:"Title"}),s.jsx(At,{id:"maintain-issue-title",value:i,"aria-invalid":!!w("title"),onChange:N=>{o(N.target.value),d(!0)}}),w("title")?s.jsx(Gn,{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(Oe,{htmlFor:"maintain-issue-description",children:"Description"}),s.jsx(es,{id:"maintain-issue-description",rows:4,placeholder:"What the end user reported, without personal data",value:f,"aria-invalid":!!w("description"),onChange:N=>h(N.target.value)}),w("description")?s.jsx(Gn,{children:w("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"maintain-issue-priority",children:"Priority"}),s.jsxs(mt,{value:m,onValueChange:g,children:[s.jsx(ct,{id:"maintain-issue-priority",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:Zo,children:"Not set"}),Fx.map(N=>s.jsx(ke,{value:N,children:Yi[N]},N))]})]})]}),k?s.jsx(Gn,{children:k}):null,s.jsxs(Ks,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>{b(),n(!1)},children:"Cancel"}),s.jsx(H,{type:"submit",loading:j,disabled:!i.trim()&&!r.trim(),children:"Log issue"})]})]})})})}const N$=["supportAccess","assigneeCandidates","create","update","assign","transition","redact"];function nk(){return _$(nn().issues)}function _$(e){return e&&N$.every(t=>typeof e[t]=="function")?e:null}function sk(e){const[t,n]=u.useState(null);return u.useEffect(()=>{if(!e)return;let a=!1;return e.supportAccess().then(r=>{a||n({contract:e,state:r.ok?{state:"ready",access:r.data}:{state:"error"}})}),()=>{a=!0}},[e]),t&&e&&t.contract===e?t.state:{state:"loading"}}function ak({access:e,header:t,back_href:n,children:a}){const{href:r,Link:l}=Xe();return e.state==="loading"?s.jsxs("div",{className:"flex flex-1 items-center justify-center py-24",children:[s.jsx(vn,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Loading…"})]}):e.state==="error"||!e.access.enabled?s.jsx(Zs,{title:"Page not found",description:"This page does not exist or you do not have access to it.",backHref:r(n),backLabel:"Back to the project",link:l}):e.access.can_view?s.jsx(s.Fragment,{children:a(e.access)}):s.jsxs(s.Fragment,{children:[t,s.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[s.jsx(CT,{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 k$(){const e=Xe();return t=>{e.navigate?e.navigate(t):window.location.assign(e.href(t))}}const on="all",Jo=25;function Kh({action:e}){return s.jsx(Xt,{title:"Support",description:"Help-desk reports logged against this project.",actions:e})}function S$({org:e,project:t,query:n}){const a=nk(),r=sk(a),l=`/org/${e}/proj/${t}`;return s.jsx("div",{className:"flex w-full flex-1 flex-col gap-6 px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(ak,{access:r,header:s.jsx(Kh,{}),back_href:l,children:i=>a?s.jsx(C$,{contract:a,access:i,org_name:e,proj_name:t,query:n}):null})})}function C$({contract:e,access:t,org_name:n,proj_name:a,query:r}){const{href:l,Link:i}=Xe(),o=k$(),[c,d]=u.useState(()=>new URLSearchParams(r).get("external_reference")??""),[f,h]=u.useState(on),[m,g]=u.useState(on),[j,v]=u.useState(on),[y,x]=u.useState(0),[p,b]=u.useState(null),[w,_]=u.useState(0),[k,N]=u.useState(null),[S,A]=u.useState([]),[D,G]=u.useState(!1),Y=c.trim()!==""||f!==on||m!==on||j!==on,T=u.useCallback(async()=>{const C=await e.list({external_reference:c.trim()||void 0,status:f===on?void 0:f,priority:m===on?void 0:m,assignee:j===on?void 0:j,limit:Jo,offset:y*Jo});if(!C.ok){N(C.refusal.message);return}N(null),b(C.data.issues),_(C.data.total)},[e,c,f,m,j,y]);u.useEffect(()=>{const C=setTimeout(()=>void T(),200);return()=>clearTimeout(C)},[T]),u.useEffect(()=>{e.assigneeCandidates().then(C=>{C.ok&&A(C.data.candidates)})},[e]);const B=t.can_change?s.jsxs(H,{onClick:()=>G(!0),children:[s.jsx(bl,{className:"mr-2 size-4"}),"New issue"]}):void 0,F=s.jsx(w$,{create:e.create,open:D,onOpenChange:G,onCreated:(C,U)=>{G(!1);const X=Xh(n,a,C.id);o(U.length?`${X}?duplicates=${U.length}`:X)}});if(p!==null&&w===0&&!Y&&y===0)return s.jsxs(s.Fragment,{children:[s.jsx(Kh,{}),s.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[s.jsx(jT,{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(H,{onClick:()=>G(!0),children:[s.jsx(bl,{className:"mr-2 size-4"}),"Log the first issue"]}):null]}),F]});const R=w===0?0:y*Jo+1,E=Math.min(w,(y+1)*Jo);return s.jsxs(s.Fragment,{children:[s.jsx(Kh,{action:B}),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(YT,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2","aria-hidden":!0}),s.jsx(At,{"aria-label":"Filter by external reference",placeholder:"Filter by external reference",className:"pl-9",value:c,onChange:C=>{d(C.target.value),x(0)}})]}),s.jsx(bf,{label:"Status",value:f,onChange:C=>{h(C),x(0)},options:m$.map(C=>({value:C,label:mu[C]}))}),s.jsx(bf,{label:"Priority",value:m,onChange:C=>{g(C),x(0)},options:Fx.map(C=>({value:C,label:Yi[C]}))}),s.jsx(bf,{label:"Assignee",value:j,onChange:C=>{v(C),x(0)},options:[{value:"unassigned",label:"Unassigned"},{value:"cannot_act",label:"Assignee cannot act"},...S.map(C=>({value:C.user_id,label:C.username??"Not available"}))]})]}),k?s.jsx(Gn,{children:k}):null,s.jsx("div",{className:"rounded-md border",children:s.jsxs(Ue,{children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Title"}),s.jsx(P,{children:"External reference"}),s.jsx(P,{children:"Status"}),s.jsx(P,{children:"Priority"}),s.jsx(P,{children:"Assignee"}),s.jsx(P,{children:"Updated"})]})}),s.jsx(Be,{children:p===null?s.jsx(ie,{children:s.jsx(I,{colSpan:6,className:"h-24 text-center",children:"Loading…"})}):p.length===0?s.jsx(ie,{children:s.jsx(I,{colSpan:6,className:"h-24 text-center",children:"No issues match these filters."})}):p.map(C=>s.jsxs(ie,{children:[s.jsx(I,{className:"max-w-md",children:s.jsx(i,{href:l(Xh(n,a,C.id)),className:"font-medium hover:underline",children:C.title})}),s.jsx(I,{className:"font-mono text-xs",children:C.external_reference??""}),s.jsx(I,{children:s.jsx(de,{variant:ek[C.status],children:mu[C.status]})}),s.jsx(I,{children:C.priority?Yi[C.priority]:""}),s.jsx(I,{children:s.jsx(T$,{issue:C})}),s.jsx(I,{className:"text-muted-foreground",children:bc(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 ${R}–${E} of ${w} issue${w===1?"":"s"}.`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(H,{variant:"outline",size:"sm",disabled:y===0,onClick:()=>x(C=>Math.max(0,C-1)),children:"Previous"}),s.jsx(H,{variant:"outline",size:"sm",disabled:E>=w,onClick:()=>x(C=>C+1),children:"Next"})]})]}),F]})}function T$({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(de,{variant:"error",children:"Assignee cannot act"}):null]}):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}function bf({label:e,value:t,onChange:n,options:a}){var l;const r=u.useMemo(()=>t===on||a.some(i=>i.value===t),[a,t]);return s.jsxs(mt,{value:r?t:on,onValueChange:n,children:[s.jsx(ct,{className:"w-44","aria-label":e,children:s.jsx(xt,{placeholder:e,children:t===on?e:(l=a.find(i=>i.value===t))==null?void 0:l.label})}),s.jsxs(ut,{children:[s.jsx(ke,{value:on,children:"All"}),a.map(i=>s.jsx(ke,{value:i.value,children:i.label},i.value))]})]})}const R$="Local only · this machine · not connected to SoftwareDLC",E$="Checking sync state…",A$="Sync state unknown",M$="Projects are the repositories this viewer reads on this machine. Nothing is shared unless you connect to SoftwareDLC.",fr="Details are in the terminal running sdlc viewer.",O$="How to fix it is in the terminal running sdlc viewer.",hd="Loading…",xu="Not available";function D$(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 li(e){return(typeof e=="string"?new Date(e):e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const $$={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 rk(e,t){const n=t?` this list was read at ${li(t)}.`:"";if(e.reason==="store_locked"){const a=e.store?$$[e.store]:"a local store",r=e.since?` since ${li(e.since)}`:"";return`Another sdlc command has held ${a}${r};${n||" nothing was read yet."} ${fr}`}return e.status===0?`The viewer did not answer. Is sdlc viewer still running?${t?` This list was read at ${li(t)}.`:""}`:`The read failed.${t?` This list was read at ${li(t)}.`:""} ${fr}`}const z$=e=>e.status===409,L$={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 U$(e){const t=e.repository??"This repository";if(e.reason==="folder_member_unlisted"&&e.folder&&e.home&&e.member_path)return{kind:"unlisted",repository:t,folder:e.folder,home:e.home,member_path:e.member_path};if(e.reason==="member_moved"){const r=e.folder?`the folder ${e.folder}`:"its folder";return{kind:"moved_member",cause:`This repository, ${t}, is not where ${r} records it.`}}if(e.reason==="folder_moved")return{kind:"other",cause:e.folder?`The folder ${e.folder} has moved.`:"The folder has moved.",fix:!0};const n=e.reason?L$[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 lk=[{key:"local",label:"Local"},{key:"staging",label:"Staging"},{key:"production",label:"Production"}],B$=/^iss-\d{1,9}$/,H$=/^col-\d{1,9}$/,I$=e=>e&&e[0].toUpperCase()+e.slice(1);function ik(e){const t=I$(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 _i(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 Qh={search:"",owner:null,urgent:!1,seen:[],label:null,collection:null};function jc(e){const t=new URLSearchParams(e),n=t.getAll("seen").filter(r=>lk.some(l=>l.key===r)),a=t.get("collection");return{search:t.get("search")??"",owner:t.get("owner")||null,urgent:t.get("urgent")==="1",seen:[...new Set(n)],label:t.get("label")||null,collection:a&&H$.test(a)?a:null}}function Xr(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 P$(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 wv=e=>!!(e.search.trim()||e.owner||e.urgent||e.seen.length||e.label||e.collection),q$={agent:"Filed by an agent",user:"Filed by you",tool:"Filed by a tool"},G$={graph:"Placed on the graph by its anchors",files:"Placed by its files",unplaced:"Triaged, not placed yet"},V$={handoff:"Handed to its owner",backlog:"Sent to the unowned backlog",batch:"Routed to a batch"};function Y$(e,t=""){const n=(e??t).trim();if(!n)return"";const a=n.indexOf(": "),r=(a===-1?n:n.slice(0,a)).trim(),l=a===-1?"":n.slice(a+2).trim(),i=o=>l?`${o} ${l}`:o;switch(r){case"filed":return q$[l]??i("Filed by");case"labelled":return i("Labelled");case"unlabelled":return l?`Label removed: ${l}`:"Label removed";case"anchored":return l?`Anchored to ${l}`:"Anchored";case"triaged":return G$[l]??(l?`Triaged: ${l}`:"Triaged");case"routed":return V$[l]??(l?`Routed: ${l}`:"Routed");case"route closed":return l==="backlog"?"Taken off the unowned backlog":l?`Route closed: ${l}`:"Route closed";case"released":return l?`Released by its owner (task ${l})`:"Released by its owner";case"resolved":return l==="duplicate"?"Resolved as a duplicate":l?`Resolved · ${l.replace(/_/g," ")}`:"Resolved";case"reopened":return l?`Reopened: ${l}`:"Reopened";case"fix landed":return l?`Fix landed in ${l.slice(0,10)}`:"Fix landed";case"merged":return l?`Merged ${l} into this issue`:"Merged a duplicate into this issue";default:return n}}const F$=e=>e.replace(/`+/g,"").replace(/\s+/g," ").trim(),ok="The sdlc engine here is too old for this page",ck="Update the main checkout, then restart sdlc viewer.",uk="Issues need the sdlc engine",dk="This page only reads issues",fk="File, route and resolve issues with the issue command or through the thread working on them.",X$=10,K$=250,Rr="__all",Q$="none",W$=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function hk(){const e=nn().issues;if(!e)throw new Error("The Issues page rendered without the issues seam.");return e}const Z$=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 J$({project:e,query:t,onQuery:n}){var K;const a=hk(),{href:r,Link:l}=Xe(),i=u.useMemo(()=>jc(t),[t]),o=Xr(i),c=wv(i),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState(null),[g,j]=u.useState(null),v=u.useRef(0),y=u.useRef(0),x=u.useRef(null),p=u.useRef(null),b=u.useRef(!1),[w,_]=u.useState(i.search),k=u.useCallback(z=>n(Xr({...i,...z})),[i,n]),N=u.useCallback(async()=>{const z=y.current+=1;j(null);const $=await a.list(P$(jc(o)));if(z!==y.current)return;if($.ok){v.current=0,m(null),f({state:"ok",list:$.data,local:$.data.local??Z$(new Date().toISOString()),key:o});return}const ee=$.refusal.reason;if(ee==="engine_missing")return f({state:"engine_missing",refusal:$.refusal});if(ee==="view_outdated")return f({state:"view_outdated"});if(v.current+=1,v.current===1&&W$($.refusal)){j($.refusal.retry_after??X$);return}m($.refusal)},[a.list,o]);u.useEffect(()=>{N()},[N]),u.useEffect(()=>{if(g===null)return;const z=setTimeout(()=>void N(),g*1e3);return()=>clearTimeout(z)},[g,N]),u.useEffect(()=>{document.activeElement!==x.current&&_(i.search)},[i.search]),u.useEffect(()=>{if(w===i.search)return;const z=setTimeout(()=>k({search:w}),K$);return()=>clearTimeout(z)},[w,i.search,k]),u.useEffect(()=>{const z=$=>{if($.key!=="/"||$.metaKey||$.ctrlKey||$.altKey)return;const ee=$.target;ee&&(ee.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(ee.tagName))||x.current&&($.preventDefault(),x.current.focus())};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[]);const S=()=>{var z;_(""),n(Xr(Qh)),(z=x.current)==null||z.focus()},A=()=>{v.current=0,N()},D=()=>{b.current=!0,A()};u.useEffect(()=>{var $;if(!b.current||d.state==="loading"||g!==null)return;b.current=!1;const z=($=p.current)==null?void 0:$.querySelector("h1");z&&(z.tabIndex=-1,z.focus())},[d,h,g]);const G=z=>`/proj/${encodeURIComponent(e)}/issues${z?`?${z}`:""}`,Y=z=>`/proj/${encodeURIComponent(e)}/issues/${encodeURIComponent(z)}?from=issues${o?`&${o}`:""}`,T=s.jsx("div",{role:"status","aria-live":"polite",children:g!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(vn,{"aria-hidden":"true"}),"Issues are busy. Reading them again…"]}):null}),B=h?s.jsxs(le,{variant:"destructive",className:"mt-4",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Issues could not be loaded"}),s.jsxs(ae,{children:[s.jsxs("p",{children:[h.message,h.since?` Since ${Fn(h.since)}.`:"",d.state==="ok"?` The list below was read at ${Fn(d.local.read_at)}.`:"",h.message.includes(fr)?"":` ${fr}`]}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:D,children:"Retry"})]})]}):null,F=s.jsx(Xt,{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 ",Fn(d.local.read_at)]}),s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:A,children:[s.jsx(gr,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]}):null});if(d.state==="engine_missing"||d.state==="view_outdated")return s.jsxs(jf,{ref:p,children:[F,d.state==="engine_missing"?s.jsxs(le,{variant:"info",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:uk}),s.jsx(ae,{children:d.refusal.message})]}):s.jsxs(le,{variant:"warning",className:"mt-6",children:[s.jsx(Vt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:ok}),s.jsx(ae,{children:ck})]})]});if(d.state==="loading")return s.jsxs(jf,{ref:p,children:[F,T,B,!h&&g===null?s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading issues",children:Array.from({length:6},(z,$)=>s.jsx(st,{className:$===5?"h-10 w-2/3":"h-10 w-full"},$))}):null]});const{list:R,local:E}=d,C=!h&&g===null&&(d.key!==o||w!==i.search),U=wv(jc(d.key)),X=E.scope==="folder",M=E.listed===0&&!c,Q=Math.max(0,E.listed-E.facets.owners.reduce((z,$)=>z+$.count,0)),se=i.collection?((K=E.collections.find(z=>z.collection===i.collection))==null?void 0:K.title)??i.collection:null,W=new Map;for(const z of R.issues){const $=z.group??"unplaced";W.set($,[...W.get($)??[],z])}return s.jsxs(jf,{ref:p,children:[F,X&&E.folder?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Issues of the folder ",E.folder,", from its issue store."]}):null,s.jsxs(le,{variant:"info",className:"mt-4",children:[s.jsx(ho,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:dk}),s.jsx(ae,{children:fk})]}),T,B,M?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(pT,{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(At,{ref:x,type:"search",className:"w-64","aria-label":"Search issues",placeholder:"Search issues",value:w,onChange:z=>_(z.target.value)}),s.jsxs(mt,{value:i.owner??Rr,onValueChange:z=>k({owner:z===Rr?null:z}),children:[s.jsx(ct,{className:"w-56","aria-label":"Owner",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:Rr,children:"All owners"}),s.jsxs(ke,{value:Q$,children:["Unowned (",Q,")"]}),E.facets.owners.map(z=>s.jsxs(ke,{value:z.key,children:[z.title," (",z.count,")"]},z.key))]})]}),s.jsxs(mt,{value:i.label??Rr,onValueChange:z=>k({label:z===Rr?null:z}),children:[s.jsx(ct,{className:"w-48","aria-label":"Label",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:Rr,children:"All labels"}),E.facets.labels.map(z=>s.jsxs(ke,{value:z.label,children:[z.label," (",z.count,")"]},z.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(H,{type:"button",variant:"outline",size:"sm",className:al,"aria-pressed":i.urgent,onClick:()=>k({urgent:!i.urgent}),children:["Urgent ",E.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"}),lk.map(z=>{const $=i.seen.includes(z.key);return s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:al,"aria-pressed":$,onClick:()=>k({seen:$?i.seen.filter(ee=>ee!==z.key):[...i.seen,z.key]}),children:[z.label," ",E.facets.seen[z.key]]},z.key)}),se!==null?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsxs("span",{"data-testid":"issues-collection-chip",className:ne(Ku({variant:"outline",size:"sm"}),pA),children:["Collection ",se]}),s.jsx(H,{type:"button",variant:"ghost",size:"sm-icon","aria-label":"Remove the collection filter",onClick:()=>{var z;k({collection:null}),(z=x.current)==null||z.focus()},children:s.jsx(ix,{className:"size-4","aria-hidden":"true"})})]}):null]})]}),s.jsx("div",{role:"status","aria-live":"polite",children:C?s.jsxs("p",{className:"text-muted-foreground mt-3 flex items-center gap-2 text-sm",children:[s.jsx(vn,{"aria-hidden":"true"}),"Searching…"]}):c&&R.total>0?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:[R.total," of ",E.listed," issues ·"," ",s.jsx(H,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:S,children:"Clear"})]}):null}),s.jsx("div",{"data-testid":"issues-results","aria-busy":C||void 0,className:"shrink-0 transition-opacity aria-busy:opacity-50",children:U&&R.total===0?s.jsxs("p",{className:"mt-6 flex items-center gap-2 text-sm",children:[s.jsx(qu,{className:"text-muted-foreground size-4","aria-hidden":"true"}),"No issues match."," ",s.jsx(H,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:S,children:"Clear"})]}):E.groups.map(z=>s.jsx(e3,{id:`issues-${z.key}`,title:`${z.label} · ${z.count}`,issues:W.get(z.key)??[],folder:X,link:$=>s.jsx(l,{className:"text-primary hover:underline",href:r(Y($.id)),children:$.title})},z.key))}),!c&&E.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 · ",E.collections.length]}),s.jsx(yt,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Collections",className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{className:"w-1/2",children:"Collection"}),s.jsx(P,{className:"w-1/4",children:"Resolved"}),s.jsx(P,{className:"w-1/4",children:"Updated"})]})}),s.jsx(Be,{children:E.collections.map(z=>s.jsxs(ie,{children:[s.jsxs(I,{children:[s.jsx(l,{className:"text-primary hover:underline",href:r(G(Xr({...Qh,collection:z.collection}))),children:z.title}),s.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:z.collection})]}),s.jsxs(I,{children:[z.resolved," of ",z.total," resolved"]}),s.jsx(I,{className:"text-muted-foreground",children:_i(z.updated_at)})]},z.collection))})]})})]}):null]})]})}const jf=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 e3({id:e,title:t,issues:n,folder:a,link:r}){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(yt,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:t,className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{className:a?"w-[30%]":"w-[36%]",children:"Title"}),s.jsx(P,{className:"w-[10%]",children:"Issue"}),a?s.jsx(P,{className:"w-[12%]",children:"Project"}):null,s.jsx(P,{className:"w-[16%]",children:"Status"}),s.jsx(P,{className:"w-[8%]",children:"Urgent"}),s.jsx(P,{className:a?"w-[14%]":"w-[18%]",children:"Owner"}),s.jsx(P,{className:"w-[12%]",children:"Updated"})]})}),s.jsx(Be,{children:n.map(l=>{var o;const i=ik(l);return s.jsxs(ie,{"data-testid":"issues-row",children:[s.jsxs(I,{className:"break-words",children:[r(l),(o=l.labels)!=null&&o.length?s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:l.labels.map(c=>s.jsx(de,{variant:"neutral",size:"dense",children:c},c))}):null]}),s.jsx(I,{className:"font-mono text-xs",children:l.id}),a?s.jsx(I,{className:"break-words",children:l.project_id??"Folder"}):null,s.jsx(I,{children:s.jsx(de,{variant:i.tone,children:i.label})}),s.jsx(I,{children:l.urgent&&l.status!=="resolved"&&l.group!=="resolved"?s.jsx(de,{variant:"warning",children:"Urgent"}):null}),s.jsx(I,{className:"break-words",children:l.owner_title?l.owner_title:s.jsx("span",{className:"text-muted-foreground",children:"Unowned"})}),s.jsx(I,{className:"text-muted-foreground",children:_i(l.updated_at)})]},l.id)})})]})})]})}function t3(e){var t;return(t=nn().issues)!=null&&t.issueSections?s.jsx(J$,{...e}):s.jsx(S$,{org:e.org,project:e.project,query:e.query})}function n3({update:e,issue:t,open:n,onOpenChange:a,onDone:r,onReload:l}){const[i,o]=u.useState(t.title),[c,d]=u.useState(t.description),[f,h]=u.useState(t.external_reference??""),[m,g]=u.useState(t),[j,v]=u.useState(null),[y,x]=u.useState(!1);u.useEffect(()=>{n&&(o(t.title),d(t.description),h(t.external_reference??""),g(t),v(null))},[n]);const p=_=>{var k;return((k=j==null?void 0:j.personal_data)==null?void 0:k.field)===_?j.message:void 0},b=async _=>{_.preventDefault(),x(!0);const k=await e(m.id,m.revision,{title:i,description:c,external_reference:f.trim()||null});if(x(!1),!k.ok){v(k.refusal);return}r(k.data.issue)},w=async()=>{const _=await l();_&&(g(_),v(null))};return s.jsx(Ys,{open:n,onOpenChange:a,children:s.jsx(Fs,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:b,className:"grid gap-4",children:[s.jsxs(Xs,{children:[s.jsx(Qs,{children:"Edit issue"}),s.jsx(Ws,{children:"Text is shown exactly as entered."})]}),j!=null&&j.conflict?s.jsxs(le,{variant:"destructive",children:[s.jsx(nt,{}),s.jsx(ae,{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(Oe,{htmlFor:"maintain-edit-title",children:"Title"}),s.jsx(At,{id:"maintain-edit-title",value:i,"aria-invalid":!!p("title"),onChange:_=>o(_.target.value)}),p("title")?s.jsx(Gn,{children:p("title")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"maintain-edit-description",children:"Description"}),s.jsx(es,{id:"maintain-edit-description",rows:4,value:c,"aria-invalid":!!p("description"),onChange:_=>d(_.target.value)}),p("description")?s.jsx(Gn,{children:p("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"maintain-edit-reference",children:"External reference"}),s.jsx(At,{id:"maintain-edit-reference",value:f,"aria-invalid":!!p("external_reference"),onChange:_=>h(_.target.value)}),p("external_reference")?s.jsx(Gn,{children:p("external_reference")}):null]}),j&&!j.conflict&&!j.personal_data?s.jsx(Gn,{children:j.message}):null,s.jsxs(Ks,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),j!=null&&j.conflict?s.jsxs(H,{type:"button",variant:"outline",onClick:w,children:[s.jsx(gr,{className:"mr-2 size-4"}),"Reload latest"]}):null,s.jsx(H,{type:"submit",loading:y,disabled:!!(j!=null&&j.conflict),children:"Save"})]})]})})})}function Nv(e){return e.map(t=>tk[t].toLowerCase()).join(", ")}function s3(e){switch(e.kind){case"created":return"Logged the issue";case"updated":return`Edited the ${Nv(e.fields)}`;case"redacted":return`Redacted the ${Nv(e.fields)}`;case"priority_set":return e.priority?`Set priority to ${Yi[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?mu[e.to_status]:"";return e.resolution_reason?`Moved to ${t}: ${Xx[e.resolution_reason]}`:`Moved to ${t}`}}}function _v(e,t){return t==="external_reference"?e.external_reference??"":e[t]}function a3({redact:e,issue:t,open:n,onOpenChange:a,onDone:r,onReload:l}){const[i,o]=u.useState("description"),[c,d]=u.useState(""),[f,h]=u.useState(!1),[m,g]=u.useState(null),[j,v]=u.useState(t);u.useEffect(()=>{n&&(v(t),d(_v(t,i)),g(null))},[n]);const y=async x=>{x.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 l();b&&v(b),g("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}g(p.refusal.message);return}r(p.data.issue)};return s.jsx(Ys,{open:n,onOpenChange:a,children:s.jsx(Fs,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:y,className:"grid gap-4",children:[s.jsxs(Xs,{children:[s.jsx(Qs,{children:"Redact text"}),s.jsx(Ws,{children:"Replace text that holds personal data, such as a name."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"maintain-redact-field",children:"Field"}),s.jsxs(mt,{value:i,onValueChange:x=>{const p=x;o(p),d(_v(j,p))},children:[s.jsx(ct,{id:"maintain-redact-field",children:s.jsx(xt,{})}),s.jsx(ut,{children:p$.map(x=>s.jsx(ke,{value:x,children:tk[x]},x))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"maintain-redact-replacement",children:"Replacement text"}),s.jsx(es,{id:"maintain-redact-replacement",rows:4,value:c,onChange:x=>d(x.target.value)})]}),s.jsxs(le,{variant:"warning",children:[s.jsx(Vt,{}),s.jsx(ae,{children:"This cannot be undone: the original text is removed for good. History records only that this field was redacted."})]}),m?s.jsx(Gn,{children:m}):null,s.jsxs(Ks,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(H,{type:"submit",variant:"destructive",loading:f,children:"Redact"})]})]})})})}function r3({transition:e,issue:t,open:n,onOpenChange:a,onDone:r}){const[l,i]=u.useState("fixed"),[o,c]=u.useState(!1),[d,f]=u.useState(null),h=async m=>{m.preventDefault(),c(!0);const g=await e(t.id,t.revision,"resolved",l);if(c(!1),!g.ok){if(g.refusal.conflict){r(null);return}f(g.refusal.message);return}f(null),r(g.data.issue)};return s.jsx(Ys,{open:n,onOpenChange:a,children:s.jsx(Fs,{children:s.jsxs("form",{onSubmit:h,className:"grid gap-4",children:[s.jsxs(Xs,{children:[s.jsx(Qs,{children:"Resolve issue"}),s.jsx(Ws,{children:"Choose how this report ended."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:"maintain-resolution-reason",children:"Resolution reason *"}),s.jsxs(mt,{value:l,onValueChange:m=>i(m),children:[s.jsx(ct,{id:"maintain-resolution-reason",children:s.jsx(xt,{})}),s.jsx(ut,{children:x$.map(m=>s.jsx(ke,{value:m,children:Xx[m]},m))})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Reopening the issue clears its reason."})]}),d?s.jsx(Gn,{children:d}):null,s.jsxs(Ks,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(H,{type:"submit",loading:o,children:"Resolve"})]})]})})})}const Er="not_set";function l3({org:e,project:t,issue_id:n,query:a}){const r=nk(),l=sk(r),i=Xh(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(ak,{access:l,header:s.jsx(Xt,{title:"Support"}),back_href:i,children:o=>r?s.jsx(i3,{contract:r,issue_id:n,access:o,list_href:i,duplicates:Number(new URLSearchParams(a).get("duplicates")??0)}):null})})}function i3({contract:e,issue_id:t,access:n,list_href:a,duplicates:r}){const{href:l,Link:i}=Xe(),o=Al(),[c,d]=u.useState(null),[f,h]=u.useState([]),[m,g]=u.useState(!1),[j,v]=u.useState([]),[y,x]=u.useState(null),p=u.useCallback(async()=>{const N=await e.issue(t);return N.ok?(d(N.data.issue),h(N.data.events),N.data.issue):(N.refusal.status===404?g(!0):o.error(N.refusal.message),null)},[e,t,o]);u.useEffect(()=>{let N=!1;return e.issue(t).then(S=>{if(!N){if(!S.ok){S.refusal.status===404?g(!0):o.error(S.refusal.message);return}d(S.data.issue),h(S.data.events)}}),()=>{N=!0}},[e,t]),u.useEffect(()=>{n.can_change&&e.assigneeCandidates().then(N=>{N.ok&&v(N.data.candidates)})},[e,n.can_change]);const b=async N=>{const S=await N;if(!S.ok){o.error(S.refusal.message),S.refusal.conflict&&await p();return}await p()};if(m)return s.jsx(Zs,{title:"Support issue not found",description:"This issue does not exist in this project.",backHref:l(a),backLabel:"Back to Support",link:i});if(!c)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"});const w=c.status==="closed",_=n.can_change,k=N=>b(e.transition(c.id,c.revision,N));return s.jsxs(s.Fragment,{children:[s.jsx(Xt,{title:c.title,actions:_?s.jsxs(s.Fragment,{children:[w?null:s.jsxs(H,{variant:"outline",onClick:()=>x("edit"),children:[s.jsx(rx,{className:"mr-2 size-4"}),"Edit"]}),s.jsxs(H,{variant:"outline",onClick:()=>x("redact"),children:[s.jsx(nT,{className:"mr-2 size-4"}),"Redact"]}),c.status==="open"?s.jsx(H,{variant:"outline",disabled:!c.priority,"aria-description":c.priority?void 0:"Set a priority first.",onClick:()=>void k("triaged"),children:"Triage"}):null,c.status==="open"||c.status==="triaged"?s.jsxs(H,{onClick:()=>x("resolve"),children:[s.jsx(Pu,{className:"mr-2 size-4"}),"Resolve"]}):null,c.status==="resolved"?s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"outline",onClick:()=>void k("open"),children:[s.jsx(qT,{className:"mr-2 size-4"}),"Reopen"]}),s.jsx(H,{onClick:()=>void k("closed"),children:"Close"})]}):null]}):void 0,children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(de,{variant:ek[c.status],children:mu[c.status]}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Logged by ",y$(c)," ",bc(c.created_at)]})]})}),s.jsxs("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-6",children:[r>0&&c.external_reference?s.jsxs(le,{variant:"info",children:[s.jsx(en,{}),s.jsxs(ae,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[s.jsxs("span",{children:[c.external_reference," is already logged on"," ",r===1?"another issue":`${r} other issues`," in this project."]}),s.jsx(H,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(i,{href:l(`${a}?external_reference=${encodeURIComponent(c.external_reference)}`),children:"Show both"})})]})]}):null,s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Description"}),c.description?s.jsx("p",{className:"text-sm break-words whitespace-pre-wrap",children:c.description}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"No description."})]}),s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"History"}),s.jsx("div",{className:"rounded-md border",children:s.jsxs(Ue,{children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"When"}),s.jsx(P,{children:"Who"}),s.jsx(P,{children:"What"})]})}),s.jsx(Be,{children:f.map(N=>s.jsxs(ie,{children:[s.jsx(I,{className:"text-muted-foreground",children:bc(N.created_at)}),s.jsx(I,{children:b$(N,c)}),s.jsx(I,{children:s3(N)})]},N.id))})]})})]})]}),s.jsxs("aside",{className:"flex w-full shrink-0 flex-col gap-5 lg:w-72",children:[s.jsx(Wl,{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(Wl,{label:"Resolution",children:s.jsx("span",{className:"text-sm",children:Xx[c.resolution_reason]})}):null,s.jsx(Wl,{label:"Priority",id:"maintain-issue-priority",children:s.jsxs(mt,{value:c.priority??Er,disabled:!_||w,onValueChange:N=>void b(e.update(c.id,c.revision,{priority:N===Er?null:N})),children:[s.jsx(ct,{id:"maintain-issue-priority",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:Er,children:"Not set"}),Fx.map(N=>s.jsx(ke,{value:N,children:Yi[N]},N))]})]})}),s.jsxs(Wl,{label:"Assignee",id:"maintain-issue-assignee",children:[s.jsxs(mt,{value:c.assignee_id??Er,disabled:!_||w,onValueChange:N=>void b(e.assign(c.id,c.revision,N===Er?null:N)),children:[s.jsx(ct,{id:"maintain-issue-assignee",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:Er,children:"Not set"}),c.assignee_id&&!j.some(N=>N.user_id===c.assignee_id)?s.jsx(ke,{value:c.assignee_id,children:Kx(c.assignee_id,c.assignee_username)}):null,j.map(N=>s.jsx(ke,{value:N.user_id,children:N.username??"Not available"},N.user_id))]})]}),c.assignee_can_act===!1?s.jsx(de,{variant:"error",className:"self-start",children:"Assignee cannot act"}):null]}),s.jsx(Wl,{label:"Updated",children:s.jsx("span",{className:"text-sm",children:bc(c.updated_at)})})]})]}),s.jsx(n3,{update:e.update,issue:c,open:y==="edit",onOpenChange:N=>x(N?"edit":null),onReload:p,onDone:()=>{x(null),p()}}),s.jsx(a3,{redact:e.redact,issue:c,open:y==="redact",onOpenChange:N=>x(N?"redact":null),onReload:p,onDone:()=>{x(null),o.success("The text was redacted."),p()}}),s.jsx(r3,{transition:e.transition,issue:c,open:y==="resolve",onOpenChange:N=>x(N?"resolve":null),onDone:N=>{x(null),N||o.error("Someone else changed this issue; it is reloaded."),p()}})]})}function Wl({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 o3=10,c3=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,kv=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;function u3(e,t,n,a=""){const r=n!=null&&n.startsWith("task:")?n.slice(5):null;if(r&&c3.test(r))return{label:r,path:`/org/${e}/tasks/${r}`};const l=`/proj/${encodeURIComponent(t)}/releases`,i=n!=null&&n.startsWith("release:")?n.slice(8):null;if(i&&kv.test(i))return{label:i==="candidate"?"Candidate":i,path:`${l}?release=${encodeURIComponent(i)}`};const o=n!=null&&n.startsWith("planned:")?n.slice(8):null;if(o&&kv.test(o))return{label:o,path:`${l}?planned=${encodeURIComponent(o)}`};const c=Xr(jc(a));return{label:"Issues",path:`/proj/${encodeURIComponent(t)}/issues${c?`?${c}`:""}`}}const d3=["Fixed in","Being fixed in","The release planned to fix it"];function f3(e){const t=e.filter(n=>n.kind==="release");for(const n of d3){const a=t.find(r=>r.relation===n);if(a)return a}return t[0]??null}function h3({org:e,project:t,issue_id:n,from:a,query:r=""}){var fe;const l=hk(),{href:i,Link:o}=Xe(),c=u3(e,t,a,r),d=`/proj/${encodeURIComponent(t)}/issues`,f=V=>`${d}/${encodeURIComponent(V)}`,[h,m]=u.useState({state:"loading"}),[g,j]=u.useState(null),[v,y]=u.useState(null),[x,p]=u.useState({state:"loading"}),[b,w]=u.useState({state:"loading"}),_=u.useRef(null),k=u.useRef(null),N=u.useRef(!1),S=u.useRef(0),A=u.useRef(0),D=u.useCallback(async()=>{if(!l.issueSections)return;p({state:"loading"});const V=await l.issueSections(n);p(V.ok?{state:"ok",data:V.data}:{state:"failed",refusal:V.refusal})},[l.issueSections,n]),G=u.useCallback(async()=>{if(!l.issueRelated)return;w({state:"loading"});const V=await l.issueRelated(n);w(V.ok?{state:"ok",data:V.data}:{state:"failed",refusal:V.refusal})},[l.issueRelated,n]),Y=u.useCallback(async()=>{const V=A.current+=1;if(y(null),!B$.test(n)){m({state:"missing"});return}D(),G();const ve=await l.issue(n);if(V!==A.current)return;if(ve.ok){S.current=0,j(null),m({state:"ok",issue:ve.data.issue,events:ve.data.events,at:new Date().toISOString()});return}const Me=ve.refusal.reason;if(ve.refusal.status===404||Me==="not_found")return m({state:"missing"});if(Me==="engine_missing")return m({state:"engine_missing",refusal:ve.refusal});if(Me==="view_outdated")return m({state:"view_outdated"});if(S.current+=1,S.current===1&&Z_(ve.refusal)){y(ve.refusal.retry_after??o3);return}j(ve.refusal)},[l.issue,n,D,G]);u.useEffect(()=>{Y()},[Y]),u.useEffect(()=>{if(v===null)return;const V=setTimeout(()=>void Y(),v*1e3);return()=>clearTimeout(V)},[v,Y]),u.useEffect(()=>{var ve;if(N.current||h.state!=="ok")return;N.current=!0;const V=(ve=_.current)==null?void 0:ve.querySelector("h1");V&&(V.tabIndex=-1,V.focus())},[h.state]);const T=u.useRef(null);u.useEffect(()=>{var Me;const V=T.current;if(V===null||(V==="sections"?x:b).state==="loading")return;T.current=null;const ve=(V==="related"?k.current:null)??((Me=_.current)==null?void 0:Me.querySelector("h1"));ve==null||ve.focus()},[x,b]);const B=V=>{T.current=V,V==="sections"?D():G()},F=()=>{S.current=0,Y()},R=u.useRef(!1),E=()=>{R.current=!0,F()};if(u.useEffect(()=>{var ve;if(!R.current||h.state==="loading"||v!==null)return;R.current=!1;const V=(ve=_.current)==null?void 0:ve.querySelector("h1");V&&(V.tabIndex=-1,V.focus())},[h,g,v]),h.state==="missing")return s.jsx(ba,{children:s.jsx(Zs,{icon:s.jsx(qu,{"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 C=s.jsx(H,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(o,{href:i(c.path),children:[s.jsx(nx,{className:"size-4","aria-hidden":"true"}),c.label]})});if(h.state==="engine_missing"||h.state==="view_outdated")return s.jsxs(ba,{children:[s.jsx(hu,{back:C,id:null,title:n}),h.state==="engine_missing"?s.jsxs(le,{variant:"info",className:"mt-4",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:uk}),s.jsx(ae,{children:h.refusal.message})]}):s.jsxs(le,{variant:"warning",className:"mt-4",children:[s.jsx(Vt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:ok}),s.jsx(ae,{children:ck})]})]});const U=g?s.jsxs(le,{variant:"destructive",className:"mt-4",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This issue could not be loaded"}),s.jsxs(ae,{children:[s.jsxs("p",{children:[g.message,g.since?` Since ${Fn(g.since)}.`:"",h.state==="ok"?` This page was read at ${Fn(h.at)}.`:"",g.message.includes(fr)?"":` ${fr}`]}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:E,children:"Retry"})]})]}):null,X=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(vn,{"aria-hidden":"true"}),"This issue is busy. Reading it again…"]}):null});if(h.state==="loading")return s.jsxs(ba,{children:[s.jsx("div",{children:C}),X,U,!g&&v===null?s.jsxs("div",{className:"mt-4 grid gap-3",role:"status","aria-label":"Loading issue",children:[s.jsx(st,{className:"h-6 w-40"}),s.jsx(st,{className:"h-9 w-2/3"}),s.jsx(st,{className:"h-24 w-full"})]}):null]});const{issue:M,events:Q,at:se}=h,W=ik(M),K=x.state==="ok"?x.data:null,z=(K==null?void 0:K.reporter)??M.created_by_username??null,$=b.state==="ok"?f3(b.data):null,ee=M.status==="resolved"||M.group==="resolved",pe=!!(K!=null&&K.duplicate_of),je=x.state==="loading"?"Loading…":(K==null?void 0:K.routing.owner)??M.owner_title??s.jsx("span",{className:"text-muted-foreground",children:"Unowned"}),Ne=V=>`${d}?${Xr({...Qh,collection:V})}`,Z=K==null?void 0:K.report,me=!!(Z&&(Z.actual||Z.expected||Z.steps.length||Z.where)),ue=[...Q].reverse(),Ie=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 ",Fn(se)]}),s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:F,children:[s.jsx(gr,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsx(ba,{children:s.jsxs("div",{ref:_,className:"contents",children:[s.jsx(hu,{back:C,id:M.id,badge:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:W.tone,children:W.label}),M.urgent&&!ee?s.jsx(de,{variant:"warning",children:"Urgent"}):null]}),title:M.title,created:`Reported${z?` by ${z}`:""} · ${_i(M.created_at)}`,actions:Ie}),K!=null&&K.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(K.duplicate_of)),children:K.duplicate_of})]}):null,X,U,x.state==="loading"?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",role:"status",children:[s.jsx(vn,{"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(os,{label:"Owner",value:je}),pe?null:s.jsx(os,{label:"Release",value:b.state==="loading"?"Loading…":$?s.jsx("span",{className:ne($.label===$.id&&"font-mono"),children:$.label}):s.jsx("span",{className:"text-muted-foreground",children:"No release yet"})}),s.jsx(os,{label:"Reported",value:[z,M.created_at?An(M.created_at):null].filter(Boolean).join(" · ")})]}),s.jsxs(le,{variant:"info",className:"mt-4",children:[s.jsx(ho,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:dk}),s.jsx(ae,{children:fk})]}),x.state==="failed"?s.jsx("div",{className:"mt-6",children:s.jsx(Yx,{what:"this issue's sections",again:"Read the issue again",refusal:x.refusal,on_retry:()=>B("sections")})}):null,K&&me&&Z?s.jsxs(gt,{id:"issue-report",title:"What happens",children:[Z.actual?s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:Z.actual}):null,Z.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:Z.expected})]}):null,Z.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:Z.steps.map((V,ve)=>s.jsx("li",{children:V},ve))})]}):null,(fe=Z.where)!=null&&fe.env?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:["Seen on ",Z.where.env,Z.where.sha?s.jsxs(s.Fragment,{children:[" ","at ",s.jsx("span",{className:"font-mono",children:Z.where.sha})]}):null]}):null]}):null,K&&(K.placement.placed||K.placement.unplaced_why)?s.jsx(gt,{id:"issue-placement",title:"Placement",children:K.placement.placed?s.jsxs("p",{className:"text-sm",children:["Placed in ",K.placement.placed]}):s.jsxs(le,{variant:"warning",children:[s.jsx(Vt,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Not placed yet: ",K.placement.unplaced_why]})]})}):null,K&&(K.routing.route||K.routing.owner||K.routing.none)?s.jsxs(gt,{id:"issue-routing",title:"Routing",children:[K.routing.route?s.jsx("p",{className:"text-sm",children:K.routing.route}):null,K.routing.owner?s.jsxs("p",{className:"text-sm",children:["Owner: ",K.routing.owner]}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"Owner: none yet"})]}):null,K&&(K.labels.length>0||K.collections.length>0)?s.jsxs(gt,{id:"issue-labels",title:"Labels and collections",children:[K.labels.length?s.jsx("div",{className:"flex flex-wrap gap-1",children:K.labels.map(V=>s.jsx(de,{variant:"neutral",size:"dense",children:V},V))}):null,K.collections.length?s.jsx("ul",{className:"mt-2 grid gap-1 text-sm",children:K.collections.map(V=>s.jsxs("li",{children:[s.jsx(o,{className:"text-primary hover:underline",href:i(Ne(V.collection)),children:V.title}),V.ref?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",V.ref]}):null,s.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",V.resolved," of ",V.total," resolved"]})]},V.collection))}):null]}):null,K&&K.anchors.length>0?s.jsx(gt,{id:"issue-anchors",title:"Anchors",children:s.jsx(wf,{label:"Anchors",heads:["Kind","Value","By"],rows:K.anchors.map(V=>[V.kind,s.jsx("span",{className:"font-mono text-xs break-all",children:V.value}),V.by??""])})}):null,K&&K.seen.length>0?s.jsx(gt,{id:"issue-seen",title:"Seen",aside:`${K.seen.length} of ${Math.max(M.occurrences??0,K.seen.length)} sightings`,children:s.jsx(wf,{label:"Seen",heads:["When","Where","Who","Note"],rows:K.seen.map(V=>[_i(V.at),s.jsxs(s.Fragment,{children:[V.sha?s.jsx("div",{className:"font-mono text-xs",children:V.sha}):null,V.env?s.jsx("div",{className:"text-muted-foreground text-xs",children:V.env}):null]}),V.who??"",V.note??""])})}):null,ue.length>0?s.jsx(gt,{id:"issue-history",title:"History",aside:"From the issue store, newest first",children:s.jsx(wf,{label:"History",heads:["When","Who","What"],rows:ue.map(V=>[_i(V.created_at),V.actor_username??"",Y$(V.note,V.kind)])})}):null,s.jsx(J_,{id:"issue-related",related:b,heading_ref:k,on_retry:()=>B("related"),fixed:!0,link:V=>{const ve=V.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(V.id)}`:V.kind==="task"?`/org/${e}/tasks/${encodeURIComponent(V.id)}?from=issue:${M.id}`:V.kind==="issue"?f(V.id):V.kind==="release"?`/proj/${encodeURIComponent(t)}/releases?${V.planned?"planned":"release"}=${encodeURIComponent(V.id)}`:null;if(V.kind==="task"&&ve){const Me=F$(V.label);return s.jsxs("div",{className:"min-w-0",children:[s.jsx(o,{className:"text-primary font-mono text-xs hover:underline",href:i(ve),children:V.id}),Me&&Me!==V.id?s.jsx("div",{className:"text-muted-foreground line-clamp-1 text-xs",title:Me,"data-testid":"related-task-title",children:Me}):null]})}return ve?s.jsx(o,{className:ne("text-primary hover:underline",V.kind!=="thread"&&V.label===V.id&&"font-mono"),href:i(ve),children:V.label}):V.label}})]})})}function wf({label:e,heads:t,rows:n}){return s.jsx(yt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:e,children:[s.jsx(Ge,{children:s.jsx(ie,{children:t.map(a=>s.jsx(P,{children:a},a))})}),s.jsx(Be,{children:n.map((a,r)=>s.jsx(ie,{children:a.map((l,i)=>s.jsx(I,{className:"break-words",children:l},i))},r))})]})})}function m3({org:e,project:t,issue_id:n,from:a,query:r}){var l;return(l=nn().issues)!=null&&l.issueSections?s.jsx(h3,{org:e,project:t,issue_id:n,from:a,query:r}):s.jsx(l3,{org:e,project:t,issue_id:n,query:r})}function pu(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 mk={integration:"Integration",deploy:"Deploy",publish:"Publish",accept:"Accept",custom:"Custom"},x3={self_service:"Self-service",managed:"Managed",manager_only:"Manager only"},p3={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"},g3={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 v3(e){return g3[e??"in_batch"]}function y3(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 xk=(e,t)=>`Holds ${e.toLowerCase()}${t?`: ${t}`:""}`;function b3(e,t,n,a=!0){return e.fixing_since!==void 0?{label:`Fixing forward since ${qn(e.fixing_since)}`,tone:"warning"}:e.ref===t?{label:"Landing",tone:"info"}:a&&e.hold?{label:xk(n),tone:"info"}:{label:"Running",tone:"info"}}function qn(e){return new Date(e*1e3).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ar(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 j3(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 w3(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 N3(e,t){var o,c;const{policy:n,management:a}=e,r=(o=e.layer)==null?void 0:o.kind,l=d=>w3(d,t),i=[["Mode",p3[a.mode]],["Who can join",l(a.joiners)]];return r==="implement"&&i.push(["Managers",l(a.managers)],["Manager lease",Ar(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 ${Ar(n.freeze.max_seconds)}, ${Ar(n.freeze.default_seconds)} by default`+(e.layer.freezers?` · ${l(e.layer.freezers)}`:""):"Off"],["Fix forward",n.fix_forward?"Yes: a failed turn keeps its turn until fixed":"No"],["Stalled turns",a.stall_takers.kind==="none"?"Nobody takes one":`${l(a.stall_takers)} may take one after ${Ar(n.stall_seconds)}`])),i.push(["Reorder",l(a.reorderers)]),n.max_turns>1&&i.push(["Turns at once",`Up to ${n.max_turns} independent turns`]),i.push(["Turn lease",Ar(n.lease_seconds)],["Time to start",`${Ar(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 pk="Where your organization's agents take turns at a shared branch, environment or proposal. One turn runs at a time in each queue.",gk="A task you cannot see",_3="A former member",k3="A member";function vk(){const e=nn().queues;if(!e)throw new Error("The Queues page rendered without the queues seam.");return e}function S3({org:e,open:t,path:n}){var h;const a=vk(),{href:r,Link:l}=Xe(),i=a.availability,[o,c]=u.useState({state:"loading"}),d=u.useCallback(async m=>{i&&(m&&c({state:"loading"}),c(await i({fresh:m})))},[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(Zs,{title:"Page not found",description:"This page does not exist, or you do not have access to it.",backHref:r(`/org/${e}`),backLabel:"Back to the organization",link:l}):s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:f?s.jsx(T3,{org:e,open:t??null,path:n??`/org/${e}/tasks/queues`}):s.jsxs(s.Fragment,{children:[s.jsx(Xt,{title:"Queues",description:a.description??pk}),o.state==="loading"&&s.jsx(yk,{}),(o.state==="error"||o.state==="off")&&s.jsx(Wh,{refusal:o.refusal,on_retry:()=>void d(!0)}),o.state==="available"&&s.jsxs(le,{variant:"info",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Tasks are not on for this organization"}),s.jsxs(ae,{children:["Queues hold turns for tasks, so they show once Tasks are on."," ",s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks`),children:"Go to Tasks"})]})]})]})})}function yk(){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(st,{className:t===2?"h-10 w-2/3":"h-10 w-full"},t))})}function Wh({refusal:e,on_retry:t}){return(e==null?void 0:e.reason)==="store_locked"?s.jsxs(le,{variant:"info",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"The local stores are busy"}),s.jsxs(ae,{children:[s.jsx("p",{children:e.message}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]}):(e==null?void 0:e.reason)==="engine_missing"||(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(le,{variant:e.reason==="engine_missing"?"info":"destructive",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:e.reason==="engine_missing"?"Queues need the sdlc engine":"The sdlc engine here is too old for this page"}),s.jsx(ae,{children:e.message})]}):s.jsxs(le,{variant:"destructive",className:"mt-6",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Queues could not be loaded"}),s.jsxs(ae,{children:[s.jsx("p",{children:"The read did not answer. Try again in a moment."}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}const Nf=e=>e.status===404||e.reason==="not_found"||e.code==="not_found";function C3(e,t,n,a){return t?e===null?`Not reading · trying again every ${n}s`:`Not reading since ${qn(e)} · trying again every ${n}s`:e===null?"Connecting…":`Live · read ${qn(e)} · refreshes every ${n}s${a?` · ${a}`:""}`}function T3({org:e,open:t,path:n}){var K;const{listQueues:a,queue:r,members:l,refresh_ms:i,settings_note:o,description:c,read_scope:d,subject_label:f="Task",thread_subjects:h=!1}=vk(),{self_id:m}=Iu(),[g,j]=u.useState(null),[v,y]=u.useState(null),[x,p]=u.useState(null),[b,w]=u.useState(null),[_,k]=u.useState({state:"pending",members:[]});u.useEffect(()=>{let z=!0;return l().then($=>{z&&k(ee=>$.ok?{state:"answered",members:$.data}:{state:"failed",members:ee.members})}),()=>{z=!1}},[l]);const N=u.useMemo(()=>new Map(_.members.map(z=>[z.user_id,z])),[_.members]),S=_.state==="answered"?_3:k3,A=u.useCallback((z,$)=>{var ee;return($==null?void 0:$.title)??(h?($==null?void 0:$.id)??z:z===m?"You":((ee=N.get(z))==null?void 0:ee.label)??S)},[N,S,m,h]),D=u.useRef({list:{last:null,fresh:!1},detail:{last:null,fresh:!1}}),[G,Y]=u.useState(null),[T,B]=u.useState(!1),F=u.useCallback((z,$)=>{D.current[z]={last:$,fresh:!0};const{list:ee,detail:pe}=D.current;B(ee.last==="failed"||pe.last==="failed"),ee.fresh&&pe.fresh&&ee.last==="ok"&&pe.last==="ok"&&Y(Date.now()/1e3)},[]),R=t??((K=g==null?void 0:g.queues[0])==null?void 0:K.id)??null,E=u.useRef(R);u.useEffect(()=>{E.current=R},[R]);const C=u.useRef(0),U=u.useCallback(async()=>{var ee;const z=C.current+=1;D.current.list.fresh=!1;const $=await a();if(z===C.current)if($.ok){if(j($.data),y(null),!t){const pe=((ee=$.data.queues[0])==null?void 0:ee.id)??null;pe===null?D.current.detail={last:"ok",fresh:!0}:pe!==E.current&&(D.current.detail.fresh=!1)}F("list","ok")}else y($.refusal),F("list","failed")},[a,t,F]),X=u.useRef(0),M=u.useCallback(async()=>{const z=X.current+=1;if(!R)return;D.current.detail.fresh=!1;const $=await r(R);z===X.current&&($.ok?(p($.data),w(null),F("detail","ok")):(w($.refusal),Nf($.refusal)&&p(null),F("detail",Nf($.refusal)?"ok":"failed")))},[R,r,F]);u.useEffect(()=>{U()},[U]),u.useEffect(()=>{p(null),w(null),M()},[M]);const Q=u.useCallback(()=>{U(),M()},[U,M]);pu(Q,i);const se=Math.round(i/1e3),W=b!==null&&Nf(b);return s.jsxs(s.Fragment,{children:[s.jsxs(Xt,{title:"Queues",description:c??pk,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:C3(G,T,se,d)}),s.jsx("span",{className:"sr-only",role:"status",children:T?"Not reading":G===null?"Connecting":"Live"})]}),!g&&!v&&s.jsx(yk,{}),!g&&v&&s.jsx(Wh,{refusal:v,on_retry:Q}),g&&g.queues.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(i0,{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."})]}):g?s.jsxs(s.Fragment,{children:[s.jsx(E3,{path:n,queues:g.queues,open_id:R,name:A,held:h}),W?s.jsxs(le,{variant:"info",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This queue is no longer available"}),s.jsx(ae,{children:"It was archived, or you can no longer read its Workspace. Pick another queue above."})]}):x&&x.queue.id===R?s.jsx(A3,{org:e,detail:x,name:A,settings_note:o,subject_label:f,thread_subjects:h}):b?s.jsx(Wh,{refusal:b,on_retry:()=>void M()}):s.jsx(st,{className:"mt-6 h-40 w-full shrink-0",role:"status","aria-label":"Loading the queue"})]}):null]})}function Zh({org:e,subject:t,link:n}){const{href:a,Link:r}=Xe();return!t||t.hidden?s.jsx("span",{className:"text-muted-foreground",children:gk}):t.kind==="task"&&n?s.jsx(r,{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 R3(e,t,n){const a=e.freeze?`frozen until ${qn(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 ${qn(e.batch.opened_at)}`,a].filter(Boolean).join(" · "),warn:!1};if(e.turn){const r=e.turn.subject,l=r.hidden?gk:r.title??r.id,i=(e.running_count??1)>1?`${e.running_count} turns · `:"",o=e.turn.landing?" landing":"",c=n&&!!e.turn.hold,d=[c?xk(e.name,e.turn.note):null,e.turn.fixing_since!==void 0?"Fixing forward":null,a].filter(Boolean);return c&&e.turn.fixing_since===void 0&&!a?{primary:`${i}${l}${o}`,secondary:_f(d.join(" · ")),warn:!1}:{primary:`${i}${l}${o}`,secondary:d.length?_f(d.join(" · ")):null,warn:d.length>0}}return{primary:"Nothing running",secondary:a?_f(a):null,warn:!!a}}const _f=e=>e.charAt(0).toUpperCase()+e.slice(1);function E3({path:e,queues:t,open_id:n,name:a,held:r}){const{href:l,Link:i}=Xe();return s.jsx(yt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Queues",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Queue"}),s.jsx(P,{className:"hidden md:table-cell",children:"Step"}),s.jsx(P,{children:"Running turn"}),s.jsx(P,{className:"hidden text-right md:table-cell",children:"Waiting"})]})}),s.jsx(Be,{children:t.map(o=>{var m;const c=o.id===n,d=j3(o),f=R3(o,a,r),h=o.waiting-(((m=o.batch)==null?void 0:m.remaining)??0);return s.jsxs(ie,{"data-testid":"queues-row",className:ne(c&&"bg-accent"),children:[s.jsxs(I,{children:[s.jsx(i,{className:"text-primary hover:underline",href:l(`${e}?queue=${encodeURIComponent(o.id)}`),"aria-current":c?"page":void 0,children:o.name}),d?s.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null,s.jsxs("div",{className:"text-muted-foreground text-xs md:hidden",children:[h," waiting"]})]}),s.jsx(I,{className:"hidden md:table-cell",children:s.jsx(de,{variant:"neutral",children:mk[o.policy.step]})}),s.jsxs(I,{children:[s.jsx("div",{className:ne(!o.batch&&!o.turn&&"text-muted-foreground"),children:f.primary}),f.secondary?s.jsx("div",{className:ne("text-xs",f.warn?"text-warning":"text-muted-foreground"),children:f.secondary}):null]}),s.jsx(I,{className:"hidden text-right md:table-cell",children:h})]},o.id)})})]})})}function ec({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 Sv({org:e,entries:t,landing:n,queue_name:a,subject_label:r,held:l,label:i}){return s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Ue,{containerAriaLabel:i,children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:r}),s.jsx(P,{children:"State"})]})}),s.jsx(Be,{children:t.map(o=>{const c=b3(o,n,a,l);return s.jsxs(ie,{"data-testid":"queues-running",children:[s.jsxs(I,{children:[s.jsx(Zh,{org:e,subject:o.subject,link:!l}),l&&o.hold&&o.note&&!o.subject.hidden?s.jsx("div",{className:"text-muted-foreground text-xs",children:o.note}):null]}),s.jsx(I,{children:s.jsx(de,{variant:c.tone,children:c.label})})]},o.ref)})})]})})}function A3({org:e,detail:t,name:n,settings_note:a,subject_label:r,thread_subjects:l}){var w;const{queue:i,state:o}=t,c=_=>n(_),d=new Map(o.entries.map(_=>[_.ref,_.subject])),f=o.entries.filter(_=>_.turn==="running"),h=o.entries.filter(_=>_.turn!=="running"&&_.batching!=="in_batch"),m=o.batch,g=Math.max(1,f.filter(_=>_.batching!=="in_batch").length),j=m&&i.policy.independent_turns?f.filter(_=>_.batching!=="in_batch"&&_.ref!==m.holder):[],v=o.manager,y=o.freeze,x=((w=i.layer)==null?void 0:w.kind)==="release"?i.layer.stall_hold:void 0,p=x?{who:n(x.by),why:x.reason,until:x.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(yt,{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(de,{variant:"neutral",children:mk[i.policy.step]}),s.jsx(de,{variant:"neutral",children:x3[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(nR,{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 ",qn(v.lease_until),v.serving_until!==void 0?" · serving now":""]})]}):null,y?s.jsxs(le,{variant:"warning",children:[s.jsx(QT,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Frozen until ",qn(y.lease_until)]}),s.jsxs(ae,{children:[n(y.holder,y.holder_subject)," froze this queue at ",qn(y.since),y.label?`: ${y.label}`:"",". Only ",n(y.holder,y.holder_subject),"'s entries start until it thaws."]})]}):null,p?s.jsxs(le,{variant:"info",children:[s.jsx(o0,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Stall hold until ",qn(p.until)]}),s.jsxs(ae,{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(ec,{id:"queue-running",title:"Running turn",side:`Batch opened by ${n(m.holder,m.holder_subject)} at ${qn(m.opened_at)}`,children:[s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Ue,{containerAriaLabel:"Batch members",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Landing order"}),s.jsx(P,{children:r}),s.jsx(P,{children:"Outcome"})]})}),s.jsx(Be,{children:m.members.map((_,k)=>{const N=v3(_.outcome);return s.jsxs(ie,{"data-testid":"queues-member",children:[s.jsx(I,{children:k+1}),s.jsx(I,{children:s.jsx(Zh,{org:e,subject:_.subject??d.get(_.ref)??(l?{kind:"thread",id:_.ref}:void 0),link:!l})}),s.jsx(I,{children:s.jsx(de,{variant:N.tone,children:N.label})})]},_.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(Sv,{org:e,entries:j,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Turns running beside the batch"})]}):null]}):s.jsx(ec,{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(Sv,{org:e,entries:f,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Running turns"})}),s.jsx(ec,{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(Ue,{containerAriaLabel:"Waiting entries",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Position"}),s.jsx(P,{children:r}),s.jsx(P,{className:"hidden md:table-cell",children:"Joined"}),s.jsx(P,{children:"Turn"}),s.jsx(P,{className:"hidden md:table-cell",children:"Note"})]})}),s.jsx(Be,{children:h.map((_,k)=>{const N=y3(_);return s.jsxs(ie,{"data-testid":"queues-waiting",children:[s.jsx(I,{children:m?g+k+1:_.position}),s.jsx(I,{children:s.jsx(Zh,{org:e,subject:_.subject,link:!l})}),s.jsx(I,{className:"hidden md:table-cell",children:qn(_.joined_at)}),s.jsx(I,{children:s.jsx(de,{variant:N.tone,children:N.label})}),s.jsx(I,{className:"hidden md:table-cell",children:_.subject.hidden?"":_.note??""})]},_.ref)})})]})})})]}),s.jsx(ec,{id:"queue-settings",title:"Settings",children:s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsx(Ue,{containerAriaLabel:"Queue settings",children:s.jsx(Be,{children:N3(i,c).map(([_,k])=>s.jsxs(ie,{children:[s.jsx(P,{scope:"row",className:"h-auto w-48 py-2 font-normal",children:_}),s.jsx(I,{children:k})]},_))})})})}),s.jsx("p",{className:"text-muted-foreground text-xs",children:a})]})}const $s="__no_parent__";function bk(e,t){const n=new Set([t]);for(let a=!0;a;){a=!1;for(const r of e)r.parent&&n.has(r.parent)&&!n.has(r.key)&&(n.add(r.key),a=!0)}return n}const Jh=(e,t)=>(e.label||e.key).localeCompare(t.label||t.key);function zs({id:e,label:t,help:n,error:a,children:r}){const l=[n?`${e}-help`:null,a?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Oe,{htmlFor:e,children:t}),r(l),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,a?s.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:a}):null]})}function Cv({id:e,label:t,help:n,checked:a,on_change:r}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(zl,{id:e,className:"mt-0.5",checked:a,"aria-describedby":n?`${e}-help`:void 0,onCheckedChange:l=>r(l===!0)}),s.jsx(Oe,{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 jk({id:e,legend:t,help:n,error:a,options:r,checked:l,on_change:i,empty:o}){const c=[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":c,"aria-invalid":a?!0:void 0,children:[s.jsx("legend",{className:"mb-2 text-sm leading-none font-medium",children:t}),r.length===0&&o?s.jsx("p",{className:"text-muted-foreground text-sm",children:o}):null,s.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:r.map((d,f)=>s.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[s.jsx(zl,{id:`${e}-${f}`,className:"mt-0.5",checked:l.has(d.value),onCheckedChange:h=>{const m=new Set(l);h===!0?m.add(d.value):m.delete(d.value),i(m)}}),s.jsx(Oe,{htmlFor:`${e}-${f}`,className:"min-w-0 font-normal break-words",children:d.label})]},d.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 Qx({message:e}){return e?s.jsxs(le,{variant:"destructive",role:"alert",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(ae,{children:e})]}):null}function wk({id:e,value:t,on_change:n,none:a,options:r,described_by:l}){return s.jsxs(mt,{value:t,onValueChange:n,children:[s.jsx(ct,{id:e,"aria-describedby":l,children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:$s,children:a}),r.map(i=>s.jsx(ke,{value:i.key,children:i.label||i.key},i.key))]})]})}function Wx(e){const[t,n]=u.useState(!1),[a,r]=u.useState(null);return{saving:t,refusal:a,set_refusal:r,run:async i=>{n(!0),r(null);try{const o=await i();o?r(o):e()}finally{n(!1)}}}}const Nk=e=>`Lowercase letters, digits, _ and -, starting with a letter. It names the ${e} in posts and in sdlc org, and cannot change later.`;function M3({open:e,chart:t,team:n,save:a,on_close:r}){const[l,i]=u.useState(""),[o,c]=u.useState(""),[d,f]=u.useState(""),[h,m]=u.useState($s),[g,j]=u.useState({}),{saving:v,refusal:y,set_refusal:x,run:p}=Wx(r);u.useEffect(()=>{e&&(i(""),c((n==null?void 0:n.label)??""),f((n==null?void 0:n.description)??""),m((n==null?void 0:n.parent)??$s),j({}),x(null))},[e,n,x]);const b=n?bk(t.teams,n.key):new Set,w=[...t.teams].filter(k=>!b.has(k.key)).sort(Jh),_=k=>{if(k.preventDefault(),!n){if(!l.trim()){j({key:"Give the team a key."});return}const A=o.trim()||l.trim();p(()=>a({action:"add",kind:"team",key:l.trim(),...o.trim()?{label:o.trim()}:{},...d.trim()?{description:d.trim()}:{},...h!==$s?{parent:h}:{}},`Team ${A} added.`));return}if(!o.trim()){j({label:"Give the team a label."});return}const N=h===$s?null:h,S={...o.trim()!==n.label.trim()?{label:o.trim()}:{},...d.trim()!==(n.description??"").trim()?{description:d.trim()}:{},...N!==n.parent?{parent:N}:{}};if(Object.keys(S).length===0){r();return}p(()=>a({action:"edit",kind:"team",key:n.key,...S},`Team ${o.trim()} saved.`))};return s.jsx(Ys,{open:e,onOpenChange:k=>k||v?null:r(),children:s.jsx(Fs,{children:s.jsxs("form",{onSubmit:_,noValidate:!0,children:[s.jsxs(Xs,{children:[s.jsx(Qs,{children:n?`Edit team ${n.label||n.key}`:"Add team"}),s.jsx(Ws,{children:n?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."]}):"Add a team to this repository's local org."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Qx,{message:y}),n?null:s.jsx(zs,{id:"org-team-key",label:"Key",help:Nk("team"),error:g.key,children:k=>s.jsx(At,{id:"org-team-key",className:"font-mono",value:l,autoComplete:"off","aria-invalid":g.key?!0:void 0,"aria-describedby":k,onChange:N=>{i(N.target.value),j({})}})}),s.jsx(zs,{id:"org-team-label",label:n?"Label":"Label (optional)",help:n?void 0:"Shown on the chart; the key when left empty.",error:g.label,children:k=>s.jsx(At,{id:"org-team-label",value:o,"aria-invalid":g.label?!0:void 0,"aria-describedby":k,onChange:N=>{c(N.target.value),j({})}})}),s.jsx(zs,{id:"org-team-description",label:"Description (optional)",children:()=>s.jsx(es,{id:"org-team-description",rows:3,placeholder:"What the team does",value:d,onChange:k=>f(k.target.value)})}),s.jsx(zs,{id:"org-team-parent",label:"Parent team",help:"Where the team sits; its posts report up through the team above.",children:k=>s.jsx(wk,{id:"org-team-parent",value:h,on_change:m,none:"No parent (a root team)",options:w,described_by:k})})]}),s.jsxs(Ks,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",disabled:v,onClick:r,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:v,children:n?v?"Saving…":"Save":v?"Adding…":"Add team"})]})]})})})}const O3=(e,t)=>e.length===t.size&&e.every(n=>t.has(n));function D3({open:e,chart:t,job:n,save:a,on_close:r}){const[l,i]=u.useState(""),[o,c]=u.useState(""),[d,f]=u.useState(""),[h,m]=u.useState($s),[g,j]=u.useState(new Set),[v,y]=u.useState(!1),[x,p]=u.useState(!0),[b,w]=u.useState({}),{saving:_,refusal:k,set_refusal:N,run:S}=Wx(r);u.useEffect(()=>{e&&(i(""),c((n==null?void 0:n.label)??""),f((n==null?void 0:n.description)??""),m((n==null?void 0:n.parent)??$s),j(new Set((n==null?void 0:n.fills)??[])),y((n==null?void 0:n.requires_person)??!1),p((n==null?void 0:n.escalable)??!0),w({}),N(null))},[e,n,N]);const A=n?bk(t.job_functions,n.key):new Set,D=[...t.job_functions].filter(T=>!A.has(T.key)).sort(Jh),G=[...t.slots].sort(Jh).map(T=>({value:T.key,label:T.label||T.key})),Y=T=>{if(T.preventDefault(),!n){if(!l.trim()){w({key:"Give the job function a key."});return}S(()=>a({action:"add",kind:"job_function",key:l.trim(),...o.trim()?{label:o.trim()}:{},...d.trim()?{description:d.trim()}:{},...h!==$s?{parent:h}:{},fills:[...g],requires_person:v,escalable:x},`Job function ${o.trim()||l.trim()} added.`));return}if(!o.trim()){w({label:"Give the job function a label."});return}const B=h===$s?null:h,F={...o.trim()!==n.label.trim()?{label:o.trim()}:{},...d.trim()!==(n.description??"").trim()?{description:d.trim()}:{},...B!==n.parent?{parent:B}:{},...O3(n.fills,g)?{}:{fills:[...g]},...v!==n.requires_person?{requires_person:v}:{},...x!==n.escalable?{escalable:x}:{}};if(Object.keys(F).length===0){r();return}S(()=>a({action:"edit",kind:"job_function",key:n.key,...F},`Job function ${o.trim()} saved.`))};return s.jsx(Ys,{open:e,onOpenChange:T=>T||_?null:r(),children:s.jsx(Fs,{children:s.jsxs("form",{onSubmit:Y,noValidate:!0,children:[s.jsxs(Xs,{children:[s.jsx(Qs,{children:n?`Edit job function ${n.label||n.key}`:"Add job function"}),s.jsxs(Ws,{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(Qx,{message:k}),n?null:s.jsx(zs,{id:"org-function-key",label:"Key",help:Nk("job function"),error:b.key,children:T=>s.jsx(At,{id:"org-function-key",className:"font-mono",value:l,autoComplete:"off","aria-invalid":b.key?!0:void 0,"aria-describedby":T,onChange:B=>{i(B.target.value),w({})}})}),s.jsx(zs,{id:"org-function-label",label:n?"Label":"Label (optional)",error:b.label,children:T=>s.jsx(At,{id:"org-function-label",value:o,"aria-invalid":b.label?!0:void 0,"aria-describedby":T,onChange:B=>{c(B.target.value),w({})}})}),s.jsx(zs,{id:"org-function-description",label:"Job description (optional)",children:()=>s.jsx(es,{id:"org-function-description",rows:3,placeholder:"What this job function does",value:d,onChange:T=>f(T.target.value)})}),s.jsx(zs,{id:"org-function-parent",label:"Parent function",help:"Its posts report to the post of the parent function.",children:T=>s.jsx(wk,{id:"org-function-parent",value:h,on_change:m,none:"No parent (a root function)",options:D,described_by:T})}),s.jsx(jk,{id:"org-function-fills",legend:"Slots it fills",options:G,checked:g,on_change:j,empty:"This org has no slots yet; add them with sdlc org add slot."}),s.jsx(Cv,{id:"org-function-requires-person",label:"Requires a person",help:"Only a person may hold its posts.",checked:v,on_change:y}),s.jsx(Cv,{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:x,on_change:p})]}),s.jsxs(Ks,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",disabled:_,onClick:r,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:_,children:n?_?"Saving…":"Save":_?"Adding…":"Add job function"})]})]})})})}function $3({open:e,chart:t,binding:n,names:a,save:r,confirm:l,on_close:i}){var S;const[o,c]=u.useState(new Set),[d,f]=u.useState(""),[h,m]=u.useState({}),{saving:g,refusal:j,set_refusal:v,run:y}=Wx(i);if(u.useEffect(()=>{!e||!n||(c(new Set(n.posts.map(A=>A.post))),f(n.source==="override"?n.reason??"":""),m({}),v(null))},[e,n,v]),!n)return null;const x=a.slot(n.slot),p=(S=t.project)!=null&&S.team?t.teams.find(A=>{var D;return A.key===((D=t.project)==null?void 0:D.team)}):void 0,b=p?p.label||p.key:"the owning team",w=new Set(t.job_functions.filter(A=>A.fills.includes(n.slot)).map(A=>A.key)),_=[...t.posts].map(A=>A.post).sort(a.byPost).map(A=>({value:A,label:w.has(A.split("/")[1]??"")?`${a.post(A)} (fills ${x})`:a.post(A)})),k=A=>{A.preventDefault();const D={...o.size===0?{posts:"Choose at least one post."}:{},...d.trim()?{}:{reason:"Give the reason for the override."}};m(D),!(D.posts||D.reason)&&y(()=>r({action:"bind",slot:n.slot,posts:[...o],reason:d.trim()},`Override of ${x} saved.`))},N=async()=>{await l({title:`Clear the override of ${x}?`,description:"It goes back to the posts its job descriptions name, and its reason is not kept.",action_label:"Clear",destructive:!0})&&y(()=>r({action:"unbind",slot:n.slot},`Override of ${x} cleared.`))};return s.jsx(Ys,{open:e,onOpenChange:A=>A||g?null:i(),children:s.jsx(Fs,{children:s.jsxs("form",{onSubmit:k,noValidate:!0,children:[s.jsxs(Xs,{children:[s.jsxs(Qs,{children:["Override ",x]}),s.jsxs(Ws,{children:["Bind ",x," in this project to the posts you choose instead of its 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:[s.jsx(Qx,{message:j}),s.jsx(jk,{id:"org-override-posts",legend:"Posts",help:"A post outside its job description is marked on the chart.",error:h.posts,options:_,checked:o,on_change:A=>{c(A),m(D=>({...D,posts:void 0}))}}),s.jsx(zs,{id:"org-override-reason",label:"Reason",error:h.reason,children:A=>s.jsx(es,{id:"org-override-reason",rows:2,placeholder:"Why this slot needs other posts",value:d,"aria-invalid":h.reason?!0:void 0,"aria-describedby":A,onChange:D=>{f(D.target.value),m(G=>({...G,reason:void 0}))}})}),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 ",b," or of a team above it."]})]}),s.jsxs(Ks,{className:"mt-6",children:[n.source==="override"?s.jsx(H,{type:"button",variant:"ghost",className:"sm:mr-auto",disabled:g,onClick:()=>void N(),children:"Clear override"}):null,s.jsx(H,{type:"button",variant:"outline",disabled:g,onClick:i,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:g,children:g?"Saving…":"Save override"})]})]})})})}function _k({label:e,on_edit:t,on_remove:n}){return s.jsxs(rd,{children:[s.jsx(ld,{asChild:!0,children:s.jsx(H,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`More actions for ${e}`,children:s.jsx(ax,{className:"size-3.5","aria-hidden":"true"})})}),s.jsxs(wo,{align:"end",children:[s.jsx(cr,{onSelect:t,children:"Edit"}),s.jsx(cr,{className:"text-destructive focus:text-destructive",onSelect:n,children:"Remove"})]})]})}function z3({label:e,message:t,on_dismiss:n}){return s.jsxs(le,{variant:"destructive",role:"alert",className:"mb-3",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:[e," was not removed"]}),s.jsxs(ae,{children:[s.jsx("p",{children:t}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Dismiss"})]})]})}const L3={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."},U3="Covered: someone holds a post that fills the slot. Vacant: posts fill it but nobody holds them. Uncovered: no job function fills it.",B3="scripts/agent-coordination/workflow.json",H3=4,Zx=e=>({paddingLeft:16+24*Math.min(e,H3)}),gu={covered:{label:"Covered",tone:"success"},vacant:{label:"Vacant",tone:"warning"},uncovered:{label:"Uncovered",tone:"error"}};function I3(){const e=nn().org;if(!e)throw new Error("The Org chart page rendered without the org seam.");return e}function P3({host:e="local",org:t=""}={}){const n=I3(),[a,r]=u.useState({state:"loading"}),[l,i]=u.useState(null),o=u.useRef(0),c=u.useRef(null),d=u.useCallback(g=>{const j=async v=>{const y=o.current+=1;c.current&&clearTimeout(c.current);const x=await n.chart();if(y!==o.current)return;if(x.ok){i({chart:x.data,at:new Date().toISOString()}),r({state:"read"});return}const{refusal:p}=x;if(p.reason==="no_local_org"){i(null),r({state:"none"});return}if(e==="hosted"&&(p.reason==="not_found"||p.status===404)){i(null),r({state:"missing"});return}if(p.retry&&p.reason==="store_locked"&&v>0){const b=p.retry_after??10;r({state:"busy",retry_after:b}),c.current=setTimeout(()=>void j(v-1),b*1e3);return}r({state:"failed",refusal:p})};return j(g)},[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:l,m=G3(n.change,()=>void d(1),(h==null?void 0:h.chart)??q3);return a.state==="missing"?s.jsx(F3,{org:t}):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(Xt,{title:"Org chart",description:L3[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(V3,{quiet:a.state==="busy"}):null,a.state==="none"?s.jsx(Y3,{edit:(m==null?void 0:m.actions)??null}):null,a.state==="failed"?s.jsx(K3,{host:e,kept_at:(h==null?void 0:h.at)??null,on_retry:f}):null,h?s.jsx(Q3,{chart:h.chart,host:e,edit:(m==null?void 0:m.actions)??null}):null,(m==null?void 0:m.dialogs)??null]})}const q3={org:"",workflow:!1,teams:[],job_functions:[],slots:[],posts:[],members:[],slot_resolution:[],project:{team:null,roots:[]}};function G3(e,t,n){const a=Al(),r=kk(n),{confirm:l,confirm_dialog:i}=$l(),[o,c]=u.useState(null),[d,f]=u.useState({}),h=y=>f(x=>{if(!x[y])return x;const{[y]:p,...b}=x;return b});if(!e)return null;const m=async(y,x)=>{const p=await e(y);return p.ok?("kind"in y&&h(y.kind==="team"?"teams":"functions"),a.success(x),t(),null):p.refusal.message},g=async(y,x,p)=>{if(!await l({title:`Remove ${y==="team"?"team":"job function"} ${p}?`,description:"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.",action_label:"Remove",destructive:!0}))return;const _=y==="team"?"teams":"functions",k=await e({action:"remove",kind:y,key:x});if(!k.ok){f(N=>({...N,[_]:{label:p,message:k.refusal.message}}));return}h(_),a.success(`${y==="team"?"Team":"Job function"} ${p} removed.`),t()},j=()=>c(null),v=(o==null?void 0:o.kind)==="override"&&n.project&&n.project.team!==null?n.project.slots.find(y=>y.slot===o.slot)??null:null;return{actions:{team:y=>c({kind:"team",team:y}),job:y=>c({kind:"function",job:y}),override:y=>c({kind:"override",slot:y}),remove:(y,x,p)=>void g(y,x,p),refused:y=>{const x=d[y];return x?s.jsx(z3,{label:x.label,message:x.message,on_dismiss:()=>h(y)}):null}},dialogs:s.jsxs(s.Fragment,{children:[s.jsx(M3,{open:(o==null?void 0:o.kind)==="team",chart:n,team:(o==null?void 0:o.kind)==="team"?o.team:null,save:m,on_close:j}),s.jsx(D3,{open:(o==null?void 0:o.kind)==="function",chart:n,job:(o==null?void 0:o.kind)==="function"?o.job:null,save:m,on_close:j}),s.jsx($3,{open:v!==null,chart:n,binding:v,names:r,save:m,confirm:l,on_close:j}),i]})}}function V3({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(st,{className:n===3?"h-10 w-2/3":"h-10 w-full"},n))})}function ll({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 Y3({edit:e}){return s.jsxs(le,{variant:"info",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This repository has no local org yet"}),s.jsxs(ae,{children:[s.jsx("p",{children: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."}),s.jsxs("div",{className:"mt-2 grid w-full gap-2",children:[s.jsx(ll,{children:"sdlc org seed"}),e?null:s.jsx(ll,{children:"sdlc org add team <key>"})]}),e?s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>e.team(null),children:[s.jsx(bl,{className:"size-4","aria-hidden":"true"}),"Add team"]}):null]})]})}function F3({org:e}){const{href:t,Link:n}=Xe();return s.jsx(Zs,{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 X3(e){return new Date(e).toDateString()===new Date().toDateString()?`today at ${Wn(e)}`:`on ${An(e)} at ${Wn(e)}`}function K3({host:e,kept_at:t,on_retry:n}){const a=t?`The chart read ${X3(t)} is kept below. `:"";return s.jsxs(le,{variant:"destructive",className:"mt-6",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:e==="hosted"?"Could not read the org chart":"Could not read the local org"}),s.jsxs(ae,{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(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function kk(e){return u.useMemo(()=>{const t=new Map(e.teams.map(y=>[y.key,y.label||y.key])),n=new Map(e.job_functions.map(y=>[y.key,y.label||y.key])),a=new Map(e.slots.map(y=>[y.key,y.label||y.key])),r=new Map(e.posts.map(y=>[y.post,y.holders])),l=y=>y.label||y.id,i=new Map;for(const y of[...e.members,...e.posts.flatMap(x=>x.holders)]){const x=l(y);i.set(x,(i.get(x)??new Set).add(`${y.kind}:${y.id}`))}const o=y=>{var x;return(((x=i.get(l(y)))==null?void 0:x.size)??0)>1},c=y=>{const x=o(y)?y.detail??y.id:null;return x&&x!==l(y)?x:null},d=y=>{const x=c(y);return x&&x!==l(y)?`${l(y)} (${x})`:l(y)},f=y=>{const[x="",p=""]=y.split("/");return{team:t.get(x)??x,job:n.get(p)??p}},h=y=>{const{team:x,job:p}=f(y);return`${p} · ${x}`},m=y=>{if(y==="top")return"Top of the org";if(typeof y!="string")return`A vacant ${n.get(y.vacant)??y.vacant}`;const x=(r.get(y)??[]).map(d);return x.length?`${h(y)} (${x.join(", ")})`:h(y)},g=new Map(e.teams.map(y=>[y.key,y.parent])),j=y=>{let x=0;for(let p=g.get(y);p&&x<e.teams.length;p=g.get(p))x+=1;return x};return{parts:f,post:h,member:d,memberLabel:l,memberDetail:c,manager:m,byPost:(y,x)=>{const[p="",b=""]=[y.split("/")[0],x.split("/")[0]],[w,_]=[f(y),f(x)];return j(p)-j(b)||w.team.localeCompare(_.team)||w.job.localeCompare(_.job)},slot:y=>a.get(y)??y,job:y=>n.get(y)??y,team:y=>t.get(y)??y}},[e])}function Fa({id:e,title:t,description:n,actions:a,children:r}){return s.jsxs("section",{"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,className:"text-lg font-semibold",children:t}),s.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:n})]}),a?s.jsx("div",{className:"flex shrink-0 gap-2",children:a}):null]}),s.jsx("div",{className:"mt-3",children:r})]})}function Tv({children:e,on_click:t}){return s.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:t,children:[s.jsx(bl,{className:"size-4","aria-hidden":"true"}),e]})}const Rv={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 Q3({chart:e,host:t,edit:n}){const a=kk(e),r=e.members.some(l=>l.kind==="agent");return s.jsxs(s.Fragment,{children:[s.jsx(Fa,{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.",children:s.jsx(J3,{chart:e,names:a,agents:r,host:t})}),s.jsx(Fa,{id:"org-chart-members",title:"Members",description:r?`${Rv[t]} Each agent answers to the nearest person in its reporting chain.`:Rv[t],children:s.jsx(nz,{chart:e,names:a,host:t,agents:r})}),n?s.jsxs(Fa,{id:"org-chart-teams",title:"Teams",description:"Each team under its parent. A post is one of its job functions staffed in it.",actions:s.jsx(Tv,{on_click:()=>n.team(null),children:"Add team"}),children:[n.refused("teams"),s.jsx(W3,{chart:e,edit:n})]}):null,s.jsxs("div",{className:"grid items-start gap-x-6 xl:grid-cols-2",children:[s.jsxs(Fa,{id:"org-chart-functions",title:"Function tree",description:"Each job function under its parent, with the slots it fills.",actions:n?s.jsx(Tv,{on_click:()=>n.job(null),children:"Add job function"}):void 0,children:[n==null?void 0:n.refused("functions"),s.jsx(sz,{chart:e,names:a,edit:n})]}),s.jsxs(Fa,{id:"org-chart-slots",title:"Slots",description:U3,children:[e.workflow===!1?s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"This checkout has no workflow file, so no slot is marked as a gate:"}),s.jsx("p",{className:"font-mono text-xs",children:B3})]}):null,s.jsx(rz,{chart:e,names:a})]})]}),e.project?s.jsx(iz,{project:e.project,chart:e,names:a,edit:n}):null]})}function W3({chart:e,edit:t}){var l;const n=Jx([...e.teams].sort((i,o)=>(i.label||i.key).localeCompare(o.label||o.key)),i=>i.key,i=>i.parent);if(n.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"No teams yet."});const a=((l=e.project)==null?void 0:l.team)??null,r=(i,o)=>s.jsx("ul",{role:"list",className:o===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:i.map(({item:c,children:d})=>{const f=c.label||c.key;return s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:Zx(o),"data-testid":"org-chart-team",children:[s.jsx("span",{className:"text-sm font-medium",children:f}),s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:c.key}),a===c.key?s.jsx(de,{variant:"neutral",children:"Owns this project"}):null,s.jsx(_k,{label:f,on_edit:()=>t.team(c),on_remove:()=>t.remove("team",c.key,f)})]})]}),d.length>0?r(d,o+1):null]},c.key)})});return s.jsx(yt,{className:"overflow-hidden",children:r(n,0)})}function Jx(e,t,n){const a=new Set(e.map(t)),r=new Map(e.map(i=>[t(i),{item:i,children:[]}])),l=[];for(const i of e){const o=n(i),c=r.get(t(i));o&&a.has(o)&&o!==t(i)?r.get(o).children.push(c):l.push(c)}return l}const Z3={local:"No posts yet.",hosted:"No posts yet. Posts appear here once an organization owner adds them."};function J3({chart:e,names:t,agents:n,host:a}){const r=Jx([...e.posts].sort((o,c)=>t.byPost(o.post,c.post)),o=>o.post,o=>typeof o.reports_to=="string"&&o.reports_to!=="top"?o.reports_to:null);if(r.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:Z3[a]});const l=new Map(e.members.map(o=>[`${o.kind}:${o.id}`,o])),i=(o,c)=>s.jsx("ul",{role:"list",className:c===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:o.map(({item:d,children:f})=>{const{team:h}=t.parts(d.post),m=typeof d.reports_to=="object"?d.reports_to:null;return s.jsxs("li",{children:[s.jsxs("div",{className:"border-b py-2 pr-4",style:Zx(c),"data-testid":"org-chart-post",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(zC,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium",children:t.parts(d.post).job}),s.jsx("span",{className:"text-muted-foreground text-xs",children:m?`${h} · Reports to a vacant ${t.job(m.vacant)}`:h})]}),s.jsx("div",{className:"mt-1 grid min-w-0 gap-1 pl-6",children:d.holders.length===0?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(de,{variant:gu.vacant.tone,children:gu.vacant.label}),s.jsx("span",{className:"text-muted-foreground text-xs",children:"No one holds this post."})]}):d.holders.map(g=>s.jsx(ez,{holder:g,post:d.post,member:l.get(`${g.kind}:${g.id}`),names:t,agents:n},`${g.kind}:${g.id}`))})]}),f.length>0?i(f,c+1):null]},d.post)})});return s.jsx(yt,{className:"overflow-hidden",children:i(r,0)})}function ez({holder:e,post:t,member:n,names:a,agents:r}){const l=e.kind==="person"?lx:sx,i=n==null?void 0:n.posts.find(f=>f.post===t),o=n==null?void 0:n.posts.find(f=>f.primary),c=a.memberDetail(e);let d=null;return i!=null&&i.dotted&&o?d=`Dotted line: primary manager is ${a.manager(o.reports_to)}`:e.kind==="agent"&&n&&"accountable_person"in n&&(d=n.accountable_person?`Accountable person ${a.member(n.accountable_person)}`:"No accountable person"),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx(l,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium break-all",children:a.memberLabel(e)}),c?s.jsx("span",{className:"text-muted-foreground text-xs break-all",children:c}):null,r?s.jsx("span",{className:"text-muted-foreground text-xs",children:e.kind==="person"?"Person":"Agent"}):null,d?s.jsx("span",{className:"text-xs",children:d}):null]})}const tz=["sdlc org hold <team>/<function> --person <id>","sdlc org hold <team>/<function> --agent <id>"];function nz({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:"}),tz.map(l=>s.jsx(ll,{children:l},l))]});const r=[...e.members].sort((l,i)=>l.kind===i.kind?t.memberLabel(l).localeCompare(t.memberLabel(i))||l.id.localeCompare(i.id):l.kind==="person"?-1:1);return s.jsx(yt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Members",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Member"}),s.jsx(P,{children:"Posts"}),s.jsx(P,{children:"Primary manager"}),s.jsx(P,{children:"Dotted lines"}),a?s.jsx(P,{children:"Accountable person"}):null]})}),s.jsx(Be,{children:r.map(l=>{const i=l.posts.find(d=>d.primary),o=l.posts.filter(d=>d.dotted),c=t.memberDetail(l);return s.jsxs(ie,{"data-testid":"org-chart-member",children:[s.jsxs(I,{children:[s.jsx("div",{className:"font-medium",children:t.memberLabel(l)}),c?s.jsx("div",{className:"text-muted-foreground text-xs",children:c}):null,a?s.jsx("div",{className:"text-muted-foreground text-xs",children:l.kind==="person"?"Person":"Agent"}):null]}),s.jsx(I,{children:l.posts.map(d=>t.post(d.post)).join(", ")}),s.jsx(I,{children:i?t.manager(i.reports_to):"None"}),s.jsx(I,{children:o.length?o.map(d=>t.manager(d.reports_to)).join(", "):"None"}),a?s.jsx(I,{children:l.kind==="person"?"Not an agent":l.accountable_person?t.member(l.accountable_person):"None"}):null]},`${l.kind}:${l.id}`)})})]})})}function sz({chart:e,names:t,edit:n}){const a=Jx([...e.job_functions].sort((l,i)=>(l.label||l.key).localeCompare(i.label||i.key)),l=>l.key,l=>l.parent);if(a.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"No job functions yet."});const r=(l,i)=>s.jsx("ul",{role:"list",className:i===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:l.map(({item:o,children:c})=>s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:Zx(i),"data-testid":"org-chart-function",children:[s.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(de,{variant:"neutral",children:"Requires a person"}):null,n?s.jsx(_k,{label:o.label||o.key,on_edit:()=>n.job(o),on_remove:()=>n.remove("job_function",o.key,o.label||o.key)}):null]})]}),c.length>0?r(c,i+1):null]},o.key))});return s.jsx(yt,{className:"overflow-hidden",children:r(a,0)})}function az(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 vu={covered:0,vacant:1,uncovered:2};function Sk(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 rz({chart:e,names:t}){const n=Sk(e);return s.jsx(yt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Slots",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Slot"}),s.jsx(P,{children:"Status"}),s.jsx(P,{children:"Resolves to"})]})}),s.jsxs(Be,{children:[[...e.slot_resolution].sort((a,r)=>vu[a.status]-vu[r.status]||t.slot(a.slot).localeCompare(t.slot(r.slot))).map(a=>{const r=gu[a.status];return s.jsxs(ie,{"data-testid":"org-chart-slot",children:[s.jsxs(I,{children:[s.jsx("div",{className:"font-medium",children:t.slot(a.slot)}),n.has(a.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:n.get(a.slot)}):null]}),s.jsx(I,{children:s.jsx(de,{variant:r.tone,children:r.label})}),s.jsxs(I,{children:[az(a,t),a.status==="covered"&&a.needs_person?s.jsx("div",{className:"text-muted-foreground text-xs",children:"Needs a person"}):null]})]},a.slot)}),e.slot_resolution.length===0?s.jsx(ie,{children:s.jsx(I,{colSpan:3,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})})}const lz="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.",kf=["sdlc org own <team>","sdlc org bind <slot> <team>/<function>... --reason <text>","sdlc org unbind <slot>"];function iz({project:e,chart:t,names:n,edit:a}){if(e.team===null){const i=e.roots.map(n.team);return s.jsx(Fa,{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(ll,{children:i.length?kf[0]:"sdlc org add team <key>"})})})}const r=Sk(t),l=[...e.slots].sort((i,o)=>vu[i.status]-vu[o.status]||n.slot(i.slot).localeCompare(n.slot(o.slot)));return s.jsxs(Fa,{id:"org-chart-project",title:"This project",description:lz,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(yt,{className:"mt-3 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Slots in this project",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Slot"}),s.jsx(P,{children:"Status"}),s.jsx(P,{children:"Bound to"}),s.jsx(P,{children:"Source"}),a?s.jsx(P,{className:"text-right",children:s.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),s.jsxs(Be,{children:[l.map(i=>{const o=gu[i.status];return s.jsxs(ie,{"data-testid":"org-chart-project-slot",children:[s.jsxs(I,{children:[s.jsx("div",{className:"font-medium",children:n.slot(i.slot)}),r.has(i.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:r.get(i.slot)}):null]}),s.jsx(I,{children:s.jsx(de,{variant:o.tone,children:o.label})}),s.jsx(I,{children:s.jsx(oz,{binding:i,names:n})}),s.jsx(I,{children:s.jsx(cz,{binding:i})}),a?s.jsx(I,{className:"text-right",children:s.jsx(H,{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(rx,{className:"size-3.5","aria-hidden":"true"})})}):null]},i.slot)}),l.length===0?s.jsx(ie,{children:s.jsx(I,{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(ll,{children:kf[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:"}),kf.map(i=>s.jsx(ll,{children:i},i))]})]})}function oz({binding:e,names:t}){const n=[];e.status==="covered"&&e.needs_person&&n.push("Needs a person");for(const r of e.posts)r.off_description&&n.push(`${t.post(r.post)} does not fill ${t.slot(e.slot)} in its job description`);e.stale_posts&&n.push(e.stale_posts===1?"One post this override names is no longer in the org":`${e.stale_posts} posts this override names are no longer in the org`);let a;return e.posts.length===0?a=e.source==="override"?"The override names no post the org still has":"No job function fills this slot":e.status==="vacant"?a=`${e.posts.map(r=>t.post(r.post)).join(", ")} has no holder`:a=e.posts.map(r=>r.holders.length?`${t.post(r.post)}: ${r.holders.map(t.member).join(", ")}`:`${t.post(r.post)}: no holder`).join("; "),s.jsxs(s.Fragment,{children:[a,n.map(r=>s.jsx("div",{className:"text-muted-foreground text-xs",children:r},r))]})}function cz({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?An(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 uz={breaking:"Breaking",new:"New",improved:"Improved",other:"Other changes"},dz=["breaking","new","improved","other"],fz={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 Ck(e){return fz[e]??e.replace(/_/g," ")}function hz(e){return e.bump==="major"?"breaking":e.change==="added"?"new":e.change==="changed"?"improved":"other"}function Fi(e){const t=new Map;let n=0,a=0;for(const l of e){if(l.modeling_only){a+=1;continue}if(!l.bump){n+=1;continue}const i=hz(l);t.set(i,[...t.get(i)??[],l])}return{sections:dz.filter(l=>t.has(l)).map(l=>({key:l,label:uz[l],lines:t.get(l)})),breaking:t.has("breaking"),unlisted_count:n,modeling_only_count:a}}function mz(e,t){const n=[`## ${e}`];t.sections.length===0&&n.push("","No change affects the version.");for(const a of t.sections){n.push("",`### ${a.label}`,"");for(const r of a.lines){const l=r.why?`: ${r.why}`:"";n.push(`- ${r.label} (${Ck(r.node_type)})${l}`)}}return`${n.join(`
|
|
396
|
+
`)}
|
|
397
|
+
`}const Cs="candidate";function ep(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}const xz="Versioned records of this project's release branch, with notes from its graph changes.";function Tk({description:e=xz,actions:t}){return s.jsx(Xt,{title:"Releases",description:e,actions:t})}function Rk(e){var l;if(!e)return"";const t=(l=e.previous_release)==null?void 0:l.version,n=Number(e.version.split("-rc.")[1]??0),a=e.commits_since??n,r=`${e.commits_since===null?"At least ":""}${a} commit${a===1?"":"s"}`;return t?`${r} since ${t}`:`${r} before the first Release`}function wc({active:e,onClick:t,version:n,badges:a,caption:r,item_ref:l}){return s.jsxs("button",{ref:l,type:"button","aria-current":e?"true":void 0,onClick:t,className:ne("focus-visible:ring-ring flex flex-col gap-0.5 rounded-md px-3 py-2 text-left outline-none focus-visible:ring-2",e?"bg-muted":"hover:bg-muted/60"),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",children:[s.jsx("span",{className:"truncate",children:n}),a]}),s.jsx("span",{className:"text-muted-foreground text-xs",children:r})]})}function Rn({children:e}){return s.jsx("section",{className:"border-border flex flex-col gap-4 rounded-xl border p-4",children:e})}function Mn({title:e,error:t,onRetry:n}){return s.jsxs(le,{variant:"destructive",children:[s.jsx(Vt,{}),e?s.jsx(xe,{children:e}):null,s.jsxs(ae,{className:"flex flex-col items-start gap-2",children:[t,n?s.jsx(H,{variant:"outline",size:"sm",onClick:n,children:"Try again"}):null]})]})}function pz({title:e,text:t}){return s.jsx(Rn,{children:s.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-center",children:[s.jsx(Pu,{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 gz(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 yu({changes:e}){const t=u.useMemo(()=>Fi(e),[e]),[n,a]=u.useState(!1),r=t.unlisted_count+t.modeling_only_count;return s.jsxs("div",{className:"flex flex-col gap-4",children:[t.sections.map(l=>{const i=s.jsx("ul",{className:"flex flex-col gap-2",children:l.lines.map(o=>s.jsx(Ev,{line:o},`${o.node_id}:${o.change}`))});return l.key==="breaking"?s.jsxs(le,{variant:"destructive",className:"border-destructive/40",children:[s.jsx(Vt,{}),s.jsx(xe,{children:s.jsx("h3",{className:"text-destructive text-sm font-semibold",children:l.label})}),s.jsx(ae,{className:"text-foreground",children:i})]},l.key):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:l.label}),i]},l.key)}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Fixed"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Fixes that changed no part of the graph are not recorded yet; they arrive with landing notes."})]}),t.sections.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No change affects the version."}):null,r>0?s.jsxs("p",{className:"text-muted-foreground text-sm",children:[r," more change",r===1?"":"s"," do",r===1?"es":""," not affect the version."]}):null,e.length>0?s.jsx(H,{variant:"link",size:"sm",className:"self-start px-0","aria-expanded":n,onClick:()=>a(l=>!l),children:n?"Hide all changes":"Show all changes"}):null,n?s.jsx("ul",{className:"flex flex-col gap-2",children:e.map(l=>s.jsx(Ev,{line:l,detail:!0},`all:${l.node_id}:${l.change}:${l.modeling_only}`))}):null]})}function Ev({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(de,{variant:"outline",children:Ck(e.node_type)})]}),n?s.jsx("span",{className:"text-muted-foreground text-xs",children:n}):null]})}const Ek="Releases of this checkout: the roadmap of open Planned Releases, the next candidate, and each production release with its notes.",Av=5,Nc="Not available: update the main checkout and restart sdlc viewer.",em="planned:",Xn=e=>`${em}${e}`,vz=e=>e!=null&&e.startsWith(em)?e.slice(em.length):null,tp=e=>e?e.slice(0,7):"";function yz(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 bz(){return s.jsxs(le,{variant:"info",children:[s.jsx(en,{}),s.jsx(xe,{children:"This page only reads Releases"}),s.jsx(ae,{className:"text-info",children:"A Release is written when production runs a release candidate, once its commit is merged into origin/main."})]})}function jz(e){if(e.state==="unreadable")return{badges:s.jsx(de,{variant:"error",children:"Could not be read"}),caption:""};if(e.state==="withdrawn")return{badges:s.jsx(de,{variant:"warning",children:"Withdrawn"}),caption:e.replaced_by?`Replaced by ${e.replaced_by}`:"Withdrawn"};const t=s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"neutral",children:e.app_changed===!1?"App unchanged":e.previous_release_id?e.bump??"patch":"First"}),e.breaking?s.jsx(de,{variant:"error",children:"Breaking"}):null]}),n=e.written_at?ep(e.written_at):"",a=e.tracks&&e.tracks.length>0?` · ${e.tracks.join(", ")}`:"";return{badges:t,caption:`${n}${a}`}}function tr({query:e,select:t,onSelect:n,children:a,inline:r=!1}){return s.jsx("a",{href:`?${e}`,className:r?"text-primary underline":"text-primary hover:underline",onClick:l=>{l.preventDefault(),n(t)},children:a})}function md({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 hs=({children:e})=>s.jsx("code",{className:"font-mono text-xs",children:e});function Ak(e,t){if(e.judged_commit&&t&&e.judged_commit!==t)return`Judged ${tp(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 xd({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 wz={ready:"success",verifying:"info",fixing:"warning",abandoned:"warning",ready_older:"neutral",none:"neutral",unknown:"neutral"};function Nz({batch:e}){if(e.state==="loading")return s.jsxs(le,{children:[s.jsx(nu,{}),s.jsxs(ae,{className:"flex flex-row items-center gap-2",role:"status",children:[s.jsx(vn,{"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(le,{children:[s.jsx(nu,{}),s.jsxs(xe,{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{children:t.text}),s.jsx(de,{variant:wz[t.state],children:t.chip})]}),t.help?s.jsx(ae,{children:t.help}):null]})}function _z(e,t,n){return`/org/${e}/issues/${encodeURIComponent(t)}?from=${encodeURIComponent(n)}`}function Mk({issues:e,error:t}){return t?s.jsx(Mn,{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(xd,{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(hs,{children:n.file}):null]},n.key))})]})}function Ok({tracks:e,error:t}){return t?s.jsx(Mn,{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(xd,{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(hs,{children:n.version}):null,n.bump?s.jsx(de,{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(hs,{children:a.name}),s.jsxs(hs,{children:[a.from??"—"," → ",a.to??"—"]})]}),a.changes.map((r,l)=>s.jsxs("span",{className:"text-muted-foreground text-xs",children:[r.feature,": ",r.entry]},l))]},a.name))}),n.published&&!n.published.recorded?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[n.released_by??"Publish",": Not available. This Release does not say whether or when it moved latest."]}):null]},n.key))]})}function Dk({delivery:e,candidate:t,onSelect:n}){if(!e||e.planned.length===0&&e.outside===0)return null;const a=r=>r.length===0?"—":r.map(l=>l.went?`${l.label} (${l.went})`:l.label).join(", ");return s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(xd,{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(Ue,{containerAriaLabel:"Planned Releases",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Planned Release"}),s.jsx(P,{children:"Delivered"}),s.jsx(P,{children:"Not delivered"})]})}),s.jsx(Be,{children:e.planned.map(r=>s.jsxs(ie,{children:[s.jsx(I,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.open&&t?s.jsx(tr,{query:`planned=${encodeURIComponent(r.id)}`,select:Xn(r.id),onSelect:n,children:r.name}):s.jsx("span",{children:r.name}),s.jsx(hs,{children:r.id})]})}),s.jsx(I,{children:a(r.delivered)}),s.jsx(I,{children:a(r.not_delivered)})]},r.id))})]})}):null,e.outside>0?s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.outside," landing",e.outside===1?"":"s"," served no Planned Release."]}):null]})}const kz={thread:"Thread",task:"Task",issue:"Issue",test:"Test"};function $k({rows:e,org:t,from:n,untasked:a}){const{href:r,Link:l}=Xe(),[i,o]=u.useState(!1),c=i?e:e.slice(0,Av),d=f=>f.kind==="task"?s.jsx(l,{className:"text-primary font-mono text-xs hover:underline",href:r(`/org/${t}/tasks/${encodeURIComponent(f.id)}?from=${encodeURIComponent(n)}`),children:f.id}):f.kind==="issue"?s.jsx(l,{className:"text-primary font-mono text-xs hover:underline",href:r(_z(t,f.id,n)),children:f.id}):f.kind==="thread"?s.jsx(l,{className:"text-primary hover:underline",href:r(`${t?`/org/${t}`:""}/threads#thread-${encodeURIComponent(f.id)}`),children:f.label}):f.kind==="test"&&f.url?s.jsx("a",{className:"text-primary hover:underline",href:f.url,target:"_blank",rel:"noreferrer",children:f.label}):s.jsx("span",{children:f.label});return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Related",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Kind"}),s.jsx(P,{children:"Item"}),s.jsx(P,{children:"How it relates"})]})}),s.jsx(Be,{children:c.map(f=>s.jsxs(ie,{children:[s.jsx(I,{children:kz[f.kind]}),s.jsx(I,{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(I,{children:f.relation})]},`${f.kind}:${f.id}`))})]})}),e.length>Av?s.jsx(H,{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 zk=e=>(e==null?void 0:e.status)===409&&e.reason==="view_outdated";function Lk(e){const t=np(),[n,a]=u.useState(t!=null&&t.related?{state:"loading"}:null),r=u.useRef(0),l=u.useCallback(async(i=!1)=>{if(!(t!=null&&t.related))return;const o=++r.current;a({state:"loading"});const c=await t.related(e,i?{fresh:!0}:void 0);o===r.current&&a(c.ok?{state:"ready",value:c.data}:{state:"error",error:c.refusal.message,refusal:c.refusal})},[t,e]);return u.useEffect(()=>{l()},[l]),{related:n,read:l}}function Uk({related:e,org:t,from:n,onRetry:a}){const r=u.useRef(null),l=u.useRef(!1);if(u.useEffect(()=>{var o;l.current&&(e==null?void 0:e.state)!=="loading"&&(l.current=!1,(o=r.current)==null||o.focus())},[e]),!e)return null;const i=e.state==="ready"?e.value.rows.length:void 0;return s.jsxs("section",{className:"flex flex-col gap-2","aria-labelledby":"release-related",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h2",{id:"release-related",ref:r,tabIndex:-1,className:"text-lg font-semibold outline-none",children:"Related"}),i!==void 0?s.jsx("span",{className:"text-muted-foreground text-xs",children:i}):null]}),e.state==="loading"?s.jsxs("div",{className:"grid gap-2",role:"status","aria-label":"Loading related work",children:[s.jsx(st,{className:"h-8 w-full"}),s.jsx(st,{className:"h-8 w-full"}),s.jsx(st,{className:"h-8 w-2/3"})]}):e.state==="error"?zk(e.refusal)?s.jsx("p",{className:"text-muted-foreground text-sm",children:Nc}):s.jsx(Mn,{title:"Related work could not be read",error:e.error,onRetry:()=>{l.current=!0,a()}}):e.value.rows.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing related yet."}):s.jsx($k,{rows:e.value.rows,org:t,from:n,untasked:e.value.untasked})]})}function Sz(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 Bk({planned:e,onSelect:t}){return e?e.open?s.jsx(tr,{query:`planned=${encodeURIComponent(e.id)}`,select:Xn(e.id),onSelect:t,children:e.name}):s.jsxs("span",{children:[e.name," ",s.jsx(hs,{children:e.id})]}):null}function Cz({candidate:e,org:t,onSelect:n,notes:a}){const r=np(),{related:l,read:i}=Lk("candidate"),[o,c]=u.useState(r!=null&&r.candidateBatch?{state:"loading"}:null);u.useEffect(()=>{if(!(r!=null&&r.candidateBatch))return;let f=!0;return r.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}},[r]);const d=e.readiness??((l==null?void 0:l.state)==="ready"?l.value.readiness:null)??null;return s.jsxs(s.Fragment,{children:[s.jsx(md,{pairs:[["Environment",e.environment??"staging"],["Commit",s.jsx(hs,{children:tp(e.head_commit_id)},"commit")],["Readiness",d?Ak(d,e.head_commit_id):null],["Planned",e.planned_release?s.jsx(Bk,{planned:e.planned_release,onSelect:n}):null]]}),o?s.jsx(Nz,{batch:o}):null,a,s.jsx(Mk,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(Ok,{tracks:e.tracks,error:e.tracks_error}),s.jsx(Dk,{delivery:e.planned_delivery,candidate:!0,onSelect:n}),s.jsx(Uk,{related:l,org:t,from:"release:candidate",onRetry:()=>i(!0)})]})}function Tz({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(de,{variant:"warning",children:"Withdrawn"}):s.jsx(de,{variant:"neutral",children:e.app_changed===!1?"App unchanged":a?"First":e.bump}),e.breaking?s.jsx(de,{variant:"error",children:"Breaking"}):null]}),e.state==="withdrawn"&&e.replaced_by?s.jsxs("p",{className:"text-sm",children:["Replaced by"," ",s.jsx(tr,{query:`release=${encodeURIComponent(e.replaced_by)}`,select:e.replaced_by,onSelect:t,inline:!0,children:e.replaced_by})]}):null]})}function Rz({release:e,org:t,onSelect:n,notes:a}){const r=e.label??e.version,{related:l,read:i}=Lk(r),o=(l==null?void 0:l.state)==="ready"?Sz(l.value.previews):null;return s.jsxs(s.Fragment,{children:[s.jsx(md,{pairs:[["Environment",e.environment??"production"],["Commit",e.commit?s.jsx(hs,{children:tp(e.commit)},"commit"):null],["Readiness",e.readiness?`${Ak(e.readiness)} on staging`:null],["Previews",o],["Planned",e.planned_release?s.jsx(Bk,{planned:e.planned_release,onSelect:n}):null]]}),a,s.jsx(Mk,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(Ok,{tracks:e.tracks,error:e.tracks_error}),s.jsx(Dk,{delivery:e.planned_delivery,candidate:!1,onSelect:n}),s.jsx(Uk,{related:l,org:t,from:`release:${r}`,onRetry:()=>i(!0)})]})}function Ez({id:e,summary:t,org:n,onNotFound:a,forecast:r}){var g,j;const l=np(),[i,o]=u.useState({state:"loading"}),c=u.useRef(0),d=u.useCallback(async(v=!1)=>{const y=++c.current;if(!(l!=null&&l.plannedRelease)){o({state:"error",error:Nc,refusal:{status:409,message:Nc,reason:"view_outdated"}});return}o({state:"loading"});const x=await l.plannedRelease(e,v?{fresh:!0}:void 0);y===c.current&&o(x.ok?{state:"ready",value:x.data}:{state:"error",error:x.refusal.message,refusal:x.refusal})},[l,e]);u.useEffect(()=>{d()},[d]);const f=i.state==="error"&&(((g=i.refusal)==null?void 0:g.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(Rn,{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(de,{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(Rn,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:(t==null?void 0:t.name)??e}),zk(i.refusal)?s.jsx("p",{className:"text-muted-foreground text-sm",children:Nc}):f?null:s.jsx(Mn,{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(Rn,{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(de,{variant:"neutral",children:"Planned"})]}),h.goal?s.jsx("p",{className:"text-muted-foreground text-sm",children:h.goal}):null]}),s.jsx(md,{pairs:[["Planned Release",s.jsx(hs,{children:h.id},"id")],["Date",h.date],["Order",m],["Members",String(h.members.length)]]}),r,s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"A Planned Release changes through release_plan.py:"}),s.jsxs("pre",{className:"bg-muted rounded-md px-3 py-2 font-mono text-xs",children:["sdlc view --planned ",h.id]})]}),s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(xd,{title:"Members",count:h.members.length}),h.members.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Members",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Member"}),s.jsx(P,{children:"Level"}),s.jsx(P,{children:"Tasks"}),s.jsx(P,{children:"State"})]})}),s.jsx(Be,{children:h.members.map(v=>{const y=v.tasks.filter(p=>p.state==="done").length,x=v.tasks.filter(p=>p.state!=="done").map(p=>p.id);return s.jsxs(ie,{children:[s.jsx(I,{children:v.label}),s.jsx(I,{children:v.level?s.jsx(de,{variant:"neutral",children:Az(v.level)}):null}),s.jsx(I,{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,x.length>0?s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Open: ",s.jsx(hs,{children:x.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(I,{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($k,{rows:h.related,org:n,from:`planned:${h.id}`})]})]})}const Az=e=>e.charAt(0).toUpperCase()+e.slice(1);function np(){return nn().releases}const rs={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",noEngine:"this engine has no roadmap read: update the coordination engine"},Mv=3,Mz=["in_progress","not_started","planned","blocked"],sp="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),Nt=e=>e.charAt(0).toUpperCase()+e.slice(1);function Sf(e){const t=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(e??""));return t?`${Number(t[3])} ${sp[Number(t[2])-1]}`:String(e??"")}function Hk(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${sp[t.getMonth()]} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function Oz(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${sp[t.getMonth()]}`}function Ts(e){return e?e.from===e.to&&e.or_later?`${Sf(e.from)} or later`:`${Sf(e.from)} to ${Sf(e.to)}${e.or_later?", or later":""}`:""}function Dz(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 Ik(e){var h;const t=e??{},n=t.source??{},r=[t.no_date==="no date: no rate"&&n.rate_why?n.rate_why:"",/members estimated$/.test(t.no_date??"")?"":Dz(t)].filter(Boolean).join(" · "),l=t.projected?Ts(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=[r,c,o&&i&&t.projected?`corrected for past estimates: raw ${Ts({...i,or_later:t.projected.or_later})}`:"",d?`past forecasts at this coverage: ${d.inside} of ${d.of} inside their range`:""].filter(Boolean);return{lead:l?Nt(l):"",caption:f}}function $z(e){const t=e.kinds??[];return[t.includes("range")?"Not promised":"",e.goal??(t.includes("major")?"No goal yet":"")].filter(Boolean).join(" · ")}function zz(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,r=(e.needs_user??[]).length,l=!a&&!r?["none blocked · none waiting on you"]:[a?`${a} blocked`:"",r?`${r} waiting on you`:""],i=((f=e.tasks)==null?void 0:f.untracked_slices)??0;i&&l.push(`${i} slice${i===1?"":"s"} not tasks yet`);const o=((h=e.not_a_member)==null?void 0:h.count)??0;return o&&l.push(`${o} not a member yet`),{lead:n,rest:l.filter(Boolean).join(" · ")}}const Pk=e=>String(e??"").replace(/_/g," ");function Lz(e){const t=e??{},n=t.kinds??[],a=n.includes("slipped"),r=!a&&t.was&&t.now?Ts(t.was)===Ts(t.now)?`, range still ${Ts(t.now)}`:`, range was ${Ts(t.was)}, now ${Ts(t.now)}`:"",l=[a&&t.was?`was ${Ts(t.was)}`:"",n.includes("scope changed")?`scope changed${r}`:""].filter(Boolean),i=(t.what??[]).slice(-3).map(o=>{const c=o.by&&(o.by.title||o.by.thread||o.by.person);return`${[o.kind,o.label||o.item].filter(Boolean).join(" ")}${c?` by ${c}`:""}${o.why?`: ${o.why}`:""}`});return{head:l.length?Nt(l.join(" · ")):"",what:i}}const il="roadmap",Ov={reading:!1,value:null,refusal:null};function Uz(e){const[t,n]=u.useState({all:Ov,mine:Ov}),a=u.useRef({all:0,mine:0}),r=u.useCallback(async(l,i=!1)=>{if(!(e!=null&&e.roadmap))return;const o=++a.current[l];n(d=>({...d,[l]:{...d[l],reading:!0}}));const c=await e.roadmap({...i?{fresh:!0}:{},...l==="mine"?{mine:!0}:{}});o===a.current[l]&&n(d=>({...d,[l]:c.ok?{reading:!1,value:c.data,refusal:null}:{reading:!1,value:d[l].value,refusal:c.refusal}}))},[e]);return{reads:t,read:r,available:!!(e!=null&&e.roadmap)}}function Bz(e,t){return`${e} open${t.length?` · ${t.join(", ")} moved since you looked`:""}`}function ki({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 qk=({level:e})=>e?s.jsx(de,{variant:"neutral",children:Nt(e)}):null;function Gk({state:e}){const t=Nt(Pk(e));return Mz.includes(String(e))?s.jsx("span",{className:"font-medium",children:t}):s.jsx("span",{children:t})}function Hz({reads:e,scope:t,onScope:n,onRead:a,org:r,onSelect:l}){var m,g;const i=e[t],o=i.value,c=u.useRef(null),d=u.useRef(!1);u.useEffect(()=>{!i.reading&&!i.value&&!i.refusal&&a(t)},[t,i.reading,i.value,i.refusal,a]),u.useEffect(()=>{var j;d.current&&!i.reading&&(d.current=!1,(j=c.current)==null||j.focus())},[i.reading]);const f=()=>{d.current=!0,a(t,!0)},h=o?[o.as_of?`as of ${Hk(o.as_of)}`:"",`${((m=o.source)==null?void 0:m.machine)||"this machine"}'s records`,((g=o.decider)==null?void 0:g.words)??""].filter(Boolean).join(" · "):"";return s.jsxs(Rn,{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:c,tabIndex:-1,className:"text-lg font-semibold outline-none",children:"Roadmap"}),h?s.jsx("p",{className:"text-muted-foreground text-xs",children:h}):null]}),s.jsx("div",{role:"group","aria-label":"Roadmap scope",className:"flex gap-2",children:["all","mine"].map(j=>s.jsx(H,{variant:"outline",size:"sm","aria-pressed":t===j,onClick:()=>n(j),children:j==="all"?"All":"Mine"},j))})]}),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(vn,{"aria-hidden":!0,className:"size-4"})," ",Nt(rs.pending),"…"]}):null}),i.refusal&&!i.reading?i.refusal.reason==="no_roadmap"?s.jsx(Mn,{title:rs.failedLead,error:Nt(rs.noEngine)}):i.refusal.reason==="refused"?s.jsx(Mn,{title:rs.failedLead,error:i.refusal.message}):s.jsx(Mn,{title:rs.failedLead,error:i.refusal.message,onRetry:f}):null,o?t==="mine"?s.jsx(Fz,{mine:o.mine,org:r,onSelect:l}):s.jsx(Pz,{read:o,org:r,onSelect:l}):null]})}function Iz(e){if(!e||typeof e.seconds_per_day!="number")return"No rate";const t=Oz(e.as_of);return`${Math.round(e.seconds_per_day/3600)} task hours a day over the ${e.days} days${t?` to ${t}`:""}`}function Pz({read:e,org:t,onSelect:n}){var r,l;const a=e.releases??[];if(!a.length){const[i,o]=rs.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(ki,{children:o})]})}return s.jsxs(s.Fragment,{children:[s.jsx(md,{pairs:[["Forecast from",Nt(`${((r=e.source)==null?void 0:r.machine)||"this machine"}'s task records and rate`)],["Rate",Iz(e.rate)],["Not counted",Nt(((l=e.source)==null?void 0:l.not_counted)||"other machines' work")]]}),a.map(i=>s.jsx(qz,{row:i,org:t,onSelect:n},i.id))]})}function qz({row:e,org:t,onSelect:n}){var h,m,g;const a=Ik(e.forecast),r=zz(e),l=$z(e),i=`roadmap-${e.id}`,o=e.moved?Lz(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=[l,c&&d?`${d} not a member yet`:""].filter(Boolean).join(" · ");return s.jsxs("section",{"aria-labelledby":i,className:"flex flex-col gap-2 border-t pt-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{id:i,className:"text-base font-semibold",children:s.jsx(tr,{query:`planned=${encodeURIComponent(e.id)}`,select:Xn(e.id),onSelect:n,children:e.name})}),e.kinds.map(j=>s.jsx(de,{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:Nt(a.caption.join(" · "))}):null]}):null,f?s.jsx("p",{className:"text-muted-foreground text-sm",children:f}):null,o?s.jsxs(le,{variant:"info",children:[s.jsx(fT,{"aria-hidden":!0}),s.jsx(xe,{children:"Moved since you looked"}),s.jsxs(ae,{className:"text-info flex flex-col gap-0.5",children:[o.head?s.jsx("span",{children:o.head}):null,o.what.map((j,v)=>s.jsx("span",{className:"text-xs",children:j},v))]})]}):null,c?null:s.jsxs("p",{className:"text-sm",children:[r.lead,r.rest?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",r.rest]}):null]}),(g=e.stale_unchecked)!=null&&g.words?s.jsx("p",{className:"text-muted-foreground text-xs",children:Nt(e.stale_unchecked.words)}):null,e.for_you&&e.kinds.includes("major")?s.jsx(Gz,{row:e}):null,s.jsx(Yz,{row:e,org:t})]})}function Gz({row:e}){const t=e.for_you;return!t||!t.proposals.length&&!t.committed_nobody_on.length&&!t.widens_most&&!t.set_goal?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"For you"}),t.proposals.map(a=>{const r=[a.proposed_by_title||a.proposed_by?`by ${a.proposed_by_title||a.proposed_by}`:"",a.reason??""].filter(Boolean).join(": ");return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("p",{className:"text-sm",children:["Proposed: ",a.label||a.item]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[r?`${Nt(r).replace(/\.$/,"")}. `:"","Accept or reject in the terminal:"]}),s.jsx(ki,{children:a.accept}),s.jsx(ki,{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(ki,{children:t.set_goal})]}):null]})}function Vk({next:e,org:t}){const{href:n,Link:a}=Xe(),r=e.tasks[0],l=e.label||e.item;return r?s.jsx(a,{className:"text-primary hover:underline",href:n(`/org/${t}/tasks/${encodeURIComponent(r.id)}?from=roadmap`),children:l}):s.jsx("span",{children:l})}function Vz(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?Nt(e.nobody):""}function Yz({row:e,org:t}){const[n,a]=u.useState(!1),r=e.next??[];if(!r.length){const o=e.kinds.includes("range")?e.tagged_threads??[]:[];return o.length?s.jsx("p",{className:"text-muted-foreground text-sm",children:o.map(c=>`${c.title}: ${c.words}`).join(", ")}):null}const l=n?r:r.slice(0,Mv),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(Ue,{containerAriaLabel:`Next in ${e.name}`,children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Member"}),s.jsx(P,{children:"Level"}),s.jsx(P,{children:"State"}),s.jsx(P,{children:"Who is on it"})]})}),s.jsx(Be,{children:l.map(o=>{const c=i.get(o.item);return s.jsxs(ie,{children:[s.jsx(I,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(Vk,{next:o,org:t}),c?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[Nt(c.words),c.estimate_as_of?` (estimated ${Hk(c.estimate_as_of)})`:""]}):null]})}),s.jsx(I,{children:s.jsx(qk,{level:o.level})}),s.jsx(I,{children:s.jsx(Gk,{state:o.state})}),s.jsx(I,{children:Vz(o,e)})]},o.item)})})]})}),r.length>Mv&&!n?s.jsxs(H,{variant:"outline",size:"sm",className:"self-start",onClick:()=>a(!0),children:["Show all ",r.length]}):null,l.some(o=>i.has(o.item))?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Re-forecast it in the terminal: task-record reforecast"}):null]})}function Fz({mine:e,org:t,onSelect:n}){const{href:a,Link:r}=Xe();if(!e)return null;const l=e.tasks.filter(i=>i.propose);return s.jsxs(s.Fragment,{children:[s.jsxs("section",{"aria-labelledby":"roadmap-your-work",className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h3",{id:"roadmap-your-work",className:"text-base font-semibold",children:"Your work"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:e.title})]}),e.tasks.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:Nt(rs.noTask)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Your work",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Task"}),s.jsx(P,{children:"Release"}),s.jsx(P,{children:"Member"})]})}),s.jsx(Be,{children:e.tasks.map(i=>{var o,c;return s.jsxs(ie,{children:[s.jsx(I,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(r,{className:"text-primary font-mono text-xs hover:underline",href:a(`/org/${t}/tasks/${encodeURIComponent(i.id)}?from=roadmap`),children:i.id}),s.jsx("span",{className:"text-muted-foreground text-xs",children:[i.title||i.thread,Nt(Pk(i.state))].filter(Boolean).join(" · ")})]})}),s.jsx(I,{children:(o=i.members)!=null&&o.length?i.members.map(d=>s.jsx("div",{children:s.jsx(tr,{query:`planned=${encodeURIComponent(d.planned_release)}`,select:Xn(d.planned_release),onSelect:n,children:d.name})},d.planned_release)):i.release?s.jsx(tr,{query:`planned=${encodeURIComponent(i.release.planned_release)}`,select:Xn(i.release.planned_release),onSelect:n,children:i.release.name}):s.jsx("span",{className:"text-muted-foreground",children:i.words?Nt(i.words):"—"})}),s.jsx(I,{children:(c=i.members)!=null&&c.length?i.members.map(d=>s.jsx(qk,{level:d.level},d.planned_release)):i.not_a_member?s.jsx("span",{className:"text-muted-foreground",children:"Not a member yet"}):null})]},i.id)})})]})}),l.map(i=>{var o;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Propose ",i.id,"'s plan to ",((o=i.release)==null?void 0:o.name)??"its release"," in the terminal:"]}),s.jsx(ki,{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:Nt(rs.noNext)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Your next members",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Release"}),s.jsx(P,{children:"Member"}),s.jsx(P,{children:"State"})]})}),s.jsx(Be,{children:e.next.map(i=>s.jsxs(ie,{children:[s.jsx(I,{children:s.jsx(tr,{query:`planned=${encodeURIComponent(i.release)}`,select:Xn(i.release),onSelect:n,children:i.name})}),s.jsx(I,{children:s.jsx(Vk,{next:i,org:t})}),s.jsx(I,{children:s.jsx(Gk,{state:i.state})})]},`${i.release}:${i.item}`))})]})})]})]})}function Xz({state:e,id:t}){var r;if(!e)return null;const n=(r=e.value)==null?void 0:r.releases.find(l=>l.id===t);if(!n)return e.reading?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status",children:[s.jsx(vn,{"aria-hidden":!0,className:"size-4"})," ",Nt(rs.pending),"…"]}):e.refusal?s.jsx("p",{className:"text-muted-foreground text-xs",children:`${rs.failedLead}: ${e.refusal.message}`}):null;const a=Ik(n.forecast);return 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:Nt(a.caption.join(" · "))}):null]})}function Yk(){const e=nn().releases;if(!e)throw new Error("The Releases page rendered without a Releases contract.");return e}function Kz({initial:e,environments:t,branch_options:n,chooseBranch:a,renderWrite:r,selection:l,org:i,onReadAgain:o,onNotFound:c,notice:d,focusOnMount:f}){var Ln,Un,kt,Bn,jn,Hn,ta,js,O,ye;const h=Yk(),m=e.local??null,[g,j]=u.useState(e),[v,y]=u.useState(null),x=l?l.selected:v,p=l?l.onSelect:y,b=!!(m||g.release_branch),[w,_]=u.useState(m||e.release_branch?{state:"loading"}:{state:"ready",value:null}),[k,N]=u.useState({}),[S,A]=u.useState(null),[D,G]=u.useState(!1),[Y,T]=u.useState(null),[B,F]=u.useState(null),R=u.useRef(null),E=m?{fresh:!0}:void 0,C=u.useCallback(async J=>{const we=await h.candidate(J);_(we.ok?{state:"ready",value:we.data.candidate}:{state:"error",error:we.refusal.message,refusal:we.refusal})},[h]),U=u.useCallback(async()=>{_({state:"loading"}),await C(E)},[C,m]),X=u.useCallback(async()=>{const J=await h.list();J.ok&&j(J.data)},[h]),M=((Ln=g.release_branch)==null?void 0:Ln.id)??null;u.useEffect(()=>{if(!m&&!M)return;let J=!1;return h.candidate().then(we=>{J||_(we.ok?{state:"ready",value:we.data.candidate}:{state:"error",error:we.refusal.message,refusal:we.refusal})}),()=>{J=!0}},[M,h,m]);const Q=u.useRef(new Set),se=u.useCallback((J,we)=>N(ts=>({...ts,[J]:we.ok?{state:"ready",value:we.data.release}:{state:"error",error:we.refusal.message,refusal:we.refusal}})),[]),W=async J=>{N(we=>({...we,[J]:{state:"loading"}})),Q.current.add(J),se(J,await h.release(J,E))},K=w.state!=="ready"||w.value!==null,z=vz(x),$=Uz(m?h:void 0),ee=$.available&&x===il,[pe,je]=u.useState("all"),Ne=g.release_branch||m?K?Cs:null:((Un=g.releases[0])==null?void 0:Un.version)??null,Z=z!==null||ee?null:x===Cs?K?Cs:null:x??Ne,[me,ue]=u.useState([]),Ie=u.useRef(0);u.useEffect(()=>{if(!m||!h.roadmapMoved)return;let J=!0;const we=Ie.current;return h.roadmapMoved().then(ts=>{J&&ts.ok&&we===Ie.current&&ue(ts.data.moved.map(Ia=>Ia.name))}),()=>{J=!1}},[h,m]);const fe=$.reads.all,V=$.read;u.useEffect(()=>{z===null||!$.available||!fe.value&&!fe.reading&&!fe.refusal&&V("all")},[z,$.available,fe,V]);const[ve,Me]=u.useState(0),dt=u.useRef(0),ge=J=>{J===il&&Me(we=>we+1),p(J)};u.useEffect(()=>{if(ve!==dt.current){if(!ee){dt.current=ve;return}pe!=="all"||fe.reading||!fe.value||!h.roadmapSeen||(dt.current=ve,h.roadmapSeen(fe.value.as_of).then(J=>{J.ok&&(Ie.current+=1,ue([]))}))}},[ve,ee,pe,fe,h]);const It=new Map((((kt=fe.value)==null?void 0:kt.releases)??[]).map(J=>[J.id,[J.kinds.includes("range")?"range":"",J.forecast.projected?Ts(J.forecast.projected):"no date"].filter(Boolean).join(" · ")])),an=Z===null||Z===Cs||g.releases.some(J=>J.version===Z);u.useEffect(()=>{!m||!c||Z!==null&&Z!==Cs&&!an&&c({kind:"release",id:Z})},[m,c,Z,an]),u.useEffect(()=>{!Z||Z===Cs||Q.current.has(Z)||m&&!an||(Q.current.add(Z),h.release(Z).then(J=>se(Z,J)))},[Z,h,se,an]);const $t=u.useRef(x),yn=u.useRef(!1),bn=u.useRef(!!f),ea=u.useRef(null);u.useEffect(()=>{var we,ts;if(!m)return;if(bn.current){const Ia=(we=ea.current)==null?void 0:we.querySelector('[aria-current="true"]');if(Ia){bn.current=!1,$t.current=x,Ia.focus();return}}if($t.current!==x&&($t.current=x,yn.current=!0),!yn.current)return;const J=(ts=R.current)==null?void 0:ts.querySelector("h2");J&&(yn.current=!1,J.tabIndex=-1,J.focus())});const Pt=async J=>{if(!a)return;A(null);const we=await a(J);if(!we.ok){A(we.error);return}y(null),_({state:"loading"}),await X()},bs=async()=>{if(!g.next_before)return;F(null);const J=await h.list({before:g.next_before});if(!J.ok){F(J.refusal.message);return}j(we=>({...J.data,releases:[...we.releases,...J.data.releases]}))},te=g.release_branch?s.jsx(Wz,{value:g.release_branch.id,label:g.release_branch.name,options:n??[],can_write:g.can_write,onChange:Pt}):null,$e=m?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Read at ",Qz(m.read_at)]}),o?s.jsxs(H,{variant:"ghost",size:"sm",onClick:o,children:[s.jsx(gr,{className:"mr-1 size-4","aria-hidden":!0}),"Read again"]}):null]}):te,Re=m?yz(((Bn=g.releases[0])==null?void 0:Bn.label)??((jn=g.releases[0])==null?void 0:jn.version)??null):gz(((Hn=g.releases[0])==null?void 0:Hn.version)??null,((ta=g.release_branch)==null?void 0:ta.name)??null),zn={org:i??""};return s.jsxs(s.Fragment,{children:[s.jsx(Tk,{description:m?Ek:void 0,actions:$e}),d,m?s.jsx(bz,{}):null,S?s.jsx(Mn,{error:S}):null,m?null:t,!m&&!g.release_branch?s.jsx(Zz,{can_write:g.can_write,options:n??[],onChoose:Pt}):null,g.release_branch||g.releases.length>0||m?s.jsxs("div",{ref:ea,className:"flex flex-col gap-6 md:flex-row md:items-start",children:[s.jsx(Jz,{list:g,candidate:b?w:null,shown:ee?il:z!==null?Xn(z):Z,onSelect:ge,roadmap:$.available?Bz(((js=g.planned)==null?void 0:js.length)??0,me):null,planned_ranges:It,can_load_older:!!g.next_before,older_error:B,onLoadOlder:bs}),s.jsx("div",{className:"min-w-0 flex-1",ref:R,children:ee?s.jsx(Hz,{reads:$.reads,scope:pe,onScope:je,onRead:V,org:zn.org,onSelect:p}):z!==null?s.jsx(Ez,{id:z,summary:((O=g.planned)==null?void 0:O.find(J=>J.id===z))??null,org:zn.org,onNotFound:()=>c==null?void 0:c({kind:"planned",id:z}),forecast:$.available?s.jsx(Xz,{state:fe,id:z}):null}):Z===Cs?s.jsx(tL,{candidate:w,branch_name:((ye=g.release_branch)==null?void 0:ye.name)??null,can_write:g.can_write&&!!r,local:!!m,org:zn.org,onSelect:p,onRetry:U,onWrite:()=>G(!0)}):Z?s.jsx(nL,{detail:k[Z]??{state:"loading"},summary:g.releases.find(J=>J.version===Z)??null,local:!!m,org:zn.org,onSelect:p,onRetry:()=>W(Z)}):(g.release_branch||m)&&w.state==="ready"?s.jsx(pz,{title:Re.title,text:Re.text}):null})]}):null,r&&w.state==="ready"&&w.value?r({candidate:w.value,open:D,notice:Y,onOpenChange:J=>{J||T(null),G(J)},onStale:async J=>{T(J),await C()},onWritten:async J=>{G(!1),T(null),await X(),y(J),await U()}}):null]})}function Qz(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function Wz({value:e,label:t,options:n,can_write:a,onChange:r}){const l=n.some(i=>i.id===e);return s.jsxs("div",{className:"grid w-56 gap-2",children:[s.jsx(Oe,{htmlFor:"release-branch",children:"Release branch"}),s.jsxs(mt,{value:e,onValueChange:r,disabled:!a,children:[s.jsx(ct,{id:"release-branch",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[l?null:s.jsx(ke,{value:e,children:t??"Unnamed branch"}),n.map(i=>s.jsx(ke,{value:i.id,children:i.label},i.id))]})]}),a?null:s.jsx(Fk,{})]})}function Fk(){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 Zz({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(nu,{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(Oe,{htmlFor:"release-branch-first",children:"Release branch"}),s.jsxs(mt,{onValueChange:n,disabled:!e,children:[s.jsx(ct,{id:"release-branch-first",children:s.jsx(xt,{placeholder:"Choose a branch"})}),s.jsx(ut,{children:t.map(a=>s.jsx(ke,{value:a.id,children:a.label},a.id))})]})]}),e?null:s.jsx(Fk,{})]})}function Xk({children:e}){return s.jsx("p",{className:"text-muted-foreground px-3 pt-3 text-xs font-medium tracking-wide uppercase",children:e})}function Jz({list:e,candidate:t,shown:n,onSelect:a,roadmap:r,planned_ranges:l,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?Fi(t.value.changes):null;return s.jsxs("nav",{"aria-label":"Releases",className:"flex w-full flex-col gap-1 md:sticky md:top-0 md:max-h-[calc(100vh-3.5rem)] md:w-72 md:shrink-0 md:overflow-y-auto",children:[d&&r?s.jsx(wc,{active:n===il,onClick:()=>a(il),version:"Roadmap",badges:null,caption:r}):null,t&&(t.state!=="ready"||t.value)?s.jsx(wc,{active:n===Cs,onClick:()=>a(Cs),version:t.state==="ready"&&t.value?t.value.version:"Next release",badges:s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"info",children:"Candidate"}),f!=null&&f.breaking?s.jsx(de,{variant:"error",children:"Breaking"}):t.state==="ready"&&((h=t.value)==null?void 0:h.app_changed)===!1?s.jsx(de,{variant:"neutral",children:"App unchanged"}):t.state==="ready"&&((m=t.value)!=null&&m.classification)?s.jsx(de,{variant:"neutral",children:t.value.classification.bump}):null]}),caption:t.state==="loading"?"Classifying…":t.state==="error"?"Could not be read":Rk(t.value)}):null,d?s.jsx(eL,{list:e,shown:n,onSelect:a,ranges:l}):null,d&&e.releases.length>0?s.jsx(Xk,{children:"Released"}):null,e.releases.map(g=>{const j=d?jz(g):null;return s.jsx(wc,{active:n===g.version,onClick:()=>a(g.version),version:g.label??g.version,badges:(j==null?void 0:j.badges)??s.jsxs(s.Fragment,{children:[s.jsx(de,{variant:"neutral",children:g.previous_release_id?g.bump??"patch":"First"}),g.breaking?s.jsx(de,{variant:"error",children:"Breaking"}):null]}),caption:(j==null?void 0:j.caption)??ep(g.written_at)},g.version)}),i?s.jsx(H,{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 eL({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(Xk,{children:"Planned"}),e.planned_error?s.jsx(Mn,{title:"Planned Releases could not be read",error:e.planned_error}):null,(e.planned??[]).map((r,l)=>s.jsx(wc,{active:t===Xn(r.id),onClick:()=>n(Xn(r.id)),version:r.name,badges:s.jsx(de,{variant:"neutral",children:"Planned"}),caption:`${r.members===0?"no members":`${r.members} member${r.members===1?"":"s"}`}${l===0?" · next":""}${a!=null&&a.get(r.id)?` · ${a.get(r.id)}`:""}`},r.id))]})}function tL({candidate:e,branch_name:t,can_write:n,local:a,org:r,onSelect:l,onRetry:i,onWrite:o}){var m;if(e.state==="loading")return s.jsx(Rn,{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(Rn,{children:s.jsx(Mn,{error:e.error,onRetry:i})});const c=e.value;if(!c)return null;const d=Fi(c.changes),f=!c.previous_release,h=t??"the release branch";return s.jsxs(Rn,{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(de,{variant:"info",children:"Candidate"}),d.breaking?s.jsx(de,{variant:"error",children:"Breaking"}):c.app_changed===!1?s.jsx(de,{variant:"neutral",children:"App unchanged"}):c.classification?s.jsx(de,{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: `,Rk(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(H,{onClick:o,children:[s.jsx(nu,{className:"mr-2 size-4"}),"Write Release ",c.next_version]}):null]}),a?s.jsx(Cz,{candidate:c,org:r,onSelect:l,notes:f?null:s.jsx(yu,{changes:c.changes})}):f?null:s.jsx(yu,{changes:c.changes})]})}function nL({detail:e,summary:t,local:n,org:a,onSelect:r,onRetry:l}){const[i,o]=u.useState(!1);if((t==null?void 0:t.state)==="unreadable")return s.jsxs(Rn,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:t.label??t.version}),s.jsx(Mn,{title:"This Release could not be read",error:t.error??"Its record cannot be read."})]});if(e.state==="loading")return s.jsx(Rn,{children:s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:"Loading the Release…"})});if(e.state==="error")return s.jsx(Rn,{children:s.jsx(Mn,{error:e.error,onRetry:l})});const c=e.value,d=!c.previous_release_id,f=c.bump&&c.computed_bump&&c.bump!==c.computed_bump,h=c.label??c.version,m=async()=>{await navigator.clipboard.writeText(mz(h,Fi(c.changes))),o(!0)};return s.jsxs(Rn,{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(Tz,{release:c,onSelect:r}):s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:c.version}),s.jsx(de,{variant:"neutral",children:d?"First":c.bump}),Fi(c.changes).breaking?s.jsx(de,{variant:"error",children:"Breaking"}):null]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Written ",ep(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(H,{variant:"outline",onClick:m,children:[s.jsx(JC,{className:"mr-2 size-4"}),i?"Copied":"Copy notes"]})]}),n?s.jsx(Rz,{release:c,org:a,onSelect:r,notes:d?null:s.jsx(yu,{changes:c.changes})}):d?null:s.jsx(yu,{changes:c.changes})]})}const sL=5,aL=e=>e.retry===!0||e.reason==="store_locked"||e.status===503;function rL({org:e,query:t,onSelect:n,home:a}){var B,F;const r=Yk(),{href:l,Link:i}=Xe(),[o,c]=u.useState({state:"loading"}),[d,f]=u.useState(null),[h,m]=u.useState(null),[g,j]=u.useState(null),v=u.useRef(0),y=u.useRef(0),x=u.useRef(null),p=u.useRef(!1),b=u.useCallback(async R=>{const E=y.current+=1;m(null);const C=await r.list(R?{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&&aL(C.refusal)){m(C.refusal.retry_after??sL);return}f(C.refusal)}},[r]);u.useEffect(()=>{b(!1)},[b]),u.useEffect(()=>{if(h===null)return;const R=setTimeout(()=>void b(!1),h*1e3);return()=>clearTimeout(R)},[h,b]),u.useEffect(()=>{var E;if(!p.current||o.state==="loading"||d||h!==null)return;p.current=!1;const R=(E=x.current)==null?void 0:E.querySelector("h1");R&&(R.tabIndex=-1,R.focus())});const w=()=>{p.current=!0,v.current=0,f(null),b(!0)},_=o.state==="ok"?o.list:null,k=t.roadmap?il:t.planned!==null?t.planned===""?(B=_==null?void 0:_.planned)!=null&&B[0]?Xn(_.planned[0].id):null:Xn(t.planned):t.release,N=`${t.release??""}|${t.planned??""}|${t.roadmap?"roadmap":""}`,S=u.useRef(N);u.useEffect(()=>{S.current!==N&&(S.current=N,j(null))},[N]);const A=u.useRef(!1),D=u.useCallback(R=>{A.current=!0,j(R)},[]),G=!g&&o.state==="ok"&&A.current;if(u.useEffect(()=>{G&&(A.current=!1)},[G]),g)return s.jsx(Zs,{title:g.kind==="release"?`No Release ${g.id}`:`No open Planned Release ${g.id}`,description:"This project has no Release, candidate or open Planned Release by that name.",backHref:l(a),backLabel:"All Releases",link:i});const Y=h!==null?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(vn,{"aria-hidden":!0})," The release records are busy; reading again in ",h," s…"]}):null,T=d?s.jsxs(le,{variant:"destructive",children:[s.jsx(Vt,{}),s.jsx(xe,{children:"Releases could not be read"}),s.jsxs(ae,{className:"flex flex-col items-start gap-2",children:[s.jsxs("span",{children:[d.message,_?" The last Releases read stay below.":""]}),s.jsx(H,{variant:"outline",size:"sm",onClick:w,children:"Try again"})]})]}):null;return s.jsx("div",{ref:x,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(Kz,{initial:o.list,org:e,selection:{selected:k,onSelect:n},onReadAgain:w,onNotFound:D,notice:Y||T?s.jsxs(s.Fragment,{children:[Y,T]}):null,focusOnMount:G},((F=o.list.local)==null?void 0:F.read_at)??"list"):s.jsxs(s.Fragment,{children:[s.jsx(Tk,{description:Ek}),o.state==="engine_missing"?s.jsx(lL,{}):T??Y??s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(vn,{"aria-hidden":!0})," Loading Releases…"]})]})})}function lL(){return s.jsxs(le,{variant:"warning",children:[s.jsx(Vt,{}),s.jsx(xe,{children:"Releases need a SoftwareDLC checkout"}),s.jsxs(ae,{className:"text-warning flex flex-col items-start gap-2",children:[s.jsx("span",{children:"Run sdlc viewer from a SoftwareDLC checkout, or set SDLC_VIEW_ROOT to one, then restart it:"}),s.jsx("pre",{className:"bg-muted text-foreground rounded-md px-3 py-2 font-mono text-xs break-all whitespace-pre-wrap",children:"sdlc viewer"})]})]})}const Dv=["tasks","issues","releases"],Kk=u.createContext(null);function sn(){const e=u.useContext(Kk);if(!e)throw new Error("A shell page rendered outside the app shell.");return e}const iL=10,oL=()=>new Date;function cL({shell:e,now:t=oL,children:n}){const[a,r]=u.useState(null),[l,i]=u.useState(null),[o,c]=u.useState(null),[d,f]=u.useState(null),[h,m]=u.useState(null),[g,j]=u.useState(!0),[v,y]=u.useState(!1),[x,p]=u.useState(void 0),[b,w]=u.useState(!1),[_,k]=u.useState(Dv),N=u.useRef(!1),S=u.useRef(!1),A=u.useRef(null),D=u.useRef(!0),G=u.useCallback(async(T=!1)=>{A.current&&clearTimeout(A.current),A.current=null,y(!0);const[B,F]=await Promise.all([e.organizations.list(),e.projects.list()]);if(!D.current)return;if(y(!1),j(!1),B.ok&&F.ok){if(N.current=!0,S.current=!1,m(null),f(t()),B.data.organizations.length===0){c("not_in_git"),r(null),i(null);return}c(null),r(B.data.organizations[0]),i(F.data.projects);return}const R=B.ok?F.ok?null:F.refusal:B.refusal;if(!R)return;if(z$(R)){S.current=!1,m(null),c(R),r(null),i(null);return}const E=N.current&&!S.current&&!T;S.current=!0;const C=R.retry_after??iL;m({refusal:R,shown:!E,retryInSeconds:E?C:null}),E&&(A.current=setTimeout(()=>void G(!0),C*1e3))},[e,t]);u.useEffect(()=>(D.current=!0,G(),e.about.about().then(T=>{D.current&&(T.ok?p(T.data):T.refusal.status===404?p(null):w(!0))}),Promise.all(Dv.map(async T=>{var B;return[T,await((B=e[T])==null?void 0:B.access())]})).then(T=>{D.current&&k(T.filter(([,B])=>!(B!=null&&B.ok&&!B.data.can_view)).map(([B])=>B))}),()=>{D.current=!1,A.current&&clearTimeout(A.current)}),[e,G]);const Y={loading:g,org:a,projects:l,none:o,readAt:d,failure:h,about:x,aboutFailed:b,domains:_,reading:v,refresh:()=>void G()};return s.jsx(Kk.Provider,{value:Y,children:n})}const uL={threads:"Threads",chat:"Chat",tasks:"Tasks",queues:"Queues",worktrees:"Worktrees",workspaces:"Workspaces",chart:"Org chart"},dL={tasks:"Tasks",issues:"Issues",releases:"Releases"};function _c(e,t){return e.kind==="home"?"Home":e.kind==="org"?uL[e.page]:e.kind==="project"?e.page?dL[e.page]:t??e.project:"Not found"}const fL="(max-width: 767px)";function hL(){const e=typeof window<"u"&&window.matchMedia?window.matchMedia(fL):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 tc({className:e=""}){return s.jsx("span",{"aria-hidden":"true",className:`block animate-pulse rounded-md bg-sidebar-accent ${e}`})}function $v({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 zv({item:e,collapsed:t}){const{Link:n}=Xe(),a=e.icon,r=e.title??(t?e.label:void 0),l=s.jsx("span",{className:"block",children:s.jsxs(n,{href:e.href,className:"flex h-8 items-center gap-2 overflow-hidden rounded-md px-2 text-sm text-sidebar-foreground no-underline outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring "+(e.current?"bg-sidebar-accent font-medium text-sidebar-accent-foreground":""),"aria-current":e.current?"page":void 0,"aria-label":t?e.label:void 0,children:[s.jsx(a,{className:"size-4 shrink-0","aria-hidden":"true"}),!t&&s.jsx("span",{className:"truncate",children:e.label})]})});return s.jsx("li",{children:r?s.jsxs(SD,{children:[s.jsx(CD,{asChild:!0,children:l}),s.jsx(I_,{side:"right",children:r})]}):l})}const Lv="m-0 flex list-none flex-col gap-1 p-0";function Uv({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 Bv({page:e,collapsed:t,sheet:n=!1,hasChat:a}){var T;const{href:r}=Xe(),{worktrees:l}=nn(),i=sn(),{org:o,projects:c,loading:d,none:f,about:h,aboutFailed:m,domains:g}=i,j=o?`/org/${o.slug}`:"",v=c==null?void 0:c.find(B=>B.current),y=((T=o==null?void 0:o.source)==null?void 0:T.kind)==="folder"&&v!==void 0,x=B=>y&&v?`${B} · ${v.name}`:B,p=x("Workspaces"),b=x("Tasks"),w=x("Queues"),_=B=>y?B:void 0,k=[{label:"Home",href:r(j||"/"),icon:mT,current:e.kind==="home"},{label:"Threads",href:r(`${j}/threads`),icon:AT,current:e.kind==="org"&&e.page==="threads"},...a?[{label:"Chat",href:r(`${j}/chat`),icon:RT,current:e.kind==="org"&&e.page==="chat"}]:[],...g.includes("tasks")?[{label:b,title:_(b),href:r(`${j}/tasks`),icon:l0,current:e.kind==="org"&&e.page==="tasks"}]:[],{label:w,title:_(w),href:r(`${j}/queues`),icon:i0,current:e.kind==="org"&&e.page==="queues"},...l?[{label:"Worktrees",href:r(`${j}/worktrees`),icon:r0,current:e.kind==="org"&&e.page==="worktrees"}]:[],{label:p,title:_(p),href:r(`${j}/workspaces`),icon:oT,current:e.kind==="org"&&e.page==="workspaces"},{label:"Org chart",href:r(`${j}/chart`),icon:$T,current:e.kind==="org"&&e.page==="chart"}],N=d?null:f?"No organization":(o==null?void 0:o.name)??"Organization",S=o?D$(o):null,A=h==null?void 0:h.version,D=A?t?A:`sdlc ${A}`:m?xu:hd,G=m||(h==null?void 0:h.sync.state)==="unknown"?A$:h===void 0?E$:R$;let Y;return d?Y=s.jsx("div",{className:"px-2 py-1",children:s.jsxs($v,{label:"Loading projects",children:[s.jsx(tc,{className:"h-4 w-32"}),s.jsx(tc,{className:"h-4 w-24"})]})}):c?Y=s.jsx("ul",{className:Lv,children:c.map(B=>s.jsx(zv,{collapsed:t,item:{label:B.name,title:B.name,href:r(`/proj/${encodeURIComponent(B.id)}`),icon:lT,current:e.kind==="project"&&e.project===B.id}},B.id))}):Y=s.jsx("p",{className:"m-0 px-2 text-sm text-sidebar-foreground/70",children:f?"No projects":xu}),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(UC,{className:"size-4","aria-hidden":"true"})}),!t&&s.jsx("div",{className:"grid min-w-0 flex-1 text-left text-sm leading-tight",children:N===null?s.jsxs($v,{label:"Loading organization",children:[s.jsx(tc,{className:"h-4 w-28"}),s.jsx(tc,{className:"h-3 w-24"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-semibold",title:N,children:N}),S&&s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/70",children:S})]})})]}),s.jsxs("nav",{"aria-label":"App",className:"min-h-0 flex-1 overflow-y-auto",children:[s.jsx(Uv,{label:"Organization",collapsed:t,children:s.jsx("ul",{className:Lv,children:k.map(B=>s.jsx(zv,{item:B,collapsed:t},B.label))})}),!t&&s.jsx(Uv,{label:"Projects",collapsed:t,children:Y})]}),h!==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:A?`sdlc ${A}`:void 0,children:D}),!t&&s.jsxs("p",{className:"m-0 flex items-start gap-2 px-2",children:[s.jsx(uT,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{children:G})]})]})]})}const mL="outline-hidden rounded-sm focus-visible:ring-2 focus-visible:ring-ring";function xL({page:e}){var c;const{href:t,Link:n}=Xe(),{org:a,projects:r,loading:l,none:i}=sn(),o=[];if(l)o.push({label:hd});else if(i)o.push({label:"No organization"});else{const d=(a==null?void 0:a.name)??"Organization";if(o.push({label:d,href:e.kind==="home"?void 0:t(a?`/org/${a.slug}`:"/")}),e.kind==="project"){const f=((c=r==null?void 0:r.find(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:_c(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:_c(e),href:t(f)}),o.push({label:e.item})}else e.kind!=="home"&&!(e.kind==="project"&&!e.page)&&o.push({label:_c(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(s0,{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 ${mL}`,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 pL({page:e,chat:t=!1,children:n}){var p;const a=hL(),[r,l]=u.useState(!0),[i,o]=u.useState(!1),c=u.useRef(null),d=u.useRef(null),{org:f,projects:h,loading:m,none:g}=sn(),j=e.kind==="project"?(p=h==null?void 0:h.find(b=>b.id===e.project))==null?void 0:p.name:void 0;u.useEffect(()=>{const b=m?hd:g?"No organization":(f==null?void 0:f.name)??"Organization",w=(e.kind==="org"||e.kind==="project")&&e.item!==void 0?`${e.item} · `:"";document.title=`${w}${_c(e,j)} · ${b} · sdlc viewer`},[e,j,f,m,g]);const v=()=>{var b;o(!1),(b=c.current)==null||b.focus()};u.useEffect(()=>{a||o(!1)},[a]);const y=a&&i;u.useEffect(()=>{var _;const b=d.current;if(!y||!b)return;(_=b.querySelector("a, button"))==null||_.focus();const w=k=>{var G;if(k.key==="Escape"){o(!1),(G=c.current)==null||G.focus();return}if(k.key!=="Tab")return;const N=[...b.querySelectorAll("a[href], button:not([disabled])")];if(N.length===0)return;const S=N[0],A=N[N.length-1],D=b.contains(document.activeElement);k.shiftKey&&(document.activeElement===S||!D)?(k.preventDefault(),A.focus()):!k.shiftKey&&(document.activeElement===A||!D)&&(k.preventDefault(),S.focus())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[y]);const x=!a&&!r;return s.jsx(kD,{children:s.jsxs("div",{className:"flex h-svh min-h-0 overflow-hidden bg-background text-foreground",children:[!a&&s.jsx("aside",{"aria-label":"Sidebar",className:`shrink-0 border-r border-sidebar-border transition-[width] ${x?"w-12":"w-64"}`,children:s.jsx(Bv,{page:e,collapsed:x,hasChat:t})}),y&&s.jsxs("div",{className:"fixed inset-0 z-50 flex",children:[s.jsxs("aside",{ref:d,role:"dialog","aria-modal":"true","aria-label":"Sidebar",className:"relative w-72 max-w-[85vw] border-r border-sidebar-border",children:[s.jsx(Bv,{page:e,collapsed:!1,sheet:!0,hasChat:t}),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:v,children:s.jsx(ix,{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:v})]}),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] ${x?"h-12":"h-16"}`,children:[s.jsx("button",{ref:c,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":a?i:r,onClick:()=>a?o(b=>!b):l(b=>!b),children:s.jsx(LT,{className:"size-4","aria-hidden":"true"})}),s.jsx("span",{"aria-hidden":"true",className:"mr-2 h-4 w-px bg-border"}),s.jsx(xL,{page:e})]}),s.jsx("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto",children:n})]})]})})}const Qk={working:{label:"Working",tone:"success"},waiting:{label:"Waiting for you",tone:"warning"},closed:{label:"Closed",tone:"neutral"},continued:{label:"Continued elsewhere",tone:"neutral"}},ap="m-0 text-2xl font-semibold tracking-tight",rp="outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",lp=`rounded-sm font-medium text-primary no-underline hover:underline ${rp}`;function Cf({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 gL({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(Cf,{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(Cf,{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(Cf,{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?fr:O$})]})}const Hv=`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 ${rp}`;function vL(){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 br(){const{href:e,Link:t}=Xe(),{loading:n,projects:a,none:r,failure:l,readAt:i,refresh:o,reading:c}=sn(),[d,f]=u.useState(""),h=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:ap,children:"Projects"}),!r&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:M$})]});if(r)return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,s.jsx(gL,{why:r==="not_in_git"?{kind:"not_in_git"}:U$(r)})]});const m=l!=null&&l.shown?l:null,g=(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:rk(m.refusal,i)}),s.jsx("div",{children:s.jsx("button",{type:"button",className:Hv,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 ${rp}`}),!m&&s.jsx("button",{type:"button",className:`${Hv} ml-auto`,onClick:o,disabled:c||n,children:"Refresh"})]}),l&&!l.shown&&i&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`Showing the list read at ${li(i)}; reading again in ${l.retryInSeconds??10} seconds.`})]}),n?s.jsx(vL,{}):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:[g.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:lp,children:j.name})}),s.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:j.location??xu}),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)),g.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 Wk({title:e,children:t}){const{href:n,Link:a}=Xe();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:ap,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 ${lp}`,children:"Back to the organization's Home"})})]})})}const yL={tasks:"Tasks",issues:"Issues",releases:"Releases"};function Xi({project:e}){const{href:t,Link:n}=Xe(),{org:a,projects:r,loading:l,domains:i}=sn(),o=r==null?void 0:r.find(c=>c.id===e);return l?s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:hd}):r?o?s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:ap,children:o.name}),s.jsx("p",{className:"m-0 font-mono text-sm text-muted-foreground",children:o.location??xu})]}),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:lp,children:yL[c]})},c))}):s.jsx("p",{className:"m-0 max-w-2xl text-sm text-muted-foreground",children:"Tasks, issues and Releases are read by the SoftwareDLC coordination engine, which this repository does not have."}):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(Wk,{title:"Project not found",children:`There is no project '${e}' in this organization.`}):s.jsx(br,{})}const ip=e=>e instanceof Error?e.message:String(e);async function op(){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:ip(e)}}}async function bL(){var e;try{const t=await fetch("api/release-links?threads",{cache:"no-store"});if(!t.ok)return null;const n=await t.json(),a=(e=n==null?void 0:n.panel)==null?void 0:e.threads;if(!a||typeof a!="object"||Array.isArray(a))return null;const r={};for(const[l,i]of Object.entries(a)){const o=(Array.isArray(i)?i:[]).filter(c=>!!c&&typeof c.planned_release=="string"&&typeof c.name=="string"&&typeof c.level=="string");o.length&&(r[l]=o)}return r}catch{return null}}async function jL(){try{return(await fetch("api/pin",{method:"HEAD",cache:"no-store"})).ok}catch{return!1}}async function wL(){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 NL(){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:ip(e)}}}async function _L(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 ip(n)}}const kL={probe:{source:async()=>{const e=await op();if("error"in e)throw new Error(e.error);return{label:"Local workspace"}}}},cp={href:e=>e.replace(/^\/+/,"")||"./",Link:({href:e,className:t,children:n,...a})=>s.jsx("a",{href:e,className:t,...a,children:n})},SL={label:"Local viewer",can:()=>!1};function CL(){return u.useEffect(()=>{document.title="Shared app UI · SDLC Workspace Viewer"},[]),s.jsx("div",{className:"app-ui dark",children:s.jsx(t0,{data:kL,router:cp,identity:SL,children:s.jsx(bC,{})})})}const TL="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.",RL=3e4,EL="Reading the workspaces. On a plan workspace this can take a few minutes.",AL="The read failed. Details are in the terminal running sdlc viewer.",ML={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"}},OL=e=>ML[e]??{label:e,tone:"neutral"},ja=e=>e.slice(0,8),Zk={human:"Human",ai:"AI"},tm=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function DL(){const e=nn().workspaces;if(!e)throw new Error("The Workspaces page rendered without the workspaces seam.");return e}function $L(e){const t=DL(),[n,a]=u.useState(null),[r,l]=u.useState(null),[i,o]=u.useState(!1),c=u.useRef(null),d=u.useRef(!1),f=u.useRef(null),h=u.useCallback(()=>{if(f.current)return f.current;const y=(async()=>{const x=await t.overview();x.ok?(a(x.data),l(null),o(!1)):(l(x.refusal),o(!0))})().finally(()=>{f.current=null});return f.current=y,y},[t]);u.useEffect(()=>{h()},[h]),pu(()=>void h(),RL),u.useEffect(()=>{var y;d.current&&(n||r)&&(d.current=!1,(y=c.current)==null||y.focus())},[n,r]);const m=()=>{d.current=!0,h()},g=n===null&&r===null,j=n===null&&r!==null,v=n?zL(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(Xt,{title:"Workspaces",description:TL,actions:s.jsxs(s.Fragment,{children:[v?s.jsx("p",{className:"text-muted-foreground text-xs",children:v}):null,s.jsxs(H,{type:"button",variant:"outline",size:"sm","aria-disabled":g||void 0,"aria-describedby":g?"workspaces-reading":void 0,className:"gap-2",onClick:g?void 0:()=>void h(),children:[s.jsx(gr,{className:"size-4","aria-hidden":"true"}),"Read again"]}),g?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?Jk(n,i):""})]})}),s.jsxs("div",{ref:c,tabIndex:-1,className:"outline-none",children:[g?s.jsx(LL,{}):null,j&&r?s.jsx(UL,{refusal:r,on_retry:m}):null,n?s.jsx(BL,{overview:n}):null]})]})}function Jk(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 zL(e,t){const n=`Read at ${Wn(new Date(e.read_at).toISOString())}`,a=Jk(e,t);return a?`${n} · ${a}`:n}function LL(){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(st,{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:EL})]})}function UL({refusal:e,on_retry:t}){const n=e.reason==="store_locked"?rk(e,null):AL;return s.jsxs(le,{variant:"destructive",className:"mt-6",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Could not read workspaces"}),s.jsxs(ae,{children:[s.jsx("p",{children:n}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function BL({overview:e}){const{counts:t}=e,n=[tm(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(nc,{id:"workspaces-lineage",title:"Lineage",caption:"Each workspace under the one it forked from",children:s.jsx(HL,{rows:e.workspaces})}),s.jsx(nc,{id:"workspaces-authority",title:"Authority and resolver",caption:"What this checkout's workspace may change",children:s.jsx(IL,{authority:e.authority})})]}),s.jsx(nc,{id:"workspaces-activity",className:"mt-4",title:"Integration activity",caption:"Newest first",children:e.activity.length===0?s.jsx(Iv,{children:"No integration or reconciliation attempts yet."}):s.jsx(qL,{rows:e.activity})}),s.jsx(nc,{id:"workspaces-handoffs",className:"mt-4",title:"Handoffs",children:e.handoffs.length===0?s.jsx(Iv,{children:"No Handoffs prepared yet."}):s.jsx(GL,{rows:e.handoffs})})]})}function nc({id:e,title:t,caption:n,className:a,children:r}){return s.jsxs("section",{"aria-labelledby":e,className:ne("min-w-0",a),children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-baseline gap-x-2",children:[s.jsx("h2",{id:e,className:"text-lg font-semibold",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),r]})}const Iv=({children:e})=>s.jsx("p",{className:"text-muted-foreground text-sm",children:e}),bu=({children:e,tone:t})=>s.jsx("div",{className:ne("text-xs",t==="error"?"text-destructive":"text-muted-foreground"),children:e});function Ki({status:e}){const t=OL(e);return s.jsx(de,{variant:t.tone,children:t.label})}function pd({label:e,children:t}){return s.jsx(yt,{role:"group","aria-label":e,tabIndex:0,className:"overflow-x-auto outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:t})}function HL({rows:e}){return s.jsx(pd,{label:"Workspaces",children:s.jsxs(Ue,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Workspace"}),s.jsx(P,{children:"Actor"}),s.jsx(P,{children:"Forked from"}),s.jsx(P,{children:"Status"}),s.jsx(P,{children:"Projection"})]})}),s.jsx(Be,{children:e.map(t=>s.jsxs(ie,{"data-testid":"workspaces-row",children:[s.jsxs(I,{children:[s.jsx("div",{className:"font-mono font-medium",children:t.short_id}),s.jsx(bu,{children:t.current?`${t.path} · This checkout`:t.path}),t.projection==="unreadable"&&t.projection_error&&s.jsx(bu,{children:t.projection_error})]}),s.jsx(I,{children:Zk[t.actor]}),s.jsx(I,{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(I,{children:s.jsx(Ki,{status:t.status})}),s.jsx(I,{children:s.jsx(Ki,{status:t.projection})})]},t.id))})]})})}function IL({authority:e}){const t=e.resolver,n=[["Workspace",s.jsx("span",{className:"font-mono",children:ja(e.workspace_id)},"id")],["Actor",Zk[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(Ki,{status:t.state==="ready"?"ready":"needs_attention"},"resolver")]),t.state==="needs_attention"&&t.issue&&n.push(["Resolver issue",t.issue]),s.jsx(pd,{label:"Authority and resolver",children:s.jsx(Ue,{containerClassName:"overflow-visible",children:s.jsx(Be,{children:n.map(([a,r])=>s.jsxs(ie,{children:[s.jsx(P,{scope:"row",className:"text-muted-foreground font-normal",children:a}),s.jsx(I,{children:r})]},a))})})})}function PL(e){const t=[e.merge_attempts?tm(e.merge_attempts,"merge attempt"):null,e.resolver_attempts?tm(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 qL({rows:e}){return s.jsx(pd,{label:"Integration activity",children:s.jsxs(Ue,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"Change"}),s.jsx(P,{children:"Status"}),s.jsx(P,{children:"Attempts"}),s.jsx(P,{children:"Updated"})]})}),s.jsx(Be,{children:e.map((t,n)=>s.jsxs(ie,{children:[s.jsxs(I,{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(bu,{children:t.kind==="integration"?"Integration":"Source reconciliation"})]}),s.jsx(I,{children:s.jsx(Ki,{status:t.status})}),s.jsx(I,{children:PL(t)}),s.jsx(I,{children:G_(t.updated_at)})]},`${t.kind}-${t.child_id}-${t.other_id}-${t.updated_at}-${n}`))})]})})}function GL({rows:e}){return s.jsx(pd,{label:"Handoffs",children:s.jsxs(Ue,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{children:"From"}),s.jsx(P,{children:"To"}),s.jsx(P,{children:"Status"}),s.jsx(P,{children:"Pinned"})]})}),s.jsx(Be,{children:e.map(t=>s.jsxs(ie,{children:[s.jsxs(I,{children:[s.jsx("div",{className:"font-mono font-medium",children:ja(t.child_id)}),t.error?s.jsx(bu,{children:t.error}):null]}),s.jsx(I,{className:"font-mono",children:ja(t.source_id)}),s.jsx(I,{children:s.jsx(Ki,{status:t.status})}),s.jsx(I,{children:`${t.child_commit} onto ${t.source_commit}`})]},t.id))})]})})}const Pv="This machine's worktrees of this repository.",VL="Merge sends one whose thread is at rest to the main queue.",YL=3e4,FL=3e3,XL=6e5,Tf=[{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"}],Zl={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"}},KL="no thread to land it",up="its thread waits on you",e1="its thread is done",t1="its thread is retired",dp=e=>e.archivable&&e.cleanup==="user",QL=e=>e.queue!==null||e.merge.offered===!1&&e.merge.why==="already in a promotion queue",WL=e=>!e.merge.offered&&(e.merge.why===e1||e.merge.why.startsWith(t1)),fp=e=>!e.merge.offered&&e.merge.why===KL||WL(e),Rf=(e,t)=>t==="all"?!0:t==="decide"?dp(e):(e.landed!==null?"landed":QL(e)?"queued":fp(e)?"orphan":"needs")===t,ZL=e=>e.landed!==null?e.threads.some(t=>t.phase!=="done"):e.threads.length>0&&!fp(e);function kc(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 JL(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 Ef=e=>Wn(new Date(e*1e3).toISOString()),ii=e=>e.charAt(0).toUpperCase()+e.slice(1);function e6(e,t){var r;const n=t.phase?ii(t.phase):"No phase",a=e.merge;if(!a.offered&&a.why.startsWith(t1)){const l=(r=/; (.+) continues it$/.exec(a.why))==null?void 0:r[1];return l?`Retired · continued by ${l}`:"Retired"}return t.phase==="done"||!a.offered&&a.why===e1?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===up?`${n} · waits on you`:a.why.startsWith("its session is not running")?`${n} · session not running`:n}function t6(){const e=nn().worktrees;if(!e)throw new Error("The Worktrees page rendered without the worktrees seam.");return e}function n6({org:e}){var U,X;const t=t6(),[n,a]=u.useState(null),[r,l]=u.useState(null),[i,o]=u.useState(null),[c,d]=u.useState(!1),[f,h]=u.useState("all"),[m,g]=u.useState(""),[j,v]=u.useState({}),y=u.useRef({}),{confirm:x,confirm_dialog:p}=$l(),b=u.useRef(!1),w=u.useCallback(async()=>{if(b.current)return;b.current=!0;const M=await t.list();b.current=!1,M.ok?(a(M.data),l(null)):l(M.refusal)},[t]),_=u.useCallback(async()=>{const M=await t.sizes();d(!M.ok),M.ok&&o(M.data)},[t]);u.useEffect(()=>{w(),_()},[w,_]);const k=(n==null?void 0:n.rows.some(M=>{var Q,se;return((Q=M.write)==null?void 0:Q.state)==="waiting"||((se=M.write)==null?void 0:se.state)==="running"}))??!1;pu(()=>void w(),k?FL:YL),pu(()=>void _(),XL);const N=(n==null?void 0:n.rows)??[],S=M=>i==null?void 0:i.sizes[M.path],A=N.filter(dp),D=i?A.reduce((M,Q)=>M+(S(Q)??0),0):null,G=N.length===0?Pv:`${Pv} ${VL}${A.length?` ${A.length} ${A.length===1?"is":"are"} yours to decide${D!==null?`: removing them frees about ${kc(D)}`:""}.`:""}`,Y=m.trim().toLowerCase(),T=M=>!Y||[M.name,M.path,M.branch??"",...M.threads.map(Q=>Q.title??Q.thread)].some(Q=>Q.toLowerCase().includes(Y)),B=N.filter(M=>Rf(M,f)&&T(M)).sort((M,Q)=>{if(f==="decide")return(S(Q)??0)-(S(M)??0);const se=W=>ZL(W)?W.merge.offered?0:1:2;return se(M)-se(Q)||(M.idle_days??1/0)-(Q.idle_days??1/0)}),F=async(M,Q)=>{const se=await(M==="merge"?t.merge(Q.path):t.remove(Q.path));se.ok?v(({[Q.path]:W,...K})=>K):v(W=>({...W,[Q.path]:se.refusal.message})),await w()},R=async M=>{if(!M.merge.offered)return;const Q=M.threads.find(ee=>ee.thread===(M.merge.offered&&M.merge.thread)),se=(Q==null?void 0:Q.title)??M.merge.thread,W=Q!=null&&Q.holds.length?`has ${Q.holds.length} open hold(s) (${Q.holds.join(", ")})`:"has no open holds",K=M.merge.lands.by==="manager"?`on its turn the queue's merge manager, ${M.merge.lands.manager}, lands it on main`:"on its turn that thread lands it on main",z=M.merge.caveat?`
|
|
398
|
+
|
|
399
|
+
Its session could not be read: ${M.merge.caveat}. A turn it does not start passes on.`:"";await x({title:`Send ${M.name} to the main queue`,description:`This joins the main promotion queue for its thread, ${se}, which ${W} and is told of the join. The queue checks the branch first, and ${K}. Nothing reaches main before then.${z}`,action_label:"Join the main queue"})&&await F("merge",M)},E=async M=>{const Q=S(M);await x({title:`Remove ${M.name}?`,description:`This deletes the folder ${M.path}${Q!==void 0?` and frees about ${kc(Q)}`:""}.${M.branch?` Its branch ${M.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 ${M.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})&&(Q!==void 0&&(y.current[M.path]=Q),await F("remove",M))},C=async M=>{await t.dismiss(M),await w()};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(Xt,{title:"Worktrees",description:G}),!n&&!r&&s.jsx(s6,{}),r?s.jsx(a6,{refusal:r,read_at:n==null?void 0:n.read_at,on_retry:()=>void w()}):null,n!=null&&n.stale?s.jsxs(le,{variant:"destructive",className:"mt-4",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Could not read worktrees"}),s.jsxs(ae,{children:[s.jsxs("p",{children:[n.stale.message," This list was read at ",Wn(new Date(n.read_at).toISOString()),"."]}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void w(),children:"Retry"})]})]}):null,n==null?void 0:n.removals.map(M=>s.jsxs(le,{variant:"success",className:"mt-4",role:"status",children:[s.jsx(xe,{children:y.current[M.path]!==void 0?`Removed ${M.name} and freed ${kc(y.current[M.path])}`:`Removed ${M.name}`}),s.jsxs(ae,{children:[s.jsx("p",{children:M.branch?`Its branch ${M.branch} stays, and its records were saved.`:"Its records were saved."}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void C({removal:M.path}),children:"Dismiss"})]})]},M.path)),n&&N.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(r0,{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(At,{type:"search",className:"w-64","aria-label":"Search worktrees",placeholder:"Search worktrees",value:m,onChange:M=>g(M.target.value)}),s.jsxs("p",{className:"text-muted-foreground ml-auto text-xs",children:["Read at ",Wn(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:Tf.map(M=>s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:al,"aria-pressed":f===M.id,onClick:()=>h(M.id),children:[M.label," ",N.filter(Q=>Rf(Q,M.id)).length]},M.id))}),B.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(qu,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No worktrees match"}),Y?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(U=Tf.find(M=>M.id===f))==null?void 0:U.empty," matches “",m,"”. Clear the search to see all"," ",N.filter(M=>Rf(M,f)).length,"."]}),s.jsx(H,{type:"button",variant:"outline",onClick:()=>g(""),children:"Clear search"})]}):s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(X=Tf.find(M=>M.id===f))==null?void 0:X.empty," right now."]})]}):s.jsx(yt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Worktrees",className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(ie,{children:[s.jsx(P,{className:"w-[24%]",children:"Worktree"}),s.jsx(P,{className:"w-[24%]",children:"Threads"}),s.jsx(P,{className:"w-[12%]",children:"Landed"}),s.jsx(P,{className:"w-[18%]",children:"Cleanup"}),s.jsx(P,{className:"hidden w-[10%] md:table-cell",children:"Last commit"}),s.jsx(P,{className:"w-[12%] text-right",children:"Actions"})]})}),s.jsx(Be,{children:B.map(M=>s.jsx(r6,{org:e,row:M,size:S(M),sizes:i!==null?"read":c?"failed":"measuring",can_write:n.can_write,sent:j[M.path],on_merge:()=>void R(M),on_remove:()=>void E(M),on_dismiss:Q=>void C(Q),on_clear_sent:()=>v(({[M.path]:Q,...se})=>se)},M.path))})]})})]}):null,p]})}function s6(){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(st,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function a6({refusal:e,read_at:t,on_retry:n}){return e.reason==="engine_missing"?s.jsxs(le,{variant:"info",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Worktrees needs a SoftwareDLC checkout"}),s.jsx(ae,{children:"sdlc viewer reads worktrees with the view code of a SoftwareDLC checkout, and this repository has none. Set SDLC_VIEW_ROOT to one, then restart sdlc viewer."})]}):e.reason==="view_outdated"?s.jsxs(le,{variant:"warning",className:"mt-6",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"The main checkout's view code is too old for Worktrees"}),s.jsx(ae,{children:"Update the main checkout, then restart sdlc viewer."})]}):s.jsxs(le,{variant:"destructive",className:"mt-6",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Could not read worktrees"}),s.jsxs(ae,{children:[s.jsxs("p",{children:[e.message,t?` This list was read at ${Wn(new Date(t).toISOString())}.`:""]}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function sc({children:e,muted:t=!0}){return s.jsx("div",{className:ne("truncate text-xs",t&&"text-muted-foreground"),title:e,children:e})}function r6({org:e,row:t,size:n,sizes:a,can_write:r,sent:l,on_merge:i,on_remove:o,on_dismiss:c,on_clear_sent:d}){const{href:f,Link:h}=Xe(),m=e?`/org/${encodeURIComponent(e)}`:"",g=f(`${m}/threads`),j=f(`${m}/tasks`),v=Zl[t.landed??"not_landed"],y=dp(t),x=t.write,p=(x==null?void 0:x.state)==="waiting"||(x==null?void 0:x.state)==="running",b=t.threads.find(G=>"thread"in t.merge&&G.thread===t.merge.thread)??t.threads[0],w=t.merge,_=!w.offered&&w.why===up,k=r&&t.landed===null&&!t.queue&&!_&&!fp(t),N=n!==void 0?kc(n):a==="measuring"?"Measuring size…":a==="failed"?"Size could not be read":null,S=y?{label:"Yours to decide",muted:!1,second:[N,t.cleanup_why[0]]}:t.archivable?{label:"The manager removes it",muted:!1,second:[N]}:{label:"Stays",muted:!0,second:[N,t.why[0]??null]},A=S.second.filter(Boolean).join(" · "),D=t.path.slice(0,t.path.length-t.name.length-1)||".";return s.jsxs(s.Fragment,{children:[s.jsxs(ie,{"data-testid":"worktrees-row",children:[s.jsxs(I,{children:[s.jsx("div",{className:"truncate font-medium",title:t.name,children:t.name}),s.jsx(sc,{children:t.branch??"Detached"}),D!==".sdlc-worktrees"?s.jsx(sc,{children:`in ${D}`}):null]}),s.jsx(I,{children:b?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"truncate",title:b.title??b.thread,children:b.title??b.thread}),s.jsx(sc,{children:`${e6(t,b)}${t.threads.length>1?` · ${t.threads.length-1} more`:""}`})]}):s.jsx("span",{className:"text-muted-foreground",children:"No thread"})}),s.jsx(I,{children:s.jsx(de,{variant:v.tone,children:v.label})}),s.jsxs(I,{children:[s.jsx("div",{className:ne("truncate",S.muted&&"text-muted-foreground"),children:S.label}),A?s.jsx("div",{className:"hidden md:block",children:s.jsx(sc,{children:A})}):null]}),s.jsx(I,{className:"hidden md:table-cell",children:JL(t.idle_days)}),s.jsx(I,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[p?s.jsx(H,{type:"button",variant:"outline",size:"sm",loading:!0,disabled:!0,children:(x==null?void 0:x.kind)==="merge"?x.state==="waiting"?"Waiting to join…":"Joining main…":(x==null?void 0:x.state)==="waiting"?"Waiting to remove…":"Removing…"}):t.queue?s.jsx(de,{variant:Zl.queued.tone,children:`${Zl.queued.label} · ${n1(t.queue.position)}`}):_?s.jsx(h,{href:j,"aria-label":`${t.name}: its thread waits on you, in Waiting on you`,children:s.jsx(de,{variant:Zl.needs_you.tone,children:Zl.needs_you.label})}):k?s.jsx(H,{type:"button",variant:"outline",size:"sm",title:w.offered?void 0:w.why,"aria-disabled":!w.offered||void 0,className:ne(!w.offered&&"cursor-not-allowed opacity-50"),"aria-label":`Send ${t.name} to the main queue`,"aria-describedby":w.offered?void 0:`why-${t.name}`,onClick:w.offered?i:void 0,children:"Merge"}):null,y&&r&&!p?s.jsx(H,{type:"button",variant:"outline",size:"sm","aria-label":`Remove ${t.name}`,onClick:o,children:"Remove"}):null]})})]}),s.jsx(l6,{row:t,threads:g,tasks:j,merge_shown:k,sent:l,on_dismiss:c,on_clear_sent:d})]})}function l6({row:e,threads:t,tasks:n,merge_shown:a,sent:r,on_dismiss:l,on_clear_sent:i}){var j,v,y,x;const{Link:o}=Xe(),c=(p="Open in Threads")=>s.jsx(o,{className:"text-primary text-sm hover:underline",href:t,children:p}),d=p=>s.jsx(H,{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 g=null;if(r)g=s.jsxs(le,{variant:"destructive",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"It was not sent"}),s.jsxs(ae,{children:[s.jsx("p",{children:r}),d(i)]})]});else if((f==null?void 0:f.state)==="waiting")g=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")g=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";g=s.jsxs(le,{variant:f.told?"success":"warning",role:"status",children:[s.jsx(xe,{children:`${e.name} joined the main queue, ${n1(f.position)}`}),s.jsxs(ae,{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 ${Ef(e.queue.passes_at)}.`}):null,s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),!f.told||((y=e.queue)==null?void 0:y.position)===1?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(f&&(f.state==="refused"||f.state==="failed")){const p=f.kind==="merge"?`The main queue refused ${e.name}`:`${e.name} was not removed`;g=s.jsxs(le,{variant:"destructive",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:f.kind==="merge"&&f.state==="failed"?`${e.name} did not join`:p}),s.jsxs(ae,{children:[s.jsx("p",{children:`${ii(f.message)}${f.kind==="merge"?" Nothing was queued.":" Nothing was deleted."}`}),s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),f.kind==="merge"?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(e.last_turn){const p=e.last_turn;g=s.jsxs(le,{variant:"warning",children:[s.jsx(nt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:`${e.name}'s turn ${p.outcome==="failed"?"failed":"passed on"} at ${Ef(p.left_at)}`}),s.jsxs(ae,{children:[s.jsx("p",{children:`${ii(p.reason)}. Continue the thread in its session; Merge sends it again once it is at rest.`}),s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({turn:{execution:p.execution,left_at:p.left_at}})),s.jsx("span",{className:"mt-2",children:c()})]})]})]})}else((x=e.queue)==null?void 0:x.position)===1&&e.queue.turn==="next"&&e.queue.passes_at?g=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 ${Ef(e.queue.passes_at)}. `,c()]}):!e.merge.offered&&e.merge.why===up?g=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?g=s.jsx("p",{className:"text-sm",children:c("Open its successor in Threads")}):a&&!e.merge.offered?g=s.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:[`${ii(e.merge.why)}. `,e.merge.thread&&!e.merge.why.startsWith("its thread is at work")?c():null]}):e.merge.offered&&e.merge.caveat&&(g=s.jsx("p",{className:"text-muted-foreground text-sm",children:`${ii(e.merge.caveat)}.`}));return g?s.jsx(ie,{className:"hover:bg-transparent",children:s.jsx(I,{colSpan:6,className:"pt-0",children:g})}):null}const i6=["reason","since","store","repository","folder","home","member_path"];function s1(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);for(const a of i6){const r=t==null?void 0:t[a];typeof r=="string"&&(n[a]=r)}return n}function jr({base:e="",fetcher:t=fetch}){return async(n,a={})=>{const r=new URLSearchParams;for(const[c,d]of Object.entries(a))if(Array.isArray(d))for(const f of d)r.append(c,f);else d!==void 0&&d!==!1&&d!==""&&r.set(c,String(d));const l=r.size>0?`?${r.toString()}`:"";let i;try{i=await t(`${e}api/app/${n}${l}`,{cache:"no-store"})}catch{return{ok:!1,refusal:{status:0,message:"The viewer did not answer. Is sdlc viewer still running?"}}}const o=await i.json().catch(()=>null);return i.ok?{ok:!0,data:o}:{ok:!1,refusal:s1(i.status,o)}}}function o6(e={}){const t=jr(e),n=r=>async()=>{const l=await t("access");return l.ok?{ok:!0,data:l.data[r]}:l},a=encodeURIComponent;return{tasks:{access:n("tasks"),configuration:()=>t("tasks/configuration"),listTasks:r=>t(`tasks/lists/${a(r)}/tasks`),task:r=>t(`tasks/tasks/${a(r)}`)},issues:{access:n("issues"),list:(r={})=>t("issues",r),issue:r=>t(`issues/${a(r)}`),issueSections:r=>t(`issues/${a(r)}/sections`),issueRelated:r=>t(`issues/${a(r)}/related`)},releases:{access:n("releases"),list:()=>t("releases"),release:r=>t(`releases/${a(r)}`),candidate:()=>t("releases/candidate")},organizations:{access:n("organizations"),list:()=>t("orgs")},projects:{access:n("projects"),list:()=>t("projects")},about:{about:()=>t("about")}}}function c6(e={}){const t=jr(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 oi=e=>({ok:!1,refusal:{status:0,message:e}});function hp({base:e="",fetcher:t=fetch}){return async(n,a)=>{let r;try{r=await t(`${e}api/${n}`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch{return oi("The viewer did not answer. Is sdlc viewer still running?")}const l=await r.json().catch(()=>null);return r.ok?{ok:!0,data:l}:{ok:!1,refusal:s1(r.status,l)}}}function u6(e={}){const t=jr(e),n=hp(e);return{chart:()=>t("org"),change:a=>n("org-change",a)}}function d6(e={}){const t=jr(e),n=o=>`tasks/tasks/${encodeURIComponent(o)}`,{base:a="",fetcher:r=fetch}=e;return{access:async()=>{const o=await t("access");return o.ok?{ok:!0,data:o.data.tasks}:o},availability:async()=>{const o=await t("tasks/configuration");if(!o.ok)return o.refusal.reason==="engine_missing"?{state:"off",refusal:o.refusal}:{state:"error",refusal:o.refusal};const c=o.data;if(c.state!=="active")return{state:"available"};const d=c.workspaces.find(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={})=>c.state==="archived"?Promise.resolve(oi("This checkout keeps no archived tasks.")):c.assigned_to_me?Promise.resolve(oi("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}),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()=>oi("The local viewer changes tasks only with Done."),complete:async o=>{const c="task"in o?{task:o.task}:{hold:o.hold};let d;try{d=await r(`${a}api/task-done`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}catch{return oi("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 f6(e={}){const t=jr(e),n=hp(e),a=encodeURIComponent,r=l=>l!=null&&l.fresh?{fresh:1}:{};return{access:async()=>{const l=await t("access");return l.ok?{ok:!0,data:l.data.releases}:l},list:(l={})=>t("releases",r(l)),release:(l,i)=>t(`releases/${a(l)}`,r(i)),candidate:l=>t("releases/candidate",r(l)),candidateBatch:l=>t("releases/candidate/batch",r(l)),related:(l,i)=>t(`releases/${a(l)}/related`,r(i)),plannedRelease:(l,i)=>t(`releases/planned/${a(l)}`,r(i)),roadmap:l=>t("releases/roadmap",{...r(l),...l!=null&&l.mine?{mine:1}:{}}),roadmapMoved:l=>t("releases/roadmap/moved",r(l)),roadmapSeen:l=>n("roadmap/seen",{at:l})}}function h6(e={}){const t=jr(e),n=hp(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 m6(e={}){const t=jr(e);return{overview:()=>t("workspaces")}}const x6=15e3,p6=10,qv="idle-sessions-list",Gv="idle-sessions-heading",Vv="idle-sessions-confirm-text";function a1(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${Math.round(e)} MB`}const g6=e=>`${Number.isInteger(e)?e:e.toFixed(1)} h`,r1=e=>e===1?"1 session":`${e} sessions`;function v6(e){const t=e.released.length?`Closed ${r1(e.released.length)}.`:"Closed no sessions.";return e.kept.length?`${t} Kept ${e.kept.length}:`:t}function y6({row:e}){const t=[e.name,e.retired?"continued in another session":"",`idle ${g6(e.idle_hours)}`,a1(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 b6(){const[e,t]=u.useState(null),[n,a]=u.useState(!1),[r,l]=u.useState(!1),[i,o]=u.useState(null),[c,d]=u.useState(null),[f,h]=u.useState(""),m=u.useRef(""),g=u.useRef(null),j=u.useRef(null),v=u.useRef(null),y=u.useRef(null),x=u.useRef(0),p=u.useRef(0),b=u.useCallback(async()=>{const T=++x.current,B=await wL();if(!B||T<p.current)return;p.current=T,h("");const F=JSON.stringify(B);F!==m.current&&(m.current=F,t(B))},[]);u.useEffect(()=>{const T=setTimeout(b,0),B=setInterval(b,x6);return()=>{clearTimeout(T),clearInterval(B)}},[b]),u.useEffect(()=>{var B;const T=y.current;T&&(y.current=null,(B={cancel:j,close:g,dismiss:v}[T].current)==null||B.focus())});const w=(e==null?void 0:e.sessions.length)??0;if(u.useEffect(()=>{r&&!w&&i===null&&l(!1)},[r,w,i]),!w&&!c&&!f&&i===null)return null;const _=()=>{i===null&&(l(!0),y.current="cancel")},k=()=>{i===null&&(l(!1),y.current="close")},N=async()=>{if(i!==null)return;o(w),d(null),h("");const T=await NL();p.current=x.current+1,await b(),o(null),l(!1),a(!1),"error"in T?(h(`The sessions were not closed: ${T.error.replace(/\.+$/,"")}.`),y.current="close"):(d(T.done),y.current="dismiss")},S=()=>{d(null),y.current="close"},A=T=>{T.key==="Escape"&&(T.preventDefault(),k())},D=i!==null?`Closing ${r1(i)}…`:c?v6(c):"",G=(e==null?void 0:e.sessions.slice(0,p6))??[],Y=w-G.length;return s.jsxs("div",{className:"idle",role:"group",...w?{"aria-labelledby":Gv}:{"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:Gv,"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 · ",a1(e.memory_mb)]})]}),s.jsxs("div",{className:"tools",children:[s.jsx("button",{type:"button",className:"pin","aria-expanded":n,"aria-controls":qv,"aria-label":n?"Hide the idle sessions list":"Show the idle sessions list",onClick:()=>a(T=>!T),children:n?"Hide":"Show"}),s.jsx("button",{type:"button",className:"pin",ref:g,"aria-expanded":r,"aria-label":"Close idle sessions…",onClick:_,children:"Close idle…"})]})]}),w>0&&s.jsxs("ul",{className:"idle-list",id:qv,hidden:!n,"aria-label":`Sessions idle over ${e==null?void 0:e.idle_over} hours, longest idle first`,children:[G.map(T=>s.jsx(y6,{row:T},T.session)),Y>0&&s.jsx("li",{children:s.jsxs("p",{className:"caption muted",children:["…and ",Y," more"]})})]}),r&&w>0&&s.jsxs("div",{className:"idle-confirm",role:"group","aria-label":"Close idle sessions","aria-describedby":Vv,onKeyDown:A,children:[s.jsxs("p",{id:Vv,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:N,children:i!==null?`Closing ${i}…`:`Close ${w}`}),s.jsx("button",{type:"button",className:"pin",ref:j,"aria-disabled":i!==null?!0:void 0,onClick:k,children:"Cancel"})]})]}),s.jsx("p",{className:"idle-status",role:"status",children:D}),c&&s.jsxs(s.Fragment,{children:[c.kept.length>0&&s.jsx("ul",{className:"idle-list","aria-label":"Kept sessions",children:c.kept.map(T=>s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:T.title}),s.jsx("p",{className:"caption muted",children:T.why})]},T.session))}),s.jsx("div",{className:"tools start",children:s.jsx("button",{type:"button",className:"pin",ref:v,"aria-label":"Dismiss the close result",onClick:S,children:"Dismiss"})})]})]})}const Yv={ok:"lime",you:"amber",alert:"red",waiting:"blue",blocked:"purple",muted:"grey",plain:"grey"};function nm(e){return e&&Object.hasOwn(Yv,e)?Yv[e]:"grey"}const j6=1e4,w6=6e4,N6=2,Af="#thread-",_6="The threads view needs a SoftwareDLC checkout (tools/vscode-threads); this repository has none.",k6={working:"▶",prod:"↑",planned:"○"};function Fv({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 Mf({text:e,role:t}){return s.jsx("span",{className:`badge tone-${nm(t)}`,children:e})}function S6({serves:e}){const t=e.slice(0,N6),n=e.length-t.length;return s.jsxs("p",{className:"caption muted serves",children:[t.map((a,r)=>s.jsxs("span",{children:[r>0&&", ",s.jsxs("a",{href:`releases?planned=${encodeURIComponent(a.planned_release)}`,"aria-label":`serves ${a.name}, ${a.level}: open it in Planned releases`,children:["serves ",a.name," (",a.level,")"]})]},a.planned_release)),n>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{"aria-hidden":"true",children:[", +",n," more"]}),s.jsxs("span",{className:"sr-only",children:[", and ",n," more planned releases"]})]})]})}function Xv({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 C6({onConnection:e,org:t=null,project:n=null}){const[a,r]=u.useState(null),[l,i]=u.useState(!1),[o,c]=u.useState(""),[d,f]=u.useState(!1),[h,m]=u.useState(null),[g,j]=u.useState(""),[v,y]=u.useState(null),[x,p]=u.useState(null),[b,w]=u.useState(null),_=u.useRef(""),k=u.useRef(""),N=u.useRef(null),S=u.useRef(null),A=u.useRef(null),D=E=>{var C;return E instanceof HTMLButtonElement&&E.classList.contains("pin")&&((C=N.current)!=null&&C.contains(E))?E.dataset.key??null:null},G=E=>{A.current=D(E.target)},Y=()=>{setTimeout(()=>{D(document.activeElement)||(A.current=null)},0)},T=u.useCallback(async()=>{const E=await op();if("none"in E){i(!0),c(""),e("live");return}if("error"in E){c(E.error),e("disconnected");return}i(!1),c(""),j(""),e("live");const C=JSON.stringify(E.data);C!==_.current&&(_.current=C,r(E.data))},[e]);u.useEffect(()=>{let E=!0;jL().then(X=>E&&f(X));const C=setTimeout(T,0),U=setInterval(T,j6);return()=>{E=!1,clearTimeout(C),clearInterval(U)}},[T]),u.useEffect(()=>{let E=!0;const C=()=>bL().then(X=>{E&&X&&y(M=>JSON.stringify(M)===JSON.stringify(X)?M:X)});C();const U=setInterval(C,w6);return()=>{E=!1,clearInterval(U)}},[]),u.useEffect(()=>{const E=()=>{var Q,se,W;const U=window.location.hash;if(!U.startsWith(Af)){w(null);return}if(U===k.current)return;let X;try{X=decodeURIComponent(U.slice(Af.length))}catch{X=U.slice(Af.length)}const M=document.getElementById(`thread-${X}`);if(!M||!((Q=N.current)!=null&&Q.contains(M))){a&&w(X);return}k.current=U,w(null),p(X),(se=M.querySelector(".thread-title"))==null||se.focus({preventScroll:!0}),(W=M.scrollIntoView)==null||W.call(M,{block:"center"})},C=()=>{k.current="",E()};return E(),window.addEventListener("hashchange",C),()=>window.removeEventListener("hashchange",C)},[a]),u.useEffect(()=>{if(!x)return;const E=()=>p(null);return document.addEventListener("pointerdown",E,!0),document.addEventListener("keydown",E,!0),()=>{document.removeEventListener("pointerdown",E,!0),document.removeEventListener("keydown",E,!0)}},[x]),u.useLayoutEffect(()=>{const E=A.current??S.current;if(!E||!N.current)return;const C=document.activeElement;if(C&&C!==document.body&&!N.current.contains(C)){A.current=null;return}const U=[...N.current.querySelectorAll("button.pin")].find(X=>X.dataset.key===E);U?C!==U&&U.focus({preventScroll:E!==S.current}):A.current=null});const B=async E=>{if(h)return;const C=!E.pinned;S.current=E.key,m(E.key);const U=await _L(E.key,C);m(null),U||r(X=>X&&{...X,threads:X.threads.map(M=>M.key===E.key?{...M,pinned:C}:M)}),await T(),j(U?`The pin was not saved: ${U}`:""),S.current===E.key&&(S.current=null)},F=(a==null?void 0:a.pinnedCount)??0,R=(a==null?void 0:a.threads)??[];return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"main-head",children:[s.jsx("h1",{children:"Threads"}),a&&!l&&s.jsx("p",{className:"muted",children:a.line})]}),s.jsxs("section",{className:"card threads","aria-label":"Threads",children:[s.jsx(b6,{}),o&&s.jsxs("div",{className:"alert",role:"alert",children:["Threads unavailable: ",o.replace(/\.+$/,""),". Retrying every 10 s."]}),g&&s.jsx("div",{className:"alert",role:"alert",children:g}),s.jsx("p",{className:"caption muted not-listed",role:"status",children:b!==null&&!l?s.jsxs(s.Fragment,{children:["Thread ",b," is not in this list. ",s.jsx("code",{children:"sdlc view --all"})," lists older threads."]}):null}),l?s.jsx("p",{className:"muted",children:_6}):s.jsxs("div",{className:"thread-list",ref:N,onFocus:G,onBlur:Y,children:[R.map((E,C)=>s.jsxs("div",{children:[F>0&&C===0&&s.jsx(Fv,{label:"Pinned",count:F,hint:"Threads you pinned; they stay first in every order"}),F>0&&C===F&&s.jsx(Fv,{label:"Other threads",count:R.length-F}),s.jsx(T6,{row:v!=null&&v[E.key]?{...E,serves:v[E.key]}:E,arrived:x===E.key,pinnable:d&&typeof E.pinned=="boolean",pinning:h,onPin:()=>B(E),org:t,project:n})]},E.key)),a&&!R.length&&s.jsx("p",{className:"muted empty",children:"No threads at work or waiting."}),a&&a.hidden>0&&s.jsxs("p",{className:"caption muted",children:[a.hidden," older thread(s) not shown; sdlc view --all lists them."]})]})]})]})}function T6({row:e,arrived:t,pinnable:n,pinning:a,onPin:r,org:l,project:i}){const o=f=>l?`org/${encodeURIComponent(l)}/tasks/${encodeURIComponent(f)}`:null,c=f=>i?`proj/${encodeURIComponent(i)}/issues/${encodeURIComponent(f)}`:null,d=[e.agent,e.phase,e.age,e.waitsOn?`waits on ${e.waitsOn}`:""].filter(Boolean).join(" · ");return s.jsxs("article",{className:t?"thread arrived":"thread",id:`thread-${e.key}`,style:{marginLeft:Math.min(e.depth*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(Mf,{text:e.carried,role:"waiting"}),e.carriedBatch&&s.jsx(Mf,{text:e.carriedBatch.text,role:e.carriedBatch.role})]}):s.jsx(Mf,{text:e.status,role:e.role}),n&&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":a?!0:void 0,"aria-busy":a===e.key?!0:void 0,onClick:()=>{a||r()},children:e.pinned?"Unpin":"Pin"})]})]}),s.jsx("p",{className:"caption muted",children:d}),e.serves&&e.serves.length>0&&s.jsx(S6,{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.map((f,h)=>s.jsxs("p",{className:`line tone-${nm(f.role)}`,children:[s.jsxs("span",{"aria-hidden":"true",children:[k6[f.state]??"•"," "]}),f.state==="working"&&s.jsx("span",{className:"sr-only",children:"Working: "}),f.task!==void 0&&s.jsx(Xv,{id:f.task,href:o(f.task)}),f.task!==void 0&&f.text?" ":null,f.text]},`l${h}`)),(e.routed??[]).map(f=>s.jsxs("p",{className:"line",children:["routed ",s.jsx(Xv,{id:f.issue,href:c(f.issue)}),f.title?` ${f.title}`:null]},`r${f.issue}`)),e.holds.map((f,h)=>s.jsx("p",{className:`line tone-${nm(f.role)}`,children:f.text},`h${h}`)),e.plan&&s.jsx("p",{className:"caption muted",children:e.plan})]})}const R6=5e3;function E6(){const[e,t]=u.useState([]),n=u.useRef(0),a=u.useRef(new Map),r=u.useCallback(c=>{const d=a.current.get(c);d&&clearTimeout(d),a.current.delete(c),t(f=>f.filter(h=>h.id!==c))},[]),l=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(()=>r(f),R6))},[r]);u.useEffect(()=>{const c=a.current;return()=>{for(const d of c.values())clearTimeout(d)}},[]);const i=u.useMemo(()=>({success:c=>l("success",c),error:c=>l("error",c)}),[l]),o=s.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"pointer-events-none fixed right-4 bottom-4 z-100 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-2",children:e.map(c=>s.jsxs("div",{"data-testid":"viewer-toast",className:"bg-popover text-popover-foreground pointer-events-auto flex w-80 max-w-full items-center gap-3 rounded-md border py-2 pr-2 pl-4 text-sm shadow-lg"+(c.tone==="error"?" border-destructive":""),children:[s.jsx("span",{className:"min-w-0 flex-1 break-words",children:c.message}),s.jsx(H,{type:"button",variant:"ghost",size:"control",className:"shrink-0",onClick:()=>r(c.id),children:"Dismiss"})]},c.id))});return{notify:i,toasts:o}}const A6=e=>e instanceof Error?e.message:String(e),gd=(e,t="")=>`api/chat/${encodeURIComponent(e)}${t}`;async function vd(e,t){try{const n=await fetch(e,{cache:"no-store",...t}),a=await n.text();let r=null;try{r=a?JSON.parse(a):null}catch{r=null}if(n.ok&&r&&typeof r=="object")return{ok:r};const l=r&&typeof r=="object"?r:{};return{failed:{status:n.status,error:typeof l.error=="string"?l.error:a||`HTTP ${n.status}`,...typeof l.reason=="string"?{reason:l.reason}:{}}}}catch(n){return{failed:{status:0,error:A6(n)}}}}async function M6(){try{const e=await fetch(gd("claude:available"),{method:"HEAD",cache:"no-store"});return e.ok?!0:e.status===404?!1:null}catch{return null}}function Kv(e,t){return vd(gd(e,t==null?"":`?before=${t}`))}function O6(e){return vd(gd(e,"/state"))}const Qv=50;function D6(e){return vd(`api/chat/states?threads=${e.map(encodeURIComponent).join(",")}`)}const l1=(e,t,n)=>vd(gd(e,`/${t}`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n})}),$6=(e,t)=>l1(e,"send",t),z6=(e,t)=>l1(e,"reopen",t),i1=/^(claude|codex):[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,L6=5e3,U6=1e4,Wv=6e4,ol=e=>e.startsWith("codex:")?"codex":"claude",o1={claude:"Claude",codex:"Codex"},B6={claude:"Claude Code",codex:"Codex"},yd=e=>e.where??e.worktree??"";function H6(e){return e?e.repository?e.checkout&&e.checkout!==e.repository?`${e.repository} · worktree ${e.checkout}`:e.repository:yd(e)||null:null}const I6=(e,t)=>[e.title,e.step,e.summary,t?yd(t):"",(t==null?void 0:t.repository)??"",(t==null?void 0:t.checkout)??""].join(" ").toLowerCase(),P6=e=>e==null?"":new Date(e*1e3).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),mp=(e,t)=>`org/${encodeURIComponent(e)}/chat${t?`/${encodeURIComponent(t)}`:""}`,Zv=(e,t)=>`org/${encodeURIComponent(e)}/threads#thread-${encodeURIComponent(t)}`,Of="text-primary underline-offset-4 hover:underline";function q6(e){const t=(e.provider??ol(e.thread))==="codex";if(e.state==="continued"||e.delivery==="none")return null;if(e.state==="working")return{line:t?"Working now · Codex reads your message at its next coordination checkpoint.":"Working now · it reads your message at its next step, as a note from you in its inbox.",button:"Send",reopen:!1,off:!1};if(e.state==="waiting")return{line:t?"Waiting at its prompt · Codex reads its inbox only at a coordination checkpoint, so your message waits until you next prompt it in its terminal.":"Waiting at its prompt · your message waits in its inbox until you next prompt it in its terminal. Chat cannot start its turn.",button:"Send to inbox",reopen:!1,off:!1};if(e.delivery==="reopen"){if(e.reopening_since)return{line:"Opening in Terminal · Send is off until its session starts.",button:"Reopen and send",reopen:!0,off:!0};const n=yd(e);return{line:t?`Closed · Send reopens it in ${n} in a new Terminal window with codex resume, with your message as its first prompt.`:`Closed · Send reopens it in ${n} in a new Terminal window, with your message as its first prompt.`,button:"Reopen and send",reopen:!0,off:!1}}return e.reason==="no_terminal"?{line:"Closed · Chat reopens a session only on macOS, so your message waits in its inbox until you next open the thread.",button:"Send to inbox",reopen:!1,off:!1}:e.reason==="no_command"?{line:t?"Closed · there is no codex command on this machine to reopen it, so your message waits in its inbox until you next open the thread in the Codex app.":"Closed · there is no claude command on this machine to reopen it, so your message waits in its inbox until you next open the thread.",button:"Send to inbox",reopen:!1,off:!1}:{line:"Closed · a process may still be this session, so your message waits in its inbox until it next reads it.",button:"Send to inbox",reopen:!1,off:!1}}function G6(e,t,n=!0){const a=n?" Your message is still in the box.":"";if(e.reason==="terminal_denied")return`Not reopened: macOS did not let sdlc viewer open Terminal. Allow it under System Settings › Privacy & Security › Automation, then ${n?"Retry":"send again"}.${a}`;const r=e.error.replace(/[.\s]+$/,"");return t?`Not reopened: ${r}.${a}`:e.status>=500||e.status===0?`Not sent: the inbox could not be written.${a}`:`Not sent: ${r}.${a}`}const V6="This thread can't be reopened: its worktree is gone. Its transcript stays readable; start a new thread to go on.",Y6="Chat cannot send to this thread: its provider keeps no inbox and cannot be resumed.";function F6(e){var t,n;return e.note?e.inbox==="read"?"Sent from Chat · read":e.inbox==="passed"?`Sent from Chat · passed to ${((t=e.successor)==null?void 0:t.title)||((n=e.successor)==null?void 0:n.thread)||"its successor"}`:e.inbox==="expired"?"Expired, not read":"Sent from Chat · in its inbox, not read yet":null}function X6(e){const t=new Map;return e.map((n,a)=>{if(n.kind==="message"&&n.note)return`note-${n.note}`;if(n.offset==null)return`${n.kind}-x-${a}`;const r=`${n.kind}-${n.offset}`,l=t.get(r)??0;return t.set(r,l+1),`${r}-${l}`})}function K6(e,t,n){if(n.before==null||n.aligned===!1)return null;const a=n.before;if(t==null||a>t)return null;const r=e.findIndex(o=>o.offset!=null&&o.offset>=a),l=new Set(n.rows.flatMap(o=>o.kind==="message"&&o.note?[o.note]:[]));return[...(r<0?e:e.slice(0,r)).filter(o=>!(o.kind==="message"&&o.note&&l.has(o.note))),...n.rows]}function Q6(e,t){return t?e.map(n=>{if(n.kind!=="message"||!n.note||!t[n.note])return n;const a=t[n.note];if(n.inbox===a.inbox&&JSON.stringify(n.successor??null)===JSON.stringify(a.successor??null))return n;const{successor:r,...l}=n;return{...l,inbox:a.inbox,...a.successor?{successor:a.successor}:{}}}):e}function c1({label:e}){return s.jsx("span",{"aria-hidden":"true",className:"flex size-7 shrink-0 items-center justify-center rounded-full bg-muted text-2xs font-medium text-muted-foreground",children:e})}function u1({state:e}){if(!e)return null;const{label:t,tone:n}=Qk[e];return s.jsx(de,{variant:n,children:t})}function W6({row:e}){const[t,n]=u.useState(!1);return s.jsxs("div",{className:"rounded-md border border-border px-3 py-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(lR,{className:"size-3.5 shrink-0 text-muted-foreground","aria-hidden":"true"}),s.jsx("span",{className:"min-w-0 flex-1 text-xs text-muted-foreground",children:e.summary}),s.jsx(H,{variant:"ghost",size:"sm","aria-expanded":t,"aria-label":`${t?"Hide":"Show"} the steps: ${e.summary}`,onClick:()=>n(a=>!a),children:t?"Hide":"Show"})]}),t&&s.jsx("ul",{className:"m-0 mt-2 flex list-none flex-col gap-1 p-0",children:e.lines.map((a,r)=>s.jsx("li",{className:`text-xs text-muted-foreground [overflow-wrap:anywhere] ${a.startsWith("Edited ")?"":"font-mono"}`,children:a},r))})]})}function Z6({row:e,agent:t,onSendAgain:n}){const a=e.who==="user",r=F6(e);return s.jsxs("div",{className:"flex gap-3",children:[s.jsx(c1,{label:a?"You":t.slice(0,2).toUpperCase()}),s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-foreground",children:a?"You":t}),s.jsx("span",{className:"text-xs text-muted-foreground",children:P6(e.at)})]}),s.jsx("p",{className:"m-0 whitespace-pre-wrap text-sm text-foreground [overflow-wrap:anywhere]",children:e.text}),e.cut&&s.jsx("span",{className:"text-xs text-muted-foreground",children:"Shows the first 32,000 characters of this message."}),r&&s.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[r,e.inbox==="expired"&&n&&s.jsx(H,{variant:"link",size:"inline-sm",onClick:()=>n(e.text),children:"Send again"})]})]})]})}function J6(){const[e,t]=u.useState({rows:null,error:"",none:!1}),n=u.useRef(""),a=u.useCallback(async(r=!0)=>{const l=await op();if("none"in l)return t({rows:[],error:"",none:!0});if("error"in l)return r?a(!1):t(c=>({...c,error:l.error}));const i=l.data.threads.filter(c=>i1.test(c.key)),o=JSON.stringify(i);t(c=>o===n.current&&!c.error?c:(n.current=o,{rows:i,error:"",none:!1}))},[]);return u.useEffect(()=>{const r=setTimeout(a,0),l=setInterval(a,U6);return()=>{clearTimeout(r),clearInterval(l)}},[a]),{...e,retry:()=>void a()}}function e5(e){const[t,n]=u.useState({}),a=u.useRef(e);a.current=e;const r=u.useRef(new Set),l=u.useRef(!0),i=u.useCallback(async o=>{for(let c=0;c<o.length;c+=Qv){const d=o.slice(c,c+Qv);d.forEach(m=>r.current.add(m));const f=await D6(d);if(!l.current)return;if(!("ok"in f))continue;const h={};for(const[m,g]of Object.entries(f.ok))"state"in g&&(h[m]=g);n(m=>({...m,...h}))}},[]);return u.useEffect(()=>{l.current=!0;let o;const c=async()=>{await i(a.current),l.current&&(o=setTimeout(c,Wv))};return o=setTimeout(c,Wv),()=>{l.current=!1,clearTimeout(o)}},[i]),u.useEffect(()=>{const o=e.filter(c=>!r.current.has(c));o.length&&i(o)},[e,i]),t}function t5({org:e,list:t,states:n,open:a}){const[r,l]=u.useState("all"),[i,o]=u.useState(""),c=u.useRef(null),d=u.useRef(null),f=i.trim(),h=u.useMemo(()=>{const m=f.toLowerCase();return d1(t.rows??[]).filter(g=>r==="all"||ol(g.key)===r).filter(g=>!m||I6(g,n[g.key]).includes(m))},[t.rows,r,f,n]);return s.jsxs("div",{ref:d,role:"region","aria-label":"Chat threads",tabIndex:-1,className:"flex min-w-0 flex-col gap-3 outline-hidden",children:[s.jsxs(mt,{value:r,onValueChange:m=>l(m),children:[s.jsx(ct,{"aria-label":"Show threads from",children:s.jsx(xt,{})}),s.jsxs(ut,{children:[s.jsx(ke,{value:"all",children:"All threads"}),s.jsx(ke,{value:"claude",children:"Claude Code"}),s.jsx(ke,{value:"codex",children:"Codex"})]})]}),s.jsx(At,{ref:c,type:"search","aria-label":"Search threads",placeholder:"Search threads",value:i,onChange:m=>o(m.target.value)}),t.error&&s.jsxs(le,{variant:"destructive",children:[s.jsx(Vt,{"aria-hidden":"true"}),s.jsxs(ae,{className:"flex flex-col items-start gap-2",children:["The threads could not be read: ",t.error.replace(/[.\s]+$/,""),".",t.rows?" The list shows what it last read.":"",s.jsx(H,{variant:"outline",size:"sm",onClick:()=>{var m;(m=d.current)==null||m.focus(),t.retry()},children:"Retry"})]})]}),t.rows===null?t.error?null:s.jsxs("div",{role:"status",className:"flex flex-col gap-3",children:[s.jsx("span",{className:"sr-only",children:"Loading threads…"}),[0,1,2].map(m=>s.jsx(st,{className:"h-14 w-full"},m))]}):t.rows.length===0?s.jsxs("div",{className:"flex flex-col gap-1 py-6",children:[s.jsx("h2",{className:"m-0 text-base font-semibold text-foreground",children:t.none?"Chat needs the SoftwareDLC view engine":"No agent threads in this folder yet"}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:t.none?"Chat needs a SoftwareDLC checkout to read threads. Set SDLC_VIEW_ROOT to one and restart sdlc viewer.":"Start Claude Code or Codex in one of this folder's repositories and its thread appears here."})]}):h.length===0?s.jsxs("div",{className:"flex flex-col items-start gap-2 py-6",children:[s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:f?`No thread matches “${f}”. Clear the search or choose All threads.`:`No ${B6[r==="all"?"claude":r]} thread in this folder. Choose All threads.`}),s.jsx(H,{variant:"outline",size:"sm",onClick:()=>{var m;o(""),l("all"),(m=c.current)==null||m.focus()},children:"Clear search"})]}):s.jsx("ul",{className:"m-0 flex list-none flex-col gap-1 p-0","aria-label":"Threads",children:h.map(m=>{var x;const g=(x=n[m.key])==null?void 0:x.state,j=m.step||m.summary,v=m.key===a,y=`chat-row-${m.key}`;return s.jsx("li",{children:s.jsxs("a",{id:y,href:mp(e,m.key),"aria-current":v?"page":void 0,"aria-label":`${m.title||m.key}${g?`, ${Qk[g].label}`:""}`,"aria-describedby":[j?`${y}-preview`:"",m.age?`${y}-age`:""].filter(Boolean).join(" ")||void 0,className:"flex gap-3 rounded-md px-3 py-2 text-left no-underline outline-hidden hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring "+(v?"bg-accent":""),children:[s.jsx(c1,{label:ol(m.key)==="codex"?"CO":"CL"}),s.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[s.jsx("span",{className:"truncate text-sm font-semibold text-foreground",title:m.title||m.key,children:m.title||m.key}),j&&s.jsx("span",{id:`${y}-preview`,className:"truncate text-xs text-muted-foreground",title:j,children:j}),s.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o1[ol(m.key)],s.jsx(u1,{state:g})]})]}),m.age&&s.jsx("span",{id:`${y}-age`,className:"shrink-0 text-xs text-muted-foreground",children:m.age})]})},m.key)})})]})}const d1=e=>[...e].sort((t,n)=>+!!n.pinned-+!!t.pinned);function n5(e,t){const[n,a]=u.useState(null),r=u.useRef(null);u.useLayoutEffect(()=>{const x=t.current;x&&r.current!==null&&(x.scrollTop=x.scrollHeight-r.current,r.current=null)},[n,t]);const[l,i]=u.useState(null),[o,c]=u.useState(null),[d,f]=u.useState(null),[h,m]=u.useState(!1),g=u.useRef(""),j=u.useCallback(async()=>{const[x,p]=await Promise.all([Kv(e),O6(e)]);if("ok"in p?(c(null),f(_=>JSON.stringify(_)===JSON.stringify(p.ok)?_:p.ok)):c(p.failed),"failed"in x)return i(x.failed);i(null);const b=JSON.stringify([x.ok.rows,x.ok.before,x.ok.notes??null]);if(b===g.current)return;g.current=b;const w=x.ok.end??null;a(_=>{const k=_&&K6(_.rows,_.end,x.ok);if(!_||!k)return{rows:x.ok.rows,before:x.ok.before,end:w};const N=k.length>x.ok.rows.length?_.before:x.ok.before;return{rows:Q6(k,x.ok.notes),before:N,end:w}})},[e]);u.useEffect(()=>{const x=setTimeout(j,0),p=setInterval(j,L6);return()=>{clearTimeout(x),clearInterval(p)}},[j]);const v=async()=>{if(!n||n.before==null||h)return;const x=n.before;m(!0);const p=await Kv(e,x);if(m(!1),"failed"in p)return i(p.failed);const b=t.current?t.current.scrollHeight-t.current.scrollTop:null;a(w=>!w||w.before!==x?w:(r.current=b,{...w,rows:[...p.ok.rows,...w.rows],before:p.ok.before}))},y=n===null&&(l==null?void 0:l.status)===404&&(o==null?void 0:o.status)===404;return{transcript:n,readFailure:l,state:d,refresh:j,showEarlier:v,earlier:h,missing:y}}function s5({thread:e,title:t,state:n,again:a,onAgainDone:r,onSent:l,onRetried:i}){const[o,c]=u.useState(""),d=u.useRef(o);d.current=o;const[f,h]=u.useState(!1),[m,g]=u.useState(null),[j,v]=u.useState(!1),y=u.useRef(null),x=u.useRef(null),{confirm:p,confirm_dialog:b}=$l(),w=q6(n),_=`chat-delivery-${e}`,k=!w||w.off||f,N=n.state!=="closed"||n.reason==="maybe_running";u.useEffect(()=>{!n.reopening_since&&N&&v(!1)},[n.reopening_since,N]);const S=u.useRef(null),A=u.useRef(!1);u.useEffect(()=>{if(!j)return;if(n.reopening_since){A.current=!0;return}if(!A.current||N||n.delivery!=="reopen")return;A.current=!1,v(!1);const T=S.current;S.current=null;const B=!!T&&!d.current.trim();B&&T&&c(T),g({text:`Not reopened: its session did not start in Terminal.${B?" Your message is back in the box.":""}`,retry:!1})},[j,n.reopening_since,N,n.delivery]);const D=async(T=d.current,B=!0)=>{var R;if(!w||k||!T.trim())return!1;if(w.reopen){const E=(n.provider??ol(e))==="codex",C=await p({title:`Reopen ${t}?`,description:`It opens in ${yd(n)}, in a new Terminal window running ${E?"codex resume":"claude --resume"}, with your message as its first prompt.`,action_label:"Reopen"});if(setTimeout(()=>{var U;return(U=x.current)==null?void 0:U.focus()},0),!C)return!1}h(!0),g(null);const F=await(w.reopen?z6(e,T):$6(e,T));return h(!1),"failed"in F?(g({text:G6(F.failed,w.reopen,B),retry:B&&F.failed.reason==="terminal_denied"}),B&&((R=y.current)==null||R.focus()),l(),!1):(B&&d.current===T&&c(""),w.reopen&&(S.current=T,A.current=!1,v(!0)),l(),!0)},G=u.useRef(D);if(G.current=D,u.useEffect(()=>{if(!a||k)return;r();const T=d.current.trim()!==""&&d.current!==a.text;T||(c(a.text),d.current=a.text),G.current(a.text,!T)},[a,k,r]),!w)return null;const Y=T=>{T.key==="Enter"&&!T.shiftKey&&!T.nativeEvent.isComposing&&(T.preventDefault(),D())};return s.jsxs("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[m&&s.jsxs(le,{variant:"destructive",children:[s.jsx(Vt,{"aria-hidden":"true"}),s.jsxs(ae,{className:"flex flex-col items-start gap-2",children:[m.text,m.retry&&s.jsx(H,{variant:"outline",size:"sm",onClick:()=>void D().then(T=>T&&i()),children:"Retry"})]})]}),(j||n.reopening_since)&&w.reopen&&s.jsxs(le,{variant:"info",role:"status",children:[s.jsx(en,{"aria-hidden":"true"}),s.jsx(ae,{children:"Opened a Terminal window with your message. Its replies appear here once it starts."})]}),s.jsx(es,{ref:y,rows:3,"aria-label":`Message ${t}`,placeholder:`Message ${t}`,value:o,onChange:T=>c(T.target.value),onKeyDown:Y}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx("p",{id:_,className:"m-0 min-w-0 flex-1 text-xs text-muted-foreground [overflow-wrap:anywhere]",children:f&&w.reopen?"Opening in Terminal · if macOS asks whether sdlc viewer may control Terminal, allow it. Send is off until it answers.":w.line}),s.jsxs(H,{ref:x,size:"sm","aria-disabled":k||void 0,"aria-describedby":_,onClick:()=>void D(),loading:f,children:[s.jsx(XT,{"aria-hidden":"true"}),w.button]})]}),b]})}function a5(e,t){if(!e)return null;const n=e==="now"?"just now":`${e} ago`;return t==="waiting"?e==="now"?"idle since just now":`idle ${e}`:t==="closed"?`closed ${n}`:n}function Jv({org:e,thread:t,row:n,onBack:a,onMissing:r,onState:l}){const i=u.useRef(null),{transcript:o,readFailure:c,state:d,refresh:f,showEarlier:h,earlier:m,missing:g}=n5(t,i);u.useEffect(()=>{d&&l(d)},[d,l]);const j=u.useRef(!0),[v,y]=u.useState(null),[x,p]=u.useState(""),b=u.useRef(void 0),w=(n==null?void 0:n.title)||(d==null?void 0:d.title)||t,_=o1[ol(t)],k=(o==null?void 0:o.rows)??null,N=u.useMemo(()=>X6(k??[]),[k]),S=u.useCallback(()=>y(null),[]);u.useEffect(()=>{g&&r()},[g,r]),u.useLayoutEffect(()=>{const T=i.current;T&&j.current&&(T.scrollTop=T.scrollHeight)},[k==null?void 0:k.length]),u.useEffect(()=>{if(!k)return;let T=-1;for(let R=k.length-1;R>=0;R--){const E=k[R];if(E.kind==="message"&&E.who==="agent"){T=R;break}}const B=T>=0?k[T]:null,F=B?N[T]:null;b.current!==void 0&&B&&F!==b.current&&p(`${_}: ${B.text.slice(0,300)}`),b.current=F},[k,N,_]);const A=[H6(d),a5(n==null?void 0:n.age,d==null?void 0:d.state)].filter(Boolean).join(" · "),D=(d==null?void 0:d.delivery)==="none"&&d.reason==="worktree_gone",G=!!(d&&d.state!=="continued"&&d.delivery!=="none"),Y=c&&!g;return s.jsxs("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col gap-3","aria-labelledby":"chat-thread-title",children:[s.jsx("div",{className:"@min-[720px]:hidden",children:s.jsxs(H,{variant:"ghost",size:"sm",onClick:a,children:[s.jsx(nx,{"aria-hidden":"true"}),"Back to threads"]})}),s.jsxs("header",{className:"flex flex-wrap items-start gap-x-3 gap-y-1 border-b border-border pb-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsx("h2",{id:"chat-thread-title",className:"m-0 text-base font-semibold text-foreground [overflow-wrap:anywhere]",children:w}),A&&s.jsx("span",{className:"text-xs text-muted-foreground",children:A})]}),s.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[_,s.jsx(u1,{state:d==null?void 0:d.state}),n&&s.jsx("a",{className:`text-sm ${Of}`,href:Zv(e,t),children:"Open in Threads"})]})]}),Y&&s.jsxs(le,{variant:"warning",children:[s.jsx(Vt,{"aria-hidden":"true"}),s.jsxs(ae,{className:"flex flex-col items-start gap-2",children:["This thread's transcript could not be read: ",c.error,".",n?" Its card on Threads still shows its status.":"",s.jsxs("span",{className:"flex items-center gap-3",children:[s.jsx(H,{variant:"outline",size:"sm",onClick:()=>{var T;(T=i.current)==null||T.focus(),f()},children:"Retry"}),n&&s.jsx("a",{className:`text-sm ${Of}`,href:Zv(e,t),children:"Open in Threads"})]})]})]}),s.jsx("div",{"aria-live":"polite",className:"sr-only",children:x}),s.jsx("div",{ref:i,role:"region",tabIndex:-1,"aria-label":`Transcript of ${w}`,className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto outline-hidden",onScroll:T=>{const B=T.currentTarget;j.current=B.scrollHeight-B.scrollTop-B.clientHeight<24},children:g?s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"This thread's session is no longer on this machine, so there is nothing to show. Choose another thread."}):k===null&&!c?s.jsxs("div",{role:"status",className:"flex flex-col gap-3",children:[s.jsx("span",{className:"sr-only",children:"Loading the transcript…"}),s.jsx(st,{className:"h-16 w-full"}),s.jsx(st,{className:"h-16 w-3/4"})]}):k&&k.length===0?s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"No messages yet. This thread's session has started but has not written a turn."}):s.jsxs(s.Fragment,{children:[(o==null?void 0:o.before)!=null&&s.jsx("div",{className:"flex justify-center",children:s.jsxs(H,{variant:"ghost",size:"sm",onClick:()=>void h(),"aria-busy":m||void 0,children:[m&&s.jsx(vn,{}),"Show earlier messages"]})}),k==null?void 0:k.map((T,B)=>T.kind==="steps"?s.jsx(W6,{row:T},N[B]):s.jsx(Z6,{row:T,agent:_,onSendAgain:G?F=>y(R=>({text:F,n:((R==null?void 0:R.n)??0)+1})):void 0},N[B]))]})}),(d==null?void 0:d.state)==="continued"?s.jsx("div",{className:"flex flex-col gap-1 border-t border-border pt-3 text-sm text-muted-foreground",children:d.successor?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"m-0",children:"Taken over by another thread, which now owns its work. Message that thread instead."}),s.jsxs("a",{className:Of,href:mp(e,d.successor.thread),children:["Open ",d.successor.title||d.successor.thread]})]}):s.jsx("p",{className:"m-0",children:"This thread was archived and takes no messages."})}):D?s.jsxs(le,{variant:"warning",children:[s.jsx(Vt,{"aria-hidden":"true"}),s.jsx(ae,{children:V6})]}):(d==null?void 0:d.delivery)==="none"?s.jsx("p",{className:"m-0 border-t border-border pt-3 text-sm text-muted-foreground",children:Y6}):d?s.jsx(s5,{thread:t,title:w,state:d,again:v,onAgainDone:S,onSent:()=>void f(),onRetried:()=>setTimeout(()=>{var T;return(T=i.current)==null?void 0:T.focus()},0)}):null]})}const r5=[];function l5({org:e,thread:t,served:n=null}){var D,G,Y;const a=J6(),r=n===!1?{...a,rows:r5,error:"",none:!0}:a,l=n===!1?null:t,[i,o]=u.useState(null),[c,d]=u.useState(l===null),[f,h]=u.useState(null),m=(D=r.rows)==null?void 0:D.find(T=>T.key===l),g=u.useMemo(()=>(r.rows??[]).map(T=>T.key),[r.rows]),j=e5(g),[v,y]=u.useState(null),x=r.rows?((G=d1(r.rows)[0])==null?void 0:G.key)??null:null;u.useEffect(()=>{v===null&&x!==null&&y(x)},[v,x]);const p=v??x,b=p?{key:p,row:(Y=r.rows)==null?void 0:Y.find(T=>T.key===p)}:null,w=l!==null&&(!i1.test(l)||f===l&&r.rows!==null&&!m),_=u.useCallback(()=>h(l),[l]),k=u.useCallback(()=>{},[]),N=l??(b==null?void 0:b.key)??null,S=u.useMemo(()=>N&&(i==null?void 0:i.thread)===N?{...j,[N]:i}:j,[j,N,i]),A=()=>{d(!0),setTimeout(()=>{var T;return l?(T=document.getElementById(`chat-row-${l}`))==null?void 0:T.focus():void 0},0)};return w?s.jsx(Zs,{title:"Thread not found",description:"This folder has no Claude Code or Codex thread at this address.",backHref:mp(e),backLabel:"Back to Chat",link:cp.Link}):s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 p-6",children:[s.jsx(Xt,{title:"Chat",description:"The Claude Code and Codex threads working in this folder. Read what each agent did and said, and send it a message."}),s.jsx("div",{className:"@container flex min-h-0 flex-1",children:s.jsxs("div",{className:"flex min-h-0 w-full gap-6 rounded-lg border border-border p-4",children:[s.jsx("div",{className:`w-full @min-[720px]:block @min-[720px]:w-80 @min-[720px]:shrink-0 ${l&&!c?"hidden":""}`,children:s.jsx(t5,{org:e,list:r,states:S,open:N})}),l?s.jsx("div",{className:`min-h-[32rem] min-w-0 flex-1 @min-[720px]:flex ${c?"hidden":"flex"}`,children:s.jsx(Jv,{org:e,thread:l,row:m,onBack:A,onMissing:_,onState:o},l)}):b?s.jsx("div",{className:"hidden min-h-[32rem] min-w-0 flex-1 @min-[720px]:flex",children:s.jsx(Jv,{org:e,thread:b.key,row:b.row,onBack:k,onMissing:k,onState:o},b.key)}):null]})})]})}const f1=/^#(?:(releases)|release=(.+)|planned(?:=(.+))?)$/,i5=/^#task=(.+)$/,o5=/^#issue=(.+)$/,c5=/^iss-\d{1,9}$/;function h1(e){return e.split("/").filter(Boolean).slice(1).join("/")}function u5(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"?{page:{kind:"org",page:"chat"},chat:!0,thread:null}:o==="tasks"?{page:{kind:"org",page:"tasks"},tasks:!0}:o==="issues"?{page:{kind:"home"},issues:!0}:o==="chart"?{page:{kind:"org",page:"chart"},chart:!0}:o==="worktrees"?{page:{kind:"org",page:"worktrees"},worktrees:!0}:o==="workspaces"?{page:{kind:"org",page:"workspaces"},workspaces:!0}:o==="queues"?{page:{kind:"org",page:"queues"},queues:!0}:o==="releases"?{page:{kind:"home"},releasesForward:!0}:{page:{kind:"not_found"}}}const[a,r,l,i]=n;if(a==="org"&&l==="tasks"&&i==="queues"&&n.length===4)return{forward:`org/${r}/queues${t}`};if(a==="org"&&l==="chat"&&n.length===4){let o="",c="";try{o=decodeURIComponent(i),c=decodeURIComponent(r)}catch{return{page:{kind:"not_found"}}}return{page:{kind:"org",page:"chat"},org:c,chat:!0,thread:o}}if(a==="org"&&l==="tasks"&&n.length===4){const o=decodeURIComponent(i);return{page:{kind:"org",page:"tasks",item:o},org:decodeURIComponent(r),task:o}}if(a==="org"&&l==="issues"&&n.length<=4){const o=decodeURIComponent(r);return i===void 0?{page:{kind:"home"},org:o,issues:!0}:{page:{kind:"home"},org:o,issues:!0,issue:decodeURIComponent(i)}}if(a==="proj"&&l==="issues"&&n.length<=4){const o=decodeURIComponent(r),c={kind:"project",project:o,page:"issues"};if(i===void 0)return{page:c,issues:!0,project:o};const d=decodeURIComponent(i),f=new URLSearchParams(t);f.delete("from");const 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(r);if(l===void 0)return{page:{kind:"home"},org:o};if(l==="threads")return{page:{kind:"org",page:"threads"},org:o,threads:!0};if(l==="chat")return{page:{kind:"org",page:"chat"},org:o,chat:!0,thread:null};if(l==="tasks")return{page:{kind:"org",page:"tasks"},org:o,tasks:!0};if(l==="chart")return{page:{kind:"org",page:"chart"},org:o,chart:!0};if(l==="worktrees")return{page:{kind:"org",page:"worktrees"},org:o,worktrees:!0};if(l==="workspaces")return{page:{kind:"org",page:"workspaces"},org:o,workspaces:!0};if(l==="queues")return{page:{kind:"org",page:"queues"},org:o,queues:!0};if(l==="releases")return{page:{kind:"home"},org:o,releasesForward:!0}}if(a==="proj"&&n.length<=3){const o=decodeURIComponent(r);if(l===void 0)return{page:{kind:"project",project:o}};if(l==="tasks")return{page:{kind:"project",project:o,page:"tasks"},tasks:!0};if(l==="releases")return{page:{kind:"project",project:o,page:"releases"},releases:!0}}return{page:{kind:"not_found"}}}const d5={label:"Local viewer",can:()=>!1},f5={connecting:"Connecting…",live:"Live · refreshes every 10s",disconnected:"Disconnected"},ey=()=>s.jsx(Wk,{title:"Page not found",children:"There is no page at this address in this viewer."});function h5({routeOrg:e}){const{org:t}=sn(),{project:n}=ko(),[a,r]=u.useState("connecting");return s.jsxs("div",{className:"main viewer-panel",children:[s.jsxs("p",{className:"connection",role:"status",children:[s.jsx("span",{className:`dot ${a}`,"aria-hidden":"true"}),f5[a]]}),s.jsx(C6,{onConnection:r,org:(t==null?void 0:t.slug)??e??null,project:n})]})}const Js=()=>s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading…"});function m5({route:e,navigate:t}){var f;const{org:n,projects:a,loading:r,none:l}=sn(),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&&!r&&n!==null?`org/${encodeURIComponent(n.slug)}/tasks`:null;if(u.useEffect(()=>{c&&t(c)},[c,t]),i!==null&&o)return s.jsx(Xi,{project:i});if(c||e.org===void 0&&r)return s.jsx(Js,{});const d=(n==null?void 0:n.slug)??e.org;return d===void 0&&i!==null?s.jsx(Xi,{project:i}):d===void 0&&l?s.jsx(br,{}):d===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Tasks open once the organization reads."}):s.jsx(UD,{org:d})}function x5({route:e,navigate:t,served:n}){const{org:a,loading:r,none:l}=sn(),i=e.org===void 0&&!r&&a!==null?`org/${encodeURIComponent(a.slug)}/chat`:null;if(u.useEffect(()=>{i&&t(i)},[i,t]),i||e.org===void 0&&r)return s.jsx(Js,{});const o=(a==null?void 0:a.slug)??e.org;return o===void 0&&l?s.jsx(br,{}):o===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Chat opens once the organization reads."}):s.jsx(l5,{org:o,thread:e.thread,served:n})}function p5({route:e,navigate:t}){const{org:n,loading:a,none:r}=sn(),l=e.org===void 0&&!a&&n!==null?`org/${encodeURIComponent(n.slug)}/queues${window.location.search}`:null;if(u.useEffect(()=>{l&&t(l)},[l,t]),l||e.org===void 0&&a)return s.jsx(Js,{});const i=(n==null?void 0:n.slug)??e.org;if(i===void 0&&r)return s.jsx(br,{});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(S3,{org:i,open:o,path:`/org/${encodeURIComponent(i)}/queues`})}function g5({route:e,navigate:t}){var j;const{org:n,projects:a}=sn(),{project:r,settled:l}=ko(),i=e.project??null,o=i!==null&&a!==null&&!((j=a.find(v=>v.id===i))!=null&&j.current),c=window.location.search,d=i===null&&r!==null?`proj/${encodeURIComponent(r)}/issues${e.issue?`/${encodeURIComponent(e.issue)}`:""}${c}`:null;u.useEffect(()=>{d&&t(d)},[d,t]);const[f,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(Xi,{project:i});if(d||i===null&&!l)return s.jsx(Js,{});if(i===null)return s.jsx(br,{});const g=encodeURIComponent((n==null?void 0:n.slug)??e.org??"");if(e.issue!==void 0){const v=new URLSearchParams(f).get("from");return s.jsx(m3,{org:g,project:i,issue_id:e.issue,from:v,query:f})}return s.jsx(t3,{org:g,project:i,query:f,onQuery:m})}function v5({issue:e,navigate:t,home:n}){const{project:a,settled:r}=ko(),l=a!==null?`proj/${encodeURIComponent(a)}/issues/${encodeURIComponent(e)}`:null;return u.useEffect(()=>{l&&t(l)},[l,t]),l||!r?s.jsx(Js,{}):n}function ko(){var l;const{projects:e,loading:t,none:n,failure:a}=sn();return{project:((l=e==null?void 0:e.find(i=>i.current))==null?void 0:l.id)??null,settled:!t&&(e!==null||n!==null||!!(a!=null&&a.shown))}}function y5({navigate:e}){const{project:t,settled:n}=ko(),a=t!==null?`proj/${encodeURIComponent(t)}/releases${window.location.search}`:null;return u.useEffect(()=>{a&&e(a)},[a,e]),a||!n?s.jsx(Js,{}):s.jsx(br,{})}function ty(e){const t=new URLSearchParams(e);return{release:t.get("release"),planned:t.has("planned")?t.get("planned")??"":null}}function b5({route:e}){var f;const{org:t,projects:n,loading:a}=sn(),r=e.page.kind==="project"?e.page.project:"",[l,i]=u.useState(()=>ty(window.location.search));if(a)return s.jsx(Js,{});if(n!==null&&!((f=n.find(h=>h.id===r))!=null&&f.current))return s.jsx(Xi,{project:r});const c=`/proj/${encodeURIComponent(r)}/releases`,d=h=>{const m=new URLSearchParams;h!=null&&h.startsWith("planned:")?m.set("planned",h.slice(8)):h&&m.set("release",h);const g=m.size>0?`?${m.toString()}`:"";window.history.replaceState(window.history.state,"",`${window.location.pathname}${g}`),i(ty(g))};return s.jsx(rL,{org:(t==null?void 0:t.slug)??"",query:l,onSelect:d,home:c})}function j5({hash:e,navigate:t,home:n}){const{project:a,settled:r}=ko(),l=f1.exec(e),i=l!=null&&l[2]?ju(l[2]):null,o=l!=null&&l[3]?ju(l[3]):null,c=i!==null?`?release=${encodeURIComponent(i)}`:e.startsWith("#planned")?`?planned${o!==null?`=${encodeURIComponent(o)}`:""}`:"",d=a!==null?`proj/${encodeURIComponent(a)}/releases${c}`:null;return u.useEffect(()=>{d&&t(d)},[d,t]),d||!r?s.jsx(Js,{}):n}function Df({route:e,navigate:t,chat:n}){const{org:a}=sn();let r=e.page;const l=e.org!==void 0&&a!==null&&e.org!==a.slug;l&&(r={kind:"not_found"});let i;if(l)i=s.jsx(ey,{});else if("threads"in e)i=s.jsx(h5,{routeOrg:e.org});else if("chat"in e)i=s.jsx(x5,{route:e,navigate:t,served:n});else if("task"in e){const o=new URLSearchParams(window.location.search).get("from");i=s.jsx(f$,{org:encodeURIComponent(e.org),task_id:e.task,from:o})}else"tasks"in e?i=s.jsx(m5,{route:e,navigate:t}):"issues"in e?i=s.jsx(g5,{route:e,navigate:t}):"chart"in e?i=s.jsx(P3,{}):"worktrees"in e?i=s.jsx(n6,{org:(a==null?void 0:a.slug)??e.org}):"workspaces"in e?i=s.jsx($L,{org:(a==null?void 0:a.slug)??e.org}):"queues"in e?i=s.jsx(p5,{route:e,navigate:t}):"releasesForward"in e?i=s.jsx(y5,{navigate:t}):"releases"in e?i=s.jsx(b5,{route:e}):r.kind==="home"?i=s.jsx(br,{}):r.kind==="project"?i=s.jsx(Xi,{project:r.project}):i=s.jsx(ey,{});return s.jsx(pL,{page:r,chat:n===!0,children:i})}function w5({task:e,navigate:t,home:n}){const{org:a,loading:r,none:l,failure:i}=sn(),o=a!==null?`org/${encodeURIComponent(a.slug)}/tasks/${encodeURIComponent(e)}`:null,c=!r&&(l!==null||!!(i!=null&&i.shown));return u.useEffect(()=>{o&&t(o)},[o,t]),o||!c?s.jsx(Js,{}):n}const N5=e=>window.location.replace(e);function ju(e){try{return decodeURIComponent(e)}catch{return null}}function _5({navigate:e=N5,data:t,chat:n=M6}){const a=u5(h1(window.location.pathname),window.location.search),[r,l]=u.useState(null),{notify:i,toasts:o}=E6(),[c,d]=u.useState(null);u.useEffect(()=>{let w=!0;return n().then(_=>w&&d(_)),()=>{w=!1}},[n]);const f=i5.exec(window.location.hash),h=f?ju(f[1]):null,m=o5.exec(window.location.hash),g=m?ju(m[1]):null,j=g!==null&&c5.test(g)?g:null,v=f1.test(window.location.hash)?window.location.hash:null,y=f!==null&&h===null||m!==null&&j===null,x="forward"in a?a.forward:null;u.useEffect(()=>{x&&e(x)},[x,e]);const p=u.useMemo(()=>{if(t)return t;const w=o6();return{probe:{source:async()=>({label:"Local workspace"})},shell:w,issues:w.issues,tasks:d6(),org:u6(),worktrees:h6(),workspaces:m6(),queues:c6(),releases:f6()}},[t]);if(x||"forward"in a||!p.shell)return null;const b=s.jsx(Df,{route:{page:{kind:"home"}},navigate:e,chat:c});return s.jsx("div",{className:"app-ui dark",ref:l,children:s.jsxs(gA,{container:r,children:[s.jsx(t0,{data:p,router:cp,identity:d5,notify:i,children:s.jsx(cL,{shell:p.shell,children:y?s.jsx(Df,{route:{page:{kind:"not_found"}},navigate:e,chat:c}):h!==null?s.jsx(w5,{task:h,navigate:e,home:b}):j!==null?s.jsx(v5,{issue:j,navigate:e,home:b}):v!==null?s.jsx(j5,{hash:v,navigate:e,home:b}):s.jsx(Df,{route:a,navigate:e,chat:c})})}),o]})})}vC.createRoot(document.getElementById("root")).render(s.jsx(u.StrictMode,{children:h1(window.location.pathname)==="app-ui-probe"?s.jsx(CL,{}):s.jsx(_5,{})}));
|