@software-dlc/cli 0.192.8 → 0.192.14
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 +44 -0
- package/dist/local/app-contract-readers.d.ts.map +1 -1
- package/dist/local/app-contract-readers.js +12 -0
- package/dist/local/app-contract-readers.js.map +1 -1
- package/dist/local/app-tasks-read.d.ts +18 -0
- package/dist/local/app-tasks-read.d.ts.map +1 -1
- package/dist/local/app-tasks-read.js +24 -10
- package/dist/local/app-tasks-read.js.map +1 -1
- package/dist/local/health-schema.d.ts +3 -3
- package/dist/local/projection-stat-pool.d.ts +2 -0
- package/dist/local/projection-stat-pool.d.ts.map +1 -0
- package/dist/local/projection-stat-pool.js +96 -0
- package/dist/local/projection-stat-pool.js.map +1 -0
- package/dist/local/projection.d.ts +25 -1
- package/dist/local/projection.d.ts.map +1 -1
- package/dist/local/projection.js +124 -42
- package/dist/local/projection.js.map +1 -1
- package/dist/local/source-evidence/schema.d.ts +2 -2
- package/dist/local/task-context-observations.d.ts +8 -8
- package/dist/local/task-context-schema.d.ts +1 -1
- package/dist/local/workspace-change-commit.d.ts +110 -0
- package/dist/local/workspace-change-commit.d.ts.map +1 -0
- package/dist/local/workspace-change-commit.js +354 -0
- package/dist/local/workspace-change-commit.js.map +1 -0
- package/dist/local/workspace-commit-generations.d.ts +12 -4
- package/dist/local/workspace-commit-generations.d.ts.map +1 -1
- package/dist/local/workspace-commit-generations.js +48 -27
- package/dist/local/workspace-commit-generations.js.map +1 -1
- package/dist/local/workspace-graph-store.d.ts +30 -1
- package/dist/local/workspace-graph-store.d.ts.map +1 -1
- package/dist/local/workspace-graph-store.js +86 -1
- package/dist/local/workspace-graph-store.js.map +1 -1
- package/dist/local/workspace-graph-tree.d.ts +42 -0
- package/dist/local/workspace-graph-tree.d.ts.map +1 -1
- package/dist/local/workspace-graph-tree.js +189 -0
- package/dist/local/workspace-graph-tree.js.map +1 -1
- package/dist/local/workspace-overlap-allocation.d.ts +5 -3
- package/dist/local/workspace-overlap-allocation.d.ts.map +1 -1
- package/dist/local/workspace-overlap-allocation.js +3 -7
- package/dist/local/workspace-overlap-allocation.js.map +1 -1
- package/dist/local/workspace-overlap-impact.d.ts.map +1 -1
- package/dist/local/workspace-overlap-impact.js +12 -1
- package/dist/local/workspace-overlap-impact.js.map +1 -1
- package/dist/local/workspace-overlap-index.d.ts +179 -0
- package/dist/local/workspace-overlap-index.d.ts.map +1 -0
- package/dist/local/workspace-overlap-index.js +559 -0
- package/dist/local/workspace-overlap-index.js.map +1 -0
- package/dist/local/workspace-overlap.d.ts +41 -9
- package/dist/local/workspace-overlap.d.ts.map +1 -1
- package/dist/local/workspace-overlap.js +336 -140
- package/dist/local/workspace-overlap.js.map +1 -1
- package/dist/local/workspace-runtime.d.ts +71 -1
- package/dist/local/workspace-runtime.d.ts.map +1 -1
- package/dist/local/workspace-runtime.js +626 -66
- package/dist/local/workspace-runtime.js.map +1 -1
- package/package.json +2 -2
- package/viewer/assets/index-CTZHobW_.js +389 -0
- package/viewer/assets/index-Cck9Xf1-.css +1 -0
- package/viewer/index.html +2 -2
- package/viewer/assets/index-B5o6MLCA.js +0 -389
- package/viewer/assets/index-DJmPW-on.css +0 -1
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
function N1(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in e)){const r=Object.getOwnPropertyDescriptor(a,l);r&&Object.defineProperty(e,l,r.get?r:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function ny(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sy={exports:{}},Ou={};/**
|
|
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 k1=Symbol.for("react.transitional.element"),S1=Symbol.for("react.fragment");function ay(e,t,n){var a=null;if(n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),"key"in t){n={};for(var l in t)l!=="key"&&(n[l]=t[l])}else n=t;return t=n.ref,{$$typeof:k1,type:e,key:a,ref:t!==void 0?t:null,props:n}}Ou.Fragment=S1;Ou.jsx=ay;Ou.jsxs=ay;sy.exports=Ou;var s=sy.exports,ly={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 hm=Symbol.for("react.transitional.element"),C1=Symbol.for("react.portal"),R1=Symbol.for("react.fragment"),T1=Symbol.for("react.strict_mode"),E1=Symbol.for("react.profiler"),A1=Symbol.for("react.consumer"),M1=Symbol.for("react.context"),O1=Symbol.for("react.forward_ref"),$1=Symbol.for("react.suspense"),D1=Symbol.for("react.memo"),ry=Symbol.for("react.lazy"),bx=Symbol.iterator;function z1(e){return e===null||typeof e!="object"?null:(e=bx&&e[bx]||e["@@iterator"],typeof e=="function"?e:null)}var iy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},oy=Object.assign,cy={};function Nr(e,t,n){this.props=e,this.context=t,this.refs=cy,this.updater=n||iy}Nr.prototype.isReactComponent={};Nr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Nr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function uy(){}uy.prototype=Nr.prototype;function mm(e,t,n){this.props=e,this.context=t,this.refs=cy,this.updater=n||iy}var pm=mm.prototype=new uy;pm.constructor=mm;oy(pm,Nr.prototype);pm.isPureReactComponent=!0;var jx=Array.isArray,tt={H:null,A:null,T:null,S:null,V:null},dy=Object.prototype.hasOwnProperty;function xm(e,t,n,a,l,r){return n=r.ref,{$$typeof:hm,type:e,key:t,ref:n!==void 0?n:null,props:r}}function L1(e,t){return xm(e.type,t,void 0,void 0,void 0,e.props)}function gm(e){return typeof e=="object"&&e!==null&&e.$$typeof===hm}function U1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var _x=/\/+/g;function Dd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?U1(""+e.key):t.toString(36)}function wx(){}function B1(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(wx,wx):(e.status="pending",e.then(function(t){e.status==="pending"&&(e.status="fulfilled",e.value=t)},function(t){e.status==="pending"&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function Ol(e,t,n,a,l){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(r){case"bigint":case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case hm:case C1:i=!0;break;case ry:return i=e._init,Ol(i(e._payload),t,n,a,l)}}if(i)return l=l(e),i=a===""?"."+Dd(e,0):a,jx(l)?(n="",i!=null&&(n=i.replace(_x,"$&/")+"/"),Ol(l,t,n,"",function(d){return d})):l!=null&&(gm(l)&&(l=L1(l,n+(l.key==null||e&&e.key===l.key?"":(""+l.key).replace(_x,"$&/")+"/")+i)),t.push(l)),1;i=0;var o=a===""?".":a+":";if(jx(e))for(var c=0;c<e.length;c++)a=e[c],r=o+Dd(a,c),i+=Ol(a,t,n,r,l);else if(c=z1(e),typeof c=="function")for(e=c.call(e),c=0;!(a=e.next()).done;)a=a.value,r=o+Dd(a,c++),i+=Ol(a,t,n,r,l);else if(r==="object"){if(typeof e.then=="function")return Ol(B1(e),t,n,a,l);throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return i}function Bo(e,t,n){if(e==null)return e;var a=[],l=0;return Ol(e,a,"","",function(r){return t.call(n,r,l++)}),a}function H1(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 Nx=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 I1(){}Se.Children={map:Bo,forEach:function(e,t,n){Bo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Bo(e,function(){t++}),t},toArray:function(e){return Bo(e,function(t){return t})||[]},only:function(e){if(!gm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Se.Component=Nr;Se.Fragment=R1;Se.Profiler=E1;Se.PureComponent=mm;Se.StrictMode=T1;Se.Suspense=$1;Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=tt;Se.__COMPILER_RUNTIME={__proto__:null,c:function(e){return tt.H.useMemoCache(e)}};Se.cache=function(e){return function(){return e.apply(null,arguments)}};Se.cloneElement=function(e,t,n){if(e==null)throw Error("The argument must be a React element, but you passed "+e+".");var a=oy({},e.props),l=e.key,r=void 0;if(t!=null)for(i in t.ref!==void 0&&(r=void 0),t.key!==void 0&&(l=""+t.key),t)!dy.call(t,i)||i==="key"||i==="__self"||i==="__source"||i==="ref"&&t.ref===void 0||(a[i]=t[i]);var i=arguments.length-2;if(i===1)a.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];a.children=o}return xm(e.type,l,void 0,void 0,r,a)};Se.createContext=function(e){return e={$$typeof:M1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:A1,_context:e},e};Se.createElement=function(e,t,n){var a,l={},r=null;if(t!=null)for(a in t.key!==void 0&&(r=""+t.key),t)dy.call(t,a)&&a!=="key"&&a!=="__self"&&a!=="__source"&&(l[a]=t[a]);var i=arguments.length-2;if(i===1)l.children=n;else if(1<i){for(var o=Array(i),c=0;c<i;c++)o[c]=arguments[c+2];l.children=o}if(e&&e.defaultProps)for(a in i=e.defaultProps,i)l[a]===void 0&&(l[a]=i[a]);return xm(e,r,void 0,void 0,null,l)};Se.createRef=function(){return{current:null}};Se.forwardRef=function(e){return{$$typeof:O1,render:e}};Se.isValidElement=gm;Se.lazy=function(e){return{$$typeof:ry,_payload:{_status:-1,_result:e},_init:H1}};Se.memo=function(e,t){return{$$typeof:D1,type:e,compare:t===void 0?null:t}};Se.startTransition=function(e){var t=tt.T,n={};tt.T=n;try{var a=e(),l=tt.S;l!==null&&l(n,a),typeof a=="object"&&a!==null&&typeof a.then=="function"&&a.then(I1,Nx)}catch(r){Nx(r)}finally{tt.T=t}};Se.unstable_useCacheRefresh=function(){return tt.H.useCacheRefresh()};Se.use=function(e){return tt.H.use(e)};Se.useActionState=function(e,t,n){return tt.H.useActionState(e,t,n)};Se.useCallback=function(e,t){return tt.H.useCallback(e,t)};Se.useContext=function(e){return tt.H.useContext(e)};Se.useDebugValue=function(){};Se.useDeferredValue=function(e,t){return tt.H.useDeferredValue(e,t)};Se.useEffect=function(e,t,n){var a=tt.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 tt.H.useId()};Se.useImperativeHandle=function(e,t,n){return tt.H.useImperativeHandle(e,t,n)};Se.useInsertionEffect=function(e,t){return tt.H.useInsertionEffect(e,t)};Se.useLayoutEffect=function(e,t){return tt.H.useLayoutEffect(e,t)};Se.useMemo=function(e,t){return tt.H.useMemo(e,t)};Se.useOptimistic=function(e,t){return tt.H.useOptimistic(e,t)};Se.useReducer=function(e,t,n){return tt.H.useReducer(e,t,n)};Se.useRef=function(e){return tt.H.useRef(e)};Se.useState=function(e){return tt.H.useState(e)};Se.useSyncExternalStore=function(e,t,n){return tt.H.useSyncExternalStore(e,t,n)};Se.useTransition=function(){return tt.H.useTransition()};Se.version="19.1.0";ly.exports=Se;var u=ly.exports;const ra=ny(u),fy=N1({__proto__:null,default:ra},[u]);var hy={exports:{}},$u={},my={exports:{}},py={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/(function(e){function t(S,E){var C=S.length;S.push(E);e:for(;0<C;){var $=C-1>>>1,X=S[$];if(0<l(X,E))S[$]=E,S[C]=X,C=$;else break e}}function n(S){return S.length===0?null:S[0]}function a(S){if(S.length===0)return null;var E=S[0],C=S.pop();if(C!==E){S[0]=C;e:for(var $=0,X=S.length,T=X>>>1;$<T;){var I=2*($+1)-1,ne=S[I],W=I+1,xe=S[W];if(0>l(ne,C))W<X&&0>l(xe,ne)?(S[$]=xe,S[W]=C,$=W):(S[$]=ne,S[I]=C,$=I);else if(W<X&&0>l(xe,C))S[$]=xe,S[W]=C,$=W;else break e}}return E}function l(S,E){var C=S.sortIndex-E.sortIndex;return C!==0?C:S.id-E.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;e.unstable_now=function(){return r.now()}}else{var i=Date,o=i.now();e.unstable_now=function(){return i.now()-o}}var c=[],d=[],f=1,h=null,m=3,x=!1,j=!1,v=!1,y=!1,g=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function _(S){for(var E=n(d);E!==null;){if(E.callback===null)a(d);else if(E.startTime<=S)a(d),E.sortIndex=E.expirationTime,t(c,E);else break;E=n(d)}}function N(S){if(v=!1,_(S),!j)if(n(c)!==null)j=!0,R||(R=!0,G());else{var E=n(d);E!==null&&A(N,E.startTime-S)}}var R=!1,w=-1,k=5,L=-1;function D(){return y?!0:!(e.unstable_now()-L<k)}function K(){if(y=!1,R){var S=e.unstable_now();L=S;var E=!0;try{e:{j=!1,v&&(v=!1,p(w),w=-1),x=!0;var C=m;try{t:{for(_(S),h=n(c);h!==null&&!(h.expirationTime>S&&D());){var $=h.callback;if(typeof $=="function"){h.callback=null,m=h.priorityLevel;var X=$(h.expirationTime<=S);if(S=e.unstable_now(),typeof X=="function"){h.callback=X,_(S),E=!0;break t}h===n(c)&&a(c),_(S)}else a(c);h=n(c)}if(h!==null)E=!0;else{var T=n(d);T!==null&&A(N,T.startTime-S),E=!1}}break e}finally{h=null,m=C,x=!1}E=void 0}}finally{E?G():R=!1}}}var G;if(typeof b=="function")G=function(){b(K)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,M=U.port2;U.port1.onmessage=K,G=function(){M.postMessage(null)}}else G=function(){g(K,0)};function A(S,E){w=g(function(){S(e.unstable_now())},E)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(S){S.callback=null},e.unstable_forceFrameRate=function(S){0>S||125<S?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<S?Math.floor(1e3/S):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_next=function(S){switch(m){case 1:case 2:case 3:var E=3;break;default:E=m}var C=m;m=E;try{return S()}finally{m=C}},e.unstable_requestPaint=function(){y=!0},e.unstable_runWithPriority=function(S,E){switch(S){case 1:case 2:case 3:case 4:case 5:break;default:S=3}var C=m;m=S;try{return E()}finally{m=C}},e.unstable_scheduleCallback=function(S,E,C){var $=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?$+C:$):C=$,S){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=C+X,S={id:f++,callback:E,priorityLevel:S,startTime:C,expirationTime:X,sortIndex:-1},C>$?(S.sortIndex=C,t(d,S),n(c)===null&&S===n(d)&&(v?(p(w),w=-1):v=!0,A(N,C-$))):(S.sortIndex=X,t(c,S),j||x||(j=!0,R||(R=!0,G()))),S},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(S){var E=m;return function(){var C=m;m=E;try{return S.apply(this,arguments)}finally{m=C}}}})(py);my.exports=py;var P1=my.exports,xy={exports:{}},Vt={};/**
|
|
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 q1=u;function gy(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function na(){}var Gt={d:{f:na,r:function(){throw Error(gy(522))},D:na,C:na,L:na,m:na,X:na,S:na,M:na},p:0,findDOMNode:null},G1=Symbol.for("react.portal");function V1(e,t,n){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:G1,key:a==null?null:""+a,children:e,containerInfo:t,implementation:n}}var pi=q1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Du(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}Vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Gt;Vt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(gy(299));return V1(e,t,null,n)};Vt.flushSync=function(e){var t=pi.T,n=Gt.p;try{if(pi.T=null,Gt.p=2,e)return e()}finally{pi.T=t,Gt.p=n,Gt.d.f()}};Vt.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,Gt.d.C(e,t))};Vt.prefetchDNS=function(e){typeof e=="string"&&Gt.d.D(e)};Vt.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var n=t.as,a=Du(n,t.crossOrigin),l=typeof t.integrity=="string"?t.integrity:void 0,r=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;n==="style"?Gt.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:l,fetchPriority:r}):n==="script"&&Gt.d.X(e,{crossOrigin:a,integrity:l,fetchPriority:r,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};Vt.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var n=Du(t.as,t.crossOrigin);Gt.d.M(e,{crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&Gt.d.M(e)};Vt.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var n=t.as,a=Du(n,t.crossOrigin);Gt.d.L(e,n,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};Vt.preloadModule=function(e,t){if(typeof e=="string")if(t){var n=Du(t.as,t.crossOrigin);Gt.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else Gt.d.m(e)};Vt.requestFormReset=function(e){Gt.d.r(e)};Vt.unstable_batchedUpdates=function(e,t){return e(t)};Vt.useFormState=function(e,t,n){return pi.H.useFormState(e,t,n)};Vt.useFormStatus=function(){return pi.H.useHostTransitionStatus()};Vt.version="19.1.0";function vy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vy)}catch(e){console.error(e)}}vy(),xy.exports=Vt;var kr=xy.exports;const Y1=ny(kr);/**
|
|
34
|
-
* @license React
|
|
35
|
-
* react-dom-client.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var St=P1,yy=u,F1=kr;function Z(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function by(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function lo(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function jy(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function kx(e){if(lo(e)!==e)throw Error(Z(188))}function X1(e){var t=e.alternate;if(!t){if(t=lo(e),t===null)throw Error(Z(188));return t!==e?null:e}for(var n=e,a=t;;){var l=n.return;if(l===null)break;var r=l.alternate;if(r===null){if(a=l.return,a!==null){n=a;continue}break}if(l.child===r.child){for(r=l.child;r;){if(r===n)return kx(l),e;if(r===a)return kx(l),t;r=r.sibling}throw Error(Z(188))}if(n.return!==a.return)n=l,a=r;else{for(var i=!1,o=l.child;o;){if(o===n){i=!0,n=l,a=r;break}if(o===a){i=!0,a=l,n=r;break}o=o.sibling}if(!i){for(o=r.child;o;){if(o===n){i=!0,n=r,a=l;break}if(o===a){i=!0,a=r,n=l;break}o=o.sibling}if(!i)throw Error(Z(189))}}if(n.alternate!==a)throw Error(Z(190))}if(n.tag!==3)throw Error(Z(188));return n.stateNode.current===n?e:t}function _y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_y(e),t!==null)return t;e=e.sibling}return null}var Je=Object.assign,K1=Symbol.for("react.element"),Ho=Symbol.for("react.transitional.element"),ai=Symbol.for("react.portal"),Ll=Symbol.for("react.fragment"),wy=Symbol.for("react.strict_mode"),Gf=Symbol.for("react.profiler"),Q1=Symbol.for("react.provider"),Ny=Symbol.for("react.consumer"),Bs=Symbol.for("react.context"),vm=Symbol.for("react.forward_ref"),Vf=Symbol.for("react.suspense"),Yf=Symbol.for("react.suspense_list"),ym=Symbol.for("react.memo"),ca=Symbol.for("react.lazy"),Ff=Symbol.for("react.activity"),Z1=Symbol.for("react.memo_cache_sentinel"),Sx=Symbol.iterator;function Yr(e){return e===null||typeof e!="object"?null:(e=Sx&&e[Sx]||e["@@iterator"],typeof e=="function"?e:null)}var W1=Symbol.for("react.client.reference");function Xf(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===W1?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ll:return"Fragment";case Gf:return"Profiler";case wy:return"StrictMode";case Vf:return"Suspense";case Yf:return"SuspenseList";case Ff:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ai:return"Portal";case Bs:return(e.displayName||"Context")+".Provider";case Ny:return(e._context.displayName||"Context")+".Consumer";case vm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ym:return t=e.displayName||null,t!==null?t:Xf(e.type)||"Memo";case ca:t=e._payload,e=e._init;try{return Xf(e(t))}catch{}}return null}var li=Array.isArray,je=yy.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ue=F1.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Za={pending:!1,data:null,method:null,action:null},Kf=[],Ul=-1;function _s(e){return{current:e}}function Ot(e){0>Ul||(e.current=Kf[Ul],Kf[Ul]=null,Ul--)}function nt(e,t){Ul++,Kf[Ul]=e.current,e.current=t}var ps=_s(null),Oi=_s(null),ja=_s(null),Uc=_s(null);function Bc(e,t){switch(nt(ja,t),nt(Oi,e),nt(ps,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ag(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ag(t),e=Ij(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Ot(ps),nt(ps,e)}function cr(){Ot(ps),Ot(Oi),Ot(ja)}function Qf(e){e.memoizedState!==null&&nt(Uc,e);var t=ps.current,n=Ij(t,e.type);t!==n&&(nt(Oi,e),nt(ps,n))}function Hc(e){Oi.current===e&&(Ot(ps),Ot(Oi)),Uc.current===e&&(Ot(Uc),qi._currentValue=Za)}var Zf=Object.prototype.hasOwnProperty,bm=St.unstable_scheduleCallback,zd=St.unstable_cancelCallback,J1=St.unstable_shouldYield,eS=St.unstable_requestPaint,xs=St.unstable_now,tS=St.unstable_getCurrentPriorityLevel,ky=St.unstable_ImmediatePriority,Sy=St.unstable_UserBlockingPriority,Ic=St.unstable_NormalPriority,nS=St.unstable_LowPriority,Cy=St.unstable_IdlePriority,sS=St.log,aS=St.unstable_setDisableYieldValue,ro=null,fn=null;function pa(e){if(typeof sS=="function"&&aS(e),fn&&typeof fn.setStrictMode=="function")try{fn.setStrictMode(ro,e)}catch{}}var hn=Math.clz32?Math.clz32:iS,lS=Math.log,rS=Math.LN2;function iS(e){return e>>>=0,e===0?32:31-(lS(e)/rS|0)|0}var Io=256,Po=4194304;function Fa(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function zu(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var l=0,r=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=a&134217727;return o!==0?(a=o&~r,a!==0?l=Fa(a):(i&=o,i!==0?l=Fa(i):n||(n=o&~e,n!==0&&(l=Fa(n))))):(o=a&~r,o!==0?l=Fa(o):i!==0?l=Fa(i):n||(n=a&~e,n!==0&&(l=Fa(n)))),l===0?0:t!==0&&t!==l&&!(t&r)&&(r=l&-l,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:l}function io(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function oS(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 Ry(){var e=Io;return Io<<=1,!(Io&4194048)&&(Io=256),e}function Ty(){var e=Po;return Po<<=1,!(Po&62914560)&&(Po=4194304),e}function Ld(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function oo(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function cS(e,t,n,a,l,r){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,c=e.expirationTimes,d=e.hiddenUpdates;for(n=i&~n;0<n;){var f=31-hn(n),h=1<<f;o[f]=0,c[f]=-1;var m=d[f];if(m!==null)for(d[f]=null,f=0;f<m.length;f++){var x=m[f];x!==null&&(x.lane&=-536870913)}n&=~h}a!==0&&Ey(e,a,0),r!==0&&l===0&&e.tag!==0&&(e.suspendedLanes|=r&~(i&~t))}function Ey(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-hn(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&4194090}function Ay(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-hn(n),l=1<<a;l&t|e[a]&t&&(e[a]|=t),n&=~l}}function jm(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 _m(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function My(){var e=Ue.p;return e!==0?e:(e=window.event,e===void 0?32:Zj(e.type))}function uS(e,t){var n=Ue.p;try{return Ue.p=e,t()}finally{Ue.p=n}}var za=Math.random().toString(36).slice(2),Ht="__reactFiber$"+za,Jt="__reactProps$"+za,Sr="__reactContainer$"+za,Wf="__reactEvents$"+za,dS="__reactListeners$"+za,fS="__reactHandles$"+za,Cx="__reactResources$"+za,co="__reactMarker$"+za;function wm(e){delete e[Ht],delete e[Jt],delete e[Wf],delete e[dS],delete e[fS]}function Bl(e){var t=e[Ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sr]||n[Ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$g(e);e!==null;){if(n=e[Ht])return n;e=$g(e)}return t}e=n,n=e.parentNode}return null}function Cr(e){if(e=e[Ht]||e[Sr]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function ri(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(Z(33))}function Ql(e){var t=e[Cx];return t||(t=e[Cx]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function At(e){e[co]=!0}var Oy=new Set,$y={};function pl(e,t){ur(e,t),ur(e+"Capture",t)}function ur(e,t){for($y[e]=t,e=0;e<t.length;e++)Oy.add(t[e])}var hS=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]*$"),Rx={},Tx={};function mS(e){return Zf.call(Tx,e)?!0:Zf.call(Rx,e)?!1:hS.test(e)?Tx[e]=!0:(Rx[e]=!0,!1)}function xc(e,t,n){if(mS(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function qo(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 As(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,Ex;function $l(e){if(Ud===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ud=t&&t[1]||"",Ex=-1<n.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ud+e+Ex}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(x){var m=x}Reflect.construct(e,[],h)}else{try{h.call()}catch(x){m=x}e.call(h.prototype)}}else{try{throw Error()}catch(x){m=x}(h=e())&&typeof h.catch=="function"&&h.catch(function(){})}}catch(x){if(x&&m&&typeof x.stack=="string")return[x.stack,m.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var l=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");l&&l.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=a.DetermineComponentFrameRoot(),i=r[0],o=r[1];if(i&&o){var c=i.split(`
|
|
44
|
-
`),d=o.split(`
|
|
45
|
-
`);for(l=a=0;a<c.length&&!c[a].includes("DetermineComponentFrameRoot");)a++;for(;l<d.length&&!d[l].includes("DetermineComponentFrameRoot");)l++;if(a===c.length||l===d.length)for(a=c.length-1,l=d.length-1;1<=a&&0<=l&&c[a]!==d[l];)l--;for(;1<=a&&0<=l;a--,l--)if(c[a]!==d[l]){if(a!==1||l!==1)do if(a--,l--,0>l||c[a]!==d[l]){var f=`
|
|
46
|
-
`+c[a].replace(" at new "," at ");return e.displayName&&f.includes("<anonymous>")&&(f=f.replace("<anonymous>",e.displayName)),f}while(1<=a&&0<=l);break}}}finally{Bd=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?$l(n):""}function pS(e){switch(e.tag){case 26:case 27:case 5:return $l(e.type);case 16:return $l("Lazy");case 13:return $l("Suspense");case 19:return $l("SuspenseList");case 0:case 15:return Hd(e.type,!1);case 11:return Hd(e.type.render,!1);case 1:return Hd(e.type,!0);case 31:return $l("Activity");default:return""}}function Ax(e){try{var t="";do t+=pS(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 Dy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xS(e){var t=Dy(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),a=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){a=""+i,r.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(i){a=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pc(e){e._valueTracker||(e._valueTracker=xS(e))}function zy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Dy(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function qc(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 gS=/[\n"\\]/g;function Sn(e){return e.replace(gS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Jf(e,t,n,a,l,r,i,o){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+wn(t)):e.value!==""+wn(t)&&(e.value=""+wn(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?eh(e,i,wn(t)):n!=null?eh(e,i,wn(n)):a!=null&&e.removeAttribute("value"),l==null&&r!=null&&(e.defaultChecked=!!r),l!=null&&(e.checked=l&&typeof l!="function"&&typeof l!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+wn(o):e.removeAttribute("name")}function Ly(e,t,n,a,l,r,i,o){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null))return;n=n!=null?""+wn(n):"",t=t!=null?""+wn(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}a=a??l,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=o?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i)}function eh(e,t,n){t==="number"&&qc(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Zl(e,t,n,a){if(e=e.options,t){t={};for(var l=0;l<n.length;l++)t["$"+n[l]]=!0;for(n=0;n<e.length;n++)l=t.hasOwnProperty("$"+e[n].value),e[n].selected!==l&&(e[n].selected=l),l&&a&&(e[n].defaultSelected=!0)}else{for(n=""+wn(n),t=null,l=0;l<e.length;l++){if(e[l].value===n){e[l].selected=!0,a&&(e[l].defaultSelected=!0);return}t!==null||e[l].disabled||(t=e[l])}t!==null&&(t.selected=!0)}}function Uy(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 By(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(Z(92));if(li(a)){if(1<a.length)throw Error(Z(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 dr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var vS=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 Mx(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||vS.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Hy(e,t,n){if(t!=null&&typeof t!="object")throw Error(Z(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var l in t)a=t[l],t.hasOwnProperty(l)&&n[l]!==a&&Mx(e,l,a)}else for(var r in t)t.hasOwnProperty(r)&&Mx(e,r,t[r])}function Nm(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 yS=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"]]),bS=/^[\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 gc(e){return bS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var th=null;function km(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Hl=null,Wl=null;function Ox(e){var t=Cr(e);if(t&&(e=t.stateNode)){var n=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Jf(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Sn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var l=a[Jt]||null;if(!l)throw Error(Z(90));Jf(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&zy(a)}break e;case"textarea":Uy(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Zl(e,!!n.multiple,t,!1)}}}var Id=!1;function Iy(e,t,n){if(Id)return e(t,n);Id=!0;try{var a=e(t);return a}finally{if(Id=!1,(Hl!==null||Wl!==null)&&(Yu(),Hl&&(t=Hl,e=Wl,Wl=Hl=null,Ox(t),e)))for(t=0;t<e.length;t++)Ox(e[t])}}function $i(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(Z(231,t,typeof n));return n}var Ys=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nh=!1;if(Ys)try{var Fr={};Object.defineProperty(Fr,"passive",{get:function(){nh=!0}}),window.addEventListener("test",Fr,Fr),window.removeEventListener("test",Fr,Fr)}catch{nh=!1}var xa=null,Sm=null,vc=null;function Py(){if(vc)return vc;var e,t=Sm,n=t.length,a,l="value"in xa?xa.value:xa.textContent,r=l.length;for(e=0;e<n&&t[e]===l[e];e++);var i=n-e;for(a=1;a<=i&&t[n-a]===l[r-a];a++);return vc=l.slice(e,1<a?1-a:void 0)}function yc(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 Go(){return!0}function $x(){return!1}function tn(e){function t(n,a,l,r,i){this._reactName=n,this._targetInst=l,this.type=a,this.nativeEvent=r,this.target=i,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(r):r[o]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Go:$x,this.isPropagationStopped=$x,this}return Je(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=Go)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Go)},persist:function(){},isPersistent:Go}),t}var xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lu=tn(xl),uo=Je({},xl,{view:0,detail:0}),jS=tn(uo),Pd,qd,Xr,Uu=Je({},uo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cm,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Xr&&(Xr&&e.type==="mousemove"?(Pd=e.screenX-Xr.screenX,qd=e.screenY-Xr.screenY):qd=Pd=0,Xr=e),Pd)},movementY:function(e){return"movementY"in e?e.movementY:qd}}),Dx=tn(Uu),_S=Je({},Uu,{dataTransfer:0}),wS=tn(_S),NS=Je({},uo,{relatedTarget:0}),Gd=tn(NS),kS=Je({},xl,{animationName:0,elapsedTime:0,pseudoElement:0}),SS=tn(kS),CS=Je({},xl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),RS=tn(CS),TS=Je({},xl,{data:0}),zx=tn(TS),ES={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AS={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"},MS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=MS[e])?!!t[e]:!1}function Cm(){return OS}var $S=Je({},uo,{key:function(e){if(e.key){var t=ES[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=yc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?AS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cm,charCode:function(e){return e.type==="keypress"?yc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?yc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),DS=tn($S),zS=Je({},Uu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lx=tn(zS),LS=Je({},uo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cm}),US=tn(LS),BS=Je({},xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),HS=tn(BS),IS=Je({},Uu,{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}),PS=tn(IS),qS=Je({},xl,{newState:0,oldState:0}),GS=tn(qS),VS=[9,13,27,32],Rm=Ys&&"CompositionEvent"in window,xi=null;Ys&&"documentMode"in document&&(xi=document.documentMode);var YS=Ys&&"TextEvent"in window&&!xi,qy=Ys&&(!Rm||xi&&8<xi&&11>=xi),Ux=" ",Bx=!1;function Gy(e,t){switch(e){case"keyup":return VS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vy(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Il=!1;function FS(e,t){switch(e){case"compositionend":return Vy(t);case"keypress":return t.which!==32?null:(Bx=!0,Ux);case"textInput":return e=t.data,e===Ux&&Bx?null:e;default:return null}}function XS(e,t){if(Il)return e==="compositionend"||!Rm&&Gy(e,t)?(e=Py(),vc=Sm=xa=null,Il=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return qy&&t.locale!=="ko"?null:t.data;default:return null}}var KS={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 Hx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!KS[e.type]:t==="textarea"}function Yy(e,t,n,a){Hl?Wl?Wl.push(a):Wl=[a]:Hl=a,t=iu(t,"onChange"),0<t.length&&(n=new Lu("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var gi=null,Di=null;function QS(e){Uj(e,0)}function Bu(e){var t=ri(e);if(zy(t))return e}function Ix(e,t){if(e==="change")return t}var Fy=!1;if(Ys){var Vd;if(Ys){var Yd="oninput"in document;if(!Yd){var Px=document.createElement("div");Px.setAttribute("oninput","return;"),Yd=typeof Px.oninput=="function"}Vd=Yd}else Vd=!1;Fy=Vd&&(!document.documentMode||9<document.documentMode)}function qx(){gi&&(gi.detachEvent("onpropertychange",Xy),Di=gi=null)}function Xy(e){if(e.propertyName==="value"&&Bu(Di)){var t=[];Yy(t,Di,e,km(e)),Iy(QS,t)}}function ZS(e,t,n){e==="focusin"?(qx(),gi=t,Di=n,gi.attachEvent("onpropertychange",Xy)):e==="focusout"&&qx()}function WS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bu(Di)}function JS(e,t){if(e==="click")return Bu(t)}function e2(e,t){if(e==="input"||e==="change")return Bu(t)}function t2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var gn=typeof Object.is=="function"?Object.is:t2;function zi(e,t){if(gn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var l=n[a];if(!Zf.call(t,l)||!gn(e[l],t[l]))return!1}return!0}function Gx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vx(e,t){var n=Gx(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=Gx(n)}}function Ky(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ky(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qy(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qc(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=qc(e.document)}return t}function Tm(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 n2=Ys&&"documentMode"in document&&11>=document.documentMode,Pl=null,sh=null,vi=null,ah=!1;function Yx(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ah||Pl==null||Pl!==qc(a)||(a=Pl,"selectionStart"in a&&Tm(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}),vi&&zi(vi,a)||(vi=a,a=iu(sh,"onSelect"),0<a.length&&(t=new Lu("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Pl)))}function Va(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ql={animationend:Va("Animation","AnimationEnd"),animationiteration:Va("Animation","AnimationIteration"),animationstart:Va("Animation","AnimationStart"),transitionrun:Va("Transition","TransitionRun"),transitionstart:Va("Transition","TransitionStart"),transitioncancel:Va("Transition","TransitionCancel"),transitionend:Va("Transition","TransitionEnd")},Fd={},Zy={};Ys&&(Zy=document.createElement("div").style,"AnimationEvent"in window||(delete ql.animationend.animation,delete ql.animationiteration.animation,delete ql.animationstart.animation),"TransitionEvent"in window||delete ql.transitionend.transition);function gl(e){if(Fd[e])return Fd[e];if(!ql[e])return e;var t=ql[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zy)return Fd[e]=t[n];return e}var Wy=gl("animationend"),Jy=gl("animationiteration"),eb=gl("animationstart"),s2=gl("transitionrun"),a2=gl("transitionstart"),l2=gl("transitioncancel"),tb=gl("transitionend"),nb=new Map,lh="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(" ");lh.push("scrollEnd");function ss(e,t){nb.set(e,t),pl(t,[e])}var Fx=new WeakMap;function Cn(e,t){if(typeof e=="object"&&e!==null){var n=Fx.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ax(t)},Fx.set(e,t),t)}return{value:e,source:t,stack:Ax(t)}}var _n=[],Gl=0,Em=0;function Hu(){for(var e=Gl,t=Em=Gl=0;t<e;){var n=_n[t];_n[t++]=null;var a=_n[t];_n[t++]=null;var l=_n[t];_n[t++]=null;var r=_n[t];if(_n[t++]=null,a!==null&&l!==null){var i=a.pending;i===null?l.next=l:(l.next=i.next,i.next=l),a.pending=l}r!==0&&sb(n,l,r)}}function Iu(e,t,n,a){_n[Gl++]=e,_n[Gl++]=t,_n[Gl++]=n,_n[Gl++]=a,Em|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Am(e,t,n,a){return Iu(e,t,n,a),Gc(e)}function Rr(e,t){return Iu(e,null,null,t),Gc(e)}function sb(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var l=!1,r=e.return;r!==null;)r.childLanes|=n,a=r.alternate,a!==null&&(a.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(l=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,l&&t!==null&&(l=31-hn(n),e=r.hiddenUpdates,a=e[l],a===null?e[l]=[t]:a.push(t),t.lane=n|536870912),r):null}function Gc(e){if(50<Ri)throw Ri=0,Sh=null,Error(Z(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Vl={};function r2(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function dn(e,t,n,a){return new r2(e,t,n,a)}function Mm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Gs(e,t){var n=e.alternate;return n===null?(n=dn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ab(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function bc(e,t,n,a,l,r){var i=0;if(a=e,typeof e=="function")Mm(e)&&(i=1);else if(typeof e=="string")i=oC(e,n,ps.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Ff:return e=dn(31,n,t,l),e.elementType=Ff,e.lanes=r,e;case Ll:return Wa(n.children,l,r,t);case wy:i=8,l|=24;break;case Gf:return e=dn(12,n,t,l|2),e.elementType=Gf,e.lanes=r,e;case Vf:return e=dn(13,n,t,l),e.elementType=Vf,e.lanes=r,e;case Yf:return e=dn(19,n,t,l),e.elementType=Yf,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q1:case Bs:i=10;break e;case Ny:i=9;break e;case vm:i=11;break e;case ym:i=14;break e;case ca:i=16,a=null;break e}i=29,n=Error(Z(130,e===null?"null":typeof e,"")),a=null}return t=dn(i,n,t,l),t.elementType=e,t.type=a,t.lanes=r,t}function Wa(e,t,n,a){return e=dn(7,e,a,t),e.lanes=n,e}function Xd(e,t,n){return e=dn(6,e,null,t),e.lanes=n,e}function Kd(e,t,n){return t=dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yl=[],Fl=0,Vc=null,Yc=0,Nn=[],kn=0,Ja=null,Hs=1,Is="";function Xa(e,t){Yl[Fl++]=Yc,Yl[Fl++]=Vc,Vc=e,Yc=t}function lb(e,t,n){Nn[kn++]=Hs,Nn[kn++]=Is,Nn[kn++]=Ja,Ja=e;var a=Hs;e=Is;var l=32-hn(a)-1;a&=~(1<<l),n+=1;var r=32-hn(t)+l;if(30<r){var i=l-l%5;r=(a&(1<<i)-1).toString(32),a>>=i,l-=i,Hs=1<<32-hn(t)+l|n<<l|a,Is=r+e}else Hs=1<<r|n<<l|a,Is=e}function Om(e){e.return!==null&&(Xa(e,1),lb(e,1,0))}function $m(e){for(;e===Vc;)Vc=Yl[--Fl],Yl[Fl]=null,Yc=Yl[--Fl],Yl[Fl]=null;for(;e===Ja;)Ja=Nn[--kn],Nn[kn]=null,Is=Nn[--kn],Nn[kn]=null,Hs=Nn[--kn],Nn[kn]=null}var qt=null,ct=null,Le=!1,el=null,cs=!1,rh=Error(Z(519));function ll(e){var t=Error(Z(418,""));throw Li(Cn(t,e)),rh}function Xx(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Ht]=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<Hi.length;n++)Ee(Hi[n],t);break;case"source":Ee("error",t);break;case"img":case"image":case"link":Ee("error",t),Ee("load",t);break;case"details":Ee("toggle",t);break;case"input":Ee("invalid",t),Ly(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0),Pc(t);break;case"select":Ee("invalid",t);break;case"textarea":Ee("invalid",t),By(t,a.value,a.defaultValue,a.children),Pc(t)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Hj(t.textContent,n)?(a.popover!=null&&(Ee("beforetoggle",t),Ee("toggle",t)),a.onScroll!=null&&Ee("scroll",t),a.onScrollEnd!=null&&Ee("scrollend",t),a.onClick!=null&&(t.onclick=Ku),t=!0):t=!1,t||ll(e)}function Kx(e){for(qt=e.return;qt;)switch(qt.tag){case 5:case 13:cs=!1;return;case 27:case 3:cs=!0;return;default:qt=qt.return}}function Kr(e){if(e!==qt)return!1;if(!Le)return Kx(e),Le=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Mh(e.type,e.memoizedProps)),n=!n),n&&ct&&ll(e),Kx(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(n=e.data,n==="/$"){if(t===0){ct=Qn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++;e=e.nextSibling}ct=null}}else t===27?(t=ct,La(e.type)?(e=Dh,Dh=null,ct=e):ct=t):ct=qt?Qn(e.stateNode.nextSibling):null;return!0}function fo(){ct=qt=null,Le=!1}function Qx(){var e=el;return e!==null&&(Zt===null?Zt=e:Zt.push.apply(Zt,e),el=null),e}function Li(e){el===null?el=[e]:el.push(e)}var ih=_s(null),vl=null,Ps=null;function da(e,t,n){nt(ih,t._currentValue),t._currentValue=n}function Vs(e){e._currentValue=ih.current,Ot(ih)}function oh(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 ch(e,t,n,a){var l=e.child;for(l!==null&&(l.return=e);l!==null;){var r=l.dependencies;if(r!==null){var i=l.child;r=r.firstContext;e:for(;r!==null;){var o=r;r=l;for(var c=0;c<t.length;c++)if(o.context===t[c]){r.lanes|=n,o=r.alternate,o!==null&&(o.lanes|=n),oh(r.return,n,e),a||(i=null);break e}r=o.next}}else if(l.tag===18){if(i=l.return,i===null)throw Error(Z(341));i.lanes|=n,r=i.alternate,r!==null&&(r.lanes|=n),oh(i,n,e),i=null}else i=l.child;if(i!==null)i.return=l;else for(i=l;i!==null;){if(i===e){i=null;break}if(l=i.sibling,l!==null){l.return=i.return,i=l;break}i=i.return}l=i}}function ho(e,t,n,a){e=null;for(var l=t,r=!1;l!==null;){if(!r){if(l.flags&524288)r=!0;else if(l.flags&262144)break}if(l.tag===10){var i=l.alternate;if(i===null)throw Error(Z(387));if(i=i.memoizedProps,i!==null){var o=l.type;gn(l.pendingProps.value,i.value)||(e!==null?e.push(o):e=[o])}}else if(l===Uc.current){if(i=l.alternate,i===null)throw Error(Z(387));i.memoizedState.memoizedState!==l.memoizedState.memoizedState&&(e!==null?e.push(qi):e=[qi])}l=l.return}e!==null&&ch(t,e,n,a),t.flags|=262144}function Fc(e){for(e=e.firstContext;e!==null;){if(!gn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function rl(e){vl=e,Ps=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function It(e){return rb(vl,e)}function Vo(e,t){return vl===null&&rl(e),rb(e,t)}function rb(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ps===null){if(e===null)throw Error(Z(308));Ps=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ps=Ps.next=t;return n}var i2=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()})}},o2=St.unstable_scheduleCallback,c2=St.unstable_NormalPriority,Nt={$$typeof:Bs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dm(){return{controller:new i2,data:new Map,refCount:0}}function mo(e){e.refCount--,e.refCount===0&&o2(c2,function(){e.controller.abort()})}var yi=null,uh=0,fr=0,Jl=null;function u2(e,t){if(yi===null){var n=yi=[];uh=0,fr=ap(),Jl={status:"pending",value:void 0,then:function(a){n.push(a)}}}return uh++,t.then(Zx,Zx),t}function Zx(){if(--uh===0&&yi!==null){Jl!==null&&(Jl.status="fulfilled");var e=yi;yi=null,fr=0,Jl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function d2(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(l){n.push(l)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var l=0;l<n.length;l++)(0,n[l])(t)},function(l){for(a.status="rejected",a.reason=l,l=0;l<n.length;l++)(0,n[l])(void 0)}),a}var Wx=je.S;je.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&u2(e,t),Wx!==null&&Wx(e,t)};var tl=_s(null);function zm(){var e=tl.current;return e!==null?e:We.pooledCache}function jc(e,t){t===null?nt(tl,tl.current):nt(tl,t.pool)}function ib(){var e=zm();return e===null?null:{parent:Nt._currentValue,pool:e}}var po=Error(Z(460)),ob=Error(Z(474)),Pu=Error(Z(542)),dh={then:function(){}};function Jx(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yo(){}function cb(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yo,Yo),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tg(e),e;default:if(typeof t.status=="string")t.then(Yo,Yo);else{if(e=We,e!==null&&100<e.shellSuspendCounter)throw Error(Z(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var l=t;l.status="fulfilled",l.value=a}},function(a){if(t.status==="pending"){var l=t;l.status="rejected",l.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tg(e),e}throw bi=t,po}}var bi=null;function eg(){if(bi===null)throw Error(Z(459));var e=bi;return bi=null,e}function tg(e){if(e===po||e===Pu)throw Error(Z(483))}var ua=!1;function Lm(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _a(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wa(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,qe&2){var l=a.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),a.pending=t,t=Gc(e),sb(e,null,n),t}return Iu(e,a,t,n),Gc(e)}function ji(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ay(e,n)}}function Qd(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var l=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?l=r=i:r=r.next=i,n=n.next}while(n!==null);r===null?l=r=t:r=r.next=t}else l=r=t;n={baseState:a.baseState,firstBaseUpdate:l,lastBaseUpdate:r,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var hh=!1;function _i(){if(hh){var e=Jl;if(e!==null)throw e}}function wi(e,t,n,a){hh=!1;var l=e.updateQueue;ua=!1;var r=l.firstBaseUpdate,i=l.lastBaseUpdate,o=l.shared.pending;if(o!==null){l.shared.pending=null;var c=o,d=c.next;c.next=null,i===null?r=d:i.next=d,i=c;var f=e.alternate;f!==null&&(f=f.updateQueue,o=f.lastBaseUpdate,o!==i&&(o===null?f.firstBaseUpdate=d:o.next=d,f.lastBaseUpdate=c))}if(r!==null){var h=l.baseState;i=0,f=d=c=null,o=r;do{var m=o.lane&-536870913,x=m!==o.lane;if(x?($e&m)===m:(a&m)===m){m!==0&&m===fr&&(hh=!0),f!==null&&(f=f.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var j=e,v=o;m=t;var y=n;switch(v.tag){case 1:if(j=v.payload,typeof j=="function"){h=j.call(y,h,m);break e}h=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=v.payload,m=typeof j=="function"?j.call(y,h,m):j,m==null)break e;h=Je({},h,m);break e;case 2:ua=!0}}m=o.callback,m!==null&&(e.flags|=64,x&&(e.flags|=8192),x=l.callbacks,x===null?l.callbacks=[m]:x.push(m))}else x={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},f===null?(d=f=x,c=h):f=f.next=x,i|=m;if(o=o.next,o===null){if(o=l.shared.pending,o===null)break;x=o,o=x.next,x.next=null,l.lastBaseUpdate=x,l.shared.pending=null}}while(!0);f===null&&(c=h),l.baseState=c,l.firstBaseUpdate=d,l.lastBaseUpdate=f,r===null&&(l.shared.lanes=0),Ma|=i,e.lanes=i,e.memoizedState=h}}function ub(e,t){if(typeof e!="function")throw Error(Z(191,e));e.call(t)}function db(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ub(n[e],t)}var hr=_s(null),Xc=_s(0);function ng(e,t){e=Ks,nt(Xc,e),nt(hr,t),Ks=e|t.baseLanes}function mh(){nt(Xc,Ks),nt(hr,hr.current)}function Um(){Ks=Xc.current,Ot(hr),Ot(Xc)}var Ea=0,Te=null,Xe=null,vt=null,Kc=!1,er=!1,il=!1,Qc=0,Ui=0,tr=null,f2=0;function ht(){throw Error(Z(321))}function Bm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!gn(e[n],t[n]))return!1;return!0}function Hm(e,t,n,a,l,r){return Ea=r,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,je.H=e===null||e.memoizedState===null?Pb:qb,il=!1,r=n(a,l),il=!1,er&&(r=hb(t,n,a,l)),fb(e),r}function fb(e){je.H=Zc;var t=Xe!==null&&Xe.next!==null;if(Ea=0,vt=Xe=Te=null,Kc=!1,Ui=0,tr=null,t)throw Error(Z(300));e===null||Mt||(e=e.dependencies,e!==null&&Fc(e)&&(Mt=!0))}function hb(e,t,n,a){Te=e;var l=0;do{if(er&&(tr=null),Ui=0,er=!1,25<=l)throw Error(Z(301));if(l+=1,vt=Xe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}je.H=y2,r=t(n,a)}while(er);return r}function h2(){var e=je.H,t=e.useState()[0];return t=typeof t.then=="function"?xo(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(Te.flags|=1024),t}function Im(){var e=Qc!==0;return Qc=0,e}function Pm(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function qm(e){if(Kc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Kc=!1}Ea=0,vt=Xe=Te=null,er=!1,Ui=Qc=0,tr=null}function Kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Te.memoizedState=vt=e:vt=vt.next=e,vt}function jt(){if(Xe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=vt===null?Te.memoizedState:vt.next;if(t!==null)vt=t,Xe=e;else{if(e===null)throw Te.alternate===null?Error(Z(467)):Error(Z(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},vt===null?Te.memoizedState=vt=e:vt=vt.next=e}return vt}function Gm(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(e){var t=Ui;return Ui+=1,tr===null&&(tr=[]),e=cb(tr,e,t),t=Te,(vt===null?t.memoizedState:vt.next)===null&&(t=t.alternate,je.H=t===null||t.memoizedState===null?Pb:qb),e}function qu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xo(e);if(e.$$typeof===Bs)return It(e)}throw Error(Z(438,String(e)))}function Vm(e){var t=null,n=Te.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Te.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(l){return l.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Gm(),Te.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=Z1;return t.index++,n}function Fs(e,t){return typeof t=="function"?t(e):t}function _c(e){var t=jt();return Ym(t,Xe,e)}function Ym(e,t,n){var a=e.queue;if(a===null)throw Error(Z(311));a.lastRenderedReducer=n;var l=e.baseQueue,r=a.pending;if(r!==null){if(l!==null){var i=l.next;l.next=r.next,r.next=i}t.baseQueue=l=r,a.pending=null}if(r=e.baseState,l===null)e.memoizedState=r;else{t=l.next;var o=i=null,c=null,d=t,f=!1;do{var h=d.lane&-536870913;if(h!==d.lane?($e&h)===h:(Ea&h)===h){var m=d.revertLane;if(m===0)c!==null&&(c=c.next={lane:0,revertLane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),h===fr&&(f=!0);else if((Ea&m)===m){d=d.next,m===fr&&(f=!0);continue}else h={lane:0,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(o=c=h,i=r):c=c.next=h,Te.lanes|=m,Ma|=m;h=d.action,il&&n(r,h),r=d.hasEagerState?d.eagerState:n(r,h)}else m={lane:h,revertLane:d.revertLane,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null},c===null?(o=c=m,i=r):c=c.next=m,Te.lanes|=h,Ma|=h;d=d.next}while(d!==null&&d!==t);if(c===null?i=r:c.next=o,!gn(r,e.memoizedState)&&(Mt=!0,f&&(n=Jl,n!==null)))throw n;e.memoizedState=r,e.baseState=i,e.baseQueue=c,a.lastRenderedState=r}return l===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Zd(e){var t=jt(),n=t.queue;if(n===null)throw Error(Z(311));n.lastRenderedReducer=e;var a=n.dispatch,l=n.pending,r=t.memoizedState;if(l!==null){n.pending=null;var i=l=l.next;do r=e(r,i.action),i=i.next;while(i!==l);gn(r,t.memoizedState)||(Mt=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,a]}function mb(e,t,n){var a=Te,l=jt(),r=Le;if(r){if(n===void 0)throw Error(Z(407));n=n()}else n=t();var i=!gn((Xe||l).memoizedState,n);i&&(l.memoizedState=n,Mt=!0),l=l.queue;var o=gb.bind(null,a,l,e);if(go(2048,8,o,[e]),l.getSnapshot!==t||i||vt!==null&&vt.memoizedState.tag&1){if(a.flags|=2048,mr(9,Gu(),xb.bind(null,a,l,n,t),null),We===null)throw Error(Z(349));r||Ea&124||pb(a,t,n)}return n}function pb(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Te.updateQueue,t===null?(t=Gm(),Te.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xb(e,t,n,a){t.value=n,t.getSnapshot=a,vb(t)&&yb(e)}function gb(e,t,n){return n(function(){vb(t)&&yb(e)})}function vb(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!gn(e,n)}catch{return!0}}function yb(e){var t=Rr(e,2);t!==null&&pn(t,e,2)}function ph(e){var t=Kt();if(typeof e=="function"){var n=e;if(e=n(),il){pa(!0);try{n()}finally{pa(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fs,lastRenderedState:e},t}function bb(e,t,n,a){return e.baseState=n,Ym(e,Xe,typeof a=="function"?a:Fs)}function m2(e,t,n,a,l){if(Vu(e))throw Error(Z(485));if(e=t.action,e!==null){var r={payload:l,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(i){r.listeners.push(i)}};je.T!==null?n(!0):r.isTransition=!1,a(r),n=t.pending,n===null?(r.next=t.pending=r,jb(t,r)):(r.next=n.next,t.pending=n.next=r)}}function jb(e,t){var n=t.action,a=t.payload,l=e.state;if(t.isTransition){var r=je.T,i={};je.T=i;try{var o=n(l,a),c=je.S;c!==null&&c(i,o),sg(e,t,o)}catch(d){xh(e,t,d)}finally{je.T=r}}else try{r=n(l,a),sg(e,t,r)}catch(d){xh(e,t,d)}}function sg(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){ag(e,t,a)},function(a){return xh(e,t,a)}):ag(e,t,n)}function ag(e,t,n){t.status="fulfilled",t.value=n,_b(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,jb(e,n)))}function xh(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,_b(t),t=t.next;while(t!==a)}e.action=null}function _b(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function wb(e,t){return t}function lg(e,t){if(Le){var n=We.formState;if(n!==null){e:{var a=Te;if(Le){if(ct){t:{for(var l=ct,r=cs;l.nodeType!==8;){if(!r){l=null;break t}if(l=Qn(l.nextSibling),l===null){l=null;break t}}r=l.data,l=r==="F!"||r==="F"?l:null}if(l){ct=Qn(l.nextSibling),a=l.data==="F!";break e}}ll(a)}a=!1}a&&(t=n[0])}}return n=Kt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wb,lastRenderedState:t},n.queue=a,n=Bb.bind(null,Te,a),a.dispatch=n,a=ph(!1),r=Qm.bind(null,Te,!1,a.queue),a=Kt(),l={state:t,dispatch:null,action:e,pending:null},a.queue=l,n=m2.bind(null,Te,l,r,n),l.dispatch=n,a.memoizedState=e,[t,n,!1]}function rg(e){var t=jt();return Nb(t,Xe,e)}function Nb(e,t,n){if(t=Ym(e,t,wb)[0],e=_c(Fs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=xo(t)}catch(i){throw i===po?Pu:i}else a=t;t=jt();var l=t.queue,r=l.dispatch;return n!==t.memoizedState&&(Te.flags|=2048,mr(9,Gu(),p2.bind(null,l,n),null)),[a,r,e]}function p2(e,t){e.action=t}function ig(e){var t=jt(),n=Xe;if(n!==null)return Nb(t,n,e);jt(),t=t.memoizedState,n=jt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function mr(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Gm(),Te.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Gu(){return{destroy:void 0,resource:void 0}}function kb(){return jt().memoizedState}function wc(e,t,n,a){var l=Kt();a=a===void 0?null:a,Te.flags|=e,l.memoizedState=mr(1|t,Gu(),n,a)}function go(e,t,n,a){var l=jt();a=a===void 0?null:a;var r=l.memoizedState.inst;Xe!==null&&a!==null&&Bm(a,Xe.memoizedState.deps)?l.memoizedState=mr(t,r,n,a):(Te.flags|=e,l.memoizedState=mr(1|t,r,n,a))}function og(e,t){wc(8390656,8,e,t)}function Sb(e,t){go(2048,8,e,t)}function Cb(e,t){return go(4,2,e,t)}function Rb(e,t){return go(4,4,e,t)}function Tb(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Eb(e,t,n){n=n!=null?n.concat([e]):null,go(4,4,Tb.bind(null,t,e),n)}function Fm(){}function Ab(e,t){var n=jt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Bm(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Mb(e,t){var n=jt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Bm(t,a[1]))return a[0];if(a=e(),il){pa(!0);try{e()}finally{pa(!1)}}return n.memoizedState=[a,t],a}function Xm(e,t,n){return n===void 0||Ea&1073741824?e.memoizedState=t:(e.memoizedState=n,e=_j(),Te.lanes|=e,Ma|=e,n)}function Ob(e,t,n,a){return gn(n,t)?n:hr.current!==null?(e=Xm(e,n,a),gn(e,t)||(Mt=!0),e):Ea&42?(e=_j(),Te.lanes|=e,Ma|=e,t):(Mt=!0,e.memoizedState=n)}function $b(e,t,n,a,l){var r=Ue.p;Ue.p=r!==0&&8>r?r:8;var i=je.T,o={};je.T=o,Qm(e,!1,t,n);try{var c=l(),d=je.S;if(d!==null&&d(o,c),c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=d2(c,a);Ni(e,t,f,mn(e))}else Ni(e,t,a,mn(e))}catch(h){Ni(e,t,{then:function(){},status:"rejected",reason:h},mn())}finally{Ue.p=r,je.T=i}}function x2(){}function gh(e,t,n,a){if(e.tag!==5)throw Error(Z(476));var l=Db(e).queue;$b(e,l,t,Za,n===null?x2:function(){return zb(e),n(a)})}function Db(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Za,baseState:Za,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fs,lastRenderedState:Za},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zb(e){var t=Db(e).next.queue;Ni(e,t,{},mn())}function Km(){return It(qi)}function Lb(){return jt().memoizedState}function Ub(){return jt().memoizedState}function g2(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mn();e=_a(n);var a=wa(t,e,n);a!==null&&(pn(a,t,n),ji(a,t,n)),t={cache:Dm()},e.payload=t;return}t=t.return}}function v2(e,t,n){var a=mn();n={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Vu(e)?Hb(t,n):(n=Am(e,t,n,a),n!==null&&(pn(n,e,a),Ib(n,t,a)))}function Bb(e,t,n){var a=mn();Ni(e,t,n,a)}function Ni(e,t,n,a){var l={lane:a,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vu(e))Hb(t,l);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var i=t.lastRenderedState,o=r(i,n);if(l.hasEagerState=!0,l.eagerState=o,gn(o,i))return Iu(e,t,l,0),We===null&&Hu(),!1}catch{}finally{}if(n=Am(e,t,l,a),n!==null)return pn(n,e,a),Ib(n,t,a),!0}return!1}function Qm(e,t,n,a){if(a={lane:2,revertLane:ap(),action:a,hasEagerState:!1,eagerState:null,next:null},Vu(e)){if(t)throw Error(Z(479))}else t=Am(e,n,a,2),t!==null&&pn(t,e,2)}function Vu(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Hb(e,t){er=Kc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ib(e,t,n){if(n&4194048){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Ay(e,n)}}var Zc={readContext:It,use:qu,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht},Pb={readContext:It,use:qu,useCallback:function(e,t){return Kt().memoizedState=[e,t===void 0?null:t],e},useContext:It,useEffect:og,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,wc(4194308,4,Tb.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wc(4194308,4,e,t)},useInsertionEffect:function(e,t){wc(4,2,e,t)},useMemo:function(e,t){var n=Kt();t=t===void 0?null:t;var a=e();if(il){pa(!0);try{e()}finally{pa(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Kt();if(n!==void 0){var l=n(t);if(il){pa(!0);try{n(t)}finally{pa(!1)}}}else l=t;return a.memoizedState=a.baseState=l,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:l},a.queue=e,e=e.dispatch=v2.bind(null,Te,e),[a.memoizedState,e]},useRef:function(e){var t=Kt();return e={current:e},t.memoizedState=e},useState:function(e){e=ph(e);var t=e.queue,n=Bb.bind(null,Te,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Fm,useDeferredValue:function(e,t){var n=Kt();return Xm(n,e,t)},useTransition:function(){var e=ph(!1);return e=$b.bind(null,Te,e.queue,!0,!1),Kt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Te,l=Kt();if(Le){if(n===void 0)throw Error(Z(407));n=n()}else{if(n=t(),We===null)throw Error(Z(349));$e&124||pb(a,t,n)}l.memoizedState=n;var r={value:n,getSnapshot:t};return l.queue=r,og(gb.bind(null,a,r,e),[e]),a.flags|=2048,mr(9,Gu(),xb.bind(null,a,r,n,t),null),n},useId:function(){var e=Kt(),t=We.identifierPrefix;if(Le){var n=Is,a=Hs;n=(a&~(1<<32-hn(a)-1)).toString(32)+n,t="«"+t+"R"+n,n=Qc++,0<n&&(t+="H"+n.toString(32)),t+="»"}else n=f2++,t="«"+t+"r"+n.toString(32)+"»";return e.memoizedState=t},useHostTransitionStatus:Km,useFormState:lg,useActionState:lg,useOptimistic:function(e){var t=Kt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Qm.bind(null,Te,!0,n),n.dispatch=t,[e,t]},useMemoCache:Vm,useCacheRefresh:function(){return Kt().memoizedState=g2.bind(null,Te)}},qb={readContext:It,use:qu,useCallback:Ab,useContext:It,useEffect:Sb,useImperativeHandle:Eb,useInsertionEffect:Cb,useLayoutEffect:Rb,useMemo:Mb,useReducer:_c,useRef:kb,useState:function(){return _c(Fs)},useDebugValue:Fm,useDeferredValue:function(e,t){var n=jt();return Ob(n,Xe.memoizedState,e,t)},useTransition:function(){var e=_c(Fs)[0],t=jt().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:mb,useId:Lb,useHostTransitionStatus:Km,useFormState:rg,useActionState:rg,useOptimistic:function(e,t){var n=jt();return bb(n,Xe,e,t)},useMemoCache:Vm,useCacheRefresh:Ub},y2={readContext:It,use:qu,useCallback:Ab,useContext:It,useEffect:Sb,useImperativeHandle:Eb,useInsertionEffect:Cb,useLayoutEffect:Rb,useMemo:Mb,useReducer:Zd,useRef:kb,useState:function(){return Zd(Fs)},useDebugValue:Fm,useDeferredValue:function(e,t){var n=jt();return Xe===null?Xm(n,e,t):Ob(n,Xe.memoizedState,e,t)},useTransition:function(){var e=Zd(Fs)[0],t=jt().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:mb,useId:Lb,useHostTransitionStatus:Km,useFormState:ig,useActionState:ig,useOptimistic:function(e,t){var n=jt();return Xe!==null?bb(n,Xe,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Vm,useCacheRefresh:Ub},nr=null,Bi=0;function Fo(e){var t=Bi;return Bi+=1,nr===null&&(nr=[]),cb(nr,e,t)}function Qr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xo(e,t){throw t.$$typeof===K1?Error(Z(525)):(e=Object.prototype.toString.call(t),Error(Z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function cg(e){var t=e._init;return t(e._payload)}function Gb(e){function t(g,p){if(e){var b=g.deletions;b===null?(g.deletions=[p],g.flags|=16):b.push(p)}}function n(g,p){if(!e)return null;for(;p!==null;)t(g,p),p=p.sibling;return null}function a(g){for(var p=new Map;g!==null;)g.key!==null?p.set(g.key,g):p.set(g.index,g),g=g.sibling;return p}function l(g,p){return g=Gs(g,p),g.index=0,g.sibling=null,g}function r(g,p,b){return g.index=b,e?(b=g.alternate,b!==null?(b=b.index,b<p?(g.flags|=67108866,p):b):(g.flags|=67108866,p)):(g.flags|=1048576,p)}function i(g){return e&&g.alternate===null&&(g.flags|=67108866),g}function o(g,p,b,_){return p===null||p.tag!==6?(p=Xd(b,g.mode,_),p.return=g,p):(p=l(p,b),p.return=g,p)}function c(g,p,b,_){var N=b.type;return N===Ll?f(g,p,b.props.children,_,b.key):p!==null&&(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ca&&cg(N)===p.type)?(p=l(p,b.props),Qr(p,b),p.return=g,p):(p=bc(b.type,b.key,b.props,null,g.mode,_),Qr(p,b),p.return=g,p)}function d(g,p,b,_){return p===null||p.tag!==4||p.stateNode.containerInfo!==b.containerInfo||p.stateNode.implementation!==b.implementation?(p=Kd(b,g.mode,_),p.return=g,p):(p=l(p,b.children||[]),p.return=g,p)}function f(g,p,b,_,N){return p===null||p.tag!==7?(p=Wa(b,g.mode,_,N),p.return=g,p):(p=l(p,b),p.return=g,p)}function h(g,p,b){if(typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint")return p=Xd(""+p,g.mode,b),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ho:return b=bc(p.type,p.key,p.props,null,g.mode,b),Qr(b,p),b.return=g,b;case ai:return p=Kd(p,g.mode,b),p.return=g,p;case ca:var _=p._init;return p=_(p._payload),h(g,p,b)}if(li(p)||Yr(p))return p=Wa(p,g.mode,b,null),p.return=g,p;if(typeof p.then=="function")return h(g,Fo(p),b);if(p.$$typeof===Bs)return h(g,Vo(g,p),b);Xo(g,p)}return null}function m(g,p,b,_){var N=p!==null?p.key:null;if(typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint")return N!==null?null:o(g,p,""+b,_);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ho:return b.key===N?c(g,p,b,_):null;case ai:return b.key===N?d(g,p,b,_):null;case ca:return N=b._init,b=N(b._payload),m(g,p,b,_)}if(li(b)||Yr(b))return N!==null?null:f(g,p,b,_,null);if(typeof b.then=="function")return m(g,p,Fo(b),_);if(b.$$typeof===Bs)return m(g,p,Vo(g,b),_);Xo(g,b)}return null}function x(g,p,b,_,N){if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return g=g.get(b)||null,o(p,g,""+_,N);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Ho:return g=g.get(_.key===null?b:_.key)||null,c(p,g,_,N);case ai:return g=g.get(_.key===null?b:_.key)||null,d(p,g,_,N);case ca:var R=_._init;return _=R(_._payload),x(g,p,b,_,N)}if(li(_)||Yr(_))return g=g.get(b)||null,f(p,g,_,N,null);if(typeof _.then=="function")return x(g,p,b,Fo(_),N);if(_.$$typeof===Bs)return x(g,p,b,Vo(p,_),N);Xo(p,_)}return null}function j(g,p,b,_){for(var N=null,R=null,w=p,k=p=0,L=null;w!==null&&k<b.length;k++){w.index>k?(L=w,w=null):L=w.sibling;var D=m(g,w,b[k],_);if(D===null){w===null&&(w=L);break}e&&w&&D.alternate===null&&t(g,w),p=r(D,p,k),R===null?N=D:R.sibling=D,R=D,w=L}if(k===b.length)return n(g,w),Le&&Xa(g,k),N;if(w===null){for(;k<b.length;k++)w=h(g,b[k],_),w!==null&&(p=r(w,p,k),R===null?N=w:R.sibling=w,R=w);return Le&&Xa(g,k),N}for(w=a(w);k<b.length;k++)L=x(w,g,k,b[k],_),L!==null&&(e&&L.alternate!==null&&w.delete(L.key===null?k:L.key),p=r(L,p,k),R===null?N=L:R.sibling=L,R=L);return e&&w.forEach(function(K){return t(g,K)}),Le&&Xa(g,k),N}function v(g,p,b,_){if(b==null)throw Error(Z(151));for(var N=null,R=null,w=p,k=p=0,L=null,D=b.next();w!==null&&!D.done;k++,D=b.next()){w.index>k?(L=w,w=null):L=w.sibling;var K=m(g,w,D.value,_);if(K===null){w===null&&(w=L);break}e&&w&&K.alternate===null&&t(g,w),p=r(K,p,k),R===null?N=K:R.sibling=K,R=K,w=L}if(D.done)return n(g,w),Le&&Xa(g,k),N;if(w===null){for(;!D.done;k++,D=b.next())D=h(g,D.value,_),D!==null&&(p=r(D,p,k),R===null?N=D:R.sibling=D,R=D);return Le&&Xa(g,k),N}for(w=a(w);!D.done;k++,D=b.next())D=x(w,g,k,D.value,_),D!==null&&(e&&D.alternate!==null&&w.delete(D.key===null?k:D.key),p=r(D,p,k),R===null?N=D:R.sibling=D,R=D);return e&&w.forEach(function(G){return t(g,G)}),Le&&Xa(g,k),N}function y(g,p,b,_){if(typeof b=="object"&&b!==null&&b.type===Ll&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Ho:e:{for(var N=b.key;p!==null;){if(p.key===N){if(N=b.type,N===Ll){if(p.tag===7){n(g,p.sibling),_=l(p,b.props.children),_.return=g,g=_;break e}}else if(p.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===ca&&cg(N)===p.type){n(g,p.sibling),_=l(p,b.props),Qr(_,b),_.return=g,g=_;break e}n(g,p);break}else t(g,p);p=p.sibling}b.type===Ll?(_=Wa(b.props.children,g.mode,_,b.key),_.return=g,g=_):(_=bc(b.type,b.key,b.props,null,g.mode,_),Qr(_,b),_.return=g,g=_)}return i(g);case ai:e:{for(N=b.key;p!==null;){if(p.key===N)if(p.tag===4&&p.stateNode.containerInfo===b.containerInfo&&p.stateNode.implementation===b.implementation){n(g,p.sibling),_=l(p,b.children||[]),_.return=g,g=_;break e}else{n(g,p);break}else t(g,p);p=p.sibling}_=Kd(b,g.mode,_),_.return=g,g=_}return i(g);case ca:return N=b._init,b=N(b._payload),y(g,p,b,_)}if(li(b))return j(g,p,b,_);if(Yr(b)){if(N=Yr(b),typeof N!="function")throw Error(Z(150));return b=N.call(b),v(g,p,b,_)}if(typeof b.then=="function")return y(g,p,Fo(b),_);if(b.$$typeof===Bs)return y(g,p,Vo(g,b),_);Xo(g,b)}return typeof b=="string"&&b!==""||typeof b=="number"||typeof b=="bigint"?(b=""+b,p!==null&&p.tag===6?(n(g,p.sibling),_=l(p,b),_.return=g,g=_):(n(g,p),_=Xd(b,g.mode,_),_.return=g,g=_),i(g)):n(g,p)}return function(g,p,b,_){try{Bi=0;var N=y(g,p,b,_);return nr=null,N}catch(w){if(w===po||w===Pu)throw w;var R=dn(29,w,null,g.mode);return R.lanes=_,R.return=g,R}finally{}}}var pr=Gb(!0),Vb=Gb(!1),On=_s(null),gs=null;function fa(e){var t=e.alternate;nt(kt,kt.current&1),nt(On,e),gs===null&&(t===null||hr.current!==null||t.memoizedState!==null)&&(gs=e)}function Yb(e){if(e.tag===22){if(nt(kt,kt.current),nt(On,e),gs===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(gs=e)}}else ha()}function ha(){nt(kt,kt.current),nt(On,On.current)}function qs(e){Ot(On),gs===e&&(gs=null),Ot(kt)}var kt=_s(0);function Wc(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==="$?"||$h(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:Je({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var vh={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=mn(),l=_a(a);l.payload=t,n!=null&&(l.callback=n),t=wa(e,l,a),t!==null&&(pn(t,e,a),ji(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=mn(),l=_a(a);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=wa(e,l,a),t!==null&&(pn(t,e,a),ji(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mn(),a=_a(n);a.tag=2,t!=null&&(a.callback=t),t=wa(e,a,n),t!==null&&(pn(t,e,n),ji(t,e,n))}};function ug(e,t,n,a,l,r,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,r,i):t.prototype&&t.prototype.isPureReactComponent?!zi(n,a)||!zi(l,r):!0}function dg(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&&vh.enqueueReplaceState(t,t.state,null)}function ol(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=Je({},n));for(var l in e)n[l]===void 0&&(n[l]=e[l])}return n}var Jc=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function Fb(e){Jc(e)}function Xb(e){console.error(e)}function Kb(e){Jc(e)}function eu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function fg(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(l){setTimeout(function(){throw l})}}function yh(e,t,n){return n=_a(n),n.tag=3,n.payload={element:null},n.callback=function(){eu(e,t)},n}function Qb(e){return e=_a(e),e.tag=3,e}function Zb(e,t,n,a){var l=n.type.getDerivedStateFromError;if(typeof l=="function"){var r=a.value;e.payload=function(){return l(r)},e.callback=function(){fg(t,n,a)}}var i=n.stateNode;i!==null&&typeof i.componentDidCatch=="function"&&(e.callback=function(){fg(t,n,a),typeof l!="function"&&(Na===null?Na=new Set([this]):Na.add(this));var o=a.stack;this.componentDidCatch(a.value,{componentStack:o!==null?o:""})})}function b2(e,t,n,a,l){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&ho(t,n,l,!0),n=On.current,n!==null){switch(n.tag){case 13:return gs===null?Ch():n.alternate===null&&ut===0&&(ut=3),n.flags&=-257,n.flags|=65536,n.lanes=l,a===dh?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),uf(e,a,l)),!1;case 22:return n.flags|=65536,a===dh?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,l)),!1}throw Error(Z(435,n.tag))}return uf(e,a,l),Ch(),!1}if(Le)return t=On.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=l,a!==rh&&(e=Error(Z(422),{cause:a}),Li(Cn(e,n)))):(a!==rh&&(t=Error(Z(423),{cause:a}),Li(Cn(t,n))),e=e.current.alternate,e.flags|=65536,l&=-l,e.lanes|=l,a=Cn(a,n),l=yh(e.stateNode,a,l),Qd(e,l),ut!==4&&(ut=2)),!1;var r=Error(Z(520),{cause:a});if(r=Cn(r,n),Ci===null?Ci=[r]:Ci.push(r),ut!==4&&(ut=2),t===null)return!0;a=Cn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=l&-l,n.lanes|=e,e=yh(n.stateNode,a,e),Qd(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Na===null||!Na.has(r))))return n.flags|=65536,l&=-l,n.lanes|=l,l=Qb(l),Zb(l,e,n,a),Qd(n,l),!1}n=n.return}while(n!==null);return!1}var Wb=Error(Z(461)),Mt=!1;function $t(e,t,n,a){t.child=e===null?Vb(t,null,n,a):pr(t,e.child,n,a)}function hg(e,t,n,a,l){n=n.render;var r=t.ref;if("ref"in a){var i={};for(var o in a)o!=="ref"&&(i[o]=a[o])}else i=a;return rl(t),a=Hm(e,t,n,i,r,l),o=Im(),e!==null&&!Mt?(Pm(e,t,l),Xs(e,t,l)):(Le&&o&&Om(t),t.flags|=1,$t(e,t,a,l),t.child)}function mg(e,t,n,a,l){if(e===null){var r=n.type;return typeof r=="function"&&!Mm(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,Jb(e,t,r,a,l)):(e=bc(n.type,null,a,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Zm(e,l)){var i=r.memoizedProps;if(n=n.compare,n=n!==null?n:zi,n(i,a)&&e.ref===t.ref)return Xs(e,t,l)}return t.flags|=1,e=Gs(r,a),e.ref=t.ref,e.return=t,t.child=e}function Jb(e,t,n,a,l){if(e!==null){var r=e.memoizedProps;if(zi(r,a)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=a=r,Zm(e,l))e.flags&131072&&(Mt=!0);else return t.lanes=e.lanes,Xs(e,t,l)}return bh(e,t,n,a,l)}function ej(e,t,n){var a=t.pendingProps,l=a.children,r=e!==null?e.memoizedState:null;if(a.mode==="hidden"){if(t.flags&128){if(a=r!==null?r.baseLanes|n:n,e!==null){for(l=t.child=e.child,r=0;l!==null;)r=r|l.lanes|l.childLanes,l=l.sibling;t.childLanes=r&~a}else t.childLanes=0,t.child=null;return pg(e,t,a,n)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&jc(t,r!==null?r.cachePool:null),r!==null?ng(t,r):mh(),Yb(t);else return t.lanes=t.childLanes=536870912,pg(e,t,r!==null?r.baseLanes|n:n,n)}else r!==null?(jc(t,r.cachePool),ng(t,r),ha(),t.memoizedState=null):(e!==null&&jc(t,null),mh(),ha());return $t(e,t,l,n),t.child}function pg(e,t,n,a){var l=zm();return l=l===null?null:{parent:Nt._currentValue,pool:l},t.memoizedState={baseLanes:n,cachePool:l},e!==null&&jc(t,null),mh(),Yb(t),e!==null&&ho(e,t,a,!0),null}function Nc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(Z(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function bh(e,t,n,a,l){return rl(t),n=Hm(e,t,n,a,void 0,l),a=Im(),e!==null&&!Mt?(Pm(e,t,l),Xs(e,t,l)):(Le&&a&&Om(t),t.flags|=1,$t(e,t,n,l),t.child)}function xg(e,t,n,a,l,r){return rl(t),t.updateQueue=null,n=hb(t,a,n,l),fb(e),a=Im(),e!==null&&!Mt?(Pm(e,t,r),Xs(e,t,r)):(Le&&a&&Om(t),t.flags|=1,$t(e,t,n,r),t.child)}function gg(e,t,n,a,l){if(rl(t),t.stateNode===null){var r=Vl,i=n.contextType;typeof i=="object"&&i!==null&&(r=It(i)),r=new n(a,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=vh,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=a,r.state=t.memoizedState,r.refs={},Lm(t),i=n.contextType,r.context=typeof i=="object"&&i!==null?It(i):Vl,r.state=t.memoizedState,i=n.getDerivedStateFromProps,typeof i=="function"&&(Wd(t,n,i,a),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(i=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),i!==r.state&&vh.enqueueReplaceState(r,r.state,null),wi(t,a,r,l),_i(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){r=t.stateNode;var o=t.memoizedProps,c=ol(n,o);r.props=c;var d=r.context,f=n.contextType;i=Vl,typeof f=="object"&&f!==null&&(i=It(f));var h=n.getDerivedStateFromProps;f=typeof h=="function"||typeof r.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,f||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(o||d!==i)&&dg(t,r,a,i),ua=!1;var m=t.memoizedState;r.state=m,wi(t,a,r,l),_i(),d=t.memoizedState,o||m!==d||ua?(typeof h=="function"&&(Wd(t,n,h,a),d=t.memoizedState),(c=ua||ug(t,n,c,a,m,d,i))?(f||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=d),r.props=a,r.state=d,r.context=i,a=c):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{r=t.stateNode,fh(e,t),i=t.memoizedProps,f=ol(n,i),r.props=f,h=t.pendingProps,m=r.context,d=n.contextType,c=Vl,typeof d=="object"&&d!==null&&(c=It(d)),o=n.getDerivedStateFromProps,(d=typeof o=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(i!==h||m!==c)&&dg(t,r,a,c),ua=!1,m=t.memoizedState,r.state=m,wi(t,a,r,l),_i();var x=t.memoizedState;i!==h||m!==x||ua||e!==null&&e.dependencies!==null&&Fc(e.dependencies)?(typeof o=="function"&&(Wd(t,n,o,a),x=t.memoizedState),(f=ua||ug(t,n,f,a,m,x,c)||e!==null&&e.dependencies!==null&&Fc(e.dependencies))?(d||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(a,x,c),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(a,x,c)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=x),r.props=a,r.state=x,r.context=c,a=f):(typeof r.componentDidUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||i===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),a=!1)}return r=a,Nc(e,t),a=(t.flags&128)!==0,r||a?(r=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&a?(t.child=pr(t,e.child,null,l),t.child=pr(t,null,n,l)):$t(e,t,n,l),t.memoizedState=r.state,e=t.child):e=Xs(e,t,l),e}function vg(e,t,n,a){return fo(),t.flags|=256,$t(e,t,n,a),t.child}var Jd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ef(e){return{baseLanes:e,cachePool:ib()}}function tf(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Rn),e}function tj(e,t,n){var a=t.pendingProps,l=!1,r=(t.flags&128)!==0,i;if((i=r)||(i=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),i&&(l=!0,t.flags&=-129),i=(t.flags&32)!==0,t.flags&=-33,e===null){if(Le){if(l?fa(t):ha(),Le){var o=ct,c;if(c=o){e:{for(c=o,o=cs;c.nodeType!==8;){if(!o){o=null;break e}if(c=Qn(c.nextSibling),c===null){o=null;break e}}o=c}o!==null?(t.memoizedState={dehydrated:o,treeContext:Ja!==null?{id:Hs,overflow:Is}:null,retryLane:536870912,hydrationErrors:null},c=dn(18,null,null,0),c.stateNode=o,c.return=t,t.child=c,qt=t,ct=null,c=!0):c=!1}c||ll(t)}if(o=t.memoizedState,o!==null&&(o=o.dehydrated,o!==null))return $h(o)?t.lanes=32:t.lanes=536870912,null;qs(t)}return o=a.children,a=a.fallback,l?(ha(),l=t.mode,o=tu({mode:"hidden",children:o},l),a=Wa(a,l,n,null),o.return=t,a.return=t,o.sibling=a,t.child=o,l=t.child,l.memoizedState=ef(n),l.childLanes=tf(e,i,n),t.memoizedState=Jd,a):(fa(t),jh(t,o))}if(c=e.memoizedState,c!==null&&(o=c.dehydrated,o!==null)){if(r)t.flags&256?(fa(t),t.flags&=-257,t=nf(e,t,n)):t.memoizedState!==null?(ha(),t.child=e.child,t.flags|=128,t=null):(ha(),l=a.fallback,o=t.mode,a=tu({mode:"visible",children:a.children},o),l=Wa(l,o,n,null),l.flags|=2,a.return=t,l.return=t,a.sibling=l,t.child=a,pr(t,e.child,null,n),a=t.child,a.memoizedState=ef(n),a.childLanes=tf(e,i,n),t.memoizedState=Jd,t=l);else if(fa(t),$h(o)){if(i=o.nextSibling&&o.nextSibling.dataset,i)var d=i.dgst;i=d,a=Error(Z(419)),a.stack="",a.digest=i,Li({value:a,source:null,stack:null}),t=nf(e,t,n)}else if(Mt||ho(e,t,n,!1),i=(n&e.childLanes)!==0,Mt||i){if(i=We,i!==null&&(a=n&-n,a=a&42?1:jm(a),a=a&(i.suspendedLanes|n)?0:a,a!==0&&a!==c.retryLane))throw c.retryLane=a,Rr(e,a),pn(i,e,a),Wb;o.data==="$?"||Ch(),t=nf(e,t,n)}else o.data==="$?"?(t.flags|=192,t.child=e.child,t=null):(e=c.treeContext,ct=Qn(o.nextSibling),qt=t,Le=!0,el=null,cs=!1,e!==null&&(Nn[kn++]=Hs,Nn[kn++]=Is,Nn[kn++]=Ja,Hs=e.id,Is=e.overflow,Ja=t),t=jh(t,a.children),t.flags|=4096);return t}return l?(ha(),l=a.fallback,o=t.mode,c=e.child,d=c.sibling,a=Gs(c,{mode:"hidden",children:a.children}),a.subtreeFlags=c.subtreeFlags&65011712,d!==null?l=Gs(d,l):(l=Wa(l,o,n,null),l.flags|=2),l.return=t,a.return=t,a.sibling=l,t.child=a,a=l,l=t.child,o=e.child.memoizedState,o===null?o=ef(n):(c=o.cachePool,c!==null?(d=Nt._currentValue,c=c.parent!==d?{parent:d,pool:d}:c):c=ib(),o={baseLanes:o.baseLanes|n,cachePool:c}),l.memoizedState=o,l.childLanes=tf(e,i,n),t.memoizedState=Jd,a):(fa(t),n=e.child,e=n.sibling,n=Gs(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 jh(e,t){return t=tu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function tu(e,t){return e=dn(22,e,null,t),e.lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function nf(e,t,n){return pr(t,e.child,null,n),e=jh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yg(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),oh(e.return,t,n)}function sf(e,t,n,a,l){var r=e.memoizedState;r===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:l}:(r.isBackwards=t,r.rendering=null,r.renderingStartTime=0,r.last=a,r.tail=n,r.tailMode=l)}function nj(e,t,n){var a=t.pendingProps,l=a.revealOrder,r=a.tail;if($t(e,t,a.children,n),a=kt.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&&yg(e,n,t);else if(e.tag===19)yg(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(nt(kt,a),l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&Wc(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),sf(t,!1,l,n,r);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&Wc(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}sf(t,!0,n,null,r);break;case"together":sf(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Xs(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ma|=t.lanes,!(n&t.childLanes))if(e!==null){if(ho(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(Z(153));if(t.child!==null){for(e=t.child,n=Gs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Zm(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Fc(e)))}function j2(e,t,n){switch(t.tag){case 3:Bc(t,t.stateNode.containerInfo),da(t,Nt,e.memoizedState.cache),fo();break;case 27:case 5:Qf(t);break;case 4:Bc(t,t.stateNode.containerInfo);break;case 10:da(t,t.type,t.memoizedProps.value);break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(fa(t),t.flags|=128,null):n&t.child.childLanes?tj(e,t,n):(fa(t),e=Xs(e,t,n),e!==null?e.sibling:null);fa(t);break;case 19:var l=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(ho(e,t,n,!1),a=(n&t.childLanes)!==0),l){if(a)return nj(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),nt(kt,kt.current),a)break;return null;case 22:case 23:return t.lanes=0,ej(e,t,n);case 24:da(t,Nt,e.memoizedState.cache)}return Xs(e,t,n)}function sj(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!Zm(e,n)&&!(t.flags&128))return Mt=!1,j2(e,t,n);Mt=!!(e.flags&131072)}else Mt=!1,Le&&t.flags&1048576&&lb(t,Yc,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var a=t.elementType,l=a._init;if(a=l(a._payload),t.type=a,typeof a=="function")Mm(a)?(e=ol(a,e),t.tag=1,t=gg(null,t,a,e,n)):(t.tag=0,t=bh(null,t,a,e,n));else{if(a!=null){if(l=a.$$typeof,l===vm){t.tag=11,t=hg(null,t,a,e,n);break e}else if(l===ym){t.tag=14,t=mg(null,t,a,e,n);break e}}throw t=Xf(a)||a,Error(Z(306,t,""))}}return t;case 0:return bh(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,l=ol(a,t.pendingProps),gg(e,t,a,l,n);case 3:e:{if(Bc(t,t.stateNode.containerInfo),e===null)throw Error(Z(387));a=t.pendingProps;var r=t.memoizedState;l=r.element,fh(e,t),wi(t,a,null,n);var i=t.memoizedState;if(a=i.cache,da(t,Nt,a),a!==r.cache&&ch(t,[Nt],n,!0),_i(),a=i.element,r.isDehydrated)if(r={element:a,isDehydrated:!1,cache:i.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=vg(e,t,a,n);break e}else if(a!==l){l=Cn(Error(Z(424)),t),Li(l),t=vg(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(ct=Qn(e.firstChild),qt=t,Le=!0,el=null,cs=!0,n=Vb(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(fo(),a===l){t=Xs(e,t,n);break e}$t(e,t,a,n)}t=t.child}return t;case 26:return Nc(e,t),e===null?(n=zg(t.type,null,t.pendingProps,null))?t.memoizedState=n:Le||(n=t.type,e=t.pendingProps,a=ou(ja.current).createElement(n),a[Ht]=t,a[Jt]=e,zt(a,n,e),At(a),t.stateNode=a):t.memoizedState=zg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Qf(t),e===null&&Le&&(a=t.stateNode=qj(t.type,t.pendingProps,ja.current),qt=t,cs=!0,l=ct,La(t.type)?(Dh=l,ct=Qn(a.firstChild)):ct=l),$t(e,t,t.pendingProps.children,n),Nc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Le&&((l=a=ct)&&(a=K2(a,t.type,t.pendingProps,cs),a!==null?(t.stateNode=a,qt=t,ct=Qn(a.firstChild),cs=!1,l=!0):l=!1),l||ll(t)),Qf(t),l=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,a=r.children,Mh(l,r)?a=null:i!==null&&Mh(l,i)&&(t.flags|=32),t.memoizedState!==null&&(l=Hm(e,t,h2,null,null,n),qi._currentValue=l),Nc(e,t),$t(e,t,a,n),t.child;case 6:return e===null&&Le&&((e=n=ct)&&(n=Q2(n,t.pendingProps,cs),n!==null?(t.stateNode=n,qt=t,ct=null,e=!0):e=!1),e||ll(t)),null;case 13:return tj(e,t,n);case 4:return Bc(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=pr(t,null,a,n):$t(e,t,a,n),t.child;case 11:return hg(e,t,t.type,t.pendingProps,n);case 7:return $t(e,t,t.pendingProps,n),t.child;case 8:return $t(e,t,t.pendingProps.children,n),t.child;case 12:return $t(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,da(t,t.type,a.value),$t(e,t,a.children,n),t.child;case 9:return l=t.type._context,a=t.pendingProps.children,rl(t),l=It(l),a=a(l),t.flags|=1,$t(e,t,a,n),t.child;case 14:return mg(e,t,t.type,t.pendingProps,n);case 15:return Jb(e,t,t.type,t.pendingProps,n);case 19:return nj(e,t,n);case 31:return a=t.pendingProps,n=t.mode,a={mode:a.mode,children:a.children},e===null?(n=tu(a,n),n.ref=t.ref,t.child=n,n.return=t,t=n):(n=Gs(e.child,a),n.ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return ej(e,t,n);case 24:return rl(t),a=It(Nt),e===null?(l=zm(),l===null&&(l=We,r=Dm(),l.pooledCache=r,r.refCount++,r!==null&&(l.pooledCacheLanes|=n),l=r),t.memoizedState={parent:a,cache:l},Lm(t),da(t,Nt,l)):(e.lanes&n&&(fh(e,t),wi(t,null,null,n),_i()),l=e.memoizedState,r=t.memoizedState,l.parent!==a?(l={parent:a,cache:a},t.memoizedState=l,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=l),da(t,Nt,a)):(a=r.cache,da(t,Nt,a),a!==l.cache&&ch(t,[Nt],n,!0))),$t(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(Z(156,t.tag))}function Ms(e){e.flags|=4}function bg(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Yj(t)){if(t=On.current,t!==null&&(($e&4194048)===$e?gs!==null:($e&62914560)!==$e&&!($e&536870912)||t!==gs))throw bi=dh,ob;e.flags|=8192}}function Ko(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ty():536870912,e.lanes|=t,xr|=t)}function Zr(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function lt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags&65011712,a|=l.flags&65011712,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,a|=l.subtreeFlags,a|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function _2(e,t,n){var a=t.pendingProps;switch($m(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(t),null;case 1:return lt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Vs(Nt),cr(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Kr(t)?Ms(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Qx())),lt(t),null;case 26:return n=t.memoizedState,e===null?(Ms(t),n!==null?(lt(t),bg(t,n)):(lt(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Ms(t),lt(t),bg(t,n)):(lt(t),t.flags&=-16777217):(e.memoizedProps!==a&&Ms(t),lt(t),t.flags&=-16777217),null;case 27:Hc(t),n=ja.current;var l=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ms(t);else{if(!a){if(t.stateNode===null)throw Error(Z(166));return lt(t),null}e=ps.current,Kr(t)?Xx(t):(e=qj(l,a,n),t.stateNode=e,Ms(t))}return lt(t),null;case 5:if(Hc(t),n=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ms(t);else{if(!a){if(t.stateNode===null)throw Error(Z(166));return lt(t),null}if(e=ps.current,Kr(t))Xx(t);else{switch(l=ou(ja.current),e){case 1:e=l.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=l.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=l.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=l.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof a.is=="string"?l.createElement("select",{is:a.is}):l.createElement("select"),a.multiple?e.multiple=!0:a.size&&(e.size=a.size);break;default:e=typeof a.is=="string"?l.createElement(n,{is:a.is}):l.createElement(n)}}e[Ht]=t,e[Jt]=a;e:for(l=t.child;l!==null;){if(l.tag===5||l.tag===6)e.appendChild(l.stateNode);else if(l.tag!==4&&l.tag!==27&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===t)break e;for(;l.sibling===null;){if(l.return===null||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}t.stateNode=e;e:switch(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&&Ms(t)}}return lt(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Ms(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(Z(166));if(e=ja.current,Kr(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,l=qt,l!==null)switch(l.tag){case 27:case 5:a=l.memoizedProps}e[Ht]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Hj(e.nodeValue,n)),e||ll(t)}else e=ou(e).createTextNode(a),e[Ht]=t,t.stateNode=e}return lt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(l=Kr(t),a!==null&&a.dehydrated!==null){if(e===null){if(!l)throw Error(Z(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(Z(317));l[Ht]=t}else fo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;lt(t),l=!1}else l=Qx(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),l=!0;if(!l)return t.flags&256?(qs(t),t):(qs(t),null)}if(qs(t),t.flags&128)return t.lanes=n,t;if(n=a!==null,e=e!==null&&e.memoizedState!==null,n){a=t.child,l=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(l=a.alternate.memoizedState.cachePool.pool);var r=null;a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(r=a.memoizedState.cachePool.pool),r!==l&&(a.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),Ko(t,t.updateQueue),lt(t),null;case 4:return cr(),e===null&&lp(t.stateNode.containerInfo),lt(t),null;case 10:return Vs(t.type),lt(t),null;case 19:if(Ot(kt),l=t.memoizedState,l===null)return lt(t),null;if(a=(t.flags&128)!==0,r=l.rendering,r===null)if(a)Zr(l,!1);else{if(ut!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(r=Wc(e),r!==null){for(t.flags|=128,Zr(l,!1),e=r.updateQueue,t.updateQueue=e,Ko(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ab(n,e),n=n.sibling;return nt(kt,kt.current&1|2),t.child}e=e.sibling}l.tail!==null&&xs()>su&&(t.flags|=128,a=!0,Zr(l,!1),t.lanes=4194304)}else{if(!a)if(e=Wc(r),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Ko(t,e),Zr(l,!0),l.tail===null&&l.tailMode==="hidden"&&!r.alternate&&!Le)return lt(t),null}else 2*xs()-l.renderingStartTime>su&&n!==536870912&&(t.flags|=128,a=!0,Zr(l,!1),t.lanes=4194304);l.isBackwards?(r.sibling=t.child,t.child=r):(e=l.last,e!==null?e.sibling=r:t.child=r,l.last=r)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=xs(),t.sibling=null,e=kt.current,nt(kt,a?e&1|2:e&1),t):(lt(t),null);case 22:case 23:return qs(t),Um(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?n&536870912&&!(t.flags&128)&&(lt(t),t.subtreeFlags&6&&(t.flags|=8192)):lt(t),n=t.updateQueue,n!==null&&Ko(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&&Ot(tl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vs(Nt),lt(t),null;case 25:return null;case 30:return null}throw Error(Z(156,t.tag))}function w2(e,t){switch($m(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vs(Nt),cr(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Hc(t),null;case 13:if(qs(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Z(340));fo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ot(kt),null;case 4:return cr(),null;case 10:return Vs(t.type),null;case 22:case 23:return qs(t),Um(),e!==null&&Ot(tl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vs(Nt),null;case 25:return null;default:return null}}function aj(e,t){switch($m(t),t.tag){case 3:Vs(Nt),cr();break;case 26:case 27:case 5:Hc(t);break;case 4:cr();break;case 13:qs(t);break;case 19:Ot(kt);break;case 10:Vs(t.type);break;case 22:case 23:qs(t),Um(),e!==null&&Ot(tl);break;case 24:Vs(Nt)}}function vo(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var l=a.next;n=l;do{if((n.tag&e)===e){a=void 0;var r=n.create,i=n.inst;a=r(),i.destroy=a}n=n.next}while(n!==l)}}catch(o){Ke(t,t.return,o)}}function Aa(e,t,n){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var r=l.next;a=r;do{if((a.tag&e)===e){var i=a.inst,o=i.destroy;if(o!==void 0){i.destroy=void 0,l=t;var c=n,d=o;try{d()}catch(f){Ke(l,c,f)}}}a=a.next}while(a!==r)}}catch(f){Ke(t,t.return,f)}}function lj(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{db(t,n)}catch(a){Ke(e,e.return,a)}}}function rj(e,t,n){n.props=ol(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Ke(e,t,a)}}function ki(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(l){Ke(e,t,l)}}function fs(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(l){Ke(e,t,l)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(l){Ke(e,t,l)}else n.current=null}function ij(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(l){Ke(e,e.return,l)}}function af(e,t,n){try{var a=e.stateNode;G2(a,e.type,n,t),a[Jt]=t}catch(l){Ke(e,e.return,l)}}function oj(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&La(e.type)||e.tag===4}function lf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&La(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 _h(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=Ku));else if(a!==4&&(a===27&&La(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(_h(e,t,n),e=e.sibling;e!==null;)_h(e,t,n),e=e.sibling}function nu(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&&La(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(nu(e,t,n),e=e.sibling;e!==null;)nu(e,t,n),e=e.sibling}function cj(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,l=t.attributes;l.length;)t.removeAttributeNode(l[0]);zt(t,a,n),t[Ht]=e,t[Jt]=n}catch(r){Ke(e,e.return,r)}}var Us=!1,mt=!1,rf=!1,jg=typeof WeakSet=="function"?WeakSet:Set,Et=null;function N2(e,t){if(e=e.containerInfo,Eh=fu,e=Qy(e),Tm(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var l=a.anchorOffset,r=a.focusNode;a=a.focusOffset;try{n.nodeType,r.nodeType}catch{n=null;break e}var i=0,o=-1,c=-1,d=0,f=0,h=e,m=null;t:for(;;){for(var x;h!==n||l!==0&&h.nodeType!==3||(o=i+l),h!==r||a!==0&&h.nodeType!==3||(c=i+a),h.nodeType===3&&(i+=h.nodeValue.length),(x=h.firstChild)!==null;)m=h,h=x;for(;;){if(h===e)break t;if(m===n&&++d===l&&(o=i),m===r&&++f===a&&(c=i),(x=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=x}n=o===-1||c===-1?null:{start:o,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ah={focusedElem:e,selectionRange:n},fu=!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,r=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&r!==null){e=void 0,n=t,l=r.memoizedProps,r=r.memoizedState,a=n.stateNode;try{var j=ol(n.type,l,n.elementType===n.type);e=a.getSnapshotBeforeUpdate(j,r),a.__reactInternalSnapshotBeforeUpdate=e}catch(v){Ke(n,n.return,v)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Oh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Oh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(Z(163))}if(e=t.sibling,e!==null){e.return=t.return,Et=e;break}Et=t.return}}function uj(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:sa(e,n),a&4&&vo(5,n);break;case 1:if(sa(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(i){Ke(n,n.return,i)}else{var l=ol(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(l,t,e.__reactInternalSnapshotBeforeUpdate)}catch(i){Ke(n,n.return,i)}}a&64&&lj(n),a&512&&ki(n,n.return);break;case 3:if(sa(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{db(e,t)}catch(i){Ke(n,n.return,i)}}break;case 27:t===null&&a&4&&cj(n);case 26:case 5:sa(e,n),t===null&&a&4&&ij(n),a&512&&ki(n,n.return);break;case 12:sa(e,n);break;case 13:sa(e,n),a&4&&hj(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=O2.bind(null,n),Z2(e,n))));break;case 22:if(a=n.memoizedState!==null||Us,!a){t=t!==null&&t.memoizedState!==null||mt,l=Us;var r=mt;Us=a,(mt=t)&&!r?ia(e,n,(n.subtreeFlags&8772)!==0):sa(e,n),Us=l,mt=r}break;case 30:break;default:sa(e,n)}}function dj(e){var t=e.alternate;t!==null&&(e.alternate=null,dj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&wm(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 et=null,Qt=!1;function Os(e,t,n){for(n=n.child;n!==null;)fj(e,t,n),n=n.sibling}function fj(e,t,n){if(fn&&typeof fn.onCommitFiberUnmount=="function")try{fn.onCommitFiberUnmount(ro,n)}catch{}switch(n.tag){case 26:mt||fs(n,t),Os(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:mt||fs(n,t);var a=et,l=Qt;La(n.type)&&(et=n.stateNode,Qt=!1),Os(e,t,n),Ti(n.stateNode),et=a,Qt=l;break;case 5:mt||fs(n,t);case 6:if(a=et,l=Qt,et=null,Os(e,t,n),et=a,Qt=l,et!==null)if(Qt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(n.stateNode)}catch(r){Ke(n,t,r)}else try{et.removeChild(n.stateNode)}catch(r){Ke(n,t,r)}break;case 18:et!==null&&(Qt?(e=et,Og(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Yi(e)):Og(et,n.stateNode));break;case 4:a=et,l=Qt,et=n.stateNode.containerInfo,Qt=!0,Os(e,t,n),et=a,Qt=l;break;case 0:case 11:case 14:case 15:mt||Aa(2,n,t),mt||Aa(4,n,t),Os(e,t,n);break;case 1:mt||(fs(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&rj(n,t,a)),Os(e,t,n);break;case 21:Os(e,t,n);break;case 22:mt=(a=mt)||n.memoizedState!==null,Os(e,t,n),mt=a;break;default:Os(e,t,n)}}function hj(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yi(e)}catch(n){Ke(t,t.return,n)}}function k2(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new jg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new jg),t;default:throw Error(Z(435,e.tag))}}function of(e,t){var n=k2(e);t.forEach(function(a){var l=$2.bind(null,e,a);n.has(a)||(n.add(a),a.then(l,l))})}function ln(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var l=n[a],r=e,i=t,o=i;e:for(;o!==null;){switch(o.tag){case 27:if(La(o.type)){et=o.stateNode,Qt=!1;break e}break;case 5:et=o.stateNode,Qt=!1;break e;case 3:case 4:et=o.stateNode.containerInfo,Qt=!0;break e}o=o.return}if(et===null)throw Error(Z(160));fj(r,i,l),et=null,Qt=!1,r=l.alternate,r!==null&&(r.return=null),l.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)mj(t,e),t=t.sibling}var Yn=null;function mj(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ln(t,e),rn(e),a&4&&(Aa(3,e,e.return),vo(3,e),Aa(5,e,e.return));break;case 1:ln(t,e),rn(e),a&512&&(mt||n===null||fs(n,n.return)),a&64&&Us&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var l=Yn;if(ln(t,e),rn(e),a&512&&(mt||n===null||fs(n,n.return)),a&4){var r=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,l=l.ownerDocument||l;t:switch(a){case"title":r=l.getElementsByTagName("title")[0],(!r||r[co]||r[Ht]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=l.createElement(a),l.head.insertBefore(r,l.querySelector("head > title"))),zt(r,a,n),r[Ht]=e,At(r),a=r;break e;case"link":var i=Ug("link","href",l).get(a+(n.href||""));if(i){for(var o=0;o<i.length;o++)if(r=i[o],r.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&r.getAttribute("rel")===(n.rel==null?null:n.rel)&&r.getAttribute("title")===(n.title==null?null:n.title)&&r.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){i.splice(o,1);break t}}r=l.createElement(a),zt(r,a,n),l.head.appendChild(r);break;case"meta":if(i=Ug("meta","content",l).get(a+(n.content||""))){for(o=0;o<i.length;o++)if(r=i[o],r.getAttribute("content")===(n.content==null?null:""+n.content)&&r.getAttribute("name")===(n.name==null?null:n.name)&&r.getAttribute("property")===(n.property==null?null:n.property)&&r.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute("charset")===(n.charSet==null?null:n.charSet)){i.splice(o,1);break t}}r=l.createElement(a),zt(r,a,n),l.head.appendChild(r);break;default:throw Error(Z(468,a))}r[Ht]=e,At(r),a=r}e.stateNode=a}else Bg(l,e.type,e.stateNode);else e.stateNode=Lg(l,a,e.memoizedProps);else r!==a?(r===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):r.count--,a===null?Bg(l,e.type,e.stateNode):Lg(l,a,e.memoizedProps)):a===null&&e.stateNode!==null&&af(e,e.memoizedProps,n.memoizedProps)}break;case 27:ln(t,e),rn(e),a&512&&(mt||n===null||fs(n,n.return)),n!==null&&a&4&&af(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ln(t,e),rn(e),a&512&&(mt||n===null||fs(n,n.return)),e.flags&32){l=e.stateNode;try{dr(l,"")}catch(x){Ke(e,e.return,x)}}a&4&&e.stateNode!=null&&(l=e.memoizedProps,af(e,l,n!==null?n.memoizedProps:l)),a&1024&&(rf=!0);break;case 6:if(ln(t,e),rn(e),a&4){if(e.stateNode===null)throw Error(Z(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(x){Ke(e,e.return,x)}}break;case 3:if(Cc=null,l=Yn,Yn=cu(t.containerInfo),ln(t,e),Yn=l,rn(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Yi(t.containerInfo)}catch(x){Ke(e,e.return,x)}rf&&(rf=!1,pj(e));break;case 4:a=Yn,Yn=cu(e.stateNode.containerInfo),ln(t,e),rn(e),Yn=a;break;case 12:ln(t,e),rn(e);break;case 13:ln(t,e),rn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(np=xs()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,of(e,a)));break;case 22:l=e.memoizedState!==null;var c=n!==null&&n.memoizedState!==null,d=Us,f=mt;if(Us=d||l,mt=f||c,ln(t,e),mt=f,Us=d,rn(e),a&8192)e:for(t=e.stateNode,t._visibility=l?t._visibility&-2:t._visibility|1,l&&(n===null||c||Us||mt||Ka(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){c=n=t;try{if(r=c.stateNode,l)i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none";else{o=c.stateNode;var h=c.memoizedProps.style,m=h!=null&&h.hasOwnProperty("display")?h.display:null;o.style.display=m==null||typeof m=="boolean"?"":(""+m).trim()}}catch(x){Ke(c,c.return,x)}}}else if(t.tag===6){if(n===null){c=t;try{c.stateNode.nodeValue=l?"":c.memoizedProps}catch(x){Ke(c,c.return,x)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,of(e,n))));break;case 19:ln(t,e),rn(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),rn(e)}}function rn(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(oj(a)){n=a;break}a=a.return}if(n==null)throw Error(Z(160));switch(n.tag){case 27:var l=n.stateNode,r=lf(e);nu(e,r,l);break;case 5:var i=n.stateNode;n.flags&32&&(dr(i,""),n.flags&=-33);var o=lf(e);nu(e,o,i);break;case 3:case 4:var c=n.stateNode.containerInfo,d=lf(e);_h(e,d,c);break;default:throw Error(Z(161))}}catch(f){Ke(e,e.return,f)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pj(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pj(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function sa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)uj(e,t.alternate,t),t=t.sibling}function Ka(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Aa(4,t,t.return),Ka(t);break;case 1:fs(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&rj(t,t.return,n),Ka(t);break;case 27:Ti(t.stateNode);case 26:case 5:fs(t,t.return),Ka(t);break;case 22:t.memoizedState===null&&Ka(t);break;case 30:Ka(t);break;default:Ka(t)}e=e.sibling}}function ia(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,l=e,r=t,i=r.flags;switch(r.tag){case 0:case 11:case 15:ia(l,r,n),vo(4,r);break;case 1:if(ia(l,r,n),a=r,l=a.stateNode,typeof l.componentDidMount=="function")try{l.componentDidMount()}catch(d){Ke(a,a.return,d)}if(a=r,l=a.updateQueue,l!==null){var o=a.stateNode;try{var c=l.shared.hiddenCallbacks;if(c!==null)for(l.shared.hiddenCallbacks=null,l=0;l<c.length;l++)ub(c[l],o)}catch(d){Ke(a,a.return,d)}}n&&i&64&&lj(r),ki(r,r.return);break;case 27:cj(r);case 26:case 5:ia(l,r,n),n&&a===null&&i&4&&ij(r),ki(r,r.return);break;case 12:ia(l,r,n);break;case 13:ia(l,r,n),n&&i&4&&hj(l,r);break;case 22:r.memoizedState===null&&ia(l,r,n),ki(r,r.return);break;case 30:break;default:ia(l,r,n)}t=t.sibling}}function Wm(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&&mo(n))}function Jm(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mo(e))}function os(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xj(e,t,n,a),t=t.sibling}function xj(e,t,n,a){var l=t.flags;switch(t.tag){case 0:case 11:case 15:os(e,t,n,a),l&2048&&vo(9,t);break;case 1:os(e,t,n,a);break;case 3:os(e,t,n,a),l&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mo(e)));break;case 12:if(l&2048){os(e,t,n,a),e=t.stateNode;try{var r=t.memoizedProps,i=r.id,o=r.onPostCommit;typeof o=="function"&&o(i,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(c){Ke(t,t.return,c)}}else os(e,t,n,a);break;case 13:os(e,t,n,a);break;case 23:break;case 22:r=t.stateNode,i=t.alternate,t.memoizedState!==null?r._visibility&2?os(e,t,n,a):Si(e,t):r._visibility&2?os(e,t,n,a):(r._visibility|=2,Dl(e,t,n,a,(t.subtreeFlags&10256)!==0)),l&2048&&Wm(i,t);break;case 24:os(e,t,n,a),l&2048&&Jm(t.alternate,t);break;default:os(e,t,n,a)}}function Dl(e,t,n,a,l){for(l=l&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var r=e,i=t,o=n,c=a,d=i.flags;switch(i.tag){case 0:case 11:case 15:Dl(r,i,o,c,l),vo(8,i);break;case 23:break;case 22:var f=i.stateNode;i.memoizedState!==null?f._visibility&2?Dl(r,i,o,c,l):Si(r,i):(f._visibility|=2,Dl(r,i,o,c,l)),l&&d&2048&&Wm(i.alternate,i);break;case 24:Dl(r,i,o,c,l),l&&d&2048&&Jm(i.alternate,i);break;default:Dl(r,i,o,c,l)}t=t.sibling}}function Si(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,l=a.flags;switch(a.tag){case 22:Si(n,a),l&2048&&Wm(a.alternate,a);break;case 24:Si(n,a),l&2048&&Jm(a.alternate,a);break;default:Si(n,a)}t=t.sibling}}var ii=8192;function wl(e){if(e.subtreeFlags&ii)for(e=e.child;e!==null;)gj(e),e=e.sibling}function gj(e){switch(e.tag){case 26:wl(e),e.flags&ii&&e.memoizedState!==null&&uC(Yn,e.memoizedState,e.memoizedProps);break;case 5:wl(e);break;case 3:case 4:var t=Yn;Yn=cu(e.stateNode.containerInfo),wl(e),Yn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=ii,ii=16777216,wl(e),ii=t):wl(e));break;default:wl(e)}}function vj(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Wr(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,bj(a,e)}vj(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yj(e),e=e.sibling}function yj(e){switch(e.tag){case 0:case 11:case 15:Wr(e),e.flags&2048&&Aa(9,e,e.return);break;case 3:Wr(e);break;case 12:Wr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,kc(e)):Wr(e);break;default:Wr(e)}}function kc(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,bj(a,e)}vj(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Aa(8,t,t.return),kc(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,kc(t));break;default:kc(t)}e=e.sibling}}function bj(e,t){for(;Et!==null;){var n=Et;switch(n.tag){case 0:case 11:case 15:Aa(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:mo(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Et=a;else e:for(n=e;Et!==null;){a=Et;var l=a.sibling,r=a.return;if(dj(a),a===n){Et=null;break e}if(l!==null){l.return=r,Et=l;break e}Et=r}}}var S2={getCacheForType:function(e){var t=It(Nt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n}},C2=typeof WeakMap=="function"?WeakMap:Map,qe=0,We=null,Ae=null,$e=0,Pe=0,cn=null,ga=!1,Tr=!1,ep=!1,Ks=0,ut=0,Ma=0,nl=0,tp=0,Rn=0,xr=0,Ci=null,Zt=null,wh=!1,np=0,su=1/0,au=null,Na=null,Dt=0,ka=null,gr=null,sr=0,Nh=0,kh=null,jj=null,Ri=0,Sh=null;function mn(){if(qe&2&&$e!==0)return $e&-$e;if(je.T!==null){var e=fr;return e!==0?e:ap()}return My()}function _j(){Rn===0&&(Rn=!($e&536870912)||Le?Ry():536870912);var e=On.current;return e!==null&&(e.flags|=32),Rn}function pn(e,t,n){(e===We&&(Pe===2||Pe===9)||e.cancelPendingCommit!==null)&&(vr(e,0),va(e,$e,Rn,!1)),oo(e,n),(!(qe&2)||e!==We)&&(e===We&&(!(qe&2)&&(nl|=n),ut===4&&va(e,$e,Rn,!1)),ws(e))}function wj(e,t,n){if(qe&6)throw Error(Z(327));var a=!n&&(t&124)===0&&(t&e.expiredLanes)===0||io(e,t),l=a?E2(e,t):cf(e,t,!0),r=a;do{if(l===0){Tr&&!a&&va(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!R2(n)){l=cf(e,t,!1),r=!1;continue}if(l===2){if(r=t,e.errorRecoveryDisabledLanes&r)var i=0;else i=e.pendingLanes&-536870913,i=i!==0?i:i&536870912?536870912:0;if(i!==0){t=i;e:{var o=e;l=Ci;var c=o.current.memoizedState.isDehydrated;if(c&&(vr(o,i).flags|=256),i=cf(o,i,!1),i!==2){if(ep&&!c){o.errorRecoveryDisabledLanes|=r,nl|=r,l=4;break e}r=Zt,Zt=l,r!==null&&(Zt===null?Zt=r:Zt.push.apply(Zt,r))}l=i}if(r=!1,l!==2)continue}}if(l===1){vr(e,0),va(e,t,0,!0);break}e:{switch(a=e,r=l,r){case 0:case 1:throw Error(Z(345));case 4:if((t&4194048)!==t)break;case 6:va(a,t,Rn,!ga);break e;case 2:Zt=null;break;case 3:case 5:break;default:throw Error(Z(329))}if((t&62914560)===t&&(l=np+300-xs(),10<l)){if(va(a,t,Rn,!ga),zu(a,0,!0)!==0)break e;a.timeoutHandle=Pj(_g.bind(null,a,n,Zt,au,wh,t,Rn,nl,xr,ga,r,2,-0,0),l);break e}_g(a,n,Zt,au,wh,t,Rn,nl,xr,ga,r,0,-0,0)}}break}while(!0);ws(e)}function _g(e,t,n,a,l,r,i,o,c,d,f,h,m,x){if(e.timeoutHandle=-1,h=t.subtreeFlags,(h&8192||(h&16785408)===16785408)&&(Pi={stylesheets:null,count:0,unsuspend:cC},gj(t),h=dC(),h!==null)){e.cancelPendingCommit=h(Ng.bind(null,e,t,r,n,a,l,i,o,c,f,1,m,x)),va(e,r,i,!d);return}Ng(e,t,r,n,a,l,i,o,c)}function R2(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var l=n[a],r=l.getSnapshot;l=l.value;try{if(!gn(r(),l))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function va(e,t,n,a){t&=~tp,t&=~nl,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var l=t;0<l;){var r=31-hn(l),i=1<<r;a[r]=-1,l&=~i}n!==0&&Ey(e,n,t)}function Yu(){return qe&6?!0:(yo(0),!1)}function sp(){if(Ae!==null){if(Pe===0)var e=Ae.return;else e=Ae,Ps=vl=null,qm(e),nr=null,Bi=0,e=Ae;for(;e!==null;)aj(e.alternate,e),e=e.return;Ae=null}}function vr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Y2(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),sp(),We=e,Ae=n=Gs(e.current,null),$e=t,Pe=0,cn=null,ga=!1,Tr=io(e,t),ep=!1,xr=Rn=tp=nl=Ma=ut=0,Zt=Ci=null,wh=!1,t&8&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-hn(a),r=1<<l;t|=e[l],a&=~r}return Ks=t,Hu(),n}function Nj(e,t){Te=null,je.H=Zc,t===po||t===Pu?(t=eg(),Pe=3):t===ob?(t=eg(),Pe=4):Pe=t===Wb?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,cn=t,Ae===null&&(ut=1,eu(e,Cn(t,e.current)))}function kj(){var e=je.H;return je.H=Zc,e===null?Zc:e}function Sj(){var e=je.A;return je.A=S2,e}function Ch(){ut=4,ga||($e&4194048)!==$e&&On.current!==null||(Tr=!0),!(Ma&134217727)&&!(nl&134217727)||We===null||va(We,$e,Rn,!1)}function cf(e,t,n){var a=qe;qe|=2;var l=kj(),r=Sj();(We!==e||$e!==t)&&(au=null,vr(e,t)),t=!1;var i=ut;e:do try{if(Pe!==0&&Ae!==null){var o=Ae,c=cn;switch(Pe){case 8:sp(),i=6;break e;case 3:case 2:case 9:case 6:On.current===null&&(t=!0);var d=Pe;if(Pe=0,cn=null,Xl(e,o,c,d),n&&Tr){i=0;break e}break;default:d=Pe,Pe=0,cn=null,Xl(e,o,c,d)}}T2(),i=ut;break}catch(f){Nj(e,f)}while(!0);return t&&e.shellSuspendCounter++,Ps=vl=null,qe=a,je.H=l,je.A=r,Ae===null&&(We=null,$e=0,Hu()),i}function T2(){for(;Ae!==null;)Cj(Ae)}function E2(e,t){var n=qe;qe|=2;var a=kj(),l=Sj();We!==e||$e!==t?(au=null,su=xs()+500,vr(e,t)):Tr=io(e,t);e:do try{if(Pe!==0&&Ae!==null){t=Ae;var r=cn;t:switch(Pe){case 1:Pe=0,cn=null,Xl(e,t,r,1);break;case 2:case 9:if(Jx(r)){Pe=0,cn=null,wg(t);break}t=function(){Pe!==2&&Pe!==9||We!==e||(Pe=7),ws(e)},r.then(t,t);break e;case 3:Pe=7;break e;case 4:Pe=5;break e;case 7:Jx(r)?(Pe=0,cn=null,wg(t)):(Pe=0,cn=null,Xl(e,t,r,7));break;case 5:var i=null;switch(Ae.tag){case 26:i=Ae.memoizedState;case 5:case 27:var o=Ae;if(!i||Yj(i)){Pe=0,cn=null;var c=o.sibling;if(c!==null)Ae=c;else{var d=o.return;d!==null?(Ae=d,Fu(d)):Ae=null}break t}}Pe=0,cn=null,Xl(e,t,r,5);break;case 6:Pe=0,cn=null,Xl(e,t,r,6);break;case 8:sp(),ut=6;break e;default:throw Error(Z(462))}}A2();break}catch(f){Nj(e,f)}while(!0);return Ps=vl=null,je.H=a,je.A=l,qe=n,Ae!==null?0:(We=null,$e=0,Hu(),ut)}function A2(){for(;Ae!==null&&!J1();)Cj(Ae)}function Cj(e){var t=sj(e.alternate,e,Ks);e.memoizedProps=e.pendingProps,t===null?Fu(e):Ae=t}function wg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=xg(n,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=xg(n,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:qm(t);default:aj(n,t),t=Ae=ab(t,Ks),t=sj(n,t,Ks)}e.memoizedProps=e.pendingProps,t===null?Fu(e):Ae=t}function Xl(e,t,n,a){Ps=vl=null,qm(t),nr=null,Bi=0;var l=t.return;try{if(b2(e,l,t,n,$e)){ut=1,eu(e,Cn(n,e.current)),Ae=null;return}}catch(r){if(l!==null)throw Ae=l,r;ut=1,eu(e,Cn(n,e.current)),Ae=null;return}t.flags&32768?(Le||a===1?e=!0:Tr||$e&536870912?e=!1:(ga=e=!0,(a===2||a===9||a===3||a===6)&&(a=On.current,a!==null&&a.tag===13&&(a.flags|=16384))),Rj(t,e)):Fu(t)}function Fu(e){var t=e;do{if(t.flags&32768){Rj(t,ga);return}e=t.return;var n=_2(t.alternate,t,Ks);if(n!==null){Ae=n;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);ut===0&&(ut=5)}function Rj(e,t){do{var n=w2(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);ut=6,Ae=null}function Ng(e,t,n,a,l,r,i,o,c){e.cancelPendingCommit=null;do Xu();while(Dt!==0);if(qe&6)throw Error(Z(327));if(t!==null){if(t===e.current)throw Error(Z(177));if(r=t.lanes|t.childLanes,r|=Em,cS(e,n,r,i,o,c),e===We&&(Ae=We=null,$e=0),gr=t,ka=e,sr=n,Nh=r,kh=l,jj=a,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,D2(Ic,function(){return Oj(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,t.subtreeFlags&13878||a){a=je.T,je.T=null,l=Ue.p,Ue.p=2,i=qe,qe|=4;try{N2(e,t,n)}finally{qe=i,Ue.p=l,je.T=a}}Dt=1,Tj(),Ej(),Aj()}}function Tj(){if(Dt===1){Dt=0;var e=ka,t=gr,n=(t.flags&13878)!==0;if(t.subtreeFlags&13878||n){n=je.T,je.T=null;var a=Ue.p;Ue.p=2;var l=qe;qe|=4;try{mj(t,e);var r=Ah,i=Qy(e.containerInfo),o=r.focusedElem,c=r.selectionRange;if(i!==o&&o&&o.ownerDocument&&Ky(o.ownerDocument.documentElement,o)){if(c!==null&&Tm(o)){var d=c.start,f=c.end;if(f===void 0&&(f=d),"selectionStart"in o)o.selectionStart=d,o.selectionEnd=Math.min(f,o.value.length);else{var h=o.ownerDocument||document,m=h&&h.defaultView||window;if(m.getSelection){var x=m.getSelection(),j=o.textContent.length,v=Math.min(c.start,j),y=c.end===void 0?v:Math.min(c.end,j);!x.extend&&v>y&&(i=y,y=v,v=i);var g=Vx(o,v),p=Vx(o,y);if(g&&p&&(x.rangeCount!==1||x.anchorNode!==g.node||x.anchorOffset!==g.offset||x.focusNode!==p.node||x.focusOffset!==p.offset)){var b=h.createRange();b.setStart(g.node,g.offset),x.removeAllRanges(),v>y?(x.addRange(b),x.extend(p.node,p.offset)):(b.setEnd(p.node,p.offset),x.addRange(b))}}}}for(h=[],x=o;x=x.parentNode;)x.nodeType===1&&h.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<h.length;o++){var _=h[o];_.element.scrollLeft=_.left,_.element.scrollTop=_.top}}fu=!!Eh,Ah=Eh=null}finally{qe=l,Ue.p=a,je.T=n}}e.current=t,Dt=2}}function Ej(){if(Dt===2){Dt=0;var e=ka,t=gr,n=(t.flags&8772)!==0;if(t.subtreeFlags&8772||n){n=je.T,je.T=null;var a=Ue.p;Ue.p=2;var l=qe;qe|=4;try{uj(e,t.alternate,t)}finally{qe=l,Ue.p=a,je.T=n}}Dt=3}}function Aj(){if(Dt===4||Dt===3){Dt=0,eS();var e=ka,t=gr,n=sr,a=jj;t.subtreeFlags&10256||t.flags&10256?Dt=5:(Dt=0,gr=ka=null,Mj(e,e.pendingLanes));var l=e.pendingLanes;if(l===0&&(Na=null),_m(n),t=t.stateNode,fn&&typeof fn.onCommitFiberRoot=="function")try{fn.onCommitFiberRoot(ro,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=je.T,l=Ue.p,Ue.p=2,je.T=null;try{for(var r=e.onRecoverableError,i=0;i<a.length;i++){var o=a[i];r(o.value,{componentStack:o.stack})}}finally{je.T=t,Ue.p=l}}sr&3&&Xu(),ws(e),l=e.pendingLanes,n&4194090&&l&42?e===Sh?Ri++:(Ri=0,Sh=e):Ri=0,yo(0)}}function Mj(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mo(t)))}function Xu(e){return Tj(),Ej(),Aj(),Oj()}function Oj(){if(Dt!==5)return!1;var e=ka,t=Nh;Nh=0;var n=_m(sr),a=je.T,l=Ue.p;try{Ue.p=32>n?32:n,je.T=null,n=kh,kh=null;var r=ka,i=sr;if(Dt=0,gr=ka=null,sr=0,qe&6)throw Error(Z(331));var o=qe;if(qe|=4,yj(r.current),xj(r,r.current,i,n),qe=o,yo(0,!1),fn&&typeof fn.onPostCommitFiberRoot=="function")try{fn.onPostCommitFiberRoot(ro,r)}catch{}return!0}finally{Ue.p=l,je.T=a,Mj(e,t)}}function kg(e,t,n){t=Cn(n,t),t=yh(e.stateNode,t,2),e=wa(e,t,2),e!==null&&(oo(e,2),ws(e))}function Ke(e,t,n){if(e.tag===3)kg(e,e,n);else for(;t!==null;){if(t.tag===3){kg(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Na===null||!Na.has(a))){e=Cn(n,e),n=Qb(2),a=wa(t,n,2),a!==null&&(Zb(n,a,t,e),oo(a,2),ws(a));break}}t=t.return}}function uf(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new C2;var l=new Set;a.set(t,l)}else l=a.get(t),l===void 0&&(l=new Set,a.set(t,l));l.has(n)||(ep=!0,l.add(n),e=M2.bind(null,e,t,n),t.then(e,e))}function M2(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,We===e&&($e&n)===n&&(ut===4||ut===3&&($e&62914560)===$e&&300>xs()-np?!(qe&2)&&vr(e,0):tp|=n,xr===$e&&(xr=0)),ws(e)}function $j(e,t){t===0&&(t=Ty()),e=Rr(e,t),e!==null&&(oo(e,t),ws(e))}function O2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$j(e,n)}function $2(e,t){var n=0;switch(e.tag){case 13:var a=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(Z(314))}a!==null&&a.delete(t),$j(e,n)}function D2(e,t){return bm(e,t)}var lu=null,zl=null,Rh=!1,ru=!1,df=!1,sl=0;function ws(e){e!==zl&&e.next===null&&(zl===null?lu=zl=e:zl=zl.next=e),ru=!0,Rh||(Rh=!0,L2())}function yo(e,t){if(!df&&ru){df=!0;do for(var n=!1,a=lu;a!==null;){if(e!==0){var l=a.pendingLanes;if(l===0)var r=0;else{var i=a.suspendedLanes,o=a.pingedLanes;r=(1<<31-hn(42|e)+1)-1,r&=l&~(i&~o),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Sg(a,r))}else r=$e,r=zu(a,a===We?r:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),!(r&3)||io(a,r)||(n=!0,Sg(a,r));a=a.next}while(n);df=!1}}function z2(){Dj()}function Dj(){ru=Rh=!1;var e=0;sl!==0&&(V2()&&(e=sl),sl=0);for(var t=xs(),n=null,a=lu;a!==null;){var l=a.next,r=zj(a,t);r===0?(a.next=null,n===null?lu=l:n.next=l,l===null&&(zl=n)):(n=a,(e!==0||r&3)&&(ru=!0)),a=l}yo(e)}function zj(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,l=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var i=31-hn(r),o=1<<i,c=l[i];c===-1?(!(o&n)||o&a)&&(l[i]=oS(o,t)):c<=t&&(e.expiredLanes|=o),r&=~o}if(t=We,n=$e,n=zu(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)||io(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&zd(a),_m(n)){case 2:case 8:n=Sy;break;case 32:n=Ic;break;case 268435456:n=Cy;break;default:n=Ic}return a=Lj.bind(null,e),n=bm(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&zd(a),e.callbackPriority=2,e.callbackNode=null,2}function Lj(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Xu()&&e.callbackNode!==n)return null;var a=$e;return a=zu(e,e===We?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(wj(e,a,t),zj(e,xs()),e.callbackNode!=null&&e.callbackNode===n?Lj.bind(null,e):null)}function Sg(e,t){if(Xu())return null;wj(e,t,!0)}function L2(){F2(function(){qe&6?bm(ky,z2):Dj()})}function ap(){return sl===0&&(sl=Ry()),sl}function Cg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gc(""+e)}function Rg(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 U2(e,t,n,a,l){if(t==="submit"&&n&&n.stateNode===l){var r=Cg((l[Jt]||null).action),i=a.submitter;i&&(t=(t=i[Jt]||null)?Cg(t.formAction):i.getAttribute("formAction"),t!==null&&(r=t,i=null));var o=new Lu("action","action",null,a,l);e.push({event:o,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(sl!==0){var c=i?Rg(l,i):new FormData(l);gh(n,{pending:!0,data:c,method:l.method,action:r},null,c)}}else typeof r=="function"&&(o.preventDefault(),c=i?Rg(l,i):new FormData(l),gh(n,{pending:!0,data:c,method:l.method,action:r},r,c))},currentTarget:l}]})}}for(var ff=0;ff<lh.length;ff++){var hf=lh[ff],B2=hf.toLowerCase(),H2=hf[0].toUpperCase()+hf.slice(1);ss(B2,"on"+H2)}ss(Wy,"onAnimationEnd");ss(Jy,"onAnimationIteration");ss(eb,"onAnimationStart");ss("dblclick","onDoubleClick");ss("focusin","onFocus");ss("focusout","onBlur");ss(s2,"onTransitionRun");ss(a2,"onTransitionStart");ss(l2,"onTransitionCancel");ss(tb,"onTransitionEnd");ur("onMouseEnter",["mouseout","mouseover"]);ur("onMouseLeave",["mouseout","mouseover"]);ur("onPointerEnter",["pointerout","pointerover"]);ur("onPointerLeave",["pointerout","pointerover"]);pl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));pl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));pl("onBeforeInput",["compositionend","keypress","textInput","paste"]);pl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));pl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));pl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hi="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(" "),I2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hi));function Uj(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],l=a.event;a=a.listeners;e:{var r=void 0;if(t)for(var i=a.length-1;0<=i;i--){var o=a[i],c=o.instance,d=o.currentTarget;if(o=o.listener,c!==r&&l.isPropagationStopped())break e;r=o,l.currentTarget=d;try{r(l)}catch(f){Jc(f)}l.currentTarget=null,r=c}else for(i=0;i<a.length;i++){if(o=a[i],c=o.instance,d=o.currentTarget,o=o.listener,c!==r&&l.isPropagationStopped())break e;r=o,l.currentTarget=d;try{r(l)}catch(f){Jc(f)}l.currentTarget=null,r=c}}}}function Ee(e,t){var n=t[Wf];n===void 0&&(n=t[Wf]=new Set);var a=e+"__bubble";n.has(a)||(Bj(t,e,2,!1),n.add(a))}function mf(e,t,n){var a=0;t&&(a|=4),Bj(n,e,a,t)}var Qo="_reactListening"+Math.random().toString(36).slice(2);function lp(e){if(!e[Qo]){e[Qo]=!0,Oy.forEach(function(n){n!=="selectionchange"&&(I2.has(n)||mf(n,!1,e),mf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Qo]||(t[Qo]=!0,mf("selectionchange",!1,t))}}function Bj(e,t,n,a){switch(Zj(t)){case 2:var l=mC;break;case 8:l=pC;break;default:l=cp}n=l.bind(null,t,n,e),l=void 0,!nh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(l=!0),a?l!==void 0?e.addEventListener(t,n,{capture:!0,passive:l}):e.addEventListener(t,n,!0):l!==void 0?e.addEventListener(t,n,{passive:l}):e.addEventListener(t,n,!1)}function pf(e,t,n,a,l){var r=a;if(!(t&1)&&!(t&2)&&a!==null)e:for(;;){if(a===null)return;var i=a.tag;if(i===3||i===4){var o=a.stateNode.containerInfo;if(o===l)break;if(i===4)for(i=a.return;i!==null;){var c=i.tag;if((c===3||c===4)&&i.stateNode.containerInfo===l)return;i=i.return}for(;o!==null;){if(i=Bl(o),i===null)return;if(c=i.tag,c===5||c===6||c===26||c===27){a=r=i;continue e}o=o.parentNode}}a=a.return}Iy(function(){var d=r,f=km(n),h=[];e:{var m=nb.get(e);if(m!==void 0){var x=Lu,j=e;switch(e){case"keypress":if(yc(n)===0)break e;case"keydown":case"keyup":x=DS;break;case"focusin":j="focus",x=Gd;break;case"focusout":j="blur",x=Gd;break;case"beforeblur":case"afterblur":x=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":x=Dx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=wS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=US;break;case Wy:case Jy:case eb:x=SS;break;case tb:x=HS;break;case"scroll":case"scrollend":x=jS;break;case"wheel":x=PS;break;case"copy":case"cut":case"paste":x=RS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Lx;break;case"toggle":case"beforetoggle":x=GS}var v=(t&4)!==0,y=!v&&(e==="scroll"||e==="scrollend"),g=v?m!==null?m+"Capture":null:m;v=[];for(var p=d,b;p!==null;){var _=p;if(b=_.stateNode,_=_.tag,_!==5&&_!==26&&_!==27||b===null||g===null||(_=$i(p,g),_!=null&&v.push(Ii(p,_,b))),y)break;p=p.return}0<v.length&&(m=new x(m,j,null,n,f),h.push({event:m,listeners:v}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",m&&n!==th&&(j=n.relatedTarget||n.fromElement)&&(Bl(j)||j[Sr]))break e;if((x||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,x?(j=n.relatedTarget||n.toElement,x=d,j=j?Bl(j):null,j!==null&&(y=lo(j),v=j.tag,j!==y||v!==5&&v!==27&&v!==6)&&(j=null)):(x=null,j=d),x!==j)){if(v=Dx,_="onMouseLeave",g="onMouseEnter",p="mouse",(e==="pointerout"||e==="pointerover")&&(v=Lx,_="onPointerLeave",g="onPointerEnter",p="pointer"),y=x==null?m:ri(x),b=j==null?m:ri(j),m=new v(_,p+"leave",x,n,f),m.target=y,m.relatedTarget=b,_=null,Bl(f)===d&&(v=new v(g,p+"enter",j,n,f),v.target=b,v.relatedTarget=y,_=v),y=_,x&&j)t:{for(v=x,g=j,p=0,b=v;b;b=Nl(b))p++;for(b=0,_=g;_;_=Nl(_))b++;for(;0<p-b;)v=Nl(v),p--;for(;0<b-p;)g=Nl(g),b--;for(;p--;){if(v===g||g!==null&&v===g.alternate)break t;v=Nl(v),g=Nl(g)}v=null}else v=null;x!==null&&Tg(h,m,x,v,!1),j!==null&&y!==null&&Tg(h,y,j,v,!0)}}e:{if(m=d?ri(d):window,x=m.nodeName&&m.nodeName.toLowerCase(),x==="select"||x==="input"&&m.type==="file")var N=Ix;else if(Hx(m))if(Fy)N=e2;else{N=WS;var R=ZS}else x=m.nodeName,!x||x.toLowerCase()!=="input"||m.type!=="checkbox"&&m.type!=="radio"?d&&Nm(d.elementType)&&(N=Ix):N=JS;if(N&&(N=N(e,d))){Yy(h,N,n,f);break e}R&&R(e,m,d),e==="focusout"&&d&&m.type==="number"&&d.memoizedProps.value!=null&&eh(m,"number",m.value)}switch(R=d?ri(d):window,e){case"focusin":(Hx(R)||R.contentEditable==="true")&&(Pl=R,sh=d,vi=null);break;case"focusout":vi=sh=Pl=null;break;case"mousedown":ah=!0;break;case"contextmenu":case"mouseup":case"dragend":ah=!1,Yx(h,n,f);break;case"selectionchange":if(n2)break;case"keydown":case"keyup":Yx(h,n,f)}var w;if(Rm)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Il?Gy(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(qy&&n.locale!=="ko"&&(Il||k!=="onCompositionStart"?k==="onCompositionEnd"&&Il&&(w=Py()):(xa=f,Sm="value"in xa?xa.value:xa.textContent,Il=!0)),R=iu(d,k),0<R.length&&(k=new zx(k,e,null,n,f),h.push({event:k,listeners:R}),w?k.data=w:(w=Vy(n),w!==null&&(k.data=w)))),(w=YS?FS(e,n):XS(e,n))&&(k=iu(d,"onBeforeInput"),0<k.length&&(R=new zx("onBeforeInput","beforeinput",null,n,f),h.push({event:R,listeners:k}),R.data=w)),U2(h,e,d,n,f)}Uj(h,t)})}function Ii(e,t,n){return{instance:e,listener:t,currentTarget:n}}function iu(e,t){for(var n=t+"Capture",a=[];e!==null;){var l=e,r=l.stateNode;if(l=l.tag,l!==5&&l!==26&&l!==27||r===null||(l=$i(e,n),l!=null&&a.unshift(Ii(e,l,r)),l=$i(e,t),l!=null&&a.push(Ii(e,l,r))),e.tag===3)return a;e=e.return}return[]}function Nl(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Tg(e,t,n,a,l){for(var r=t._reactName,i=[];n!==null&&n!==a;){var o=n,c=o.alternate,d=o.stateNode;if(o=o.tag,c!==null&&c===a)break;o!==5&&o!==26&&o!==27||d===null||(c=d,l?(d=$i(n,r),d!=null&&i.unshift(Ii(n,d,c))):l||(d=$i(n,r),d!=null&&i.push(Ii(n,d,c)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var P2=/\r\n?/g,q2=/\u0000|\uFFFD/g;function Eg(e){return(typeof e=="string"?e:""+e).replace(P2,`
|
|
49
|
-
`).replace(q2,"")}function Hj(e,t){return t=Eg(t),Eg(e)===t}function Ku(){}function Fe(e,t,n,a,l,r){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||dr(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&dr(e,""+a);break;case"className":qo(e,"class",a);break;case"tabIndex":qo(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":qo(e,n,a);break;case"style":Hy(e,a,r);break;case"data":if(t!=="object"){qo(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=gc(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="formAction"?(t!=="input"&&Fe(e,t,"name",l.name,l,null),Fe(e,t,"formEncType",l.formEncType,l,null),Fe(e,t,"formMethod",l.formMethod,l,null),Fe(e,t,"formTarget",l.formTarget,l,null)):(Fe(e,t,"encType",l.encType,l,null),Fe(e,t,"method",l.method,l,null),Fe(e,t,"target",l.target,l,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=gc(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Ku);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(Z(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(Z(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=gc(""+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),xc(e,"popover",a);break;case"xlinkActuate":As(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":As(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":As(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":As(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":As(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":As(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":As(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":As(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":As(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":xc(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=yS.get(n)||n,xc(e,n,a))}}function Th(e,t,n,a,l,r){switch(n){case"style":Hy(e,a,r);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(Z(61));if(n=a.__html,n!=null){if(l.children!=null)throw Error(Z(60));e.innerHTML=n}}break;case"children":typeof a=="string"?dr(e,a):(typeof a=="number"||typeof a=="bigint")&&dr(e,""+a);break;case"onScroll":a!=null&&Ee("scroll",e);break;case"onScrollEnd":a!=null&&Ee("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Ku);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$y.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(l=n.endsWith("Capture"),t=n.slice(2,l?n.length-7:void 0),r=e[Jt]||null,r=r!=null?r[n]:null,typeof r=="function"&&e.removeEventListener(t,r,l),typeof a=="function")){typeof r!="function"&&r!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,l);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):xc(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,l=!1,r;for(r in n)if(n.hasOwnProperty(r)){var i=n[r];if(i!=null)switch(r){case"src":a=!0;break;case"srcSet":l=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(Z(137,t));default:Fe(e,t,r,i,n,null)}}l&&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=r=i=l=null,c=null,d=null;for(a in n)if(n.hasOwnProperty(a)){var f=n[a];if(f!=null)switch(a){case"name":l=f;break;case"type":i=f;break;case"checked":c=f;break;case"defaultChecked":d=f;break;case"value":r=f;break;case"defaultValue":o=f;break;case"children":case"dangerouslySetInnerHTML":if(f!=null)throw Error(Z(137,t));break;default:Fe(e,t,a,f,n,null)}}Ly(e,r,o,c,d,i,l,!1),Pc(e);return;case"select":Ee("invalid",e),a=i=r=null;for(l in n)if(n.hasOwnProperty(l)&&(o=n[l],o!=null))switch(l){case"value":r=o;break;case"defaultValue":i=o;break;case"multiple":a=o;default:Fe(e,t,l,o,n,null)}t=r,n=i,e.multiple=!!a,t!=null?Zl(e,!!a,t,!1):n!=null&&Zl(e,!!a,n,!0);return;case"textarea":Ee("invalid",e),r=l=a=null;for(i in n)if(n.hasOwnProperty(i)&&(o=n[i],o!=null))switch(i){case"value":a=o;break;case"defaultValue":l=o;break;case"children":r=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(Z(91));break;default:Fe(e,t,i,o,n,null)}By(e,a,l,r),Pc(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<Hi.length;a++)Ee(Hi[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(Z(137,t));default:Fe(e,t,d,a,n,null)}return;default:if(Nm(t)){for(f in n)n.hasOwnProperty(f)&&(a=n[f],a!==void 0&&Th(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 G2(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var l=null,r=null,i=null,o=null,c=null,d=null,f=null;for(x in n){var h=n[x];if(n.hasOwnProperty(x)&&h!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":c=h;default:a.hasOwnProperty(x)||Fe(e,t,x,null,a,h)}}for(var m in a){var x=a[m];if(h=n[m],a.hasOwnProperty(m)&&(x!=null||h!=null))switch(m){case"type":r=x;break;case"name":l=x;break;case"checked":d=x;break;case"defaultChecked":f=x;break;case"value":i=x;break;case"defaultValue":o=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(Z(137,t));break;default:x!==h&&Fe(e,t,m,x,a,h)}}Jf(e,i,o,c,d,f,r,l);return;case"select":x=i=o=m=null;for(r in n)if(c=n[r],n.hasOwnProperty(r)&&c!=null)switch(r){case"value":break;case"multiple":x=c;default:a.hasOwnProperty(r)||Fe(e,t,r,null,a,c)}for(l in a)if(r=a[l],c=n[l],a.hasOwnProperty(l)&&(r!=null||c!=null))switch(l){case"value":m=r;break;case"defaultValue":o=r;break;case"multiple":i=r;default:r!==c&&Fe(e,t,l,r,a,c)}t=o,n=i,a=x,m!=null?Zl(e,!!n,m,!1):!!a!=!!n&&(t!=null?Zl(e,!!n,t,!0):Zl(e,!!n,n?[]:"",!1));return;case"textarea":x=m=null;for(o in n)if(l=n[o],n.hasOwnProperty(o)&&l!=null&&!a.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Fe(e,t,o,null,a,l)}for(i in a)if(l=a[i],r=n[i],a.hasOwnProperty(i)&&(l!=null||r!=null))switch(i){case"value":m=l;break;case"defaultValue":x=l;break;case"children":break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(Z(91));break;default:l!==r&&Fe(e,t,i,l,a,r)}Uy(e,m,x);return;case"option":for(var j in n)if(m=n[j],n.hasOwnProperty(j)&&m!=null&&!a.hasOwnProperty(j))switch(j){case"selected":e.selected=!1;break;default:Fe(e,t,j,null,a,m)}for(c in a)if(m=a[c],x=n[c],a.hasOwnProperty(c)&&m!==x&&(m!=null||x!=null))switch(c){case"selected":e.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Fe(e,t,c,m,a,x)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var v in n)m=n[v],n.hasOwnProperty(v)&&m!=null&&!a.hasOwnProperty(v)&&Fe(e,t,v,null,a,m);for(d in a)if(m=a[d],x=n[d],a.hasOwnProperty(d)&&m!==x&&(m!=null||x!=null))switch(d){case"children":case"dangerouslySetInnerHTML":if(m!=null)throw Error(Z(137,t));break;default:Fe(e,t,d,m,a,x)}return;default:if(Nm(t)){for(var y in n)m=n[y],n.hasOwnProperty(y)&&m!==void 0&&!a.hasOwnProperty(y)&&Th(e,t,y,void 0,a,m);for(f in a)m=a[f],x=n[f],!a.hasOwnProperty(f)||m===x||m===void 0&&x===void 0||Th(e,t,f,m,a,x);return}}for(var g in n)m=n[g],n.hasOwnProperty(g)&&m!=null&&!a.hasOwnProperty(g)&&Fe(e,t,g,null,a,m);for(h in a)m=a[h],x=n[h],!a.hasOwnProperty(h)||m===x||m==null&&x==null||Fe(e,t,h,m,a,x)}var Eh=null,Ah=null;function ou(e){return e.nodeType===9?e:e.ownerDocument}function Ag(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ij(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Mh(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 V2(){var e=window.event;return e&&e.type==="popstate"?e===xf?!1:(xf=e,!0):(xf=null,!1)}var Pj=typeof setTimeout=="function"?setTimeout:void 0,Y2=typeof clearTimeout=="function"?clearTimeout:void 0,Mg=typeof Promise=="function"?Promise:void 0,F2=typeof queueMicrotask=="function"?queueMicrotask:typeof Mg<"u"?function(e){return Mg.resolve(null).then(e).catch(X2)}:Pj;function X2(e){setTimeout(function(){throw e})}function La(e){return e==="head"}function Og(e,t){var n=t,a=0,l=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(0<a&&8>a){n=a;var i=e.ownerDocument;if(n&1&&Ti(i.documentElement),n&2&&Ti(i.body),n&4)for(n=i.head,Ti(n),i=n.firstChild;i;){var o=i.nextSibling,c=i.nodeName;i[co]||c==="SCRIPT"||c==="STYLE"||c==="LINK"&&i.rel.toLowerCase()==="stylesheet"||n.removeChild(i),i=o}}if(l===0){e.removeChild(r),Yi(t);return}l--}else n==="$"||n==="$?"||n==="$!"?l++:a=n.charCodeAt(0)-48;else a=0;n=r}while(n);Yi(t)}function Oh(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":Oh(n),wm(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function K2(e,t,n,a){for(;e.nodeType===1;){var l=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[co])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==l.rel||e.getAttribute("href")!==(l.href==null||l.href===""?null:l.href)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin)||e.getAttribute("title")!==(l.title==null?null:l.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(l.src==null?null:l.src)||e.getAttribute("type")!==(l.type==null?null:l.type)||e.getAttribute("crossorigin")!==(l.crossOrigin==null?null:l.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=l.name==null?null:""+l.name;if(l.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Qn(e.nextSibling),e===null)break}return null}function Q2(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Qn(e.nextSibling),e===null))return null;return e}function $h(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState==="complete"}function Z2(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 Qn(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 Dh=null;function $g(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}function qj(e,t,n){switch(t=ou(n),e){case"html":if(e=t.documentElement,!e)throw Error(Z(452));return e;case"head":if(e=t.head,!e)throw Error(Z(453));return e;case"body":if(e=t.body,!e)throw Error(Z(454));return e;default:throw Error(Z(451))}}function Ti(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);wm(e)}var $n=new Map,Dg=new Set;function cu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ws=Ue.d;Ue.d={f:W2,r:J2,D:eC,C:tC,L:nC,m:sC,X:lC,S:aC,M:rC};function W2(){var e=Ws.f(),t=Yu();return e||t}function J2(e){var t=Cr(e);t!==null&&t.tag===5&&t.type==="form"?zb(t):Ws.r(e)}var Er=typeof document>"u"?null:document;function Gj(e,t,n){var a=Er;if(a&&typeof t=="string"&&t){var l=Sn(t);l='link[rel="'+e+'"][href="'+l+'"]',typeof n=="string"&&(l+='[crossorigin="'+n+'"]'),Dg.has(l)||(Dg.add(l),e={rel:e,crossOrigin:n,href:t},a.querySelector(l)===null&&(t=a.createElement("link"),zt(t,"link",e),At(t),a.head.appendChild(t)))}}function eC(e){Ws.D(e),Gj("dns-prefetch",e,null)}function tC(e,t){Ws.C(e,t),Gj("preconnect",e,t)}function nC(e,t,n){Ws.L(e,t,n);var a=Er;if(a&&e&&t){var l='link[rel="preload"][as="'+Sn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(l+='[imagesrcset="'+Sn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(l+='[imagesizes="'+Sn(n.imageSizes)+'"]')):l+='[href="'+Sn(e)+'"]';var r=l;switch(t){case"style":r=yr(e);break;case"script":r=Ar(e)}$n.has(r)||(e=Je({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),$n.set(r,e),a.querySelector(l)!==null||t==="style"&&a.querySelector(bo(r))||t==="script"&&a.querySelector(jo(r))||(t=a.createElement("link"),zt(t,"link",e),At(t),a.head.appendChild(t)))}}function sC(e,t){Ws.m(e,t);var n=Er;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",l='link[rel="modulepreload"][as="'+Sn(a)+'"][href="'+Sn(e)+'"]',r=l;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Ar(e)}if(!$n.has(r)&&(e=Je({rel:"modulepreload",href:e},t),$n.set(r,e),n.querySelector(l)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(jo(r)))return}a=n.createElement("link"),zt(a,"link",e),At(a),n.head.appendChild(a)}}}function aC(e,t,n){Ws.S(e,t,n);var a=Er;if(a&&e){var l=Ql(a).hoistableStyles,r=yr(e);t=t||"default";var i=l.get(r);if(!i){var o={loading:0,preload:null};if(i=a.querySelector(bo(r)))o.loading=5;else{e=Je({rel:"stylesheet",href:e,"data-precedence":t},n),(n=$n.get(r))&&rp(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,Sc(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:o},l.set(r,i)}}}function lC(e,t){Ws.X(e,t);var n=Er;if(n&&e){var a=Ql(n).hoistableScripts,l=Ar(e),r=a.get(l);r||(r=n.querySelector(jo(l)),r||(e=Je({src:e,async:!0},t),(t=$n.get(l))&&ip(e,t),r=n.createElement("script"),At(r),zt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(l,r))}}function rC(e,t){Ws.M(e,t);var n=Er;if(n&&e){var a=Ql(n).hoistableScripts,l=Ar(e),r=a.get(l);r||(r=n.querySelector(jo(l)),r||(e=Je({src:e,async:!0,type:"module"},t),(t=$n.get(l))&&ip(e,t),r=n.createElement("script"),At(r),zt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},a.set(l,r))}}function zg(e,t,n,a){var l=(l=ja.current)?cu(l):null;if(!l)throw Error(Z(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=yr(n.href),n=Ql(l).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=yr(n.href);var r=Ql(l).hoistableStyles,i=r.get(e);if(i||(l=l.ownerDocument||l,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,i),(r=l.querySelector(bo(e)))&&!r._p&&(i.instance=r,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),r||iC(l,e,n,i.state))),t&&a===null)throw Error(Z(528,""));return i}if(t&&a!==null)throw Error(Z(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ar(n),n=Ql(l).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(Z(444,e))}}function yr(e){return'href="'+Sn(e)+'"'}function bo(e){return'link[rel="stylesheet"]['+e+"]"}function Vj(e){return Je({},e,{"data-precedence":e.precedence,precedence:null})}function iC(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 Ar(e){return'[src="'+Sn(e)+'"]'}function jo(e){return"script[async]"+e}function Lg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Sn(n.href)+'"]');if(a)return t.instance=a,At(a),a;var l=Je({},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",l),Sc(a,n.precedence,e),t.instance=a;case"stylesheet":l=yr(n.href);var r=e.querySelector(bo(l));if(r)return t.state.loading|=4,t.instance=r,At(r),r;a=Vj(n),(l=$n.get(l))&&rp(a,l),r=(e.ownerDocument||e).createElement("link"),At(r);var i=r;return i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),zt(r,"link",a),t.state.loading|=4,Sc(r,n.precedence,e),t.instance=r;case"script":return r=Ar(n.src),(l=e.querySelector(jo(r)))?(t.instance=l,At(l),l):(a=n,(l=$n.get(r))&&(a=Je({},n),ip(a,l)),e=e.ownerDocument||e,l=e.createElement("script"),At(l),zt(l,"link",a),e.head.appendChild(l),t.instance=l);case"void":return null;default:throw Error(Z(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(a=t.instance,t.state.loading|=4,Sc(a,n.precedence,e));return t.instance}function Sc(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),l=a.length?a[a.length-1]:null,r=l,i=0;i<a.length;i++){var o=a[i];if(o.dataset.precedence===t)r=o;else if(r!==l)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function rp(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ip(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Cc=null;function Ug(e,t,n){if(Cc===null){var a=new Map,l=Cc=new Map;l.set(n,a)}else l=Cc,a=l.get(n),a||(a=new Map,l.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),l=0;l<n.length;l++){var r=n[l];if(!(r[co]||r[Ht]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var i=r.getAttribute(t)||"";i=e+i;var o=a.get(i);o?o.push(r):a.set(i,[r])}}return a}function Bg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function oC(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Yj(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var Pi=null;function cC(){}function uC(e,t,n){if(Pi===null)throw Error(Z(475));var a=Pi;if(t.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var l=yr(n.href),r=e.querySelector(bo(l));if(r){e=r._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(a.count++,a=uu.bind(a),e.then(a,a)),t.state.loading|=4,t.instance=r,At(r);return}r=e.ownerDocument||e,n=Vj(n),(l=$n.get(l))&&rp(n,l),r=r.createElement("link"),At(r);var i=r;i._p=new Promise(function(o,c){i.onload=o,i.onerror=c}),zt(r,"link",n),t.instance=r}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(a.count++,t=uu.bind(a),e.addEventListener("load",t),e.addEventListener("error",t))}}function dC(){if(Pi===null)throw Error(Z(475));var e=Pi;return e.stylesheets&&e.count===0&&zh(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&zh(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 uu(){if(this.count--,this.count===0){if(this.stylesheets)zh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var du=null;function zh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,du=new Map,t.forEach(fC,e),du=null,uu.call(e))}function fC(e,t){if(!(t.state.loading&4)){var n=du.get(e);if(n)var a=n.get(null);else{n=new Map,du.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<l.length;r++){var i=l[r];(i.nodeName==="LINK"||i.getAttribute("media")!=="not all")&&(n.set(i.dataset.precedence,i),a=i)}a&&n.set(null,a)}l=t.instance,i=l.getAttribute("data-precedence"),r=n.get(i)||a,r===a&&n.set(null,l),n.set(i,l),this.count++,a=uu.bind(this),l.addEventListener("load",a),l.addEventListener("error",a),r?r.parentNode.insertBefore(l,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(l,e.firstChild)),t.state.loading|=4}}var qi={$$typeof:Bs,Provider:null,Consumer:null,_currentValue:Za,_currentValue2:Za,_threadCount:0};function hC(e,t,n,a,l,r,i,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=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=l,this.onCaughtError=r,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Fj(e,t,n,a,l,r,i,o,c,d,f,h){return e=new hC(e,t,n,i,o,c,d,h),t=1,r===!0&&(t|=24),r=dn(3,null,null,t),e.current=r,r.stateNode=e,t=Dm(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:a,isDehydrated:n,cache:t},Lm(r),e}function Xj(e){return e?(e=Vl,e):Vl}function Kj(e,t,n,a,l,r){l=Xj(l),a.context===null?a.context=l:a.pendingContext=l,a=_a(t),a.payload={element:n},r=r===void 0?null:r,r!==null&&(a.callback=r),n=wa(e,a,t),n!==null&&(pn(n,e,t),ji(n,e,t))}function Hg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function op(e,t){Hg(e,t),(e=e.alternate)&&Hg(e,t)}function Qj(e){if(e.tag===13){var t=Rr(e,67108864);t!==null&&pn(t,e,67108864),op(e,67108864)}}var fu=!0;function mC(e,t,n,a){var l=je.T;je.T=null;var r=Ue.p;try{Ue.p=2,cp(e,t,n,a)}finally{Ue.p=r,je.T=l}}function pC(e,t,n,a){var l=je.T;je.T=null;var r=Ue.p;try{Ue.p=8,cp(e,t,n,a)}finally{Ue.p=r,je.T=l}}function cp(e,t,n,a){if(fu){var l=Lh(a);if(l===null)pf(e,t,a,hu,n),Ig(e,a);else if(gC(l,e,t,n,a))a.stopPropagation();else if(Ig(e,a),t&4&&-1<xC.indexOf(e)){for(;l!==null;){var r=Cr(l);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var i=Fa(r.pendingLanes);if(i!==0){var o=r;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var c=1<<31-hn(i);o.entanglements[1]|=c,i&=~c}ws(r),!(qe&6)&&(su=xs()+500,yo(0))}}break;case 13:o=Rr(r,2),o!==null&&pn(o,r,2),Yu(),op(r,2)}if(r=Lh(a),r===null&&pf(e,t,a,hu,n),r===l)break;l=r}l!==null&&a.stopPropagation()}else pf(e,t,a,null,n)}}function Lh(e){return e=km(e),up(e)}var hu=null;function up(e){if(hu=null,e=Bl(e),e!==null){var t=lo(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=jy(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return hu=e,null}function Zj(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(tS()){case ky:return 2;case Sy:return 8;case Ic:case nS:return 32;case Cy:return 268435456;default:return 32}default:return 32}}var Uh=!1,Sa=null,Ca=null,Ra=null,Gi=new Map,Vi=new Map,ma=[],xC="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 Ig(e,t){switch(e){case"focusin":case"focusout":Sa=null;break;case"dragenter":case"dragleave":Ca=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":Gi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vi.delete(t.pointerId)}}function Jr(e,t,n,a,l,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:r,targetContainers:[l]},t!==null&&(t=Cr(t),t!==null&&Qj(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,l!==null&&t.indexOf(l)===-1&&t.push(l),e)}function gC(e,t,n,a,l){switch(t){case"focusin":return Sa=Jr(Sa,e,t,n,a,l),!0;case"dragenter":return Ca=Jr(Ca,e,t,n,a,l),!0;case"mouseover":return Ra=Jr(Ra,e,t,n,a,l),!0;case"pointerover":var r=l.pointerId;return Gi.set(r,Jr(Gi.get(r)||null,e,t,n,a,l)),!0;case"gotpointercapture":return r=l.pointerId,Vi.set(r,Jr(Vi.get(r)||null,e,t,n,a,l)),!0}return!1}function Wj(e){var t=Bl(e.target);if(t!==null){var n=lo(t);if(n!==null){if(t=n.tag,t===13){if(t=jy(n),t!==null){e.blockedOn=t,uS(e.priority,function(){if(n.tag===13){var a=mn();a=jm(a);var l=Rr(n,a);l!==null&&pn(l,n,a),op(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 Rc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lh(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);th=a,n.target.dispatchEvent(a),th=null}else return t=Cr(n),t!==null&&Qj(t),e.blockedOn=n,!1;t.shift()}return!0}function Pg(e,t,n){Rc(e)&&n.delete(t)}function vC(){Uh=!1,Sa!==null&&Rc(Sa)&&(Sa=null),Ca!==null&&Rc(Ca)&&(Ca=null),Ra!==null&&Rc(Ra)&&(Ra=null),Gi.forEach(Pg),Vi.forEach(Pg)}function Zo(e,t){e.blockedOn===t&&(e.blockedOn=null,Uh||(Uh=!0,St.unstable_scheduleCallback(St.unstable_NormalPriority,vC)))}var Wo=null;function qg(e){Wo!==e&&(Wo=e,St.unstable_scheduleCallback(St.unstable_NormalPriority,function(){Wo===e&&(Wo=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],l=e[t+2];if(typeof a!="function"){if(up(a||n)===null)continue;break}var r=Cr(n);r!==null&&(e.splice(t,3),t-=3,gh(r,{pending:!0,data:l,method:n.method,action:a},a,l))}}))}function Yi(e){function t(c){return Zo(c,e)}Sa!==null&&Zo(Sa,e),Ca!==null&&Zo(Ca,e),Ra!==null&&Zo(Ra,e),Gi.forEach(t),Vi.forEach(t);for(var n=0;n<ma.length;n++){var a=ma[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<ma.length&&(n=ma[0],n.blockedOn===null);)Wj(n),n.blockedOn===null&&ma.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var l=n[a],r=n[a+1],i=l[Jt]||null;if(typeof r=="function")i||qg(n);else if(i){var o=null;if(r&&r.hasAttribute("formAction")){if(l=r,i=r[Jt]||null)o=i.formAction;else if(up(l)!==null)continue}else o=i.action;typeof o=="function"?n[a+1]=o:(n.splice(a,3),a-=3),qg(n)}}}function dp(e){this._internalRoot=e}Qu.prototype.render=dp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Z(409));var n=t.current,a=mn();Kj(n,a,e,t,null,null)};Qu.prototype.unmount=dp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kj(e.current,2,null,e,null,null),Yu(),t[Sr]=null}};function Qu(e){this._internalRoot=e}Qu.prototype.unstable_scheduleHydration=function(e){if(e){var t=My();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ma.length&&t!==0&&t<ma[n].priority;n++);ma.splice(n,0,e),n===0&&Wj(e)}};var Gg=yy.version;if(Gg!=="19.1.0")throw Error(Z(527,Gg,"19.1.0"));Ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Z(188)):(e=Object.keys(e).join(","),Error(Z(268,e)));return e=X1(t),e=e!==null?_y(e):null,e=e===null?null:e.stateNode,e};var yC={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:je,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jo.isDisabled&&Jo.supportsFiber)try{ro=Jo.inject(yC),fn=Jo}catch{}}$u.createRoot=function(e,t){if(!by(e))throw Error(Z(299));var n=!1,a="",l=Fb,r=Xb,i=Kb,o=null;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(l=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(i=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(o=t.unstable_transitionCallbacks)),t=Fj(e,1,!1,null,null,n,a,l,r,i,o,null),e[Sr]=t.current,lp(e),new dp(t)};$u.hydrateRoot=function(e,t,n){if(!by(e))throw Error(Z(299));var a=!1,l="",r=Fb,i=Xb,o=Kb,c=null,d=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(i=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(c=n.unstable_transitionCallbacks),n.formState!==void 0&&(d=n.formState)),t=Fj(e,1,!0,t,n??null,a,l,r,i,o,c,d),t.context=Xj(null),n=t.current,a=mn(),a=jm(a),l=_a(a),l.callback=null,wa(n,l,a),n=a,t.current.lanes=n,oo(t,n),ws(t),e[Sr]=t.current,lp(e),new Qu(t)};$u.version="19.1.0";function Jj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Jj)}catch(e){console.error(e)}}Jj(),hy.exports=$u;var bC=hy.exports;const e0=u.createContext(null);function t0({data:e,router:t,identity:n,notify:a,children:l}){return s.jsx(e0.Provider,{value:{data:e,router:t,identity:n,notify:a},children:l})}function Zu(){const e=u.useContext(e0);if(!e)throw new Error("A shared app page rendered outside AppUiProvider.");return e}const jC={success:()=>{},error:()=>{}},nn=()=>Zu().data,Ve=()=>Zu().router,Wu=()=>Zu().identity,Mr=()=>Zu().notify??jC;function _C(){const{probe:e}=nn(),{href:t,Link:n}=Ve(),a=Wu(),[l,r]=u.useState(null),[i,o]=u.useState(!1);return u.useEffect(()=>{let c=!0;if(!e){o(!0);return}return e.source().then(d=>c&&r(d.label),()=>c&&o(!0)),()=>{c=!1}},[e]),s.jsxs("section",{"data-testid":"app-ui-probe",className:"m-6 flex max-w-xl flex-col gap-2 rounded-lg border border-border bg-card p-6 text-card-foreground",children:[s.jsx("h1",{className:"text-xl font-semibold",children:"Shared app UI"}),s.jsx("p",{"data-testid":"app-ui-probe-source",className:"text-sm text-muted-foreground",children:i?"Data source unavailable":l??"Loading…"}),s.jsxs("p",{"data-testid":"app-ui-probe-identity",className:"text-sm",children:[a.label," · ",a.can("tasks.write")?"can edit tasks":"read only"]}),s.jsx(n,{href:t("/tasks"),className:"rounded-sm text-sm text-primary underline outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:"Tasks"})]})}/**
|
|
50
|
-
* @license lucide-react v0.511.0 - ISC
|
|
51
|
-
*
|
|
52
|
-
* This source code is licensed under the ISC license.
|
|
53
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
-
*/const wC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),NC=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase()),Vg=e=>{const t=NC(e);return t.charAt(0).toUpperCase()+t.slice(1)},n0=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim(),kC=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 SC={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 CC=u.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:l="",children:r,iconNode:i,...o},c)=>u.createElement("svg",{ref:c,...SC,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:n0("lucide",l),...!r&&!kC(o)&&{"aria-hidden":"true"},...o},[...i.map(([d,f])=>u.createElement(d,f)),...Array.isArray(r)?r:[r]]));/**
|
|
65
|
-
* @license lucide-react v0.511.0 - ISC
|
|
66
|
-
*
|
|
67
|
-
* This source code is licensed under the ISC license.
|
|
68
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
-
*/const ge=(e,t)=>{const n=u.forwardRef(({className:a,...l},r)=>u.createElement(CC,{ref:r,iconNode:t,className:n0(`lucide-${wC(Vg(e))}`,`lucide-${e}`,a),...l}));return n.displayName=Vg(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 RC=[["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"}]],TC=ge("archive-restore",RC);/**
|
|
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 EC=[["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"}]],Yg=ge("archive",EC);/**
|
|
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 AC=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],MC=ge("arrow-down",AC);/**
|
|
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 OC=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],s0=ge("arrow-left",OC);/**
|
|
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 $C=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],DC=ge("arrow-up",$C);/**
|
|
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 zC=[["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"}]],fp=ge("bot",zC);/**
|
|
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 LC=[["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"}]],UC=ge("briefcase",LC);/**
|
|
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 BC=[["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"}]],HC=ge("building-2",BC);/**
|
|
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 IC=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Or=ge("check",IC);/**
|
|
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 PC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qC=ge("chevron-down",PC);/**
|
|
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 GC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],a0=ge("chevron-right",GC);/**
|
|
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 VC=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],YC=ge("chevron-up",VC);/**
|
|
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 FC=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],l0=ge("chevrons-up-down",FC);/**
|
|
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 XC=[["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"}]],rt=ge("circle-alert",XC);/**
|
|
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 KC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ju=ge("circle-check",KC);/**
|
|
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 QC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ZC=ge("circle",QC);/**
|
|
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 WC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],JC=ge("clock",WC);/**
|
|
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 eR=[["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"}]],tR=ge("copy",eR);/**
|
|
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 nR=[["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"}]],hp=ge("ellipsis",nR);/**
|
|
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 sR=[["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"}]],aR=ge("eraser",sR);/**
|
|
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 lR=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_o=ge("eye",lR);/**
|
|
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 rR=[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],r0=ge("folder-git-2",rR);/**
|
|
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 iR=[["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"}]],oR=ge("folder-git",iR);/**
|
|
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 cR=[["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"}]],uR=ge("git-fork",cR);/**
|
|
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 dR=[["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"}]],fR=ge("hard-drive",dR);/**
|
|
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 hR=[["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"}]],mR=ge("history",hR);/**
|
|
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 pR=[["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"}]],xR=ge("house",pR);/**
|
|
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 gR=[["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"}]],vR=ge("inbox",gR);/**
|
|
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 yR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Ua=ge("info",yR);/**
|
|
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 bR=[["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"}]],jR=ge("laptop",bR);/**
|
|
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 _R=[["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"}]],wR=ge("life-buoy",_R);/**
|
|
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 NR=[["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"}]],i0=ge("list-checks",NR);/**
|
|
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 kR=[["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"}]],o0=ge("list-ordered",kR);/**
|
|
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 SR=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],CR=ge("loader-circle",SR);/**
|
|
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 RR=[["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"}]],TR=ge("lock",RR);/**
|
|
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 ER=[["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"}]],AR=ge("messages-square",ER);/**
|
|
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 MR=[["path",{d:"M5 12h14",key:"1ays0h"}]],OR=ge("minus",MR);/**
|
|
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 $R=[["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"}]],DR=ge("network",$R);/**
|
|
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 zR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],LR=ge("panel-left",zR);/**
|
|
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 UR=[["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"}]],c0=ge("pause",UR);/**
|
|
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 BR=[["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"}]],ed=ge("pencil",BR);/**
|
|
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 HR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],br=ge("plus",HR);/**
|
|
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 IR=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],yl=ge("refresh-cw",IR);/**
|
|
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 PR=[["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"}]],qR=ge("rotate-ccw",PR);/**
|
|
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 GR=[["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"}]],td=ge("search-x",GR);/**
|
|
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 VR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],YR=ge("search",VR);/**
|
|
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 FR=[["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"}]],XR=ge("shield-alert",FR);/**
|
|
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 KR=[["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"}]],QR=ge("snowflake",KR);/**
|
|
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 ZR=[["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"}]],mu=ge("tag",ZR);/**
|
|
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 WR=[["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"}]],en=ge("triangle-alert",WR);/**
|
|
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 JR=[["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"}]],eT=ge("user-check",JR);/**
|
|
325
|
-
* @license lucide-react v0.511.0 - ISC
|
|
326
|
-
*
|
|
327
|
-
* This source code is licensed under the ISC license.
|
|
328
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
-
*/const tT=[["path",{d:"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"}]],nT=ge("user-cog",tT);/**
|
|
330
|
-
* @license lucide-react v0.511.0 - ISC
|
|
331
|
-
*
|
|
332
|
-
* This source code is licensed under the ISC license.
|
|
333
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
-
*/const sT=[["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"}]],mp=ge("user",sT);/**
|
|
335
|
-
* @license lucide-react v0.511.0 - ISC
|
|
336
|
-
*
|
|
337
|
-
* This source code is licensed under the ISC license.
|
|
338
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
-
*/const aT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],nd=ge("x",aT),lT="Local only · this machine · not connected to SoftwareDLC",rT="Checking sync state…",iT="Sync state unknown",oT="Projects are the repositories this viewer reads on this machine. Nothing is shared unless you connect to SoftwareDLC.",cl="Details are in the terminal running sdlc viewer.",cT="How to fix it is in the terminal running sdlc viewer.",sd="Loading…",pu="Not available";function uT(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 oi(e){return(typeof e=="string"?new Date(e):e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})}const dT={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 u0(e,t){const n=t?` this list was read at ${oi(t)}.`:"";if(e.reason==="store_locked"){const a=e.store?dT[e.store]:"a local store",l=e.since?` since ${oi(e.since)}`:"";return`Another sdlc command has held ${a}${l};${n||" nothing was read yet."} ${cl}`}return e.status===0?`The viewer did not answer. Is sdlc viewer still running?${t?` This list was read at ${oi(t)}.`:""}`:`The read failed.${t?` This list was read at ${oi(t)}.`:""} ${cl}`}const fT=e=>e.status===409,hT={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 mT(e){const t=e.repository??"This repository";if(e.reason==="folder_member_unlisted"&&e.folder&&e.home&&e.member_path)return{kind:"unlisted",repository:t,folder:e.folder,home:e.home,member_path:e.member_path};if(e.reason==="member_moved"){const l=e.folder?`the folder ${e.folder}`:"its folder";return{kind:"moved_member",cause:`This repository, ${t}, is not where ${l} records it.`}}if(e.reason==="folder_moved")return{kind:"other",cause:e.folder?`The folder ${e.folder} has moved.`:"The folder has moved.",fix:!0};const n=e.reason?hT[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 Fg=["tasks","issues","releases"],pp=u.createContext(null);function yn(){const e=u.useContext(pp);if(!e)throw new Error("A shell page rendered outside the app shell.");return e}function pT(){var e;return(e=u.useContext(pp))==null?void 0:e.engine}const xT=10,gT=()=>new Date;function vT({shell:e,now:t=gT,children:n}){var U;const[a,l]=u.useState(null),[r,i]=u.useState(null),[o,c]=u.useState(null),[d,f]=u.useState(null),[h,m]=u.useState(null),[x,j]=u.useState(!0),[v,y]=u.useState(!1),[g,p]=u.useState(void 0),[b,_]=u.useState(!1),[N,R]=u.useState(Fg),w=u.useRef(!1),k=u.useRef(!1),L=u.useRef(null),D=u.useRef(!0),K=u.useCallback(async(M=!1)=>{L.current&&clearTimeout(L.current),L.current=null,y(!0);const[A,S]=await Promise.all([e.organizations.list(),e.projects.list()]);if(!D.current)return;if(y(!1),j(!1),A.ok&&S.ok){if(w.current=!0,k.current=!1,m(null),f(t()),A.data.organizations.length===0){c("not_in_git"),l(null),i(null);return}c(null),l(A.data.organizations[0]),i(S.data.projects);return}const E=A.ok?S.ok?null:S.refusal:A.refusal;if(!E)return;if(fT(E)){k.current=!1,m(null),c(E),l(null),i(null);return}const C=w.current&&!k.current&&!M;k.current=!0;const $=E.retry_after??xT;m({refusal:E,shown:!C,retryInSeconds:C?$:null}),C&&(L.current=setTimeout(()=>void K(!0),$*1e3))},[e,t]);u.useEffect(()=>(D.current=!0,K(),e.about.about().then(M=>{D.current&&(M.ok?p(M.data):M.refusal.status===404?p(null):_(!0))}),Promise.all(Fg.map(async M=>{var A;return[M,await((A=e[M])==null?void 0:A.access())]})).then(M=>{D.current&&R(M.filter(([,A])=>!(A!=null&&A.ok&&!A.data.can_view)).map(([A])=>A))}),()=>{D.current=!1,L.current&&clearTimeout(L.current)}),[e,K]);const G={loading:x,org:a,projects:r,none:o,readAt:d,failure:h,about:g,aboutFailed:b,engine:(g==null?void 0:g.engine)===null?null:(U=g==null?void 0:g.engine)==null?void 0:U.source,domains:N,reading:v,refresh:()=>void K()};return s.jsx(pp.Provider,{value:G,children:n})}const d0=e=>`The ${e} page is not part of this sdlc install`,$r="The sdlc engine here is too old for this page";function yT(e){return e==="checkout"?"Update the main checkout, then restart sdlc viewer.":"Update sdlc to its latest version, then restart sdlc viewer."}function as(){return yT(pT())}function f0(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(n=f0(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function h0(){for(var e,t,n=0,a="",l=arguments.length;n<l;n++)(e=arguments[n])&&(t=f0(e))&&(a&&(a+=" "),a+=t);return a}const Xg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kg=h0,wo=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return Kg(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:r}=t,i=Object.keys(l).map(d=>{const f=n==null?void 0:n[d],h=r==null?void 0:r[d];if(f===null)return null;const m=Xg(f)||Xg(h);return l[d][m]}),o=n&&Object.entries(n).reduce((d,f)=>{let[h,m]=f;return m===void 0||(d[h]=m),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,f)=>{let{class:h,className:m,...x}=f;return Object.entries(x).every(j=>{let[v,y]=j;return Array.isArray(y)?y.includes({...r,...o}[v]):{...r,...o}[v]===y})?[...d,h,m]:d},[]);return Kg(e,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},xp="-",bT=e=>{const t=_T(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{const o=i.split(xp);return o[0]===""&&o.length!==1&&o.shift(),m0(o,t)||jT(i)},getConflictingClassGroupIds:(i,o)=>{const c=n[i]||[];return o&&a[i]?[...c,...a[i]]:c}}},m0=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],a=t.nextPart.get(n),l=a?m0(e.slice(1),a):void 0;if(l)return l;if(t.validators.length===0)return;const r=e.join(xp);return(i=t.validators.find(({validator:o})=>o(r)))==null?void 0:i.classGroupId},Qg=/^\[(.+)\]$/,jT=e=>{if(Qg.test(e)){const t=Qg.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},_T=e=>{const{theme:t,classGroups:n}=e,a={nextPart:new Map,validators:[]};for(const l in n)Bh(n[l],a,l,t);return a},Bh=(e,t,n,a)=>{e.forEach(l=>{if(typeof l=="string"){const r=l===""?t:Zg(t,l);r.classGroupId=n;return}if(typeof l=="function"){if(wT(l)){Bh(l(a),t,n,a);return}t.validators.push({validator:l,classGroupId:n});return}Object.entries(l).forEach(([r,i])=>{Bh(i,Zg(t,r),n,a)})})},Zg=(e,t)=>{let n=e;return t.split(xp).forEach(a=>{n.nextPart.has(a)||n.nextPart.set(a,{nextPart:new Map,validators:[]}),n=n.nextPart.get(a)}),n},wT=e=>e.isThemeGetter,NT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,a=new Map;const l=(r,i)=>{n.set(r,i),t++,t>e&&(t=0,a=n,n=new Map)};return{get(r){let i=n.get(r);if(i!==void 0)return i;if((i=a.get(r))!==void 0)return l(r,i),i},set(r,i){n.has(r)?n.set(r,i):l(r,i)}}},Hh="!",Ih=":",kT=Ih.length,ST=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=l=>{const r=[];let i=0,o=0,c=0,d;for(let j=0;j<l.length;j++){let v=l[j];if(i===0&&o===0){if(v===Ih){r.push(l.slice(c,j)),c=j+kT;continue}if(v==="/"){d=j;continue}}v==="["?i++:v==="]"?i--:v==="("?o++:v===")"&&o--}const f=r.length===0?l:l.substring(c),h=CT(f),m=h!==f,x=d&&d>c?d-c:void 0;return{modifiers:r,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:x}};if(t){const l=t+Ih,r=a;a=i=>i.startsWith(l)?r(i.substring(l.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(n){const l=a;a=r=>n({className:r,parseClassName:l})}return a},CT=e=>e.endsWith(Hh)?e.substring(0,e.length-1):e.startsWith(Hh)?e.substring(1):e,RT=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(a=>[a,!0]));return a=>{if(a.length<=1)return a;const l=[];let r=[];return a.forEach(i=>{i[0]==="["||t[i]?(l.push(...r.sort(),i),r=[]):r.push(i)}),l.push(...r.sort()),l}},TT=e=>({cache:NT(e.cacheSize),parseClassName:ST(e),sortModifiers:RT(e),...bT(e)}),ET=/\s+/,AT=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:l,sortModifiers:r}=t,i=[],o=e.trim().split(ET);let c="";for(let d=o.length-1;d>=0;d-=1){const f=o[d],{isExternal:h,modifiers:m,hasImportantModifier:x,baseClassName:j,maybePostfixModifierPosition:v}=n(f);if(h){c=f+(c.length>0?" "+c:c);continue}let y=!!v,g=a(y?j.substring(0,v):j);if(!g){if(!y){c=f+(c.length>0?" "+c:c);continue}if(g=a(j),!g){c=f+(c.length>0?" "+c:c);continue}y=!1}const p=r(m).join(":"),b=x?p+Hh:p,_=b+g;if(i.includes(_))continue;i.push(_);const N=l(g,y);for(let R=0;R<N.length;++R){const w=N[R];i.push(b+w)}c=f+(c.length>0?" "+c:c)}return c};function MT(){let e=0,t,n,a="";for(;e<arguments.length;)(t=arguments[e++])&&(n=p0(t))&&(a&&(a+=" "),a+=n);return a}const p0=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=p0(e[a]))&&(n&&(n+=" "),n+=t);return n};function OT(e,...t){let n,a,l,r=i;function i(c){const d=t.reduce((f,h)=>h(f),e());return n=TT(d),a=n.cache.get,l=n.cache.set,r=o,o(c)}function o(c){const d=a(c);if(d)return d;const f=AT(c,n);return l(c,f),f}return function(){return r(MT.apply(null,arguments))}}const wt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},x0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,g0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,$T=/^\d+\/\d+$/,DT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zT=/\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$/,LT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,UT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kl=e=>$T.test(e),Re=e=>!!e&&!Number.isNaN(Number(e)),aa=e=>!!e&&Number.isInteger(Number(e)),gf=e=>e.endsWith("%")&&Re(e.slice(0,-1)),$s=e=>DT.test(e),HT=()=>!0,IT=e=>zT.test(e)&&!LT.test(e),v0=()=>!1,PT=e=>UT.test(e),qT=e=>BT.test(e),GT=e=>!de(e)&&!fe(e),VT=e=>Dr(e,j0,v0),de=e=>x0.test(e),Ya=e=>Dr(e,_0,IT),vf=e=>Dr(e,QT,Re),Wg=e=>Dr(e,y0,v0),YT=e=>Dr(e,b0,qT),ec=e=>Dr(e,w0,PT),fe=e=>g0.test(e),ei=e=>zr(e,_0),FT=e=>zr(e,ZT),Jg=e=>zr(e,y0),XT=e=>zr(e,j0),KT=e=>zr(e,b0),tc=e=>zr(e,w0,!0),Dr=(e,t,n)=>{const a=x0.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},zr=(e,t,n=!1)=>{const a=g0.exec(e);return a?a[1]?t(a[1]):n:!1},y0=e=>e==="position"||e==="percentage",b0=e=>e==="image"||e==="url",j0=e=>e==="length"||e==="size"||e==="bg-size",_0=e=>e==="length",QT=e=>e==="number",ZT=e=>e==="family-name",w0=e=>e==="shadow",WT=()=>{const e=wt("color"),t=wt("font"),n=wt("text"),a=wt("font-weight"),l=wt("tracking"),r=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"),x=wt("drop-shadow"),j=wt("blur"),v=wt("perspective"),y=wt("aspect"),g=wt("ease"),p=wt("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[..._(),fe,de],R=()=>["auto","hidden","clip","visible","scroll"],w=()=>["auto","contain","none"],k=()=>[fe,de,c],L=()=>[kl,"full","auto",...k()],D=()=>[aa,"none","subgrid",fe,de],K=()=>["auto",{span:["full",aa,fe,de]},aa,fe,de],G=()=>[aa,"auto",fe,de],U=()=>["auto","min","max","fr",fe,de],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],S=()=>["auto",...k()],E=()=>[kl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],C=()=>[e,fe,de],$=()=>[..._(),Jg,Wg,{position:[fe,de]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],T=()=>["auto","cover","contain",XT,VT,{size:[fe,de]}],I=()=>[gf,ei,Ya],ne=()=>["","none","full",d,fe,de],W=()=>["",Re,ei,Ya],xe=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>[Re,gf,Jg,Wg],Y=()=>["","none",j,fe,de],ae=()=>["none",Re,fe,de],H=()=>["none",Re,fe,de],te=()=>[Re,fe,de],ee=()=>[kl,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$s],breakpoint:[$s],color:[HT],container:[$s],"drop-shadow":[$s],ease:["in","out","in-out"],font:[GT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$s],shadow:[$s],spacing:["px",Re],text:[$s],"text-shadow":[$s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",kl,de,fe,y]}],container:["container"],columns:[{columns:[Re,de,fe,o]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[aa,"auto",fe,de]}],basis:[{basis:[kl,"full","auto",o,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Re,kl,"auto","initial","none",de]}],grow:[{grow:["",Re,fe,de]}],shrink:[{shrink:["",Re,fe,de]}],order:[{order:[aa,"first","last","none",fe,de]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[o,"screen",...E()]}],"min-w":[{"min-w":[o,"screen","none",...E()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",n,ei,Ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,fe,vf]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gf,de]}],"font-family":[{font:[FT,de,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,fe,de]}],"line-clamp":[{"line-clamp":[Re,"none",fe,vf]}],leading:[{leading:[r,...k()]}],"list-image":[{"list-image":["none",fe,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:C()}],"text-color":[{text:C()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Re,"from-font","auto",fe,Ya]}],"text-decoration-color":[{decoration:C()}],"underline-offset":[{"underline-offset":[Re,"auto",fe,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,de]}],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",fe,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},aa,fe,de],radial:["",fe,de],conic:[aa,fe,de]},KT,YT]}],"bg-color":[{bg:C()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:C()}],"gradient-via":[{via:C()}],"gradient-to":[{to:C()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:W()}],"border-w-x":[{"border-x":W()}],"border-w-y":[{"border-y":W()}],"border-w-s":[{"border-s":W()}],"border-w-e":[{"border-e":W()}],"border-w-t":[{"border-t":W()}],"border-w-r":[{"border-r":W()}],"border-w-b":[{"border-b":W()}],"border-w-l":[{"border-l":W()}],"divide-x":[{"divide-x":W()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":W()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...xe(),"hidden","none"]}],"divide-style":[{divide:[...xe(),"hidden","none"]}],"border-color":[{border:C()}],"border-color-x":[{"border-x":C()}],"border-color-y":[{"border-y":C()}],"border-color-s":[{"border-s":C()}],"border-color-e":[{"border-e":C()}],"border-color-t":[{"border-t":C()}],"border-color-r":[{"border-r":C()}],"border-color-b":[{"border-b":C()}],"border-color-l":[{"border-l":C()}],"divide-color":[{divide:C()}],"outline-style":[{outline:[...xe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Re,fe,de]}],"outline-w":[{outline:["",Re,ei,Ya]}],"outline-color":[{outline:C()}],shadow:[{shadow:["","none",f,tc,ec]}],"shadow-color":[{shadow:C()}],"inset-shadow":[{"inset-shadow":["none",h,tc,ec]}],"inset-shadow-color":[{"inset-shadow":C()}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:C()}],"ring-offset-w":[{"ring-offset":[Re,Ya]}],"ring-offset-color":[{"ring-offset":C()}],"inset-ring-w":[{"inset-ring":W()}],"inset-ring-color":[{"inset-ring":C()}],"text-shadow":[{"text-shadow":["none",m,tc,ec]}],"text-shadow-color":[{"text-shadow":C()}],opacity:[{opacity:[Re,fe,de]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"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":[Re]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":C()}],"mask-image-linear-to-color":[{"mask-linear-to":C()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":C()}],"mask-image-t-to-color":[{"mask-t-to":C()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":C()}],"mask-image-r-to-color":[{"mask-r-to":C()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":C()}],"mask-image-b-to-color":[{"mask-b-to":C()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":C()}],"mask-image-l-to-color":[{"mask-l-to":C()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":C()}],"mask-image-x-to-color":[{"mask-x-to":C()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":C()}],"mask-image-y-to-color":[{"mask-y-to":C()}],"mask-image-radial":[{"mask-radial":[fe,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":C()}],"mask-image-radial-to-color":[{"mask-radial-to":C()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[Re]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":C()}],"mask-image-conic-to-color":[{"mask-conic-to":C()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,de]}],filter:[{filter:["","none",fe,de]}],blur:[{blur:Y()}],brightness:[{brightness:[Re,fe,de]}],contrast:[{contrast:[Re,fe,de]}],"drop-shadow":[{"drop-shadow":["","none",x,tc,ec]}],"drop-shadow-color":[{"drop-shadow":C()}],grayscale:[{grayscale:["",Re,fe,de]}],"hue-rotate":[{"hue-rotate":[Re,fe,de]}],invert:[{invert:["",Re,fe,de]}],saturate:[{saturate:[Re,fe,de]}],sepia:[{sepia:["",Re,fe,de]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,de]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[Re,fe,de]}],"backdrop-contrast":[{"backdrop-contrast":[Re,fe,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Re,fe,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Re,fe,de]}],"backdrop-invert":[{"backdrop-invert":["",Re,fe,de]}],"backdrop-opacity":[{"backdrop-opacity":[Re,fe,de]}],"backdrop-saturate":[{"backdrop-saturate":[Re,fe,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Re,fe,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Re,"initial",fe,de]}],ease:[{ease:["linear","initial",g,fe,de]}],delay:[{delay:[Re,fe,de]}],animate:[{animate:["none",p,fe,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,fe,de]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:H()}],"scale-x":[{"scale-x":H()}],"scale-y":[{"scale-y":H()}],"scale-z":[{"scale-z":H()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[fe,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ee()}],"translate-x":[{"translate-x":ee()}],"translate-y":[{"translate-y":ee()}],"translate-z":[{"translate-z":ee()}],"translate-none":["translate-none"],accent:[{accent:C()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:C()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,de]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,de]}],fill:[{fill:["none",...C()]}],"stroke-w":[{stroke:[Re,ei,Ya,vf]}],stroke:[{stroke:["none",...C()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},JT=OT(WT);function ie(...e){return JT(h0(e))}const eE=wo("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground *:data-[slot=alert-description]:text-muted-foreground",info:"border-info/40 bg-info/10 text-info",success:"border-success/40 bg-success/10 text-success",warning:"border-warning/40 bg-warning/10 text-warning",destructive:"border-destructive/40 bg-destructive/10 text-destructive"}},defaultVariants:{variant:"default"}});function me({className:e,variant:t,...n}){return s.jsx("div",{"data-slot":"alert",role:"alert",className:ie(eE({variant:t}),e),...n})}function ve({className:e,...t}){return s.jsx("div",{"data-slot":"alert-title",className:ie("col-start-2 min-h-4 font-medium tracking-tight",e),...t})}function pe({className:e,...t}){return s.jsx("div",{"data-slot":"alert-description",className:ie("col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function ce(e,t,{checkForDefaultPrevented:n=!0}={}){return function(l){if(e==null||e(l),n===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function ev(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ad(...e){return t=>{let n=!1;const a=e.map(l=>{const r=ev(l,t);return!n&&typeof r=="function"&&(n=!0),r});if(n)return()=>{for(let l=0;l<a.length;l++){const r=a[l];typeof r=="function"?r():ev(e[l],null)}}}}function Ie(...e){return u.useCallback(ad(...e),e)}function tE(e,t){const n=u.createContext(t),a=r=>{const{children:i,...o}=r,c=u.useMemo(()=>o,Object.values(o));return s.jsx(n.Provider,{value:c,children:i})};a.displayName=e+"Provider";function l(r){const i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${r}\` must be used within \`${e}\``)}return[a,l]}function Ns(e,t=[]){let n=[];function a(r,i){const o=u.createContext(i),c=n.length;n=[...n,i];const d=h=>{var g;const{scope:m,children:x,...j}=h,v=((g=m==null?void 0:m[e])==null?void 0:g[c])||o,y=u.useMemo(()=>j,Object.values(j));return s.jsx(v.Provider,{value:y,children:x})};d.displayName=r+"Provider";function f(h,m){var v;const x=((v=m==null?void 0:m[e])==null?void 0:v[c])||o,j=u.useContext(x);if(j)return j;if(i!==void 0)return i;throw new Error(`\`${h}\` must be used within \`${r}\``)}return[d,f]}const l=()=>{const r=n.map(i=>u.createContext(i));return function(o){const c=(o==null?void 0:o[e])||r;return u.useMemo(()=>({[`__scope${e}`]:{...o,[e]:c}}),[o,c])}};return l.scopeName=e,[a,nE(l,...t)]}function nE(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(r){const i=a.reduce((o,{useScope:c,scopeName:d})=>{const h=c(r)[`__scope${d}`];return{...o,...h}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Pt=globalThis!=null&&globalThis.document?u.useLayoutEffect:()=>{},sE=fy[" useId ".trim().toString()]||(()=>{}),aE=0;function Zn(e){const[t,n]=u.useState(sE());return Pt(()=>{n(a=>a??String(aE++))},[e]),t?`radix-${t}`:""}var lE=fy[" useInsertionEffect ".trim().toString()]||Pt;function Oa({prop:e,defaultProp:t,onChange:n=()=>{},caller:a}){const[l,r,i]=rE({defaultProp:t,onChange:n}),o=e!==void 0,c=o?e:l;{const f=u.useRef(e!==void 0);u.useEffect(()=>{const h=f.current;h!==o&&console.warn(`${a} is changing from ${h?"controlled":"uncontrolled"} to ${o?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=o},[o,a])}const d=u.useCallback(f=>{var h;if(o){const m=iE(f)?f(e):f;m!==e&&((h=i.current)==null||h.call(i,m))}else r(f)},[o,e,r,i]);return[c,d]}function rE({defaultProp:e,onChange:t}){const[n,a]=u.useState(e),l=u.useRef(n),r=u.useRef(t);return lE(()=>{r.current=t},[t]),u.useEffect(()=>{var i;l.current!==n&&((i=r.current)==null||i.call(r,n),l.current=n)},[n,l]),[n,a,r]}function iE(e){return typeof e=="function"}function ul(e){const t=cE(e),n=u.forwardRef((a,l)=>{const{children:r,...i}=a,o=u.Children.toArray(r),c=o.find(dE);if(c){const d=c.props.children,f=o.map(h=>h===c?u.Children.count(d)>1?u.Children.only(null):u.isValidElement(d)?d.props.children:null:h);return s.jsx(t,{...i,ref:l,children:u.isValidElement(d)?u.cloneElement(d,void 0,f):null})}return s.jsx(t,{...i,ref:l,children:r})});return n.displayName=`${e}.Slot`,n}var oE=ul("Slot");function cE(e){const t=u.forwardRef((n,a)=>{const{children:l,...r}=n;if(u.isValidElement(l)){const i=hE(l),o=fE(r,l.props);return l.type!==u.Fragment&&(o.ref=a?ad(a,i):i),u.cloneElement(l,o)}return u.Children.count(l)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var N0=Symbol("radix.slottable");function uE(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=N0,t}function dE(e){return u.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===N0}function fE(e,t){const n={...t};for(const a in t){const l=e[a],r=t[a];/^on[A-Z]/.test(a)?l&&r?n[a]=(...o)=>{const c=r(...o);return l(...o),c}:l&&(n[a]=l):a==="style"?n[a]={...l,...r}:a==="className"&&(n[a]=[l,r].filter(Boolean).join(" "))}return{...e,...n}}function hE(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var mE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=mE.reduce((e,t)=>{const n=ul(`Primitive.${t}`),a=u.forwardRef((l,r)=>{const{asChild:i,...o}=l,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...o,ref:r})});return a.displayName=`Primitive.${t}`,{...e,[t]:a}},{});function k0(e,t){e&&kr.flushSync(()=>e.dispatchEvent(t))}function bs(e){const t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...n)=>{var a;return(a=t.current)==null?void 0:a.call(t,...n)},[])}function pE(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e);u.useEffect(()=>{const a=l=>{l.key==="Escape"&&n(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[n,t])}var xE="DismissableLayer",Ph="dismissableLayer.update",gE="dismissableLayer.pointerDownOutside",vE="dismissableLayer.focusOutside",tv,S0=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),No=u.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:r,onInteractOutside:i,onDismiss:o,...c}=e,d=u.useContext(S0),[f,h]=u.useState(null),m=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,x]=u.useState({}),j=Ie(t,w=>h(w)),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(y),p=f?v.indexOf(f):-1,b=d.layersWithOutsidePointerEventsDisabled.size>0,_=p>=g,N=jE(w=>{const k=w.target,L=[...d.branches].some(D=>D.contains(k));!_||L||(l==null||l(w),i==null||i(w),w.defaultPrevented||o==null||o())},m),R=_E(w=>{const k=w.target;[...d.branches].some(D=>D.contains(k))||(r==null||r(w),i==null||i(w),w.defaultPrevented||o==null||o())},m);return pE(w=>{p===d.layers.size-1&&(a==null||a(w),!w.defaultPrevented&&o&&(w.preventDefault(),o()))},m),u.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(tv=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),nv(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=tv)}},[f,m,n,d]),u.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),nv())},[f,d]),u.useEffect(()=>{const w=()=>x({});return document.addEventListener(Ph,w),()=>document.removeEventListener(Ph,w)},[]),s.jsx(we.div,{...c,ref:j,style:{pointerEvents:b?_?"auto":"none":void 0,...e.style},onFocusCapture:ce(e.onFocusCapture,R.onFocusCapture),onBlurCapture:ce(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:ce(e.onPointerDownCapture,N.onPointerDownCapture)})});No.displayName=xE;var yE="DismissableLayerBranch",bE=u.forwardRef((e,t)=>{const n=u.useContext(S0),a=u.useRef(null),l=Ie(t,a);return u.useEffect(()=>{const r=a.current;if(r)return n.branches.add(r),()=>{n.branches.delete(r)}},[n.branches]),s.jsx(we.div,{...e,ref:l})});bE.displayName=yE;function jE(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e),a=u.useRef(!1),l=u.useRef(()=>{});return u.useEffect(()=>{const r=o=>{if(o.target&&!a.current){let c=function(){C0(gE,n,d,{discrete:!0})};const d={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=c,t.addEventListener("click",l.current,{once:!0})):c()}else t.removeEventListener("click",l.current);a.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",r)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",r),t.removeEventListener("click",l.current)}},[t,n]),{onPointerDownCapture:()=>a.current=!0}}function _E(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e),a=u.useRef(!1);return u.useEffect(()=>{const l=r=>{r.target&&!a.current&&C0(vE,n,{originalEvent:r},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,n]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function nv(){const e=new CustomEvent(Ph);document.dispatchEvent(e)}function C0(e,t,n,{discrete:a}){const l=n.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&l.addEventListener(e,t,{once:!0}),a?k0(l,r):l.dispatchEvent(r)}var yf="focusScope.autoFocusOnMount",bf="focusScope.autoFocusOnUnmount",sv={bubbles:!1,cancelable:!0},wE="FocusScope",ld=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:r,...i}=e,[o,c]=u.useState(null),d=bs(l),f=bs(r),h=u.useRef(null),m=Ie(t,v=>c(v)),x=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(a){let v=function(b){if(x.paused||!o)return;const _=b.target;o.contains(_)?h.current=_:oa(h.current,{select:!0})},y=function(b){if(x.paused||!o)return;const _=b.relatedTarget;_!==null&&(o.contains(_)||oa(h.current,{select:!0}))},g=function(b){if(document.activeElement===document.body)for(const N of b)N.removedNodes.length>0&&oa(o)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const p=new MutationObserver(g);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),p.disconnect()}}},[a,o,x.paused]),u.useEffect(()=>{if(o){lv.add(x);const v=document.activeElement;if(!o.contains(v)){const g=new CustomEvent(yf,sv);o.addEventListener(yf,d),o.dispatchEvent(g),g.defaultPrevented||(NE(TE(R0(o)),{select:!0}),document.activeElement===v&&oa(o))}return()=>{o.removeEventListener(yf,d),setTimeout(()=>{const g=new CustomEvent(bf,sv);o.addEventListener(bf,f),o.dispatchEvent(g),g.defaultPrevented||oa(v??document.body,{select:!0}),o.removeEventListener(bf,f),lv.remove(x)},0)}}},[o,d,f,x]);const j=u.useCallback(v=>{if(!n&&!a||x.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(y&&g){const p=v.currentTarget,[b,_]=kE(p);b&&_?!v.shiftKey&&g===_?(v.preventDefault(),n&&oa(b,{select:!0})):v.shiftKey&&g===b&&(v.preventDefault(),n&&oa(_,{select:!0})):g===p&&v.preventDefault()}},[n,a,x.paused]);return s.jsx(we.div,{tabIndex:-1,...i,ref:m,onKeyDown:j})});ld.displayName=wE;function NE(e,{select:t=!1}={}){const n=document.activeElement;for(const a of e)if(oa(a,{select:t}),document.activeElement!==n)return}function kE(e){const t=R0(e),n=av(t,e),a=av(t.reverse(),e);return[n,a]}function R0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function av(e,t){for(const n of e)if(!SE(n,{upTo:t}))return n}function SE(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 CE(e){return e instanceof HTMLInputElement&&"select"in e}function oa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&CE(e)&&t&&e.select()}}var lv=RE();function RE(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=rv(e,t),e.unshift(t)},remove(t){var n;e=rv(e,t),(n=e[0])==null||n.resume()}}}function rv(e,t){const n=[...e],a=n.indexOf(t);return a!==-1&&n.splice(a,1),n}function TE(e){return e.filter(t=>t.tagName!=="A")}var EE="Portal",ko=u.forwardRef((e,t)=>{var o;const{container:n,...a}=e,[l,r]=u.useState(!1);Pt(()=>r(!0),[]);const i=n||l&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return i?Y1.createPortal(s.jsx(we.div,{...a,ref:t}),i):null});ko.displayName=EE;function AE(e,t){return u.useReducer((n,a)=>t[n][a]??n,e)}var Dn=e=>{const{present:t,children:n}=e,a=ME(t),l=typeof n=="function"?n({present:a.isPresent}):u.Children.only(n),r=Ie(a.ref,OE(l));return typeof n=="function"||a.isPresent?u.cloneElement(l,{ref:r}):null};Dn.displayName="Presence";function ME(e){const[t,n]=u.useState(),a=u.useRef(null),l=u.useRef(e),r=u.useRef("none"),i=e?"mounted":"unmounted",[o,c]=AE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return u.useEffect(()=>{const d=nc(a.current);r.current=o==="mounted"?d:"none"},[o]),Pt(()=>{const d=a.current,f=l.current;if(f!==e){const m=r.current,x=nc(d);e?c("MOUNT"):x==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&m!==x?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,c]),Pt(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,h=x=>{const v=nc(a.current).includes(x.animationName);if(x.target===t&&v&&(c("ANIMATION_END"),!l.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},m=x=>{x.target===t&&(r.current=nc(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 nc(e){return(e==null?void 0:e.animationName)||"none"}function OE(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jf=0;function gp(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??iv()),document.body.insertAdjacentElement("beforeend",e[1]??iv()),jf++,()=>{jf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jf--}},[])}function iv(){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 us=function(){return us=Object.assign||function(t){for(var n,a=1,l=arguments.length;a<l;a++){n=arguments[a];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},us.apply(this,arguments)};function T0(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(e);l<a.length;l++)t.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(e,a[l])&&(n[a[l]]=e[a[l]]);return n}function $E(e,t,n){if(n||arguments.length===2)for(var a=0,l=t.length,r;a<l;a++)(r||!(a in t))&&(r||(r=Array.prototype.slice.call(t,0,a)),r[a]=t[a]);return e.concat(r||Array.prototype.slice.call(t))}var Tc="right-scroll-bar-position",Ec="width-before-scroll-bar",DE="with-scroll-bars-hidden",zE="--removed-body-scroll-bar-size";function _f(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function LE(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(a){var l=n.value;l!==a&&(n.value=a,n.callback(a,l))}}}})[0];return n.callback=t,n.facade}var UE=typeof window<"u"?u.useLayoutEffect:u.useEffect,ov=new WeakMap;function BE(e,t){var n=LE(null,function(a){return e.forEach(function(l){return _f(l,a)})});return UE(function(){var a=ov.get(n);if(a){var l=new Set(a),r=new Set(e),i=n.current;l.forEach(function(o){r.has(o)||_f(o,null)}),r.forEach(function(o){l.has(o)||_f(o,i)})}ov.set(n,e)},[e]),n}function HE(e){return e}function IE(e,t){t===void 0&&(t=HE);var n=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(r){var i=t(r,a);return n.push(i),function(){n=n.filter(function(o){return o!==i})}},assignSyncMedium:function(r){for(a=!0;n.length;){var i=n;n=[],i.forEach(r)}n={push:function(o){return r(o)},filter:function(){return n}}},assignMedium:function(r){a=!0;var i=[];if(n.length){var o=n;n=[],o.forEach(r),i=n}var c=function(){var f=i;i=[],f.forEach(r)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),n}}}};return l}function PE(e){e===void 0&&(e={});var t=IE(null);return t.options=us({async:!0,ssr:!1},e),t}var E0=function(e){var t=e.sideCar,n=T0(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,us({},n))};E0.isSideCarExport=!0;function qE(e,t){return e.useMedium(t),E0}var A0=PE(),wf=function(){},rd=u.forwardRef(function(e,t){var n=u.useRef(null),a=u.useState({onScrollCapture:wf,onWheelCapture:wf,onTouchMoveCapture:wf}),l=a[0],r=a[1],i=e.forwardProps,o=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,h=e.shards,m=e.sideCar,x=e.noRelative,j=e.noIsolation,v=e.inert,y=e.allowPinchZoom,g=e.as,p=g===void 0?"div":g,b=e.gapMode,_=T0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,R=BE([n,t]),w=us(us({},_),l);return u.createElement(u.Fragment,null,f&&u.createElement(N,{sideCar:A0,removeScrollBar:d,shards:h,noRelative:x,noIsolation:j,inert:v,setCallbacks:r,allowPinchZoom:!!y,lockRef:n,gapMode:b}),i?u.cloneElement(u.Children.only(o),us(us({},w),{ref:R})):u.createElement(p,us({},w,{className:c,ref:R}),o))});rd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rd.classNames={fullWidth:Ec,zeroRight:Tc};var GE=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VE(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=GE();return t&&e.setAttribute("nonce",t),e}function YE(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function FE(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var XE=function(){var e=0,t=null;return{add:function(n){e==0&&(t=VE())&&(YE(t,n),FE(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},KE=function(){var e=XE();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},M0=function(){var e=KE(),t=function(n){var a=n.styles,l=n.dynamic;return e(a,l),null};return t},QE={left:0,top:0,right:0,gap:0},Nf=function(e){return parseInt(e||"",10)||0},ZE=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],a=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[Nf(n),Nf(a),Nf(l)]},WE=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return QE;var t=ZE(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])}},JE=M0(),ar="data-scroll-locked",eA=function(e,t,n,a){var l=e.left,r=e.top,i=e.right,o=e.gap;return n===void 0&&(n="margin"),`
|
|
340
|
-
.`.concat(DE,` {
|
|
341
|
-
overflow: hidden `).concat(a,`;
|
|
342
|
-
padding-right: `).concat(o,"px ").concat(a,`;
|
|
343
|
-
}
|
|
344
|
-
body[`).concat(ar,`] {
|
|
345
|
-
overflow: hidden `).concat(a,`;
|
|
346
|
-
overscroll-behavior: contain;
|
|
347
|
-
`).concat([t&&"position: relative ".concat(a,";"),n==="margin"&&`
|
|
348
|
-
padding-left: `.concat(l,`px;
|
|
349
|
-
padding-top: `).concat(r,`px;
|
|
350
|
-
padding-right: `).concat(i,`px;
|
|
351
|
-
margin-left:0;
|
|
352
|
-
margin-top:0;
|
|
353
|
-
margin-right: `).concat(o,"px ").concat(a,`;
|
|
354
|
-
`),n==="padding"&&"padding-right: ".concat(o,"px ").concat(a,";")].filter(Boolean).join(""),`
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.`).concat(Tc,` {
|
|
358
|
-
right: `).concat(o,"px ").concat(a,`;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.`).concat(Ec,` {
|
|
362
|
-
margin-right: `).concat(o,"px ").concat(a,`;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.`).concat(Tc," .").concat(Tc,` {
|
|
366
|
-
right: 0 `).concat(a,`;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.`).concat(Ec," .").concat(Ec,` {
|
|
370
|
-
margin-right: 0 `).concat(a,`;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
body[`).concat(ar,`] {
|
|
374
|
-
`).concat(zE,": ").concat(o,`px;
|
|
375
|
-
}
|
|
376
|
-
`)},cv=function(){var e=parseInt(document.body.getAttribute(ar)||"0",10);return isFinite(e)?e:0},tA=function(){u.useEffect(function(){return document.body.setAttribute(ar,(cv()+1).toString()),function(){var e=cv()-1;e<=0?document.body.removeAttribute(ar):document.body.setAttribute(ar,e.toString())}},[])},nA=function(e){var t=e.noRelative,n=e.noImportant,a=e.gapMode,l=a===void 0?"margin":a;tA();var r=u.useMemo(function(){return WE(l)},[l]);return u.createElement(JE,{styles:eA(r,!t,l,n?"":"!important")})},qh=!1;if(typeof window<"u")try{var sc=Object.defineProperty({},"passive",{get:function(){return qh=!0,!0}});window.addEventListener("test",sc,sc),window.removeEventListener("test",sc,sc)}catch{qh=!1}var Sl=qh?{passive:!1}:!1,sA=function(e){return e.tagName==="TEXTAREA"},O0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!sA(e)&&n[t]==="visible")},aA=function(e){return O0(e,"overflowY")},lA=function(e){return O0(e,"overflowX")},uv=function(e,t){var n=t.ownerDocument,a=t;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=$0(e,a);if(l){var r=D0(e,a),i=r[1],o=r[2];if(i>o)return!0}a=a.parentNode}while(a&&a!==n.body);return!1},rA=function(e){var t=e.scrollTop,n=e.scrollHeight,a=e.clientHeight;return[t,n,a]},iA=function(e){var t=e.scrollLeft,n=e.scrollWidth,a=e.clientWidth;return[t,n,a]},$0=function(e,t){return e==="v"?aA(t):lA(t)},D0=function(e,t){return e==="v"?rA(t):iA(t)},oA=function(e,t){return e==="h"&&t==="rtl"?-1:1},cA=function(e,t,n,a,l){var r=oA(e,window.getComputedStyle(t).direction),i=r*a,o=n.target,c=t.contains(o),d=!1,f=i>0,h=0,m=0;do{if(!o)break;var x=D0(e,o),j=x[0],v=x[1],y=x[2],g=v-y-r*j;(j||g)&&$0(e,o)&&(h+=g,m+=j);var p=o.parentNode;o=p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE?p.host:p}while(!c&&o!==document.body||c&&(t.contains(o)||t===o));return(f&&Math.abs(h)<1||!f&&Math.abs(m)<1)&&(d=!0),d},ac=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dv=function(e){return[e.deltaX,e.deltaY]},fv=function(e){return e&&"current"in e?e.current:e},uA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dA=function(e){return`
|
|
377
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
378
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
379
|
-
`)},fA=0,Cl=[];function hA(e){var t=u.useRef([]),n=u.useRef([0,0]),a=u.useRef(),l=u.useState(fA++)[0],r=u.useState(M0)[0],i=u.useRef(e);u.useEffect(function(){i.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var v=$E([e.lockRef.current],(e.shards||[]).map(fv),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var o=u.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var g=ac(v),p=n.current,b="deltaX"in v?v.deltaX:p[0]-g[0],_="deltaY"in v?v.deltaY:p[1]-g[1],N,R=v.target,w=Math.abs(b)>Math.abs(_)?"h":"v";if("touches"in v&&w==="h"&&R.type==="range")return!1;var k=uv(w,R);if(!k)return!0;if(k?N=w:(N=w==="v"?"h":"v",k=uv(w,R)),!k)return!1;if(!a.current&&"changedTouches"in v&&(b||_)&&(a.current=N),!N)return!0;var L=a.current||N;return cA(L,y,v,L==="h"?b:_)},[]),c=u.useCallback(function(v){var y=v;if(!(!Cl.length||Cl[Cl.length-1]!==r)){var g="deltaY"in y?dv(y):ac(y),p=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&uA(N.delta,g)})[0];if(p&&p.should){y.cancelable&&y.preventDefault();return}if(!p){var b=(i.current.shards||[]).map(fv).filter(Boolean).filter(function(N){return N.contains(y.target)}),_=b.length>0?o(y,b[0]):!i.current.noIsolation;_&&y.cancelable&&y.preventDefault()}}},[]),d=u.useCallback(function(v,y,g,p){var b={name:v,delta:y,target:g,should:p,shadowParent:mA(g)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(_){return _!==b})},1)},[]),f=u.useCallback(function(v){n.current=ac(v),a.current=void 0},[]),h=u.useCallback(function(v){d(v.type,dv(v),v.target,o(v,e.lockRef.current))},[]),m=u.useCallback(function(v){d(v.type,ac(v),v.target,o(v,e.lockRef.current))},[]);u.useEffect(function(){return Cl.push(r),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Sl),document.addEventListener("touchmove",c,Sl),document.addEventListener("touchstart",f,Sl),function(){Cl=Cl.filter(function(v){return v!==r}),document.removeEventListener("wheel",c,Sl),document.removeEventListener("touchmove",c,Sl),document.removeEventListener("touchstart",f,Sl)}},[]);var x=e.removeScrollBar,j=e.inert;return u.createElement(u.Fragment,null,j?u.createElement(r,{styles:dA(l)}):null,x?u.createElement(nA,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pA=qE(A0,hA);var id=u.forwardRef(function(e,t){return u.createElement(rd,us({},e,{ref:t,sideCar:pA}))});id.classNames=rd.classNames;var xA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rl=new WeakMap,lc=new WeakMap,rc={},kf=0,z0=function(e){return e&&(e.host||z0(e.parentNode))},gA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var a=z0(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})},vA=function(e,t,n,a){var l=gA(t,Array.isArray(e)?e:[e]);rc[n]||(rc[n]=new WeakMap);var r=rc[n],i=[],o=new Set,c=new Set(l),d=function(h){!h||o.has(h)||(o.add(h),d(h.parentNode))};l.forEach(d);var f=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(m){if(o.has(m))f(m);else try{var x=m.getAttribute(a),j=x!==null&&x!=="false",v=(Rl.get(m)||0)+1,y=(r.get(m)||0)+1;Rl.set(m,v),r.set(m,y),i.push(m),v===1&&j&&lc.set(m,!0),y===1&&m.setAttribute(n,"true"),j||m.setAttribute(a,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return f(t),o.clear(),kf++,function(){i.forEach(function(h){var m=Rl.get(h)-1,x=r.get(h)-1;Rl.set(h,m),r.set(h,x),m||(lc.has(h)||h.removeAttribute(a),lc.delete(h)),x||h.removeAttribute(n)}),kf--,kf||(Rl=new WeakMap,Rl=new WeakMap,lc=new WeakMap,rc={})}},vp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var a=Array.from(Array.isArray(e)?e:[e]),l=xA(e);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),vA(a,l,n,"aria-hidden")):function(){return null}},od="Dialog",[L0]=Ns(od),[yA,ls]=L0(od),U0=e=>{const{__scopeDialog:t,children:n,open:a,defaultOpen:l,onOpenChange:r,modal:i=!0}=e,o=u.useRef(null),c=u.useRef(null),[d,f]=Oa({prop:a,defaultProp:l??!1,onChange:r,caller:od});return s.jsx(yA,{scope:t,triggerRef:o,contentRef:c,contentId:Zn(),titleId:Zn(),descriptionId:Zn(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(h=>!h),[f]),modal:i,children:n})};U0.displayName=od;var B0="DialogTrigger",bA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=ls(B0,n),r=Ie(t,l.triggerRef);return s.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":jp(l.open),...a,ref:r,onClick:ce(e.onClick,l.onOpenToggle)})});bA.displayName=B0;var yp="DialogPortal",[jA,H0]=L0(yp,{forceMount:void 0}),I0=e=>{const{__scopeDialog:t,forceMount:n,children:a,container:l}=e,r=ls(yp,t);return s.jsx(jA,{scope:t,forceMount:n,children:u.Children.map(a,i=>s.jsx(Dn,{present:n||r.open,children:s.jsx(ko,{asChild:!0,container:l,children:i})}))})};I0.displayName=yp;var xu="DialogOverlay",P0=u.forwardRef((e,t)=>{const n=H0(xu,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,r=ls(xu,e.__scopeDialog);return r.modal?s.jsx(Dn,{present:a||r.open,children:s.jsx(wA,{...l,ref:t})}):null});P0.displayName=xu;var _A=ul("DialogOverlay.RemoveScroll"),wA=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=ls(xu,n);return s.jsx(id,{as:_A,allowPinchZoom:!0,shards:[l.contentRef],children:s.jsx(we.div,{"data-state":jp(l.open),...a,ref:t,style:{pointerEvents:"auto",...a.style}})})}),dl="DialogContent",q0=u.forwardRef((e,t)=>{const n=H0(dl,e.__scopeDialog),{forceMount:a=n.forceMount,...l}=e,r=ls(dl,e.__scopeDialog);return s.jsx(Dn,{present:a||r.open,children:r.modal?s.jsx(NA,{...l,ref:t}):s.jsx(kA,{...l,ref:t})})});q0.displayName=dl;var NA=u.forwardRef((e,t)=>{const n=ls(dl,e.__scopeDialog),a=u.useRef(null),l=Ie(t,n.contentRef,a);return u.useEffect(()=>{const r=a.current;if(r)return vp(r)},[]),s.jsx(G0,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ce(e.onCloseAutoFocus,r=>{var i;r.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:ce(e.onPointerDownOutside,r=>{const i=r.detail.originalEvent,o=i.button===0&&i.ctrlKey===!0;(i.button===2||o)&&r.preventDefault()}),onFocusOutside:ce(e.onFocusOutside,r=>r.preventDefault())})}),kA=u.forwardRef((e,t)=>{const n=ls(dl,e.__scopeDialog),a=u.useRef(!1),l=u.useRef(!1);return s.jsx(G0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var i,o;(i=e.onCloseAutoFocus)==null||i.call(e,r),r.defaultPrevented||(a.current||(o=n.triggerRef.current)==null||o.focus(),r.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:r=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const i=r.target;((d=n.triggerRef.current)==null?void 0:d.contains(i))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&l.current&&r.preventDefault()}})}),G0=u.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:r,...i}=e,o=ls(dl,n),c=u.useRef(null),d=Ie(t,c);return gp(),s.jsxs(s.Fragment,{children:[s.jsx(ld,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:r,children:s.jsx(No,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":jp(o.open),...i,ref:d,onDismiss:()=>o.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(SA,{titleId:o.titleId}),s.jsx(RA,{contentRef:c,descriptionId:o.descriptionId})]})]})}),bp="DialogTitle",V0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=ls(bp,n);return s.jsx(we.h2,{id:l.titleId,...a,ref:t})});V0.displayName=bp;var Y0="DialogDescription",F0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=ls(Y0,n);return s.jsx(we.p,{id:l.descriptionId,...a,ref:t})});F0.displayName=Y0;var X0="DialogClose",K0=u.forwardRef((e,t)=>{const{__scopeDialog:n,...a}=e,l=ls(X0,n);return s.jsx(we.button,{type:"button",...a,ref:t,onClick:ce(e.onClick,()=>l.onOpenChange(!1))})});K0.displayName=X0;function jp(e){return e?"open":"closed"}var Q0="DialogTitleWarning",[J6,Z0]=tE(Q0,{contentName:dl,titleName:bp,docsSlug:"dialog"}),SA=({titleId:e})=>{const t=Z0(Q0),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
380
|
-
|
|
381
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
382
|
-
|
|
383
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},CA="DialogDescriptionWarning",RA=({contentRef:e,descriptionId:t})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Z0(CA).contentName}}.`;return u.useEffect(()=>{var r;const l=(r=e.current)==null?void 0:r.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(a))},[a,e,t]),null},W0=U0,J0=I0,e_=P0,t_=q0,n_=V0,s_=F0,_p=K0;function vn({className:e,...t}){return s.jsx(CR,{role:"status","aria-label":"Loading",className:ie("size-4 animate-spin",e),...t})}const lr="aria-pressed:border aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:text-accent-foreground",TA="border border-primary bg-accent text-accent-foreground hover:bg-accent",cd=wo("inline-flex items-center justify-center whitespace-nowrap rounded-md font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",warning:"bg-warning text-warning-foreground hover:bg-warning/90",success:"bg-success text-success-foreground hover:bg-success/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",text:"underline-offset-2 hover:underline"},size:{"inline-sm":"p-1 text-sm",inline:"p-1 text-base",default:"h-9 px-4 py-2 text-sm",sm:"h-8 px-3 text-sm",control:"h-7 px-2 text-xs",lg:"h-10 px-6 text-base",icon:"size-9 text-sm","sm-icon":"size-8 text-sm","control-icon":"size-7 text-xs","xs-icon":"size-6 text-xs"}},defaultVariants:{variant:"default",size:"default"}}),q=u.forwardRef(({className:e,disabled:t,variant:n,size:a,asChild:l=!1,loading:r,children:i,...o},c)=>{const d=l?oE:"button",f=a==="icon"||a==="sm-icon"||a==="control-icon"||a==="xs-icon",h=s.jsx(vn,{"aria-hidden":"true","aria-label":void 0,role:void 0,className:ie(!f&&"mr-2")}),m=l?i:r&&f?h:s.jsxs(s.Fragment,{children:[r?h:null,i]});return s.jsx(d,{className:ie(cd({variant:n,size:a,className:e})),ref:c,disabled:t||r,...o,children:m})});q.displayName="Button";const a_=u.createContext(null);function EA({container:e,children:t}){return s.jsx(a_.Provider,{value:e,children:t})}function So(){return u.useContext(a_)??void 0}function l_(e){return s.jsx(W0,{"data-slot":"alert-dialog",...e})}function AA({className:e,...t}){return s.jsx(e_,{"data-slot":"alert-dialog-overlay",className:ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function r_({className:e,onOpenAutoFocus:t,onPointerDownOutside:n,onInteractOutside:a,...l}){return s.jsxs(J0,{container:So(),children:[s.jsx(AA,{}),s.jsx(t_,{"data-slot":"alert-dialog-content",role:"alertdialog",className:ie("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),onOpenAutoFocus:r=>{if(t==null||t(r),r.defaultPrevented)return;const i=r.currentTarget,o=i instanceof HTMLElement?i.querySelector('[data-slot="alert-dialog-cancel"]'):null;o&&(r.preventDefault(),o.focus())},onPointerDownOutside:r=>{n==null||n(r),r.preventDefault()},onInteractOutside:r=>{a==null||a(r),r.preventDefault()},...l})]})}function i_({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-header",className:ie("flex flex-col gap-2 text-center sm:text-left",e),...t})}function o_({className:e,...t}){return s.jsx("div",{"data-slot":"alert-dialog-footer",className:ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function c_({className:e,...t}){return s.jsx(n_,{"data-slot":"alert-dialog-title",className:ie("text-lg font-semibold",e),...t})}function u_({className:e,...t}){return s.jsx(s_,{"data-slot":"alert-dialog-description",className:ie("text-muted-foreground text-sm",e),...t})}function d_({className:e,variant:t,...n}){return s.jsx(_p,{"data-slot":"alert-dialog-action",className:ie(cd({variant:t}),e),...n})}function f_({className:e,...t}){return s.jsx(_p,{"data-slot":"alert-dialog-cancel",className:ie(cd({variant:"outline"}),e),...t})}function MA(){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 OA(e,t){t!=null&&t.isConnected&&(e.preventDefault(),t.focus())}function Co(){const[e,t]=u.useState(null),n=u.useRef(null),a=u.useRef(null),l=u.useCallback(o=>{var c;(c=n.current)==null||c.resolve(o),n.current=null,t(null)},[]),r=u.useCallback(o=>new Promise(c=>{var f;(f=n.current)==null||f.resolve(!1),a.current=MA();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(l_,{open:e!==null,onOpenChange:o=>{o||l(!1)},children:s.jsxs(r_,{onCloseAutoFocus:o=>OA(o,a.current),children:[s.jsxs(i_,{children:[s.jsx(c_,{children:e==null?void 0:e.title}),s.jsx(u_,{className:"whitespace-pre-line",children:e==null?void 0:e.description})]}),s.jsxs(o_,{children:[s.jsx(f_,{children:"Cancel"}),s.jsx(d_,{variant:e!=null&&e.destructive?"destructive":"default",onClick:()=>l(!0),children:e==null?void 0:e.action_label})]})]})});return{confirm:r,confirm_dialog:i}}const Ds="px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",$A=wo("inline-flex items-center rounded-md border transition-colors",{variants:{variant:{default:`${Ds} border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80`,secondary:`${Ds} border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`${Ds} border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80`,outline:`${Ds} text-foreground`,success:`${Ds} border-success/40 bg-success/10 text-success`,warning:`${Ds} border-warning/40 bg-warning/10 text-warning`,info:`${Ds} border-info/40 bg-info/10 text-info`,error:`${Ds} border-destructive/40 bg-destructive/10 text-destructive`,neutral:`${Ds} 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 he({className:e,variant:t,size:n,...a}){return s.jsx("div",{className:ie($A({variant:t,size:n}),e),...a})}function h_(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 m_(e){const[t,n]=u.useState(void 0);return Pt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const a=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const r=l[0];let i,o;if("borderBoxSize"in r){const c=r.borderBoxSize,d=Array.isArray(c)?c[0]:c;i=d.inlineSize,o=d.blockSize}else i=e.offsetWidth,o=e.offsetHeight;n({width:i,height:o})});return a.observe(e,{box:"border-box"}),()=>a.unobserve(e)}else n(void 0)},[e]),t}var ud="Checkbox",[DA]=Ns(ud),[zA,wp]=DA(ud);function LA(e){const{__scopeCheckbox:t,checked:n,children:a,defaultChecked:l,disabled:r,form:i,name:o,onCheckedChange:c,required:d,value:f="on",internal_do_not_use_render:h}=e,[m,x]=Oa({prop:n,defaultProp:l??!1,onChange:c,caller:ud}),[j,v]=u.useState(null),[y,g]=u.useState(null),p=u.useRef(!1),b=j?!!i||!!j.closest("form"):!0,_={checked:m,disabled:r,setChecked:x,control:j,setControl:v,name:o,form:i,value:f,hasConsumerStoppedPropagationRef:p,required:d,defaultChecked:Ta(l)?!1:l,isFormControl:b,bubbleInput:y,setBubbleInput:g};return s.jsx(zA,{scope:t,..._,children:UA(h)?h(_):a})}var p_="CheckboxTrigger",x_=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...a},l)=>{const{control:r,value:i,disabled:o,checked:c,required:d,setControl:f,setChecked:h,hasConsumerStoppedPropagationRef:m,isFormControl:x,bubbleInput:j}=wp(p_,e),v=Ie(l,f),y=u.useRef(c);return u.useEffect(()=>{const g=r==null?void 0:r.form;if(g){const p=()=>h(y.current);return g.addEventListener("reset",p),()=>g.removeEventListener("reset",p)}},[r,h]),s.jsx(we.button,{type:"button",role:"checkbox","aria-checked":Ta(c)?"mixed":c,"aria-required":d,"data-state":j_(c),"data-disabled":o?"":void 0,disabled:o,value:i,...a,ref:v,onKeyDown:ce(t,g=>{g.key==="Enter"&&g.preventDefault()}),onClick:ce(n,g=>{h(p=>Ta(p)?!0:!p),j&&x&&(m.current=g.isPropagationStopped(),m.current||g.stopPropagation())})})});x_.displayName=p_;var Np=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:a,checked:l,defaultChecked:r,required:i,disabled:o,value:c,onCheckedChange:d,form:f,...h}=e;return s.jsx(LA,{__scopeCheckbox:n,checked:l,defaultChecked:r,disabled:o,required:i,onCheckedChange:d,name:a,form:f,value:c,internal_do_not_use_render:({isFormControl:m})=>s.jsxs(s.Fragment,{children:[s.jsx(x_,{...h,ref:t,__scopeCheckbox:n}),m&&s.jsx(b_,{__scopeCheckbox:n})]})})});Np.displayName=ud;var g_="CheckboxIndicator",v_=u.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:a,...l}=e,r=wp(g_,n);return s.jsx(Dn,{present:a||Ta(r.checked)||r.checked===!0,children:s.jsx(we.span,{"data-state":j_(r.checked),"data-disabled":r.disabled?"":void 0,...l,ref:t,style:{pointerEvents:"none",...e.style}})})});v_.displayName=g_;var y_="CheckboxBubbleInput",b_=u.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:a,hasConsumerStoppedPropagationRef:l,checked:r,defaultChecked:i,required:o,disabled:c,name:d,value:f,form:h,bubbleInput:m,setBubbleInput:x}=wp(y_,e),j=Ie(n,x),v=h_(r),y=m_(a);u.useEffect(()=>{const p=m;if(!p)return;const b=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(b,"checked").set,R=!l.current;if(v!==r&&N){const w=new Event("click",{bubbles:R});p.indeterminate=Ta(r),N.call(p,Ta(r)?!1:r),p.dispatchEvent(w)}},[m,v,r,l]);const g=u.useRef(Ta(r)?!1:r);return s.jsx(we.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??g.current,required:o,disabled:c,name:d,value:f,form:h,...t,tabIndex:-1,ref:j,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});b_.displayName=y_;function UA(e){return typeof e=="function"}function Ta(e){return e==="indeterminate"}function j_(e){return Ta(e)?"indeterminate":e?"checked":"unchecked"}const Lr=u.forwardRef(({className:e,...t},n)=>s.jsx(Np,{ref:n,className:ie("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=indeterminate]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:text-primary-foreground",e),...t,children:s.jsx(v_,{className:ie("flex items-center justify-center text-current"),children:t.checked==="indeterminate"?s.jsx(OR,{className:"size-4","aria-hidden":"true"}):s.jsx(Or,{className:"size-4","aria-hidden":"true"})})}));Lr.displayName=Np.displayName;const BA=wo("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 zn({...e}){return s.jsx(W0,{"data-slot":"dialog",...e})}function HA({...e}){const t=So();return s.jsx(J0,{"data-slot":"dialog-portal",container:t,...e})}function IA({className:e,...t}){return s.jsx(e_,{"data-slot":"dialog-overlay",className:ie("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Ln({className:e,children:t,showCloseButton:n=!0,size:a,...l}){return s.jsxs(HA,{"data-slot":"dialog-portal",children:[s.jsx(IA,{}),s.jsxs(t_,{"data-slot":"dialog-content",className:ie(BA({size:a}),e),...l,children:[t,n&&s.jsxs(_p,{"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(nd,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Un({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:ie("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Bn({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-footer",className:ie("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Hn({className:e,...t}){return s.jsx(n_,{"data-slot":"dialog-title",className:ie("text-lg leading-none font-semibold",e),...t})}function In({className:e,...t}){return s.jsx(s_,{"data-slot":"dialog-description",className:ie("text-muted-foreground text-sm",e),...t})}function kp(e){const t=e+"CollectionProvider",[n,a]=Ns(t),[l,r]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:y,children:g}=v,p=ra.useRef(null),b=ra.useRef(new Map).current;return s.jsx(l,{scope:y,itemMap:b,collectionRef:p,children:g})};i.displayName=t;const o=e+"CollectionSlot",c=ul(o),d=ra.forwardRef((v,y)=>{const{scope:g,children:p}=v,b=r(o,g),_=Ie(y,b.collectionRef);return s.jsx(c,{ref:_,children:p})});d.displayName=o;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=ul(f),x=ra.forwardRef((v,y)=>{const{scope:g,children:p,...b}=v,_=ra.useRef(null),N=Ie(y,_),R=r(f,g);return ra.useEffect(()=>(R.itemMap.set(_,{ref:_,...b}),()=>void R.itemMap.delete(_))),s.jsx(m,{[h]:"",ref:N,children:p})});x.displayName=f;function j(v){const y=r(e+"CollectionConsumer",v);return ra.useCallback(()=>{const p=y.collectionRef.current;if(!p)return[];const b=Array.from(p.querySelectorAll(`[${h}]`));return Array.from(y.itemMap.values()).sort((R,w)=>b.indexOf(R.ref.current)-b.indexOf(w.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:i,Slot:d,ItemSlot:x},j,a]}var PA=u.createContext(void 0);function dd(e){const t=u.useContext(PA);return e||t||"ltr"}const qA=["top","right","bottom","left"],$a=Math.min,un=Math.max,gu=Math.round,ic=Math.floor,vs=e=>({x:e,y:e}),GA={left:"right",right:"left",bottom:"top",top:"bottom"},VA={start:"end",end:"start"};function Gh(e,t,n){return un(e,$a(t,n))}function Qs(e,t){return typeof e=="function"?e(t):e}function Zs(e){return e.split("-")[0]}function Ur(e){return e.split("-")[1]}function Sp(e){return e==="x"?"y":"x"}function Cp(e){return e==="y"?"height":"width"}function hs(e){return["top","bottom"].includes(Zs(e))?"y":"x"}function Rp(e){return Sp(hs(e))}function YA(e,t,n){n===void 0&&(n=!1);const a=Ur(e),l=Rp(e),r=Cp(l);let i=l==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(i=vu(i)),[i,vu(i)]}function FA(e){const t=vu(e);return[Vh(e),t,Vh(t)]}function Vh(e){return e.replace(/start|end/g,t=>VA[t])}function XA(e,t,n){const a=["left","right"],l=["right","left"],r=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?l:a:t?a:l;case"left":case"right":return t?r:i;default:return[]}}function KA(e,t,n,a){const l=Ur(e);let r=XA(Zs(e),n==="start",a);return l&&(r=r.map(i=>i+"-"+l),t&&(r=r.concat(r.map(Vh)))),r}function vu(e){return e.replace(/left|right|bottom|top/g,t=>GA[t])}function QA(e){return{top:0,right:0,bottom:0,left:0,...e}}function __(e){return typeof e!="number"?QA(e):{top:e,right:e,bottom:e,left:e}}function yu(e){const{x:t,y:n,width:a,height:l}=e;return{width:a,height:l,top:n,left:t,right:t+a,bottom:n+l,x:t,y:n}}function hv(e,t,n){let{reference:a,floating:l}=e;const r=hs(t),i=Rp(t),o=Cp(i),c=Zs(t),d=r==="y",f=a.x+a.width/2-l.width/2,h=a.y+a.height/2-l.height/2,m=a[o]/2-l[o]/2;let x;switch(c){case"top":x={x:f,y:a.y-l.height};break;case"bottom":x={x:f,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:h};break;case"left":x={x:a.x-l.width,y:h};break;default:x={x:a.x,y:a.y}}switch(Ur(t)){case"start":x[i]-=m*(n&&d?-1:1);break;case"end":x[i]+=m*(n&&d?-1:1);break}return x}const ZA=async(e,t,n)=>{const{placement:a="bottom",strategy:l="absolute",middleware:r=[],platform:i}=n,o=r.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:l}),{x:f,y:h}=hv(d,a,c),m=a,x={},j=0;for(let v=0;v<o.length;v++){const{name:y,fn:g}=o[v],{x:p,y:b,data:_,reset:N}=await g({x:f,y:h,initialPlacement:a,placement:m,strategy:l,middlewareData:x,rects:d,platform:i,elements:{reference:e,floating:t}});f=p??f,h=b??h,x={...x,[y]:{...x[y],..._}},N&&j<=50&&(j++,typeof N=="object"&&(N.placement&&(m=N.placement),N.rects&&(d=N.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:l}):N.rects),{x:f,y:h}=hv(d,m,c)),v=-1)}return{x:f,y:h,placement:m,strategy:l,middlewareData:x}};async function Fi(e,t){var n;t===void 0&&(t={});const{x:a,y:l,platform:r,rects:i,elements:o,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:m=!1,padding:x=0}=Qs(t,e),j=__(x),y=o[m?h==="floating"?"reference":"floating":h],g=yu(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(y)))==null||n?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(o.floating)),boundary:d,rootBoundary:f,strategy:c})),p=h==="floating"?{x:a,y:l,width:i.floating.width,height:i.floating.height}:i.reference,b=await(r.getOffsetParent==null?void 0:r.getOffsetParent(o.floating)),_=await(r.isElement==null?void 0:r.isElement(b))?await(r.getScale==null?void 0:r.getScale(b))||{x:1,y:1}:{x:1,y:1},N=yu(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:p,offsetParent:b,strategy:c}):p);return{top:(g.top-N.top+j.top)/_.y,bottom:(N.bottom-g.bottom+j.bottom)/_.y,left:(g.left-N.left+j.left)/_.x,right:(N.right-g.right+j.right)/_.x}}const WA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:a,placement:l,rects:r,platform:i,elements:o,middlewareData:c}=t,{element:d,padding:f=0}=Qs(e,t)||{};if(d==null)return{};const h=__(f),m={x:n,y:a},x=Rp(l),j=Cp(x),v=await i.getDimensions(d),y=x==="y",g=y?"top":"left",p=y?"bottom":"right",b=y?"clientHeight":"clientWidth",_=r.reference[j]+r.reference[x]-m[x]-r.floating[j],N=m[x]-r.reference[x],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let w=R?R[b]:0;(!w||!await(i.isElement==null?void 0:i.isElement(R)))&&(w=o.floating[b]||r.floating[j]);const k=_/2-N/2,L=w/2-v[j]/2-1,D=$a(h[g],L),K=$a(h[p],L),G=D,U=w-v[j]-K,M=w/2-v[j]/2+k,A=Gh(G,M,U),S=!c.arrow&&Ur(l)!=null&&M!==A&&r.reference[j]/2-(M<G?D:K)-v[j]/2<0,E=S?M<G?M-G:M-U:0;return{[x]:m[x]+E,data:{[x]:A,centerOffset:M-A-E,...S&&{alignmentOffset:E}},reset:S}}}),JA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:l,middlewareData:r,rects:i,initialPlacement:o,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:j="none",flipAlignment:v=!0,...y}=Qs(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const g=Zs(l),p=hs(o),b=Zs(o)===o,_=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=m||(b||!v?[vu(o)]:FA(o)),R=j!=="none";!m&&R&&N.push(...KA(o,v,j,_));const w=[o,...N],k=await Fi(t,y),L=[];let D=((a=r.flip)==null?void 0:a.overflows)||[];if(f&&L.push(k[g]),h){const M=YA(l,i,_);L.push(k[M[0]],k[M[1]])}if(D=[...D,{placement:l,overflows:L}],!L.every(M=>M<=0)){var K,G;const M=(((K=r.flip)==null?void 0:K.index)||0)+1,A=w[M];if(A&&(!(h==="alignment"?p!==hs(A):!1)||D.every(C=>C.overflows[0]>0&&hs(C.placement)===p)))return{data:{index:M,overflows:D},reset:{placement:A}};let S=(G=D.filter(E=>E.overflows[0]<=0).sort((E,C)=>E.overflows[1]-C.overflows[1])[0])==null?void 0:G.placement;if(!S)switch(x){case"bestFit":{var U;const E=(U=D.filter(C=>{if(R){const $=hs(C.placement);return $===p||$==="y"}return!0}).map(C=>[C.placement,C.overflows.filter($=>$>0).reduce(($,X)=>$+X,0)]).sort((C,$)=>C[1]-$[1])[0])==null?void 0:U[0];E&&(S=E);break}case"initialPlacement":S=o;break}if(l!==S)return{reset:{placement:S}}}return{}}}};function mv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pv(e){return qA.some(t=>e[t]>=0)}const eM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:a="referenceHidden",...l}=Qs(e,t);switch(a){case"referenceHidden":{const r=await Fi(t,{...l,elementContext:"reference"}),i=mv(r,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:pv(i)}}}case"escaped":{const r=await Fi(t,{...l,altBoundary:!0}),i=mv(r,n.floating);return{data:{escapedOffsets:i,escaped:pv(i)}}}default:return{}}}}};async function tM(e,t){const{placement:n,platform:a,elements:l}=e,r=await(a.isRTL==null?void 0:a.isRTL(l.floating)),i=Zs(n),o=Ur(n),c=hs(n)==="y",d=["left","top"].includes(i)?-1:1,f=r&&c?-1:1,h=Qs(t,e);let{mainAxis:m,crossAxis:x,alignmentAxis:j}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&typeof j=="number"&&(x=o==="end"?j*-1:j),c?{x:x*f,y:m*d}:{x:m*d,y:x*f}}const nM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:l,y:r,placement:i,middlewareData:o}=t,c=await tM(t,e);return i===((n=o.offset)==null?void 0:n.placement)&&(a=o.arrow)!=null&&a.alignmentOffset?{}:{x:l+c.x,y:r+c.y,data:{...c,placement:i}}}}},sM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:l}=t,{mainAxis:r=!0,crossAxis:i=!1,limiter:o={fn:y=>{let{x:g,y:p}=y;return{x:g,y:p}}},...c}=Qs(e,t),d={x:n,y:a},f=await Fi(t,c),h=hs(Zs(l)),m=Sp(h);let x=d[m],j=d[h];if(r){const y=m==="y"?"top":"left",g=m==="y"?"bottom":"right",p=x+f[y],b=x-f[g];x=Gh(p,x,b)}if(i){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",p=j+f[y],b=j-f[g];j=Gh(p,j,b)}const v=o.fn({...t,[m]:x,[h]:j});return{...v,data:{x:v.x-n,y:v.y-a,enabled:{[m]:r,[h]:i}}}}}},aM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:l,rects:r,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:d=!0}=Qs(e,t),f={x:n,y:a},h=hs(l),m=Sp(h);let x=f[m],j=f[h];const v=Qs(o,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const b=m==="y"?"height":"width",_=r.reference[m]-r.floating[b]+y.mainAxis,N=r.reference[m]+r.reference[b]-y.mainAxis;x<_?x=_:x>N&&(x=N)}if(d){var g,p;const b=m==="y"?"width":"height",_=["top","left"].includes(Zs(l)),N=r.reference[h]-r.floating[b]+(_&&((g=i.offset)==null?void 0:g[h])||0)+(_?0:y.crossAxis),R=r.reference[h]+r.reference[b]+(_?0:((p=i.offset)==null?void 0:p[h])||0)-(_?y.crossAxis:0);j<N?j=N:j>R&&(j=R)}return{[m]:x,[h]:j}}}},lM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:l,rects:r,platform:i,elements:o}=t,{apply:c=()=>{},...d}=Qs(e,t),f=await Fi(t,d),h=Zs(l),m=Ur(l),x=hs(l)==="y",{width:j,height:v}=r.floating;let y,g;h==="top"||h==="bottom"?(y=h,g=m===(await(i.isRTL==null?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=h,y=m==="end"?"top":"bottom");const p=v-f.top-f.bottom,b=j-f.left-f.right,_=$a(v-f[y],p),N=$a(j-f[g],b),R=!t.middlewareData.shift;let w=_,k=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=b),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(w=p),R&&!m){const D=un(f.left,0),K=un(f.right,0),G=un(f.top,0),U=un(f.bottom,0);x?k=j-2*(D!==0||K!==0?D+K:un(f.left,f.right)):w=v-2*(G!==0||U!==0?G+U:un(f.top,f.bottom))}await c({...t,availableWidth:k,availableHeight:w});const L=await i.getDimensions(o.floating);return j!==L.width||v!==L.height?{reset:{rects:!0}}:{}}}};function fd(){return typeof window<"u"}function Br(e){return w_(e)?(e.nodeName||"").toLowerCase():"#document"}function xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ks(e){var t;return(t=(w_(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function w_(e){return fd()?e instanceof Node||e instanceof xn(e).Node:!1}function es(e){return fd()?e instanceof Element||e instanceof xn(e).Element:!1}function js(e){return fd()?e instanceof HTMLElement||e instanceof xn(e).HTMLElement:!1}function xv(e){return!fd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof xn(e).ShadowRoot}function Ro(e){const{overflow:t,overflowX:n,overflowY:a,display:l}=ts(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!["inline","contents"].includes(l)}function rM(e){return["table","td","th"].includes(Br(e))}function hd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Tp(e){const t=Ep(),n=es(e)?ts(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 iM(e){let t=Da(e);for(;js(t)&&!jr(t);){if(Tp(t))return t;if(hd(t))return null;t=Da(t)}return null}function Ep(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jr(e){return["html","body","#document"].includes(Br(e))}function ts(e){return xn(e).getComputedStyle(e)}function md(e){return es(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Da(e){if(Br(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xv(e)&&e.host||ks(e);return xv(t)?t.host:t}function N_(e){const t=Da(e);return jr(t)?e.ownerDocument?e.ownerDocument.body:e.body:js(t)&&Ro(t)?t:N_(t)}function Xi(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const l=N_(e),r=l===((a=e.ownerDocument)==null?void 0:a.body),i=xn(l);if(r){const o=Yh(i);return t.concat(i,i.visualViewport||[],Ro(l)?l:[],o&&n?Xi(o):[])}return t.concat(l,Xi(l,[],n))}function Yh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function k_(e){const t=ts(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const l=js(e),r=l?e.offsetWidth:n,i=l?e.offsetHeight:a,o=gu(n)!==r||gu(a)!==i;return o&&(n=r,a=i),{width:n,height:a,$:o}}function Ap(e){return es(e)?e:e.contextElement}function rr(e){const t=Ap(e);if(!js(t))return vs(1);const n=t.getBoundingClientRect(),{width:a,height:l,$:r}=k_(t);let i=(r?gu(n.width):n.width)/a,o=(r?gu(n.height):n.height)/l;return(!i||!Number.isFinite(i))&&(i=1),(!o||!Number.isFinite(o))&&(o=1),{x:i,y:o}}const oM=vs(0);function S_(e){const t=xn(e);return!Ep()||!t.visualViewport?oM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==xn(e)?!1:t}function fl(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect(),r=Ap(e);let i=vs(1);t&&(a?es(a)&&(i=rr(a)):i=rr(e));const o=cM(r,n,a)?S_(r):vs(0);let c=(l.left+o.x)/i.x,d=(l.top+o.y)/i.y,f=l.width/i.x,h=l.height/i.y;if(r){const m=xn(r),x=a&&es(a)?xn(a):a;let j=m,v=Yh(j);for(;v&&a&&x!==j;){const y=rr(v),g=v.getBoundingClientRect(),p=ts(v),b=g.left+(v.clientLeft+parseFloat(p.paddingLeft))*y.x,_=g.top+(v.clientTop+parseFloat(p.paddingTop))*y.y;c*=y.x,d*=y.y,f*=y.x,h*=y.y,c+=b,d+=_,j=xn(v),v=Yh(j)}}return yu({width:f,height:h,x:c,y:d})}function Mp(e,t){const n=md(e).scrollLeft;return t?t.left+n:fl(ks(e)).left+n}function C_(e,t,n){n===void 0&&(n=!1);const a=e.getBoundingClientRect(),l=a.left+t.scrollLeft-(n?0:Mp(e,a)),r=a.top+t.scrollTop;return{x:l,y:r}}function uM(e){let{elements:t,rect:n,offsetParent:a,strategy:l}=e;const r=l==="fixed",i=ks(a),o=t?hd(t.floating):!1;if(a===i||o&&r)return n;let c={scrollLeft:0,scrollTop:0},d=vs(1);const f=vs(0),h=js(a);if((h||!h&&!r)&&((Br(a)!=="body"||Ro(i))&&(c=md(a)),js(a))){const x=fl(a);d=rr(a),f.x=x.x+a.clientLeft,f.y=x.y+a.clientTop}const m=i&&!h&&!r?C_(i,c,!0):vs(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 dM(e){return Array.from(e.getClientRects())}function fM(e){const t=ks(e),n=md(e),a=e.ownerDocument.body,l=un(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),r=un(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+Mp(e);const o=-n.scrollTop;return ts(a).direction==="rtl"&&(i+=un(t.clientWidth,a.clientWidth)-l),{width:l,height:r,x:i,y:o}}function hM(e,t){const n=xn(e),a=ks(e),l=n.visualViewport;let r=a.clientWidth,i=a.clientHeight,o=0,c=0;if(l){r=l.width,i=l.height;const d=Ep();(!d||d&&t==="fixed")&&(o=l.offsetLeft,c=l.offsetTop)}return{width:r,height:i,x:o,y:c}}function mM(e,t){const n=fl(e,!0,t==="fixed"),a=n.top+e.clientTop,l=n.left+e.clientLeft,r=js(e)?rr(e):vs(1),i=e.clientWidth*r.x,o=e.clientHeight*r.y,c=l*r.x,d=a*r.y;return{width:i,height:o,x:c,y:d}}function gv(e,t,n){let a;if(t==="viewport")a=hM(e,n);else if(t==="document")a=fM(ks(e));else if(es(t))a=mM(t,n);else{const l=S_(e);a={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return yu(a)}function R_(e,t){const n=Da(e);return n===t||!es(n)||jr(n)?!1:ts(n).position==="fixed"||R_(n,t)}function pM(e,t){const n=t.get(e);if(n)return n;let a=Xi(e,[],!1).filter(o=>es(o)&&Br(o)!=="body"),l=null;const r=ts(e).position==="fixed";let i=r?Da(e):e;for(;es(i)&&!jr(i);){const o=ts(i),c=Tp(i);!c&&o.position==="fixed"&&(l=null),(r?!c&&!l:!c&&o.position==="static"&&!!l&&["absolute","fixed"].includes(l.position)||Ro(i)&&!c&&R_(e,i))?a=a.filter(f=>f!==i):l=o,i=Da(i)}return t.set(e,a),a}function xM(e){let{element:t,boundary:n,rootBoundary:a,strategy:l}=e;const i=[...n==="clippingAncestors"?hd(t)?[]:pM(t,this._c):[].concat(n),a],o=i[0],c=i.reduce((d,f)=>{const h=gv(t,f,l);return d.top=un(h.top,d.top),d.right=$a(h.right,d.right),d.bottom=$a(h.bottom,d.bottom),d.left=un(h.left,d.left),d},gv(t,o,l));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function gM(e){const{width:t,height:n}=k_(e);return{width:t,height:n}}function vM(e,t,n){const a=js(t),l=ks(t),r=n==="fixed",i=fl(e,!0,r,t);let o={scrollLeft:0,scrollTop:0};const c=vs(0);function d(){c.x=Mp(l)}if(a||!a&&!r)if((Br(t)!=="body"||Ro(l))&&(o=md(t)),a){const x=fl(t,!0,r,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else l&&d();r&&!a&&l&&d();const f=l&&!a&&!r?C_(l,o):vs(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 ts(e).position==="static"}function vv(e,t){if(!js(e)||ts(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ks(e)===n&&(n=n.ownerDocument.body),n}function T_(e,t){const n=xn(e);if(hd(e))return n;if(!js(e)){let l=Da(e);for(;l&&!jr(l);){if(es(l)&&!Sf(l))return l;l=Da(l)}return n}let a=vv(e,t);for(;a&&rM(a)&&Sf(a);)a=vv(a,t);return a&&jr(a)&&Sf(a)&&!Tp(a)?n:a||iM(e)||n}const yM=async function(e){const t=this.getOffsetParent||T_,n=this.getDimensions,a=await n(e.floating);return{reference:vM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function bM(e){return ts(e).direction==="rtl"}const jM={convertOffsetParentRelativeRectToViewportRelativeRect:uM,getDocumentElement:ks,getClippingRect:xM,getOffsetParent:T_,getElementRects:yM,getClientRects:dM,getDimensions:gM,getScale:rr,isElement:es,isRTL:bM};function E_(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _M(e,t){let n=null,a;const l=ks(e);function r(){var o;clearTimeout(a),(o=n)==null||o.disconnect(),n=null}function i(o,c){o===void 0&&(o=!1),c===void 0&&(c=1),r();const d=e.getBoundingClientRect(),{left:f,top:h,width:m,height:x}=d;if(o||t(),!m||!x)return;const j=ic(h),v=ic(l.clientWidth-(f+m)),y=ic(l.clientHeight-(h+x)),g=ic(f),b={rootMargin:-j+"px "+-v+"px "+-y+"px "+-g+"px",threshold:un(0,$a(1,c))||1};let _=!0;function N(R){const w=R[0].intersectionRatio;if(w!==c){if(!_)return i();w?i(!1,w):a=setTimeout(()=>{i(!1,1e-7)},1e3)}w===1&&!E_(d,e.getBoundingClientRect())&&i(),_=!1}try{n=new IntersectionObserver(N,{...b,root:l.ownerDocument})}catch{n=new IntersectionObserver(N,b)}n.observe(e)}return i(!0),r}function wM(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:r=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:o=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=Ap(e),f=l||r?[...d?Xi(d):[],...Xi(t)]:[];f.forEach(g=>{l&&g.addEventListener("scroll",n,{passive:!0}),r&&g.addEventListener("resize",n)});const h=d&&o?_M(d,n):null;let m=-1,x=null;i&&(x=new ResizeObserver(g=>{let[p]=g;p&&p.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var b;(b=x)==null||b.observe(t)})),n()}),d&&!c&&x.observe(d),x.observe(t));let j,v=c?fl(e):null;c&&y();function y(){const g=fl(e);v&&!E_(v,g)&&n(),v=g,j=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(p=>{l&&p.removeEventListener("scroll",n),r&&p.removeEventListener("resize",n)}),h==null||h(),(g=x)==null||g.disconnect(),x=null,c&&cancelAnimationFrame(j)}}const NM=nM,kM=sM,SM=JA,CM=lM,RM=eM,yv=WA,TM=aM,EM=(e,t,n)=>{const a=new Map,l={platform:jM,...n},r={...l.platform,_c:a};return ZA(e,t,{...l,platform:r})};var AM=typeof document<"u",MM=function(){},Ac=AM?u.useLayoutEffect:MM;function bu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,a,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!bu(e[a],t[a]))return!1;return!0}if(l=Object.keys(e),n=l.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,l[a]))return!1;for(a=n;a--!==0;){const r=l[a];if(!(r==="_owner"&&e.$$typeof)&&!bu(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function A_(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bv(e,t){const n=A_(e);return Math.round(t*n)/n}function Cf(e){const t=u.useRef(e);return Ac(()=>{t.current=e}),t}function OM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:l,elements:{reference:r,floating:i}={},transform:o=!0,whileElementsMounted:c,open:d}=e,[f,h]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,x]=u.useState(a);bu(m,a)||x(a);const[j,v]=u.useState(null),[y,g]=u.useState(null),p=u.useCallback(C=>{C!==R.current&&(R.current=C,v(C))},[]),b=u.useCallback(C=>{C!==w.current&&(w.current=C,g(C))},[]),_=r||j,N=i||y,R=u.useRef(null),w=u.useRef(null),k=u.useRef(f),L=c!=null,D=Cf(c),K=Cf(l),G=Cf(d),U=u.useCallback(()=>{if(!R.current||!w.current)return;const C={placement:t,strategy:n,middleware:m};K.current&&(C.platform=K.current),EM(R.current,w.current,C).then($=>{const X={...$,isPositioned:G.current!==!1};M.current&&!bu(k.current,X)&&(k.current=X,kr.flushSync(()=>{h(X)}))})},[m,t,n,K,G]);Ac(()=>{d===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,h(C=>({...C,isPositioned:!1})))},[d]);const M=u.useRef(!1);Ac(()=>(M.current=!0,()=>{M.current=!1}),[]),Ac(()=>{if(_&&(R.current=_),N&&(w.current=N),_&&N){if(D.current)return D.current(_,N,U);U()}},[_,N,U,D,L]);const A=u.useMemo(()=>({reference:R,floating:w,setReference:p,setFloating:b}),[p,b]),S=u.useMemo(()=>({reference:_,floating:N}),[_,N]),E=u.useMemo(()=>{const C={position:n,left:0,top:0};if(!S.floating)return C;const $=bv(S.floating,f.x),X=bv(S.floating,f.y);return o?{...C,transform:"translate("+$+"px, "+X+"px)",...A_(S.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:X}},[n,o,S.floating,f.x,f.y]);return u.useMemo(()=>({...f,update:U,refs:A,elements:S,floatingStyles:E}),[f,U,A,S,E])}const $M=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:a,padding:l}=typeof e=="function"?e(n):e;return a&&t(a)?a.current!=null?yv({element:a.current,padding:l}).fn(n):{}:a?yv({element:a,padding:l}).fn(n):{}}}},DM=(e,t)=>({...NM(e),options:[e,t]}),zM=(e,t)=>({...kM(e),options:[e,t]}),LM=(e,t)=>({...TM(e),options:[e,t]}),UM=(e,t)=>({...SM(e),options:[e,t]}),BM=(e,t)=>({...CM(e),options:[e,t]}),HM=(e,t)=>({...RM(e),options:[e,t]}),IM=(e,t)=>({...$M(e),options:[e,t]});var PM="Arrow",M_=u.forwardRef((e,t)=>{const{children:n,width:a=10,height:l=5,...r}=e;return s.jsx(we.svg,{...r,ref:t,width:a,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});M_.displayName=PM;var qM=M_,Op="Popper",[O_,Hr]=Ns(Op),[GM,$_]=O_(Op),D_=e=>{const{__scopePopper:t,children:n}=e,[a,l]=u.useState(null);return s.jsx(GM,{scope:t,anchor:a,onAnchorChange:l,children:n})};D_.displayName=Op;var z_="PopperAnchor",L_=u.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:a,...l}=e,r=$_(z_,n),i=u.useRef(null),o=Ie(t,i);return u.useEffect(()=>{r.onAnchorChange((a==null?void 0:a.current)||i.current)}),a?null:s.jsx(we.div,{...l,ref:o})});L_.displayName=z_;var $p="PopperContent",[VM,YM]=O_($p),U_=u.forwardRef((e,t)=>{var O,Y,ae,H,te,ee;const{__scopePopper:n,side:a="bottom",sideOffset:l=0,align:r="center",alignOffset:i=0,arrowPadding:o=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:m=!1,updatePositionStrategy:x="optimized",onPlaced:j,...v}=e,y=$_($p,n),[g,p]=u.useState(null),b=Ie(t,le=>p(le)),[_,N]=u.useState(null),R=m_(_),w=(R==null?void 0:R.width)??0,k=(R==null?void 0:R.height)??0,L=a+(r!=="center"?"-"+r:""),D=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},K=Array.isArray(d)?d:[d],G=K.length>0,U={padding:D,boundary:K.filter(XM),altBoundary:G},{refs:M,floatingStyles:A,placement:S,isPositioned:E,middlewareData:C}=OM({strategy:"fixed",placement:L,whileElementsMounted:(...le)=>wM(...le,{animationFrame:x==="always"}),elements:{reference:y.anchor},middleware:[DM({mainAxis:l+k,alignmentAxis:i}),c&&zM({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?LM():void 0,...U}),c&&UM({...U}),BM({...U,apply:({elements:le,rects:J,availableWidth:Qe,availableHeight:oe})=>{const{width:Oe,height:Q}=J.reference,Ne=le.floating.style;Ne.setProperty("--radix-popper-available-width",`${Qe}px`),Ne.setProperty("--radix-popper-available-height",`${oe}px`),Ne.setProperty("--radix-popper-anchor-width",`${Oe}px`),Ne.setProperty("--radix-popper-anchor-height",`${Q}px`)}}),_&&IM({element:_,padding:o}),KM({arrowWidth:w,arrowHeight:k}),m&&HM({strategy:"referenceHidden",...U})]}),[$,X]=I_(S),T=bs(j);Pt(()=>{E&&(T==null||T())},[E,T]);const I=(O=C.arrow)==null?void 0:O.x,ne=(Y=C.arrow)==null?void 0:Y.y,W=((ae=C.arrow)==null?void 0:ae.centerOffset)!==0,[xe,V]=u.useState();return Pt(()=>{g&&V(window.getComputedStyle(g).zIndex)},[g]),s.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:E?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[(H=C.transformOrigin)==null?void 0:H.x,(te=C.transformOrigin)==null?void 0:te.y].join(" "),...((ee=C.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(VM,{scope:n,placedSide:$,onArrowChange:N,arrowX:I,arrowY:ne,shouldHideArrow:W,children:s.jsx(we.div,{"data-side":$,"data-align":X,...v,ref:b,style:{...v.style,animation:E?void 0:"none"}})})})});U_.displayName=$p;var B_="PopperArrow",FM={top:"bottom",right:"left",bottom:"top",left:"right"},H_=u.forwardRef(function(t,n){const{__scopePopper:a,...l}=t,r=YM(B_,a),i=FM[r.placedSide];return s.jsx("span",{ref:r.onArrowChange,style:{position:"absolute",left:r.arrowX,top:r.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[r.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[r.placedSide],visibility:r.shouldHideArrow?"hidden":void 0},children:s.jsx(qM,{...l,ref:n,style:{...l.style,display:"block"}})})});H_.displayName=B_;function XM(e){return e!==null}var KM=e=>({name:"transformOrigin",options:e,fn(t){var y,g,p;const{placement:n,rects:a,middlewareData:l}=t,i=((y=l.arrow)==null?void 0:y.centerOffset)!==0,o=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[d,f]=I_(n),h={start:"0%",center:"50%",end:"100%"}[f],m=(((g=l.arrow)==null?void 0:g.x)??0)+o/2,x=(((p=l.arrow)==null?void 0:p.y)??0)+c/2;let j="",v="";return d==="bottom"?(j=i?h:`${m}px`,v=`${-c}px`):d==="top"?(j=i?h:`${m}px`,v=`${a.floating.height+c}px`):d==="right"?(j=`${-c}px`,v=i?h:`${x}px`):d==="left"&&(j=`${a.floating.width+c}px`,v=i?h:`${x}px`),{data:{x:j,y:v}}}});function I_(e){const[t,n="center"]=e.split("-");return[t,n]}var Dp=D_,zp=L_,Lp=U_,Up=H_,Rf="rovingFocusGroup.onEntryFocus",QM={bubbles:!1,cancelable:!0},To="RovingFocusGroup",[Fh,P_,ZM]=kp(To),[WM,pd]=Ns(To,[ZM]),[JM,eO]=WM(To),q_=u.forwardRef((e,t)=>s.jsx(Fh.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Fh.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(tO,{...e,ref:t})})}));q_.displayName=To;var tO=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:a,loop:l=!1,dir:r,currentTabStopId:i,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...h}=e,m=u.useRef(null),x=Ie(t,m),j=dd(r),[v,y]=Oa({prop:i,defaultProp:o??null,onChange:c,caller:To}),[g,p]=u.useState(!1),b=bs(d),_=P_(n),N=u.useRef(!1),[R,w]=u.useState(0);return u.useEffect(()=>{const k=m.current;if(k)return k.addEventListener(Rf,b),()=>k.removeEventListener(Rf,b)},[b]),s.jsx(JM,{scope:n,orientation:a,dir:j,loop:l,currentTabStopId:v,onItemFocus:u.useCallback(k=>y(k),[y]),onItemShiftTab:u.useCallback(()=>p(!0),[]),onFocusableItemAdd:u.useCallback(()=>w(k=>k+1),[]),onFocusableItemRemove:u.useCallback(()=>w(k=>k-1),[]),children:s.jsx(we.div,{tabIndex:g||R===0?-1:0,"data-orientation":a,...h,ref:x,style:{outline:"none",...e.style},onMouseDown:ce(e.onMouseDown,()=>{N.current=!0}),onFocus:ce(e.onFocus,k=>{const L=!N.current;if(k.target===k.currentTarget&&L&&!g){const D=new CustomEvent(Rf,QM);if(k.currentTarget.dispatchEvent(D),!D.defaultPrevented){const K=_().filter(S=>S.focusable),G=K.find(S=>S.active),U=K.find(S=>S.id===v),A=[G,U,...K].filter(Boolean).map(S=>S.ref.current);Y_(A,f)}}N.current=!1}),onBlur:ce(e.onBlur,()=>p(!1))})})}),G_="RovingFocusGroupItem",V_=u.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:a=!0,active:l=!1,tabStopId:r,children:i,...o}=e,c=Zn(),d=r||c,f=eO(G_,n),h=f.currentTabStopId===d,m=P_(n),{onFocusableItemAdd:x,onFocusableItemRemove:j,currentTabStopId:v}=f;return u.useEffect(()=>{if(a)return x(),()=>j()},[a,x,j]),s.jsx(Fh.ItemSlot,{scope:n,id:d,focusable:a,active:l,children:s.jsx(we.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...o,ref:t,onMouseDown:ce(e.onMouseDown,y=>{a?f.onItemFocus(d):y.preventDefault()}),onFocus:ce(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:ce(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){f.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const g=aO(y,f.orientation,f.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let b=m().filter(_=>_.focusable).map(_=>_.ref.current);if(g==="last")b.reverse();else if(g==="prev"||g==="next"){g==="prev"&&b.reverse();const _=b.indexOf(y.currentTarget);b=f.loop?lO(b,_+1):b.slice(_+1)}setTimeout(()=>Y_(b))}}),children:typeof i=="function"?i({isCurrentTabStop:h,hasTabStop:v!=null}):i})})});V_.displayName=G_;var nO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function sO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function aO(e,t,n){const a=sO(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(a))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(a)))return nO[a]}function Y_(e,t=!1){const n=document.activeElement;for(const a of e)if(a===n||(a.focus({preventScroll:t}),document.activeElement!==n))return}function lO(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var F_=q_,X_=V_,Xh=["Enter"," "],rO=["ArrowDown","PageUp","Home"],K_=["ArrowUp","PageDown","End"],iO=[...rO,...K_],oO={ltr:[...Xh,"ArrowRight"],rtl:[...Xh,"ArrowLeft"]},cO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Eo="Menu",[Ki,uO,dO]=kp(Eo),[bl,Q_]=Ns(Eo,[dO,Hr,pd]),xd=Hr(),Z_=pd(),[fO,jl]=bl(Eo),[hO,Ao]=bl(Eo),W_=e=>{const{__scopeMenu:t,open:n=!1,children:a,dir:l,onOpenChange:r,modal:i=!0}=e,o=xd(t),[c,d]=u.useState(null),f=u.useRef(!1),h=bs(r),m=dd(l);return u.useEffect(()=>{const x=()=>{f.current=!0,document.addEventListener("pointerdown",j,{capture:!0,once:!0}),document.addEventListener("pointermove",j,{capture:!0,once:!0})},j=()=>f.current=!1;return document.addEventListener("keydown",x,{capture:!0}),()=>{document.removeEventListener("keydown",x,{capture:!0}),document.removeEventListener("pointerdown",j,{capture:!0}),document.removeEventListener("pointermove",j,{capture:!0})}},[]),s.jsx(Dp,{...o,children:s.jsx(fO,{scope:t,open:n,onOpenChange:h,content:c,onContentChange:d,children:s.jsx(hO,{scope:t,onClose:u.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:m,modal:i,children:a})})})};W_.displayName=Eo;var mO="MenuAnchor",Bp=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=xd(n);return s.jsx(zp,{...l,...a,ref:t})});Bp.displayName=mO;var Hp="MenuPortal",[pO,J_]=bl(Hp,{forceMount:void 0}),ew=e=>{const{__scopeMenu:t,forceMount:n,children:a,container:l}=e,r=jl(Hp,t);return s.jsx(pO,{scope:t,forceMount:n,children:s.jsx(Dn,{present:n||r.open,children:s.jsx(ko,{asChild:!0,container:l,children:a})})})};ew.displayName=Hp;var En="MenuContent",[xO,Ip]=bl(En),tw=u.forwardRef((e,t)=>{const n=J_(En,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,r=jl(En,e.__scopeMenu),i=Ao(En,e.__scopeMenu);return s.jsx(Ki.Provider,{scope:e.__scopeMenu,children:s.jsx(Dn,{present:a||r.open,children:s.jsx(Ki.Slot,{scope:e.__scopeMenu,children:i.modal?s.jsx(gO,{...l,ref:t}):s.jsx(vO,{...l,ref:t})})})})}),gO=u.forwardRef((e,t)=>{const n=jl(En,e.__scopeMenu),a=u.useRef(null),l=Ie(t,a);return u.useEffect(()=>{const r=a.current;if(r)return vp(r)},[]),s.jsx(Pp,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ce(e.onFocusOutside,r=>r.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vO=u.forwardRef((e,t)=>{const n=jl(En,e.__scopeMenu);return s.jsx(Pp,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yO=ul("MenuContent.ScrollLock"),Pp=u.forwardRef((e,t)=>{const{__scopeMenu:n,loop:a=!1,trapFocus:l,onOpenAutoFocus:r,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:x,disableOutsideScroll:j,...v}=e,y=jl(En,n),g=Ao(En,n),p=xd(n),b=Z_(n),_=uO(n),[N,R]=u.useState(null),w=u.useRef(null),k=Ie(t,w,y.onContentChange),L=u.useRef(0),D=u.useRef(""),K=u.useRef(0),G=u.useRef(null),U=u.useRef("right"),M=u.useRef(0),A=j?id:u.Fragment,S=j?{as:yO,allowPinchZoom:!0}:void 0,E=$=>{var O,Y;const X=D.current+$,T=_().filter(ae=>!ae.disabled),I=document.activeElement,ne=(O=T.find(ae=>ae.ref.current===I))==null?void 0:O.textValue,W=T.map(ae=>ae.textValue),xe=AO(W,X,ne),V=(Y=T.find(ae=>ae.textValue===xe))==null?void 0:Y.ref.current;(function ae(H){D.current=H,window.clearTimeout(L.current),H!==""&&(L.current=window.setTimeout(()=>ae(""),1e3))})(X),V&&setTimeout(()=>V.focus())};u.useEffect(()=>()=>window.clearTimeout(L.current),[]),gp();const C=u.useCallback($=>{var T,I;return U.current===((T=G.current)==null?void 0:T.side)&&OO($,(I=G.current)==null?void 0:I.area)},[]);return s.jsx(xO,{scope:n,searchRef:D,onItemEnter:u.useCallback($=>{C($)&&$.preventDefault()},[C]),onItemLeave:u.useCallback($=>{var X;C($)||((X=w.current)==null||X.focus(),R(null))},[C]),onTriggerLeave:u.useCallback($=>{C($)&&$.preventDefault()},[C]),pointerGraceTimerRef:K,onPointerGraceIntentChange:u.useCallback($=>{G.current=$},[]),children:s.jsx(A,{...S,children:s.jsx(ld,{asChild:!0,trapped:l,onMountAutoFocus:ce(r,$=>{var X;$.preventDefault(),(X=w.current)==null||X.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:s.jsx(No,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:m,onDismiss:x,children:s.jsx(F_,{asChild:!0,...b,dir:g.dir,orientation:"vertical",loop:a,currentTabStopId:N,onCurrentTabStopIdChange:R,onEntryFocus:ce(c,$=>{g.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Lp,{role:"menu","aria-orientation":"vertical","data-state":gw(y.open),"data-radix-menu-content":"",dir:g.dir,...p,...v,ref:k,style:{outline:"none",...v.style},onKeyDown:ce(v.onKeyDown,$=>{const T=$.target.closest("[data-radix-menu-content]")===$.currentTarget,I=$.ctrlKey||$.altKey||$.metaKey,ne=$.key.length===1;T&&($.key==="Tab"&&$.preventDefault(),!I&&ne&&E($.key));const W=w.current;if($.target!==W||!iO.includes($.key))return;$.preventDefault();const V=_().filter(O=>!O.disabled).map(O=>O.ref.current);K_.includes($.key)&&V.reverse(),TO(V)}),onBlur:ce(e.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(L.current),D.current="")}),onPointerMove:ce(e.onPointerMove,Qi($=>{const X=$.target,T=M.current!==$.clientX;if($.currentTarget.contains(X)&&T){const I=$.clientX>M.current?"right":"left";U.current=I,M.current=$.clientX}}))})})})})})})});tw.displayName=En;var bO="MenuGroup",qp=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(we.div,{role:"group",...a,ref:t})});qp.displayName=bO;var jO="MenuLabel",nw=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(we.div,{...a,ref:t})});nw.displayName=jO;var ju="MenuItem",jv="menu.itemSelect",gd=u.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:a,...l}=e,r=u.useRef(null),i=Ao(ju,e.__scopeMenu),o=Ip(ju,e.__scopeMenu),c=Ie(t,r),d=u.useRef(!1),f=()=>{const h=r.current;if(!n&&h){const m=new CustomEvent(jv,{bubbles:!0,cancelable:!0});h.addEventListener(jv,x=>a==null?void 0:a(x),{once:!0}),k0(h,m),m.defaultPrevented?d.current=!1:i.onClose()}};return s.jsx(sw,{...l,ref:c,disabled:n,onClick:ce(e.onClick,f),onPointerDown:h=>{var m;(m=e.onPointerDown)==null||m.call(e,h),d.current=!0},onPointerUp:ce(e.onPointerUp,h=>{var m;d.current||(m=h.currentTarget)==null||m.click()}),onKeyDown:ce(e.onKeyDown,h=>{const m=o.searchRef.current!=="";n||m&&h.key===" "||Xh.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});gd.displayName=ju;var sw=u.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:a=!1,textValue:l,...r}=e,i=Ip(ju,n),o=Z_(n),c=u.useRef(null),d=Ie(t,c),[f,h]=u.useState(!1),[m,x]=u.useState("");return u.useEffect(()=>{const j=c.current;j&&x((j.textContent??"").trim())},[r.children]),s.jsx(Ki.ItemSlot,{scope:n,disabled:a,textValue:l??m,children:s.jsx(X_,{asChild:!0,...o,focusable:!a,children:s.jsx(we.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...r,ref:d,onPointerMove:ce(e.onPointerMove,Qi(j=>{a?i.onItemLeave(j):(i.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ce(e.onPointerLeave,Qi(j=>i.onItemLeave(j))),onFocus:ce(e.onFocus,()=>h(!0)),onBlur:ce(e.onBlur,()=>h(!1))})})})}),_O="MenuCheckboxItem",aw=u.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:a,...l}=e;return s.jsx(cw,{scope:e.__scopeMenu,checked:n,children:s.jsx(gd,{role:"menuitemcheckbox","aria-checked":_u(n)?"mixed":n,...l,ref:t,"data-state":Vp(n),onSelect:ce(l.onSelect,()=>a==null?void 0:a(_u(n)?!0:!n),{checkForDefaultPrevented:!1})})})});aw.displayName=_O;var lw="MenuRadioGroup",[wO,NO]=bl(lw,{value:void 0,onValueChange:()=>{}}),rw=u.forwardRef((e,t)=>{const{value:n,onValueChange:a,...l}=e,r=bs(a);return s.jsx(wO,{scope:e.__scopeMenu,value:n,onValueChange:r,children:s.jsx(qp,{...l,ref:t})})});rw.displayName=lw;var iw="MenuRadioItem",ow=u.forwardRef((e,t)=>{const{value:n,...a}=e,l=NO(iw,e.__scopeMenu),r=n===l.value;return s.jsx(cw,{scope:e.__scopeMenu,checked:r,children:s.jsx(gd,{role:"menuitemradio","aria-checked":r,...a,ref:t,"data-state":Vp(r),onSelect:ce(a.onSelect,()=>{var i;return(i=l.onValueChange)==null?void 0:i.call(l,n)},{checkForDefaultPrevented:!1})})})});ow.displayName=iw;var Gp="MenuItemIndicator",[cw,kO]=bl(Gp,{checked:!1}),uw=u.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:a,...l}=e,r=kO(Gp,n);return s.jsx(Dn,{present:a||_u(r.checked)||r.checked===!0,children:s.jsx(we.span,{...l,ref:t,"data-state":Vp(r.checked)})})});uw.displayName=Gp;var SO="MenuSeparator",dw=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e;return s.jsx(we.div,{role:"separator","aria-orientation":"horizontal",...a,ref:t})});dw.displayName=SO;var CO="MenuArrow",fw=u.forwardRef((e,t)=>{const{__scopeMenu:n,...a}=e,l=xd(n);return s.jsx(Up,{...l,...a,ref:t})});fw.displayName=CO;var RO="MenuSub",[e5,hw]=bl(RO),ci="MenuSubTrigger",mw=u.forwardRef((e,t)=>{const n=jl(ci,e.__scopeMenu),a=Ao(ci,e.__scopeMenu),l=hw(ci,e.__scopeMenu),r=Ip(ci,e.__scopeMenu),i=u.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:c}=r,d={__scopeMenu:e.__scopeMenu},f=u.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return u.useEffect(()=>f,[f]),u.useEffect(()=>{const h=o.current;return()=>{window.clearTimeout(h),c(null)}},[o,c]),s.jsx(Bp,{asChild:!0,...d,children:s.jsx(sw,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":gw(n.open),...e,ref:ad(t,l.onTriggerChange),onClick:h=>{var m;(m=e.onClick)==null||m.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ce(e.onPointerMove,Qi(h=>{r.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(r.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:ce(e.onPointerLeave,Qi(h=>{var x,j;f();const m=(x=n.content)==null?void 0:x.getBoundingClientRect();if(m){const v=(j=n.content)==null?void 0:j.dataset.side,y=v==="right",g=y?-5:5,p=m[y?"left":"right"],b=m[y?"right":"left"];r.onPointerGraceIntentChange({area:[{x:h.clientX+g,y:h.clientY},{x:p,y:m.top},{x:b,y:m.top},{x:b,y:m.bottom},{x:p,y:m.bottom}],side:v}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>r.onPointerGraceIntentChange(null),300)}else{if(r.onTriggerLeave(h),h.defaultPrevented)return;r.onPointerGraceIntentChange(null)}})),onKeyDown:ce(e.onKeyDown,h=>{var x;const m=r.searchRef.current!=="";e.disabled||m&&h.key===" "||oO[a.dir].includes(h.key)&&(n.onOpenChange(!0),(x=n.content)==null||x.focus(),h.preventDefault())})})})});mw.displayName=ci;var pw="MenuSubContent",xw=u.forwardRef((e,t)=>{const n=J_(En,e.__scopeMenu),{forceMount:a=n.forceMount,...l}=e,r=jl(En,e.__scopeMenu),i=Ao(En,e.__scopeMenu),o=hw(pw,e.__scopeMenu),c=u.useRef(null),d=Ie(t,c);return s.jsx(Ki.Provider,{scope:e.__scopeMenu,children:s.jsx(Dn,{present:a||r.open,children:s.jsx(Ki.Slot,{scope:e.__scopeMenu,children:s.jsx(Pp,{id:o.contentId,"aria-labelledby":o.triggerId,...l,ref:d,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var h;i.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:ce(e.onFocusOutside,f=>{f.target!==o.trigger&&r.onOpenChange(!1)}),onEscapeKeyDown:ce(e.onEscapeKeyDown,f=>{i.onClose(),f.preventDefault()}),onKeyDown:ce(e.onKeyDown,f=>{var x;const h=f.currentTarget.contains(f.target),m=cO[i.dir].includes(f.key);h&&m&&(r.onOpenChange(!1),(x=o.trigger)==null||x.focus(),f.preventDefault())})})})})})});xw.displayName=pw;function gw(e){return e?"open":"closed"}function _u(e){return e==="indeterminate"}function Vp(e){return _u(e)?"indeterminate":e?"checked":"unchecked"}function TO(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function EO(e,t){return e.map((n,a)=>e[(t+a)%e.length])}function AO(e,t,n){const l=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let i=EO(e,Math.max(r,0));l.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.toLowerCase().startsWith(l.toLowerCase()));return c!==n?c:void 0}function MO(e,t){const{x:n,y:a}=e;let l=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){const o=t[r],c=t[i],d=o.x,f=o.y,h=c.x,m=c.y;f>a!=m>a&&n<(h-d)*(a-f)/(m-f)+d&&(l=!l)}return l}function OO(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return MO(n,t)}function Qi(e){return t=>t.pointerType==="mouse"?e(t):void 0}var $O=W_,DO=Bp,zO=ew,LO=tw,UO=qp,BO=nw,HO=gd,IO=aw,PO=rw,qO=ow,GO=uw,VO=dw,YO=fw,FO=mw,XO=xw,vd="DropdownMenu",[KO]=Ns(vd,[Q_]),Yt=Q_(),[QO,vw]=KO(vd),yw=e=>{const{__scopeDropdownMenu:t,children:n,dir:a,open:l,defaultOpen:r,onOpenChange:i,modal:o=!0}=e,c=Yt(t),d=u.useRef(null),[f,h]=Oa({prop:l,defaultProp:r??!1,onChange:i,caller:vd});return s.jsx(QO,{scope:t,triggerId:Zn(),triggerRef:d,contentId:Zn(),open:f,onOpenChange:h,onOpenToggle:u.useCallback(()=>h(m=>!m),[h]),modal:o,children:s.jsx($O,{...c,open:f,onOpenChange:h,dir:a,modal:o,children:n})})};yw.displayName=vd;var bw="DropdownMenuTrigger",jw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...l}=e,r=vw(bw,n),i=Yt(n);return s.jsx(DO,{asChild:!0,...i,children:s.jsx(we.button,{type:"button",id:r.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?r.contentId:void 0,"data-state":r.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...l,ref:ad(t,r.triggerRef),onPointerDown:ce(e.onPointerDown,o=>{!a&&o.button===0&&o.ctrlKey===!1&&(r.onOpenToggle(),r.open||o.preventDefault())}),onKeyDown:ce(e.onKeyDown,o=>{a||(["Enter"," "].includes(o.key)&&r.onOpenToggle(),o.key==="ArrowDown"&&r.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});jw.displayName=bw;var ZO="DropdownMenuPortal",_w=e=>{const{__scopeDropdownMenu:t,...n}=e,a=Yt(t);return s.jsx(zO,{...a,...n})};_w.displayName=ZO;var ww="DropdownMenuContent",Nw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=vw(ww,n),r=Yt(n),i=u.useRef(!1);return s.jsx(LO,{id:l.contentId,"aria-labelledby":l.triggerId,...r,...a,ref:t,onCloseAutoFocus:ce(e.onCloseAutoFocus,o=>{var c;i.current||(c=l.triggerRef.current)==null||c.focus(),i.current=!1,o.preventDefault()}),onInteractOutside:ce(e.onInteractOutside,o=>{const c=o.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0,f=c.button===2||d;(!l.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Nw.displayName=ww;var WO="DropdownMenuGroup",JO=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(UO,{...l,...a,ref:t})});JO.displayName=WO;var e4="DropdownMenuLabel",kw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(BO,{...l,...a,ref:t})});kw.displayName=e4;var t4="DropdownMenuItem",Sw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(HO,{...l,...a,ref:t})});Sw.displayName=t4;var n4="DropdownMenuCheckboxItem",Cw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(IO,{...l,...a,ref:t})});Cw.displayName=n4;var s4="DropdownMenuRadioGroup",a4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(PO,{...l,...a,ref:t})});a4.displayName=s4;var l4="DropdownMenuRadioItem",Rw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(qO,{...l,...a,ref:t})});Rw.displayName=l4;var r4="DropdownMenuItemIndicator",Tw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(GO,{...l,...a,ref:t})});Tw.displayName=r4;var i4="DropdownMenuSeparator",Ew=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(VO,{...l,...a,ref:t})});Ew.displayName=i4;var o4="DropdownMenuArrow",c4=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(YO,{...l,...a,ref:t})});c4.displayName=o4;var u4="DropdownMenuSubTrigger",Aw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(FO,{...l,...a,ref:t})});Aw.displayName=u4;var d4="DropdownMenuSubContent",Mw=u.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...a}=e,l=Yt(n);return s.jsx(XO,{...l,...a,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});Mw.displayName=d4;var f4=yw,h4=jw,m4=_w,Ow=Nw,$w=kw,Dw=Sw,zw=Cw,Lw=Rw,Uw=Tw,Bw=Ew,Hw=Aw,Iw=Mw;const yd=f4,bd=h4,p4=u.forwardRef(({className:e,inset:t,children:n,...a},l)=>s.jsxs(Hw,{ref:l,className:ie("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[n,s.jsx(a0,{className:"ml-auto"})]}));p4.displayName=Hw.displayName;const x4=u.forwardRef(({className:e,...t},n)=>s.jsx(Iw,{ref:n,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));x4.displayName=Iw.displayName;const Mo=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>s.jsx(m4,{container:So(),children:s.jsx(Ow,{ref:a,sideOffset:t,className:ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Mo.displayName=Ow.displayName;const _r=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx(Dw,{ref:a,className:ie("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));_r.displayName=Dw.displayName;const g4=u.forwardRef(({className:e,children:t,checked:n,...a},l)=>s.jsxs(zw,{ref:l,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...a,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Uw,{children:s.jsx(Or,{className:"h-4 w-4"})})}),t]}));g4.displayName=zw.displayName;const v4=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(Lw,{ref:a,className:ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(Uw,{children:s.jsx(ZC,{className:"h-2 w-2 fill-current"})})}),t]}));v4.displayName=Lw.displayName;const y4=u.forwardRef(({className:e,inset:t,...n},a)=>s.jsx($w,{ref:a,className:ie("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));y4.displayName=$w.displayName;const b4=u.forwardRef(({className:e,...t},n)=>s.jsx(Bw,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));b4.displayName=Bw.displayName;const j4={default:"h-9 px-3 py-1 text-sm",control:"h-7 px-2 py-1 text-xs"},_t=u.forwardRef(({className:e,type:t,inputSize:n="default",...a},l)=>s.jsx("input",{type:t,className:ie("flex w-full rounded-md border border-input bg-transparent shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-disabled-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 read-only:cursor-default read-only:bg-muted read-only:text-muted-foreground read-only:border-dashed",j4[n],e),ref:l,...a}));_t.displayName="Input";var _4="Label",Pw=u.forwardRef((e,t)=>s.jsx(we.label,{...e,ref:t,onMouseDown:n=>{var l;n.target.closest("button, input, select, textarea")||((l=e.onMouseDown)==null||l.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Pw.displayName=_4;var qw=Pw;const w4=wo("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Me=u.forwardRef(({className:e,...t},n)=>s.jsx(qw,{ref:n,className:ie(w4(),e),...t}));Me.displayName=qw.displayName;function Ba({title:e,description:t,backHref:n,backLabel:a,className:l,icon:r,link:i}){const o=s.jsx(q,{asChild:!0,variant:"outline",size:"sm",className:"mt-4 no-underline",children:s.jsx(i,{href:n,children:a})});return r?s.jsx("div",{className:ie("flex-1 px-4 py-8 sm:px-6 lg:px-8",l),children:s.jsxs("section",{className:"mx-auto flex max-w-xl flex-col items-center text-center","data-testid":"not-found-state",children:[s.jsx("div",{className:"text-foreground mb-2 [&_svg]:size-8",children:r}),s.jsx("h1",{className:"m-0 text-xl font-semibold tracking-tight",children:e}),s.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),o]})}):s.jsx("div",{className:ie("flex-1 px-4 py-8 sm:px-6 lg:px-8",l),children:s.jsxs("section",{className:"border-border bg-card mx-auto max-w-xl rounded-xl border p-6",children:[s.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:e}),s.jsx("div",{className:"text-muted-foreground mt-2 space-y-2 text-sm",children:t}),o]})})}function Ft({title:e,description:t,actions:n,className:a,children:l,...r}){return s.jsxs("header",{"data-slot":"page-header",className:ie("flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",a),...r,children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("h1",{className:"text-foreground text-2xl font-semibold tracking-tight",children:e}),t?s.jsx("p",{className:"text-muted-foreground text-sm",children:t}):null,l]}),n?s.jsx("div",{"data-slot":"page-header-actions",className:"flex shrink-0 items-center gap-2",children:n}):null]})}function xt({as:e="div",className:t,...n}){return s.jsx(e,{className:ie("rounded-lg border",t),...n})}function _v(e,[t,n]){return Math.min(n,Math.max(t,e))}var Gw=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"}),N4="VisuallyHidden",Vw=u.forwardRef((e,t)=>s.jsx(we.span,{...e,ref:t,style:{...Gw,...e.style}}));Vw.displayName=N4;var k4=Vw,S4=[" ","Enter","ArrowUp","ArrowDown"],C4=[" ","Enter"],hl="Select",[jd,_d,R4]=kp(hl),[Ir]=Ns(hl,[R4,Hr]),wd=Hr(),[T4,Ha]=Ir(hl),[E4,A4]=Ir(hl),Yw=e=>{const{__scopeSelect:t,children:n,open:a,defaultOpen:l,onOpenChange:r,value:i,defaultValue:o,onValueChange:c,dir:d,name:f,autoComplete:h,disabled:m,required:x,form:j}=e,v=wd(t),[y,g]=u.useState(null),[p,b]=u.useState(null),[_,N]=u.useState(!1),R=dd(d),[w,k]=Oa({prop:a,defaultProp:l??!1,onChange:r,caller:hl}),[L,D]=Oa({prop:i,defaultProp:o,onChange:c,caller:hl}),K=u.useRef(null),G=y?j||!!y.closest("form"):!0,[U,M]=u.useState(new Set),A=Array.from(U).map(S=>S.props.value).join(";");return s.jsx(Dp,{...v,children:s.jsxs(T4,{required:x,scope:t,trigger:y,onTriggerChange:g,valueNode:p,onValueNodeChange:b,valueNodeHasChildren:_,onValueNodeHasChildrenChange:N,contentId:Zn(),value:L,onValueChange:D,open:w,onOpenChange:k,dir:R,triggerPointerDownPosRef:K,disabled:m,children:[s.jsx(jd.Provider,{scope:t,children:s.jsx(E4,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(S=>{M(E=>new Set(E).add(S))},[]),onNativeOptionRemove:u.useCallback(S=>{M(E=>{const C=new Set(E);return C.delete(S),C})},[]),children:n})}),G?s.jsxs(xN,{"aria-hidden":!0,required:x,tabIndex:-1,name:f,autoComplete:h,value:L,onChange:S=>D(S.target.value),disabled:m,form:j,children:[L===void 0?s.jsx("option",{value:""}):null,Array.from(U)]},A):null]})})};Yw.displayName=hl;var Fw="SelectTrigger",Xw=u.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:a=!1,...l}=e,r=wd(n),i=Ha(Fw,n),o=i.disabled||a,c=Ie(t,i.onTriggerChange),d=_d(n),f=u.useRef("touch"),[h,m,x]=vN(v=>{const y=d().filter(b=>!b.disabled),g=y.find(b=>b.value===i.value),p=yN(y,v,g);p!==void 0&&i.onValueChange(p.value)}),j=v=>{o||(i.onOpenChange(!0),x()),v&&(i.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return s.jsx(zp,{asChild:!0,...r,children:s.jsx(we.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":gN(i.value)?"":void 0,...l,ref:c,onClick:ce(l.onClick,v=>{v.currentTarget.focus(),f.current!=="mouse"&&j(v)}),onPointerDown:ce(l.onPointerDown,v=>{f.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(j(v),v.preventDefault())}),onKeyDown:ce(l.onKeyDown,v=>{const y=h.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&m(v.key),!(y&&v.key===" ")&&S4.includes(v.key)&&(j(),v.preventDefault())})})})});Xw.displayName=Fw;var Kw="SelectValue",Qw=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:l,children:r,placeholder:i="",...o}=e,c=Ha(Kw,n),{onValueNodeHasChildrenChange:d}=c,f=r!==void 0,h=Ie(t,c.onValueNodeChange);return Pt(()=>{d(f)},[d,f]),s.jsx(we.span,{...o,ref:h,style:{pointerEvents:"none"},children:gN(c.value)?s.jsx(s.Fragment,{children:i}):r})});Qw.displayName=Kw;var M4="SelectIcon",Zw=u.forwardRef((e,t)=>{const{__scopeSelect:n,children:a,...l}=e;return s.jsx(we.span,{"aria-hidden":!0,...l,ref:t,children:a||"▼"})});Zw.displayName=M4;var O4="SelectPortal",Ww=e=>s.jsx(ko,{asChild:!0,...e});Ww.displayName=O4;var ml="SelectContent",Jw=u.forwardRef((e,t)=>{const n=Ha(ml,e.__scopeSelect),[a,l]=u.useState();if(Pt(()=>{l(new DocumentFragment)},[]),!n.open){const r=a;return r?kr.createPortal(s.jsx(eN,{scope:e.__scopeSelect,children:s.jsx(jd.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),r):null}return s.jsx(tN,{...e,ref:t})});Jw.displayName=ml;var Vn=10,[eN,Ia]=Ir(ml),$4="SelectContentImpl",D4=ul("SelectContent.RemoveScroll"),tN=u.forwardRef((e,t)=>{const{__scopeSelect:n,position:a="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:r,onPointerDownOutside:i,side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:x,sticky:j,hideWhenDetached:v,avoidCollisions:y,...g}=e,p=Ha(ml,n),[b,_]=u.useState(null),[N,R]=u.useState(null),w=Ie(t,O=>_(O)),[k,L]=u.useState(null),[D,K]=u.useState(null),G=_d(n),[U,M]=u.useState(!1),A=u.useRef(!1);u.useEffect(()=>{if(b)return vp(b)},[b]),gp();const S=u.useCallback(O=>{const[Y,...ae]=G().map(ee=>ee.ref.current),[H]=ae.slice(-1),te=document.activeElement;for(const ee of O)if(ee===te||(ee==null||ee.scrollIntoView({block:"nearest"}),ee===Y&&N&&(N.scrollTop=0),ee===H&&N&&(N.scrollTop=N.scrollHeight),ee==null||ee.focus(),document.activeElement!==te))return},[G,N]),E=u.useCallback(()=>S([k,b]),[S,k,b]);u.useEffect(()=>{U&&E()},[U,E]);const{onOpenChange:C,triggerPointerDownPosRef:$}=p;u.useEffect(()=>{if(b){let O={x:0,y:0};const Y=H=>{var te,ee;O={x:Math.abs(Math.round(H.pageX)-(((te=$.current)==null?void 0:te.x)??0)),y:Math.abs(Math.round(H.pageY)-(((ee=$.current)==null?void 0:ee.y)??0))}},ae=H=>{O.x<=10&&O.y<=10?H.preventDefault():b.contains(H.target)||C(!1),document.removeEventListener("pointermove",Y),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",ae,{capture:!0})}}},[b,C,$]),u.useEffect(()=>{const O=()=>C(!1);return window.addEventListener("blur",O),window.addEventListener("resize",O),()=>{window.removeEventListener("blur",O),window.removeEventListener("resize",O)}},[C]);const[X,T]=vN(O=>{const Y=G().filter(te=>!te.disabled),ae=Y.find(te=>te.ref.current===document.activeElement),H=yN(Y,O,ae);H&&setTimeout(()=>H.ref.current.focus())}),I=u.useCallback((O,Y,ae)=>{const H=!A.current&&!ae;(p.value!==void 0&&p.value===Y||H)&&(L(O),H&&(A.current=!0))},[p.value]),ne=u.useCallback(()=>b==null?void 0:b.focus(),[b]),W=u.useCallback((O,Y,ae)=>{const H=!A.current&&!ae;(p.value!==void 0&&p.value===Y||H)&&K(O)},[p.value]),xe=a==="popper"?Kh:nN,V=xe===Kh?{side:o,sideOffset:c,align:d,alignOffset:f,arrowPadding:h,collisionBoundary:m,collisionPadding:x,sticky:j,hideWhenDetached:v,avoidCollisions:y}:{};return s.jsx(eN,{scope:n,content:b,viewport:N,onViewportChange:R,itemRefCallback:I,selectedItem:k,onItemLeave:ne,itemTextRefCallback:W,focusSelectedItem:E,selectedItemText:D,position:a,isPositioned:U,searchRef:X,children:s.jsx(id,{as:D4,allowPinchZoom:!0,children:s.jsx(ld,{asChild:!0,trapped:p.open,onMountAutoFocus:O=>{O.preventDefault()},onUnmountAutoFocus:ce(l,O=>{var Y;(Y=p.trigger)==null||Y.focus({preventScroll:!0}),O.preventDefault()}),children:s.jsx(No,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:O=>O.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:s.jsx(xe,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:O=>O.preventDefault(),...g,...V,onPlaced:()=>M(!0),ref:w,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ce(g.onKeyDown,O=>{const Y=O.ctrlKey||O.altKey||O.metaKey;if(O.key==="Tab"&&O.preventDefault(),!Y&&O.key.length===1&&T(O.key),["ArrowUp","ArrowDown","Home","End"].includes(O.key)){let H=G().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(O.key)&&(H=H.slice().reverse()),["ArrowUp","ArrowDown"].includes(O.key)){const te=O.target,ee=H.indexOf(te);H=H.slice(ee+1)}setTimeout(()=>S(H)),O.preventDefault()}})})})})})})});tN.displayName=$4;var z4="SelectItemAlignedPosition",nN=u.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:a,...l}=e,r=Ha(ml,n),i=Ia(ml,n),[o,c]=u.useState(null),[d,f]=u.useState(null),h=Ie(t,w=>f(w)),m=_d(n),x=u.useRef(!1),j=u.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:g,focusSelectedItem:p}=i,b=u.useCallback(()=>{if(r.trigger&&r.valueNode&&o&&d&&v&&y&&g){const w=r.trigger.getBoundingClientRect(),k=d.getBoundingClientRect(),L=r.valueNode.getBoundingClientRect(),D=g.getBoundingClientRect();if(r.dir!=="rtl"){const te=D.left-k.left,ee=L.left-te,le=w.left-ee,J=w.width+le,Qe=Math.max(J,k.width),oe=window.innerWidth-Vn,Oe=_v(ee,[Vn,Math.max(Vn,oe-Qe)]);o.style.minWidth=J+"px",o.style.left=Oe+"px"}else{const te=k.right-D.right,ee=window.innerWidth-L.right-te,le=window.innerWidth-w.right-ee,J=w.width+le,Qe=Math.max(J,k.width),oe=window.innerWidth-Vn,Oe=_v(ee,[Vn,Math.max(Vn,oe-Qe)]);o.style.minWidth=J+"px",o.style.right=Oe+"px"}const K=m(),G=window.innerHeight-Vn*2,U=v.scrollHeight,M=window.getComputedStyle(d),A=parseInt(M.borderTopWidth,10),S=parseInt(M.paddingTop,10),E=parseInt(M.borderBottomWidth,10),C=parseInt(M.paddingBottom,10),$=A+S+U+C+E,X=Math.min(y.offsetHeight*5,$),T=window.getComputedStyle(v),I=parseInt(T.paddingTop,10),ne=parseInt(T.paddingBottom,10),W=w.top+w.height/2-Vn,xe=G-W,V=y.offsetHeight/2,O=y.offsetTop+V,Y=A+S+O,ae=$-Y;if(Y<=W){const te=K.length>0&&y===K[K.length-1].ref.current;o.style.bottom="0px";const ee=d.clientHeight-v.offsetTop-v.offsetHeight,le=Math.max(xe,V+(te?ne:0)+ee+E),J=Y+le;o.style.height=J+"px"}else{const te=K.length>0&&y===K[0].ref.current;o.style.top="0px";const le=Math.max(W,A+v.offsetTop+(te?I:0)+V)+ae;o.style.height=le+"px",v.scrollTop=Y-W+v.offsetTop}o.style.margin=`${Vn}px 0`,o.style.minHeight=X+"px",o.style.maxHeight=G+"px",a==null||a(),requestAnimationFrame(()=>x.current=!0)}},[m,r.trigger,r.valueNode,o,d,v,y,g,r.dir,a]);Pt(()=>b(),[b]);const[_,N]=u.useState();Pt(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const R=u.useCallback(w=>{w&&j.current===!0&&(b(),p==null||p(),j.current=!1)},[b,p]);return s.jsx(U4,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:x,onScrollButtonChange:R,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:s.jsx(we.div,{...l,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});nN.displayName=z4;var L4="SelectPopperPosition",Kh=u.forwardRef((e,t)=>{const{__scopeSelect:n,align:a="start",collisionPadding:l=Vn,...r}=e,i=wd(n);return s.jsx(Lp,{...i,...r,ref:t,align:a,collisionPadding:l,style:{boxSizing:"border-box",...r.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Kh.displayName=L4;var[U4,Yp]=Ir(ml,{}),Qh="SelectViewport",sN=u.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:a,...l}=e,r=Ia(Qh,n),i=Yp(Qh,n),o=Ie(t,r.onViewportChange),c=u.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(jd.Slot,{scope:n,children:s.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:ce(l.onScroll,d=>{const f=d.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:m}=i;if(m!=null&&m.current&&h){const x=Math.abs(c.current-f.scrollTop);if(x>0){const j=window.innerHeight-Vn*2,v=parseFloat(h.style.minHeight),y=parseFloat(h.style.height),g=Math.max(v,y);if(g<j){const p=g+x,b=Math.min(j,p),_=p-b;h.style.height=b+"px",h.style.bottom==="0px"&&(f.scrollTop=_>0?_:0,h.style.justifyContent="flex-end")}}}c.current=f.scrollTop})})})]})});sN.displayName=Qh;var aN="SelectGroup",[B4,H4]=Ir(aN),I4=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,l=Zn();return s.jsx(B4,{scope:n,id:l,children:s.jsx(we.div,{role:"group","aria-labelledby":l,...a,ref:t})})});I4.displayName=aN;var lN="SelectLabel",rN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,l=H4(lN,n);return s.jsx(we.div,{id:l.id,...a,ref:t})});rN.displayName=lN;var wu="SelectItem",[P4,iN]=Ir(wu),oN=u.forwardRef((e,t)=>{const{__scopeSelect:n,value:a,disabled:l=!1,textValue:r,...i}=e,o=Ha(wu,n),c=Ia(wu,n),d=o.value===a,[f,h]=u.useState(r??""),[m,x]=u.useState(!1),j=Ie(t,p=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,p,a,l)}),v=Zn(),y=u.useRef("touch"),g=()=>{l||(o.onValueChange(a),o.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(P4,{scope:n,value:a,disabled:l,textId:v,isSelected:d,onItemTextChange:u.useCallback(p=>{h(b=>b||((p==null?void 0:p.textContent)??"").trim())},[]),children:s.jsx(jd.ItemSlot,{scope:n,value:a,disabled:l,textValue:f,children:s.jsx(we.div,{role:"option","aria-labelledby":v,"data-highlighted":m?"":void 0,"aria-selected":d&&m,"data-state":d?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...i,ref:j,onFocus:ce(i.onFocus,()=>x(!0)),onBlur:ce(i.onBlur,()=>x(!1)),onClick:ce(i.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:ce(i.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:ce(i.onPointerDown,p=>{y.current=p.pointerType}),onPointerMove:ce(i.onPointerMove,p=>{var b;y.current=p.pointerType,l?(b=c.onItemLeave)==null||b.call(c):y.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ce(i.onPointerLeave,p=>{var b;p.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:ce(i.onKeyDown,p=>{var _;((_=c.searchRef)==null?void 0:_.current)!==""&&p.key===" "||(C4.includes(p.key)&&g(),p.key===" "&&p.preventDefault())})})})})});oN.displayName=wu;var ui="SelectItemText",cN=u.forwardRef((e,t)=>{const{__scopeSelect:n,className:a,style:l,...r}=e,i=Ha(ui,n),o=Ia(ui,n),c=iN(ui,n),d=A4(ui,n),[f,h]=u.useState(null),m=Ie(t,g=>h(g),c.onItemTextChange,g=>{var p;return(p=o.itemTextRefCallback)==null?void 0:p.call(o,g,c.value,c.disabled)}),x=f==null?void 0:f.textContent,j=u.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=d;return Pt(()=>(v(j),()=>y(j)),[v,y,j]),s.jsxs(s.Fragment,{children:[s.jsx(we.span,{id:c.textId,...r,ref:m}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?kr.createPortal(r.children,i.valueNode):null]})});cN.displayName=ui;var uN="SelectItemIndicator",dN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return iN(uN,n).isSelected?s.jsx(we.span,{"aria-hidden":!0,...a,ref:t}):null});dN.displayName=uN;var Zh="SelectScrollUpButton",fN=u.forwardRef((e,t)=>{const n=Ia(Zh,e.__scopeSelect),a=Yp(Zh,e.__scopeSelect),[l,r]=u.useState(!1),i=Ie(t,a.onScrollButtonChange);return Pt(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollTop>0;r(d)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),l?s.jsx(mN,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop-c.offsetHeight)}}):null});fN.displayName=Zh;var Wh="SelectScrollDownButton",hN=u.forwardRef((e,t)=>{const n=Ia(Wh,e.__scopeSelect),a=Yp(Wh,e.__scopeSelect),[l,r]=u.useState(!1),i=Ie(t,a.onScrollButtonChange);return Pt(()=>{if(n.viewport&&n.isPositioned){let o=function(){const d=c.scrollHeight-c.clientHeight,f=Math.ceil(c.scrollTop)<d;r(f)};const c=n.viewport;return o(),c.addEventListener("scroll",o),()=>c.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),l?s.jsx(mN,{...e,ref:i,onAutoScroll:()=>{const{viewport:o,selectedItem:c}=n;o&&c&&(o.scrollTop=o.scrollTop+c.offsetHeight)}}):null});hN.displayName=Wh;var mN=u.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:a,...l}=e,r=Ia("SelectScrollButton",n),i=u.useRef(null),o=_d(n),c=u.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),Pt(()=>{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(we.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:ce(l.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(a,50))}),onPointerMove:ce(l.onPointerMove,()=>{var d;(d=r.onItemLeave)==null||d.call(r),i.current===null&&(i.current=window.setInterval(a,50))}),onPointerLeave:ce(l.onPointerLeave,()=>{c()})})}),q4="SelectSeparator",pN=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e;return s.jsx(we.div,{"aria-hidden":!0,...a,ref:t})});pN.displayName=q4;var Jh="SelectArrow",G4=u.forwardRef((e,t)=>{const{__scopeSelect:n,...a}=e,l=wd(n),r=Ha(Jh,n),i=Ia(Jh,n);return r.open&&i.position==="popper"?s.jsx(Up,{...l,...a,ref:t}):null});G4.displayName=Jh;var V4="SelectBubbleInput",xN=u.forwardRef(({__scopeSelect:e,value:t,...n},a)=>{const l=u.useRef(null),r=Ie(a,l),i=h_(t);return u.useEffect(()=>{const o=l.current;if(!o)return;const c=window.HTMLSelectElement.prototype,f=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&f){const h=new Event("change",{bubbles:!0});f.call(o,t),o.dispatchEvent(h)}},[i,t]),s.jsx(we.select,{...n,style:{...Gw,...n.style},ref:r,defaultValue:t})});xN.displayName=V4;function gN(e){return e===""||e===void 0}function vN(e){const t=bs(e),n=u.useRef(""),a=u.useRef(0),l=u.useCallback(i=>{const o=n.current+i;t(o),function c(d){n.current=d,window.clearTimeout(a.current),d!==""&&(a.current=window.setTimeout(()=>c(""),1e3))}(o)},[t]),r=u.useCallback(()=>{n.current="",window.clearTimeout(a.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(a.current),[]),[n,l,r]}function yN(e,t,n){const l=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let i=Y4(e,Math.max(r,0));l.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(l.toLowerCase()));return c!==n?c:void 0}function Y4(e,t){return e.map((n,a)=>e[(t+a)%e.length])}var F4=Yw,bN=Xw,X4=Qw,K4=Zw,Q4=Ww,jN=Jw,Z4=sN,_N=rN,wN=oN,W4=cN,J4=dN,NN=fN,kN=hN,SN=pN;const e$={default:"h-9 px-3 py-2 text-sm",control:"h-7 px-2 py-1 text-xs"},dt=F4,ft=X4,it=u.forwardRef(({className:e,children:t,triggerSize:n="default",...a},l)=>s.jsxs(bN,{ref:l,className:ie("flex w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent shadow-sm ring-offset-background data-[placeholder]:text-disabled-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e$[n],e),...a,children:[t,s.jsx(K4,{asChild:!0,children:s.jsx(l0,{className:"text-muted-foreground size-4","aria-hidden":"true"})})]}));it.displayName=bN.displayName;const CN=u.forwardRef(({className:e,...t},n)=>s.jsx(NN,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(YC,{className:"size-4","aria-hidden":"true"})}));CN.displayName=NN.displayName;const RN=u.forwardRef(({className:e,...t},n)=>s.jsx(kN,{ref:n,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(qC,{className:"size-4","aria-hidden":"true"})}));RN.displayName=kN.displayName;const ot=u.forwardRef(({className:e,children:t,position:n="popper",...a},l)=>s.jsx(Q4,{container:So(),children:s.jsxs(jN,{ref:l,className:ie("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...a,children:[s.jsx(CN,{}),s.jsx(Z4,{className:ie("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(RN,{})]})}));ot.displayName=jN.displayName;const t$=u.forwardRef(({className:e,...t},n)=>s.jsx(_N,{ref:n,className:ie("px-2 py-1.5 text-sm font-semibold",e),...t}));t$.displayName=_N.displayName;const ke=u.forwardRef(({className:e,children:t,...n},a)=>s.jsxs(wN,{ref:a,className:ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(J4,{children:s.jsx(Or,{className:"size-4","aria-hidden":"true"})})}),s.jsx(W4,{children:t})]}));ke.displayName=wN.displayName;const n$=u.forwardRef(({className:e,...t},n)=>s.jsx(SN,{ref:n,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));n$.displayName=SN.displayName;function pt({className:e,...t}){return s.jsx("div",{className:ie("animate-pulse rounded-md bg-primary/10",e),...t})}const Be=u.forwardRef(({className:e,containerClassName:t,containerRef:n,containerTabIndex:a,containerAriaLabel:l,...r},i)=>s.jsx("div",{ref:n,tabIndex:a,"aria-label":l,className:ie("relative w-full overflow-auto",t),children:s.jsx("table",{ref:i,className:ie("w-full caption-bottom text-sm",e),...r})}));Be.displayName="Table";const Ge=u.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:ie("[&_tr]:border-b",e),...t}));Ge.displayName="TableHeader";const He=u.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:ie("[&_tr:last-child]:border-0",e),...t}));He.displayName="TableBody";const s$=u.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:ie("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",e),...t}));s$.displayName="TableFooter";const ue=u.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:ie("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t}));ue.displayName="TableRow";const F=u.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:ie("text-muted-foreground h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));F.displayName="TableHead";const P=u.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:ie("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));P.displayName="TableCell";const a$=u.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:ie("text-muted-foreground mt-4 text-sm",e),...t}));a$.displayName="TableCaption";var Nd="Tabs",[l$]=Ns(Nd,[pd]),TN=pd(),[r$,Fp]=l$(Nd),EN=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,onValueChange:l,defaultValue:r,orientation:i="horizontal",dir:o,activationMode:c="automatic",...d}=e,f=dd(o),[h,m]=Oa({prop:a,onChange:l,defaultProp:r??"",caller:Nd});return s.jsx(r$,{scope:n,baseId:Zn(),value:h,onValueChange:m,orientation:i,dir:f,activationMode:c,children:s.jsx(we.div,{dir:f,"data-orientation":i,...d,ref:t})})});EN.displayName=Nd;var AN="TabsList",MN=u.forwardRef((e,t)=>{const{__scopeTabs:n,loop:a=!0,...l}=e,r=Fp(AN,n),i=TN(n);return s.jsx(F_,{asChild:!0,...i,orientation:r.orientation,dir:r.dir,loop:a,children:s.jsx(we.div,{role:"tablist","aria-orientation":r.orientation,...l,ref:t})})});MN.displayName=AN;var ON="TabsTrigger",$N=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,disabled:l=!1,...r}=e,i=Fp(ON,n),o=TN(n),c=LN(i.baseId,a),d=UN(i.baseId,a),f=a===i.value;return s.jsx(X_,{asChild:!0,...o,focusable:!l,active:f,children:s.jsx(we.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":d,"data-state":f?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:c,...r,ref:t,onMouseDown:ce(e.onMouseDown,h=>{!l&&h.button===0&&h.ctrlKey===!1?i.onValueChange(a):h.preventDefault()}),onKeyDown:ce(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&i.onValueChange(a)}),onFocus:ce(e.onFocus,()=>{const h=i.activationMode!=="manual";!f&&!l&&h&&i.onValueChange(a)})})})});$N.displayName=ON;var DN="TabsContent",zN=u.forwardRef((e,t)=>{const{__scopeTabs:n,value:a,forceMount:l,children:r,...i}=e,o=Fp(DN,n),c=LN(o.baseId,a),d=UN(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(Dn,{present:l||f,children:({present:m})=>s.jsx(we.div,{"data-state":f?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:d,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:m&&r})})});zN.displayName=DN;function LN(e,t){return`${e}-trigger-${t}`}function UN(e,t){return`${e}-content-${t}`}var i$=EN,BN=MN,HN=$N,IN=zN;const o$=i$,PN=u.forwardRef(({className:e,...t},n)=>s.jsx(BN,{ref:n,className:ie("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));PN.displayName=BN.displayName;const em=u.forwardRef(({className:e,...t},n)=>s.jsx(HN,{ref:n,className:ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));em.displayName=HN.displayName;const c$=u.forwardRef(({className:e,...t},n)=>s.jsx(IN,{ref:n,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));c$.displayName=IN.displayName;const rs=u.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:ie("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-disabled-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 read-only:cursor-default read-only:bg-muted read-only:text-muted-foreground read-only:border-dashed",e),ref:n,...t}));rs.displayName="Textarea";var[kd]=Ns("Tooltip",[Hr]),Sd=Hr(),qN="TooltipProvider",u$=700,tm="tooltip.open",[d$,Xp]=kd(qN),GN=e=>{const{__scopeTooltip:t,delayDuration:n=u$,skipDelayDuration:a=300,disableHoverableContent:l=!1,children:r}=e,i=u.useRef(!0),o=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(d$,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,a)},[a]),isPointerInTransitRef:o,onPointerInTransitChange:u.useCallback(d=>{o.current=d},[]),disableHoverableContent:l,children:r})};GN.displayName=qN;var Zi="Tooltip",[f$,Oo]=kd(Zi),VN=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:l,onOpenChange:r,disableHoverableContent:i,delayDuration:o}=e,c=Xp(Zi,e.__scopeTooltip),d=Sd(t),[f,h]=u.useState(null),m=Zn(),x=u.useRef(0),j=i??c.disableHoverableContent,v=o??c.delayDuration,y=u.useRef(!1),[g,p]=Oa({prop:a,defaultProp:l??!1,onChange:w=>{w?(c.onOpen(),document.dispatchEvent(new CustomEvent(tm))):c.onClose(),r==null||r(w)},caller:Zi}),b=u.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),_=u.useCallback(()=>{window.clearTimeout(x.current),x.current=0,y.current=!1,p(!0)},[p]),N=u.useCallback(()=>{window.clearTimeout(x.current),x.current=0,p(!1)},[p]),R=u.useCallback(()=>{window.clearTimeout(x.current),x.current=window.setTimeout(()=>{y.current=!0,p(!0),x.current=0},v)},[v,p]);return u.useEffect(()=>()=>{x.current&&(window.clearTimeout(x.current),x.current=0)},[]),s.jsx(Dp,{...d,children:s.jsx(f$,{scope:t,contentId:m,open:g,stateAttribute:b,trigger:f,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?R():_()},[c.isOpenDelayedRef,R,_]),onTriggerLeave:u.useCallback(()=>{j?N():(window.clearTimeout(x.current),x.current=0)},[N,j]),onOpen:_,onClose:N,disableHoverableContent:j,children:n})})};VN.displayName=Zi;var nm="TooltipTrigger",YN=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=Oo(nm,n),r=Xp(nm,n),i=Sd(n),o=u.useRef(null),c=Ie(t,o,l.onTriggerChange),d=u.useRef(!1),f=u.useRef(!1),h=u.useCallback(()=>d.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(zp,{asChild:!0,...i,children:s.jsx(we.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...a,ref:c,onPointerMove:ce(e.onPointerMove,m=>{m.pointerType!=="touch"&&!f.current&&!r.isPointerInTransitRef.current&&(l.onTriggerEnter(),f.current=!0)}),onPointerLeave:ce(e.onPointerLeave,()=>{l.onTriggerLeave(),f.current=!1}),onPointerDown:ce(e.onPointerDown,()=>{l.open&&l.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ce(e.onFocus,()=>{d.current||l.onOpen()}),onBlur:ce(e.onBlur,l.onClose),onClick:ce(e.onClick,l.onClose)})})});YN.displayName=nm;var Kp="TooltipPortal",[h$,m$]=kd(Kp,{forceMount:void 0}),FN=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:l}=e,r=Oo(Kp,t);return s.jsx(h$,{scope:t,forceMount:n,children:s.jsx(Dn,{present:n||r.open,children:s.jsx(ko,{asChild:!0,container:l,children:a})})})};FN.displayName=Kp;var wr="TooltipContent",XN=u.forwardRef((e,t)=>{const n=m$(wr,e.__scopeTooltip),{forceMount:a=n.forceMount,side:l="top",...r}=e,i=Oo(wr,e.__scopeTooltip);return s.jsx(Dn,{present:a||i.open,children:i.disableHoverableContent?s.jsx(KN,{side:l,...r,ref:t}):s.jsx(p$,{side:l,...r,ref:t})})}),p$=u.forwardRef((e,t)=>{const n=Oo(wr,e.__scopeTooltip),a=Xp(wr,e.__scopeTooltip),l=u.useRef(null),r=Ie(t,l),[i,o]=u.useState(null),{trigger:c,onClose:d}=n,f=l.current,{onPointerInTransitChange:h}=a,m=u.useCallback(()=>{o(null),h(!1)},[h]),x=u.useCallback((j,v)=>{const y=j.currentTarget,g={x:j.clientX,y:j.clientY},p=b$(g,y.getBoundingClientRect()),b=j$(g,p),_=_$(v.getBoundingClientRect()),N=N$([...b,..._]);o(N),h(!0)},[h]);return u.useEffect(()=>()=>m(),[m]),u.useEffect(()=>{if(c&&f){const j=y=>x(y,f),v=y=>x(y,c);return c.addEventListener("pointerleave",j),f.addEventListener("pointerleave",v),()=>{c.removeEventListener("pointerleave",j),f.removeEventListener("pointerleave",v)}}},[c,f,x,m]),u.useEffect(()=>{if(i){const j=v=>{const y=v.target,g={x:v.clientX,y:v.clientY},p=(c==null?void 0:c.contains(y))||(f==null?void 0:f.contains(y)),b=!w$(g,i);p?m():b&&(m(),d())};return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[c,f,i,d,m]),s.jsx(KN,{...e,ref:r})}),[x$,g$]=kd(Zi,{isInside:!1}),v$=uE("TooltipContent"),KN=u.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":l,onEscapeKeyDown:r,onPointerDownOutside:i,...o}=e,c=Oo(wr,n),d=Sd(n),{onClose:f}=c;return u.useEffect(()=>(document.addEventListener(tm,f),()=>document.removeEventListener(tm,f)),[f]),u.useEffect(()=>{if(c.trigger){const h=m=>{const x=m.target;x!=null&&x.contains(c.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,f]),s.jsx(No,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:s.jsxs(Lp,{"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(v$,{children:a}),s.jsx(x$,{scope:n,isInside:!0,children:s.jsx(k4,{id:c.contentId,role:"tooltip",children:l||a})})]})})});XN.displayName=wr;var QN="TooltipArrow",y$=u.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,l=Sd(n);return g$(QN,n).isInside?null:s.jsx(Up,{...l,...a,ref:t})});y$.displayName=QN;function b$(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),r=Math.abs(t.left-e.x);switch(Math.min(n,a,l,r)){case r:return"left";case l:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function j$(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 _$(e){const{top:t,right:n,bottom:a,left:l}=e;return[{x:l,y:t},{x:n,y:t},{x:n,y:a},{x:l,y:a}]}function w$(e,t){const{x:n,y:a}=e;let l=!1;for(let r=0,i=t.length-1;r<t.length;i=r++){const o=t[r],c=t[i],d=o.x,f=o.y,h=c.x,m=c.y;f>a!=m>a&&n<(h-d)*(a-f)/(m-f)+d&&(l=!l)}return l}function N$(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),k$(t)}function k$(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const l=e[a];for(;t.length>=2;){const r=t[t.length-1],i=t[t.length-2];if((r.x-i.x)*(l.y-i.y)>=(r.y-i.y)*(l.x-i.x))t.pop();else break}t.push(l)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const l=e[a];for(;n.length>=2;){const r=n[n.length-1],i=n[n.length-2];if((r.x-i.x)*(l.y-i.y)>=(r.y-i.y)*(l.x-i.x))n.pop();else break}n.push(l)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var S$=GN,C$=VN,R$=YN,T$=FN,ZN=XN;const WN=S$,JN=C$,ek=R$,Qp=u.forwardRef(({className:e,sideOffset:t=4,...n},a)=>{const l=So(),r=s.jsx(ZN,{ref:a,sideOffset:t,className:ie("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n});return l?s.jsx(T$,{container:l,children:r}):r});Qp.displayName=ZN.displayName;function Js({page:e,header:t}){return s.jsxs(s.Fragment,{children:[t??s.jsx(Ft,{title:e}),s.jsx(E$,{page:e})]})}function E$({page:e}){return s.jsxs(me,{variant:"info",role:"status",className:"mt-6","data-testid":"not-installed",children:[s.jsx(Ua,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:d0(e)})]})}const wv=["none","read","comment","write","manage","admin"];function Nu(e,t){return wv.indexOf(e??"none")>=wv.indexOf(t)}function Zp(e){return e==="api_key"?"API key":e==="sdlc_login"?"sdlc login":null}function Tf(e,t){const n=Zp(e);return e==="sdlc_login"&&t?`${n} on ${tk(t)}`:n}const A$=String.fromCodePoint(8296),M$=String.fromCodePoint(8297);function tk(e){return`${A$}${e}${M$}`}const Wi={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"}},O$={backlog:"neutral",planned:"neutral",in_progress:"info",completed:"success",canceled:"neutral"};function nk(e){return e.name==="Blocked"?"warning":O$[e.category]}const Nv=1800;function ns(e){return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Wn(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1})}function Wp(e){return`${An(e)}, ${Wn(e)}`}function ti(e){return e<90?`${Math.round(e)} s`:e<5400?`${Math.round(e/60)} min`:`${(e/3600).toFixed(1).replace(/\.0$/,"")} h`}function An(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function sk(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function $$(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 D$(e){return{"task.created":"Created the task","task.title_changed":"Changed the title","task.description_changed":"Changed the description","task.status_changed":"Changed the status","task.priority_changed":"Changed the priority","task.primary_changed":"Changed the primary","task.custom_fields_changed":"Changed a field","task.archived":"Archived the task","task.restored":"Restored the task","task.reordered":"Moved the task","task.reparented":"Moved the task under another","task.contributor_added":"Added a contributor","task.contributor_removed":"Removed a contributor","task.checklist_item_added":"Added a checklist item","task.checklist_item_edited":"Edited a checklist item","task.checklist_item_toggled":"Checked off a checklist item","task.checklist_item_moved":"Moved a checklist item","task.checklist_item_archived":"Removed a checklist item","task.hold_opened":"Opened a hold","task.hold_released":"Released a hold","task.hold_resolved":"Resolved a hold","task.claimed":"Claimed the task","task.claim_released":"Released a claim","task.claim_completed":"Finished a claim","task.claim_expired":"Ended a lapsed claim","task.relation_added":"Linked a task","task.relation_archived":"Unlinked a task","task.project_linked":"Linked a project","task.project_unlinked":"Unlinked a project"}[e.event_type]??"Changed the task"}const la="not_set";function z$({open:e,commands:t,list_id:n,list_revision:a,default_status_id:l,statuses:r,priorities:i,members:o,on_close:c,on_created:d}){var G;const f=Mr(),[h,m]=u.useState(""),[x,j]=u.useState(""),[v,y]=u.useState(l??((G=r[0])==null?void 0:G.id)??""),[g,p]=u.useState(la),[b,_]=u.useState(la),[N,R]=u.useState(!1),[w,k]=u.useState(null),[L,D]=u.useState(!1);u.useEffect(()=>{var U;e&&(m(""),j(""),y(l??((U=r[0])==null?void 0:U.id)??""),p(la),_(la),R(!1),k(null))},[e,l,r]);const K=async U=>{if(U.preventDefault(),!h.trim()){R(!0);return}D(!0),k(null);try{const M=await t.run("create_task",{list_id:n,expected_list_revision:a,title:h.trim(),description:x.trim()||null,status_id:v||null,priority_id:g===la?null:g,primary_user_id:b===la?null:b});if(!M.ok){k(M.refusal.message);return}f.success("Task created."),await d()}finally{D(!1)}};return s.jsx(zn,{open:e,onOpenChange:U=>U?null:c(),children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:U=>void K(U),noValidate:!0,children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:"New task"}),s.jsx(In,{children:"Add a task to this List."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[w&&s.jsxs(me,{variant:"destructive",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(pe,{children:w})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-title",children:"Title"}),s.jsx(_t,{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:U=>{m(U.target.value),R(!1)}}),N&&s.jsx("p",{id:"new-task-title-error",className:"text-destructive text-xs",children:"Give the task a title."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-description",children:"Description (optional)"}),s.jsx(rs,{id:"new-task-description",rows:4,value:x,onChange:U=>j(U.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(dt,{value:v,onValueChange:y,children:[s.jsx(it,{id:"new-task-status",children:s.jsx(ft,{})}),s.jsx(ot,{children:r.map(U=>s.jsx(ke,{value:U.id,children:U.name},U.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-priority",children:"Priority"}),s.jsxs(dt,{value:g,onValueChange:p,children:[s.jsx(it,{id:"new-task-priority",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:la,children:"Not set"}),i.map(U=>s.jsx(ke,{value:U.id,children:U.name},U.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"new-task-primary",children:"Primary"}),s.jsxs(dt,{value:b,onValueChange:_,children:[s.jsx(it,{id:"new-task-primary",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:la,children:"Not set"}),o.map(U=>s.jsx(ke,{value:U.user_id,children:U.label},U.user_id))]})]})]})]})]}),s.jsxs(Bn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",onClick:c,children:"Cancel"}),s.jsx(q,{type:"submit",disabled:L,children:L?"Creating…":"Create task"})]})]})})})}const L$="Your organization's work, in queue order. Claim a task to show you are working on it.",di="any",ak="none",U$=1,B$=250;function Jp(){const e=nn().tasks;if(!e)throw new Error("The Tasks page rendered without the tasks seam.");return e}function H$({org:e}){var j,v;const t=Jp(),{href:n,Link:a}=Ve(),[l,r]=u.useState({state:"loading"}),[i,o]=u.useState([]),[c,d]=u.useState(null),f=u.useRef(0),h=u.useCallback(async y=>{const g=f.current+=1;y&&r({state:"loading"});const p=await t.availability({fresh:y});g===f.current&&r(p)},[t.availability]);u.useEffect(()=>{h(!1)},[h]);const m=u.useCallback(()=>void h(!0),[h]);if(u.useEffect(()=>{let y=!0;return t.members().then(g=>{y&&g.ok&&o(g.data)}),()=>{y=!1}},[t.members]),u.useEffect(()=>{if(!t.access)return;let y=!0;return t.access().then(g=>{y&&g.ok&&d(g.data)}),()=>{y=!1}},[t.access]),l.state==="off"&&((j=l.refusal)==null?void 0:j.reason)!=="engine_missing")return s.jsx(Ba,{title:"Page not found",description:"This page does not exist, or you do not have access to it.",backHref:n(`/org/${e}`),backLabel:"Back to the organization",link:a});const x=(c==null?void 0:c.read_only_reason)??L$;return s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:l.state==="active"?s.jsx(P$,{active:l,org:e,members:i,description:x,read_only_reason:c==null?void 0:c.read_only_reason,reload_configuration:m}):l.state==="off"&&((v=l.refusal)==null?void 0:v.reason)==="engine_missing"?s.jsx(Js,{page:"Tasks"}):s.jsxs(s.Fragment,{children:[s.jsx(Ft,{title:"Tasks",description:x}),l.state==="loading"&&s.jsx(lk,{}),(l.state==="error"||l.state==="off")&&s.jsx(rk,{refusal:l.refusal,on_retry:m}),l.state==="available"&&s.jsx(I$,{on_done:m})]})})}function lk(){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(pt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function rk({refusal:e,on_retry:t}){const n=as();return(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(me,{variant:"warning",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:$r}),s.jsx(pe,{children:n})]}):s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Tasks could not be loaded"}),s.jsxs(pe,{children:[s.jsx("p",{children:e!=null&&e.reason?e.message:"Check your connection and try again."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function I$({on_done:e}){const{commands:t}=Jp(),n=Mr(),[a,l]=u.useState(!1),r=t==null?void 0:t.activate,i=async()=>{if(!r)return;l(!0);const o=await r();if(l(!1),!o.ok){n.error(o.refusal.message);return}n.success("Tasks are on."),e()};return s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(Ua,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Tasks are not on for this organization"}),s.jsxs(pe,{children:[s.jsx("p",{children:"Turning them on creates one List with the default workflow. Members then see tasks as their access allows. It needs two-factor sign-in."}),r?s.jsx(q,{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 P$({active:e,org:t,members:n,description:a,read_only_reason:l,reload_configuration:r}){var yx;const{commands:i,listTasks:o,waitingOnYou:c,hierarchyRevision:d}=Jp(),{href:f,Link:h}=Ve(),{self_id:m}=Wu(),x=Mr(),{list:j,workspace:v}=e,y=j.offers,g=y!==void 0,p=u.useMemo(()=>{var B;return((B=v.workflows.find(Ye=>Ye.id===j.workflow_id))==null?void 0:B.statuses)??[]},[v,j]),b=v.priorities,_=!!i&&Nu(j.permission,"write"),N=_&&Nu(j.permission,"manage"),R=u.useMemo(()=>new Map(n.map(B=>[B.user_id,B])),[n]),w=B=>{var Ye;return B?B===m?"You":((Ye=R.get(B))==null?void 0:Ye.label)??"A member":""},[k,L]=u.useState("active"),[D,K]=u.useState(!1),[G,U]=u.useState(""),[M,A]=u.useState("");u.useEffect(()=>{const B=setTimeout(()=>A(G),B$);return()=>clearTimeout(B)},[G]);const[S,E]=u.useState(null),[C,$]=u.useState(di),[X,T]=u.useState(!1),[I,ne]=u.useState(!1),[W,xe]=u.useState(null),[V,O]=u.useState([]),[Y,ae]=u.useState(null),[H,te]=u.useState(0),[ee,le]=u.useState(!1),[J,Qe]=u.useState(null),[oe,Oe]=u.useState(null),Q=as(),[Ne,ze]=u.useState(!1),[gt,ye]=u.useState(null),[Ct,Lt]=u.useState({}),[bn,Ss]=u.useState(""),{confirm:jn,confirm_dialog:sn}=Co(),Cs=u.useRef(null),Rs=u.useRef(null),re=u.useRef(null),De=u.useRef(null),[Ce,Ts]=u.useState(void 0),Pn=!!(M.trim()||S||C!==di||X||I),qn=u.useRef(0),Rt=u.useCallback(async(B,Ye=!1)=>{const Ze=B?qn.current:qn.current+=1,st={state:k,assigned_to_me:D||void 0,cursor:B,search:M.trim()||void 0,group:S??void 0,owner:C===di?void 0:C===ak?"":C,urgent:X||void 0,over_estimate:I||void 0},Ut=Xt=>o(j.id,{...st,cursor:Xt});let Tt=await Ut(B),at=!!B;if(!Tt.ok&&Tt.refusal.code==="cursor_stale"&&(Tt=await Ut(),at=!1),Ze!==qn.current)return;if(!Tt.ok){ae(Tt.refusal),te(Xt=>Xt+1);return}const Bt=Tt.data;ae(null),te(0),!(Ye&&Ef(Bt,re.current))&&(re.current=Bt,xe(Bt),Bt.facets&&Ts(Bt.facets),O(Xt=>at?[...Xt,...Bt.tasks]:Bt.tasks))},[o,j.id,k,D,M,S,C,X,I]),an=u.useCallback(async()=>{const B=await c();if(Oe(Ze=>B.ok?null:Ef(Ze,B.refusal)?Ze:B.refusal),!B.ok&&g)return;const Ye=B.ok?B.data:null;Ef(Ye,De.current)||(De.current=Ye,Qe(Ye))},[c,g]);u.useEffect(()=>{re.current=null,xe(null)},[k,D]),u.useEffect(()=>{Rt()},[Rt]),u.useEffect(()=>{an()},[an]);const is=u.useCallback(async()=>{await Promise.all([Rt(),an()])},[Rt,an]),Gn=y==null?void 0:y.refresh_ms;u.useEffect(()=>{if(!Gn)return;const B=setInterval(()=>{Rt(void 0,!0),an()},Gn);return()=>clearInterval(B)},[Gn,Rt,an]);const ea=u.useCallback(async(B,Ye,Ze)=>{if(!i)return;const st=await i.run(B,Ye);st.ok?Ze&&x.success(Ze):(x.error(st.refusal.message),st.refusal.code==="revision_conflict"&&r()),await is()},[i,x,is,r]),z=p.find(B=>B.category==="completed"),be=async(B,Ye,Ze)=>{const st=Ye+Ze,Ut=V[st];if(!Ut||!W||!i)return;const Tt=async(at,Bt)=>{const Xt=await i.run(at,Bt);if(!Xt.ok)throw Xt.refusal;return Xt.data};try{let at=W.list.order_revision,Bt=B.revision;if(Ut.queue_rank===null){const Xt=V.findIndex(ta=>ta.queue_rank===null);for(const ta of V.slice(Xt,st+1)){const Uo=await Tt("reorder",{task_id:ta.id,expected_revision:ta.revision,expected_order_revision:at,placement:"end"});at=Uo.list.order_revision,ta.id===B.id&&(Bt=Uo.task.revision)}}await Tt("reorder",{task_id:B.id,expected_revision:Bt,expected_order_revision:at,placement:Ze<0?"before":"after",anchor_task_id:Ut.id})}catch(at){x.error(at.message)}await is()},se=B=>{z&&ea("update_task",{task_id:B.id,expected_revision:B.revision,changes:{status_id:z.id}},`${B.title} completed.`)},_e=async B=>{if(!W||!await jn({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[Ze,st]=await Promise.all([o(j.id,{limit:1}),d(v.id)]);if(!Ze.ok||!st.ok){x.error(Ze.ok?st.ok?"":st.refusal.message:Ze.refusal.message);return}await ea("archive_task",{task_id:B.id,expected_revision:B.revision,expected_order_revision:Ze.data.list.order_revision,expected_hierarchy_revision:st.data},`${B.title} archived.`)},Es=async B=>{await ea("release_hold",{hold_id:B},"Hold released.")},Ga=async(B,Ye,Ze,st)=>{var Xt;if(!(i!=null&&i.complete)||!await jn({title:`Mark ${Ye} done?`,description:Ze.reason?`“${Ze.reason}”
|
|
384
|
-
|
|
385
|
-
It leaves the open tasks.`:"It leaves the open tasks.",action_label:"Mark done"}))return;ye(B);const Tt=await i.complete(Ze);if(ye(null),!Tt.ok){Lt(ta=>({...ta,[B]:Tt.refusal.message}));return}Lt(({[B]:ta,...Uo})=>Uo),Ss(`${Ye} marked done.`),await is();const at=Rs.current;(Xt=(st?(at==null?void 0:at.querySelector(`[data-done-key="${CSS.escape(st)}"]`))??(at==null?void 0:at.querySelector(`[data-title-key="${CSS.escape(st)}"] a`)):null)??Cs.current)==null||Xt.focus()},vx=()=>{var B;U(""),A(""),E(null),$(di),T(!1),ne(!1),(B=Cs.current)==null||B.focus()},x1=new Map(p.map(B=>[B.id,B])),g1=new Map(b.map(B=>[B.id,B])),Ad=new Map(V.map(B=>[B.id,B.title])),Md=_&&k==="active",v1=V.some(B=>B.local_done),Od=Md||v1,$d=!g||b.length>0,y1=!D&&!Pn,b1=5+($d?1:0)+(Od?1:0),j1=Y!==null&&(Y.reason==="store_locked"||Y.reason==="engine_failed")&&H<=U$,Lo=(J==null?void 0:J.holds)??[],_1=V.map(B=>B.id),w1=Lo.map(B=>B.id);return s.jsxs("div",{ref:Rs,className:"contents",children:[s.jsx(Ft,{title:"Tasks",description:a,actions:_?s.jsxs(q,{type:"button",onClick:()=>ze(!0),children:[s.jsx(br,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]}):null}),g&&(W!=null&&W.open)?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:[W.open," open"]}):null,Gn?s.jsx("p",{className:"text-muted-foreground mt-1 text-xs",role:"status",children:Y?`Not reading · trying again every ${Math.round(Gn/1e3)}s`:W?`Live · refreshes every ${Math.round(Gn/1e3)}s`:"Connecting…"}):null,g?s.jsx("p",{className:"sr-only",role:"status",children:bn}):null,(g||Lo.length>0)&&s.jsxs(xt,{as:"section","aria-labelledby":"waiting-title",className:"mt-4 p-4","data-testid":"tasks-waiting",children:[s.jsx("h2",{id:"waiting-title",className:"text-lg font-semibold",children:"Waiting on you"}),Lo.length>0?s.jsx("ul",{className:"mt-2 divide-y","aria-labelledby":"waiting-title",children:Lo.map((B,Ye)=>{var Tt,at;const Ze=Wi[B.hold_type],st=B.target.kind==="task"?`Because you claim ${Ad.get(B.target.task_id)??"the task it waits on"} · `:"",Ut=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(he,{variant:Ze.tone,children:B.local_label??Ze.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:[st,"From ",w(B.opened_by)," · ",An(B.opened_at)]}),(Tt=B.local_threads)!=null&&Tt.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]}),Ut&&(i!=null&&i.complete)?s.jsx(q,{type:"button",variant:"outline",size:"sm","data-done-key":B.id,"aria-label":`Mark ${((at=B.task)==null?void 0:at.title)??B.reason} done`,loading:gt===B.id,onClick:()=>{var Bt;return void Ga(B.id,((Bt=B.task)==null?void 0:Bt.title)??B.reason,Ut,w1[Ye+1]??null)},children:"Done"}):null,g?null:s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void Es(B.id),children:"Release"})]},B.id)})}):J?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:"Nothing in this checkout waits on you."}):null,g&&oe?s.jsx("p",{className:"text-muted-foreground mt-2 text-sm",role:"status",children:oe.reason==="view_outdated"?`Waiting on you is not read here. ${Q}`:"Waiting on you could not be read. It is read again with the list."}):null,s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:g?"This checkout only. Teammates' agents are not listed here.":"Release a hold when you have done your part. Whoever can edit the task then resolves it."})]}),!_&&!l&&s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"You can view these tasks"}),s.jsx(pe,{children:"Ask an organization admin for write access to change them."})]}),s.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-4",children:[(y==null?void 0:y.archived)!==!1?s.jsx(o$,{value:k,onValueChange:B=>L(B),children:s.jsxs(PN,{"aria-label":"Which tasks",children:[s.jsx(em,{value:"active",children:"Active"}),s.jsx(em,{value:"archived",children:"Archived"})]})}):null,(y==null?void 0:y.assigned_to_me)!==!1?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lr,{id:"tasks-mine",checked:D,onCheckedChange:B=>K(B===!0)}),s.jsx(Me,{htmlFor:"tasks-mine",children:"Assigned to me"})]}):null,y!=null&&y.search?s.jsx(_t,{ref:Cs,type:"search",className:"w-64","aria-label":"Search tasks",placeholder:"Search title, ID or detail",value:G,onChange:B=>U(B.target.value)}):null,Ce!=null&&Ce.owners?s.jsx(G$,{owners:Ce.owners,no_owner:Ce.no_owner,value:C,on_change:$}):null]}),(yx=Ce==null?void 0:Ce.groups)!=null&&yx.length?s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",role:"group","aria-label":"Status",children:[Ce.groups.map(B=>s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":S===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(q,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":X,onClick:()=>T(B=>!B),children:["Urgent ",Ce.marks.urgent]}),s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":I,onClick:()=>ne(B=>!B),children:["Over estimate ",Ce.marks.over_estimate]})]}):null]}):null,Pn&&(W==null?void 0:W.matched)!==void 0&&W.total!==void 0?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:[W.matched," of ",W.total," match ·"," ",s.jsx(q,{type:"button",variant:"link",size:"inline-sm",onClick:vx,children:"Clear"})]}):null,j1?s.jsx("p",{className:"text-muted-foreground mt-4 text-sm",children:"Tasks are busy. Reading them again…"}):Y?s.jsx(rk,{refusal:Y,on_retry:()=>void Rt()}):null,!W&&!Y&&s.jsx(lk,{}),W&&V.length===0&&Pn?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(td,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No tasks match"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing open matches these filters."}),s.jsx(q,{type:"button",variant:"outline",onClick:vx,children:"Clear filters"})]}):W&&V.length===0&&k==="active"&&!D&&g?s.jsx("p",{className:"text-muted-foreground mt-6 text-sm",children:"No tasks recorded yet."}):W&&V.length===0&&k==="active"&&!D?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(i0,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No 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."}),_&&s.jsxs(q,{type:"button",onClick:()=>ze(!0),children:[s.jsx(br,{className:"mr-2 size-4","aria-hidden":"true"}),"New task"]})]}):W?s.jsxs(s.Fragment,{children:[s.jsx(xt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Tasks",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Title"}),s.jsx(F,{children:"Status"}),$d?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"}),Od?s.jsx(F,{className:"text-right",children:"Actions"}):null]})}),s.jsxs(He,{children:[V.map((B,Ye)=>{var Tt,at;const Ze=x1.get(B.status_id),st=$$(B),Ut=B.local_done;return s.jsxs(ue,{"data-testid":"tasks-row",children:[s.jsxs(P,{"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,g?s.jsx(q$,{row:B}):null,Ct[B.id]?s.jsx("div",{className:"text-destructive text-xs",role:"alert",children:Ct[B.id]}):null]}),s.jsx(P,{children:Ze?s.jsx(he,{variant:nk(Ze),children:Ze.name}):null}),$d?s.jsx(P,{className:"hidden md:table-cell",children:B.priority_id?((Tt=g1.get(B.priority_id))==null?void 0:Tt.name)??"":s.jsx("span",{className:"text-muted-foreground",children:"Not set"})}):null,s.jsx(P,{className:"hidden md:table-cell",children:B.owner_title?B.owner_title:B.primary_user_id?w(B.primary_user_id):s.jsx("span",{className:"text-muted-foreground",children:"Unassigned"})}),s.jsx(P,{className:"hidden md:table-cell",children:st?s.jsx(he,{variant:st.tone,children:st.label}):s.jsx("span",{className:"text-muted-foreground",children:"None"})}),s.jsx(P,{"data-testid":"tasks-claim",children:s.jsx(V$,{row:B,holder:w((at=B.claim)==null?void 0:at.user_id)})}),Od?s.jsx(P,{className:"text-right whitespace-nowrap",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[Ut&&"hold"in Ut?s.jsx("a",{className:"text-primary text-sm hover:underline",href:`#waiting-${Ut.hold}`,children:"In Waiting on you"}):Ut&&(i!=null&&i.complete)?s.jsx(q,{type:"button",variant:"outline",size:"sm","data-done-key":B.id,"aria-label":`Mark ${B.title} done`,loading:gt===B.id,onClick:()=>void Ga(B.id,B.title,Ut,_1[Ye+1]??null),children:"Done"}):null,Md&&y1?s.jsxs(s.Fragment,{children:[s.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${B.title} up`,disabled:Ye===0,onClick:()=>void be(B,Ye,-1),children:s.jsx(DC,{className:"size-4","aria-hidden":"true"})}),s.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`Move ${B.title} down`,disabled:Ye===V.length-1,onClick:()=>void be(B,Ye,1),children:s.jsx(MC,{className:"size-4","aria-hidden":"true"})})]}):null,Md?s.jsxs(yd,{children:[s.jsx(bd,{asChild:!0,children:s.jsx(q,{type:"button",variant:"outline",size:"icon","aria-label":`More actions for ${B.title}`,children:s.jsx(hp,{className:"size-4","aria-hidden":"true"})})}),s.jsxs(Mo,{align:"end",children:[z&&B.status_id!==z.id?s.jsx(_r,{onSelect:()=>se(B),children:"Complete"}):null,N?s.jsx(_r,{className:"text-destructive focus:text-destructive",onSelect:()=>void _e(B),children:"Archive"}):null]})]}):null]})}):null]},B.id)}),V.length===0&&s.jsx(ue,{children:s.jsx(P,{colSpan:b1,className:"text-muted-foreground h-24 text-center",children:k==="archived"?"No archived tasks.":"No tasks are assigned to you."})})]})]})}),W.next_cursor?s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2 self-start",disabled:ee,onClick:async()=>{le(!0),await Rt(W.next_cursor??void 0),le(!1)},children:"Load more"}):null]}):null,_&&i&&s.jsx(z$,{open:Ne,commands:i,list_id:j.id,list_revision:(W==null?void 0:W.list.revision)??j.revision,default_status_id:j.default_status_id,statuses:p,priorities:b,members:n,on_close:()=>ze(!1),on_created:async()=>{ze(!1),await is()}}),sn]})}function q$({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(he,{variant:a.tone??"neutral",children:a.label},a.label))}):null]})}function G$({owners:e,no_owner:t,value:n,on_change:a}){return s.jsxs(dt,{value:n,onValueChange:a,children:[s.jsx(it,{className:"w-56","aria-label":"Owner",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:di,children:"Any owner"}),e.map(l=>s.jsxs(ke,{value:l.id,children:[l.label," (",l.count,")"]},l.id)),t!==void 0?s.jsxs(ke,{value:ak,children:["No owner (",t,")"]}):null]})]})}function V$({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 ${ns(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?` · ${Zp(n.via)}`:""]}),s.jsxs("div",{className:"text-muted-foreground truncate text-xs",title:n.via==="sdlc_login"&&n.via_device?tk(n.via_device):void 0,children:["Until ",ns(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 Y$={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 F$({open:e,members:t,tasks:n,holds_my_web_claim:a,on_close:l,on_submit:r}){const[i,o]=u.useState("waiting_for_user"),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,x]=u.useState(!1),[j,v]=u.useState({}),[y,g]=u.useState(null),[p,b]=u.useState(!1);u.useEffect(()=>{e&&(o("waiting_for_user"),d(""),h(""),x(!1),v({}),g(null))},[e]);const _=Y$[i],N=async R=>{R.preventDefault();const w={target:_!==null&&!c.trim(),reason:!f.trim()};if(v(w),w.target||w.reason)return;b(!0);const k={hold_type:i,reason:f.trim(),release_claim:m};i==="waiting_for_user"&&(k.target_user_id=c),i==="blocked"&&(k.target_task_id=c),i==="waiting_for_external"&&(k.target_label=c.trim());const L=await r(k);b(!1),g(L)};return s.jsx(zn,{open:e,onOpenChange:R=>R?null:l(),children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:R=>void N(R),noValidate:!0,children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:"Add hold"}),s.jsx(In,{children:"Say what this task is waiting for."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[y&&s.jsxs(me,{variant:"destructive",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(pe,{children:y})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"hold-type",children:"Type"}),s.jsxs(dt,{value:i,onValueChange:R=>{o(R),d(""),v({})},children:[s.jsx(it,{id:"hold-type",children:s.jsx(ft,{})}),s.jsx(ot,{children:Object.keys(Wi).map(R=>s.jsx(ke,{value:R,children:Wi[R].label},R))})]})]}),_?s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"hold-target",children:_.label}),i==="waiting_for_external"?s.jsx(_t,{id:"hold-target",value:c,"aria-invalid":j.target,onChange:R=>d(R.target.value)}):s.jsxs(dt,{value:c,onValueChange:d,children:[s.jsx(it,{id:"hold-target","aria-invalid":j.target,children:s.jsx(ft,{placeholder:i==="blocked"?"Choose a task":"Choose a member"})}),s.jsx(ot,{children:i==="blocked"?n.map(R=>s.jsx(ke,{value:R.id,children:R.title},R.id)):t.map(R=>s.jsx(ke,{value:R.user_id,children:R.label},R.user_id))})]}),s.jsx("p",{className:j.target?"text-destructive text-xs":"text-muted-foreground text-xs",children:j.target?"Choose what it waits for.":_.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:R=>h(R.target.value)}),j.reason&&s.jsx("p",{className:"text-destructive text-xs",children:"Give a reason."})]}),a&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lr,{id:"hold-release-claim",checked:m,onCheckedChange:R=>x(R===!0)}),s.jsx(Me,{htmlFor:"hold-release-claim",children:"Also release my claim"})]})]}),s.jsxs(Bn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),s.jsx(q,{type:"submit",disabled:p,children:p?"Adding…":"Add hold"})]})]})})})}function $o(){const e=nn().tasks;if(!e)throw new Error("The Task page rendered without the tasks seam.");return e}function ex(){return s.jsxs("div",{className:"grid gap-3",role:"status","aria-label":"Loading task",children:[s.jsx(pt,{className:"h-8 w-1/2"}),Array.from({length:7},(e,t)=>s.jsx(pt,{className:t===6?"h-6 w-2/3":"h-6 w-full"},t))]})}function ku({back:e,description:t}){const{href:n,Link:a}=Ve();return s.jsx(Ba,{title:"Task not found",description:t??"It may have been removed, or you may not have access to it.",backHref:n(e),backLabel:"Back to tasks",link:a})}const Tl="not_set",X$=10*60*1e3,kv=20;function K$(){const{members:e}=$o(),[t,n]=u.useState([]);u.useEffect(()=>{let r=!0;return e().then(i=>{r&&i.ok&&n(i.data)}),()=>{r=!1}},[e]);const a=u.useMemo(()=>new Map(t.map(r=>[r.user_id,r])),[t]),l=u.useCallback((r,i)=>{var o;return r?r===i?"You":((o=a.get(r))==null?void 0:o.label)??"A member":""},[a]);return{members:t,name:l}}function Q$({active:e,task_id:t,back:n}){const a=$o(),{task:l,activity:r,listTasks:i,hierarchyRevision:o,commands:c}=a,{href:d,Link:f}=Ve(),h=Mr(),{self_id:m}=Wu(),{members:x,name:j}=K$(),{workspace:v}=e,{confirm:y,confirm_dialog:g}=Co(),[p,b]=u.useState(null),[_,N]=u.useState(!1),[R,w]=u.useState(!1),[k,L]=u.useState(null),[D,K]=u.useState([]),[G,U]=u.useState(kv),[M,A]=u.useState([]),[S,E]=u.useState(!1),[C,$]=u.useState(null),[X,T]=u.useState(null),[I,ne]=u.useState(""),[W,xe]=u.useState(null),V=u.useCallback(async()=>{if(!l)return;const z=await l(t);z.ok?(b(z.data),w(!1)):z.refusal.status===404||z.refusal.status===400?N(!0):w(!0)},[l,t]),O=u.useRef(0),Y=u.useCallback(async()=>{if(!r)return;const z=O.current+=1;let be=[],se;for(;;){const _e=await r(t,se);if(z!==O.current||!_e.ok)return;if(be=[...be,..._e.data.events].slice(-1e3),!_e.data.more||!_e.data.next_cursor)break;se=_e.data.next_cursor}z===O.current&&K(be.reverse())},[r,t]);u.useEffect(()=>{V(),Y()},[V,Y]);const ae=p?v.lists.find(z=>z.id===p.task.list_id):void 0,H=u.useMemo(()=>{var z;return((z=v.workflows.find(be=>be.id===(p==null?void 0:p.task.workflow_id)))==null?void 0:z.statuses)??[]},[v,p==null?void 0:p.task.workflow_id]);u.useEffect(()=>{if(!p)return;let z=!0;return i(p.task.list_id,{limit:100}).then(be=>{z&&A(be.ok?be.data.tasks.filter(se=>se.id!==p.task.id).map(se=>({id:se.id,title:se.title})):[])}),()=>{z=!1}},[i,p==null?void 0:p.task.list_id,p==null?void 0:p.task.id,p]);const te=u.useCallback(async()=>{await Promise.all([V(),Y()])},[V,Y]),ee=u.useCallback((z,be)=>c?c.run(z,be):Promise.resolve({ok:!1,refusal:{status:0,message:"This page cannot change tasks."}}),[c]),le=u.useCallback(async(z,be,se)=>{const _e=await ee(z,be);return _e.ok?(se&&h.success(se),await te(),_e.data):(_e.refusal.code==="revision_conflict"?L({tone:"warning",title:"This task changed while you were editing",body:"We reloaded it. Check the change, then save again."}):_e.refusal.code==="claim_held"?(await V(),L({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(_e.refusal.message),await te(),null)},[ee,h,te,V]),J=(p==null?void 0:p.claim)??null,Qe=J!==null&&J.id===W&&!J.lapsed&&!J.via?J.id:null;if(u.useEffect(()=>{if(!Qe)return;const z=window.setInterval(()=>{ee("renew_claim",{claim_id:Qe,lease_seconds:Nv}).then(()=>V())},X$);return()=>window.clearInterval(z)},[Qe,ee,V]),_)return s.jsx(ku,{back:n});if(R&&!p)return s.jsxs(me,{variant:"destructive",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"This task could not be loaded"}),s.jsxs(pe,{children:[s.jsx("p",{children:"Check your connection and try again."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void V(),children:"Retry"})]})]});if(!p)return s.jsx(ex,{});const{task:oe}=p,Oe=oe.archived_at!==null,Q=Nu(p.permission,"write")&&!Oe,Ne=Nu(p.permission,"manage"),ze=H.find(z=>z.id===oe.status_id),gt=H.find(z=>z.category==="completed"),ye=v.priorities.find(z=>z.id===oe.priority_id),Ct=p.contributors.map(z=>z.user_id),Lt=J!==null&&J.user_id===m,bn=J!==null&&!J.lapsed,Ss=p.checklist.filter(z=>z.is_complete).length,jn=async()=>{const[z,be]=await Promise.all([i(oe.list_id,{limit:1}),o(v.id)]);return z.ok?be.ok?{ok:!0,data:{task_id:oe.id,expected_revision:oe.revision,expected_order_revision:z.data.list.order_revision,expected_hierarchy_revision:be.data}}:be:z},sn=(z,be)=>le("update_task",{task_id:oe.id,expected_revision:oe.revision,changes:z},be),Cs=z=>y(z.via==="sdlc_login"?{title:"Release this claim?",description:`You claimed it via ${Tf(z.via,z.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(!gt)return;if(bn&&(!Lt||J.via)){const be=J.via==="api_key"?`${Lt?"Your":`${j(J.user_id)}'s`} agent is still working on it.`:J.via==="sdlc_login"?`${Lt?"You are":`${j(J.user_id)} is`} still working on it via ${Tf(J.via,J.via_device)}.`:`${j(J.user_id)} is still working on it.`;if(!await y({title:"Complete this task?",description:be,action_label:"Mark complete"}))return}await sn({status_id:gt.id},"Task completed.")!==null&&J&&Lt&&bn&&await le("end_claim",{claim_id:J.id,outcome:"completed"})},re=async(z,be)=>{const se=await jn();if(!se.ok){h.error(se.refusal.message);return}await le(z,se.data,be)},De=async()=>{await y({title:"Archive this task?",description:"It leaves the queue and becomes read-only. Its claim, holds and history stay, and a manager can restore it.",action_label:"Archive task",destructive:!0})&&await re("archive_task","Task archived.")},Ce=async()=>{await re("restore_task","Task restored.")},Ts=async()=>{var _e;const z=J,be=await le("claim_task",{task_id:oe.id,lease_seconds:Nv}),se=(_e=be==null?void 0:be.claim)==null?void 0:_e.id;se&&!(z&&z.id===se&&z.via)&&xe(se)},Pn=async()=>{J&&(J.via&&!await Cs(J)||(await le("end_claim",{claim_id:J.id,outcome:"released"},"Claim released."),xe(null)))},qn=async()=>{J&&await le("end_claim",{claim_id:J.id,outcome:"expired"},"Claim cleared.")},Rt=async z=>{z.hold_type==="paused"&&m&&(z={...z,target_user_id:m});const be=await ee("open_hold",{task_id:oe.id,hold_type:z.hold_type,reason:z.reason,...z.target_user_id?{target_user_id:z.target_user_id}:{},...z.target_task_id?{target_task_id:z.target_task_id}:{},...z.target_label?{target_label:z.target_label}:{}});return be.ok?(E(!1),h.success("Hold added."),z.release_claim&&J&&Lt&&!J.via&&(await le("end_claim",{claim_id:J.id,outcome:"released"}),xe(null)),await te(),null):be.refusal.message},an=z=>le("checklist",{task_id:oe.id,expected_revision:oe.revision,...z}),is=async z=>{for(const be of z.filter(se=>!Ct.includes(se)))await le("set_contributor",{task_id:oe.id,expected_revision:oe.revision,user_id:be,action:"add"});for(const be of p.contributors.filter(se=>!z.includes(se.user_id)))await le("set_contributor",{task_id:oe.id,expected_revision:oe.revision,user_id:be.user_id,action:"remove",expected_contributor_revision:be.revision})},Gn=z=>{var se;if(z.target.kind==="user")return j(z.target.user_id,m);if(z.target.kind==="external")return z.target.label;if(z.target.hidden||!z.target.task_id)return"A task you cannot see";const be=z.target.task_id;return s.jsx(f,{className:"text-primary hover:underline",href:d(`${n}/${be}`),children:((se=M.find(_e=>_e.id===be))==null?void 0:se.title)??"Another task"})},ea=z=>z.target.kind==="user"&&z.target.user_id===m&&!z.released_at?s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void le("release_hold",{hold_id:z.id},"Hold released."),children:"Release"}):Q?s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void le("resolve_hold",{hold_id:z.id},"Hold resolved."),children:"Resolve"}):null;return s.jsxs(s.Fragment,{children:[s.jsx(Ft,{title:oe.title,description:`Created ${An(oe.created_at)} by ${j(oe.created_by,m)}`,actions:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[Q&&s.jsxs(s.Fragment,{children:[s.jsxs(q,{type:"button",variant:"outline",onClick:()=>$(oe.title),children:[s.jsx(ed,{className:"mr-2 size-4","aria-hidden":"true"}),"Edit title"]}),gt&&oe.status_id!==gt.id&&s.jsxs(q,{type:"button",variant:"outline",onClick:()=>void Rs(),children:[s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}),"Mark complete"]})]}),Ne&&!Oe&&s.jsxs(q,{type:"button",variant:"outline",onClick:()=>void De(),children:[s.jsx(Yg,{className:"mr-2 size-4","aria-hidden":"true"}),"Archive"]})]}),children:C!==null?s.jsxs("form",{className:"flex flex-wrap items-center gap-2 pt-1",onSubmit:async z=>{z.preventDefault(),C.trim()&&await sn({title:C.trim()})!==null&&$(null)},children:[s.jsx(Me,{htmlFor:"task-title",className:"sr-only",children:"Title"}),s.jsx(_t,{id:"task-title",className:"max-w-xl",value:C,onChange:z=>$(z.target.value)}),s.jsx(q,{type:"submit",size:"sm",children:"Save"}),s.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:()=>$(null),children:"Cancel"})]}):null}),k&&s.jsxs(me,{variant:k.tone,className:"mt-4","data-testid":"task-notice",children:[k.tone==="warning"?s.jsx(yl,{className:"size-4","aria-hidden":"true"}):s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:k.title}),s.jsx(pe,{children:k.body})]}),Oe?s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(Yg,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"This task is archived"}),s.jsx(pe,{children:Ne?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"It is out of the queue and cannot be claimed. Restore it to work on it again."}),s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void Ce(),children:[s.jsx(TC,{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."})})]}):Q?null:s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"You can view this task"}),s.jsx(pe,{children:"Ask an organization admin for write access to change it."})]}),Q?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(dt,{value:oe.status_id,onValueChange:z=>void sn({status_id:z}),children:[s.jsx(it,{id:"task-status",children:s.jsx(ft,{})}),s.jsx(ot,{children:H.map(z=>s.jsx(ke,{value:z.id,children:z.name},z.id))})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"task-priority",children:"Priority"}),s.jsxs(dt,{value:oe.priority_id??Tl,onValueChange:z=>void sn({priority_id:z===Tl?null:z}),children:[s.jsx(it,{id:"task-priority",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:Tl,children:"Not set"}),v.priorities.map(z=>s.jsx(ke,{value:z.id,children:z.name},z.id))]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"task-primary",children:"Primary"}),s.jsxs(dt,{value:oe.primary_user_id??Tl,onValueChange:z=>void sn({primary_user_id:z===Tl?null:z}),children:[s.jsx(it,{id:"task-primary",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:Tl,children:"Not set"}),x.map(z=>s.jsx(ke,{value:z.user_id,children:z.label},z.user_id))]})]})]}),s.jsx(Z$,{members:x,selected:Ct,on_change:z=>void is(z)})]}):s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(oc,{label:"Status",value:(ze==null?void 0:ze.name)??""}),s.jsx(oc,{label:"Priority",value:(ye==null?void 0:ye.name)??"Not set"}),s.jsx(oc,{label:"Primary",value:oe.primary_user_id?j(oe.primary_user_id,m):"Not set"}),s.jsx(oc,{label:"Contributors",value:Ct.map(z=>j(z,m)).join(", ")||"None"})]}),!Oe&&s.jsx(W$,{claim:J,mine:Lt,holder:J?j(J.user_id):"",own:J!==null&&J.id===W,can_write:Q,on_claim:()=>void Ts(),on_release:()=>void Pn(),on_clear:()=>void qn()}),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"}),Q&&X===null&&s.jsx(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>T(oe.description??""),children:"Edit description"})]}),X!==null?s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async z=>{z.preventDefault(),await sn({description:X})!==null&&T(null)},children:[s.jsx(Me,{htmlFor:"task-description",className:"sr-only",children:"Description"}),s.jsx(rs,{id:"task-description",rows:5,value:X,onChange:z=>T(z.target.value)}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{type:"submit",size:"sm",children:"Save"}),s.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:()=>T(null),children:"Cancel"})]})]}):s.jsx("p",{className:"mt-2 text-sm whitespace-pre-wrap",children:oe.description||s.jsx("span",{className:"text-muted-foreground",children:"No description."})})]}),s.jsxs("section",{className:"mt-6","aria-labelledby":"task-checklist-title",children:[s.jsxs("h2",{id:"task-checklist-title",className:"text-lg font-semibold",children:["Checklist",p.checklist.length>0?` · ${Ss} of ${p.checklist.length} done`:""]}),s.jsx("ul",{className:"mt-2 grid gap-1",children:p.checklist.map(z=>s.jsxs("li",{className:"flex items-center justify-between gap-2 py-1","data-testid":"task-checklist-item",children:[Q?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lr,{id:`check-${z.id}`,checked:z.is_complete,onCheckedChange:be=>void an({action:"toggle",item_id:z.id,expected_item_revision:z.revision,is_complete:be===!0})}),s.jsx(Me,{htmlFor:`check-${z.id}`,className:"font-normal",children:z.label})]}):s.jsxs("span",{className:"text-sm",children:[z.is_complete?"Done: ":"To do: ",z.label]}),Q&&s.jsxs(yd,{children:[s.jsx(bd,{asChild:!0,children:s.jsx(q,{type:"button",variant:"ghost",size:"icon","aria-label":`Item actions for ${z.label}`,children:s.jsx(hp,{className:"size-4","aria-hidden":"true"})})}),s.jsx(Mo,{align:"end",children:s.jsx(_r,{className:"text-destructive focus:text-destructive",onSelect:()=>void an({action:"archive",item_id:z.id,expected_item_revision:z.revision}),children:"Remove"})})]})]},z.id))}),p.checklist.length===0&&!Q&&s.jsx("p",{className:"text-muted-foreground text-sm",children:"No checklist items."}),Q&&s.jsxs("form",{className:"mt-2 grid gap-2",onSubmit:async z=>{z.preventDefault(),I.trim()&&await an({action:"add",label:I.trim()})!==null&&ne("")},children:[s.jsx(Me,{htmlFor:"task-new-item",children:"Add an item"}),s.jsx(_t,{id:"task-new-item",placeholder:"Add an item and press Enter",value:I,onChange:z=>ne(z.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"}),Q&&s.jsxs(q,{type:"button",variant:"outline",size:"sm",onClick:()=>E(!0),children:[s.jsx(c0,{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(Be,{containerAriaLabel:"Holds",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:[p.holds.map(z=>{const be=Wi[z.hold_type];return s.jsxs(ue,{"data-testid":"task-hold",children:[s.jsx(P,{children:s.jsx(he,{variant:be.tone,children:be.label})}),s.jsxs(P,{children:[s.jsx("div",{children:z.reason}),s.jsx("div",{className:"text-muted-foreground text-xs",children:z.released_at?`Released by ${j(z.released_by,m)} · ${An(z.released_at)} · Ready to resolve`:`Opened by ${j(z.opened_by,m)} · ${An(z.opened_at)} · Open`})]}),s.jsx(P,{children:Gn(z)}),s.jsx(P,{className:"text-right",children:ea(z)})]},z.id)}),p.holds.length===0&&s.jsx(ue,{children:s.jsx(P,{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,G).map(z=>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:D$(z)}),s.jsxs("span",{className:"min-w-0 text-right sm:text-left",children:[s.jsx("span",{children:z.actor_id?j(z.actor_id,m):"The system"}),z.via?s.jsxs("span",{className:"text-muted-foreground block max-w-64 truncate text-xs sm:max-w-none",title:`via ${Tf(z.via,z.via_device)}`,children:["via ",Zp(z.via),s.jsx(ik,{via:z.via,device:z.via_device})]}):null]}),s.jsx("span",{className:"text-muted-foreground col-span-2 sm:col-span-1 sm:text-right",children:sk(z.created_at)})]},z.id)),D.length===0&&s.jsx("li",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No activity yet."})]}),D.length>G&&s.jsx(q,{type:"button",variant:"ghost",size:"sm",className:"mt-2",onClick:()=>U(z=>z+kv),children:"Load more"})]}),Q&&ae&&s.jsx(F$,{open:S,members:x,tasks:M,holds_my_web_claim:Lt&&bn&&!(J!=null&&J.via),on_close:()=>E(!1),on_submit:Rt}),g]})}function oc({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 Z$({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(yd,{children:[s.jsx(bd,{asChild:!0,children:s.jsxs(q,{id:"task-contributors",type:"button",variant:"outline",className:"justify-between font-normal",children:[t.length===0?s.jsx("span",{className:"text-muted-foreground",children:"Add a contributor"}):s.jsx("span",{className:"truncate",children:e.filter(a=>t.includes(a.user_id)).map(a=>a.label).join(", ")}),s.jsx(l0,{className:"text-muted-foreground size-4","aria-hidden":"true"})]})}),s.jsx(Mo,{align:"start",children:e.map(a=>{const l=t.includes(a.user_id);return s.jsxs(_r,{onSelect:()=>n(l?t.filter(r=>r!==a.user_id):[...t,a.user_id]),children:[l?s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}):s.jsx("span",{className:"mr-2 size-4"}),a.label]},a.user_id)})})]})]})}function ik({via:e,device:t}){return e!=="sdlc_login"||!t?null:s.jsxs(s.Fragment,{children:[" on ",s.jsx("bdi",{children:t})]})}function W$({claim:e,mine:t,holder:n,own:a,can_write:l,on_claim:r,on_release:i,on_clear:o}){let c=s.jsx(mp,{className:"size-4","aria-hidden":"true"}),d="Nobody is working on this",f=l?"Claim it to show others you are.":"",h=l?s.jsx(q,{type:"button",size:"sm",onClick:r,children:"Claim"}):null;if(e&&e.lapsed){const m=new Date(e.lease_expires_at)<=new Date;c=s.jsx(JC,{className:"size-4","aria-hidden":"true"}),d=m?`${t?"Your":`${n}'s`} claim lapsed at ${ns(e.lease_expires_at)}`:`${t?"Your":`${n}'s`} claim lapsed`,f=m?"Its time ran out.":`${n} can no longer edit this task.`,l&&(f+=" Take it over to work on it yourself, or clear it so anyone can claim it."),h=l?s.jsxs(s.Fragment,{children:[s.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:o,children:"Clear claim"}),s.jsx(q,{type:"button",size:"sm",onClick:r,children:"Take over"})]}):null}else if(e){const m=ns(e.lease_expires_at);c=e.via==="api_key"?s.jsx(fp,{className:"size-4","aria-hidden":"true"}):e.via==="sdlc_login"?s.jsx(jR,{className:"size-4","aria-hidden":"true"}):s.jsx(eT,{className:"size-4","aria-hidden":"true"});const x=s.jsxs(s.Fragment,{children:["Claimed via sdlc login",s.jsx(ik,{via:e.via,device:e.via_device}),"."]});t&&e.via==="api_key"?(d=`Your agent is working on this until ${m}`,f="Claimed through one of your API keys. This page does not renew it. Releasing it, or Mark complete, ends the agent's claim after asking."):t&&e.via==="sdlc_login"?(d=`You are working on this until ${m}`,f=s.jsxs(s.Fragment,{children:[x," This page does not renew it. Releasing it, or Mark complete, ends that claim after asking."]})):e.via==="sdlc_login"?(d=`${n} is working on this until ${m}`,f=x):t?(d=`You are working on this until ${m}`,f=a?"Claimed on the web, and renewed while this page is open. Marking the task complete ends your claim.":"Claimed on the web. Marking the task complete ends your claim."):e.via==="api_key"?(d=`${n}'s agent is working on this until ${m}`,f="Claimed through an API key."):(d=`${n} is working on this until ${m}`,f=l?"Claimed on the web. You can take it over if the claim lapses.":"Claimed on the web."),h=t?s.jsx(q,{type:"button",size:"sm",variant:"outline",onClick:i,children:"Release claim"}):null}return s.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-3 rounded-lg border p-3","data-testid":"task-claim",children:[c,s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-sm font-medium",children:d}),f?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:f}):null]}),h?s.jsx("div",{className:"flex items-center gap-2",children:h}):null]})}const J$=10,ok=5,eD=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,ck="Not available",tD={added:"Added",changed:"Changed",removed:"Removed"},nD={thread:"Thread",task:"Task",issue:"Issue",release:"Release",test:"Test"},Sv=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,127}$/;function sD(e,t){const n=t!=null&&t.startsWith("task:")?t.slice(5):null;if(n&&eD.test(n))return{label:n,path:`/org/${e}/tasks/${n}`};const a=t!=null&&t.startsWith("issue:")?t.slice(6):null;if(a&&/^iss-\d{1,9}$/.test(a))return{label:a,path:`/org/${e}/issues/${a}`};const l=t!=null&&t.startsWith("release:")?t.slice(8):null;if(l&&Sv.test(l))return{label:l==="candidate"?"Candidate":`Release ${l}`,path:`/releases?release=${l}`};const r=t!=null&&t.startsWith("planned:")?t.slice(8):null;return r&&Sv.test(r)?{label:`Planned Release ${r}`,path:`/releases?planned=${r}`}:{label:"Tasks",path:`/org/${e}/tasks`}}const uk=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function aD({org:e,task_id:t,from:n}){var Rs;const a=$o(),{href:l,Link:r}=Ve(),{confirm:i,confirm_dialog:o}=Co(),c=sD(e,n),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState([]),[x,j]=u.useState([]),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,_]=u.useState({state:"loading"}),[N,R]=u.useState({state:"loading"}),[w,k]=u.useState(null),[L,D]=u.useState(null),[K,G]=u.useState(!1),U=u.useRef(null),M=as(),A=u.useRef(null),S=u.useRef(null),E=u.useRef(null),C=u.useRef(null),$=u.useRef(!1),X=u.useRef(0),T=u.useRef(0),I=u.useCallback(async()=>{if(!a.taskSections)return;_({state:"loading"});const re=await a.taskSections(t);_(re.ok?{state:"ok",data:re.data}:{state:"failed",refusal:re.refusal})},[a.taskSections,t]),ne=u.useCallback(async()=>{if(!a.taskRelated)return;R({state:"loading"});const re=await a.taskRelated(t);R(re.ok?{state:"ok",data:re.data}:{state:"failed",refusal:re.refusal})},[a.taskRelated,t]),W=u.useCallback(async()=>{var Pn,qn;const re=T.current+=1;p(null),I(),ne();const[De,Ce]=await Promise.all([a.availability(),a.task?a.task(t):Promise.resolve(null)]);if(re!==T.current)return;De.state==="active"&&m(((Pn=De.workspace.workflows.find(Rt=>Rt.id===De.list.workflow_id))==null?void 0:Pn.statuses)??[]);const Ts=De.state==="off"&&((qn=De.refusal)==null?void 0:qn.reason)==="engine_missing"?De.refusal:null;if(!Ce||!Ce.ok&&Ce.refusal.reason==="engine_missing"||Ts){f({state:"engine_missing",refusal:Ts??(Ce&&!Ce.ok?Ce.refusal:{status:0,message:""})});return}if(Ce.ok){X.current=0,y(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(X.current+=1,X.current===1&&uk(Ce.refusal)){p(Ce.refusal.retry_after??J$);return}y(Ce.refusal),f(Rt=>Rt.state==="loading"?{state:"loading"}:Rt)},[a,t,I,ne]);u.useEffect(()=>{W()},[W]),u.useEffect(()=>{if(g===null)return;const re=setTimeout(()=>void W(),g*1e3);return()=>clearTimeout(re)},[g,W]),u.useEffect(()=>{let re=!0;return a.members().then(De=>{re&&De.ok&&j(De.data)}),()=>{re=!1}},[a.members]),u.useEffect(()=>{var De;if($.current||d.state!=="ok")return;$.current=!0;const re=(De=U.current)==null?void 0:De.querySelector("h1");re&&(re.tabIndex=-1,re.focus())},[d.state]),u.useEffect(()=>{var re;w&&((re=S.current)==null||re.focus())},[w]),u.useEffect(()=>{if(L===null)return;const re=setTimeout(()=>{var De;return(De=A.current)==null?void 0:De.focus()},0);return()=>clearTimeout(re)},[L]);const xe=u.useMemo(()=>new Map(x.map(re=>[re.user_id,re.label])),[x]),V=re=>re?xe.get(re)??re:"",O=()=>{k(null),W()},Y=u.useRef(null),ae=re=>(Y.current=re,re==="graph"?I():ne());if(u.useEffect(()=>{var Ce;const re=Y.current;if(re===null||(re==="graph"?b:N).state==="loading")return;Y.current=null;const De=(re==="graph"?E:C).current??((Ce=U.current)==null?void 0:Ce.querySelector("h1"));De==null||De.focus()},[b,N]),d.state==="missing")return s.jsx(ya,{children:s.jsx(ku,{back:`/org/${e}/tasks`,description:`No task ${t} in this checkout. It may have finished and been archived, or never been recorded.`})});const H=s.jsx(q,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(r,{href:l(c.path),children:[s.jsx(s0,{className:"size-4","aria-hidden":"true"}),c.label]})});if(d.state==="engine_missing")return s.jsx(ya,{children:s.jsx("div",{ref:U,className:"contents",children:s.jsx(Js,{page:"Task",header:s.jsx(Ei,{back:H,id:null,title:t})})})});const te=v?s.jsxs(me,{variant:"destructive",className:"mt-4",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Could not read this task"}),s.jsxs(pe,{children:[s.jsxs("p",{children:[v.message,v.since?` Since ${Wn(v.since)}.`:"",d.state==="ok"?` This page was read at ${Wn(d.at)}.`:""," See the sdlc viewer terminal for more."]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:O,children:"Retry"})]})]}):null,ee=g!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(vn,{"aria-hidden":"true"}),"Could not read this task. Trying again in ",g," seconds."]}):null,le=s.jsx("div",{role:"status","aria-live":"polite",children:ee});if(d.state==="loading")return s.jsxs(ya,{children:[le,te,!v&&g===null?s.jsx(ex,{}):null]});const{detail:J,at:Qe}=d,{task:oe}=J,Oe=h.find(re=>re.id===oe.status_id),Q=J.local_done&&"task"in J.local_done?J.local_done:null,Ne=J.local_waits??[],ze=Q?Ne[0]??null:null,gt=ze?V(ze.opened_by):J.owner_title??V(J.thread),ye=b.state==="ok"?b.data:null,Ct=(ye==null?void 0:ye.lifecycle)==="finished",Lt=Ct&&(ye==null?void 0:ye.outcome)==="cancelled",bn=Ct&&(ye==null?void 0:ye.outcome)==="complete",Ss=!!oe.created_at,jn=J.acceptance??[],sn=async()=>{var Ce;if(!Q||!((Ce=a.commands)!=null&&Ce.complete)||!await i({title:`Mark ${oe.title} done?`,description:ze?`This answers ${gt}'s ask, “${ze.reason}”, closes that wait, and tells ${gt} to check and continue.`:`This tells ${gt||"its thread"} to check and continue.`,action_label:"Mark done"}))return;G(!0);const De=await a.commands.complete(Q);if(G(!1),!De.ok){D(De.refusal.message);return}await W(),k({title:oe.title,asker:gt||"Its thread"})},Cs=s.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[Q&&!w?s.jsxs(s.Fragment,{children:[s.jsxs(q,{ref:A,type:"button",variant:"outline",disabled:K,"aria-disabled":L!==null?!0:void 0,"aria-describedby":L!==null?"task-done-why":void 0,onClick:()=>{L===null&&sn()},children:[s.jsx(Or,{className:"mr-2 size-4","aria-hidden":"true"}),"Done"]}),L!==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 ",Wn(Qe)]}),s.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:O,children:[s.jsx(yl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsxs(ya,{children:[s.jsxs("div",{ref:U,className:"contents",children:[s.jsx(Ei,{back:H,id:oe.id,badge:Oe?s.jsx(he,{variant:nk(Oe),children:Oe.name}):null,title:oe.title,created:Ss?`Created ${An(oe.created_at)}${gt||J.owner_title?` by ${J.owner_title??gt}`:""}`:null,actions:Cs}),le,te,w?s.jsx("div",{ref:S,tabIndex:-1,role:"status","aria-live":"polite",className:"outline-none",children:s.jsxs(me,{variant:"success",className:"mt-4",children:[s.jsx(Ju,{className:"size-4","aria-hidden":"true"}),s.jsxs(ve,{children:["Marked ",w.title," done"]}),s.jsxs(pe,{children:[w.asker," is told to check and continue."]})]})}):null,L!==null?s.jsxs(me,{variant:"destructive",className:"mt-4",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Done was not recorded"}),s.jsxs(pe,{children:[L," Read again to see the task as it is now."]})]}):null,ze&&!w?s.jsxs(me,{variant:"warning",className:"mt-4",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsxs(ve,{children:[gt," asks: ",ze.reason]}),s.jsxs(pe,{children:["Waiting on you since ",Wp(ze.opened_at),". Done answers it and tells ",gt," to check and continue."]})]}):null,J.view_outdated?s.jsxs(me,{variant:"warning",className:"mt-4",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:$r}),s.jsxs(pe,{children:[M," Until then this page cannot read the claim and holds."]})]}):null,s.jsxs("dl",{className:"mt-4 grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[s.jsx(ms,{label:"Owner thread",value:J.owner_title??(V(J.thread)||"None")}),s.jsx(ms,{label:"Release",value:J.release??"None"}),s.jsx(ms,{label:"Session",value:b.state==="loading"?"Loading…":b.state==="failed"?"Not available":ye!=null&&ye.session?s.jsxs(s.Fragment,{children:[ye.session.provider," ",s.jsx("span",{className:"font-mono break-all",children:ye.session.id})]}):"None"}),s.jsx(ms,{label:"Now",value:J.local_detail??(Oe==null?void 0:Oe.name)??""})]}),s.jsx("p",{className:"text-muted-foreground mt-2 text-xs",children:"Local tasks have no priority or contributors."}),s.jsx(lD,{detail:J,holder:V((Rs=J.claim)==null?void 0:Rs.user_id),finished_at:Ct?(ye==null?void 0:ye.finished_at)??null:null,read_at:Qe}),s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"text-info size-4","aria-hidden":"true"}),Q?s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Done is the one change this page makes"}),s.jsx(pe,{children:"Everything else about this task changes through its thread."})]}):s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"This page only reads tasks"}),s.jsx(pe,{children:"A task changes through the agent thread working on it."})]})]}),Ss?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."}),Q?s.jsx(yt,{id:"task-done-needs",title:"What Done needs",children:jn.length>0?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-xs",children:["The task's acceptance; ",gt||"its thread"," checks these after Done."]}),s.jsx("ul",{className:"mt-2 grid list-disc gap-1 pl-5 text-sm",children:jn.map(re=>s.jsx("li",{children:re},re))})]}):s.jsxs("p",{className:"text-sm",children:["Its thread gave no acceptance. Ask ",gt||"its thread"," what Done needs before marking it."]})}):jn.length>0?s.jsxs(yt,{id:"task-acceptance",title:"Acceptance",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:bn?"All met: the task finished complete":Lt&&(ye!=null&&ye.finished_at)?`Cancelled ${An(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:jn.map(re=>s.jsx("li",{children:bn?`Met: ${re}`:re},re))})]}):null,s.jsx(rD,{detail:J,waits:Ne,given:Q!==null,threadName:V,threadsLink:s.jsx(r,{className:"text-primary hover:underline",href:l(`/org/${e}/threads`),children:"Threads"})}),b.state==="loading"?s.jsxs("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading the task's sections",children:[s.jsx(pt,{className:"h-8 w-full"}),s.jsx(pt,{className:"h-8 w-full"}),s.jsx(pt,{className:"h-8 w-2/3"})]}):null,ye?s.jsx(yt,{id:"task-stands",title:"Where it stands",children:s.jsxs("p",{className:"text-sm",children:[(Oe==null?void 0:Oe.name)??oe.status_id,J.local_detail?` · ${J.local_detail}`:""]})}):null,ye!=null&&ye.time?s.jsx(iD,{time:ye.time}):null,s.jsx(oD,{sections:b,heading_ref:E,on_retry:()=>void ae("graph"),taskLink:re=>s.jsx(r,{className:"text-primary hover:underline",href:l(`/org/${e}/tasks/${re}?from=task:${oe.id}`),children:re})}),ye!=null&&ye.files?s.jsx(cD,{files:ye.files,finished:Ct}):null,ye!=null&&ye.proof?s.jsx(uD,{proof:ye.proof,finished_at:ye.finished_at,who:J.owner_title??null}):null,ye&&ye.history.length>0?s.jsx(dD,{history:ye.history}):null,s.jsx(dk,{related:N,heading_ref:C,on_retry:()=>void ae("related"),link:re=>{const De=re.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(re.id)}`:re.kind==="task"?`/org/${e}/tasks/${re.id}?from=task:${oe.id}`:re.kind==="issue"?`/org/${e}/issues/${encodeURIComponent(re.id)}?from=task:${oe.id}`:re.kind==="release"?`/releases?${re.planned?"planned":"release"}=${encodeURIComponent(re.id)}`:null;return De?s.jsx(r,{className:ie("text-primary hover:underline",re.kind!=="thread"&&re.label===re.id&&"font-mono"),href:l(De),children:re.label}):re.label}})]}),o]})}function ya({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 Ei({back:e,id:t,badge:n,title:a,created:l,actions:r}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsx("div",{children:e}),t?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[s.jsx("span",{className:"font-mono",children:t}),n]}):null,s.jsx(Ft,{title:a,description:l??void 0,actions:r})]})}function ms({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 yt({id:e,title:t,aside:n,heading_ref:a,children:l}){return s.jsxs("section",{className:"mt-6","aria-labelledby":`${e}-title`,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[s.jsx("h2",{id:`${e}-title`,ref:a,tabIndex:a?-1:void 0,className:"text-lg font-semibold outline-none",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),s.jsx("div",{className:"mt-2",children:l})]})}function lD({detail:e,holder:t,finished_at:n,read_at:a}){const l=e.claim,[,r]=u.useReducer(f=>f+1,0),i=l&&!e.view_outdated?new Date(l.lease_expires_at).getTime():null;u.useEffect(()=>{if(i===null||!Number.isFinite(i))return;const f=i-Date.now();if(f<=0)return;const h=setTimeout(r,Math.min(f+50,2147483647));return()=>clearTimeout(h)},[i]);let o=s.jsx(mp,{className:"size-4","aria-hidden":"true"}),c="Nobody is working on this",d=null;if(e.view_outdated)c=`Claimed by: ${ck}`;else if(l){const f=new Date(l.lease_expires_at)<=new Date(Math.max(Date.now(),new Date(a).getTime()));o=s.jsx(fp,{className:"size-4","aria-hidden":"true"}),c=`${t} is working on this until ${Wn(l.lease_expires_at)}${f||l.lapsed?" · passed":""}`,d="Claimed in the coordination registry; its thread renews the claim."}else n&&(o=s.jsx(Ju,{className:"size-4","aria-hidden":"true"}),d=`Finished ${An(n)}. Its claim ended when it finished.`);return s.jsxs(xt,{className:"mt-4 flex flex-wrap items-center gap-3 p-3","data-testid":"task-claim",children:[o,s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-sm font-medium",children:c}),d?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:d}):null]})]})}function rD({detail:e,waits:t,given:n,threadName:a,threadsLink:l}){if(e.view_outdated)return s.jsx(yt,{id:"task-holds",title:"Holds",children:s.jsx("p",{className:"text-sm",children:ck})});if(e.holds.length===0)return null;const r=new Map(t.map(i=>[i.id,i]));return s.jsxs(yt,{id:"task-holds",title:`Holds · ${e.holds.length} open`,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"A hold does not change the task's status."}),s.jsx(xt,{className:"mt-2 overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Holds",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Type"}),s.jsx(F,{children:"Reason"}),s.jsx(F,{children:"Waiting on"}),s.jsx(F,{children:"Opened"})]})}),s.jsx(He,{children:e.holds.map(i=>{var f;const o=r.get(i.id),c=Wi[i.hold_type],d=n?"Done above answers it":o!=null&&o.local_done?"In Waiting on you":(f=o==null?void 0:o.local_threads)!=null&&f.length?s.jsxs(s.Fragment,{children:["Answer it in ",l,": ",o.local_threads.join(" · ")]}):null;return s.jsxs(ue,{"data-testid":"task-hold",children:[s.jsx(P,{children:s.jsx(he,{variant:c.tone,children:(o==null?void 0:o.local_label)??c.label})}),s.jsxs(P,{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(P,{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(P,{children:Wp(i.opened_at)})]},i.id)})})]})})]})}function iD({time:e}){return s.jsx(yt,{id:"task-time",title:"Time",children:s.jsxs("dl",{className:"grid gap-4 sm:grid-cols-3",children:[s.jsx(ms,{label:"Estimate",value:e.estimate?`${ti(e.estimate.low)}–${ti(e.estimate.high)}`:e.unknown_reason??"None"}),s.jsx(ms,{label:"Time taken",value:e.elapsed!==null?`${ti(e.elapsed)}${e.over_estimate?" · over estimate":""}`:"Not started"}),e.forecast?s.jsx(ms,{label:"Reforecast",value:s.jsxs("span",{className:"text-muted-foreground",children:[ti(e.forecast.low),"–",ti(e.forecast.high)," left",e.forecast.reason?` · ${e.forecast.reason}`:""]})}):null]})})}function tx({what:e,again:t,refusal:n,on_retry:a}){return s.jsxs(me,{variant:"destructive",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsxs(ve,{children:["Could not read ",e]}),s.jsxs(pe,{children:[s.jsx("p",{children:n.message}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:t})]})]})}function oD({sections:e,heading_ref:t,on_retry:n,taskLink:a}){const[l,r]=u.useState(!1);if(e.state==="loading")return null;const i=e.state==="failed"?e.refusal:e.data.graph.ok?null:e.data.graph.refusal;if(i)return s.jsx(yt,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsx(tx,{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(yt,{id:"task-graph",title:"Graph changes",heading_ref:t,children:s.jsxs("p",{className:"text-sm",children:["This task changes no modeled design. Its plan says why: ",o.exempt,"."]})});if(o.changes.length===0)return null;const c=l?o.changes:o.changes.slice(0,ok),d=o.changes.length-c.length;return s.jsxs(yt,{id:"task-graph",title:"Graph changes",aside:o.document,heading_ref:t,children:[s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Graph changes",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:c.map(f=>s.jsxs(ue,{children:[s.jsxs(P,{children:[s.jsx("div",{children:f.label}),s.jsx("div",{className:"text-muted-foreground text-xs",children:f.type})]}),s.jsx(P,{children:tD[f.change]}),s.jsx(P,{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(P,{children:f.planned?"Yes":s.jsx(he,{variant:"warning",children:"No longer planned"})})]},`${f.id}:${f.planned}`))})]})}),d>0?s.jsxs("p",{className:"mt-2 flex flex-wrap items-center gap-2 text-sm",children:[d," more changes in this task's plan slice.",s.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(!0),children:["Show all ",o.changes.length]})]}):null]})}function cD({files:e,finished:t}){const[n,a]=u.useState(!1),l=n?e.paths:e.paths.slice(0,ok);return s.jsxs(yt,{id:"task-files",title:"Files",children:[l.length>0?s.jsx("ul",{className:"grid gap-1 text-sm",children:l.map(r=>s.jsx("li",{children:s.jsx("span",{className:"font-mono break-all",children:r})},r))}):null,e.paths.length>l.length?s.jsxs(q,{type:"button",variant:"ghost",size:"sm",className:"mt-1",onClick:()=>a(!0),children:["Show all ",e.paths.length]}):null,e.landed?s.jsxs("p",{className:"mt-2 text-sm",children:["Landed ",s.jsx("span",{className:"font-mono",children:e.landed.sha.slice(0,10)})," · ",e.landed.files," files",t?"":" · becomes the proof when the task finishes"]}):null]})}function uD({proof:e,finished_at:t,who:n}){return s.jsxs(yt,{id:"task-proof",title:"Evidence and proof",children:[e.evidence?s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:e.evidence}):null,e.no_code?s.jsxs("p",{className:"mt-2 text-sm",children:["No code: ",e.no_code]}):e.commit?s.jsxs("p",{className:"mt-2 text-sm",children:["Proof ",s.jsx("span",{className:"font-mono",children:e.commit.slice(0,10)})," ·"," ",e.on_main?"on main":"not yet on main"]}):null,t?s.jsxs("p",{className:"text-muted-foreground mt-2 text-xs",children:["Finished ",An(t),n?` by ${n}`:""]}):null]})}function dD({history:e}){return s.jsxs(yt,{id:"task-history",title:"History",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"From the task record, newest first"}),s.jsx(xt,{className:"mt-2 overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"History",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"What"}),s.jsx(F,{children:"Who"}),s.jsx(F,{children:"When"})]})}),s.jsx(He,{children:e.map((t,n)=>s.jsxs(ue,{children:[s.jsx(P,{children:t.what}),s.jsx(P,{children:t.who??"Its thread"}),s.jsx(P,{children:Wp(t.at)})]},`${t.at}:${n}`))})]})})]})}function dk({id:e="task-related",related:t,heading_ref:n,on_retry:a,link:l,fixed:r=!1}){return t.state==="ok"&&t.data.length===0?null:s.jsx(yt,{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(pt,{className:"h-8 w-full"}),s.jsx(pt,{className:"h-8 w-full"}),s.jsx(pt,{className:"h-8 w-2/3"})]}):t.state==="failed"?s.jsx(tx,{what:"related work",again:"Read related work again",refusal:t.refusal,on_retry:a}):s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Related",className:r?"table-fixed":void 0,children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{className:r?"w-[14%]":void 0,children:"Kind"}),s.jsx(F,{className:r?"w-[45%]":void 0,children:"Item"}),s.jsx(F,{className:r?"w-[41%]":void 0,children:"How it relates"})]})}),s.jsx(He,{children:t.data.map(i=>s.jsxs(ue,{children:[s.jsx(P,{children:nD[i.kind]}),s.jsx(P,{className:r?"break-words":void 0,children:l(i)}),s.jsx(P,{className:r?"break-words":void 0,children:i.relation})]},`${i.kind}:${i.planned?"planned:":""}${i.id}`))})]})})})}function fD({org:e,task_id:t,from:n}){const a=$o(),l=`/org/${e}/tasks`;return a.taskSections?s.jsx(aD,{org:e,task_id:t,from:n??null}):s.jsx(hD,{task_id:t,back:l})}function hD({task_id:e,back:t}){const{availability:n}=$o(),[a,l]=u.useState({state:"loading"});return u.useEffect(()=>{let r=!0;return n().then(i=>{r&&l(i)}),()=>{r=!1}},[n]),a.state==="off"?s.jsx(ku,{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(Q$,{active:a,task_id:e,back:t}):a.state==="error"?s.jsxs(me,{variant:"destructive",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"This task could not be loaded"}),s.jsx(pe,{children:"Check your connection and try again."})]}):a.state==="available"?s.jsx(ku,{back:t}):s.jsx(ex,{})})}function Kn({children:e}){return s.jsx("p",{role:"alert",className:"text-destructive text-sm",children:e})}const mD=["open","triaged","resolved","closed"],nx=["low","normal","high","urgent"],pD=["fixed","works_as_intended","planned","duplicate","wont_fix","cannot_reproduce"],xD=["title","description","external_reference"],Su={open:"Open",triaged:"Triaged",escalated:"Escalated",waiting_on_fix:"Waiting on fix",resolved:"Resolved",closed:"Closed"},fk={open:"warning",triaged:"info",escalated:"info",waiting_on_fix:"info",resolved:"success",closed:"neutral"},Ji={low:"Low",normal:"Normal",high:"High",urgent:"Urgent"},sx={fixed:"Fixed",works_as_intended:"Works as intended",planned:"Planned",duplicate:"Duplicate",wont_fix:"Won't fix",cannot_reproduce:"Cannot reproduce"},hk={title:"Title",description:"Description",external_reference:"External reference"},gD=[["year",365*24*3600],["month",30*24*3600],["week",7*24*3600],["day",24*3600],["hour",3600],["minute",60]];function Mc(e,t=Date.now()){const n=Math.round((new Date(e).getTime()-t)/1e3),a=new Intl.RelativeTimeFormat("en",{numeric:"auto"});for(const[l,r]of gD)if(Math.abs(n)>=r)return a.format(Math.round(n/r),l);return"just now"}function sm(e,t,n){const a=`/org/${encodeURIComponent(e)}/proj/${encodeURIComponent(t)}/support`;return n?`${a}/${encodeURIComponent(n)}`:a}function ax(e,t){return e?t??"Not available":"A former member"}const vD="the issue integration";function yD(e){return!e.created_by&&e.reporter_kind==="customer"?vD:ax(e.created_by,e.created_by_username)}function bD(e,t){return!e.actor_id&&e.kind==="created"&&t.reporter_kind==="customer"?"The issue integration":ax(e.actor_id,e.actor_username)}const cc="not_set",jD="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 _D({create:e,open:t,onOpenChange:n,onCreated:a}){const[l,r]=u.useState(""),[i,o]=u.useState(""),[c,d]=u.useState(!1),[f,h]=u.useState(""),[m,x]=u.useState(cc),[j,v]=u.useState(!1),[y,g]=u.useState(null),p=u.useRef(null),b=()=>{r(""),o(""),d(!1),h(""),x(cc),g(null),p.current=null},_=w=>{var k;return((k=y==null?void 0:y.personal_data)==null?void 0:k.field)===w?y.message:void 0},N=async w=>{if(w.preventDefault(),j)return;v(!0),p.current??(p.current=crypto.randomUUID());const k=await e({request_id:p.current,title:i.trim()||void 0,description:f||void 0,external_reference:l.trim()||void 0,priority:m===cc?null:m});if(v(!1),!k.ok){k.refusal.status!==0&&(p.current=null),g(k.refusal);return}b(),a(k.data.issue,k.data.duplicates)},R=y&&!y.personal_data?y.message:void 0;return s.jsx(zn,{open:t,onOpenChange:w=>{w||b(),n(w)},children:s.jsx(Ln,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:N,className:"grid gap-4",children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:"New support issue"}),s.jsx(In,{children:"Log one help-desk report. Text is shown exactly as entered."})]}),s.jsxs(me,{variant:"warning",children:[s.jsx(en,{}),s.jsx(pe,{children:jD})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-issue-reference",children:"External reference"}),s.jsx(_t,{id:"maintain-issue-reference",value:l,"aria-invalid":!!_("external_reference"),onChange:w=>{r(w.target.value),c||o(w.target.value)}}),_("external_reference")?s.jsx(Kn,{children:_("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(_t,{id:"maintain-issue-title",value:i,"aria-invalid":!!_("title"),onChange:w=>{o(w.target.value),d(!0)}}),_("title")?s.jsx(Kn,{children:_("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":!!_("description"),onChange:w=>h(w.target.value)}),_("description")?s.jsx(Kn,{children:_("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-issue-priority",children:"Priority"}),s.jsxs(dt,{value:m,onValueChange:x,children:[s.jsx(it,{id:"maintain-issue-priority",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:cc,children:"Not set"}),nx.map(w=>s.jsx(ke,{value:w,children:Ji[w]},w))]})]})]}),R?s.jsx(Kn,{children:R}):null,s.jsxs(Bn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>{b(),n(!1)},children:"Cancel"}),s.jsx(q,{type:"submit",loading:j,disabled:!i.trim()&&!l.trim(),children:"Log issue"})]})]})})})}const wD=["supportAccess","assigneeCandidates","create","update","assign","transition","redact"];function mk(){return ND(nn().issues)}function ND(e){return e&&wD.every(t=>typeof e[t]=="function")?e:null}function pk(e){const[t,n]=u.useState(null);return u.useEffect(()=>{if(!e)return;let a=!1;return e.supportAccess().then(l=>{a||n({contract:e,state:l.ok?{state:"ready",access:l.data}:{state:"error"}})}),()=>{a=!0}},[e]),t&&e&&t.contract===e?t.state:{state:"loading"}}function xk({access:e,header:t,back_href:n,children:a}){const{href:l,Link:r}=Ve();return e.state==="loading"?s.jsxs("div",{className:"flex flex-1 items-center justify-center py-24",children:[s.jsx(vn,{className:"size-5"}),s.jsx("span",{className:"sr-only",children:"Loading…"})]}):e.state==="error"||!e.access.enabled?s.jsx(Ba,{title:"Page not found",description:"This page does not exist or you do not have access to it.",backHref:l(n),backLabel:"Back to the project",link:r}):e.access.can_view?s.jsx(s.Fragment,{children:a(e.access)}):s.jsxs(s.Fragment,{children:[t,s.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[s.jsx(TR,{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 kD(){const e=Ve();return t=>{e.navigate?e.navigate(t):window.location.assign(e.href(t))}}const on="all",uc=25;function am({action:e}){return s.jsx(Ft,{title:"Support",description:"Help-desk reports logged against this project.",actions:e})}function SD({org:e,project:t,query:n}){const a=mk(),l=pk(a),r=`/org/${e}/proj/${t}`;return s.jsx("div",{className:"flex w-full flex-1 flex-col gap-6 px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(xk,{access:l,header:s.jsx(am,{}),back_href:r,children:i=>a?s.jsx(CD,{contract:a,access:i,org_name:e,proj_name:t,query:n}):null})})}function CD({contract:e,access:t,org_name:n,proj_name:a,query:l}){const{href:r,Link:i}=Ve(),o=kD(),[c,d]=u.useState(()=>new URLSearchParams(l).get("external_reference")??""),[f,h]=u.useState(on),[m,x]=u.useState(on),[j,v]=u.useState(on),[y,g]=u.useState(0),[p,b]=u.useState(null),[_,N]=u.useState(0),[R,w]=u.useState(null),[k,L]=u.useState([]),[D,K]=u.useState(!1),G=c.trim()!==""||f!==on||m!==on||j!==on,U=u.useCallback(async()=>{const C=await e.list({external_reference:c.trim()||void 0,status:f===on?void 0:f,priority:m===on?void 0:m,assignee:j===on?void 0:j,limit:uc,offset:y*uc});if(!C.ok){w(C.refusal.message);return}w(null),b(C.data.issues),N(C.data.total)},[e,c,f,m,j,y]);u.useEffect(()=>{const C=setTimeout(()=>void U(),200);return()=>clearTimeout(C)},[U]),u.useEffect(()=>{e.assigneeCandidates().then(C=>{C.ok&&L(C.data.candidates)})},[e]);const M=t.can_change?s.jsxs(q,{onClick:()=>K(!0),children:[s.jsx(br,{className:"mr-2 size-4"}),"New issue"]}):void 0,A=s.jsx(_D,{create:e.create,open:D,onOpenChange:K,onCreated:(C,$)=>{K(!1);const X=sm(n,a,C.id);o($.length?`${X}?duplicates=${$.length}`:X)}});if(p!==null&&_===0&&!G&&y===0)return s.jsxs(s.Fragment,{children:[s.jsx(am,{}),s.jsxs("div",{className:"flex flex-col items-center gap-3 py-24 text-center",children:[s.jsx(wR,{className:"text-muted-foreground size-8","aria-hidden":!0}),s.jsx("h2",{className:"text-lg font-semibold",children:"No support issues yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Log a help-desk report under its ticket number, so every report is counted once."}),t.can_change?s.jsxs(q,{onClick:()=>K(!0),children:[s.jsx(br,{className:"mr-2 size-4"}),"Log the first issue"]}):null]}),A]});const S=_===0?0:y*uc+1,E=Math.min(_,(y+1)*uc);return s.jsxs(s.Fragment,{children:[s.jsx(am,{action:M}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"relative w-full max-w-sm",children:[s.jsx(YR,{className:"text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2","aria-hidden":!0}),s.jsx(_t,{"aria-label":"Filter by external reference",placeholder:"Filter by external reference",className:"pl-9",value:c,onChange:C=>{d(C.target.value),g(0)}})]}),s.jsx(Af,{label:"Status",value:f,onChange:C=>{h(C),g(0)},options:mD.map(C=>({value:C,label:Su[C]}))}),s.jsx(Af,{label:"Priority",value:m,onChange:C=>{x(C),g(0)},options:nx.map(C=>({value:C,label:Ji[C]}))}),s.jsx(Af,{label:"Assignee",value:j,onChange:C=>{v(C),g(0)},options:[{value:"unassigned",label:"Unassigned"},{value:"cannot_act",label:"Assignee cannot act"},...k.map(C=>({value:C.user_id,label:C.username??"Not available"}))]})]}),R?s.jsx(Kn,{children:R}):null,s.jsx("div",{className:"rounded-md border",children:s.jsxs(Be,{children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:p===null?s.jsx(ue,{children:s.jsx(P,{colSpan:6,className:"h-24 text-center",children:"Loading…"})}):p.length===0?s.jsx(ue,{children:s.jsx(P,{colSpan:6,className:"h-24 text-center",children:"No issues match these filters."})}):p.map(C=>s.jsxs(ue,{children:[s.jsx(P,{className:"max-w-md",children:s.jsx(i,{href:r(sm(n,a,C.id)),className:"font-medium hover:underline",children:C.title})}),s.jsx(P,{className:"font-mono text-xs",children:C.external_reference??""}),s.jsx(P,{children:s.jsx(he,{variant:fk[C.status],children:Su[C.status]})}),s.jsx(P,{children:C.priority?Ji[C.priority]:""}),s.jsx(P,{children:s.jsx(RD,{issue:C})}),s.jsx(P,{className:"text-muted-foreground",children:Mc(C.updated_at)})]},C.id))})]})}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("p",{className:"text-muted-foreground text-sm",children:_===0?"No issues.":`Showing ${S}–${E} of ${_} issue${_===1?"":"s"}.`}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(q,{variant:"outline",size:"sm",disabled:y===0,onClick:()=>g(C=>Math.max(0,C-1)),children:"Previous"}),s.jsx(q,{variant:"outline",size:"sm",disabled:E>=_,onClick:()=>g(C=>C+1),children:"Next"})]})]}),A]})}function RD({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(he,{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 r;const l=u.useMemo(()=>t===on||a.some(i=>i.value===t),[a,t]);return s.jsxs(dt,{value:l?t:on,onValueChange:n,children:[s.jsx(it,{className:"w-44","aria-label":e,children:s.jsx(ft,{placeholder:e,children:t===on?e:(r=a.find(i=>i.value===t))==null?void 0:r.label})}),s.jsxs(ot,{children:[s.jsx(ke,{value:on,children:"All"}),a.map(i=>s.jsx(ke,{value:i.value,children:i.label},i.value))]})]})}const gk=[{key:"local",label:"Local"},{key:"staging",label:"Staging"},{key:"production",label:"Production"}],TD=/^iss-\d{1,9}$/,ED=/^col-\d{1,9}$/,AD=e=>e&&e[0].toUpperCase()+e.slice(1);function vk(e){const t=AD(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 Ai(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 lm={search:"",owner:null,urgent:!1,seen:[],label:null,collection:null};function Oc(e){const t=new URLSearchParams(e),n=t.getAll("seen").filter(l=>gk.some(r=>r.key===l)),a=t.get("collection");return{search:t.get("search")??"",owner:t.get("owner")||null,urgent:t.get("urgent")==="1",seen:[...new Set(n)],label:t.get("label")||null,collection:a&&ED.test(a)?a:null}}function Kl(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 MD(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 Cv=e=>!!(e.search.trim()||e.owner||e.urgent||e.seen.length||e.label||e.collection),OD={agent:"Filed by an agent",user:"Filed by you",tool:"Filed by a tool"},$D={graph:"Placed on the graph by its anchors",files:"Placed by its files",unplaced:"Triaged, not placed yet"},DD={handoff:"Handed to its owner",backlog:"Sent to the unowned backlog",batch:"Routed to a batch"};function zD(e,t=""){const n=(e??t).trim();if(!n)return"";const a=n.indexOf(": "),l=(a===-1?n:n.slice(0,a)).trim(),r=a===-1?"":n.slice(a+2).trim(),i=o=>r?`${o} ${r}`:o;switch(l){case"filed":return OD[r]??i("Filed by");case"labelled":return i("Labelled");case"unlabelled":return r?`Label removed: ${r}`:"Label removed";case"anchored":return r?`Anchored to ${r}`:"Anchored";case"triaged":return $D[r]??(r?`Triaged: ${r}`:"Triaged");case"routed":return DD[r]??(r?`Routed: ${r}`:"Routed");case"route closed":return r==="backlog"?"Taken off the unowned backlog":r?`Route closed: ${r}`:"Route closed";case"released":return r?`Released by its owner (task ${r})`:"Released by its owner";case"resolved":return r==="duplicate"?"Resolved as a duplicate":r?`Resolved · ${r.replace(/_/g," ")}`:"Resolved";case"reopened":return r?`Reopened: ${r}`:"Reopened";case"fix landed":return r?`Fix landed in ${r.slice(0,10)}`:"Fix landed";case"merged":return r?`Merged ${r} into this issue`:"Merged a duplicate into this issue";default:return n}}const LD=e=>e.replace(/`+/g,"").replace(/\s+/g," ").trim(),yk="This page only reads issues",bk="File, route and resolve issues with the issue command or through the thread working on them.",UD=10,BD=250,El="__all",HD="none",ID=e=>e.status===0||e.reason==="store_locked"||e.reason==="engine_failed"||e.status>=500;function jk(){const e=nn().issues;if(!e)throw new Error("The Issues page rendered without the issues seam.");return e}const PD=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 qD({project:e,query:t,onQuery:n}){var V;const a=jk(),{href:l,Link:r}=Ve(),i=u.useMemo(()=>Oc(t),[t]),o=Kl(i),c=Cv(i),[d,f]=u.useState({state:"loading"}),[h,m]=u.useState(null),[x,j]=u.useState(null),v=u.useRef(0),y=u.useRef(0),g=u.useRef(null),p=u.useRef(null),b=as(),_=u.useRef(!1),[N,R]=u.useState(i.search),w=u.useCallback(O=>n(Kl({...i,...O})),[i,n]),k=u.useCallback(async()=>{const O=y.current+=1;j(null);const Y=await a.list(MD(Oc(o)));if(O!==y.current)return;if(Y.ok){v.current=0,m(null),f({state:"ok",list:Y.data,local:Y.data.local??PD(new Date().toISOString()),key:o});return}const ae=Y.refusal.reason;if(ae==="engine_missing")return f({state:"engine_missing",refusal:Y.refusal});if(ae==="view_outdated")return f({state:"view_outdated"});if(v.current+=1,v.current===1&&ID(Y.refusal)){j(Y.refusal.retry_after??UD);return}m(Y.refusal)},[a.list,o]);u.useEffect(()=>{k()},[k]),u.useEffect(()=>{if(x===null)return;const O=setTimeout(()=>void k(),x*1e3);return()=>clearTimeout(O)},[x,k]),u.useEffect(()=>{document.activeElement!==g.current&&R(i.search)},[i.search]),u.useEffect(()=>{if(N===i.search)return;const O=setTimeout(()=>w({search:N}),BD);return()=>clearTimeout(O)},[N,i.search,w]),u.useEffect(()=>{const O=Y=>{if(Y.key!=="/"||Y.metaKey||Y.ctrlKey||Y.altKey)return;const ae=Y.target;ae&&(ae.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(ae.tagName))||g.current&&(Y.preventDefault(),g.current.focus())};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[]);const L=()=>{var O;R(""),n(Kl(lm)),(O=g.current)==null||O.focus()},D=()=>{v.current=0,k()},K=()=>{_.current=!0,D()};u.useEffect(()=>{var Y;if(!_.current||d.state==="loading"||x!==null)return;_.current=!1;const O=(Y=p.current)==null?void 0:Y.querySelector("h1");O&&(O.tabIndex=-1,O.focus())},[d,h,x]);const G=O=>`/proj/${encodeURIComponent(e)}/issues${O?`?${O}`:""}`,U=O=>`/proj/${encodeURIComponent(e)}/issues/${encodeURIComponent(O)}?from=issues${o?`&${o}`:""}`,M=s.jsx("div",{role:"status","aria-live":"polite",children:x!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(vn,{"aria-hidden":"true"}),"Issues are busy. Reading them again…"]}):null}),A=h?s.jsxs(me,{variant:"destructive",className:"mt-4",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Issues could not be loaded"}),s.jsxs(pe,{children:[s.jsxs("p",{children:[h.message,h.since?` Since ${Wn(h.since)}.`:"",d.state==="ok"?` The list below was read at ${Wn(d.local.read_at)}.`:"",h.message.includes(cl)?"":` ${cl}`]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:K,children:"Retry"})]})]}):null,S=s.jsx(Ft,{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 ",Wn(d.local.read_at)]}),s.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:D,children:[s.jsx(yl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]}):null});if(d.state==="engine_missing")return s.jsx(dc,{ref:p,children:s.jsx(Js,{page:"Issues"})});if(d.state==="view_outdated")return s.jsxs(dc,{ref:p,children:[S,s.jsxs(me,{variant:"warning",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:$r}),s.jsx(pe,{children:b})]})]});if(d.state==="loading")return s.jsxs(dc,{ref:p,children:[S,M,A,!h&&x===null?s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading issues",children:Array.from({length:6},(O,Y)=>s.jsx(pt,{className:Y===5?"h-10 w-2/3":"h-10 w-full"},Y))}):null]});const{list:E,local:C}=d,$=!h&&x===null&&(d.key!==o||N!==i.search),X=Cv(Oc(d.key)),T=C.scope==="folder",I=C.listed===0&&!c,ne=Math.max(0,C.listed-C.facets.owners.reduce((O,Y)=>O+Y.count,0)),W=i.collection?((V=C.collections.find(O=>O.collection===i.collection))==null?void 0:V.title)??i.collection:null,xe=new Map;for(const O of E.issues){const Y=O.group??"unplaced";xe.set(Y,[...xe.get(Y)??[],O])}return s.jsxs(dc,{ref:p,children:[S,T&&C.folder?s.jsxs("p",{className:"text-muted-foreground mt-1 text-sm",children:["Issues of the folder ",C.folder,", from its issue store."]}):null,s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:yk}),s.jsx(pe,{children:bk})]}),M,A,I?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(vR,{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(_t,{ref:g,type:"search",className:"w-64","aria-label":"Search issues",placeholder:"Search issues",value:N,onChange:O=>R(O.target.value)}),s.jsxs(dt,{value:i.owner??El,onValueChange:O=>w({owner:O===El?null:O}),children:[s.jsx(it,{className:"w-56","aria-label":"Owner",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:El,children:"All owners"}),s.jsxs(ke,{value:HD,children:["Unowned (",ne,")"]}),C.facets.owners.map(O=>s.jsxs(ke,{value:O.key,children:[O.title," (",O.count,")"]},O.key))]})]}),s.jsxs(dt,{value:i.label??El,onValueChange:O=>w({label:O===El?null:O}),children:[s.jsx(it,{className:"w-48","aria-label":"Label",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:El,children:"All labels"}),C.facets.labels.map(O=>s.jsxs(ke,{value:O.label,children:[O.label," (",O.count,")"]},O.label))]})]})]}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-2",children:[s.jsx("div",{className:"flex flex-wrap items-center gap-2",role:"group","aria-label":"Marks",children:s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":i.urgent,onClick:()=>w({urgent:!i.urgent}),children:["Urgent ",C.facets.urgent]})}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",role:"group","aria-label":"Seen on",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Seen on"}),gk.map(O=>{const Y=i.seen.includes(O.key);return s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":Y,onClick:()=>w({seen:Y?i.seen.filter(ae=>ae!==O.key):[...i.seen,O.key]}),children:[O.label," ",C.facets.seen[O.key]]},O.key)}),W!==null?s.jsxs("span",{className:"inline-flex items-center gap-1",children:[s.jsxs("span",{"data-testid":"issues-collection-chip",className:ie(cd({variant:"outline",size:"sm"}),TA),children:["Collection ",W]}),s.jsx(q,{type:"button",variant:"ghost",size:"sm-icon","aria-label":"Remove the collection filter",onClick:()=>{var O;w({collection:null}),(O=g.current)==null||O.focus()},children:s.jsx(nd,{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(vn,{"aria-hidden":"true"}),"Searching…"]}):c&&E.total>0?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:[E.total," of ",C.listed," issues ·"," ",s.jsx(q,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:L,children:"Clear"})]}):null}),s.jsx("div",{"data-testid":"issues-results","aria-busy":$||void 0,className:"shrink-0 transition-opacity aria-busy:opacity-50",children:X&&E.total===0?s.jsxs("p",{className:"mt-6 flex items-center gap-2 text-sm",children:[s.jsx(td,{className:"text-muted-foreground size-4","aria-hidden":"true"}),"No issues match."," ",s.jsx(q,{type:"button",variant:"link",size:"sm",className:"px-0",onClick:L,children:"Clear"})]}):C.groups.map(O=>s.jsx(GD,{id:`issues-${O.key}`,title:`${O.label} · ${O.count}`,issues:xe.get(O.key)??[],folder:T,link:Y=>s.jsx(r,{className:"text-primary hover:underline",href:l(U(Y.id)),children:Y.title})},O.key))}),!c&&C.collections.length>0?s.jsxs("section",{className:"mt-8","aria-labelledby":"issues-collections-title",children:[s.jsxs("h2",{id:"issues-collections-title",className:"text-lg font-semibold",children:["Collections · ",C.collections.length]}),s.jsx(xt,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Collections",className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:C.collections.map(O=>s.jsxs(ue,{children:[s.jsxs(P,{children:[s.jsx(r,{className:"text-primary hover:underline",href:l(G(Kl({...lm,collection:O.collection}))),children:O.title}),s.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:O.collection})]}),s.jsxs(P,{children:[O.resolved," of ",O.total," resolved"]}),s.jsx(P,{className:"text-muted-foreground",children:Ai(O.updated_at)})]},O.collection))})]})})]}):null]})]})}const dc=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 GD({id:e,title:t,issues:n,folder:a,link:l}){return s.jsxs("section",{className:"mt-6","aria-labelledby":`${e}-title`,"data-testid":"issues-group",children:[s.jsx("h2",{id:`${e}-title`,className:"text-lg font-semibold",children:t}),s.jsx(xt,{className:"mt-2 shrink-0 overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:t,className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:n.map(r=>{var o;const i=vk(r);return s.jsxs(ue,{"data-testid":"issues-row",children:[s.jsxs(P,{className:"break-words",children:[l(r),(o=r.labels)!=null&&o.length?s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:r.labels.map(c=>s.jsx(he,{variant:"neutral",size:"dense",children:c},c))}):null]}),s.jsx(P,{className:"font-mono text-xs",children:r.id}),a?s.jsx(P,{className:"break-words",children:r.project_id??"Folder"}):null,s.jsx(P,{children:s.jsx(he,{variant:i.tone,children:i.label})}),s.jsx(P,{children:r.urgent&&r.status!=="resolved"&&r.group!=="resolved"?s.jsx(he,{variant:"warning",children:"Urgent"}):null}),s.jsx(P,{className:"break-words",children:r.owner_title?r.owner_title:s.jsx("span",{className:"text-muted-foreground",children:"Unowned"})}),s.jsx(P,{className:"text-muted-foreground",children:Ai(r.updated_at)})]},r.id)})})]})})]})}function VD(e){var t;return(t=nn().issues)!=null&&t.issueSections?s.jsx(qD,{...e}):s.jsx(SD,{org:e.org,project:e.project,query:e.query})}function YD({update:e,issue:t,open:n,onOpenChange:a,onDone:l,onReload:r}){const[i,o]=u.useState(t.title),[c,d]=u.useState(t.description),[f,h]=u.useState(t.external_reference??""),[m,x]=u.useState(t),[j,v]=u.useState(null),[y,g]=u.useState(!1);u.useEffect(()=>{n&&(o(t.title),d(t.description),h(t.external_reference??""),x(t),v(null))},[n]);const p=N=>{var R;return((R=j==null?void 0:j.personal_data)==null?void 0:R.field)===N?j.message:void 0},b=async N=>{N.preventDefault(),g(!0);const R=await e(m.id,m.revision,{title:i,description:c,external_reference:f.trim()||null});if(g(!1),!R.ok){v(R.refusal);return}l(R.data.issue)},_=async()=>{const N=await r();N&&(x(N),v(null))};return s.jsx(zn,{open:n,onOpenChange:a,children:s.jsx(Ln,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:b,className:"grid gap-4",children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:"Edit issue"}),s.jsx(In,{children:"Text is shown exactly as entered."})]}),j!=null&&j.conflict?s.jsxs(me,{variant:"destructive",children:[s.jsx(rt,{}),s.jsx(pe,{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(_t,{id:"maintain-edit-title",value:i,"aria-invalid":!!p("title"),onChange:N=>o(N.target.value)}),p("title")?s.jsx(Kn,{children:p("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":!!p("description"),onChange:N=>d(N.target.value)}),p("description")?s.jsx(Kn,{children:p("description")}):null]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:"maintain-edit-reference",children:"External reference"}),s.jsx(_t,{id:"maintain-edit-reference",value:f,"aria-invalid":!!p("external_reference"),onChange:N=>h(N.target.value)}),p("external_reference")?s.jsx(Kn,{children:p("external_reference")}):null]}),j&&!j.conflict&&!j.personal_data?s.jsx(Kn,{children:j.message}):null,s.jsxs(Bn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),j!=null&&j.conflict?s.jsxs(q,{type:"button",variant:"outline",onClick:_,children:[s.jsx(yl,{className:"mr-2 size-4"}),"Reload latest"]}):null,s.jsx(q,{type:"submit",loading:y,disabled:!!(j!=null&&j.conflict),children:"Save"})]})]})})})}function Rv(e){return e.map(t=>hk[t].toLowerCase()).join(", ")}function FD(e){switch(e.kind){case"created":return"Logged the issue";case"updated":return`Edited the ${Rv(e.fields)}`;case"redacted":return`Redacted the ${Rv(e.fields)}`;case"priority_set":return e.priority?`Set priority to ${Ji[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?Su[e.to_status]:"";return e.resolution_reason?`Moved to ${t}: ${sx[e.resolution_reason]}`:`Moved to ${t}`}}}function Tv(e,t){return t==="external_reference"?e.external_reference??"":e[t]}function XD({redact:e,issue:t,open:n,onOpenChange:a,onDone:l,onReload:r}){const[i,o]=u.useState("description"),[c,d]=u.useState(""),[f,h]=u.useState(!1),[m,x]=u.useState(null),[j,v]=u.useState(t);u.useEffect(()=>{n&&(v(t),d(Tv(t,i)),x(null))},[n]);const y=async g=>{g.preventDefault(),h(!0);const p=await e(j.id,j.revision,i,c);if(h(!1),!p.ok){if(p.refusal.conflict){const b=await r();b&&v(b),x("Someone else saved this issue after you opened it. The latest issue is loaded and your replacement is kept; redact again to apply it.");return}x(p.refusal.message);return}l(p.data.issue)};return s.jsx(zn,{open:n,onOpenChange:a,children:s.jsx(Ln,{className:"sm:max-w-2xl",children:s.jsxs("form",{onSubmit:y,className:"grid gap-4",children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:"Redact text"}),s.jsx(In,{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(dt,{value:i,onValueChange:g=>{const p=g;o(p),d(Tv(j,p))},children:[s.jsx(it,{id:"maintain-redact-field",children:s.jsx(ft,{})}),s.jsx(ot,{children:xD.map(g=>s.jsx(ke,{value:g,children:hk[g]},g))})]})]}),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:g=>d(g.target.value)})]}),s.jsxs(me,{variant:"warning",children:[s.jsx(en,{}),s.jsx(pe,{children:"This cannot be undone: the original text is removed for good. History records only that this field was redacted."})]}),m?s.jsx(Kn,{children:m}):null,s.jsxs(Bn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(q,{type:"submit",variant:"destructive",loading:f,children:"Redact"})]})]})})})}function KD({transition:e,issue:t,open:n,onOpenChange:a,onDone:l}){const[r,i]=u.useState("fixed"),[o,c]=u.useState(!1),[d,f]=u.useState(null),h=async m=>{m.preventDefault(),c(!0);const x=await e(t.id,t.revision,"resolved",r);if(c(!1),!x.ok){if(x.refusal.conflict){l(null);return}f(x.refusal.message);return}f(null),l(x.data.issue)};return s.jsx(zn,{open:n,onOpenChange:a,children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:h,className:"grid gap-4",children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:"Resolve issue"}),s.jsx(In,{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(dt,{value:r,onValueChange:m=>i(m),children:[s.jsx(it,{id:"maintain-resolution-reason",children:s.jsx(ft,{})}),s.jsx(ot,{children:pD.map(m=>s.jsx(ke,{value:m,children:sx[m]},m))})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Reopening the issue clears its reason."})]}),d?s.jsx(Kn,{children:d}):null,s.jsxs(Bn,{children:[s.jsx(q,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),s.jsx(q,{type:"submit",loading:o,children:"Resolve"})]})]})})})}const Al="not_set";function QD({org:e,project:t,issue_id:n,query:a}){const l=mk(),r=pk(l),i=sm(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(xk,{access:r,header:s.jsx(Ft,{title:"Support"}),back_href:i,children:o=>l?s.jsx(ZD,{contract:l,issue_id:n,access:o,list_href:i,duplicates:Number(new URLSearchParams(a).get("duplicates")??0)}):null})})}function ZD({contract:e,issue_id:t,access:n,list_href:a,duplicates:l}){const{href:r,Link:i}=Ve(),o=Mr(),[c,d]=u.useState(null),[f,h]=u.useState([]),[m,x]=u.useState(!1),[j,v]=u.useState([]),[y,g]=u.useState(null),p=u.useCallback(async()=>{const w=await e.issue(t);return w.ok?(d(w.data.issue),h(w.data.events),w.data.issue):(w.refusal.status===404?x(!0):o.error(w.refusal.message),null)},[e,t,o]);u.useEffect(()=>{let w=!1;return e.issue(t).then(k=>{if(!w){if(!k.ok){k.refusal.status===404?x(!0):o.error(k.refusal.message);return}d(k.data.issue),h(k.data.events)}}),()=>{w=!0}},[e,t]),u.useEffect(()=>{n.can_change&&e.assigneeCandidates().then(w=>{w.ok&&v(w.data.candidates)})},[e,n.can_change]);const b=async w=>{const k=await w;if(!k.ok){o.error(k.refusal.message),k.refusal.conflict&&await p();return}await p()};if(m)return s.jsx(Ba,{title:"Support issue not found",description:"This issue does not exist in this project.",backHref:r(a),backLabel:"Back to Support",link:i});if(!c)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Loading…"});const _=c.status==="closed",N=n.can_change,R=w=>b(e.transition(c.id,c.revision,w));return s.jsxs(s.Fragment,{children:[s.jsx(Ft,{title:c.title,actions:N?s.jsxs(s.Fragment,{children:[_?null:s.jsxs(q,{variant:"outline",onClick:()=>g("edit"),children:[s.jsx(ed,{className:"mr-2 size-4"}),"Edit"]}),s.jsxs(q,{variant:"outline",onClick:()=>g("redact"),children:[s.jsx(aR,{className:"mr-2 size-4"}),"Redact"]}),c.status==="open"?s.jsx(q,{variant:"outline",disabled:!c.priority,"aria-description":c.priority?void 0:"Set a priority first.",onClick:()=>void R("triaged"),children:"Triage"}):null,c.status==="open"||c.status==="triaged"?s.jsxs(q,{onClick:()=>g("resolve"),children:[s.jsx(Ju,{className:"mr-2 size-4"}),"Resolve"]}):null,c.status==="resolved"?s.jsxs(s.Fragment,{children:[s.jsxs(q,{variant:"outline",onClick:()=>void R("open"),children:[s.jsx(qR,{className:"mr-2 size-4"}),"Reopen"]}),s.jsx(q,{onClick:()=>void R("closed"),children:"Close"})]}):null]}):void 0,children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(he,{variant:fk[c.status],children:Su[c.status]}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Logged by ",yD(c)," ",Mc(c.created_at)]})]})}),s.jsxs("div",{className:"flex flex-col gap-8 lg:flex-row lg:items-start",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-6",children:[l>0&&c.external_reference?s.jsxs(me,{variant:"info",children:[s.jsx(Ua,{}),s.jsxs(pe,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[s.jsxs("span",{children:[c.external_reference," is already logged on"," ",l===1?"another issue":`${l} other issues`," in this project."]}),s.jsx(q,{asChild:!0,variant:"outline",size:"sm",children:s.jsx(i,{href:r(`${a}?external_reference=${encodeURIComponent(c.external_reference)}`),children:"Show both"})})]})]}):null,s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Description"}),c.description?s.jsx("p",{className:"text-sm break-words whitespace-pre-wrap",children:c.description}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"No description."})]}),s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"History"}),s.jsx("div",{className:"rounded-md border",children:s.jsxs(Be,{children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"When"}),s.jsx(F,{children:"Who"}),s.jsx(F,{children:"What"})]})}),s.jsx(He,{children:f.map(w=>s.jsxs(ue,{children:[s.jsx(P,{className:"text-muted-foreground",children:Mc(w.created_at)}),s.jsx(P,{children:bD(w,c)}),s.jsx(P,{children:FD(w)})]},w.id))})]})})]})]}),s.jsxs("aside",{className:"flex w-full shrink-0 flex-col gap-5 lg:w-72",children:[s.jsx(ni,{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(ni,{label:"Resolution",children:s.jsx("span",{className:"text-sm",children:sx[c.resolution_reason]})}):null,s.jsx(ni,{label:"Priority",id:"maintain-issue-priority",children:s.jsxs(dt,{value:c.priority??Al,disabled:!N||_,onValueChange:w=>void b(e.update(c.id,c.revision,{priority:w===Al?null:w})),children:[s.jsx(it,{id:"maintain-issue-priority",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:Al,children:"Not set"}),nx.map(w=>s.jsx(ke,{value:w,children:Ji[w]},w))]})]})}),s.jsxs(ni,{label:"Assignee",id:"maintain-issue-assignee",children:[s.jsxs(dt,{value:c.assignee_id??Al,disabled:!N||_,onValueChange:w=>void b(e.assign(c.id,c.revision,w===Al?null:w)),children:[s.jsx(it,{id:"maintain-issue-assignee",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[s.jsx(ke,{value:Al,children:"Not set"}),c.assignee_id&&!j.some(w=>w.user_id===c.assignee_id)?s.jsx(ke,{value:c.assignee_id,children:ax(c.assignee_id,c.assignee_username)}):null,j.map(w=>s.jsx(ke,{value:w.user_id,children:w.username??"Not available"},w.user_id))]})]}),c.assignee_can_act===!1?s.jsx(he,{variant:"error",className:"self-start",children:"Assignee cannot act"}):null]}),s.jsx(ni,{label:"Updated",children:s.jsx("span",{className:"text-sm",children:Mc(c.updated_at)})})]})]}),s.jsx(YD,{update:e.update,issue:c,open:y==="edit",onOpenChange:w=>g(w?"edit":null),onReload:p,onDone:()=>{g(null),p()}}),s.jsx(XD,{redact:e.redact,issue:c,open:y==="redact",onOpenChange:w=>g(w?"redact":null),onReload:p,onDone:()=>{g(null),o.success("The text was redacted."),p()}}),s.jsx(KD,{transition:e.transition,issue:c,open:y==="resolve",onOpenChange:w=>g(w?"resolve":null),onDone:w=>{g(null),w||o.error("Someone else changed this issue; it is reloaded."),p()}})]})}function ni({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 WD=10,JD=/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/,Ev=/^[A-Za-z0-9][A-Za-z0-9._+-]{0,63}$/;function e3(e,t,n,a=""){const l=n!=null&&n.startsWith("task:")?n.slice(5):null;if(l&&JD.test(l))return{label:l,path:`/org/${e}/tasks/${l}`};const r=`/proj/${encodeURIComponent(t)}/releases`,i=n!=null&&n.startsWith("release:")?n.slice(8):null;if(i&&Ev.test(i))return{label:i==="candidate"?"Candidate":i,path:`${r}?release=${encodeURIComponent(i)}`};const o=n!=null&&n.startsWith("planned:")?n.slice(8):null;if(o&&Ev.test(o))return{label:o,path:`${r}?planned=${encodeURIComponent(o)}`};const c=Kl(Oc(a));return{label:"Issues",path:`/proj/${encodeURIComponent(t)}/issues${c?`?${c}`:""}`}}const t3=["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 t3){const a=t.find(l=>l.relation===n);if(a)return a}return t[0]??null}function s3({org:e,project:t,issue_id:n,from:a,query:l=""}){var Oe;const r=jk(),{href:i,Link:o}=Ve(),c=e3(e,t,a,l),d=`/proj/${encodeURIComponent(t)}/issues`,f=Q=>`${d}/${encodeURIComponent(Q)}`,[h,m]=u.useState({state:"loading"}),[x,j]=u.useState(null),[v,y]=u.useState(null),[g,p]=u.useState({state:"loading"}),[b,_]=u.useState({state:"loading"}),N=u.useRef(null),R=as(),w=u.useRef(null),k=u.useRef(!1),L=u.useRef(0),D=u.useRef(0),K=u.useCallback(async()=>{if(!r.issueSections)return;p({state:"loading"});const Q=await r.issueSections(n);p(Q.ok?{state:"ok",data:Q.data}:{state:"failed",refusal:Q.refusal})},[r.issueSections,n]),G=u.useCallback(async()=>{if(!r.issueRelated)return;_({state:"loading"});const Q=await r.issueRelated(n);_(Q.ok?{state:"ok",data:Q.data}:{state:"failed",refusal:Q.refusal})},[r.issueRelated,n]),U=u.useCallback(async()=>{const Q=D.current+=1;if(y(null),!TD.test(n)){m({state:"missing"});return}K(),G();const Ne=await r.issue(n);if(Q!==D.current)return;if(Ne.ok){L.current=0,j(null),m({state:"ok",issue:Ne.data.issue,events:Ne.data.events,at:new Date().toISOString()});return}const ze=Ne.refusal.reason;if(Ne.refusal.status===404||ze==="not_found")return m({state:"missing"});if(ze==="engine_missing")return m({state:"engine_missing",refusal:Ne.refusal});if(ze==="view_outdated")return m({state:"view_outdated"});if(L.current+=1,L.current===1&&uk(Ne.refusal)){y(Ne.refusal.retry_after??WD);return}j(Ne.refusal)},[r.issue,n,K,G]);u.useEffect(()=>{U()},[U]),u.useEffect(()=>{if(v===null)return;const Q=setTimeout(()=>void U(),v*1e3);return()=>clearTimeout(Q)},[v,U]),u.useEffect(()=>{var Ne;if(k.current||h.state!=="ok")return;k.current=!0;const Q=(Ne=N.current)==null?void 0:Ne.querySelector("h1");Q&&(Q.tabIndex=-1,Q.focus())},[h.state]);const M=u.useRef(null);u.useEffect(()=>{var ze;const Q=M.current;if(Q===null||(Q==="sections"?g:b).state==="loading")return;M.current=null;const Ne=(Q==="related"?w.current:null)??((ze=N.current)==null?void 0:ze.querySelector("h1"));Ne==null||Ne.focus()},[g,b]);const A=Q=>{M.current=Q,Q==="sections"?K():G()},S=()=>{L.current=0,U()},E=u.useRef(!1),C=()=>{E.current=!0,S()};if(u.useEffect(()=>{var Ne;if(!E.current||h.state==="loading"||v!==null)return;E.current=!1;const Q=(Ne=N.current)==null?void 0:Ne.querySelector("h1");Q&&(Q.tabIndex=-1,Q.focus())},[h,x,v]),h.state==="missing")return s.jsx(ya,{children:s.jsx(Ba,{icon:s.jsx(td,{"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(q,{asChild:!0,variant:"link",size:"sm",className:"px-0",children:s.jsxs(o,{href:i(c.path),children:[s.jsx(s0,{className:"size-4","aria-hidden":"true"}),c.label]})});if(h.state==="engine_missing"||h.state==="view_outdated")return s.jsx(ya,{children:h.state==="engine_missing"?s.jsx(Js,{page:"Issue",header:s.jsx(Ei,{back:$,id:null,title:n})}):s.jsxs(s.Fragment,{children:[s.jsx(Ei,{back:$,id:null,title:n}),s.jsxs(me,{variant:"warning",className:"mt-4",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:$r}),s.jsx(pe,{children:R})]})]})});const X=x?s.jsxs(me,{variant:"destructive",className:"mt-4",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"This issue could not be loaded"}),s.jsxs(pe,{children:[s.jsxs("p",{children:[x.message,x.since?` Since ${Wn(x.since)}.`:"",h.state==="ok"?` This page was read at ${Wn(h.at)}.`:"",x.message.includes(cl)?"":` ${cl}`]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:C,children:"Retry"})]})]}):null,T=s.jsx("div",{role:"status","aria-live":"polite",children:v!==null?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",children:[s.jsx(vn,{"aria-hidden":"true"}),"This issue is busy. Reading it again…"]}):null});if(h.state==="loading")return s.jsxs(ya,{children:[s.jsx("div",{children:$}),T,X,!x&&v===null?s.jsxs("div",{className:"mt-4 grid gap-3",role:"status","aria-label":"Loading issue",children:[s.jsx(pt,{className:"h-6 w-40"}),s.jsx(pt,{className:"h-9 w-2/3"}),s.jsx(pt,{className:"h-24 w-full"})]}):null]});const{issue:I,events:ne,at:W}=h,xe=vk(I),V=g.state==="ok"?g.data:null,O=(V==null?void 0:V.reporter)??I.created_by_username??null,Y=b.state==="ok"?n3(b.data):null,ae=I.status==="resolved"||I.group==="resolved",H=!!(V!=null&&V.duplicate_of),te=g.state==="loading"?"Loading…":(V==null?void 0:V.routing.owner)??I.owner_title??s.jsx("span",{className:"text-muted-foreground",children:"Unowned"}),ee=Q=>`${d}?${Kl({...lm,collection:Q})}`,le=V==null?void 0:V.report,J=!!(le&&(le.actual||le.expected||le.steps.length||le.where)),Qe=[...ne].reverse(),oe=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 ",Wn(W)]}),s.jsxs(q,{type:"button",variant:"ghost",size:"sm",onClick:S,children:[s.jsx(yl,{className:"mr-2 size-4","aria-hidden":"true"}),"Read again"]})]});return s.jsx(ya,{children:s.jsxs("div",{ref:N,className:"contents",children:[s.jsx(Ei,{back:$,id:I.id,badge:s.jsxs(s.Fragment,{children:[s.jsx(he,{variant:xe.tone,children:xe.label}),I.urgent&&!ae?s.jsx(he,{variant:"warning",children:"Urgent"}):null]}),title:I.title,created:`Reported${O?` by ${O}`:""} · ${Ai(I.created_at)}`,actions:oe}),V!=null&&V.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(V.duplicate_of)),children:V.duplicate_of})]}):null,T,X,g.state==="loading"?s.jsxs("p",{className:"text-muted-foreground mt-2 flex items-center gap-2 text-sm",role:"status",children:[s.jsx(vn,{"aria-hidden":"true"}),"Loading the issue's sections"]}):null,s.jsxs("dl",{className:"mt-4 mb-0 flex flex-wrap gap-x-12 gap-y-4","data-testid":"issue-facts",children:[s.jsx(ms,{label:"Owner",value:te}),H?null:s.jsx(ms,{label:"Release",value:b.state==="loading"?"Loading…":Y?s.jsx("span",{className:ie(Y.label===Y.id&&"font-mono"),children:Y.label}):s.jsx("span",{className:"text-muted-foreground",children:"No release yet"})}),s.jsx(ms,{label:"Reported",value:[O,I.created_at?An(I.created_at):null].filter(Boolean).join(" · ")})]}),s.jsxs(me,{variant:"info",className:"mt-4",children:[s.jsx(_o,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:yk}),s.jsx(pe,{children:bk})]}),g.state==="failed"?s.jsx("div",{className:"mt-6",children:s.jsx(tx,{what:"this issue's sections",again:"Read the issue again",refusal:g.refusal,on_retry:()=>A("sections")})}):null,V&&J&&le?s.jsxs(yt,{id:"issue-report",title:"What happens",children:[le.actual?s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:le.actual}):null,le.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:le.expected})]}):null,le.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:le.steps.map((Q,Ne)=>s.jsx("li",{children:Q},Ne))})]}):null,(Oe=le.where)!=null&&Oe.env?s.jsxs("p",{className:"text-muted-foreground mt-3 text-sm",children:["Seen on ",le.where.env,le.where.sha?s.jsxs(s.Fragment,{children:[" ","at ",s.jsx("span",{className:"font-mono",children:le.where.sha})]}):null]}):null]}):null,V&&(V.placement.placed||V.placement.unplaced_why)?s.jsx(yt,{id:"issue-placement",title:"Placement",children:V.placement.placed?s.jsxs("p",{className:"text-sm",children:["Placed in ",V.placement.placed]}):s.jsxs(me,{variant:"warning",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsxs(ve,{children:["Not placed yet: ",V.placement.unplaced_why]})]})}):null,V&&(V.routing.route||V.routing.owner||V.routing.none)?s.jsxs(yt,{id:"issue-routing",title:"Routing",children:[V.routing.route?s.jsx("p",{className:"text-sm",children:V.routing.route}):null,V.routing.owner?s.jsxs("p",{className:"text-sm",children:["Owner: ",V.routing.owner]}):s.jsx("p",{className:"text-muted-foreground text-sm",children:"Owner: none yet"})]}):null,V&&(V.labels.length>0||V.collections.length>0)?s.jsxs(yt,{id:"issue-labels",title:"Labels and collections",children:[V.labels.length?s.jsx("div",{className:"flex flex-wrap gap-1",children:V.labels.map(Q=>s.jsx(he,{variant:"neutral",size:"dense",children:Q},Q))}):null,V.collections.length?s.jsx("ul",{className:"mt-2 grid gap-1 text-sm",children:V.collections.map(Q=>s.jsxs("li",{children:[s.jsx(o,{className:"text-primary hover:underline",href:i(ee(Q.collection)),children:Q.title}),Q.ref?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",Q.ref]}):null,s.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",Q.resolved," of ",Q.total," resolved"]})]},Q.collection))}):null]}):null,V&&V.anchors.length>0?s.jsx(yt,{id:"issue-anchors",title:"Anchors",children:s.jsx(Mf,{label:"Anchors",heads:["Kind","Value","By"],rows:V.anchors.map(Q=>[Q.kind,s.jsx("span",{className:"font-mono text-xs break-all",children:Q.value}),Q.by??""])})}):null,V&&V.seen.length>0?s.jsx(yt,{id:"issue-seen",title:"Seen",aside:`${V.seen.length} of ${Math.max(I.occurrences??0,V.seen.length)} sightings`,children:s.jsx(Mf,{label:"Seen",heads:["When","Where","Who","Note"],rows:V.seen.map(Q=>[Ai(Q.at),s.jsxs(s.Fragment,{children:[Q.sha?s.jsx("div",{className:"font-mono text-xs",children:Q.sha}):null,Q.env?s.jsx("div",{className:"text-muted-foreground text-xs",children:Q.env}):null]}),Q.who??"",Q.note??""])})}):null,Qe.length>0?s.jsx(yt,{id:"issue-history",title:"History",aside:"From the issue store, newest first",children:s.jsx(Mf,{label:"History",heads:["When","Who","What"],rows:Qe.map(Q=>[Ai(Q.created_at),Q.actor_username??"",zD(Q.note,Q.kind)])})}):null,s.jsx(dk,{id:"issue-related",related:b,heading_ref:w,on_retry:()=>A("related"),fixed:!0,link:Q=>{const Ne=Q.kind==="thread"?`${e?`/org/${e}`:""}/threads#thread-${encodeURIComponent(Q.id)}`:Q.kind==="task"?`/org/${e}/tasks/${encodeURIComponent(Q.id)}?from=issue:${I.id}`:Q.kind==="issue"?f(Q.id):Q.kind==="release"?`/proj/${encodeURIComponent(t)}/releases?${Q.planned?"planned":"release"}=${encodeURIComponent(Q.id)}`:null;if(Q.kind==="task"&&Ne){const ze=LD(Q.label);return s.jsxs("div",{className:"min-w-0",children:[s.jsx(o,{className:"text-primary font-mono text-xs hover:underline",href:i(Ne),children:Q.id}),ze&&ze!==Q.id?s.jsx("div",{className:"text-muted-foreground line-clamp-1 text-xs",title:ze,"data-testid":"related-task-title",children:ze}):null]})}return Ne?s.jsx(o,{className:ie("text-primary hover:underline",Q.kind!=="thread"&&Q.label===Q.id&&"font-mono"),href:i(Ne),children:Q.label}):Q.label}})]})})}function Mf({label:e,heads:t,rows:n}){return s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:e,children:[s.jsx(Ge,{children:s.jsx(ue,{children:t.map(a=>s.jsx(F,{children:a},a))})}),s.jsx(He,{children:n.map((a,l)=>s.jsx(ue,{children:a.map((r,i)=>s.jsx(P,{className:"break-words",children:r},i))},l))})]})})}function a3({org:e,project:t,issue_id:n,from:a,query:l}){var r;return(r=nn().issues)!=null&&r.issueSections?s.jsx(s3,{org:e,project:t,issue_id:n,from:a,query:l}):s.jsx(QD,{org:e,project:t,issue_id:n,query:l})}function Cu(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"},l3={self_service:"Self-service",managed:"Managed",manager_only:"Manager only"},r3={self_service:"Self-service: each entry takes its own turn",managed:"Managed: a manager batches entries that allow it",manager_only:"Manager only: the manager runs every turn"},i3={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 o3(e){return i3[e??"in_batch"]}function c3(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 wk=(e,t)=>`Holds ${e.toLowerCase()}${t?`: ${t}`:""}`;function u3(e,t,n,a=!0){return e.fixing_since!==void 0?{label:`Fixing forward since ${Fn(e.fixing_since)}`,tone:"warning"}:e.ref===t?{label:"Landing",tone:"info"}:a&&e.hold?{label:wk(n),tone:"info"}:{label:"Running",tone:"info"}}function Fn(e){return new Date(e*1e3).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function Ml(e){const t=Math.round(e/60);if(t<60)return`${t} min`;const n=Math.floor(t/60),a=t%60;return a?`${n} h ${a} min`:`${n} h`}function d3(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 f3(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 h3(e,t){var o,c;const{policy:n,management:a}=e,l=(o=e.layer)==null?void 0:o.kind,r=d=>f3(d,t),i=[["Mode",r3[a.mode]],["Who can join",r(a.joiners)]];return l==="implement"&&i.push(["Managers",r(a.managers)],["Manager lease",Ml(a.manager_lease_seconds)],["Batches",n.batch.enabled?`Up to ${n.batch.max_members} entries`:"Off"]),((c=e.layer)==null?void 0:c.kind)==="release"&&(e.layer.promotes_to&&i.push(["Promotes to",e.layer.promotes_to]),i.push(["Carries waiting entries",n.ride?"Yes: a done turn carries entries already contained in it":"No"],["Freeze",n.freeze.enabled?`Up to ${Ml(n.freeze.max_seconds)}, ${Ml(n.freeze.default_seconds)} by default`+(e.layer.freezers?` · ${r(e.layer.freezers)}`:""):"Off"],["Fix forward",n.fix_forward?"Yes: a failed turn keeps its turn until fixed":"No"],["Stalled turns",a.stall_takers.kind==="none"?"Nobody takes one":`${r(a.stall_takers)} may take one after ${Ml(n.stall_seconds)}`])),i.push(["Reorder",r(a.reorderers)]),n.max_turns>1&&i.push(["Turns at once",`Up to ${n.max_turns} independent turns`]),i.push(["Turn lease",Ml(n.lease_seconds)],["Time to start",`${Ml(n.start_grace_seconds)} after the turn comes`]),n.entry_limit!==null&&i.push(["Waiting entries",`Up to ${n.entry_limit}`]),n.footprint!=="off"&&i.push(["Footprint",n.footprint==="required"?"Required":"Optional"]),i}const Nk="Where your organization's agents take turns at a shared branch, environment or proposal. One turn runs at a time in each queue.",kk="A task you cannot see",m3="A former member",p3="A member";function Sk(){const e=nn().queues;if(!e)throw new Error("The Queues page rendered without the queues seam.");return e}function x3({org:e,open:t,path:n}){var h,m;const a=Sk(),{href:l,Link:r}=Ve(),i=a.availability,[o,c]=u.useState({state:"loading"}),d=u.useCallback(async x=>{i&&(x&&c({state:"loading"}),c(await i({fresh:x})))},[i]);u.useEffect(()=>{d(!1)},[d]);const f=!i||o.state==="active";return o.state==="off"&&((h=o.refusal)==null?void 0:h.reason)!=="engine_missing"?s.jsx(Ba,{title:"Page not found",description:"This page does not exist, or you do not have access to it.",backHref:l(`/org/${e}`),backLabel:"Back to the organization",link:r}):s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:f?s.jsx(v3,{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(Js,{page:"Queues"}):s.jsxs(s.Fragment,{children:[s.jsx(Ft,{title:"Queues",description:a.description??Nk}),o.state==="loading"&&s.jsx(Ck,{}),(o.state==="error"||o.state==="off")&&s.jsx(rm,{refusal:o.refusal,on_retry:()=>void d(!0)}),o.state==="available"&&s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(Ua,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Tasks are not on for this organization"}),s.jsxs(pe,{children:["Queues hold turns for tasks, so they show once Tasks are on."," ",s.jsx(r,{className:"text-primary hover:underline",href:l(`/org/${e}/tasks`),children:"Go to Tasks"})]})]})]})})}function Ck(){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(pt,{className:t===2?"h-10 w-2/3":"h-10 w-full"},t))})}function rm({refusal:e,on_retry:t}){const n=as();return(e==null?void 0:e.reason)==="store_locked"?s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(Ua,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"The local stores are busy"}),s.jsxs(pe,{children:[s.jsx("p",{children:e.message}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]}):(e==null?void 0:e.reason)==="view_outdated"?s.jsxs(me,{variant:"warning",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:$r}),s.jsx(pe,{children:n})]}):s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Queues could not be loaded"}),s.jsxs(pe,{children:[s.jsx("p",{children:"The read did not answer. Try again in a moment."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}const Of=e=>e.status===404||e.reason==="not_found"||e.code==="not_found";function g3(e,t,n,a){return t?e===null?`Not reading · trying again every ${n}s`:`Not reading since ${Fn(e)} · trying again every ${n}s`:e===null?"Connecting…":`Live · read ${Fn(e)} · refreshes every ${n}s${a?` · ${a}`:""}`}function v3({org:e,open:t,path:n}){var O;const{listQueues:a,queue:l,members:r,refresh_ms:i,settings_note:o,description:c,read_scope:d,subject_label:f="Task",thread_subjects:h=!1}=Sk(),{self_id:m}=Wu(),[x,j]=u.useState(null),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,_]=u.useState(null),[N,R]=u.useState({state:"pending",members:[]});u.useEffect(()=>{let Y=!0;return r().then(ae=>{Y&&R(H=>ae.ok?{state:"answered",members:ae.data}:{state:"failed",members:H.members})}),()=>{Y=!1}},[r]);const w=u.useMemo(()=>new Map(N.members.map(Y=>[Y.user_id,Y])),[N.members]),k=N.state==="answered"?m3:p3,L=u.useCallback((Y,ae)=>{var H;return(ae==null?void 0:ae.title)??(h?(ae==null?void 0:ae.id)??Y:Y===m?"You":((H=w.get(Y))==null?void 0:H.label)??k)},[w,k,m,h]),D=u.useRef({list:{last:null,fresh:!1},detail:{last:null,fresh:!1}}),[K,G]=u.useState(null),[U,M]=u.useState(!1),A=u.useCallback((Y,ae)=>{D.current[Y]={last:ae,fresh:!0};const{list:H,detail:te}=D.current;M(H.last==="failed"||te.last==="failed"),H.fresh&&te.fresh&&H.last==="ok"&&te.last==="ok"&&G(Date.now()/1e3)},[]),S=t??((O=x==null?void 0:x.queues[0])==null?void 0:O.id)??null,E=u.useRef(S);u.useEffect(()=>{E.current=S},[S]);const C=u.useRef(0),$=u.useCallback(async()=>{var H;const Y=C.current+=1;D.current.list.fresh=!1;const ae=await a();if(Y===C.current)if(ae.ok){if(j(ae.data),y(null),!t){const te=((H=ae.data.queues[0])==null?void 0:H.id)??null;te===null?D.current.detail={last:"ok",fresh:!0}:te!==E.current&&(D.current.detail.fresh=!1)}A("list","ok")}else y(ae.refusal),A("list","failed")},[a,t,A]),X=u.useRef(0),T=u.useCallback(async()=>{const Y=X.current+=1;if(!S)return;D.current.detail.fresh=!1;const ae=await l(S);Y===X.current&&(ae.ok?(p(ae.data),_(null),A("detail","ok")):(_(ae.refusal),Of(ae.refusal)&&p(null),A("detail",Of(ae.refusal)?"ok":"failed")))},[S,l,A]);u.useEffect(()=>{$()},[$]),u.useEffect(()=>{p(null),_(null),T()},[T]);const I=u.useCallback(()=>{$(),T()},[$,T]),ne=!x&&(v==null?void 0:v.reason)==="engine_missing",W=u.useCallback(()=>{ne||I()},[ne,I]);if(Cu(W,i),ne)return s.jsx(Js,{page:"Queues"});const xe=Math.round(i/1e3),V=b!==null&&Of(b);return s.jsxs(s.Fragment,{children:[s.jsxs(Ft,{title:"Queues",description:c??Nk,children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:g3(K,U,xe,d)}),s.jsx("span",{className:"sr-only",role:"status",children:U?"Not reading":K===null?"Connecting":"Live"})]}),!x&&!v&&s.jsx(Ck,{}),!x&&v&&s.jsx(rm,{refusal:v,on_retry:I}),x&&x.queues.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(o0,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No queues yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Queues are created through the sdlc CLI, the MCP tools or the API. Once one exists, its turns and waiting work show here."})]}):x?s.jsxs(s.Fragment,{children:[s.jsx(b3,{path:n,queues:x.queues,open_id:S,name:L,held:h}),V?s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(Ua,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"This queue is no longer available"}),s.jsx(pe,{children:"It was archived, or you can no longer read its Workspace. Pick another queue above."})]}):g&&g.queue.id===S?s.jsx(j3,{org:e,detail:g,name:L,settings_note:o,subject_label:f,thread_subjects:h}):b?s.jsx(rm,{refusal:b,on_retry:()=>void T()}):s.jsx(pt,{className:"mt-6 h-40 w-full shrink-0",role:"status","aria-label":"Loading the queue"})]}):null]})}function im({org:e,subject:t,link:n}){const{href:a,Link:l}=Ve();return!t||t.hidden?s.jsx("span",{className:"text-muted-foreground",children:kk}):t.kind==="task"&&n?s.jsx(l,{className:"text-primary hover:underline",href:a(`/org/${e}/tasks/${t.id}`),children:t.title??t.id}):s.jsx("span",{children:t.title??t.id})}function y3(e,t,n){const a=e.freeze?`frozen until ${Fn(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 ${Fn(e.batch.opened_at)}`,a].filter(Boolean).join(" · "),warn:!1};if(e.turn){const l=e.turn.subject,r=l.hidden?kk:l.title??l.id,i=(e.running_count??1)>1?`${e.running_count} turns · `:"",o=e.turn.landing?" landing":"",c=n&&!!e.turn.hold,d=[c?wk(e.name,e.turn.note):null,e.turn.fixing_since!==void 0?"Fixing forward":null,a].filter(Boolean);return c&&e.turn.fixing_since===void 0&&!a?{primary:`${i}${r}${o}`,secondary:$f(d.join(" · ")),warn:!1}:{primary:`${i}${r}${o}`,secondary:d.length?$f(d.join(" · ")):null,warn:d.length>0}}return{primary:"Nothing running",secondary:a?$f(a):null,warn:!!a}}const $f=e=>e.charAt(0).toUpperCase()+e.slice(1);function b3({path:e,queues:t,open_id:n,name:a,held:l}){const{href:r,Link:i}=Ve();return s.jsx(xt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Queues",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:t.map(o=>{var m;const c=o.id===n,d=d3(o),f=y3(o,a,l),h=o.waiting-(((m=o.batch)==null?void 0:m.remaining)??0);return s.jsxs(ue,{"data-testid":"queues-row",className:ie(c&&"bg-accent"),children:[s.jsxs(P,{children:[s.jsx(i,{className:"text-primary hover:underline",href:r(`${e}?queue=${encodeURIComponent(o.id)}`),"aria-current":c?"page":void 0,children:o.name}),d?s.jsx("div",{className:"text-muted-foreground text-xs",children:d}):null,s.jsxs("div",{className:"text-muted-foreground text-xs md:hidden",children:[h," waiting"]})]}),s.jsx(P,{className:"hidden md:table-cell",children:s.jsx(he,{variant:"neutral",children:_k[o.policy.step]})}),s.jsxs(P,{children:[s.jsx("div",{className:ie(!o.batch&&!o.turn&&"text-muted-foreground"),children:f.primary}),f.secondary?s.jsx("div",{className:ie("text-xs",f.warn?"text-warning":"text-muted-foreground"),children:f.secondary}):null]}),s.jsx(P,{className:"hidden text-right md:table-cell",children:h})]},o.id)})})]})})}function fc({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 Av({org:e,entries:t,landing:n,queue_name:a,subject_label:l,held:r,label:i}){return s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Be,{containerAriaLabel:i,children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:l}),s.jsx(F,{children:"State"})]})}),s.jsx(He,{children:t.map(o=>{const c=u3(o,n,a,r);return s.jsxs(ue,{"data-testid":"queues-running",children:[s.jsxs(P,{children:[s.jsx(im,{org:e,subject:o.subject,link:!r}),r&&o.hold&&o.note&&!o.subject.hidden?s.jsx("div",{className:"text-muted-foreground text-xs",children:o.note}):null]}),s.jsx(P,{children:s.jsx(he,{variant:c.tone,children:c.label})})]},o.ref)})})]})})}function j3({org:e,detail:t,name:n,settings_note:a,subject_label:l,thread_subjects:r}){var _;const{queue:i,state:o}=t,c=N=>n(N),d=new Map(o.entries.map(N=>[N.ref,N.subject])),f=o.entries.filter(N=>N.turn==="running"),h=o.entries.filter(N=>N.turn!=="running"&&N.batching!=="in_batch"),m=o.batch,x=Math.max(1,f.filter(N=>N.batching!=="in_batch").length),j=m&&i.policy.independent_turns?f.filter(N=>N.batching!=="in_batch"&&N.ref!==m.holder):[],v=o.manager,y=o.freeze,g=((_=i.layer)==null?void 0:_.kind)==="release"?i.layer.stall_hold:void 0,p=g?{who:n(g.by),why:g.reason,until:g.until}:v!=null&&v.hold?{who:n(v.holder,v.holder_subject),why:v.hold.why,until:v.hold.until}:null,b=!m&&f.length===0&&h.length===0;return s.jsxs(xt,{as:"section","aria-labelledby":"queue-title",className:"mt-6 flex shrink-0 flex-col gap-4 p-4","data-testid":"queues-detail",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{id:"queue-title",className:"text-lg font-semibold",children:i.name}),s.jsx(he,{variant:"neutral",children:_k[i.policy.step]}),s.jsx(he,{variant:"neutral",children:l3[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(nT,{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 ",Fn(v.lease_until),v.serving_until!==void 0?" · serving now":""]})]}):null,y?s.jsxs(me,{variant:"warning",children:[s.jsx(QR,{className:"size-4","aria-hidden":"true"}),s.jsxs(ve,{children:["Frozen until ",Fn(y.lease_until)]}),s.jsxs(pe,{children:[n(y.holder,y.holder_subject)," froze this queue at ",Fn(y.since),y.label?`: ${y.label}`:"",". Only ",n(y.holder,y.holder_subject),"'s entries start until it thaws."]})]}):null,p?s.jsxs(me,{variant:"info",children:[s.jsx(c0,{className:"size-4","aria-hidden":"true"}),s.jsxs(ve,{children:["Stall hold until ",Fn(p.until)]}),s.jsxs(pe,{children:[p.who,p.why?`: ${p.why}`:"",". The first entry is not treated as stalled while it lasts."]})]}):null,b?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing running, and nothing waits in this queue."}):s.jsxs(s.Fragment,{children:[m?s.jsxs(fc,{id:"queue-running",title:"Running turn",side:`Batch opened by ${n(m.holder,m.holder_subject)} at ${Fn(m.opened_at)}`,children:[s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsxs(Be,{containerAriaLabel:"Batch members",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Landing order"}),s.jsx(F,{children:l}),s.jsx(F,{children:"Outcome"})]})}),s.jsx(He,{children:m.members.map((N,R)=>{const w=o3(N.outcome);return s.jsxs(ue,{"data-testid":"queues-member",children:[s.jsx(P,{children:R+1}),s.jsx(P,{children:s.jsx(im,{org:e,subject:N.subject??d.get(N.ref)??(r?{kind:"thread",id:N.ref}:void 0),link:!r})}),s.jsx(P,{children:s.jsx(he,{variant:w.tone,children:w.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(Av,{org:e,entries:j,landing:o.landing,queue_name:i.name,subject_label:l,held:r,label:"Turns running beside the batch"})]}):null]}):s.jsx(fc,{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(Av,{org:e,entries:f,landing:o.landing,queue_name:i.name,subject_label:l,held:r,label:"Running turns"})}),s.jsx(fc,{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(Be,{containerAriaLabel:"Waiting entries",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Position"}),s.jsx(F,{children:l}),s.jsx(F,{className:"hidden md:table-cell",children:"Joined"}),s.jsx(F,{children:"Turn"}),s.jsx(F,{className:"hidden md:table-cell",children:"Note"})]})}),s.jsx(He,{children:h.map((N,R)=>{const w=c3(N);return s.jsxs(ue,{"data-testid":"queues-waiting",children:[s.jsx(P,{children:m?x+R+1:N.position}),s.jsx(P,{children:s.jsx(im,{org:e,subject:N.subject,link:!r})}),s.jsx(P,{className:"hidden md:table-cell",children:Fn(N.joined_at)}),s.jsx(P,{children:s.jsx(he,{variant:w.tone,children:w.label})}),s.jsx(P,{className:"hidden md:table-cell",children:N.subject.hidden?"":N.note??""})]},N.ref)})})]})})})]}),s.jsx(fc,{id:"queue-settings",title:"Settings",children:s.jsx("div",{className:"overflow-x-auto rounded-lg border",children:s.jsx(Be,{containerAriaLabel:"Queue settings",children:s.jsx(He,{children:h3(i,c).map(([N,R])=>s.jsxs(ue,{children:[s.jsx(F,{scope:"row",className:"h-auto w-48 py-2 font-normal",children:N}),s.jsx(P,{children:R})]},N))})})})}),s.jsx("p",{className:"text-muted-foreground text-xs",children:a})]})}const ds="__no_parent__";function Rk(e,t){const n=new Set([t]);for(let a=!0;a;){a=!1;for(const l of e)l.parent&&n.has(l.parent)&&!n.has(l.key)&&(n.add(l.key),a=!0)}return n}const eo=(e,t)=>(e.label||e.key).localeCompare(t.label||t.key);function Wt({id:e,label:t,help:n,error:a,children:l}){const r=[n?`${e}-help`:null,a?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Me,{htmlFor:e,children:t}),l(r),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,a?s.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:a}):null]})}function om({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 Mv({id:e,label:t,help:n,checked:a,on_change:l}){return s.jsxs("div",{className:"grid gap-1",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Lr,{id:e,className:"mt-0.5",checked:a,"aria-describedby":n?`${e}-help`:void 0,onCheckedChange:r=>l(r===!0)}),s.jsx(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 Tk({id:e,legend:t,help:n,error:a,options:l,checked:r,on_change:i,empty:o,notes:c,scroll:d}){const f=[c!=null&&c.length?`${e}-notes`:null,n?`${e}-help`:null,a?`${e}-error`:null].filter(Boolean).join(" ")||void 0;return s.jsxs("fieldset",{className:"m-0 grid min-w-0 gap-2 border-0 p-0","aria-describedby":f,"aria-invalid":a?!0:void 0,children:[s.jsx("legend",{className:"mb-2 text-sm leading-none font-medium",children:t}),c!=null&&c.length?s.jsxs("div",{id:`${e}-notes`,className:"text-warning flex items-start gap-2 text-xs",children:[s.jsx(en,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),s.jsx("div",{className:"grid gap-0.5",children:c.map(h=>s.jsx("p",{children:h},h))})]}):null,l.length===0&&o?s.jsx("p",{className:"text-muted-foreground text-sm",children:o}):null,s.jsx("div",{className:d?"grid max-h-[200px] grid-cols-1 gap-2 overflow-y-auto rounded-md border p-3 sm:grid-cols-2":"grid grid-cols-1 gap-2 sm:grid-cols-2",tabIndex:d?0:void 0,role:d?"group":void 0,"aria-label":d?`${t} list`:void 0,children:l.map((h,m)=>s.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[s.jsx(Lr,{id:`${e}-${m}`,className:"mt-0.5",checked:r.has(h.value),onCheckedChange:x=>{const j=new Set(r);x===!0?j.add(h.value):j.delete(h.value),i(j)}}),s.jsx(Me,{htmlFor:`${e}-${m}`,className:"min-w-0 font-normal break-words",children:h.label})]},h.value))}),n?s.jsx("p",{id:`${e}-help`,className:"text-muted-foreground text-xs",children:n}):null,a?s.jsx("p",{id:`${e}-error`,className:"text-destructive text-sm",children:a}):null]})}function cm({context:e,action:t,title:n="Two-factor sign-in needed",changing:a="Changing the org"}){const l=e.two_factor==="enroll";return s.jsxs(me,{variant:"destructive",role:"alert",children:[s.jsx(XR,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:n}),s.jsxs(pe,{children:[s.jsx("p",{children:l?`Turn on two-factor sign-in in Account Settings, then come back here and ${t}.`:`${a} needs a two-factor sign-in. Sign in again with your authenticator in Account Settings, then come back here and ${t}.`}),s.jsx(q,{asChild:!0,variant:"outline",size:"sm",className:"mt-2 h-auto min-h-8 py-1.5 whitespace-normal text-left",children:s.jsx("a",{href:e.settings_href,target:"_blank",rel:"noreferrer",children:"Open Account Settings in a new tab"})})]})]})}const Pa=e=>e.two_factor==="ok";function Pr({refusal:e,context:t,subject:n,action:a,changing:l,authority_title:r}){if((e==null?void 0:e.kind)==="two_factor")return s.jsx(cm,{context:t,action:a,changing:l,title:`Could not save ${n}`});const i=Pa(t)?null:s.jsx(cm,{context:t,action:a,changing:l});if(!e)return i;const o=e.kind==="changed"?"The org changed since you opened this":e.kind==="authority"?r??`Could not save ${n}`:null;return s.jsxs(s.Fragment,{children:[i,s.jsxs(me,{variant:"destructive",role:"alert",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),o?s.jsx(ve,{children:o}):null,s.jsx(pe,{children:e.message})]})]})}function Ek({id:e,value:t,on_change:n,none:a,options:l,described_by:r}){return s.jsxs(dt,{value:t,onValueChange:n,children:[s.jsx(it,{id:e,"aria-describedby":r,children:s.jsx(ft,{placeholder:"Choose a team"})}),s.jsxs(ot,{children:[a?s.jsx(ke,{value:ds,children:a}):null,l.map(i=>s.jsx(ke,{value:i.key,children:i.label||i.key},i.key))]})]})}function qr(e){const[t,n]=u.useState(!1),[a,l]=u.useState(null);return{saving:t,refusal:a,set_refusal:l,run:async i=>{n(!0),l(null);try{const o=await i();o?l(o):e()}finally{n(!1)}}}}function Gr({saving:e,blocked:t,described_by:n,children:a}){return s.jsx(q,{type:"submit",disabled:e,"aria-disabled":t||void 0,"aria-describedby":t?n:void 0,children:a})}const Ak=(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 _3({open:e,chart:t,team:n,save:a,on_close:l,context:r=Do,scope:i="full",parents:o}){var C;const c=r.host==="hosted",[d,f]=u.useState(""),[h,m]=u.useState(""),[x,j]=u.useState(""),[v,y]=u.useState(ds),[g,p]=u.useState({}),{saving:b,refusal:_,set_refusal:N,run:R}=qr(l),w=((C=t.teams.find($=>$.parent===null))==null?void 0:C.key)??null;u.useEffect(()=>{e&&(f(""),m((n==null?void 0:n.label)??""),j((n==null?void 0:n.description)??""),y((n==null?void 0:n.parent)??(c&&w&&(!o||o.includes(w))?w:ds)),p({}),N(null))},[e,n,N,c,w,o]);const k=$=>{const X=t.teams.find(T=>T.key===$);return X?X.label||X.key:$??""},L=n?Rk(t.teams,n.key):new Set,D=[...t.teams].filter($=>!L.has($.key)&&(!o||o.includes($.key))).sort(($,X)=>$.key===w?-1:X.key===w?1:eo($,X)),K=n?n.label||n.key:"",G=i==="description",U=!Pa(r),M=n?G?"save the description":"save the team":"add the team",A=$=>{if($.preventDefault(),U)return;if(!n){const I=c?h.trim():d.trim();if(!I){p(c?{label:"Give the team a name."}:{key:"Give the team a key."});return}if(c&&v===ds){p({parent:"Choose the parent team."});return}const ne=c?I:h.trim()||I;R(()=>a({action:"add",kind:"team",key:I,...h.trim()?{label:h.trim()}:{},...x.trim()?{description:x.trim()}:{},...v!==ds?{parent:v}:{}},`Team ${ne} added.`));return}if(!G&&!h.trim()){p({label:c?"Give the team a name.":"Give the team a label."});return}const X=v===ds?null:v,T={...!G&&h.trim()!==n.label.trim()?{label:h.trim()}:{},...x.trim()!==(n.description??"").trim()?{description:x.trim()}:{},...!c&&X!==n.parent?{parent:X}:{}};if(Object.keys(T).length===0){l();return}R(()=>a({action:"edit",kind:"team",key:n.key,...T},G?`Saved the description of ${K}.`:`Team ${h.trim()} saved.`))},S=n?G?`Edit the description of ${K}`:`Edit team ${K}`:"Add team";let E;return G?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(zn,{open:e,onOpenChange:$=>$||b?null:l(),children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:A,noValidate:!0,children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:S}),s.jsx(In,{children:E})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Pr,{refusal:_,context:r,subject:G?"the description":"the team",action:M}),!n&&!c?s.jsx(Wt,{id:"org-team-key",label:"Key",help:Ak("team",r.host),error:g.key,children:$=>s.jsx(_t,{id:"org-team-key",className:"font-mono",value:d,autoComplete:"off","aria-invalid":g.key?!0:void 0,"aria-describedby":$,onChange:X=>{f(X.target.value),p({})}})}):null,G&&n?s.jsx(om,{label:"Name",children:n.parent?`${K} · under ${k(n.parent)}`:K}):s.jsx(Wt,{id:"org-team-label",label:c?"Name":n?"Label":"Label (optional)",help:c?n?void 0:"Its key is made from the name.":n?void 0:"Shown on the chart; the key when left empty.",error:g.label,children:$=>s.jsx(_t,{id:"org-team-label",value:h,"aria-invalid":g.label?!0:void 0,"aria-describedby":$,onChange:X=>{m(X.target.value),p({})}})}),s.jsx(Wt,{id:"org-team-description",label:G?"Description":"Description (optional)",children:()=>s.jsx(rs,{id:"org-team-description",rows:3,placeholder:"What the team does",value:x,onChange:$=>j($.target.value)})}),G?null:c&&n?s.jsx(om,{label:"Parent team",children:n.parent?k(n.parent):"None: the organization itself"}):s.jsx(Wt,{id:"org-team-parent",label:"Parent team",help:"Where the team sits; its posts report up through the team above.",error:g.parent,children:$=>s.jsx(Ek,{id:"org-team-parent",value:v,on_change:X=>{y(X),p({})},none:c?void 0:"No parent (a root team)",options:D,described_by:$})})]}),s.jsxs(Bn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:b,onClick:l,children:"Cancel"}),s.jsx(Gr,{saving:b,blocked:U,children:n?b?"Saving…":"Save":b?"Adding…":"Add team"})]})]})})})}const w3=(e,t)=>e.length===t.size&&e.every(n=>t.has(n));function N3({open:e,chart:t,job:n,save:a,on_close:l,context:r=Do}){const[i,o]=u.useState(""),[c,d]=u.useState(""),[f,h]=u.useState(""),[m,x]=u.useState(ds),[j,v]=u.useState(new Set),[y,g]=u.useState(!1),[p,b]=u.useState(!0),[_,N]=u.useState({}),{saving:R,refusal:w,set_refusal:k,run:L}=qr(l);u.useEffect(()=>{e&&(o(""),d((n==null?void 0:n.label)??""),h((n==null?void 0:n.description)??""),x((n==null?void 0:n.parent)??ds),v(new Set((n==null?void 0:n.fills)??[])),g((n==null?void 0:n.requires_person)??!1),b((n==null?void 0:n.escalable)??!0),N({}),k(null))},[e,n,k]);const D=n?Rk(t.job_functions,n.key):new Set,K=[...t.job_functions].filter(S=>!D.has(S.key)).sort(eo),G=[...t.slots].sort(eo).map(S=>({value:S.key,label:S.label||S.key})),U=!Pa(r),M=n?"save the job function":"add the job function",A=S=>{if(S.preventDefault(),U)return;if(!n){if(!i.trim()){N({key:"Give the job function a key."});return}L(()=>a({action:"add",kind:"job_function",key:i.trim(),...c.trim()?{label:c.trim()}:{},...f.trim()?{description:f.trim()}:{},...m!==ds?{parent:m}:{},fills:[...j],requires_person:y,escalable:p},`Job function ${c.trim()||i.trim()} added.`));return}if(!c.trim()){N({label:"Give the job function a label."});return}const E=m===ds?null:m,C={...c.trim()!==n.label.trim()?{label:c.trim()}:{},...f.trim()!==(n.description??"").trim()?{description:f.trim()}:{},...E!==n.parent?{parent:E}:{},...w3(n.fills,j)?{}:{fills:[...j]},...y!==n.requires_person?{requires_person:y}:{},...p!==n.escalable?{escalable:p}:{}};if(Object.keys(C).length===0){l();return}L(()=>a({action:"edit",kind:"job_function",key:n.key,...C},`Job function ${c.trim()} saved.`))};return s.jsx(zn,{open:e,onOpenChange:S=>S||R?null:l(),children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:A,noValidate:!0,children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:n?`Edit job function ${n.label||n.key}`:"Add job function"}),s.jsxs(In,{children:["Its job description: what it does, the slots it fills and who may hold its posts.",n?s.jsxs(s.Fragment,{children:[" ","Its key, ",s.jsx("span",{className:"font-mono",children:n.key}),", does not change."]}):null]})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Pr,{refusal:w,context:r,subject:"the job function",action:M}),n?null:s.jsx(Wt,{id:"org-function-key",label:"Key",help:Ak("job function",r.host),error:_.key,children:S=>s.jsx(_t,{id:"org-function-key",className:"font-mono",value:i,autoComplete:"off","aria-invalid":_.key?!0:void 0,"aria-describedby":S,onChange:E=>{o(E.target.value),N({})}})}),s.jsx(Wt,{id:"org-function-label",label:n?"Label":"Label (optional)",error:_.label,children:S=>s.jsx(_t,{id:"org-function-label",value:c,"aria-invalid":_.label?!0:void 0,"aria-describedby":S,onChange:E=>{d(E.target.value),N({})}})}),s.jsx(Wt,{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:S=>h(S.target.value)})}),s.jsx(Wt,{id:"org-function-parent",label:"Parent function",help:"Its posts report to the post of the parent function.",children:S=>s.jsx(Ek,{id:"org-function-parent",value:m,on_change:x,none:"No parent (a root function)",options:K,described_by:S})}),s.jsx(Tk,{id:"org-function-fills",legend:"Slots it fills",options:G,checked:j,on_change:v,empty:r.host==="hosted"?"This organization has no slots yet.":"This org has no slots yet; add them with sdlc org add slot."}),s.jsx(Mv,{id:"org-function-requires-person",label:"Requires a person",help:"Only a person may hold its posts.",checked:y,on_change:g}),s.jsx(Mv,{id:"org-function-escalable",label:"Escalable",help:"When no holder can decide, the decision goes up the reporting line. Off, it waits for a holder of this function.",checked:p,on_change:b})]}),s.jsxs(Bn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:R,onClick:l,children:"Cancel"}),s.jsx(Gr,{saving:R,blocked:U,children:n?R?"Saving…":"Save":R?"Adding…":"Add job function"})]})]})})})}const k3=/^[a-z][a-z0-9_-]{0,63}$/;function S3(e){return e.toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^[^a-z]+/,"").slice(0,64).replace(/-+$/,"")}function C3({open:e,chart:t,slot:n,save:a,on_close:l,context:r=Do}){const[i,o]=u.useState(""),[c,d]=u.useState(""),[f,h]=u.useState(!1),[m,x]=u.useState(""),[j,v]=u.useState({}),{saving:y,refusal:g,set_refusal:p,run:b}=qr(l);u.useEffect(()=>{e&&(o((n==null?void 0:n.label)??""),d((n==null?void 0:n.key)??""),h(!1),x((n==null?void 0:n.description)??""),v({}),p(null))},[e,n,p]);const _=!Pa(r),N=n?"save the slot":"add the slot",R=w=>{if(w.preventDefault(),_)return;const k=i.trim();if(n){if(!k){v({label:"Give the slot a label."});return}const D={...k!==(n.label??"").trim()?{label:k}:{},...m.trim()!==(n.description??"").trim()?{description:m.trim()}:{}};if(Object.keys(D).length===0){l();return}b(()=>a({action:"edit",kind:"slot",key:n.key,...D},`Saved slot ${k}.`));return}const L={...k?{}:{label:"Give the slot a label."},...k3.test(c)?t.slots.some(D=>D.key===c)?{key:`Slot ${c} already exists.`}:{}:{key:"Use lowercase letters, digits, _ and -, starting with a letter, at most 64 characters."}};v(L),!(L.label||L.key)&&b(()=>a({action:"add",kind:"slot",key:c,label:k,...m.trim()?{description:m.trim()}:{}},`Added slot ${k}.`))};return s.jsx(zn,{open:e,onOpenChange:w=>w||y?null:l(),children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:R,noValidate:!0,children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:n?`Edit ${n.label||n.key}`:"Add slot"}),s.jsx(In,{children:"A slot is a workflow role a project fills from its team's posts. Job functions name the slots they fill."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Pr,{refusal:g,context:r,subject:"the slot",action:N}),s.jsx(Wt,{id:"org-slot-label",label:"Label",help:"How the slot is named on the chart and in project settings.",error:j.label,children:w=>s.jsx(_t,{id:"org-slot-label",value:i,"aria-invalid":j.label?!0:void 0,"aria-describedby":w,onChange:k=>{o(k.target.value),!n&&!f&&d(S3(k.target.value)),v({})}})}),n?s.jsx(om,{label:"Key",children:s.jsx("span",{className:"font-mono",children:n.key})}):s.jsx(Wt,{id:"org-slot-key",label:"Key",help:"Lowercase letters, digits, _ and -, starting with a letter, at most 64 characters. It can't be changed after you save.",error:j.key,children:w=>s.jsx(_t,{id:"org-slot-key",className:"font-mono",value:c,autoComplete:"off","aria-invalid":j.key?!0:void 0,"aria-describedby":w,onChange:k=>{d(k.target.value),h(!0),v({})}})}),s.jsx(Wt,{id:"org-slot-description",label:"Description (optional)",children:()=>s.jsx(rs,{id:"org-slot-description",rows:3,placeholder:"What this role does",value:m,onChange:w=>x(w.target.value)})})]}),s.jsxs(Bn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:y,onClick:l,children:"Cancel"}),s.jsx(Gr,{saving:y,blocked:_,children:n?y?"Saving…":"Save":y?"Adding…":"Add slot"})]})]})})})}function R3({open:e,chart:t,binding:n,names:a,save:l,confirm:r,on_close:i,context:o=Do,hosted:c}){var U;const[d,f]=u.useState(new Set),[h,m]=u.useState(""),[x,j]=u.useState({}),{saving:v,refusal:y,set_refusal:g,run:p}=qr(i),b=(n==null?void 0:n.slot)??null;if(u.useEffect(()=>{!e||!n||(f(new Set(c&&n.source!=="override"?[]:n.posts.map(M=>M.post))),m(n.source==="override"?n.reason??"":""),j({}),g(null))},[e,b,g]),!n)return null;const _=a.slot(n.slot),N=(U=t.project)!=null&&U.team?t.teams.find(M=>{var A;return M.key===((A=t.project)==null?void 0:A.team)}):void 0,R=N?N.label||N.key:"the owning team",w=new Set(t.job_functions.filter(M=>M.fills.includes(n.slot)).map(M=>M.key)),k=[...t.posts].map(M=>M.post).sort(a.byPost).map(M=>{const A=w.has(M.split("/")[1]??"")?`${a.post(M)} (fills ${_})`:a.post(M),S=c==null?void 0:c.holders(M);return{value:M,label:c?S?`${A}: ${S}`:`${A} (no holder)`:A}}),L=c?[...d].sort(a.byPost).flatMap(M=>[...w.has(M.split("/")[1]??"")?[]:[`${a.post(M)} is not in the job description of ${_}.`],...c.chain.has(M.split("/")[0]??"")?[]:[`${a.post(M)} is outside ${c.owner} and the teams above it.`]]):[],D=!Pa(o),K=M=>{M.preventDefault();const A={...d.size===0?{posts:"Choose at least one post."}:{},...h.trim()?{}:{reason:"Give the reason for the override."}};j(A),!(A.posts||A.reason||D)&&p(()=>l({action:"bind",slot:n.slot,posts:[...d],reason:h.trim()},`Override of ${_} saved.`))},G=async()=>{await r({title:`Clear the override of ${_}?`,description:c?`${_} goes back to its team's posts: ${c.baseline}. The override and its reason stay in the audit trail.`:"It goes back to the posts its job descriptions name, and its reason is not kept.",action_label:c?"Clear override":"Clear",destructive:!0})&&p(()=>l({action:"unbind",slot:n.slot},`Override of ${_} cleared.`))};return s.jsx(zn,{open:e,onOpenChange:M=>M||v?null:i(),children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:K,noValidate:!0,children:[s.jsxs(Un,{children:[s.jsxs(Hn,{children:["Override ",_]}),s.jsxs(In,{children:["Bind ",_," in this project to the posts you choose instead of its"," ",c?"team’s":"job descriptions’"," posts. The override is reported with its reason, who set it and when."]})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[y||D?s.jsx("div",{id:"org-override-refusal",className:"grid gap-4",children:s.jsx(Pr,{refusal:y,context:o,subject:"the override",action:c?"save":"save the override",changing:c?"Changing this project’s slots":void 0,authority_title:c?"Your changes were not saved":void 0})}):null,s.jsx(Tk,{id:"org-override-posts",legend:"Posts",help:c?`(fills ${_}) marks the posts whose job function fills ${_}.`:"A post outside its job description is marked on the chart.",notes:L,scroll:!!c,error:x.posts,options:k,checked:d,on_change:M=>{f(M),j(A=>({...A,posts:void 0}))}}),s.jsx(Wt,{id:"org-override-reason",label:"Reason",error:x.reason,children:M=>s.jsx(rs,{id:"org-override-reason",rows:2,placeholder:"Why this slot needs other posts",value:h,"aria-invalid":x.reason?!0:void 0,"aria-describedby":M,onChange:A=>{m(A.target.value),j(S=>({...S,reason:void 0}))}})}),c?null:s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Made as ",s.jsx("span",{className:"font-mono",children:"person:user"}),", who must hold the lead post of ",R," or of a team above it."]})]}),s.jsxs(Bn,{className:"mt-6",children:[n.source==="override"?s.jsx(q,{type:"button",variant:"ghost",className:"sm:mr-auto",disabled:v,onClick:()=>void G(),children:"Clear override"}):null,s.jsx(q,{type:"button",variant:"outline",disabled:v,onClick:i,children:"Cancel"}),s.jsx(Gr,{saving:v,blocked:D,described_by:"org-override-refusal",children:v?"Saving…":"Save override"})]})]})})})}function T3(e){return e.length<=1?e[0]??"":`${e.slice(0,-1).join(", ")} or ${e[e.length-1]}`}function E3({open:e,chart:t,names:n,save:a,on_close:l,context:r}){var U;const i=t.authority,o=u.useMemo(()=>new Set((i==null?void 0:i.post_pairs)??[]),[i]),c=((U=t.teams.find(M=>M.parent===null))==null?void 0:U.key)??null,d=[...t.teams].filter(M=>[...o].some(A=>A.startsWith(`${M.key}/`))).sort((M,A)=>M.key===c?-1:A.key===c?1:eo(M,A)),[f,h]=u.useState(""),[m,x]=u.useState(""),[j,v]=u.useState({}),{saving:y,refusal:g,set_refusal:p,run:b}=qr(l);u.useEffect(()=>{var M;e&&(h(((M=d[0])==null?void 0:M.key)??""),x(""),v({}),p(null))},[e,p]);const _=new Set(t.posts.filter(M=>M.post.startsWith(`${f}/`)).map(M=>M.post.split("/")[1])),N=[],R=M=>{for(const A of[...t.job_functions].filter(S=>S.parent===M).sort(eo))N.push(A),R(A.key)};R(null);const w=N.filter(M=>o.has(`${f}/${M.key}`)&&!_.has(M.key)),k=f!==""&&w.length===0,L=!Pa(r)||k,D=M=>{if(M.preventDefault(),L)return;const A={...f?{}:{team:"Choose a team."},...m?{}:{job:"Choose a job function."}};v(A),!(A.team||A.job)&&b(()=>a({action:"add",kind:"post",key:`${f}/${m}`},`Added post ${n.job(m)} · ${n.team(f)}.`))},K=k?"Every job function already has a post in this team.":"A team has one post per job function; functions already staffed in this team are left out.",G=(i==null?void 0:i.ask)??[];return s.jsx(zn,{open:e,onOpenChange:M=>M||y?null:l(),children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:D,noValidate:!0,children:[s.jsxs(Un,{children:[s.jsx(Hn,{children:"Add post"}),s.jsx(In,{children:"A post is a job function staffed in a team. People in this post report to the post above it."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Pr,{refusal:g,context:r,subject:"the post",action:"add the post"}),s.jsx(Wt,{id:"org-post-team",label:"Team",help:"The team the post is in.",error:j.team,children:M=>s.jsxs(dt,{value:f,onValueChange:A=>{h(A),x(""),v({})},children:[s.jsx(it,{id:"org-post-team","aria-describedby":M,"aria-invalid":j.team?!0:void 0,children:s.jsx(ft,{placeholder:"Choose a team"})}),s.jsx(ot,{children:d.map(A=>s.jsx(ke,{value:A.key,children:A.label||A.key},A.key))})]})}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Wt,{id:"org-post-function",label:"Job function",help:K,error:j.job,children:M=>s.jsxs(dt,{value:m,disabled:k,onValueChange:A=>{x(A),v({})},children:[s.jsx(it,{id:"org-post-function","aria-describedby":M,"aria-invalid":j.job?!0:void 0,children:s.jsx(ft,{placeholder:k?"Every job function has a post here":"Choose a job function"})}),s.jsx(ot,{children:w.map(A=>s.jsx(ke,{value:A.key,children:A.label||A.key},A.key))})]})}),i&&!i.administer?s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Only the job functions directly below a post you hold are listed.",G.length?` For others, ask ${T3(G)}.`:""]}):null]})]}),s.jsxs(Bn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:y,onClick:l,children:"Cancel"}),s.jsx(Gr,{saving:y,blocked:L,described_by:k?"org-post-function-help":void 0,children:y?"Adding…":"Add post"})]})]})})})}function A3({open:e,chart:t,post:n,names:a,members:l,save:r,on_close:i,context:o}){const[c,d]=u.useState({state:"loading"}),[f,h]=u.useState(""),[m,x]=u.useState(null),[j,v]=u.useState(-1),{saving:y,refusal:g,set_refusal:p,run:b}=qr(i),_=u.useRef(0),N=u.useCallback(async()=>{const T=_.current+=1;d({state:"loading"});const I=await l();T===_.current&&d(I.ok?{state:"read",members:I.data}:{state:"failed"})},[l]);u.useEffect(()=>{e&&(h(""),x(null),v(-1),p(null),N())},[e,N,p]);const R=t.posts.find(T=>T.post===n);if(!n||!R)return null;const w=a.post(n),k=new Set(R.holders.map(T=>T.id)),D=t.posts.some(T=>T.reports_to===n)&&R.holders.length>0?R.holders[0]:null,K=f.trim().toLowerCase(),G=c.state==="read"?c.members.filter(T=>!k.has(T.id)).filter(T=>!K||[T.label,T.detail,T.email].some(I=>I==null?void 0:I.toLowerCase().includes(K))):[],U=c.state==="read"&&c.members.every(T=>k.has(T.id)),M=c.state==="read"&&!U&&G.length>0,A=M&&j>=0&&j<G.length?G[j]:null,S=T=>`org-holder-option-${T.id}`,E=!Pa(o)||!m||D!==null,C=T=>{if(!M)return;const I=G.length-1,ne=W=>{var xe,V;T.preventDefault(),v(W),(V=(xe=document.getElementById(S(G[W])))==null?void 0:xe.scrollIntoView)==null||V.call(xe,{block:"nearest"})};T.key==="ArrowDown"?ne(Math.min(A?j+1:0,I)):T.key==="ArrowUp"?ne(A?Math.max(j-1,0):I):T.key==="Home"&&A?ne(0):T.key==="End"&&A?ne(I):T.key==="Enter"&&A&&(m==null?void 0:m.id)!==A.id&&(T.preventDefault(),x(A))},$=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.",X=T=>{T.preventDefault(),!(E||!m)&&b(()=>r({action:"hold",post:n,member:m.id},`Added ${m.label} to ${w}.`))};return s.jsx(zn,{open:e,onOpenChange:T=>T||y?null:i(),children:s.jsx(Ln,{children:s.jsxs("form",{onSubmit:X,noValidate:!0,children:[s.jsxs(Un,{children:[s.jsxs(Hn,{children:["Add holder to ",w]}),s.jsx(In,{children:"The member holds this post and reports as it does."})]}),s.jsxs("div",{className:"mt-4 grid gap-4",children:[s.jsx(Pr,{refusal:g,context:o,subject:"the holder",action:"add the holder"}),D?s.jsxs(me,{variant:"info",id:"org-holder-one",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsxs(pe,{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(_t,{id:"org-holder-member",role:"combobox","aria-expanded":M,"aria-controls":M?"org-holder-members":void 0,"aria-activedescendant":A?S(A):void 0,"aria-autocomplete":"list","aria-describedby":$?"org-holder-member-help":void 0,placeholder:"Search members by name, username or email",autoComplete:"off",value:f,disabled:D!==null,onChange:T=>{h(T.target.value),v(-1)},onKeyDown:C}),s.jsx("div",{className:"max-h-56 overflow-y-auto rounded-md border",children:c.state==="loading"?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 px-3 py-2 text-sm",role:"status",children:[s.jsx(vn,{className:"size-4","aria-hidden":"true"}),"Loading members…"]}):c.state==="failed"?s.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-2",children:[s.jsx("p",{className:"text-destructive text-sm",children:"Could not read the members."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",onClick:()=>void N(),children:"Retry"})]}):U?s.jsx("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"Every member already holds this post."}):G.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:G.map((T,I)=>{const ne=(m==null?void 0:m.id)===T.id,W=(A==null?void 0:A.id)===T.id;return s.jsxs("li",{id:S(T),role:"option","aria-selected":ne,className:`cursor-pointer rounded-sm px-2 py-1.5 ${ne?"bg-accent text-accent-foreground":W?"bg-muted":"hover:bg-muted"} ${W?"ring-ring ring-2 ring-inset":""}`,onClick:()=>{D||(v(I),x(T))},children:[s.jsxs("div",{className:"text-sm font-medium break-words",children:[T.label,T.detail&&G.filter(xe=>xe.label===T.label).length>1?` (${T.detail})`:""]}),T.email?s.jsx("div",{className:"text-muted-foreground text-xs break-all",children:T.email}):null]},T.id)})})}),$?s.jsx("p",{id:"org-holder-member-help",className:"text-muted-foreground text-xs",children:$}):null]})]}),s.jsxs(Bn,{className:"mt-6",children:[s.jsx(q,{type:"button",variant:"outline",disabled:y,onClick:i,children:"Cancel"}),s.jsx(Gr,{saving:y,blocked:E,described_by:D?"org-holder-one":$?"org-holder-member-help":void 0,children:y?"Adding…":"Add holder"})]})]})})})}function M3(e){const[t,n]=u.useState(null),a=u.useRef(t);u.useEffect(()=>{a.current=t},[t]);const l=u.useCallback(c=>{var d;(d=a.current)==null||d.resolve(c),n(null)},[]),r=u.useCallback(c=>new Promise(d=>{var f;(f=a.current)==null||f.resolve(!1),n({...c,resolve:d})}),[]);u.useEffect(()=>()=>{var c;return(c=a.current)==null?void 0:c.resolve(!1)},[]);const i=!Pa(e),o=s.jsx(l_,{open:t!==null,onOpenChange:c=>c?null:l(!1),children:s.jsxs(r_,{children:[s.jsxs(i_,{children:[s.jsx(c_,{children:t==null?void 0:t.title}),s.jsx(u_,{className:"whitespace-pre-line",children:t==null?void 0:t.description})]}),t&&i?s.jsx(cm,{context:e,action:t.action}):null,s.jsxs(o_,{children:[s.jsx(f_,{children:"Cancel"}),s.jsx(d_,{variant:t!=null&&t.destructive?"destructive":"default","aria-disabled":i||void 0,onClick:c=>{if(i){c.preventDefault();return}l(!0)},children:t==null?void 0:t.action_label})]})]})});return{confirm:r,confirm_dialog:o}}function to({label:e,on_edit:t,on_remove:n,items:a}){const l=a??[...t?[{label:"Edit",on_select:t}]:[],...n?[{label:"Remove",on_select:n,destructive:!0}]:[]];return s.jsxs(yd,{children:[s.jsx(bd,{asChild:!0,children:s.jsx(q,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`More actions for ${e}`,children:s.jsx(hp,{className:"size-3.5","aria-hidden":"true"})})}),s.jsx(Mo,{align:"end",children:l.map(r=>s.jsx(_r,{className:r.destructive?"text-destructive focus:text-destructive":void 0,onSelect:r.on_select,children:r.label},r.label))})]})}function O3({label:e,message:t,bound:n,on_dismiss:a}){return s.jsxs(me,{variant:"destructive",role:"alert",className:"mb-3",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsxs(ve,{children:[e," was not removed"]}),s.jsxs(pe,{children:[s.jsx("p",{children:t}),n!=null&&n.projects.length?s.jsx("ul",{role:"list",className:"bg-card text-foreground m-0 mt-2 grid list-none gap-3 rounded-md border p-3",children:n.projects.map(l=>s.jsxs("li",{className:"grid gap-0.5",children:[s.jsxs("a",{className:"text-primary text-sm underline underline-offset-2",href:l.href,children:["Settings of ",l.name]}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Override set by ",l.set_by??"a former member"]})]},l.href))}):null,n&&n.more>0?s.jsxs("p",{className:"mt-2",children:["And ",n.more," more ",n.more===1?"project":"projects",". Clear these and try again to see the rest. An org owner can open any project you cannot."]}):null,s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:a,children:"Dismiss"})]})]})}const Do={host:"local",two_factor:"ok",settings_href:""},$3={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."},D3="Covered: someone holds a post that fills the slot. Vacant: posts fill it but nobody holds them. Uncovered: no job function fills it.",z3=4,lx=e=>({paddingLeft:16+24*Math.min(e,z3)}),Ru={covered:{label:"Covered",tone:"success"},vacant:{label:"Vacant",tone:"warning"},uncovered:{label:"Uncovered",tone:"error"}};function L3(){const e=nn().org;if(!e)throw new Error("The Org chart page rendered without the org seam.");return e}function U3({host:e="local",org:t=""}={}){const n=L3(),[a,l]=u.useState({state:"loading"}),[r,i]=u.useState(null),o=u.useRef(0),c=u.useRef(null),d=u.useCallback(j=>{const v=async y=>{const g=o.current+=1;c.current&&clearTimeout(c.current);const p=await n.chart();if(g!==o.current)return;if(p.ok){i({chart:p.data,at:new Date().toISOString()}),l({state:"read"});return}const{refusal:b}=p;if(b.reason==="no_local_org"){i(null),l({state:"none",seedable:b.seedable!==!1});return}if(e==="hosted"&&(b.reason==="not_found"||b.status===404)){i(null),l({state:"missing"});return}if(b.retry&&b.reason==="store_locked"&&y>0){const _=b.retry_after??10;l({state:"busy",retry_after:_}),c.current=setTimeout(()=>void v(y-1),_*1e3);return}l({state:"failed",refusal:b})};return v(j)},[n,e]);u.useEffect(()=>(d(1),()=>{o.current+=1,c.current&&clearTimeout(c.current)}),[d]);const f=()=>void d(1),h=a.state==="none"||a.state==="missing"?null:r,{href:m}=Ve(),x=V3(n,()=>void d(1),(h==null?void 0:h.chart)??B3,e,m("/settings/account"));return a.state==="missing"?s.jsx(X3,{org:t}):s.jsx(WN,{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(Ft,{title:"Org chart",description:$3[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(Y3,{quiet:a.state==="busy"}):null,a.state==="none"?s.jsx(F3,{edit:(x==null?void 0:x.actions)??null,seedable:a.seedable}):null,a.state==="failed"?s.jsx(Q3,{host:e,kept_at:(h==null?void 0:h.at)??null,on_retry:f}):null,h?s.jsx(Z3,{chart:h.chart,host:e,edit:(x==null?void 0:x.actions)??null}):null,(x==null?void 0:x.dialogs)??null]})})}const B3={org:"",workflow:!1,teams:[],job_functions:[],slots:[],posts:[],members:[],slot_resolution:[],project:{team:null,roots:[]}};function H3(e){var i;const t=e.authority;if(!t)return{functions:!0,team_add:!0,team:()=>"full",post_add:!1,post:()=>!1,override:!0,slots:!1};const n=((i=e.teams.find(o=>o.parent===null))==null?void 0:i.key)??null,a=new Set(t.teams),l=new Set(t.team_descriptions),r=new Set(t.posts);return{functions:t.administer,team_add:a.size>0,team:o=>o===n?t.administer?"root":l.has(o)?"description":null:a.has(o)?"full":l.has(o)?"description":null,post_add:t.post_pairs.length>0,post:o=>r.has(o),override:!1,slots:t.administer}}function I3(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 P3={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."},q3={mfa_challenge_required:"challenge",mfa_enrollment_required:"enroll"};function G3(e,t,n){var c;const a=t==="hosted"&&!!n.authority,l=((c=n.authority)==null?void 0:c.two_factor)??!0,[r,i]=u.useState("ok"),o=u.useCallback(async()=>{a&&i(e.twoFactor?await e.twoFactor():l?"ok":"challenge")},[e,a,l]);return u.useEffect(()=>{if(!a){i("ok");return}l?i("ok"):o();const d=()=>void o();return window.addEventListener("focus",d),()=>window.removeEventListener("focus",d)},[a,l,o]),{state:r,set_state:i,check:o}}function V3(e,t,n,a,l){const r=Mr(),i=Mk(n),o=G3(e,a,n),c=a==="hosted"?{host:a,two_factor:o.state,settings_href:l}:Do,{confirm:d,confirm_dialog:f}=M3(c),[h,m]=u.useState(null),[x,j]=u.useState({}),v=S=>j(E=>{if(!E[S])return E;const{[S]:C,...$}=E;return $}),y=e.members,g=u.useCallback(async()=>{if(!y)return{ok:!1};const S=await y();return S.ok?{ok:!0,data:S.data}:{ok:!1}},[y]),p=e.change;if(!p||a==="hosted"&&(!n.authority||!I3(n)))return null;const b=H3(n),_=S=>{const E=S.code?q3[S.code]:void 0;return E?(o.set_state(E),{kind:"two_factor",message:S.message}):S.code==="revision_conflict"?(t(),{kind:"changed",message:S.message}):S.code==="outside_authority"?(t(),{kind:"authority",message:S.message}):{message:S.message}},N=S=>S.action==="hold"||S.action==="release"?"posts":"kind"in S?S.kind==="team"?"teams":S.kind==="post"?"posts":S.kind==="slot"?"slots":"functions":null,R=(S,E)=>{const C=S==null?void 0:S.warning;C?r.error(C):r.success(E),t()},w=async(S,E)=>{const C=await p(S);if(!C.ok)return _(C.refusal);const $=N(S);return $&&v($),R(C.data,E),null},k=S=>{o.check(),m(S)},L=async(S,E,C,$)=>{const X=await p(C);if(!X.ok){const T=_(X.refusal),I=X.refusal.bound,ne=I?I.projects.length+I.more:0,W=I?`${I.kind==="slot"?"Slot":"Post"} ${E} is still needed by the ${ne===1?"override of 1 project that binds":`overrides of ${ne} projects that bind`} it. Clear ${ne===1?"it":"them"} on each project's Settings first.`:T.message;j(xe=>({...xe,[S]:{label:E,message:W,...I?{bound:I}:{}}}));return}v(S),R(X.data,$)},D=async(S,E,C)=>{const $=S==="team"?"team":"job function";o.check(),await d({title:`Remove ${$} ${C}?`,description:P3[a],action_label:"Remove",destructive:!0,action:`remove the ${$}`})&&await L(S==="team"?"teams":"functions",C,{action:"remove",kind:S,key:E},`${S==="team"?"Team":"Job function"} ${C} removed.`)},K=async S=>{const E=S.label||S.key;o.check(),await d({title:`Remove slot ${E}?`,description:"Projects stop showing it. This can't be undone.",action_label:"Remove slot",destructive:!0,action:"remove the slot"})&&await L("slots",E,{action:"remove",kind:"slot",key:S.key},`Removed slot ${E}.`)},G=async S=>{const E=i.post(S);o.check(),await d({title:`Remove post ${E}?`,description:"The post leaves the organization's chart. A post with holders is refused; remove its holders first.",action_label:"Remove",destructive:!0,action:"remove the post"})&&await L("posts",E,{action:"remove",kind:"post",key:S},`Removed post ${E}.`)},U=async(S,E)=>{const C=i.post(S),$=i.member(E),X=n.posts.find(xe=>xe.post===S),I=((X==null?void 0:X.holders.length)??0)<=1?X!=null&&X.escalates_to?` The post becomes vacant. Until someone holds it, its reports and the slots it fills go to ${i.manager(X.escalates_to)}.`:" The post becomes vacant.":"";if(o.check(),!await d({title:`Remove ${$} from ${C}?`,description:`They stop holding this post and no longer report through it.${I}`,action_label:"Remove",action:"remove the holder"}))return;const W=await p({action:"release",post:S,member:E.id});if(!W.ok){r.error(_(W.refusal).message),t();return}v("posts"),R(W.data,`Removed ${$} from ${C}.`)},M=()=>m(null),A=(h==null?void 0:h.kind)==="override"&&n.project&&n.project.team!==null?n.project.slots.find(S=>S.slot===h.slot)??null:null;return{actions:{can:b,host:a,team:(S,E="full")=>k({kind:"team",team:S,scope:E}),job:S=>k({kind:"function",job:S}),override:S=>k({kind:"override",slot:S}),slot:S=>k({kind:"slot",slot:S}),slot_remove:S=>void K(S),remove:(S,E,C)=>void D(S,E,C),post_add:()=>k({kind:"post"}),post_remove:S=>void G(S),holder_add:S=>k({kind:"holder",post:S}),holder_remove:(S,E)=>void U(S,E),refused:S=>{const E=x[S];return E?s.jsx(O3,{label:E.label,message:E.message,bound:E.bound,on_dismiss:()=>v(S)}):null}},dialogs:s.jsxs(s.Fragment,{children:[s.jsx(_3,{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:w,on_close:M,context:c}),s.jsx(N3,{open:(h==null?void 0:h.kind)==="function",chart:n,job:(h==null?void 0:h.kind)==="function"?h.job:null,save:w,on_close:M,context:c}),s.jsx(R3,{open:A!==null,chart:n,binding:A,names:i,save:w,confirm:S=>d({...S,action:"clear the override"}),on_close:M}),s.jsx(C3,{open:(h==null?void 0:h.kind)==="slot",chart:n,slot:(h==null?void 0:h.kind)==="slot"?h.slot:null,save:w,on_close:M,context:c}),s.jsx(E3,{open:(h==null?void 0:h.kind)==="post",chart:n,names:i,save:w,on_close:M,context:c}),s.jsx(A3,{open:(h==null?void 0:h.kind)==="holder",chart:n,post:(h==null?void 0:h.kind)==="holder"?h.post:null,names:i,members:g,save:w,on_close:M,context:c}),f]})}}function Y3({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(pt,{className:n===3?"h-10 w-2/3":"h-10 w-full"},n))})}function ir({children:e}){return s.jsx("pre",{className:"bg-muted text-foreground m-0 overflow-x-auto rounded-md border px-3 py-2 font-mono text-sm",children:s.jsx("code",{children:e})})}function F3({edit:e,seedable:t}){const n=t?e?"Plan one from this checkout's workflow roles with sdlc org seed, or start one with a team. This page shows it as soon as it exists.":"Plan one from this checkout's workflow roles, or start one with a team. This page shows it as soon as it exists.":"Start one with a team. This page shows it as soon as it exists.";return s.jsxs(me,{variant:"info",className:"mt-6",children:[s.jsx(Ua,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"This repository has no local org yet"}),s.jsxs(pe,{children:[s.jsx("p",{children:n}),t||!e?s.jsxs("div",{className:"mt-2 grid w-full gap-2",children:[t?s.jsx(ir,{children:"sdlc org seed"}):null,e?null:s.jsx(ir,{children:"sdlc org add team <key>"})]}):null,e?s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>e.team(null),children:[s.jsx(br,{className:"size-4","aria-hidden":"true"}),"Add team"]}):null]})]})}function X3({org:e}){const{href:t,Link:n}=Ve();return s.jsx(Ba,{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 K3(e){return new Date(e).toDateString()===new Date().toDateString()?`today at ${ns(e)}`:`on ${An(e)} at ${ns(e)}`}function Q3({host:e,kept_at:t,on_retry:n}){const a=t?`The chart read ${K3(t)} is kept below. `:"";return s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:e==="hosted"?"Could not read the org chart":"Could not read the local org"}),s.jsxs(pe,{children:[s.jsxs("p",{children:[a,e==="hosted"?a?"Try again in a moment.":"Try again in a moment. If it keeps failing, ask an organization owner.":"Details are in the terminal running sdlc viewer."]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function Mk(e){return u.useMemo(()=>{const t=new Map(e.teams.map(y=>[y.key,y.label||y.key])),n=new Map(e.job_functions.map(y=>[y.key,y.label||y.key])),a=new Map(e.slots.map(y=>[y.key,y.label||y.key])),l=new Map(e.posts.map(y=>[y.post,y.holders])),r=y=>y.label||y.id,i=new Map;for(const y of[...e.members,...e.posts.flatMap(g=>g.holders)]){const g=r(y);i.set(g,(i.get(g)??new Set).add(`${y.kind}:${y.id}`))}const o=y=>{var g;return(((g=i.get(r(y)))==null?void 0:g.size)??0)>1},c=y=>{const g=o(y)?y.detail??y.id:null;return g&&g!==r(y)?g:null},d=y=>{const g=c(y);return g&&g!==r(y)?`${r(y)} (${g})`:r(y)},f=y=>{const[g="",p=""]=y.split("/");return{team:t.get(g)??g,job:n.get(p)??p}},h=y=>{const{team:g,job:p}=f(y);return`${p} · ${g}`},m=y=>{if(y==="top")return"Top of the org";if(typeof y!="string")return`A vacant ${n.get(y.vacant)??y.vacant}`;const g=(l.get(y)??[]).map(d);return g.length?`${h(y)} (${g.join(", ")})`:h(y)},x=new Map(e.teams.map(y=>[y.key,y.parent])),j=y=>{let g=0;for(let p=x.get(y);p&&g<e.teams.length;p=x.get(p))g+=1;return g};return{parts:f,post:h,member:d,memberLabel:r,memberDetail:c,manager:m,byPost:(y,g)=>{const[p="",b=""]=[y.split("/")[0],g.split("/")[0]],[_,N]=[f(y),f(g)];return j(p)-j(b)||_.team.localeCompare(N.team)||_.job.localeCompare(N.job)},slot:y=>a.get(y)??y,job:y=>n.get(y)??y,team:y=>t.get(y)??y}},[e])}function Qa({id:e,title:t,description:n,actions:a,children:l,anchor:r}){const i=u.useRef(null);return u.useEffect(()=>{var o,c;!r||typeof window>"u"||window.location.hash!==`#${r}`||((o=i.current)==null||o.scrollIntoView({block:"start"}),(c=i.current)==null||c.focus({preventScroll:!0}))},[r]),s.jsxs("section",{id:r,"aria-labelledby":e,className:"mt-8 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-4 gap-y-2",children:[s.jsxs("div",{className:"min-w-0 flex-1 basis-64",children:[s.jsx("h2",{id:e,ref:i,tabIndex:r?-1:void 0,className:"text-lg font-semibold",children:t}),s.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:n})]}),a?s.jsx("div",{className:"flex shrink-0 gap-2",children:a}):null]}),s.jsx("div",{className:"mt-3",children:l})]})}function fi({children:e,on_click:t}){return s.jsxs(q,{type:"button",variant:"outline",size:"sm",onClick:t,children:[s.jsx(br,{className:"size-4","aria-hidden":"true"}),e]})}const Ov={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 Z3({chart:e,host:t,edit:n}){const a=Mk(e),l=e.members.some(r=>r.kind==="agent");return s.jsxs(s.Fragment,{children:[s.jsxs(Qa,{id:"org-chart-lines",title:"Reporting lines",description:"Each post reports to the post of its parent job function in the same team, or else in the nearest team above it that has one.",actions:n!=null&&n.can.post_add?s.jsx(fi,{on_click:n.post_add,children:"Add post"}):void 0,children:[n==null?void 0:n.refused("posts"),s.jsx(ez,{chart:e,names:a,agents:l,host:t,edit:n})]}),s.jsx(Qa,{id:"org-chart-members",title:"Members",description:l?`${Ov[t]} Each agent answers to the nearest person in its reporting chain.`:Ov[t],children:s.jsx(lz,{chart:e,names:a,host:t,agents:l})}),n?s.jsxs(Qa,{id:"org-chart-teams",title:"Teams",description:"Each team under its parent. A post is one of its job functions staffed in it.",actions:n.can.team_add?s.jsx(fi,{on_click:()=>n.team(null),children:"Add team"}):void 0,children:[n.refused("teams"),s.jsx(W3,{chart:e,edit:n})]}):null,s.jsxs("div",{className:"grid items-start gap-x-6 xl:grid-cols-2",children:[s.jsxs(Qa,{id:"org-chart-functions",title:"Function tree",description:"Each job function under its parent, with the slots it fills.",actions:n!=null&&n.can.functions?s.jsx(fi,{on_click:()=>n.job(null),children:"Add job function"}):void 0,children:[n!=null&&n.can.functions?n.refused("functions"):null,s.jsx(rz,{chart:e,names:a,edit:n!=null&&n.can.functions?n:null})]}),s.jsxs(Qa,{id:"org-chart-slots",anchor:"slots",title:"Slots",description:D3,actions:n!=null&&n.can.slots&&e.slot_resolution.length>0?s.jsx(fi,{on_click:()=>n.slot(null),children:"Add slot"}):void 0,children:[n!=null&&n.can.slots?n.refused("slots"):null,e.workflow===!1?s.jsx("p",{className:"text-muted-foreground mb-3 text-xs",children:"This checkout has no workflow file, so no slot is marked as a gate."}):null,s.jsx(oz,{chart:e,names:a,host:t,edit:n!=null&&n.can.slots?n:null})]})]}),e.project?s.jsx(uz,{project:e.project,chart:e,names:a,edit:n!=null&&n.can.override?n:null}):null]})}function W3({chart:e,edit:t}){var c;const n=rx([...e.teams].sort((d,f)=>(d.label||d.key).localeCompare(f.label||f.key)),d=>d.key,d=>d.parent);if(n.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"No teams yet."});const a=((c=e.project)==null?void 0:c.team)??null,l=t.host==="hosted",r=(d,f)=>{const h=t.can.team(d.key);return h==="full"?s.jsx(to,{label:f,on_edit:()=>t.team(d),on_remove:()=>t.remove("team",d.key,f)}):h==="root"?s.jsx(to,{label:f,on_edit:()=>t.team(d,"description")}):h==="description"?s.jsx(q,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`Edit the description of ${f}`,onClick:()=>t.team(d,"description"),children:s.jsx(ed,{className:"size-3.5","aria-hidden":"true"})}):null},i=(d,f)=>s.jsx("ul",{role:"list",className:f===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:d.map(({item:h,children:m})=>{const x=h.label||h.key;return s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:lx(f),"data-testid":"org-chart-team",children:[s.jsx("span",{className:"text-sm font-medium",children:x}),s.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[l?null:s.jsx("span",{className:"text-muted-foreground font-mono text-xs",children:h.key}),a===h.key?s.jsx(he,{variant:"neutral",children:"Owns this project"}):null,r(h,x)]})]}),m.length>0?i(m,f+1):null]},h.key)})}),o=l&&e.teams.length===1;return s.jsxs(s.Fragment,{children:[s.jsx(xt,{className:"overflow-hidden",children:i(n,0)}),o?s.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["No teams below ",e.teams[0].label||e.teams[0].key," yet."]}):null]})}function rx(e,t,n){const a=new Set(e.map(t)),l=new Map(e.map(i=>[t(i),{item:i,children:[]}])),r=[];for(const i of e){const o=n(i),c=l.get(t(i));o&&a.has(o)&&o!==t(i)?l.get(o).children.push(c):r.push(c)}return r}const J3={local:"No posts yet.",hosted:"No posts yet. An org admin can add them."};function ez({chart:e,names:t,agents:n,host:a,edit:l}){const r=rx([...e.posts].sort((c,d)=>t.byPost(c.post,d.post)),c=>c.post,c=>typeof c.reports_to=="string"&&c.reports_to!=="top"?c.reports_to:null);if(r.length===0){const c=a==="hosted"&&(l==null?void 0:l.can.functions)&&!l.can.post_add;return s.jsx("p",{className:"text-muted-foreground text-sm",children:l!=null&&l.can.post_add?"No posts yet. Add a post to staff a job function in a team.":c?"No posts yet. Add a job function under Function tree first, then add a post to staff it in a team.":J3[a]})}const i=new Map(e.members.map(c=>[`${c.kind}:${c.id}`,c])),o=(c,d)=>s.jsx("ul",{role:"list",className:d===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:c.map(({item:f,children:h})=>{const{team:m}=t.parts(f.post),x=typeof f.reports_to=="object"?f.reports_to:null,j=!!(l!=null&&l.can.post(f.post));return s.jsxs("li",{children:[s.jsxs("div",{className:"border-b py-2 pr-4",style:lx(d),"data-testid":"org-chart-post",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(UC,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium",children:t.parts(f.post).job}),s.jsx("span",{className:"text-muted-foreground text-xs",children:x?`${m} · Reports to a vacant ${t.job(x.vacant)}`:m}),j&&l?s.jsx("span",{className:"ml-auto",children:s.jsx(to,{label:t.post(f.post),items:[{label:"Add holder",on_select:()=>l.holder_add(f.post)},{label:"Remove post",on_select:()=>l.post_remove(f.post),destructive:!0}]})}):null]}),s.jsx("div",{className:"mt-1 grid min-w-0 gap-1 pl-6",children:f.holders.length===0?s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(he,{variant:Ru.vacant.tone,children:Ru.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(sz,{holder:v,post:f.post,member:i.get(`${v.kind}:${v.id}`),names:t,agents:n,host:a,on_remove:j&&l?()=>l.holder_remove(f.post,v):void 0},`${v.kind}:${v.id}`))})]}),h.length>0?o(h,d+1):null]},f.post)})});return s.jsx(xt,{className:"overflow-hidden",children:o(r,0)})}function tz(e){return new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function nz(e){if(!e.held_since)return null;const t=tz(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 sz({holder:e,post:t,member:n,names:a,agents:l,host:r,on_remove:i}){const o=e.kind==="person"?mp:fp,c=n==null?void 0:n.posts.find(j=>j.post===t),d=n==null?void 0:n.posts.find(j=>j.primary),f=a.memberDetail(e);let h=null;c!=null&&c.dotted&&d?h=`Dotted line: primary manager is ${a.manager(d.reports_to)}`:e.kind==="agent"&&n&&"accountable_person"in n&&(h=n.accountable_person?`Accountable person ${a.member(n.accountable_person)}`:"No accountable person");const m=r==="hosted"?nz(e):null,x=a.memberLabel(e);return s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1",children:[s.jsx(o,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":"true"}),s.jsx("span",{className:"text-sm font-medium break-all",children:x}),i?s.jsxs(JN,{children:[s.jsx(ek,{asChild:!0,children:s.jsx(q,{type:"button",variant:"ghost",size:"control-icon",className:"-my-1 shrink-0","aria-label":`Remove ${a.member(e)} from ${a.post(t)}`,onClick:i,children:s.jsx(nd,{className:"size-3.5","aria-hidden":"true"})})}),s.jsxs(Qp,{children:["Remove ",x]})]}):null,f?s.jsx("span",{className:"text-muted-foreground text-xs break-all",children:f}):null,l?s.jsx("span",{className:"text-muted-foreground text-xs",children:e.kind==="person"?"Person":"Agent"}):null]}),h?s.jsx("div",{className:"pl-5.5 text-xs",children:h}):null,m?s.jsx("div",{className:"text-muted-foreground pl-5.5 text-xs",children:m}):null]})}const az=["sdlc org hold <team>/<function> --person <id>","sdlc org hold <team>/<function> --agent <id>"];function lz({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:"}),az.map(r=>s.jsx(ir,{children:r},r))]});const l=[...e.members].sort((r,i)=>r.kind===i.kind?t.memberLabel(r).localeCompare(t.memberLabel(i))||r.id.localeCompare(i.id):r.kind==="person"?-1:1);return s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Members",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:l.map(r=>{const i=r.posts.find(d=>d.primary),o=r.posts.filter(d=>d.dotted),c=t.memberDetail(r);return s.jsxs(ue,{"data-testid":"org-chart-member",children:[s.jsxs(P,{children:[s.jsx("div",{className:"font-medium",children:t.memberLabel(r)}),c?s.jsx("div",{className:"text-muted-foreground text-xs",children:c}):null,a?s.jsx("div",{className:"text-muted-foreground text-xs",children:r.kind==="person"?"Person":"Agent"}):null]}),s.jsx(P,{children:r.posts.map(d=>t.post(d.post)).join(", ")}),s.jsx(P,{children:i?t.manager(i.reports_to):"None"}),s.jsx(P,{children:o.length?o.map(d=>t.manager(d.reports_to)).join(", "):"None"}),a?s.jsx(P,{children:r.kind==="person"?"Not an agent":r.accountable_person?t.member(r.accountable_person):"None"}):null]},`${r.kind}:${r.id}`)})})]})})}function rz({chart:e,names:t,edit:n}){const a=rx([...e.job_functions].sort((r,i)=>(r.label||r.key).localeCompare(i.label||i.key)),r=>r.key,r=>r.parent);if(a.length===0)return s.jsx("p",{className:"text-muted-foreground text-sm",children:(n==null?void 0:n.host)==="hosted"?"No job functions yet. Add one to start the chart.":"No job functions yet."});const l=(r,i)=>s.jsx("ul",{role:"list",className:i===0?"m-0 -mb-px list-none p-0":"m-0 list-none p-0",children:r.map(({item:o,children:c})=>s.jsxs("li",{children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-b py-2 pr-4",style:lx(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(he,{variant:"neutral",children:"Requires a person"}):null,n?s.jsx(to,{label:o.label||o.key,on_edit:()=>n.job(o),on_remove:()=>n.remove("job_function",o.key,o.label||o.key)}):null]})]}),c.length>0?l(c,i+1):null]},o.key))});return s.jsx(xt,{className:"overflow-hidden",children:l(a,0)})}function iz(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 Tu={covered:0,vacant:1,uncovered:2};function Ok(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 oz({chart:e,names:t,host:n,edit:a}){var i;const l=Ok(e),r=new Map(e.slots.map(o=>[o.key,o]));if(n==="hosted"&&e.slot_resolution.length===0){const o=((i=e.authority)==null?void 0:i.ask)??[];return s.jsxs(xt,{className:"grid justify-items-center gap-2 p-6 text-center",children:[s.jsx("span",{className:"text-sm font-medium",children:"No slots yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Add the workflow roles your projects fill, such as Implementer or Approver."}),a?s.jsx(fi,{on_click:()=>a.slot(null),children:"Add slot"}):s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Only an org owner or admin adds slots."," ",o.length?`Ask ${o.slice(0,3).join(", ")} to make this change.`:"Ask an org owner to make this change."]})]})}return s.jsx(xt,{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Slots",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Slot"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Resolves to"}),a?s.jsx(F,{className:"text-right",children:s.jsx("span",{className:"sr-only",children:"Actions"})}):null]})}),s.jsxs(He,{children:[[...e.slot_resolution].sort((o,c)=>Tu[o.status]-Tu[c.status]||t.slot(o.slot).localeCompare(t.slot(c.slot))).map(o=>{var d,f;const c=Ru[o.status];return s.jsxs(ue,{"data-testid":"org-chart-slot",children:[s.jsxs(P,{children:[s.jsx("div",{className:"font-medium",children:t.slot(o.slot)}),n==="hosted"?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-muted-foreground font-mono text-xs",children:o.slot}),(d=r.get(o.slot))!=null&&d.description?s.jsx("div",{className:"text-muted-foreground text-xs break-words",children:(f=r.get(o.slot))==null?void 0:f.description}):null]}):null,l.has(o.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:l.get(o.slot)}):null]}),s.jsx(P,{children:s.jsx(he,{variant:c.tone,children:c.label})}),s.jsxs(P,{children:[iz(o,t),o.status==="covered"&&o.needs_person?s.jsx("div",{className:"text-muted-foreground text-xs",children:"Needs a person"}):null]}),a&&r.has(o.slot)?s.jsx(P,{className:"text-right",children:s.jsx(to,{label:t.slot(o.slot),on_edit:()=>a.slot(r.get(o.slot)),on_remove:()=>a.slot_remove(r.get(o.slot))})}):null]},o.slot)}),e.slot_resolution.length===0?s.jsx(ue,{children:s.jsx(P,{colSpan:3,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})})}const cz="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.",Df=["sdlc org own <team>","sdlc org bind <slot> <team>/<function>... --reason <text>","sdlc org unbind <slot>"];function uz({project:e,chart:t,names:n,edit:a}){if(e.team===null){const i=e.roots.map(n.team);return s.jsx(Qa,{id:"org-chart-project",title:"This project",description:i.length?`This org has several root teams (${i.join(", ")}), so no team owns this repository's project yet and its slots are not bound. Name the owning team:`:"This org has no team yet, so no team owns this repository's project. Start one:",children:s.jsx("div",{className:"max-w-2xl",children:s.jsx(ir,{children:i.length?Df[0]:"sdlc org add team <key>"})})})}const l=Ok(t),r=[...e.slots].sort((i,o)=>Tu[i.status]-Tu[o.status]||n.slot(i.slot).localeCompare(n.slot(o.slot)));return s.jsxs(Qa,{id:"org-chart-project",title:"This project",description:cz,children:[s.jsxs("div",{className:"flex flex-wrap items-baseline gap-2",children:[s.jsx("span",{className:"text-muted-foreground text-xs",children:"Owning team"}),s.jsx("span",{className:"text-sm font-medium",children:n.team(e.team)})]}),s.jsx(xt,{className:"mt-3 overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Slots in this project",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:[r.map(i=>{const o=Ru[i.status];return s.jsxs(ue,{"data-testid":"org-chart-project-slot",children:[s.jsxs(P,{children:[s.jsx("div",{className:"font-medium",children:n.slot(i.slot)}),l.has(i.slot)?s.jsx("div",{className:"text-muted-foreground text-xs",children:l.get(i.slot)}):null]}),s.jsx(P,{children:s.jsx(he,{variant:o.tone,children:o.label})}),s.jsx(P,{children:s.jsx(dz,{binding:i,names:n})}),s.jsx(P,{children:s.jsx(fz,{binding:i})}),a?s.jsx(P,{className:"text-right",children:s.jsx(q,{type:"button",variant:"ghost",size:"control-icon","aria-label":i.source==="override"?`Edit the override of ${n.slot(i.slot)}`:`Override ${n.slot(i.slot)}`,onClick:()=>a.override(i.slot),children:s.jsx(ed,{className:"size-3.5","aria-hidden":"true"})})}):null]},i.slot)}),r.length===0?s.jsx(ue,{children:s.jsx(P,{colSpan:a?5:4,className:"text-muted-foreground h-24 text-center",children:"This org has no slots yet."})}):null]})]})}),a?s.jsxs("div",{className:"mt-3 grid max-w-2xl gap-2",children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Overrides made here are made as ",s.jsx("span",{className:"font-mono",children:"person:user"}),", as sdlc org makes them without --as: that person must hold the lead post of the owning team or of a team above it."]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Change the owning team with sdlc org:"}),s.jsx(ir,{children:Df[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:"}),Df.map(i=>s.jsx(ir,{children:i},i))]})]})}function dz({binding:e,names:t}){const n=[];e.status==="covered"&&e.needs_person&&n.push("Needs a person");for(const l of e.posts)l.off_description&&n.push(`${t.post(l.post)} does not fill ${t.slot(e.slot)} in its job description`);e.stale_posts&&n.push(e.stale_posts===1?"One post this override names is no longer in the org":`${e.stale_posts} posts this override names are no longer in the org`);let a;return e.posts.length===0?a=e.source==="override"?"The override names no post the org still has":"No job function fills this slot":e.status==="vacant"?a=`${e.posts.map(l=>t.post(l.post)).join(", ")} has no holder`:a=e.posts.map(l=>l.holders.length?`${t.post(l.post)}: ${l.holders.map(t.member).join(", ")}`:`${t.post(l.post)}: no holder`).join("; "),s.jsxs(s.Fragment,{children:[a,n.map(l=>s.jsx("div",{className:"text-muted-foreground text-xs",children:l},l))]})}function fz({binding:e}){var a;if(e.source==="baseline")return s.jsx(s.Fragment,{children:"From job descriptions"});const t=(a=e.set_by)==null?void 0:a.split(":").slice(1).join(":"),n=[e.reason,[t,e.set_at?An(e.set_at):null].filter(Boolean).join(", ")].filter(Boolean).join(" · ");return s.jsxs(s.Fragment,{children:["Override",n?s.jsx("div",{className:"text-muted-foreground text-xs",children:n}):null]})}const hz={breaking:"Breaking",new:"New",improved:"Improved",other:"Other changes"},mz=["breaking","new","improved","other"],pz={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 $k(e){return pz[e]??e.replace(/_/g," ")}function xz(e){return e.bump==="major"?"breaking":e.change==="added"?"new":e.change==="changed"?"improved":"other"}function no(e){const t=new Map;let n=0,a=0;for(const r of e){if(r.modeling_only){a+=1;continue}if(!r.bump){n+=1;continue}const i=xz(r);t.set(i,[...t.get(i)??[],r])}return{sections:mz.filter(r=>t.has(r)).map(r=>({key:r,label:hz[r],lines:t.get(r)})),breaking:t.has("breaking"),unlisted_count:n,modeling_only_count:a}}function gz(e,t){const n=[`## ${e}`];t.sections.length===0&&n.push("","No change affects the version.");for(const a of t.sections){n.push("",`### ${a.label}`,"");for(const l of a.lines){const r=l.why?`: ${l.why}`:"";n.push(`- ${l.label} (${$k(l.node_type)})${r}`)}}return`${n.join(`
|
|
386
|
-
`)}
|
|
387
|
-
`}const zs="candidate";function ix(e){return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}const vz="Versioned records of this project's release branch, with notes from its graph changes.";function Dk({description:e=vz,actions:t}){return s.jsx(Ft,{title:"Releases",description:e,actions:t})}function zk(e){var r;if(!e)return"";const t=(r=e.previous_release)==null?void 0:r.version,n=Number(e.version.split("-rc.")[1]??0),a=e.commits_since??n,l=`${e.commits_since===null?"At least ":""}${a} commit${a===1?"":"s"}`;return t?`${l} since ${t}`:`${l} before the first Release`}function $c({active:e,onClick:t,version:n,badges:a,caption:l,item_ref:r}){return s.jsxs("button",{ref:r,type:"button","aria-current":e?"true":void 0,onClick:t,className:ie("focus-visible:ring-ring flex flex-col gap-0.5 rounded-md px-3 py-2 text-left outline-none focus-visible:ring-2",e?"bg-muted":"hover:bg-muted/60"),children:[s.jsxs("span",{className:"flex min-w-0 items-center gap-2 text-sm font-medium",children:[s.jsx("span",{className:"truncate",children:n}),a]}),s.jsx("span",{className:"text-muted-foreground text-xs",children:l})]})}function Tn({children:e}){return s.jsx("section",{className:"border-border flex flex-col gap-4 rounded-xl border p-4",children:e})}function Mn({title:e,error:t,onRetry:n}){return s.jsxs(me,{variant:"destructive",children:[s.jsx(en,{}),e?s.jsx(ve,{children:e}):null,s.jsxs(pe,{className:"flex flex-col items-start gap-2",children:[t,n?s.jsx(q,{variant:"outline",size:"sm",onClick:n,children:"Try again"}):null]})]})}function yz({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(Ju,{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 Eu({changes:e}){const t=u.useMemo(()=>no(e),[e]),[n,a]=u.useState(!1),l=t.unlisted_count+t.modeling_only_count;return s.jsxs("div",{className:"flex flex-col gap-4",children:[t.sections.map(r=>{const i=s.jsx("ul",{className:"flex flex-col gap-2",children:r.lines.map(o=>s.jsx($v,{line:o},`${o.node_id}:${o.change}`))});return r.key==="breaking"?s.jsxs(me,{variant:"destructive",className:"border-destructive/40",children:[s.jsx(en,{}),s.jsx(ve,{children:s.jsx("h3",{className:"text-destructive text-sm font-semibold",children:r.label})}),s.jsx(pe,{className:"text-foreground",children:i})]},r.key):s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:r.label}),i]},r.key)}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Fixed"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Fixes that changed no part of the graph are not recorded yet; they arrive with landing notes."})]}),t.sections.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No change affects the version."}):null,l>0?s.jsxs("p",{className:"text-muted-foreground text-sm",children:[l," more change",l===1?"":"s"," do",l===1?"es":""," not affect the version."]}):null,e.length>0?s.jsx(q,{variant:"link",size:"sm",className:"self-start px-0","aria-expanded":n,onClick:()=>a(r=>!r),children:n?"Hide all changes":"Show all changes"}):null,n?s.jsx("ul",{className:"flex flex-col gap-2",children:e.map(r=>s.jsx($v,{line:r,detail:!0},`all:${r.node_id}:${r.change}:${r.modeling_only}`))}):null]})}function $v({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(he,{variant:"outline",children:$k(e.node_type)})]}),n?s.jsx("span",{className:"text-muted-foreground text-xs",children:n}):null]})}const Lk="Releases of this checkout: the roadmap of open Planned Releases, the next candidate, and each production release with its notes.",Dv=5,um="Not available",dm="planned:";function Uk(){const e=as();return s.jsx("p",{className:"text-muted-foreground text-sm",children:`${um}. ${e}`})}const Jn=e=>`${dm}${e}`,jz=e=>e!=null&&e.startsWith(dm)?e.slice(dm.length):null,ox=e=>e?e.slice(0,7):"";function _z(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 wz(){return s.jsxs(me,{variant:"info",children:[s.jsx(Ua,{}),s.jsx(ve,{children:"This page only reads Releases"}),s.jsx(pe,{className:"text-info",children:"A Release is written when production runs a release candidate, once its commit is merged into origin/main."})]})}function Nz(e){if(e.state==="unreadable")return{badges:s.jsx(he,{variant:"error",children:"Could not be read"}),caption:""};if(e.state==="withdrawn")return{badges:s.jsx(he,{variant:"warning",children:"Withdrawn"}),caption:e.replaced_by?`Replaced by ${e.replaced_by}`:"Withdrawn"};const t=s.jsxs(s.Fragment,{children:[s.jsx(he,{variant:"neutral",children:e.app_changed===!1?"App unchanged":e.previous_release_id?e.bump??"patch":"First"}),e.breaking?s.jsx(he,{variant:"error",children:"Breaking"}):null]}),n=e.written_at?ix(e.written_at):"",a=e.tracks&&e.tracks.length>0?` · ${e.tracks.join(", ")}`:"";return{badges:t,caption:`${n}${a}`}}function al({query:e,select:t,onSelect:n,children:a,inline:l=!1}){return s.jsx("a",{href:`?${e}`,className:l?"text-primary underline":"text-primary hover:underline",onClick:r=>{r.preventDefault(),n(t)},children:a})}function Cd({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 ys=({children:e})=>s.jsx("code",{className:"font-mono text-xs",children:e});function Bk(e,t){if(e.judged_commit&&t&&e.judged_commit!==t)return`Judged ${ox(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 Rd({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 kz={ready:"success",verifying:"info",fixing:"warning",abandoned:"warning",ready_older:"neutral",none:"neutral",unknown:"neutral"};function Sz({batch:e}){if(e.state==="loading")return s.jsxs(me,{children:[s.jsx(mu,{}),s.jsxs(pe,{className:"flex flex-row items-center gap-2",role:"status",children:[s.jsx(vn,{"aria-hidden":!0})," Reading the release batch…"]})]});const t=e.state==="ready"?e.value:{state:"unknown",chip:"Batch unknown",text:`The release batch could not be read: ${e.error}`,help:null};return s.jsxs(me,{children:[s.jsx(mu,{}),s.jsxs(ve,{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{children:t.text}),s.jsx(he,{variant:kz[t.state],children:t.chip})]}),t.help?s.jsx(pe,{children:t.help}):null]})}function Cz(e,t,n){return`/org/${e}/issues/${encodeURIComponent(t)}?from=${encodeURIComponent(n)}`}function Hk({issues:e,error:t}){return t?s.jsx(Mn,{title:"Known issues could not be read",error:t}):!e||e.length===0?null:s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(Rd,{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(ys,{children:n.file}):null]},n.key))})]})}function Ik({tracks:e,error:t}){return t?s.jsx(Mn,{title:"Tracks could not be read",error:t}):!e||e.length===0||e.length===1&&e[0].key==="app"?null:s.jsxs("section",{className:"flex flex-col gap-3",children:[s.jsx(Rd,{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(ys,{children:n.version}):null,n.bump?s.jsx(he,{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(ys,{children:a.name}),s.jsxs(ys,{children:[a.from??"—"," → ",a.to??"—"]})]}),a.changes.map((l,r)=>s.jsxs("span",{className:"text-muted-foreground text-xs",children:[l.feature,": ",l.entry]},r))]},a.name))}),n.published&&!n.published.recorded?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[n.released_by??"Publish",": Not available. This Release does not say whether or when it moved latest."]}):null]},n.key))]})}function Pk({delivery:e,candidate:t,onSelect:n}){if(!e||e.planned.length===0&&e.outside===0)return null;const a=l=>l.length===0?"—":l.map(r=>r.went?`${r.label} (${r.went})`:r.label).join(", ");return s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(Rd,{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(Be,{containerAriaLabel:"Planned Releases",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Planned Release"}),s.jsx(F,{children:"Delivered"}),s.jsx(F,{children:"Not delivered"})]})}),s.jsx(He,{children:e.planned.map(l=>s.jsxs(ue,{children:[s.jsx(P,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.open&&t?s.jsx(al,{query:`planned=${encodeURIComponent(l.id)}`,select:Jn(l.id),onSelect:n,children:l.name}):s.jsx("span",{children:l.name}),s.jsx(ys,{children:l.id})]})}),s.jsx(P,{children:a(l.delivered)}),s.jsx(P,{children:a(l.not_delivered)})]},l.id))})]})}):null,e.outside>0?s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.outside," landing",e.outside===1?"":"s"," served no Planned Release."]}):null]})}const Rz={thread:"Thread",task:"Task",issue:"Issue",test:"Test"};function qk({rows:e,org:t,from:n,untasked:a}){const{href:l,Link:r}=Ve(),[i,o]=u.useState(!1),c=i?e:e.slice(0,Dv),d=f=>f.kind==="task"?s.jsx(r,{className:"text-primary font-mono text-xs hover:underline",href:l(`/org/${t}/tasks/${encodeURIComponent(f.id)}?from=${encodeURIComponent(n)}`),children:f.id}):f.kind==="issue"?s.jsx(r,{className:"text-primary font-mono text-xs hover:underline",href:l(Cz(t,f.id,n)),children:f.id}):f.kind==="thread"?s.jsx(r,{className:"text-primary hover:underline",href:l(`${t?`/org/${t}`:""}/threads#thread-${encodeURIComponent(f.id)}`),children:f.label}):f.kind==="test"&&f.url?s.jsx("a",{className:"text-primary hover:underline",href:f.url,target:"_blank",rel:"noreferrer",children:f.label}):s.jsx("span",{children:f.label});return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Related",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Kind"}),s.jsx(F,{children:"Item"}),s.jsx(F,{children:"How it relates"})]})}),s.jsx(He,{children:c.map(f=>s.jsxs(ue,{children:[s.jsx(P,{children:Rz[f.kind]}),s.jsx(P,{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(P,{children:f.relation})]},`${f.kind}:${f.id}`))})]})}),e.length>Dv?s.jsx(q,{variant:"link",size:"sm",className:"self-start px-0","aria-expanded":i,onClick:()=>o(f=>!f),children:i?"Show fewer":`Show all ${e.length}`}):null,a?s.jsxs("p",{className:"text-muted-foreground text-xs",children:[a," landing",a===1?"":"s"," not tied to a task"]}):null]})}const Gk=e=>(e==null?void 0:e.status)===409&&e.reason==="view_outdated";function Vk(e){const t=cx(),[n,a]=u.useState(t!=null&&t.related?{state:"loading"}:null),l=u.useRef(0),r=u.useCallback(async(i=!1)=>{if(!(t!=null&&t.related))return;const o=++l.current;a({state:"loading"});const c=await t.related(e,i?{fresh:!0}:void 0);o===l.current&&a(c.ok?{state:"ready",value:c.data}:{state:"error",error:c.refusal.message,refusal:c.refusal})},[t,e]);return u.useEffect(()=>{r()},[r]),{related:n,read:r}}function Yk({related:e,org:t,from:n,onRetry:a}){const l=u.useRef(null),r=u.useRef(!1);if(u.useEffect(()=>{var o;r.current&&(e==null?void 0:e.state)!=="loading"&&(r.current=!1,(o=l.current)==null||o.focus())},[e]),!e)return null;const i=e.state==="ready"?e.value.rows.length:void 0;return s.jsxs("section",{className:"flex flex-col gap-2","aria-labelledby":"release-related",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h2",{id:"release-related",ref:l,tabIndex:-1,className:"text-lg font-semibold outline-none",children:"Related"}),i!==void 0?s.jsx("span",{className:"text-muted-foreground text-xs",children:i}):null]}),e.state==="loading"?s.jsxs("div",{className:"grid gap-2",role:"status","aria-label":"Loading related work",children:[s.jsx(pt,{className:"h-8 w-full"}),s.jsx(pt,{className:"h-8 w-full"}),s.jsx(pt,{className:"h-8 w-2/3"})]}):e.state==="error"?Gk(e.refusal)?s.jsx(Uk,{}):s.jsx(Mn,{title:"Related work could not be read",error:e.error,onRetry:()=>{r.current=!0,a()}}):e.value.rows.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Nothing related yet."}):s.jsx(qk,{rows:e.value.rows,org:t,from:n,untasked:e.value.untasked})]})}function Tz(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 Fk({planned:e,onSelect:t}){return e?e.open?s.jsx(al,{query:`planned=${encodeURIComponent(e.id)}`,select:Jn(e.id),onSelect:t,children:e.name}):s.jsxs("span",{children:[e.name," ",s.jsx(ys,{children:e.id})]}):null}function Ez({candidate:e,org:t,onSelect:n,notes:a}){const l=cx(),{related:r,read:i}=Vk("candidate"),[o,c]=u.useState(l!=null&&l.candidateBatch?{state:"loading"}:null);u.useEffect(()=>{if(!(l!=null&&l.candidateBatch))return;let f=!0;return l.candidateBatch().then(h=>{f&&(h.ok?c(h.data.batch===null?null:{state:"ready",value:h.data.batch}):c({state:"error",error:h.refusal.message}))}),()=>{f=!1}},[l]);const d=e.readiness??((r==null?void 0:r.state)==="ready"?r.value.readiness:null)??null;return s.jsxs(s.Fragment,{children:[s.jsx(Cd,{pairs:[["Environment",e.environment??"staging"],["Commit",s.jsx(ys,{children:ox(e.head_commit_id)},"commit")],["Readiness",d?Bk(d,e.head_commit_id):null],["Planned",e.planned_release?s.jsx(Fk,{planned:e.planned_release,onSelect:n}):null]]}),o?s.jsx(Sz,{batch:o}):null,a,s.jsx(Hk,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(Ik,{tracks:e.tracks,error:e.tracks_error}),s.jsx(Pk,{delivery:e.planned_delivery,candidate:!0,onSelect:n}),s.jsx(Yk,{related:r,org:t,from:"release:candidate",onRetry:()=>i(!0)})]})}function Az({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(he,{variant:"warning",children:"Withdrawn"}):s.jsx(he,{variant:"neutral",children:e.app_changed===!1?"App unchanged":a?"First":e.bump}),e.breaking?s.jsx(he,{variant:"error",children:"Breaking"}):null]}),e.state==="withdrawn"&&e.replaced_by?s.jsxs("p",{className:"text-sm",children:["Replaced by"," ",s.jsx(al,{query:`release=${encodeURIComponent(e.replaced_by)}`,select:e.replaced_by,onSelect:t,inline:!0,children:e.replaced_by})]}):null]})}function Mz({release:e,org:t,onSelect:n,notes:a}){const l=e.label??e.version,{related:r,read:i}=Vk(l),o=(r==null?void 0:r.state)==="ready"?Tz(r.value.previews):null;return s.jsxs(s.Fragment,{children:[s.jsx(Cd,{pairs:[["Environment",e.environment??"production"],["Commit",e.commit?s.jsx(ys,{children:ox(e.commit)},"commit"):null],["Readiness",e.readiness?`${Bk(e.readiness)} on staging`:null],["Previews",o],["Planned",e.planned_release?s.jsx(Fk,{planned:e.planned_release,onSelect:n}):null]]}),a,s.jsx(Hk,{issues:e.known_issues,error:e.known_issues_error}),s.jsx(Ik,{tracks:e.tracks,error:e.tracks_error}),s.jsx(Pk,{delivery:e.planned_delivery,candidate:!1,onSelect:n}),s.jsx(Yk,{related:r,org:t,from:`release:${l}`,onRetry:()=>i(!0)})]})}function Oz({id:e,summary:t,org:n,onNotFound:a,forecast:l}){var x,j;const r=cx(),[i,o]=u.useState({state:"loading"}),c=u.useRef(0),d=u.useCallback(async(v=!1)=>{const y=++c.current;if(!(r!=null&&r.plannedRelease)){o({state:"error",error:um,refusal:{status:409,message:um,reason:"view_outdated"}});return}o({state:"loading"});const g=await r.plannedRelease(e,v?{fresh:!0}:void 0);y===c.current&&o(g.ok?{state:"ready",value:g.data}:{state:"error",error:g.refusal.message,refusal:g.refusal})},[r,e]);u.useEffect(()=>{d()},[d]);const f=i.state==="error"&&(((x=i.refusal)==null?void 0:x.status)===404||((j=i.refusal)==null?void 0:j.reason)==="not_found");if(u.useEffect(()=>{f&&a()},[f,a]),i.state==="loading")return s.jsxs(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(he,{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}),Gk(i.refusal)?s.jsx(Uk,{}):f?null:s.jsx(Mn,{error:i.error,onRetry:()=>void d(!0)})]});const h=i.value,m=h.order===null?null:h.order===1?`Next of ${h.open} open`:`${h.order} of ${h.open} open`;return s.jsxs(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(he,{variant:"neutral",children:"Planned"})]}),h.goal?s.jsx("p",{className:"text-muted-foreground text-sm",children:h.goal}):null]}),s.jsx(Cd,{pairs:[["Planned Release",s.jsx(ys,{children:h.id},"id")],["Date",h.date],["Order",m],["Members",String(h.members.length)]]}),l,s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("p",{className:"text-muted-foreground text-xs",children:"A Planned Release changes through release_plan.py:"}),s.jsxs("pre",{className:"bg-muted rounded-md px-3 py-2 font-mono text-xs",children:["sdlc view --planned ",h.id]})]}),s.jsxs("section",{className:"flex flex-col gap-2",children:[s.jsx(Rd,{title:"Members",count:h.members.length}),h.members.length>0?s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Members",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Member"}),s.jsx(F,{children:"Level"}),s.jsx(F,{children:"Tasks"}),s.jsx(F,{children:"State"})]})}),s.jsx(He,{children:h.members.map(v=>{const y=v.tasks.filter(p=>p.state==="done").length,g=v.tasks.filter(p=>p.state!=="done").map(p=>p.id);return s.jsxs(ue,{children:[s.jsx(P,{children:v.label}),s.jsx(P,{children:v.level?s.jsx(he,{variant:"neutral",children:$z(v.level)}):null}),s.jsx(P,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[v.tasks.length>0?s.jsxs("span",{children:[y," of ",v.tasks.length," done"]}):null,g.length>0?s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Open: ",s.jsx(ys,{children:g.join(", ")})]}):null,v.untracked>0?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[v.untracked," slice",v.untracked===1?" has":"s have"," no task yet"]}):null]})}),s.jsx(P,{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(qk,{rows:h.related,org:n,from:`planned:${h.id}`})]})]})}const $z=e=>e.charAt(0).toUpperCase()+e.slice(1);function cx(){return nn().releases}const Xn={noRelease:"No open Planned Release. Create one: release_plan.py create --name <version>",noTask:"no open task of yours",noNext:"none",pending:"reading the roadmap",failedLead:"The roadmap could not be read",noEngineLead:"this engine has no roadmap read"},zv=3,Dz=["in_progress","not_started","planned","blocked"],ux="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),bt=e=>e.charAt(0).toUpperCase()+e.slice(1);function zf(e){const t=/^(\d{4})-(\d{2})-(\d{2})/.exec(String(e??""));return t?`${Number(t[3])} ${ux[Number(t[2])-1]}`:String(e??"")}function Xk(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${ux[t.getMonth()]} ${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function zz(e){if(typeof e!="number")return"";const t=new Date(e*1e3);return Number.isNaN(t.getTime())?"":`${t.getDate()} ${ux[t.getMonth()]}`}function Ls(e){return e?e.from===e.to&&e.or_later?`${zf(e.from)} or later`:`${zf(e.from)} to ${zf(e.to)}${e.or_later?", or later":""}`:""}function Lz(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 Kk(e){var h;const t=e??{},n=t.source??{},l=[t.no_date==="no date: no rate"&&n.rate_why?n.rate_why:"",/members estimated$/.test(t.no_date??"")?"":Lz(t)].filter(Boolean).join(" · "),r=t.projected?Ls(t.projected):t.no_date??"",i=(h=t.projected)==null?void 0:h.raw,o=!!(i&&t.projected&&(i.from!==t.projected.from||i.to!==t.projected.to)),c=t.projected?n.rate_basis==="release"?"at this release's own rate":n.rate_basis==="machine"?`at the machine's rate${n.rate_why?`: ${n.rate_why}`:""}`:"":"",d=t.track_record,f=[l,c,o&&i&&t.projected?`corrected for past estimates: raw ${Ls({...i,or_later:t.projected.or_later})}`:"",d?`past forecasts at this coverage: ${d.inside} of ${d.of} inside their range`:""].filter(Boolean);return{lead:r?bt(r):"",caption:f}}function Uz(e){const t=e.kinds??[];return[t.includes("range")?"Not promised":"",e.goal??(t.includes("major")?"No goal yet":"")].filter(Boolean).join(" · ")}function Bz(e){var c,d,f,h;const t=((c=e.counts)==null?void 0:c.members)??0,n=`${((d=e.counts)==null?void 0:d.done)??0} of ${t} member${t===1?"":"s"} done`,a=(e.blocked??[]).length,l=(e.needs_user??[]).length,r=!a&&!l?["none blocked · none waiting on you"]:[a?`${a} blocked`:"",l?`${l} waiting on you`:""],i=((f=e.tasks)==null?void 0:f.untracked_slices)??0;i&&r.push(`${i} slice${i===1?"":"s"} not tasks yet`);const o=((h=e.not_a_member)==null?void 0:h.count)??0;return o&&r.push(`${o} not a member yet`),{lead:n,rest:r.filter(Boolean).join(" · ")}}const Qk=e=>String(e??"").replace(/_/g," ");function Hz(e){const t=e??{},n=t.kinds??[],a=n.includes("slipped"),l=!a&&t.was&&t.now?Ls(t.was)===Ls(t.now)?`, range still ${Ls(t.now)}`:`, range was ${Ls(t.was)}, now ${Ls(t.now)}`:"",r=[a&&t.was?`was ${Ls(t.was)}`:"",n.includes("scope changed")?`scope changed${l}`:""].filter(Boolean),i=(t.what??[]).slice(-3).map(o=>{const c=o.by&&(o.by.title||o.by.thread||o.by.person);return`${[o.kind,o.label||o.item].filter(Boolean).join(" ")}${c?` by ${c}`:""}${o.why?`: ${o.why}`:""}`});return{head:r.length?bt(r.join(" · ")):"",what:i}}const or="roadmap",Lv={reading:!1,value:null,refusal:null};function Iz(e){const[t,n]=u.useState({all:Lv,mine:Lv}),a=u.useRef({all:0,mine:0}),l=u.useCallback(async(r,i=!1)=>{if(!(e!=null&&e.roadmap))return;const o=++a.current[r];n(d=>({...d,[r]:{...d[r],reading:!0}}));const c=await e.roadmap({...i?{fresh:!0}:{},...r==="mine"?{mine:!0}:{}});o===a.current[r]&&n(d=>({...d,[r]:c.ok?{reading:!1,value:c.data,refusal:null}:{reading:!1,value:d[r].value,refusal:c.refusal}}))},[e]);return{reads:t,read:l,available:!!(e!=null&&e.roadmap)}}function Pz(e,t){return`${e} open${t.length?` · ${t.join(", ")} moved since you looked`:""}`}function Mi({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 Zk=({level:e})=>e?s.jsx(he,{variant:"neutral",children:bt(e)}):null;function Wk({state:e}){const t=bt(Qk(e));return Dz.includes(String(e))?s.jsx("span",{className:"font-medium",children:t}):s.jsx("span",{children:t})}function qz({reads:e,scope:t,onScope:n,onRead:a,org:l,onSelect:r}){var x,j;const i=e[t],o=i.value,c=as(),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 ${Xk(o.as_of)}`:"",`${((x=o.source)==null?void 0:x.machine)||"this machine"}'s records`,((j=o.decider)==null?void 0:j.words)??""].filter(Boolean).join(" · "):"";return s.jsxs(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(q,{variant:"outline",size:"sm","aria-pressed":t===v,onClick:()=>n(v),children:v==="all"?"All":"Mine"},v))})]}),s.jsx("div",{"aria-live":"polite",children:i.reading?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status",children:[s.jsx(vn,{"aria-hidden":!0,className:"size-4"})," ",bt(Xn.pending),"…"]}):null}),i.refusal&&!i.reading?i.refusal.reason==="no_roadmap"?s.jsx(Mn,{title:Xn.failedLead,error:`${bt(Xn.noEngineLead)}. ${c}`}):i.refusal.reason==="refused"?s.jsx(Mn,{title:Xn.failedLead,error:i.refusal.message}):s.jsx(Mn,{title:Xn.failedLead,error:i.refusal.message,onRetry:h}):null,o?t==="mine"?s.jsx(Qz,{mine:o.mine,org:l,onSelect:r}):s.jsx(Vz,{read:o,org:l,onSelect:r}):null]})}function Gz(e){if(!e||typeof e.seconds_per_day!="number")return"No rate";const t=zz(e.as_of);return`${Math.round(e.seconds_per_day/3600)} task hours a day over the ${e.days} days${t?` to ${t}`:""}`}function Vz({read:e,org:t,onSelect:n}){var l,r;const a=e.releases??[];if(!a.length){const[i,o]=Xn.noRelease.split(" Create one: ");return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("p",{className:"text-sm",children:i}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Create one in the terminal:"}),s.jsx(Mi,{children:o})]})}return s.jsxs(s.Fragment,{children:[s.jsx(Cd,{pairs:[["Forecast from",bt(`${((l=e.source)==null?void 0:l.machine)||"this machine"}'s task records and rate`)],["Rate",Gz(e.rate)],["Not counted",bt(((r=e.source)==null?void 0:r.not_counted)||"other machines' work")]]}),a.map(i=>s.jsx(Yz,{row:i,org:t,onSelect:n},i.id))]})}function Yz({row:e,org:t,onSelect:n}){var h,m,x;const a=Kk(e.forecast),l=Bz(e),r=Uz(e),i=`roadmap-${e.id}`,o=e.moved?Hz(e.told):null,c=(((h=e.counts)==null?void 0:h.members)??0)===0,d=((m=e.not_a_member)==null?void 0:m.count)??0,f=[r,c&&d?`${d} not a member yet`:""].filter(Boolean).join(" · ");return s.jsxs("section",{"aria-labelledby":i,className:"flex flex-col gap-2 border-t pt-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{id:i,className:"text-base font-semibold",children:s.jsx(al,{query:`planned=${encodeURIComponent(e.id)}`,select:Jn(e.id),onSelect:n,children:e.name})}),e.kinds.map(j=>s.jsx(he,{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:bt(a.caption.join(" · "))}):null]}):null,f?s.jsx("p",{className:"text-muted-foreground text-sm",children:f}):null,o?s.jsxs(me,{variant:"info",children:[s.jsx(mR,{"aria-hidden":!0}),s.jsx(ve,{children:"Moved since you looked"}),s.jsxs(pe,{className:"text-info flex flex-col gap-0.5",children:[o.head?s.jsx("span",{children:o.head}):null,o.what.map((j,v)=>s.jsx("span",{className:"text-xs",children:j},v))]})]}):null,c?null:s.jsxs("p",{className:"text-sm",children:[l.lead,l.rest?s.jsxs("span",{className:"text-muted-foreground",children:[" · ",l.rest]}):null]}),(x=e.stale_unchecked)!=null&&x.words?s.jsx("p",{className:"text-muted-foreground text-xs",children:bt(e.stale_unchecked.words)}):null,e.for_you&&e.kinds.includes("major")?s.jsx(Fz,{row:e}):null,s.jsx(Kz,{row:e,org:t})]})}function Fz({row:e}){const t=e.for_you;return!t||!t.proposals.length&&!t.committed_nobody_on.length&&!t.widens_most&&!t.set_goal?null:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h4",{className:"text-sm font-semibold",children:"For you"}),t.proposals.map(a=>{const l=[a.proposed_by_title||a.proposed_by?`by ${a.proposed_by_title||a.proposed_by}`:"",a.reason??""].filter(Boolean).join(": ");return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("p",{className:"text-sm",children:["Proposed: ",a.label||a.item]}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[l?`${bt(l).replace(/\.$/,"")}. `:"","Accept or reject in the terminal:"]}),s.jsx(Mi,{children:a.accept}),s.jsx(Mi,{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(Mi,{children:t.set_goal})]}):null]})}function Jk({next:e,org:t}){const{href:n,Link:a}=Ve(),l=e.tasks[0],r=e.label||e.item;return l?s.jsx(a,{className:"text-primary hover:underline",href:n(`/org/${t}/tasks/${encodeURIComponent(l.id)}?from=roadmap`),children:r}):s.jsx("span",{children:r})}function Xz(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?bt(e.nobody):""}function Kz({row:e,org:t}){const[n,a]=u.useState(!1),l=e.next??[];if(!l.length){const o=e.kinds.includes("range")?e.tagged_threads??[]:[];return o.length?s.jsx("p",{className:"text-muted-foreground text-sm",children:o.map(c=>`${c.title}: ${c.words}`).join(", ")}):null}const r=n?l:l.slice(0,zv),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(Be,{containerAriaLabel:`Next in ${e.name}`,children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:r.map(o=>{const c=i.get(o.item);return s.jsxs(ue,{children:[s.jsx(P,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(Jk,{next:o,org:t}),c?s.jsxs("span",{className:"text-muted-foreground text-xs",children:[bt(c.words),c.estimate_as_of?` (estimated ${Xk(c.estimate_as_of)})`:""]}):null]})}),s.jsx(P,{children:s.jsx(Zk,{level:o.level})}),s.jsx(P,{children:s.jsx(Wk,{state:o.state})}),s.jsx(P,{children:Xz(o,e)})]},o.item)})})]})}),l.length>zv&&!n?s.jsxs(q,{variant:"outline",size:"sm",className:"self-start",onClick:()=>a(!0),children:["Show all ",l.length]}):null,r.some(o=>i.has(o.item))?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Re-forecast it in the terminal: task-record reforecast"}):null]})}function Qz({mine:e,org:t,onSelect:n}){const{href:a,Link:l}=Ve();if(!e)return null;const r=e.tasks.filter(i=>i.propose);return s.jsxs(s.Fragment,{children:[s.jsxs("section",{"aria-labelledby":"roadmap-your-work",className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-baseline gap-2",children:[s.jsx("h3",{id:"roadmap-your-work",className:"text-base font-semibold",children:"Your work"}),s.jsx("span",{className:"text-muted-foreground text-xs",children:e.title})]}),e.tasks.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:bt(Xn.noTask)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Your work",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Task"}),s.jsx(F,{children:"Release"}),s.jsx(F,{children:"Member"})]})}),s.jsx(He,{children:e.tasks.map(i=>{var o,c;return s.jsxs(ue,{children:[s.jsx(P,{children:s.jsxs("div",{className:"flex flex-col gap-0.5",children:[s.jsx(l,{className:"text-primary font-mono text-xs hover:underline",href:a(`/org/${t}/tasks/${encodeURIComponent(i.id)}?from=roadmap`),children:i.id}),s.jsx("span",{className:"text-muted-foreground text-xs",children:[i.title||i.thread,bt(Qk(i.state))].filter(Boolean).join(" · ")})]})}),s.jsx(P,{children:(o=i.members)!=null&&o.length?i.members.map(d=>s.jsx("div",{children:s.jsx(al,{query:`planned=${encodeURIComponent(d.planned_release)}`,select:Jn(d.planned_release),onSelect:n,children:d.name})},d.planned_release)):i.release?s.jsx(al,{query:`planned=${encodeURIComponent(i.release.planned_release)}`,select:Jn(i.release.planned_release),onSelect:n,children:i.release.name}):s.jsx("span",{className:"text-muted-foreground",children:i.words?bt(i.words):"—"})}),s.jsx(P,{children:(c=i.members)!=null&&c.length?i.members.map(d=>s.jsx(Zk,{level:d.level},d.planned_release)):i.not_a_member?s.jsx("span",{className:"text-muted-foreground",children:"Not a member yet"}):null})]},i.id)})})]})}),r.map(i=>{var o;return s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Propose ",i.id,"'s plan to ",((o=i.release)==null?void 0:o.name)??"its release"," in the terminal:"]}),s.jsx(Mi,{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:bt(Xn.noNext)}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Your next members",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Release"}),s.jsx(F,{children:"Member"}),s.jsx(F,{children:"State"})]})}),s.jsx(He,{children:e.next.map(i=>s.jsxs(ue,{children:[s.jsx(P,{children:s.jsx(al,{query:`planned=${encodeURIComponent(i.release)}`,select:Jn(i.release),onSelect:n,children:i.name})}),s.jsx(P,{children:s.jsx(Jk,{next:i,org:t})}),s.jsx(P,{children:s.jsx(Wk,{state:i.state})})]},`${i.release}:${i.item}`))})]})})]})]})}function Zz({state:e,id:t}){var r;const n=as();if(!e)return null;const a=(r=e.value)==null?void 0:r.releases.find(i=>i.id===t);if(!a){if(e.reading)return s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status",children:[s.jsx(vn,{"aria-hidden":!0,className:"size-4"})," ",bt(Xn.pending),"…"]});if(e.refusal){const i=e.refusal.reason==="no_roadmap"?`${bt(Xn.noEngineLead)}. ${n}`:e.refusal.message;return s.jsx("p",{className:"text-muted-foreground text-xs",children:`${Xn.failedLead}: ${i}`})}return null}const l=Kk(a.forecast);return s.jsxs("div",{className:"flex flex-col gap-0.5",children:[l.lead?s.jsx("p",{className:"text-sm",children:l.lead}):null,l.caption.length?s.jsx("p",{className:"text-muted-foreground text-xs",children:bt(l.caption.join(" · "))}):null]})}function e1(){const e=nn().releases;if(!e)throw new Error("The Releases page rendered without a Releases contract.");return e}function Wz({initial:e,environments:t,branch_options:n,chooseBranch:a,renderWrite:l,selection:r,org:i,onReadAgain:o,onNotFound:c,notice:d,focusOnMount:f}){var Ts,Pn,qn,Rt,an,is,Gn,ea,z,be;const h=e1(),m=e.local??null,[x,j]=u.useState(e),[v,y]=u.useState(null),g=r?r.selected:v,p=r?r.onSelect:y,b=!!(m||x.release_branch),[_,N]=u.useState(m||e.release_branch?{state:"loading"}:{state:"ready",value:null}),[R,w]=u.useState({}),[k,L]=u.useState(null),[D,K]=u.useState(!1),[G,U]=u.useState(null),[M,A]=u.useState(null),S=u.useRef(null),E=m?{fresh:!0}:void 0,C=u.useCallback(async se=>{const _e=await h.candidate(se);N(_e.ok?{state:"ready",value:_e.data.candidate}:{state:"error",error:_e.refusal.message,refusal:_e.refusal})},[h]),$=u.useCallback(async()=>{N({state:"loading"}),await C(E)},[C,m]),X=u.useCallback(async()=>{const se=await h.list();se.ok&&j(se.data)},[h]),T=((Ts=x.release_branch)==null?void 0:Ts.id)??null;u.useEffect(()=>{if(!m&&!T)return;let se=!1;return h.candidate().then(_e=>{se||N(_e.ok?{state:"ready",value:_e.data.candidate}:{state:"error",error:_e.refusal.message,refusal:_e.refusal})}),()=>{se=!0}},[T,h,m]);const I=u.useRef(new Set),ne=u.useCallback((se,_e)=>w(Es=>({...Es,[se]:_e.ok?{state:"ready",value:_e.data.release}:{state:"error",error:_e.refusal.message,refusal:_e.refusal}})),[]),W=async se=>{w(_e=>({..._e,[se]:{state:"loading"}})),I.current.add(se),ne(se,await h.release(se,E))},xe=_.state!=="ready"||_.value!==null,V=jz(g),O=Iz(m?h:void 0),Y=O.available&&g===or,[ae,H]=u.useState("all"),te=x.release_branch||m?xe?zs:null:((Pn=x.releases[0])==null?void 0:Pn.version)??null,ee=V!==null||Y?null:g===zs?xe?zs:null:g??te,[le,J]=u.useState([]),Qe=u.useRef(0);u.useEffect(()=>{if(!m||!h.roadmapMoved)return;let se=!0;const _e=Qe.current;return h.roadmapMoved().then(Es=>{se&&Es.ok&&_e===Qe.current&&J(Es.data.moved.map(Ga=>Ga.name))}),()=>{se=!1}},[h,m]);const oe=O.reads.all,Oe=O.read;u.useEffect(()=>{V===null||!O.available||!oe.value&&!oe.reading&&!oe.refusal&&Oe("all")},[V,O.available,oe,Oe]);const[Q,Ne]=u.useState(0),ze=u.useRef(0),gt=se=>{se===or&&Ne(_e=>_e+1),p(se)};u.useEffect(()=>{if(Q!==ze.current){if(!Y){ze.current=Q;return}ae!=="all"||oe.reading||!oe.value||!h.roadmapSeen||(ze.current=Q,h.roadmapSeen(oe.value.as_of).then(se=>{se.ok&&(Qe.current+=1,J([]))}))}},[Q,Y,ae,oe,h]);const ye=new Map((((qn=oe.value)==null?void 0:qn.releases)??[]).map(se=>[se.id,[se.kinds.includes("range")?"range":"",se.forecast.projected?Ls(se.forecast.projected):"no date"].filter(Boolean).join(" · ")])),Ct=ee===null||ee===zs||x.releases.some(se=>se.version===ee);u.useEffect(()=>{!m||!c||ee!==null&&ee!==zs&&!Ct&&c({kind:"release",id:ee})},[m,c,ee,Ct]),u.useEffect(()=>{!ee||ee===zs||I.current.has(ee)||m&&!Ct||(I.current.add(ee),h.release(ee).then(se=>ne(ee,se)))},[ee,h,ne,Ct]);const Lt=u.useRef(g),bn=u.useRef(!1),Ss=u.useRef(!!f),jn=u.useRef(null);u.useEffect(()=>{var _e,Es;if(!m)return;if(Ss.current){const Ga=(_e=jn.current)==null?void 0:_e.querySelector('[aria-current="true"]');if(Ga){Ss.current=!1,Lt.current=g,Ga.focus();return}}if(Lt.current!==g&&(Lt.current=g,bn.current=!0),!bn.current)return;const se=(Es=S.current)==null?void 0:Es.querySelector("h2");se&&(bn.current=!1,se.tabIndex=-1,se.focus())});const sn=async se=>{if(!a)return;L(null);const _e=await a(se);if(!_e.ok){L(_e.error);return}y(null),N({state:"loading"}),await X()},Cs=async()=>{if(!x.next_before)return;A(null);const se=await h.list({before:x.next_before});if(!se.ok){A(se.refusal.message);return}j(_e=>({...se.data,releases:[..._e.releases,...se.data.releases]}))},Rs=x.release_branch?s.jsx(eL,{value:x.release_branch.id,label:x.release_branch.name,options:n??[],can_write:x.can_write,onChange:sn}):null,re=m?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-muted-foreground text-xs",children:["Read at ",Jz(m.read_at)]}),o?s.jsxs(q,{variant:"ghost",size:"sm",onClick:o,children:[s.jsx(yl,{className:"mr-1 size-4","aria-hidden":!0}),"Read again"]}):null]}):Rs,De=m?_z(((Rt=x.releases[0])==null?void 0:Rt.label)??((an=x.releases[0])==null?void 0:an.version)??null):bz(((is=x.releases[0])==null?void 0:is.version)??null,((Gn=x.release_branch)==null?void 0:Gn.name)??null),Ce={org:i??""};return s.jsxs(s.Fragment,{children:[s.jsx(Dk,{description:m?Lk:void 0,actions:re}),d,m?s.jsx(wz,{}):null,k?s.jsx(Mn,{error:k}):null,m?null:t,!m&&!x.release_branch?s.jsx(tL,{can_write:x.can_write,options:n??[],onChoose:sn}):null,x.release_branch||x.releases.length>0||m?s.jsxs("div",{ref:jn,className:"flex flex-col gap-6 md:flex-row md:items-start",children:[s.jsx(nL,{list:x,candidate:b?_:null,shown:Y?or:V!==null?Jn(V):ee,onSelect:gt,roadmap:O.available?Pz(((ea=x.planned)==null?void 0:ea.length)??0,le):null,planned_ranges:ye,can_load_older:!!x.next_before,older_error:M,onLoadOlder:Cs}),s.jsx("div",{className:"min-w-0 flex-1",ref:S,children:Y?s.jsx(qz,{reads:O.reads,scope:ae,onScope:H,onRead:Oe,org:Ce.org,onSelect:p}):V!==null?s.jsx(Oz,{id:V,summary:((z=x.planned)==null?void 0:z.find(se=>se.id===V))??null,org:Ce.org,onNotFound:()=>c==null?void 0:c({kind:"planned",id:V}),forecast:O.available?s.jsx(Zz,{state:oe,id:V}):null}):ee===zs?s.jsx(aL,{candidate:_,branch_name:((be=x.release_branch)==null?void 0:be.name)??null,can_write:x.can_write&&!!l,local:!!m,org:Ce.org,onSelect:p,onRetry:$,onWrite:()=>K(!0)}):ee?s.jsx(lL,{detail:R[ee]??{state:"loading"},summary:x.releases.find(se=>se.version===ee)??null,local:!!m,org:Ce.org,onSelect:p,onRetry:()=>W(ee)}):(x.release_branch||m)&&_.state==="ready"?s.jsx(yz,{title:De.title,text:De.text}):null})]}):null,l&&_.state==="ready"&&_.value?l({candidate:_.value,open:D,notice:G,onOpenChange:se=>{se||U(null),K(se)},onStale:async se=>{U(se),await C()},onWritten:async se=>{K(!1),U(null),await X(),y(se),await $()}}):null]})}function Jz(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function eL({value:e,label:t,options:n,can_write:a,onChange:l}){const r=n.some(i=>i.id===e);return s.jsxs("div",{className:"grid w-56 gap-2",children:[s.jsx(Me,{htmlFor:"release-branch",children:"Release branch"}),s.jsxs(dt,{value:e,onValueChange:l,disabled:!a,children:[s.jsx(it,{id:"release-branch",children:s.jsx(ft,{})}),s.jsxs(ot,{children:[r?null:s.jsx(ke,{value:e,children:t??"Unnamed branch"}),n.map(i=>s.jsx(ke,{value:i.id,children:i.label},i.id))]})]}),a?null:s.jsx(t1,{})]})}function t1(){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 tL({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(mu,{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(dt,{onValueChange:n,disabled:!e,children:[s.jsx(it,{id:"release-branch-first",children:s.jsx(ft,{placeholder:"Choose a branch"})}),s.jsx(ot,{children:t.map(a=>s.jsx(ke,{value:a.id,children:a.label},a.id))})]})]}),e?null:s.jsx(t1,{})]})}function n1({children:e}){return s.jsx("p",{className:"text-muted-foreground px-3 pt-3 text-xs font-medium tracking-wide uppercase",children:e})}function nL({list:e,candidate:t,shown:n,onSelect:a,roadmap:l,planned_ranges:r,can_load_older:i,older_error:o,onLoadOlder:c}){var h,m;const d=!!e.local,f=(t==null?void 0:t.state)==="ready"&&t.value?no(t.value.changes):null;return s.jsxs("nav",{"aria-label":"Releases",className:"flex w-full flex-col gap-1 md:sticky md:top-0 md:max-h-[calc(100vh-3.5rem)] md:w-72 md:shrink-0 md:overflow-y-auto",children:[d&&l?s.jsx($c,{active:n===or,onClick:()=>a(or),version:"Roadmap",badges:null,caption:l}):null,t&&(t.state!=="ready"||t.value)?s.jsx($c,{active:n===zs,onClick:()=>a(zs),version:t.state==="ready"&&t.value?t.value.version:"Next release",badges:s.jsxs(s.Fragment,{children:[s.jsx(he,{variant:"info",children:"Candidate"}),f!=null&&f.breaking?s.jsx(he,{variant:"error",children:"Breaking"}):t.state==="ready"&&((h=t.value)==null?void 0:h.app_changed)===!1?s.jsx(he,{variant:"neutral",children:"App unchanged"}):t.state==="ready"&&((m=t.value)!=null&&m.classification)?s.jsx(he,{variant:"neutral",children:t.value.classification.bump}):null]}),caption:t.state==="loading"?"Classifying…":t.state==="error"?"Could not be read":zk(t.value)}):null,d?s.jsx(sL,{list:e,shown:n,onSelect:a,ranges:r}):null,d&&e.releases.length>0?s.jsx(n1,{children:"Released"}):null,e.releases.map(x=>{const j=d?Nz(x):null;return s.jsx($c,{active:n===x.version,onClick:()=>a(x.version),version:x.label??x.version,badges:(j==null?void 0:j.badges)??s.jsxs(s.Fragment,{children:[s.jsx(he,{variant:"neutral",children:x.previous_release_id?x.bump??"patch":"First"}),x.breaking?s.jsx(he,{variant:"error",children:"Breaking"}):null]}),caption:(j==null?void 0:j.caption)??ix(x.written_at)},x.version)}),i?s.jsx(q,{variant:"link",size:"sm",className:"self-start",onClick:c,children:"Show older Releases"}):null,o?s.jsx("p",{className:"text-destructive text-xs",role:"alert",children:o}):null]})}function sL({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(n1,{children:"Planned"}),e.planned_error?s.jsx(Mn,{title:"Planned Releases could not be read",error:e.planned_error}):null,(e.planned??[]).map((l,r)=>s.jsx($c,{active:t===Jn(l.id),onClick:()=>n(Jn(l.id)),version:l.name,badges:s.jsx(he,{variant:"neutral",children:"Planned"}),caption:`${l.members===0?"no members":`${l.members} member${l.members===1?"":"s"}`}${r===0?" · next":""}${a!=null&&a.get(l.id)?` · ${a.get(l.id)}`:""}`},l.id))]})}function aL({candidate:e,branch_name:t,can_write:n,local:a,org:l,onSelect:r,onRetry:i,onWrite:o}){var m;if(e.state==="loading")return s.jsx(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(Mn,{error:e.error,onRetry:i})});const c=e.value;if(!c)return null;const d=no(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(he,{variant:"info",children:"Candidate"}),d.breaking?s.jsx(he,{variant:"error",children:"Breaking"}):c.app_changed===!1?s.jsx(he,{variant:"neutral",children:"App unchanged"}):c.classification?s.jsx(he,{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: `,zk(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(q,{onClick:o,children:[s.jsx(mu,{className:"mr-2 size-4"}),"Write Release ",c.next_version]}):null]}),a?s.jsx(Ez,{candidate:c,org:l,onSelect:r,notes:f?null:s.jsx(Eu,{changes:c.changes})}):f?null:s.jsx(Eu,{changes:c.changes})]})}function lL({detail:e,summary:t,local:n,org:a,onSelect:l,onRetry:r}){const[i,o]=u.useState(!1);if((t==null?void 0:t.state)==="unreadable")return s.jsxs(Tn,{children:[s.jsx("h2",{className:"text-lg font-semibold",children:t.label??t.version}),s.jsx(Mn,{title:"This Release could not be read",error:t.error??"Its record cannot be read."})]});if(e.state==="loading")return s.jsx(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(Mn,{error:e.error,onRetry:r})});const c=e.value,d=!c.previous_release_id,f=c.bump&&c.computed_bump&&c.bump!==c.computed_bump,h=c.label??c.version,m=async()=>{await navigator.clipboard.writeText(gz(h,no(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(Az,{release:c,onSelect:l}):s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h2",{className:"text-lg font-semibold",children:c.version}),s.jsx(he,{variant:"neutral",children:d?"First":c.bump}),no(c.changes).breaking?s.jsx(he,{variant:"error",children:"Breaking"}):null]}),s.jsxs("p",{className:"text-muted-foreground text-sm",children:["Written ",ix(c.written_at),c.written_by_name?` by ${c.written_by_name}`:"",". A Release is permanent; a correction is a new Release."]}),n&&c.batch?s.jsxs("p",{className:"text-muted-foreground text-xs",children:["Released when production ran release batch ",s.jsx("code",{className:"font-mono",children:c.batch}),".",c.app_changed===!1?` The app's version stays ${c.app_version??c.version}.`:""]}):null,f?s.jsxs("p",{className:"text-sm",children:["Computed ",c.computed_bump,", declared ",c.bump,c.declared_by_name?` by ${c.declared_by_name}`:"",c.declared_reason?`: “${c.declared_reason}”`:"."]}):null,c.version_line?s.jsx("p",{className:"text-sm",children:c.version_line}):null,c.marks_approximate?s.jsx("p",{className:"text-muted-foreground text-xs",children:"Modeling-only marks could not all be read when it was written, so its notes may leave out a change made after a mark."}):null,d?s.jsx("p",{className:"text-muted-foreground text-xs",children:"The first Release records the starting point and lists no changes."}):c.source_judged?null:s.jsx("p",{className:"text-muted-foreground text-xs",children:"Only graph changes were judged, so code that changed without a graph change is not counted."})]}),d?null:s.jsxs(q,{variant:"outline",onClick:m,children:[s.jsx(tR,{className:"mr-2 size-4"}),i?"Copied":"Copy notes"]})]}),n?s.jsx(Mz,{release:c,org:a,onSelect:l,notes:d?null:s.jsx(Eu,{changes:c.changes})}):d?null:s.jsx(Eu,{changes:c.changes})]})}const rL=5,iL=e=>e.retry===!0||e.reason==="store_locked"||e.status===503;function oL({org:e,query:t,onSelect:n,home:a}){var M,A;const l=e1(),{href:r,Link:i}=Ve(),[o,c]=u.useState({state:"loading"}),[d,f]=u.useState(null),[h,m]=u.useState(null),[x,j]=u.useState(null),v=u.useRef(0),y=u.useRef(0),g=u.useRef(null),p=u.useRef(!1),b=u.useCallback(async S=>{const E=y.current+=1;m(null);const C=await l.list(S?{fresh:!0}:void 0);if(E===y.current){if(C.ok){v.current=0,f(null),c({state:"ok",list:C.data});return}if(C.refusal.reason==="engine_missing"){c({state:"engine_missing",refusal:C.refusal});return}if(v.current+=1,v.current===1&&iL(C.refusal)){m(C.refusal.retry_after??rL);return}f(C.refusal)}},[l]);u.useEffect(()=>{b(!1)},[b]),u.useEffect(()=>{if(h===null)return;const S=setTimeout(()=>void b(!1),h*1e3);return()=>clearTimeout(S)},[h,b]),u.useEffect(()=>{var E;if(!p.current||o.state==="loading"||d||h!==null)return;p.current=!1;const S=(E=g.current)==null?void 0:E.querySelector("h1");S&&(S.tabIndex=-1,S.focus())});const _=()=>{p.current=!0,v.current=0,f(null),b(!0)},N=o.state==="ok"?o.list:null,R=t.roadmap?or:t.planned!==null?t.planned===""?(M=N==null?void 0:N.planned)!=null&&M[0]?Jn(N.planned[0].id):null:Jn(t.planned):t.release,w=`${t.release??""}|${t.planned??""}|${t.roadmap?"roadmap":""}`,k=u.useRef(w);u.useEffect(()=>{k.current!==w&&(k.current=w,j(null))},[w]);const L=u.useRef(!1),D=u.useCallback(S=>{L.current=!0,j(S)},[]),K=!x&&o.state==="ok"&&L.current;if(u.useEffect(()=>{K&&(L.current=!1)},[K]),x)return s.jsx(Ba,{title:x.kind==="release"?`No Release ${x.id}`:`No open Planned Release ${x.id}`,description:"This project has no Release, candidate or open Planned Release by that name.",backHref:r(a),backLabel:"All Releases",link:i});const G=h!==null?s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(vn,{"aria-hidden":!0})," The release records are busy; reading again in ",h," s…"]}):null,U=d?s.jsxs(me,{variant:"destructive",children:[s.jsx(en,{}),s.jsx(ve,{children:"Releases could not be read"}),s.jsxs(pe,{className:"flex flex-col items-start gap-2",children:[s.jsxs("span",{children:[d.message,N?" The last Releases read stay below.":""]}),s.jsx(q,{variant:"outline",size:"sm",onClick:_,children:"Try again"})]})]}):null;return s.jsx("div",{ref:g,className:"flex w-full flex-1 flex-col gap-6 px-4 py-4 sm:px-6 lg:px-8",children:o.state==="ok"?s.jsx(Wz,{initial:o.list,org:e,selection:{selected:R,onSelect:n},onReadAgain:_,onNotFound:D,notice:G||U?s.jsxs(s.Fragment,{children:[G,U]}):null,focusOnMount:K},((A=o.list.local)==null?void 0:A.read_at)??"list"):o.state==="engine_missing"?s.jsx(Js,{page:"Releases"}):s.jsxs(s.Fragment,{children:[s.jsx(Dk,{description:Lk}),U??G??s.jsxs("p",{className:"text-muted-foreground flex items-center gap-2 text-sm",role:"status","aria-live":"polite",children:[s.jsx(vn,{"aria-hidden":!0})," Loading Releases…"]})]})})}const cL={threads:"Threads",tasks:"Tasks",queues:"Queues",worktrees:"Worktrees",workspaces:"Workspaces",chart:"Org chart"},uL={tasks:"Tasks",issues:"Issues",releases:"Releases"};function Dc(e,t){return e.kind==="home"?"Home":e.kind==="org"?cL[e.page]:e.kind==="project"?e.page?uL[e.page]:t??e.project:"Not found"}const dL="(max-width: 767px)";function fL(){const e=typeof window<"u"&&window.matchMedia?window.matchMedia(dL):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 hc({className:e=""}){return s.jsx("span",{"aria-hidden":"true",className:`block animate-pulse rounded-md bg-sidebar-accent ${e}`})}function Uv({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 Bv({item:e,collapsed:t}){const{Link:n}=Ve(),a=e.icon,l=e.title??(t?e.label:void 0),r=s.jsx("span",{className:"block",children:s.jsxs(n,{href:e.href,className:"flex h-8 items-center gap-2 overflow-hidden rounded-md px-2 text-sm text-sidebar-foreground no-underline outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring "+(e.current?"bg-sidebar-accent font-medium text-sidebar-accent-foreground":""),"aria-current":e.current?"page":void 0,"aria-label":t?e.label:void 0,children:[s.jsx(a,{className:"size-4 shrink-0","aria-hidden":"true"}),!t&&s.jsx("span",{className:"truncate",children:e.label})]})});return s.jsx("li",{children:l?s.jsxs(JN,{children:[s.jsx(ek,{asChild:!0,children:r}),s.jsx(Qp,{side:"right",children:l})]}):r})}const Hv="m-0 flex list-none flex-col gap-1 p-0";function Iv({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 Pv({page:e,collapsed:t,sheet:n=!1}){var M;const{href:a}=Ve(),{worktrees:l}=nn(),r=yn(),{org:i,projects:o,loading:c,none:d,about:f,aboutFailed:h,domains:m,engine:x}=r,j=x===null,v=i?`/org/${i.slug}`:"",y=o==null?void 0:o.find(A=>A.current),g=((M=i==null?void 0:i.source)==null?void 0:M.kind)==="folder"&&y!==void 0,p=A=>g&&y?`${A} · ${y.name}`:A,b=p("Workspaces"),_=p("Tasks"),N=p("Queues"),R=A=>g?A:void 0,w=[{label:"Home",href:a(v||"/"),icon:xR,current:e.kind==="home"},...j?[]:[{label:"Threads",href:a(`${v}/threads`),icon:AR,current:e.kind==="org"&&e.page==="threads"}],...m.includes("tasks")&&!j?[{label:_,title:R(_),href:a(`${v}/tasks`),icon:i0,current:e.kind==="org"&&e.page==="tasks"}]:[],...j?[]:[{label:N,title:R(N),href:a(`${v}/queues`),icon:o0,current:e.kind==="org"&&e.page==="queues"}],...l&&!j?[{label:"Worktrees",href:a(`${v}/worktrees`),icon:r0,current:e.kind==="org"&&e.page==="worktrees"}]:[],{label:b,title:R(b),href:a(`${v}/workspaces`),icon:uR,current:e.kind==="org"&&e.page==="workspaces"},{label:"Org chart",href:a(`${v}/chart`),icon:DR,current:e.kind==="org"&&e.page==="chart"}],k=c?null:d?"No organization":(i==null?void 0:i.name)??"Organization",L=i?uT(i):null,D=f==null?void 0:f.version,K=D?t?D:`sdlc ${D}`:h?pu:sd,G=h||(f==null?void 0:f.sync.state)==="unknown"?iT:f===void 0?rT:lT;let U;return c?U=s.jsx("div",{className:"px-2 py-1",children:s.jsxs(Uv,{label:"Loading projects",children:[s.jsx(hc,{className:"h-4 w-32"}),s.jsx(hc,{className:"h-4 w-24"})]})}):o?U=s.jsx("ul",{className:Hv,children:o.map(A=>s.jsx(Bv,{collapsed:t,item:{label:A.name,title:A.name,href:a(`/proj/${encodeURIComponent(A.id)}`),icon:oR,current:e.kind==="project"&&e.project===A.id}},A.id))}):U=s.jsx("p",{className:"m-0 px-2 text-sm text-sidebar-foreground/70",children:d?"No projects":pu}),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(HC,{className:"size-4","aria-hidden":"true"})}),!t&&s.jsx("div",{className:"grid min-w-0 flex-1 text-left text-sm leading-tight",children:k===null?s.jsxs(Uv,{label:"Loading organization",children:[s.jsx(hc,{className:"h-4 w-28"}),s.jsx(hc,{className:"h-3 w-24"})]}):s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"truncate font-semibold",title:k,children:k}),L&&s.jsx("span",{className:"truncate text-xs text-sidebar-foreground/70",children:L})]})})]}),s.jsxs("nav",{"aria-label":"App",className:"min-h-0 flex-1 overflow-y-auto",children:[s.jsx(Iv,{label:"Organization",collapsed:t,children:s.jsx("ul",{className:Hv,children:w.map(A=>s.jsx(Bv,{item:A,collapsed:t},A.label))})}),!t&&s.jsx(Iv,{label:"Projects",collapsed:t,children:U})]}),f!==null&&s.jsxs("div",{className:"flex flex-col gap-1 border-t border-sidebar-border p-2 text-xs text-sidebar-foreground/70",children:[s.jsx("p",{className:"m-0 truncate px-2",title:D?`sdlc ${D}`:void 0,children:K}),!t&&s.jsxs("p",{className:"m-0 flex items-start gap-2 px-2",children:[s.jsx(fR,{className:"mt-0.5 size-4 shrink-0","aria-hidden":"true"}),s.jsx("span",{children:G})]})]})]})}const hL="outline-hidden rounded-sm focus-visible:ring-2 focus-visible:ring-ring";function mL({page:e}){var c;const{href:t,Link:n}=Ve(),{org:a,projects:l,loading:r,none:i}=yn(),o=[];if(r)o.push({label:sd});else if(i)o.push({label:"No organization"});else{const d=(a==null?void 0:a.name)??"Organization";if(o.push({label:d,href:e.kind==="home"?void 0:t(a?`/org/${a.slug}`:"/")}),e.kind==="project"){const f=((c=l==null?void 0:l.find(h=>h.id===e.project))==null?void 0:c.name)??e.project;o.push({label:f,href:e.page?t(`/proj/${encodeURIComponent(e.project)}`):void 0})}if(e.kind==="org"&&e.item!==void 0)o.push({label:Dc(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:Dc(e),href:t(f)}),o.push({label:e.item})}else e.kind!=="home"&&!(e.kind==="project"&&!e.page)&&o.push({label:Dc(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(a0,{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 ${hL}`,children:d.label}):s.jsx("span",{className:"truncate font-normal text-foreground","aria-current":f===o.length-1?"page":void 0,children:d.label})]},`${f}-${d.label}`))})})}function pL({page:e,children:t}){var g;const n=fL(),[a,l]=u.useState(!0),[r,i]=u.useState(!1),o=u.useRef(null),c=u.useRef(null),{org:d,projects:f,loading:h,none:m}=yn(),x=e.kind==="project"?(g=f==null?void 0:f.find(p=>p.id===e.project))==null?void 0:g.name:void 0;u.useEffect(()=>{const p=h?sd:m?"No organization":(d==null?void 0:d.name)??"Organization",b=(e.kind==="org"||e.kind==="project")&&e.item!==void 0?`${e.item} · `:"";document.title=`${b}${Dc(e,x)} · ${p} · sdlc viewer`},[e,x,d,h,m]);const j=()=>{var p;i(!1),(p=o.current)==null||p.focus()};u.useEffect(()=>{n||i(!1)},[n]);const v=n&&r;u.useEffect(()=>{var _;const p=c.current;if(!v||!p)return;(_=p.querySelector("a, button"))==null||_.focus();const b=N=>{var D;if(N.key==="Escape"){i(!1),(D=o.current)==null||D.focus();return}if(N.key!=="Tab")return;const R=[...p.querySelectorAll("a[href], button:not([disabled])")];if(R.length===0)return;const w=R[0],k=R[R.length-1],L=p.contains(document.activeElement);N.shiftKey&&(document.activeElement===w||!L)?(N.preventDefault(),k.focus()):!N.shiftKey&&(document.activeElement===k||!L)&&(N.preventDefault(),w.focus())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[v]);const y=!n&&!a;return s.jsx(WN,{children:s.jsxs("div",{className:"flex h-svh min-h-0 overflow-hidden bg-background text-foreground",children:[!n&&s.jsx("aside",{"aria-label":"Sidebar",className:`shrink-0 border-r border-sidebar-border transition-[width] ${y?"w-12":"w-64"}`,children:s.jsx(Pv,{page:e,collapsed:y})}),v&&s.jsxs("div",{className:"fixed inset-0 z-50 flex",children:[s.jsxs("aside",{ref:c,role:"dialog","aria-modal":"true","aria-label":"Sidebar",className:"relative w-72 max-w-[85vw] border-r border-sidebar-border",children:[s.jsx(Pv,{page:e,collapsed:!1,sheet:!0}),s.jsx("button",{type:"button","aria-label":"Close the sidebar",className:"absolute top-3 right-3 inline-flex size-7 items-center justify-center rounded-md border-0 bg-transparent text-sidebar-foreground/70 outline-hidden hover:text-sidebar-foreground focus-visible:ring-2 focus-visible:ring-ring",onClick:j,children:s.jsx(nd,{className:"size-4","aria-hidden":"true"})})]}),s.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"flex-1 border-0 bg-black/80 outline-hidden",onClick:j})]}),s.jsxs("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:[s.jsxs("header",{className:`flex shrink-0 items-center gap-2 border-b border-border px-4 transition-[height] ${y?"h-12":"h-16"}`,children:[s.jsx("button",{ref:o,type:"button",className:"-ml-1 inline-flex size-7 items-center justify-center rounded-md border-0 bg-transparent text-foreground outline-hidden hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Toggle Sidebar","aria-expanded":n?r:a,onClick:()=>n?i(p=>!p):l(p=>!p),children:s.jsx(LR,{className:"size-4","aria-hidden":"true"})}),s.jsx("span",{"aria-hidden":"true",className:"mr-2 h-4 w-px bg-border"}),s.jsx(mL,{page:e})]}),s.jsx("main",{className:"flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden overflow-y-auto",children:t})]})]})})}const dx="m-0 text-2xl font-semibold tracking-tight",fx="outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",hx=`rounded-sm font-medium text-primary no-underline hover:underline ${fx}`;function Lf({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 xL({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(Lf,{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(Lf,{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(Lf,{children:`sdlc-agents folder add ${e.member_path} --name ${e.repository}`}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"To work in this repository alone, leaving is enough."})]}):s.jsxs("div",{className:"flex max-w-2xl flex-col gap-2",children:[s.jsx("p",{className:"m-0 text-sm",children:e.cause}),e.kind==="moved_member"&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:"Move this repository back to where the folder records it."}),s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:e.kind==="other"&&!e.fix?cl:cT})]})}const qv=`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 ${fx}`;function gL(){return s.jsxs("div",{role:"status",className:"flex flex-col gap-2",children:[s.jsx("span",{className:"sr-only",children:"Loading projects"}),[0,1,2].map(e=>s.jsx("span",{"aria-hidden":"true",className:"block h-9 animate-pulse rounded-md bg-muted"},e))]})}function Vr(){const{href:e,Link:t}=Ve(),{loading:n,projects:a,none:l,failure:r,readAt:i,refresh:o,reading:c}=yn(),[d,f]=u.useState(""),h=s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:dx,children:"Projects"}),!l&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:oT})]});if(l)return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,s.jsx(xL,{why:l==="not_in_git"?{kind:"not_in_git"}:mT(l)})]});const m=r!=null&&r.shown?r:null,x=(a??[]).filter(j=>j.name.toLowerCase().includes(d.trim().toLowerCase()));return s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[h,m&&s.jsxs("div",{role:"alert",className:"flex flex-col gap-2 rounded-lg border border-destructive/40 bg-destructive/10 p-4",children:[s.jsx("p",{className:"m-0 text-sm font-medium text-destructive",children:"The projects could not be refreshed"}),s.jsx("p",{className:"m-0 text-sm",children:u0(m.refusal,i)}),s.jsx("div",{children:s.jsx("button",{type:"button",className:qv,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 ${fx}`}),!m&&s.jsx("button",{type:"button",className:`${qv} ml-auto`,onClick:o,disabled:c||n,children:"Refresh"})]}),r&&!r.shown&&i&&s.jsx("p",{className:"m-0 text-sm text-muted-foreground",children:`Showing the list read at ${oi(i)}; reading again in ${r.retryInSeconds??10} seconds.`})]}),n?s.jsx(gL,{}):a&&s.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:s.jsxs("table",{className:"w-full border-collapse text-sm",children:[s.jsx("thead",{className:"border-b border-border text-left text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{scope:"col",className:"h-10 px-3 font-medium",children:"Name"}),s.jsx("th",{scope:"col",className:"h-10 px-3 font-medium",children:"Location"}),s.jsx("th",{scope:"col",className:"h-10 px-3",children:s.jsx("span",{className:"sr-only",children:"Where this viewer runs"})})]})}),s.jsxs("tbody",{children:[x.map(j=>s.jsxs("tr",{className:"border-b border-border last:border-0",children:[s.jsx("td",{className:"px-3 py-2",children:s.jsx(t,{href:e(`/proj/${encodeURIComponent(j.id)}`),className:hx,children:j.name})}),s.jsx("td",{className:"px-3 py-2 font-mono text-muted-foreground",children:j.location??pu}),s.jsx("td",{className:"px-3 py-2 text-right",children:j.current&&s.jsx("span",{className:"inline-flex items-center rounded-md border border-border px-2 py-0.5 text-xs font-medium",children:"This repository"})})]},j.id)),x.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:3,className:"px-3 py-6 text-center text-muted-foreground",children:"No projects found."})})]})]})})]})}function s1({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:dx,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 ${hx}`,children:"Back to the organization's Home"})})]})})}const vL={tasks:"Tasks",issues:"Issues",releases:"Releases"};function so({project:e}){const{href:t,Link:n}=Ve(),{org:a,projects:l,loading:r,domains:i}=yn(),o=l==null?void 0:l.find(c=>c.id===e);return r?s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:sd}):l?o?s.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("h1",{className:dx,children:o.name}),s.jsx("p",{className:"m-0 font-mono text-sm text-muted-foreground",children:o.location??pu})]}),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:hx,children:vL[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(s1,{title:"Project not found",children:`There is no project '${e}' in this organization.`}):s.jsx(Vr,{})}const Td=e=>e instanceof Error?e.message:String(e);async function a1(){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:Td(e)}}}async function yL(){var e;try{const t=await fetch("api/release-links?threads",{cache:"no-store"});if(!t.ok)return null;const n=await t.json(),a=(e=n==null?void 0:n.panel)==null?void 0:e.threads;if(!a||typeof a!="object"||Array.isArray(a))return null;const l={};for(const[r,i]of Object.entries(a)){const o=(Array.isArray(i)?i:[]).filter(c=>!!c&&typeof c.planned_release=="string"&&typeof c.name=="string"&&typeof c.level=="string");o.length&&(l[r]=o)}return l}catch{return null}}async function bL(){try{return(await fetch("api/pin",{method:"HEAD",cache:"no-store"})).ok}catch{return!1}}async function jL(){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 _L(){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:Td(e)}}}async function wL(e,t){try{const n=await fetch("api/threads/open",{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e,reopen:t})}),a=await n.text();let l={};try{l=JSON.parse(a)??{}}catch{}return n.ok?{done:l}:{refused:{reason:typeof l.reason=="string"?l.reason:"failed",error:typeof l.error=="string"?l.error:a||`HTTP ${n.status}`,...typeof l.where=="string"&&l.where?{where:l.where}:{}}}}catch(n){return{refused:{reason:"failed",error:Td(n)}}}}async function NL(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 Td(n)}}const kL={probe:{source:async()=>{const e=await a1();if("error"in e)throw new Error(e.error);return{label:"Local workspace"}}}},l1={href:e=>e.replace(/^\/+/,"")||"./",Link:({href:e,className:t,children:n,...a})=>s.jsx("a",{href:e,className:t,...a,children:n})},SL={label:"Local viewer",can:()=>!1};function CL(){return u.useEffect(()=>{document.title="Shared app UI · SDLC Workspace Viewer"},[]),s.jsx("div",{className:"app-ui dark",children:s.jsx(t0,{data:kL,router:l1,identity:SL,children:s.jsx(_C,{})})})}const RL="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.",TL=3e4,EL="Reading the workspaces. On a plan workspace this can take a few minutes.",AL="The read failed. Details are in the terminal running sdlc viewer.",ML={active:{label:"Active",tone:"success"},closed:{label:"Closed",tone:"neutral"},clean:{label:"Clean",tone:"success"},dirty:{label:"Uncommitted changes",tone:"warning"},unreadable:{label:"Unreadable",tone:"error"},queued:{label:"Queued",tone:"info"},integrated:{label:"Integrated",tone:"success"},reconciled:{label:"Reconciled",tone:"success"},stale_head:{label:"Retrying",tone:"warning"},current:{label:"Current",tone:"neutral"},blocked_conflict:{label:"Blocked: conflict",tone:"warning"},blocked_validation:{label:"Blocked: validation error",tone:"warning"},ready:{label:"Ready",tone:"success"},applied:{label:"Applied",tone:"success"},stale_base:{label:"Stale base",tone:"warning"},applied_recovery_required:{label:"Needs recovery",tone:"warning"},unavailable:{label:"Unavailable",tone:"warning"},needs_attention:{label:"Needs attention",tone:"warning"}},OL=e=>ML[e]??{label:e,tone:"neutral"},ba=e=>e.slice(0,8),r1={human:"Human",ai:"AI"},fm=(e,t)=>`${e} ${t}${e===1?"":"s"}`;function $L(){const e=nn().workspaces;if(!e)throw new Error("The Workspaces page rendered without the workspaces seam.");return e}function DL(e){const t=$L(),[n,a]=u.useState(null),[l,r]=u.useState(null),[i,o]=u.useState(!1),c=u.useRef(null),d=u.useRef(!1),f=u.useRef(null),h=u.useCallback(()=>{if(f.current)return f.current;const y=(async()=>{const g=await t.overview();g.ok?(a(g.data),r(null),o(!1)):(r(g.refusal),o(!0))})().finally(()=>{f.current=null});return f.current=y,y},[t]);u.useEffect(()=>{h()},[h]),Cu(()=>void h(),TL),u.useEffect(()=>{var y;d.current&&(n||l)&&(d.current=!1,(y=c.current)==null||y.focus())},[n,l]);const m=()=>{d.current=!0,h()},x=n===null&&l===null,j=n===null&&l!==null,v=n?zL(n,i):null;return s.jsxs("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:[s.jsx(Ft,{title:"Workspaces",description:RL,actions:s.jsxs(s.Fragment,{children:[v?s.jsx("p",{className:"text-muted-foreground text-xs",children:v}):null,s.jsxs(q,{type:"button",variant:"outline",size:"sm","aria-disabled":x||void 0,"aria-describedby":x?"workspaces-reading":void 0,className:"gap-2",onClick:x?void 0:()=>void h(),children:[s.jsx(yl,{className:"size-4","aria-hidden":"true"}),"Read again"]}),x?s.jsx("span",{id:"workspaces-reading",className:"sr-only",children:"Reading…"}):null,s.jsx("span",{className:"sr-only",role:"status","aria-live":"polite",children:n?i1(n,i):""})]})}),s.jsxs("div",{ref:c,tabIndex:-1,className:"outline-none",children:[x?s.jsx(LL,{}):null,j&&l?s.jsx(UL,{refusal:l,on_retry:m}):null,n?s.jsx(BL,{overview:n}):null]})]})}function i1(e,t){var n,a;return t||((n=e.stale)==null?void 0:n.reason)==="failed"?"a newer read failed":((a=e.stale)==null?void 0:a.reason)==="running"?"a newer read is still running":""}function zL(e,t){const n=`Read at ${ns(new Date(e.read_at).toISOString())}`,a=i1(e,t);return a?`${n} · ${a}`:n}function LL(){return s.jsxs("div",{className:"mt-6",children:[s.jsx("div",{className:"grid gap-2",role:"status","aria-label":"Loading workspaces",children:Array.from({length:6},(e,t)=>s.jsx(pt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))}),s.jsx("p",{className:"text-muted-foreground mt-3 text-sm","aria-live":"polite",children:EL})]})}function UL({refusal:e,on_retry:t}){const n=e.reason==="store_locked"?u0(e,null):AL;return s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Could not read workspaces"}),s.jsxs(pe,{children:[s.jsx("p",{children:n}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:t,children:"Retry"})]})]})}function BL({overview:e}){const{counts:t}=e,n=[fm(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(mc,{id:"workspaces-lineage",title:"Lineage",caption:"Each workspace under the one it forked from",children:s.jsx(HL,{rows:e.workspaces})}),s.jsx(mc,{id:"workspaces-authority",title:"Authority and resolver",caption:"What this checkout's workspace may change",children:s.jsx(IL,{authority:e.authority})})]}),s.jsx(mc,{id:"workspaces-activity",className:"mt-4",title:"Integration activity",caption:"Newest first",children:e.activity.length===0?s.jsx(Gv,{children:"No integration or reconciliation attempts yet."}):s.jsx(qL,{rows:e.activity})}),s.jsx(mc,{id:"workspaces-handoffs",className:"mt-4",title:"Handoffs",children:e.handoffs.length===0?s.jsx(Gv,{children:"No Handoffs prepared yet."}):s.jsx(GL,{rows:e.handoffs})})]})}function mc({id:e,title:t,caption:n,className:a,children:l}){return s.jsxs("section",{"aria-labelledby":e,className:ie("min-w-0",a),children:[s.jsxs("div",{className:"mb-2 flex flex-wrap items-baseline gap-x-2",children:[s.jsx("h2",{id:e,className:"text-lg font-semibold",children:t}),n?s.jsx("span",{className:"text-muted-foreground text-sm",children:n}):null]}),l]})}const Gv=({children:e})=>s.jsx("p",{className:"text-muted-foreground text-sm",children:e}),Au=({children:e,tone:t})=>s.jsx("div",{className:ie("text-xs",t==="error"?"text-destructive":"text-muted-foreground"),children:e});function ao({status:e}){const t=OL(e);return s.jsx(he,{variant:t.tone,children:t.label})}function Ed({label:e,children:t}){return s.jsx(xt,{role:"group","aria-label":e,tabIndex:0,className:"overflow-x-auto outline-hidden focus-visible:ring-2 focus-visible:ring-ring",children:t})}function HL({rows:e}){return s.jsx(Ed,{label:"Workspaces",children:s.jsxs(Be,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:e.map(t=>s.jsxs(ue,{"data-testid":"workspaces-row",children:[s.jsxs(P,{children:[s.jsx("div",{className:"font-mono font-medium",children:t.short_id}),s.jsx(Au,{children:t.current?`${t.path} · This checkout`:t.path}),t.projection==="unreadable"&&t.projection_error&&s.jsx(Au,{children:t.projection_error})]}),s.jsx(P,{children:r1[t.actor]}),s.jsx(P,{children:t.source_id?s.jsx("span",{className:"font-mono",children:ba(t.source_id)}):s.jsx("span",{className:"text-muted-foreground",children:"No source"})}),s.jsx(P,{children:s.jsx(ao,{status:t.status})}),s.jsx(P,{children:s.jsx(ao,{status:t.projection})})]},t.id))})]})})}function IL({authority:e}){const t=e.resolver,n=[["Workspace",s.jsx("span",{className:"font-mono",children:ba(e.workspace_id)},"id")],["Actor",r1[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(ao,{status:t.state==="ready"?"ready":"needs_attention"},"resolver")]),t.state==="needs_attention"&&t.issue&&n.push(["Resolver issue",t.issue]),s.jsx(Ed,{label:"Authority and resolver",children:s.jsx(Be,{containerClassName:"overflow-visible",children:s.jsx(He,{children:n.map(([a,l])=>s.jsxs(ue,{children:[s.jsx(F,{scope:"row",className:"text-muted-foreground font-normal",children:a}),s.jsx(P,{children:l})]},a))})})})}function PL(e){const t=[e.merge_attempts?fm(e.merge_attempts,"merge attempt"):null,e.resolver_attempts?fm(e.resolver_attempts,"resolver attempt"):null].filter(Boolean);if(t.length)return t.join(" · ");const n=e.kind==="reconciliation"?"No resolver attempts":"No merge attempts yet";return s.jsx("span",{className:"text-muted-foreground",children:n})}function qL({rows:e}){return s.jsx(Ed,{label:"Integration activity",children:s.jsxs(Be,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"Change"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Attempts"}),s.jsx(F,{children:"Updated"})]})}),s.jsx(He,{children:e.map((t,n)=>s.jsxs(ue,{children:[s.jsxs(P,{children:[s.jsx("div",{className:"font-medium",children:t.kind==="integration"?`Integrate ${ba(t.child_id)} into ${ba(t.other_id)}`:`Reconcile ${ba(t.child_id)} from ${ba(t.other_id)}`}),s.jsx(Au,{children:t.kind==="integration"?"Integration":"Source reconciliation"})]}),s.jsx(P,{children:s.jsx(ao,{status:t.status})}),s.jsx(P,{children:PL(t)}),s.jsx(P,{children:sk(t.updated_at)})]},`${t.kind}-${t.child_id}-${t.other_id}-${t.updated_at}-${n}`))})]})})}function GL({rows:e}){return s.jsx(Ed,{label:"Handoffs",children:s.jsxs(Be,{containerClassName:"overflow-visible",children:[s.jsx(Ge,{children:s.jsxs(ue,{children:[s.jsx(F,{children:"From"}),s.jsx(F,{children:"To"}),s.jsx(F,{children:"Status"}),s.jsx(F,{children:"Pinned"})]})}),s.jsx(He,{children:e.map(t=>s.jsxs(ue,{children:[s.jsxs(P,{children:[s.jsx("div",{className:"font-mono font-medium",children:ba(t.child_id)}),t.error?s.jsx(Au,{children:t.error}):null]}),s.jsx(P,{className:"font-mono",children:ba(t.source_id)}),s.jsx(P,{children:s.jsx(ao,{status:t.status})}),s.jsx(P,{children:`${t.child_commit} onto ${t.source_commit}`})]},t.id))})]})})}const Vv="This machine's worktrees of this repository.",VL="Merge sends one whose thread is at rest to the main queue.",YL=3e4,FL=3e3,XL=6e5,Uf=[{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"}],si={not_landed:{label:"Not landed",tone:"neutral"},main:{label:"On main",tone:"success"},production:{label:"In production",tone:"success"},queued:{label:"Main queue",tone:"info"},needs_you:{label:"Needs you",tone:"warning"}},KL="no thread to land it",mx="its thread waits on you",o1="its thread is done",c1="its thread is retired",px=e=>e.archivable&&e.cleanup==="user",QL=e=>e.queue!==null||e.merge.offered===!1&&e.merge.why==="already in a promotion queue",ZL=e=>!e.merge.offered&&(e.merge.why===o1||e.merge.why.startsWith(c1)),xx=e=>!e.merge.offered&&e.merge.why===KL||ZL(e),Bf=(e,t)=>t==="all"?!0:t==="decide"?px(e):(e.landed!==null?"landed":QL(e)?"queued":xx(e)?"orphan":"needs")===t,WL=e=>e.landed!==null?e.threads.some(t=>t.phase!=="done"):e.threads.length>0&&!xx(e);function zc(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 u1(e){const t=e%100,n=t>=11&&t<=13?"th":{1:"st",2:"nd",3:"rd"}[e%10]??"th";return`${e}${n}`}function JL(e){if(e===null)return"No commits";if(e<1)return"Today";const t=Math.floor(e);return t===1?"1 day ago":`${t} days ago`}const Hf=e=>ns(new Date(e*1e3).toISOString()),hi=e=>e.charAt(0).toUpperCase()+e.slice(1);function e6(e,t){var l;const n=t.phase?hi(t.phase):"No phase",a=e.merge;if(!a.offered&&a.why.startsWith(c1)){const r=(l=/; (.+) continues it$/.exec(a.why))==null?void 0:l[1];return r?`Retired · continued by ${r}`:"Retired"}return t.phase==="done"||!a.offered&&a.why===o1?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===mx?`${n} · waits on you`:a.why.startsWith("its session is not running")?`${n} · session not running`:n}function t6(){const e=nn().worktrees;if(!e)throw new Error("The Worktrees page rendered without the worktrees seam.");return e}function n6({org:e}){var $,X;const t=t6(),[n,a]=u.useState(null),[l,r]=u.useState(null),[i,o]=u.useState(null),[c,d]=u.useState(!1),[f,h]=u.useState("all"),[m,x]=u.useState(""),[j,v]=u.useState({}),y=u.useRef({}),{confirm:g,confirm_dialog:p}=Co(),b=u.useRef(!1),_=u.useCallback(async()=>{if(b.current)return;b.current=!0;const T=await t.list();b.current=!1,T.ok?(a(T.data),r(null)):r(T.refusal)},[t]),N=u.useCallback(async()=>{const T=await t.sizes();d(!T.ok),T.ok&&o(T.data)},[t]);u.useEffect(()=>{_(),N()},[_,N]);const R=(n==null?void 0:n.rows.some(T=>{var I,ne;return((I=T.write)==null?void 0:I.state)==="waiting"||((ne=T.write)==null?void 0:ne.state)==="running"}))??!1;Cu(()=>void _(),R?FL:YL),Cu(()=>void N(),XL);const w=(n==null?void 0:n.rows)??[],k=T=>i==null?void 0:i.sizes[T.path],L=w.filter(px),D=i?L.reduce((T,I)=>T+(k(I)??0),0):null,K=w.length===0?Vv:`${Vv} ${VL}${L.length?` ${L.length} ${L.length===1?"is":"are"} yours to decide${D!==null?`: removing them frees about ${zc(D)}`:""}.`:""}`,G=m.trim().toLowerCase(),U=T=>!G||[T.name,T.path,T.branch??"",...T.threads.map(I=>I.title??I.thread)].some(I=>I.toLowerCase().includes(G)),M=w.filter(T=>Bf(T,f)&&U(T)).sort((T,I)=>{if(f==="decide")return(k(I)??0)-(k(T)??0);const ne=W=>WL(W)?W.merge.offered?0:1:2;return ne(T)-ne(I)||(T.idle_days??1/0)-(I.idle_days??1/0)}),A=async(T,I)=>{const ne=await(T==="merge"?t.merge(I.path):t.remove(I.path));ne.ok?v(({[I.path]:W,...xe})=>xe):v(W=>({...W,[I.path]:ne.refusal.message})),await _()},S=async T=>{if(!T.merge.offered)return;const I=T.threads.find(Y=>Y.thread===(T.merge.offered&&T.merge.thread)),ne=(I==null?void 0:I.title)??T.merge.thread,W=I!=null&&I.holds.length?`has ${I.holds.length} open hold(s) (${I.holds.join(", ")})`:"has no open holds",xe=T.merge.lands.by==="manager"?`on its turn the queue's merge manager, ${T.merge.lands.manager}, lands it on main`:"on its turn that thread lands it on main",V=T.merge.caveat?`
|
|
388
|
-
|
|
389
|
-
Its session could not be read: ${T.merge.caveat}. A turn it does not start passes on.`:"";await g({title:`Send ${T.name} to the main queue`,description:`This joins the main promotion queue for its thread, ${ne}, which ${W} and is told of the join. The queue checks the branch first, and ${xe}. Nothing reaches main before then.${V}`,action_label:"Join the main queue"})&&await A("merge",T)},E=async T=>{const I=k(T);await g({title:`Remove ${T.name}?`,description:`This deletes the folder ${T.path}${I!==void 0?` and frees about ${zc(I)}`:""}.${T.branch?` Its branch ${T.branch} stays, so its work can be checked out again,`:""} and its task records are saved first; a landed plan workspace in it is closed. It stays with you because ${T.cleanup_why[0]??"the Local systems manager leaves it to you"}. The worktree is checked again just before, and nothing is deleted if that check finds work in it.`,action_label:"Remove worktree",destructive:!0})&&(I!==void 0&&(y.current[T.path]=I),await A("remove",T))},C=async T=>{await t.dismiss(T),await _()};return(l==null?void 0:l.reason)==="engine_missing"?s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(Js,{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(Ft,{title:"Worktrees",description:K}),!n&&!l&&s.jsx(s6,{}),l?s.jsx(a6,{refusal:l,read_at:n==null?void 0:n.read_at,on_retry:()=>void _()}):null,n!=null&&n.stale?s.jsxs(me,{variant:"destructive",className:"mt-4",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Could not read worktrees"}),s.jsxs(pe,{children:[s.jsxs("p",{children:[n.stale.message," This list was read at ",ns(new Date(n.read_at).toISOString()),"."]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void _(),children:"Retry"})]})]}):null,n==null?void 0:n.removals.map(T=>s.jsxs(me,{variant:"success",className:"mt-4",role:"status",children:[s.jsx(ve,{children:y.current[T.path]!==void 0?`Removed ${T.name} and freed ${zc(y.current[T.path])}`:`Removed ${T.name}`}),s.jsxs(pe,{children:[s.jsx("p",{children:T.branch?`Its branch ${T.branch} stays, and its records were saved.`:"Its records were saved."}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:()=>void C({removal:T.path}),children:"Dismiss"})]})]},T.path)),n&&w.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(r0,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"Only the main checkout"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"No other worktrees. Agents make theirs in .sdlc-worktrees beside the main checkout."})]}):n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[s.jsx(_t,{type:"search",className:"w-64","aria-label":"Search worktrees",placeholder:"Search worktrees",value:m,onChange:T=>x(T.target.value)}),s.jsxs("p",{className:"text-muted-foreground ml-auto text-xs",children:["Read at ",ns(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:Uf.map(T=>s.jsxs(q,{type:"button",variant:"outline",size:"sm",className:lr,"aria-pressed":f===T.id,onClick:()=>h(T.id),children:[T.label," ",w.filter(I=>Bf(I,T.id)).length]},T.id))}),M.length===0?s.jsxs("div",{className:"mt-12 flex flex-col items-center gap-2 text-center",children:[s.jsx(td,{className:"text-muted-foreground size-8","aria-hidden":"true"}),s.jsx("h2",{className:"text-lg font-semibold",children:"No worktrees match"}),G?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",($=Uf.find(T=>T.id===f))==null?void 0:$.empty," matches “",m,"”. Clear the search to see all"," ",w.filter(T=>Bf(T,f)).length,"."]}),s.jsx(q,{type:"button",variant:"outline",onClick:()=>x(""),children:"Clear search"})]}):s.jsxs("p",{className:"text-muted-foreground text-sm",children:["No ",(X=Uf.find(T=>T.id===f))==null?void 0:X.empty," right now."]})]}):s.jsx(xt,{className:"mt-4 shrink-0 overflow-x-auto",children:s.jsxs(Be,{containerAriaLabel:"Worktrees",className:"table-fixed",children:[s.jsx(Ge,{children:s.jsxs(ue,{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(He,{children:M.map(T=>s.jsx(l6,{org:e,row:T,size:k(T),sizes:i!==null?"read":c?"failed":"measuring",can_write:n.can_write,sent:j[T.path],on_merge:()=>void S(T),on_remove:()=>void E(T),on_dismiss:I=>void C(I),on_clear_sent:()=>v(({[T.path]:I,...ne})=>ne)},T.path))})]})})]}):null,p]})}function s6(){return s.jsx("div",{className:"mt-6 grid gap-2",role:"status","aria-label":"Loading worktrees",children:Array.from({length:6},(e,t)=>s.jsx(pt,{className:t===5?"h-10 w-2/3":"h-10 w-full"},t))})}function a6({refusal:e,read_at:t,on_retry:n}){const a=as();return e.reason==="view_outdated"?s.jsxs(me,{variant:"warning",className:"mt-6",children:[s.jsx(en,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:$r}),s.jsx(pe,{children:a})]}):s.jsxs(me,{variant:"destructive",className:"mt-6",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"Could not read worktrees"}),s.jsxs(pe,{children:[s.jsxs("p",{children:[e.message,t?` This list was read at ${ns(new Date(t).toISOString())}.`:""]}),s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:n,children:"Retry"})]})]})}function pc({children:e,muted:t=!0}){return s.jsx("div",{className:ie("truncate text-xs",t&&"text-muted-foreground"),title:e,children:e})}function l6({org:e,row:t,size:n,sizes:a,can_write:l,sent:r,on_merge:i,on_remove:o,on_dismiss:c,on_clear_sent:d}){const{href:f,Link:h}=Ve(),m=e?`/org/${encodeURIComponent(e)}`:"",x=f(`${m}/threads`),j=f(`${m}/tasks`),v=si[t.landed??"not_landed"],y=px(t),g=t.write,p=(g==null?void 0:g.state)==="waiting"||(g==null?void 0:g.state)==="running",b=t.threads.find(K=>"thread"in t.merge&&K.thread===t.merge.thread)??t.threads[0],_=t.merge,N=!_.offered&&_.why===mx,R=l&&t.landed===null&&!t.queue&&!N&&!xx(t),w=n!==void 0?zc(n):a==="measuring"?"Measuring size…":a==="failed"?"Size could not be read":null,k=y?{label:"Yours to decide",muted:!1,second:[w,t.cleanup_why[0]]}:t.archivable?{label:"The manager removes it",muted:!1,second:[w]}:{label:"Stays",muted:!0,second:[w,t.why[0]??null]},L=k.second.filter(Boolean).join(" · "),D=t.path.slice(0,t.path.length-t.name.length-1)||".";return s.jsxs(s.Fragment,{children:[s.jsxs(ue,{"data-testid":"worktrees-row",children:[s.jsxs(P,{children:[s.jsx("div",{className:"truncate font-medium",title:t.name,children:t.name}),s.jsx(pc,{children:t.branch??"Detached"}),D!==".sdlc-worktrees"?s.jsx(pc,{children:`in ${D}`}):null]}),s.jsx(P,{children:b?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"truncate",title:b.title??b.thread,children:b.title??b.thread}),s.jsx(pc,{children:`${e6(t,b)}${t.threads.length>1?` · ${t.threads.length-1} more`:""}`})]}):s.jsx("span",{className:"text-muted-foreground",children:"No thread"})}),s.jsx(P,{children:s.jsx(he,{variant:v.tone,children:v.label})}),s.jsxs(P,{children:[s.jsx("div",{className:ie("truncate",k.muted&&"text-muted-foreground"),children:k.label}),L?s.jsx("div",{className:"hidden md:block",children:s.jsx(pc,{children:L})}):null]}),s.jsx(P,{className:"hidden md:table-cell",children:JL(t.idle_days)}),s.jsx(P,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[p?s.jsx(q,{type:"button",variant:"outline",size:"sm",loading:!0,disabled:!0,children:(g==null?void 0:g.kind)==="merge"?g.state==="waiting"?"Waiting to join…":"Joining main…":(g==null?void 0:g.state)==="waiting"?"Waiting to remove…":"Removing…"}):t.queue?s.jsx(he,{variant:si.queued.tone,children:`${si.queued.label} · ${u1(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(he,{variant:si.needs_you.tone,children:si.needs_you.label})}):R?s.jsx(q,{type:"button",variant:"outline",size:"sm",title:_.offered?void 0:_.why,"aria-disabled":!_.offered||void 0,className:ie(!_.offered&&"cursor-not-allowed opacity-50"),"aria-label":`Send ${t.name} to the main queue`,"aria-describedby":_.offered?void 0:`why-${t.name}`,onClick:_.offered?i:void 0,children:"Merge"}):null,y&&l&&!p?s.jsx(q,{type:"button",variant:"outline",size:"sm","aria-label":`Remove ${t.name}`,onClick:o,children:"Remove"}):null]})})]}),s.jsx(r6,{row:t,threads:x,tasks:j,merge_shown:R,sent:r,on_dismiss:c,on_clear_sent:d})]})}function r6({row:e,threads:t,tasks:n,merge_shown:a,sent:l,on_dismiss:r,on_clear_sent:i}){var j,v,y,g;const{Link:o}=Ve(),c=(p="Open in Threads")=>s.jsx(o,{className:"text-primary text-sm hover:underline",href:t,children:p}),d=p=>s.jsx(q,{type:"button",variant:"outline",size:"sm",className:"mt-2",onClick:p,children:"Dismiss"}),f=e.write,h=e.threads.find(p=>p.thread===("thread"in e.merge?e.merge.thread:void 0))??e.threads[0],m=(h==null?void 0:h.title)??"Its thread";let x=null;if(l)x=s.jsxs(me,{variant:"destructive",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:"It was not sent"}),s.jsxs(pe,{children:[s.jsx("p",{children:l}),d(i)]})]});else if((f==null?void 0:f.state)==="waiting")x=s.jsxs("p",{className:"text-muted-foreground text-sm",role:"status",children:["Another worktree's write runs first; ",e.name," ",f.kind==="merge"?"joins":"is removed"," next."]});else if((f==null?void 0:f.state)==="running")x=s.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:f.kind==="merge"?`Joining the main queue for ${e.name}. The queue checks its branch first; this can take a few minutes.`:`Removing ${e.name}. It is checked again first.`});else if((f==null?void 0:f.state)==="joined"){const p=((j=f.lands)==null?void 0:j.by)==="manager"?`the merge manager, ${f.lands.manager}, lands it`:"it lands it on its turn";x=s.jsxs(me,{variant:f.told?"success":"warning",role:"status",children:[s.jsx(ve,{children:`${e.name} joined the main queue, ${u1(f.position)}`}),s.jsxs(pe,{children:[s.jsx("p",{children:f.told?`${m} was left a notice, and ${p}.`:"Its thread could not be told, so it does not know its turn is coming. Tell it from Threads; the join itself is unchanged."}),((v=e.queue)==null?void 0:v.position)===1&&e.queue.turn==="next"&&e.queue.passes_at?s.jsx("p",{children:`It is first in the main queue. Its thread was left a notice but not woken: continue it in its session, or the turn passes on at ${Hf(e.queue.passes_at)}.`}):null,s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>r({write:e.path})),!f.told||((y=e.queue)==null?void 0:y.position)===1?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(f&&(f.state==="refused"||f.state==="failed")){const p=f.kind==="merge"?`The main queue refused ${e.name}`:`${e.name} was not removed`;x=s.jsxs(me,{variant:"destructive",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:f.kind==="merge"&&f.state==="failed"?`${e.name} did not join`:p}),s.jsxs(pe,{children:[s.jsx("p",{children:`${hi(f.message)}${f.kind==="merge"?" Nothing was queued.":" Nothing was deleted."}`}),s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>r({write:e.path})),f.kind==="merge"?s.jsx("span",{className:"mt-2",children:c()}):null]})]})]})}else if(e.last_turn){const p=e.last_turn;x=s.jsxs(me,{variant:"warning",children:[s.jsx(rt,{className:"size-4","aria-hidden":"true"}),s.jsx(ve,{children:`${e.name}'s turn ${p.outcome==="failed"?"failed":"passed on"} at ${Hf(p.left_at)}`}),s.jsxs(pe,{children:[s.jsx("p",{children:`${hi(p.reason)}. Continue the thread in its session; Merge sends it again once it is at rest.`}),s.jsxs("div",{className:"flex items-center gap-3",children:[d(()=>r({turn:{execution:p.execution,left_at:p.left_at}})),s.jsx("span",{className:"mt-2",children:c()})]})]})]})}else((g=e.queue)==null?void 0:g.position)===1&&e.queue.turn==="next"&&e.queue.passes_at?x=s.jsxs("p",{className:"text-sm",role:"status",children:[`Its turn now: ${e.name} is first in the main queue. Continue its thread in its session, or the turn passes on at ${Hf(e.queue.passes_at)}. `,c()]}):!e.merge.offered&&e.merge.why===mx?x=s.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:["Its thread waits on you. Merge comes back once you answer it. ",s.jsx(o,{className:"text-primary hover:underline",href:n,children:"In Waiting on you"})]}):!e.merge.offered&&e.merge.successor&&!e.queue&&e.landed===null?x=s.jsx("p",{className:"text-sm",children:c("Open its successor in Threads")}):a&&!e.merge.offered?x=s.jsxs("p",{className:"text-sm",id:`why-${e.name}`,children:[`${hi(e.merge.why)}. `,e.merge.thread&&!e.merge.why.startsWith("its thread is at work")?c():null]}):e.merge.offered&&e.merge.caveat&&(x=s.jsx("p",{className:"text-muted-foreground text-sm",children:`${hi(e.merge.caveat)}.`}));return x?s.jsx(ue,{className:"hover:bg-transparent",children:s.jsx(P,{colSpan:6,className:"pt-0",children:x})}):null}const i6=["reason","since","store","repository","folder","home","member_path"];function d1(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 i6){const l=t==null?void 0:t[a];typeof l=="string"&&(n[a]=l)}return n}function _l({base:e="",fetcher:t=fetch}){return async(n,a={})=>{const l=new URLSearchParams;for(const[c,d]of Object.entries(a))if(Array.isArray(d))for(const f of d)l.append(c,f);else d!==void 0&&d!==!1&&d!==""&&l.set(c,String(d));const r=l.size>0?`?${l.toString()}`:"";let i;try{i=await t(`${e}api/app/${n}${r}`,{cache:"no-store"})}catch{return{ok:!1,refusal:{status:0,message:"The viewer did not answer. Is sdlc viewer still running?"}}}const o=await i.json().catch(()=>null);return i.ok?{ok:!0,data:o}:{ok:!1,refusal:d1(i.status,o)}}}function o6(e={}){const t=_l(e),n=l=>async()=>{const r=await t("access");return r.ok?{ok:!0,data:r.data[l]}:r},a=encodeURIComponent;return{tasks:{access:n("tasks"),configuration:()=>t("tasks/configuration"),listTasks:l=>t(`tasks/lists/${a(l)}/tasks`),task:l=>t(`tasks/tasks/${a(l)}`)},issues:{access:n("issues"),list:(l={})=>t("issues",l),issue:l=>t(`issues/${a(l)}`),issueSections:l=>t(`issues/${a(l)}/sections`),issueRelated:l=>t(`issues/${a(l)}/related`)},releases:{access:n("releases"),list:()=>t("releases"),release:l=>t(`releases/${a(l)}`),candidate:()=>t("releases/candidate")},organizations:{access:n("organizations"),list:()=>t("orgs")},projects:{access:n("projects"),list:()=>t("projects")},about:{about:()=>t("about")}}}function c6(e={}){const t=_l(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 mi=e=>({ok:!1,refusal:{status:0,message:e}});function gx({base:e="",fetcher:t=fetch}){return async(n,a)=>{let l;try{l=await t(`${e}api/${n}`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})}catch{return mi("The viewer did not answer. Is sdlc viewer still running?")}const r=await l.json().catch(()=>null);return l.ok?{ok:!0,data:r}:{ok:!1,refusal:d1(l.status,r)}}}function u6(e={}){const t=_l(e),n=gx(e);return{chart:()=>t("org"),change:a=>n("org-change",a)}}function d6(e={}){const t=_l(e),n=o=>`tasks/tasks/${encodeURIComponent(o)}`,{base:a="",fetcher:l=fetch}=e;return{access:async()=>{const o=await t("access");return o.ok?{ok:!0,data:o.data.tasks}:o},availability:async()=>{const o=await t("tasks/configuration");if(!o.ok)return o.refusal.reason==="engine_missing"?{state:"off",refusal:o.refusal}:{state:"error",refusal:o.refusal};const c=o.data;if(c.state!=="active")return{state:"available"};const d=c.workspaces.find(h=>h.is_default)??c.workspaces[0],f=d==null?void 0:d.lists[0];return!d||!f?{state:"error"}:{state:"active",configuration:c,workspace:d,list:f}},listTasks:(o,c={})=>c.state==="archived"?Promise.resolve(mi("This checkout keeps no archived tasks.")):c.assigned_to_me?Promise.resolve(mi("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()=>mi("The local viewer changes tasks only with Done."),complete:async o=>{const c="task"in o?{task:o.task}:{hold:o.hold};let d;try{d=await l(`${a}api/task-done`,{method:"POST",cache:"no-store",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})}catch{return mi("The viewer did not answer. Is sdlc viewer still running?")}if(d.ok)return{ok:!0,data:null};const f=await d.text().catch(()=>"");return{ok:!1,refusal:{status:d.status,message:f||`It was not recorded (HTTP ${d.status}).`}}}}}}function f6(e={}){const t=_l(e),n=gx(e),a=encodeURIComponent,l=r=>r!=null&&r.fresh?{fresh:1}:{};return{access:async()=>{const r=await t("access");return r.ok?{ok:!0,data:r.data.releases}:r},list:(r={})=>t("releases",l(r)),release:(r,i)=>t(`releases/${a(r)}`,l(i)),candidate:r=>t("releases/candidate",l(r)),candidateBatch:r=>t("releases/candidate/batch",l(r)),related:(r,i)=>t(`releases/${a(r)}/related`,l(i)),plannedRelease:(r,i)=>t(`releases/planned/${a(r)}`,l(i)),roadmap:r=>t("releases/roadmap",{...l(r),...r!=null&&r.mine?{mine:1}:{}}),roadmapMoved:r=>t("releases/roadmap/moved",l(r)),roadmapSeen:r=>n("roadmap/seen",{at:r})}}function h6(e={}){const t=_l(e),n=gx(e);return{list:()=>t("worktrees"),sizes:()=>t("worktree-sizes"),merge:a=>n("worktree-merge",{path:a}),remove:a=>n("worktree-remove",{path:a}),dismiss:a=>n("worktree-dismiss",a)}}function m6(e={}){const t=_l(e);return{overview:()=>t("workspaces")}}const p6=15e3,x6=10,Yv="idle-sessions-list",Fv="idle-sessions-heading",Xv="idle-sessions-confirm-text";function f1(e){return e>=1024?`${(e/1024).toFixed(1)} GB`:`${Math.round(e)} MB`}const g6=e=>`${Number.isInteger(e)?e:e.toFixed(1)} h`,h1=e=>e===1?"1 session":`${e} sessions`;function v6(e){const t=e.released.length?`Closed ${h1(e.released.length)}.`:"Closed no sessions.";return e.kept.length?`${t} Kept ${e.kept.length}:`:t}function y6({row:e}){const t=[e.name,e.retired?"continued in another session":"",`idle ${g6(e.idle_hours)}`,f1(e.memory_mb)].filter(Boolean).join(" · ");return s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:e.title}),s.jsxs("p",{className:"caption",children:[s.jsxs("span",{className:"muted",children:[t,e.unfinished&&" ·"]}),e.unfinished&&s.jsx("span",{className:"idle-unfinished",children:" unfinished work"})]})]})}function b6(){const[e,t]=u.useState(null),[n,a]=u.useState(!1),[l,r]=u.useState(!1),[i,o]=u.useState(null),[c,d]=u.useState(null),[f,h]=u.useState(""),m=u.useRef(""),x=u.useRef(null),j=u.useRef(null),v=u.useRef(null),y=u.useRef(null),g=u.useRef(0),p=u.useRef(0),b=u.useCallback(async()=>{const U=++g.current,M=await jL();if(!M||U<p.current)return;p.current=U,h("");const A=JSON.stringify(M);A!==m.current&&(m.current=A,t(M))},[]);u.useEffect(()=>{const U=setTimeout(b,0),M=setInterval(b,p6);return()=>{clearTimeout(U),clearInterval(M)}},[b]),u.useEffect(()=>{var M;const U=y.current;U&&(y.current=null,(M={cancel:j,close:x,dismiss:v}[U].current)==null||M.focus())});const _=(e==null?void 0:e.sessions.length)??0;if(u.useEffect(()=>{l&&!_&&i===null&&r(!1)},[l,_,i]),!_&&!c&&!f&&i===null)return null;const N=()=>{i===null&&(r(!0),y.current="cancel")},R=()=>{i===null&&(r(!1),y.current="close")},w=async()=>{if(i!==null)return;o(_),d(null),h("");const U=await _L();p.current=g.current+1,await b(),o(null),r(!1),a(!1),"error"in U?(h(`The sessions were not closed: ${U.error.replace(/\.+$/,"")}.`),y.current="close"):(d(U.done),y.current="dismiss")},k=()=>{d(null),y.current="close"},L=U=>{U.key==="Escape"&&(U.preventDefault(),R())},D=i!==null?`Closing ${h1(i)}…`:c?v6(c):"",K=(e==null?void 0:e.sessions.slice(0,x6))??[],G=_-K.length;return s.jsxs("div",{className:"idle",role:"group",..._?{"aria-labelledby":Fv}:{"aria-label":"Idle sessions"},children:[f&&s.jsx("div",{className:"alert",role:"alert",children:f}),_>0&&e&&s.jsxs("div",{className:"idle-head",children:[s.jsxs("div",{className:"idle-title",children:[s.jsxs("h2",{className:"group",id:Fv,"aria-label":`Idle sessions, ${_}`,children:["Idle sessions",s.jsx("span",{className:"count",children:_})]}),s.jsxs("p",{className:"caption muted",children:["over ",e.idle_over," h · ",f1(e.memory_mb)]})]}),s.jsxs("div",{className:"tools",children:[s.jsx("button",{type:"button",className:"pin","aria-expanded":n,"aria-controls":Yv,"aria-label":n?"Hide the idle sessions list":"Show the idle sessions list",onClick:()=>a(U=>!U),children:n?"Hide":"Show"}),s.jsx("button",{type:"button",className:"pin",ref:x,"aria-expanded":l,"aria-label":"Close idle sessions…",onClick:N,children:"Close idle…"})]})]}),_>0&&s.jsxs("ul",{className:"idle-list",id:Yv,hidden:!n,"aria-label":`Sessions idle over ${e==null?void 0:e.idle_over} hours, longest idle first`,children:[K.map(U=>s.jsx(y6,{row:U},U.session)),G>0&&s.jsx("li",{children:s.jsxs("p",{className:"caption muted",children:["…and ",G," more"]})})]}),l&&_>0&&s.jsxs("div",{className:"idle-confirm",role:"group","aria-label":"Close idle sessions","aria-describedby":Xv,onKeyDown:L,children:[s.jsxs("p",{id:Xv,children:[_===1?"Close this session?":`Close these ${_} 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:w,children:i!==null?`Closing ${i}…`:`Close ${_}`}),s.jsx("button",{type:"button",className:"pin",ref:j,"aria-disabled":i!==null?!0:void 0,onClick:R,children:"Cancel"})]})]}),s.jsx("p",{className:"idle-status",role:"status",children: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(U=>s.jsxs("li",{children:[s.jsx("p",{className:"idle-name",children:U.title}),s.jsx("p",{className:"caption muted",children:U.why})]},U.session))}),s.jsx("div",{className:"tools start",children:s.jsx("button",{type:"button",className:"pin",ref:v,"aria-label":"Dismiss the close result",onClick:k,children:"Dismiss"})})]})]})}const Kv={ok:"lime",you:"amber",alert:"red",waiting:"blue",blocked:"purple",muted:"grey",plain:"grey"};function Lc(e){return e&&Object.hasOwn(Kv,e)?Kv[e]:"grey"}const j6=1e4,_6=6e4,w6=2,If="#thread-",N6=d0("Threads"),k6={working:"▶",prod:"↑",planned:"○"},Qv=3,Zv=["working","ready","prod","waiting","blocked","paused","planned"],S6={ready:"results ready",prod:"ready for prod"};function C6(e){const t=Zv.map(a=>[a,e.filter(l=>l.state===a).length]),n=[...new Set(e.map(a=>a.state).filter(a=>!Zv.includes(a)))].map(a=>[a,e.filter(l=>l.state===a).length]);return[...t,...n].filter(([,a])=>a>0).map(([a,l])=>`${l} ${S6[a]??a}`).join(" · ")}const R6={Terminal:"Opening in Terminal · if macOS asks whether sdlc viewer may control Terminal, allow it.","VS Code":"Opening in VS Code, in the window on this thread's folder.","Claude app":"Opening in the Claude app."};function T6(e){return e.agent!=="Claude"?null:e.where==="VS Code"?"Open in VS Code":e.where==="Claude app"?e.open?"Open in Claude app":null:e.where==="Terminal"?"Open in Terminal":null}const E6=new Set(["not_terminal","another_process","continued","no_open","pending"]);function Wv({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 Pf({text:e,role:t}){return s.jsx("span",{className:`badge tone-${Lc(t)}`,children:e})}function A6({serves:e}){const t=e.slice(0,w6),n=e.length-t.length;return s.jsxs("p",{className:"caption muted serves",children:[t.map((a,l)=>s.jsxs("span",{children:[l>0&&", ",s.jsxs("a",{href:`releases?planned=${encodeURIComponent(a.planned_release)}`,"aria-label":`serves ${a.name}, ${a.level}: open it in Planned releases`,children:["serves ",a.name," (",a.level,")"]})]},a.planned_release)),n>0&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{"aria-hidden":"true",children:[", +",n," more"]}),s.jsxs("span",{className:"sr-only",children:[", and ",n," more planned releases"]})]})]})}function Jv({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 M6({onConnection:e,org:t=null,project:n=null}){const[a,l]=u.useState(null),[r,i]=u.useState(!1),[o,c]=u.useState(""),[d,f]=u.useState(!1),[h,m]=u.useState(null),[x,j]=u.useState(""),[v,y]=u.useState(null),[g,p]=u.useState(null),[b,_]=u.useState(null),N=u.useRef(""),R=u.useRef(""),w=u.useRef(null),k=u.useRef(null),L=u.useRef(null),D=H=>{var te;return H instanceof HTMLButtonElement&&H.classList.contains("pin")&&((te=w.current)!=null&&te.contains(H))?H.dataset.key??null:null},K=H=>{L.current=D(H.target)},G=()=>{setTimeout(()=>{D(document.activeElement)||(L.current=null)},0)},U=u.useCallback(async()=>{const H=await a1();if("none"in H){i(!0),c(""),e("live");return}if("error"in H){c(H.error),e("disconnected");return}i(!1),c(""),j(""),e("live");const te=JSON.stringify(H.data);te!==N.current&&(N.current=te,l(H.data))},[e]);u.useEffect(()=>{let H=!0;bL().then(le=>H&&f(le));const te=setTimeout(U,0),ee=setInterval(U,j6);return()=>{H=!1,clearTimeout(te),clearInterval(ee)}},[U]),u.useEffect(()=>{let H=!0;const te=()=>yL().then(le=>{H&&le&&y(J=>JSON.stringify(J)===JSON.stringify(le)?J:le)});te();const ee=setInterval(te,_6);return()=>{H=!1,clearInterval(ee)}},[]),u.useEffect(()=>{const H=()=>{var Qe,oe,Oe;const ee=window.location.hash;if(!ee.startsWith(If)){_(null);return}if(ee===R.current)return;let le;try{le=decodeURIComponent(ee.slice(If.length))}catch{le=ee.slice(If.length)}const J=document.getElementById(`thread-${le}`);if(!J||!((Qe=w.current)!=null&&Qe.contains(J))){a&&_(le);return}R.current=ee,_(null),p(le),(oe=J.querySelector(".thread-title"))==null||oe.focus({preventScroll:!0}),(Oe=J.scrollIntoView)==null||Oe.call(J,{block:"center"})},te=()=>{R.current="",H()};return H(),window.addEventListener("hashchange",te),()=>window.removeEventListener("hashchange",te)},[a]),u.useEffect(()=>{if(!g)return;const H=()=>p(null);return document.addEventListener("pointerdown",H,!0),document.addEventListener("keydown",H,!0),()=>{document.removeEventListener("pointerdown",H,!0),document.removeEventListener("keydown",H,!0)}},[g]),u.useLayoutEffect(()=>{const H=L.current??k.current;if(!H||!w.current)return;const te=document.activeElement;if(te&&te!==document.body&&!w.current.contains(te)){L.current=null;return}const ee=[...w.current.querySelectorAll("button.pin")].find(le=>le.dataset.key===H);ee?te!==ee&&ee.focus({preventScroll:H!==k.current}):L.current=null});const M=async H=>{if(h)return;const te=!H.pinned;k.current=H.key,m(H.key);const ee=await NL(H.key,te);m(null),ee||l(le=>le&&{...le,threads:le.threads.map(J=>J.key===H.key?{...J,pinned:te}:J)}),await U(),j(ee?`The pin was not saved: ${ee}`:""),k.current===H.key&&(k.current=null)},[A,S]=u.useState(()=>new Set),[E,C]=u.useState({}),$=as(),{confirm:X,confirm_dialog:T}=Co(),I=(H,te)=>C(ee=>{const{[H]:le,...J}=ee;return te?{...J,[H]:te}:J}),ne=(H,te)=>S(ee=>{const le=new Set(ee);return te?le.add(H):le.delete(H),le}),W=Object.keys(E).some(H=>!A.has(H));u.useEffect(()=>{if(!W)return;const H=()=>C(te=>Object.fromEntries(Object.entries(te).filter(([ee])=>A.has(ee))));return document.addEventListener("pointerdown",H,!0),document.addEventListener("click",H,!0),()=>{document.removeEventListener("pointerdown",H,!0),document.removeEventListener("click",H,!0)}},[W,A]);const xe=H=>setTimeout(()=>{var te,ee;return(ee=[...((te=w.current)==null?void 0:te.querySelectorAll("button.open-thread"))??[]].find(le=>le.dataset.key===H))==null?void 0:ee.focus()},0),V=async(H,te)=>{const ee=await X({title:`Reopen ${H.title} in Terminal?`,description:`Its session is closed. It opens in a new Terminal window in ${te??"the thread's folder"}, running claude --resume.`,action_label:"Reopen"});return xe(H.key),ee},O=async H=>{if(A.has(H.key))return;let te=!1;for(;;){ne(H.key,!0),I(H.key,{key:H.key,text:R6[H.where??""]??"Opening.",role:"waiting"});const ee=await wL(H.key,te);if(ne(H.key,!1),"done"in ee){I(H.key,null);return}const{reason:le,error:J,where:Qe}=ee.refused;if(le==="closed"&&!te){if(I(H.key,null),!await V(H,Qe))return;te=!0;continue}const oe=le==="outdated"?`${J.replace(/\.*$/,".")} ${$}`:J.replace(/\.*$/,"."),Oe=le==="terminal_denied"?"you":E6.has(le)?"muted":"alert";I(H.key,{key:H.key,text:oe,role:Oe});return}},Y=(a==null?void 0:a.pinnedCount)??0,ae=(a==null?void 0:a.threads)??[];return s.jsxs(s.Fragment,{children:[T,s.jsxs("header",{className:"main-head",children:[s.jsx("h1",{children:"Threads"}),a&&!r&&s.jsx("p",{className:"muted",children:a.line})]}),s.jsxs("section",{className:"card threads","aria-label":"Threads",children:[s.jsx(b6,{}),o&&s.jsxs("div",{className:"alert",role:"alert",children:["Threads unavailable: ",o.replace(/\.+$/,""),". Retrying every 10 s."]}),x&&s.jsx("div",{className:"alert",role:"alert",children:x}),s.jsx("p",{className:"caption muted not-listed",role:"status",children:b!==null&&!r?s.jsxs(s.Fragment,{children:["Thread ",b," is not in this list. ",s.jsx("code",{children:"sdlc view --all"})," lists older threads."]}):null}),r?s.jsx("p",{className:"muted",children:N6}):s.jsxs("div",{className:"thread-list",ref:w,onFocus:K,onBlur:G,children:[ae.map((H,te)=>s.jsxs("div",{children:[Y>0&&te===0&&s.jsx(Wv,{label:"Pinned",count:Y,hint:"Threads you pinned; they stay first in every order"}),Y>0&&te===Y&&s.jsx(Wv,{label:"Other threads",count:ae.length-Y}),s.jsx(O6,{row:v!=null&&v[H.key]?{...H,serves:v[H.key]}:H,arrived:g===H.key,pinnable:d&&typeof H.pinned=="boolean",pinning:h,onPin:()=>M(H),opening:A.has(H.key),note:E[H.key]??null,onOpen:()=>O(H),org:t,project:n})]},H.key)),a&&!ae.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 O6({row:e,arrived:t,pinnable:n,pinning:a,onPin:l,opening:r,note:i,onOpen:o,org:c,project:d}){const f=g=>c?`org/${encodeURIComponent(c)}/tasks/${encodeURIComponent(g)}`:null,h=g=>d?`proj/${encodeURIComponent(d)}/issues/${encodeURIComponent(g)}`:null,m=[e.where||e.agent,e.phase,e.age,e.waitsOn?`waits on ${e.waitsOn}`:""].filter(Boolean).join(" · "),x=T6(e),j=`open-note-${e.key}`,[v,y]=u.useState(!1);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(Pf,{text:e.carried,role:"waiting"}),e.carriedBatch&&s.jsx(Pf,{text:e.carriedBatch.text,role:e.carriedBatch.role})]}):s.jsx(Pf,{text:e.status,role:e.role}),x&&s.jsx("button",{type:"button",className:"open-thread","data-key":e.key,"aria-label":`${x}: ${e.title}`,"aria-describedby":j,"aria-disabled":r?!0:void 0,"aria-busy":r?!0:void 0,onClick:()=>{r||o()},children:r?"Opening…":x}),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||l()},children:e.pinned?"Unpin":"Pin"})]})]}),s.jsx("p",{className:"caption muted",children:m}),x&&s.jsx("p",{id:j,className:`caption open-note tone-${Lc((i==null?void 0:i.role)??"muted")}`,role:(i==null?void 0:i.role)==="alert"||(i==null?void 0:i.role)==="you"?"alert":"status",children:(i==null?void 0:i.text)??null}),e.serves&&e.serves.length>0&&s.jsx(A6,{serves:e.serves}),e.summary&&s.jsx("p",{className:"caption muted",children:e.summary}),e.carriedDetail&&s.jsx("p",{className:"line",children:e.carriedDetail}),e.step&&s.jsxs("p",{className:"caption muted",children:["step: ",e.step]}),e.lines.length>0&&s.jsx("p",{className:"caption muted lines-summary",children:C6(e.lines)}),(v?e.lines:e.lines.slice(0,Qv)).map((g,p)=>s.jsxs("p",{className:`line tone-${Lc(g.role)}`,children:[s.jsxs("span",{"aria-hidden":"true",children:[k6[g.state]??"•"," "]}),g.state==="working"&&s.jsx("span",{className:"sr-only",children:"Working: "}),g.task!==void 0&&s.jsx(Jv,{id:g.task,href:f(g.task)}),g.task!==void 0&&g.text?" ":null,g.text]},`l${p}`)),e.lines.length>Qv&&s.jsx("button",{type:"button",className:"lines-more","aria-expanded":v,"aria-label":v?`Show fewer lines of work of ${e.title}`:`Show all ${e.lines.length} lines of work of ${e.title}`,onClick:()=>y(g=>!g),children:v?"Show fewer":`Show all ${e.lines.length}`}),(e.routed??[]).map(g=>s.jsxs("p",{className:"line",children:["routed ",s.jsx(Jv,{id:g.issue,href:h(g.issue)}),g.title?` ${g.title}`:null]},`r${g.issue}`)),e.holds.map((g,p)=>s.jsx("p",{className:`line tone-${Lc(g.role)}`,children:g.text},`h${p}`)),e.plan&&s.jsx("p",{className:"caption muted",children:e.plan})]})}const $6=5e3;function D6(){const[e,t]=u.useState([]),n=u.useRef(0),a=u.useRef(new Map),l=u.useCallback(c=>{const d=a.current.get(c);d&&clearTimeout(d),a.current.delete(c),t(f=>f.filter(h=>h.id!==c))},[]),r=u.useCallback((c,d)=>{const f=n.current+=1;t(h=>[...h.filter(m=>m.tone!=="error").slice(-2),{id:f,tone:c,message:d}]),c==="success"&&a.current.set(f,setTimeout(()=>l(f),$6))},[l]);u.useEffect(()=>{const c=a.current;return()=>{for(const d of c.values())clearTimeout(d)}},[]);const i=u.useMemo(()=>({success:c=>r("success",c),error:c=>r("error",c)}),[r]),o=s.jsx("div",{"aria-live":"polite","aria-label":"Notifications",className:"pointer-events-none fixed right-4 bottom-4 z-100 flex max-w-[calc(100vw-2rem)] flex-col items-end gap-2",children:e.map(c=>s.jsxs("div",{"data-testid":"viewer-toast",className:"bg-popover text-popover-foreground pointer-events-auto flex w-80 max-w-full items-center gap-3 rounded-md border py-2 pr-2 pl-4 text-sm shadow-lg"+(c.tone==="error"?" border-destructive":""),children:[s.jsx("span",{className:"min-w-0 flex-1 break-words",children:c.message}),s.jsx(q,{type:"button",variant:"ghost",size:"control",className:"shrink-0",onClick:()=>l(c.id),children:"Dismiss"})]},c.id))});return{notify:i,toasts:o}}const m1=/^#(?:(releases)|release=(.+)|planned(?:=(.+))?)$/,z6=/^#task=(.+)$/,L6=/^#issue=(.+)$/,U6=/^iss-\d{1,9}$/;function p1(e){return e.split("/").filter(Boolean).slice(1).join("/")}function B6(e,t=""){const n=e.split("/").filter(Boolean);if(n.length===0)return{page:{kind:"home"}};if(n.length===1){const[o]=n;return o==="threads"?{page:{kind:"org",page:"threads"},threads:!0}:o==="chat"?{forward:"threads"}:o==="tasks"?{page:{kind:"org",page:"tasks"},tasks:!0}:o==="issues"?{page:{kind:"home"},issues:!0}:o==="chart"?{page:{kind:"org",page:"chart"},chart:!0}:o==="worktrees"?{page:{kind:"org",page:"worktrees"},worktrees:!0}:o==="workspaces"?{page:{kind:"org",page:"workspaces"},workspaces:!0}:o==="queues"?{page:{kind:"org",page:"queues"},queues:!0}:o==="releases"?{page:{kind:"home"},releasesForward:!0}:{page:{kind:"not_found"}}}const[a,l,r,i]=n;if(a==="org"&&r==="tasks"&&i==="queues"&&n.length===4)return{forward:`org/${l}/queues${t}`};if(a==="org"&&r==="chat"&&n.length<=4)return{forward:`org/${l}/threads${i===void 0?"":`#thread-${i}`}`};if(a==="org"&&r==="tasks"&&n.length===4){const o=decodeURIComponent(i);return{page:{kind:"org",page:"tasks",item:o},org:decodeURIComponent(l),task:o}}if(a==="org"&&r==="issues"&&n.length<=4){const o=decodeURIComponent(l);return i===void 0?{page:{kind:"home"},org:o,issues:!0}:{page:{kind:"home"},org:o,issues:!0,issue:decodeURIComponent(i)}}if(a==="proj"&&r==="issues"&&n.length<=4){const o=decodeURIComponent(l),c={kind:"project",project:o,page:"issues"};if(i===void 0)return{page:c,issues:!0,project:o};const d=decodeURIComponent(i),f=new URLSearchParams(t);f.delete("from");const h=f.toString();return{page:{...c,item:d,...h?{list_query:h}:{}},issues:!0,project:o,issue:d}}if(a==="org"&&n.length<=3){const o=decodeURIComponent(l);if(r===void 0)return{page:{kind:"home"},org:o};if(r==="threads")return{page:{kind:"org",page:"threads"},org:o,threads:!0};if(r==="tasks")return{page:{kind:"org",page:"tasks"},org:o,tasks:!0};if(r==="chart")return{page:{kind:"org",page:"chart"},org:o,chart:!0};if(r==="worktrees")return{page:{kind:"org",page:"worktrees"},org:o,worktrees:!0};if(r==="workspaces")return{page:{kind:"org",page:"workspaces"},org:o,workspaces:!0};if(r==="queues")return{page:{kind:"org",page:"queues"},org:o,queues:!0};if(r==="releases")return{page:{kind:"home"},org:o,releasesForward:!0}}if(a==="proj"&&n.length<=3){const o=decodeURIComponent(l);if(r===void 0)return{page:{kind:"project",project:o}};if(r==="tasks")return{page:{kind:"project",project:o,page:"tasks"},tasks:!0};if(r==="releases")return{page:{kind:"project",project:o,page:"releases"},releases:!0}}return{page:{kind:"not_found"}}}const H6={label:"Local viewer",can:()=>!1},I6={connecting:"Connecting…",live:"Live · refreshes every 10s",disconnected:"Disconnected"},ey=()=>s.jsx(s1,{title:"Page not found",children:"There is no page at this address in this viewer."});function P6({routeOrg:e}){const{org:t,engine:n}=yn(),{project:a}=zo(),[l,r]=u.useState("connecting");return n===null?s.jsx("div",{className:"flex h-full min-h-0 flex-1 flex-col overflow-auto px-4 py-4 sm:px-6 lg:px-8",children:s.jsx(Js,{page:"Threads"})}):s.jsxs("div",{className:"main viewer-panel",children:[s.jsxs("p",{className:"connection",role:"status",children:[s.jsx("span",{className:`dot ${l}`,"aria-hidden":"true"}),I6[l]]}),s.jsx(M6,{onConnection:r,org:(t==null?void 0:t.slug)??e??null,project:a})]})}const qa=()=>s.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"Loading…"});function q6({route:e,navigate:t}){var f;const{org:n,projects:a,loading:l,none:r}=yn(),i=e.page.kind==="project"?e.page.project:null,o=i!==null&&a!==null&&!((f=a.find(h=>h.id===i))!=null&&f.current),c=e.org===void 0&&!o&&!l&&n!==null?`org/${encodeURIComponent(n.slug)}/tasks`:null;if(u.useEffect(()=>{c&&t(c)},[c,t]),i!==null&&o)return s.jsx(so,{project:i});if(c||e.org===void 0&&l)return s.jsx(qa,{});const d=(n==null?void 0:n.slug)??e.org;return d===void 0&&i!==null?s.jsx(so,{project:i}):d===void 0&&r?s.jsx(Vr,{}):d===void 0?s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Tasks open once the organization reads."}):s.jsx(H$,{org:d})}function G6({route:e,navigate:t}){const{org:n,loading:a,none:l}=yn(),r=e.org===void 0&&!a&&n!==null?`org/${encodeURIComponent(n.slug)}/queues${window.location.search}`:null;if(u.useEffect(()=>{r&&t(r)},[r,t]),r||e.org===void 0&&a)return s.jsx(qa,{});const i=(n==null?void 0:n.slug)??e.org;if(i===void 0&&l)return s.jsx(Vr,{});if(i===void 0)return s.jsx("p",{className:"p-6 text-sm text-muted-foreground",children:"Queues open once the organization reads."});const o=new URLSearchParams(window.location.search).get("queue");return s.jsx(x3,{org:i,open:o,path:`/org/${encodeURIComponent(i)}/queues`})}function V6({route:e,navigate:t}){var j;const{org:n,projects:a}=yn(),{project:l,settled:r}=zo(),i=e.project??null,o=i!==null&&a!==null&&!((j=a.find(v=>v.id===i))!=null&&j.current),c=window.location.search,d=i===null&&l!==null?`proj/${encodeURIComponent(l)}/issues${e.issue?`/${encodeURIComponent(e.issue)}`:""}${c}`:null;u.useEffect(()=>{d&&t(d)},[d,t]);const[f,h]=u.useState(()=>window.location.search.replace(/^\?/,"")),m=u.useCallback(v=>{window.history.replaceState(window.history.state,"",`${window.location.pathname}${v?`?${v}`:""}`),h(v)},[]);if(i!==null&&o)return s.jsx(so,{project:i});if(d||i===null&&!r)return s.jsx(qa,{});if(i===null)return s.jsx(Vr,{});const x=encodeURIComponent((n==null?void 0:n.slug)??e.org??"");if(e.issue!==void 0){const v=new URLSearchParams(f).get("from");return s.jsx(a3,{org:x,project:i,issue_id:e.issue,from:v,query:f})}return s.jsx(VD,{org:x,project:i,query:f,onQuery:m})}function Y6({issue:e,navigate:t,home:n}){const{project:a,settled:l}=zo(),r=a!==null?`proj/${encodeURIComponent(a)}/issues/${encodeURIComponent(e)}`:null;return u.useEffect(()=>{r&&t(r)},[r,t]),r||!l?s.jsx(qa,{}):n}function zo(){var r;const{projects:e,loading:t,none:n,failure:a}=yn();return{project:((r=e==null?void 0:e.find(i=>i.current))==null?void 0:r.id)??null,settled:!t&&(e!==null||n!==null||!!(a!=null&&a.shown))}}function F6({navigate:e}){const{project:t,settled:n}=zo(),a=t!==null?`proj/${encodeURIComponent(t)}/releases${window.location.search}`:null;return u.useEffect(()=>{a&&e(a)},[a,e]),a||!n?s.jsx(qa,{}):s.jsx(Vr,{})}function ty(e){const t=new URLSearchParams(e);return{release:t.get("release"),planned:t.has("planned")?t.get("planned")??"":null}}function X6({route:e}){var f;const{org:t,projects:n,loading:a}=yn(),l=e.page.kind==="project"?e.page.project:"",[r,i]=u.useState(()=>ty(window.location.search));if(a)return s.jsx(qa,{});if(n!==null&&!((f=n.find(h=>h.id===l))!=null&&f.current))return s.jsx(so,{project:l});const c=`/proj/${encodeURIComponent(l)}/releases`,d=h=>{const m=new URLSearchParams;h!=null&&h.startsWith("planned:")?m.set("planned",h.slice(8)):h&&m.set("release",h);const x=m.size>0?`?${m.toString()}`:"";window.history.replaceState(window.history.state,"",`${window.location.pathname}${x}`),i(ty(x))};return s.jsx(oL,{org:(t==null?void 0:t.slug)??"",query:r,onSelect:d,home:c})}function K6({hash:e,navigate:t,home:n}){const{project:a,settled:l}=zo(),r=m1.exec(e),i=r!=null&&r[2]?Mu(r[2]):null,o=r!=null&&r[3]?Mu(r[3]):null,c=i!==null?`?release=${encodeURIComponent(i)}`:e.startsWith("#planned")?`?planned${o!==null?`=${encodeURIComponent(o)}`:""}`:"",d=a!==null?`proj/${encodeURIComponent(a)}/releases${c}`:null;return u.useEffect(()=>{d&&t(d)},[d,t]),d||!l?s.jsx(qa,{}):n}function qf({route:e,navigate:t}){const{org:n}=yn();let a=e.page;const l=e.org!==void 0&&n!==null&&e.org!==n.slug;l&&(a={kind:"not_found"});let r;if(l)r=s.jsx(ey,{});else if("threads"in e)r=s.jsx(P6,{routeOrg:e.org});else if("task"in e){const i=new URLSearchParams(window.location.search).get("from");r=s.jsx(fD,{org:encodeURIComponent(e.org),task_id:e.task,from:i})}else"tasks"in e?r=s.jsx(q6,{route:e,navigate:t}):"issues"in e?r=s.jsx(V6,{route:e,navigate:t}):"chart"in e?r=s.jsx(U3,{}):"worktrees"in e?r=s.jsx(n6,{org:(n==null?void 0:n.slug)??e.org}):"workspaces"in e?r=s.jsx(DL,{org:(n==null?void 0:n.slug)??e.org}):"queues"in e?r=s.jsx(G6,{route:e,navigate:t}):"releasesForward"in e?r=s.jsx(F6,{navigate:t}):"releases"in e?r=s.jsx(X6,{route:e}):a.kind==="home"?r=s.jsx(Vr,{}):a.kind==="project"?r=s.jsx(so,{project:a.project}):r=s.jsx(ey,{});return s.jsx(pL,{page:a,children:r})}function Q6({task:e,navigate:t,home:n}){const{org:a,loading:l,none:r,failure:i}=yn(),o=a!==null?`org/${encodeURIComponent(a.slug)}/tasks/${encodeURIComponent(e)}`:null,c=!l&&(r!==null||!!(i!=null&&i.shown));return u.useEffect(()=>{o&&t(o)},[o,t]),o||!c?s.jsx(qa,{}):n}const Z6=e=>window.location.replace(e);function Mu(e){try{return decodeURIComponent(e)}catch{return null}}function W6({navigate:e=Z6,data:t}){const n=B6(p1(window.location.pathname),window.location.search),[a,l]=u.useState(null),{notify:r,toasts:i}=D6(),o=z6.exec(window.location.hash),c=o?Mu(o[1]):null,d=L6.exec(window.location.hash),f=d?Mu(d[1]):null,h=f!==null&&U6.test(f)?f:null,m=m1.test(window.location.hash)?window.location.hash:null,x=o!==null&&c===null||d!==null&&h===null,j="forward"in n?n.forward:null;u.useEffect(()=>{j&&e(j)},[j,e]);const v=u.useMemo(()=>{if(t)return t;const g=o6();return{probe:{source:async()=>({label:"Local workspace"})},shell:g,issues:g.issues,tasks:d6(),org:u6(),worktrees:h6(),workspaces:m6(),queues:c6(),releases:f6()}},[t]);if(j||"forward"in n||!v.shell)return null;const y=s.jsx(qf,{route:{page:{kind:"home"}},navigate:e});return s.jsx("div",{className:"app-ui dark",ref:l,children:s.jsxs(EA,{container:a,children:[s.jsx(t0,{data:v,router:l1,identity:H6,notify:r,children:s.jsx(vT,{shell:v.shell,children:x?s.jsx(qf,{route:{page:{kind:"not_found"}},navigate:e}):c!==null?s.jsx(Q6,{task:c,navigate:e,home:y}):h!==null?s.jsx(Y6,{issue:h,navigate:e,home:y}):m!==null?s.jsx(K6,{hash:m,navigate:e,home:y}):s.jsx(qf,{route:n,navigate:e})})}),i]})})}bC.createRoot(document.getElementById("root")).render(s.jsx(u.StrictMode,{children:p1(window.location.pathname)==="app-ui-probe"?s.jsx(CL,{}):s.jsx(W6,{})}));
|