@software-dlc/cli 0.186.5 → 0.186.6
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 +7 -0
- package/dist/local/app-org-reader.d.ts.map +1 -1
- package/dist/local/app-org-reader.js +8 -0
- package/dist/local/app-org-reader.js.map +1 -1
- package/dist/local/local-org-store.d.ts +5 -6
- package/dist/local/local-org-store.d.ts.map +1 -1
- package/dist/local/local-org-store.js +5 -5
- package/dist/local/local-org-store.js.map +1 -1
- package/dist/local/local-org.d.ts +9 -69
- package/dist/local/local-org.d.ts.map +1 -1
- package/dist/local/local-org.js +8 -383
- package/dist/local/local-org.js.map +1 -1
- package/package.json +2 -2
- package/viewer/assets/index-D2FQbWvr.js +404 -0
- package/viewer/assets/index-DGqyCEIM.css +1 -0
- package/viewer/index.html +2 -2
- package/viewer/assets/index-BfNqQNEG.js +0 -399
- package/viewer/assets/index-CPNiXwOB.css +0 -1
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
function H1(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 my(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var py={exports:{}},Eu={};/**
|
|
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 I1=Symbol.for("react.transitional.element"),P1=Symbol.for("react.fragment");function xy(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:I1,type:e,key:a,ref:t!==void 0?t:null,props:n}}Eu.Fragment=P1;Eu.jsx=xy;Eu.jsxs=xy;py.exports=Eu;var s=py.exports,gy={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 pm=Symbol.for("react.transitional.element"),q1=Symbol.for("react.portal"),G1=Symbol.for("react.fragment"),V1=Symbol.for("react.strict_mode"),Y1=Symbol.for("react.profiler"),F1=Symbol.for("react.consumer"),X1=Symbol.for("react.context"),K1=Symbol.for("react.forward_ref"),Q1=Symbol.for("react.suspense"),Z1=Symbol.for("react.memo"),vy=Symbol.for("react.lazy"),Tx=Symbol.iterator;function W1(e){return e===null||typeof e!="object"?null:(e=Tx&&e[Tx]||e["@@iterator"],typeof e=="function"?e:null)}var yy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},by=Object.assign,jy={};function kl(e,t,n){this.props=e,this.context=t,this.refs=jy,this.updater=n||yy}kl.prototype.isReactComponent={};kl.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")};kl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wy(){}wy.prototype=kl.prototype;function xm(e,t,n){this.props=e,this.context=t,this.refs=jy,this.updater=n||yy}var gm=xm.prototype=new wy;gm.constructor=xm;by(gm,kl.prototype);gm.isPureReactComponent=!0;var Rx=Array.isArray,et={H:null,A:null,T:null,S:null,V:null},_y=Object.prototype.hasOwnProperty;function vm(e,t,n,a,r,l){return n=l.ref,{$$typeof:pm,type:e,key:t,ref:n!==void 0?n:null,props:l}}function J1(e,t){return vm(e.type,t,void 0,void 0,void 0,e.props)}function ym(e){return typeof e=="object"&&e!==null&&e.$$typeof===pm}function eS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ex=/\/+/g;function Dd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?eS(""+e.key):t.toString(36)}function Ax(){}function tS(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(Ax,Ax):(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 $r(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 pm:case q1:i=!0;break;case vy:return i=e._init,$r(i(e._payload),t,n,a,r)}}if(i)return r=r(e),i=a===""?"."+Dd(e,0):a,Rx(r)?(n="",i!=null&&(n=i.replace(Ex,"$&/")+"/"),$r(r,t,n,"",function(d){return d})):r!=null&&(ym(r)&&(r=J1(r,n+(r.key==null||e&&e.key===r.key?"":(""+r.key).replace(Ex,"$&/")+"/")+i)),t.push(r)),1;i=0;var o=a===""?".":a+":";if(Rx(e))for(var c=0;c<e.length;c++)a=e[c],l=o+Dd(a,c),i+=$r(a,t,n,l,r);else if(c=W1(e),typeof c=="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,l=o+Dd(a,c++),i+=$r(a,t,n,l,r);else if(l==="object"){if(typeof e.then=="function")return $r(tS(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 zo(e,t,n){if(e==null)return e;var a=[],r=0;return $r(e,a,"","",function(l){return t.call(n,l,r++)}),a}function nS(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 Mx=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 sS(){}Se.Children={map:zo,forEach:function(e,t,n){zo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return zo(e,function(){t++}),t},toArray:function(e){return zo(e,function(t){return t})||[]},only:function(e){if(!ym(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Se.Component=kl;Se.Fragment=G1;Se.Profiler=Y1;Se.PureComponent=xm;Se.StrictMode=V1;Se.Suspense=Q1;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=by({},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)!_y.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 vm(e.type,r,void 0,void 0,l,a)};Se.createContext=function(e){return e={$$typeof:X1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:F1,_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)_y.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 vm(e,l,void 0,void 0,null,r)};Se.createRef=function(){return{current:null}};Se.forwardRef=function(e){return{$$typeof:K1,render:e}};Se.isValidElement=ym;Se.lazy=function(e){return{$$typeof:vy,_payload:{_status:-1,_result:e},_init:nS}};Se.memo=function(e,t){return{$$typeof:Z1,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(sS,Mx)}catch(l){Mx(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";gy.exports=Se;var u=gy.exports;const ca=my(u),Ny=H1({__proto__:null,default:ca},[u]);var ky={exports:{}},Au={},Sy={exports:{}},Cy={};/**
|
|
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(T,E){var k=T.length;T.push(E);e:for(;0<k;){var $=k-1>>>1,V=T[$];if(0<r(V,E))T[$]=E,T[k]=V,k=$;else break e}}function n(T){return T.length===0?null:T[0]}function a(T){if(T.length===0)return null;var E=T[0],k=T.pop();if(k!==E){T[0]=k;e:for(var $=0,V=T.length,A=V>>>1;$<A;){var G=2*($+1)-1,W=T[G],Z=G+1,ge=T[Z];if(0>r(W,k))Z<V&&0>r(ge,W)?(T[$]=ge,T[Z]=k,$=Z):(T[$]=W,T[G]=k,$=G);else if(Z<V&&0>r(ge,k))T[$]=ge,T[Z]=k,$=Z;else break e}}return E}function r(T,E){var k=T.sortIndex-E.sortIndex;return k!==0?k:T.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,p=!1,j=!1,v=!1,b=!1,x=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function w(T){for(var E=n(d);E!==null;){if(E.callback===null)a(d);else if(E.startTime<=T)a(d),E.sortIndex=E.expirationTime,t(c,E);else break;E=n(d)}}function N(T){if(v=!1,w(T),!j)if(n(c)!==null)j=!0,C||(C=!0,P());else{var E=n(d);E!==null&&R(N,E.startTime-T)}}var C=!1,_=-1,S=5,O=-1;function D(){return b?!0:!(e.unstable_now()-O<S)}function I(){if(b=!1,C){var T=e.unstable_now();O=T;var E=!0;try{e:{j=!1,v&&(v=!1,g(_),_=-1),p=!0;var k=m;try{t:{for(w(T),h=n(c);h!==null&&!(h.expirationTime>T&&D());){var $=h.callback;if(typeof $=="function"){h.callback=null,m=h.priorityLevel;var V=$(h.expirationTime<=T);if(T=e.unstable_now(),typeof V=="function"){h.callback=V,w(T),E=!0;break t}h===n(c)&&a(c),w(T)}else a(c);h=n(c)}if(h!==null)E=!0;else{var A=n(d);A!==null&&R(N,A.startTime-T),E=!1}}break e}finally{h=null,m=k,p=!1}E=void 0}}finally{E?P():C=!1}}}var P;if(typeof y=="function")P=function(){y(I)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,U=M.port2;M.port1.onmessage=I,P=function(){U.postMessage(null)}}else P=function(){x(I,0)};function R(T,E){_=x(function(){T(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(T){T.callback=null},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(T){switch(m){case 1:case 2:case 3:var E=3;break;default:E=m}var k=m;m=E;try{return T()}finally{m=k}},e.unstable_requestPaint=function(){b=!0},e.unstable_runWithPriority=function(T,E){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var k=m;m=T;try{return E()}finally{m=k}},e.unstable_scheduleCallback=function(T,E,k){var $=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?$+k:$):k=$,T){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=k+V,T={id:f++,callback:E,priorityLevel:T,startTime:k,expirationTime:V,sortIndex:-1},k>$?(T.sortIndex=k,t(d,T),n(c)===null&&T===n(d)&&(v?(g(_),_=-1):v=!0,R(N,k-$))):(T.sortIndex=V,t(c,T),j||p||(j=!0,C||(C=!0,P()))),T},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(T){var E=m;return function(){var k=m;m=E;try{return T.apply(this,arguments)}finally{m=k}}}})(Cy);Sy.exports=Cy;var aS=Sy.exports,Ty={exports:{}},Ft={};/**
|
|
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 rS=u;function Ry(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 ra(){}var Yt={d:{f:ra,r:function(){throw Error(Ry(522))},D:ra,C:ra,L:ra,m:ra,X:ra,S:ra,M:ra},p:0,findDOMNode:null},lS=Symbol.for("react.portal");function iS(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:lS,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var fi=rS.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Mu(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Ft.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Yt;Ft.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(Ry(299));return iS(e,t,null,n)};Ft.flushSync=function(e){var t=fi.T,n=Yt.p;try{if(fi.T=null,Yt.p=2,e)return e()}finally{fi.T=t,Yt.p=n,Yt.d.f()}};Ft.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Yt.d.C(e,t))};Ft.prefetchDNS=function(e){typeof e=="string"&&Yt.d.D(e)};Ft.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,a=Mu(n,t.crossOrigin),r=typeof t.integrity=="string"?t.integrity:void 0,l=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Yt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:r,fetchPriority:l}):n==="script"&&Yt.d.X(e,{crossOrigin:a,integrity:r,fetchPriority:l,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Ft.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Mu(t.as,t.crossOrigin);Yt.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&&Yt.d.M(e)};Ft.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,a=Mu(n,t.crossOrigin);Yt.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})}};Ft.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Mu(t.as,t.crossOrigin);Yt.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 Yt.d.m(e)};Ft.requestFormReset=function(e){Yt.d.r(e)};Ft.unstable_batchedUpdates=function(e,t){return e(t)};Ft.useFormState=function(e,t,n){return fi.H.useFormState(e,t,n)};Ft.useFormStatus=function(){return fi.H.useHostTransitionStatus()};Ft.version="19.1.0";function Ey(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ey)}catch(e){console.error(e)}}Ey(),Ty.exports=Ft;var Sl=Ty.exports;const oS=my(Sl);/**
|
|
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 kt=aS,Ay=u,cS=Sl;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 My(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function to(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 $y(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 $x(e){if(to(e)!==e)throw Error(Q(188))}function uS(e){var t=e.alternate;if(!t){if(t=to(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 $x(r),e;if(l===a)return $x(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 Oy(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=Oy(e),t!==null)return t;e=e.sibling}return null}var We=Object.assign,dS=Symbol.for("react.element"),Lo=Symbol.for("react.transitional.element"),ni=Symbol.for("react.portal"),Lr=Symbol.for("react.fragment"),Dy=Symbol.for("react.strict_mode"),Yf=Symbol.for("react.profiler"),fS=Symbol.for("react.provider"),zy=Symbol.for("react.consumer"),Hs=Symbol.for("react.context"),bm=Symbol.for("react.forward_ref"),Ff=Symbol.for("react.suspense"),Xf=Symbol.for("react.suspense_list"),jm=Symbol.for("react.memo"),fa=Symbol.for("react.lazy"),Kf=Symbol.for("react.activity"),hS=Symbol.for("react.memo_cache_sentinel"),Ox=Symbol.iterator;function Gl(e){return e===null||typeof e!="object"?null:(e=Ox&&e[Ox]||e["@@iterator"],typeof e=="function"?e:null)}var mS=Symbol.for("react.client.reference");function Qf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===mS?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Lr:return"Fragment";case Yf:return"Profiler";case Dy:return"StrictMode";case Ff:return"Suspense";case Xf:return"SuspenseList";case Kf:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ni:return"Portal";case Hs:return(e.displayName||"Context")+".Provider";case zy:return(e._context.displayName||"Context")+".Consumer";case bm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case jm:return t=e.displayName||null,t!==null?t:Qf(e.type)||"Memo";case fa:t=e._payload,e=e._init;try{return Qf(e(t))}catch{}}return null}var si=Array.isArray,je=Ay.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le=cS.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Qa={pending:!1,data:null,method:null,action:null},Zf=[],Ur=-1;function js(e){return{current:e}}function $t(e){0>Ur||(e.current=Zf[Ur],Zf[Ur]=null,Ur--)}function tt(e,t){Ur++,Zf[Ur]=e.current,e.current=t}var ms=js(null),Ei=js(null),Na=js(null),Oc=js(null);function Dc(e,t){switch(tt(Na,t),tt(Ei,e),tt(ms,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bg(t),e=Jj(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$t(ms),tt(ms,e)}function ul(){$t(ms),$t(Ei),$t(Na)}function Wf(e){e.memoizedState!==null&&tt(Oc,e);var t=ms.current,n=Jj(t,e.type);t!==n&&(tt(Ei,e),tt(ms,n))}function zc(e){Ei.current===e&&($t(ms),$t(Ei)),Oc.current===e&&($t(Oc),Hi._currentValue=Qa)}var Jf=Object.prototype.hasOwnProperty,wm=kt.unstable_scheduleCallback,zd=kt.unstable_cancelCallback,pS=kt.unstable_shouldYield,xS=kt.unstable_requestPaint,ps=kt.unstable_now,gS=kt.unstable_getCurrentPriorityLevel,Ly=kt.unstable_ImmediatePriority,Uy=kt.unstable_UserBlockingPriority,Lc=kt.unstable_NormalPriority,vS=kt.unstable_LowPriority,By=kt.unstable_IdlePriority,yS=kt.log,bS=kt.unstable_setDisableYieldValue,no=null,hn=null;function va(e){if(typeof yS=="function"&&bS(e),hn&&typeof hn.setStrictMode=="function")try{hn.setStrictMode(no,e)}catch{}}var mn=Math.clz32?Math.clz32:_S,jS=Math.log,wS=Math.LN2;function _S(e){return e>>>=0,e===0?32:31-(jS(e)/wS|0)|0}var Uo=256,Bo=4194304;function Ya(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 $u(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=Ya(a):(i&=o,i!==0?r=Ya(i):n||(n=o&~e,n!==0&&(r=Ya(n))))):(o=a&~l,o!==0?r=Ya(o):i!==0?r=Ya(i):n||(n=a&~e,n!==0&&(r=Ya(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 so(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function NS(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 Hy(){var e=Uo;return Uo<<=1,!(Uo&4194048)&&(Uo=256),e}function Iy(){var e=Bo;return Bo<<=1,!(Bo&62914560)&&(Bo=4194304),e}function Ld(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ao(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function kS(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-mn(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 p=m[f];p!==null&&(p.lane&=-536870913)}n&=~h}a!==0&&Py(e,a,0),l!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=l&~(i&~t))}function Py(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-mn(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&4194090}function qy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-mn(n),r=1<<a;r&t|e[a]&t&&(e[a]|=t),n&=~r}}function _m(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 Nm(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Gy(){var e=Le.p;return e!==0?e:(e=window.event,e===void 0?32:c0(e.type))}function SS(e,t){var n=Le.p;try{return Le.p=e,t()}finally{Le.p=n}}var Ba=Math.random().toString(36).slice(2),It="__reactFiber$"+Ba,Jt="__reactProps$"+Ba,Cl="__reactContainer$"+Ba,eh="__reactEvents$"+Ba,CS="__reactListeners$"+Ba,TS="__reactHandles$"+Ba,Dx="__reactResources$"+Ba,ro="__reactMarker$"+Ba;function km(e){delete e[It],delete e[Jt],delete e[eh],delete e[CS],delete e[TS]}function Br(e){var t=e[It];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Cl]||n[It]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Pg(e);e!==null;){if(n=e[It])return n;e=Pg(e)}return t}e=n,n=e.parentNode}return null}function Tl(e){if(e=e[It]||e[Cl]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function ai(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Q(33))}function Qr(e){var t=e[Dx];return t||(t=e[Dx]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[ro]=!0}var Vy=new Set,Yy={};function mr(e,t){dl(e,t),dl(e+"Capture",t)}function dl(e,t){for(Yy[e]=t,e=0;e<t.length;e++)Vy.add(t[e])}var RS=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]*$"),zx={},Lx={};function ES(e){return Jf.call(Lx,e)?!0:Jf.call(zx,e)?!1:RS.test(e)?Lx[e]=!0:(zx[e]=!0,!1)}function hc(e,t,n){if(ES(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 Ho(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 Ms(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 Ud,Ux;function Or(e){if(Ud===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ud=t&&t[1]||"",Ux=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Ud+e+Ux}var Bd=!1;function Hd(e,t){if(!e||Bd)return"";Bd=!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(p){var m=p}Reflect.construct(e,[],h)}else{try{h.call()}catch(p){m=p}e.call(h.prototype)}}else{try{throw Error()}catch(p){m=p}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(p){if(p&&m&&typeof p.stack=="string")return[p.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{Bd=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Or(n):""}function AS(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 Hd(e.type,!1);case 11:return Hd(e.type.render,!1);case 1:return Hd(e.type,!0);case 31:return Or("Activity");default:return""}}function Bx(e){try{var t="";do t+=AS(e),e=e.return;while(e);return t}catch(n){return`
|
|
47
|
+
Error generating stack: `+n.message+`
|
|
48
|
+
`+n.stack}}function wn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Fy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function MS(e){var t=Fy(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 Uc(e){e._valueTracker||(e._valueTracker=MS(e))}function Xy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Fy(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function Bc(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 $S=/[\n"\\]/g;function kn(e){return e.replace($S,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function th(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=""+wn(t)):e.value!==""+wn(t)&&(e.value=""+wn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?nh(e,i,wn(t)):n!=null?nh(e,i,wn(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=""+wn(o):e.removeAttribute("name")}function Ky(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?""+wn(n):"",t=t!=null?""+wn(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 nh(e,t,n){t==="number"&&Bc(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Zr(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=""+wn(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 Qy(e,t,n){if(t!=null&&(t=""+wn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+wn(n):""}function Zy(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(Q(92));if(si(a)){if(1<a.length)throw Error(Q(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=wn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a)}function fl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var OS=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 Hx(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||OS.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Wy(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&&Hx(e,r,a)}else for(var l in t)t.hasOwnProperty(l)&&Hx(e,l,t[l])}function Sm(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 DS=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"]]),zS=/^[\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 mc(e){return zS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var sh=null;function Cm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Hr=null,Wr=null;function Ix(e){var t=Tl(e);if(t&&(e=t.stateNode)){var n=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(th(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="'+kn(""+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));th(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&&Xy(a)}break e;case"textarea":Qy(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Zr(e,!!n.multiple,t,!1)}}}var Id=!1;function Jy(e,t,n){if(Id)return e(t,n);Id=!0;try{var a=e(t);return a}finally{if(Id=!1,(Hr!==null||Wr!==null)&&(qu(),Hr&&(t=Hr,e=Wr,Wr=Hr=null,Ix(t),e)))for(t=0;t<e.length;t++)Ix(e[t])}}function Ai(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 Fs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ah=!1;if(Fs)try{var Vl={};Object.defineProperty(Vl,"passive",{get:function(){ah=!0}}),window.addEventListener("test",Vl,Vl),window.removeEventListener("test",Vl,Vl)}catch{ah=!1}var ya=null,Tm=null,pc=null;function eb(){if(pc)return pc;var e,t=Tm,n=t.length,a,r="value"in ya?ya.value:ya.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 pc=r.slice(e,1<a?1-a:void 0)}function xc(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 Io(){return!0}function Px(){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)?Io:Px,this.isPropagationStopped=Px,this}return We(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=Io)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Io)},persist:function(){},isPersistent:Io}),t}var pr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ou=tn(pr),lo=We({},pr,{view:0,detail:0}),LS=tn(lo),Pd,qd,Yl,Du=We({},lo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rm,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!==Yl&&(Yl&&e.type==="mousemove"?(Pd=e.screenX-Yl.screenX,qd=e.screenY-Yl.screenY):qd=Pd=0,Yl=e),Pd)},movementY:function(e){return"movementY"in e?e.movementY:qd}}),qx=tn(Du),US=We({},Du,{dataTransfer:0}),BS=tn(US),HS=We({},lo,{relatedTarget:0}),Gd=tn(HS),IS=We({},pr,{animationName:0,elapsedTime:0,pseudoElement:0}),PS=tn(IS),qS=We({},pr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),GS=tn(qS),VS=We({},pr,{data:0}),Gx=tn(VS),YS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},FS={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"},XS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=XS[e])?!!t[e]:!1}function Rm(){return KS}var QS=We({},lo,{key:function(e){if(e.key){var t=YS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=xc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?FS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rm,charCode:function(e){return e.type==="keypress"?xc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?xc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ZS=tn(QS),WS=We({},Du,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vx=tn(WS),JS=We({},lo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rm}),e2=tn(JS),t2=We({},pr,{propertyName:0,elapsedTime:0,pseudoElement:0}),n2=tn(t2),s2=We({},Du,{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}),a2=tn(s2),r2=We({},pr,{newState:0,oldState:0}),l2=tn(r2),i2=[9,13,27,32],Em=Fs&&"CompositionEvent"in window,hi=null;Fs&&"documentMode"in document&&(hi=document.documentMode);var o2=Fs&&"TextEvent"in window&&!hi,tb=Fs&&(!Em||hi&&8<hi&&11>=hi),Yx=" ",Fx=!1;function nb(e,t){switch(e){case"keyup":return i2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sb(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ir=!1;function c2(e,t){switch(e){case"compositionend":return sb(t);case"keypress":return t.which!==32?null:(Fx=!0,Yx);case"textInput":return e=t.data,e===Yx&&Fx?null:e;default:return null}}function u2(e,t){if(Ir)return e==="compositionend"||!Em&&nb(e,t)?(e=eb(),pc=Tm=ya=null,Ir=!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 tb&&t.locale!=="ko"?null:t.data;default:return null}}var d2={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 Xx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!d2[e.type]:t==="textarea"}function ab(e,t,n,a){Hr?Wr?Wr.push(a):Wr=[a]:Hr=a,t=su(t,"onChange"),0<t.length&&(n=new Ou("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var mi=null,Mi=null;function f2(e){Qj(e,0)}function zu(e){var t=ai(e);if(Xy(t))return e}function Kx(e,t){if(e==="change")return t}var rb=!1;if(Fs){var Vd;if(Fs){var Yd="oninput"in document;if(!Yd){var Qx=document.createElement("div");Qx.setAttribute("oninput","return;"),Yd=typeof Qx.oninput=="function"}Vd=Yd}else Vd=!1;rb=Vd&&(!document.documentMode||9<document.documentMode)}function Zx(){mi&&(mi.detachEvent("onpropertychange",lb),Mi=mi=null)}function lb(e){if(e.propertyName==="value"&&zu(Mi)){var t=[];ab(t,Mi,e,Cm(e)),Jy(f2,t)}}function h2(e,t,n){e==="focusin"?(Zx(),mi=t,Mi=n,mi.attachEvent("onpropertychange",lb)):e==="focusout"&&Zx()}function m2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zu(Mi)}function p2(e,t){if(e==="click")return zu(t)}function x2(e,t){if(e==="input"||e==="change")return zu(t)}function g2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vn=typeof Object.is=="function"?Object.is:g2;function $i(e,t){if(vn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var r=n[a];if(!Jf.call(t,r)||!vn(e[r],t[r]))return!1}return!0}function Wx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jx(e,t){var n=Wx(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=Wx(n)}}function ib(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ib(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ob(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bc(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=Bc(e.document)}return t}function Am(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 v2=Fs&&"documentMode"in document&&11>=document.documentMode,Pr=null,rh=null,pi=null,lh=!1;function eg(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lh||Pr==null||Pr!==Bc(a)||(a=Pr,"selectionStart"in a&&Am(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}),pi&&$i(pi,a)||(pi=a,a=su(rh,"onSelect"),0<a.length&&(t=new Ou("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Pr)))}function Ga(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var qr={animationend:Ga("Animation","AnimationEnd"),animationiteration:Ga("Animation","AnimationIteration"),animationstart:Ga("Animation","AnimationStart"),transitionrun:Ga("Transition","TransitionRun"),transitionstart:Ga("Transition","TransitionStart"),transitioncancel:Ga("Transition","TransitionCancel"),transitionend:Ga("Transition","TransitionEnd")},Fd={},cb={};Fs&&(cb=document.createElement("div").style,"AnimationEvent"in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),"TransitionEvent"in window||delete qr.transitionend.transition);function xr(e){if(Fd[e])return Fd[e];if(!qr[e])return e;var t=qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in cb)return Fd[e]=t[n];return e}var ub=xr("animationend"),db=xr("animationiteration"),fb=xr("animationstart"),y2=xr("transitionrun"),b2=xr("transitionstart"),j2=xr("transitioncancel"),hb=xr("transitionend"),mb=new Map,ih="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(" ");ih.push("scrollEnd");function Zn(e,t){mb.set(e,t),mr(t,[e])}var tg=new WeakMap;function Sn(e,t){if(typeof e=="object"&&e!==null){var n=tg.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Bx(t)},tg.set(e,t),t)}return{value:e,source:t,stack:Bx(t)}}var jn=[],Gr=0,Mm=0;function Lu(){for(var e=Gr,t=Mm=Gr=0;t<e;){var n=jn[t];jn[t++]=null;var a=jn[t];jn[t++]=null;var r=jn[t];jn[t++]=null;var l=jn[t];if(jn[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&&pb(n,r,l)}}function Uu(e,t,n,a){jn[Gr++]=e,jn[Gr++]=t,jn[Gr++]=n,jn[Gr++]=a,Mm|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function $m(e,t,n,a){return Uu(e,t,n,a),Hc(e)}function Rl(e,t){return Uu(e,null,null,t),Hc(e)}function pb(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-mn(n),e=l.hiddenUpdates,a=e[r],a===null?e[r]=[t]:a.push(t),t.lane=n|536870912),l):null}function Hc(e){if(50<ki)throw ki=0,Th=null,Error(Q(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Vr={};function w2(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 fn(e,t,n,a){return new w2(e,t,n,a)}function Om(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vs(e,t){var n=e.alternate;return n===null?(n=fn(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 xb(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 gc(e,t,n,a,r,l){var i=0;if(a=e,typeof e=="function")Om(e)&&(i=1);else if(typeof e=="string")i=NC(e,n,ms.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Kf:return e=fn(31,n,t,r),e.elementType=Kf,e.lanes=l,e;case Lr:return Za(n.children,r,l,t);case Dy:i=8,r|=24;break;case Yf:return e=fn(12,n,t,r|2),e.elementType=Yf,e.lanes=l,e;case Ff:return e=fn(13,n,t,r),e.elementType=Ff,e.lanes=l,e;case Xf:return e=fn(19,n,t,r),e.elementType=Xf,e.lanes=l,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case fS:case Hs:i=10;break e;case zy:i=9;break e;case bm:i=11;break e;case jm:i=14;break e;case fa:i=16,a=null;break e}i=29,n=Error(Q(130,e===null?"null":typeof e,"")),a=null}return t=fn(i,n,t,r),t.elementType=e,t.type=a,t.lanes=l,t}function Za(e,t,n,a){return e=fn(7,e,a,t),e.lanes=n,e}function Xd(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function Kd(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yr=[],Fr=0,Ic=null,Pc=0,_n=[],Nn=0,Wa=null,Is=1,Ps="";function Fa(e,t){Yr[Fr++]=Pc,Yr[Fr++]=Ic,Ic=e,Pc=t}function gb(e,t,n){_n[Nn++]=Is,_n[Nn++]=Ps,_n[Nn++]=Wa,Wa=e;var a=Is;e=Ps;var r=32-mn(a)-1;a&=~(1<<r),n+=1;var l=32-mn(t)+r;if(30<l){var i=r-r%5;l=(a&(1<<i)-1).toString(32),a>>=i,r-=i,Is=1<<32-mn(t)+r|n<<r|a,Ps=l+e}else Is=1<<l|n<<r|a,Ps=e}function Dm(e){e.return!==null&&(Fa(e,1),gb(e,1,0))}function zm(e){for(;e===Ic;)Ic=Yr[--Fr],Yr[Fr]=null,Pc=Yr[--Fr],Yr[Fr]=null;for(;e===Wa;)Wa=_n[--Nn],_n[Nn]=null,Ps=_n[--Nn],_n[Nn]=null,Is=_n[--Nn],_n[Nn]=null}var Vt=null,dt=null,ze=!1,Ja=null,os=!1,oh=Error(Q(519));function ar(e){var t=Error(Q(418,""));throw Oi(Sn(t,e)),oh}function ng(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[It]=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<Li.length;n++)Ee(Li[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),Ky(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),Uc(t);break;case"select":Ee("invalid",t);break;case"textarea":Ee("invalid",t),Zy(t,a.value,a.defaultValue,a.children),Uc(t)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Wj(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=Yu),t=!0):t=!1,t||ar(e)}function sg(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 13:os=!1;return;case 27:case 3:os=!0;return;default:Vt=Vt.return}}function Fl(e){if(e!==Vt)return!1;if(!ze)return sg(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")||Oh(e.type,e.memoizedProps)),n=!n),n&&dt&&ar(e),sg(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){dt=Gn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}dt=null}}else t===27?(t=dt,Ha(e.type)?(e=Lh,Lh=null,dt=e):dt=t):dt=Vt?Gn(e.stateNode.nextSibling):null;return!0}function io(){dt=Vt=null,ze=!1}function ag(){var e=Ja;return e!==null&&(Wt===null?Wt=e:Wt.push.apply(Wt,e),Ja=null),e}function Oi(e){Ja===null?Ja=[e]:Ja.push(e)}var ch=js(null),gr=null,qs=null;function ma(e,t,n){tt(ch,t._currentValue),t._currentValue=n}function Ys(e){e._currentValue=ch.current,$t(ch)}function uh(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 dh(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),uh(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),uh(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 oo(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;vn(r.pendingProps.value,i.value)||(e!==null?e.push(o):e=[o])}}else if(r===Oc.current){if(i=r.alternate,i===null)throw Error(Q(387));i.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Hi):e=[Hi])}r=r.return}e!==null&&dh(t,e,n,a),t.flags|=262144}function qc(e){for(e=e.firstContext;e!==null;){if(!vn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rr(e){gr=e,qs=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pt(e){return vb(gr,e)}function Po(e,t){return gr===null&&rr(e),vb(e,t)}function vb(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qs===null){if(e===null)throw Error(Q(308));qs=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qs=qs.next=t;return n}var _2=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()})}},N2=kt.unstable_scheduleCallback,k2=kt.unstable_NormalPriority,_t={$$typeof:Hs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Lm(){return{controller:new _2,data:new Map,refCount:0}}function co(e){e.refCount--,e.refCount===0&&N2(k2,function(){e.controller.abort()})}var xi=null,fh=0,hl=0,Jr=null;function S2(e,t){if(xi===null){var n=xi=[];fh=0,hl=lp(),Jr={status:"pending",value:void 0,then:function(a){n.push(a)}}}return fh++,t.then(rg,rg),t}function rg(){if(--fh===0&&xi!==null){Jr!==null&&(Jr.status="fulfilled");var e=xi;xi=null,hl=0,Jr=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 lg=je.S;je.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&S2(e,t),lg!==null&&lg(e,t)};var er=js(null);function Um(){var e=er.current;return e!==null?e:Ze.pooledCache}function vc(e,t){t===null?tt(er,er.current):tt(er,t.pool)}function yb(){var e=Um();return e===null?null:{parent:_t._currentValue,pool:e}}var uo=Error(Q(460)),bb=Error(Q(474)),Bu=Error(Q(542)),hh={then:function(){}};function ig(e){return e=e.status,e==="fulfilled"||e==="rejected"}function qo(){}function jb(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(qo,qo),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cg(e),e;default:if(typeof t.status=="string")t.then(qo,qo);else{if(e=Ze,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,cg(e),e}throw gi=t,uo}}var gi=null;function og(){if(gi===null)throw Error(Q(459));var e=gi;return gi=null,e}function cg(e){if(e===uo||e===Bu)throw Error(Q(483))}var ha=!1;function Bm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mh(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 ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Sa(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=Hc(e),pb(e,null,n),t}return Uu(e,a,t,n),Hc(e)}function vi(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,qy(e,n)}}function Qd(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var r=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};l===null?r=l=i:l=l.next=i,n=n.next}while(n!==null);l===null?r=l=t:l=l.next=t}else r=l=t;n={baseState:a.baseState,firstBaseUpdate:r,lastBaseUpdate:l,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var ph=!1;function yi(){if(ph){var e=Jr;if(e!==null)throw e}}function bi(e,t,n,a){ph=!1;var r=e.updateQueue;ha=!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,p=m!==o.lane;if(p?($e&m)===m:(a&m)===m){m!==0&&m===hl&&(ph=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var j=e,v=o;m=t;var b=n;switch(v.tag){case 1:if(j=v.payload,typeof j=="function"){h=j.call(b,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(b,h,m):j,m==null)break e;h=We({},h,m);break e;case 2:ha=!0}}m=o.callback,m!==null&&(e.flags|=64,p&&(e.flags|=8192),p=r.callbacks,p===null?r.callbacks=[m]:p.push(m))}else p={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(d=f=p,c=h):f=f.next=p,i|=m;if(o=o.next,o===null){if(o=r.shared.pending,o===null)break;p=o,o=p.next,p.next=null,r.lastBaseUpdate=p,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),Da|=i,e.lanes=i,e.memoizedState=h}}function wb(e,t){if(typeof e!="function")throw Error(Q(191,e));e.call(t)}function _b(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wb(n[e],t)}var ml=js(null),Gc=js(0);function ug(e,t){e=Qs,tt(Gc,e),tt(ml,t),Qs=e|t.baseLanes}function xh(){tt(Gc,Qs),tt(ml,ml.current)}function Hm(){Qs=Gc.current,$t(ml),$t(Gc)}var $a=0,Re=null,Xe=null,gt=null,Vc=!1,el=!1,lr=!1,Yc=0,Di=0,tl=null,T2=0;function mt(){throw Error(Q(321))}function Im(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!vn(e[n],t[n]))return!1;return!0}function Pm(e,t,n,a,r,l){return $a=l,Re=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,je.H=e===null||e.memoizedState===null?ej:tj,lr=!1,l=n(a,r),lr=!1,el&&(l=kb(t,n,a,r)),Nb(e),l}function Nb(e){je.H=Fc;var t=Xe!==null&&Xe.next!==null;if($a=0,gt=Xe=Re=null,Vc=!1,Di=0,tl=null,t)throw Error(Q(300));e===null||Mt||(e=e.dependencies,e!==null&&qc(e)&&(Mt=!0))}function kb(e,t,n,a){Re=e;var r=0;do{if(el&&(tl=null),Di=0,el=!1,25<=r)throw Error(Q(301));if(r+=1,gt=Xe=null,e.updateQueue!=null){var l=e.updateQueue;l.lastEffect=null,l.events=null,l.stores=null,l.memoCache!=null&&(l.memoCache.index=0)}je.H=D2,l=t(n,a)}while(el);return l}function R2(){var e=je.H,t=e.useState()[0];return t=typeof t.then=="function"?fo(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(Re.flags|=1024),t}function qm(){var e=Yc!==0;return Yc=0,e}function Gm(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Vm(e){if(Vc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Vc=!1}$a=0,gt=Xe=Re=null,el=!1,Di=Yc=0,tl=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Re.memoizedState=gt=e:gt=gt.next=e,gt}function bt(){if(Xe===null){var e=Re.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=gt===null?Re.memoizedState:gt.next;if(t!==null)gt=t,Xe=e;else{if(e===null)throw Re.alternate===null?Error(Q(467)):Error(Q(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},gt===null?Re.memoizedState=gt=e:gt=gt.next=e}return gt}function Ym(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fo(e){var t=Di;return Di+=1,tl===null&&(tl=[]),e=jb(tl,e,t),t=Re,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,je.H=t===null||t.memoizedState===null?ej:tj),e}function Hu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fo(e);if(e.$$typeof===Hs)return Pt(e)}throw Error(Q(438,String(e)))}function Fm(e){var t=null,n=Re.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Re.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=Ym(),Re.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]=hS;return t.index++,n}function Xs(e,t){return typeof t=="function"?t(e):t}function yc(e){var t=bt();return Xm(t,Xe,e)}function Xm(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?($e&h)===h:($a&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===hl&&(f=!0);else if(($a&m)===m){d=d.next,m===hl&&(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,Re.lanes|=m,Da|=m;h=d.action,lr&&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,Re.lanes|=h,Da|=h;d=d.next}while(d!==null&&d!==t);if(c===null?i=l:c.next=o,!vn(l,e.memoizedState)&&(Mt=!0,f&&(n=Jr,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 Zd(e){var t=bt(),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);vn(l,t.memoizedState)||(Mt=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,a]}function Sb(e,t,n){var a=Re,r=bt(),l=ze;if(l){if(n===void 0)throw Error(Q(407));n=n()}else n=t();var i=!vn((Xe||r).memoizedState,n);i&&(r.memoizedState=n,Mt=!0),r=r.queue;var o=Rb.bind(null,a,r,e);if(ho(2048,8,o,[e]),r.getSnapshot!==t||i||gt!==null&>.memoizedState.tag&1){if(a.flags|=2048,pl(9,Iu(),Tb.bind(null,a,r,n,t),null),Ze===null)throw Error(Q(349));l||$a&124||Cb(a,t,n)}return n}function Cb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Re.updateQueue,t===null?(t=Ym(),Re.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Tb(e,t,n,a){t.value=n,t.getSnapshot=a,Eb(t)&&Ab(e)}function Rb(e,t,n){return n(function(){Eb(t)&&Ab(e)})}function Eb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vn(e,n)}catch{return!0}}function Ab(e){var t=Rl(e,2);t!==null&&xn(t,e,2)}function gh(e){var t=Qt();if(typeof e=="function"){var n=e;if(e=n(),lr){va(!0);try{n()}finally{va(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xs,lastRenderedState:e},t}function Mb(e,t,n,a){return e.baseState=n,Xm(e,Xe,typeof a=="function"?a:Xs)}function E2(e,t,n,a,r){if(Pu(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)}};je.T!==null?n(!0):l.isTransition=!1,a(l),n=t.pending,n===null?(l.next=t.pending=l,$b(t,l)):(l.next=n.next,t.pending=n.next=l)}}function $b(e,t){var n=t.action,a=t.payload,r=e.state;if(t.isTransition){var l=je.T,i={};je.T=i;try{var o=n(r,a),c=je.S;c!==null&&c(i,o),dg(e,t,o)}catch(d){vh(e,t,d)}finally{je.T=l}}else try{l=n(r,a),dg(e,t,l)}catch(d){vh(e,t,d)}}function dg(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){fg(e,t,a)},function(a){return vh(e,t,a)}):fg(e,t,n)}function fg(e,t,n){t.status="fulfilled",t.value=n,Ob(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,$b(e,n)))}function vh(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Ob(t),t=t.next;while(t!==a)}e.action=null}function Ob(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Db(e,t){return t}function hg(e,t){if(ze){var n=Ze.formState;if(n!==null){e:{var a=Re;if(ze){if(dt){t:{for(var r=dt,l=os;r.nodeType!==8;){if(!l){r=null;break t}if(r=Gn(r.nextSibling),r===null){r=null;break t}}l=r.data,r=l==="F!"||l==="F"?r:null}if(r){dt=Gn(r.nextSibling),a=r.data==="F!";break e}}ar(a)}a=!1}a&&(t=n[0])}}return n=Qt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Db,lastRenderedState:t},n.queue=a,n=Zb.bind(null,Re,a),a.dispatch=n,a=gh(!1),l=Wm.bind(null,Re,!1,a.queue),a=Qt(),r={state:t,dispatch:null,action:e,pending:null},a.queue=r,n=E2.bind(null,Re,r,l,n),r.dispatch=n,a.memoizedState=e,[t,n,!1]}function mg(e){var t=bt();return zb(t,Xe,e)}function zb(e,t,n){if(t=Xm(e,t,Db)[0],e=yc(Xs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=fo(t)}catch(i){throw i===uo?Bu:i}else a=t;t=bt();var r=t.queue,l=r.dispatch;return n!==t.memoizedState&&(Re.flags|=2048,pl(9,Iu(),A2.bind(null,r,n),null)),[a,l,e]}function A2(e,t){e.action=t}function pg(e){var t=bt(),n=Xe;if(n!==null)return zb(t,n,e);bt(),t=t.memoizedState,n=bt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function pl(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Re.updateQueue,t===null&&(t=Ym(),Re.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 Iu(){return{destroy:void 0,resource:void 0}}function Lb(){return bt().memoizedState}function bc(e,t,n,a){var r=Qt();a=a===void 0?null:a,Re.flags|=e,r.memoizedState=pl(1|t,Iu(),n,a)}function ho(e,t,n,a){var r=bt();a=a===void 0?null:a;var l=r.memoizedState.inst;Xe!==null&&a!==null&&Im(a,Xe.memoizedState.deps)?r.memoizedState=pl(t,l,n,a):(Re.flags|=e,r.memoizedState=pl(1|t,l,n,a))}function xg(e,t){bc(8390656,8,e,t)}function Ub(e,t){ho(2048,8,e,t)}function Bb(e,t){return ho(4,2,e,t)}function Hb(e,t){return ho(4,4,e,t)}function Ib(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 Pb(e,t,n){n=n!=null?n.concat([e]):null,ho(4,4,Ib.bind(null,t,e),n)}function Km(){}function qb(e,t){var n=bt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Im(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Gb(e,t){var n=bt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Im(t,a[1]))return a[0];if(a=e(),lr){va(!0);try{e()}finally{va(!1)}}return n.memoizedState=[a,t],a}function Qm(e,t,n){return n===void 0||$a&1073741824?e.memoizedState=t:(e.memoizedState=n,e=Oj(),Re.lanes|=e,Da|=e,n)}function Vb(e,t,n,a){return vn(n,t)?n:ml.current!==null?(e=Qm(e,n,a),vn(e,t)||(Mt=!0),e):$a&42?(e=Oj(),Re.lanes|=e,Da|=e,t):(Mt=!0,e.memoizedState=n)}function Yb(e,t,n,a,r){var l=Le.p;Le.p=l!==0&&8>l?l:8;var i=je.T,o={};je.T=o,Wm(e,!1,t,n);try{var c=r(),d=je.S;if(d!==null&&d(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=C2(c,a);ji(e,t,f,pn(e))}else ji(e,t,a,pn(e))}catch(h){ji(e,t,{then:function(){},status:"rejected",reason:h},pn())}finally{Le.p=l,je.T=i}}function M2(){}function yh(e,t,n,a){if(e.tag!==5)throw Error(Q(476));var r=Fb(e).queue;Yb(e,r,t,Qa,n===null?M2:function(){return Xb(e),n(a)})}function Fb(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Qa,baseState:Qa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xs,lastRenderedState:Qa},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xb(e){var t=Fb(e).next.queue;ji(e,t,{},pn())}function Zm(){return Pt(Hi)}function Kb(){return bt().memoizedState}function Qb(){return bt().memoizedState}function $2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pn();e=ka(n);var a=Sa(t,e,n);a!==null&&(xn(a,t,n),vi(a,t,n)),t={cache:Lm()},e.payload=t;return}t=t.return}}function O2(e,t,n){var a=pn();n={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Pu(e)?Wb(t,n):(n=$m(e,t,n,a),n!==null&&(xn(n,e,a),Jb(n,t,a)))}function Zb(e,t,n){var a=pn();ji(e,t,n,a)}function ji(e,t,n,a){var r={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Pu(e))Wb(t,r);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var i=t.lastRenderedState,o=l(i,n);if(r.hasEagerState=!0,r.eagerState=o,vn(o,i))return Uu(e,t,r,0),Ze===null&&Lu(),!1}catch{}finally{}if(n=$m(e,t,r,a),n!==null)return xn(n,e,a),Jb(n,t,a),!0}return!1}function Wm(e,t,n,a){if(a={lane:2,revertLane:lp(),action:a,hasEagerState:!1,eagerState:null,next:null},Pu(e)){if(t)throw Error(Q(479))}else t=$m(e,n,a,2),t!==null&&xn(t,e,2)}function Pu(e){var t=e.alternate;return e===Re||t!==null&&t===Re}function Wb(e,t){el=Vc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Jb(e,t,n){if(n&4194048){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,qy(e,n)}}var Fc={readContext:Pt,use:Hu,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useLayoutEffect:mt,useInsertionEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useSyncExternalStore:mt,useId:mt,useHostTransitionStatus:mt,useFormState:mt,useActionState:mt,useOptimistic:mt,useMemoCache:mt,useCacheRefresh:mt},ej={readContext:Pt,use:Hu,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:xg,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,bc(4194308,4,Ib.bind(null,t,e),n)},useLayoutEffect:function(e,t){return bc(4194308,4,e,t)},useInsertionEffect:function(e,t){bc(4,2,e,t)},useMemo:function(e,t){var n=Qt();t=t===void 0?null:t;var a=e();if(lr){va(!0);try{e()}finally{va(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Qt();if(n!==void 0){var r=n(t);if(lr){va(!0);try{n(t)}finally{va(!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=O2.bind(null,Re,e),[a.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=gh(e);var t=e.queue,n=Zb.bind(null,Re,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Km,useDeferredValue:function(e,t){var n=Qt();return Qm(n,e,t)},useTransition:function(){var e=gh(!1);return e=Yb.bind(null,Re,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Re,r=Qt();if(ze){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),Ze===null)throw Error(Q(349));$e&124||Cb(a,t,n)}r.memoizedState=n;var l={value:n,getSnapshot:t};return r.queue=l,xg(Rb.bind(null,a,l,e),[e]),a.flags|=2048,pl(9,Iu(),Tb.bind(null,a,l,n,t),null),n},useId:function(){var e=Qt(),t=Ze.identifierPrefix;if(ze){var n=Ps,a=Is;n=(a&~(1<<32-mn(a)-1)).toString(32)+n,t="«"+t+"R"+n,n=Yc++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=T2++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Zm,useFormState:hg,useActionState:hg,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=Wm.bind(null,Re,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fm,useCacheRefresh:function(){return Qt().memoizedState=$2.bind(null,Re)}},tj={readContext:Pt,use:Hu,useCallback:qb,useContext:Pt,useEffect:Ub,useImperativeHandle:Pb,useInsertionEffect:Bb,useLayoutEffect:Hb,useMemo:Gb,useReducer:yc,useRef:Lb,useState:function(){return yc(Xs)},useDebugValue:Km,useDeferredValue:function(e,t){var n=bt();return Vb(n,Xe.memoizedState,e,t)},useTransition:function(){var e=yc(Xs)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:fo(e),t]},useSyncExternalStore:Sb,useId:Kb,useHostTransitionStatus:Zm,useFormState:mg,useActionState:mg,useOptimistic:function(e,t){var n=bt();return Mb(n,Xe,e,t)},useMemoCache:Fm,useCacheRefresh:Qb},D2={readContext:Pt,use:Hu,useCallback:qb,useContext:Pt,useEffect:Ub,useImperativeHandle:Pb,useInsertionEffect:Bb,useLayoutEffect:Hb,useMemo:Gb,useReducer:Zd,useRef:Lb,useState:function(){return Zd(Xs)},useDebugValue:Km,useDeferredValue:function(e,t){var n=bt();return Xe===null?Qm(n,e,t):Vb(n,Xe.memoizedState,e,t)},useTransition:function(){var e=Zd(Xs)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:fo(e),t]},useSyncExternalStore:Sb,useId:Kb,useHostTransitionStatus:Zm,useFormState:pg,useActionState:pg,useOptimistic:function(e,t){var n=bt();return Xe!==null?Mb(n,Xe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Fm,useCacheRefresh:Qb},nl=null,zi=0;function Go(e){var t=zi;return zi+=1,nl===null&&(nl=[]),jb(nl,e,t)}function Xl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Vo(e,t){throw t.$$typeof===dS?Error(Q(525)):(e=Object.prototype.toString.call(t),Error(Q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function gg(e){var t=e._init;return t(e._payload)}function nj(e){function t(x,g){if(e){var y=x.deletions;y===null?(x.deletions=[g],x.flags|=16):y.push(g)}}function n(x,g){if(!e)return null;for(;g!==null;)t(x,g),g=g.sibling;return null}function a(x){for(var g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function r(x,g){return x=Vs(x,g),x.index=0,x.sibling=null,x}function l(x,g,y){return x.index=y,e?(y=x.alternate,y!==null?(y=y.index,y<g?(x.flags|=67108866,g):y):(x.flags|=67108866,g)):(x.flags|=1048576,g)}function i(x){return e&&x.alternate===null&&(x.flags|=67108866),x}function o(x,g,y,w){return g===null||g.tag!==6?(g=Xd(y,x.mode,w),g.return=x,g):(g=r(g,y),g.return=x,g)}function c(x,g,y,w){var N=y.type;return N===Lr?f(x,g,y.props.children,w,y.key):g!==null&&(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===fa&&gg(N)===g.type)?(g=r(g,y.props),Xl(g,y),g.return=x,g):(g=gc(y.type,y.key,y.props,null,x.mode,w),Xl(g,y),g.return=x,g)}function d(x,g,y,w){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Kd(y,x.mode,w),g.return=x,g):(g=r(g,y.children||[]),g.return=x,g)}function f(x,g,y,w,N){return g===null||g.tag!==7?(g=Za(y,x.mode,w,N),g.return=x,g):(g=r(g,y),g.return=x,g)}function h(x,g,y){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=Xd(""+g,x.mode,y),g.return=x,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Lo:return y=gc(g.type,g.key,g.props,null,x.mode,y),Xl(y,g),y.return=x,y;case ni:return g=Kd(g,x.mode,y),g.return=x,g;case fa:var w=g._init;return g=w(g._payload),h(x,g,y)}if(si(g)||Gl(g))return g=Za(g,x.mode,y,null),g.return=x,g;if(typeof g.then=="function")return h(x,Go(g),y);if(g.$$typeof===Hs)return h(x,Po(x,g),y);Vo(x,g)}return null}function m(x,g,y,w){var N=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return N!==null?null:o(x,g,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Lo:return y.key===N?c(x,g,y,w):null;case ni:return y.key===N?d(x,g,y,w):null;case fa:return N=y._init,y=N(y._payload),m(x,g,y,w)}if(si(y)||Gl(y))return N!==null?null:f(x,g,y,w,null);if(typeof y.then=="function")return m(x,g,Go(y),w);if(y.$$typeof===Hs)return m(x,g,Po(x,y),w);Vo(x,y)}return null}function p(x,g,y,w,N){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return x=x.get(y)||null,o(g,x,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Lo:return x=x.get(w.key===null?y:w.key)||null,c(g,x,w,N);case ni:return x=x.get(w.key===null?y:w.key)||null,d(g,x,w,N);case fa:var C=w._init;return w=C(w._payload),p(x,g,y,w,N)}if(si(w)||Gl(w))return x=x.get(y)||null,f(g,x,w,N,null);if(typeof w.then=="function")return p(x,g,y,Go(w),N);if(w.$$typeof===Hs)return p(x,g,y,Po(g,w),N);Vo(g,w)}return null}function j(x,g,y,w){for(var N=null,C=null,_=g,S=g=0,O=null;_!==null&&S<y.length;S++){_.index>S?(O=_,_=null):O=_.sibling;var D=m(x,_,y[S],w);if(D===null){_===null&&(_=O);break}e&&_&&D.alternate===null&&t(x,_),g=l(D,g,S),C===null?N=D:C.sibling=D,C=D,_=O}if(S===y.length)return n(x,_),ze&&Fa(x,S),N;if(_===null){for(;S<y.length;S++)_=h(x,y[S],w),_!==null&&(g=l(_,g,S),C===null?N=_:C.sibling=_,C=_);return ze&&Fa(x,S),N}for(_=a(_);S<y.length;S++)O=p(_,x,S,y[S],w),O!==null&&(e&&O.alternate!==null&&_.delete(O.key===null?S:O.key),g=l(O,g,S),C===null?N=O:C.sibling=O,C=O);return e&&_.forEach(function(I){return t(x,I)}),ze&&Fa(x,S),N}function v(x,g,y,w){if(y==null)throw Error(Q(151));for(var N=null,C=null,_=g,S=g=0,O=null,D=y.next();_!==null&&!D.done;S++,D=y.next()){_.index>S?(O=_,_=null):O=_.sibling;var I=m(x,_,D.value,w);if(I===null){_===null&&(_=O);break}e&&_&&I.alternate===null&&t(x,_),g=l(I,g,S),C===null?N=I:C.sibling=I,C=I,_=O}if(D.done)return n(x,_),ze&&Fa(x,S),N;if(_===null){for(;!D.done;S++,D=y.next())D=h(x,D.value,w),D!==null&&(g=l(D,g,S),C===null?N=D:C.sibling=D,C=D);return ze&&Fa(x,S),N}for(_=a(_);!D.done;S++,D=y.next())D=p(_,x,S,D.value,w),D!==null&&(e&&D.alternate!==null&&_.delete(D.key===null?S:D.key),g=l(D,g,S),C===null?N=D:C.sibling=D,C=D);return e&&_.forEach(function(P){return t(x,P)}),ze&&Fa(x,S),N}function b(x,g,y,w){if(typeof y=="object"&&y!==null&&y.type===Lr&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Lo:e:{for(var N=y.key;g!==null;){if(g.key===N){if(N=y.type,N===Lr){if(g.tag===7){n(x,g.sibling),w=r(g,y.props.children),w.return=x,x=w;break e}}else if(g.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===fa&&gg(N)===g.type){n(x,g.sibling),w=r(g,y.props),Xl(w,y),w.return=x,x=w;break e}n(x,g);break}else t(x,g);g=g.sibling}y.type===Lr?(w=Za(y.props.children,x.mode,w,y.key),w.return=x,x=w):(w=gc(y.type,y.key,y.props,null,x.mode,w),Xl(w,y),w.return=x,x=w)}return i(x);case ni:e:{for(N=y.key;g!==null;){if(g.key===N)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(x,g.sibling),w=r(g,y.children||[]),w.return=x,x=w;break e}else{n(x,g);break}else t(x,g);g=g.sibling}w=Kd(y,x.mode,w),w.return=x,x=w}return i(x);case fa:return N=y._init,y=N(y._payload),b(x,g,y,w)}if(si(y))return j(x,g,y,w);if(Gl(y)){if(N=Gl(y),typeof N!="function")throw Error(Q(150));return y=N.call(y),v(x,g,y,w)}if(typeof y.then=="function")return b(x,g,Go(y),w);if(y.$$typeof===Hs)return b(x,g,Po(x,y),w);Vo(x,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,g!==null&&g.tag===6?(n(x,g.sibling),w=r(g,y),w.return=x,x=w):(n(x,g),w=Xd(y,x.mode,w),w.return=x,x=w),i(x)):n(x,g)}return function(x,g,y,w){try{zi=0;var N=b(x,g,y,w);return nl=null,N}catch(_){if(_===uo||_===Bu)throw _;var C=fn(29,_,null,x.mode);return C.lanes=w,C.return=x,C}finally{}}}var xl=nj(!0),sj=nj(!1),Mn=js(null),xs=null;function pa(e){var t=e.alternate;tt(Nt,Nt.current&1),tt(Mn,e),xs===null&&(t===null||ml.current!==null||t.memoizedState!==null)&&(xs=e)}function aj(e){if(e.tag===22){if(tt(Nt,Nt.current),tt(Mn,e),xs===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(xs=e)}}else xa()}function xa(){tt(Nt,Nt.current),tt(Mn,Mn.current)}function Gs(e){$t(Mn),xs===e&&(xs=null),$t(Nt)}var Nt=js(0);function Xc(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==="$?"||zh(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 Wd(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:We({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bh={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=pn(),r=ka(a);r.payload=t,n!=null&&(r.callback=n),t=Sa(e,r,a),t!==null&&(xn(t,e,a),vi(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=pn(),r=ka(a);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=Sa(e,r,a),t!==null&&(xn(t,e,a),vi(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=pn(),a=ka(n);a.tag=2,t!=null&&(a.callback=t),t=Sa(e,a,n),t!==null&&(xn(t,e,n),vi(t,e,n))}};function vg(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?!$i(n,a)||!$i(r,l):!0}function yg(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&&bh.enqueueReplaceState(t,t.state,null)}function ir(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=We({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}var Kc=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 rj(e){Kc(e)}function lj(e){console.error(e)}function ij(e){Kc(e)}function Qc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function bg(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 jh(e,t,n){return n=ka(n),n.tag=3,n.payload={element:null},n.callback=function(){Qc(e,t)},n}function oj(e){return e=ka(e),e.tag=3,e}function cj(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(){bg(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){bg(t,n,a),typeof r!="function"&&(Ca===null?Ca=new Set([this]):Ca.add(this));var o=a.stack;this.componentDidCatch(a.value,{componentStack:o!==null?o:""})})}function z2(e,t,n,a,r){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&oo(t,n,r,!0),n=Mn.current,n!==null){switch(n.tag){case 13:return xs===null?Rh():n.alternate===null&&ft===0&&(ft=3),n.flags&=-257,n.flags|=65536,n.lanes=r,a===hh?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),uf(e,a,r)),!1;case 22:return n.flags|=65536,a===hh?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),uf(e,a,r)),!1}throw Error(Q(435,n.tag))}return uf(e,a,r),Rh(),!1}if(ze)return t=Mn.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,a!==oh&&(e=Error(Q(422),{cause:a}),Oi(Sn(e,n)))):(a!==oh&&(t=Error(Q(423),{cause:a}),Oi(Sn(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,a=Sn(a,n),r=jh(e.stateNode,a,r),Qd(e,r),ft!==4&&(ft=2)),!1;var l=Error(Q(520),{cause:a});if(l=Sn(l,n),Ni===null?Ni=[l]:Ni.push(l),ft!==4&&(ft=2),t===null)return!0;a=Sn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=jh(n.stateNode,a,e),Qd(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"&&(Ca===null||!Ca.has(l))))return n.flags|=65536,r&=-r,n.lanes|=r,r=oj(r),cj(r,e,n,a),Qd(n,r),!1}n=n.return}while(n!==null);return!1}var uj=Error(Q(461)),Mt=!1;function Ot(e,t,n,a){t.child=e===null?sj(t,null,n,a):xl(t,e.child,n,a)}function jg(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 rr(t),a=Pm(e,t,n,i,l,r),o=qm(),e!==null&&!Mt?(Gm(e,t,r),Ks(e,t,r)):(ze&&o&&Dm(t),t.flags|=1,Ot(e,t,a,r),t.child)}function wg(e,t,n,a,r){if(e===null){var l=n.type;return typeof l=="function"&&!Om(l)&&l.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=l,dj(e,t,l,a,r)):(e=gc(n.type,null,a,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!Jm(e,r)){var i=l.memoizedProps;if(n=n.compare,n=n!==null?n:$i,n(i,a)&&e.ref===t.ref)return Ks(e,t,r)}return t.flags|=1,e=Vs(l,a),e.ref=t.ref,e.return=t,t.child=e}function dj(e,t,n,a,r){if(e!==null){var l=e.memoizedProps;if($i(l,a)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=a=l,Jm(e,r))e.flags&131072&&(Mt=!0);else return t.lanes=e.lanes,Ks(e,t,r)}return wh(e,t,n,a,r)}function fj(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 _g(e,t,a,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vc(t,l!==null?l.cachePool:null),l!==null?ug(t,l):xh(),aj(t);else return t.lanes=t.childLanes=536870912,_g(e,t,l!==null?l.baseLanes|n:n,n)}else l!==null?(vc(t,l.cachePool),ug(t,l),xa(),t.memoizedState=null):(e!==null&&vc(t,null),xh(),xa());return Ot(e,t,r,n),t.child}function _g(e,t,n,a){var r=Um();return r=r===null?null:{parent:_t._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&vc(t,null),xh(),aj(t),e!==null&&oo(e,t,a,!0),null}function jc(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 wh(e,t,n,a,r){return rr(t),n=Pm(e,t,n,a,void 0,r),a=qm(),e!==null&&!Mt?(Gm(e,t,r),Ks(e,t,r)):(ze&&a&&Dm(t),t.flags|=1,Ot(e,t,n,r),t.child)}function Ng(e,t,n,a,r,l){return rr(t),t.updateQueue=null,n=kb(t,a,n,r),Nb(e),a=qm(),e!==null&&!Mt?(Gm(e,t,l),Ks(e,t,l)):(ze&&a&&Dm(t),t.flags|=1,Ot(e,t,n,l),t.child)}function kg(e,t,n,a,r){if(rr(t),t.stateNode===null){var l=Vr,i=n.contextType;typeof i=="object"&&i!==null&&(l=Pt(i)),l=new n(a,l),t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=bh,t.stateNode=l,l._reactInternals=t,l=t.stateNode,l.props=a,l.state=t.memoizedState,l.refs={},Bm(t),i=n.contextType,l.context=typeof i=="object"&&i!==null?Pt(i):Vr,l.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(Wd(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&&bh.enqueueReplaceState(l,l.state,null),bi(t,a,l,r),yi(),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=ir(n,o);l.props=c;var d=l.context,f=n.contextType;i=Vr,typeof f=="object"&&f!==null&&(i=Pt(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)&&yg(t,l,a,i),ha=!1;var m=t.memoizedState;l.state=m,bi(t,a,l,r),yi(),d=t.memoizedState,o||m!==d||ha?(typeof h=="function"&&(Wd(t,n,h,a),d=t.memoizedState),(c=ha||vg(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,mh(e,t),i=t.memoizedProps,f=ir(n,i),l.props=f,h=t.pendingProps,m=l.context,d=n.contextType,c=Vr,typeof d=="object"&&d!==null&&(c=Pt(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)&&yg(t,l,a,c),ha=!1,m=t.memoizedState,l.state=m,bi(t,a,l,r),yi();var p=t.memoizedState;i!==h||m!==p||ha||e!==null&&e.dependencies!==null&&qc(e.dependencies)?(typeof o=="function"&&(Wd(t,n,o,a),p=t.memoizedState),(f=ha||vg(t,n,f,a,m,p,c)||e!==null&&e.dependencies!==null&&qc(e.dependencies))?(d||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(a,p,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(a,p,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=p),l.props=a,l.state=p,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,jc(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)):Ot(e,t,n,r),t.memoizedState=l.state,e=t.child):e=Ks(e,t,r),e}function Sg(e,t,n,a){return io(),t.flags|=256,Ot(e,t,n,a),t.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ef(e){return{baseLanes:e,cachePool:yb()}}function tf(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Cn),e}function hj(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:(Nt.current&2)!==0),i&&(r=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(r?pa(t):xa(),ze){var o=dt,c;if(c=o){e:{for(c=o,o=os;c.nodeType!==8;){if(!o){o=null;break e}if(c=Gn(c.nextSibling),c===null){o=null;break e}}o=c}o!==null?(t.memoizedState={dehydrated:o,treeContext:Wa!==null?{id:Is,overflow:Ps}:null,retryLane:536870912,hydrationErrors:null},c=fn(18,null,null,0),c.stateNode=o,c.return=t,t.child=c,Vt=t,dt=null,c=!0):c=!1}c||ar(t)}if(o=t.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return zh(o)?t.lanes=32:t.lanes=536870912,null;Gs(t)}return o=a.children,a=a.fallback,r?(xa(),r=t.mode,o=Zc({mode:"hidden",children:o},r),a=Za(a,r,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,r=t.child,r.memoizedState=ef(n),r.childLanes=tf(e,i,n),t.memoizedState=Jd,a):(pa(t),_h(t,o))}if(c=e.memoizedState,c!==null&&(o=c.dehydrated,o!==null)){if(l)t.flags&256?(pa(t),t.flags&=-257,t=nf(e,t,n)):t.memoizedState!==null?(xa(),t.child=e.child,t.flags|=128,t=null):(xa(),r=a.fallback,o=t.mode,a=Zc({mode:"visible",children:a.children},o),r=Za(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=ef(n),a.childLanes=tf(e,i,n),t.memoizedState=Jd,t=r);else if(pa(t),zh(o)){if(i=o.nextSibling&&o.nextSibling.dataset,i)var d=i.dgst;i=d,a=Error(Q(419)),a.stack="",a.digest=i,Oi({value:a,source:null,stack:null}),t=nf(e,t,n)}else if(Mt||oo(e,t,n,!1),i=(n&e.childLanes)!==0,Mt||i){if(i=Ze,i!==null&&(a=n&-n,a=a&42?1:_m(a),a=a&(i.suspendedLanes|n)?0:a,a!==0&&a!==c.retryLane))throw c.retryLane=a,Rl(e,a),xn(i,e,a),uj;o.data==="$?"||Rh(),t=nf(e,t,n)}else o.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,dt=Gn(o.nextSibling),Vt=t,ze=!0,Ja=null,os=!1,e!==null&&(_n[Nn++]=Is,_n[Nn++]=Ps,_n[Nn++]=Wa,Is=e.id,Ps=e.overflow,Wa=t),t=_h(t,a.children),t.flags|=4096);return t}return r?(xa(),r=a.fallback,o=t.mode,c=e.child,d=c.sibling,a=Vs(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,d!==null?r=Vs(d,r):(r=Za(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=ef(n):(c=o.cachePool,c!==null?(d=_t._currentValue,c=c.parent!==d?{parent:d,pool:d}:c):c=yb(),o={baseLanes:o.baseLanes|n,cachePool:c}),r.memoizedState=o,r.childLanes=tf(e,i,n),t.memoizedState=Jd,a):(pa(t),n=e.child,e=n.sibling,n=Vs(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 _h(e,t){return t=Zc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Zc(e,t){return e=fn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function nf(e,t,n){return xl(t,e.child,null,n),e=_h(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cg(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),uh(e.return,t,n)}function sf(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 mj(e,t,n){var a=t.pendingProps,r=a.revealOrder,l=a.tail;if(Ot(e,t,a.children,n),a=Nt.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&&Cg(e,n,t);else if(e.tag===19)Cg(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(Nt,a),r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Xc(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),sf(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&&Xc(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}sf(t,!0,n,null,l);break;case"together":sf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ks(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Da|=t.lanes,!(n&t.childLanes))if(e!==null){if(oo(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=Vs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Vs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Jm(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&qc(e)))}function L2(e,t,n){switch(t.tag){case 3:Dc(t,t.stateNode.containerInfo),ma(t,_t,e.memoizedState.cache),io();break;case 27:case 5:Wf(t);break;case 4:Dc(t,t.stateNode.containerInfo);break;case 10:ma(t,t.type,t.memoizedProps.value);break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(pa(t),t.flags|=128,null):n&t.child.childLanes?hj(e,t,n):(pa(t),e=Ks(e,t,n),e!==null?e.sibling:null);pa(t);break;case 19:var r=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(oo(e,t,n,!1),a=(n&t.childLanes)!==0),r){if(a)return mj(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),tt(Nt,Nt.current),a)break;return null;case 22:case 23:return t.lanes=0,fj(e,t,n);case 24:ma(t,_t,e.memoizedState.cache)}return Ks(e,t,n)}function pj(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!Jm(e,n)&&!(t.flags&128))return Mt=!1,L2(e,t,n);Mt=!!(e.flags&131072)}else Mt=!1,ze&&t.flags&1048576&&gb(t,Pc,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")Om(a)?(e=ir(a,e),t.tag=1,t=kg(null,t,a,e,n)):(t.tag=0,t=wh(null,t,a,e,n));else{if(a!=null){if(r=a.$$typeof,r===bm){t.tag=11,t=jg(null,t,a,e,n);break e}else if(r===jm){t.tag=14,t=wg(null,t,a,e,n);break e}}throw t=Qf(a)||a,Error(Q(306,t,""))}}return t;case 0:return wh(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,r=ir(a,t.pendingProps),kg(e,t,a,r,n);case 3:e:{if(Dc(t,t.stateNode.containerInfo),e===null)throw Error(Q(387));a=t.pendingProps;var l=t.memoizedState;r=l.element,mh(e,t),bi(t,a,null,n);var i=t.memoizedState;if(a=i.cache,ma(t,_t,a),a!==l.cache&&dh(t,[_t],n,!0),yi(),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=Sg(e,t,a,n);break e}else if(a!==r){r=Sn(Error(Q(424)),t),Oi(r),t=Sg(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(dt=Gn(e.firstChild),Vt=t,ze=!0,Ja=null,os=!0,n=sj(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(io(),a===r){t=Ks(e,t,n);break e}Ot(e,t,a,n)}t=t.child}return t;case 26:return jc(e,t),e===null?(n=Gg(t.type,null,t.pendingProps,null))?t.memoizedState=n:ze||(n=t.type,e=t.pendingProps,a=au(Na.current).createElement(n),a[It]=t,a[Jt]=e,zt(a,n,e),At(a),t.stateNode=a):t.memoizedState=Gg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Wf(t),e===null&&ze&&(a=t.stateNode=t0(t.type,t.pendingProps,Na.current),Vt=t,os=!0,r=dt,Ha(t.type)?(Lh=r,dt=Gn(a.firstChild)):dt=r),Ot(e,t,t.pendingProps.children,n),jc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((r=a=dt)&&(a=dC(a,t.type,t.pendingProps,os),a!==null?(t.stateNode=a,Vt=t,dt=Gn(a.firstChild),os=!1,r=!0):r=!1),r||ar(t)),Wf(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,a=l.children,Oh(r,l)?a=null:i!==null&&Oh(r,i)&&(t.flags|=32),t.memoizedState!==null&&(r=Pm(e,t,R2,null,null,n),Hi._currentValue=r),jc(e,t),Ot(e,t,a,n),t.child;case 6:return e===null&&ze&&((e=n=dt)&&(n=fC(n,t.pendingProps,os),n!==null?(t.stateNode=n,Vt=t,dt=null,e=!0):e=!1),e||ar(t)),null;case 13:return hj(e,t,n);case 4:return Dc(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=xl(t,null,a,n):Ot(e,t,a,n),t.child;case 11:return jg(e,t,t.type,t.pendingProps,n);case 7:return Ot(e,t,t.pendingProps,n),t.child;case 8:return Ot(e,t,t.pendingProps.children,n),t.child;case 12:return Ot(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,ma(t,t.type,a.value),Ot(e,t,a.children,n),t.child;case 9:return r=t.type._context,a=t.pendingProps.children,rr(t),r=Pt(r),a=a(r),t.flags|=1,Ot(e,t,a,n),t.child;case 14:return wg(e,t,t.type,t.pendingProps,n);case 15:return dj(e,t,t.type,t.pendingProps,n);case 19:return mj(e,t,n);case 31:return a=t.pendingProps,n=t.mode,a={mode:a.mode,children:a.children},e===null?(n=Zc(a,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Vs(e.child,a),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return fj(e,t,n);case 24:return rr(t),a=Pt(_t),e===null?(r=Um(),r===null&&(r=Ze,l=Lm(),r.pooledCache=l,l.refCount++,l!==null&&(r.pooledCacheLanes|=n),r=l),t.memoizedState={parent:a,cache:r},Bm(t),ma(t,_t,r)):(e.lanes&n&&(mh(e,t),bi(t,null,null,n),yi()),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),ma(t,_t,a)):(a=l.cache,ma(t,_t,a),a!==r.cache&&dh(t,[_t],n,!0))),Ot(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(Q(156,t.tag))}function $s(e){e.flags|=4}function Tg(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!a0(t)){if(t=Mn.current,t!==null&&(($e&4194048)===$e?xs!==null:($e&62914560)!==$e&&!($e&536870912)||t!==xs))throw gi=hh,bb;e.flags|=8192}}function Yo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Iy():536870912,e.lanes|=t,gl|=t)}function Kl(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 it(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 U2(e,t,n){var a=t.pendingProps;switch(zm(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(t),null;case 1:return it(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ys(_t),ul(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fl(t)?$s(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ag())),it(t),null;case 26:return n=t.memoizedState,e===null?($s(t),n!==null?(it(t),Tg(t,n)):(it(t),t.flags&=-16777217)):n?n!==e.memoizedState?($s(t),it(t),Tg(t,n)):(it(t),t.flags&=-16777217):(e.memoizedProps!==a&&$s(t),it(t),t.flags&=-16777217),null;case 27:zc(t),n=Na.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==a&&$s(t);else{if(!a){if(t.stateNode===null)throw Error(Q(166));return it(t),null}e=ms.current,Fl(t)?ng(t):(e=t0(r,a,n),t.stateNode=e,$s(t))}return it(t),null;case 5:if(zc(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&$s(t);else{if(!a){if(t.stateNode===null)throw Error(Q(166));return it(t),null}if(e=ms.current,Fl(t))ng(t);else{switch(r=au(Na.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[It]=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(zt(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&&$s(t)}}return it(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&$s(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(Q(166));if(e=Na.current,Fl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,r=Vt,r!==null)switch(r.tag){case 27:case 5:a=r.memoizedProps}e[It]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Wj(e.nodeValue,n)),e||ar(t)}else e=au(e).createTextNode(a),e[It]=t,t.stateNode=e}return it(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Fl(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[It]=t}else io(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;it(t),r=!1}else r=ag(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(Gs(t),t):(Gs(t),null)}if(Gs(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),Yo(t,t.updateQueue),it(t),null;case 4:return ul(),e===null&&ip(t.stateNode.containerInfo),it(t),null;case 10:return Ys(t.type),it(t),null;case 19:if($t(Nt),r=t.memoizedState,r===null)return it(t),null;if(a=(t.flags&128)!==0,l=r.rendering,l===null)if(a)Kl(r,!1);else{if(ft!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Xc(e),l!==null){for(t.flags|=128,Kl(r,!1),e=l.updateQueue,t.updateQueue=e,Yo(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)xb(n,e),n=n.sibling;return tt(Nt,Nt.current&1|2),t.child}e=e.sibling}r.tail!==null&&ps()>Jc&&(t.flags|=128,a=!0,Kl(r,!1),t.lanes=4194304)}else{if(!a)if(e=Xc(l),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Yo(t,e),Kl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!l.alternate&&!ze)return it(t),null}else 2*ps()-r.renderingStartTime>Jc&&n!==536870912&&(t.flags|=128,a=!0,Kl(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=ps(),t.sibling=null,e=Nt.current,tt(Nt,a?e&1|2:e&1),t):(it(t),null);case 22:case 23:return Gs(t),Hm(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?n&536870912&&!(t.flags&128)&&(it(t),t.subtreeFlags&6&&(t.flags|=8192)):it(t),n=t.updateQueue,n!==null&&Yo(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&&$t(er),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ys(_t),it(t),null;case 25:return null;case 30:return null}throw Error(Q(156,t.tag))}function B2(e,t){switch(zm(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ys(_t),ul(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return zc(t),null;case 13:if(Gs(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));io()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $t(Nt),null;case 4:return ul(),null;case 10:return Ys(t.type),null;case 22:case 23:return Gs(t),Hm(),e!==null&&$t(er),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ys(_t),null;case 25:return null;default:return null}}function xj(e,t){switch(zm(t),t.tag){case 3:Ys(_t),ul();break;case 26:case 27:case 5:zc(t);break;case 4:ul();break;case 13:Gs(t);break;case 19:$t(Nt);break;case 10:Ys(t.type);break;case 22:case 23:Gs(t),Hm(),e!==null&&$t(er);break;case 24:Ys(_t)}}function mo(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 Oa(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 gj(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{_b(t,n)}catch(a){Ke(e,e.return,a)}}}function vj(e,t,n){n.props=ir(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Ke(e,t,a)}}function wi(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 ds(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 yj(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 af(e,t,n){try{var a=e.stateNode;lC(a,e.type,n,t),a[Jt]=t}catch(r){Ke(e,e.return,r)}}function bj(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ha(e.type)||e.tag===4}function rf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bj(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&&Ha(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 Nh(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=Yu));else if(a!==4&&(a===27&&Ha(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Nh(e,t,n),e=e.sibling;e!==null;)Nh(e,t,n),e=e.sibling}function Wc(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&&Ha(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Wc(e,t,n),e=e.sibling;e!==null;)Wc(e,t,n),e=e.sibling}function jj(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);zt(t,a,n),t[It]=e,t[Jt]=n}catch(l){Ke(e,e.return,l)}}var Bs=!1,pt=!1,lf=!1,Rg=typeof WeakSet=="function"?WeakSet:Set,Et=null;function H2(e,t){if(e=e.containerInfo,Mh=ou,e=ob(e),Am(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 p;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),(p=h.firstChild)!==null;)m=h,h=p;for(;;){if(h===e)break t;if(m===n&&++d===r&&(o=i),m===l&&++f===a&&(c=i),(p=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=p}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for($h={focusedElem:e,selectionRange:n},ou=!1,Et=t;Et!==null;)if(t=Et,e=t.child,(t.subtreeFlags&1024)!==0&&e!==null)e.return=t,Et=e;else for(;Et!==null;){switch(t=Et,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=ir(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)Dh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Dh(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,Et=e;break}Et=t.return}}function wj(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:la(e,n),a&4&&mo(5,n);break;case 1:if(la(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Ke(n,n.return,i)}else{var r=ir(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Ke(n,n.return,i)}}a&64&&gj(n),a&512&&wi(n,n.return);break;case 3:if(la(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{_b(e,t)}catch(i){Ke(n,n.return,i)}}break;case 27:t===null&&a&4&&jj(n);case 26:case 5:la(e,n),t===null&&a&4&&yj(n),a&512&&wi(n,n.return);break;case 12:la(e,n);break;case 13:la(e,n),a&4&&kj(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=K2.bind(null,n),hC(e,n))));break;case 22:if(a=n.memoizedState!==null||Bs,!a){t=t!==null&&t.memoizedState!==null||pt,r=Bs;var l=pt;Bs=a,(pt=t)&&!l?ua(e,n,(n.subtreeFlags&8772)!==0):la(e,n),Bs=r,pt=l}break;case 30:break;default:la(e,n)}}function _j(e){var t=e.alternate;t!==null&&(e.alternate=null,_j(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&km(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,Zt=!1;function Os(e,t,n){for(n=n.child;n!==null;)Nj(e,t,n),n=n.sibling}function Nj(e,t,n){if(hn&&typeof hn.onCommitFiberUnmount=="function")try{hn.onCommitFiberUnmount(no,n)}catch{}switch(n.tag){case 26:pt||ds(n,t),Os(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:pt||ds(n,t);var a=Je,r=Zt;Ha(n.type)&&(Je=n.stateNode,Zt=!1),Os(e,t,n),Si(n.stateNode),Je=a,Zt=r;break;case 5:pt||ds(n,t);case 6:if(a=Je,r=Zt,Je=null,Os(e,t,n),Je=a,Zt=r,Je!==null)if(Zt)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&&(Zt?(e=Je,Ig(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),qi(e)):Ig(Je,n.stateNode));break;case 4:a=Je,r=Zt,Je=n.stateNode.containerInfo,Zt=!0,Os(e,t,n),Je=a,Zt=r;break;case 0:case 11:case 14:case 15:pt||Oa(2,n,t),pt||Oa(4,n,t),Os(e,t,n);break;case 1:pt||(ds(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&vj(n,t,a)),Os(e,t,n);break;case 21:Os(e,t,n);break;case 22:pt=(a=pt)||n.memoizedState!==null,Os(e,t,n),pt=a;break;default:Os(e,t,n)}}function kj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{qi(e)}catch(n){Ke(t,t.return,n)}}function I2(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Rg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Rg),t;default:throw Error(Q(435,e.tag))}}function of(e,t){var n=I2(e);t.forEach(function(a){var r=Q2.bind(null,e,a);n.has(a)||(n.add(a),a.then(r,r))})}function ln(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(Ha(o.type)){Je=o.stateNode,Zt=!1;break e}break;case 5:Je=o.stateNode,Zt=!1;break e;case 3:case 4:Je=o.stateNode.containerInfo,Zt=!0;break e}o=o.return}if(Je===null)throw Error(Q(160));Nj(l,i,r),Je=null,Zt=!1,l=r.alternate,l!==null&&(l.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Sj(t,e),t=t.sibling}var Bn=null;function Sj(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ln(t,e),on(e),a&4&&(Oa(3,e,e.return),mo(3,e),Oa(5,e,e.return));break;case 1:ln(t,e),on(e),a&512&&(pt||n===null||ds(n,n.return)),a&64&&Bs&&(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=Bn;if(ln(t,e),on(e),a&512&&(pt||n===null||ds(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[ro]||l[It]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=r.createElement(a),r.head.insertBefore(l,r.querySelector("head > title"))),zt(l,a,n),l[It]=e,At(l),a=l;break e;case"link":var i=Yg("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),zt(l,a,n),r.head.appendChild(l);break;case"meta":if(i=Yg("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),zt(l,a,n),r.head.appendChild(l);break;default:throw Error(Q(468,a))}l[It]=e,At(l),a=l}e.stateNode=a}else Fg(r,e.type,e.stateNode);else e.stateNode=Vg(r,a,e.memoizedProps);else l!==a?(l===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):l.count--,a===null?Fg(r,e.type,e.stateNode):Vg(r,a,e.memoizedProps)):a===null&&e.stateNode!==null&&af(e,e.memoizedProps,n.memoizedProps)}break;case 27:ln(t,e),on(e),a&512&&(pt||n===null||ds(n,n.return)),n!==null&&a&4&&af(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ln(t,e),on(e),a&512&&(pt||n===null||ds(n,n.return)),e.flags&32){r=e.stateNode;try{fl(r,"")}catch(p){Ke(e,e.return,p)}}a&4&&e.stateNode!=null&&(r=e.memoizedProps,af(e,r,n!==null?n.memoizedProps:r)),a&1024&&(lf=!0);break;case 6:if(ln(t,e),on(e),a&4){if(e.stateNode===null)throw Error(Q(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(p){Ke(e,e.return,p)}}break;case 3:if(Nc=null,r=Bn,Bn=ru(t.containerInfo),ln(t,e),Bn=r,on(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{qi(t.containerInfo)}catch(p){Ke(e,e.return,p)}lf&&(lf=!1,Cj(e));break;case 4:a=Bn,Bn=ru(e.stateNode.containerInfo),ln(t,e),on(e),Bn=a;break;case 12:ln(t,e),on(e);break;case 13:ln(t,e),on(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ap=ps()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,of(e,a)));break;case 22:r=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=Bs,f=pt;if(Bs=d||r,pt=f||c,ln(t,e),pt=f,Bs=d,on(e),a&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(n===null||c||Bs||pt||Xa(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(p){Ke(c,c.return,p)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=r?"":c.memoizedProps}catch(p){Ke(c,c.return,p)}}}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,of(e,n))));break;case 19:ln(t,e),on(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,of(e,a)));break;case 30:break;case 21:break;default:ln(t,e),on(e)}}function on(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(bj(a)){n=a;break}a=a.return}if(n==null)throw Error(Q(160));switch(n.tag){case 27:var r=n.stateNode,l=rf(e);Wc(e,l,r);break;case 5:var i=n.stateNode;n.flags&32&&(fl(i,""),n.flags&=-33);var o=rf(e);Wc(e,o,i);break;case 3:case 4:var c=n.stateNode.containerInfo,d=rf(e);Nh(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 Cj(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cj(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wj(e,t.alternate,t),t=t.sibling}function Xa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oa(4,t,t.return),Xa(t);break;case 1:ds(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&vj(t,t.return,n),Xa(t);break;case 27:Si(t.stateNode);case 26:case 5:ds(t,t.return),Xa(t);break;case 22:t.memoizedState===null&&Xa(t);break;case 30:Xa(t);break;default:Xa(t)}e=e.sibling}}function ua(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:ua(r,l,n),mo(4,l);break;case 1:if(ua(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++)wb(c[r],o)}catch(d){Ke(a,a.return,d)}}n&&i&64&&gj(l),wi(l,l.return);break;case 27:jj(l);case 26:case 5:ua(r,l,n),n&&a===null&&i&4&&yj(l),wi(l,l.return);break;case 12:ua(r,l,n);break;case 13:ua(r,l,n),n&&i&4&&kj(r,l);break;case 22:l.memoizedState===null&&ua(r,l,n),wi(l,l.return);break;case 30:break;default:ua(r,l,n)}t=t.sibling}}function ep(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&&co(n))}function tp(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&co(e))}function is(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tj(e,t,n,a),t=t.sibling}function Tj(e,t,n,a){var r=t.flags;switch(t.tag){case 0:case 11:case 15:is(e,t,n,a),r&2048&&mo(9,t);break;case 1:is(e,t,n,a);break;case 3:is(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&&co(e)));break;case 12:if(r&2048){is(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 is(e,t,n,a);break;case 13:is(e,t,n,a);break;case 23:break;case 22:l=t.stateNode,i=t.alternate,t.memoizedState!==null?l._visibility&2?is(e,t,n,a):_i(e,t):l._visibility&2?is(e,t,n,a):(l._visibility|=2,Dr(e,t,n,a,(t.subtreeFlags&10256)!==0)),r&2048&&ep(i,t);break;case 24:is(e,t,n,a),r&2048&&tp(t.alternate,t);break;default:is(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),mo(8,i);break;case 23:break;case 22:var f=i.stateNode;i.memoizedState!==null?f._visibility&2?Dr(l,i,o,c,r):_i(l,i):(f._visibility|=2,Dr(l,i,o,c,r)),r&&d&2048&&ep(i.alternate,i);break;case 24:Dr(l,i,o,c,r),r&&d&2048&&tp(i.alternate,i);break;default:Dr(l,i,o,c,r)}t=t.sibling}}function _i(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:_i(n,a),r&2048&&ep(a.alternate,a);break;case 24:_i(n,a),r&2048&&tp(a.alternate,a);break;default:_i(n,a)}t=t.sibling}}var ri=8192;function _r(e){if(e.subtreeFlags&ri)for(e=e.child;e!==null;)Rj(e),e=e.sibling}function Rj(e){switch(e.tag){case 26:_r(e),e.flags&ri&&e.memoizedState!==null&&SC(Bn,e.memoizedState,e.memoizedProps);break;case 5:_r(e);break;case 3:case 4:var t=Bn;Bn=ru(e.stateNode.containerInfo),_r(e),Bn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ri,ri=16777216,_r(e),ri=t):_r(e));break;default:_r(e)}}function Ej(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 Ql(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Et=a,Mj(a,e)}Ej(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Aj(e),e=e.sibling}function Aj(e){switch(e.tag){case 0:case 11:case 15:Ql(e),e.flags&2048&&Oa(9,e,e.return);break;case 3:Ql(e);break;case 12:Ql(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,wc(e)):Ql(e);break;default:Ql(e)}}function wc(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Et=a,Mj(a,e)}Ej(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oa(8,t,t.return),wc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,wc(t));break;default:wc(t)}e=e.sibling}}function Mj(e,t){for(;Et!==null;){var n=Et;switch(n.tag){case 0:case 11:case 15:Oa(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:co(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Et=a;else e:for(n=e;Et!==null;){a=Et;var r=a.sibling,l=a.return;if(_j(a),a===n){Et=null;break e}if(r!==null){r.return=l,Et=r;break e}Et=l}}}var P2={getCacheForType:function(e){var t=Pt(_t),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},q2=typeof WeakMap=="function"?WeakMap:Map,qe=0,Ze=null,Ae=null,$e=0,Pe=0,un=null,ba=!1,El=!1,np=!1,Qs=0,ft=0,Da=0,tr=0,sp=0,Cn=0,gl=0,Ni=null,Wt=null,kh=!1,ap=0,Jc=1/0,eu=null,Ca=null,Dt=0,Ta=null,vl=null,sl=0,Sh=0,Ch=null,$j=null,ki=0,Th=null;function pn(){if(qe&2&&$e!==0)return $e&-$e;if(je.T!==null){var e=hl;return e!==0?e:lp()}return Gy()}function Oj(){Cn===0&&(Cn=!($e&536870912)||ze?Hy():536870912);var e=Mn.current;return e!==null&&(e.flags|=32),Cn}function xn(e,t,n){(e===Ze&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(yl(e,0),ja(e,$e,Cn,!1)),ao(e,n),(!(qe&2)||e!==Ze)&&(e===Ze&&(!(qe&2)&&(tr|=n),ft===4&&ja(e,$e,Cn,!1)),ws(e))}function Dj(e,t,n){if(qe&6)throw Error(Q(327));var a=!n&&(t&124)===0&&(t&e.expiredLanes)===0||so(e,t),r=a?Y2(e,t):cf(e,t,!0),l=a;do{if(r===0){El&&!a&&ja(e,t,0,!1);break}else{if(n=e.current.alternate,l&&!G2(n)){r=cf(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=Ni;var c=o.current.memoizedState.isDehydrated;if(c&&(yl(o,i).flags|=256),i=cf(o,i,!1),i!==2){if(np&&!c){o.errorRecoveryDisabledLanes|=l,tr|=l,r=4;break e}l=Wt,Wt=r,l!==null&&(Wt===null?Wt=l:Wt.push.apply(Wt,l))}r=i}if(l=!1,r!==2)continue}}if(r===1){yl(e,0),ja(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:ja(a,t,Cn,!ba);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(Q(329))}if((t&62914560)===t&&(r=ap+300-ps(),10<r)){if(ja(a,t,Cn,!ba),$u(a,0,!0)!==0)break e;a.timeoutHandle=e0(Eg.bind(null,a,n,Wt,eu,kh,t,Cn,tr,gl,ba,l,2,-0,0),r);break e}Eg(a,n,Wt,eu,kh,t,Cn,tr,gl,ba,l,0,-0,0)}}break}while(!0);ws(e)}function Eg(e,t,n,a,r,l,i,o,c,d,f,h,m,p){if(e.timeoutHandle=-1,h=t.subtreeFlags,(h&8192||(h&16785408)===16785408)&&(Bi={stylesheets:null,count:0,unsuspend:kC},Rj(t),h=CC(),h!==null)){e.cancelPendingCommit=h(Mg.bind(null,e,t,l,n,a,r,i,o,c,f,1,m,p)),ja(e,l,i,!d);return}Mg(e,t,l,n,a,r,i,o,c)}function G2(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var r=n[a],l=r.getSnapshot;r=r.value;try{if(!vn(l(),r))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ja(e,t,n,a){t&=~sp,t&=~tr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var r=t;0<r;){var l=31-mn(r),i=1<<l;a[l]=-1,r&=~i}n!==0&&Py(e,n,t)}function qu(){return qe&6?!0:(po(0),!1)}function rp(){if(Ae!==null){if(Pe===0)var e=Ae.return;else e=Ae,qs=gr=null,Vm(e),nl=null,zi=0,e=Ae;for(;e!==null;)xj(e.alternate,e),e=e.return;Ae=null}}function yl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,oC(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),rp(),Ze=e,Ae=n=Vs(e.current,null),$e=t,Pe=0,un=null,ba=!1,El=so(e,t),np=!1,gl=Cn=sp=tr=Da=ft=0,Wt=Ni=null,kh=!1,t&8&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var r=31-mn(a),l=1<<r;t|=e[r],a&=~l}return Qs=t,Lu(),n}function zj(e,t){Re=null,je.H=Fc,t===uo||t===Bu?(t=og(),Pe=3):t===bb?(t=og(),Pe=4):Pe=t===uj?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,un=t,Ae===null&&(ft=1,Qc(e,Sn(t,e.current)))}function Lj(){var e=je.H;return je.H=Fc,e===null?Fc:e}function Uj(){var e=je.A;return je.A=P2,e}function Rh(){ft=4,ba||($e&4194048)!==$e&&Mn.current!==null||(El=!0),!(Da&134217727)&&!(tr&134217727)||Ze===null||ja(Ze,$e,Cn,!1)}function cf(e,t,n){var a=qe;qe|=2;var r=Lj(),l=Uj();(Ze!==e||$e!==t)&&(eu=null,yl(e,t)),t=!1;var i=ft;e:do try{if(Pe!==0&&Ae!==null){var o=Ae,c=un;switch(Pe){case 8:rp(),i=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(t=!0);var d=Pe;if(Pe=0,un=null,Xr(e,o,c,d),n&&El){i=0;break e}break;default:d=Pe,Pe=0,un=null,Xr(e,o,c,d)}}V2(),i=ft;break}catch(f){zj(e,f)}while(!0);return t&&e.shellSuspendCounter++,qs=gr=null,qe=a,je.H=r,je.A=l,Ae===null&&(Ze=null,$e=0,Lu()),i}function V2(){for(;Ae!==null;)Bj(Ae)}function Y2(e,t){var n=qe;qe|=2;var a=Lj(),r=Uj();Ze!==e||$e!==t?(eu=null,Jc=ps()+500,yl(e,t)):El=so(e,t);e:do try{if(Pe!==0&&Ae!==null){t=Ae;var l=un;t:switch(Pe){case 1:Pe=0,un=null,Xr(e,t,l,1);break;case 2:case 9:if(ig(l)){Pe=0,un=null,Ag(t);break}t=function(){Pe!==2&&Pe!==9||Ze!==e||(Pe=7),ws(e)},l.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:ig(l)?(Pe=0,un=null,Ag(t)):(Pe=0,un=null,Xr(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||a0(i)){Pe=0,un=null;var c=o.sibling;if(c!==null)Ae=c;else{var d=o.return;d!==null?(Ae=d,Gu(d)):Ae=null}break t}}Pe=0,un=null,Xr(e,t,l,5);break;case 6:Pe=0,un=null,Xr(e,t,l,6);break;case 8:rp(),ft=6;break e;default:throw Error(Q(462))}}F2();break}catch(f){zj(e,f)}while(!0);return qs=gr=null,je.H=a,je.A=r,qe=n,Ae!==null?0:(Ze=null,$e=0,Lu(),ft)}function F2(){for(;Ae!==null&&!pS();)Bj(Ae)}function Bj(e){var t=pj(e.alternate,e,Qs);e.memoizedProps=e.pendingProps,t===null?Gu(e):Ae=t}function Ag(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ng(n,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Ng(n,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:Vm(t);default:xj(n,t),t=Ae=xb(t,Qs),t=pj(n,t,Qs)}e.memoizedProps=e.pendingProps,t===null?Gu(e):Ae=t}function Xr(e,t,n,a){qs=gr=null,Vm(t),nl=null,zi=0;var r=t.return;try{if(z2(e,r,t,n,$e)){ft=1,Qc(e,Sn(n,e.current)),Ae=null;return}}catch(l){if(r!==null)throw Ae=r,l;ft=1,Qc(e,Sn(n,e.current)),Ae=null;return}t.flags&32768?(ze||a===1?e=!0:El||$e&536870912?e=!1:(ba=e=!0,(a===2||a===9||a===3||a===6)&&(a=Mn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Hj(t,e)):Gu(t)}function Gu(e){var t=e;do{if(t.flags&32768){Hj(t,ba);return}e=t.return;var n=U2(t.alternate,t,Qs);if(n!==null){Ae=n;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ft===0&&(ft=5)}function Hj(e,t){do{var n=B2(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);ft=6,Ae=null}function Mg(e,t,n,a,r,l,i,o,c){e.cancelPendingCommit=null;do Vu();while(Dt!==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|=Mm,kS(e,n,l,i,o,c),e===Ze&&(Ae=Ze=null,$e=0),vl=t,Ta=e,sl=n,Sh=l,Ch=r,$j=a,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Z2(Lc,function(){return Vj(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,t.subtreeFlags&13878||a){a=je.T,je.T=null,r=Le.p,Le.p=2,i=qe,qe|=4;try{H2(e,t,n)}finally{qe=i,Le.p=r,je.T=a}}Dt=1,Ij(),Pj(),qj()}}function Ij(){if(Dt===1){Dt=0;var e=Ta,t=vl,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=je.T,je.T=null;var a=Le.p;Le.p=2;var r=qe;qe|=4;try{Sj(t,e);var l=$h,i=ob(e.containerInfo),o=l.focusedElem,c=l.selectionRange;if(i!==o&&o&&o.ownerDocument&&ib(o.ownerDocument.documentElement,o)){if(c!==null&&Am(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 p=m.getSelection(),j=o.textContent.length,v=Math.min(c.start,j),b=c.end===void 0?v:Math.min(c.end,j);!p.extend&&v>b&&(i=b,b=v,v=i);var x=Jx(o,v),g=Jx(o,b);if(x&&g&&(p.rangeCount!==1||p.anchorNode!==x.node||p.anchorOffset!==x.offset||p.focusNode!==g.node||p.focusOffset!==g.offset)){var y=h.createRange();y.setStart(x.node,x.offset),p.removeAllRanges(),v>b?(p.addRange(y),p.extend(g.node,g.offset)):(y.setEnd(g.node,g.offset),p.addRange(y))}}}}for(h=[],p=o;p=p.parentNode;)p.nodeType===1&&h.push({element:p,left:p.scrollLeft,top:p.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}}ou=!!Mh,$h=Mh=null}finally{qe=r,Le.p=a,je.T=n}}e.current=t,Dt=2}}function Pj(){if(Dt===2){Dt=0;var e=Ta,t=vl,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=je.T,je.T=null;var a=Le.p;Le.p=2;var r=qe;qe|=4;try{wj(e,t.alternate,t)}finally{qe=r,Le.p=a,je.T=n}}Dt=3}}function qj(){if(Dt===4||Dt===3){Dt=0,xS();var e=Ta,t=vl,n=sl,a=$j;t.subtreeFlags&10256||t.flags&10256?Dt=5:(Dt=0,vl=Ta=null,Gj(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Ca=null),Nm(n),t=t.stateNode,hn&&typeof hn.onCommitFiberRoot=="function")try{hn.onCommitFiberRoot(no,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=je.T,r=Le.p,Le.p=2,je.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{je.T=t,Le.p=r}}sl&3&&Vu(),ws(e),r=e.pendingLanes,n&4194090&&r&42?e===Th?ki++:(ki=0,Th=e):ki=0,po(0)}}function Gj(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,co(t)))}function Vu(e){return Ij(),Pj(),qj(),Vj()}function Vj(){if(Dt!==5)return!1;var e=Ta,t=Sh;Sh=0;var n=Nm(sl),a=je.T,r=Le.p;try{Le.p=32>n?32:n,je.T=null,n=Ch,Ch=null;var l=Ta,i=sl;if(Dt=0,vl=Ta=null,sl=0,qe&6)throw Error(Q(331));var o=qe;if(qe|=4,Aj(l.current),Tj(l,l.current,i,n),qe=o,po(0,!1),hn&&typeof hn.onPostCommitFiberRoot=="function")try{hn.onPostCommitFiberRoot(no,l)}catch{}return!0}finally{Le.p=r,je.T=a,Gj(e,t)}}function $g(e,t,n){t=Sn(n,t),t=jh(e.stateNode,t,2),e=Sa(e,t,2),e!==null&&(ao(e,2),ws(e))}function Ke(e,t,n){if(e.tag===3)$g(e,e,n);else for(;t!==null;){if(t.tag===3){$g(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ca===null||!Ca.has(a))){e=Sn(n,e),n=oj(2),a=Sa(t,n,2),a!==null&&(cj(n,a,t,e),ao(a,2),ws(a));break}}t=t.return}}function uf(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new q2;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)||(np=!0,r.add(n),e=X2.bind(null,e,t,n),t.then(e,e))}function X2(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ze===e&&($e&n)===n&&(ft===4||ft===3&&($e&62914560)===$e&&300>ps()-ap?!(qe&2)&&yl(e,0):sp|=n,gl===$e&&(gl=0)),ws(e)}function Yj(e,t){t===0&&(t=Iy()),e=Rl(e,t),e!==null&&(ao(e,t),ws(e))}function K2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yj(e,n)}function Q2(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),Yj(e,n)}function Z2(e,t){return wm(e,t)}var tu=null,zr=null,Eh=!1,nu=!1,df=!1,nr=0;function ws(e){e!==zr&&e.next===null&&(zr===null?tu=zr=e:zr=zr.next=e),nu=!0,Eh||(Eh=!0,J2())}function po(e,t){if(!df&&nu){df=!0;do for(var n=!1,a=tu;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-mn(42|e)+1)-1,l&=r&~(i&~o),l=l&201326741?l&201326741|1:l?l|2:0}l!==0&&(n=!0,Og(a,l))}else l=$e,l=$u(a,a===Ze?l:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),!(l&3)||so(a,l)||(n=!0,Og(a,l));a=a.next}while(n);df=!1}}function W2(){Fj()}function Fj(){nu=Eh=!1;var e=0;nr!==0&&(iC()&&(e=nr),nr=0);for(var t=ps(),n=null,a=tu;a!==null;){var r=a.next,l=Xj(a,t);l===0?(a.next=null,n===null?tu=r:n.next=r,r===null&&(zr=n)):(n=a,(e!==0||l&3)&&(nu=!0)),a=r}po(e)}function Xj(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,r=e.expirationTimes,l=e.pendingLanes&-62914561;0<l;){var i=31-mn(l),o=1<<i,c=r[i];c===-1?(!(o&n)||o&a)&&(r[i]=NS(o,t)):c<=t&&(e.expiredLanes|=o),l&=~o}if(t=Ze,n=$e,n=$u(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&&zd(a),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||so(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&zd(a),Nm(n)){case 2:case 8:n=Uy;break;case 32:n=Lc;break;case 268435456:n=By;break;default:n=Lc}return a=Kj.bind(null,e),n=wm(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&zd(a),e.callbackPriority=2,e.callbackNode=null,2}function Kj(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Vu()&&e.callbackNode!==n)return null;var a=$e;return a=$u(e,e===Ze?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Dj(e,a,t),Xj(e,ps()),e.callbackNode!=null&&e.callbackNode===n?Kj.bind(null,e):null)}function Og(e,t){if(Vu())return null;Dj(e,t,!0)}function J2(){cC(function(){qe&6?wm(Ly,W2):Fj()})}function lp(){return nr===0&&(nr=Hy()),nr}function Dg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:mc(""+e)}function zg(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 eC(e,t,n,a,r){if(t==="submit"&&n&&n.stateNode===r){var l=Dg((r[Jt]||null).action),i=a.submitter;i&&(t=(t=i[Jt]||null)?Dg(t.formAction):i.getAttribute("formAction"),t!==null&&(l=t,i=null));var o=new Ou("action","action",null,a,r);e.push({event:o,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(nr!==0){var c=i?zg(r,i):new FormData(r);yh(n,{pending:!0,data:c,method:r.method,action:l},null,c)}}else typeof l=="function"&&(o.preventDefault(),c=i?zg(r,i):new FormData(r),yh(n,{pending:!0,data:c,method:r.method,action:l},l,c))},currentTarget:r}]})}}for(var ff=0;ff<ih.length;ff++){var hf=ih[ff],tC=hf.toLowerCase(),nC=hf[0].toUpperCase()+hf.slice(1);Zn(tC,"on"+nC)}Zn(ub,"onAnimationEnd");Zn(db,"onAnimationIteration");Zn(fb,"onAnimationStart");Zn("dblclick","onDoubleClick");Zn("focusin","onFocus");Zn("focusout","onBlur");Zn(y2,"onTransitionRun");Zn(b2,"onTransitionStart");Zn(j2,"onTransitionCancel");Zn(hb,"onTransitionEnd");dl("onMouseEnter",["mouseout","mouseover"]);dl("onMouseLeave",["mouseout","mouseover"]);dl("onPointerEnter",["pointerout","pointerover"]);dl("onPointerLeave",["pointerout","pointerover"]);mr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));mr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));mr("onBeforeInput",["compositionend","keypress","textInput","paste"]);mr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));mr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));mr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Li="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(" "),sC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Li));function Qj(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){Kc(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){Kc(f)}r.currentTarget=null,l=c}}}}function Ee(e,t){var n=t[eh];n===void 0&&(n=t[eh]=new Set);var a=e+"__bubble";n.has(a)||(Zj(t,e,2,!1),n.add(a))}function mf(e,t,n){var a=0;t&&(a|=4),Zj(n,e,a,t)}var Fo="_reactListening"+Math.random().toString(36).slice(2);function ip(e){if(!e[Fo]){e[Fo]=!0,Vy.forEach(function(n){n!=="selectionchange"&&(sC.has(n)||mf(n,!1,e),mf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Fo]||(t[Fo]=!0,mf("selectionchange",!1,t))}}function Zj(e,t,n,a){switch(c0(t)){case 2:var r=EC;break;case 8:r=AC;break;default:r=dp}n=r.bind(null,t,n,e),r=void 0,!ah||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),a?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function pf(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=Br(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}Jy(function(){var d=l,f=Cm(n),h=[];e:{var m=mb.get(e);if(m!==void 0){var p=Ou,j=e;switch(e){case"keypress":if(xc(n)===0)break e;case"keydown":case"keyup":p=ZS;break;case"focusin":j="focus",p=Gd;break;case"focusout":j="blur",p=Gd;break;case"beforeblur":case"afterblur":p=Gd;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":p=qx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=BS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=e2;break;case ub:case db:case fb:p=PS;break;case hb:p=n2;break;case"scroll":case"scrollend":p=LS;break;case"wheel":p=a2;break;case"copy":case"cut":case"paste":p=GS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Vx;break;case"toggle":case"beforetoggle":p=l2}var v=(t&4)!==0,b=!v&&(e==="scroll"||e==="scrollend"),x=v?m!==null?m+"Capture":null:m;v=[];for(var g=d,y;g!==null;){var w=g;if(y=w.stateNode,w=w.tag,w!==5&&w!==26&&w!==27||y===null||x===null||(w=Ai(g,x),w!=null&&v.push(Ui(g,w,y))),b)break;g=g.return}0<v.length&&(m=new p(m,j,null,n,f),h.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",m&&n!==sh&&(j=n.relatedTarget||n.fromElement)&&(Br(j)||j[Cl]))break e;if((p||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,p?(j=n.relatedTarget||n.toElement,p=d,j=j?Br(j):null,j!==null&&(b=to(j),v=j.tag,j!==b||v!==5&&v!==27&&v!==6)&&(j=null)):(p=null,j=d),p!==j)){if(v=qx,w="onMouseLeave",x="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(v=Vx,w="onPointerLeave",x="onPointerEnter",g="pointer"),b=p==null?m:ai(p),y=j==null?m:ai(j),m=new v(w,g+"leave",p,n,f),m.target=b,m.relatedTarget=y,w=null,Br(f)===d&&(v=new v(x,g+"enter",j,n,f),v.target=y,v.relatedTarget=b,w=v),b=w,p&&j)t:{for(v=p,x=j,g=0,y=v;y;y=Nr(y))g++;for(y=0,w=x;w;w=Nr(w))y++;for(;0<g-y;)v=Nr(v),g--;for(;0<y-g;)x=Nr(x),y--;for(;g--;){if(v===x||x!==null&&v===x.alternate)break t;v=Nr(v),x=Nr(x)}v=null}else v=null;p!==null&&Lg(h,m,p,v,!1),j!==null&&b!==null&&Lg(h,b,j,v,!0)}}e:{if(m=d?ai(d):window,p=m.nodeName&&m.nodeName.toLowerCase(),p==="select"||p==="input"&&m.type==="file")var N=Kx;else if(Xx(m))if(rb)N=x2;else{N=m2;var C=h2}else p=m.nodeName,!p||p.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?d&&Sm(d.elementType)&&(N=Kx):N=p2;if(N&&(N=N(e,d))){ab(h,N,n,f);break e}C&&C(e,m,d),e==="focusout"&&d&&m.type==="number"&&d.memoizedProps.value!=null&&nh(m,"number",m.value)}switch(C=d?ai(d):window,e){case"focusin":(Xx(C)||C.contentEditable==="true")&&(Pr=C,rh=d,pi=null);break;case"focusout":pi=rh=Pr=null;break;case"mousedown":lh=!0;break;case"contextmenu":case"mouseup":case"dragend":lh=!1,eg(h,n,f);break;case"selectionchange":if(v2)break;case"keydown":case"keyup":eg(h,n,f)}var _;if(Em)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 Ir?nb(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(tb&&n.locale!=="ko"&&(Ir||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ir&&(_=eb()):(ya=f,Tm="value"in ya?ya.value:ya.textContent,Ir=!0)),C=su(d,S),0<C.length&&(S=new Gx(S,e,null,n,f),h.push({event:S,listeners:C}),_?S.data=_:(_=sb(n),_!==null&&(S.data=_)))),(_=o2?c2(e,n):u2(e,n))&&(S=su(d,"onBeforeInput"),0<S.length&&(C=new Gx("onBeforeInput","beforeinput",null,n,f),h.push({event:C,listeners:S}),C.data=_)),eC(h,e,d,n,f)}Qj(h,t)})}function Ui(e,t,n){return{instance:e,listener:t,currentTarget:n}}function su(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=Ai(e,n),r!=null&&a.unshift(Ui(e,r,l)),r=Ai(e,t),r!=null&&a.push(Ui(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 Lg(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=Ai(n,l),d!=null&&i.unshift(Ui(n,d,c))):r||(d=Ai(n,l),d!=null&&i.push(Ui(n,d,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var aC=/\r\n?/g,rC=/\u0000|\uFFFD/g;function Ug(e){return(typeof e=="string"?e:""+e).replace(aC,`
|
|
49
|
+
`).replace(rC,"")}function Wj(e,t){return t=Ug(t),Ug(e)===t}function Yu(){}function Fe(e,t,n,a,r,l){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||fl(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&fl(e,""+a);break;case"className":Ho(e,"class",a);break;case"tabIndex":Ho(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Ho(e,n,a);break;case"style":Wy(e,a,l);break;case"data":if(t!=="object"){Ho(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=mc(""+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"&&Fe(e,t,"name",r.name,r,null),Fe(e,t,"formEncType",r.formEncType,r,null),Fe(e,t,"formMethod",r.formMethod,r,null),Fe(e,t,"formTarget",r.formTarget,r,null)):(Fe(e,t,"encType",r.encType,r,null),Fe(e,t,"method",r.method,r,null),Fe(e,t,"target",r.target,r,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=mc(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Yu);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=mc(""+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),hc(e,"popover",a);break;case"xlinkActuate":Ms(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ms(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ms(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ms(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ms(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ms(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ms(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ms(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ms(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":hc(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=DS.get(n)||n,hc(e,n,a))}}function Ah(e,t,n,a,r,l){switch(n){case"style":Wy(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"?fl(e,a):(typeof a=="number"||typeof a=="bigint")&&fl(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=Yu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Yy.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,""):hc(e,n,a)}}}function zt(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:Fe(e,t,l,i,n,null)}}r&&Fe(e,t,"srcSet",n.srcSet,n,null),a&&Fe(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:Fe(e,t,a,f,n,null)}}Ky(e,l,o,c,d,i,r,!1),Uc(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:Fe(e,t,r,o,n,null)}t=l,n=i,e.multiple=!!a,t!=null?Zr(e,!!a,t,!1):n!=null&&Zr(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:Fe(e,t,i,o,n,null)}Zy(e,a,r,l),Uc(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:Fe(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<Li.length;a++)Ee(Li[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:Fe(e,t,d,a,n,null)}return;default:if(Sm(t)){for(f in n)n.hasOwnProperty(f)&&(a=n[f],a!==void 0&&Ah(e,t,f,a,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(a=n[o],a!=null&&Fe(e,t,o,a,n,null))}function lC(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(p in n){var h=n[p];if(n.hasOwnProperty(p)&&h!=null)switch(p){case"checked":break;case"value":break;case"defaultValue":c=h;default:a.hasOwnProperty(p)||Fe(e,t,p,null,a,h)}}for(var m in a){var p=a[m];if(h=n[m],a.hasOwnProperty(m)&&(p!=null||h!=null))switch(m){case"type":l=p;break;case"name":r=p;break;case"checked":d=p;break;case"defaultChecked":f=p;break;case"value":i=p;break;case"defaultValue":o=p;break;case"children":case"dangerouslySetInnerHTML":if(p!=null)throw Error(Q(137,t));break;default:p!==h&&Fe(e,t,m,p,a,h)}}th(e,i,o,c,d,f,l,r);return;case"select":p=i=o=m=null;for(l in n)if(c=n[l],n.hasOwnProperty(l)&&c!=null)switch(l){case"value":break;case"multiple":p=c;default:a.hasOwnProperty(l)||Fe(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&&Fe(e,t,r,l,a,c)}t=o,n=i,a=p,m!=null?Zr(e,!!n,m,!1):!!a!=!!n&&(t!=null?Zr(e,!!n,t,!0):Zr(e,!!n,n?[]:"",!1));return;case"textarea":p=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:Fe(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":p=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(Q(91));break;default:r!==l&&Fe(e,t,i,r,a,l)}Qy(e,m,p);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:Fe(e,t,j,null,a,m)}for(c in a)if(m=a[c],p=n[c],a.hasOwnProperty(c)&&m!==p&&(m!=null||p!=null))switch(c){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Fe(e,t,c,m,a,p)}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)&&Fe(e,t,v,null,a,m);for(d in a)if(m=a[d],p=n[d],a.hasOwnProperty(d)&&m!==p&&(m!=null||p!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(Q(137,t));break;default:Fe(e,t,d,m,a,p)}return;default:if(Sm(t)){for(var b in n)m=n[b],n.hasOwnProperty(b)&&m!==void 0&&!a.hasOwnProperty(b)&&Ah(e,t,b,void 0,a,m);for(f in a)m=a[f],p=n[f],!a.hasOwnProperty(f)||m===p||m===void 0&&p===void 0||Ah(e,t,f,m,a,p);return}}for(var x in n)m=n[x],n.hasOwnProperty(x)&&m!=null&&!a.hasOwnProperty(x)&&Fe(e,t,x,null,a,m);for(h in a)m=a[h],p=n[h],!a.hasOwnProperty(h)||m===p||m==null&&p==null||Fe(e,t,h,m,a,p)}var Mh=null,$h=null;function au(e){return e.nodeType===9?e:e.ownerDocument}function Bg(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 Jj(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 Oh(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 xf=null;function iC(){var e=window.event;return e&&e.type==="popstate"?e===xf?!1:(xf=e,!0):(xf=null,!1)}var e0=typeof setTimeout=="function"?setTimeout:void 0,oC=typeof clearTimeout=="function"?clearTimeout:void 0,Hg=typeof Promise=="function"?Promise:void 0,cC=typeof queueMicrotask=="function"?queueMicrotask:typeof Hg<"u"?function(e){return Hg.resolve(null).then(e).catch(uC)}:e0;function uC(e){setTimeout(function(){throw e})}function Ha(e){return e==="head"}function Ig(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&&Si(i.documentElement),n&2&&Si(i.body),n&4)for(n=i.head,Si(n),i=n.firstChild;i;){var o=i.nextSibling,c=i.nodeName;i[ro]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}if(r===0){e.removeChild(l),qi(t);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:a=n.charCodeAt(0)-48;else a=0;n=l}while(n);qi(t)}function Dh(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":Dh(n),km(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function dC(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[ro])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=Gn(e.nextSibling),e===null)break}return null}function fC(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Gn(e.nextSibling),e===null))return null;return e}function zh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function hC(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 Gn(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 Lh=null;function Pg(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 t0(e,t,n){switch(t=au(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 Si(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);km(e)}var $n=new Map,qg=new Set;function ru(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Js=Le.d;Le.d={f:mC,r:pC,D:xC,C:gC,L:vC,m:yC,X:jC,S:bC,M:wC};function mC(){var e=Js.f(),t=qu();return e||t}function pC(e){var t=Tl(e);t!==null&&t.tag===5&&t.type==="form"?Xb(t):Js.r(e)}var Al=typeof document>"u"?null:document;function n0(e,t,n){var a=Al;if(a&&typeof t=="string"&&t){var r=kn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),qg.has(r)||(qg.add(r),e={rel:e,crossOrigin:n,href:t},a.querySelector(r)===null&&(t=a.createElement("link"),zt(t,"link",e),At(t),a.head.appendChild(t)))}}function xC(e){Js.D(e),n0("dns-prefetch",e,null)}function gC(e,t){Js.C(e,t),n0("preconnect",e,t)}function vC(e,t,n){Js.L(e,t,n);var a=Al;if(a&&e&&t){var r='link[rel="preload"][as="'+kn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+kn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+kn(n.imageSizes)+'"]')):r+='[href="'+kn(e)+'"]';var l=r;switch(t){case"style":l=bl(e);break;case"script":l=Ml(e)}$n.has(l)||(e=We({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),$n.set(l,e),a.querySelector(r)!==null||t==="style"&&a.querySelector(xo(l))||t==="script"&&a.querySelector(go(l))||(t=a.createElement("link"),zt(t,"link",e),At(t),a.head.appendChild(t)))}}function yC(e,t){Js.m(e,t);var n=Al;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+kn(a)+'"][href="'+kn(e)+'"]',l=r;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":l=Ml(e)}if(!$n.has(l)&&(e=We({rel:"modulepreload",href:e},t),$n.set(l,e),n.querySelector(r)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(go(l)))return}a=n.createElement("link"),zt(a,"link",e),At(a),n.head.appendChild(a)}}}function bC(e,t,n){Js.S(e,t,n);var a=Al;if(a&&e){var r=Qr(a).hoistableStyles,l=bl(e);t=t||"default";var i=r.get(l);if(!i){var o={loading:0,preload:null};if(i=a.querySelector(xo(l)))o.loading=5;else{e=We({rel:"stylesheet",href:e,"data-precedence":t},n),(n=$n.get(l))&&op(e,n);var c=i=a.createElement("link");At(c),zt(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,_c(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:o},r.set(l,i)}}}function jC(e,t){Js.X(e,t);var n=Al;if(n&&e){var a=Qr(n).hoistableScripts,r=Ml(e),l=a.get(r);l||(l=n.querySelector(go(r)),l||(e=We({src:e,async:!0},t),(t=$n.get(r))&&cp(e,t),l=n.createElement("script"),At(l),zt(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},a.set(r,l))}}function wC(e,t){Js.M(e,t);var n=Al;if(n&&e){var a=Qr(n).hoistableScripts,r=Ml(e),l=a.get(r);l||(l=n.querySelector(go(r)),l||(e=We({src:e,async:!0,type:"module"},t),(t=$n.get(r))&&cp(e,t),l=n.createElement("script"),At(l),zt(l,"link",e),n.head.appendChild(l)),l={type:"script",instance:l,count:1,state:null},a.set(r,l))}}function Gg(e,t,n,a){var r=(r=Na.current)?ru(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=bl(n.href),n=Qr(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=bl(n.href);var l=Qr(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(xo(e)))&&!l._p&&(i.instance=l,i.state.loading=5),$n.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},$n.set(e,n),l||_C(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=Ml(n),n=Qr(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 bl(e){return'href="'+kn(e)+'"'}function xo(e){return'link[rel="stylesheet"]['+e+"]"}function s0(e){return We({},e,{"data-precedence":e.precedence,precedence:null})}function _C(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}),zt(t,"link",n),At(t),e.head.appendChild(t))}function Ml(e){return'[src="'+kn(e)+'"]'}function go(e){return"script[async]"+e}function Vg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+kn(n.href)+'"]');if(a)return t.instance=a,At(a),a;var r=We({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),At(a),zt(a,"style",r),_c(a,n.precedence,e),t.instance=a;case"stylesheet":r=bl(n.href);var l=e.querySelector(xo(r));if(l)return t.state.loading|=4,t.instance=l,At(l),l;a=s0(n),(r=$n.get(r))&&op(a,r),l=(e.ownerDocument||e).createElement("link"),At(l);var i=l;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),zt(l,"link",a),t.state.loading|=4,_c(l,n.precedence,e),t.instance=l;case"script":return l=Ml(n.src),(r=e.querySelector(go(l)))?(t.instance=r,At(r),r):(a=n,(r=$n.get(l))&&(a=We({},n),cp(a,r)),e=e.ownerDocument||e,r=e.createElement("script"),At(r),zt(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,_c(a,n.precedence,e));return t.instance}function _c(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 op(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function cp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Nc=null;function Yg(e,t,n){if(Nc===null){var a=new Map,r=Nc=new Map;r.set(n,a)}else r=Nc,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[ro]||l[It]||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 Fg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function NC(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 a0(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Bi=null;function kC(){}function SC(e,t,n){if(Bi===null)throw Error(Q(475));var a=Bi;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=bl(n.href),l=e.querySelector(xo(r));if(l){e=l._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(a.count++,a=lu.bind(a),e.then(a,a)),t.state.loading|=4,t.instance=l,At(l);return}l=e.ownerDocument||e,n=s0(n),(r=$n.get(r))&&op(n,r),l=l.createElement("link"),At(l);var i=l;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),zt(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=lu.bind(a),e.addEventListener("load",t),e.addEventListener("error",t))}}function CC(){if(Bi===null)throw Error(Q(475));var e=Bi;return e.stylesheets&&e.count===0&&Uh(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Uh(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 lu(){if(this.count--,this.count===0){if(this.stylesheets)Uh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var iu=null;function Uh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,iu=new Map,t.forEach(TC,e),iu=null,lu.call(e))}function TC(e,t){if(!(t.state.loading&4)){var n=iu.get(e);if(n)var a=n.get(null);else{n=new Map,iu.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=lu.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 Hi={$$typeof:Hs,Provider:null,Consumer:null,_currentValue:Qa,_currentValue2:Qa,_threadCount:0};function RC(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=Ld(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ld(0),this.hiddenUpdates=Ld(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 r0(e,t,n,a,r,l,i,o,c,d,f,h){return e=new RC(e,t,n,i,o,c,d,h),t=1,l===!0&&(t|=24),l=fn(3,null,null,t),e.current=l,l.stateNode=e,t=Lm(),t.refCount++,e.pooledCache=t,t.refCount++,l.memoizedState={element:a,isDehydrated:n,cache:t},Bm(l),e}function l0(e){return e?(e=Vr,e):Vr}function i0(e,t,n,a,r,l){r=l0(r),a.context===null?a.context=r:a.pendingContext=r,a=ka(t),a.payload={element:n},l=l===void 0?null:l,l!==null&&(a.callback=l),n=Sa(e,a,t),n!==null&&(xn(n,e,t),vi(n,e,t))}function Xg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){Xg(e,t),(e=e.alternate)&&Xg(e,t)}function o0(e){if(e.tag===13){var t=Rl(e,67108864);t!==null&&xn(t,e,67108864),up(e,67108864)}}var ou=!0;function EC(e,t,n,a){var r=je.T;je.T=null;var l=Le.p;try{Le.p=2,dp(e,t,n,a)}finally{Le.p=l,je.T=r}}function AC(e,t,n,a){var r=je.T;je.T=null;var l=Le.p;try{Le.p=8,dp(e,t,n,a)}finally{Le.p=l,je.T=r}}function dp(e,t,n,a){if(ou){var r=Bh(a);if(r===null)pf(e,t,a,cu,n),Kg(e,a);else if($C(r,e,t,n,a))a.stopPropagation();else if(Kg(e,a),t&4&&-1<MC.indexOf(e)){for(;r!==null;){var l=Tl(r);if(l!==null)switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var i=Ya(l.pendingLanes);if(i!==0){var o=l;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var c=1<<31-mn(i);o.entanglements[1]|=c,i&=~c}ws(l),!(qe&6)&&(Jc=ps()+500,po(0))}}break;case 13:o=Rl(l,2),o!==null&&xn(o,l,2),qu(),up(l,2)}if(l=Bh(a),l===null&&pf(e,t,a,cu,n),l===r)break;r=l}r!==null&&a.stopPropagation()}else pf(e,t,a,null,n)}}function Bh(e){return e=Cm(e),fp(e)}var cu=null;function fp(e){if(cu=null,e=Br(e),e!==null){var t=to(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=$y(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 cu=e,null}function c0(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(gS()){case Ly:return 2;case Uy:return 8;case Lc:case vS:return 32;case By:return 268435456;default:return 32}default:return 32}}var Hh=!1,Ra=null,Ea=null,Aa=null,Ii=new Map,Pi=new Map,ga=[],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 Kg(e,t){switch(e){case"focusin":case"focusout":Ra=null;break;case"dragenter":case"dragleave":Ea=null;break;case"mouseover":case"mouseout":Aa=null;break;case"pointerover":case"pointerout":Ii.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pi.delete(t.pointerId)}}function Zl(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=Tl(t),t!==null&&o0(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function $C(e,t,n,a,r){switch(t){case"focusin":return Ra=Zl(Ra,e,t,n,a,r),!0;case"dragenter":return Ea=Zl(Ea,e,t,n,a,r),!0;case"mouseover":return Aa=Zl(Aa,e,t,n,a,r),!0;case"pointerover":var l=r.pointerId;return Ii.set(l,Zl(Ii.get(l)||null,e,t,n,a,r)),!0;case"gotpointercapture":return l=r.pointerId,Pi.set(l,Zl(Pi.get(l)||null,e,t,n,a,r)),!0}return!1}function u0(e){var t=Br(e.target);if(t!==null){var n=to(t);if(n!==null){if(t=n.tag,t===13){if(t=$y(n),t!==null){e.blockedOn=t,SS(e.priority,function(){if(n.tag===13){var a=pn();a=_m(a);var r=Rl(n,a);r!==null&&xn(r,n,a),up(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 kc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);sh=a,n.target.dispatchEvent(a),sh=null}else return t=Tl(n),t!==null&&o0(t),e.blockedOn=n,!1;t.shift()}return!0}function Qg(e,t,n){kc(e)&&n.delete(t)}function OC(){Hh=!1,Ra!==null&&kc(Ra)&&(Ra=null),Ea!==null&&kc(Ea)&&(Ea=null),Aa!==null&&kc(Aa)&&(Aa=null),Ii.forEach(Qg),Pi.forEach(Qg)}function Xo(e,t){e.blockedOn===t&&(e.blockedOn=null,Hh||(Hh=!0,kt.unstable_scheduleCallback(kt.unstable_NormalPriority,OC)))}var Ko=null;function Zg(e){Ko!==e&&(Ko=e,kt.unstable_scheduleCallback(kt.unstable_NormalPriority,function(){Ko===e&&(Ko=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(fp(a||n)===null)continue;break}var l=Tl(n);l!==null&&(e.splice(t,3),t-=3,yh(l,{pending:!0,data:r,method:n.method,action:a},a,r))}}))}function qi(e){function t(c){return Xo(c,e)}Ra!==null&&Xo(Ra,e),Ea!==null&&Xo(Ea,e),Aa!==null&&Xo(Aa,e),Ii.forEach(t),Pi.forEach(t);for(var n=0;n<ga.length;n++){var a=ga[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ga.length&&(n=ga[0],n.blockedOn===null);)u0(n),n.blockedOn===null&&ga.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||Zg(n);else if(i){var o=null;if(l&&l.hasAttribute("formAction")){if(r=l,i=l[Jt]||null)o=i.formAction;else if(fp(r)!==null)continue}else o=i.action;typeof o=="function"?n[a+1]=o:(n.splice(a,3),a-=3),Zg(n)}}}function hp(e){this._internalRoot=e}Fu.prototype.render=hp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Q(409));var n=t.current,a=pn();i0(n,a,e,t,null,null)};Fu.prototype.unmount=hp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;i0(e.current,2,null,e,null,null),qu(),t[Cl]=null}};function Fu(e){this._internalRoot=e}Fu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ga.length&&t!==0&&t<ga[n].priority;n++);ga.splice(n,0,e),n===0&&u0(e)}};var Wg=Ay.version;if(Wg!=="19.1.0")throw Error(Q(527,Wg,"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=uS(t),e=e!==null?Oy(e):null,e=e===null?null:e.stateNode,e};var DC={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:je,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Qo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qo.isDisabled&&Qo.supportsFiber)try{no=Qo.inject(DC),hn=Qo}catch{}}Au.createRoot=function(e,t){if(!My(e))throw Error(Q(299));var n=!1,a="",r=rj,l=lj,i=ij,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=r0(e,1,!1,null,null,n,a,r,l,i,o,null),e[Cl]=t.current,ip(e),new hp(t)};Au.hydrateRoot=function(e,t,n){if(!My(e))throw Error(Q(299));var a=!1,r="",l=rj,i=lj,o=ij,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=r0(e,1,!0,t,n??null,a,r,l,i,o,c,d),t.context=l0(null),n=t.current,a=pn(),a=_m(a),r=ka(a),r.callback=null,Sa(n,r,a),n=a,t.current.lanes=n,ao(t,n),ws(t),e[Cl]=t.current,ip(e),new Fu(t)};Au.version="19.1.0";function d0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(d0)}catch(e){console.error(e)}}d0(),ky.exports=Au;var zC=ky.exports;const f0=u.createContext(null);function h0({data:e,router:t,identity:n,notify:a,children:r}){return s.jsx(f0.Provider,{value:{data:e,router:t,identity:n,notify:a},children:r})}function Xu(){const e=u.useContext(f0);if(!e)throw new Error("A shared app page rendered outside AppUiProvider.");return e}const LC={success:()=>{},error:()=>{}},nn=()=>Xu().data,Ve=()=>Xu().router,Ku=()=>Xu().identity,$l=()=>Xu().notify??LC;function UC(){const{probe:e}=nn(),{href:t,Link:n}=Ve(),a=Ku(),[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 BC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),HC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),Jg=e=>{const t=HC(e);return t.charAt(0).toUpperCase()+t.slice(1)},m0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),IC=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 PC={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 qC=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,...PC,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:m0("lucide",r),...!l&&!IC(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 me=(e,t)=>{const n=u.forwardRef(({className:a,...r},l)=>u.createElement(qC,{ref:l,iconNode:t,className:m0(`lucide-${BC(Jg(e))}`,`lucide-${e}`,a),...r}));return n.displayName=Jg(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 GC=[["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"}]],VC=me("archive-restore",GC);/**
|
|
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 YC=[["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"}]],ev=me("archive",YC);/**
|
|
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 FC=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],XC=me("arrow-down",FC);/**
|
|
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 KC=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],mp=me("arrow-left",KC);/**
|
|
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 QC=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ZC=me("arrow-up",QC);/**
|
|
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 WC=[["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"}]],pp=me("bot",WC);/**
|
|
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 JC=[["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"}]],eT=me("briefcase",JC);/**
|
|
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 tT=[["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"}]],nT=me("building-2",tT);/**
|
|
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 sT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ol=me("check",sT);/**
|
|
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 aT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],rT=me("chevron-down",aT);/**
|
|
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 lT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],p0=me("chevron-right",lT);/**
|
|
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 iT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],oT=me("chevron-up",iT);/**
|
|
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 cT=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],x0=me("chevrons-up-down",cT);/**
|
|
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 uT=[["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"}]],ot=me("circle-alert",uT);/**
|
|
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 dT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Qu=me("circle-check",dT);/**
|
|
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 fT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],hT=me("circle",fT);/**
|
|
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 mT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],pT=me("clock",mT);/**
|
|
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 xT=[["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"}]],gT=me("copy",xT);/**
|
|
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 vT=[["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"}]],xp=me("ellipsis",vT);/**
|
|
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 yT=[["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"}]],bT=me("eraser",yT);/**
|
|
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 jT=[["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"}]],vo=me("eye",jT);/**
|
|
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 wT=[["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"}]],g0=me("folder-git-2",wT);/**
|
|
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 _T=[["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"}]],NT=me("folder-git",_T);/**
|
|
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 kT=[["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"}]],ST=me("git-fork",kT);/**
|
|
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"}]],TT=me("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 RT=[["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"}]],ET=me("history",RT);/**
|
|
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 AT=[["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=me("house",AT);/**
|
|
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 $T=[["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"}]],OT=me("inbox",$T);/**
|
|
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 DT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ea=me("info",DT);/**
|
|
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 zT=[["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"}]],LT=me("laptop",zT);/**
|
|
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 UT=[["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"}]],BT=me("life-buoy",UT);/**
|
|
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 HT=[["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"}]],v0=me("list-checks",HT);/**
|
|
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 IT=[["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"}]],y0=me("list-ordered",IT);/**
|
|
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 PT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],qT=me("loader-circle",PT);/**
|
|
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 GT=[["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"}]],VT=me("lock",GT);/**
|
|
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 YT=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],FT=me("message-circle",YT);/**
|
|
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 XT=[["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"}]],KT=me("messages-square",XT);/**
|
|
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 QT=[["path",{d:"M5 12h14",key:"1ays0h"}]],ZT=me("minus",QT);/**
|
|
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 WT=[["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"}]],JT=me("network",WT);/**
|
|
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 eR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],tR=me("panel-left",eR);/**
|
|
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 nR=[["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"}]],b0=me("pause",nR);/**
|
|
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 sR=[["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"}]],Zu=me("pencil",sR);/**
|
|
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 aR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jl=me("plus",aR);/**
|
|
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 rR=[["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"}]],vr=me("refresh-cw",rR);/**
|
|
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 lR=[["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"}]],iR=me("rotate-ccw",lR);/**
|
|
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 oR=[["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"}]],Wu=me("search-x",oR);/**
|
|
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 cR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],uR=me("search",cR);/**
|
|
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 dR=[["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"}]],fR=me("send",dR);/**
|
|
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 hR=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],mR=me("shield-alert",hR);/**
|
|
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 pR=[["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"}]],xR=me("snowflake",pR);/**
|
|
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 gR=[["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"}]],uu=me("tag",gR);/**
|
|
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 vR=[["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"}]],Lt=me("triangle-alert",vR);/**
|
|
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 yR=[["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"}]],bR=me("user-check",yR);/**
|
|
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 jR=[["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"}]],wR=me("user-cog",jR);/**
|
|
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 _R=[["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"}]],gp=me("user",_R);/**
|
|
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 NR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ju=me("x",NR);/**
|
|
350
|
+
* @license lucide-react v0.511.0 - ISC
|
|
351
|
+
*
|
|
352
|
+
* This source code is licensed under the ISC license.
|
|
353
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
+
*/const kR=[["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"}]],SR=me("wrench",kR),CR="Local only · this machine · not connected to SoftwareDLC",TR="Checking sync state…",RR="Sync state unknown",ER="Projects are the repositories this viewer reads on this machine. Nothing is shared unless you connect to SoftwareDLC.",or="Details are in the terminal running sdlc viewer.",AR="How to fix it is in the terminal running sdlc viewer.",ed="Loading…",du="Not available";function MR(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 $R={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 j0(e,t){const n=t?` this list was read at ${li(t)}.`:"";if(e.reason==="store_locked"){const a=e.store?$R[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."} ${or}`}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)}.`:""} ${or}`}const OR=e=>e.status===409,DR={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 zR(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?DR[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 tv=["tasks","issues","releases"],vp=u.createContext(null);function sn(){const e=u.useContext(vp);if(!e)throw new Error("A shell page rendered outside the app shell.");return e}function LR(){var e;return(e=u.useContext(vp))==null?void 0:e.engine}const UR=10,BR=()=>new Date;function HR({shell:e,now:t=BR,children:n}){var M;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),[p,j]=u.useState(!0),[v,b]=u.useState(!1),[x,g]=u.useState(void 0),[y,w]=u.useState(!1),[N,C]=u.useState(tv),_=u.useRef(!1),S=u.useRef(!1),O=u.useRef(null),D=u.useRef(!0),I=u.useCallback(async(U=!1)=>{O.current&&clearTimeout(O.current),O.current=null,b(!0);const[R,T]=await Promise.all([e.organizations.list(),e.projects.list()]);if(!D.current)return;if(b(!1),j(!1),R.ok&&T.ok){if(_.current=!0,S.current=!1,m(null),f(t()),R.data.organizations.length===0){c("not_in_git"),r(null),i(null);return}c(null),r(R.data.organizations[0]),i(T.data.projects);return}const E=R.ok?T.ok?null:T.refusal:R.refusal;if(!E)return;if(OR(E)){S.current=!1,m(null),c(E),r(null),i(null);return}const k=_.current&&!S.current&&!U;S.current=!0;const $=E.retry_after??UR;m({refusal:E,shown:!k,retryInSeconds:k?$:null}),k&&(O.current=setTimeout(()=>void I(!0),$*1e3))},[e,t]);u.useEffect(()=>(D.current=!0,I(),e.about.about().then(U=>{D.current&&(U.ok?g(U.data):U.refusal.status===404?g(null):w(!0))}),Promise.all(tv.map(async U=>{var R;return[U,await((R=e[U])==null?void 0:R.access())]})).then(U=>{D.current&&C(U.filter(([,R])=>!(R!=null&&R.ok&&!R.data.can_view)).map(([R])=>R))}),()=>{D.current=!1,O.current&&clearTimeout(O.current)}),[e,I]);const P={loading:p,org:a,projects:l,none:o,readAt:d,failure:h,about:x,aboutFailed:y,engine:(x==null?void 0:x.engine)===null?null:(M=x==null?void 0:x.engine)==null?void 0:M.source,domains:N,reading:v,refresh:()=>void I()};return s.jsx(vp.Provider,{value:P,children:n})}const w0=e=>`The ${e} page is not part of this sdlc install`,Dl="The sdlc engine here is too old for this page";function IR(e){return e==="checkout"?"Update the main checkout, then restart sdlc viewer.":"Update sdlc to its latest version, then restart sdlc viewer."}function _s(){return IR(LR())}function _0(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=_0(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function N0(){for(var e,t,n=0,a="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=_0(e))&&(a&&(a+=" "),a+=t);return a}const nv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,sv=N0,yo=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return sv(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=nv(f)||nv(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,...p}=f;return Object.entries(p).every(j=>{let[v,b]=j;return Array.isArray(b)?b.includes({...l,...o}[v]):{...l,...o}[v]===b})?[...d,h,m]:d},[]);return sv(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},yp="-",PR=e=>{const t=GR(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{const o=i.split(yp);return o[0]===""&&o.length!==1&&o.shift(),k0(o,t)||qR(i)},getConflictingClassGroupIds:(i,o)=>{const c=n[i]||[];return o&&a[i]?[...c,...a[i]]:c}}},k0=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),r=a?k0(e.slice(1),a):void 0;if(r)return r;if(t.validators.length===0)return;const l=e.join(yp);return(i=t.validators.find(({validator:o})=>o(l)))==null?void 0:i.classGroupId},av=/^\[(.+)\]$/,qR=e=>{if(av.test(e)){const t=av.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},GR=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const r in n)Ih(n[r],a,r,t);return a},Ih=(e,t,n,a)=>{e.forEach(r=>{if(typeof r=="string"){const l=r===""?t:rv(t,r);l.classGroupId=n;return}if(typeof r=="function"){if(VR(r)){Ih(r(a),t,n,a);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([l,i])=>{Ih(i,rv(t,l),n,a)})})},rv=(e,t)=>{let n=e;return t.split(yp).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},VR=e=>e.isThemeGetter,YR=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)}}},Ph="!",qh=":",FR=qh.length,XR=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===qh){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=KR(f),m=h!==f,p=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:p}};if(t){const r=t+qh,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},KR=e=>e.endsWith(Ph)?e.substring(0,e.length-1):e.startsWith(Ph)?e.substring(1):e,QR=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}},ZR=e=>({cache:YR(e.cacheSize),parseClassName:XR(e),sortModifiers:QR(e),...PR(e)}),WR=/\s+/,JR=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:l}=t,i=[],o=e.trim().split(WR);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{isExternal:h,modifiers:m,hasImportantModifier:p,baseClassName:j,maybePostfixModifierPosition:v}=n(f);if(h){c=f+(c.length>0?" "+c:c);continue}let b=!!v,x=a(b?j.substring(0,v):j);if(!x){if(!b){c=f+(c.length>0?" "+c:c);continue}if(x=a(j),!x){c=f+(c.length>0?" "+c:c);continue}b=!1}const g=l(m).join(":"),y=p?g+Ph:g,w=y+x;if(i.includes(w))continue;i.push(w);const N=r(x,b);for(let C=0;C<N.length;++C){const _=N[C];i.push(y+_)}c=f+(c.length>0?" "+c:c)}return c};function eE(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=S0(t))&&(a&&(a+=" "),a+=n);return a}const S0=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=S0(e[a]))&&(n&&(n+=" "),n+=t);return n};function tE(e,...t){let n,a,r,l=i;function i(c){const d=t.reduce((f,h)=>h(f),e());return n=ZR(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=JR(c,n);return r(c,f),f}return function(){return l(eE.apply(null,arguments))}}const wt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},C0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,T0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nE=/^\d+\/\d+$/,sE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aE=/\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$/,rE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kr=e=>nE.test(e),Te=e=>!!e&&!Number.isNaN(Number(e)),ia=e=>!!e&&Number.isInteger(Number(e)),gf=e=>e.endsWith("%")&&Te(e.slice(0,-1)),Ds=e=>sE.test(e),oE=()=>!0,cE=e=>aE.test(e)&&!rE.test(e),R0=()=>!1,uE=e=>lE.test(e),dE=e=>iE.test(e),fE=e=>!ie(e)&&!oe(e),hE=e=>zl(e,M0,R0),ie=e=>C0.test(e),Va=e=>zl(e,$0,cE),vf=e=>zl(e,vE,Te),lv=e=>zl(e,E0,R0),mE=e=>zl(e,A0,dE),Zo=e=>zl(e,O0,uE),oe=e=>T0.test(e),Wl=e=>Ll(e,$0),pE=e=>Ll(e,yE),iv=e=>Ll(e,E0),xE=e=>Ll(e,M0),gE=e=>Ll(e,A0),Wo=e=>Ll(e,O0,!0),zl=(e,t,n)=>{const a=C0.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},Ll=(e,t,n=!1)=>{const a=T0.exec(e);return a?a[1]?t(a[1]):n:!1},E0=e=>e==="position"||e==="percentage",A0=e=>e==="image"||e==="url",M0=e=>e==="length"||e==="size"||e==="bg-size",$0=e=>e==="length",vE=e=>e==="number",yE=e=>e==="family-name",O0=e=>e==="shadow",bE=()=>{const e=wt("color"),t=wt("font"),n=wt("text"),a=wt("font-weight"),r=wt("tracking"),l=wt("leading"),i=wt("breakpoint"),o=wt("container"),c=wt("spacing"),d=wt("radius"),f=wt("shadow"),h=wt("inset-shadow"),m=wt("text-shadow"),p=wt("drop-shadow"),j=wt("blur"),v=wt("perspective"),b=wt("aspect"),x=wt("ease"),g=wt("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...w(),oe,ie],C=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],S=()=>[oe,ie,c],O=()=>[kr,"full","auto",...S()],D=()=>[ia,"none","subgrid",oe,ie],I=()=>["auto",{span:["full",ia,oe,ie]},ia,oe,ie],P=()=>[ia,"auto",oe,ie],M=()=>["auto","min","max","fr",oe,ie],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],R=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...S()],E=()=>[kr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...S()],k=()=>[e,oe,ie],$=()=>[...w(),iv,lv,{position:[oe,ie]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",xE,hE,{size:[oe,ie]}],G=()=>[gf,Wl,Va],W=()=>["","none","full",d,oe,ie],Z=()=>["",Te,Wl,Va],ge=()=>["solid","dashed","dotted","double"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>[Te,gf,iv,lv],X=()=>["","none",j,oe,ie],te=()=>["none",Te,oe,ie],he=()=>["none",Te,oe,ie],pe=()=>[Te,oe,ie],re=()=>[kr,"full",...S()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ds],breakpoint:[Ds],color:[oE],container:[Ds],"drop-shadow":[Ds],ease:["in","out","in-out"],font:[fE],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ds],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ds],shadow:[Ds],spacing:["px",Te],text:[Ds],"text-shadow":[Ds],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",kr,ie,oe,b]}],container:["container"],columns:[{columns:[Te,ie,oe,o]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{start:O()}],end:[{end:O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[ia,"auto",oe,ie]}],basis:[{basis:[kr,"full","auto",o,...S()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Te,kr,"auto","initial","none",ie]}],grow:[{grow:["",Te,oe,ie]}],shrink:[{shrink:["",Te,oe,ie]}],order:[{order:[ia,"first","last","none",oe,ie]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...R(),"normal"]}],"justify-self":[{"justify-self":["auto",...R()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...R(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...R(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...R(),"baseline"]}],"place-self":[{"place-self":["auto",...R()]}],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:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"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,Wl,Va]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,oe,vf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gf,ie]}],"font-family":[{font:[pE,ie,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,oe,ie]}],"line-clamp":[{"line-clamp":[Te,"none",oe,vf]}],leading:[{leading:[l,...S()]}],"list-image":[{"list-image":["none",oe,ie]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",oe,ie]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ge(),"wavy"]}],"text-decoration-thickness":[{decoration:[Te,"from-font","auto",oe,Va]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[Te,"auto",oe,ie]}],"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",oe,ie]}],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",oe,ie]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ia,oe,ie],radial:["",oe,ie],conic:[ia,oe,ie]},gE,mE]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ge(),"hidden","none"]}],"divide-style":[{divide:[...ge(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...ge(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Te,oe,ie]}],"outline-w":[{outline:["",Te,Wl,Va]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",f,Wo,Zo]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",h,Wo,Zo]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[Te,Va]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",m,Wo,Zo]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[Te,oe,ie]}],"mix-blend":[{"mix-blend":[...Y(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Y()}],"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":[Te]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[oe,ie]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[Te]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",oe,ie]}],filter:[{filter:["","none",oe,ie]}],blur:[{blur:X()}],brightness:[{brightness:[Te,oe,ie]}],contrast:[{contrast:[Te,oe,ie]}],"drop-shadow":[{"drop-shadow":["","none",p,Wo,Zo]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",Te,oe,ie]}],"hue-rotate":[{"hue-rotate":[Te,oe,ie]}],invert:[{invert:["",Te,oe,ie]}],saturate:[{saturate:[Te,oe,ie]}],sepia:[{sepia:["",Te,oe,ie]}],"backdrop-filter":[{"backdrop-filter":["","none",oe,ie]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[Te,oe,ie]}],"backdrop-contrast":[{"backdrop-contrast":[Te,oe,ie]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Te,oe,ie]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Te,oe,ie]}],"backdrop-invert":[{"backdrop-invert":["",Te,oe,ie]}],"backdrop-opacity":[{"backdrop-opacity":[Te,oe,ie]}],"backdrop-saturate":[{"backdrop-saturate":[Te,oe,ie]}],"backdrop-sepia":[{"backdrop-sepia":["",Te,oe,ie]}],"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",oe,ie]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Te,"initial",oe,ie]}],ease:[{ease:["linear","initial",x,oe,ie]}],delay:[{delay:[Te,oe,ie]}],animate:[{animate:["none",g,oe,ie]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,oe,ie]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:he()}],"scale-x":[{"scale-x":he()}],"scale-y":[{"scale-y":he()}],"scale-z":[{"scale-z":he()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[oe,ie,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe,ie]}],"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",oe,ie]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[Te,Wl,Va,vf]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},jE=tE(bE);function se(...e){return jE(N0(e))}const wE=yo("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 ce({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:se(wE({variant:t}),e),...n})}function xe({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:se("col-start-2 min-h-4 font-medium tracking-tight",e),...t})}function ue({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:se("col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function ae(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 ov(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function td(...e){return t=>{let n=!1;const a=e.map(r=>{const l=ov(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():ov(e[r],null)}}}}function He(...e){return u.useCallback(td(...e),e)}function _E(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 Ns(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:p,...j}=h,v=((x=m==null?void 0:m[e])==null?void 0:x[c])||o,b=u.useMemo(()=>j,Object.values(j));return s.jsx(v.Provider,{value:b,children:p})};d.displayName=l+"Provider";function f(h,m){var v;const p=((v=m==null?void 0:m[e])==null?void 0:v[c])||o,j=u.useContext(p);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,NE(r,...t)]}function NE(...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 qt=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},kE=Ny[" useId ".trim().toString()]||(()=>{}),SE=0;function Vn(e){const[t,n]=u.useState(kE());return qt(()=>{n(a=>a??String(SE++))},[e]),t?`radix-${t}`:""}var CE=Ny[" useInsertionEffect ".trim().toString()]||qt;function za({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[r,l,i]=TE({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=RE(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 TE({defaultProp:e,onChange:t}){const[n,a]=u.useState(e),r=u.useRef(n),l=u.useRef(t);return CE(()=>{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 RE(e){return typeof e=="function"}function cr(e){const t=AE(e),n=u.forwardRef((a,r)=>{const{children:l,...i}=a,o=u.Children.toArray(l),c=o.find($E);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 EE=cr("Slot");function AE(e){const t=u.forwardRef((n,a)=>{const{children:r,...l}=n;if(u.isValidElement(r)){const i=DE(r),o=OE(l,r.props);return r.type!==u.Fragment&&(o.ref=a?td(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 D0=Symbol("radix.slottable");function ME(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=D0,t}function $E(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===D0}function OE(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 DE(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 zE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=zE.reduce((e,t)=>{const n=cr(`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 z0(e,t){e&&Sl.flushSync(()=>e.dispatchEvent(t))}function ys(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 LE(e,t=globalThis==null?void 0:globalThis.document){const n=ys(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 UE="DismissableLayer",Gh="dismissableLayer.update",BE="dismissableLayer.pointerDownOutside",HE="dismissableLayer.focusOutside",cv,L0=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bo=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:r,onFocusOutside:l,onInteractOutside:i,onDismiss:o,...c}=e,d=u.useContext(L0),[f,h]=u.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=u.useState({}),j=He(t,_=>h(_)),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(b),g=f?v.indexOf(f):-1,y=d.layersWithOutsidePointerEventsDisabled.size>0,w=g>=x,N=qE(_=>{const S=_.target,O=[...d.branches].some(D=>D.contains(S));!w||O||(r==null||r(_),i==null||i(_),_.defaultPrevented||o==null||o())},m),C=GE(_=>{const S=_.target;[...d.branches].some(D=>D.contains(S))||(l==null||l(_),i==null||i(_),_.defaultPrevented||o==null||o())},m);return LE(_=>{g===d.layers.size-1&&(a==null||a(_),!_.defaultPrevented&&o&&(_.preventDefault(),o()))},m),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(cv=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),uv(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=cv)}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),uv())},[f,d]),u.useEffect(()=>{const _=()=>p({});return document.addEventListener(Gh,_),()=>document.removeEventListener(Gh,_)},[]),s.jsx(Ne.div,{...c,ref:j,style:{pointerEvents:y?w?"auto":"none":void 0,...e.style},onFocusCapture:ae(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ae(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ae(e.onPointerDownCapture,N.onPointerDownCapture)})});bo.displayName=UE;var IE="DismissableLayerBranch",PE=u.forwardRef((e,t)=>{const n=u.useContext(L0),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(Ne.div,{...e,ref:r})});PE.displayName=IE;function qE(e,t=globalThis==null?void 0:globalThis.document){const n=ys(e),a=u.useRef(!1),r=u.useRef(()=>{});return u.useEffect(()=>{const l=o=>{if(o.target&&!a.current){let c=function(){U0(BE,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 GE(e,t=globalThis==null?void 0:globalThis.document){const n=ys(e),a=u.useRef(!1);return u.useEffect(()=>{const r=l=>{l.target&&!a.current&&U0(HE,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 uv(){const e=new CustomEvent(Gh);document.dispatchEvent(e)}function U0(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?z0(r,l):r.dispatchEvent(l)}var yf="focusScope.autoFocusOnMount",bf="focusScope.autoFocusOnUnmount",dv={bubbles:!1,cancelable:!0},VE="FocusScope",nd=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:r,onUnmountAutoFocus:l,...i}=e,[o,c]=u.useState(null),d=ys(r),f=ys(l),h=u.useRef(null),m=He(t,v=>c(v)),p=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(a){let v=function(y){if(p.paused||!o)return;const w=y.target;o.contains(w)?h.current=w:da(h.current,{select:!0})},b=function(y){if(p.paused||!o)return;const w=y.relatedTarget;w!==null&&(o.contains(w)||da(h.current,{select:!0}))},x=function(y){if(document.activeElement===document.body)for(const N of y)N.removedNodes.length>0&&da(o)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const g=new MutationObserver(x);return o&&g.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),g.disconnect()}}},[a,o,p.paused]),u.useEffect(()=>{if(o){hv.add(p);const v=document.activeElement;if(!o.contains(v)){const x=new CustomEvent(yf,dv);o.addEventListener(yf,d),o.dispatchEvent(x),x.defaultPrevented||(YE(ZE(B0(o)),{select:!0}),document.activeElement===v&&da(o))}return()=>{o.removeEventListener(yf,d),setTimeout(()=>{const x=new CustomEvent(bf,dv);o.addEventListener(bf,f),o.dispatchEvent(x),x.defaultPrevented||da(v??document.body,{select:!0}),o.removeEventListener(bf,f),hv.remove(p)},0)}}},[o,d,f,p]);const j=u.useCallback(v=>{if(!n&&!a||p.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(b&&x){const g=v.currentTarget,[y,w]=FE(g);y&&w?!v.shiftKey&&x===w?(v.preventDefault(),n&&da(y,{select:!0})):v.shiftKey&&x===y&&(v.preventDefault(),n&&da(w,{select:!0})):x===g&&v.preventDefault()}},[n,a,p.paused]);return s.jsx(Ne.div,{tabIndex:-1,...i,ref:m,onKeyDown:j})});nd.displayName=VE;function YE(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(da(a,{select:t}),document.activeElement!==n)return}function FE(e){const t=B0(e),n=fv(t,e),a=fv(t.reverse(),e);return[n,a]}function B0(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 fv(e,t){for(const n of e)if(!XE(n,{upTo:t}))return n}function XE(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 KE(e){return e instanceof HTMLInputElement&&"select"in e}function da(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&KE(e)&&t&&e.select()}}var hv=QE();function QE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=mv(e,t),e.unshift(t)},remove(t){var n;e=mv(e,t),(n=e[0])==null||n.resume()}}}function mv(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function ZE(e){return e.filter(t=>t.tagName!=="A")}var WE="Portal",jo=u.forwardRef((e,t)=>{var o;const{container:n,...a}=e,[r,l]=u.useState(!1);qt(()=>l(!0),[]);const i=n||r&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?oS.createPortal(s.jsx(Ne.div,{...a,ref:t}),i):null});jo.displayName=WE;function JE(e,t){return u.useReducer((n,a)=>t[n][a]??n,e)}var On=e=>{const{present:t,children:n}=e,a=eA(t),r=typeof n=="function"?n({present:a.isPresent}):u.Children.only(n),l=He(a.ref,tA(r));return typeof n=="function"||a.isPresent?u.cloneElement(r,{ref:l}):null};On.displayName="Presence";function eA(e){const[t,n]=u.useState(),a=u.useRef(null),r=u.useRef(e),l=u.useRef("none"),i=e?"mounted":"unmounted",[o,c]=JE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=Jo(a.current);l.current=o==="mounted"?d:"none"},[o]),qt(()=>{const d=a.current,f=r.current;if(f!==e){const m=l.current,p=Jo(d);e?c("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&m!==p?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,c]),qt(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=p=>{const v=Jo(a.current).includes(p.animationName);if(p.target===t&&v&&(c("ANIMATION_END"),!r.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=p=>{p.target===t&&(l.current=Jo(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 Jo(e){return(e==null?void 0:e.animationName)||"none"}function tA(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 jf=0;function bp(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pv()),document.body.insertAdjacentElement("beforeend",e[1]??pv()),jf++,()=>{jf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jf--}},[])}function pv(){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 cs=function(){return cs=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},cs.apply(this,arguments)};function H0(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 nA(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 Sc="right-scroll-bar-position",Cc="width-before-scroll-bar",sA="with-scroll-bars-hidden",aA="--removed-body-scroll-bar-size";function wf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function rA(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 lA=typeof window<"u"?u.useLayoutEffect:u.useEffect,xv=new WeakMap;function iA(e,t){var n=rA(null,function(a){return e.forEach(function(r){return wf(r,a)})});return lA(function(){var a=xv.get(n);if(a){var r=new Set(a),l=new Set(e),i=n.current;r.forEach(function(o){l.has(o)||wf(o,null)}),l.forEach(function(o){r.has(o)||wf(o,i)})}xv.set(n,e)},[e]),n}function oA(e){return e}function cA(e,t){t===void 0&&(t=oA);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 uA(e){e===void 0&&(e={});var t=cA(null);return t.options=cs({async:!0,ssr:!1},e),t}var I0=function(e){var t=e.sideCar,n=H0(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,cs({},n))};I0.isSideCarExport=!0;function dA(e,t){return e.useMedium(t),I0}var P0=uA(),_f=function(){},sd=u.forwardRef(function(e,t){var n=u.useRef(null),a=u.useState({onScrollCapture:_f,onWheelCapture:_f,onTouchMoveCapture:_f}),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,p=e.noRelative,j=e.noIsolation,v=e.inert,b=e.allowPinchZoom,x=e.as,g=x===void 0?"div":x,y=e.gapMode,w=H0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,C=iA([n,t]),_=cs(cs({},w),r);return u.createElement(u.Fragment,null,f&&u.createElement(N,{sideCar:P0,removeScrollBar:d,shards:h,noRelative:p,noIsolation:j,inert:v,setCallbacks:l,allowPinchZoom:!!b,lockRef:n,gapMode:y}),i?u.cloneElement(u.Children.only(o),cs(cs({},_),{ref:C})):u.createElement(g,cs({},_,{className:c,ref:C}),o))});sd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sd.classNames={fullWidth:Cc,zeroRight:Sc};var fA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function hA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fA();return t&&e.setAttribute("nonce",t),e}function mA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xA=function(){var e=0,t=null;return{add:function(n){e==0&&(t=hA())&&(mA(t,n),pA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gA=function(){var e=xA();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},q0=function(){var e=gA(),t=function(n){var a=n.styles,r=n.dynamic;return e(a,r),null};return t},vA={left:0,top:0,right:0,gap:0},Nf=function(e){return parseInt(e||"",10)||0},yA=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[Nf(n),Nf(a),Nf(r)]},bA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vA;var t=yA(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])}},jA=q0(),al="data-scroll-locked",wA=function(e,t,n,a){var r=e.left,l=e.top,i=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
355
|
+
.`.concat(sA,` {
|
|
356
|
+
overflow: hidden `).concat(a,`;
|
|
357
|
+
padding-right: `).concat(o,"px ").concat(a,`;
|
|
358
|
+
}
|
|
359
|
+
body[`).concat(al,`] {
|
|
360
|
+
overflow: hidden `).concat(a,`;
|
|
361
|
+
overscroll-behavior: contain;
|
|
362
|
+
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
363
|
+
padding-left: `.concat(r,`px;
|
|
364
|
+
padding-top: `).concat(l,`px;
|
|
365
|
+
padding-right: `).concat(i,`px;
|
|
366
|
+
margin-left:0;
|
|
367
|
+
margin-top:0;
|
|
368
|
+
margin-right: `).concat(o,"px ").concat(a,`;
|
|
369
|
+
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.`).concat(Sc,` {
|
|
373
|
+
right: `).concat(o,"px ").concat(a,`;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.`).concat(Cc,` {
|
|
377
|
+
margin-right: `).concat(o,"px ").concat(a,`;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.`).concat(Sc," .").concat(Sc,` {
|
|
381
|
+
right: 0 `).concat(a,`;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.`).concat(Cc," .").concat(Cc,` {
|
|
385
|
+
margin-right: 0 `).concat(a,`;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
body[`).concat(al,`] {
|
|
389
|
+
`).concat(aA,": ").concat(o,`px;
|
|
390
|
+
}
|
|
391
|
+
`)},gv=function(){var e=parseInt(document.body.getAttribute(al)||"0",10);return isFinite(e)?e:0},_A=function(){u.useEffect(function(){return document.body.setAttribute(al,(gv()+1).toString()),function(){var e=gv()-1;e<=0?document.body.removeAttribute(al):document.body.setAttribute(al,e.toString())}},[])},NA=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,r=a===void 0?"margin":a;_A();var l=u.useMemo(function(){return bA(r)},[r]);return u.createElement(jA,{styles:wA(l,!t,r,n?"":"!important")})},Vh=!1;if(typeof window<"u")try{var ec=Object.defineProperty({},"passive",{get:function(){return Vh=!0,!0}});window.addEventListener("test",ec,ec),window.removeEventListener("test",ec,ec)}catch{Vh=!1}var Sr=Vh?{passive:!1}:!1,kA=function(e){return e.tagName==="TEXTAREA"},G0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!kA(e)&&n[t]==="visible")},SA=function(e){return G0(e,"overflowY")},CA=function(e){return G0(e,"overflowX")},vv=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var r=V0(e,a);if(r){var l=Y0(e,a),i=l[1],o=l[2];if(i>o)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},TA=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},RA=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},V0=function(e,t){return e==="v"?SA(t):CA(t)},Y0=function(e,t){return e==="v"?TA(t):RA(t)},EA=function(e,t){return e==="h"&&t==="rtl"?-1:1},AA=function(e,t,n,a,r){var l=EA(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 p=Y0(e,o),j=p[0],v=p[1],b=p[2],x=v-b-l*j;(j||x)&&V0(e,o)&&(h+=x,m+=j);var g=o.parentNode;o=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}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},tc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yv=function(e){return[e.deltaX,e.deltaY]},bv=function(e){return e&&"current"in e?e.current:e},MA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$A=function(e){return`
|
|
392
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
393
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
394
|
+
`)},OA=0,Cr=[];function DA(e){var t=u.useRef([]),n=u.useRef([0,0]),a=u.useRef(),r=u.useState(OA++)[0],l=u.useState(q0)[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=nA([e.lockRef.current],(e.shards||[]).map(bv),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var o=u.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var x=tc(v),g=n.current,y="deltaX"in v?v.deltaX:g[0]-x[0],w="deltaY"in v?v.deltaY:g[1]-x[1],N,C=v.target,_=Math.abs(y)>Math.abs(w)?"h":"v";if("touches"in v&&_==="h"&&C.type==="range")return!1;var S=vv(_,C);if(!S)return!0;if(S?N=_:(N=_==="v"?"h":"v",S=vv(_,C)),!S)return!1;if(!a.current&&"changedTouches"in v&&(y||w)&&(a.current=N),!N)return!0;var O=a.current||N;return AA(O,b,v,O==="h"?y:w)},[]),c=u.useCallback(function(v){var b=v;if(!(!Cr.length||Cr[Cr.length-1]!==l)){var x="deltaY"in b?yv(b):tc(b),g=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&MA(N.delta,x)})[0];if(g&&g.should){b.cancelable&&b.preventDefault();return}if(!g){var y=(i.current.shards||[]).map(bv).filter(Boolean).filter(function(N){return N.contains(b.target)}),w=y.length>0?o(b,y[0]):!i.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),d=u.useCallback(function(v,b,x,g){var y={name:v,delta:b,target:x,should:g,shadowParent:zA(x)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(w){return w!==y})},1)},[]),f=u.useCallback(function(v){n.current=tc(v),a.current=void 0},[]),h=u.useCallback(function(v){d(v.type,yv(v),v.target,o(v,e.lockRef.current))},[]),m=u.useCallback(function(v){d(v.type,tc(v),v.target,o(v,e.lockRef.current))},[]);u.useEffect(function(){return Cr.push(l),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Sr),document.addEventListener("touchmove",c,Sr),document.addEventListener("touchstart",f,Sr),function(){Cr=Cr.filter(function(v){return v!==l}),document.removeEventListener("wheel",c,Sr),document.removeEventListener("touchmove",c,Sr),document.removeEventListener("touchstart",f,Sr)}},[]);var p=e.removeScrollBar,j=e.inert;return u.createElement(u.Fragment,null,j?u.createElement(l,{styles:$A(r)}):null,p?u.createElement(NA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const LA=dA(P0,DA);var ad=u.forwardRef(function(e,t){return u.createElement(sd,cs({},e,{ref:t,sideCar:LA}))});ad.classNames=sd.classNames;var UA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Tr=new WeakMap,nc=new WeakMap,sc={},kf=0,F0=function(e){return e&&(e.host||F0(e.parentNode))},BA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=F0(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})},HA=function(e,t,n,a){var r=BA(t,Array.isArray(e)?e:[e]);sc[n]||(sc[n]=new WeakMap);var l=sc[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 p=m.getAttribute(a),j=p!==null&&p!=="false",v=(Tr.get(m)||0)+1,b=(l.get(m)||0)+1;Tr.set(m,v),l.set(m,b),i.push(m),v===1&&j&&nc.set(m,!0),b===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(),kf++,function(){i.forEach(function(h){var m=Tr.get(h)-1,p=l.get(h)-1;Tr.set(h,m),l.set(h,p),m||(nc.has(h)||h.removeAttribute(a),nc.delete(h)),p||h.removeAttribute(n)}),kf--,kf||(Tr=new WeakMap,Tr=new WeakMap,nc=new WeakMap,sc={})}},jp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),r=UA(e);return r?(a.push.apply(a,Array.from(r.querySelectorAll("[aria-live], script"))),HA(a,r,n,"aria-hidden")):function(){return null}},rd="Dialog",[X0]=Ns(rd),[IA,Wn]=X0(rd),K0=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]=za({prop:a,defaultProp:r??!1,onChange:l,caller:rd});return s.jsx(IA,{scope:t,triggerRef:o,contentRef:c,contentId:Vn(),titleId:Vn(),descriptionId:Vn(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(h=>!h),[f]),modal:i,children:n})};K0.displayName=rd;var Q0="DialogTrigger",PA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Wn(Q0,n),l=He(t,r.triggerRef);return s.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":Np(r.open),...a,ref:l,onClick:ae(e.onClick,r.onOpenToggle)})});PA.displayName=Q0;var wp="DialogPortal",[qA,Z0]=X0(wp,{forceMount:void 0}),W0=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:r}=e,l=Wn(wp,t);return s.jsx(qA,{scope:t,forceMount:n,children:u.Children.map(a,i=>s.jsx(On,{present:n||l.open,children:s.jsx(jo,{asChild:!0,container:r,children:i})}))})};W0.displayName=wp;var fu="DialogOverlay",J0=u.forwardRef((e,t)=>{const n=Z0(fu,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,l=Wn(fu,e.__scopeDialog);return l.modal?s.jsx(On,{present:a||l.open,children:s.jsx(VA,{...r,ref:t})}):null});J0.displayName=fu;var GA=cr("DialogOverlay.RemoveScroll"),VA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Wn(fu,n);return s.jsx(ad,{as:GA,allowPinchZoom:!0,shards:[r.contentRef],children:s.jsx(Ne.div,{"data-state":Np(r.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),ur="DialogContent",ew=u.forwardRef((e,t)=>{const n=Z0(ur,e.__scopeDialog),{forceMount:a=n.forceMount,...r}=e,l=Wn(ur,e.__scopeDialog);return s.jsx(On,{present:a||l.open,children:l.modal?s.jsx(YA,{...r,ref:t}):s.jsx(FA,{...r,ref:t})})});ew.displayName=ur;var YA=u.forwardRef((e,t)=>{const n=Wn(ur,e.__scopeDialog),a=u.useRef(null),r=He(t,n.contentRef,a);return u.useEffect(()=>{const l=a.current;if(l)return jp(l)},[]),s.jsx(tw,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ae(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ae(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&l.preventDefault()}),onFocusOutside:ae(e.onFocusOutside,l=>l.preventDefault())})}),FA=u.forwardRef((e,t)=>{const n=Wn(ur,e.__scopeDialog),a=u.useRef(!1),r=u.useRef(!1);return s.jsx(tw,{...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()}})}),tw=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:r,onCloseAutoFocus:l,...i}=e,o=Wn(ur,n),c=u.useRef(null),d=He(t,c);return bp(),s.jsxs(s.Fragment,{children:[s.jsx(nd,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:r,onUnmountAutoFocus:l,children:s.jsx(bo,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":Np(o.open),...i,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(XA,{titleId:o.titleId}),s.jsx(QA,{contentRef:c,descriptionId:o.descriptionId})]})]})}),_p="DialogTitle",nw=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Wn(_p,n);return s.jsx(Ne.h2,{id:r.titleId,...a,ref:t})});nw.displayName=_p;var sw="DialogDescription",aw=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Wn(sw,n);return s.jsx(Ne.p,{id:r.descriptionId,...a,ref:t})});aw.displayName=sw;var rw="DialogClose",lw=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,r=Wn(rw,n);return s.jsx(Ne.button,{type:"button",...a,ref:t,onClick:ae(e.onClick,()=>r.onOpenChange(!1))})});lw.displayName=rw;function Np(e){return e?"open":"closed"}var iw="DialogTitleWarning",[q5,ow]=_E(iw,{contentName:ur,titleName:_p,docsSlug:"dialog"}),XA=({titleId:e})=>{const t=ow(iw),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
395
|
+
|
|
396
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
397
|
+
|
|
398
|
+
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},KA="DialogDescriptionWarning",QA=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ow(KA).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},cw=K0,uw=W0,dw=J0,fw=ew,hw=nw,mw=aw,kp=lw;function en({className:e,...t}){return s.jsx(qT,{role:"status","aria-label":"Loading",className:se("size-4 animate-spin",e),...t})}const rl="aria-pressed:border aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:text-accent-foreground",ZA="border border-primary bg-accent text-accent-foreground hover:bg-accent",ld=yo("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?EE:"button",f=a==="icon"||a==="sm-icon"||a==="control-icon"||a==="xs-icon",h=s.jsx(en,{"aria-hidden":"true","aria-label":void 0,role:void 0,className:se(!f&&"mr-2")}),m=r?i:l&&f?h:s.jsxs(s.Fragment,{children:[l?h:null,i]});return s.jsx(d,{className:se(ld({variant:n,size:a,className:e})),ref:c,disabled:t||l,...o,children:m})});H.displayName="Button";const pw=u.createContext(null);function WA({container:e,children:t}){return s.jsx(pw.Provider,{value:e,children:t})}function wo(){return u.useContext(pw)??void 0}function xw(e){return s.jsx(cw,{"data-slot":"alert-dialog",...e})}function JA({className:e,...t}){return s.jsx(dw,{"data-slot":"alert-dialog-overlay",className:se("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 gw({className:e,onOpenAutoFocus:t,onPointerDownOutside:n,onInteractOutside:a,...r}){return s.jsxs(uw,{container:wo(),children:[s.jsx(JA,{}),s.jsx(fw,{"data-slot":"alert-dialog-content",role:"alertdialog",className:se("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 vw({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:se("flex flex-col gap-2 text-center sm:text-left",e),...t})}function yw({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function bw({className:e,...t}){return s.jsx(hw,{"data-slot":"alert-dialog-title",className:se("text-lg font-semibold",e),...t})}function jw({className:e,...t}){return s.jsx(mw,{"data-slot":"alert-dialog-description",className:se("text-muted-foreground text-sm",e),...t})}function ww({className:e,variant:t,...n}){return s.jsx(kp,{"data-slot":"alert-dialog-action",className:se(ld({variant:t}),e),...n})}function _w({className:e,...t}){return s.jsx(kp,{"data-slot":"alert-dialog-cancel",className:se(ld({variant:"outline"}),e),...t})}function eM(){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 tM(e,t){t!=null&&t.isConnected&&(e.preventDefault(),t.focus())}function _o(){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=eM();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(xw,{open:e!==null,onOpenChange:o=>{o||r(!1)},children:s.jsxs(gw,{onCloseAutoFocus:o=>tM(o,a.current),children:[s.jsxs(vw,{children:[s.jsx(bw,{children:e==null?void 0:e.title}),s.jsx(jw,{className:"whitespace-pre-line",children:e==null?void 0:e.description})]}),s.jsxs(yw,{children:[s.jsx(_w,{children:"Cancel"}),s.jsx(ww,{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 zs="px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",nM=yo("inline-flex items-center rounded-md border transition-colors",{variants:{variant:{default:`${zs} border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80`,secondary:`${zs} border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`${zs} border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80`,outline:`${zs} text-foreground`,success:`${zs} border-success/40 bg-success/10 text-success`,warning:`${zs} border-warning/40 bg-warning/10 text-warning`,info:`${zs} border-info/40 bg-info/10 text-info`,error:`${zs} border-destructive/40 bg-destructive/10 text-destructive`,neutral:`${zs} 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 fe({className:e,variant:t,size:n,...a}){return s.jsx("div",{className:se(nM({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 kw(e){const[t,n]=u.useState(void 0);return qt(()=>{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 id="Checkbox",[sM]=Ns(id),[aM,Sp]=sM(id);function rM(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,p]=za({prop:n,defaultProp:r??!1,onChange:c,caller:id}),[j,v]=u.useState(null),[b,x]=u.useState(null),g=u.useRef(!1),y=j?!!i||!!j.closest("form"):!0,w={checked:m,disabled:l,setChecked:p,control:j,setControl:v,name:o,form:i,value:f,hasConsumerStoppedPropagationRef:g,required:d,defaultChecked:Ma(r)?!1:r,isFormControl:y,bubbleInput:b,setBubbleInput:x};return s.jsx(aM,{scope:t,...w,children:lM(h)?h(w):a})}var Sw="CheckboxTrigger",Cw=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:p,bubbleInput:j}=Sp(Sw,e),v=He(r,f),b=u.useRef(c);return u.useEffect(()=>{const x=l==null?void 0:l.form;if(x){const g=()=>h(b.current);return x.addEventListener("reset",g),()=>x.removeEventListener("reset",g)}},[l,h]),s.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Ma(c)?"mixed":c,"aria-required":d,"data-state":Mw(c),"data-disabled":o?"":void 0,disabled:o,value:i,...a,ref:v,onKeyDown:ae(t,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:ae(n,x=>{h(g=>Ma(g)?!0:!g),j&&p&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})});Cw.displayName=Sw;var Cp=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(rM,{__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(Cw,{...h,ref:t,__scopeCheckbox:n}),m&&s.jsx(Aw,{__scopeCheckbox:n})]})})});Cp.displayName=id;var Tw="CheckboxIndicator",Rw=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...r}=e,l=Sp(Tw,n);return s.jsx(On,{present:a||Ma(l.checked)||l.checked===!0,children:s.jsx(Ne.span,{"data-state":Mw(l.checked),"data-disabled":l.disabled?"":void 0,...r,ref:t,style:{pointerEvents:"none",...e.style}})})});Rw.displayName=Tw;var Ew="CheckboxBubbleInput",Aw=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:p}=Sp(Ew,e),j=He(n,p),v=Nw(l),b=kw(a);u.useEffect(()=>{const g=m;if(!g)return;const y=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(y,"checked").set,C=!r.current;if(v!==l&&N){const _=new Event("click",{bubbles:C});g.indeterminate=Ma(l),N.call(g,Ma(l)?!1:l),g.dispatchEvent(_)}},[m,v,l,r]);const x=u.useRef(Ma(l)?!1:l);return s.jsx(Ne.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,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Aw.displayName=Ew;function lM(e){return typeof e=="function"}function Ma(e){return e==="indeterminate"}function Mw(e){return Ma(e)?"indeterminate":e?"checked":"unchecked"}const Ul=u.forwardRef(({className:e,...t},n)=>s.jsx(Cp,{ref:n,className:se("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(Rw,{className:se("flex items-center justify-center text-current"),children:t.checked==="indeterminate"?s.jsx(ZT,{className:"size-4","aria-hidden":"true"}):s.jsx(Ol,{className:"size-4","aria-hidden":"true"})})}));Ul.displayName=Cp.displayName;const iM=yo("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 Jn({...e}){return s.jsx(cw,{"data-slot":"dialog",...e})}function oM({...e}){const t=wo();return s.jsx(uw,{"data-slot":"dialog-portal",container:t,...e})}function cM({className:e,...t}){return s.jsx(dw,{"data-slot":"dialog-overlay",className:se("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 es({className:e,children:t,showCloseButton:n=!0,size:a,...r}){return s.jsxs(oM,{"data-slot":"dialog-portal",children:[s.jsx(cM,{}),s.jsxs(fw,{"data-slot":"dialog-content",className:se(iM({size:a}),e),...r,children:[t,n&&s.jsxs(kp,{"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(Ju,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ts({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:se("flex flex-col gap-2 text-center sm:text-left",e),...t})}function ns({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-footer",className:se("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function ss({className:e,...t}){return s.jsx(hw,{"data-slot":"dialog-title",className:se("text-lg leading-none font-semibold",e),...t})}function as({className:e,...t}){return s.jsx(mw,{"data-slot":"dialog-description",className:se("text-muted-foreground text-sm",e),...t})}function Tp(e){const t=e+"CollectionProvider",[n,a]=Ns(t),[r,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:b,children:x}=v,g=ca.useRef(null),y=ca.useRef(new Map).current;return s.jsx(r,{scope:b,itemMap:y,collectionRef:g,children:x})};i.displayName=t;const o=e+"CollectionSlot",c=cr(o),d=ca.forwardRef((v,b)=>{const{scope:x,children:g}=v,y=l(o,x),w=He(b,y.collectionRef);return s.jsx(c,{ref:w,children:g})});d.displayName=o;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=cr(f),p=ca.forwardRef((v,b)=>{const{scope:x,children:g,...y}=v,w=ca.useRef(null),N=He(b,w),C=l(f,x);return ca.useEffect(()=>(C.itemMap.set(w,{ref:w,...y}),()=>void C.itemMap.delete(w))),s.jsx(m,{[h]:"",ref:N,children:g})});p.displayName=f;function j(v){const b=l(e+"CollectionConsumer",v);return ca.useCallback(()=>{const g=b.collectionRef.current;if(!g)return[];const y=Array.from(g.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((C,_)=>y.indexOf(C.ref.current)-y.indexOf(_.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:d,ItemSlot:p},j,a]}var uM=u.createContext(void 0);function od(e){const t=u.useContext(uM);return e||t||"ltr"}const dM=["top","right","bottom","left"],La=Math.min,dn=Math.max,hu=Math.round,ac=Math.floor,gs=e=>({x:e,y:e}),fM={left:"right",right:"left",bottom:"top",top:"bottom"},hM={start:"end",end:"start"};function Yh(e,t,n){return dn(e,La(t,n))}function Zs(e,t){return typeof e=="function"?e(t):e}function Ws(e){return e.split("-")[0]}function Bl(e){return e.split("-")[1]}function Rp(e){return e==="x"?"y":"x"}function Ep(e){return e==="y"?"height":"width"}function fs(e){return["top","bottom"].includes(Ws(e))?"y":"x"}function Ap(e){return Rp(fs(e))}function mM(e,t,n){n===void 0&&(n=!1);const a=Bl(e),r=Ap(e),l=Ep(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=mu(i)),[i,mu(i)]}function pM(e){const t=mu(e);return[Fh(e),t,Fh(t)]}function Fh(e){return e.replace(/start|end/g,t=>hM[t])}function xM(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 gM(e,t,n,a){const r=Bl(e);let l=xM(Ws(e),n==="start",a);return r&&(l=l.map(i=>i+"-"+r),t&&(l=l.concat(l.map(Fh)))),l}function mu(e){return e.replace(/left|right|bottom|top/g,t=>fM[t])}function vM(e){return{top:0,right:0,bottom:0,left:0,...e}}function $w(e){return typeof e!="number"?vM(e):{top:e,right:e,bottom:e,left:e}}function pu(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 jv(e,t,n){let{reference:a,floating:r}=e;const l=fs(t),i=Ap(t),o=Ep(i),c=Ws(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 p;switch(c){case"top":p={x:f,y:a.y-r.height};break;case"bottom":p={x:f,y:a.y+a.height};break;case"right":p={x:a.x+a.width,y:h};break;case"left":p={x:a.x-r.width,y:h};break;default:p={x:a.x,y:a.y}}switch(Bl(t)){case"start":p[i]-=m*(n&&d?-1:1);break;case"end":p[i]+=m*(n&&d?-1:1);break}return p}const yM=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}=jv(d,a,c),m=a,p={},j=0;for(let v=0;v<o.length;v++){const{name:b,fn:x}=o[v],{x:g,y,data:w,reset:N}=await x({x:f,y:h,initialPlacement:a,placement:m,strategy:r,middlewareData:p,rects:d,platform:i,elements:{reference:e,floating:t}});f=g??f,h=y??h,p={...p,[b]:{...p[b],...w}},N&&j<=50&&(j++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(d=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):N.rects),{x:f,y:h}=jv(d,m,c)),v=-1)}return{x:f,y:h,placement:m,strategy:r,middlewareData:p}};async function Gi(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:p=0}=Zs(t,e),j=$w(p),b=o[m?h==="floating"?"reference":"floating":h],x=pu(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(b)))==null||n?b:b.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(o.floating)),boundary:d,rootBoundary:f,strategy:c})),g=h==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,y=await(l.getOffsetParent==null?void 0:l.getOffsetParent(o.floating)),w=await(l.isElement==null?void 0:l.isElement(y))?await(l.getScale==null?void 0:l.getScale(y))||{x:1,y:1}:{x:1,y:1},N=pu(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:y,strategy:c}):g);return{top:(x.top-N.top+j.top)/w.y,bottom:(N.bottom-x.bottom+j.bottom)/w.y,left:(x.left-N.left+j.left)/w.x,right:(N.right-x.right+j.right)/w.x}}const bM=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}=Zs(e,t)||{};if(d==null)return{};const h=$w(f),m={x:n,y:a},p=Ap(r),j=Ep(p),v=await i.getDimensions(d),b=p==="y",x=b?"top":"left",g=b?"bottom":"right",y=b?"clientHeight":"clientWidth",w=l.reference[j]+l.reference[p]-m[p]-l.floating[j],N=m[p]-l.reference[p],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let _=C?C[y]:0;(!_||!await(i.isElement==null?void 0:i.isElement(C)))&&(_=o.floating[y]||l.floating[j]);const S=w/2-N/2,O=_/2-v[j]/2-1,D=La(h[x],O),I=La(h[g],O),P=D,M=_-v[j]-I,U=_/2-v[j]/2+S,R=Yh(P,U,M),T=!c.arrow&&Bl(r)!=null&&U!==R&&l.reference[j]/2-(U<P?D:I)-v[j]/2<0,E=T?U<P?U-P:U-M:0;return{[p]:m[p]+E,data:{[p]:R,centerOffset:U-R-E,...T&&{alignmentOffset:E}},reset:T}}}),jM=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:p="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:v=!0,...b}=Zs(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const x=Ws(r),g=fs(o),y=Ws(o)===o,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=m||(y||!v?[mu(o)]:pM(o)),C=j!=="none";!m&&C&&N.push(...gM(o,v,j,w));const _=[o,...N],S=await Gi(t,b),O=[];let D=((a=l.flip)==null?void 0:a.overflows)||[];if(f&&O.push(S[x]),h){const U=mM(r,i,w);O.push(S[U[0]],S[U[1]])}if(D=[...D,{placement:r,overflows:O}],!O.every(U=>U<=0)){var I,P;const U=(((I=l.flip)==null?void 0:I.index)||0)+1,R=_[U];if(R&&(!(h==="alignment"?g!==fs(R):!1)||D.every(k=>k.overflows[0]>0&&fs(k.placement)===g)))return{data:{index:U,overflows:D},reset:{placement:R}};let T=(P=D.filter(E=>E.overflows[0]<=0).sort((E,k)=>E.overflows[1]-k.overflows[1])[0])==null?void 0:P.placement;if(!T)switch(p){case"bestFit":{var M;const E=(M=D.filter(k=>{if(C){const $=fs(k.placement);return $===g||$==="y"}return!0}).map(k=>[k.placement,k.overflows.filter($=>$>0).reduce(($,V)=>$+V,0)]).sort((k,$)=>k[1]-$[1])[0])==null?void 0:M[0];E&&(T=E);break}case"initialPlacement":T=o;break}if(r!==T)return{reset:{placement:T}}}return{}}}};function wv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _v(e){return dM.some(t=>e[t]>=0)}const wM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...r}=Zs(e,t);switch(a){case"referenceHidden":{const l=await Gi(t,{...r,elementContext:"reference"}),i=wv(l,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:_v(i)}}}case"escaped":{const l=await Gi(t,{...r,altBoundary:!0}),i=wv(l,n.floating);return{data:{escapedOffsets:i,escaped:_v(i)}}}default:return{}}}}};async function _M(e,t){const{placement:n,platform:a,elements:r}=e,l=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=Ws(n),o=Bl(n),c=fs(n)==="y",d=["left","top"].includes(i)?-1:1,f=l&&c?-1:1,h=Zs(t,e);let{mainAxis:m,crossAxis:p,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"&&(p=o==="end"?j*-1:j),c?{x:p*f,y:m*d}:{x:m*d,y:p*f}}const NM=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 _M(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}}}}},kM=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:b=>{let{x,y:g}=b;return{x,y:g}}},...c}=Zs(e,t),d={x:n,y:a},f=await Gi(t,c),h=fs(Ws(r)),m=Rp(h);let p=d[m],j=d[h];if(l){const b=m==="y"?"top":"left",x=m==="y"?"bottom":"right",g=p+f[b],y=p-f[x];p=Yh(g,p,y)}if(i){const b=h==="y"?"top":"left",x=h==="y"?"bottom":"right",g=j+f[b],y=j-f[x];j=Yh(g,j,y)}const v=o.fn({...t,[m]:p,[h]:j});return{...v,data:{x:v.x-n,y:v.y-a,enabled:{[m]:l,[h]:i}}}}}},SM=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}=Zs(e,t),f={x:n,y:a},h=fs(r),m=Rp(h);let p=f[m],j=f[h];const v=Zs(o,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=m==="y"?"height":"width",w=l.reference[m]-l.floating[y]+b.mainAxis,N=l.reference[m]+l.reference[y]-b.mainAxis;p<w?p=w:p>N&&(p=N)}if(d){var x,g;const y=m==="y"?"width":"height",w=["top","left"].includes(Ws(r)),N=l.reference[h]-l.floating[y]+(w&&((x=i.offset)==null?void 0:x[h])||0)+(w?0:b.crossAxis),C=l.reference[h]+l.reference[y]+(w?0:((g=i.offset)==null?void 0:g[h])||0)-(w?b.crossAxis:0);j<N?j=N:j>C&&(j=C)}return{[m]:p,[h]:j}}}},CM=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}=Zs(e,t),f=await Gi(t,d),h=Ws(r),m=Bl(r),p=fs(r)==="y",{width:j,height:v}=l.floating;let b,x;h==="top"||h==="bottom"?(b=h,x=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(x=h,b=m==="end"?"top":"bottom");const g=v-f.top-f.bottom,y=j-f.left-f.right,w=La(v-f[b],g),N=La(j-f[x],y),C=!t.middlewareData.shift;let _=w,S=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=y),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(_=g),C&&!m){const D=dn(f.left,0),I=dn(f.right,0),P=dn(f.top,0),M=dn(f.bottom,0);p?S=j-2*(D!==0||I!==0?D+I:dn(f.left,f.right)):_=v-2*(P!==0||M!==0?P+M:dn(f.top,f.bottom))}await c({...t,availableWidth:S,availableHeight:_});const O=await i.getDimensions(o.floating);return j!==O.width||v!==O.height?{reset:{rects:!0}}:{}}}};function cd(){return typeof window<"u"}function Hl(e){return Ow(e)?(e.nodeName||"").toLowerCase():"#document"}function gn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ks(e){var t;return(t=(Ow(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ow(e){return cd()?e instanceof Node||e instanceof gn(e).Node:!1}function Xn(e){return cd()?e instanceof Element||e instanceof gn(e).Element:!1}function bs(e){return cd()?e instanceof HTMLElement||e instanceof gn(e).HTMLElement:!1}function Nv(e){return!cd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof gn(e).ShadowRoot}function No(e){const{overflow:t,overflowX:n,overflowY:a,display:r}=Kn(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(r)}function TM(e){return["table","td","th"].includes(Hl(e))}function ud(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Mp(e){const t=$p(),n=Xn(e)?Kn(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 RM(e){let t=Ua(e);for(;bs(t)&&!wl(t);){if(Mp(t))return t;if(ud(t))return null;t=Ua(t)}return null}function $p(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function wl(e){return["html","body","#document"].includes(Hl(e))}function Kn(e){return gn(e).getComputedStyle(e)}function dd(e){return Xn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ua(e){if(Hl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Nv(e)&&e.host||ks(e);return Nv(t)?t.host:t}function Dw(e){const t=Ua(e);return wl(t)?e.ownerDocument?e.ownerDocument.body:e.body:bs(t)&&No(t)?t:Dw(t)}function Vi(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Dw(e),l=r===((a=e.ownerDocument)==null?void 0:a.body),i=gn(r);if(l){const o=Xh(i);return t.concat(i,i.visualViewport||[],No(r)?r:[],o&&n?Vi(o):[])}return t.concat(r,Vi(r,[],n))}function Xh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function zw(e){const t=Kn(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=bs(e),l=r?e.offsetWidth:n,i=r?e.offsetHeight:a,o=hu(n)!==l||hu(a)!==i;return o&&(n=l,a=i),{width:n,height:a,$:o}}function Op(e){return Xn(e)?e:e.contextElement}function ll(e){const t=Op(e);if(!bs(t))return gs(1);const n=t.getBoundingClientRect(),{width:a,height:r,$:l}=zw(t);let i=(l?hu(n.width):n.width)/a,o=(l?hu(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const EM=gs(0);function Lw(e){const t=gn(e);return!$p()||!t.visualViewport?EM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function AM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==gn(e)?!1:t}function dr(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),l=Op(e);let i=gs(1);t&&(a?Xn(a)&&(i=ll(a)):i=ll(e));const o=AM(l,n,a)?Lw(l):gs(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=gn(l),p=a&&Xn(a)?gn(a):a;let j=m,v=Xh(j);for(;v&&a&&p!==j;){const b=ll(v),x=v.getBoundingClientRect(),g=Kn(v),y=x.left+(v.clientLeft+parseFloat(g.paddingLeft))*b.x,w=x.top+(v.clientTop+parseFloat(g.paddingTop))*b.y;c*=b.x,d*=b.y,f*=b.x,h*=b.y,c+=y,d+=w,j=gn(v),v=Xh(j)}}return pu({width:f,height:h,x:c,y:d})}function Dp(e,t){const n=dd(e).scrollLeft;return t?t.left+n:dr(ks(e)).left+n}function Uw(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),r=a.left+t.scrollLeft-(n?0:Dp(e,a)),l=a.top+t.scrollTop;return{x:r,y:l}}function MM(e){let{elements:t,rect:n,offsetParent:a,strategy:r}=e;const l=r==="fixed",i=ks(a),o=t?ud(t.floating):!1;if(a===i||o&&l)return n;let c={scrollLeft:0,scrollTop:0},d=gs(1);const f=gs(0),h=bs(a);if((h||!h&&!l)&&((Hl(a)!=="body"||No(i))&&(c=dd(a)),bs(a))){const p=dr(a);d=ll(a),f.x=p.x+a.clientLeft,f.y=p.y+a.clientTop}const m=i&&!h&&!l?Uw(i,c,!0):gs(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 $M(e){return Array.from(e.getClientRects())}function OM(e){const t=ks(e),n=dd(e),a=e.ownerDocument.body,r=dn(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),l=dn(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+Dp(e);const o=-n.scrollTop;return Kn(a).direction==="rtl"&&(i+=dn(t.clientWidth,a.clientWidth)-r),{width:r,height:l,x:i,y:o}}function DM(e,t){const n=gn(e),a=ks(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=$p();(!d||d&&t==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}return{width:l,height:i,x:o,y:c}}function zM(e,t){const n=dr(e,!0,t==="fixed"),a=n.top+e.clientTop,r=n.left+e.clientLeft,l=bs(e)?ll(e):gs(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 kv(e,t,n){let a;if(t==="viewport")a=DM(e,n);else if(t==="document")a=OM(ks(e));else if(Xn(t))a=zM(t,n);else{const r=Lw(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return pu(a)}function Bw(e,t){const n=Ua(e);return n===t||!Xn(n)||wl(n)?!1:Kn(n).position==="fixed"||Bw(n,t)}function LM(e,t){const n=t.get(e);if(n)return n;let a=Vi(e,[],!1).filter(o=>Xn(o)&&Hl(o)!=="body"),r=null;const l=Kn(e).position==="fixed";let i=l?Ua(e):e;for(;Xn(i)&&!wl(i);){const o=Kn(i),c=Mp(i);!c&&o.position==="fixed"&&(r=null),(l?!c&&!r:!c&&o.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||No(i)&&!c&&Bw(e,i))?a=a.filter(f=>f!==i):r=o,i=Ua(i)}return t.set(e,a),a}function UM(e){let{element:t,boundary:n,rootBoundary:a,strategy:r}=e;const i=[...n==="clippingAncestors"?ud(t)?[]:LM(t,this._c):[].concat(n),a],o=i[0],c=i.reduce((d,f)=>{const h=kv(t,f,r);return d.top=dn(h.top,d.top),d.right=La(h.right,d.right),d.bottom=La(h.bottom,d.bottom),d.left=dn(h.left,d.left),d},kv(t,o,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function BM(e){const{width:t,height:n}=zw(e);return{width:t,height:n}}function HM(e,t,n){const a=bs(t),r=ks(t),l=n==="fixed",i=dr(e,!0,l,t);let o={scrollLeft:0,scrollTop:0};const c=gs(0);function d(){c.x=Dp(r)}if(a||!a&&!l)if((Hl(t)!=="body"||No(r))&&(o=dd(t)),a){const p=dr(t,!0,l,t);c.x=p.x+t.clientLeft,c.y=p.y+t.clientTop}else r&&d();l&&!a&&r&&d();const f=r&&!a&&!l?Uw(r,o):gs(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 Sf(e){return Kn(e).position==="static"}function Sv(e,t){if(!bs(e)||Kn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ks(e)===n&&(n=n.ownerDocument.body),n}function Hw(e,t){const n=gn(e);if(ud(e))return n;if(!bs(e)){let r=Ua(e);for(;r&&!wl(r);){if(Xn(r)&&!Sf(r))return r;r=Ua(r)}return n}let a=Sv(e,t);for(;a&&TM(a)&&Sf(a);)a=Sv(a,t);return a&&wl(a)&&Sf(a)&&!Mp(a)?n:a||RM(e)||n}const IM=async function(e){const t=this.getOffsetParent||Hw,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 PM(e){return Kn(e).direction==="rtl"}const qM={convertOffsetParentRelativeRectToViewportRelativeRect:MM,getDocumentElement:ks,getClippingRect:UM,getOffsetParent:Hw,getElementRects:IM,getClientRects:$M,getDimensions:BM,getScale:ll,isElement:Xn,isRTL:PM};function Iw(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=ks(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:p}=d;if(o||t(),!m||!p)return;const j=ac(h),v=ac(r.clientWidth-(f+m)),b=ac(r.clientHeight-(h+p)),x=ac(f),y={rootMargin:-j+"px "+-v+"px "+-b+"px "+-x+"px",threshold:dn(0,La(1,c))||1};let w=!0;function N(C){const _=C[0].intersectionRatio;if(_!==c){if(!w)return i();_?i(!1,_):a=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!Iw(d,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(N,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(N,y)}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=Op(e),f=r||l?[...d?Vi(d):[],...Vi(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,p=null;i&&(p=new ResizeObserver(x=>{let[g]=x;g&&g.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),d&&!c&&p.observe(d),p.observe(t));let j,v=c?dr(e):null;c&&b();function b(){const x=dr(e);v&&!Iw(v,x)&&n(),v=x,j=requestAnimationFrame(b)}return n(),()=>{var x;f.forEach(g=>{r&&g.removeEventListener("scroll",n),l&&g.removeEventListener("resize",n)}),h==null||h(),(x=p)==null||x.disconnect(),p=null,c&&cancelAnimationFrame(j)}}const YM=NM,FM=kM,XM=jM,KM=CM,QM=wM,Cv=bM,ZM=SM,WM=(e,t,n)=>{const a=new Map,r={platform:qM,...n},l={...r.platform,_c:a};return yM(e,t,{...r,platform:l})};var JM=typeof document<"u",e4=function(){},Tc=JM?u.useLayoutEffect:e4;function xu(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(!xu(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)&&!xu(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function Pw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Tv(e,t){const n=Pw(e);return Math.round(t*n)/n}function Cf(e){const t=u.useRef(e);return Tc(()=>{t.current=e}),t}function t4(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,p]=u.useState(a);xu(m,a)||p(a);const[j,v]=u.useState(null),[b,x]=u.useState(null),g=u.useCallback(k=>{k!==C.current&&(C.current=k,v(k))},[]),y=u.useCallback(k=>{k!==_.current&&(_.current=k,x(k))},[]),w=l||j,N=i||b,C=u.useRef(null),_=u.useRef(null),S=u.useRef(f),O=c!=null,D=Cf(c),I=Cf(r),P=Cf(d),M=u.useCallback(()=>{if(!C.current||!_.current)return;const k={placement:t,strategy:n,middleware:m};I.current&&(k.platform=I.current),WM(C.current,_.current,k).then($=>{const V={...$,isPositioned:P.current!==!1};U.current&&!xu(S.current,V)&&(S.current=V,Sl.flushSync(()=>{h(V)}))})},[m,t,n,I,P]);Tc(()=>{d===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,h(k=>({...k,isPositioned:!1})))},[d]);const U=u.useRef(!1);Tc(()=>(U.current=!0,()=>{U.current=!1}),[]),Tc(()=>{if(w&&(C.current=w),N&&(_.current=N),w&&N){if(D.current)return D.current(w,N,M);M()}},[w,N,M,D,O]);const R=u.useMemo(()=>({reference:C,floating:_,setReference:g,setFloating:y}),[g,y]),T=u.useMemo(()=>({reference:w,floating:N}),[w,N]),E=u.useMemo(()=>{const k={position:n,left:0,top:0};if(!T.floating)return k;const $=Tv(T.floating,f.x),V=Tv(T.floating,f.y);return o?{...k,transform:"translate("+$+"px, "+V+"px)",...Pw(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:V}},[n,o,T.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:M,refs:R,elements:T,floatingStyles:E}),[f,M,R,T,E])}const n4=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?Cv({element:a.current,padding:r}).fn(n):{}:a?Cv({element:a,padding:r}).fn(n):{}}}},s4=(e,t)=>({...YM(e),options:[e,t]}),a4=(e,t)=>({...FM(e),options:[e,t]}),r4=(e,t)=>({...ZM(e),options:[e,t]}),l4=(e,t)=>({...XM(e),options:[e,t]}),i4=(e,t)=>({...KM(e),options:[e,t]}),o4=(e,t)=>({...QM(e),options:[e,t]}),c4=(e,t)=>({...n4(e),options:[e,t]});var u4="Arrow",qw=u.forwardRef((e,t)=>{const{children:n,width:a=10,height:r=5,...l}=e;return s.jsx(Ne.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"})})});qw.displayName=u4;var d4=qw,zp="Popper",[Gw,Il]=Ns(zp),[f4,Vw]=Gw(zp),Yw=e=>{const{__scopePopper:t,children:n}=e,[a,r]=u.useState(null);return s.jsx(f4,{scope:t,anchor:a,onAnchorChange:r,children:n})};Yw.displayName=zp;var Fw="PopperAnchor",Xw=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...r}=e,l=Vw(Fw,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(Ne.div,{...r,ref:o})});Xw.displayName=Fw;var Lp="PopperContent",[h4,m4]=Gw(Lp),Kw=u.forwardRef((e,t)=>{var z,X,te,he,pe,re;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:p="optimized",onPlaced:j,...v}=e,b=Vw(Lp,n),[x,g]=u.useState(null),y=He(t,ve=>g(ve)),[w,N]=u.useState(null),C=kw(w),_=(C==null?void 0:C.width)??0,S=(C==null?void 0:C.height)??0,O=a+(l!=="center"?"-"+l:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},I=Array.isArray(d)?d:[d],P=I.length>0,M={padding:D,boundary:I.filter(x4),altBoundary:P},{refs:U,floatingStyles:R,placement:T,isPositioned:E,middlewareData:k}=t4({strategy:"fixed",placement:O,whileElementsMounted:(...ve)=>VM(...ve,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[s4({mainAxis:r+S,alignmentAxis:i}),c&&a4({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?r4():void 0,...M}),c&&l4({...M}),i4({...M,apply:({elements:ve,rects:ee,availableWidth:ht,availableHeight:de})=>{const{width:Ie,height:K}=ee.reference,ke=ve.floating.style;ke.setProperty("--radix-popper-available-width",`${ht}px`),ke.setProperty("--radix-popper-available-height",`${de}px`),ke.setProperty("--radix-popper-anchor-width",`${Ie}px`),ke.setProperty("--radix-popper-anchor-height",`${K}px`)}}),w&&c4({element:w,padding:o}),g4({arrowWidth:_,arrowHeight:S}),m&&o4({strategy:"referenceHidden",...M})]}),[$,V]=Ww(T),A=ys(j);qt(()=>{E&&(A==null||A())},[E,A]);const G=(z=k.arrow)==null?void 0:z.x,W=(X=k.arrow)==null?void 0:X.y,Z=((te=k.arrow)==null?void 0:te.centerOffset)!==0,[ge,Y]=u.useState();return qt(()=>{x&&Y(window.getComputedStyle(x).zIndex)},[x]),s.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:E?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(he=k.transformOrigin)==null?void 0:he.x,(pe=k.transformOrigin)==null?void 0:pe.y].join(" "),...((re=k.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(h4,{scope:n,placedSide:$,onArrowChange:N,arrowX:G,arrowY:W,shouldHideArrow:Z,children:s.jsx(Ne.div,{"data-side":$,"data-align":V,...v,ref:y,style:{...v.style,animation:E?void 0:"none"}})})})});Kw.displayName=Lp;var Qw="PopperArrow",p4={top:"bottom",right:"left",bottom:"top",left:"right"},Zw=u.forwardRef(function(t,n){const{__scopePopper:a,...r}=t,l=m4(Qw,a),i=p4[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(d4,{...r,ref:n,style:{...r.style,display:"block"}})})});Zw.displayName=Qw;function x4(e){return e!==null}var g4=e=>({name:"transformOrigin",options:e,fn(t){var b,x,g;const{placement:n,rects:a,middlewareData:r}=t,i=((b=r.arrow)==null?void 0:b.centerOffset)!==0,o=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=Ww(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((x=r.arrow)==null?void 0:x.x)??0)+o/2,p=(((g=r.arrow)==null?void 0:g.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:`${p}px`):d==="left"&&(j=`${a.floating.width+c}px`,v=i?h:`${p}px`),{data:{x:j,y:v}}}});function Ww(e){const[t,n="center"]=e.split("-");return[t,n]}var Up=Yw,Bp=Xw,Hp=Kw,Ip=Zw,Tf="rovingFocusGroup.onEntryFocus",v4={bubbles:!1,cancelable:!0},ko="RovingFocusGroup",[Kh,Jw,y4]=Tp(ko),[b4,fd]=Ns(ko,[y4]),[j4,w4]=b4(ko),e_=u.forwardRef((e,t)=>s.jsx(Kh.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Kh.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(_4,{...e,ref:t})})}));e_.displayName=ko;var _4=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),p=He(t,m),j=od(l),[v,b]=za({prop:i,defaultProp:o??null,onChange:c,caller:ko}),[x,g]=u.useState(!1),y=ys(d),w=Jw(n),N=u.useRef(!1),[C,_]=u.useState(0);return u.useEffect(()=>{const S=m.current;if(S)return S.addEventListener(Tf,y),()=>S.removeEventListener(Tf,y)},[y]),s.jsx(j4,{scope:n,orientation:a,dir:j,loop:r,currentTabStopId:v,onItemFocus:u.useCallback(S=>b(S),[b]),onItemShiftTab:u.useCallback(()=>g(!0),[]),onFocusableItemAdd:u.useCallback(()=>_(S=>S+1),[]),onFocusableItemRemove:u.useCallback(()=>_(S=>S-1),[]),children:s.jsx(Ne.div,{tabIndex:x||C===0?-1:0,"data-orientation":a,...h,ref:p,style:{outline:"none",...e.style},onMouseDown:ae(e.onMouseDown,()=>{N.current=!0}),onFocus:ae(e.onFocus,S=>{const O=!N.current;if(S.target===S.currentTarget&&O&&!x){const D=new CustomEvent(Tf,v4);if(S.currentTarget.dispatchEvent(D),!D.defaultPrevented){const I=w().filter(T=>T.focusable),P=I.find(T=>T.active),M=I.find(T=>T.id===v),R=[P,M,...I].filter(Boolean).map(T=>T.ref.current);s_(R,f)}}N.current=!1}),onBlur:ae(e.onBlur,()=>g(!1))})})}),t_="RovingFocusGroupItem",n_=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:r=!1,tabStopId:l,children:i,...o}=e,c=Vn(),d=l||c,f=w4(t_,n),h=f.currentTabStopId===d,m=Jw(n),{onFocusableItemAdd:p,onFocusableItemRemove:j,currentTabStopId:v}=f;return u.useEffect(()=>{if(a)return p(),()=>j()},[a,p,j]),s.jsx(Kh.ItemSlot,{scope:n,id:d,focusable:a,active:r,children:s.jsx(Ne.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:ae(e.onMouseDown,b=>{a?f.onItemFocus(d):b.preventDefault()}),onFocus:ae(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:ae(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){f.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=S4(b,f.orientation,f.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let y=m().filter(w=>w.focusable).map(w=>w.ref.current);if(x==="last")y.reverse();else if(x==="prev"||x==="next"){x==="prev"&&y.reverse();const w=y.indexOf(b.currentTarget);y=f.loop?C4(y,w+1):y.slice(w+1)}setTimeout(()=>s_(y))}}),children:typeof i=="function"?i({isCurrentTabStop:h,hasTabStop:v!=null}):i})})});n_.displayName=t_;var N4={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function k4(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function S4(e,t,n){const a=k4(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return N4[a]}function s_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function C4(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var a_=e_,r_=n_,Qh=["Enter"," "],T4=["ArrowDown","PageUp","Home"],l_=["ArrowUp","PageDown","End"],R4=[...T4,...l_],E4={ltr:[...Qh,"ArrowRight"],rtl:[...Qh,"ArrowLeft"]},A4={ltr:["ArrowLeft"],rtl:["ArrowRight"]},So="Menu",[Yi,M4,$4]=Tp(So),[yr,i_]=Ns(So,[$4,Il,fd]),hd=Il(),o_=fd(),[O4,br]=yr(So),[D4,Co]=yr(So),c_=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:r,onOpenChange:l,modal:i=!0}=e,o=hd(t),[c,d]=u.useState(null),f=u.useRef(!1),h=ys(l),m=od(r);return u.useEffect(()=>{const p=()=>{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",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Up,{...o,children:s.jsx(O4,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:s.jsx(D4,{scope:t,onClose:u.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:i,children:a})})})};c_.displayName=So;var z4="MenuAnchor",Pp=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=hd(n);return s.jsx(Bp,{...r,...a,ref:t})});Pp.displayName=z4;var qp="MenuPortal",[L4,u_]=yr(qp,{forceMount:void 0}),d_=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:r}=e,l=br(qp,t);return s.jsx(L4,{scope:t,forceMount:n,children:s.jsx(On,{present:n||l.open,children:s.jsx(jo,{asChild:!0,container:r,children:a})})})};d_.displayName=qp;var Rn="MenuContent",[U4,Gp]=yr(Rn),f_=u.forwardRef((e,t)=>{const n=u_(Rn,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,l=br(Rn,e.__scopeMenu),i=Co(Rn,e.__scopeMenu);return s.jsx(Yi.Provider,{scope:e.__scopeMenu,children:s.jsx(On,{present:a||l.open,children:s.jsx(Yi.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx(B4,{...r,ref:t}):s.jsx(H4,{...r,ref:t})})})})}),B4=u.forwardRef((e,t)=>{const n=br(Rn,e.__scopeMenu),a=u.useRef(null),r=He(t,a);return u.useEffect(()=>{const l=a.current;if(l)return jp(l)},[]),s.jsx(Vp,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ae(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),H4=u.forwardRef((e,t)=>{const n=br(Rn,e.__scopeMenu);return s.jsx(Vp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),I4=cr("MenuContent.ScrollLock"),Vp=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:p,disableOutsideScroll:j,...v}=e,b=br(Rn,n),x=Co(Rn,n),g=hd(n),y=o_(n),w=M4(n),[N,C]=u.useState(null),_=u.useRef(null),S=He(t,_,b.onContentChange),O=u.useRef(0),D=u.useRef(""),I=u.useRef(0),P=u.useRef(null),M=u.useRef("right"),U=u.useRef(0),R=j?ad:u.Fragment,T=j?{as:I4,allowPinchZoom:!0}:void 0,E=$=>{var z,X;const V=D.current+$,A=w().filter(te=>!te.disabled),G=document.activeElement,W=(z=A.find(te=>te.ref.current===G))==null?void 0:z.textValue,Z=A.map(te=>te.textValue),ge=J4(Z,V,W),Y=(X=A.find(te=>te.textValue===ge))==null?void 0:X.ref.current;(function te(he){D.current=he,window.clearTimeout(O.current),he!==""&&(O.current=window.setTimeout(()=>te(""),1e3))})(V),Y&&setTimeout(()=>Y.focus())};u.useEffect(()=>()=>window.clearTimeout(O.current),[]),bp();const k=u.useCallback($=>{var A,G;return M.current===((A=P.current)==null?void 0:A.side)&&t$($,(G=P.current)==null?void 0:G.area)},[]);return s.jsx(U4,{scope:n,searchRef:D,onItemEnter:u.useCallback($=>{k($)&&$.preventDefault()},[k]),onItemLeave:u.useCallback($=>{var V;k($)||((V=_.current)==null||V.focus(),C(null))},[k]),onTriggerLeave:u.useCallback($=>{k($)&&$.preventDefault()},[k]),pointerGraceTimerRef:I,onPointerGraceIntentChange:u.useCallback($=>{P.current=$},[]),children:s.jsx(R,{...T,children:s.jsx(nd,{asChild:!0,trapped:r,onMountAutoFocus:ae(l,$=>{var V;$.preventDefault(),(V=_.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(bo,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:p,children:s.jsx(a_,{asChild:!0,...y,dir:x.dir,orientation:"vertical",loop:a,currentTabStopId:N,onCurrentTabStopIdChange:C,onEntryFocus:ae(c,$=>{x.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Hp,{role:"menu","aria-orientation":"vertical","data-state":T_(b.open),"data-radix-menu-content":"",dir:x.dir,...g,...v,ref:S,style:{outline:"none",...v.style},onKeyDown:ae(v.onKeyDown,$=>{const A=$.target.closest("[data-radix-menu-content]")===$.currentTarget,G=$.ctrlKey||$.altKey||$.metaKey,W=$.key.length===1;A&&($.key==="Tab"&&$.preventDefault(),!G&&W&&E($.key));const Z=_.current;if($.target!==Z||!R4.includes($.key))return;$.preventDefault();const Y=w().filter(z=>!z.disabled).map(z=>z.ref.current);l_.includes($.key)&&Y.reverse(),Z4(Y)}),onBlur:ae(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(O.current),D.current="")}),onPointerMove:ae(e.onPointerMove,Fi($=>{const V=$.target,A=U.current!==$.clientX;if($.currentTarget.contains(V)&&A){const G=$.clientX>U.current?"right":"left";M.current=G,U.current=$.clientX}}))})})})})})})});f_.displayName=Rn;var P4="MenuGroup",Yp=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Ne.div,{role:"group",...a,ref:t})});Yp.displayName=P4;var q4="MenuLabel",h_=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Ne.div,{...a,ref:t})});h_.displayName=q4;var gu="MenuItem",Rv="menu.itemSelect",md=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...r}=e,l=u.useRef(null),i=Co(gu,e.__scopeMenu),o=Gp(gu,e.__scopeMenu),c=He(t,l),d=u.useRef(!1),f=()=>{const h=l.current;if(!n&&h){const m=new CustomEvent(Rv,{bubbles:!0,cancelable:!0});h.addEventListener(Rv,p=>a==null?void 0:a(p),{once:!0}),z0(h,m),m.defaultPrevented?d.current=!1:i.onClose()}};return s.jsx(m_,{...r,ref:c,disabled:n,onClick:ae(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:ae(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:ae(e.onKeyDown,h=>{const m=o.searchRef.current!=="";n||m&&h.key===" "||Qh.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});md.displayName=gu;var m_=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:r,...l}=e,i=Gp(gu,n),o=o_(n),c=u.useRef(null),d=He(t,c),[f,h]=u.useState(!1),[m,p]=u.useState("");return u.useEffect(()=>{const j=c.current;j&&p((j.textContent??"").trim())},[l.children]),s.jsx(Yi.ItemSlot,{scope:n,disabled:a,textValue:r??m,children:s.jsx(r_,{asChild:!0,...o,focusable:!a,children:s.jsx(Ne.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...l,ref:d,onPointerMove:ae(e.onPointerMove,Fi(j=>{a?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ae(e.onPointerLeave,Fi(j=>i.onItemLeave(j))),onFocus:ae(e.onFocus,()=>h(!0)),onBlur:ae(e.onBlur,()=>h(!1))})})})}),G4="MenuCheckboxItem",p_=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...r}=e;return s.jsx(b_,{scope:e.__scopeMenu,checked:n,children:s.jsx(md,{role:"menuitemcheckbox","aria-checked":vu(n)?"mixed":n,...r,ref:t,"data-state":Xp(n),onSelect:ae(r.onSelect,()=>a==null?void 0:a(vu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});p_.displayName=G4;var x_="MenuRadioGroup",[V4,Y4]=yr(x_,{value:void 0,onValueChange:()=>{}}),g_=u.forwardRef((e,t)=>{const{value:n,onValueChange:a,...r}=e,l=ys(a);return s.jsx(V4,{scope:e.__scopeMenu,value:n,onValueChange:l,children:s.jsx(Yp,{...r,ref:t})})});g_.displayName=x_;var v_="MenuRadioItem",y_=u.forwardRef((e,t)=>{const{value:n,...a}=e,r=Y4(v_,e.__scopeMenu),l=n===r.value;return s.jsx(b_,{scope:e.__scopeMenu,checked:l,children:s.jsx(md,{role:"menuitemradio","aria-checked":l,...a,ref:t,"data-state":Xp(l),onSelect:ae(a.onSelect,()=>{var i;return(i=r.onValueChange)==null?void 0:i.call(r,n)},{checkForDefaultPrevented:!1})})})});y_.displayName=v_;var Fp="MenuItemIndicator",[b_,F4]=yr(Fp,{checked:!1}),j_=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...r}=e,l=F4(Fp,n);return s.jsx(On,{present:a||vu(l.checked)||l.checked===!0,children:s.jsx(Ne.span,{...r,ref:t,"data-state":Xp(l.checked)})})});j_.displayName=Fp;var X4="MenuSeparator",w_=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});w_.displayName=X4;var K4="MenuArrow",__=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,r=hd(n);return s.jsx(Ip,{...r,...a,ref:t})});__.displayName=K4;var Q4="MenuSub",[G5,N_]=yr(Q4),ii="MenuSubTrigger",k_=u.forwardRef((e,t)=>{const n=br(ii,e.__scopeMenu),a=Co(ii,e.__scopeMenu),r=N_(ii,e.__scopeMenu),l=Gp(ii,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(Pp,{asChild:!0,...d,children:s.jsx(m_,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":T_(n.open),...e,ref:td(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:ae(e.onPointerMove,Fi(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:ae(e.onPointerLeave,Fi(h=>{var p,j;f();const m=(p=n.content)==null?void 0:p.getBoundingClientRect();if(m){const v=(j=n.content)==null?void 0:j.dataset.side,b=v==="right",x=b?-5:5,g=m[b?"left":"right"],y=m[b?"right":"left"];l.onPointerGraceIntentChange({area:[{x:h.clientX+x,y:h.clientY},{x:g,y:m.top},{x:y,y:m.top},{x:y,y:m.bottom},{x:g,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:ae(e.onKeyDown,h=>{var p;const m=l.searchRef.current!=="";e.disabled||m&&h.key===" "||E4[a.dir].includes(h.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),h.preventDefault())})})})});k_.displayName=ii;var S_="MenuSubContent",C_=u.forwardRef((e,t)=>{const n=u_(Rn,e.__scopeMenu),{forceMount:a=n.forceMount,...r}=e,l=br(Rn,e.__scopeMenu),i=Co(Rn,e.__scopeMenu),o=N_(S_,e.__scopeMenu),c=u.useRef(null),d=He(t,c);return s.jsx(Yi.Provider,{scope:e.__scopeMenu,children:s.jsx(On,{present:a||l.open,children:s.jsx(Yi.Slot,{scope:e.__scopeMenu,children:s.jsx(Vp,{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:ae(e.onFocusOutside,f=>{f.target!==o.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:ae(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:ae(e.onKeyDown,f=>{var p;const h=f.currentTarget.contains(f.target),m=A4[i.dir].includes(f.key);h&&m&&(l.onOpenChange(!1),(p=o.trigger)==null||p.focus(),f.preventDefault())})})})})})});C_.displayName=S_;function T_(e){return e?"open":"closed"}function vu(e){return e==="indeterminate"}function Xp(e){return vu(e)?"indeterminate":e?"checked":"unchecked"}function Z4(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function W4(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function J4(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=W4(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 e$(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 t$(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return e$(n,t)}function Fi(e){return t=>t.pointerType==="mouse"?e(t):void 0}var n$=c_,s$=Pp,a$=d_,r$=f_,l$=Yp,i$=h_,o$=md,c$=p_,u$=g_,d$=y_,f$=j_,h$=w_,m$=__,p$=k_,x$=C_,pd="DropdownMenu",[g$]=Ns(pd,[i_]),Xt=i_(),[v$,R_]=g$(pd),E_=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:r,defaultOpen:l,onOpenChange:i,modal:o=!0}=e,c=Xt(t),d=u.useRef(null),[f,h]=za({prop:r,defaultProp:l??!1,onChange:i,caller:pd});return s.jsx(v$,{scope:t,triggerId:Vn(),triggerRef:d,contentId:Vn(),open:f,onOpenChange:h,onOpenToggle:u.useCallback(()=>h(m=>!m),[h]),modal:o,children:s.jsx(n$,{...c,open:f,onOpenChange:h,dir:a,modal:o,children:n})})};E_.displayName=pd;var A_="DropdownMenuTrigger",M_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...r}=e,l=R_(A_,n),i=Xt(n);return s.jsx(s$,{asChild:!0,...i,children:s.jsx(Ne.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:td(t,l.triggerRef),onPointerDown:ae(e.onPointerDown,o=>{!a&&o.button===0&&o.ctrlKey===!1&&(l.onOpenToggle(),l.open||o.preventDefault())}),onKeyDown:ae(e.onKeyDown,o=>{a||(["Enter"," "].includes(o.key)&&l.onOpenToggle(),o.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});M_.displayName=A_;var y$="DropdownMenuPortal",$_=e=>{const{__scopeDropdownMenu:t,...n}=e,a=Xt(t);return s.jsx(a$,{...a,...n})};$_.displayName=y$;var O_="DropdownMenuContent",D_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=R_(O_,n),l=Xt(n),i=u.useRef(!1);return s.jsx(r$,{id:r.contentId,"aria-labelledby":r.triggerId,...l,...a,ref:t,onCloseAutoFocus:ae(e.onCloseAutoFocus,o=>{var c;i.current||(c=r.triggerRef.current)==null||c.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:ae(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)"}})});D_.displayName=O_;var b$="DropdownMenuGroup",j$=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(l$,{...r,...a,ref:t})});j$.displayName=b$;var w$="DropdownMenuLabel",z_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(i$,{...r,...a,ref:t})});z_.displayName=w$;var _$="DropdownMenuItem",L_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(o$,{...r,...a,ref:t})});L_.displayName=_$;var N$="DropdownMenuCheckboxItem",U_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(c$,{...r,...a,ref:t})});U_.displayName=N$;var k$="DropdownMenuRadioGroup",S$=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(u$,{...r,...a,ref:t})});S$.displayName=k$;var C$="DropdownMenuRadioItem",B_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(d$,{...r,...a,ref:t})});B_.displayName=C$;var T$="DropdownMenuItemIndicator",H_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(f$,{...r,...a,ref:t})});H_.displayName=T$;var R$="DropdownMenuSeparator",I_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(h$,{...r,...a,ref:t})});I_.displayName=R$;var E$="DropdownMenuArrow",A$=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(m$,{...r,...a,ref:t})});A$.displayName=E$;var M$="DropdownMenuSubTrigger",P_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(p$,{...r,...a,ref:t})});P_.displayName=M$;var $$="DropdownMenuSubContent",q_=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,r=Xt(n);return s.jsx(x$,{...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)"}})});q_.displayName=$$;var O$=E_,D$=M_,z$=$_,G_=D_,V_=z_,Y_=L_,F_=U_,X_=B_,K_=H_,Q_=I_,Z_=P_,W_=q_;const xd=O$,gd=D$,L$=u.forwardRef(({className:e,inset:t,children:n,...a},r)=>s.jsxs(Z_,{ref:r,className:se("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(p0,{className:"ml-auto"})]}));L$.displayName=Z_.displayName;const U$=u.forwardRef(({className:e,...t},n)=>s.jsx(W_,{ref:n,className:se("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}));U$.displayName=W_.displayName;const To=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>s.jsx(z$,{container:wo(),children:s.jsx(G_,{ref:a,sideOffset:t,className:se("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})}));To.displayName=G_.displayName;const _l=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(Y_,{ref:a,className:se("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}));_l.displayName=Y_.displayName;const B$=u.forwardRef(({className:e,children:t,checked:n,...a},r)=>s.jsxs(F_,{ref:r,className:se("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(K_,{children:s.jsx(Ol,{className:"h-4 w-4"})})}),t]}));B$.displayName=F_.displayName;const H$=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(X_,{ref:a,className:se("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(K_,{children:s.jsx(hT,{className:"h-2 w-2 fill-current"})})}),t]}));H$.displayName=X_.displayName;const I$=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(V_,{ref:a,className:se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));I$.displayName=V_.displayName;const P$=u.forwardRef(({className:e,...t},n)=>s.jsx(Q_,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));P$.displayName=Q_.displayName;const q$={default:"h-9 px-3 py-1 text-sm",control:"h-7 px-2 py-1 text-xs"},St=u.forwardRef(({className:e,type:t,inputSize:n="default",...a},r)=>s.jsx("input",{type:t,className:se("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",q$[n],e),ref:r,...a}));St.displayName="Input";var G$="Label",J_=u.forwardRef((e,t)=>s.jsx(Ne.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())}}));J_.displayName=G$;var eN=J_;const V$=yo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Me=u.forwardRef(({className:e,...t},n)=>s.jsx(eN,{ref:n,className:se(V$(),e),...t}));Me.displayName=eN.displayName;function ta({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:se("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:se("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 Gt({title:e,description:t,actions:n,className:a,children:r,...l}){return s.jsxs("header",{"data-slot":"page-header",className:se("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 jt({as:e="div",className:t,...n}){return s.jsx(e,{className:se("rounded-lg border",t),...n})}function Ev(e,[t,n]){return Math.min(n,Math.max(t,e))}var tN=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"}),Y$="VisuallyHidden",nN=u.forwardRef((e,t)=>s.jsx(Ne.span,{...e,ref:t,style:{...tN,...e.style}}));nN.displayName=Y$;var F$=nN,X$=[" ","Enter","ArrowUp","ArrowDown"],K$=[" ","Enter"],fr="Select",[vd,yd,Q$]=Tp(fr),[Pl]=Ns(fr,[Q$,Il]),bd=Il(),[Z$,Ia]=Pl(fr),[W$,J$]=Pl(fr),sN=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:p,form:j}=e,v=bd(t),[b,x]=u.useState(null),[g,y]=u.useState(null),[w,N]=u.useState(!1),C=od(d),[_,S]=za({prop:a,defaultProp:r??!1,onChange:l,caller:fr}),[O,D]=za({prop:i,defaultProp:o,onChange:c,caller:fr}),I=u.useRef(null),P=b?j||!!b.closest("form"):!0,[M,U]=u.useState(new Set),R=Array.from(M).map(T=>T.props.value).join(";");return s.jsx(Up,{...v,children:s.jsxs(Z$,{required:p,scope:t,trigger:b,onTriggerChange:x,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:w,onValueNodeHasChildrenChange:N,contentId:Vn(),value:O,onValueChange:D,open:_,onOpenChange:S,dir:C,triggerPointerDownPosRef:I,disabled:m,children:[s.jsx(vd.Provider,{scope:t,children:s.jsx(W$,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(T=>{U(E=>new Set(E).add(T))},[]),onNativeOptionRemove:u.useCallback(T=>{U(E=>{const k=new Set(E);return k.delete(T),k})},[]),children:n})}),P?s.jsxs(CN,{"aria-hidden":!0,required:p,tabIndex:-1,name:f,autoComplete:h,value:O,onChange:T=>D(T.target.value),disabled:m,form:j,children:[O===void 0?s.jsx("option",{value:""}):null,Array.from(M)]},R):null]})})};sN.displayName=fr;var aN="SelectTrigger",rN=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...r}=e,l=bd(n),i=Ia(aN,n),o=i.disabled||a,c=He(t,i.onTriggerChange),d=yd(n),f=u.useRef("touch"),[h,m,p]=RN(v=>{const b=d().filter(y=>!y.disabled),x=b.find(y=>y.value===i.value),g=EN(b,v,x);g!==void 0&&i.onValueChange(g.value)}),j=v=>{o||(i.onOpenChange(!0),p()),v&&(i.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return s.jsx(Bp,{asChild:!0,...l,children:s.jsx(Ne.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":TN(i.value)?"":void 0,...r,ref:c,onClick:ae(r.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&j(v)}),onPointerDown:ae(r.onPointerDown,v=>{f.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(j(v),v.preventDefault())}),onKeyDown:ae(r.onKeyDown,v=>{const b=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(b&&v.key===" ")&&X$.includes(v.key)&&(j(),v.preventDefault())})})})});rN.displayName=aN;var lN="SelectValue",iN=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,children:l,placeholder:i="",...o}=e,c=Ia(lN,n),{onValueNodeHasChildrenChange:d}=c,f=l!==void 0,h=He(t,c.onValueNodeChange);return qt(()=>{d(f)},[d,f]),s.jsx(Ne.span,{...o,ref:h,style:{pointerEvents:"none"},children:TN(c.value)?s.jsx(s.Fragment,{children:i}):l})});iN.displayName=lN;var eO="SelectIcon",oN=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...r}=e;return s.jsx(Ne.span,{"aria-hidden":!0,...r,ref:t,children:a||"▼"})});oN.displayName=eO;var tO="SelectPortal",cN=e=>s.jsx(jo,{asChild:!0,...e});cN.displayName=tO;var hr="SelectContent",uN=u.forwardRef((e,t)=>{const n=Ia(hr,e.__scopeSelect),[a,r]=u.useState();if(qt(()=>{r(new DocumentFragment)},[]),!n.open){const l=a;return l?Sl.createPortal(s.jsx(dN,{scope:e.__scopeSelect,children:s.jsx(vd.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),l):null}return s.jsx(fN,{...e,ref:t})});uN.displayName=hr;var Un=10,[dN,Pa]=Pl(hr),nO="SelectContentImpl",sO=cr("SelectContent.RemoveScroll"),fN=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:p,sticky:j,hideWhenDetached:v,avoidCollisions:b,...x}=e,g=Ia(hr,n),[y,w]=u.useState(null),[N,C]=u.useState(null),_=He(t,z=>w(z)),[S,O]=u.useState(null),[D,I]=u.useState(null),P=yd(n),[M,U]=u.useState(!1),R=u.useRef(!1);u.useEffect(()=>{if(y)return jp(y)},[y]),bp();const T=u.useCallback(z=>{const[X,...te]=P().map(re=>re.ref.current),[he]=te.slice(-1),pe=document.activeElement;for(const re of z)if(re===pe||(re==null||re.scrollIntoView({block:"nearest"}),re===X&&N&&(N.scrollTop=0),re===he&&N&&(N.scrollTop=N.scrollHeight),re==null||re.focus(),document.activeElement!==pe))return},[P,N]),E=u.useCallback(()=>T([S,y]),[T,S,y]);u.useEffect(()=>{M&&E()},[M,E]);const{onOpenChange:k,triggerPointerDownPosRef:$}=g;u.useEffect(()=>{if(y){let z={x:0,y:0};const X=he=>{var pe,re;z={x:Math.abs(Math.round(he.pageX)-(((pe=$.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(he.pageY)-(((re=$.current)==null?void 0:re.y)??0))}},te=he=>{z.x<=10&&z.y<=10?he.preventDefault():y.contains(he.target)||k(!1),document.removeEventListener("pointermove",X),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",X),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",X),document.removeEventListener("pointerup",te,{capture:!0})}}},[y,k,$]),u.useEffect(()=>{const z=()=>k(!1);return window.addEventListener("blur",z),window.addEventListener("resize",z),()=>{window.removeEventListener("blur",z),window.removeEventListener("resize",z)}},[k]);const[V,A]=RN(z=>{const X=P().filter(pe=>!pe.disabled),te=X.find(pe=>pe.ref.current===document.activeElement),he=EN(X,z,te);he&&setTimeout(()=>he.ref.current.focus())}),G=u.useCallback((z,X,te)=>{const he=!R.current&&!te;(g.value!==void 0&&g.value===X||he)&&(O(z),he&&(R.current=!0))},[g.value]),W=u.useCallback(()=>y==null?void 0:y.focus(),[y]),Z=u.useCallback((z,X,te)=>{const he=!R.current&&!te;(g.value!==void 0&&g.value===X||he)&&I(z)},[g.value]),ge=a==="popper"?Zh:hN,Y=ge===Zh?{side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:p,sticky:j,hideWhenDetached:v,avoidCollisions:b}:{};return s.jsx(dN,{scope:n,content:y,viewport:N,onViewportChange:C,itemRefCallback:G,selectedItem:S,onItemLeave:W,itemTextRefCallback:Z,focusSelectedItem:E,selectedItemText:D,position:a,isPositioned:M,searchRef:V,children:s.jsx(ad,{as:sO,allowPinchZoom:!0,children:s.jsx(nd,{asChild:!0,trapped:g.open,onMountAutoFocus:z=>{z.preventDefault()},onUnmountAutoFocus:ae(r,z=>{var X;(X=g.trigger)==null||X.focus({preventScroll:!0}),z.preventDefault()}),children:s.jsx(bo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:z=>z.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:s.jsx(ge,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:z=>z.preventDefault(),...x,...Y,onPlaced:()=>U(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ae(x.onKeyDown,z=>{const X=z.ctrlKey||z.altKey||z.metaKey;if(z.key==="Tab"&&z.preventDefault(),!X&&z.key.length===1&&A(z.key),["ArrowUp","ArrowDown","Home","End"].includes(z.key)){let he=P().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(z.key)&&(he=he.slice().reverse()),["ArrowUp","ArrowDown"].includes(z.key)){const pe=z.target,re=he.indexOf(pe);he=he.slice(re+1)}setTimeout(()=>T(he)),z.preventDefault()}})})})})})})});fN.displayName=nO;var aO="SelectItemAlignedPosition",hN=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...r}=e,l=Ia(hr,n),i=Pa(hr,n),[o,c]=u.useState(null),[d,f]=u.useState(null),h=He(t,_=>f(_)),m=yd(n),p=u.useRef(!1),j=u.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:x,focusSelectedItem:g}=i,y=u.useCallback(()=>{if(l.trigger&&l.valueNode&&o&&d&&v&&b&&x){const _=l.trigger.getBoundingClientRect(),S=d.getBoundingClientRect(),O=l.valueNode.getBoundingClientRect(),D=x.getBoundingClientRect();if(l.dir!=="rtl"){const pe=D.left-S.left,re=O.left-pe,ve=_.left-re,ee=_.width+ve,ht=Math.max(ee,S.width),de=window.innerWidth-Un,Ie=Ev(re,[Un,Math.max(Un,de-ht)]);o.style.minWidth=ee+"px",o.style.left=Ie+"px"}else{const pe=S.right-D.right,re=window.innerWidth-O.right-pe,ve=window.innerWidth-_.right-re,ee=_.width+ve,ht=Math.max(ee,S.width),de=window.innerWidth-Un,Ie=Ev(re,[Un,Math.max(Un,de-ht)]);o.style.minWidth=ee+"px",o.style.right=Ie+"px"}const I=m(),P=window.innerHeight-Un*2,M=v.scrollHeight,U=window.getComputedStyle(d),R=parseInt(U.borderTopWidth,10),T=parseInt(U.paddingTop,10),E=parseInt(U.borderBottomWidth,10),k=parseInt(U.paddingBottom,10),$=R+T+M+k+E,V=Math.min(b.offsetHeight*5,$),A=window.getComputedStyle(v),G=parseInt(A.paddingTop,10),W=parseInt(A.paddingBottom,10),Z=_.top+_.height/2-Un,ge=P-Z,Y=b.offsetHeight/2,z=b.offsetTop+Y,X=R+T+z,te=$-X;if(X<=Z){const pe=I.length>0&&b===I[I.length-1].ref.current;o.style.bottom="0px";const re=d.clientHeight-v.offsetTop-v.offsetHeight,ve=Math.max(ge,Y+(pe?W:0)+re+E),ee=X+ve;o.style.height=ee+"px"}else{const pe=I.length>0&&b===I[0].ref.current;o.style.top="0px";const ve=Math.max(Z,R+v.offsetTop+(pe?G:0)+Y)+te;o.style.height=ve+"px",v.scrollTop=X-Z+v.offsetTop}o.style.margin=`${Un}px 0`,o.style.minHeight=V+"px",o.style.maxHeight=P+"px",a==null||a(),requestAnimationFrame(()=>p.current=!0)}},[m,l.trigger,l.valueNode,o,d,v,b,x,l.dir,a]);qt(()=>y(),[y]);const[w,N]=u.useState();qt(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const C=u.useCallback(_=>{_&&j.current===!0&&(y(),g==null||g(),j.current=!1)},[y,g]);return s.jsx(lO,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:w},children:s.jsx(Ne.div,{...r,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});hN.displayName=aO;var rO="SelectPopperPosition",Zh=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:r=Un,...l}=e,i=bd(n);return s.jsx(Hp,{...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)"}})});Zh.displayName=rO;var[lO,Kp]=Pl(hr,{}),Wh="SelectViewport",mN=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...r}=e,l=Pa(Wh,n),i=Kp(Wh,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(vd.Slot,{scope:n,children:s.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:ae(r.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&h){const p=Math.abs(c.current-f.scrollTop);if(p>0){const j=window.innerHeight-Un*2,v=parseFloat(h.style.minHeight),b=parseFloat(h.style.height),x=Math.max(v,b);if(x<j){const g=x+p,y=Math.min(j,g),w=g-y;h.style.height=y+"px",h.style.bottom==="0px"&&(f.scrollTop=w>0?w:0,h.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});mN.displayName=Wh;var pN="SelectGroup",[iO,oO]=Pl(pN),cO=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=Vn();return s.jsx(iO,{scope:n,id:r,children:s.jsx(Ne.div,{role:"group","aria-labelledby":r,...a,ref:t})})});cO.displayName=pN;var xN="SelectLabel",gN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=oO(xN,n);return s.jsx(Ne.div,{id:r.id,...a,ref:t})});gN.displayName=xN;var yu="SelectItem",[uO,vN]=Pl(yu),yN=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:r=!1,textValue:l,...i}=e,o=Ia(yu,n),c=Pa(yu,n),d=o.value===a,[f,h]=u.useState(l??""),[m,p]=u.useState(!1),j=He(t,g=>{var y;return(y=c.itemRefCallback)==null?void 0:y.call(c,g,a,r)}),v=Vn(),b=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(uO,{scope:n,value:a,disabled:r,textId:v,isSelected:d,onItemTextChange:u.useCallback(g=>{h(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:s.jsx(vd.ItemSlot,{scope:n,value:a,disabled:r,textValue:f,children:s.jsx(Ne.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:ae(i.onFocus,()=>p(!0)),onBlur:ae(i.onBlur,()=>p(!1)),onClick:ae(i.onClick,()=>{b.current!=="mouse"&&x()}),onPointerUp:ae(i.onPointerUp,()=>{b.current==="mouse"&&x()}),onPointerDown:ae(i.onPointerDown,g=>{b.current=g.pointerType}),onPointerMove:ae(i.onPointerMove,g=>{var y;b.current=g.pointerType,r?(y=c.onItemLeave)==null||y.call(c):b.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ae(i.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=c.onItemLeave)==null||y.call(c))}),onKeyDown:ae(i.onKeyDown,g=>{var w;((w=c.searchRef)==null?void 0:w.current)!==""&&g.key===" "||(K$.includes(g.key)&&x(),g.key===" "&&g.preventDefault())})})})})});yN.displayName=yu;var oi="SelectItemText",bN=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:r,...l}=e,i=Ia(oi,n),o=Pa(oi,n),c=vN(oi,n),d=J$(oi,n),[f,h]=u.useState(null),m=He(t,x=>h(x),c.onItemTextChange,x=>{var g;return(g=o.itemTextRefCallback)==null?void 0:g.call(o,x,c.value,c.disabled)}),p=f==null?void 0:f.textContent,j=u.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=d;return qt(()=>(v(j),()=>b(j)),[v,b,j]),s.jsxs(s.Fragment,{children:[s.jsx(Ne.span,{id:c.textId,...l,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Sl.createPortal(l.children,i.valueNode):null]})});bN.displayName=oi;var jN="SelectItemIndicator",wN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return vN(jN,n).isSelected?s.jsx(Ne.span,{"aria-hidden":!0,...a,ref:t}):null});wN.displayName=jN;var Jh="SelectScrollUpButton",_N=u.forwardRef((e,t)=>{const n=Pa(Jh,e.__scopeSelect),a=Kp(Jh,e.__scopeSelect),[r,l]=u.useState(!1),i=He(t,a.onScrollButtonChange);return qt(()=>{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(kN,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});_N.displayName=Jh;var em="SelectScrollDownButton",NN=u.forwardRef((e,t)=>{const n=Pa(em,e.__scopeSelect),a=Kp(em,e.__scopeSelect),[r,l]=u.useState(!1),i=He(t,a.onScrollButtonChange);return qt(()=>{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(kN,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});NN.displayName=em;var kN=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...r}=e,l=Pa("SelectScrollButton",n),i=u.useRef(null),o=yd(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),qt(()=>{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(Ne.div,{"aria-hidden":!0,...r,ref:t,style:{flexShrink:0,...r.style},onPointerDown:ae(r.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(a,50))}),onPointerMove:ae(r.onPointerMove,()=>{var d;(d=l.onItemLeave)==null||d.call(l),i.current===null&&(i.current=window.setInterval(a,50))}),onPointerLeave:ae(r.onPointerLeave,()=>{c()})})}),dO="SelectSeparator",SN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return s.jsx(Ne.div,{"aria-hidden":!0,...a,ref:t})});SN.displayName=dO;var tm="SelectArrow",fO=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,r=bd(n),l=Ia(tm,n),i=Pa(tm,n);return l.open&&i.position==="popper"?s.jsx(Ip,{...r,...a,ref:t}):null});fO.displayName=tm;var hO="SelectBubbleInput",CN=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(Ne.select,{...n,style:{...tN,...n.style},ref:l,defaultValue:t})});CN.displayName=hO;function TN(e){return e===""||e===void 0}function RN(e){const t=ys(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 EN(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=mO(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 mO(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var pO=sN,AN=rN,xO=iN,gO=oN,vO=cN,MN=uN,yO=mN,$N=gN,ON=yN,bO=bN,jO=wN,DN=_N,zN=NN,LN=SN;const wO={default:"h-9 px-3 py-2 text-sm",control:"h-7 px-2 py-1 text-xs"},ct=pO,ut=xO,nt=u.forwardRef(({className:e,children:t,triggerSize:n="default",...a},r)=>s.jsxs(AN,{ref:r,className:se("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",wO[n],e),...a,children:[t,s.jsx(gO,{asChild:!0,children:s.jsx(x0,{className:"text-muted-foreground size-4","aria-hidden":"true"})})]}));nt.displayName=AN.displayName;const UN=u.forwardRef(({className:e,...t},n)=>s.jsx(DN,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(oT,{className:"size-4","aria-hidden":"true"})}));UN.displayName=DN.displayName;const BN=u.forwardRef(({className:e,...t},n)=>s.jsx(zN,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(rT,{className:"size-4","aria-hidden":"true"})}));BN.displayName=zN.displayName;const st=u.forwardRef(({className:e,children:t,position:n="popper",...a},r)=>s.jsx(vO,{container:wo(),children:s.jsxs(MN,{ref:r,className:se("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(UN,{}),s.jsx(yO,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(BN,{})]})}));st.displayName=MN.displayName;const _O=u.forwardRef(({className:e,...t},n)=>s.jsx($N,{ref:n,className:se("px-2 py-1.5 text-sm font-semibold",e),...t}));_O.displayName=$N.displayName;const _e=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(ON,{ref:a,className:se("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(jO,{children:s.jsx(Ol,{className:"size-4","aria-hidden":"true"})})}),s.jsx(bO,{children:t})]}));_e.displayName=ON.displayName;const NO=u.forwardRef(({className:e,...t},n)=>s.jsx(LN,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));NO.displayName=LN.displayName;function at({className:e,...t}){return s.jsx("div",{className:se("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:se("relative w-full overflow-auto",t),children:s.jsx("table",{ref:i,className:se("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:se("[&_tr]:border-b",e),...t}));Ge.displayName="TableHeader";const Be=u.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:se("[&_tr:last-child]:border-0",e),...t}));Be.displayName="TableBody";const kO=u.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:se("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));kO.displayName="TableFooter";const le=u.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:se("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));le.displayName="TableRow";const F=u.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:se("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));F.displayName="TableHead";const q=u.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:se("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));q.displayName="TableCell";const SO=u.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:se("text-muted-foreground mt-4 text-sm",e),...t}));SO.displayName="TableCaption";var jd="Tabs",[CO]=Ns(jd,[fd]),HN=fd(),[TO,Qp]=CO(jd),IN=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:r,defaultValue:l,orientation:i="horizontal",dir:o,activationMode:c="automatic",...d}=e,f=od(o),[h,m]=za({prop:a,onChange:r,defaultProp:l??"",caller:jd});return s.jsx(TO,{scope:n,baseId:Vn(),value:h,onValueChange:m,orientation:i,dir:f,activationMode:c,children:s.jsx(Ne.div,{dir:f,"data-orientation":i,...d,ref:t})})});IN.displayName=jd;var PN="TabsList",qN=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...r}=e,l=Qp(PN,n),i=HN(n);return s.jsx(a_,{asChild:!0,...i,orientation:l.orientation,dir:l.dir,loop:a,children:s.jsx(Ne.div,{role:"tablist","aria-orientation":l.orientation,...r,ref:t})})});qN.displayName=PN;var GN="TabsTrigger",VN=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:r=!1,...l}=e,i=Qp(GN,n),o=HN(n),c=XN(i.baseId,a),d=KN(i.baseId,a),f=a===i.value;return s.jsx(r_,{asChild:!0,...o,focusable:!r,active:f,children:s.jsx(Ne.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:ae(e.onMouseDown,h=>{!r&&h.button===0&&h.ctrlKey===!1?i.onValueChange(a):h.preventDefault()}),onKeyDown:ae(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(a)}),onFocus:ae(e.onFocus,()=>{const h=i.activationMode!=="manual";!f&&!r&&h&&i.onValueChange(a)})})})});VN.displayName=GN;var YN="TabsContent",FN=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:r,children:l,...i}=e,o=Qp(YN,n),c=XN(o.baseId,a),d=KN(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(On,{present:r||f,children:({present:m})=>s.jsx(Ne.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})})});FN.displayName=YN;function XN(e,t){return`${e}-trigger-${t}`}function KN(e,t){return`${e}-content-${t}`}var RO=IN,QN=qN,ZN=VN,WN=FN;const EO=RO,JN=u.forwardRef(({className:e,...t},n)=>s.jsx(QN,{ref:n,className:se("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));JN.displayName=QN.displayName;const nm=u.forwardRef(({className:e,...t},n)=>s.jsx(ZN,{ref:n,className:se("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}));nm.displayName=ZN.displayName;const AO=u.forwardRef(({className:e,...t},n)=>s.jsx(WN,{ref:n,className:se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));AO.displayName=WN.displayName;const rs=u.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:se("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}));rs.displayName="Textarea";var[wd]=Ns("Tooltip",[Il]),_d=Il(),ek="TooltipProvider",MO=700,sm="tooltip.open",[$O,Zp]=wd(ek),tk=e=>{const{__scopeTooltip:t,delayDuration:n=MO,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($O,{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})};tk.displayName=ek;var Xi="Tooltip",[OO,Ro]=wd(Xi),nk=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:r,onOpenChange:l,disableHoverableContent:i,delayDuration:o}=e,c=Zp(Xi,e.__scopeTooltip),d=_d(t),[f,h]=u.useState(null),m=Vn(),p=u.useRef(0),j=i??c.disableHoverableContent,v=o??c.delayDuration,b=u.useRef(!1),[x,g]=za({prop:a,defaultProp:r??!1,onChange:_=>{_?(c.onOpen(),document.dispatchEvent(new CustomEvent(sm))):c.onClose(),l==null||l(_)},caller:Xi}),y=u.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),w=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,g(!0)},[g]),N=u.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g(!1)},[g]),C=u.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,g(!0),p.current=0},v)},[v,g]);return u.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),s.jsx(Up,{...d,children:s.jsx(OO,{scope:t,contentId:m,open:x,stateAttribute:y,trigger:f,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?C():w()},[c.isOpenDelayedRef,C,w]),onTriggerLeave:u.useCallback(()=>{j?N():(window.clearTimeout(p.current),p.current=0)},[N,j]),onOpen:w,onClose:N,disableHoverableContent:j,children:n})})};nk.displayName=Xi;var am="TooltipTrigger",sk=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=Ro(am,n),l=Zp(am,n),i=_d(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(Bp,{asChild:!0,...i,children:s.jsx(Ne.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...a,ref:c,onPointerMove:ae(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!l.isPointerInTransitRef.current&&(r.onTriggerEnter(),f.current=!0)}),onPointerLeave:ae(e.onPointerLeave,()=>{r.onTriggerLeave(),f.current=!1}),onPointerDown:ae(e.onPointerDown,()=>{r.open&&r.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ae(e.onFocus,()=>{d.current||r.onOpen()}),onBlur:ae(e.onBlur,r.onClose),onClick:ae(e.onClick,r.onClose)})})});sk.displayName=am;var Wp="TooltipPortal",[DO,zO]=wd(Wp,{forceMount:void 0}),ak=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:r}=e,l=Ro(Wp,t);return s.jsx(DO,{scope:t,forceMount:n,children:s.jsx(On,{present:n||l.open,children:s.jsx(jo,{asChild:!0,container:r,children:a})})})};ak.displayName=Wp;var Nl="TooltipContent",rk=u.forwardRef((e,t)=>{const n=zO(Nl,e.__scopeTooltip),{forceMount:a=n.forceMount,side:r="top",...l}=e,i=Ro(Nl,e.__scopeTooltip);return s.jsx(On,{present:a||i.open,children:i.disableHoverableContent?s.jsx(lk,{side:r,...l,ref:t}):s.jsx(LO,{side:r,...l,ref:t})})}),LO=u.forwardRef((e,t)=>{const n=Ro(Nl,e.__scopeTooltip),a=Zp(Nl,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]),p=u.useCallback((j,v)=>{const b=j.currentTarget,x={x:j.clientX,y:j.clientY},g=PO(x,b.getBoundingClientRect()),y=qO(x,g),w=GO(v.getBoundingClientRect()),N=YO([...y,...w]);o(N),h(!0)},[h]);return u.useEffect(()=>()=>m(),[m]),u.useEffect(()=>{if(c&&f){const j=b=>p(b,f),v=b=>p(b,c);return c.addEventListener("pointerleave",j),f.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",j),f.removeEventListener("pointerleave",v)}}},[c,f,p,m]),u.useEffect(()=>{if(i){const j=v=>{const b=v.target,x={x:v.clientX,y:v.clientY},g=(c==null?void 0:c.contains(b))||(f==null?void 0:f.contains(b)),y=!VO(x,i);g?m():y&&(m(),d())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[c,f,i,d,m]),s.jsx(lk,{...e,ref:l})}),[UO,BO]=wd(Xi,{isInside:!1}),HO=ME("TooltipContent"),lk=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":r,onEscapeKeyDown:l,onPointerDownOutside:i,...o}=e,c=Ro(Nl,n),d=_d(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(sm,f),()=>document.removeEventListener(sm,f)),[f]),u.useEffect(()=>{if(c.trigger){const h=m=>{const p=m.target;p!=null&&p.contains(c.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,f]),s.jsx(bo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:s.jsxs(Hp,{"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(HO,{children:a}),s.jsx(UO,{scope:n,isInside:!0,children:s.jsx(F$,{id:c.contentId,role:"tooltip",children:r||a})})]})})});rk.displayName=Nl;var ik="TooltipArrow",IO=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=_d(n);return BO(ik,n).isInside?null:s.jsx(Ip,{...r,...a,ref:t})});IO.displayName=ik;function PO(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 qO(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 GO(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 VO(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 YO(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),FO(t)}function FO(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 XO=tk,KO=nk,QO=sk,ZO=ak,ok=rk;const ck=XO,uk=KO,dk=QO,Jp=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>{const r=wo(),l=s.jsx(ok,{ref:a,sideOffset:t,className:se("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(ZO,{container:r,children:l}):l});Jp.displayName=ok.displayName;function Ss({page:e,header:t}){return s.jsxs(s.Fragment,{children:[t??s.jsx(Gt,{title:e}),s.jsx(WO,{page:e})]})}function WO({page:e}){return s.jsxs(ce,{variant:"info",role:"status",className:"mt-6","data-testid":"not-installed",children:[s.jsx(ea,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:w0(e)})]})}const Av=["none","read","comment","write","manage","admin"];function bu(e,t){return Av.indexOf(e??"none")>=Av.indexOf(t)}function ex(e){return e==="api_key"?"API key":e==="sdlc_login"?"sdlc login":null}function Rf(e,t){const n=ex(e);return e==="sdlc_login"&&t?`${n} on ${fk(t)}`:n}const JO=String.fromCodePoint(8296),eD=String.fromCodePoint(8297);function fk(e){return`${JO}${e}${eD}`}const Ki={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"}},tD={backlog:"neutral",planned:"neutral",in_progress:"info",completed:"success",canceled:"neutral"};function hk(e){return e.name==="Blocked"?"warning":tD[e.category]}const Mv=1800;function Qn(e){return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Yn(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function tx(e){return`${En(e)}, ${Yn(e)}`}function Jl(e){return e<90?`${Math.round(e)} s`:e<5400?`${Math.round(e/60)} min`:`${(e/3600).toFixed(1).replace(/\.0$/,"")} h`}function En(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function mk(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function nD(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 sD(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 oa="not_set";function aD({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 P;const f=$l(),[h,m]=u.useState(""),[p,j]=u.useState(""),[v,b]=u.useState(r??((P=l[0])==null?void 0:P.id)??""),[x,g]=u.useState(oa),[y,w]=u.useState(oa),[N,C]=u.useState(!1),[_,S]=u.useState(null),[O,D]=u.useState(!1);u.useEffect(()=>{var M;e&&(m(""),j(""),b(r??((M=l[0])==null?void 0:M.id)??""),g(oa),w(oa),C(!1),S(null))},[e,r,l]);const I=async M=>{if(M.preventDefault(),!h.trim()){C(!0);return}D(!0),S(null);try{const U=await t.run("create_task",{list_id:n,expected_list_revision:a,title:h.trim(),description:p.trim()||null,status_id:v||null,priority_id:x===oa?null:x,primary_user_id:y===oa?null:y});if(!U.ok){S(U.refusal.message);return}f.success("Task created."),await d()}finally{D(!1)}};return s.jsx(Jn,{open:e,onOpenChange:M=>M?null:c(),children:s.jsx(es,{children:s.jsxs("form",{onSubmit:M=>void I(M),noValidate:!0,children:[s.jsxs(ts,{children:[s.jsx(ss,{children:"New task"}),s.jsx(as,{children:"Add a task to this List."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[_&&s.jsxs(ce,{variant:"destructive",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(ue,{children:_})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-title",children:"Title"}),s.jsx(St,{id:"new-task-title",placeholder:"What needs doing",value:h,required:!0,"aria-invalid":N,"aria-describedby":N?"new-task-title-error":void 0,onChange:M=>{m(M.target.value),C(!1)}}),N&&s.jsx("p",{id:"new-task-title-error",className:"text-destructive text-xs",children:"Give the task a title."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-description",children:"Description (optional)"}),s.jsx(rs,{id:"new-task-description",rows:4,value:p,onChange:M=>j(M.target.value)})]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-status",children:"Status"}),s.jsxs(ct,{value:v,onValueChange:b,children:[s.jsx(nt,{id:"new-task-status",children:s.jsx(ut,{})}),s.jsx(st,{children:l.map(M=>s.jsx(_e,{value:M.id,children:M.name},M.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-priority",children:"Priority"}),s.jsxs(ct,{value:x,onValueChange:g,children:[s.jsx(nt,{id:"new-task-priority",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:oa,children:"Not set"}),i.map(M=>s.jsx(_e,{value:M.id,children:M.name},M.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-primary",children:"Primary"}),s.jsxs(ct,{value:y,onValueChange:w,children:[s.jsx(nt,{id:"new-task-primary",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:oa,children:"Not set"}),o.map(M=>s.jsx(_e,{value:M.user_id,children:M.label},M.user_id))]})]})]})]})]}),s.jsxs(ns,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:O,children:O?"Creating…":"Create task"})]})]})})})}const rD="Your organization's work, in queue order. Claim a task to show you are working on it.",ci="any",pk="none",lD=1,iD=250;function nx(){const e=nn().tasks;if(!e)throw new Error("The Tasks page rendered without the tasks seam.");return e}function oD({org:e}){var j,v;const t=nx(),{href:n,Link:a}=Ve(),[r,l]=u.useState({state:"loading"}),[i,o]=u.useState([]),[c,d]=u.useState(null),f=u.useRef(0),h=u.useCallback(async b=>{const x=f.current+=1;b&&l({state:"loading"});const g=await t.availability({fresh:b});x===f.current&&l(g)},[t.availability]);u.useEffect(()=>{h(!1)},[h]);const m=u.useCallback(()=>void h(!0),[h]);if(u.useEffect(()=>{let b=!0;return t.members().then(x=>{b&&x.ok&&o(x.data)}),()=>{b=!1}},[t.members]),u.useEffect(()=>{if(!t.access)return;let b=!0;return t.access().then(x=>{b&&x.ok&&d(x.data)}),()=>{b=!1}},[t.access]),r.state==="off"&&((j=r.refusal)==null?void 0:j.reason)!=="engine_missing")return s.jsx(ta,{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 p=(c==null?void 0:c.read_only_reason)??rD;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(uD,{active:r,org:e,members:i,description:p,read_only_reason:c==null?void 0:c.read_only_reason,reload_configuration:m}):r.state==="off"&&((v=r.refusal)==null?void 0:v.reason)==="engine_missing"?s.jsx(Ss,{page:"Tasks"}):s.jsxs(s.Fragment,{children:[s.jsx(Gt,{title:"Tasks",description:p}),r.state==="loading"&&s.jsx(xk,{}),(r.state==="error"||r.state==="off")&&s.jsx(gk,{refusal:r.refusal,on_retry:m}),r.state==="available"&&s.jsx(cD,{on_done:m})]})})}function xk(){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(at,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function gk({refusal:e,on_retry:t}){const n=_s();return(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(ce,{variant:"warning",className:"mt-6",children:[s.jsx(Lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:Dl}),s.jsx(ue,{children:n})]}):s.jsxs(ce,{variant:"destructive",className:"mt-6",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Tasks could not be loaded"}),s.jsxs(ue,{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 cD({on_done:e}){const{commands:t}=nx(),n=$l(),[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(ce,{variant:"info",className:"mt-6",children:[s.jsx(ea,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Tasks are not on for this organization"}),s.jsxs(ue,{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 Ef=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function uD({active:e,org:t,members:n,description:a,read_only_reason:r,reload_configuration:l}){var Cx;const{commands:i,listTasks:o,waitingOnYou:c,hierarchyRevision:d}=nx(),{href:f,Link:h}=Ve(),{self_id:m}=Ku(),p=$l(),{list:j,workspace:v}=e,b=j.offers,x=b!==void 0,g=u.useMemo(()=>{var B;return((B=v.workflows.find(Ye=>Ye.id===j.workflow_id))==null?void 0:B.statuses)??[]},[v,j]),y=v.priorities,w=!!i&&bu(j.permission,"write"),N=w&&bu(j.permission,"manage"),C=u.useMemo(()=>new Map(n.map(B=>[B.user_id,B])),[n]),_=B=>{var Ye;return B?B===m?"You":((Ye=C.get(B))==null?void 0:Ye.label)??"A member":""},[S,O]=u.useState("active"),[D,I]=u.useState(!1),[P,M]=u.useState(""),[U,R]=u.useState("");u.useEffect(()=>{const B=setTimeout(()=>R(P),iD);return()=>clearTimeout(B)},[P]);const[T,E]=u.useState(null),[k,$]=u.useState(ci),[V,A]=u.useState(!1),[G,W]=u.useState(!1),[Z,ge]=u.useState(null),[Y,z]=u.useState([]),[X,te]=u.useState(null),[he,pe]=u.useState(0),[re,ve]=u.useState(!1),[ee,ht]=u.useState(null),[de,Ie]=u.useState(null),K=_s(),[ke,De]=u.useState(!1),[xt,ye]=u.useState(null),[Ct,Ut]=u.useState({}),[yn,Cs]=u.useState(""),{confirm:bn,confirm_dialog:an}=_o(),Ts=u.useRef(null),Rs=u.useRef(null),ne=u.useRef(null),Oe=u.useRef(null),[Ce,Es]=u.useState(void 0),Dn=!!(U.trim()||T||k!==ci||V||G),zn=u.useRef(0),Tt=u.useCallback(async(B,Ye=!1)=>{const Qe=B?zn.current:zn.current+=1,rt={state:S,assigned_to_me:D||void 0,cursor:B,search:U.trim()||void 0,group:T??void 0,owner:k===ci?void 0:k===pk?"":k,urgent:V||void 0,over_estimate:G||void 0},Bt=Kt=>o(j.id,{...rt,cursor:Kt});let Rt=await Bt(B),lt=!!B;if(!Rt.ok&&Rt.refusal.code==="cursor_stale"&&(Rt=await Bt(),lt=!1),Qe!==zn.current)return;if(!Rt.ok){te(Rt.refusal),pe(Kt=>Kt+1);return}const Ht=Rt.data;te(null),pe(0),!(Ye&&Ef(Ht,ne.current))&&(ne.current=Ht,ge(Ht),Ht.facets&&Es(Ht.facets),z(Kt=>lt?[...Kt,...Ht.tasks]:Ht.tasks))},[o,j.id,S,D,U,T,k,V,G]),rn=u.useCallback(async()=>{const B=await c();if(Ie(Qe=>B.ok?null:Ef(Qe,B.refusal)?Qe:B.refusal),!B.ok&&x)return;const Ye=B.ok?B.data:null;Ef(Ye,Oe.current)||(Oe.current=Ye,ht(Ye))},[c,x]);u.useEffect(()=>{ne.current=null,ge(null)},[S,D]),u.useEffect(()=>{Tt()},[Tt]),u.useEffect(()=>{rn()},[rn]);const ls=u.useCallback(async()=>{await Promise.all([Tt(),rn()])},[Tt,rn]),Ln=b==null?void 0:b.refresh_ms;u.useEffect(()=>{if(!Ln)return;const B=setInterval(()=>{Tt(void 0,!0),rn()},Ln);return()=>clearInterval(B)},[Ln,Tt,rn]);const sa=u.useCallback(async(B,Ye,Qe)=>{if(!i)return;const rt=await i.run(B,Ye);rt.ok?Qe&&p.success(Qe):(p.error(rt.refusal.message),rt.refusal.code==="revision_conflict"&&l()),await ls()},[i,p,ls,l]),L=g.find(B=>B.category==="completed"),be=async(B,Ye,Qe)=>{const rt=Ye+Qe,Bt=Y[rt];if(!Bt||!Z||!i)return;const Rt=async(lt,Ht)=>{const Kt=await i.run(lt,Ht);if(!Kt.ok)throw Kt.refusal;return Kt.data};try{let lt=Z.list.order_revision,Ht=B.revision;if(Bt.queue_rank===null){const Kt=Y.findIndex(aa=>aa.queue_rank===null);for(const aa of Y.slice(Kt,rt+1)){const Do=await Rt("reorder",{task_id:aa.id,expected_revision:aa.revision,expected_order_revision:lt,placement:"end"});lt=Do.list.order_revision,aa.id===B.id&&(Ht=Do.task.revision)}}await Rt("reorder",{task_id:B.id,expected_revision:Ht,expected_order_revision:lt,placement:Qe<0?"before":"after",anchor_task_id:Bt.id})}catch(lt){p.error(lt.message)}await ls()},J=B=>{L&&sa("update_task",{task_id:B.id,expected_revision:B.revision,changes:{status_id:L.id}},`${B.title} completed.`)},we=async B=>{if(!Z||!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,rt]=await Promise.all([o(j.id,{limit:1}),d(v.id)]);if(!Qe.ok||!rt.ok){p.error(Qe.ok?rt.ok?"":rt.refusal.message:Qe.refusal.message);return}await sa("archive_task",{task_id:B.id,expected_revision:B.revision,expected_order_revision:Qe.data.list.order_revision,expected_hierarchy_revision:rt.data},`${B.title} archived.`)},As=async B=>{await sa("release_hold",{hold_id:B},"Hold released.")},qa=async(B,Ye,Qe,rt)=>{var Kt;if(!(i!=null&&i.complete)||!await bn({title:`Mark ${Ye} done?`,description:Qe.reason?`“${Qe.reason}”
|
|
399
|
+
|
|
400
|
+
It leaves the open tasks.`:"It leaves the open tasks.",action_label:"Mark done"}))return;ye(B);const Rt=await i.complete(Qe);if(ye(null),!Rt.ok){Ut(aa=>({...aa,[B]:Rt.refusal.message}));return}Ut(({[B]:aa,...Do})=>Do),Cs(`${Ye} marked done.`),await ls();const lt=Rs.current;(Kt=(rt?(lt==null?void 0:lt.querySelector(`[data-done-key="${CSS.escape(rt)}"]`))??(lt==null?void 0:lt.querySelector(`[data-title-key="${CSS.escape(rt)}"] a`)):null)??Ts.current)==null||Kt.focus()},Sx=()=>{var B;M(""),R(""),E(null),$(ci),A(!1),W(!1),(B=Ts.current)==null||B.focus()},M1=new Map(g.map(B=>[B.id,B])),$1=new Map(y.map(B=>[B.id,B])),Ad=new Map(Y.map(B=>[B.id,B.title])),Md=w&&S==="active",O1=Y.some(B=>B.local_done),$d=Md||O1,Od=!x||y.length>0,D1=!D&&!Dn,z1=5+(Od?1:0)+($d?1:0),L1=X!==null&&(X.reason==="store_locked"||X.reason==="engine_failed")&&he<=lD,Oo=(ee==null?void 0:ee.holds)??[],U1=Y.map(B=>B.id),B1=Oo.map(B=>B.id);return s.jsxs("div",{ref:Rs,className:"contents",children:[s.jsx(Gt,{title:"Tasks",description:a,actions:w?s.jsxs(H,{type:"button",onClick:()=>De(!0),children:[s.jsx(jl,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]}):null}),x&&(Z!=null&&Z.open)?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[Z.open," open"]}):null,Ln?s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",role:"status",children:X?`Not reading · trying again every ${Math.round(Ln/1e3)}s`:Z?`Live · refreshes every ${Math.round(Ln/1e3)}s`:"Connecting…"}):null,x?s.jsx("p",{className:"sr-only",role:"status",children:yn}):null,(x||Oo.length>0)&&s.jsxs(jt,{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"}),Oo.length>0?s.jsx("ul",{className:"mt-2 divide-y","aria-labelledby":"waiting-title",children:Oo.map((B,Ye)=>{var Rt,lt;const Qe=Ki[B.hold_type],rt=B.target.kind==="task"?`Because you claim ${Ad.get(B.target.task_id)??"the task it waits on"} · `:"",Bt=B.local_done;return s.jsxs("li",{id:`waiting-${B.id}`,"data-title-key":B.id,className:"flex flex-wrap items-center gap-3 py-2",children:[B.task?s.jsx(h,{className:"text-primary min-w-40 flex-1 hover:underline",href:f(`/org/${t}/tasks/${B.task.id}`),children:B.task.title}):s.jsx("span",{className:"min-w-40 flex-1",children:B.reason}),s.jsx(fe,{variant:Qe.tone,children:B.local_label??Qe.label}),s.jsxs("div",{className:"min-w-48 flex-2",children:[B.task?s.jsx("div",{className:"text-sm",children:B.reason}):null,s.jsxs("div",{className:"text-muted-foreground text-xs",children:[rt,"From ",_(B.opened_by)," · ",En(B.opened_at)]}),(Rt=B.local_threads)!=null&&Rt.length?s.jsxs("div",{className:"text-muted-foreground text-xs",children:["Answer it in"," ",s.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/threads`),children:"Threads"}),": ",B.local_threads.join(" · ")]}):null,Ct[B.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:Ct[B.id]}):null]}),Bt&&(i!=null&&i.complete)?s.jsx(H,{type:"button",variant:"outline",size:"sm","data-done-key":B.id,"aria-label":`Mark ${((lt=B.task)==null?void 0:lt.title)??B.reason} done`,loading:xt===B.id,onClick:()=>{var Ht;return void qa(B.id,((Ht=B.task)==null?void 0:Ht.title)??B.reason,Bt,B1[Ye+1]??null)},children:"Done"}):null,x?null:s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void As(B.id),children:"Release"})]},B.id)})}):ee?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Nothing in this checkout waits on you."}):null,x&&de?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status",children:de.reason==="view_outdated"?`Waiting on you is not read here. ${K}`:"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(ce,{variant:"info",className:"mt-4",children:[s.jsx(vo,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"You can view these tasks"}),s.jsx(ue,{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:[(b==null?void 0:b.archived)!==!1?s.jsx(EO,{value:S,onValueChange:B=>O(B),children:s.jsxs(JN,{"aria-label":"Which tasks",children:[s.jsx(nm,{value:"active",children:"Active"}),s.jsx(nm,{value:"archived",children:"Archived"})]})}):null,(b==null?void 0:b.assigned_to_me)!==!1?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{id:"tasks-mine",checked:D,onCheckedChange:B=>I(B===!0)}),s.jsx(Me,{htmlFor:"tasks-mine",children:"Assigned to me"})]}):null,b!=null&&b.search?s.jsx(St,{ref:Ts,type:"search",className:"w-64","aria-label":"Search tasks",placeholder:"Search title, ID or detail",value:P,onChange:B=>M(B.target.value)}):null,Ce!=null&&Ce.owners?s.jsx(fD,{owners:Ce.owners,no_owner:Ce.no_owner,value:k,on_change:$}):null]}),(Cx=Ce==null?void 0:Ce.groups)!=null&&Cx.length?s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Status",children:[Ce.groups.map(B=>s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:rl,"aria-pressed":T===B.id,onClick:()=>E(Ye=>Ye===B.id?null:B.id),children:[B.label," ",B.count]},B.id)),Ce.marks?s.jsxs(s.Fragment,{children:[s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:rl,"aria-pressed":V,onClick:()=>A(B=>!B),children:["Urgent ",Ce.marks.urgent]}),s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:rl,"aria-pressed":G,onClick:()=>W(B=>!B),children:["Over estimate ",Ce.marks.over_estimate]})]}):null]}):null,Dn&&(Z==null?void 0:Z.matched)!==void 0&&Z.total!==void 0?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:[Z.matched," of ",Z.total," match ·"," ",s.jsx(H,{type:"button",variant:"link",size:"inline-sm",onClick:Sx,children:"Clear"})]}):null,L1?s.jsx("p",{className:"text-muted-foreground mt-4 text-sm",children:"Tasks are busy. Reading them again…"}):X?s.jsx(gk,{refusal:X,on_retry:()=>void Tt()}):null,!Z&&!X&&s.jsx(xk,{}),Z&&Y.length===0&&Dn?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Wu,{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:Sx,children:"Clear filters"})]}):Z&&Y.length===0&&S==="active"&&!D&&x?s.jsx("p",{className:"text-muted-foreground mt-6 text-sm",children:"No tasks recorded yet."}):Z&&Y.length===0&&S==="active"&&!D?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(v0,{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:()=>De(!0),children:[s.jsx(jl,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]})]}):Z?s.jsxs(s.Fragment,{children:[s.jsx(jt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Tasks",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Title"}),s.jsx(F,{children:"Status"}),Od?s.jsx(F,{className:"hidden md:table-cell",children:"Priority"}):null,s.jsx(F,{className:"hidden md:table-cell",children:"Primary"}),s.jsx(F,{className:"hidden md:table-cell",children:"Holds"}),s.jsx(F,{children:"Claimed by"}),$d?s.jsx(F,{className:"text-right",children:"Actions"}):null]})}),s.jsxs(Be,{children:[Y.map((B,Ye)=>{var Rt,lt;const Qe=M1.get(B.status_id),rt=nD(B),Bt=B.local_done;return s.jsxs(le,{"data-testid":"tasks-row",children:[s.jsxs(q,{"data-title-key":B.id,children:[B.no_page?s.jsx("span",{children:B.title}):s.jsx(h,{className:"text-primary hover:underline",href:f(`/org/${t}/tasks/${B.id}`),children:B.title}),B.parent_task_id&&Ad.get(B.parent_task_id)?s.jsx("div",{className:"text-muted-foreground text-xs",children:Ad.get(B.parent_task_id)}):null,x?s.jsx(dD,{row:B}):null,Ct[B.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:Ct[B.id]}):null]}),s.jsx(q,{children:Qe?s.jsx(fe,{variant:hk(Qe),children:Qe.name}):null}),Od?s.jsx(q,{className:"hidden md:table-cell",children:B.priority_id?((Rt=$1.get(B.priority_id))==null?void 0:Rt.name)??"":s.jsx("span",{className:"text-muted-foreground",children:"Not set"})}):null,s.jsx(q,{className:"hidden md:table-cell",children:B.owner_title?B.owner_title:B.primary_user_id?_(B.primary_user_id):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}),s.jsx(q,{className:"hidden md:table-cell",children:rt?s.jsx(fe,{variant:rt.tone,children:rt.label}):s.jsx("span",{className:"text-muted-foreground",children:"None"})}),s.jsx(q,{"data-testid":"tasks-claim",children:s.jsx(hD,{row:B,holder:_((lt=B.claim)==null?void 0:lt.user_id)})}),$d?s.jsx(q,{className:"text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[Bt&&"hold"in Bt?s.jsx("a",{className:"text-primary text-sm hover:underline",href:`#waiting-${Bt.hold}`,children:"In Waiting on you"}):Bt&&(i!=null&&i.complete)?s.jsx(H,{type:"button",variant:"outline",size:"sm","data-done-key":B.id,"aria-label":`Mark ${B.title} done`,loading:xt===B.id,onClick:()=>void qa(B.id,B.title,Bt,U1[Ye+1]??null),children:"Done"}):null,Md&&D1?s.jsxs(s.Fragment,{children:[s.jsx(H,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${B.title} up`,disabled:Ye===0,onClick:()=>void be(B,Ye,-1),children:s.jsx(ZC,{className:"size-4","aria-hidden":"true"})}),s.jsx(H,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${B.title} down`,disabled:Ye===Y.length-1,onClick:()=>void be(B,Ye,1),children:s.jsx(XC,{className:"size-4","aria-hidden":"true"})})]}):null,Md?s.jsxs(xd,{children:[s.jsx(gd,{asChild:!0,children:s.jsx(H,{type:"button",variant:"outline",size:"icon","aria-label":`More actions for ${B.title}`,children:s.jsx(xp,{className:"size-4","aria-hidden":"true"})})}),s.jsxs(To,{align:"end",children:[L&&B.status_id!==L.id?s.jsx(_l,{onSelect:()=>J(B),children:"Complete"}):null,N?s.jsx(_l,{className:"text-destructive focus:text-destructive",onSelect:()=>void we(B),children:"Archive"}):null]})]}):null]})}):null]},B.id)}),Y.length===0&&s.jsx(le,{children:s.jsx(q,{colSpan:z1,className:"text-muted-foreground h-24 text-center",children:S==="archived"?"No archived tasks.":"No tasks are assigned to you."})})]})]})}),Z.next_cursor?s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2 self-start",disabled:re,onClick:async()=>{ve(!0),await Tt(Z.next_cursor??void 0),ve(!1)},children:"Load more"}):null]}):null,w&&i&&s.jsx(aD,{open:ke,commands:i,list_id:j.id,list_revision:(Z==null?void 0:Z.list.revision)??j.revision,default_status_id:j.default_status_id,statuses:g,priorities:y,members:n,on_close:()=>De(!1),on_created:async()=>{De(!1),await ls()}}),an]})}function dD({row:e}){var n;const t=[e.local_after,e.local_detail].filter(Boolean).join(" · ");return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"text-muted-foreground font-mono text-xs",children:[e.id,e.match?` · matched in ${e.match}`:""]}),t?s.jsx("div",{className:"text-muted-foreground text-xs",children:t}):null,(n=e.local_marks)!=null&&n.length?s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:e.local_marks.map(a=>s.jsx(fe,{variant:a.tone??"neutral",children:a.label},a.label))}):null]})}function fD({owners:e,no_owner:t,value:n,on_change:a}){return s.jsxs(ct,{value:n,onValueChange:a,children:[s.jsx(nt,{className:"w-56","aria-label":"Owner",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:ci,children:"Any owner"}),e.map(r=>s.jsxs(_e,{value:r.id,children:[r.label," (",r.count,")"]},r.id)),t!==void 0?s.jsxs(_e,{value:pk,children:["No owner (",t,")"]}):null]})]})}function hD({row:e,holder:t}){const n=e.claim;if(!n)return s.jsx("span",{className:"text-muted-foreground",children:"Nobody"});if(n.lapsed){const a=new Date(n.lease_expires_at)<=new Date;return s.jsxs("div",{children:[s.jsxs("div",{className:"text-warning",children:["Lapsed · ",t]}),s.jsx("div",{className:"text-muted-foreground text-xs",children:a?`Ran out at ${Qn(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?` · ${ex(n.via)}`:""]}),s.jsxs("div",{className:"text-muted-foreground truncate text-xs",title:n.via==="sdlc_login"&&n.via_device?fk(n.via_device):void 0,children:["Until ",Qn(n.lease_expires_at),n.via==="sdlc_login"&&n.via_device?s.jsxs(s.Fragment,{children:[" · ",s.jsx("bdi",{children:n.via_device})]}):null]})]})}const mD={waiting_for_user:{label:"Waiting for",help:"The member who must act. They see this hold under Waiting on you."},blocked:{label:"Blocked by",help:"The task that must finish first."},waiting_for_external:{label:"Waiting for",help:"Who or what outside the organization."},paused:null};function pD({open:e,members:t,tasks:n,holds_my_web_claim:a,on_close:r,on_submit:l}){const[i,o]=u.useState("waiting_for_user"),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,p]=u.useState(!1),[j,v]=u.useState({}),[b,x]=u.useState(null),[g,y]=u.useState(!1);u.useEffect(()=>{e&&(o("waiting_for_user"),d(""),h(""),p(!1),v({}),x(null))},[e]);const w=mD[i],N=async C=>{C.preventDefault();const _={target:w!==null&&!c.trim(),reason:!f.trim()};if(v(_),_.target||_.reason)return;y(!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 O=await l(S);y(!1),x(O)};return s.jsx(Jn,{open:e,onOpenChange:C=>C?null:r(),children:s.jsx(es,{children:s.jsxs("form",{onSubmit:C=>void N(C),noValidate:!0,children:[s.jsxs(ts,{children:[s.jsx(ss,{children:"Add hold"}),s.jsx(as,{children:"Say what this task is waiting for."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[b&&s.jsxs(ce,{variant:"destructive",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(ue,{children:b})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"hold-type",children:"Type"}),s.jsxs(ct,{value:i,onValueChange:C=>{o(C),d(""),v({})},children:[s.jsx(nt,{id:"hold-type",children:s.jsx(ut,{})}),s.jsx(st,{children:Object.keys(Ki).map(C=>s.jsx(_e,{value:C,children:Ki[C].label},C))})]})]}),w?s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"hold-target",children:w.label}),i==="waiting_for_external"?s.jsx(St,{id:"hold-target",value:c,"aria-invalid":j.target,onChange:C=>d(C.target.value)}):s.jsxs(ct,{value:c,onValueChange:d,children:[s.jsx(nt,{id:"hold-target","aria-invalid":j.target,children:s.jsx(ut,{placeholder:i==="blocked"?"Choose a task":"Choose a member"})}),s.jsx(st,{children:i==="blocked"?n.map(C=>s.jsx(_e,{value:C.id,children:C.title},C.id)):t.map(C=>s.jsx(_e,{value:C.user_id,children:C.label},C.user_id))})]}),s.jsx("p",{className:j.target?"text-destructive text-xs":"text-muted-foreground text-xs",children:j.target?"Choose what it waits for.":w.help})]}):s.jsx("p",{className:"text-muted-foreground text-xs",children:"You resume it yourself."}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"hold-reason",children:"Reason"}),s.jsx(rs,{id:"hold-reason",rows:3,placeholder:"What the task is waiting for",value:f,"aria-invalid":j.reason,onChange:C=>h(C.target.value)}),j.reason&&s.jsx("p",{className:"text-destructive text-xs",children:"Give a reason."})]}),a&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{id:"hold-release-claim",checked:m,onCheckedChange:C=>p(C===!0)}),s.jsx(Me,{htmlFor:"hold-release-claim",children:"Also release my claim"})]})]}),s.jsxs(ns,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:g,children:g?"Adding…":"Add hold"})]})]})})})}function Eo(){const e=nn().tasks;if(!e)throw new Error("The Task page rendered without the tasks seam.");return e}function sx(){return s.jsxs("div",{className:"grid gap-3",role:"status","aria-label":"Loading task",children:[s.jsx(at,{className:"h-8 w-1/2"}),Array.from({length:7},(e,t)=>s.jsx(at,{className:t===6?"h-6 w-2/3":"h-6 w-full"},t))]})}function ju({back:e,description:t}){const{href:n,Link:a}=Ve();return s.jsx(ta,{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 Rr="not_set",xD=10*60*1e3,$v=20;function gD(){const{members:e}=Eo(),[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 vD({active:e,task_id:t,back:n}){const a=Eo(),{task:r,activity:l,listTasks:i,hierarchyRevision:o,commands:c}=a,{href:d,Link:f}=Ve(),h=$l(),{self_id:m}=Ku(),{members:p,name:j}=gD(),{workspace:v}=e,{confirm:b,confirm_dialog:x}=_o(),[g,y]=u.useState(null),[w,N]=u.useState(!1),[C,_]=u.useState(!1),[S,O]=u.useState(null),[D,I]=u.useState([]),[P,M]=u.useState($v),[U,R]=u.useState([]),[T,E]=u.useState(!1),[k,$]=u.useState(null),[V,A]=u.useState(null),[G,W]=u.useState(""),[Z,ge]=u.useState(null),Y=u.useCallback(async()=>{if(!r)return;const L=await r(t);L.ok?(y(L.data),_(!1)):L.refusal.status===404||L.refusal.status===400?N(!0):_(!0)},[r,t]),z=u.useRef(0),X=u.useCallback(async()=>{if(!l)return;const L=z.current+=1;let be=[],J;for(;;){const we=await l(t,J);if(L!==z.current||!we.ok)return;if(be=[...be,...we.data.events].slice(-1e3),!we.data.more||!we.data.next_cursor)break;J=we.data.next_cursor}L===z.current&&I(be.reverse())},[l,t]);u.useEffect(()=>{Y(),X()},[Y,X]);const te=g?v.lists.find(L=>L.id===g.task.list_id):void 0,he=u.useMemo(()=>{var L;return((L=v.workflows.find(be=>be.id===(g==null?void 0:g.task.workflow_id)))==null?void 0:L.statuses)??[]},[v,g==null?void 0:g.task.workflow_id]);u.useEffect(()=>{if(!g)return;let L=!0;return i(g.task.list_id,{limit:100}).then(be=>{L&&R(be.ok?be.data.tasks.filter(J=>J.id!==g.task.id).map(J=>({id:J.id,title:J.title})):[])}),()=>{L=!1}},[i,g==null?void 0:g.task.list_id,g==null?void 0:g.task.id,g]);const pe=u.useCallback(async()=>{await Promise.all([Y(),X()])},[Y,X]),re=u.useCallback((L,be)=>c?c.run(L,be):Promise.resolve({ok:!1,refusal:{status:0,message:"This page cannot change tasks."}}),[c]),ve=u.useCallback(async(L,be,J)=>{const we=await re(L,be);return we.ok?(J&&h.success(J),await pe(),we.data):(we.refusal.code==="revision_conflict"?O({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 Y(),O({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 pe(),null)},[re,h,pe,Y]),ee=(g==null?void 0:g.claim)??null,ht=ee!==null&&ee.id===Z&&!ee.lapsed&&!ee.via?ee.id:null;if(u.useEffect(()=>{if(!ht)return;const L=window.setInterval(()=>{re("renew_claim",{claim_id:ht,lease_seconds:Mv}).then(()=>Y())},xD);return()=>window.clearInterval(L)},[ht,re,Y]),w)return s.jsx(ju,{back:n});if(C&&!g)return s.jsxs(ce,{variant:"destructive",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This task could not be loaded"}),s.jsxs(ue,{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 Y(),children:"Retry"})]})]});if(!g)return s.jsx(sx,{});const{task:de}=g,Ie=de.archived_at!==null,K=bu(g.permission,"write")&&!Ie,ke=bu(g.permission,"manage"),De=he.find(L=>L.id===de.status_id),xt=he.find(L=>L.category==="completed"),ye=v.priorities.find(L=>L.id===de.priority_id),Ct=g.contributors.map(L=>L.user_id),Ut=ee!==null&&ee.user_id===m,yn=ee!==null&&!ee.lapsed,Cs=g.checklist.filter(L=>L.is_complete).length,bn=async()=>{const[L,be]=await Promise.all([i(de.list_id,{limit:1}),o(v.id)]);return L.ok?be.ok?{ok:!0,data:{task_id:de.id,expected_revision:de.revision,expected_order_revision:L.data.list.order_revision,expected_hierarchy_revision:be.data}}:be:L},an=(L,be)=>ve("update_task",{task_id:de.id,expected_revision:de.revision,changes:L},be),Ts=L=>b(L.via==="sdlc_login"?{title:"Release this claim?",description:`You claimed it via ${Rf(L.via,L.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}),Rs=async()=>{if(!xt)return;if(yn&&(!Ut||ee.via)){const be=ee.via==="api_key"?`${Ut?"Your":`${j(ee.user_id)}'s`} agent is still working on it.`:ee.via==="sdlc_login"?`${Ut?"You are":`${j(ee.user_id)} is`} still working on it via ${Rf(ee.via,ee.via_device)}.`:`${j(ee.user_id)} is still working on it.`;if(!await b({title:"Complete this task?",description:be,action_label:"Mark complete"}))return}await an({status_id:xt.id},"Task completed.")!==null&&ee&&Ut&&yn&&await ve("end_claim",{claim_id:ee.id,outcome:"completed"})},ne=async(L,be)=>{const J=await bn();if(!J.ok){h.error(J.refusal.message);return}await ve(L,J.data,be)},Oe=async()=>{await b({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 ne("archive_task","Task archived.")},Ce=async()=>{await ne("restore_task","Task restored.")},Es=async()=>{var we;const L=ee,be=await ve("claim_task",{task_id:de.id,lease_seconds:Mv}),J=(we=be==null?void 0:be.claim)==null?void 0:we.id;J&&!(L&&L.id===J&&L.via)&&ge(J)},Dn=async()=>{ee&&(ee.via&&!await Ts(ee)||(await ve("end_claim",{claim_id:ee.id,outcome:"released"},"Claim released."),ge(null)))},zn=async()=>{ee&&await ve("end_claim",{claim_id:ee.id,outcome:"expired"},"Claim cleared.")},Tt=async L=>{L.hold_type==="paused"&&m&&(L={...L,target_user_id:m});const be=await re("open_hold",{task_id:de.id,hold_type:L.hold_type,reason:L.reason,...L.target_user_id?{target_user_id:L.target_user_id}:{},...L.target_task_id?{target_task_id:L.target_task_id}:{},...L.target_label?{target_label:L.target_label}:{}});return be.ok?(E(!1),h.success("Hold added."),L.release_claim&&ee&&Ut&&!ee.via&&(await ve("end_claim",{claim_id:ee.id,outcome:"released"}),ge(null)),await pe(),null):be.refusal.message},rn=L=>ve("checklist",{task_id:de.id,expected_revision:de.revision,...L}),ls=async L=>{for(const be of L.filter(J=>!Ct.includes(J)))await ve("set_contributor",{task_id:de.id,expected_revision:de.revision,user_id:be,action:"add"});for(const be of g.contributors.filter(J=>!L.includes(J.user_id)))await ve("set_contributor",{task_id:de.id,expected_revision:de.revision,user_id:be.user_id,action:"remove",expected_contributor_revision:be.revision})},Ln=L=>{var J;if(L.target.kind==="user")return j(L.target.user_id,m);if(L.target.kind==="external")return L.target.label;if(L.target.hidden||!L.target.task_id)return"A task you cannot see";const be=L.target.task_id;return s.jsx(f,{className:"text-primary hover:underline",href:d(`${n}/${be}`),children:((J=U.find(we=>we.id===be))==null?void 0:J.title)??"Another task"})},sa=L=>L.target.kind==="user"&&L.target.user_id===m&&!L.released_at?s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void ve("release_hold",{hold_id:L.id},"Hold released."),children:"Release"}):K?s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void ve("resolve_hold",{hold_id:L.id},"Hold resolved."),children:"Resolve"}):null;return s.jsxs(s.Fragment,{children:[s.jsx(Gt,{title:de.title,description:`Created ${En(de.created_at)} by ${j(de.created_by,m)}`,actions:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[K&&s.jsxs(s.Fragment,{children:[s.jsxs(H,{type:"button",variant:"outline",onClick:()=>$(de.title),children:[s.jsx(Zu,{className:"mr-2 size-4","aria-hidden":"true"}),"Edit title"]}),xt&&de.status_id!==xt.id&&s.jsxs(H,{type:"button",variant:"outline",onClick:()=>void Rs(),children:[s.jsx(Ol,{className:"mr-2 size-4","aria-hidden":"true"}),"Mark complete"]})]}),ke&&!Ie&&s.jsxs(H,{type:"button",variant:"outline",onClick:()=>void Oe(),children:[s.jsx(ev,{className:"mr-2 size-4","aria-hidden":"true"}),"Archive"]})]}),children:k!==null?s.jsxs("form",{className:"flex flex-wrap items-center gap-2 pt-1",onSubmit:async L=>{L.preventDefault(),k.trim()&&await an({title:k.trim()})!==null&&$(null)},children:[s.jsx(Me,{htmlFor:"task-title",className:"sr-only",children:"Title"}),s.jsx(St,{id:"task-title",className:"max-w-xl",value:k,onChange:L=>$(L.target.value)}),s.jsx(H,{type:"submit",size:"sm",children:"Save"}),s.jsx(H,{type:"button",size:"sm",variant:"outline",onClick:()=>$(null),children:"Cancel"})]}):null}),S&&s.jsxs(ce,{variant:S.tone,className:"mt-4","data-testid":"task-notice",children:[S.tone==="warning"?s.jsx(vr,{className:"size-4","aria-hidden":"true"}):s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:S.title}),s.jsx(ue,{children:S.body})]}),Ie?s.jsxs(ce,{variant:"info",className:"mt-4",children:[s.jsx(ev,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This task is archived"}),s.jsx(ue,{children:ke?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 Ce(),children:[s.jsx(VC,{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."})})]}):K?null:s.jsxs(ce,{variant:"info",className:"mt-4",children:[s.jsx(vo,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"You can view this task"}),s.jsx(ue,{children:"Ask an organization admin for write access to change it."})]}),K?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(Me,{htmlFor:"task-status",children:"Status"}),s.jsxs(ct,{value:de.status_id,onValueChange:L=>void an({status_id:L}),children:[s.jsx(nt,{id:"task-status",children:s.jsx(ut,{})}),s.jsx(st,{children:he.map(L=>s.jsx(_e,{value:L.id,children:L.name},L.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"task-priority",children:"Priority"}),s.jsxs(ct,{value:de.priority_id??Rr,onValueChange:L=>void an({priority_id:L===Rr?null:L}),children:[s.jsx(nt,{id:"task-priority",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:Rr,children:"Not set"}),v.priorities.map(L=>s.jsx(_e,{value:L.id,children:L.name},L.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"task-primary",children:"Primary"}),s.jsxs(ct,{value:de.primary_user_id??Rr,onValueChange:L=>void an({primary_user_id:L===Rr?null:L}),children:[s.jsx(nt,{id:"task-primary",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:Rr,children:"Not set"}),p.map(L=>s.jsx(_e,{value:L.user_id,children:L.label},L.user_id))]})]})]}),s.jsx(yD,{members:p,selected:Ct,on_change:L=>void ls(L)})]}):s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(rc,{label:"Status",value:(De==null?void 0:De.name)??""}),s.jsx(rc,{label:"Priority",value:(ye==null?void 0:ye.name)??"Not set"}),s.jsx(rc,{label:"Primary",value:de.primary_user_id?j(de.primary_user_id,m):"Not set"}),s.jsx(rc,{label:"Contributors",value:Ct.map(L=>j(L,m)).join(", ")||"None"})]}),!Ie&&s.jsx(bD,{claim:ee,mine:Ut,holder:ee?j(ee.user_id):"",own:ee!==null&&ee.id===Z,can_write:K,on_claim:()=>void Es(),on_release:()=>void Dn(),on_clear:()=>void zn()}),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"}),K&&V===null&&s.jsx(H,{type:"button",variant:"ghost",size:"sm",onClick:()=>A(de.description??""),children:"Edit description"})]}),V!==null?s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async L=>{L.preventDefault(),await an({description:V})!==null&&A(null)},children:[s.jsx(Me,{htmlFor:"task-description",className:"sr-only",children:"Description"}),s.jsx(rs,{id:"task-description",rows:5,value:V,onChange:L=>A(L.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:()=>A(null),children:"Cancel"})]})]}):s.jsx("p",{className:"mt-2 text-sm whitespace-pre-wrap",children:de.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",g.checklist.length>0?` · ${Cs} of ${g.checklist.length} done`:""]}),s.jsx("ul",{className:"mt-2 grid gap-1",children:g.checklist.map(L=>s.jsxs("li",{className:"flex items-center justify-between gap-2 py-1","data-testid":"task-checklist-item",children:[K?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{id:`check-${L.id}`,checked:L.is_complete,onCheckedChange:be=>void rn({action:"toggle",item_id:L.id,expected_item_revision:L.revision,is_complete:be===!0})}),s.jsx(Me,{htmlFor:`check-${L.id}`,className:"font-normal",children:L.label})]}):s.jsxs("span",{className:"text-sm",children:[L.is_complete?"Done: ":"To do: ",L.label]}),K&&s.jsxs(xd,{children:[s.jsx(gd,{asChild:!0,children:s.jsx(H,{type:"button",variant:"ghost",size:"icon","aria-label":`Item actions for ${L.label}`,children:s.jsx(xp,{className:"size-4","aria-hidden":"true"})})}),s.jsx(To,{align:"end",children:s.jsx(_l,{className:"text-destructive focus:text-destructive",onSelect:()=>void rn({action:"archive",item_id:L.id,expected_item_revision:L.revision}),children:"Remove"})})]})]},L.id))}),g.checklist.length===0&&!K&&s.jsx("p",{className:"text-muted-foreground text-sm",children:"No checklist items."}),K&&s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async L=>{L.preventDefault(),G.trim()&&await rn({action:"add",label:G.trim()})!==null&&W("")},children:[s.jsx(Me,{htmlFor:"task-new-item",children:"Add an item"}),s.jsx(St,{id:"task-new-item",placeholder:"Add an item and press Enter",value:G,onChange:L=>W(L.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"}),K&&s.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!0),children:[s.jsx(b0,{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(le,{children:[s.jsx(F,{children:"Type"}),s.jsx(F,{children:"Reason"}),s.jsx(F,{children:"Waiting on"}),s.jsx(F,{className:"text-right",children:"Actions"})]})}),s.jsxs(Be,{children:[g.holds.map(L=>{const be=Ki[L.hold_type];return s.jsxs(le,{"data-testid":"task-hold",children:[s.jsx(q,{children:s.jsx(fe,{variant:be.tone,children:be.label})}),s.jsxs(q,{children:[s.jsx("div",{children:L.reason}),s.jsx("div",{className:"text-muted-foreground text-xs",children:L.released_at?`Released by ${j(L.released_by,m)} · ${En(L.released_at)} · Ready to resolve`:`Opened by ${j(L.opened_by,m)} · ${En(L.opened_at)} · Open`})]}),s.jsx(q,{children:Ln(L)}),s.jsx(q,{className:"text-right",children:sa(L)})]},L.id)}),g.holds.length===0&&s.jsx(le,{children:s.jsx(q,{colSpan:4,className:"text-muted-foreground h-16 text-center",children:"Nothing is holding this task."})})]})]})}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"A hold does not change the task's status. The person it waits on releases it; whoever can edit the task resolves it."})]}),s.jsxs("section",{className:"mt-6 pb-8","aria-labelledby":"task-activity-title",children:[s.jsx("h2",{id:"task-activity-title",className:"text-lg font-semibold",children:"Activity"}),s.jsxs("ul",{className:"mt-2 divide-y rounded-lg border",children:[D.slice(0,P).map(L=>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:sD(L)}),s.jsxs("span",{className:"min-w-0 text-right sm:text-left",children:[s.jsx("span",{children:L.actor_id?j(L.actor_id,m):"The system"}),L.via?s.jsxs("span",{className:"text-muted-foreground block max-w-64 truncate text-xs sm:max-w-none",title:`via ${Rf(L.via,L.via_device)}`,children:["via ",ex(L.via),s.jsx(vk,{via:L.via,device:L.via_device})]}):null]}),s.jsx("span",{className:"text-muted-foreground col-span-2 sm:col-span-1 sm:text-right",children:mk(L.created_at)})]},L.id)),D.length===0&&s.jsx("li",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No activity yet."})]}),D.length>P&&s.jsx(H,{type:"button",variant:"ghost",size:"sm",className:"mt-2",onClick:()=>M(L=>L+$v),children:"Load more"})]}),K&&te&&s.jsx(pD,{open:T,members:p,tasks:U,holds_my_web_claim:Ut&&yn&&!(ee!=null&&ee.via),on_close:()=>E(!1),on_submit:Tt}),x]})}function rc({label:e,value:t}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("dt",{className:"text-muted-foreground text-xs",children:e}),s.jsx("dd",{className:"text-sm",children:t})]})}function yD({members:e,selected:t,on_change:n}){return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"task-contributors",children:"Contributors"}),s.jsxs(xd,{children:[s.jsx(gd,{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(x0,{className:"text-muted-foreground size-4","aria-hidden":"true"})]})}),s.jsx(To,{align:"start",children:e.map(a=>{const r=t.includes(a.user_id);return s.jsxs(_l,{onSelect:()=>n(r?t.filter(l=>l!==a.user_id):[...t,a.user_id]),children:[r?s.jsx(Ol,{className:"mr-2 size-4","aria-hidden":"true"}):s.jsx("span",{className:"mr-2 size-4"}),a.label]},a.user_id)})})]})]})}function vk({via:e,device:t}){return e!=="sdlc_login"||!t?null:s.jsxs(s.Fragment,{children:[" on ",s.jsx("bdi",{children:t})]})}function bD({claim:e,mine:t,holder:n,own:a,can_write:r,on_claim:l,on_release:i,on_clear:o}){let c=s.jsx(gp,{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(pT,{className:"size-4","aria-hidden":"true"}),d=m?`${t?"Your":`${n}'s`} claim lapsed at ${Qn(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=Qn(e.lease_expires_at);c=e.via==="api_key"?s.jsx(pp,{className:"size-4","aria-hidden":"true"}):e.via==="sdlc_login"?s.jsx(LT,{className:"size-4","aria-hidden":"true"}):s.jsx(bR,{className:"size-4","aria-hidden":"true"});const p=s.jsxs(s.Fragment,{children:["Claimed via sdlc login",s.jsx(vk,{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:[p," 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=p):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 jD=10,yk=5,wD=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,bk="Not available",_D={added:"Added",changed:"Changed",removed:"Removed"},ND={thread:"Thread",task:"Task",issue:"Issue",release:"Release",test:"Test"},Ov=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;function kD(e,t){const n=t!=null&&t.startsWith("task:")?t.slice(5):null;if(n&&wD.test(n))return{label:n,path:`/org/${e}/tasks/${n}`};const a=t!=null&&t.startsWith("issue:")?t.slice(6):null;if(a&&/^iss-\d{1,9}$/.test(a))return{label:a,path:`/org/${e}/issues/${a}`};const r=t!=null&&t.startsWith("release:")?t.slice(8):null;if(r&&Ov.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&&Ov.test(l)?{label:`Planned Release ${l}`,path:`/releases?planned=${l}`}:{label:"Tasks",path:`/org/${e}/tasks`}}const jk=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function SD({org:e,task_id:t,from:n}){var Rs;const a=Eo(),{href:r,Link:l}=Ve(),{confirm:i,confirm_dialog:o}=_o(),c=kD(e,n),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState([]),[p,j]=u.useState([]),[v,b]=u.useState(null),[x,g]=u.useState(null),[y,w]=u.useState({state:"loading"}),[N,C]=u.useState({state:"loading"}),[_,S]=u.useState(null),[O,D]=u.useState(null),[I,P]=u.useState(!1),M=u.useRef(null),U=_s(),R=u.useRef(null),T=u.useRef(null),E=u.useRef(null),k=u.useRef(null),$=u.useRef(!1),V=u.useRef(0),A=u.useRef(0),G=u.useCallback(async()=>{if(!a.taskSections)return;w({state:"loading"});const ne=await a.taskSections(t);w(ne.ok?{state:"ok",data:ne.data}:{state:"failed",refusal:ne.refusal})},[a.taskSections,t]),W=u.useCallback(async()=>{if(!a.taskRelated)return;C({state:"loading"});const ne=await a.taskRelated(t);C(ne.ok?{state:"ok",data:ne.data}:{state:"failed",refusal:ne.refusal})},[a.taskRelated,t]),Z=u.useCallback(async()=>{var Dn,zn;const ne=A.current+=1;g(null),G(),W();const[Oe,Ce]=await Promise.all([a.availability(),a.task?a.task(t):Promise.resolve(null)]);if(ne!==A.current)return;Oe.state==="active"&&m(((Dn=Oe.workspace.workflows.find(Tt=>Tt.id===Oe.list.workflow_id))==null?void 0:Dn.statuses)??[]);const Es=Oe.state==="off"&&((zn=Oe.refusal)==null?void 0:zn.reason)==="engine_missing"?Oe.refusal:null;if(!Ce||!Ce.ok&&Ce.refusal.reason==="engine_missing"||Es){f({state:"engine_missing",refusal:Es??(Ce&&!Ce.ok?Ce.refusal:{status:0,message:""})});return}if(Ce.ok){V.current=0,b(null),D(null),f({state:"ok",detail:Ce.data,at:new Date().toISOString()});return}if(Ce.refusal.status===404||Ce.refusal.reason==="not_found"){f({state:"missing"});return}if(V.current+=1,V.current===1&&jk(Ce.refusal)){g(Ce.refusal.retry_after??jD);return}b(Ce.refusal),f(Tt=>Tt.state==="loading"?{state:"loading"}:Tt)},[a,t,G,W]);u.useEffect(()=>{Z()},[Z]),u.useEffect(()=>{if(x===null)return;const ne=setTimeout(()=>void Z(),x*1e3);return()=>clearTimeout(ne)},[x,Z]),u.useEffect(()=>{let ne=!0;return a.members().then(Oe=>{ne&&Oe.ok&&j(Oe.data)}),()=>{ne=!1}},[a.members]),u.useEffect(()=>{var Oe;if($.current||d.state!=="ok")return;$.current=!0;const ne=(Oe=M.current)==null?void 0:Oe.querySelector("h1");ne&&(ne.tabIndex=-1,ne.focus())},[d.state]),u.useEffect(()=>{var ne;_&&((ne=T.current)==null||ne.focus())},[_]),u.useEffect(()=>{if(O===null)return;const ne=setTimeout(()=>{var Oe;return(Oe=R.current)==null?void 0:Oe.focus()},0);return()=>clearTimeout(ne)},[O]);const ge=u.useMemo(()=>new Map(p.map(ne=>[ne.user_id,ne.label])),[p]),Y=ne=>ne?ge.get(ne)??ne:"",z=()=>{S(null),Z()},X=u.useRef(null),te=ne=>(X.current=ne,ne==="graph"?G():W());if(u.useEffect(()=>{var Ce;const ne=X.current;if(ne===null||(ne==="graph"?y:N).state==="loading")return;X.current=null;const Oe=(ne==="graph"?E:k).current??((Ce=M.current)==null?void 0:Ce.querySelector("h1"));Oe==null||Oe.focus()},[y,N]),d.state==="missing")return s.jsx(wa,{children:s.jsx(ju,{back:`/org/${e}/tasks`,description:`No task ${t} in this checkout. It may have finished and been archived, or never been recorded.`})});const he=s.jsx(H,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(l,{href:r(c.path),children:[s.jsx(mp,{className:"size-4","aria-hidden":"true"}),c.label]})});if(d.state==="engine_missing")return s.jsx(wa,{children:s.jsx("div",{ref:M,className:"contents",children:s.jsx(Ss,{page:"Task",header:s.jsx(Ci,{back:he,id:null,title:t})})})});const pe=v?s.jsxs(ce,{variant:"destructive",className:"mt-4",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Could not read this task"}),s.jsxs(ue,{children:[s.jsxs("p",{children:[v.message,v.since?` Since ${Yn(v.since)}.`:"",d.state==="ok"?` This page was read at ${Yn(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,re=x!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(en,{"aria-hidden":"true"}),"Could not read this task. Trying again in ",x," seconds."]}):null,ve=s.jsx("div",{role:"status","aria-live":"polite",children:re});if(d.state==="loading")return s.jsxs(wa,{children:[ve,pe,!v&&x===null?s.jsx(sx,{}):null]});const{detail:ee,at:ht}=d,{task:de}=ee,Ie=h.find(ne=>ne.id===de.status_id),K=ee.local_done&&"task"in ee.local_done?ee.local_done:null,ke=ee.local_waits??[],De=K?ke[0]??null:null,xt=De?Y(De.opened_by):ee.owner_title??Y(ee.thread),ye=y.state==="ok"?y.data:null,Ct=(ye==null?void 0:ye.lifecycle)==="finished",Ut=Ct&&(ye==null?void 0:ye.outcome)==="cancelled",yn=Ct&&(ye==null?void 0:ye.outcome)==="complete",Cs=!!de.created_at,bn=ee.acceptance??[],an=async()=>{var Ce;if(!K||!((Ce=a.commands)!=null&&Ce.complete)||!await i({title:`Mark ${de.title} done?`,description:De?`This answers ${xt}'s ask, “${De.reason}”, closes that wait, and tells ${xt} to check and continue.`:`This tells ${xt||"its thread"} to check and continue.`,action_label:"Mark done"}))return;P(!0);const Oe=await a.commands.complete(K);if(P(!1),!Oe.ok){D(Oe.refusal.message);return}await Z(),S({title:de.title,asker:xt||"Its thread"})},Ts=s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[K&&!_?s.jsxs(s.Fragment,{children:[s.jsxs(H,{ref:R,type:"button",variant:"outline",disabled:I,"aria-disabled":O!==null?!0:void 0,"aria-describedby":O!==null?"task-done-why":void 0,onClick:()=>{O===null&&an()},children:[s.jsx(Ol,{className:"mr-2 size-4","aria-hidden":"true"}),"Done"]}),O!==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 ",Yn(ht)]}),s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:z,children:[s.jsx(vr,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsxs(wa,{children:[s.jsxs("div",{ref:M,className:"contents",children:[s.jsx(Ci,{back:he,id:de.id,badge:Ie?s.jsx(fe,{variant:hk(Ie),children:Ie.name}):null,title:de.title,created:Cs?`Created ${En(de.created_at)}${xt||ee.owner_title?` by ${ee.owner_title??xt}`:""}`:null,actions:Ts}),ve,pe,_?s.jsx("div",{ref:T,tabIndex:-1,role:"status","aria-live":"polite",className:"outline-none",children:s.jsxs(ce,{variant:"success",className:"mt-4",children:[s.jsx(Qu,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Marked ",_.title," done"]}),s.jsxs(ue,{children:[_.asker," is told to check and continue."]})]})}):null,O!==null?s.jsxs(ce,{variant:"destructive",className:"mt-4",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Done was not recorded"}),s.jsxs(ue,{children:[O," Read again to see the task as it is now."]})]}):null,De&&!_?s.jsxs(ce,{variant:"warning",className:"mt-4",children:[s.jsx(Lt,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:[xt," asks: ",De.reason]}),s.jsxs(ue,{children:["Waiting on you since ",tx(De.opened_at),". Done answers it and tells ",xt," to check and continue."]})]}):null,ee.view_outdated?s.jsxs(ce,{variant:"warning",className:"mt-4",children:[s.jsx(Lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:Dl}),s.jsxs(ue,{children:[U," 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(hs,{label:"Owner thread",value:ee.owner_title??(Y(ee.thread)||"None")}),s.jsx(hs,{label:"Release",value:ee.release??"None"}),s.jsx(hs,{label:"Session",value:y.state==="loading"?"Loading…":y.state==="failed"?"Not available":ye!=null&&ye.session?s.jsxs(s.Fragment,{children:[ye.session.provider," ",s.jsx("span",{className:"font-mono break-all",children:ye.session.id})]}):"None"}),s.jsx(hs,{label:"Now",value:ee.local_detail??(Ie==null?void 0:Ie.name)??""})]}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"Local tasks have no priority or contributors."}),s.jsx(CD,{detail:ee,holder:Y((Rs=ee.claim)==null?void 0:Rs.user_id),finished_at:Ct?(ye==null?void 0:ye.finished_at)??null:null,read_at:ht}),s.jsxs(ce,{variant:"info",className:"mt-4",children:[s.jsx(vo,{className:"text-info size-4","aria-hidden":"true"}),K?s.jsxs(s.Fragment,{children:[s.jsx(xe,{children:"Done is the one change this page makes"}),s.jsx(ue,{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(ue,{children:"A task changes through the agent thread working on it."})]})]}),Cs?ye!=null&&ye.record?s.jsxs("p",{className:"mt-4 text-sm",children:["Record ",s.jsx("span",{className:"font-mono break-all",children:ye.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."}),K?s.jsx(vt,{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; ",xt||"its thread"," checks these after Done."]}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:bn.map(ne=>s.jsx("li",{children:ne},ne))})]}):s.jsxs("p",{className:"text-sm",children:["Its thread gave no acceptance. Ask ",xt||"its thread"," what Done needs before marking it."]})}):bn.length>0?s.jsxs(vt,{id:"task-acceptance",title:"Acceptance",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:yn?"All met: the task finished complete":Ut&&(ye!=null&&ye.finished_at)?`Cancelled ${En(ye.finished_at)}`:"Met when the task finishes complete"}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:bn.map(ne=>s.jsx("li",{children:yn?`Met: ${ne}`:ne},ne))})]}):null,s.jsx(TD,{detail:ee,waits:ke,given:K!==null,threadName:Y,threadsLink:s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/threads`),children:"Threads"})}),y.state==="loading"?s.jsxs("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading the task's sections",children:[s.jsx(at,{className:"h-8 w-full"}),s.jsx(at,{className:"h-8 w-full"}),s.jsx(at,{className:"h-8 w-2/3"})]}):null,ye?s.jsx(vt,{id:"task-stands",title:"Where it stands",children:s.jsxs("p",{className:"text-sm",children:[(Ie==null?void 0:Ie.name)??de.status_id,ee.local_detail?` · ${ee.local_detail}`:""]})}):null,ye!=null&&ye.time?s.jsx(RD,{time:ye.time}):null,s.jsx(ED,{sections:y,heading_ref:E,on_retry:()=>void te("graph"),taskLink:ne=>s.jsx(l,{className:"text-primary hover:underline",href:r(`/org/${e}/tasks/${ne}?from=task:${de.id}`),children:ne})}),ye!=null&&ye.files?s.jsx(AD,{files:ye.files,finished:Ct}):null,ye!=null&&ye.proof?s.jsx(MD,{proof:ye.proof,finished_at:ye.finished_at,who:ee.owner_title??null}):null,ye&&ye.history.length>0?s.jsx($D,{history:ye.history}):null,s.jsx(wk,{related:N,heading_ref:k,on_retry:()=>void te("related"),link:ne=>{const Oe=ne.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(ne.id)}`:ne.kind==="task"?`/org/${e}/tasks/${ne.id}?from=task:${de.id}`:ne.kind==="issue"?`/org/${e}/issues/${encodeURIComponent(ne.id)}?from=task:${de.id}`:ne.kind==="release"?`/releases?${ne.planned?"planned":"release"}=${encodeURIComponent(ne.id)}`:null;return Oe?s.jsx(l,{className:se("text-primary hover:underline",ne.kind!=="thread"&&ne.label===ne.id&&"font-mono"),href:r(Oe),children:ne.label}):ne.label}})]}),o]})}function wa({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 Ci({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(Gt,{title:a,description:r??void 0,actions:l})]})}function hs({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 vt({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 CD({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(gp,{className:"size-4","aria-hidden":"true"}),c="Nobody is working on this",d=null;if(e.view_outdated)c=`Claimed by: ${bk}`;else if(r){const f=new Date(r.lease_expires_at)<=new Date(Math.max(Date.now(),new Date(a).getTime()));o=s.jsx(pp,{className:"size-4","aria-hidden":"true"}),c=`${t} is working on this until ${Yn(r.lease_expires_at)}${f||r.lapsed?" · passed":""}`,d="Claimed in the coordination registry; its thread renews the claim."}else n&&(o=s.jsx(Qu,{className:"size-4","aria-hidden":"true"}),d=`Finished ${En(n)}. Its claim ended when it finished.`);return s.jsxs(jt,{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 TD({detail:e,waits:t,given:n,threadName:a,threadsLink:r}){if(e.view_outdated)return s.jsx(vt,{id:"task-holds",title:"Holds",children:s.jsx("p",{className:"text-sm",children:bk})});if(e.holds.length===0)return null;const l=new Map(t.map(i=>[i.id,i]));return s.jsxs(vt,{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(jt,{className:"mt-2 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Holds",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Type"}),s.jsx(F,{children:"Reason"}),s.jsx(F,{children:"Waiting on"}),s.jsx(F,{children:"Opened"})]})}),s.jsx(Be,{children:e.holds.map(i=>{var f;const o=l.get(i.id),c=Ki[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(le,{"data-testid":"task-hold",children:[s.jsx(q,{children:s.jsx(fe,{variant:c.tone,children:(o==null?void 0:o.local_label)??c.label})}),s.jsxs(q,{children:[s.jsx("div",{children:i.reason}),s.jsxs("div",{className:"text-muted-foreground text-xs",children:["Opened by ",a(i.opened_by)]})]}),s.jsxs(q,{children:[s.jsx("div",{children:i.target.kind==="user"?"You":i.target.kind==="external"?i.target.label:"Another task"}),d?s.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null]}),s.jsx(q,{children:tx(i.opened_at)})]},i.id)})})]})})]})}function RD({time:e}){return s.jsx(vt,{id:"task-time",title:"Time",children:s.jsxs("dl",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsx(hs,{label:"Estimate",value:e.estimate?`${Jl(e.estimate.low)}–${Jl(e.estimate.high)}`:e.unknown_reason??"None"}),s.jsx(hs,{label:"Time taken",value:e.elapsed!==null?`${Jl(e.elapsed)}${e.over_estimate?" · over estimate":""}`:"Not started"}),e.forecast?s.jsx(hs,{label:"Reforecast",value:s.jsxs("span",{className:"text-muted-foreground",children:[Jl(e.forecast.low),"–",Jl(e.forecast.high)," left",e.forecast.reason?` · ${e.forecast.reason}`:""]})}):null]})})}function ax({what:e,again:t,refusal:n,on_retry:a}){return s.jsxs(ce,{variant:"destructive",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Could not read ",e]}),s.jsxs(ue,{children:[s.jsx("p",{children:n.message}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:t})]})]})}function ED({sections:e,heading_ref:t,on_retry:n,taskLink:a}){const[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(vt,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsx(ax,{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(vt,{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,yk),d=o.changes.length-c.length;return s.jsxs(vt,{id:"task-graph",title:"Graph changes",aside:o.document,heading_ref:t,children:[s.jsx(jt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Graph changes",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Change"}),s.jsx(F,{children:"Kind of change"}),s.jsx(F,{children:"Also in"}),s.jsx(F,{children:"In the plan"})]})}),s.jsx(Be,{children:c.map(f=>s.jsxs(le,{children:[s.jsxs(q,{children:[s.jsx("div",{children:f.label}),s.jsx("div",{className:"text-muted-foreground text-xs",children:f.type})]}),s.jsx(q,{children:_D[f.change]}),s.jsx(q,{children:f.also_in.length===0?"No other task":f.also_in.map((h,m)=>s.jsxs(u.Fragment,{children:[m>0?", ":null,a(h.id)]},h.id))}),s.jsx(q,{children:f.planned?"Yes":s.jsx(fe,{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 AD({files:e,finished:t}){const[n,a]=u.useState(!1),r=n?e.paths:e.paths.slice(0,yk);return s.jsxs(vt,{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 MD({proof:e,finished_at:t,who:n}){return s.jsxs(vt,{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 ",En(t),n?` by ${n}`:""]}):null]})}function $D({history:e}){return s.jsxs(vt,{id:"task-history",title:"History",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"From the task record, newest first"}),s.jsx(jt,{className:"mt-2 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"History",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"What"}),s.jsx(F,{children:"Who"}),s.jsx(F,{children:"When"})]})}),s.jsx(Be,{children:e.map((t,n)=>s.jsxs(le,{children:[s.jsx(q,{children:t.what}),s.jsx(q,{children:t.who??"Its thread"}),s.jsx(q,{children:tx(t.at)})]},`${t.at}:${n}`))})]})})]})}function wk({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(vt,{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(at,{className:"h-8 w-full"}),s.jsx(at,{className:"h-8 w-full"}),s.jsx(at,{className:"h-8 w-2/3"})]}):t.state==="failed"?s.jsx(ax,{what:"related work",again:"Read related work again",refusal:t.refusal,on_retry:a}):s.jsx(jt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Related",className:l?"table-fixed":void 0,children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{className:l?"w-[14%]":void 0,children:"Kind"}),s.jsx(F,{className:l?"w-[45%]":void 0,children:"Item"}),s.jsx(F,{className:l?"w-[41%]":void 0,children:"How it relates"})]})}),s.jsx(Be,{children:t.data.map(i=>s.jsxs(le,{children:[s.jsx(q,{children:ND[i.kind]}),s.jsx(q,{className:l?"break-words":void 0,children:r(i)}),s.jsx(q,{className:l?"break-words":void 0,children:i.relation})]},`${i.kind}:${i.planned?"planned:":""}${i.id}`))})]})})})}function OD({org:e,task_id:t,from:n}){const a=Eo(),r=`/org/${e}/tasks`;return a.taskSections?s.jsx(SD,{org:e,task_id:t,from:n??null}):s.jsx(DD,{task_id:t,back:r})}function DD({task_id:e,back:t}){const{availability:n}=Eo(),[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(ju,{back:t}):s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:a.state==="active"?s.jsx(vD,{active:a,task_id:e,back:t}):a.state==="error"?s.jsxs(ce,{variant:"destructive",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This task could not be loaded"}),s.jsx(ue,{children:"Check your connection and try again."})]}):a.state==="available"?s.jsx(ju,{back:t}):s.jsx(sx,{})})}function Pn({children:e}){return s.jsx("p",{role:"alert",className:"text-destructive text-sm",children:e})}const zD=["open","triaged","resolved","closed"],rx=["low","normal","high","urgent"],LD=["fixed","works_as_intended","planned","duplicate","wont_fix","cannot_reproduce"],UD=["title","description","external_reference"],wu={open:"Open",triaged:"Triaged",escalated:"Escalated",waiting_on_fix:"Waiting on fix",resolved:"Resolved",closed:"Closed"},_k={open:"warning",triaged:"info",escalated:"info",waiting_on_fix:"info",resolved:"success",closed:"neutral"},Qi={low:"Low",normal:"Normal",high:"High",urgent:"Urgent"},lx={fixed:"Fixed",works_as_intended:"Works as intended",planned:"Planned",duplicate:"Duplicate",wont_fix:"Won't fix",cannot_reproduce:"Cannot reproduce"},Nk={title:"Title",description:"Description",external_reference:"External reference"},BD=[["year",365*24*3600],["month",30*24*3600],["week",7*24*3600],["day",24*3600],["hour",3600],["minute",60]];function Rc(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 BD)if(Math.abs(n)>=l)return a.format(Math.round(n/l),r);return"just now"}function rm(e,t,n){const a=`/org/${encodeURIComponent(e)}/proj/${encodeURIComponent(t)}/support`;return n?`${a}/${encodeURIComponent(n)}`:a}function ix(e,t){return e?t??"Not available":"A former member"}const HD="the issue integration";function ID(e){return!e.created_by&&e.reporter_kind==="customer"?HD:ix(e.created_by,e.created_by_username)}function PD(e,t){return!e.actor_id&&e.kind==="created"&&t.reporter_kind==="customer"?"The issue integration":ix(e.actor_id,e.actor_username)}const lc="not_set",qD="Do not paste personal data. Leave out names, such as borrower names, and loan numbers; text shaped like an email address, phone number, or social security number is refused.";function GD({create:e,open:t,onOpenChange:n,onCreated:a}){const[r,l]=u.useState(""),[i,o]=u.useState(""),[c,d]=u.useState(!1),[f,h]=u.useState(""),[m,p]=u.useState(lc),[j,v]=u.useState(!1),[b,x]=u.useState(null),g=u.useRef(null),y=()=>{l(""),o(""),d(!1),h(""),p(lc),x(null),g.current=null},w=_=>{var S;return((S=b==null?void 0:b.personal_data)==null?void 0:S.field)===_?b.message:void 0},N=async _=>{if(_.preventDefault(),j)return;v(!0),g.current??(g.current=crypto.randomUUID());const S=await e({request_id:g.current,title:i.trim()||void 0,description:f||void 0,external_reference:r.trim()||void 0,priority:m===lc?null:m});if(v(!1),!S.ok){S.refusal.status!==0&&(g.current=null),x(S.refusal);return}y(),a(S.data.issue,S.data.duplicates)},C=b&&!b.personal_data?b.message:void 0;return s.jsx(Jn,{open:t,onOpenChange:_=>{_||y(),n(_)},children:s.jsx(es,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:N,className:"grid gap-4",children:[s.jsxs(ts,{children:[s.jsx(ss,{children:"New support issue"}),s.jsx(as,{children:"Log one help-desk report. Text is shown exactly as entered."})]}),s.jsxs(ce,{variant:"warning",children:[s.jsx(Lt,{}),s.jsx(ue,{children:qD})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-issue-reference",children:"External reference"}),s.jsx(St,{id:"maintain-issue-reference",value:r,"aria-invalid":!!w("external_reference"),onChange:_=>{l(_.target.value),c||o(_.target.value)}}),w("external_reference")?s.jsx(Pn,{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(Me,{htmlFor:"maintain-issue-title",children:"Title"}),s.jsx(St,{id:"maintain-issue-title",value:i,"aria-invalid":!!w("title"),onChange:_=>{o(_.target.value),d(!0)}}),w("title")?s.jsx(Pn,{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(Me,{htmlFor:"maintain-issue-description",children:"Description"}),s.jsx(rs,{id:"maintain-issue-description",rows:4,placeholder:"What the end user reported, without personal data",value:f,"aria-invalid":!!w("description"),onChange:_=>h(_.target.value)}),w("description")?s.jsx(Pn,{children:w("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-issue-priority",children:"Priority"}),s.jsxs(ct,{value:m,onValueChange:p,children:[s.jsx(nt,{id:"maintain-issue-priority",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:lc,children:"Not set"}),rx.map(_=>s.jsx(_e,{value:_,children:Qi[_]},_))]})]})]}),C?s.jsx(Pn,{children:C}):null,s.jsxs(ns,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>{y(),n(!1)},children:"Cancel"}),s.jsx(H,{type:"submit",loading:j,disabled:!i.trim()&&!r.trim(),children:"Log issue"})]})]})})})}const VD=["supportAccess","assigneeCandidates","create","update","assign","transition","redact"];function kk(){return YD(nn().issues)}function YD(e){return e&&VD.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 Ck({access:e,header:t,back_href:n,children:a}){const{href:r,Link:l}=Ve();return e.state==="loading"?s.jsxs("div",{className:"flex flex-1 items-center justify-center py-24",children:[s.jsx(en,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Loading…"})]}):e.state==="error"||!e.access.enabled?s.jsx(ta,{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(VT,{className:"text-muted-foreground size-8","aria-hidden":!0}),s.jsx("h2",{className:"text-lg font-semibold",children:"Support needs a Maintain seat"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:e.access.seat?"You need read permission on this project to see its support issues; ask an organization admin.":"You need a Maintain seat to see this project's support issues; ask an organization admin."})]})]})}function FD(){const e=Ve();return t=>{e.navigate?e.navigate(t):window.location.assign(e.href(t))}}const cn="all",ic=25;function lm({action:e}){return s.jsx(Gt,{title:"Support",description:"Help-desk reports logged against this project.",actions:e})}function XD({org:e,project:t,query:n}){const a=kk(),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(Ck,{access:r,header:s.jsx(lm,{}),back_href:l,children:i=>a?s.jsx(KD,{contract:a,access:i,org_name:e,proj_name:t,query:n}):null})})}function KD({contract:e,access:t,org_name:n,proj_name:a,query:r}){const{href:l,Link:i}=Ve(),o=FD(),[c,d]=u.useState(()=>new URLSearchParams(r).get("external_reference")??""),[f,h]=u.useState(cn),[m,p]=u.useState(cn),[j,v]=u.useState(cn),[b,x]=u.useState(0),[g,y]=u.useState(null),[w,N]=u.useState(0),[C,_]=u.useState(null),[S,O]=u.useState([]),[D,I]=u.useState(!1),P=c.trim()!==""||f!==cn||m!==cn||j!==cn,M=u.useCallback(async()=>{const k=await e.list({external_reference:c.trim()||void 0,status:f===cn?void 0:f,priority:m===cn?void 0:m,assignee:j===cn?void 0:j,limit:ic,offset:b*ic});if(!k.ok){_(k.refusal.message);return}_(null),y(k.data.issues),N(k.data.total)},[e,c,f,m,j,b]);u.useEffect(()=>{const k=setTimeout(()=>void M(),200);return()=>clearTimeout(k)},[M]),u.useEffect(()=>{e.assigneeCandidates().then(k=>{k.ok&&O(k.data.candidates)})},[e]);const U=t.can_change?s.jsxs(H,{onClick:()=>I(!0),children:[s.jsx(jl,{className:"mr-2 size-4"}),"New issue"]}):void 0,R=s.jsx(GD,{create:e.create,open:D,onOpenChange:I,onCreated:(k,$)=>{I(!1);const V=rm(n,a,k.id);o($.length?`${V}?duplicates=${$.length}`:V)}});if(g!==null&&w===0&&!P&&b===0)return s.jsxs(s.Fragment,{children:[s.jsx(lm,{}),s.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[s.jsx(BT,{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:()=>I(!0),children:[s.jsx(jl,{className:"mr-2 size-4"}),"Log the first issue"]}):null]}),R]});const T=w===0?0:b*ic+1,E=Math.min(w,(b+1)*ic);return s.jsxs(s.Fragment,{children:[s.jsx(lm,{action:U}),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(uR,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2","aria-hidden":!0}),s.jsx(St,{"aria-label":"Filter by external reference",placeholder:"Filter by external reference",className:"pl-9",value:c,onChange:k=>{d(k.target.value),x(0)}})]}),s.jsx(Af,{label:"Status",value:f,onChange:k=>{h(k),x(0)},options:zD.map(k=>({value:k,label:wu[k]}))}),s.jsx(Af,{label:"Priority",value:m,onChange:k=>{p(k),x(0)},options:rx.map(k=>({value:k,label:Qi[k]}))}),s.jsx(Af,{label:"Assignee",value:j,onChange:k=>{v(k),x(0)},options:[{value:"unassigned",label:"Unassigned"},{value:"cannot_act",label:"Assignee cannot act"},...S.map(k=>({value:k.user_id,label:k.username??"Not available"}))]})]}),C?s.jsx(Pn,{children:C}):null,s.jsx("div",{className:"rounded-md border",children:s.jsxs(Ue,{children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Title"}),s.jsx(F,{children:"External reference"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Priority"}),s.jsx(F,{children:"Assignee"}),s.jsx(F,{children:"Updated"})]})}),s.jsx(Be,{children:g===null?s.jsx(le,{children:s.jsx(q,{colSpan:6,className:"h-24 text-center",children:"Loading…"})}):g.length===0?s.jsx(le,{children:s.jsx(q,{colSpan:6,className:"h-24 text-center",children:"No issues match these filters."})}):g.map(k=>s.jsxs(le,{children:[s.jsx(q,{className:"max-w-md",children:s.jsx(i,{href:l(rm(n,a,k.id)),className:"font-medium hover:underline",children:k.title})}),s.jsx(q,{className:"font-mono text-xs",children:k.external_reference??""}),s.jsx(q,{children:s.jsx(fe,{variant:_k[k.status],children:wu[k.status]})}),s.jsx(q,{children:k.priority?Qi[k.priority]:""}),s.jsx(q,{children:s.jsx(QD,{issue:k})}),s.jsx(q,{className:"text-muted-foreground",children:Rc(k.updated_at)})]},k.id))})]})}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:w===0?"No issues.":`Showing ${T}–${E} of ${w} issue${w===1?"":"s"}.`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(H,{variant:"outline",size:"sm",disabled:b===0,onClick:()=>x(k=>Math.max(0,k-1)),children:"Previous"}),s.jsx(H,{variant:"outline",size:"sm",disabled:E>=w,onClick:()=>x(k=>k+1),children:"Next"})]})]}),R]})}function QD({issue:e}){return e.assignee_id?s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{children:e.assignee_username??"Not available"}),e.assignee_can_act===!1?s.jsx(fe,{variant:"error",children:"Assignee cannot act"}):null]}):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}function Af({label:e,value:t,onChange:n,options:a}){var l;const r=u.useMemo(()=>t===cn||a.some(i=>i.value===t),[a,t]);return s.jsxs(ct,{value:r?t:cn,onValueChange:n,children:[s.jsx(nt,{className:"w-44","aria-label":e,children:s.jsx(ut,{placeholder:e,children:t===cn?e:(l=a.find(i=>i.value===t))==null?void 0:l.label})}),s.jsxs(st,{children:[s.jsx(_e,{value:cn,children:"All"}),a.map(i=>s.jsx(_e,{value:i.value,children:i.label},i.value))]})]})}const Tk=[{key:"local",label:"Local"},{key:"staging",label:"Staging"},{key:"production",label:"Production"}],ZD=/^iss-\d{1,9}$/,WD=/^col-\d{1,9}$/,JD=e=>e&&e[0].toUpperCase()+e.slice(1);function Rk(e){const t=JD(e.status_word??e.status.replace(/_/g," ")),n=e.group??(e.status==="resolved"?"resolved":"unplaced");return n==="resolved"?{label:t,tone:e.resolution_reason==="fixed"?"success":"neutral"}:n==="unowned"||n==="routed"?{label:t,tone:"warning"}:n==="fixing"?{label:t,tone:"info"}:{label:t,tone:"neutral"}}function Ti(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 im={search:"",owner:null,urgent:!1,seen:[],label:null,collection:null};function Ec(e){const t=new URLSearchParams(e),n=t.getAll("seen").filter(r=>Tk.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&&WD.test(a)?a:null}}function Kr(e){const t=new URLSearchParams;e.search&&t.set("search",e.search),e.owner&&t.set("owner",e.owner),e.urgent&&t.set("urgent","1");for(const n of e.seen)t.append("seen",n);return e.label&&t.set("label",e.label),e.collection&&t.set("collection",e.collection),t.toString()}function e3(e){return{search:e.search.trim()||void 0,owner:e.owner??void 0,urgent:e.urgent||void 0,seen:e.seen.length?e.seen:void 0,label:e.label?[e.label]:void 0,collection:e.collection??void 0}}const Dv=e=>!!(e.search.trim()||e.owner||e.urgent||e.seen.length||e.label||e.collection),t3={agent:"Filed by an agent",user:"Filed by you",tool:"Filed by a tool"},n3={graph:"Placed on the graph by its anchors",files:"Placed by its files",unplaced:"Triaged, not placed yet"},s3={handoff:"Handed to its owner",backlog:"Sent to the unowned backlog",batch:"Routed to a batch"};function a3(e,t=""){const n=(e??t).trim();if(!n)return"";const a=n.indexOf(": "),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 t3[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 n3[l]??(l?`Triaged: ${l}`:"Triaged");case"routed":return s3[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 r3=e=>e.replace(/`+/g,"").replace(/\s+/g," ").trim(),Ek="This page only reads issues",Ak="File, route and resolve issues with the issue command or through the thread working on them.",l3=10,i3=250,Er="__all",o3="none",c3=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function Mk(){const e=nn().issues;if(!e)throw new Error("The Issues page rendered without the issues seam.");return e}const u3=e=>({read_at:e,scope:"project",folder:null,groups:[],facets:{owners:[],labels:[],urgent:0,seen:{local:0,staging:0,production:0}},listed:0,collections:[]});function d3({project:e,query:t,onQuery:n}){var Y;const a=Mk(),{href:r,Link:l}=Ve(),i=u.useMemo(()=>Ec(t),[t]),o=Kr(i),c=Dv(i),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState(null),[p,j]=u.useState(null),v=u.useRef(0),b=u.useRef(0),x=u.useRef(null),g=u.useRef(null),y=_s(),w=u.useRef(!1),[N,C]=u.useState(i.search),_=u.useCallback(z=>n(Kr({...i,...z})),[i,n]),S=u.useCallback(async()=>{const z=b.current+=1;j(null);const X=await a.list(e3(Ec(o)));if(z!==b.current)return;if(X.ok){v.current=0,m(null),f({state:"ok",list:X.data,local:X.data.local??u3(new Date().toISOString()),key:o});return}const te=X.refusal.reason;if(te==="engine_missing")return f({state:"engine_missing",refusal:X.refusal});if(te==="view_outdated")return f({state:"view_outdated"});if(v.current+=1,v.current===1&&c3(X.refusal)){j(X.refusal.retry_after??l3);return}m(X.refusal)},[a.list,o]);u.useEffect(()=>{S()},[S]),u.useEffect(()=>{if(p===null)return;const z=setTimeout(()=>void S(),p*1e3);return()=>clearTimeout(z)},[p,S]),u.useEffect(()=>{document.activeElement!==x.current&&C(i.search)},[i.search]),u.useEffect(()=>{if(N===i.search)return;const z=setTimeout(()=>_({search:N}),i3);return()=>clearTimeout(z)},[N,i.search,_]),u.useEffect(()=>{const z=X=>{if(X.key!=="/"||X.metaKey||X.ctrlKey||X.altKey)return;const te=X.target;te&&(te.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(te.tagName))||x.current&&(X.preventDefault(),x.current.focus())};return window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)},[]);const O=()=>{var z;C(""),n(Kr(im)),(z=x.current)==null||z.focus()},D=()=>{v.current=0,S()},I=()=>{w.current=!0,D()};u.useEffect(()=>{var X;if(!w.current||d.state==="loading"||p!==null)return;w.current=!1;const z=(X=g.current)==null?void 0:X.querySelector("h1");z&&(z.tabIndex=-1,z.focus())},[d,h,p]);const P=z=>`/proj/${encodeURIComponent(e)}/issues${z?`?${z}`:""}`,M=z=>`/proj/${encodeURIComponent(e)}/issues/${encodeURIComponent(z)}?from=issues${o?`&${o}`:""}`,U=s.jsx("div",{role:"status","aria-live":"polite",children:p!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(en,{"aria-hidden":"true"}),"Issues are busy. Reading them again…"]}):null}),R=h?s.jsxs(ce,{variant:"destructive",className:"mt-4",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Issues could not be loaded"}),s.jsxs(ue,{children:[s.jsxs("p",{children:[h.message,h.since?` Since ${Yn(h.since)}.`:"",d.state==="ok"?` The list below was read at ${Yn(d.local.read_at)}.`:"",h.message.includes(or)?"":` ${or}`]}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:I,children:"Retry"})]})]}):null,T=s.jsx(Gt,{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 ",Yn(d.local.read_at)]}),s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:D,children:[s.jsx(vr,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]}):null});if(d.state==="engine_missing")return s.jsx(oc,{ref:g,children:s.jsx(Ss,{page:"Issues"})});if(d.state==="view_outdated")return s.jsxs(oc,{ref:g,children:[T,s.jsxs(ce,{variant:"warning",className:"mt-6",children:[s.jsx(Lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:Dl}),s.jsx(ue,{children:y})]})]});if(d.state==="loading")return s.jsxs(oc,{ref:g,children:[T,U,R,!h&&p===null?s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading issues",children:Array.from({length:6},(z,X)=>s.jsx(at,{className:X===5?"h-10 w-2/3":"h-10 w-full"},X))}):null]});const{list:E,local:k}=d,$=!h&&p===null&&(d.key!==o||N!==i.search),V=Dv(Ec(d.key)),A=k.scope==="folder",G=k.listed===0&&!c,W=Math.max(0,k.listed-k.facets.owners.reduce((z,X)=>z+X.count,0)),Z=i.collection?((Y=k.collections.find(z=>z.collection===i.collection))==null?void 0:Y.title)??i.collection:null,ge=new Map;for(const z of E.issues){const X=z.group??"unplaced";ge.set(X,[...ge.get(X)??[],z])}return s.jsxs(oc,{ref:g,children:[T,A&&k.folder?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Issues of the folder ",k.folder,", from its issue store."]}):null,s.jsxs(ce,{variant:"info",className:"mt-4",children:[s.jsx(vo,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:Ek}),s.jsx(ue,{children:Ak})]}),U,R,G?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(OT,{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(St,{ref:x,type:"search",className:"w-64","aria-label":"Search issues",placeholder:"Search issues",value:N,onChange:z=>C(z.target.value)}),s.jsxs(ct,{value:i.owner??Er,onValueChange:z=>_({owner:z===Er?null:z}),children:[s.jsx(nt,{className:"w-56","aria-label":"Owner",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:Er,children:"All owners"}),s.jsxs(_e,{value:o3,children:["Unowned (",W,")"]}),k.facets.owners.map(z=>s.jsxs(_e,{value:z.key,children:[z.title," (",z.count,")"]},z.key))]})]}),s.jsxs(ct,{value:i.label??Er,onValueChange:z=>_({label:z===Er?null:z}),children:[s.jsx(nt,{className:"w-48","aria-label":"Label",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:Er,children:"All labels"}),k.facets.labels.map(z=>s.jsxs(_e,{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:rl,"aria-pressed":i.urgent,onClick:()=>_({urgent:!i.urgent}),children:["Urgent ",k.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"}),Tk.map(z=>{const X=i.seen.includes(z.key);return s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:rl,"aria-pressed":X,onClick:()=>_({seen:X?i.seen.filter(te=>te!==z.key):[...i.seen,z.key]}),children:[z.label," ",k.facets.seen[z.key]]},z.key)}),Z!==null?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsxs("span",{"data-testid":"issues-collection-chip",className:se(ld({variant:"outline",size:"sm"}),ZA),children:["Collection ",Z]}),s.jsx(H,{type:"button",variant:"ghost",size:"sm-icon","aria-label":"Remove the collection filter",onClick:()=>{var z;_({collection:null}),(z=x.current)==null||z.focus()},children:s.jsx(Ju,{className:"size-4","aria-hidden":"true"})})]}):null]})]}),s.jsx("div",{role:"status","aria-live":"polite",children:$?s.jsxs("p",{className:"text-muted-foreground mt-3 flex items-center gap-2 text-sm",children:[s.jsx(en,{"aria-hidden":"true"}),"Searching…"]}):c&&E.total>0?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:[E.total," of ",k.listed," issues ·"," ",s.jsx(H,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:O,children:"Clear"})]}):null}),s.jsx("div",{"data-testid":"issues-results","aria-busy":$||void 0,className:"shrink-0 transition-opacity aria-busy:opacity-50",children:V&&E.total===0?s.jsxs("p",{className:"mt-6 flex items-center gap-2 text-sm",children:[s.jsx(Wu,{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:O,children:"Clear"})]}):k.groups.map(z=>s.jsx(f3,{id:`issues-${z.key}`,title:`${z.label} · ${z.count}`,issues:ge.get(z.key)??[],folder:A,link:X=>s.jsx(l,{className:"text-primary hover:underline",href:r(M(X.id)),children:X.title})},z.key))}),!c&&k.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 · ",k.collections.length]}),s.jsx(jt,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Collections",className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{className:"w-1/2",children:"Collection"}),s.jsx(F,{className:"w-1/4",children:"Resolved"}),s.jsx(F,{className:"w-1/4",children:"Updated"})]})}),s.jsx(Be,{children:k.collections.map(z=>s.jsxs(le,{children:[s.jsxs(q,{children:[s.jsx(l,{className:"text-primary hover:underline",href:r(P(Kr({...im,collection:z.collection}))),children:z.title}),s.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:z.collection})]}),s.jsxs(q,{children:[z.resolved," of ",z.total," resolved"]}),s.jsx(q,{className:"text-muted-foreground",children:Ti(z.updated_at)})]},z.collection))})]})})]}):null]})]})}const oc=u.forwardRef(function({children:t},n){return s.jsx("div",{ref:n,className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 pb-8 sm:px-6 lg:px-8",children:t})});function f3({id:e,title:t,issues:n,folder:a,link: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(jt,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:t,className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{className:a?"w-[30%]":"w-[36%]",children:"Title"}),s.jsx(F,{className:"w-[10%]",children:"Issue"}),a?s.jsx(F,{className:"w-[12%]",children:"Project"}):null,s.jsx(F,{className:"w-[16%]",children:"Status"}),s.jsx(F,{className:"w-[8%]",children:"Urgent"}),s.jsx(F,{className:a?"w-[14%]":"w-[18%]",children:"Owner"}),s.jsx(F,{className:"w-[12%]",children:"Updated"})]})}),s.jsx(Be,{children:n.map(l=>{var o;const i=Rk(l);return s.jsxs(le,{"data-testid":"issues-row",children:[s.jsxs(q,{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(fe,{variant:"neutral",size:"dense",children:c},c))}):null]}),s.jsx(q,{className:"font-mono text-xs",children:l.id}),a?s.jsx(q,{className:"break-words",children:l.project_id??"Folder"}):null,s.jsx(q,{children:s.jsx(fe,{variant:i.tone,children:i.label})}),s.jsx(q,{children:l.urgent&&l.status!=="resolved"&&l.group!=="resolved"?s.jsx(fe,{variant:"warning",children:"Urgent"}):null}),s.jsx(q,{className:"break-words",children:l.owner_title?l.owner_title:s.jsx("span",{className:"text-muted-foreground",children:"Unowned"})}),s.jsx(q,{className:"text-muted-foreground",children:Ti(l.updated_at)})]},l.id)})})]})})]})}function h3(e){var t;return(t=nn().issues)!=null&&t.issueSections?s.jsx(d3,{...e}):s.jsx(XD,{org:e.org,project:e.project,query:e.query})}function m3({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,p]=u.useState(t),[j,v]=u.useState(null),[b,x]=u.useState(!1);u.useEffect(()=>{n&&(o(t.title),d(t.description),h(t.external_reference??""),p(t),v(null))},[n]);const g=N=>{var C;return((C=j==null?void 0:j.personal_data)==null?void 0:C.field)===N?j.message:void 0},y=async N=>{N.preventDefault(),x(!0);const C=await e(m.id,m.revision,{title:i,description:c,external_reference:f.trim()||null});if(x(!1),!C.ok){v(C.refusal);return}r(C.data.issue)},w=async()=>{const N=await l();N&&(p(N),v(null))};return s.jsx(Jn,{open:n,onOpenChange:a,children:s.jsx(es,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:y,className:"grid gap-4",children:[s.jsxs(ts,{children:[s.jsx(ss,{children:"Edit issue"}),s.jsx(as,{children:"Text is shown exactly as entered."})]}),j!=null&&j.conflict?s.jsxs(ce,{variant:"destructive",children:[s.jsx(ot,{}),s.jsx(ue,{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(Me,{htmlFor:"maintain-edit-title",children:"Title"}),s.jsx(St,{id:"maintain-edit-title",value:i,"aria-invalid":!!g("title"),onChange:N=>o(N.target.value)}),g("title")?s.jsx(Pn,{children:g("title")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-edit-description",children:"Description"}),s.jsx(rs,{id:"maintain-edit-description",rows:4,value:c,"aria-invalid":!!g("description"),onChange:N=>d(N.target.value)}),g("description")?s.jsx(Pn,{children:g("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-edit-reference",children:"External reference"}),s.jsx(St,{id:"maintain-edit-reference",value:f,"aria-invalid":!!g("external_reference"),onChange:N=>h(N.target.value)}),g("external_reference")?s.jsx(Pn,{children:g("external_reference")}):null]}),j&&!j.conflict&&!j.personal_data?s.jsx(Pn,{children:j.message}):null,s.jsxs(ns,{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(vr,{className:"mr-2 size-4"}),"Reload latest"]}):null,s.jsx(H,{type:"submit",loading:b,disabled:!!(j!=null&&j.conflict),children:"Save"})]})]})})})}function zv(e){return e.map(t=>Nk[t].toLowerCase()).join(", ")}function p3(e){switch(e.kind){case"created":return"Logged the issue";case"updated":return`Edited the ${zv(e.fields)}`;case"redacted":return`Redacted the ${zv(e.fields)}`;case"priority_set":return e.priority?`Set priority to ${Qi[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?wu[e.to_status]:"";return e.resolution_reason?`Moved to ${t}: ${lx[e.resolution_reason]}`:`Moved to ${t}`}}}function Lv(e,t){return t==="external_reference"?e.external_reference??"":e[t]}function x3({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,p]=u.useState(null),[j,v]=u.useState(t);u.useEffect(()=>{n&&(v(t),d(Lv(t,i)),p(null))},[n]);const b=async x=>{x.preventDefault(),h(!0);const g=await e(j.id,j.revision,i,c);if(h(!1),!g.ok){if(g.refusal.conflict){const y=await l();y&&v(y),p("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}p(g.refusal.message);return}r(g.data.issue)};return s.jsx(Jn,{open:n,onOpenChange:a,children:s.jsx(es,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:b,className:"grid gap-4",children:[s.jsxs(ts,{children:[s.jsx(ss,{children:"Redact text"}),s.jsx(as,{children:"Replace text that holds personal data, such as a name."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-redact-field",children:"Field"}),s.jsxs(ct,{value:i,onValueChange:x=>{const g=x;o(g),d(Lv(j,g))},children:[s.jsx(nt,{id:"maintain-redact-field",children:s.jsx(ut,{})}),s.jsx(st,{children:UD.map(x=>s.jsx(_e,{value:x,children:Nk[x]},x))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-redact-replacement",children:"Replacement text"}),s.jsx(rs,{id:"maintain-redact-replacement",rows:4,value:c,onChange:x=>d(x.target.value)})]}),s.jsxs(ce,{variant:"warning",children:[s.jsx(Lt,{}),s.jsx(ue,{children:"This cannot be undone: the original text is removed for good. History records only that this field was redacted."})]}),m?s.jsx(Pn,{children:m}):null,s.jsxs(ns,{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 g3({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 p=await e(t.id,t.revision,"resolved",l);if(c(!1),!p.ok){if(p.refusal.conflict){r(null);return}f(p.refusal.message);return}f(null),r(p.data.issue)};return s.jsx(Jn,{open:n,onOpenChange:a,children:s.jsx(es,{children:s.jsxs("form",{onSubmit:h,className:"grid gap-4",children:[s.jsxs(ts,{children:[s.jsx(ss,{children:"Resolve issue"}),s.jsx(as,{children:"Choose how this report ended."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-resolution-reason",children:"Resolution reason *"}),s.jsxs(ct,{value:l,onValueChange:m=>i(m),children:[s.jsx(nt,{id:"maintain-resolution-reason",children:s.jsx(ut,{})}),s.jsx(st,{children:LD.map(m=>s.jsx(_e,{value:m,children:lx[m]},m))})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Reopening the issue clears its reason."})]}),d?s.jsx(Pn,{children:d}):null,s.jsxs(ns,{children:[s.jsx(H,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(H,{type:"submit",loading:o,children:"Resolve"})]})]})})})}const Ar="not_set";function v3({org:e,project:t,issue_id:n,query:a}){const r=kk(),l=Sk(r),i=rm(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(Ck,{access:l,header:s.jsx(Gt,{title:"Support"}),back_href:i,children:o=>r?s.jsx(y3,{contract:r,issue_id:n,access:o,list_href:i,duplicates:Number(new URLSearchParams(a).get("duplicates")??0)}):null})})}function y3({contract:e,issue_id:t,access:n,list_href:a,duplicates:r}){const{href:l,Link:i}=Ve(),o=$l(),[c,d]=u.useState(null),[f,h]=u.useState([]),[m,p]=u.useState(!1),[j,v]=u.useState([]),[b,x]=u.useState(null),g=u.useCallback(async()=>{const _=await e.issue(t);return _.ok?(d(_.data.issue),h(_.data.events),_.data.issue):(_.refusal.status===404?p(!0):o.error(_.refusal.message),null)},[e,t,o]);u.useEffect(()=>{let _=!1;return e.issue(t).then(S=>{if(!_){if(!S.ok){S.refusal.status===404?p(!0):o.error(S.refusal.message);return}d(S.data.issue),h(S.data.events)}}),()=>{_=!0}},[e,t]),u.useEffect(()=>{n.can_change&&e.assigneeCandidates().then(_=>{_.ok&&v(_.data.candidates)})},[e,n.can_change]);const y=async _=>{const S=await _;if(!S.ok){o.error(S.refusal.message),S.refusal.conflict&&await g();return}await g()};if(m)return s.jsx(ta,{title:"Support issue not found",description:"This issue does not exist in this project.",backHref:l(a),backLabel:"Back to Support",link:i});if(!c)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"});const w=c.status==="closed",N=n.can_change,C=_=>y(e.transition(c.id,c.revision,_));return s.jsxs(s.Fragment,{children:[s.jsx(Gt,{title:c.title,actions:N?s.jsxs(s.Fragment,{children:[w?null:s.jsxs(H,{variant:"outline",onClick:()=>x("edit"),children:[s.jsx(Zu,{className:"mr-2 size-4"}),"Edit"]}),s.jsxs(H,{variant:"outline",onClick:()=>x("redact"),children:[s.jsx(bT,{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 C("triaged"),children:"Triage"}):null,c.status==="open"||c.status==="triaged"?s.jsxs(H,{onClick:()=>x("resolve"),children:[s.jsx(Qu,{className:"mr-2 size-4"}),"Resolve"]}):null,c.status==="resolved"?s.jsxs(s.Fragment,{children:[s.jsxs(H,{variant:"outline",onClick:()=>void C("open"),children:[s.jsx(iR,{className:"mr-2 size-4"}),"Reopen"]}),s.jsx(H,{onClick:()=>void C("closed"),children:"Close"})]}):null]}):void 0,children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(fe,{variant:_k[c.status],children:wu[c.status]}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Logged by ",ID(c)," ",Rc(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(ce,{variant:"info",children:[s.jsx(ea,{}),s.jsxs(ue,{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(le,{children:[s.jsx(F,{children:"When"}),s.jsx(F,{children:"Who"}),s.jsx(F,{children:"What"})]})}),s.jsx(Be,{children:f.map(_=>s.jsxs(le,{children:[s.jsx(q,{className:"text-muted-foreground",children:Rc(_.created_at)}),s.jsx(q,{children:PD(_,c)}),s.jsx(q,{children:p3(_)})]},_.id))})]})})]})]}),s.jsxs("aside",{className:"flex w-full shrink-0 flex-col gap-5 lg:w-72",children:[s.jsx(ei,{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(ei,{label:"Resolution",children:s.jsx("span",{className:"text-sm",children:lx[c.resolution_reason]})}):null,s.jsx(ei,{label:"Priority",id:"maintain-issue-priority",children:s.jsxs(ct,{value:c.priority??Ar,disabled:!N||w,onValueChange:_=>void y(e.update(c.id,c.revision,{priority:_===Ar?null:_})),children:[s.jsx(nt,{id:"maintain-issue-priority",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:Ar,children:"Not set"}),rx.map(_=>s.jsx(_e,{value:_,children:Qi[_]},_))]})]})}),s.jsxs(ei,{label:"Assignee",id:"maintain-issue-assignee",children:[s.jsxs(ct,{value:c.assignee_id??Ar,disabled:!N||w,onValueChange:_=>void y(e.assign(c.id,c.revision,_===Ar?null:_)),children:[s.jsx(nt,{id:"maintain-issue-assignee",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:Ar,children:"Not set"}),c.assignee_id&&!j.some(_=>_.user_id===c.assignee_id)?s.jsx(_e,{value:c.assignee_id,children:ix(c.assignee_id,c.assignee_username)}):null,j.map(_=>s.jsx(_e,{value:_.user_id,children:_.username??"Not available"},_.user_id))]})]}),c.assignee_can_act===!1?s.jsx(fe,{variant:"error",className:"self-start",children:"Assignee cannot act"}):null]}),s.jsx(ei,{label:"Updated",children:s.jsx("span",{className:"text-sm",children:Rc(c.updated_at)})})]})]}),s.jsx(m3,{update:e.update,issue:c,open:b==="edit",onOpenChange:_=>x(_?"edit":null),onReload:g,onDone:()=>{x(null),g()}}),s.jsx(x3,{redact:e.redact,issue:c,open:b==="redact",onOpenChange:_=>x(_?"redact":null),onReload:g,onDone:()=>{x(null),o.success("The text was redacted."),g()}}),s.jsx(g3,{transition:e.transition,issue:c,open:b==="resolve",onOpenChange:_=>x(_?"resolve":null),onDone:_=>{x(null),_||o.error("Someone else changed this issue; it is reloaded."),g()}})]})}function ei({label:e,id:t,children:n}){return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[t?s.jsx("label",{htmlFor:t,className:"text-muted-foreground text-2xs font-medium tracking-wide uppercase",children:e}):s.jsx("span",{className:"text-muted-foreground text-2xs font-medium tracking-wide uppercase",children:e}),n]})}const b3=10,j3=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,Uv=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;function w3(e,t,n,a=""){const r=n!=null&&n.startsWith("task:")?n.slice(5):null;if(r&&j3.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&&Uv.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&&Uv.test(o))return{label:o,path:`${l}?planned=${encodeURIComponent(o)}`};const c=Kr(Ec(a));return{label:"Issues",path:`/proj/${encodeURIComponent(t)}/issues${c?`?${c}`:""}`}}const _3=["Fixed in","Being fixed in","The release planned to fix it"];function N3(e){const t=e.filter(n=>n.kind==="release");for(const n of _3){const a=t.find(r=>r.relation===n);if(a)return a}return t[0]??null}function k3({org:e,project:t,issue_id:n,from:a,query:r=""}){var Ie;const l=Mk(),{href:i,Link:o}=Ve(),c=w3(e,t,a,r),d=`/proj/${encodeURIComponent(t)}/issues`,f=K=>`${d}/${encodeURIComponent(K)}`,[h,m]=u.useState({state:"loading"}),[p,j]=u.useState(null),[v,b]=u.useState(null),[x,g]=u.useState({state:"loading"}),[y,w]=u.useState({state:"loading"}),N=u.useRef(null),C=_s(),_=u.useRef(null),S=u.useRef(!1),O=u.useRef(0),D=u.useRef(0),I=u.useCallback(async()=>{if(!l.issueSections)return;g({state:"loading"});const K=await l.issueSections(n);g(K.ok?{state:"ok",data:K.data}:{state:"failed",refusal:K.refusal})},[l.issueSections,n]),P=u.useCallback(async()=>{if(!l.issueRelated)return;w({state:"loading"});const K=await l.issueRelated(n);w(K.ok?{state:"ok",data:K.data}:{state:"failed",refusal:K.refusal})},[l.issueRelated,n]),M=u.useCallback(async()=>{const K=D.current+=1;if(b(null),!ZD.test(n)){m({state:"missing"});return}I(),P();const ke=await l.issue(n);if(K!==D.current)return;if(ke.ok){O.current=0,j(null),m({state:"ok",issue:ke.data.issue,events:ke.data.events,at:new Date().toISOString()});return}const De=ke.refusal.reason;if(ke.refusal.status===404||De==="not_found")return m({state:"missing"});if(De==="engine_missing")return m({state:"engine_missing",refusal:ke.refusal});if(De==="view_outdated")return m({state:"view_outdated"});if(O.current+=1,O.current===1&&jk(ke.refusal)){b(ke.refusal.retry_after??b3);return}j(ke.refusal)},[l.issue,n,I,P]);u.useEffect(()=>{M()},[M]),u.useEffect(()=>{if(v===null)return;const K=setTimeout(()=>void M(),v*1e3);return()=>clearTimeout(K)},[v,M]),u.useEffect(()=>{var ke;if(S.current||h.state!=="ok")return;S.current=!0;const K=(ke=N.current)==null?void 0:ke.querySelector("h1");K&&(K.tabIndex=-1,K.focus())},[h.state]);const U=u.useRef(null);u.useEffect(()=>{var De;const K=U.current;if(K===null||(K==="sections"?x:y).state==="loading")return;U.current=null;const ke=(K==="related"?_.current:null)??((De=N.current)==null?void 0:De.querySelector("h1"));ke==null||ke.focus()},[x,y]);const R=K=>{U.current=K,K==="sections"?I():P()},T=()=>{O.current=0,M()},E=u.useRef(!1),k=()=>{E.current=!0,T()};if(u.useEffect(()=>{var ke;if(!E.current||h.state==="loading"||v!==null)return;E.current=!1;const K=(ke=N.current)==null?void 0:ke.querySelector("h1");K&&(K.tabIndex=-1,K.focus())},[h,p,v]),h.state==="missing")return s.jsx(wa,{children:s.jsx(ta,{icon:s.jsx(Wu,{"aria-hidden":"true"}),title:"Issue not found",description:`No issue ${n} in this repository's issue store.`,backHref:i(a==="issues"?c.path:d),backLabel:"Back to issues",link:o})});const $=s.jsx(H,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(o,{href:i(c.path),children:[s.jsx(mp,{className:"size-4","aria-hidden":"true"}),c.label]})});if(h.state==="engine_missing"||h.state==="view_outdated")return s.jsx(wa,{children:h.state==="engine_missing"?s.jsx(Ss,{page:"Issue",header:s.jsx(Ci,{back:$,id:null,title:n})}):s.jsxs(s.Fragment,{children:[s.jsx(Ci,{back:$,id:null,title:n}),s.jsxs(ce,{variant:"warning",className:"mt-4",children:[s.jsx(Lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:Dl}),s.jsx(ue,{children:C})]})]})});const V=p?s.jsxs(ce,{variant:"destructive",className:"mt-4",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This issue could not be loaded"}),s.jsxs(ue,{children:[s.jsxs("p",{children:[p.message,p.since?` Since ${Yn(p.since)}.`:"",h.state==="ok"?` This page was read at ${Yn(h.at)}.`:"",p.message.includes(or)?"":` ${or}`]}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:k,children:"Retry"})]})]}):null,A=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(en,{"aria-hidden":"true"}),"This issue is busy. Reading it again…"]}):null});if(h.state==="loading")return s.jsxs(wa,{children:[s.jsx("div",{children:$}),A,V,!p&&v===null?s.jsxs("div",{className:"mt-4 grid gap-3",role:"status","aria-label":"Loading issue",children:[s.jsx(at,{className:"h-6 w-40"}),s.jsx(at,{className:"h-9 w-2/3"}),s.jsx(at,{className:"h-24 w-full"})]}):null]});const{issue:G,events:W,at:Z}=h,ge=Rk(G),Y=x.state==="ok"?x.data:null,z=(Y==null?void 0:Y.reporter)??G.created_by_username??null,X=y.state==="ok"?N3(y.data):null,te=G.status==="resolved"||G.group==="resolved",he=!!(Y!=null&&Y.duplicate_of),pe=x.state==="loading"?"Loading…":(Y==null?void 0:Y.routing.owner)??G.owner_title??s.jsx("span",{className:"text-muted-foreground",children:"Unowned"}),re=K=>`${d}?${Kr({...im,collection:K})}`,ve=Y==null?void 0:Y.report,ee=!!(ve&&(ve.actual||ve.expected||ve.steps.length||ve.where)),ht=[...W].reverse(),de=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 ",Yn(Z)]}),s.jsxs(H,{type:"button",variant:"ghost",size:"sm",onClick:T,children:[s.jsx(vr,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsx(wa,{children:s.jsxs("div",{ref:N,className:"contents",children:[s.jsx(Ci,{back:$,id:G.id,badge:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:ge.tone,children:ge.label}),G.urgent&&!te?s.jsx(fe,{variant:"warning",children:"Urgent"}):null]}),title:G.title,created:`Reported${z?` by ${z}`:""} · ${Ti(G.created_at)}`,actions:de}),Y!=null&&Y.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(Y.duplicate_of)),children:Y.duplicate_of})]}):null,A,V,x.state==="loading"?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",role:"status",children:[s.jsx(en,{"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(hs,{label:"Owner",value:pe}),he?null:s.jsx(hs,{label:"Release",value:y.state==="loading"?"Loading…":X?s.jsx("span",{className:se(X.label===X.id&&"font-mono"),children:X.label}):s.jsx("span",{className:"text-muted-foreground",children:"No release yet"})}),s.jsx(hs,{label:"Reported",value:[z,G.created_at?En(G.created_at):null].filter(Boolean).join(" · ")})]}),s.jsxs(ce,{variant:"info",className:"mt-4",children:[s.jsx(vo,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:Ek}),s.jsx(ue,{children:Ak})]}),x.state==="failed"?s.jsx("div",{className:"mt-6",children:s.jsx(ax,{what:"this issue's sections",again:"Read the issue again",refusal:x.refusal,on_retry:()=>R("sections")})}):null,Y&&ee&&ve?s.jsxs(vt,{id:"issue-report",title:"What happens",children:[ve.actual?s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:ve.actual}):null,ve.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:ve.expected})]}):null,ve.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:ve.steps.map((K,ke)=>s.jsx("li",{children:K},ke))})]}):null,(Ie=ve.where)!=null&&Ie.env?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:["Seen on ",ve.where.env,ve.where.sha?s.jsxs(s.Fragment,{children:[" ","at ",s.jsx("span",{className:"font-mono",children:ve.where.sha})]}):null]}):null]}):null,Y&&(Y.placement.placed||Y.placement.unplaced_why)?s.jsx(vt,{id:"issue-placement",title:"Placement",children:Y.placement.placed?s.jsxs("p",{className:"text-sm",children:["Placed in ",Y.placement.placed]}):s.jsxs(ce,{variant:"warning",children:[s.jsx(Lt,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Not placed yet: ",Y.placement.unplaced_why]})]})}):null,Y&&(Y.routing.route||Y.routing.owner||Y.routing.none)?s.jsxs(vt,{id:"issue-routing",title:"Routing",children:[Y.routing.route?s.jsx("p",{className:"text-sm",children:Y.routing.route}):null,Y.routing.owner?s.jsxs("p",{className:"text-sm",children:["Owner: ",Y.routing.owner]}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"Owner: none yet"})]}):null,Y&&(Y.labels.length>0||Y.collections.length>0)?s.jsxs(vt,{id:"issue-labels",title:"Labels and collections",children:[Y.labels.length?s.jsx("div",{className:"flex flex-wrap gap-1",children:Y.labels.map(K=>s.jsx(fe,{variant:"neutral",size:"dense",children:K},K))}):null,Y.collections.length?s.jsx("ul",{className:"mt-2 grid gap-1 text-sm",children:Y.collections.map(K=>s.jsxs("li",{children:[s.jsx(o,{className:"text-primary hover:underline",href:i(re(K.collection)),children:K.title}),K.ref?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",K.ref]}):null,s.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",K.resolved," of ",K.total," resolved"]})]},K.collection))}):null]}):null,Y&&Y.anchors.length>0?s.jsx(vt,{id:"issue-anchors",title:"Anchors",children:s.jsx(Mf,{label:"Anchors",heads:["Kind","Value","By"],rows:Y.anchors.map(K=>[K.kind,s.jsx("span",{className:"font-mono text-xs break-all",children:K.value}),K.by??""])})}):null,Y&&Y.seen.length>0?s.jsx(vt,{id:"issue-seen",title:"Seen",aside:`${Y.seen.length} of ${Math.max(G.occurrences??0,Y.seen.length)} sightings`,children:s.jsx(Mf,{label:"Seen",heads:["When","Where","Who","Note"],rows:Y.seen.map(K=>[Ti(K.at),s.jsxs(s.Fragment,{children:[K.sha?s.jsx("div",{className:"font-mono text-xs",children:K.sha}):null,K.env?s.jsx("div",{className:"text-muted-foreground text-xs",children:K.env}):null]}),K.who??"",K.note??""])})}):null,ht.length>0?s.jsx(vt,{id:"issue-history",title:"History",aside:"From the issue store, newest first",children:s.jsx(Mf,{label:"History",heads:["When","Who","What"],rows:ht.map(K=>[Ti(K.created_at),K.actor_username??"",a3(K.note,K.kind)])})}):null,s.jsx(wk,{id:"issue-related",related:y,heading_ref:_,on_retry:()=>R("related"),fixed:!0,link:K=>{const ke=K.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(K.id)}`:K.kind==="task"?`/org/${e}/tasks/${encodeURIComponent(K.id)}?from=issue:${G.id}`:K.kind==="issue"?f(K.id):K.kind==="release"?`/proj/${encodeURIComponent(t)}/releases?${K.planned?"planned":"release"}=${encodeURIComponent(K.id)}`:null;if(K.kind==="task"&&ke){const De=r3(K.label);return s.jsxs("div",{className:"min-w-0",children:[s.jsx(o,{className:"text-primary font-mono text-xs hover:underline",href:i(ke),children:K.id}),De&&De!==K.id?s.jsx("div",{className:"text-muted-foreground line-clamp-1 text-xs",title:De,"data-testid":"related-task-title",children:De}):null]})}return ke?s.jsx(o,{className:se("text-primary hover:underline",K.kind!=="thread"&&K.label===K.id&&"font-mono"),href:i(ke),children:K.label}):K.label}})]})})}function Mf({label:e,heads:t,rows:n}){return s.jsx(jt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:e,children:[s.jsx(Ge,{children:s.jsx(le,{children:t.map(a=>s.jsx(F,{children:a},a))})}),s.jsx(Be,{children:n.map((a,r)=>s.jsx(le,{children:a.map((l,i)=>s.jsx(q,{className:"break-words",children:l},i))},r))})]})})}function S3({org:e,project:t,issue_id:n,from:a,query:r}){var l;return(l=nn().issues)!=null&&l.issueSections?s.jsx(k3,{org:e,project:t,issue_id:n,from:a,query:r}):s.jsx(v3,{org:e,project:t,issue_id:n,query:r})}function _u(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 $k={integration:"Integration",deploy:"Deploy",publish:"Publish",accept:"Accept",custom:"Custom"},C3={self_service:"Self-service",managed:"Managed",manager_only:"Manager only"},T3={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"},R3={in_batch:{label:"In the batch",tone:"info"},done:{label:"Done",tone:"success"},failed:{label:"Failed",tone:"error"},released:{label:"Released",tone:"neutral"},left:{label:"Left",tone:"neutral"},gone:{label:"Ended",tone:"neutral"},skipped:{label:"Skipped",tone:"neutral"},lapsed:{label:"Lapsed",tone:"warning"}};function E3(e){return R3[e??"in_batch"]}function A3(e){const t=e.turn==="next",n=t?"Next":"Waiting",a=e.batching==="managed"||e.batching==="released"?` · ${e.batching}`:"";return{label:`${n}${a}`,tone:t?"info":"neutral"}}const Ok=(e,t)=>`Holds ${e.toLowerCase()}${t?`: ${t}`:""}`;function M3(e,t,n,a=!0){return e.fixing_since!==void 0?{label:`Fixing forward since ${Hn(e.fixing_since)}`,tone:"warning"}:e.ref===t?{label:"Landing",tone:"info"}:a&&e.hold?{label:Ok(n),tone:"info"}:{label:"Running",tone:"info"}}function Hn(e){return new Date(e*1e3).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Mr(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 $3(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 O3(e,t){switch(e.kind){case"any_thread":return"Any thread in this checkout";case"task_writers":return"Anyone who can edit the entry's task";case"any_joiner":return"Anyone who may join";case"managers":return"Whoever may manage";case"admins":return"Workspace admins";case"none":return"Nobody";case"listed":{const n=e.users.map(t),a=e.teams.length;return a&&n.push(a===1?"1 team":`${a} teams`),n.length?n.join(", "):"Nobody"}}}function D3(e,t){var o,c;const{policy:n,management:a}=e,r=(o=e.layer)==null?void 0:o.kind,l=d=>O3(d,t),i=[["Mode",T3[a.mode]],["Who can join",l(a.joiners)]];return r==="implement"&&i.push(["Managers",l(a.managers)],["Manager lease",Mr(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 ${Mr(n.freeze.max_seconds)}, ${Mr(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 ${Mr(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",Mr(n.lease_seconds)],["Time to start",`${Mr(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 Dk="Where your organization's agents take turns at a shared branch, environment or proposal. One turn runs at a time in each queue.",zk="A task you cannot see",z3="A former member",L3="A member";function Lk(){const e=nn().queues;if(!e)throw new Error("The Queues page rendered without the queues seam.");return e}function U3({org:e,open:t,path:n}){var h,m;const a=Lk(),{href:r,Link:l}=Ve(),i=a.availability,[o,c]=u.useState({state:"loading"}),d=u.useCallback(async p=>{i&&(p&&c({state:"loading"}),c(await i({fresh:p})))},[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(ta,{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(H3,{org:e,open:t??null,path:n??`/org/${e}/tasks/queues`}):o.state==="off"&&((m=o.refusal)==null?void 0:m.reason)==="engine_missing"?s.jsx(Ss,{page:"Queues"}):s.jsxs(s.Fragment,{children:[s.jsx(Gt,{title:"Queues",description:a.description??Dk}),o.state==="loading"&&s.jsx(Uk,{}),(o.state==="error"||o.state==="off")&&s.jsx(om,{refusal:o.refusal,on_retry:()=>void d(!0)}),o.state==="available"&&s.jsxs(ce,{variant:"info",className:"mt-6",children:[s.jsx(ea,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Tasks are not on for this organization"}),s.jsxs(ue,{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 Uk(){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(at,{className:t===2?"h-10 w-2/3":"h-10 w-full"},t))})}function om({refusal:e,on_retry:t}){const n=_s();return(e==null?void 0:e.reason)==="store_locked"?s.jsxs(ce,{variant:"info",className:"mt-6",children:[s.jsx(ea,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"The local stores are busy"}),s.jsxs(ue,{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)==="view_outdated"?s.jsxs(ce,{variant:"warning",className:"mt-6",children:[s.jsx(Lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:Dl}),s.jsx(ue,{children:n})]}):s.jsxs(ce,{variant:"destructive",className:"mt-6",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Queues could not be loaded"}),s.jsxs(ue,{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 $f=e=>e.status===404||e.reason==="not_found"||e.code==="not_found";function B3(e,t,n,a){return t?e===null?`Not reading · trying again every ${n}s`:`Not reading since ${Hn(e)} · trying again every ${n}s`:e===null?"Connecting…":`Live · read ${Hn(e)} · refreshes every ${n}s${a?` · ${a}`:""}`}function H3({org:e,open:t,path:n}){var z;const{listQueues:a,queue:r,members:l,refresh_ms:i,settings_note:o,description:c,read_scope:d,subject_label:f="Task",thread_subjects:h=!1}=Lk(),{self_id:m}=Ku(),[p,j]=u.useState(null),[v,b]=u.useState(null),[x,g]=u.useState(null),[y,w]=u.useState(null),[N,C]=u.useState({state:"pending",members:[]});u.useEffect(()=>{let X=!0;return l().then(te=>{X&&C(he=>te.ok?{state:"answered",members:te.data}:{state:"failed",members:he.members})}),()=>{X=!1}},[l]);const _=u.useMemo(()=>new Map(N.members.map(X=>[X.user_id,X])),[N.members]),S=N.state==="answered"?z3:L3,O=u.useCallback((X,te)=>{var he;return(te==null?void 0:te.title)??(h?(te==null?void 0:te.id)??X:X===m?"You":((he=_.get(X))==null?void 0:he.label)??S)},[_,S,m,h]),D=u.useRef({list:{last:null,fresh:!1},detail:{last:null,fresh:!1}}),[I,P]=u.useState(null),[M,U]=u.useState(!1),R=u.useCallback((X,te)=>{D.current[X]={last:te,fresh:!0};const{list:he,detail:pe}=D.current;U(he.last==="failed"||pe.last==="failed"),he.fresh&&pe.fresh&&he.last==="ok"&&pe.last==="ok"&&P(Date.now()/1e3)},[]),T=t??((z=p==null?void 0:p.queues[0])==null?void 0:z.id)??null,E=u.useRef(T);u.useEffect(()=>{E.current=T},[T]);const k=u.useRef(0),$=u.useCallback(async()=>{var he;const X=k.current+=1;D.current.list.fresh=!1;const te=await a();if(X===k.current)if(te.ok){if(j(te.data),b(null),!t){const pe=((he=te.data.queues[0])==null?void 0:he.id)??null;pe===null?D.current.detail={last:"ok",fresh:!0}:pe!==E.current&&(D.current.detail.fresh=!1)}R("list","ok")}else b(te.refusal),R("list","failed")},[a,t,R]),V=u.useRef(0),A=u.useCallback(async()=>{const X=V.current+=1;if(!T)return;D.current.detail.fresh=!1;const te=await r(T);X===V.current&&(te.ok?(g(te.data),w(null),R("detail","ok")):(w(te.refusal),$f(te.refusal)&&g(null),R("detail",$f(te.refusal)?"ok":"failed")))},[T,r,R]);u.useEffect(()=>{$()},[$]),u.useEffect(()=>{g(null),w(null),A()},[A]);const G=u.useCallback(()=>{$(),A()},[$,A]),W=!p&&(v==null?void 0:v.reason)==="engine_missing",Z=u.useCallback(()=>{W||G()},[W,G]);if(_u(Z,i),W)return s.jsx(Ss,{page:"Queues"});const ge=Math.round(i/1e3),Y=y!==null&&$f(y);return s.jsxs(s.Fragment,{children:[s.jsxs(Gt,{title:"Queues",description:c??Dk,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:B3(I,M,ge,d)}),s.jsx("span",{className:"sr-only",role:"status",children:M?"Not reading":I===null?"Connecting":"Live"})]}),!p&&!v&&s.jsx(Uk,{}),!p&&v&&s.jsx(om,{refusal:v,on_retry:G}),p&&p.queues.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(y0,{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."})]}):p?s.jsxs(s.Fragment,{children:[s.jsx(P3,{path:n,queues:p.queues,open_id:T,name:O,held:h}),Y?s.jsxs(ce,{variant:"info",className:"mt-6",children:[s.jsx(ea,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This queue is no longer available"}),s.jsx(ue,{children:"It was archived, or you can no longer read its Workspace. Pick another queue above."})]}):x&&x.queue.id===T?s.jsx(q3,{org:e,detail:x,name:O,settings_note:o,subject_label:f,thread_subjects:h}):y?s.jsx(om,{refusal:y,on_retry:()=>void A()}):s.jsx(at,{className:"mt-6 h-40 w-full shrink-0",role:"status","aria-label":"Loading the queue"})]}):null]})}function cm({org:e,subject:t,link:n}){const{href:a,Link:r}=Ve();return!t||t.hidden?s.jsx("span",{className:"text-muted-foreground",children:zk}):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 I3(e,t,n){const a=e.freeze?`frozen until ${Hn(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 ${Hn(e.batch.opened_at)}`,a].filter(Boolean).join(" · "),warn:!1};if(e.turn){const r=e.turn.subject,l=r.hidden?zk: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?Ok(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:Of(d.join(" · ")),warn:!1}:{primary:`${i}${l}${o}`,secondary:d.length?Of(d.join(" · ")):null,warn:d.length>0}}return{primary:"Nothing running",secondary:a?Of(a):null,warn:!!a}}const Of=e=>e.charAt(0).toUpperCase()+e.slice(1);function P3({path:e,queues:t,open_id:n,name:a,held:r}){const{href:l,Link:i}=Ve();return s.jsx(jt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Queues",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Queue"}),s.jsx(F,{className:"hidden md:table-cell",children:"Step"}),s.jsx(F,{children:"Running turn"}),s.jsx(F,{className:"hidden text-right md:table-cell",children:"Waiting"})]})}),s.jsx(Be,{children:t.map(o=>{var m;const c=o.id===n,d=$3(o),f=I3(o,a,r),h=o.waiting-(((m=o.batch)==null?void 0:m.remaining)??0);return s.jsxs(le,{"data-testid":"queues-row",className:se(c&&"bg-accent"),children:[s.jsxs(q,{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(q,{className:"hidden md:table-cell",children:s.jsx(fe,{variant:"neutral",children:$k[o.policy.step]})}),s.jsxs(q,{children:[s.jsx("div",{className:se(!o.batch&&!o.turn&&"text-muted-foreground"),children:f.primary}),f.secondary?s.jsx("div",{className:se("text-xs",f.warn?"text-warning":"text-muted-foreground"),children:f.secondary}):null]}),s.jsx(q,{className:"hidden text-right md:table-cell",children:h})]},o.id)})})]})})}function cc({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 Bv({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(le,{children:[s.jsx(F,{children:r}),s.jsx(F,{children:"State"})]})}),s.jsx(Be,{children:t.map(o=>{const c=M3(o,n,a,l);return s.jsxs(le,{"data-testid":"queues-running",children:[s.jsxs(q,{children:[s.jsx(cm,{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(q,{children:s.jsx(fe,{variant:c.tone,children:c.label})})]},o.ref)})})]})})}function q3({org:e,detail:t,name:n,settings_note:a,subject_label:r,thread_subjects:l}){var w;const{queue:i,state:o}=t,c=N=>n(N),d=new Map(o.entries.map(N=>[N.ref,N.subject])),f=o.entries.filter(N=>N.turn==="running"),h=o.entries.filter(N=>N.turn!=="running"&&N.batching!=="in_batch"),m=o.batch,p=Math.max(1,f.filter(N=>N.batching!=="in_batch").length),j=m&&i.policy.independent_turns?f.filter(N=>N.batching!=="in_batch"&&N.ref!==m.holder):[],v=o.manager,b=o.freeze,x=((w=i.layer)==null?void 0:w.kind)==="release"?i.layer.stall_hold:void 0,g=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,y=!m&&f.length===0&&h.length===0;return s.jsxs(jt,{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(fe,{variant:"neutral",children:$k[i.policy.step]}),s.jsx(fe,{variant:"neutral",children:C3[i.management.mode]})]}),i.purpose?s.jsx("p",{className:"text-muted-foreground text-sm",children:i.purpose}):null]}),v?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm","data-testid":"queues-manager",children:[s.jsx(wR,{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 ",Hn(v.lease_until),v.serving_until!==void 0?" · serving now":""]})]}):null,b?s.jsxs(ce,{variant:"warning",children:[s.jsx(xR,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Frozen until ",Hn(b.lease_until)]}),s.jsxs(ue,{children:[n(b.holder,b.holder_subject)," froze this queue at ",Hn(b.since),b.label?`: ${b.label}`:"",". Only ",n(b.holder,b.holder_subject),"'s entries start until it thaws."]})]}):null,g?s.jsxs(ce,{variant:"info",children:[s.jsx(b0,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:["Stall hold until ",Hn(g.until)]}),s.jsxs(ue,{children:[g.who,g.why?`: ${g.why}`:"",". The first entry is not treated as stalled while it lasts."]})]}):null,y?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(cc,{id:"queue-running",title:"Running turn",side:`Batch opened by ${n(m.holder,m.holder_subject)} at ${Hn(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(le,{children:[s.jsx(F,{children:"Landing order"}),s.jsx(F,{children:r}),s.jsx(F,{children:"Outcome"})]})}),s.jsx(Be,{children:m.members.map((N,C)=>{const _=E3(N.outcome);return s.jsxs(le,{"data-testid":"queues-member",children:[s.jsx(q,{children:C+1}),s.jsx(q,{children:s.jsx(cm,{org:e,subject:N.subject??d.get(N.ref)??(l?{kind:"thread",id:N.ref}:void 0),link:!l})}),s.jsx(q,{children:s.jsx(fe,{variant:_.tone,children:_.label})})]},N.ref)})})]})}),j.length>0?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"text-muted-foreground text-xs font-medium",children:"Also running"}),s.jsx(Bv,{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(cc,{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(Bv,{org:e,entries:f,landing:o.landing,queue_name:i.name,subject_label:r,held:l,label:"Running turns"})}),s.jsx(cc,{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(le,{children:[s.jsx(F,{children:"Position"}),s.jsx(F,{children:r}),s.jsx(F,{className:"hidden md:table-cell",children:"Joined"}),s.jsx(F,{children:"Turn"}),s.jsx(F,{className:"hidden md:table-cell",children:"Note"})]})}),s.jsx(Be,{children:h.map((N,C)=>{const _=A3(N);return s.jsxs(le,{"data-testid":"queues-waiting",children:[s.jsx(q,{children:m?p+C+1:N.position}),s.jsx(q,{children:s.jsx(cm,{org:e,subject:N.subject,link:!l})}),s.jsx(q,{className:"hidden md:table-cell",children:Hn(N.joined_at)}),s.jsx(q,{children:s.jsx(fe,{variant:_.tone,children:_.label})}),s.jsx(q,{className:"hidden md:table-cell",children:N.subject.hidden?"":N.note??""})]},N.ref)})})]})})})]}),s.jsx(cc,{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:D3(i,c).map(([N,C])=>s.jsxs(le,{children:[s.jsx(F,{scope:"row",className:"h-auto w-48 py-2 font-normal",children:N}),s.jsx(q,{children:C})]},N))})})})}),s.jsx("p",{className:"text-muted-foreground text-xs",children:a})]})}const us="__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 Zi=(e,t)=>(e.label||e.key).localeCompare(t.label||t.key);function qn({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(Me,{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 Hv({label:e,children:t}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("span",{className:"text-sm leading-none font-medium",children:e}),s.jsx("span",{className:"text-muted-foreground text-sm break-words",children:t})]})}function Iv({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(Ul,{id:e,className:"mt-0.5",checked:a,"aria-describedby":n?`${e}-help`:void 0,onCheckedChange:l=>r(l===!0)}),s.jsx(Me,{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 Hk({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(Ul,{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(Me,{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 um({context:e,action:t,title:n="Two-factor sign-in needed"}){const a=e.two_factor==="enroll";return s.jsxs(ce,{variant:"destructive",role:"alert",children:[s.jsx(mR,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:n}),s.jsxs(ue,{children:[s.jsx("p",{children:a?`Turn on two-factor sign-in in Account Settings, then come back here and ${t}.`:`Changing the org needs a two-factor sign-in. Sign in again with your authenticator in Account Settings, then come back here and ${t}.`}),s.jsx(H,{asChild:!0,variant:"outline",size:"sm",className:"mt-2 h-auto min-h-8 py-1.5 whitespace-normal text-left",children:s.jsx("a",{href:e.settings_href,target:"_blank",rel:"noreferrer",children:"Open Account Settings in a new tab"})})]})]})}const ql=e=>e.two_factor==="ok";function Ao({refusal:e,context:t,subject:n,action:a}){if((e==null?void 0:e.kind)==="two_factor")return s.jsx(um,{context:t,action:a,title:`Could not save ${n}`});const r=ql(t)?null:s.jsx(um,{context:t,action:a});if(!e)return r;const l=e.kind==="changed"?"The org changed since you opened this":e.kind==="authority"?`Could not save ${n}`:null;return s.jsxs(s.Fragment,{children:[r,s.jsxs(ce,{variant:"destructive",role:"alert",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),l?s.jsx(xe,{children:l}):null,s.jsx(ue,{children:e.message})]})]})}function Ik({id:e,value:t,on_change:n,none:a,options:r,described_by:l}){return s.jsxs(ct,{value:t,onValueChange:n,children:[s.jsx(nt,{id:e,"aria-describedby":l,children:s.jsx(ut,{placeholder:"Choose a team"})}),s.jsxs(st,{children:[a?s.jsx(_e,{value:us,children:a}):null,r.map(i=>s.jsx(_e,{value:i.key,children:i.label||i.key},i.key))]})]})}function Mo(e){const[t,n]=u.useState(!1),[a,r]=u.useState(null);return{saving:t,refusal:a,set_refusal:r,run:async i=>{n(!0),r(null);try{const o=await i();o?r(o):e()}finally{n(!1)}}}}function Nd({saving:e,blocked:t,described_by:n,children:a}){return s.jsx(H,{type:"submit",disabled:e,"aria-disabled":t||void 0,"aria-describedby":t?n:void 0,children:a})}const Pk=(e,t)=>t==="hosted"?`Lowercase letters, digits, _ and -, starting with a letter. It names the ${e} in posts, and cannot change later.`:`Lowercase letters, digits, _ and -, starting with a letter. It names the ${e} in posts and in sdlc org, and cannot change later.`;function G3({open:e,chart:t,team:n,save:a,on_close:r,context:l=kd,scope:i="full",parents:o}){var k;const c=l.host==="hosted",[d,f]=u.useState(""),[h,m]=u.useState(""),[p,j]=u.useState(""),[v,b]=u.useState(us),[x,g]=u.useState({}),{saving:y,refusal:w,set_refusal:N,run:C}=Mo(r),_=((k=t.teams.find($=>$.parent===null))==null?void 0:k.key)??null;u.useEffect(()=>{e&&(f(""),m((n==null?void 0:n.label)??""),j((n==null?void 0:n.description)??""),b((n==null?void 0:n.parent)??(c&&_&&(!o||o.includes(_))?_:us)),g({}),N(null))},[e,n,N,c,_,o]);const S=$=>{const V=t.teams.find(A=>A.key===$);return V?V.label||V.key:$??""},O=n?Bk(t.teams,n.key):new Set,D=[...t.teams].filter($=>!O.has($.key)&&(!o||o.includes($.key))).sort(($,V)=>$.key===_?-1:V.key===_?1:Zi($,V)),I=n?n.label||n.key:"",P=i==="description",M=!ql(l),U=n?P?"save the description":"save the team":"add the team",R=$=>{if($.preventDefault(),M)return;if(!n){const G=c?h.trim():d.trim();if(!G){g(c?{label:"Give the team a name."}:{key:"Give the team a key."});return}if(c&&v===us){g({parent:"Choose the parent team."});return}const W=c?G:h.trim()||G;C(()=>a({action:"add",kind:"team",key:G,...h.trim()?{label:h.trim()}:{},...p.trim()?{description:p.trim()}:{},...v!==us?{parent:v}:{}},`Team ${W} added.`));return}if(!P&&!h.trim()){g({label:c?"Give the team a name.":"Give the team a label."});return}const V=v===us?null:v,A={...!P&&h.trim()!==n.label.trim()?{label:h.trim()}:{},...p.trim()!==(n.description??"").trim()?{description:p.trim()}:{},...!c&&V!==n.parent?{parent:V}:{}};if(Object.keys(A).length===0){r();return}C(()=>a({action:"edit",kind:"team",key:n.key,...A},P?`Saved the description of ${I}.`:`Team ${h.trim()} saved.`))},T=n?P?`Edit the description of ${I}`:`Edit team ${I}`:"Add team";let E;return P?E="Say what the team works on. Only the description is yours to change here.":c?E=n?"Rename the team or say what it works on.":"Add a team to the organization.":n?E=s.jsxs(s.Fragment,{children:["Its key, ",s.jsx("span",{className:"font-mono",children:n.key}),", names it in posts and in sdlc org and does not change."]}):E="Add a team to this repository's local org.",s.jsx(Jn,{open:e,onOpenChange:$=>$||y?null:r(),children:s.jsx(es,{children:s.jsxs("form",{onSubmit:R,noValidate:!0,children:[s.jsxs(ts,{children:[s.jsx(ss,{children:T}),s.jsx(as,{children:E})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Ao,{refusal:w,context:l,subject:P?"the description":"the team",action:U}),!n&&!c?s.jsx(qn,{id:"org-team-key",label:"Key",help:Pk("team",l.host),error:x.key,children:$=>s.jsx(St,{id:"org-team-key",className:"font-mono",value:d,autoComplete:"off","aria-invalid":x.key?!0:void 0,"aria-describedby":$,onChange:V=>{f(V.target.value),g({})}})}):null,P&&n?s.jsx(Hv,{label:"Name",children:n.parent?`${I} · under ${S(n.parent)}`:I}):s.jsx(qn,{id:"org-team-label",label:c?"Name":n?"Label":"Label (optional)",help:c?n?void 0:"Its key is made from the name.":n?void 0:"Shown on the chart; the key when left empty.",error:x.label,children:$=>s.jsx(St,{id:"org-team-label",value:h,"aria-invalid":x.label?!0:void 0,"aria-describedby":$,onChange:V=>{m(V.target.value),g({})}})}),s.jsx(qn,{id:"org-team-description",label:P?"Description":"Description (optional)",children:()=>s.jsx(rs,{id:"org-team-description",rows:3,placeholder:"What the team does",value:p,onChange:$=>j($.target.value)})}),P?null:c&&n?s.jsx(Hv,{label:"Parent team",children:n.parent?S(n.parent):"None: the organization itself"}):s.jsx(qn,{id:"org-team-parent",label:"Parent team",help:"Where the team sits; its posts report up through the team above.",error:x.parent,children:$=>s.jsx(Ik,{id:"org-team-parent",value:v,on_change:V=>{b(V),g({})},none:c?void 0:"No parent (a root team)",options:D,described_by:$})})]}),s.jsxs(ns,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",disabled:y,onClick:r,children:"Cancel"}),s.jsx(Nd,{saving:y,blocked:M,children:n?y?"Saving…":"Save":y?"Adding…":"Add team"})]})]})})})}const V3=(e,t)=>e.length===t.size&&e.every(n=>t.has(n));function Y3({open:e,chart:t,job:n,save:a,on_close:r,context:l=kd}){const[i,o]=u.useState(""),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,p]=u.useState(us),[j,v]=u.useState(new Set),[b,x]=u.useState(!1),[g,y]=u.useState(!0),[w,N]=u.useState({}),{saving:C,refusal:_,set_refusal:S,run:O}=Mo(r);u.useEffect(()=>{e&&(o(""),d((n==null?void 0:n.label)??""),h((n==null?void 0:n.description)??""),p((n==null?void 0:n.parent)??us),v(new Set((n==null?void 0:n.fills)??[])),x((n==null?void 0:n.requires_person)??!1),y((n==null?void 0:n.escalable)??!0),N({}),S(null))},[e,n,S]);const D=n?Bk(t.job_functions,n.key):new Set,I=[...t.job_functions].filter(T=>!D.has(T.key)).sort(Zi),P=[...t.slots].sort(Zi).map(T=>({value:T.key,label:T.label||T.key})),M=!ql(l),U=n?"save the job function":"add the job function",R=T=>{if(T.preventDefault(),M)return;if(!n){if(!i.trim()){N({key:"Give the job function a key."});return}O(()=>a({action:"add",kind:"job_function",key:i.trim(),...c.trim()?{label:c.trim()}:{},...f.trim()?{description:f.trim()}:{},...m!==us?{parent:m}:{},fills:[...j],requires_person:b,escalable:g},`Job function ${c.trim()||i.trim()} added.`));return}if(!c.trim()){N({label:"Give the job function a label."});return}const E=m===us?null:m,k={...c.trim()!==n.label.trim()?{label:c.trim()}:{},...f.trim()!==(n.description??"").trim()?{description:f.trim()}:{},...E!==n.parent?{parent:E}:{},...V3(n.fills,j)?{}:{fills:[...j]},...b!==n.requires_person?{requires_person:b}:{},...g!==n.escalable?{escalable:g}:{}};if(Object.keys(k).length===0){r();return}O(()=>a({action:"edit",kind:"job_function",key:n.key,...k},`Job function ${c.trim()} saved.`))};return s.jsx(Jn,{open:e,onOpenChange:T=>T||C?null:r(),children:s.jsx(es,{children:s.jsxs("form",{onSubmit:R,noValidate:!0,children:[s.jsxs(ts,{children:[s.jsx(ss,{children:n?`Edit job function ${n.label||n.key}`:"Add job function"}),s.jsxs(as,{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(Ao,{refusal:_,context:l,subject:"the job function",action:U}),n?null:s.jsx(qn,{id:"org-function-key",label:"Key",help:Pk("job function",l.host),error:w.key,children:T=>s.jsx(St,{id:"org-function-key",className:"font-mono",value:i,autoComplete:"off","aria-invalid":w.key?!0:void 0,"aria-describedby":T,onChange:E=>{o(E.target.value),N({})}})}),s.jsx(qn,{id:"org-function-label",label:n?"Label":"Label (optional)",error:w.label,children:T=>s.jsx(St,{id:"org-function-label",value:c,"aria-invalid":w.label?!0:void 0,"aria-describedby":T,onChange:E=>{d(E.target.value),N({})}})}),s.jsx(qn,{id:"org-function-description",label:"Job description (optional)",children:()=>s.jsx(rs,{id:"org-function-description",rows:3,placeholder:"What this job function does",value:f,onChange:T=>h(T.target.value)})}),s.jsx(qn,{id:"org-function-parent",label:"Parent function",help:"Its posts report to the post of the parent function.",children:T=>s.jsx(Ik,{id:"org-function-parent",value:m,on_change:p,none:"No parent (a root function)",options:I,described_by:T})}),s.jsx(Hk,{id:"org-function-fills",legend:"Slots it fills",options:P,checked:j,on_change:v,empty:l.host==="hosted"?"This organization has no slots yet.":"This org has no slots yet; add them with sdlc org add slot."}),s.jsx(Iv,{id:"org-function-requires-person",label:"Requires a person",help:"Only a person may hold its posts.",checked:b,on_change:x}),s.jsx(Iv,{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:g,on_change:y})]}),s.jsxs(ns,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",disabled:C,onClick:r,children:"Cancel"}),s.jsx(Nd,{saving:C,blocked:M,children:n?C?"Saving…":"Save":C?"Adding…":"Add job function"})]})]})})})}function F3({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:p,refusal:j,set_refusal:v,run:b}=Mo(i);if(u.useEffect(()=>{!e||!n||(c(new Set(n.posts.map(O=>O.post))),f(n.source==="override"?n.reason??"":""),m({}),v(null))},[e,n,v]),!n)return null;const x=a.slot(n.slot),g=(S=t.project)!=null&&S.team?t.teams.find(O=>{var D;return O.key===((D=t.project)==null?void 0:D.team)}):void 0,y=g?g.label||g.key:"the owning team",w=new Set(t.job_functions.filter(O=>O.fills.includes(n.slot)).map(O=>O.key)),N=[...t.posts].map(O=>O.post).sort(a.byPost).map(O=>({value:O,label:w.has(O.split("/")[1]??"")?`${a.post(O)} (fills ${x})`:a.post(O)})),C=O=>{O.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)&&b(()=>r({action:"bind",slot:n.slot,posts:[...o],reason:d.trim()},`Override of ${x} saved.`))},_=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})&&b(()=>r({action:"unbind",slot:n.slot},`Override of ${x} cleared.`))};return s.jsx(Jn,{open:e,onOpenChange:O=>O||p?null:i(),children:s.jsx(es,{children:s.jsxs("form",{onSubmit:C,noValidate:!0,children:[s.jsxs(ts,{children:[s.jsxs(ss,{children:["Override ",x]}),s.jsxs(as,{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(Ao,{refusal:j,context:kd,subject:"the override",action:"save the override"}),s.jsx(Hk,{id:"org-override-posts",legend:"Posts",help:"A post outside its job description is marked on the chart.",error:h.posts,options:N,checked:o,on_change:O=>{c(O),m(D=>({...D,posts:void 0}))}}),s.jsx(qn,{id:"org-override-reason",label:"Reason",error:h.reason,children:O=>s.jsx(rs,{id:"org-override-reason",rows:2,placeholder:"Why this slot needs other posts",value:d,"aria-invalid":h.reason?!0:void 0,"aria-describedby":O,onChange:D=>{f(D.target.value),m(I=>({...I,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 ",y," or of a team above it."]})]}),s.jsxs(ns,{className:"mt-6",children:[n.source==="override"?s.jsx(H,{type:"button",variant:"ghost",className:"sm:mr-auto",disabled:p,onClick:()=>void _(),children:"Clear override"}):null,s.jsx(H,{type:"button",variant:"outline",disabled:p,onClick:i,children:"Cancel"}),s.jsx(H,{type:"submit",disabled:p,children:p?"Saving…":"Save override"})]})]})})})}function X3(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function K3({open:e,chart:t,names:n,save:a,on_close:r,context:l}){var M;const i=t.authority,o=u.useMemo(()=>new Set((i==null?void 0:i.post_pairs)??[]),[i]),c=((M=t.teams.find(U=>U.parent===null))==null?void 0:M.key)??null,d=[...t.teams].filter(U=>[...o].some(R=>R.startsWith(`${U.key}/`))).sort((U,R)=>U.key===c?-1:R.key===c?1:Zi(U,R)),[f,h]=u.useState(""),[m,p]=u.useState(""),[j,v]=u.useState({}),{saving:b,refusal:x,set_refusal:g,run:y}=Mo(r);u.useEffect(()=>{var U;e&&(h(((U=d[0])==null?void 0:U.key)??""),p(""),v({}),g(null))},[e,g]);const w=new Set(t.posts.filter(U=>U.post.startsWith(`${f}/`)).map(U=>U.post.split("/")[1])),N=[],C=U=>{for(const R of[...t.job_functions].filter(T=>T.parent===U).sort(Zi))N.push(R),C(R.key)};C(null);const _=N.filter(U=>o.has(`${f}/${U.key}`)&&!w.has(U.key)),S=f!==""&&_.length===0,O=!ql(l)||S,D=U=>{if(U.preventDefault(),O)return;const R={...f?{}:{team:"Choose a team."},...m?{}:{job:"Choose a job function."}};v(R),!(R.team||R.job)&&y(()=>a({action:"add",kind:"post",key:`${f}/${m}`},`Added post ${n.job(m)} · ${n.team(f)}.`))},I=S?"Every job function already has a post in this team.":"A team has one post per job function; functions already staffed in this team are left out.",P=(i==null?void 0:i.ask)??[];return s.jsx(Jn,{open:e,onOpenChange:U=>U||b?null:r(),children:s.jsx(es,{children:s.jsxs("form",{onSubmit:D,noValidate:!0,children:[s.jsxs(ts,{children:[s.jsx(ss,{children:"Add post"}),s.jsx(as,{children:"A post is a job function staffed in a team. People in this post report to the post above it."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Ao,{refusal:x,context:l,subject:"the post",action:"add the post"}),s.jsx(qn,{id:"org-post-team",label:"Team",help:"The team the post is in.",error:j.team,children:U=>s.jsxs(ct,{value:f,onValueChange:R=>{h(R),p(""),v({})},children:[s.jsx(nt,{id:"org-post-team","aria-describedby":U,"aria-invalid":j.team?!0:void 0,children:s.jsx(ut,{placeholder:"Choose a team"})}),s.jsx(st,{children:d.map(R=>s.jsx(_e,{value:R.key,children:R.label||R.key},R.key))})]})}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(qn,{id:"org-post-function",label:"Job function",help:I,error:j.job,children:U=>s.jsxs(ct,{value:m,disabled:S,onValueChange:R=>{p(R),v({})},children:[s.jsx(nt,{id:"org-post-function","aria-describedby":U,"aria-invalid":j.job?!0:void 0,children:s.jsx(ut,{placeholder:S?"Every job function has a post here":"Choose a job function"})}),s.jsx(st,{children:_.map(R=>s.jsx(_e,{value:R.key,children:R.label||R.key},R.key))})]})}),i&&!i.administer?s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Only the job functions directly below a post you hold are listed.",P.length?` For others, ask ${X3(P)}.`:""]}):null]})]}),s.jsxs(ns,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",disabled:b,onClick:r,children:"Cancel"}),s.jsx(Nd,{saving:b,blocked:O,described_by:S?"org-post-function-help":void 0,children:b?"Adding…":"Add post"})]})]})})})}function Q3({open:e,chart:t,post:n,names:a,members:r,save:l,on_close:i,context:o}){const[c,d]=u.useState({state:"loading"}),[f,h]=u.useState(""),[m,p]=u.useState(null),[j,v]=u.useState(-1),{saving:b,refusal:x,set_refusal:g,run:y}=Mo(i),w=u.useRef(0),N=u.useCallback(async()=>{const A=w.current+=1;d({state:"loading"});const G=await r();A===w.current&&d(G.ok?{state:"read",members:G.data}:{state:"failed"})},[r]);u.useEffect(()=>{e&&(h(""),p(null),v(-1),g(null),N())},[e,N,g]);const C=t.posts.find(A=>A.post===n);if(!n||!C)return null;const _=a.post(n),S=new Set(C.holders.map(A=>A.id)),D=t.posts.some(A=>A.reports_to===n)&&C.holders.length>0?C.holders[0]:null,I=f.trim().toLowerCase(),P=c.state==="read"?c.members.filter(A=>!S.has(A.id)).filter(A=>!I||[A.label,A.detail,A.email].some(G=>G==null?void 0:G.toLowerCase().includes(I))):[],M=c.state==="read"&&c.members.every(A=>S.has(A.id)),U=c.state==="read"&&!M&&P.length>0,R=U&&j>=0&&j<P.length?P[j]:null,T=A=>`org-holder-option-${A.id}`,E=!ql(o)||!m||D!==null,k=A=>{if(!U)return;const G=P.length-1,W=Z=>{var ge,Y;A.preventDefault(),v(Z),(Y=(ge=document.getElementById(T(P[Z])))==null?void 0:ge.scrollIntoView)==null||Y.call(ge,{block:"nearest"})};A.key==="ArrowDown"?W(Math.min(R?j+1:0,G)):A.key==="ArrowUp"?W(R?Math.max(j-1,0):G):A.key==="Home"&&R?W(0):A.key==="End"&&R?W(G):A.key==="Enter"&&R&&(m==null?void 0:m.id)!==R.id&&(A.preventDefault(),p(R))},$=D?void 0:m?"Only members of the organization can hold its posts. Members who already hold it are left out.":"Choose a member to add.",V=A=>{A.preventDefault(),!(E||!m)&&y(()=>l({action:"hold",post:n,member:m.id},`Added ${m.label} to ${_}.`))};return s.jsx(Jn,{open:e,onOpenChange:A=>A||b?null:i(),children:s.jsx(es,{children:s.jsxs("form",{onSubmit:V,noValidate:!0,children:[s.jsxs(ts,{children:[s.jsxs(ss,{children:["Add holder to ",_]}),s.jsx(as,{children:"The member holds this post and reports as it does."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Ao,{refusal:x,context:o,subject:"the holder",action:"add the holder"}),D?s.jsxs(ce,{variant:"info",id:"org-holder-one",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsxs(ue,{children:["This post takes one holder. Remove ",a.member(D)," first, then add the new holder."]})]}):null,s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"org-holder-member",children:"Member"}),s.jsx(St,{id:"org-holder-member",role:"combobox","aria-expanded":U,"aria-controls":U?"org-holder-members":void 0,"aria-activedescendant":R?T(R):void 0,"aria-autocomplete":"list","aria-describedby":$?"org-holder-member-help":void 0,placeholder:"Search members by name, username or email",autoComplete:"off",value:f,disabled:D!==null,onChange:A=>{h(A.target.value),v(-1)},onKeyDown:k}),s.jsx("div",{className:"max-h-56 overflow-y-auto rounded-md border",children:c.state==="loading"?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-sm",role:"status",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),"Loading members…"]}):c.state==="failed"?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-2",children:[s.jsx("p",{className:"text-destructive text-sm",children:"Could not read the members."}),s.jsx(H,{type:"button",variant:"outline",size:"sm",onClick:()=>void N(),children:"Retry"})]}):M?s.jsx("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"Every member already holds this post."}):P.length===0?s.jsxs("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:["No member matches “",f.trim(),"”."]}):s.jsx("ul",{id:"org-holder-members",role:"listbox","aria-label":"Members",className:"m-0 list-none p-1",children:P.map((A,G)=>{const W=(m==null?void 0:m.id)===A.id,Z=(R==null?void 0:R.id)===A.id;return s.jsxs("li",{id:T(A),role:"option","aria-selected":W,className:`cursor-pointer rounded-sm px-2 py-1.5 ${W?"bg-accent text-accent-foreground":Z?"bg-muted":"hover:bg-muted"} ${Z?"ring-ring ring-2 ring-inset":""}`,onClick:()=>{D||(v(G),p(A))},children:[s.jsxs("div",{className:"text-sm font-medium break-words",children:[A.label,A.detail&&P.filter(ge=>ge.label===A.label).length>1?` (${A.detail})`:""]}),A.email?s.jsx("div",{className:"text-muted-foreground text-xs break-all",children:A.email}):null]},A.id)})})}),$?s.jsx("p",{id:"org-holder-member-help",className:"text-muted-foreground text-xs",children:$}):null]})]}),s.jsxs(ns,{className:"mt-6",children:[s.jsx(H,{type:"button",variant:"outline",disabled:b,onClick:i,children:"Cancel"}),s.jsx(Nd,{saving:b,blocked:E,described_by:D?"org-holder-one":$?"org-holder-member-help":void 0,children:b?"Adding…":"Add holder"})]})]})})})}function Z3(e){const[t,n]=u.useState(null),a=u.useRef(t);u.useEffect(()=>{a.current=t},[t]);const r=u.useCallback(c=>{var d;(d=a.current)==null||d.resolve(c),n(null)},[]),l=u.useCallback(c=>new Promise(d=>{var f;(f=a.current)==null||f.resolve(!1),n({...c,resolve:d})}),[]);u.useEffect(()=>()=>{var c;return(c=a.current)==null?void 0:c.resolve(!1)},[]);const i=!ql(e),o=s.jsx(xw,{open:t!==null,onOpenChange:c=>c?null:r(!1),children:s.jsxs(gw,{children:[s.jsxs(vw,{children:[s.jsx(bw,{children:t==null?void 0:t.title}),s.jsx(jw,{className:"whitespace-pre-line",children:t==null?void 0:t.description})]}),t&&i?s.jsx(um,{context:e,action:t.action}):null,s.jsxs(yw,{children:[s.jsx(_w,{children:"Cancel"}),s.jsx(ww,{variant:t!=null&&t.destructive?"destructive":"default","aria-disabled":i||void 0,onClick:c=>{if(i){c.preventDefault();return}r(!0)},children:t==null?void 0:t.action_label})]})]})});return{confirm:l,confirm_dialog:o}}function Nu({label:e,on_edit:t,on_remove:n,items:a}){const r=a??[...t?[{label:"Edit",on_select:t}]:[],...n?[{label:"Remove",on_select:n,destructive:!0}]:[]];return s.jsxs(xd,{children:[s.jsx(gd,{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(xp,{className:"size-3.5","aria-hidden":"true"})})}),s.jsx(To,{align:"end",children:r.map(l=>s.jsx(_l,{className:l.destructive?"text-destructive focus:text-destructive":void 0,onSelect:l.on_select,children:l.label},l.label))})]})}function W3({label:e,message:t,on_dismiss:n}){return s.jsxs(ce,{variant:"destructive",role:"alert",className:"mb-3",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsxs(xe,{children:[e," was not removed"]}),s.jsxs(ue,{children:[s.jsx("p",{children:t}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Dismiss"})]})]})}const kd={host:"local",two_factor:"ok",settings_href:""},J3={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."},ez="Covered: someone holds a post that fills the slot. Vacant: posts fill it but nobody holds them. Uncovered: no job function fills it.",tz=4,ox=e=>({paddingLeft:16+24*Math.min(e,tz)}),ku={covered:{label:"Covered",tone:"success"},vacant:{label:"Vacant",tone:"warning"},uncovered:{label:"Uncovered",tone:"error"}};function nz(){const e=nn().org;if(!e)throw new Error("The Org chart page rendered without the org seam.");return e}function sz({host:e="local",org:t=""}={}){const n=nz(),[a,r]=u.useState({state:"loading"}),[l,i]=u.useState(null),o=u.useRef(0),c=u.useRef(null),d=u.useCallback(j=>{const v=async b=>{const x=o.current+=1;c.current&&clearTimeout(c.current);const g=await n.chart();if(x!==o.current)return;if(g.ok){i({chart:g.data,at:new Date().toISOString()}),r({state:"read"});return}const{refusal:y}=g;if(y.reason==="no_local_org"){i(null),r({state:"none",seedable:y.seedable!==!1});return}if(e==="hosted"&&(y.reason==="not_found"||y.status===404)){i(null),r({state:"missing"});return}if(y.retry&&y.reason==="store_locked"&&b>0){const w=y.retry_after??10;r({state:"busy",retry_after:w}),c.current=setTimeout(()=>void v(b-1),w*1e3);return}r({state:"failed",refusal:y})};return v(j)},[n,e]);u.useEffect(()=>(d(1),()=>{o.current+=1,c.current&&clearTimeout(c.current)}),[d]);const f=()=>void d(1),h=a.state==="none"||a.state==="missing"?null:l,{href:m}=Ve(),p=uz(n,()=>void d(1),(h==null?void 0:h.chart)??az,e,m("/settings/account"));return a.state==="missing"?s.jsx(hz,{org:t}):s.jsx(ck,{children:s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(Gt,{title:"Org chart",description:J3[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(dz,{quiet:a.state==="busy"}):null,a.state==="none"?s.jsx(fz,{edit:(p==null?void 0:p.actions)??null,seedable:a.seedable}):null,a.state==="failed"?s.jsx(pz,{host:e,kept_at:(h==null?void 0:h.at)??null,on_retry:f}):null,h?s.jsx(xz,{chart:h.chart,host:e,edit:(p==null?void 0:p.actions)??null}):null,(p==null?void 0:p.dialogs)??null]})})}const az={org:"",workflow:!1,teams:[],job_functions:[],slots:[],posts:[],members:[],slot_resolution:[],project:{team:null,roots:[]}};function rz(e){var i;const t=e.authority;if(!t)return{functions:!0,team_add:!0,team:()=>"full",post_add:!1,post:()=>!1,override:!0};const n=((i=e.teams.find(o=>o.parent===null))==null?void 0:i.key)??null,a=new Set(t.teams),r=new Set(t.team_descriptions),l=new Set(t.posts);return{functions:t.administer,team_add:a.size>0,team:o=>o===n?t.administer?"root":r.has(o)?"description":null:a.has(o)?"full":r.has(o)?"description":null,post_add:t.post_pairs.length>0,post:o=>l.has(o),override:!1}}function lz(e){const t=e.authority;return t?t.administer||t.teams.length>0||t.team_descriptions.length>0||t.posts.length>0||t.post_pairs.length>0:!0}const iz={local:"It leaves this repository's local org. If a post, a team or function under it, a holder, an override or the project still needs it, nothing is removed and you are told what needs it.",hosted:"It leaves the organization. If a post, a team or job function under it, or a holder still needs it, nothing is removed and you are told what needs it."},oz={mfa_challenge_required:"challenge",mfa_enrollment_required:"enroll"};function cz(e,t,n){var c;const a=t==="hosted"&&!!n.authority,r=((c=n.authority)==null?void 0:c.two_factor)??!0,[l,i]=u.useState("ok"),o=u.useCallback(async()=>{a&&i(e.twoFactor?await e.twoFactor():r?"ok":"challenge")},[e,a,r]);return u.useEffect(()=>{if(!a){i("ok");return}r?i("ok"):o();const d=()=>void o();return window.addEventListener("focus",d),()=>window.removeEventListener("focus",d)},[a,r,o]),{state:l,set_state:i,check:o}}function uz(e,t,n,a,r){const l=$l(),i=qk(n),o=cz(e,a,n),c=a==="hosted"?{host:a,two_factor:o.state,settings_href:r}:kd,{confirm:d,confirm_dialog:f}=Z3(c),[h,m]=u.useState(null),[p,j]=u.useState({}),v=R=>j(T=>{if(!T[R])return T;const{[R]:E,...k}=T;return k}),b=e.members,x=u.useCallback(async()=>{if(!b)return{ok:!1};const R=await b();return R.ok?{ok:!0,data:R.data}:{ok:!1}},[b]),g=e.change;if(!g||a==="hosted"&&(!n.authority||!lz(n)))return null;const y=rz(n),w=R=>{const T=R.code?oz[R.code]:void 0;return T?(o.set_state(T),{kind:"two_factor",message:R.message}):R.code==="revision_conflict"?(t(),{kind:"changed",message:R.message}):R.code==="outside_authority"?(t(),{kind:"authority",message:R.message}):{message:R.message}},N=R=>R.action==="hold"||R.action==="release"?"posts":"kind"in R?R.kind==="team"?"teams":R.kind==="post"?"posts":"functions":null,C=(R,T)=>{const E=R==null?void 0:R.warning;E?l.error(E):l.success(T),t()},_=async(R,T)=>{const E=await g(R);if(!E.ok)return w(E.refusal);const k=N(R);return k&&v(k),C(E.data,T),null},S=R=>{o.check(),m(R)},O=async(R,T,E,k)=>{const $=await g(E);if(!$.ok){const V=w($.refusal);j(A=>({...A,[R]:{label:T,message:V.message}}));return}v(R),C($.data,k)},D=async(R,T,E)=>{const k=R==="team"?"team":"job function";o.check(),await d({title:`Remove ${k} ${E}?`,description:iz[a],action_label:"Remove",destructive:!0,action:`remove the ${k}`})&&await O(R==="team"?"teams":"functions",E,{action:"remove",kind:R,key:T},`${R==="team"?"Team":"Job function"} ${E} removed.`)},I=async R=>{const T=i.post(R);o.check(),await d({title:`Remove post ${T}?`,description:"The post leaves the organization's chart. A post with holders is refused; remove its holders first.",action_label:"Remove",destructive:!0,action:"remove the post"})&&await O("posts",T,{action:"remove",kind:"post",key:R},`Removed post ${T}.`)},P=async(R,T)=>{const E=i.post(R),k=i.member(T),$=n.posts.find(Z=>Z.post===R),A=(($==null?void 0:$.holders.length)??0)<=1?$!=null&&$.escalates_to?` The post becomes vacant. Until someone holds it, its reports and the slots it fills go to ${i.manager($.escalates_to)}.`:" The post becomes vacant.":"";if(o.check(),!await d({title:`Remove ${k} from ${E}?`,description:`They stop holding this post and no longer report through it.${A}`,action_label:"Remove",action:"remove the holder"}))return;const W=await g({action:"release",post:R,member:T.id});if(!W.ok){l.error(w(W.refusal).message),t();return}v("posts"),C(W.data,`Removed ${k} from ${E}.`)},M=()=>m(null),U=(h==null?void 0:h.kind)==="override"&&n.project&&n.project.team!==null?n.project.slots.find(R=>R.slot===h.slot)??null:null;return{actions:{can:y,host:a,team:(R,T="full")=>S({kind:"team",team:R,scope:T}),job:R=>S({kind:"function",job:R}),override:R=>S({kind:"override",slot:R}),remove:(R,T,E)=>void D(R,T,E),post_add:()=>S({kind:"post"}),post_remove:R=>void I(R),holder_add:R=>S({kind:"holder",post:R}),holder_remove:(R,T)=>void P(R,T),refused:R=>{const T=p[R];return T?s.jsx(W3,{label:T.label,message:T.message,on_dismiss:()=>v(R)}):null}},dialogs:s.jsxs(s.Fragment,{children:[s.jsx(G3,{open:(h==null?void 0:h.kind)==="team",chart:n,team:(h==null?void 0:h.kind)==="team"?h.team:null,scope:(h==null?void 0:h.kind)==="team"?h.scope:"full",parents:n.authority?n.authority.teams:void 0,save:_,on_close:M,context:c}),s.jsx(Y3,{open:(h==null?void 0:h.kind)==="function",chart:n,job:(h==null?void 0:h.kind)==="function"?h.job:null,save:_,on_close:M,context:c}),s.jsx(F3,{open:U!==null,chart:n,binding:U,names:i,save:_,confirm:R=>d({...R,action:"clear the override"}),on_close:M}),s.jsx(K3,{open:(h==null?void 0:h.kind)==="post",chart:n,names:i,save:_,on_close:M,context:c}),s.jsx(Q3,{open:(h==null?void 0:h.kind)==="holder",chart:n,post:(h==null?void 0:h.kind)==="holder"?h.post:null,names:i,members:x,save:_,on_close:M,context:c}),f]})}}function dz({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(at,{className:n===3?"h-10 w-2/3":"h-10 w-full"},n))})}function il({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 fz({edit:e,seedable:t}){const n=t?e?"Plan one from this checkout's workflow roles with sdlc org seed, or start one with a team. This page shows it as soon as it exists.":"Plan one from this checkout's workflow roles, or start one with a team. This page shows it as soon as it exists.":"Start one with a team. This page shows it as soon as it exists.";return s.jsxs(ce,{variant:"info",className:"mt-6",children:[s.jsx(ea,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"This repository has no local org yet"}),s.jsxs(ue,{children:[s.jsx("p",{children:n}),t||!e?s.jsxs("div",{className:"mt-2 grid w-full gap-2",children:[t?s.jsx(il,{children:"sdlc org seed"}):null,e?null:s.jsx(il,{children:"sdlc org add team <key>"})]}):null,e?s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>e.team(null),children:[s.jsx(jl,{className:"size-4","aria-hidden":"true"}),"Add team"]}):null]})]})}function hz({org:e}){const{href:t,Link:n}=Ve();return s.jsx(ta,{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 mz(e){return new Date(e).toDateString()===new Date().toDateString()?`today at ${Qn(e)}`:`on ${En(e)} at ${Qn(e)}`}function pz({host:e,kept_at:t,on_retry:n}){const a=t?`The chart read ${mz(t)} is kept below. `:"";return s.jsxs(ce,{variant:"destructive",className:"mt-6",children:[s.jsx(ot,{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(ue,{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 qk(e){return u.useMemo(()=>{const t=new Map(e.teams.map(b=>[b.key,b.label||b.key])),n=new Map(e.job_functions.map(b=>[b.key,b.label||b.key])),a=new Map(e.slots.map(b=>[b.key,b.label||b.key])),r=new Map(e.posts.map(b=>[b.post,b.holders])),l=b=>b.label||b.id,i=new Map;for(const b of[...e.members,...e.posts.flatMap(x=>x.holders)]){const x=l(b);i.set(x,(i.get(x)??new Set).add(`${b.kind}:${b.id}`))}const o=b=>{var x;return(((x=i.get(l(b)))==null?void 0:x.size)??0)>1},c=b=>{const x=o(b)?b.detail??b.id:null;return x&&x!==l(b)?x:null},d=b=>{const x=c(b);return x&&x!==l(b)?`${l(b)} (${x})`:l(b)},f=b=>{const[x="",g=""]=b.split("/");return{team:t.get(x)??x,job:n.get(g)??g}},h=b=>{const{team:x,job:g}=f(b);return`${g} · ${x}`},m=b=>{if(b==="top")return"Top of the org";if(typeof b!="string")return`A vacant ${n.get(b.vacant)??b.vacant}`;const x=(r.get(b)??[]).map(d);return x.length?`${h(b)} (${x.join(", ")})`:h(b)},p=new Map(e.teams.map(b=>[b.key,b.parent])),j=b=>{let x=0;for(let g=p.get(b);g&&x<e.teams.length;g=p.get(g))x+=1;return x};return{parts:f,post:h,member:d,memberLabel:l,memberDetail:c,manager:m,byPost:(b,x)=>{const[g="",y=""]=[b.split("/")[0],x.split("/")[0]],[w,N]=[f(b),f(x)];return j(g)-j(y)||w.team.localeCompare(N.team)||w.job.localeCompare(N.job)},slot:b=>a.get(b)??b,job:b=>n.get(b)??b,team:b=>t.get(b)??b}},[e])}function Ka({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 Df({children:e,on_click:t}){return s.jsxs(H,{type:"button",variant:"outline",size:"sm",onClick:t,children:[s.jsx(jl,{className:"size-4","aria-hidden":"true"}),e]})}const Pv={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 xz({chart:e,host:t,edit:n}){const a=qk(e),r=e.members.some(l=>l.kind==="agent");return s.jsxs(s.Fragment,{children:[s.jsxs(Ka,{id:"org-chart-lines",title:"Reporting lines",description:"Each post reports to the post of its parent job function in the same team, or else in the nearest team above it that has one.",actions:n!=null&&n.can.post_add?s.jsx(Df,{on_click:n.post_add,children:"Add post"}):void 0,children:[n==null?void 0:n.refused("posts"),s.jsx(yz,{chart:e,names:a,agents:r,host:t,edit:n})]}),s.jsx(Ka,{id:"org-chart-members",title:"Members",description:r?`${Pv[t]} Each agent answers to the nearest person in its reporting chain.`:Pv[t],children:s.jsx(Nz,{chart:e,names:a,host:t,agents:r})}),n?s.jsxs(Ka,{id:"org-chart-teams",title:"Teams",description:"Each team under its parent. A post is one of its job functions staffed in it.",actions:n.can.team_add?s.jsx(Df,{on_click:()=>n.team(null),children:"Add team"}):void 0,children:[n.refused("teams"),s.jsx(gz,{chart:e,edit:n})]}):null,s.jsxs("div",{className:"grid items-start gap-x-6 xl:grid-cols-2",children:[s.jsxs(Ka,{id:"org-chart-functions",title:"Function tree",description:"Each job function under its parent, with the slots it fills.",actions:n!=null&&n.can.functions?s.jsx(Df,{on_click:()=>n.job(null),children:"Add job function"}):void 0,children:[n!=null&&n.can.functions?n.refused("functions"):null,s.jsx(kz,{chart:e,names:a,edit:n!=null&&n.can.functions?n:null})]}),s.jsxs(Ka,{id:"org-chart-slots",title:"Slots",description:ez,children:[e.workflow===!1?s.jsx("p",{className:"text-muted-foreground mb-3 text-xs",children:"This checkout has no workflow file, so no slot is marked as a gate."}):null,s.jsx(Cz,{chart:e,names:a})]})]}),e.project?s.jsx(Rz,{project:e.project,chart:e,names:a,edit:n!=null&&n.can.override?n:null}):null]})}function gz({chart:e,edit:t}){var c;const n=cx([...e.teams].sort((d,f)=>(d.label||d.key).localeCompare(f.label||f.key)),d=>d.key,d=>d.parent);if(n.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"No teams yet."});const a=((c=e.project)==null?void 0:c.team)??null,r=t.host==="hosted",l=(d,f)=>{const h=t.can.team(d.key);return h==="full"?s.jsx(Nu,{label:f,on_edit:()=>t.team(d),on_remove:()=>t.remove("team",d.key,f)}):h==="root"?s.jsx(Nu,{label:f,on_edit:()=>t.team(d,"description")}):h==="description"?s.jsx(H,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`Edit the description of ${f}`,onClick:()=>t.team(d,"description"),children:s.jsx(Zu,{className:"size-3.5","aria-hidden":"true"})}):null},i=(d,f)=>s.jsx("ul",{role:"list",className:f===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:d.map(({item:h,children:m})=>{const p=h.label||h.key;return s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:ox(f),"data-testid":"org-chart-team",children:[s.jsx("span",{className:"text-sm font-medium",children:p}),s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[r?null:s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:h.key}),a===h.key?s.jsx(fe,{variant:"neutral",children:"Owns this project"}):null,l(h,p)]})]}),m.length>0?i(m,f+1):null]},h.key)})}),o=r&&e.teams.length===1;return s.jsxs(s.Fragment,{children:[s.jsx(jt,{className:"overflow-hidden",children:i(n,0)}),o?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["No teams below ",e.teams[0].label||e.teams[0].key," yet."]}):null]})}function cx(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 vz={local:"No posts yet.",hosted:"No posts yet. An org admin can add them."};function yz({chart:e,names:t,agents:n,host:a,edit:r}){const l=cx([...e.posts].sort((c,d)=>t.byPost(c.post,d.post)),c=>c.post,c=>typeof c.reports_to=="string"&&c.reports_to!=="top"?c.reports_to:null);if(l.length===0){const c=a==="hosted"&&(r==null?void 0:r.can.functions)&&!r.can.post_add;return s.jsx("p",{className:"text-muted-foreground text-sm",children:r!=null&&r.can.post_add?"No posts yet. Add a post to staff a job function in a team.":c?"No posts yet. Add a job function under Function tree first, then add a post to staff it in a team.":vz[a]})}const i=new Map(e.members.map(c=>[`${c.kind}:${c.id}`,c])),o=(c,d)=>s.jsx("ul",{role:"list",className:d===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:c.map(({item:f,children:h})=>{const{team:m}=t.parts(f.post),p=typeof f.reports_to=="object"?f.reports_to:null,j=!!(r!=null&&r.can.post(f.post));return s.jsxs("li",{children:[s.jsxs("div",{className:"border-b py-2 pr-4",style:ox(d),"data-testid":"org-chart-post",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(eT,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium",children:t.parts(f.post).job}),s.jsx("span",{className:"text-muted-foreground text-xs",children:p?`${m} · Reports to a vacant ${t.job(p.vacant)}`:m}),j&&r?s.jsx("span",{className:"ml-auto",children:s.jsx(Nu,{label:t.post(f.post),items:[{label:"Add holder",on_select:()=>r.holder_add(f.post)},{label:"Remove post",on_select:()=>r.post_remove(f.post),destructive:!0}]})}):null]}),s.jsx("div",{className:"mt-1 grid min-w-0 gap-1 pl-6",children:f.holders.length===0?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(fe,{variant:ku.vacant.tone,children:ku.vacant.label}),s.jsx("span",{className:"text-muted-foreground text-xs",children:f.escalates_to?`No one holds this post. Its work goes to ${t.manager(f.escalates_to)}.`:"No one holds this post."})]}):f.holders.map(v=>s.jsx(wz,{holder:v,post:f.post,member:i.get(`${v.kind}:${v.id}`),names:t,agents:n,host:a,on_remove:j&&r?()=>r.holder_remove(f.post,v):void 0},`${v.kind}:${v.id}`))})]}),h.length>0?o(h,d+1):null]},f.post)})});return s.jsx(jt,{className:"overflow-hidden",children:o(l,0)})}function bz(e){return new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function jz(e){if(!e.held_since)return null;const t=bz(e.held_since);return e.added_by?e.added_by==="former_member"?`Added on ${t} by a former member`:`Added by ${e.added_by.name} on ${t}`:`Added on ${t}`}function wz({holder:e,post:t,member:n,names:a,agents:r,host:l,on_remove:i}){const o=e.kind==="person"?gp:pp,c=n==null?void 0:n.posts.find(j=>j.post===t),d=n==null?void 0:n.posts.find(j=>j.primary),f=a.memberDetail(e);let h=null;c!=null&&c.dotted&&d?h=`Dotted line: primary manager is ${a.manager(d.reports_to)}`:e.kind==="agent"&&n&&"accountable_person"in n&&(h=n.accountable_person?`Accountable person ${a.member(n.accountable_person)}`:"No accountable person");const m=l==="hosted"?jz(e):null,p=a.memberLabel(e);return s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx(o,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium break-all",children:p}),i?s.jsxs(uk,{children:[s.jsx(dk,{asChild:!0,children:s.jsx(H,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`Remove ${a.member(e)} from ${a.post(t)}`,onClick:i,children:s.jsx(Ju,{className:"size-3.5","aria-hidden":"true"})})}),s.jsxs(Jp,{children:["Remove ",p]})]}):null,f?s.jsx("span",{className:"text-muted-foreground text-xs break-all",children:f}):null,r?s.jsx("span",{className:"text-muted-foreground text-xs",children:e.kind==="person"?"Person":"Agent"}):null]}),h?s.jsx("div",{className:"pl-5.5 text-xs",children:h}):null,m?s.jsx("div",{className:"text-muted-foreground pl-5.5 text-xs",children:m}):null]})}const _z=["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:"}),_z.map(l=>s.jsx(il,{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(jt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Members",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Member"}),s.jsx(F,{children:"Posts"}),s.jsx(F,{children:"Primary manager"}),s.jsx(F,{children:"Dotted lines"}),a?s.jsx(F,{children:"Accountable person"}):null]})}),s.jsx(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(le,{"data-testid":"org-chart-member",children:[s.jsxs(q,{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(q,{children:l.posts.map(d=>t.post(d.post)).join(", ")}),s.jsx(q,{children:i?t.manager(i.reports_to):"None"}),s.jsx(q,{children:o.length?o.map(d=>t.manager(d.reports_to)).join(", "):"None"}),a?s.jsx(q,{children:l.kind==="person"?"Not an agent":l.accountable_person?t.member(l.accountable_person):"None"}):null]},`${l.kind}:${l.id}`)})})]})})}function kz({chart:e,names:t,edit:n}){const a=cx([...e.job_functions].sort((l,i)=>(l.label||l.key).localeCompare(i.label||i.key)),l=>l.key,l=>l.parent);if(a.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:(n==null?void 0:n.host)==="hosted"?"No job functions yet. Add one to start the chart.":"No job functions yet."});const r=(l,i)=>s.jsx("ul",{role:"list",className:i===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:l.map(({item:o,children:c})=>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:ox(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(fe,{variant:"neutral",children:"Requires a person"}):null,n?s.jsx(Nu,{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(jt,{className:"overflow-hidden",children:r(a,0)})}function Sz(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 Su={covered:0,vacant:1,uncovered:2};function Gk(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 Cz({chart:e,names:t}){const n=Gk(e);return s.jsx(jt,{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Slots",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Slot"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Resolves to"})]})}),s.jsxs(Be,{children:[[...e.slot_resolution].sort((a,r)=>Su[a.status]-Su[r.status]||t.slot(a.slot).localeCompare(t.slot(r.slot))).map(a=>{const r=ku[a.status];return s.jsxs(le,{"data-testid":"org-chart-slot",children:[s.jsxs(q,{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(q,{children:s.jsx(fe,{variant:r.tone,children:r.label})}),s.jsxs(q,{children:[Sz(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(le,{children:s.jsx(q,{colSpan:3,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})})}const Tz="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.",zf=["sdlc org own <team>","sdlc org bind <slot> <team>/<function>... --reason <text>","sdlc org unbind <slot>"];function Rz({project:e,chart:t,names:n,edit:a}){if(e.team===null){const i=e.roots.map(n.team);return s.jsx(Ka,{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(il,{children:i.length?zf[0]:"sdlc org add team <key>"})})})}const r=Gk(t),l=[...e.slots].sort((i,o)=>Su[i.status]-Su[o.status]||n.slot(i.slot).localeCompare(n.slot(o.slot)));return s.jsxs(Ka,{id:"org-chart-project",title:"This project",description:Tz,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(jt,{className:"mt-3 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Slots in this project",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Slot"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Bound to"}),s.jsx(F,{children:"Source"}),a?s.jsx(F,{className:"text-right",children:s.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),s.jsxs(Be,{children:[l.map(i=>{const o=ku[i.status];return s.jsxs(le,{"data-testid":"org-chart-project-slot",children:[s.jsxs(q,{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(q,{children:s.jsx(fe,{variant:o.tone,children:o.label})}),s.jsx(q,{children:s.jsx(Ez,{binding:i,names:n})}),s.jsx(q,{children:s.jsx(Az,{binding:i})}),a?s.jsx(q,{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(Zu,{className:"size-3.5","aria-hidden":"true"})})}):null]},i.slot)}),l.length===0?s.jsx(le,{children:s.jsx(q,{colSpan:a?5:4,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})}),a?s.jsxs("div",{className:"mt-3 grid max-w-2xl gap-2",children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Overrides made here are made as ",s.jsx("span",{className:"font-mono",children:"person:user"}),", as sdlc org makes them without --as: that person must hold the lead post of the owning team or of a team above it."]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Change the owning team with sdlc org:"}),s.jsx(il,{children:zf[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:"}),zf.map(i=>s.jsx(il,{children:i},i))]})]})}function Ez({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 Az({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?En(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 Mz={breaking:"Breaking",new:"New",improved:"Improved",other:"Other changes"},$z=["breaking","new","improved","other"],Oz={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 Vk(e){return Oz[e]??e.replace(/_/g," ")}function Dz(e){return e.bump==="major"?"breaking":e.change==="added"?"new":e.change==="changed"?"improved":"other"}function Wi(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=Dz(l);t.set(i,[...t.get(i)??[],l])}return{sections:$z.filter(l=>t.has(l)).map(l=>({key:l,label:Mz[l],lines:t.get(l)})),breaking:t.has("breaking"),unlisted_count:n,modeling_only_count:a}}function zz(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} (${Vk(r.node_type)})${l}`)}}return`${n.join(`
|
|
401
|
+
`)}
|
|
402
|
+
`}const Ls="candidate";function ux(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}const Lz="Versioned records of this project's release branch, with notes from its graph changes.";function Yk({description:e=Lz,actions:t}){return s.jsx(Gt,{title:"Releases",description:e,actions:t})}function Fk(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 Ac({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:se("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 Tn({children:e}){return s.jsx("section",{className:"border-border flex flex-col gap-4 rounded-xl border p-4",children:e})}function An({title:e,error:t,onRetry:n}){return s.jsxs(ce,{variant:"destructive",children:[s.jsx(Lt,{}),e?s.jsx(xe,{children:e}):null,s.jsxs(ue,{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 Uz({title:e,text:t}){return s.jsx(Tn,{children:s.jsxs("div",{className:"flex flex-col items-center gap-2 py-10 text-center",children:[s.jsx(Qu,{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 Bz(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 Cu({changes:e}){const t=u.useMemo(()=>Wi(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(qv,{line:o},`${o.node_id}:${o.change}`))});return l.key==="breaking"?s.jsxs(ce,{variant:"destructive",className:"border-destructive/40",children:[s.jsx(Lt,{}),s.jsx(xe,{children:s.jsx("h3",{className:"text-destructive text-sm font-semibold",children:l.label})}),s.jsx(ue,{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(qv,{line:l,detail:!0},`all:${l.node_id}:${l.change}:${l.modeling_only}`))}):null]})}function qv({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(fe,{variant:"outline",children:Vk(e.node_type)})]}),n?s.jsx("span",{className:"text-muted-foreground text-xs",children:n}):null]})}const Xk="Releases of this checkout: the roadmap of open Planned Releases, the next candidate, and each production release with its notes.",Gv=5,dm="Not available",fm="planned:";function Kk(){const e=_s();return s.jsx("p",{className:"text-muted-foreground text-sm",children:`${dm}. ${e}`})}const Fn=e=>`${fm}${e}`,Hz=e=>e!=null&&e.startsWith(fm)?e.slice(fm.length):null,dx=e=>e?e.slice(0,7):"";function Iz(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 Pz(){return s.jsxs(ce,{variant:"info",children:[s.jsx(ea,{}),s.jsx(xe,{children:"This page only reads Releases"}),s.jsx(ue,{className:"text-info",children:"A Release is written when production runs a release candidate, once its commit is merged into origin/main."})]})}function qz(e){if(e.state==="unreadable")return{badges:s.jsx(fe,{variant:"error",children:"Could not be read"}),caption:""};if(e.state==="withdrawn")return{badges:s.jsx(fe,{variant:"warning",children:"Withdrawn"}),caption:e.replaced_by?`Replaced by ${e.replaced_by}`:"Withdrawn"};const t=s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"neutral",children:e.app_changed===!1?"App unchanged":e.previous_release_id?e.bump??"patch":"First"}),e.breaking?s.jsx(fe,{variant:"error",children:"Breaking"}):null]}),n=e.written_at?ux(e.written_at):"",a=e.tracks&&e.tracks.length>0?` · ${e.tracks.join(", ")}`:"";return{badges:t,caption:`${n}${a}`}}function sr({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 Sd({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 vs=({children:e})=>s.jsx("code",{className:"font-mono text-xs",children:e});function Qk(e,t){if(e.judged_commit&&t&&e.judged_commit!==t)return`Judged ${dx(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 Cd({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 Gz={ready:"success",verifying:"info",fixing:"warning",abandoned:"warning",ready_older:"neutral",none:"neutral",unknown:"neutral"};function Vz({batch:e}){if(e.state==="loading")return s.jsxs(ce,{children:[s.jsx(uu,{}),s.jsxs(ue,{className:"flex flex-row items-center gap-2",role:"status",children:[s.jsx(en,{"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(ce,{children:[s.jsx(uu,{}),s.jsxs(xe,{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{children:t.text}),s.jsx(fe,{variant:Gz[t.state],children:t.chip})]}),t.help?s.jsx(ue,{children:t.help}):null]})}function Yz(e,t,n){return`/org/${e}/issues/${encodeURIComponent(t)}?from=${encodeURIComponent(n)}`}function Zk({issues:e,error:t}){return t?s.jsx(An,{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(Cd,{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(vs,{children:n.file}):null]},n.key))})]})}function Wk({tracks:e,error:t}){return t?s.jsx(An,{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(Cd,{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(vs,{children:n.version}):null,n.bump?s.jsx(fe,{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(vs,{children:a.name}),s.jsxs(vs,{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 Jk({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(Cd,{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(le,{children:[s.jsx(F,{children:"Planned Release"}),s.jsx(F,{children:"Delivered"}),s.jsx(F,{children:"Not delivered"})]})}),s.jsx(Be,{children:e.planned.map(r=>s.jsxs(le,{children:[s.jsx(q,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.open&&t?s.jsx(sr,{query:`planned=${encodeURIComponent(r.id)}`,select:Fn(r.id),onSelect:n,children:r.name}):s.jsx("span",{children:r.name}),s.jsx(vs,{children:r.id})]})}),s.jsx(q,{children:a(r.delivered)}),s.jsx(q,{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 Fz={thread:"Thread",task:"Task",issue:"Issue",test:"Test"};function e1({rows:e,org:t,from:n,untasked:a}){const{href:r,Link:l}=Ve(),[i,o]=u.useState(!1),c=i?e:e.slice(0,Gv),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(Yz(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(le,{children:[s.jsx(F,{children:"Kind"}),s.jsx(F,{children:"Item"}),s.jsx(F,{children:"How it relates"})]})}),s.jsx(Be,{children:c.map(f=>s.jsxs(le,{children:[s.jsx(q,{children:Fz[f.kind]}),s.jsx(q,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[d(f),f.state&&f.kind!=="thread"?s.jsx("span",{className:"text-muted-foreground text-xs",children:f.state}):null]})}),s.jsx(q,{children:f.relation})]},`${f.kind}:${f.id}`))})]})}),e.length>Gv?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 t1=e=>(e==null?void 0:e.status)===409&&e.reason==="view_outdated";function n1(e){const t=fx(),[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 s1({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(at,{className:"h-8 w-full"}),s.jsx(at,{className:"h-8 w-full"}),s.jsx(at,{className:"h-8 w-2/3"})]}):e.state==="error"?t1(e.refusal)?s.jsx(Kk,{}):s.jsx(An,{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(e1,{rows:e.value.rows,org:t,from:n,untasked:e.value.untasked})]})}function Xz(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 a1({planned:e,onSelect:t}){return e?e.open?s.jsx(sr,{query:`planned=${encodeURIComponent(e.id)}`,select:Fn(e.id),onSelect:t,children:e.name}):s.jsxs("span",{children:[e.name," ",s.jsx(vs,{children:e.id})]}):null}function Kz({candidate:e,org:t,onSelect:n,notes:a}){const r=fx(),{related:l,read:i}=n1("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(Sd,{pairs:[["Environment",e.environment??"staging"],["Commit",s.jsx(vs,{children:dx(e.head_commit_id)},"commit")],["Readiness",d?Qk(d,e.head_commit_id):null],["Planned",e.planned_release?s.jsx(a1,{planned:e.planned_release,onSelect:n}):null]]}),o?s.jsx(Vz,{batch:o}):null,a,s.jsx(Zk,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(Wk,{tracks:e.tracks,error:e.tracks_error}),s.jsx(Jk,{delivery:e.planned_delivery,candidate:!0,onSelect:n}),s.jsx(s1,{related:l,org:t,from:"release:candidate",onRetry:()=>i(!0)})]})}function Qz({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(fe,{variant:"warning",children:"Withdrawn"}):s.jsx(fe,{variant:"neutral",children:e.app_changed===!1?"App unchanged":a?"First":e.bump}),e.breaking?s.jsx(fe,{variant:"error",children:"Breaking"}):null]}),e.state==="withdrawn"&&e.replaced_by?s.jsxs("p",{className:"text-sm",children:["Replaced by"," ",s.jsx(sr,{query:`release=${encodeURIComponent(e.replaced_by)}`,select:e.replaced_by,onSelect:t,inline:!0,children:e.replaced_by})]}):null]})}function Zz({release:e,org:t,onSelect:n,notes:a}){const r=e.label??e.version,{related:l,read:i}=n1(r),o=(l==null?void 0:l.state)==="ready"?Xz(l.value.previews):null;return s.jsxs(s.Fragment,{children:[s.jsx(Sd,{pairs:[["Environment",e.environment??"production"],["Commit",e.commit?s.jsx(vs,{children:dx(e.commit)},"commit"):null],["Readiness",e.readiness?`${Qk(e.readiness)} on staging`:null],["Previews",o],["Planned",e.planned_release?s.jsx(a1,{planned:e.planned_release,onSelect:n}):null]]}),a,s.jsx(Zk,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(Wk,{tracks:e.tracks,error:e.tracks_error}),s.jsx(Jk,{delivery:e.planned_delivery,candidate:!1,onSelect:n}),s.jsx(s1,{related:l,org:t,from:`release:${r}`,onRetry:()=>i(!0)})]})}function Wz({id:e,summary:t,org:n,onNotFound:a,forecast:r}){var p,j;const l=fx(),[i,o]=u.useState({state:"loading"}),c=u.useRef(0),d=u.useCallback(async(v=!1)=>{const b=++c.current;if(!(l!=null&&l.plannedRelease)){o({state:"error",error:dm,refusal:{status:409,message:dm,reason:"view_outdated"}});return}o({state:"loading"});const x=await l.plannedRelease(e,v?{fresh:!0}:void 0);b===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"&&(((p=i.refusal)==null?void 0:p.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(Tn,{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(fe,{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(Tn,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:(t==null?void 0:t.name)??e}),t1(i.refusal)?s.jsx(Kk,{}):f?null:s.jsx(An,{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(Tn,{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(fe,{variant:"neutral",children:"Planned"})]}),h.goal?s.jsx("p",{className:"text-muted-foreground text-sm",children:h.goal}):null]}),s.jsx(Sd,{pairs:[["Planned Release",s.jsx(vs,{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(Cd,{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(le,{children:[s.jsx(F,{children:"Member"}),s.jsx(F,{children:"Level"}),s.jsx(F,{children:"Tasks"}),s.jsx(F,{children:"State"})]})}),s.jsx(Be,{children:h.members.map(v=>{const b=v.tasks.filter(g=>g.state==="done").length,x=v.tasks.filter(g=>g.state!=="done").map(g=>g.id);return s.jsxs(le,{children:[s.jsx(q,{children:v.label}),s.jsx(q,{children:v.level?s.jsx(fe,{variant:"neutral",children:Jz(v.level)}):null}),s.jsx(q,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v.tasks.length>0?s.jsxs("span",{children:[b," of ",v.tasks.length," done"]}):null,x.length>0?s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Open: ",s.jsx(vs,{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(q,{children:v.state})]},v.item)})})]})}):null]}),s.jsxs("section",{className:"flex flex-col gap-2","aria-labelledby":"planned-related",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h2",{id:"planned-related",className:"text-lg font-semibold",children:"Related"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:h.related.length})]}),h.related.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing related yet."}):s.jsx(e1,{rows:h.related,org:n,from:`planned:${h.id}`})]})]})}const Jz=e=>e.charAt(0).toUpperCase()+e.slice(1);function fx(){return nn().releases}const In={noRelease:"No open Planned Release. Create one: release_plan.py create --name <version>",noTask:"no open task of yours",noNext:"none",pending:"reading the roadmap",failedLead:"The roadmap could not be read",noEngineLead:"this engine has no roadmap read"},Vv=3,e6=["in_progress","not_started","planned","blocked"],hx="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),yt=e=>e.charAt(0).toUpperCase()+e.slice(1);function Lf(e){const t=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(e??""));return t?`${Number(t[3])} ${hx[Number(t[2])-1]}`:String(e??"")}function r1(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${hx[t.getMonth()]} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function t6(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${hx[t.getMonth()]}`}function Us(e){return e?e.from===e.to&&e.or_later?`${Lf(e.from)} or later`:`${Lf(e.from)} to ${Lf(e.to)}${e.or_later?", or later":""}`:""}function n6(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 l1(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??"")?"":n6(t)].filter(Boolean).join(" · "),l=t.projected?Us(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 ${Us({...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?yt(l):"",caption:f}}function s6(e){const t=e.kinds??[];return[t.includes("range")?"Not promised":"",e.goal??(t.includes("major")?"No goal yet":"")].filter(Boolean).join(" · ")}function a6(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 i1=e=>String(e??"").replace(/_/g," ");function r6(e){const t=e??{},n=t.kinds??[],a=n.includes("slipped"),r=!a&&t.was&&t.now?Us(t.was)===Us(t.now)?`, range still ${Us(t.now)}`:`, range was ${Us(t.was)}, now ${Us(t.now)}`:"",l=[a&&t.was?`was ${Us(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?yt(l.join(" · ")):"",what:i}}const ol="roadmap",Yv={reading:!1,value:null,refusal:null};function l6(e){const[t,n]=u.useState({all:Yv,mine:Yv}),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 i6(e,t){return`${e} open${t.length?` · ${t.join(", ")} moved since you looked`:""}`}function Ri({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 o1=({level:e})=>e?s.jsx(fe,{variant:"neutral",children:yt(e)}):null;function c1({state:e}){const t=yt(i1(e));return e6.includes(String(e))?s.jsx("span",{className:"font-medium",children:t}):s.jsx("span",{children:t})}function o6({reads:e,scope:t,onScope:n,onRead:a,org:r,onSelect:l}){var p,j;const i=e[t],o=i.value,c=_s(),d=u.useRef(null),f=u.useRef(!1);u.useEffect(()=>{!i.reading&&!i.value&&!i.refusal&&a(t)},[t,i.reading,i.value,i.refusal,a]),u.useEffect(()=>{var v;f.current&&!i.reading&&(f.current=!1,(v=d.current)==null||v.focus())},[i.reading]);const h=()=>{f.current=!0,a(t,!0)},m=o?[o.as_of?`as of ${r1(o.as_of)}`:"",`${((p=o.source)==null?void 0:p.machine)||"this machine"}'s records`,((j=o.decider)==null?void 0:j.words)??""].filter(Boolean).join(" · "):"";return s.jsxs(Tn,{children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[s.jsx("h2",{ref:d,tabIndex:-1,className:"text-lg font-semibold outline-none",children:"Roadmap"}),m?s.jsx("p",{className:"text-muted-foreground text-xs",children:m}):null]}),s.jsx("div",{role:"group","aria-label":"Roadmap scope",className:"flex gap-2",children:["all","mine"].map(v=>s.jsx(H,{variant:"outline",size:"sm","aria-pressed":t===v,onClick:()=>n(v),children:v==="all"?"All":"Mine"},v))})]}),s.jsx("div",{"aria-live":"polite",children:i.reading?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status",children:[s.jsx(en,{"aria-hidden":!0,className:"size-4"})," ",yt(In.pending),"…"]}):null}),i.refusal&&!i.reading?i.refusal.reason==="no_roadmap"?s.jsx(An,{title:In.failedLead,error:`${yt(In.noEngineLead)}. ${c}`}):i.refusal.reason==="refused"?s.jsx(An,{title:In.failedLead,error:i.refusal.message}):s.jsx(An,{title:In.failedLead,error:i.refusal.message,onRetry:h}):null,o?t==="mine"?s.jsx(p6,{mine:o.mine,org:r,onSelect:l}):s.jsx(u6,{read:o,org:r,onSelect:l}):null]})}function c6(e){if(!e||typeof e.seconds_per_day!="number")return"No rate";const t=t6(e.as_of);return`${Math.round(e.seconds_per_day/3600)} task hours a day over the ${e.days} days${t?` to ${t}`:""}`}function u6({read:e,org:t,onSelect:n}){var r,l;const a=e.releases??[];if(!a.length){const[i,o]=In.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(Ri,{children:o})]})}return s.jsxs(s.Fragment,{children:[s.jsx(Sd,{pairs:[["Forecast from",yt(`${((r=e.source)==null?void 0:r.machine)||"this machine"}'s task records and rate`)],["Rate",c6(e.rate)],["Not counted",yt(((l=e.source)==null?void 0:l.not_counted)||"other machines' work")]]}),a.map(i=>s.jsx(d6,{row:i,org:t,onSelect:n},i.id))]})}function d6({row:e,org:t,onSelect:n}){var h,m,p;const a=l1(e.forecast),r=a6(e),l=s6(e),i=`roadmap-${e.id}`,o=e.moved?r6(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(sr,{query:`planned=${encodeURIComponent(e.id)}`,select:Fn(e.id),onSelect:n,children:e.name})}),e.kinds.map(j=>s.jsx(fe,{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:yt(a.caption.join(" · "))}):null]}):null,f?s.jsx("p",{className:"text-muted-foreground text-sm",children:f}):null,o?s.jsxs(ce,{variant:"info",children:[s.jsx(ET,{"aria-hidden":!0}),s.jsx(xe,{children:"Moved since you looked"}),s.jsxs(ue,{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]}),(p=e.stale_unchecked)!=null&&p.words?s.jsx("p",{className:"text-muted-foreground text-xs",children:yt(e.stale_unchecked.words)}):null,e.for_you&&e.kinds.includes("major")?s.jsx(f6,{row:e}):null,s.jsx(m6,{row:e,org:t})]})}function f6({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?`${yt(r).replace(/\.$/,"")}. `:"","Accept or reject in the terminal:"]}),s.jsx(Ri,{children:a.accept}),s.jsx(Ri,{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(Ri,{children:t.set_goal})]}):null]})}function u1({next:e,org:t}){const{href:n,Link:a}=Ve(),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 h6(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?yt(e.nobody):""}function m6({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,Vv),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(le,{children:[s.jsx(F,{children:"Member"}),s.jsx(F,{children:"Level"}),s.jsx(F,{children:"State"}),s.jsx(F,{children:"Who is on it"})]})}),s.jsx(Be,{children:l.map(o=>{const c=i.get(o.item);return s.jsxs(le,{children:[s.jsx(q,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(u1,{next:o,org:t}),c?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[yt(c.words),c.estimate_as_of?` (estimated ${r1(c.estimate_as_of)})`:""]}):null]})}),s.jsx(q,{children:s.jsx(o1,{level:o.level})}),s.jsx(q,{children:s.jsx(c1,{state:o.state})}),s.jsx(q,{children:h6(o,e)})]},o.item)})})]})}),r.length>Vv&&!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 p6({mine:e,org:t,onSelect:n}){const{href:a,Link:r}=Ve();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:yt(In.noTask)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Your work",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Task"}),s.jsx(F,{children:"Release"}),s.jsx(F,{children:"Member"})]})}),s.jsx(Be,{children:e.tasks.map(i=>{var o,c;return s.jsxs(le,{children:[s.jsx(q,{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,yt(i1(i.state))].filter(Boolean).join(" · ")})]})}),s.jsx(q,{children:(o=i.members)!=null&&o.length?i.members.map(d=>s.jsx("div",{children:s.jsx(sr,{query:`planned=${encodeURIComponent(d.planned_release)}`,select:Fn(d.planned_release),onSelect:n,children:d.name})},d.planned_release)):i.release?s.jsx(sr,{query:`planned=${encodeURIComponent(i.release.planned_release)}`,select:Fn(i.release.planned_release),onSelect:n,children:i.release.name}):s.jsx("span",{className:"text-muted-foreground",children:i.words?yt(i.words):"—"})}),s.jsx(q,{children:(c=i.members)!=null&&c.length?i.members.map(d=>s.jsx(o1,{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(Ri,{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:yt(In.noNext)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Your next members",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Release"}),s.jsx(F,{children:"Member"}),s.jsx(F,{children:"State"})]})}),s.jsx(Be,{children:e.next.map(i=>s.jsxs(le,{children:[s.jsx(q,{children:s.jsx(sr,{query:`planned=${encodeURIComponent(i.release)}`,select:Fn(i.release),onSelect:n,children:i.name})}),s.jsx(q,{children:s.jsx(u1,{next:i,org:t})}),s.jsx(q,{children:s.jsx(c1,{state:i.state})})]},`${i.release}:${i.item}`))})]})})]})]})}function x6({state:e,id:t}){var l;const n=_s();if(!e)return null;const a=(l=e.value)==null?void 0:l.releases.find(i=>i.id===t);if(!a){if(e.reading)return s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status",children:[s.jsx(en,{"aria-hidden":!0,className:"size-4"})," ",yt(In.pending),"…"]});if(e.refusal){const i=e.refusal.reason==="no_roadmap"?`${yt(In.noEngineLead)}. ${n}`:e.refusal.message;return s.jsx("p",{className:"text-muted-foreground text-xs",children:`${In.failedLead}: ${i}`})}return null}const r=l1(a.forecast);return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.lead?s.jsx("p",{className:"text-sm",children:r.lead}):null,r.caption.length?s.jsx("p",{className:"text-muted-foreground text-xs",children:yt(r.caption.join(" · "))}):null]})}function d1(){const e=nn().releases;if(!e)throw new Error("The Releases page rendered without a Releases contract.");return e}function g6({initial:e,environments:t,branch_options:n,chooseBranch:a,renderWrite:r,selection:l,org:i,onReadAgain:o,onNotFound:c,notice:d,focusOnMount:f}){var Es,Dn,zn,Tt,rn,ls,Ln,sa,L,be;const h=d1(),m=e.local??null,[p,j]=u.useState(e),[v,b]=u.useState(null),x=l?l.selected:v,g=l?l.onSelect:b,y=!!(m||p.release_branch),[w,N]=u.useState(m||e.release_branch?{state:"loading"}:{state:"ready",value:null}),[C,_]=u.useState({}),[S,O]=u.useState(null),[D,I]=u.useState(!1),[P,M]=u.useState(null),[U,R]=u.useState(null),T=u.useRef(null),E=m?{fresh:!0}:void 0,k=u.useCallback(async J=>{const we=await h.candidate(J);N(we.ok?{state:"ready",value:we.data.candidate}:{state:"error",error:we.refusal.message,refusal:we.refusal})},[h]),$=u.useCallback(async()=>{N({state:"loading"}),await k(E)},[k,m]),V=u.useCallback(async()=>{const J=await h.list();J.ok&&j(J.data)},[h]),A=((Es=p.release_branch)==null?void 0:Es.id)??null;u.useEffect(()=>{if(!m&&!A)return;let J=!1;return h.candidate().then(we=>{J||N(we.ok?{state:"ready",value:we.data.candidate}:{state:"error",error:we.refusal.message,refusal:we.refusal})}),()=>{J=!0}},[A,h,m]);const G=u.useRef(new Set),W=u.useCallback((J,we)=>_(As=>({...As,[J]:we.ok?{state:"ready",value:we.data.release}:{state:"error",error:we.refusal.message,refusal:we.refusal}})),[]),Z=async J=>{_(we=>({...we,[J]:{state:"loading"}})),G.current.add(J),W(J,await h.release(J,E))},ge=w.state!=="ready"||w.value!==null,Y=Hz(x),z=l6(m?h:void 0),X=z.available&&x===ol,[te,he]=u.useState("all"),pe=p.release_branch||m?ge?Ls:null:((Dn=p.releases[0])==null?void 0:Dn.version)??null,re=Y!==null||X?null:x===Ls?ge?Ls:null:x??pe,[ve,ee]=u.useState([]),ht=u.useRef(0);u.useEffect(()=>{if(!m||!h.roadmapMoved)return;let J=!0;const we=ht.current;return h.roadmapMoved().then(As=>{J&&As.ok&&we===ht.current&&ee(As.data.moved.map(qa=>qa.name))}),()=>{J=!1}},[h,m]);const de=z.reads.all,Ie=z.read;u.useEffect(()=>{Y===null||!z.available||!de.value&&!de.reading&&!de.refusal&&Ie("all")},[Y,z.available,de,Ie]);const[K,ke]=u.useState(0),De=u.useRef(0),xt=J=>{J===ol&&ke(we=>we+1),g(J)};u.useEffect(()=>{if(K!==De.current){if(!X){De.current=K;return}te!=="all"||de.reading||!de.value||!h.roadmapSeen||(De.current=K,h.roadmapSeen(de.value.as_of).then(J=>{J.ok&&(ht.current+=1,ee([]))}))}},[K,X,te,de,h]);const ye=new Map((((zn=de.value)==null?void 0:zn.releases)??[]).map(J=>[J.id,[J.kinds.includes("range")?"range":"",J.forecast.projected?Us(J.forecast.projected):"no date"].filter(Boolean).join(" · ")])),Ct=re===null||re===Ls||p.releases.some(J=>J.version===re);u.useEffect(()=>{!m||!c||re!==null&&re!==Ls&&!Ct&&c({kind:"release",id:re})},[m,c,re,Ct]),u.useEffect(()=>{!re||re===Ls||G.current.has(re)||m&&!Ct||(G.current.add(re),h.release(re).then(J=>W(re,J)))},[re,h,W,Ct]);const Ut=u.useRef(x),yn=u.useRef(!1),Cs=u.useRef(!!f),bn=u.useRef(null);u.useEffect(()=>{var we,As;if(!m)return;if(Cs.current){const qa=(we=bn.current)==null?void 0:we.querySelector('[aria-current="true"]');if(qa){Cs.current=!1,Ut.current=x,qa.focus();return}}if(Ut.current!==x&&(Ut.current=x,yn.current=!0),!yn.current)return;const J=(As=T.current)==null?void 0:As.querySelector("h2");J&&(yn.current=!1,J.tabIndex=-1,J.focus())});const an=async J=>{if(!a)return;O(null);const we=await a(J);if(!we.ok){O(we.error);return}b(null),N({state:"loading"}),await V()},Ts=async()=>{if(!p.next_before)return;R(null);const J=await h.list({before:p.next_before});if(!J.ok){R(J.refusal.message);return}j(we=>({...J.data,releases:[...we.releases,...J.data.releases]}))},Rs=p.release_branch?s.jsx(y6,{value:p.release_branch.id,label:p.release_branch.name,options:n??[],can_write:p.can_write,onChange:an}):null,ne=m?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Read at ",v6(m.read_at)]}),o?s.jsxs(H,{variant:"ghost",size:"sm",onClick:o,children:[s.jsx(vr,{className:"mr-1 size-4","aria-hidden":!0}),"Read again"]}):null]}):Rs,Oe=m?Iz(((Tt=p.releases[0])==null?void 0:Tt.label)??((rn=p.releases[0])==null?void 0:rn.version)??null):Bz(((ls=p.releases[0])==null?void 0:ls.version)??null,((Ln=p.release_branch)==null?void 0:Ln.name)??null),Ce={org:i??""};return s.jsxs(s.Fragment,{children:[s.jsx(Yk,{description:m?Xk:void 0,actions:ne}),d,m?s.jsx(Pz,{}):null,S?s.jsx(An,{error:S}):null,m?null:t,!m&&!p.release_branch?s.jsx(b6,{can_write:p.can_write,options:n??[],onChoose:an}):null,p.release_branch||p.releases.length>0||m?s.jsxs("div",{ref:bn,className:"flex flex-col gap-6 md:flex-row md:items-start",children:[s.jsx(j6,{list:p,candidate:y?w:null,shown:X?ol:Y!==null?Fn(Y):re,onSelect:xt,roadmap:z.available?i6(((sa=p.planned)==null?void 0:sa.length)??0,ve):null,planned_ranges:ye,can_load_older:!!p.next_before,older_error:U,onLoadOlder:Ts}),s.jsx("div",{className:"min-w-0 flex-1",ref:T,children:X?s.jsx(o6,{reads:z.reads,scope:te,onScope:he,onRead:Ie,org:Ce.org,onSelect:g}):Y!==null?s.jsx(Wz,{id:Y,summary:((L=p.planned)==null?void 0:L.find(J=>J.id===Y))??null,org:Ce.org,onNotFound:()=>c==null?void 0:c({kind:"planned",id:Y}),forecast:z.available?s.jsx(x6,{state:de,id:Y}):null}):re===Ls?s.jsx(_6,{candidate:w,branch_name:((be=p.release_branch)==null?void 0:be.name)??null,can_write:p.can_write&&!!r,local:!!m,org:Ce.org,onSelect:g,onRetry:$,onWrite:()=>I(!0)}):re?s.jsx(N6,{detail:C[re]??{state:"loading"},summary:p.releases.find(J=>J.version===re)??null,local:!!m,org:Ce.org,onSelect:g,onRetry:()=>Z(re)}):(p.release_branch||m)&&w.state==="ready"?s.jsx(Uz,{title:Oe.title,text:Oe.text}):null})]}):null,r&&w.state==="ready"&&w.value?r({candidate:w.value,open:D,notice:P,onOpenChange:J=>{J||M(null),I(J)},onStale:async J=>{M(J),await k()},onWritten:async J=>{I(!1),M(null),await V(),b(J),await $()}}):null]})}function v6(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function y6({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(Me,{htmlFor:"release-branch",children:"Release branch"}),s.jsxs(ct,{value:e,onValueChange:r,disabled:!a,children:[s.jsx(nt,{id:"release-branch",children:s.jsx(ut,{})}),s.jsxs(st,{children:[l?null:s.jsx(_e,{value:e,children:t??"Unnamed branch"}),n.map(i=>s.jsx(_e,{value:i.id,children:i.label},i.id))]})]}),a?null:s.jsx(f1,{})]})}function f1(){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 b6({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(uu,{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(Me,{htmlFor:"release-branch-first",children:"Release branch"}),s.jsxs(ct,{onValueChange:n,disabled:!e,children:[s.jsx(nt,{id:"release-branch-first",children:s.jsx(ut,{placeholder:"Choose a branch"})}),s.jsx(st,{children:t.map(a=>s.jsx(_e,{value:a.id,children:a.label},a.id))})]})]}),e?null:s.jsx(f1,{})]})}function h1({children:e}){return s.jsx("p",{className:"text-muted-foreground px-3 pt-3 text-xs font-medium tracking-wide uppercase",children:e})}function j6({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?Wi(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(Ac,{active:n===ol,onClick:()=>a(ol),version:"Roadmap",badges:null,caption:r}):null,t&&(t.state!=="ready"||t.value)?s.jsx(Ac,{active:n===Ls,onClick:()=>a(Ls),version:t.state==="ready"&&t.value?t.value.version:"Next release",badges:s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"info",children:"Candidate"}),f!=null&&f.breaking?s.jsx(fe,{variant:"error",children:"Breaking"}):t.state==="ready"&&((h=t.value)==null?void 0:h.app_changed)===!1?s.jsx(fe,{variant:"neutral",children:"App unchanged"}):t.state==="ready"&&((m=t.value)!=null&&m.classification)?s.jsx(fe,{variant:"neutral",children:t.value.classification.bump}):null]}),caption:t.state==="loading"?"Classifying…":t.state==="error"?"Could not be read":Fk(t.value)}):null,d?s.jsx(w6,{list:e,shown:n,onSelect:a,ranges:l}):null,d&&e.releases.length>0?s.jsx(h1,{children:"Released"}):null,e.releases.map(p=>{const j=d?qz(p):null;return s.jsx(Ac,{active:n===p.version,onClick:()=>a(p.version),version:p.label??p.version,badges:(j==null?void 0:j.badges)??s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"neutral",children:p.previous_release_id?p.bump??"patch":"First"}),p.breaking?s.jsx(fe,{variant:"error",children:"Breaking"}):null]}),caption:(j==null?void 0:j.caption)??ux(p.written_at)},p.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 w6({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(h1,{children:"Planned"}),e.planned_error?s.jsx(An,{title:"Planned Releases could not be read",error:e.planned_error}):null,(e.planned??[]).map((r,l)=>s.jsx(Ac,{active:t===Fn(r.id),onClick:()=>n(Fn(r.id)),version:r.name,badges:s.jsx(fe,{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 _6({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(Tn,{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(Tn,{children:s.jsx(An,{error:e.error,onRetry:i})});const c=e.value;if(!c)return null;const d=Wi(c.changes),f=!c.previous_release,h=t??"the release branch";return s.jsxs(Tn,{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(fe,{variant:"info",children:"Candidate"}),d.breaking?s.jsx(fe,{variant:"error",children:"Breaking"}):c.app_changed===!1?s.jsx(fe,{variant:"neutral",children:"App unchanged"}):c.classification?s.jsx(fe,{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: `,Fk(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(uu,{className:"mr-2 size-4"}),"Write Release ",c.next_version]}):null]}),a?s.jsx(Kz,{candidate:c,org:r,onSelect:l,notes:f?null:s.jsx(Cu,{changes:c.changes})}):f?null:s.jsx(Cu,{changes:c.changes})]})}function N6({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(Tn,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:t.label??t.version}),s.jsx(An,{title:"This Release could not be read",error:t.error??"Its record cannot be read."})]});if(e.state==="loading")return s.jsx(Tn,{children:s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:"Loading the Release…"})});if(e.state==="error")return s.jsx(Tn,{children:s.jsx(An,{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(zz(h,Wi(c.changes))),o(!0)};return s.jsxs(Tn,{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(Qz,{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(fe,{variant:"neutral",children:d?"First":c.bump}),Wi(c.changes).breaking?s.jsx(fe,{variant:"error",children:"Breaking"}):null]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Written ",ux(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(gT,{className:"mr-2 size-4"}),i?"Copied":"Copy notes"]})]}),n?s.jsx(Zz,{release:c,org:a,onSelect:r,notes:d?null:s.jsx(Cu,{changes:c.changes})}):d?null:s.jsx(Cu,{changes:c.changes})]})}const k6=5,S6=e=>e.retry===!0||e.reason==="store_locked"||e.status===503;function C6({org:e,query:t,onSelect:n,home:a}){var U,R;const r=d1(),{href:l,Link:i}=Ve(),[o,c]=u.useState({state:"loading"}),[d,f]=u.useState(null),[h,m]=u.useState(null),[p,j]=u.useState(null),v=u.useRef(0),b=u.useRef(0),x=u.useRef(null),g=u.useRef(!1),y=u.useCallback(async T=>{const E=b.current+=1;m(null);const k=await r.list(T?{fresh:!0}:void 0);if(E===b.current){if(k.ok){v.current=0,f(null),c({state:"ok",list:k.data});return}if(k.refusal.reason==="engine_missing"){c({state:"engine_missing",refusal:k.refusal});return}if(v.current+=1,v.current===1&&S6(k.refusal)){m(k.refusal.retry_after??k6);return}f(k.refusal)}},[r]);u.useEffect(()=>{y(!1)},[y]),u.useEffect(()=>{if(h===null)return;const T=setTimeout(()=>void y(!1),h*1e3);return()=>clearTimeout(T)},[h,y]),u.useEffect(()=>{var E;if(!g.current||o.state==="loading"||d||h!==null)return;g.current=!1;const T=(E=x.current)==null?void 0:E.querySelector("h1");T&&(T.tabIndex=-1,T.focus())});const w=()=>{g.current=!0,v.current=0,f(null),y(!0)},N=o.state==="ok"?o.list:null,C=t.roadmap?ol:t.planned!==null?t.planned===""?(U=N==null?void 0:N.planned)!=null&&U[0]?Fn(N.planned[0].id):null:Fn(t.planned):t.release,_=`${t.release??""}|${t.planned??""}|${t.roadmap?"roadmap":""}`,S=u.useRef(_);u.useEffect(()=>{S.current!==_&&(S.current=_,j(null))},[_]);const O=u.useRef(!1),D=u.useCallback(T=>{O.current=!0,j(T)},[]),I=!p&&o.state==="ok"&&O.current;if(u.useEffect(()=>{I&&(O.current=!1)},[I]),p)return s.jsx(ta,{title:p.kind==="release"?`No Release ${p.id}`:`No open Planned Release ${p.id}`,description:"This project has no Release, candidate or open Planned Release by that name.",backHref:l(a),backLabel:"All Releases",link:i});const P=h!==null?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(en,{"aria-hidden":!0})," The release records are busy; reading again in ",h," s…"]}):null,M=d?s.jsxs(ce,{variant:"destructive",children:[s.jsx(Lt,{}),s.jsx(xe,{children:"Releases could not be read"}),s.jsxs(ue,{className:"flex flex-col items-start gap-2",children:[s.jsxs("span",{children:[d.message,N?" 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(g6,{initial:o.list,org:e,selection:{selected:C,onSelect:n},onReadAgain:w,onNotFound:D,notice:P||M?s.jsxs(s.Fragment,{children:[P,M]}):null,focusOnMount:I},((R=o.list.local)==null?void 0:R.read_at)??"list"):o.state==="engine_missing"?s.jsx(Ss,{page:"Releases"}):s.jsxs(s.Fragment,{children:[s.jsx(Yk,{description:Xk}),M??P??s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(en,{"aria-hidden":!0})," Loading Releases…"]})]})})}const T6={threads:"Threads",chat:"Chat",tasks:"Tasks",queues:"Queues",worktrees:"Worktrees",workspaces:"Workspaces",chart:"Org chart"},R6={tasks:"Tasks",issues:"Issues",releases:"Releases"};function Mc(e,t){return e.kind==="home"?"Home":e.kind==="org"?T6[e.page]:e.kind==="project"?e.page?R6[e.page]:t??e.project:"Not found"}const E6="(max-width: 767px)";function A6(){const e=typeof window<"u"&&window.matchMedia?window.matchMedia(E6):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 uc({className:e=""}){return s.jsx("span",{"aria-hidden":"true",className:`block animate-pulse rounded-md bg-sidebar-accent ${e}`})}function Fv({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 Xv({item:e,collapsed:t}){const{Link:n}=Ve(),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(uk,{children:[s.jsx(dk,{asChild:!0,children:l}),s.jsx(Jp,{side:"right",children:r})]}):l})}const Kv="m-0 flex list-none flex-col gap-1 p-0";function Qv({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 Zv({page:e,collapsed:t,sheet:n=!1,hasChat:a}){var R;const{href:r}=Ve(),{worktrees:l}=nn(),i=sn(),{org:o,projects:c,loading:d,none:f,about:h,aboutFailed:m,domains:p,engine:j}=i,v=j===null,b=o?`/org/${o.slug}`:"",x=c==null?void 0:c.find(T=>T.current),g=((R=o==null?void 0:o.source)==null?void 0:R.kind)==="folder"&&x!==void 0,y=T=>g&&x?`${T} · ${x.name}`:T,w=y("Workspaces"),N=y("Tasks"),C=y("Queues"),_=T=>g?T:void 0,S=[{label:"Home",href:r(b||"/"),icon:MT,current:e.kind==="home"},...v?[]:[{label:"Threads",href:r(`${b}/threads`),icon:KT,current:e.kind==="org"&&e.page==="threads"}],...a&&!v?[{label:"Chat",href:r(`${b}/chat`),icon:FT,current:e.kind==="org"&&e.page==="chat"}]:[],...p.includes("tasks")&&!v?[{label:N,title:_(N),href:r(`${b}/tasks`),icon:v0,current:e.kind==="org"&&e.page==="tasks"}]:[],...v?[]:[{label:C,title:_(C),href:r(`${b}/queues`),icon:y0,current:e.kind==="org"&&e.page==="queues"}],...l&&!v?[{label:"Worktrees",href:r(`${b}/worktrees`),icon:g0,current:e.kind==="org"&&e.page==="worktrees"}]:[],{label:w,title:_(w),href:r(`${b}/workspaces`),icon:ST,current:e.kind==="org"&&e.page==="workspaces"},{label:"Org chart",href:r(`${b}/chart`),icon:JT,current:e.kind==="org"&&e.page==="chart"}],O=d?null:f?"No organization":(o==null?void 0:o.name)??"Organization",D=o?MR(o):null,I=h==null?void 0:h.version,P=I?t?I:`sdlc ${I}`:m?du:ed,M=m||(h==null?void 0:h.sync.state)==="unknown"?RR:h===void 0?TR:CR;let U;return d?U=s.jsx("div",{className:"px-2 py-1",children:s.jsxs(Fv,{label:"Loading projects",children:[s.jsx(uc,{className:"h-4 w-32"}),s.jsx(uc,{className:"h-4 w-24"})]})}):c?U=s.jsx("ul",{className:Kv,children:c.map(T=>s.jsx(Xv,{collapsed:t,item:{label:T.name,title:T.name,href:r(`/proj/${encodeURIComponent(T.id)}`),icon:NT,current:e.kind==="project"&&e.project===T.id}},T.id))}):U=s.jsx("p",{className:"m-0 px-2 text-sm text-sidebar-foreground/70",children:f?"No projects":du}),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(nT,{className:"size-4","aria-hidden":"true"})}),!t&&s.jsx("div",{className:"grid min-w-0 flex-1 text-left text-sm leading-tight",children:O===null?s.jsxs(Fv,{label:"Loading organization",children:[s.jsx(uc,{className:"h-4 w-28"}),s.jsx(uc,{className:"h-3 w-24"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-semibold",title:O,children:O}),D&&s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/70",children:D})]})})]}),s.jsxs("nav",{"aria-label":"App",className:"min-h-0 flex-1 overflow-y-auto",children:[s.jsx(Qv,{label:"Organization",collapsed:t,children:s.jsx("ul",{className:Kv,children:S.map(T=>s.jsx(Xv,{item:T,collapsed:t},T.label))})}),!t&&s.jsx(Qv,{label:"Projects",collapsed:t,children:U})]}),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:I?`sdlc ${I}`:void 0,children:P}),!t&&s.jsxs("p",{className:"m-0 flex items-start gap-2 px-2",children:[s.jsx(TT,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{children:M})]})]})]})}const M6="outline-hidden rounded-sm focus-visible:ring-2 focus-visible:ring-ring";function $6({page:e}){var c;const{href:t,Link:n}=Ve(),{org:a,projects:r,loading:l,none:i}=sn(),o=[];if(l)o.push({label:ed});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:Mc(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:Mc(e),href:t(f)}),o.push({label:e.item})}else e.kind!=="home"&&!(e.kind==="project"&&!e.page)&&o.push({label:Mc(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(p0,{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 ${M6}`,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 O6({page:e,chat:t=!1,children:n}){var g;const a=A6(),[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:p}=sn(),j=e.kind==="project"?(g=h==null?void 0:h.find(y=>y.id===e.project))==null?void 0:g.name:void 0;u.useEffect(()=>{const y=m?ed:p?"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}${Mc(e,j)} · ${y} · sdlc viewer`},[e,j,f,m,p]);const v=()=>{var y;o(!1),(y=c.current)==null||y.focus()};u.useEffect(()=>{a||o(!1)},[a]);const b=a&&i;u.useEffect(()=>{var N;const y=d.current;if(!b||!y)return;(N=y.querySelector("a, button"))==null||N.focus();const w=C=>{var I;if(C.key==="Escape"){o(!1),(I=c.current)==null||I.focus();return}if(C.key!=="Tab")return;const _=[...y.querySelectorAll("a[href], button:not([disabled])")];if(_.length===0)return;const S=_[0],O=_[_.length-1],D=y.contains(document.activeElement);C.shiftKey&&(document.activeElement===S||!D)?(C.preventDefault(),O.focus()):!C.shiftKey&&(document.activeElement===O||!D)&&(C.preventDefault(),S.focus())};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[b]);const x=!a&&!r;return s.jsx(ck,{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(Zv,{page:e,collapsed:x,hasChat:t})}),b&&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(Zv,{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(Ju,{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(y=>!y):l(y=>!y),children:s.jsx(tR,{className:"size-4","aria-hidden":"true"})}),s.jsx("span",{"aria-hidden":"true",className:"mr-2 h-4 w-px bg-border"}),s.jsx($6,{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 m1={working:{label:"Working",tone:"success"},waiting:{label:"Waiting for you",tone:"warning"},closed:{label:"Closed",tone:"neutral"},continued:{label:"Continued elsewhere",tone:"neutral"}},mx="m-0 text-2xl font-semibold tracking-tight",px="outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",xx=`rounded-sm font-medium text-primary no-underline hover:underline ${px}`;function Uf({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 D6({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(Uf,{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(Uf,{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(Uf,{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?or:AR})]})}const Wv=`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 ${px}`;function z6(){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 jr(){const{href:e,Link:t}=Ve(),{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:mx,children:"Projects"}),!r&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:ER})]});if(r)return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,s.jsx(D6,{why:r==="not_in_git"?{kind:"not_in_git"}:zR(r)})]});const m=l!=null&&l.shown?l:null,p=(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:j0(m.refusal,i)}),s.jsx("div",{children:s.jsx("button",{type:"button",className:Wv,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 ${px}`}),!m&&s.jsx("button",{type:"button",className:`${Wv} 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(z6,{}):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:[p.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:xx,children:j.name})}),s.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:j.location??du}),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)),p.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 p1({title:e,children:t}){const{href:n,Link:a}=Ve();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:mx,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 ${xx}`,children:"Back to the organization's Home"})})]})})}const L6={tasks:"Tasks",issues:"Issues",releases:"Releases"};function Ji({project:e}){const{href:t,Link:n}=Ve(),{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:ed}):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:mx,children:o.name}),s.jsx("p",{className:"m-0 font-mono text-sm text-muted-foreground",children:o.location??du})]}),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:xx,children:L6[c]})},c))}):null:s.jsx("p",{className:"m-0 max-w-2xl text-sm text-muted-foreground",children:`This viewer reads ${o.name}'s tasks, issues and Releases only from its own checkout: open it with sdlc viewer there.`})]}):s.jsx(p1,{title:"Project not found",children:`There is no project '${e}' in this organization.`}):s.jsx(jr,{})}const gx=e=>e instanceof Error?e.message:String(e);async function vx(){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:gx(e)}}}async function U6(){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 B6(){try{return(await fetch("api/pin",{method:"HEAD",cache:"no-store"})).ok}catch{return!1}}async function H6(){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 I6(){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:gx(e)}}}async function P6(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 gx(n)}}const q6={probe:{source:async()=>{const e=await vx();if("error"in e)throw new Error(e.error);return{label:"Local workspace"}}}},yx={href:e=>e.replace(/^\/+/,"")||"./",Link:({href:e,className:t,children:n,...a})=>s.jsx("a",{href:e,className:t,...a,children:n})},G6={label:"Local viewer",can:()=>!1};function V6(){return u.useEffect(()=>{document.title="Shared app UI · SDLC Workspace Viewer"},[]),s.jsx("div",{className:"app-ui dark",children:s.jsx(h0,{data:q6,router:yx,identity:G6,children:s.jsx(UC,{})})})}const Y6="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.",F6=3e4,X6="Reading the workspaces. On a plan workspace this can take a few minutes.",K6="The read failed. Details are in the terminal running sdlc viewer.",Q6={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"}},Z6=e=>Q6[e]??{label:e,tone:"neutral"},_a=e=>e.slice(0,8),x1={human:"Human",ai:"AI"},hm=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function W6(){const e=nn().workspaces;if(!e)throw new Error("The Workspaces page rendered without the workspaces seam.");return e}function J6(e){const t=W6(),[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 b=(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=b,b},[t]);u.useEffect(()=>{h()},[h]),_u(()=>void h(),F6),u.useEffect(()=>{var b;d.current&&(n||r)&&(d.current=!1,(b=c.current)==null||b.focus())},[n,r]);const m=()=>{d.current=!0,h()},p=n===null&&r===null,j=n===null&&r!==null,v=n?eL(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(Gt,{title:"Workspaces",description:Y6,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":p||void 0,"aria-describedby":p?"workspaces-reading":void 0,className:"gap-2",onClick:p?void 0:()=>void h(),children:[s.jsx(vr,{className:"size-4","aria-hidden":"true"}),"Read again"]}),p?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?g1(n,i):""})]})}),s.jsxs("div",{ref:c,tabIndex:-1,className:"outline-none",children:[p?s.jsx(tL,{}):null,j&&r?s.jsx(nL,{refusal:r,on_retry:m}):null,n?s.jsx(sL,{overview:n}):null]})]})}function g1(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 eL(e,t){const n=`Read at ${Qn(new Date(e.read_at).toISOString())}`,a=g1(e,t);return a?`${n} · ${a}`:n}function tL(){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(at,{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:X6})]})}function nL({refusal:e,on_retry:t}){const n=e.reason==="store_locked"?j0(e,null):K6;return s.jsxs(ce,{variant:"destructive",className:"mt-6",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Could not read workspaces"}),s.jsxs(ue,{children:[s.jsx("p",{children:n}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function sL({overview:e}){const{counts:t}=e,n=[hm(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(dc,{id:"workspaces-lineage",title:"Lineage",caption:"Each workspace under the one it forked from",children:s.jsx(aL,{rows:e.workspaces})}),s.jsx(dc,{id:"workspaces-authority",title:"Authority and resolver",caption:"What this checkout's workspace may change",children:s.jsx(rL,{authority:e.authority})})]}),s.jsx(dc,{id:"workspaces-activity",className:"mt-4",title:"Integration activity",caption:"Newest first",children:e.activity.length===0?s.jsx(Jv,{children:"No integration or reconciliation attempts yet."}):s.jsx(iL,{rows:e.activity})}),s.jsx(dc,{id:"workspaces-handoffs",className:"mt-4",title:"Handoffs",children:e.handoffs.length===0?s.jsx(Jv,{children:"No Handoffs prepared yet."}):s.jsx(oL,{rows:e.handoffs})})]})}function dc({id:e,title:t,caption:n,className:a,children:r}){return s.jsxs("section",{"aria-labelledby":e,className:se("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 Jv=({children:e})=>s.jsx("p",{className:"text-muted-foreground text-sm",children:e}),Tu=({children:e,tone:t})=>s.jsx("div",{className:se("text-xs",t==="error"?"text-destructive":"text-muted-foreground"),children:e});function eo({status:e}){const t=Z6(e);return s.jsx(fe,{variant:t.tone,children:t.label})}function Td({label:e,children:t}){return s.jsx(jt,{role:"group","aria-label":e,tabIndex:0,className:"overflow-x-auto outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:t})}function aL({rows:e}){return s.jsx(Td,{label:"Workspaces",children:s.jsxs(Ue,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Workspace"}),s.jsx(F,{children:"Actor"}),s.jsx(F,{children:"Forked from"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Projection"})]})}),s.jsx(Be,{children:e.map(t=>s.jsxs(le,{"data-testid":"workspaces-row",children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-mono font-medium",children:t.short_id}),s.jsx(Tu,{children:t.current?`${t.path} · This checkout`:t.path}),t.projection==="unreadable"&&t.projection_error&&s.jsx(Tu,{children:t.projection_error})]}),s.jsx(q,{children:x1[t.actor]}),s.jsx(q,{children:t.source_id?s.jsx("span",{className:"font-mono",children:_a(t.source_id)}):s.jsx("span",{className:"text-muted-foreground",children:"No source"})}),s.jsx(q,{children:s.jsx(eo,{status:t.status})}),s.jsx(q,{children:s.jsx(eo,{status:t.projection})})]},t.id))})]})})}function rL({authority:e}){const t=e.resolver,n=[["Workspace",s.jsx("span",{className:"font-mono",children:_a(e.workspace_id)},"id")],["Actor",x1[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(eo,{status:t.state==="ready"?"ready":"needs_attention"},"resolver")]),t.state==="needs_attention"&&t.issue&&n.push(["Resolver issue",t.issue]),s.jsx(Td,{label:"Authority and resolver",children:s.jsx(Ue,{containerClassName:"overflow-visible",children:s.jsx(Be,{children:n.map(([a,r])=>s.jsxs(le,{children:[s.jsx(F,{scope:"row",className:"text-muted-foreground font-normal",children:a}),s.jsx(q,{children:r})]},a))})})})}function lL(e){const t=[e.merge_attempts?hm(e.merge_attempts,"merge attempt"):null,e.resolver_attempts?hm(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 iL({rows:e}){return s.jsx(Td,{label:"Integration activity",children:s.jsxs(Ue,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"Change"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Attempts"}),s.jsx(F,{children:"Updated"})]})}),s.jsx(Be,{children:e.map((t,n)=>s.jsxs(le,{children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-medium",children:t.kind==="integration"?`Integrate ${_a(t.child_id)} into ${_a(t.other_id)}`:`Reconcile ${_a(t.child_id)} from ${_a(t.other_id)}`}),s.jsx(Tu,{children:t.kind==="integration"?"Integration":"Source reconciliation"})]}),s.jsx(q,{children:s.jsx(eo,{status:t.status})}),s.jsx(q,{children:lL(t)}),s.jsx(q,{children:mk(t.updated_at)})]},`${t.kind}-${t.child_id}-${t.other_id}-${t.updated_at}-${n}`))})]})})}function oL({rows:e}){return s.jsx(Td,{label:"Handoffs",children:s.jsxs(Ue,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{children:"From"}),s.jsx(F,{children:"To"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Pinned"})]})}),s.jsx(Be,{children:e.map(t=>s.jsxs(le,{children:[s.jsxs(q,{children:[s.jsx("div",{className:"font-mono font-medium",children:_a(t.child_id)}),t.error?s.jsx(Tu,{children:t.error}):null]}),s.jsx(q,{className:"font-mono",children:_a(t.source_id)}),s.jsx(q,{children:s.jsx(eo,{status:t.status})}),s.jsx(q,{children:`${t.child_commit} onto ${t.source_commit}`})]},t.id))})]})})}const ey="This machine's worktrees of this repository.",cL="Merge sends one whose thread is at rest to the main queue.",uL=3e4,dL=3e3,fL=6e5,Bf=[{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"}],ti={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"}},hL="no thread to land it",bx="its thread waits on you",v1="its thread is done",y1="its thread is retired",jx=e=>e.archivable&&e.cleanup==="user",mL=e=>e.queue!==null||e.merge.offered===!1&&e.merge.why==="already in a promotion queue",pL=e=>!e.merge.offered&&(e.merge.why===v1||e.merge.why.startsWith(y1)),wx=e=>!e.merge.offered&&e.merge.why===hL||pL(e),Hf=(e,t)=>t==="all"?!0:t==="decide"?jx(e):(e.landed!==null?"landed":mL(e)?"queued":wx(e)?"orphan":"needs")===t,xL=e=>e.landed!==null?e.threads.some(t=>t.phase!=="done"):e.threads.length>0&&!wx(e);function $c(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 b1(e){const t=e%100,n=t>=11&&t<=13?"th":{1:"st",2:"nd",3:"rd"}[e%10]??"th";return`${e}${n}`}function gL(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 If=e=>Qn(new Date(e*1e3).toISOString()),ui=e=>e.charAt(0).toUpperCase()+e.slice(1);function vL(e,t){var r;const n=t.phase?ui(t.phase):"No phase",a=e.merge;if(!a.offered&&a.why.startsWith(y1)){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===v1?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===bx?`${n} · waits on you`:a.why.startsWith("its session is not running")?`${n} · session not running`:n}function yL(){const e=nn().worktrees;if(!e)throw new Error("The Worktrees page rendered without the worktrees seam.");return e}function bL({org:e}){var $,V;const t=yL(),[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,p]=u.useState(""),[j,v]=u.useState({}),b=u.useRef({}),{confirm:x,confirm_dialog:g}=_o(),y=u.useRef(!1),w=u.useCallback(async()=>{if(y.current)return;y.current=!0;const A=await t.list();y.current=!1,A.ok?(a(A.data),l(null)):l(A.refusal)},[t]),N=u.useCallback(async()=>{const A=await t.sizes();d(!A.ok),A.ok&&o(A.data)},[t]);u.useEffect(()=>{w(),N()},[w,N]);const C=(n==null?void 0:n.rows.some(A=>{var G,W;return((G=A.write)==null?void 0:G.state)==="waiting"||((W=A.write)==null?void 0:W.state)==="running"}))??!1;_u(()=>void w(),C?dL:uL),_u(()=>void N(),fL);const _=(n==null?void 0:n.rows)??[],S=A=>i==null?void 0:i.sizes[A.path],O=_.filter(jx),D=i?O.reduce((A,G)=>A+(S(G)??0),0):null,I=_.length===0?ey:`${ey} ${cL}${O.length?` ${O.length} ${O.length===1?"is":"are"} yours to decide${D!==null?`: removing them frees about ${$c(D)}`:""}.`:""}`,P=m.trim().toLowerCase(),M=A=>!P||[A.name,A.path,A.branch??"",...A.threads.map(G=>G.title??G.thread)].some(G=>G.toLowerCase().includes(P)),U=_.filter(A=>Hf(A,f)&&M(A)).sort((A,G)=>{if(f==="decide")return(S(G)??0)-(S(A)??0);const W=Z=>xL(Z)?Z.merge.offered?0:1:2;return W(A)-W(G)||(A.idle_days??1/0)-(G.idle_days??1/0)}),R=async(A,G)=>{const W=await(A==="merge"?t.merge(G.path):t.remove(G.path));W.ok?v(({[G.path]:Z,...ge})=>ge):v(Z=>({...Z,[G.path]:W.refusal.message})),await w()},T=async A=>{if(!A.merge.offered)return;const G=A.threads.find(X=>X.thread===(A.merge.offered&&A.merge.thread)),W=(G==null?void 0:G.title)??A.merge.thread,Z=G!=null&&G.holds.length?`has ${G.holds.length} open hold(s) (${G.holds.join(", ")})`:"has no open holds",ge=A.merge.lands.by==="manager"?`on its turn the queue's merge manager, ${A.merge.lands.manager}, lands it on main`:"on its turn that thread lands it on main",Y=A.merge.caveat?`
|
|
403
|
+
|
|
404
|
+
Its session could not be read: ${A.merge.caveat}. A turn it does not start passes on.`:"";await x({title:`Send ${A.name} to the main queue`,description:`This joins the main promotion queue for its thread, ${W}, which ${Z} and is told of the join. The queue checks the branch first, and ${ge}. Nothing reaches main before then.${Y}`,action_label:"Join the main queue"})&&await R("merge",A)},E=async A=>{const G=S(A);await x({title:`Remove ${A.name}?`,description:`This deletes the folder ${A.path}${G!==void 0?` and frees about ${$c(G)}`:""}.${A.branch?` Its branch ${A.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 ${A.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})&&(G!==void 0&&(b.current[A.path]=G),await R("remove",A))},k=async A=>{await t.dismiss(A),await w()};return(r==null?void 0:r.reason)==="engine_missing"?s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(Ss,{page:"Worktrees"})}):s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(Gt,{title:"Worktrees",description:I}),!n&&!r&&s.jsx(jL,{}),r?s.jsx(wL,{refusal:r,read_at:n==null?void 0:n.read_at,on_retry:()=>void w()}):null,n!=null&&n.stale?s.jsxs(ce,{variant:"destructive",className:"mt-4",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Could not read worktrees"}),s.jsxs(ue,{children:[s.jsxs("p",{children:[n.stale.message," This list was read at ",Qn(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(A=>s.jsxs(ce,{variant:"success",className:"mt-4",role:"status",children:[s.jsx(xe,{children:b.current[A.path]!==void 0?`Removed ${A.name} and freed ${$c(b.current[A.path])}`:`Removed ${A.name}`}),s.jsxs(ue,{children:[s.jsx("p",{children:A.branch?`Its branch ${A.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 k({removal:A.path}),children:"Dismiss"})]})]},A.path)),n&&_.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(g0,{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(St,{type:"search",className:"w-64","aria-label":"Search worktrees",placeholder:"Search worktrees",value:m,onChange:A=>p(A.target.value)}),s.jsxs("p",{className:"text-muted-foreground ml-auto text-xs",children:["Read at ",Qn(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:Bf.map(A=>s.jsxs(H,{type:"button",variant:"outline",size:"sm",className:rl,"aria-pressed":f===A.id,onClick:()=>h(A.id),children:[A.label," ",_.filter(G=>Hf(G,A.id)).length]},A.id))}),U.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(Wu,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No worktrees match"}),P?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",($=Bf.find(A=>A.id===f))==null?void 0:$.empty," matches “",m,"”. Clear the search to see all"," ",_.filter(A=>Hf(A,f)).length,"."]}),s.jsx(H,{type:"button",variant:"outline",onClick:()=>p(""),children:"Clear search"})]}):s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(V=Bf.find(A=>A.id===f))==null?void 0:V.empty," right now."]})]}):s.jsx(jt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Ue,{containerAriaLabel:"Worktrees",className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(le,{children:[s.jsx(F,{className:"w-[24%]",children:"Worktree"}),s.jsx(F,{className:"w-[24%]",children:"Threads"}),s.jsx(F,{className:"w-[12%]",children:"Landed"}),s.jsx(F,{className:"w-[18%]",children:"Cleanup"}),s.jsx(F,{className:"hidden w-[10%] md:table-cell",children:"Last commit"}),s.jsx(F,{className:"w-[12%] text-right",children:"Actions"})]})}),s.jsx(Be,{children:U.map(A=>s.jsx(_L,{org:e,row:A,size:S(A),sizes:i!==null?"read":c?"failed":"measuring",can_write:n.can_write,sent:j[A.path],on_merge:()=>void T(A),on_remove:()=>void E(A),on_dismiss:G=>void k(G),on_clear_sent:()=>v(({[A.path]:G,...W})=>W)},A.path))})]})})]}):null,g]})}function jL(){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(at,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function wL({refusal:e,read_at:t,on_retry:n}){const a=_s();return e.reason==="view_outdated"?s.jsxs(ce,{variant:"warning",className:"mt-6",children:[s.jsx(Lt,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:Dl}),s.jsx(ue,{children:a})]}):s.jsxs(ce,{variant:"destructive",className:"mt-6",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"Could not read worktrees"}),s.jsxs(ue,{children:[s.jsxs("p",{children:[e.message,t?` This list was read at ${Qn(new Date(t).toISOString())}.`:""]}),s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function fc({children:e,muted:t=!0}){return s.jsx("div",{className:se("truncate text-xs",t&&"text-muted-foreground"),title:e,children:e})}function _L({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}=Ve(),m=e?`/org/${encodeURIComponent(e)}`:"",p=f(`${m}/threads`),j=f(`${m}/tasks`),v=ti[t.landed??"not_landed"],b=jx(t),x=t.write,g=(x==null?void 0:x.state)==="waiting"||(x==null?void 0:x.state)==="running",y=t.threads.find(I=>"thread"in t.merge&&I.thread===t.merge.thread)??t.threads[0],w=t.merge,N=!w.offered&&w.why===bx,C=r&&t.landed===null&&!t.queue&&!N&&!wx(t),_=n!==void 0?$c(n):a==="measuring"?"Measuring size…":a==="failed"?"Size could not be read":null,S=b?{label:"Yours to decide",muted:!1,second:[_,t.cleanup_why[0]]}:t.archivable?{label:"The manager removes it",muted:!1,second:[_]}:{label:"Stays",muted:!0,second:[_,t.why[0]??null]},O=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(le,{"data-testid":"worktrees-row",children:[s.jsxs(q,{children:[s.jsx("div",{className:"truncate font-medium",title:t.name,children:t.name}),s.jsx(fc,{children:t.branch??"Detached"}),D!==".sdlc-worktrees"?s.jsx(fc,{children:`in ${D}`}):null]}),s.jsx(q,{children:y?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"truncate",title:y.title??y.thread,children:y.title??y.thread}),s.jsx(fc,{children:`${vL(t,y)}${t.threads.length>1?` · ${t.threads.length-1} more`:""}`})]}):s.jsx("span",{className:"text-muted-foreground",children:"No thread"})}),s.jsx(q,{children:s.jsx(fe,{variant:v.tone,children:v.label})}),s.jsxs(q,{children:[s.jsx("div",{className:se("truncate",S.muted&&"text-muted-foreground"),children:S.label}),O?s.jsx("div",{className:"hidden md:block",children:s.jsx(fc,{children:O})}):null]}),s.jsx(q,{className:"hidden md:table-cell",children:gL(t.idle_days)}),s.jsx(q,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[g?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(fe,{variant:ti.queued.tone,children:`${ti.queued.label} · ${b1(t.queue.position)}`}):N?s.jsx(h,{href:j,"aria-label":`${t.name}: its thread waits on you, in Waiting on you`,children:s.jsx(fe,{variant:ti.needs_you.tone,children:ti.needs_you.label})}):C?s.jsx(H,{type:"button",variant:"outline",size:"sm",title:w.offered?void 0:w.why,"aria-disabled":!w.offered||void 0,className:se(!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,b&&r&&!g?s.jsx(H,{type:"button",variant:"outline",size:"sm","aria-label":`Remove ${t.name}`,onClick:o,children:"Remove"}):null]})})]}),s.jsx(NL,{row:t,threads:p,tasks:j,merge_shown:C,sent:l,on_dismiss:c,on_clear_sent:d})]})}function NL({row:e,threads:t,tasks:n,merge_shown:a,sent:r,on_dismiss:l,on_clear_sent:i}){var j,v,b,x;const{Link:o}=Ve(),c=(g="Open in Threads")=>s.jsx(o,{className:"text-primary text-sm hover:underline",href:t,children:g}),d=g=>s.jsx(H,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:g,children:"Dismiss"}),f=e.write,h=e.threads.find(g=>g.thread===("thread"in e.merge?e.merge.thread:void 0))??e.threads[0],m=(h==null?void 0:h.title)??"Its thread";let p=null;if(r)p=s.jsxs(ce,{variant:"destructive",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:"It was not sent"}),s.jsxs(ue,{children:[s.jsx("p",{children:r}),d(i)]})]});else if((f==null?void 0:f.state)==="waiting")p=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")p=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 g=((j=f.lands)==null?void 0:j.by)==="manager"?`the merge manager, ${f.lands.manager}, lands it`:"it lands it on its turn";p=s.jsxs(ce,{variant:f.told?"success":"warning",role:"status",children:[s.jsx(xe,{children:`${e.name} joined the main queue, ${b1(f.position)}`}),s.jsxs(ue,{children:[s.jsx("p",{children:f.told?`${m} was left a notice, and ${g}.`:"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 ${If(e.queue.passes_at)}.`}):null,s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>l({write:e.path})),!f.told||((b=e.queue)==null?void 0:b.position)===1?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(f&&(f.state==="refused"||f.state==="failed")){const g=f.kind==="merge"?`The main queue refused ${e.name}`:`${e.name} was not removed`;p=s.jsxs(ce,{variant:"destructive",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:f.kind==="merge"&&f.state==="failed"?`${e.name} did not join`:g}),s.jsxs(ue,{children:[s.jsx("p",{children:`${ui(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 g=e.last_turn;p=s.jsxs(ce,{variant:"warning",children:[s.jsx(ot,{className:"size-4","aria-hidden":"true"}),s.jsx(xe,{children:`${e.name}'s turn ${g.outcome==="failed"?"failed":"passed on"} at ${If(g.left_at)}`}),s.jsxs(ue,{children:[s.jsx("p",{children:`${ui(g.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:g.execution,left_at:g.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?p=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 ${If(e.queue.passes_at)}. `,c()]}):!e.merge.offered&&e.merge.why===bx?p=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?p=s.jsx("p",{className:"text-sm",children:c("Open its successor in Threads")}):a&&!e.merge.offered?p=s.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:[`${ui(e.merge.why)}. `,e.merge.thread&&!e.merge.why.startsWith("its thread is at work")?c():null]}):e.merge.offered&&e.merge.caveat&&(p=s.jsx("p",{className:"text-muted-foreground text-sm",children:`${ui(e.merge.caveat)}.`}));return p?s.jsx(le,{className:"hover:bg-transparent",children:s.jsx(q,{colSpan:6,className:"pt-0",children:p})}):null}const kL=["reason","since","store","repository","folder","home","member_path"];function j1(e,t){const n={status:e,message:typeof(t==null?void 0:t.error)=="string"?t.error:"The read failed; see the sdlc viewer terminal."};(t==null?void 0:t.retry)===!0&&(n.retry=!0),typeof(t==null?void 0:t.retry_after)=="number"&&(n.retry_after=t.retry_after),typeof(t==null?void 0:t.seedable)=="boolean"&&(n.seedable=t.seedable);for(const a of kL){const r=t==null?void 0:t[a];typeof r=="string"&&(n[a]=r)}return n}function wr({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:j1(i.status,o)}}}function SL(e={}){const t=wr(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 CL(e={}){const t=wr(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 di=e=>({ok:!1,refusal:{status:0,message:e}});function _x({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 di("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:j1(r.status,l)}}}function TL(e={}){const t=wr(e),n=_x(e);return{chart:()=>t("org"),change:a=>n("org-change",a)}}function RL(e={}){const t=wr(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(di("This checkout keeps no archived tasks.")):c.assigned_to_me?Promise.resolve(di("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()=>di("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 di("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 EL(e={}){const t=wr(e),n=_x(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 AL(e={}){const t=wr(e),n=_x(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 ML(e={}){const t=wr(e);return{overview:()=>t("workspaces")}}const $L=15e3,OL=10,ty="idle-sessions-list",ny="idle-sessions-heading",sy="idle-sessions-confirm-text";function w1(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${Math.round(e)} MB`}const DL=e=>`${Number.isInteger(e)?e:e.toFixed(1)} h`,_1=e=>e===1?"1 session":`${e} sessions`;function zL(e){const t=e.released.length?`Closed ${_1(e.released.length)}.`:"Closed no sessions.";return e.kept.length?`${t} Kept ${e.kept.length}:`:t}function LL({row:e}){const t=[e.name,e.retired?"continued in another session":"",`idle ${DL(e.idle_hours)}`,w1(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 UL(){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(""),p=u.useRef(null),j=u.useRef(null),v=u.useRef(null),b=u.useRef(null),x=u.useRef(0),g=u.useRef(0),y=u.useCallback(async()=>{const M=++x.current,U=await H6();if(!U||M<g.current)return;g.current=M,h("");const R=JSON.stringify(U);R!==m.current&&(m.current=R,t(U))},[]);u.useEffect(()=>{const M=setTimeout(y,0),U=setInterval(y,$L);return()=>{clearTimeout(M),clearInterval(U)}},[y]),u.useEffect(()=>{var U;const M=b.current;M&&(b.current=null,(U={cancel:j,close:p,dismiss:v}[M].current)==null||U.focus())});const w=(e==null?void 0:e.sessions.length)??0;if(u.useEffect(()=>{r&&!w&&i===null&&l(!1)},[r,w,i]),!w&&!c&&!f&&i===null)return null;const N=()=>{i===null&&(l(!0),b.current="cancel")},C=()=>{i===null&&(l(!1),b.current="close")},_=async()=>{if(i!==null)return;o(w),d(null),h("");const M=await I6();g.current=x.current+1,await y(),o(null),l(!1),a(!1),"error"in M?(h(`The sessions were not closed: ${M.error.replace(/\.+$/,"")}.`),b.current="close"):(d(M.done),b.current="dismiss")},S=()=>{d(null),b.current="close"},O=M=>{M.key==="Escape"&&(M.preventDefault(),C())},D=i!==null?`Closing ${_1(i)}…`:c?zL(c):"",I=(e==null?void 0:e.sessions.slice(0,OL))??[],P=w-I.length;return s.jsxs("div",{className:"idle",role:"group",...w?{"aria-labelledby":ny}:{"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:ny,"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 · ",w1(e.memory_mb)]})]}),s.jsxs("div",{className:"tools",children:[s.jsx("button",{type:"button",className:"pin","aria-expanded":n,"aria-controls":ty,"aria-label":n?"Hide the idle sessions list":"Show the idle sessions list",onClick:()=>a(M=>!M),children:n?"Hide":"Show"}),s.jsx("button",{type:"button",className:"pin",ref:p,"aria-expanded":r,"aria-label":"Close idle sessions…",onClick:N,children:"Close idle…"})]})]}),w>0&&s.jsxs("ul",{className:"idle-list",id:ty,hidden:!n,"aria-label":`Sessions idle over ${e==null?void 0:e.idle_over} hours, longest idle first`,children:[I.map(M=>s.jsx(LL,{row:M},M.session)),P>0&&s.jsx("li",{children:s.jsxs("p",{className:"caption muted",children:["…and ",P," more"]})})]}),r&&w>0&&s.jsxs("div",{className:"idle-confirm",role:"group","aria-label":"Close idle sessions","aria-describedby":sy,onKeyDown:O,children:[s.jsxs("p",{id:sy,children:[w===1?"Close this session?":`Close these ${w} sessions?`," Each transcript stays, so reopening a conversation resumes it, and a thread with unfinished work goes on with Continue on its card. A session that is busy or has background work running is kept."]}),s.jsxs("div",{className:"tools start",children:[s.jsx("button",{type:"button",className:"pin","aria-disabled":i!==null?!0:void 0,"aria-busy":i!==null?!0:void 0,onClick:_,children:i!==null?`Closing ${i}…`:`Close ${w}`}),s.jsx("button",{type:"button",className:"pin",ref:j,"aria-disabled":i!==null?!0:void 0,onClick:C,children:"Cancel"})]})]}),s.jsx("p",{className:"idle-status",role:"status",children: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(M=>s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:M.title}),s.jsx("p",{className:"caption muted",children:M.why})]},M.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 ay={ok:"lime",you:"amber",alert:"red",waiting:"blue",blocked:"purple",muted:"grey",plain:"grey"};function mm(e){return e&&Object.hasOwn(ay,e)?ay[e]:"grey"}const BL=1e4,HL=6e4,IL=2,Pf="#thread-",PL=w0("Threads"),qL={working:"▶",prod:"↑",planned:"○"};function ry({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 qf({text:e,role:t}){return s.jsx("span",{className:`badge tone-${mm(t)}`,children:e})}function GL({serves:e}){const t=e.slice(0,IL),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 ly({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 VL({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),[p,j]=u.useState(""),[v,b]=u.useState(null),[x,g]=u.useState(null),[y,w]=u.useState(null),N=u.useRef(""),C=u.useRef(""),_=u.useRef(null),S=u.useRef(null),O=u.useRef(null),D=E=>{var k;return E instanceof HTMLButtonElement&&E.classList.contains("pin")&&((k=_.current)!=null&&k.contains(E))?E.dataset.key??null:null},I=E=>{O.current=D(E.target)},P=()=>{setTimeout(()=>{D(document.activeElement)||(O.current=null)},0)},M=u.useCallback(async()=>{const E=await vx();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 k=JSON.stringify(E.data);k!==N.current&&(N.current=k,r(E.data))},[e]);u.useEffect(()=>{let E=!0;B6().then(V=>E&&f(V));const k=setTimeout(M,0),$=setInterval(M,BL);return()=>{E=!1,clearTimeout(k),clearInterval($)}},[M]),u.useEffect(()=>{let E=!0;const k=()=>U6().then(V=>{E&&V&&b(A=>JSON.stringify(A)===JSON.stringify(V)?A:V)});k();const $=setInterval(k,HL);return()=>{E=!1,clearInterval($)}},[]),u.useEffect(()=>{const E=()=>{var G,W,Z;const $=window.location.hash;if(!$.startsWith(Pf)){w(null);return}if($===C.current)return;let V;try{V=decodeURIComponent($.slice(Pf.length))}catch{V=$.slice(Pf.length)}const A=document.getElementById(`thread-${V}`);if(!A||!((G=_.current)!=null&&G.contains(A))){a&&w(V);return}C.current=$,w(null),g(V),(W=A.querySelector(".thread-title"))==null||W.focus({preventScroll:!0}),(Z=A.scrollIntoView)==null||Z.call(A,{block:"center"})},k=()=>{C.current="",E()};return E(),window.addEventListener("hashchange",k),()=>window.removeEventListener("hashchange",k)},[a]),u.useEffect(()=>{if(!x)return;const E=()=>g(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=O.current??S.current;if(!E||!_.current)return;const k=document.activeElement;if(k&&k!==document.body&&!_.current.contains(k)){O.current=null;return}const $=[..._.current.querySelectorAll("button.pin")].find(V=>V.dataset.key===E);$?k!==$&&$.focus({preventScroll:E!==S.current}):O.current=null});const U=async E=>{if(h)return;const k=!E.pinned;S.current=E.key,m(E.key);const $=await P6(E.key,k);m(null),$||r(V=>V&&{...V,threads:V.threads.map(A=>A.key===E.key?{...A,pinned:k}:A)}),await M(),j($?`The pin was not saved: ${$}`:""),S.current===E.key&&(S.current=null)},R=(a==null?void 0:a.pinnedCount)??0,T=(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(UL,{}),o&&s.jsxs("div",{className:"alert",role:"alert",children:["Threads unavailable: ",o.replace(/\.+$/,""),". Retrying every 10 s."]}),p&&s.jsx("div",{className:"alert",role:"alert",children:p}),s.jsx("p",{className:"caption muted not-listed",role:"status",children:y!==null&&!l?s.jsxs(s.Fragment,{children:["Thread ",y," is not in this list. ",s.jsx("code",{children:"sdlc view --all"})," lists older threads."]}):null}),l?s.jsx("p",{className:"muted",children:PL}):s.jsxs("div",{className:"thread-list",ref:_,onFocus:I,onBlur:P,children:[T.map((E,k)=>s.jsxs("div",{children:[R>0&&k===0&&s.jsx(ry,{label:"Pinned",count:R,hint:"Threads you pinned; they stay first in every order"}),R>0&&k===R&&s.jsx(ry,{label:"Other threads",count:T.length-R}),s.jsx(YL,{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:()=>U(E),org:t,project:n})]},E.key)),a&&!T.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 YL({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(qf,{text:e.carried,role:"waiting"}),e.carriedBatch&&s.jsx(qf,{text:e.carriedBatch.text,role:e.carriedBatch.role})]}):s.jsx(qf,{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(GL,{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-${mm(f.role)}`,children:[s.jsxs("span",{"aria-hidden":"true",children:[qL[f.state]??"•"," "]}),f.state==="working"&&s.jsx("span",{className:"sr-only",children:"Working: "}),f.task!==void 0&&s.jsx(ly,{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(ly,{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-${mm(f.role)}`,children:f.text},`h${h}`)),e.plan&&s.jsx("p",{className:"caption muted",children:e.plan})]})}const FL=5e3;function XL(){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),FL))},[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 KL=e=>e instanceof Error?e.message:String(e),Nx=(e,t="")=>`api/chat/${encodeURIComponent(e)}${t}`;async function Rd(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:KL(n)}}}}async function QL(){try{const e=await fetch("api/chat-available",{cache:"no-store"});if(e.status===404)return!1;if(!e.ok)return null;const t=await e.json().catch(()=>null);return typeof(t==null?void 0:t.available)=="boolean"?t.available:null}catch{return null}}function iy(e,t){return Rd(Nx(e,t==null?"":`?before=${t}`))}function ZL(e){return Rd(Nx(e,"/state"))}const oy=50;function WL(e){return Rd(`api/chat/states?threads=${e.map(encodeURIComponent).join(",")}`)}const N1=(e,t,n)=>Rd(Nx(e,`/${t}`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:n})}),JL=(e,t)=>N1(e,"send",t),e5=(e,t)=>N1(e,"reopen",t),k1=/^(claude|codex):[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,t5=5e3,n5=1e4,cy=6e4,cl=e=>e.startsWith("codex:")?"codex":"claude",S1={claude:"Claude",codex:"Codex"},s5={claude:"Claude Code",codex:"Codex"},Ed=e=>e.where??e.worktree??"";function a5(e){return e?e.repository?e.checkout&&e.checkout!==e.repository?`${e.repository} · worktree ${e.checkout}`:e.repository:Ed(e)||null:null}const r5=(e,t)=>[e.title,e.step,e.summary,t?Ed(t):"",(t==null?void 0:t.repository)??"",(t==null?void 0:t.checkout)??""].join(" ").toLowerCase(),l5=e=>e==null?"":new Date(e*1e3).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"}),kx=(e,t)=>`org/${encodeURIComponent(e)}/chat${t?`/${encodeURIComponent(t)}`:""}`,uy=(e,t)=>`org/${encodeURIComponent(e)}/threads#thread-${encodeURIComponent(t)}`,Gf="text-primary underline-offset-4 hover:underline";function i5(e){const t=(e.provider??cl(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=Ed(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 o5(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 c5="This thread can't be reopened: its worktree is gone. Its transcript stays readable; start a new thread to go on.",u5="Chat cannot send to this thread: its provider keeps no inbox and cannot be resumed.";function d5(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 f5(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 h5(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 m5(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 T1({state:e}){if(!e)return null;const{label:t,tone:n}=m1[e];return s.jsx(fe,{variant:n,children:t})}function p5({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(SR,{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 x5({row:e,agent:t,onSendAgain:n}){const a=e.who==="user",r=d5(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:l5(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 g5(){const[e,t]=u.useState({rows:null,error:"",none:!1}),n=u.useRef(""),a=u.useCallback(async(r=!0)=>{const l=await vx();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=>k1.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,n5);return()=>{clearTimeout(r),clearInterval(l)}},[a]),{...e,retry:()=>void a()}}function v5(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+=oy){const d=o.slice(c,c+oy);d.forEach(m=>r.current.add(m));const f=await WL(d);if(!l.current)return;if(!("ok"in f))continue;const h={};for(const[m,p]of Object.entries(f.ok))"state"in p&&(h[m]=p);n(m=>({...m,...h}))}},[]);return u.useEffect(()=>{l.current=!0;let o;const c=async()=>{await i(a.current),l.current&&(o=setTimeout(c,cy))};return o=setTimeout(c,cy),()=>{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 y5({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 R1(t.rows??[]).filter(p=>r==="all"||cl(p.key)===r).filter(p=>!m||r5(p,n[p.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(ct,{value:r,onValueChange:m=>l(m),children:[s.jsx(nt,{"aria-label":"Show threads from",children:s.jsx(ut,{})}),s.jsxs(st,{children:[s.jsx(_e,{value:"all",children:"All threads"}),s.jsx(_e,{value:"claude",children:"Claude Code"}),s.jsx(_e,{value:"codex",children:"Codex"})]})]}),s.jsx(St,{ref:c,type:"search","aria-label":"Search threads",placeholder:"Search threads",value:i,onChange:m=>o(m.target.value)}),t.error&&s.jsxs(ce,{variant:"destructive",children:[s.jsx(Lt,{"aria-hidden":"true"}),s.jsxs(ue,{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(at,{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:"No agent threads in this folder yet"}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"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 ${s5[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 p=(x=n[m.key])==null?void 0:x.state,j=m.step||m.summary,v=m.key===a,b=`chat-row-${m.key}`;return s.jsx("li",{children:s.jsxs("a",{id:b,href:kx(e,m.key),"aria-current":v?"page":void 0,"aria-label":`${m.title||m.key}${p?`, ${m1[p].label}`:""}`,"aria-describedby":[j?`${b}-preview`:"",m.age?`${b}-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:cl(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:`${b}-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:[S1[cl(m.key)],s.jsx(T1,{state:p})]})]}),m.age&&s.jsx("span",{id:`${b}-age`,className:"shrink-0 text-xs text-muted-foreground",children:m.age})]})},m.key)})})]})}const R1=e=>[...e].sort((t,n)=>+!!n.pinned-+!!t.pinned);function b5(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),p=u.useRef(""),j=u.useCallback(async()=>{const[x,g]=await Promise.all([iy(e),ZL(e)]);if("ok"in g?(c(null),f(N=>JSON.stringify(N)===JSON.stringify(g.ok)?N:g.ok)):c(g.failed),"failed"in x)return i(x.failed);i(null);const y=JSON.stringify([x.ok.rows,x.ok.before,x.ok.notes??null]);if(y===p.current)return;p.current=y;const w=x.ok.end??null;a(N=>{const C=N&&h5(N.rows,N.end,x.ok);if(!N||!C)return{rows:x.ok.rows,before:x.ok.before,end:w};const _=C.length>x.ok.rows.length?N.before:x.ok.before;return{rows:m5(C,x.ok.notes),before:_,end:w}})},[e]);u.useEffect(()=>{const x=setTimeout(j,0),g=setInterval(j,t5);return()=>{clearTimeout(x),clearInterval(g)}},[j]);const v=async()=>{if(!n||n.before==null||h)return;const x=n.before;m(!0);const g=await iy(e,x);if(m(!1),"failed"in g)return i(g.failed);const y=t.current?t.current.scrollHeight-t.current.scrollTop:null;a(w=>!w||w.before!==x?w:(r.current=y,{...w,rows:[...g.ok.rows,...w.rows],before:g.ok.before}))},b=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:b}}function j5({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,p]=u.useState(null),[j,v]=u.useState(!1),b=u.useRef(null),x=u.useRef(null),{confirm:g,confirm_dialog:y}=_o(),w=i5(n),N=`chat-delivery-${e}`,C=!w||w.off||f,_=n.state!=="closed"||n.reason==="maybe_running";u.useEffect(()=>{!n.reopening_since&&_&&v(!1)},[n.reopening_since,_]);const S=u.useRef(null),O=u.useRef(!1);u.useEffect(()=>{if(!j)return;if(n.reopening_since){O.current=!0;return}if(!O.current||_||n.delivery!=="reopen")return;O.current=!1,v(!1);const M=S.current;S.current=null;const U=!!M&&!d.current.trim();U&&M&&c(M),p({text:`Not reopened: its session did not start in Terminal.${U?" Your message is back in the box.":""}`,retry:!1})},[j,n.reopening_since,_,n.delivery]);const D=async(M=d.current,U=!0)=>{var T;if(!w||C||!M.trim())return!1;if(w.reopen){const E=(n.provider??cl(e))==="codex",k=await g({title:`Reopen ${t}?`,description:`It opens in ${Ed(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 $;return($=x.current)==null?void 0:$.focus()},0),!k)return!1}h(!0),p(null);const R=await(w.reopen?e5(e,M):JL(e,M));return h(!1),"failed"in R?(p({text:o5(R.failed,w.reopen,U),retry:U&&R.failed.reason==="terminal_denied"}),U&&((T=b.current)==null||T.focus()),l(),!1):(U&&d.current===M&&c(""),w.reopen&&(S.current=M,O.current=!1,v(!0)),l(),!0)},I=u.useRef(D);if(I.current=D,u.useEffect(()=>{if(!a||C)return;r();const M=d.current.trim()!==""&&d.current!==a.text;M||(c(a.text),d.current=a.text),I.current(a.text,!M)},[a,C,r]),!w)return null;const P=M=>{M.key==="Enter"&&!M.shiftKey&&!M.nativeEvent.isComposing&&(M.preventDefault(),D())};return s.jsxs("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[m&&s.jsxs(ce,{variant:"destructive",children:[s.jsx(Lt,{"aria-hidden":"true"}),s.jsxs(ue,{className:"flex flex-col items-start gap-2",children:[m.text,m.retry&&s.jsx(H,{variant:"outline",size:"sm",onClick:()=>void D().then(M=>M&&i()),children:"Retry"})]})]}),(j||n.reopening_since)&&w.reopen&&s.jsxs(ce,{variant:"info",role:"status",children:[s.jsx(ea,{"aria-hidden":"true"}),s.jsx(ue,{children:"Opened a Terminal window with your message. Its replies appear here once it starts."})]}),s.jsx(rs,{ref:b,rows:3,"aria-label":`Message ${t}`,placeholder:`Message ${t}`,value:o,onChange:M=>c(M.target.value),onKeyDown:P}),s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx("p",{id:N,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":C||void 0,"aria-describedby":N,onClick:()=>void D(),loading:f,children:[s.jsx(fR,{"aria-hidden":"true"}),w.button]})]}),y]})}function w5(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 dy({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:p}=b5(t,i);u.useEffect(()=>{d&&l(d)},[d,l]);const j=u.useRef(!0),[v,b]=u.useState(null),[x,g]=u.useState(""),y=u.useRef(void 0),w=(n==null?void 0:n.title)||(d==null?void 0:d.title)||t,N=S1[cl(t)],C=(o==null?void 0:o.rows)??null,_=u.useMemo(()=>f5(C??[]),[C]),S=u.useCallback(()=>b(null),[]);u.useEffect(()=>{p&&r()},[p,r]),u.useLayoutEffect(()=>{const M=i.current;M&&j.current&&(M.scrollTop=M.scrollHeight)},[C==null?void 0:C.length]),u.useEffect(()=>{if(!C)return;let M=-1;for(let T=C.length-1;T>=0;T--){const E=C[T];if(E.kind==="message"&&E.who==="agent"){M=T;break}}const U=M>=0?C[M]:null,R=U?_[M]:null;y.current!==void 0&&U&&R!==y.current&&g(`${N}: ${U.text.slice(0,300)}`),y.current=R},[C,_,N]);const O=[a5(d),w5(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",I=!!(d&&d.state!=="continued"&&d.delivery!=="none"),P=c&&!p;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(mp,{"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}),O&&s.jsx("span",{className:"text-xs text-muted-foreground",children:O})]}),s.jsxs("span",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[N,s.jsx(T1,{state:d==null?void 0:d.state}),n&&s.jsx("a",{className:`text-sm ${Gf}`,href:uy(e,t),children:"Open in Threads"})]})]}),P&&s.jsxs(ce,{variant:"warning",children:[s.jsx(Lt,{"aria-hidden":"true"}),s.jsxs(ue,{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 M;(M=i.current)==null||M.focus(),f()},children:"Retry"}),n&&s.jsx("a",{className:`text-sm ${Gf}`,href:uy(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:M=>{const U=M.currentTarget;j.current=U.scrollHeight-U.scrollTop-U.clientHeight<24},children:p?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."}):C===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(at,{className:"h-16 w-full"}),s.jsx(at,{className:"h-16 w-3/4"})]}):C&&C.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(en,{}),"Show earlier messages"]})}),C==null?void 0:C.map((M,U)=>M.kind==="steps"?s.jsx(p5,{row:M},_[U]):s.jsx(x5,{row:M,agent:N,onSendAgain:I?R=>b(T=>({text:R,n:((T==null?void 0:T.n)??0)+1})):void 0},_[U]))]})}),(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:Gf,href:kx(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(ce,{variant:"warning",children:[s.jsx(Lt,{"aria-hidden":"true"}),s.jsx(ue,{children:c5})]}):(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:u5}):d?s.jsx(j5,{thread:t,title:w,state:d,again:v,onAgainDone:S,onSent:()=>void f(),onRetried:()=>setTimeout(()=>{var M;return(M=i.current)==null?void 0:M.focus()},0)}):null]})}const _5=[];function N5({org:e,thread:t,served:n=null}){var D,I,P;const a=g5(),r=n===!1?{...a,rows:_5,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(M=>M.key===l),p=u.useMemo(()=>(r.rows??[]).map(M=>M.key),[r.rows]),j=v5(p),[v,b]=u.useState(null),x=r.rows?((I=R1(r.rows)[0])==null?void 0:I.key)??null:null;u.useEffect(()=>{v===null&&x!==null&&b(x)},[v,x]);const g=v??x,y=g?{key:g,row:(P=r.rows)==null?void 0:P.find(M=>M.key===g)}:null,w=l!==null&&(!k1.test(l)||f===l&&r.rows!==null&&!m),N=u.useCallback(()=>h(l),[l]),C=u.useCallback(()=>{},[]),_=l??(y==null?void 0:y.key)??null,S=u.useMemo(()=>_&&(i==null?void 0:i.thread)===_?{...j,[_]:i}:j,[j,_,i]),O=()=>{d(!0),setTimeout(()=>{var M;return l?(M=document.getElementById(`chat-row-${l}`))==null?void 0:M.focus():void 0},0)};return r.none?s.jsx("div",{className:"flex min-h-0 flex-1 flex-col px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(Ss,{page:"Chat"})}):w?s.jsx(ta,{title:"Thread not found",description:"This folder has no Claude Code or Codex thread at this address.",backHref:kx(e),backLabel:"Back to Chat",link:yx.Link}):s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 p-6",children:[s.jsx(Gt,{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(y5,{org:e,list:r,states:S,open:_})}),l?s.jsx("div",{className:`min-h-[32rem] min-w-0 flex-1 @min-[720px]:flex ${c?"hidden":"flex"}`,children:s.jsx(dy,{org:e,thread:l,row:m,onBack:O,onMissing:N,onState:o},l)}):y?s.jsx("div",{className:"hidden min-h-[32rem] min-w-0 flex-1 @min-[720px]:flex",children:s.jsx(dy,{org:e,thread:y.key,row:y.row,onBack:C,onMissing:C,onState:o},y.key)}):null]})})]})}const E1=/^#(?:(releases)|release=(.+)|planned(?:=(.+))?)$/,k5=/^#task=(.+)$/,S5=/^#issue=(.+)$/,C5=/^iss-\d{1,9}$/;function A1(e){return e.split("/").filter(Boolean).slice(1).join("/")}function T5(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 R5={label:"Local viewer",can:()=>!1},E5={connecting:"Connecting…",live:"Live · refreshes every 10s",disconnected:"Disconnected"},fy=()=>s.jsx(p1,{title:"Page not found",children:"There is no page at this address in this viewer."});function A5({routeOrg:e}){const{org:t,engine:n}=sn(),{project:a}=$o(),[r,l]=u.useState("connecting");return n===null?s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(Ss,{page:"Threads"})}):s.jsxs("div",{className:"main viewer-panel",children:[s.jsxs("p",{className:"connection",role:"status",children:[s.jsx("span",{className:`dot ${r}`,"aria-hidden":"true"}),E5[r]]}),s.jsx(VL,{onConnection:l,org:(t==null?void 0:t.slug)??e??null,project:a})]})}const na=()=>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(Ji,{project:i});if(c||e.org===void 0&&r)return s.jsx(na,{});const d=(n==null?void 0:n.slug)??e.org;return d===void 0&&i!==null?s.jsx(Ji,{project:i}):d===void 0&&l?s.jsx(jr,{}):d===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Tasks open once the organization reads."}):s.jsx(oD,{org:d})}function $5({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(na,{});const o=(a==null?void 0:a.slug)??e.org;return o===void 0&&l?s.jsx(jr,{}):o===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Chat opens once the organization reads."}):s.jsx(N5,{org:o,thread:e.thread,served:n})}function O5({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(na,{});const i=(n==null?void 0:n.slug)??e.org;if(i===void 0&&r)return s.jsx(jr,{});if(i===void 0)return s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Queues open once the organization reads."});const o=new URLSearchParams(window.location.search).get("queue");return s.jsx(U3,{org:i,open:o,path:`/org/${encodeURIComponent(i)}/queues`})}function D5({route:e,navigate:t}){var j;const{org:n,projects:a}=sn(),{project:r,settled:l}=$o(),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(Ji,{project:i});if(d||i===null&&!l)return s.jsx(na,{});if(i===null)return s.jsx(jr,{});const p=encodeURIComponent((n==null?void 0:n.slug)??e.org??"");if(e.issue!==void 0){const v=new URLSearchParams(f).get("from");return s.jsx(S3,{org:p,project:i,issue_id:e.issue,from:v,query:f})}return s.jsx(h3,{org:p,project:i,query:f,onQuery:m})}function z5({issue:e,navigate:t,home:n}){const{project:a,settled:r}=$o(),l=a!==null?`proj/${encodeURIComponent(a)}/issues/${encodeURIComponent(e)}`:null;return u.useEffect(()=>{l&&t(l)},[l,t]),l||!r?s.jsx(na,{}):n}function $o(){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 L5({navigate:e}){const{project:t,settled:n}=$o(),a=t!==null?`proj/${encodeURIComponent(t)}/releases${window.location.search}`:null;return u.useEffect(()=>{a&&e(a)},[a,e]),a||!n?s.jsx(na,{}):s.jsx(jr,{})}function hy(e){const t=new URLSearchParams(e);return{release:t.get("release"),planned:t.has("planned")?t.get("planned")??"":null}}function U5({route:e}){var f;const{org:t,projects:n,loading:a}=sn(),r=e.page.kind==="project"?e.page.project:"",[l,i]=u.useState(()=>hy(window.location.search));if(a)return s.jsx(na,{});if(n!==null&&!((f=n.find(h=>h.id===r))!=null&&f.current))return s.jsx(Ji,{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 p=m.size>0?`?${m.toString()}`:"";window.history.replaceState(window.history.state,"",`${window.location.pathname}${p}`),i(hy(p))};return s.jsx(C6,{org:(t==null?void 0:t.slug)??"",query:l,onSelect:d,home:c})}function B5({hash:e,navigate:t,home:n}){const{project:a,settled:r}=$o(),l=E1.exec(e),i=l!=null&&l[2]?Ru(l[2]):null,o=l!=null&&l[3]?Ru(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(na,{}):n}function Vf({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(fy,{});else if("threads"in e)i=s.jsx(A5,{routeOrg:e.org});else if("chat"in e)i=s.jsx($5,{route:e,navigate:t,served:n});else if("task"in e){const o=new URLSearchParams(window.location.search).get("from");i=s.jsx(OD,{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(D5,{route:e,navigate:t}):"chart"in e?i=s.jsx(sz,{}):"worktrees"in e?i=s.jsx(bL,{org:(a==null?void 0:a.slug)??e.org}):"workspaces"in e?i=s.jsx(J6,{org:(a==null?void 0:a.slug)??e.org}):"queues"in e?i=s.jsx(O5,{route:e,navigate:t}):"releasesForward"in e?i=s.jsx(L5,{navigate:t}):"releases"in e?i=s.jsx(U5,{route:e}):r.kind==="home"?i=s.jsx(jr,{}):r.kind==="project"?i=s.jsx(Ji,{project:r.project}):i=s.jsx(fy,{});return s.jsx(O6,{page:r,chat:n===!0,children:i})}function H5({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(na,{}):n}const I5=e=>window.location.replace(e);function Ru(e){try{return decodeURIComponent(e)}catch{return null}}function P5({navigate:e=I5,data:t,chat:n=QL}){const a=T5(A1(window.location.pathname),window.location.search),[r,l]=u.useState(null),{notify:i,toasts:o}=XL(),[c,d]=u.useState(null);u.useEffect(()=>{let w=!0;return n().then(N=>w&&d(N)),()=>{w=!1}},[n]);const f=k5.exec(window.location.hash),h=f?Ru(f[1]):null,m=S5.exec(window.location.hash),p=m?Ru(m[1]):null,j=p!==null&&C5.test(p)?p:null,v=E1.test(window.location.hash)?window.location.hash:null,b=f!==null&&h===null||m!==null&&j===null,x="forward"in a?a.forward:null;u.useEffect(()=>{x&&e(x)},[x,e]);const g=u.useMemo(()=>{if(t)return t;const w=SL();return{probe:{source:async()=>({label:"Local workspace"})},shell:w,issues:w.issues,tasks:RL(),org:TL(),worktrees:AL(),workspaces:ML(),queues:CL(),releases:EL()}},[t]);if(x||"forward"in a||!g.shell)return null;const y=s.jsx(Vf,{route:{page:{kind:"home"}},navigate:e,chat:c});return s.jsx("div",{className:"app-ui dark",ref:l,children:s.jsxs(WA,{container:r,children:[s.jsx(h0,{data:g,router:yx,identity:R5,notify:i,children:s.jsx(HR,{shell:g.shell,children:b?s.jsx(Vf,{route:{page:{kind:"not_found"}},navigate:e,chat:c}):h!==null?s.jsx(H5,{task:h,navigate:e,home:y}):j!==null?s.jsx(z5,{issue:j,navigate:e,home:y}):v!==null?s.jsx(B5,{hash:v,navigate:e,home:y}):s.jsx(Vf,{route:a,navigate:e,chat:c})})}),o]})})}zC.createRoot(document.getElementById("root")).render(s.jsx(u.StrictMode,{children:A1(window.location.pathname)==="app-ui-probe"?s.jsx(V6,{}):s.jsx(P5,{})}));
|