@agile-vibe-coding/avc 0.3.4 → 0.4.0
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/README.md +86 -12
- package/cli/agents/code-implementer.md +33 -46
- package/cli/init.js +4 -3
- package/cli/llm-claude.js +72 -0
- package/cli/llm-gemini.js +76 -0
- package/cli/llm-local.js +52 -0
- package/cli/llm-openai.js +52 -0
- package/cli/llm-provider.js +12 -0
- package/cli/llm-xiaomi.js +51 -0
- package/cli/seed-processor.js +31 -0
- package/cli/worktree-runner.js +268 -26
- package/cli/worktree-tools.js +322 -0
- package/kanban/client/dist/assets/index-BSm2Zo5j.js +380 -0
- package/kanban/client/dist/assets/index-BevZLADh.css +1 -0
- package/kanban/client/dist/index.html +2 -2
- package/kanban/client/src/App.jsx +37 -5
- package/kanban/client/src/components/ceremony/RunModal.jsx +329 -0
- package/kanban/client/src/components/ceremony/SeedModal.jsx +2 -2
- package/kanban/client/src/components/kanban/CardDetailModal.jsx +95 -21
- package/kanban/client/src/components/kanban/RunButton.jsx +34 -153
- package/kanban/client/src/components/process/ProcessMonitorBar.jsx +4 -0
- package/kanban/client/src/lib/api.js +10 -0
- package/kanban/client/src/store/filterStore.js +10 -3
- package/kanban/client/src/store/runStore.js +103 -0
- package/kanban/server/routes/work-items.js +101 -2
- package/kanban/server/workers/run-task-worker.js +60 -11
- package/package.json +1 -1
- package/kanban/client/dist/assets/index-BfLDUxPS.js +0 -353
- package/kanban/client/dist/assets/index-C7W_e4ik.css +0 -1
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
var GI=Object.defineProperty;var YI=(e,t,n)=>t in e?GI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var lm=(e,t,n)=>YI(e,typeof t!="symbol"?t+"":t,n);function XI(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Jr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cm={exports:{}},yl={},um={exports:{}},ze={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its 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;function QI(){if(k1)return ze;k1=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function g(_){return _===null||typeof _!="object"?null:(_=m&&_[m]||_["@@iterator"],typeof _=="function"?_:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function j(_,V,ie){this.props=_,this.context=V,this.refs=S,this.updater=ie||v}j.prototype.isReactComponent={},j.prototype.setState=function(_,V){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,V,"setState")},j.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function k(){}k.prototype=j.prototype;function C(_,V,ie){this.props=_,this.context=V,this.refs=S,this.updater=ie||v}var E=C.prototype=new k;E.constructor=C,w(E,j.prototype),E.isPureReactComponent=!0;var A=Array.isArray,P=Object.prototype.hasOwnProperty,O={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function I(_,V,ie){var ue,te={},se=null,pe=null;if(V!=null)for(ue in V.ref!==void 0&&(pe=V.ref),V.key!==void 0&&(se=""+V.key),V)P.call(V,ue)&&!M.hasOwnProperty(ue)&&(te[ue]=V[ue]);var Ne=arguments.length-2;if(Ne===1)te.children=ie;else if(1<Ne){for(var Y=Array(Ne),me=0;me<Ne;me++)Y[me]=arguments[me+2];te.children=Y}if(_&&_.defaultProps)for(ue in Ne=_.defaultProps,Ne)te[ue]===void 0&&(te[ue]=Ne[ue]);return{$$typeof:e,type:_,key:se,ref:pe,props:te,_owner:O.current}}function z(_,V){return{$$typeof:e,type:_.type,key:V,ref:_.ref,props:_.props,_owner:_._owner}}function K(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function L(_){var V={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(ie){return V[ie]})}var R=/\/+/g;function ee(_,V){return typeof _=="object"&&_!==null&&_.key!=null?L(""+_.key):V.toString(36)}function J(_,V,ie,ue,te){var se=typeof _;(se==="undefined"||se==="boolean")&&(_=null);var pe=!1;if(_===null)pe=!0;else switch(se){case"string":case"number":pe=!0;break;case"object":switch(_.$$typeof){case e:case t:pe=!0}}if(pe)return pe=_,te=te(pe),_=ue===""?"."+ee(pe,0):ue,A(te)?(ie="",_!=null&&(ie=_.replace(R,"$&/")+"/"),J(te,V,ie,"",function(me){return me})):te!=null&&(K(te)&&(te=z(te,ie+(!te.key||pe&&pe.key===te.key?"":(""+te.key).replace(R,"$&/")+"/")+_)),V.push(te)),1;if(pe=0,ue=ue===""?".":ue+":",A(_))for(var Ne=0;Ne<_.length;Ne++){se=_[Ne];var Y=ue+ee(se,Ne);pe+=J(se,V,ie,Y,te)}else if(Y=g(_),typeof Y=="function")for(_=Y.call(_),Ne=0;!(se=_.next()).done;)se=se.value,Y=ue+ee(se,Ne++),pe+=J(se,V,ie,Y,te);else if(se==="object")throw V=String(_),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.");return pe}function ne(_,V,ie){if(_==null)return _;var ue=[],te=0;return J(_,ue,"","",function(se){return V.call(ie,se,te++)}),ue}function re(_){if(_._status===-1){var V=_._result;V=V(),V.then(function(ie){(_._status===0||_._status===-1)&&(_._status=1,_._result=ie)},function(ie){(_._status===0||_._status===-1)&&(_._status=2,_._result=ie)}),_._status===-1&&(_._status=0,_._result=V)}if(_._status===1)return _._result.default;throw _._result}var U={current:null},B={transition:null},G={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:B,ReactCurrentOwner:O};function q(){throw Error("act(...) is not supported in production builds of React.")}return ze.Children={map:ne,forEach:function(_,V,ie){ne(_,function(){V.apply(this,arguments)},ie)},count:function(_){var V=0;return ne(_,function(){V++}),V},toArray:function(_){return ne(_,function(V){return V})||[]},only:function(_){if(!K(_))throw Error("React.Children.only expected to receive a single React element child.");return _}},ze.Component=j,ze.Fragment=n,ze.Profiler=i,ze.PureComponent=C,ze.StrictMode=r,ze.Suspense=d,ze.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=G,ze.act=q,ze.cloneElement=function(_,V,ie){if(_==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+_+".");var ue=w({},_.props),te=_.key,se=_.ref,pe=_._owner;if(V!=null){if(V.ref!==void 0&&(se=V.ref,pe=O.current),V.key!==void 0&&(te=""+V.key),_.type&&_.type.defaultProps)var Ne=_.type.defaultProps;for(Y in V)P.call(V,Y)&&!M.hasOwnProperty(Y)&&(ue[Y]=V[Y]===void 0&&Ne!==void 0?Ne[Y]:V[Y])}var Y=arguments.length-2;if(Y===1)ue.children=ie;else if(1<Y){Ne=Array(Y);for(var me=0;me<Y;me++)Ne[me]=arguments[me+2];ue.children=Ne}return{$$typeof:e,type:_.type,key:te,ref:se,props:ue,_owner:pe}},ze.createContext=function(_){return _={$$typeof:c,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},_.Provider={$$typeof:a,_context:_},_.Consumer=_},ze.createElement=I,ze.createFactory=function(_){var V=I.bind(null,_);return V.type=_,V},ze.createRef=function(){return{current:null}},ze.forwardRef=function(_){return{$$typeof:u,render:_}},ze.isValidElement=K,ze.lazy=function(_){return{$$typeof:h,_payload:{_status:-1,_result:_},_init:re}},ze.memo=function(_,V){return{$$typeof:p,type:_,compare:V===void 0?null:V}},ze.startTransition=function(_){var V=B.transition;B.transition={};try{_()}finally{B.transition=V}},ze.unstable_act=q,ze.useCallback=function(_,V){return U.current.useCallback(_,V)},ze.useContext=function(_){return U.current.useContext(_)},ze.useDebugValue=function(){},ze.useDeferredValue=function(_){return U.current.useDeferredValue(_)},ze.useEffect=function(_,V){return U.current.useEffect(_,V)},ze.useId=function(){return U.current.useId()},ze.useImperativeHandle=function(_,V,ie){return U.current.useImperativeHandle(_,V,ie)},ze.useInsertionEffect=function(_,V){return U.current.useInsertionEffect(_,V)},ze.useLayoutEffect=function(_,V){return U.current.useLayoutEffect(_,V)},ze.useMemo=function(_,V){return U.current.useMemo(_,V)},ze.useReducer=function(_,V,ie){return U.current.useReducer(_,V,ie)},ze.useRef=function(_){return U.current.useRef(_)},ze.useState=function(_){return U.current.useState(_)},ze.useSyncExternalStore=function(_,V,ie){return U.current.useSyncExternalStore(_,V,ie)},ze.useTransition=function(){return U.current.useTransition()},ze.version="18.3.1",ze}var P1;function No(){return P1||(P1=1,um.exports=QI()),um.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its 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 C1;function JI(){if(C1)return yl;C1=1;var e=No(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(u,d,p){var h,m={},g=null,v=null;p!==void 0&&(g=""+p),d.key!==void 0&&(g=""+d.key),d.ref!==void 0&&(v=d.ref);for(h in d)r.call(d,h)&&!a.hasOwnProperty(h)&&(m[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:t,type:u,key:g,ref:v,props:m,_owner:i.current}}return yl.Fragment=n,yl.jsx=c,yl.jsxs=c,yl}var O1;function ZI(){return O1||(O1=1,cm.exports=JI()),cm.exports}var l=ZI(),b=No();const Ya=Jr(b),e3=XI({__proto__:null,default:Ya},[b]);var Wu={},dm={exports:{}},kn={},fm={exports:{}},pm={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its 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
|
+
*/var A1;function t3(){return A1||(A1=1,(function(e){function t(B,G){var q=B.length;B.push(G);e:for(;0<q;){var _=q-1>>>1,V=B[_];if(0<i(V,G))B[_]=G,B[q]=V,q=_;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var G=B[0],q=B.pop();if(q!==G){B[0]=q;e:for(var _=0,V=B.length,ie=V>>>1;_<ie;){var ue=2*(_+1)-1,te=B[ue],se=ue+1,pe=B[se];if(0>i(te,q))se<V&&0>i(pe,te)?(B[_]=pe,B[se]=q,_=se):(B[_]=te,B[ue]=q,_=ue);else if(se<V&&0>i(pe,q))B[_]=pe,B[se]=q,_=se;else break e}}return G}function i(B,G){var q=B.sortIndex-G.sortIndex;return q!==0?q:B.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var d=[],p=[],h=1,m=null,g=3,v=!1,w=!1,S=!1,j=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(B){for(var G=n(p);G!==null;){if(G.callback===null)r(p);else if(G.startTime<=B)r(p),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(p)}}function A(B){if(S=!1,E(B),!w)if(n(d)!==null)w=!0,re(P);else{var G=n(p);G!==null&&U(A,G.startTime-B)}}function P(B,G){w=!1,S&&(S=!1,k(I),I=-1),v=!0;var q=g;try{for(E(G),m=n(d);m!==null&&(!(m.expirationTime>G)||B&&!L());){var _=m.callback;if(typeof _=="function"){m.callback=null,g=m.priorityLevel;var V=_(m.expirationTime<=G);G=e.unstable_now(),typeof V=="function"?m.callback=V:m===n(d)&&r(d),E(G)}else r(d);m=n(d)}if(m!==null)var ie=!0;else{var ue=n(p);ue!==null&&U(A,ue.startTime-G),ie=!1}return ie}finally{m=null,g=q,v=!1}}var O=!1,M=null,I=-1,z=5,K=-1;function L(){return!(e.unstable_now()-K<z)}function R(){if(M!==null){var B=e.unstable_now();K=B;var G=!0;try{G=M(!0,B)}finally{G?ee():(O=!1,M=null)}}else O=!1}var ee;if(typeof C=="function")ee=function(){C(R)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ne=J.port2;J.port1.onmessage=R,ee=function(){ne.postMessage(null)}}else ee=function(){j(R,0)};function re(B){M=B,O||(O=!0,ee())}function U(B,G){I=j(function(){B(e.unstable_now())},G)}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(B){B.callback=null},e.unstable_continueExecution=function(){w||v||(w=!0,re(P))},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(B){switch(g){case 1:case 2:case 3:var G=3;break;default:G=g}var q=g;g=G;try{return B()}finally{g=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var q=g;g=B;try{return G()}finally{g=q}},e.unstable_scheduleCallback=function(B,G,q){var _=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?_+q:_):q=_,B){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=q+V,B={id:h++,callback:G,priorityLevel:B,startTime:q,expirationTime:V,sortIndex:-1},q>_?(B.sortIndex=q,t(p,B),n(d)===null&&B===n(p)&&(S?(k(I),I=-1):S=!0,U(A,q-_))):(B.sortIndex=V,t(d,B),w||v||(w=!0,re(P))),B},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(B){var G=g;return function(){var q=g;g=G;try{return B.apply(this,arguments)}finally{g=q}}}})(pm)),pm}var E1;function n3(){return E1||(E1=1,fm.exports=t3()),fm.exports}/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its 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 T1;function r3(){if(T1)return kn;T1=1;var e=No(),t=n3();function n(s){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+s,f=1;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+s+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function a(s,o){c(s,o),c(s+"Capture",o)}function c(s,o){for(i[s]=o,s=0;s<o.length;s++)r.add(o[s])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[: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]*$/,h={},m={};function g(s){return d.call(m,s)?!0:d.call(h,s)?!1:p.test(s)?m[s]=!0:(h[s]=!0,!1)}function v(s,o,f,x){if(f!==null&&f.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return x?!1:f!==null?!f.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function w(s,o,f,x){if(o===null||typeof o>"u"||v(s,o,f,x))return!0;if(x)return!1;if(f!==null)switch(f.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function S(s,o,f,x,y,N,T){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=x,this.attributeNamespace=y,this.mustUseProperty=f,this.propertyName=s,this.type=o,this.sanitizeURL=N,this.removeEmptyString=T}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){j[s]=new S(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var o=s[0];j[o]=new S(o,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){j[s]=new S(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){j[s]=new S(s,2,!1,s,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(s){j[s]=new S(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){j[s]=new S(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){j[s]=new S(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){j[s]=new S(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){j[s]=new S(s,5,!1,s.toLowerCase(),null,!1,!1)});var k=/[\-:]([a-z])/g;function C(s){return s[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(s){var o=s.replace(k,C);j[o]=new S(o,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var o=s.replace(k,C);j[o]=new S(o,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var o=s.replace(k,C);j[o]=new S(o,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){j[s]=new S(s,1,!1,s.toLowerCase(),null,!1,!1)}),j.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){j[s]=new S(s,1,!1,s.toLowerCase(),null,!0,!0)});function E(s,o,f,x){var y=j.hasOwnProperty(o)?j[o]:null;(y!==null?y.type!==0:x||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(w(o,f,y,x)&&(f=null),x||y===null?g(o)&&(f===null?s.removeAttribute(o):s.setAttribute(o,""+f)):y.mustUseProperty?s[y.propertyName]=f===null?y.type===3?!1:"":f:(o=y.attributeName,x=y.attributeNamespace,f===null?s.removeAttribute(o):(y=y.type,f=y===3||y===4&&f===!0?"":""+f,x?s.setAttributeNS(x,o,f):s.setAttribute(o,f))))}var A=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),O=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),I=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),K=Symbol.for("react.provider"),L=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),B=Symbol.iterator;function G(s){return s===null||typeof s!="object"?null:(s=B&&s[B]||s["@@iterator"],typeof s=="function"?s:null)}var q=Object.assign,_;function V(s){if(_===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);_=o&&o[1]||""}return`
|
|
34
|
+
`+_+s}var ie=!1;function ue(s,o){if(!s||ie)return"";ie=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(o)if(o=function(){throw Error()},Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(Q){var x=Q}Reflect.construct(s,[],o)}else{try{o.call()}catch(Q){x=Q}s.call(o.prototype)}else{try{throw Error()}catch(Q){x=Q}s()}}catch(Q){if(Q&&x&&typeof Q.stack=="string"){for(var y=Q.stack.split(`
|
|
35
|
+
`),N=x.stack.split(`
|
|
36
|
+
`),T=y.length-1,D=N.length-1;1<=T&&0<=D&&y[T]!==N[D];)D--;for(;1<=T&&0<=D;T--,D--)if(y[T]!==N[D]){if(T!==1||D!==1)do if(T--,D--,0>D||y[T]!==N[D]){var $=`
|
|
37
|
+
`+y[T].replace(" at new "," at ");return s.displayName&&$.includes("<anonymous>")&&($=$.replace("<anonymous>",s.displayName)),$}while(1<=T&&0<=D);break}}}finally{ie=!1,Error.prepareStackTrace=f}return(s=s?s.displayName||s.name:"")?V(s):""}function te(s){switch(s.tag){case 5:return V(s.type);case 16:return V("Lazy");case 13:return V("Suspense");case 19:return V("SuspenseList");case 0:case 2:case 15:return s=ue(s.type,!1),s;case 11:return s=ue(s.type.render,!1),s;case 1:return s=ue(s.type,!0),s;default:return""}}function se(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case M:return"Fragment";case O:return"Portal";case z:return"Profiler";case I:return"StrictMode";case ee:return"Suspense";case J:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case L:return(s.displayName||"Context")+".Consumer";case K:return(s._context.displayName||"Context")+".Provider";case R:var o=s.render;return s=s.displayName,s||(s=o.displayName||o.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case ne:return o=s.displayName||null,o!==null?o:se(s.type)||"Memo";case re:o=s._payload,s=s._init;try{return se(s(o))}catch{}}return null}function pe(s){var o=s.type;switch(s.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=o.render,s=s.displayName||s.name||"",o.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return se(o);case 8:return o===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Ne(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Y(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function me(s){var o=Y(s)?"checked":"value",f=Object.getOwnPropertyDescriptor(s.constructor.prototype,o),x=""+s[o];if(!s.hasOwnProperty(o)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var y=f.get,N=f.set;return Object.defineProperty(s,o,{configurable:!0,get:function(){return y.call(this)},set:function(T){x=""+T,N.call(this,T)}}),Object.defineProperty(s,o,{enumerable:f.enumerable}),{getValue:function(){return x},setValue:function(T){x=""+T},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function Ae(s){s._valueTracker||(s._valueTracker=me(s))}function ae(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var f=o.getValue(),x="";return s&&(x=Y(s)?s.checked?"true":"false":s.value),s=x,s!==f?(o.setValue(s),!0):!1}function $e(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Re(s,o){var f=o.checked;return q({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??s._wrapperState.initialChecked})}function Ye(s,o){var f=o.defaultValue==null?"":o.defaultValue,x=o.checked!=null?o.checked:o.defaultChecked;f=Ne(o.value!=null?o.value:f),s._wrapperState={initialChecked:x,initialValue:f,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Qe(s,o){o=o.checked,o!=null&&E(s,"checked",o,!1)}function Mt(s,o){Qe(s,o);var f=Ne(o.value),x=o.type;if(f!=null)x==="number"?(f===0&&s.value===""||s.value!=f)&&(s.value=""+f):s.value!==""+f&&(s.value=""+f);else if(x==="submit"||x==="reset"){s.removeAttribute("value");return}o.hasOwnProperty("value")?xn(s,o.type,f):o.hasOwnProperty("defaultValue")&&xn(s,o.type,Ne(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(s.defaultChecked=!!o.defaultChecked)}function En(s,o,f){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var x=o.type;if(!(x!=="submit"&&x!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+s._wrapperState.initialValue,f||o===s.value||(s.value=o),s.defaultValue=o}f=s.name,f!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,f!==""&&(s.name=f)}function xn(s,o,f){(o!=="number"||$e(s.ownerDocument)!==s)&&(f==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+f&&(s.defaultValue=""+f))}var vn=Array.isArray;function yn(s,o,f,x){if(s=s.options,o){o={};for(var y=0;y<f.length;y++)o["$"+f[y]]=!0;for(f=0;f<s.length;f++)y=o.hasOwnProperty("$"+s[f].value),s[f].selected!==y&&(s[f].selected=y),y&&x&&(s[f].defaultSelected=!0)}else{for(f=""+Ne(f),o=null,y=0;y<s.length;y++){if(s[y].value===f){s[y].selected=!0,x&&(s[y].defaultSelected=!0);return}o!==null||s[y].disabled||(o=s[y])}o!==null&&(o.selected=!0)}}function he(s,o){if(o.dangerouslySetInnerHTML!=null)throw Error(n(91));return q({},o,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function Pe(s,o){var f=o.value;if(f==null){if(f=o.children,o=o.defaultValue,f!=null){if(o!=null)throw Error(n(92));if(vn(f)){if(1<f.length)throw Error(n(93));f=f[0]}o=f}o==null&&(o=""),f=o}s._wrapperState={initialValue:Ne(f)}}function De(s,o){var f=Ne(o.value),x=Ne(o.defaultValue);f!=null&&(f=""+f,f!==s.value&&(s.value=f),o.defaultValue==null&&s.defaultValue!==f&&(s.defaultValue=f)),x!=null&&(s.defaultValue=""+x)}function Xe(s){var o=s.textContent;o===s._wrapperState.initialValue&&o!==""&&o!==null&&(s.value=o)}function Pt(s){switch(s){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function _t(s,o){return s==null||s==="http://www.w3.org/1999/xhtml"?Pt(o):s==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var It,un=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,f,x,y){MSApp.execUnsafeLocalFunction(function(){return s(o,f,x,y)})}:s})(function(s,o){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=o;else{for(It=It||document.createElement("div"),It.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=It.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;o.firstChild;)s.appendChild(o.firstChild)}});function Ke(s,o){if(o){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=o;return}}s.textContent=o}var Dt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Tn=["Webkit","ms","Moz","O"];Object.keys(Dt).forEach(function(s){Tn.forEach(function(o){o=o+s.charAt(0).toUpperCase()+s.substring(1),Dt[o]=Dt[s]})});function ga(s,o,f){return o==null||typeof o=="boolean"||o===""?"":f||typeof o!="number"||o===0||Dt.hasOwnProperty(s)&&Dt[s]?(""+o).trim():o+"px"}function xa(s,o){s=s.style;for(var f in o)if(o.hasOwnProperty(f)){var x=f.indexOf("--")===0,y=ga(f,o[f],x);f==="float"&&(f="cssFloat"),x?s.setProperty(f,y):s[f]=y}}var js=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zr(s,o){if(o){if(js[s]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(n(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(n(61))}if(o.style!=null&&typeof o.style!="object")throw Error(n(62))}}function _r(s,o){if(s.indexOf("-")===-1)return typeof o.is=="string";switch(s){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 pr=null;function _i(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Ii=null,qn=null,hr=null;function va(s){if(s=il(s)){if(typeof Ii!="function")throw Error(n(280));var o=s.stateNode;o&&(o=su(o),Ii(s.stateNode,s.type,o))}}function ya(s){qn?hr?hr.push(s):hr=[s]:qn=s}function Ss(){if(qn){var s=qn,o=hr;if(hr=qn=null,va(s),o)for(s=0;s<o.length;s++)va(o[s])}}function ba(s,o){return s(o)}function Ns(){}var Di=!1;function mr(s,o,f){if(Di)return s(o,f);Di=!0;try{return ba(s,o,f)}finally{Di=!1,(qn!==null||hr!==null)&&(Ns(),Ss())}}function Mn(s,o){var f=s.stateNode;if(f===null)return null;var x=su(f);if(x===null)return null;f=x[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(x=!x.disabled)||(s=s.type,x=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!x;break e;default:s=!1}if(s)return null;if(f&&typeof f!="function")throw Error(n(231,o,typeof f));return f}var fe=!1;if(u)try{var Me={};Object.defineProperty(Me,"passive",{get:function(){fe=!0}}),window.addEventListener("test",Me,Me),window.removeEventListener("test",Me,Me)}catch{fe=!1}function Kn(s,o,f,x,y,N,T,D,$){var Q=Array.prototype.slice.call(arguments,3);try{o.apply(f,Q)}catch(le){this.onError(le)}}var Hn=!1,gr=null,Ri=!1,wa=null,Pp={onError:function(s){Hn=!0,gr=s}};function $c(s,o,f,x,y,N,T,D,$){Hn=!1,gr=null,Kn.apply(Pp,arguments)}function Cp(s,o,f,x,y,N,T,D,$){if($c.apply(this,arguments),Hn){if(Hn){var Q=gr;Hn=!1,gr=null}else throw Error(n(198));Ri||(Ri=!0,wa=Q)}}function ei(s){var o=s,f=s;if(s.alternate)for(;o.return;)o=o.return;else{s=o;do o=s,(o.flags&4098)!==0&&(f=o.return),s=o.return;while(s)}return o.tag===3?f:null}function X(s){if(s.tag===13){var o=s.memoizedState;if(o===null&&(s=s.alternate,s!==null&&(o=s.memoizedState)),o!==null)return o.dehydrated}return null}function Fe(s){if(ei(s)!==s)throw Error(n(188))}function yt(s){var o=s.alternate;if(!o){if(o=ei(s),o===null)throw Error(n(188));return o!==s?null:s}for(var f=s,x=o;;){var y=f.return;if(y===null)break;var N=y.alternate;if(N===null){if(x=y.return,x!==null){f=x;continue}break}if(y.child===N.child){for(N=y.child;N;){if(N===f)return Fe(y),s;if(N===x)return Fe(y),o;N=N.sibling}throw Error(n(188))}if(f.return!==x.return)f=y,x=N;else{for(var T=!1,D=y.child;D;){if(D===f){T=!0,f=y,x=N;break}if(D===x){T=!0,x=y,f=N;break}D=D.sibling}if(!T){for(D=N.child;D;){if(D===f){T=!0,f=N,x=y;break}if(D===x){T=!0,x=N,f=y;break}D=D.sibling}if(!T)throw Error(n(189))}}if(f.alternate!==x)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?s:o}function xr(s){return s=yt(s),s!==null?ks(s):null}function ks(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var o=ks(s);if(o!==null)return o;s=s.sibling}return null}var Ps=t.unstable_scheduleCallback,Cs=t.unstable_cancelCallback,xe=t.unstable_shouldYield,a_=t.unstable_requestPaint,bt=t.unstable_now,o_=t.unstable_getCurrentPriorityLevel,Op=t.unstable_ImmediatePriority,eb=t.unstable_UserBlockingPriority,zc=t.unstable_NormalPriority,l_=t.unstable_LowPriority,tb=t.unstable_IdlePriority,Fc=null,Ir=null;function c_(s){if(Ir&&typeof Ir.onCommitFiberRoot=="function")try{Ir.onCommitFiberRoot(Fc,s,void 0,(s.current.flags&128)===128)}catch{}}var vr=Math.clz32?Math.clz32:f_,u_=Math.log,d_=Math.LN2;function f_(s){return s>>>=0,s===0?32:31-(u_(s)/d_|0)|0}var Bc=64,Vc=4194304;function Fo(s){switch(s&-s){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: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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function Uc(s,o){var f=s.pendingLanes;if(f===0)return 0;var x=0,y=s.suspendedLanes,N=s.pingedLanes,T=f&268435455;if(T!==0){var D=T&~y;D!==0?x=Fo(D):(N&=T,N!==0&&(x=Fo(N)))}else T=f&~y,T!==0?x=Fo(T):N!==0&&(x=Fo(N));if(x===0)return 0;if(o!==0&&o!==x&&(o&y)===0&&(y=x&-x,N=o&-o,y>=N||y===16&&(N&4194240)!==0))return o;if((x&4)!==0&&(x|=f&16),o=s.entangledLanes,o!==0)for(s=s.entanglements,o&=x;0<o;)f=31-vr(o),y=1<<f,x|=s[f],o&=~y;return x}function p_(s,o){switch(s){case 1:case 2:case 4:return o+250;case 8:case 16:case 32:case 64: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 o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function h_(s,o){for(var f=s.suspendedLanes,x=s.pingedLanes,y=s.expirationTimes,N=s.pendingLanes;0<N;){var T=31-vr(N),D=1<<T,$=y[T];$===-1?((D&f)===0||(D&x)!==0)&&(y[T]=p_(D,o)):$<=o&&(s.expiredLanes|=D),N&=~D}}function Ap(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function nb(){var s=Bc;return Bc<<=1,(Bc&4194240)===0&&(Bc=64),s}function Ep(s){for(var o=[],f=0;31>f;f++)o.push(s);return o}function Bo(s,o,f){s.pendingLanes|=o,o!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,o=31-vr(o),s[o]=f}function m_(s,o){var f=s.pendingLanes&~o;s.pendingLanes=o,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=o,s.mutableReadLanes&=o,s.entangledLanes&=o,o=s.entanglements;var x=s.eventTimes;for(s=s.expirationTimes;0<f;){var y=31-vr(f),N=1<<y;o[y]=0,x[y]=-1,s[y]=-1,f&=~N}}function Tp(s,o){var f=s.entangledLanes|=o;for(s=s.entanglements;f;){var x=31-vr(f),y=1<<x;y&o|s[x]&o&&(s[x]|=o),f&=~y}}var He=0;function rb(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var ib,Mp,sb,ab,ob,_p=!1,Wc=[],Li=null,$i=null,zi=null,Vo=new Map,Uo=new Map,Fi=[],g_="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 submit".split(" ");function lb(s,o){switch(s){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":$i=null;break;case"mouseover":case"mouseout":zi=null;break;case"pointerover":case"pointerout":Vo.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(o.pointerId)}}function Wo(s,o,f,x,y,N){return s===null||s.nativeEvent!==N?(s={blockedOn:o,domEventName:f,eventSystemFlags:x,nativeEvent:N,targetContainers:[y]},o!==null&&(o=il(o),o!==null&&Mp(o)),s):(s.eventSystemFlags|=x,o=s.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),s)}function x_(s,o,f,x,y){switch(o){case"focusin":return Li=Wo(Li,s,o,f,x,y),!0;case"dragenter":return $i=Wo($i,s,o,f,x,y),!0;case"mouseover":return zi=Wo(zi,s,o,f,x,y),!0;case"pointerover":var N=y.pointerId;return Vo.set(N,Wo(Vo.get(N)||null,s,o,f,x,y)),!0;case"gotpointercapture":return N=y.pointerId,Uo.set(N,Wo(Uo.get(N)||null,s,o,f,x,y)),!0}return!1}function cb(s){var o=Os(s.target);if(o!==null){var f=ei(o);if(f!==null){if(o=f.tag,o===13){if(o=X(f),o!==null){s.blockedOn=o,ob(s.priority,function(){sb(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){s.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}s.blockedOn=null}function qc(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var f=Dp(s.domEventName,s.eventSystemFlags,o[0],s.nativeEvent);if(f===null){f=s.nativeEvent;var x=new f.constructor(f.type,f);pr=x,f.target.dispatchEvent(x),pr=null}else return o=il(f),o!==null&&Mp(o),s.blockedOn=f,!1;o.shift()}return!0}function ub(s,o,f){qc(s)&&f.delete(o)}function v_(){_p=!1,Li!==null&&qc(Li)&&(Li=null),$i!==null&&qc($i)&&($i=null),zi!==null&&qc(zi)&&(zi=null),Vo.forEach(ub),Uo.forEach(ub)}function qo(s,o){s.blockedOn===o&&(s.blockedOn=null,_p||(_p=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,v_)))}function Ko(s){function o(y){return qo(y,s)}if(0<Wc.length){qo(Wc[0],s);for(var f=1;f<Wc.length;f++){var x=Wc[f];x.blockedOn===s&&(x.blockedOn=null)}}for(Li!==null&&qo(Li,s),$i!==null&&qo($i,s),zi!==null&&qo(zi,s),Vo.forEach(o),Uo.forEach(o),f=0;f<Fi.length;f++)x=Fi[f],x.blockedOn===s&&(x.blockedOn=null);for(;0<Fi.length&&(f=Fi[0],f.blockedOn===null);)cb(f),f.blockedOn===null&&Fi.shift()}var ja=A.ReactCurrentBatchConfig,Kc=!0;function y_(s,o,f,x){var y=He,N=ja.transition;ja.transition=null;try{He=1,Ip(s,o,f,x)}finally{He=y,ja.transition=N}}function b_(s,o,f,x){var y=He,N=ja.transition;ja.transition=null;try{He=4,Ip(s,o,f,x)}finally{He=y,ja.transition=N}}function Ip(s,o,f,x){if(Kc){var y=Dp(s,o,f,x);if(y===null)Jp(s,o,x,Hc,f),lb(s,x);else if(x_(y,s,o,f,x))x.stopPropagation();else if(lb(s,x),o&4&&-1<g_.indexOf(s)){for(;y!==null;){var N=il(y);if(N!==null&&ib(N),N=Dp(s,o,f,x),N===null&&Jp(s,o,x,Hc,f),N===y)break;y=N}y!==null&&x.stopPropagation()}else Jp(s,o,x,null,f)}}var Hc=null;function Dp(s,o,f,x){if(Hc=null,s=_i(x),s=Os(s),s!==null)if(o=ei(s),o===null)s=null;else if(f=o.tag,f===13){if(s=X(o),s!==null)return s;s=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;s=null}else o!==s&&(s=null);return Hc=s,null}function db(s){switch(s){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(o_()){case Op:return 1;case eb:return 4;case zc:case l_:return 16;case tb:return 536870912;default:return 16}default:return 16}}var Bi=null,Rp=null,Gc=null;function fb(){if(Gc)return Gc;var s,o=Rp,f=o.length,x,y="value"in Bi?Bi.value:Bi.textContent,N=y.length;for(s=0;s<f&&o[s]===y[s];s++);var T=f-s;for(x=1;x<=T&&o[f-x]===y[N-x];x++);return Gc=y.slice(s,1<x?1-x:void 0)}function Yc(s){var o=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&o===13&&(s=13)):s=o,s===10&&(s=13),32<=s||s===13?s:0}function Xc(){return!0}function pb(){return!1}function _n(s){function o(f,x,y,N,T){this._reactName=f,this._targetInst=y,this.type=x,this.nativeEvent=N,this.target=T,this.currentTarget=null;for(var D in s)s.hasOwnProperty(D)&&(f=s[D],this[D]=f?f(N):N[D]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Xc:pb,this.isPropagationStopped=pb,this}return q(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Xc)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Xc)},persist:function(){},isPersistent:Xc}),o}var Sa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Lp=_n(Sa),Ho=q({},Sa,{view:0,detail:0}),w_=_n(Ho),$p,zp,Go,Qc=q({},Ho,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bp,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Go&&(Go&&s.type==="mousemove"?($p=s.screenX-Go.screenX,zp=s.screenY-Go.screenY):zp=$p=0,Go=s),$p)},movementY:function(s){return"movementY"in s?s.movementY:zp}}),hb=_n(Qc),j_=q({},Qc,{dataTransfer:0}),S_=_n(j_),N_=q({},Ho,{relatedTarget:0}),Fp=_n(N_),k_=q({},Sa,{animationName:0,elapsedTime:0,pseudoElement:0}),P_=_n(k_),C_=q({},Sa,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),O_=_n(C_),A_=q({},Sa,{data:0}),mb=_n(A_),E_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T_={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"},M_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function __(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=M_[s])?!!o[s]:!1}function Bp(){return __}var I_=q({},Ho,{key:function(s){if(s.key){var o=E_[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=Yc(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?T_[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bp,charCode:function(s){return s.type==="keypress"?Yc(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?Yc(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),D_=_n(I_),R_=q({},Qc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gb=_n(R_),L_=q({},Ho,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bp}),$_=_n(L_),z_=q({},Sa,{propertyName:0,elapsedTime:0,pseudoElement:0}),F_=_n(z_),B_=q({},Qc,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),V_=_n(B_),U_=[9,13,27,32],Vp=u&&"CompositionEvent"in window,Yo=null;u&&"documentMode"in document&&(Yo=document.documentMode);var W_=u&&"TextEvent"in window&&!Yo,xb=u&&(!Vp||Yo&&8<Yo&&11>=Yo),vb=" ",yb=!1;function bb(s,o){switch(s){case"keyup":return U_.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var Na=!1;function q_(s,o){switch(s){case"compositionend":return wb(o);case"keypress":return o.which!==32?null:(yb=!0,vb);case"textInput":return s=o.data,s===vb&&yb?null:s;default:return null}}function K_(s,o){if(Na)return s==="compositionend"||!Vp&&bb(s,o)?(s=fb(),Gc=Rp=Bi=null,Na=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return xb&&o.locale!=="ko"?null:o.data;default:return null}}var H_={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 jb(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!H_[s.type]:o==="textarea"}function Sb(s,o,f,x){ya(x),o=nu(o,"onChange"),0<o.length&&(f=new Lp("onChange","change",null,f,x),s.push({event:f,listeners:o}))}var Xo=null,Qo=null;function G_(s){Bb(s,0)}function Jc(s){var o=Aa(s);if(ae(o))return s}function Y_(s,o){if(s==="change")return o}var Nb=!1;if(u){var Up;if(u){var Wp="oninput"in document;if(!Wp){var kb=document.createElement("div");kb.setAttribute("oninput","return;"),Wp=typeof kb.oninput=="function"}Up=Wp}else Up=!1;Nb=Up&&(!document.documentMode||9<document.documentMode)}function Pb(){Xo&&(Xo.detachEvent("onpropertychange",Cb),Qo=Xo=null)}function Cb(s){if(s.propertyName==="value"&&Jc(Qo)){var o=[];Sb(o,Qo,s,_i(s)),mr(G_,o)}}function X_(s,o,f){s==="focusin"?(Pb(),Xo=o,Qo=f,Xo.attachEvent("onpropertychange",Cb)):s==="focusout"&&Pb()}function Q_(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Jc(Qo)}function J_(s,o){if(s==="click")return Jc(o)}function Z_(s,o){if(s==="input"||s==="change")return Jc(o)}function eI(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var yr=typeof Object.is=="function"?Object.is:eI;function Jo(s,o){if(yr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var f=Object.keys(s),x=Object.keys(o);if(f.length!==x.length)return!1;for(x=0;x<f.length;x++){var y=f[x];if(!d.call(o,y)||!yr(s[y],o[y]))return!1}return!0}function Ob(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Ab(s,o){var f=Ob(s);s=0;for(var x;f;){if(f.nodeType===3){if(x=s+f.textContent.length,s<=o&&x>=o)return{node:f,offset:o-s};s=x}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Ob(f)}}function Eb(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?Eb(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function Tb(){for(var s=window,o=$e();o instanceof s.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)s=o.contentWindow;else break;o=$e(s.document)}return o}function qp(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o&&(o==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||o==="textarea"||s.contentEditable==="true")}function tI(s){var o=Tb(),f=s.focusedElem,x=s.selectionRange;if(o!==f&&f&&f.ownerDocument&&Eb(f.ownerDocument.documentElement,f)){if(x!==null&&qp(f)){if(o=x.start,s=x.end,s===void 0&&(s=o),"selectionStart"in f)f.selectionStart=o,f.selectionEnd=Math.min(s,f.value.length);else if(s=(o=f.ownerDocument||document)&&o.defaultView||window,s.getSelection){s=s.getSelection();var y=f.textContent.length,N=Math.min(x.start,y);x=x.end===void 0?N:Math.min(x.end,y),!s.extend&&N>x&&(y=x,x=N,N=y),y=Ab(f,N);var T=Ab(f,x);y&&T&&(s.rangeCount!==1||s.anchorNode!==y.node||s.anchorOffset!==y.offset||s.focusNode!==T.node||s.focusOffset!==T.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),s.removeAllRanges(),N>x?(s.addRange(o),s.extend(T.node,T.offset)):(o.setEnd(T.node,T.offset),s.addRange(o)))}}for(o=[],s=f;s=s.parentNode;)s.nodeType===1&&o.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<o.length;f++)s=o[f],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var nI=u&&"documentMode"in document&&11>=document.documentMode,ka=null,Kp=null,Zo=null,Hp=!1;function Mb(s,o,f){var x=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Hp||ka==null||ka!==$e(x)||(x=ka,"selectionStart"in x&&qp(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Zo&&Jo(Zo,x)||(Zo=x,x=nu(Kp,"onSelect"),0<x.length&&(o=new Lp("onSelect","select",null,o,f),s.push({event:o,listeners:x}),o.target=ka)))}function Zc(s,o){var f={};return f[s.toLowerCase()]=o.toLowerCase(),f["Webkit"+s]="webkit"+o,f["Moz"+s]="moz"+o,f}var Pa={animationend:Zc("Animation","AnimationEnd"),animationiteration:Zc("Animation","AnimationIteration"),animationstart:Zc("Animation","AnimationStart"),transitionend:Zc("Transition","TransitionEnd")},Gp={},_b={};u&&(_b=document.createElement("div").style,"AnimationEvent"in window||(delete Pa.animationend.animation,delete Pa.animationiteration.animation,delete Pa.animationstart.animation),"TransitionEvent"in window||delete Pa.transitionend.transition);function eu(s){if(Gp[s])return Gp[s];if(!Pa[s])return s;var o=Pa[s],f;for(f in o)if(o.hasOwnProperty(f)&&f in _b)return Gp[s]=o[f];return s}var Ib=eu("animationend"),Db=eu("animationiteration"),Rb=eu("animationstart"),Lb=eu("transitionend"),$b=new Map,zb="abort auxClick 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(" ");function Vi(s,o){$b.set(s,o),a(o,[s])}for(var Yp=0;Yp<zb.length;Yp++){var Xp=zb[Yp],rI=Xp.toLowerCase(),iI=Xp[0].toUpperCase()+Xp.slice(1);Vi(rI,"on"+iI)}Vi(Ib,"onAnimationEnd"),Vi(Db,"onAnimationIteration"),Vi(Rb,"onAnimationStart"),Vi("dblclick","onDoubleClick"),Vi("focusin","onFocus"),Vi("focusout","onBlur"),Vi(Lb,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var el="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(" "),sI=new Set("cancel close invalid load scroll toggle".split(" ").concat(el));function Fb(s,o,f){var x=s.type||"unknown-event";s.currentTarget=f,Cp(x,o,void 0,s),s.currentTarget=null}function Bb(s,o){o=(o&4)!==0;for(var f=0;f<s.length;f++){var x=s[f],y=x.event;x=x.listeners;e:{var N=void 0;if(o)for(var T=x.length-1;0<=T;T--){var D=x[T],$=D.instance,Q=D.currentTarget;if(D=D.listener,$!==N&&y.isPropagationStopped())break e;Fb(y,D,Q),N=$}else for(T=0;T<x.length;T++){if(D=x[T],$=D.instance,Q=D.currentTarget,D=D.listener,$!==N&&y.isPropagationStopped())break e;Fb(y,D,Q),N=$}}}if(Ri)throw s=wa,Ri=!1,wa=null,s}function it(s,o){var f=o[ih];f===void 0&&(f=o[ih]=new Set);var x=s+"__bubble";f.has(x)||(Vb(o,s,2,!1),f.add(x))}function Qp(s,o,f){var x=0;o&&(x|=4),Vb(f,s,x,o)}var tu="_reactListening"+Math.random().toString(36).slice(2);function tl(s){if(!s[tu]){s[tu]=!0,r.forEach(function(f){f!=="selectionchange"&&(sI.has(f)||Qp(f,!1,s),Qp(f,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[tu]||(o[tu]=!0,Qp("selectionchange",!1,o))}}function Vb(s,o,f,x){switch(db(o)){case 1:var y=y_;break;case 4:y=b_;break;default:y=Ip}f=y.bind(null,o,f,s),y=void 0,!fe||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),x?y!==void 0?s.addEventListener(o,f,{capture:!0,passive:y}):s.addEventListener(o,f,!0):y!==void 0?s.addEventListener(o,f,{passive:y}):s.addEventListener(o,f,!1)}function Jp(s,o,f,x,y){var N=x;if((o&1)===0&&(o&2)===0&&x!==null)e:for(;;){if(x===null)return;var T=x.tag;if(T===3||T===4){var D=x.stateNode.containerInfo;if(D===y||D.nodeType===8&&D.parentNode===y)break;if(T===4)for(T=x.return;T!==null;){var $=T.tag;if(($===3||$===4)&&($=T.stateNode.containerInfo,$===y||$.nodeType===8&&$.parentNode===y))return;T=T.return}for(;D!==null;){if(T=Os(D),T===null)return;if($=T.tag,$===5||$===6){x=N=T;continue e}D=D.parentNode}}x=x.return}mr(function(){var Q=N,le=_i(f),ce=[];e:{var oe=$b.get(s);if(oe!==void 0){var ge=Lp,be=s;switch(s){case"keypress":if(Yc(f)===0)break e;case"keydown":case"keyup":ge=D_;break;case"focusin":be="focus",ge=Fp;break;case"focusout":be="blur",ge=Fp;break;case"beforeblur":case"afterblur":ge=Fp;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=hb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=S_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=$_;break;case Ib:case Db:case Rb:ge=P_;break;case Lb:ge=F_;break;case"scroll":ge=w_;break;case"wheel":ge=V_;break;case"copy":case"cut":case"paste":ge=O_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=gb}var je=(o&4)!==0,wt=!je&&s==="scroll",W=je?oe!==null?oe+"Capture":null:oe;je=[];for(var F=Q,H;F!==null;){H=F;var de=H.stateNode;if(H.tag===5&&de!==null&&(H=de,W!==null&&(de=Mn(F,W),de!=null&&je.push(nl(F,de,H)))),wt)break;F=F.return}0<je.length&&(oe=new ge(oe,be,null,f,le),ce.push({event:oe,listeners:je}))}}if((o&7)===0){e:{if(oe=s==="mouseover"||s==="pointerover",ge=s==="mouseout"||s==="pointerout",oe&&f!==pr&&(be=f.relatedTarget||f.fromElement)&&(Os(be)||be[ti]))break e;if((ge||oe)&&(oe=le.window===le?le:(oe=le.ownerDocument)?oe.defaultView||oe.parentWindow:window,ge?(be=f.relatedTarget||f.toElement,ge=Q,be=be?Os(be):null,be!==null&&(wt=ei(be),be!==wt||be.tag!==5&&be.tag!==6)&&(be=null)):(ge=null,be=Q),ge!==be)){if(je=hb,de="onMouseLeave",W="onMouseEnter",F="mouse",(s==="pointerout"||s==="pointerover")&&(je=gb,de="onPointerLeave",W="onPointerEnter",F="pointer"),wt=ge==null?oe:Aa(ge),H=be==null?oe:Aa(be),oe=new je(de,F+"leave",ge,f,le),oe.target=wt,oe.relatedTarget=H,de=null,Os(le)===Q&&(je=new je(W,F+"enter",be,f,le),je.target=H,je.relatedTarget=wt,de=je),wt=de,ge&&be)t:{for(je=ge,W=be,F=0,H=je;H;H=Ca(H))F++;for(H=0,de=W;de;de=Ca(de))H++;for(;0<F-H;)je=Ca(je),F--;for(;0<H-F;)W=Ca(W),H--;for(;F--;){if(je===W||W!==null&&je===W.alternate)break t;je=Ca(je),W=Ca(W)}je=null}else je=null;ge!==null&&Ub(ce,oe,ge,je,!1),be!==null&&wt!==null&&Ub(ce,wt,be,je,!0)}}e:{if(oe=Q?Aa(Q):window,ge=oe.nodeName&&oe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&oe.type==="file")var Se=Y_;else if(jb(oe))if(Nb)Se=Z_;else{Se=Q_;var Ce=X_}else(ge=oe.nodeName)&&ge.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Se=J_);if(Se&&(Se=Se(s,Q))){Sb(ce,Se,f,le);break e}Ce&&Ce(s,oe,Q),s==="focusout"&&(Ce=oe._wrapperState)&&Ce.controlled&&oe.type==="number"&&xn(oe,"number",oe.value)}switch(Ce=Q?Aa(Q):window,s){case"focusin":(jb(Ce)||Ce.contentEditable==="true")&&(ka=Ce,Kp=Q,Zo=null);break;case"focusout":Zo=Kp=ka=null;break;case"mousedown":Hp=!0;break;case"contextmenu":case"mouseup":case"dragend":Hp=!1,Mb(ce,f,le);break;case"selectionchange":if(nI)break;case"keydown":case"keyup":Mb(ce,f,le)}var Oe;if(Vp)e:{switch(s){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Na?bb(s,f)&&(Ie="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(Ie="onCompositionStart");Ie&&(xb&&f.locale!=="ko"&&(Na||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Na&&(Oe=fb()):(Bi=le,Rp="value"in Bi?Bi.value:Bi.textContent,Na=!0)),Ce=nu(Q,Ie),0<Ce.length&&(Ie=new mb(Ie,s,null,f,le),ce.push({event:Ie,listeners:Ce}),Oe?Ie.data=Oe:(Oe=wb(f),Oe!==null&&(Ie.data=Oe)))),(Oe=W_?q_(s,f):K_(s,f))&&(Q=nu(Q,"onBeforeInput"),0<Q.length&&(le=new mb("onBeforeInput","beforeinput",null,f,le),ce.push({event:le,listeners:Q}),le.data=Oe))}Bb(ce,o)})}function nl(s,o,f){return{instance:s,listener:o,currentTarget:f}}function nu(s,o){for(var f=o+"Capture",x=[];s!==null;){var y=s,N=y.stateNode;y.tag===5&&N!==null&&(y=N,N=Mn(s,f),N!=null&&x.unshift(nl(s,N,y)),N=Mn(s,o),N!=null&&x.push(nl(s,N,y))),s=s.return}return x}function Ca(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function Ub(s,o,f,x,y){for(var N=o._reactName,T=[];f!==null&&f!==x;){var D=f,$=D.alternate,Q=D.stateNode;if($!==null&&$===x)break;D.tag===5&&Q!==null&&(D=Q,y?($=Mn(f,N),$!=null&&T.unshift(nl(f,$,D))):y||($=Mn(f,N),$!=null&&T.push(nl(f,$,D)))),f=f.return}T.length!==0&&s.push({event:o,listeners:T})}var aI=/\r\n?/g,oI=/\u0000|\uFFFD/g;function Wb(s){return(typeof s=="string"?s:""+s).replace(aI,`
|
|
38
|
+
`).replace(oI,"")}function ru(s,o,f){if(o=Wb(o),Wb(s)!==o&&f)throw Error(n(425))}function iu(){}var Zp=null,eh=null;function th(s,o){return s==="textarea"||s==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var nh=typeof setTimeout=="function"?setTimeout:void 0,lI=typeof clearTimeout=="function"?clearTimeout:void 0,qb=typeof Promise=="function"?Promise:void 0,cI=typeof queueMicrotask=="function"?queueMicrotask:typeof qb<"u"?function(s){return qb.resolve(null).then(s).catch(uI)}:nh;function uI(s){setTimeout(function(){throw s})}function rh(s,o){var f=o,x=0;do{var y=f.nextSibling;if(s.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"){if(x===0){s.removeChild(y),Ko(o);return}x--}else f!=="$"&&f!=="$?"&&f!=="$!"||x++;f=y}while(f);Ko(o)}function Ui(s){for(;s!=null;s=s.nextSibling){var o=s.nodeType;if(o===1||o===3)break;if(o===8){if(o=s.data,o==="$"||o==="$!"||o==="$?")break;if(o==="/$")return null}}return s}function Kb(s){s=s.previousSibling;for(var o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="$"||f==="$!"||f==="$?"){if(o===0)return s;o--}else f==="/$"&&o++}s=s.previousSibling}return null}var Oa=Math.random().toString(36).slice(2),Dr="__reactFiber$"+Oa,rl="__reactProps$"+Oa,ti="__reactContainer$"+Oa,ih="__reactEvents$"+Oa,dI="__reactListeners$"+Oa,fI="__reactHandles$"+Oa;function Os(s){var o=s[Dr];if(o)return o;for(var f=s.parentNode;f;){if(o=f[ti]||f[Dr]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(s=Kb(s);s!==null;){if(f=s[Dr])return f;s=Kb(s)}return o}s=f,f=s.parentNode}return null}function il(s){return s=s[Dr]||s[ti],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function Aa(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function su(s){return s[rl]||null}var sh=[],Ea=-1;function Wi(s){return{current:s}}function st(s){0>Ea||(s.current=sh[Ea],sh[Ea]=null,Ea--)}function et(s,o){Ea++,sh[Ea]=s.current,s.current=o}var qi={},tn=Wi(qi),bn=Wi(!1),As=qi;function Ta(s,o){var f=s.type.contextTypes;if(!f)return qi;var x=s.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===o)return x.__reactInternalMemoizedMaskedChildContext;var y={},N;for(N in f)y[N]=o[N];return x&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=o,s.__reactInternalMemoizedMaskedChildContext=y),y}function wn(s){return s=s.childContextTypes,s!=null}function au(){st(bn),st(tn)}function Hb(s,o,f){if(tn.current!==qi)throw Error(n(168));et(tn,o),et(bn,f)}function Gb(s,o,f){var x=s.stateNode;if(o=o.childContextTypes,typeof x.getChildContext!="function")return f;x=x.getChildContext();for(var y in x)if(!(y in o))throw Error(n(108,pe(s)||"Unknown",y));return q({},f,x)}function ou(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||qi,As=tn.current,et(tn,s),et(bn,bn.current),!0}function Yb(s,o,f){var x=s.stateNode;if(!x)throw Error(n(169));f?(s=Gb(s,o,As),x.__reactInternalMemoizedMergedChildContext=s,st(bn),st(tn),et(tn,s)):st(bn),et(bn,f)}var ni=null,lu=!1,ah=!1;function Xb(s){ni===null?ni=[s]:ni.push(s)}function pI(s){lu=!0,Xb(s)}function Ki(){if(!ah&&ni!==null){ah=!0;var s=0,o=He;try{var f=ni;for(He=1;s<f.length;s++){var x=f[s];do x=x(!0);while(x!==null)}ni=null,lu=!1}catch(y){throw ni!==null&&(ni=ni.slice(s+1)),Ps(Op,Ki),y}finally{He=o,ah=!1}}return null}var Ma=[],_a=0,cu=null,uu=0,Gn=[],Yn=0,Es=null,ri=1,ii="";function Ts(s,o){Ma[_a++]=uu,Ma[_a++]=cu,cu=s,uu=o}function Qb(s,o,f){Gn[Yn++]=ri,Gn[Yn++]=ii,Gn[Yn++]=Es,Es=s;var x=ri;s=ii;var y=32-vr(x)-1;x&=~(1<<y),f+=1;var N=32-vr(o)+y;if(30<N){var T=y-y%5;N=(x&(1<<T)-1).toString(32),x>>=T,y-=T,ri=1<<32-vr(o)+y|f<<y|x,ii=N+s}else ri=1<<N|f<<y|x,ii=s}function oh(s){s.return!==null&&(Ts(s,1),Qb(s,1,0))}function lh(s){for(;s===cu;)cu=Ma[--_a],Ma[_a]=null,uu=Ma[--_a],Ma[_a]=null;for(;s===Es;)Es=Gn[--Yn],Gn[Yn]=null,ii=Gn[--Yn],Gn[Yn]=null,ri=Gn[--Yn],Gn[Yn]=null}var In=null,Dn=null,ct=!1,br=null;function Jb(s,o){var f=Zn(5,null,null,0);f.elementType="DELETED",f.stateNode=o,f.return=s,o=s.deletions,o===null?(s.deletions=[f],s.flags|=16):o.push(f)}function Zb(s,o){switch(s.tag){case 5:var f=s.type;return o=o.nodeType!==1||f.toLowerCase()!==o.nodeName.toLowerCase()?null:o,o!==null?(s.stateNode=o,In=s,Dn=Ui(o.firstChild),!0):!1;case 6:return o=s.pendingProps===""||o.nodeType!==3?null:o,o!==null?(s.stateNode=o,In=s,Dn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(f=Es!==null?{id:ri,overflow:ii}:null,s.memoizedState={dehydrated:o,treeContext:f,retryLane:1073741824},f=Zn(18,null,null,0),f.stateNode=o,f.return=s,s.child=f,In=s,Dn=null,!0):!1;default:return!1}}function ch(s){return(s.mode&1)!==0&&(s.flags&128)===0}function uh(s){if(ct){var o=Dn;if(o){var f=o;if(!Zb(s,o)){if(ch(s))throw Error(n(418));o=Ui(f.nextSibling);var x=In;o&&Zb(s,o)?Jb(x,f):(s.flags=s.flags&-4097|2,ct=!1,In=s)}}else{if(ch(s))throw Error(n(418));s.flags=s.flags&-4097|2,ct=!1,In=s}}}function ew(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;In=s}function du(s){if(s!==In)return!1;if(!ct)return ew(s),ct=!0,!1;var o;if((o=s.tag!==3)&&!(o=s.tag!==5)&&(o=s.type,o=o!=="head"&&o!=="body"&&!th(s.type,s.memoizedProps)),o&&(o=Dn)){if(ch(s))throw tw(),Error(n(418));for(;o;)Jb(s,o),o=Ui(o.nextSibling)}if(ew(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));e:{for(s=s.nextSibling,o=0;s;){if(s.nodeType===8){var f=s.data;if(f==="/$"){if(o===0){Dn=Ui(s.nextSibling);break e}o--}else f!=="$"&&f!=="$!"&&f!=="$?"||o++}s=s.nextSibling}Dn=null}}else Dn=In?Ui(s.stateNode.nextSibling):null;return!0}function tw(){for(var s=Dn;s;)s=Ui(s.nextSibling)}function Ia(){Dn=In=null,ct=!1}function dh(s){br===null?br=[s]:br.push(s)}var hI=A.ReactCurrentBatchConfig;function sl(s,o,f){if(s=f.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var x=f.stateNode}if(!x)throw Error(n(147,s));var y=x,N=""+s;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===N?o.ref:(o=function(T){var D=y.refs;T===null?delete D[N]:D[N]=T},o._stringRef=N,o)}if(typeof s!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,s))}return s}function fu(s,o){throw s=Object.prototype.toString.call(o),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s))}function nw(s){var o=s._init;return o(s._payload)}function rw(s){function o(W,F){if(s){var H=W.deletions;H===null?(W.deletions=[F],W.flags|=16):H.push(F)}}function f(W,F){if(!s)return null;for(;F!==null;)o(W,F),F=F.sibling;return null}function x(W,F){for(W=new Map;F!==null;)F.key!==null?W.set(F.key,F):W.set(F.index,F),F=F.sibling;return W}function y(W,F){return W=es(W,F),W.index=0,W.sibling=null,W}function N(W,F,H){return W.index=H,s?(H=W.alternate,H!==null?(H=H.index,H<F?(W.flags|=2,F):H):(W.flags|=2,F)):(W.flags|=1048576,F)}function T(W){return s&&W.alternate===null&&(W.flags|=2),W}function D(W,F,H,de){return F===null||F.tag!==6?(F=nm(H,W.mode,de),F.return=W,F):(F=y(F,H),F.return=W,F)}function $(W,F,H,de){var Se=H.type;return Se===M?le(W,F,H.props.children,de,H.key):F!==null&&(F.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===re&&nw(Se)===F.type)?(de=y(F,H.props),de.ref=sl(W,F,H),de.return=W,de):(de=Ru(H.type,H.key,H.props,null,W.mode,de),de.ref=sl(W,F,H),de.return=W,de)}function Q(W,F,H,de){return F===null||F.tag!==4||F.stateNode.containerInfo!==H.containerInfo||F.stateNode.implementation!==H.implementation?(F=rm(H,W.mode,de),F.return=W,F):(F=y(F,H.children||[]),F.return=W,F)}function le(W,F,H,de,Se){return F===null||F.tag!==7?(F=zs(H,W.mode,de,Se),F.return=W,F):(F=y(F,H),F.return=W,F)}function ce(W,F,H){if(typeof F=="string"&&F!==""||typeof F=="number")return F=nm(""+F,W.mode,H),F.return=W,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case P:return H=Ru(F.type,F.key,F.props,null,W.mode,H),H.ref=sl(W,null,F),H.return=W,H;case O:return F=rm(F,W.mode,H),F.return=W,F;case re:var de=F._init;return ce(W,de(F._payload),H)}if(vn(F)||G(F))return F=zs(F,W.mode,H,null),F.return=W,F;fu(W,F)}return null}function oe(W,F,H,de){var Se=F!==null?F.key:null;if(typeof H=="string"&&H!==""||typeof H=="number")return Se!==null?null:D(W,F,""+H,de);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case P:return H.key===Se?$(W,F,H,de):null;case O:return H.key===Se?Q(W,F,H,de):null;case re:return Se=H._init,oe(W,F,Se(H._payload),de)}if(vn(H)||G(H))return Se!==null?null:le(W,F,H,de,null);fu(W,H)}return null}function ge(W,F,H,de,Se){if(typeof de=="string"&&de!==""||typeof de=="number")return W=W.get(H)||null,D(F,W,""+de,Se);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case P:return W=W.get(de.key===null?H:de.key)||null,$(F,W,de,Se);case O:return W=W.get(de.key===null?H:de.key)||null,Q(F,W,de,Se);case re:var Ce=de._init;return ge(W,F,H,Ce(de._payload),Se)}if(vn(de)||G(de))return W=W.get(H)||null,le(F,W,de,Se,null);fu(F,de)}return null}function be(W,F,H,de){for(var Se=null,Ce=null,Oe=F,Ie=F=0,$t=null;Oe!==null&&Ie<H.length;Ie++){Oe.index>Ie?($t=Oe,Oe=null):$t=Oe.sibling;var Ve=oe(W,Oe,H[Ie],de);if(Ve===null){Oe===null&&(Oe=$t);break}s&&Oe&&Ve.alternate===null&&o(W,Oe),F=N(Ve,F,Ie),Ce===null?Se=Ve:Ce.sibling=Ve,Ce=Ve,Oe=$t}if(Ie===H.length)return f(W,Oe),ct&&Ts(W,Ie),Se;if(Oe===null){for(;Ie<H.length;Ie++)Oe=ce(W,H[Ie],de),Oe!==null&&(F=N(Oe,F,Ie),Ce===null?Se=Oe:Ce.sibling=Oe,Ce=Oe);return ct&&Ts(W,Ie),Se}for(Oe=x(W,Oe);Ie<H.length;Ie++)$t=ge(Oe,W,Ie,H[Ie],de),$t!==null&&(s&&$t.alternate!==null&&Oe.delete($t.key===null?Ie:$t.key),F=N($t,F,Ie),Ce===null?Se=$t:Ce.sibling=$t,Ce=$t);return s&&Oe.forEach(function(ts){return o(W,ts)}),ct&&Ts(W,Ie),Se}function je(W,F,H,de){var Se=G(H);if(typeof Se!="function")throw Error(n(150));if(H=Se.call(H),H==null)throw Error(n(151));for(var Ce=Se=null,Oe=F,Ie=F=0,$t=null,Ve=H.next();Oe!==null&&!Ve.done;Ie++,Ve=H.next()){Oe.index>Ie?($t=Oe,Oe=null):$t=Oe.sibling;var ts=oe(W,Oe,Ve.value,de);if(ts===null){Oe===null&&(Oe=$t);break}s&&Oe&&ts.alternate===null&&o(W,Oe),F=N(ts,F,Ie),Ce===null?Se=ts:Ce.sibling=ts,Ce=ts,Oe=$t}if(Ve.done)return f(W,Oe),ct&&Ts(W,Ie),Se;if(Oe===null){for(;!Ve.done;Ie++,Ve=H.next())Ve=ce(W,Ve.value,de),Ve!==null&&(F=N(Ve,F,Ie),Ce===null?Se=Ve:Ce.sibling=Ve,Ce=Ve);return ct&&Ts(W,Ie),Se}for(Oe=x(W,Oe);!Ve.done;Ie++,Ve=H.next())Ve=ge(Oe,W,Ie,Ve.value,de),Ve!==null&&(s&&Ve.alternate!==null&&Oe.delete(Ve.key===null?Ie:Ve.key),F=N(Ve,F,Ie),Ce===null?Se=Ve:Ce.sibling=Ve,Ce=Ve);return s&&Oe.forEach(function(HI){return o(W,HI)}),ct&&Ts(W,Ie),Se}function wt(W,F,H,de){if(typeof H=="object"&&H!==null&&H.type===M&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case P:e:{for(var Se=H.key,Ce=F;Ce!==null;){if(Ce.key===Se){if(Se=H.type,Se===M){if(Ce.tag===7){f(W,Ce.sibling),F=y(Ce,H.props.children),F.return=W,W=F;break e}}else if(Ce.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===re&&nw(Se)===Ce.type){f(W,Ce.sibling),F=y(Ce,H.props),F.ref=sl(W,Ce,H),F.return=W,W=F;break e}f(W,Ce);break}else o(W,Ce);Ce=Ce.sibling}H.type===M?(F=zs(H.props.children,W.mode,de,H.key),F.return=W,W=F):(de=Ru(H.type,H.key,H.props,null,W.mode,de),de.ref=sl(W,F,H),de.return=W,W=de)}return T(W);case O:e:{for(Ce=H.key;F!==null;){if(F.key===Ce)if(F.tag===4&&F.stateNode.containerInfo===H.containerInfo&&F.stateNode.implementation===H.implementation){f(W,F.sibling),F=y(F,H.children||[]),F.return=W,W=F;break e}else{f(W,F);break}else o(W,F);F=F.sibling}F=rm(H,W.mode,de),F.return=W,W=F}return T(W);case re:return Ce=H._init,wt(W,F,Ce(H._payload),de)}if(vn(H))return be(W,F,H,de);if(G(H))return je(W,F,H,de);fu(W,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,F!==null&&F.tag===6?(f(W,F.sibling),F=y(F,H),F.return=W,W=F):(f(W,F),F=nm(H,W.mode,de),F.return=W,W=F),T(W)):f(W,F)}return wt}var Da=rw(!0),iw=rw(!1),pu=Wi(null),hu=null,Ra=null,fh=null;function ph(){fh=Ra=hu=null}function hh(s){var o=pu.current;st(pu),s._currentValue=o}function mh(s,o,f){for(;s!==null;){var x=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,x!==null&&(x.childLanes|=o)):x!==null&&(x.childLanes&o)!==o&&(x.childLanes|=o),s===f)break;s=s.return}}function La(s,o){hu=s,fh=Ra=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&o)!==0&&(jn=!0),s.firstContext=null)}function Xn(s){var o=s._currentValue;if(fh!==s)if(s={context:s,memoizedValue:o,next:null},Ra===null){if(hu===null)throw Error(n(308));Ra=s,hu.dependencies={lanes:0,firstContext:s}}else Ra=Ra.next=s;return o}var Ms=null;function gh(s){Ms===null?Ms=[s]:Ms.push(s)}function sw(s,o,f,x){var y=o.interleaved;return y===null?(f.next=f,gh(o)):(f.next=y.next,y.next=f),o.interleaved=f,si(s,x)}function si(s,o){s.lanes|=o;var f=s.alternate;for(f!==null&&(f.lanes|=o),f=s,s=s.return;s!==null;)s.childLanes|=o,f=s.alternate,f!==null&&(f.childLanes|=o),f=s,s=s.return;return f.tag===3?f.stateNode:null}var Hi=!1;function xh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function aw(s,o){s=s.updateQueue,o.updateQueue===s&&(o.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function ai(s,o){return{eventTime:s,lane:o,tag:0,payload:null,callback:null,next:null}}function Gi(s,o,f){var x=s.updateQueue;if(x===null)return null;if(x=x.shared,(Be&2)!==0){var y=x.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),x.pending=o,si(s,f)}return y=x.interleaved,y===null?(o.next=o,gh(x)):(o.next=y.next,y.next=o),x.interleaved=o,si(s,f)}function mu(s,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194240)!==0)){var x=o.lanes;x&=s.pendingLanes,f|=x,o.lanes=f,Tp(s,f)}}function ow(s,o){var f=s.updateQueue,x=s.alternate;if(x!==null&&(x=x.updateQueue,f===x)){var y=null,N=null;if(f=f.firstBaseUpdate,f!==null){do{var T={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};N===null?y=N=T:N=N.next=T,f=f.next}while(f!==null);N===null?y=N=o:N=N.next=o}else y=N=o;f={baseState:x.baseState,firstBaseUpdate:y,lastBaseUpdate:N,shared:x.shared,effects:x.effects},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=o:s.next=o,f.lastBaseUpdate=o}function gu(s,o,f,x){var y=s.updateQueue;Hi=!1;var N=y.firstBaseUpdate,T=y.lastBaseUpdate,D=y.shared.pending;if(D!==null){y.shared.pending=null;var $=D,Q=$.next;$.next=null,T===null?N=Q:T.next=Q,T=$;var le=s.alternate;le!==null&&(le=le.updateQueue,D=le.lastBaseUpdate,D!==T&&(D===null?le.firstBaseUpdate=Q:D.next=Q,le.lastBaseUpdate=$))}if(N!==null){var ce=y.baseState;T=0,le=Q=$=null,D=N;do{var oe=D.lane,ge=D.eventTime;if((x&oe)===oe){le!==null&&(le=le.next={eventTime:ge,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var be=s,je=D;switch(oe=o,ge=f,je.tag){case 1:if(be=je.payload,typeof be=="function"){ce=be.call(ge,ce,oe);break e}ce=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=je.payload,oe=typeof be=="function"?be.call(ge,ce,oe):be,oe==null)break e;ce=q({},ce,oe);break e;case 2:Hi=!0}}D.callback!==null&&D.lane!==0&&(s.flags|=64,oe=y.effects,oe===null?y.effects=[D]:oe.push(D))}else ge={eventTime:ge,lane:oe,tag:D.tag,payload:D.payload,callback:D.callback,next:null},le===null?(Q=le=ge,$=ce):le=le.next=ge,T|=oe;if(D=D.next,D===null){if(D=y.shared.pending,D===null)break;oe=D,D=oe.next,oe.next=null,y.lastBaseUpdate=oe,y.shared.pending=null}}while(!0);if(le===null&&($=ce),y.baseState=$,y.firstBaseUpdate=Q,y.lastBaseUpdate=le,o=y.shared.interleaved,o!==null){y=o;do T|=y.lane,y=y.next;while(y!==o)}else N===null&&(y.shared.lanes=0);Ds|=T,s.lanes=T,s.memoizedState=ce}}function lw(s,o,f){if(s=o.effects,o.effects=null,s!==null)for(o=0;o<s.length;o++){var x=s[o],y=x.callback;if(y!==null){if(x.callback=null,x=f,typeof y!="function")throw Error(n(191,y));y.call(x)}}}var al={},Rr=Wi(al),ol=Wi(al),ll=Wi(al);function _s(s){if(s===al)throw Error(n(174));return s}function vh(s,o){switch(et(ll,o),et(ol,s),et(Rr,al),s=o.nodeType,s){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:_t(null,"");break;default:s=s===8?o.parentNode:o,o=s.namespaceURI||null,s=s.tagName,o=_t(o,s)}st(Rr),et(Rr,o)}function $a(){st(Rr),st(ol),st(ll)}function cw(s){_s(ll.current);var o=_s(Rr.current),f=_t(o,s.type);o!==f&&(et(ol,s),et(Rr,f))}function yh(s){ol.current===s&&(st(Rr),st(ol))}var ft=Wi(0);function xu(s){for(var o=s;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var bh=[];function wh(){for(var s=0;s<bh.length;s++)bh[s]._workInProgressVersionPrimary=null;bh.length=0}var vu=A.ReactCurrentDispatcher,jh=A.ReactCurrentBatchConfig,Is=0,pt=null,Ct=null,Rt=null,yu=!1,cl=!1,ul=0,mI=0;function nn(){throw Error(n(321))}function Sh(s,o){if(o===null)return!1;for(var f=0;f<o.length&&f<s.length;f++)if(!yr(s[f],o[f]))return!1;return!0}function Nh(s,o,f,x,y,N){if(Is=N,pt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,vu.current=s===null||s.memoizedState===null?yI:bI,s=f(x,y),cl){N=0;do{if(cl=!1,ul=0,25<=N)throw Error(n(301));N+=1,Rt=Ct=null,o.updateQueue=null,vu.current=wI,s=f(x,y)}while(cl)}if(vu.current=ju,o=Ct!==null&&Ct.next!==null,Is=0,Rt=Ct=pt=null,yu=!1,o)throw Error(n(300));return s}function kh(){var s=ul!==0;return ul=0,s}function Lr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?pt.memoizedState=Rt=s:Rt=Rt.next=s,Rt}function Qn(){if(Ct===null){var s=pt.alternate;s=s!==null?s.memoizedState:null}else s=Ct.next;var o=Rt===null?pt.memoizedState:Rt.next;if(o!==null)Rt=o,Ct=s;else{if(s===null)throw Error(n(310));Ct=s,s={memoizedState:Ct.memoizedState,baseState:Ct.baseState,baseQueue:Ct.baseQueue,queue:Ct.queue,next:null},Rt===null?pt.memoizedState=Rt=s:Rt=Rt.next=s}return Rt}function dl(s,o){return typeof o=="function"?o(s):o}function Ph(s){var o=Qn(),f=o.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=s;var x=Ct,y=x.baseQueue,N=f.pending;if(N!==null){if(y!==null){var T=y.next;y.next=N.next,N.next=T}x.baseQueue=y=N,f.pending=null}if(y!==null){N=y.next,x=x.baseState;var D=T=null,$=null,Q=N;do{var le=Q.lane;if((Is&le)===le)$!==null&&($=$.next={lane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),x=Q.hasEagerState?Q.eagerState:s(x,Q.action);else{var ce={lane:le,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null};$===null?(D=$=ce,T=x):$=$.next=ce,pt.lanes|=le,Ds|=le}Q=Q.next}while(Q!==null&&Q!==N);$===null?T=x:$.next=D,yr(x,o.memoizedState)||(jn=!0),o.memoizedState=x,o.baseState=T,o.baseQueue=$,f.lastRenderedState=x}if(s=f.interleaved,s!==null){y=s;do N=y.lane,pt.lanes|=N,Ds|=N,y=y.next;while(y!==s)}else y===null&&(f.lanes=0);return[o.memoizedState,f.dispatch]}function Ch(s){var o=Qn(),f=o.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=s;var x=f.dispatch,y=f.pending,N=o.memoizedState;if(y!==null){f.pending=null;var T=y=y.next;do N=s(N,T.action),T=T.next;while(T!==y);yr(N,o.memoizedState)||(jn=!0),o.memoizedState=N,o.baseQueue===null&&(o.baseState=N),f.lastRenderedState=N}return[N,x]}function uw(){}function dw(s,o){var f=pt,x=Qn(),y=o(),N=!yr(x.memoizedState,y);if(N&&(x.memoizedState=y,jn=!0),x=x.queue,Oh(hw.bind(null,f,x,s),[s]),x.getSnapshot!==o||N||Rt!==null&&Rt.memoizedState.tag&1){if(f.flags|=2048,fl(9,pw.bind(null,f,x,y,o),void 0,null),Lt===null)throw Error(n(349));(Is&30)!==0||fw(f,o,y)}return y}function fw(s,o,f){s.flags|=16384,s={getSnapshot:o,value:f},o=pt.updateQueue,o===null?(o={lastEffect:null,stores:null},pt.updateQueue=o,o.stores=[s]):(f=o.stores,f===null?o.stores=[s]:f.push(s))}function pw(s,o,f,x){o.value=f,o.getSnapshot=x,mw(o)&&gw(s)}function hw(s,o,f){return f(function(){mw(o)&&gw(s)})}function mw(s){var o=s.getSnapshot;s=s.value;try{var f=o();return!yr(s,f)}catch{return!0}}function gw(s){var o=si(s,1);o!==null&&Nr(o,s,1,-1)}function xw(s){var o=Lr();return typeof s=="function"&&(s=s()),o.memoizedState=o.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:dl,lastRenderedState:s},o.queue=s,s=s.dispatch=vI.bind(null,pt,s),[o.memoizedState,s]}function fl(s,o,f,x){return s={tag:s,create:o,destroy:f,deps:x,next:null},o=pt.updateQueue,o===null?(o={lastEffect:null,stores:null},pt.updateQueue=o,o.lastEffect=s.next=s):(f=o.lastEffect,f===null?o.lastEffect=s.next=s:(x=f.next,f.next=s,s.next=x,o.lastEffect=s)),s}function vw(){return Qn().memoizedState}function bu(s,o,f,x){var y=Lr();pt.flags|=s,y.memoizedState=fl(1|o,f,void 0,x===void 0?null:x)}function wu(s,o,f,x){var y=Qn();x=x===void 0?null:x;var N=void 0;if(Ct!==null){var T=Ct.memoizedState;if(N=T.destroy,x!==null&&Sh(x,T.deps)){y.memoizedState=fl(o,f,N,x);return}}pt.flags|=s,y.memoizedState=fl(1|o,f,N,x)}function yw(s,o){return bu(8390656,8,s,o)}function Oh(s,o){return wu(2048,8,s,o)}function bw(s,o){return wu(4,2,s,o)}function ww(s,o){return wu(4,4,s,o)}function jw(s,o){if(typeof o=="function")return s=s(),o(s),function(){o(null)};if(o!=null)return s=s(),o.current=s,function(){o.current=null}}function Sw(s,o,f){return f=f!=null?f.concat([s]):null,wu(4,4,jw.bind(null,o,s),f)}function Ah(){}function Nw(s,o){var f=Qn();o=o===void 0?null:o;var x=f.memoizedState;return x!==null&&o!==null&&Sh(o,x[1])?x[0]:(f.memoizedState=[s,o],s)}function kw(s,o){var f=Qn();o=o===void 0?null:o;var x=f.memoizedState;return x!==null&&o!==null&&Sh(o,x[1])?x[0]:(s=s(),f.memoizedState=[s,o],s)}function Pw(s,o,f){return(Is&21)===0?(s.baseState&&(s.baseState=!1,jn=!0),s.memoizedState=f):(yr(f,o)||(f=nb(),pt.lanes|=f,Ds|=f,s.baseState=!0),o)}function gI(s,o){var f=He;He=f!==0&&4>f?f:4,s(!0);var x=jh.transition;jh.transition={};try{s(!1),o()}finally{He=f,jh.transition=x}}function Cw(){return Qn().memoizedState}function xI(s,o,f){var x=Ji(s);if(f={lane:x,action:f,hasEagerState:!1,eagerState:null,next:null},Ow(s))Aw(o,f);else if(f=sw(s,o,f,x),f!==null){var y=fn();Nr(f,s,x,y),Ew(f,o,x)}}function vI(s,o,f){var x=Ji(s),y={lane:x,action:f,hasEagerState:!1,eagerState:null,next:null};if(Ow(s))Aw(o,y);else{var N=s.alternate;if(s.lanes===0&&(N===null||N.lanes===0)&&(N=o.lastRenderedReducer,N!==null))try{var T=o.lastRenderedState,D=N(T,f);if(y.hasEagerState=!0,y.eagerState=D,yr(D,T)){var $=o.interleaved;$===null?(y.next=y,gh(o)):(y.next=$.next,$.next=y),o.interleaved=y;return}}catch{}finally{}f=sw(s,o,y,x),f!==null&&(y=fn(),Nr(f,s,x,y),Ew(f,o,x))}}function Ow(s){var o=s.alternate;return s===pt||o!==null&&o===pt}function Aw(s,o){cl=yu=!0;var f=s.pending;f===null?o.next=o:(o.next=f.next,f.next=o),s.pending=o}function Ew(s,o,f){if((f&4194240)!==0){var x=o.lanes;x&=s.pendingLanes,f|=x,o.lanes=f,Tp(s,f)}}var ju={readContext:Xn,useCallback:nn,useContext:nn,useEffect:nn,useImperativeHandle:nn,useInsertionEffect:nn,useLayoutEffect:nn,useMemo:nn,useReducer:nn,useRef:nn,useState:nn,useDebugValue:nn,useDeferredValue:nn,useTransition:nn,useMutableSource:nn,useSyncExternalStore:nn,useId:nn,unstable_isNewReconciler:!1},yI={readContext:Xn,useCallback:function(s,o){return Lr().memoizedState=[s,o===void 0?null:o],s},useContext:Xn,useEffect:yw,useImperativeHandle:function(s,o,f){return f=f!=null?f.concat([s]):null,bu(4194308,4,jw.bind(null,o,s),f)},useLayoutEffect:function(s,o){return bu(4194308,4,s,o)},useInsertionEffect:function(s,o){return bu(4,2,s,o)},useMemo:function(s,o){var f=Lr();return o=o===void 0?null:o,s=s(),f.memoizedState=[s,o],s},useReducer:function(s,o,f){var x=Lr();return o=f!==void 0?f(o):o,x.memoizedState=x.baseState=o,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:o},x.queue=s,s=s.dispatch=xI.bind(null,pt,s),[x.memoizedState,s]},useRef:function(s){var o=Lr();return s={current:s},o.memoizedState=s},useState:xw,useDebugValue:Ah,useDeferredValue:function(s){return Lr().memoizedState=s},useTransition:function(){var s=xw(!1),o=s[0];return s=gI.bind(null,s[1]),Lr().memoizedState=s,[o,s]},useMutableSource:function(){},useSyncExternalStore:function(s,o,f){var x=pt,y=Lr();if(ct){if(f===void 0)throw Error(n(407));f=f()}else{if(f=o(),Lt===null)throw Error(n(349));(Is&30)!==0||fw(x,o,f)}y.memoizedState=f;var N={value:f,getSnapshot:o};return y.queue=N,yw(hw.bind(null,x,N,s),[s]),x.flags|=2048,fl(9,pw.bind(null,x,N,f,o),void 0,null),f},useId:function(){var s=Lr(),o=Lt.identifierPrefix;if(ct){var f=ii,x=ri;f=(x&~(1<<32-vr(x)-1)).toString(32)+f,o=":"+o+"R"+f,f=ul++,0<f&&(o+="H"+f.toString(32)),o+=":"}else f=mI++,o=":"+o+"r"+f.toString(32)+":";return s.memoizedState=o},unstable_isNewReconciler:!1},bI={readContext:Xn,useCallback:Nw,useContext:Xn,useEffect:Oh,useImperativeHandle:Sw,useInsertionEffect:bw,useLayoutEffect:ww,useMemo:kw,useReducer:Ph,useRef:vw,useState:function(){return Ph(dl)},useDebugValue:Ah,useDeferredValue:function(s){var o=Qn();return Pw(o,Ct.memoizedState,s)},useTransition:function(){var s=Ph(dl)[0],o=Qn().memoizedState;return[s,o]},useMutableSource:uw,useSyncExternalStore:dw,useId:Cw,unstable_isNewReconciler:!1},wI={readContext:Xn,useCallback:Nw,useContext:Xn,useEffect:Oh,useImperativeHandle:Sw,useInsertionEffect:bw,useLayoutEffect:ww,useMemo:kw,useReducer:Ch,useRef:vw,useState:function(){return Ch(dl)},useDebugValue:Ah,useDeferredValue:function(s){var o=Qn();return Ct===null?o.memoizedState=s:Pw(o,Ct.memoizedState,s)},useTransition:function(){var s=Ch(dl)[0],o=Qn().memoizedState;return[s,o]},useMutableSource:uw,useSyncExternalStore:dw,useId:Cw,unstable_isNewReconciler:!1};function wr(s,o){if(s&&s.defaultProps){o=q({},o),s=s.defaultProps;for(var f in s)o[f]===void 0&&(o[f]=s[f]);return o}return o}function Eh(s,o,f,x){o=s.memoizedState,f=f(x,o),f=f==null?o:q({},o,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var Su={isMounted:function(s){return(s=s._reactInternals)?ei(s)===s:!1},enqueueSetState:function(s,o,f){s=s._reactInternals;var x=fn(),y=Ji(s),N=ai(x,y);N.payload=o,f!=null&&(N.callback=f),o=Gi(s,N,y),o!==null&&(Nr(o,s,y,x),mu(o,s,y))},enqueueReplaceState:function(s,o,f){s=s._reactInternals;var x=fn(),y=Ji(s),N=ai(x,y);N.tag=1,N.payload=o,f!=null&&(N.callback=f),o=Gi(s,N,y),o!==null&&(Nr(o,s,y,x),mu(o,s,y))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var f=fn(),x=Ji(s),y=ai(f,x);y.tag=2,o!=null&&(y.callback=o),o=Gi(s,y,x),o!==null&&(Nr(o,s,x,f),mu(o,s,x))}};function Tw(s,o,f,x,y,N,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(x,N,T):o.prototype&&o.prototype.isPureReactComponent?!Jo(f,x)||!Jo(y,N):!0}function Mw(s,o,f){var x=!1,y=qi,N=o.contextType;return typeof N=="object"&&N!==null?N=Xn(N):(y=wn(o)?As:tn.current,x=o.contextTypes,N=(x=x!=null)?Ta(s,y):qi),o=new o(f,N),s.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Su,s.stateNode=o,o._reactInternals=s,x&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=y,s.__reactInternalMemoizedMaskedChildContext=N),o}function _w(s,o,f,x){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,x),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,x),o.state!==s&&Su.enqueueReplaceState(o,o.state,null)}function Th(s,o,f,x){var y=s.stateNode;y.props=f,y.state=s.memoizedState,y.refs={},xh(s);var N=o.contextType;typeof N=="object"&&N!==null?y.context=Xn(N):(N=wn(o)?As:tn.current,y.context=Ta(s,N)),y.state=s.memoizedState,N=o.getDerivedStateFromProps,typeof N=="function"&&(Eh(s,o,N,f),y.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(o=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),o!==y.state&&Su.enqueueReplaceState(y,y.state,null),gu(s,f,y,x),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308)}function za(s,o){try{var f="",x=o;do f+=te(x),x=x.return;while(x);var y=f}catch(N){y=`
|
|
39
|
+
Error generating stack: `+N.message+`
|
|
40
|
+
`+N.stack}return{value:s,source:o,stack:y,digest:null}}function Mh(s,o,f){return{value:s,source:null,stack:f??null,digest:o??null}}function _h(s,o){try{console.error(o.value)}catch(f){setTimeout(function(){throw f})}}var jI=typeof WeakMap=="function"?WeakMap:Map;function Iw(s,o,f){f=ai(-1,f),f.tag=3,f.payload={element:null};var x=o.value;return f.callback=function(){Eu||(Eu=!0,Gh=x),_h(s,o)},f}function Dw(s,o,f){f=ai(-1,f),f.tag=3;var x=s.type.getDerivedStateFromError;if(typeof x=="function"){var y=o.value;f.payload=function(){return x(y)},f.callback=function(){_h(s,o)}}var N=s.stateNode;return N!==null&&typeof N.componentDidCatch=="function"&&(f.callback=function(){_h(s,o),typeof x!="function"&&(Xi===null?Xi=new Set([this]):Xi.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})}),f}function Rw(s,o,f){var x=s.pingCache;if(x===null){x=s.pingCache=new jI;var y=new Set;x.set(o,y)}else y=x.get(o),y===void 0&&(y=new Set,x.set(o,y));y.has(f)||(y.add(f),s=RI.bind(null,s,o,f),o.then(s,s))}function Lw(s){do{var o;if((o=s.tag===13)&&(o=s.memoizedState,o=o!==null?o.dehydrated!==null:!0),o)return s;s=s.return}while(s!==null);return null}function $w(s,o,f,x,y){return(s.mode&1)===0?(s===o?s.flags|=65536:(s.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(o=ai(-1,1),o.tag=2,Gi(f,o,1))),f.lanes|=1),s):(s.flags|=65536,s.lanes=y,s)}var SI=A.ReactCurrentOwner,jn=!1;function dn(s,o,f,x){o.child=s===null?iw(o,null,f,x):Da(o,s.child,f,x)}function zw(s,o,f,x,y){f=f.render;var N=o.ref;return La(o,y),x=Nh(s,o,f,x,N,y),f=kh(),s!==null&&!jn?(o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~y,oi(s,o,y)):(ct&&f&&oh(o),o.flags|=1,dn(s,o,x,y),o.child)}function Fw(s,o,f,x,y){if(s===null){var N=f.type;return typeof N=="function"&&!tm(N)&&N.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(o.tag=15,o.type=N,Bw(s,o,N,x,y)):(s=Ru(f.type,null,x,o,o.mode,y),s.ref=o.ref,s.return=o,o.child=s)}if(N=s.child,(s.lanes&y)===0){var T=N.memoizedProps;if(f=f.compare,f=f!==null?f:Jo,f(T,x)&&s.ref===o.ref)return oi(s,o,y)}return o.flags|=1,s=es(N,x),s.ref=o.ref,s.return=o,o.child=s}function Bw(s,o,f,x,y){if(s!==null){var N=s.memoizedProps;if(Jo(N,x)&&s.ref===o.ref)if(jn=!1,o.pendingProps=x=N,(s.lanes&y)!==0)(s.flags&131072)!==0&&(jn=!0);else return o.lanes=s.lanes,oi(s,o,y)}return Ih(s,o,f,x,y)}function Vw(s,o,f){var x=o.pendingProps,y=x.children,N=s!==null?s.memoizedState:null;if(x.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},et(Ba,Rn),Rn|=f;else{if((f&1073741824)===0)return s=N!==null?N.baseLanes|f:f,o.lanes=o.childLanes=1073741824,o.memoizedState={baseLanes:s,cachePool:null,transitions:null},o.updateQueue=null,et(Ba,Rn),Rn|=s,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},x=N!==null?N.baseLanes:f,et(Ba,Rn),Rn|=x}else N!==null?(x=N.baseLanes|f,o.memoizedState=null):x=f,et(Ba,Rn),Rn|=x;return dn(s,o,y,f),o.child}function Uw(s,o){var f=o.ref;(s===null&&f!==null||s!==null&&s.ref!==f)&&(o.flags|=512,o.flags|=2097152)}function Ih(s,o,f,x,y){var N=wn(f)?As:tn.current;return N=Ta(o,N),La(o,y),f=Nh(s,o,f,x,N,y),x=kh(),s!==null&&!jn?(o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~y,oi(s,o,y)):(ct&&x&&oh(o),o.flags|=1,dn(s,o,f,y),o.child)}function Ww(s,o,f,x,y){if(wn(f)){var N=!0;ou(o)}else N=!1;if(La(o,y),o.stateNode===null)ku(s,o),Mw(o,f,x),Th(o,f,x,y),x=!0;else if(s===null){var T=o.stateNode,D=o.memoizedProps;T.props=D;var $=T.context,Q=f.contextType;typeof Q=="object"&&Q!==null?Q=Xn(Q):(Q=wn(f)?As:tn.current,Q=Ta(o,Q));var le=f.getDerivedStateFromProps,ce=typeof le=="function"||typeof T.getSnapshotBeforeUpdate=="function";ce||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(D!==x||$!==Q)&&_w(o,T,x,Q),Hi=!1;var oe=o.memoizedState;T.state=oe,gu(o,x,T,y),$=o.memoizedState,D!==x||oe!==$||bn.current||Hi?(typeof le=="function"&&(Eh(o,f,le,x),$=o.memoizedState),(D=Hi||Tw(o,f,D,x,oe,$,Q))?(ce||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount()),typeof T.componentDidMount=="function"&&(o.flags|=4194308)):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=x,o.memoizedState=$),T.props=x,T.state=$,T.context=Q,x=D):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),x=!1)}else{T=o.stateNode,aw(s,o),D=o.memoizedProps,Q=o.type===o.elementType?D:wr(o.type,D),T.props=Q,ce=o.pendingProps,oe=T.context,$=f.contextType,typeof $=="object"&&$!==null?$=Xn($):($=wn(f)?As:tn.current,$=Ta(o,$));var ge=f.getDerivedStateFromProps;(le=typeof ge=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(D!==ce||oe!==$)&&_w(o,T,x,$),Hi=!1,oe=o.memoizedState,T.state=oe,gu(o,x,T,y);var be=o.memoizedState;D!==ce||oe!==be||bn.current||Hi?(typeof ge=="function"&&(Eh(o,f,ge,x),be=o.memoizedState),(Q=Hi||Tw(o,f,Q,x,oe,be,$)||!1)?(le||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(x,be,$),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(x,be,$)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||D===s.memoizedProps&&oe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&oe===s.memoizedState||(o.flags|=1024),o.memoizedProps=x,o.memoizedState=be),T.props=x,T.state=be,T.context=$,x=Q):(typeof T.componentDidUpdate!="function"||D===s.memoizedProps&&oe===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||D===s.memoizedProps&&oe===s.memoizedState||(o.flags|=1024),x=!1)}return Dh(s,o,f,x,N,y)}function Dh(s,o,f,x,y,N){Uw(s,o);var T=(o.flags&128)!==0;if(!x&&!T)return y&&Yb(o,f,!1),oi(s,o,N);x=o.stateNode,SI.current=o;var D=T&&typeof f.getDerivedStateFromError!="function"?null:x.render();return o.flags|=1,s!==null&&T?(o.child=Da(o,s.child,null,N),o.child=Da(o,null,D,N)):dn(s,o,D,N),o.memoizedState=x.state,y&&Yb(o,f,!0),o.child}function qw(s){var o=s.stateNode;o.pendingContext?Hb(s,o.pendingContext,o.pendingContext!==o.context):o.context&&Hb(s,o.context,!1),vh(s,o.containerInfo)}function Kw(s,o,f,x,y){return Ia(),dh(y),o.flags|=256,dn(s,o,f,x),o.child}var Rh={dehydrated:null,treeContext:null,retryLane:0};function Lh(s){return{baseLanes:s,cachePool:null,transitions:null}}function Hw(s,o,f){var x=o.pendingProps,y=ft.current,N=!1,T=(o.flags&128)!==0,D;if((D=T)||(D=s!==null&&s.memoizedState===null?!1:(y&2)!==0),D?(N=!0,o.flags&=-129):(s===null||s.memoizedState!==null)&&(y|=1),et(ft,y&1),s===null)return uh(o),s=o.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((o.mode&1)===0?o.lanes=1:s.data==="$!"?o.lanes=8:o.lanes=1073741824,null):(T=x.children,s=x.fallback,N?(x=o.mode,N=o.child,T={mode:"hidden",children:T},(x&1)===0&&N!==null?(N.childLanes=0,N.pendingProps=T):N=Lu(T,x,0,null),s=zs(s,x,f,null),N.return=o,s.return=o,N.sibling=s,o.child=N,o.child.memoizedState=Lh(f),o.memoizedState=Rh,s):$h(o,T));if(y=s.memoizedState,y!==null&&(D=y.dehydrated,D!==null))return NI(s,o,T,x,D,y,f);if(N){N=x.fallback,T=o.mode,y=s.child,D=y.sibling;var $={mode:"hidden",children:x.children};return(T&1)===0&&o.child!==y?(x=o.child,x.childLanes=0,x.pendingProps=$,o.deletions=null):(x=es(y,$),x.subtreeFlags=y.subtreeFlags&14680064),D!==null?N=es(D,N):(N=zs(N,T,f,null),N.flags|=2),N.return=o,x.return=o,x.sibling=N,o.child=x,x=N,N=o.child,T=s.child.memoizedState,T=T===null?Lh(f):{baseLanes:T.baseLanes|f,cachePool:null,transitions:T.transitions},N.memoizedState=T,N.childLanes=s.childLanes&~f,o.memoizedState=Rh,x}return N=s.child,s=N.sibling,x=es(N,{mode:"visible",children:x.children}),(o.mode&1)===0&&(x.lanes=f),x.return=o,x.sibling=null,s!==null&&(f=o.deletions,f===null?(o.deletions=[s],o.flags|=16):f.push(s)),o.child=x,o.memoizedState=null,x}function $h(s,o){return o=Lu({mode:"visible",children:o},s.mode,0,null),o.return=s,s.child=o}function Nu(s,o,f,x){return x!==null&&dh(x),Da(o,s.child,null,f),s=$h(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function NI(s,o,f,x,y,N,T){if(f)return o.flags&256?(o.flags&=-257,x=Mh(Error(n(422))),Nu(s,o,T,x)):o.memoizedState!==null?(o.child=s.child,o.flags|=128,null):(N=x.fallback,y=o.mode,x=Lu({mode:"visible",children:x.children},y,0,null),N=zs(N,y,T,null),N.flags|=2,x.return=o,N.return=o,x.sibling=N,o.child=x,(o.mode&1)!==0&&Da(o,s.child,null,T),o.child.memoizedState=Lh(T),o.memoizedState=Rh,N);if((o.mode&1)===0)return Nu(s,o,T,null);if(y.data==="$!"){if(x=y.nextSibling&&y.nextSibling.dataset,x)var D=x.dgst;return x=D,N=Error(n(419)),x=Mh(N,x,void 0),Nu(s,o,T,x)}if(D=(T&s.childLanes)!==0,jn||D){if(x=Lt,x!==null){switch(T&-T){case 4:y=2;break;case 16:y=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(x.suspendedLanes|T))!==0?0:y,y!==0&&y!==N.retryLane&&(N.retryLane=y,si(s,y),Nr(x,s,y,-1))}return em(),x=Mh(Error(n(421))),Nu(s,o,T,x)}return y.data==="$?"?(o.flags|=128,o.child=s.child,o=LI.bind(null,s),y._reactRetry=o,null):(s=N.treeContext,Dn=Ui(y.nextSibling),In=o,ct=!0,br=null,s!==null&&(Gn[Yn++]=ri,Gn[Yn++]=ii,Gn[Yn++]=Es,ri=s.id,ii=s.overflow,Es=o),o=$h(o,x.children),o.flags|=4096,o)}function Gw(s,o,f){s.lanes|=o;var x=s.alternate;x!==null&&(x.lanes|=o),mh(s.return,o,f)}function zh(s,o,f,x,y){var N=s.memoizedState;N===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:x,tail:f,tailMode:y}:(N.isBackwards=o,N.rendering=null,N.renderingStartTime=0,N.last=x,N.tail=f,N.tailMode=y)}function Yw(s,o,f){var x=o.pendingProps,y=x.revealOrder,N=x.tail;if(dn(s,o,x.children,f),x=ft.current,(x&2)!==0)x=x&1|2,o.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=o.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Gw(s,f,o);else if(s.tag===19)Gw(s,f,o);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===o)break e;for(;s.sibling===null;){if(s.return===null||s.return===o)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}x&=1}if(et(ft,x),(o.mode&1)===0)o.memoizedState=null;else switch(y){case"forwards":for(f=o.child,y=null;f!==null;)s=f.alternate,s!==null&&xu(s)===null&&(y=f),f=f.sibling;f=y,f===null?(y=o.child,o.child=null):(y=f.sibling,f.sibling=null),zh(o,!1,y,f,N);break;case"backwards":for(f=null,y=o.child,o.child=null;y!==null;){if(s=y.alternate,s!==null&&xu(s)===null){o.child=y;break}s=y.sibling,y.sibling=f,f=y,y=s}zh(o,!0,f,null,N);break;case"together":zh(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function ku(s,o){(o.mode&1)===0&&s!==null&&(s.alternate=null,o.alternate=null,o.flags|=2)}function oi(s,o,f){if(s!==null&&(o.dependencies=s.dependencies),Ds|=o.lanes,(f&o.childLanes)===0)return null;if(s!==null&&o.child!==s.child)throw Error(n(153));if(o.child!==null){for(s=o.child,f=es(s,s.pendingProps),o.child=f,f.return=o;s.sibling!==null;)s=s.sibling,f=f.sibling=es(s,s.pendingProps),f.return=o;f.sibling=null}return o.child}function kI(s,o,f){switch(o.tag){case 3:qw(o),Ia();break;case 5:cw(o);break;case 1:wn(o.type)&&ou(o);break;case 4:vh(o,o.stateNode.containerInfo);break;case 10:var x=o.type._context,y=o.memoizedProps.value;et(pu,x._currentValue),x._currentValue=y;break;case 13:if(x=o.memoizedState,x!==null)return x.dehydrated!==null?(et(ft,ft.current&1),o.flags|=128,null):(f&o.child.childLanes)!==0?Hw(s,o,f):(et(ft,ft.current&1),s=oi(s,o,f),s!==null?s.sibling:null);et(ft,ft.current&1);break;case 19:if(x=(f&o.childLanes)!==0,(s.flags&128)!==0){if(x)return Yw(s,o,f);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),et(ft,ft.current),x)break;return null;case 22:case 23:return o.lanes=0,Vw(s,o,f)}return oi(s,o,f)}var Xw,Fh,Qw,Jw;Xw=function(s,o){for(var f=o.child;f!==null;){if(f.tag===5||f.tag===6)s.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===o)break;for(;f.sibling===null;){if(f.return===null||f.return===o)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},Fh=function(){},Qw=function(s,o,f,x){var y=s.memoizedProps;if(y!==x){s=o.stateNode,_s(Rr.current);var N=null;switch(f){case"input":y=Re(s,y),x=Re(s,x),N=[];break;case"select":y=q({},y,{value:void 0}),x=q({},x,{value:void 0}),N=[];break;case"textarea":y=he(s,y),x=he(s,x),N=[];break;default:typeof y.onClick!="function"&&typeof x.onClick=="function"&&(s.onclick=iu)}Zr(f,x);var T;f=null;for(Q in y)if(!x.hasOwnProperty(Q)&&y.hasOwnProperty(Q)&&y[Q]!=null)if(Q==="style"){var D=y[Q];for(T in D)D.hasOwnProperty(T)&&(f||(f={}),f[T]="")}else Q!=="dangerouslySetInnerHTML"&&Q!=="children"&&Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(i.hasOwnProperty(Q)?N||(N=[]):(N=N||[]).push(Q,null));for(Q in x){var $=x[Q];if(D=y!=null?y[Q]:void 0,x.hasOwnProperty(Q)&&$!==D&&($!=null||D!=null))if(Q==="style")if(D){for(T in D)!D.hasOwnProperty(T)||$&&$.hasOwnProperty(T)||(f||(f={}),f[T]="");for(T in $)$.hasOwnProperty(T)&&D[T]!==$[T]&&(f||(f={}),f[T]=$[T])}else f||(N||(N=[]),N.push(Q,f)),f=$;else Q==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,D=D?D.__html:void 0,$!=null&&D!==$&&(N=N||[]).push(Q,$)):Q==="children"?typeof $!="string"&&typeof $!="number"||(N=N||[]).push(Q,""+$):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&(i.hasOwnProperty(Q)?($!=null&&Q==="onScroll"&&it("scroll",s),N||D===$||(N=[])):(N=N||[]).push(Q,$))}f&&(N=N||[]).push("style",f);var Q=N;(o.updateQueue=Q)&&(o.flags|=4)}},Jw=function(s,o,f,x){f!==x&&(o.flags|=4)};function pl(s,o){if(!ct)switch(s.tailMode){case"hidden":o=s.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?s.tail=null:f.sibling=null;break;case"collapsed":f=s.tail;for(var x=null;f!==null;)f.alternate!==null&&(x=f),f=f.sibling;x===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:x.sibling=null}}function rn(s){var o=s.alternate!==null&&s.alternate.child===s.child,f=0,x=0;if(o)for(var y=s.child;y!==null;)f|=y.lanes|y.childLanes,x|=y.subtreeFlags&14680064,x|=y.flags&14680064,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)f|=y.lanes|y.childLanes,x|=y.subtreeFlags,x|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=x,s.childLanes=f,o}function PI(s,o,f){var x=o.pendingProps;switch(lh(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(o),null;case 1:return wn(o.type)&&au(),rn(o),null;case 3:return x=o.stateNode,$a(),st(bn),st(tn),wh(),x.pendingContext&&(x.context=x.pendingContext,x.pendingContext=null),(s===null||s.child===null)&&(du(o)?o.flags|=4:s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,br!==null&&(Qh(br),br=null))),Fh(s,o),rn(o),null;case 5:yh(o);var y=_s(ll.current);if(f=o.type,s!==null&&o.stateNode!=null)Qw(s,o,f,x,y),s.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!x){if(o.stateNode===null)throw Error(n(166));return rn(o),null}if(s=_s(Rr.current),du(o)){x=o.stateNode,f=o.type;var N=o.memoizedProps;switch(x[Dr]=o,x[rl]=N,s=(o.mode&1)!==0,f){case"dialog":it("cancel",x),it("close",x);break;case"iframe":case"object":case"embed":it("load",x);break;case"video":case"audio":for(y=0;y<el.length;y++)it(el[y],x);break;case"source":it("error",x);break;case"img":case"image":case"link":it("error",x),it("load",x);break;case"details":it("toggle",x);break;case"input":Ye(x,N),it("invalid",x);break;case"select":x._wrapperState={wasMultiple:!!N.multiple},it("invalid",x);break;case"textarea":Pe(x,N),it("invalid",x)}Zr(f,N),y=null;for(var T in N)if(N.hasOwnProperty(T)){var D=N[T];T==="children"?typeof D=="string"?x.textContent!==D&&(N.suppressHydrationWarning!==!0&&ru(x.textContent,D,s),y=["children",D]):typeof D=="number"&&x.textContent!==""+D&&(N.suppressHydrationWarning!==!0&&ru(x.textContent,D,s),y=["children",""+D]):i.hasOwnProperty(T)&&D!=null&&T==="onScroll"&&it("scroll",x)}switch(f){case"input":Ae(x),En(x,N,!0);break;case"textarea":Ae(x),Xe(x);break;case"select":case"option":break;default:typeof N.onClick=="function"&&(x.onclick=iu)}x=y,o.updateQueue=x,x!==null&&(o.flags|=4)}else{T=y.nodeType===9?y:y.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Pt(f)),s==="http://www.w3.org/1999/xhtml"?f==="script"?(s=T.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof x.is=="string"?s=T.createElement(f,{is:x.is}):(s=T.createElement(f),f==="select"&&(T=s,x.multiple?T.multiple=!0:x.size&&(T.size=x.size))):s=T.createElementNS(s,f),s[Dr]=o,s[rl]=x,Xw(s,o,!1,!1),o.stateNode=s;e:{switch(T=_r(f,x),f){case"dialog":it("cancel",s),it("close",s),y=x;break;case"iframe":case"object":case"embed":it("load",s),y=x;break;case"video":case"audio":for(y=0;y<el.length;y++)it(el[y],s);y=x;break;case"source":it("error",s),y=x;break;case"img":case"image":case"link":it("error",s),it("load",s),y=x;break;case"details":it("toggle",s),y=x;break;case"input":Ye(s,x),y=Re(s,x),it("invalid",s);break;case"option":y=x;break;case"select":s._wrapperState={wasMultiple:!!x.multiple},y=q({},x,{value:void 0}),it("invalid",s);break;case"textarea":Pe(s,x),y=he(s,x),it("invalid",s);break;default:y=x}Zr(f,y),D=y;for(N in D)if(D.hasOwnProperty(N)){var $=D[N];N==="style"?xa(s,$):N==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&un(s,$)):N==="children"?typeof $=="string"?(f!=="textarea"||$!=="")&&Ke(s,$):typeof $=="number"&&Ke(s,""+$):N!=="suppressContentEditableWarning"&&N!=="suppressHydrationWarning"&&N!=="autoFocus"&&(i.hasOwnProperty(N)?$!=null&&N==="onScroll"&&it("scroll",s):$!=null&&E(s,N,$,T))}switch(f){case"input":Ae(s),En(s,x,!1);break;case"textarea":Ae(s),Xe(s);break;case"option":x.value!=null&&s.setAttribute("value",""+Ne(x.value));break;case"select":s.multiple=!!x.multiple,N=x.value,N!=null?yn(s,!!x.multiple,N,!1):x.defaultValue!=null&&yn(s,!!x.multiple,x.defaultValue,!0);break;default:typeof y.onClick=="function"&&(s.onclick=iu)}switch(f){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return rn(o),null;case 6:if(s&&o.stateNode!=null)Jw(s,o,s.memoizedProps,x);else{if(typeof x!="string"&&o.stateNode===null)throw Error(n(166));if(f=_s(ll.current),_s(Rr.current),du(o)){if(x=o.stateNode,f=o.memoizedProps,x[Dr]=o,(N=x.nodeValue!==f)&&(s=In,s!==null))switch(s.tag){case 3:ru(x.nodeValue,f,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&ru(x.nodeValue,f,(s.mode&1)!==0)}N&&(o.flags|=4)}else x=(f.nodeType===9?f:f.ownerDocument).createTextNode(x),x[Dr]=o,o.stateNode=x}return rn(o),null;case 13:if(st(ft),x=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(ct&&Dn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)tw(),Ia(),o.flags|=98560,N=!1;else if(N=du(o),x!==null&&x.dehydrated!==null){if(s===null){if(!N)throw Error(n(318));if(N=o.memoizedState,N=N!==null?N.dehydrated:null,!N)throw Error(n(317));N[Dr]=o}else Ia(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;rn(o),N=!1}else br!==null&&(Qh(br),br=null),N=!0;if(!N)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=f,o):(x=x!==null,x!==(s!==null&&s.memoizedState!==null)&&x&&(o.child.flags|=8192,(o.mode&1)!==0&&(s===null||(ft.current&1)!==0?Ot===0&&(Ot=3):em())),o.updateQueue!==null&&(o.flags|=4),rn(o),null);case 4:return $a(),Fh(s,o),s===null&&tl(o.stateNode.containerInfo),rn(o),null;case 10:return hh(o.type._context),rn(o),null;case 17:return wn(o.type)&&au(),rn(o),null;case 19:if(st(ft),N=o.memoizedState,N===null)return rn(o),null;if(x=(o.flags&128)!==0,T=N.rendering,T===null)if(x)pl(N,!1);else{if(Ot!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(T=xu(s),T!==null){for(o.flags|=128,pl(N,!1),x=T.updateQueue,x!==null&&(o.updateQueue=x,o.flags|=4),o.subtreeFlags=0,x=f,f=o.child;f!==null;)N=f,s=x,N.flags&=14680066,T=N.alternate,T===null?(N.childLanes=0,N.lanes=s,N.child=null,N.subtreeFlags=0,N.memoizedProps=null,N.memoizedState=null,N.updateQueue=null,N.dependencies=null,N.stateNode=null):(N.childLanes=T.childLanes,N.lanes=T.lanes,N.child=T.child,N.subtreeFlags=0,N.deletions=null,N.memoizedProps=T.memoizedProps,N.memoizedState=T.memoizedState,N.updateQueue=T.updateQueue,N.type=T.type,s=T.dependencies,N.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),f=f.sibling;return et(ft,ft.current&1|2),o.child}s=s.sibling}N.tail!==null&&bt()>Va&&(o.flags|=128,x=!0,pl(N,!1),o.lanes=4194304)}else{if(!x)if(s=xu(T),s!==null){if(o.flags|=128,x=!0,f=s.updateQueue,f!==null&&(o.updateQueue=f,o.flags|=4),pl(N,!0),N.tail===null&&N.tailMode==="hidden"&&!T.alternate&&!ct)return rn(o),null}else 2*bt()-N.renderingStartTime>Va&&f!==1073741824&&(o.flags|=128,x=!0,pl(N,!1),o.lanes=4194304);N.isBackwards?(T.sibling=o.child,o.child=T):(f=N.last,f!==null?f.sibling=T:o.child=T,N.last=T)}return N.tail!==null?(o=N.tail,N.rendering=o,N.tail=o.sibling,N.renderingStartTime=bt(),o.sibling=null,f=ft.current,et(ft,x?f&1|2:f&1),o):(rn(o),null);case 22:case 23:return Zh(),x=o.memoizedState!==null,s!==null&&s.memoizedState!==null!==x&&(o.flags|=8192),x&&(o.mode&1)!==0?(Rn&1073741824)!==0&&(rn(o),o.subtreeFlags&6&&(o.flags|=8192)):rn(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function CI(s,o){switch(lh(o),o.tag){case 1:return wn(o.type)&&au(),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return $a(),st(bn),st(tn),wh(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 5:return yh(o),null;case 13:if(st(ft),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Ia()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return st(ft),null;case 4:return $a(),null;case 10:return hh(o.type._context),null;case 22:case 23:return Zh(),null;case 24:return null;default:return null}}var Pu=!1,sn=!1,OI=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Fa(s,o){var f=s.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(x){mt(s,o,x)}else f.current=null}function Bh(s,o,f){try{f()}catch(x){mt(s,o,x)}}var Zw=!1;function AI(s,o){if(Zp=Kc,s=Tb(),qp(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var x=f.getSelection&&f.getSelection();if(x&&x.rangeCount!==0){f=x.anchorNode;var y=x.anchorOffset,N=x.focusNode;x=x.focusOffset;try{f.nodeType,N.nodeType}catch{f=null;break e}var T=0,D=-1,$=-1,Q=0,le=0,ce=s,oe=null;t:for(;;){for(var ge;ce!==f||y!==0&&ce.nodeType!==3||(D=T+y),ce!==N||x!==0&&ce.nodeType!==3||($=T+x),ce.nodeType===3&&(T+=ce.nodeValue.length),(ge=ce.firstChild)!==null;)oe=ce,ce=ge;for(;;){if(ce===s)break t;if(oe===f&&++Q===y&&(D=T),oe===N&&++le===x&&($=T),(ge=ce.nextSibling)!==null)break;ce=oe,oe=ce.parentNode}ce=ge}f=D===-1||$===-1?null:{start:D,end:$}}else f=null}f=f||{start:0,end:0}}else f=null;for(eh={focusedElem:s,selectionRange:f},Kc=!1,ve=o;ve!==null;)if(o=ve,s=o.child,(o.subtreeFlags&1028)!==0&&s!==null)s.return=o,ve=s;else for(;ve!==null;){o=ve;try{var be=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(be!==null){var je=be.memoizedProps,wt=be.memoizedState,W=o.stateNode,F=W.getSnapshotBeforeUpdate(o.elementType===o.type?je:wr(o.type,je),wt);W.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var H=o.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){mt(o,o.return,de)}if(s=o.sibling,s!==null){s.return=o.return,ve=s;break}ve=o.return}return be=Zw,Zw=!1,be}function hl(s,o,f){var x=o.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var y=x=x.next;do{if((y.tag&s)===s){var N=y.destroy;y.destroy=void 0,N!==void 0&&Bh(o,f,N)}y=y.next}while(y!==x)}}function Cu(s,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var f=o=o.next;do{if((f.tag&s)===s){var x=f.create;f.destroy=x()}f=f.next}while(f!==o)}}function Vh(s){var o=s.ref;if(o!==null){var f=s.stateNode;switch(s.tag){case 5:s=f;break;default:s=f}typeof o=="function"?o(s):o.current=s}}function e1(s){var o=s.alternate;o!==null&&(s.alternate=null,e1(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&(delete o[Dr],delete o[rl],delete o[ih],delete o[dI],delete o[fI])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function t1(s){return s.tag===5||s.tag===3||s.tag===4}function n1(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||t1(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Uh(s,o,f){var x=s.tag;if(x===5||x===6)s=s.stateNode,o?f.nodeType===8?f.parentNode.insertBefore(s,o):f.insertBefore(s,o):(f.nodeType===8?(o=f.parentNode,o.insertBefore(s,f)):(o=f,o.appendChild(s)),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=iu));else if(x!==4&&(s=s.child,s!==null))for(Uh(s,o,f),s=s.sibling;s!==null;)Uh(s,o,f),s=s.sibling}function Wh(s,o,f){var x=s.tag;if(x===5||x===6)s=s.stateNode,o?f.insertBefore(s,o):f.appendChild(s);else if(x!==4&&(s=s.child,s!==null))for(Wh(s,o,f),s=s.sibling;s!==null;)Wh(s,o,f),s=s.sibling}var Ht=null,jr=!1;function Yi(s,o,f){for(f=f.child;f!==null;)r1(s,o,f),f=f.sibling}function r1(s,o,f){if(Ir&&typeof Ir.onCommitFiberUnmount=="function")try{Ir.onCommitFiberUnmount(Fc,f)}catch{}switch(f.tag){case 5:sn||Fa(f,o);case 6:var x=Ht,y=jr;Ht=null,Yi(s,o,f),Ht=x,jr=y,Ht!==null&&(jr?(s=Ht,f=f.stateNode,s.nodeType===8?s.parentNode.removeChild(f):s.removeChild(f)):Ht.removeChild(f.stateNode));break;case 18:Ht!==null&&(jr?(s=Ht,f=f.stateNode,s.nodeType===8?rh(s.parentNode,f):s.nodeType===1&&rh(s,f),Ko(s)):rh(Ht,f.stateNode));break;case 4:x=Ht,y=jr,Ht=f.stateNode.containerInfo,jr=!0,Yi(s,o,f),Ht=x,jr=y;break;case 0:case 11:case 14:case 15:if(!sn&&(x=f.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){y=x=x.next;do{var N=y,T=N.destroy;N=N.tag,T!==void 0&&((N&2)!==0||(N&4)!==0)&&Bh(f,o,T),y=y.next}while(y!==x)}Yi(s,o,f);break;case 1:if(!sn&&(Fa(f,o),x=f.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=f.memoizedProps,x.state=f.memoizedState,x.componentWillUnmount()}catch(D){mt(f,o,D)}Yi(s,o,f);break;case 21:Yi(s,o,f);break;case 22:f.mode&1?(sn=(x=sn)||f.memoizedState!==null,Yi(s,o,f),sn=x):Yi(s,o,f);break;default:Yi(s,o,f)}}function i1(s){var o=s.updateQueue;if(o!==null){s.updateQueue=null;var f=s.stateNode;f===null&&(f=s.stateNode=new OI),o.forEach(function(x){var y=$I.bind(null,s,x);f.has(x)||(f.add(x),x.then(y,y))})}}function Sr(s,o){var f=o.deletions;if(f!==null)for(var x=0;x<f.length;x++){var y=f[x];try{var N=s,T=o,D=T;e:for(;D!==null;){switch(D.tag){case 5:Ht=D.stateNode,jr=!1;break e;case 3:Ht=D.stateNode.containerInfo,jr=!0;break e;case 4:Ht=D.stateNode.containerInfo,jr=!0;break e}D=D.return}if(Ht===null)throw Error(n(160));r1(N,T,y),Ht=null,jr=!1;var $=y.alternate;$!==null&&($.return=null),y.return=null}catch(Q){mt(y,o,Q)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)s1(o,s),o=o.sibling}function s1(s,o){var f=s.alternate,x=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Sr(o,s),$r(s),x&4){try{hl(3,s,s.return),Cu(3,s)}catch(je){mt(s,s.return,je)}try{hl(5,s,s.return)}catch(je){mt(s,s.return,je)}}break;case 1:Sr(o,s),$r(s),x&512&&f!==null&&Fa(f,f.return);break;case 5:if(Sr(o,s),$r(s),x&512&&f!==null&&Fa(f,f.return),s.flags&32){var y=s.stateNode;try{Ke(y,"")}catch(je){mt(s,s.return,je)}}if(x&4&&(y=s.stateNode,y!=null)){var N=s.memoizedProps,T=f!==null?f.memoizedProps:N,D=s.type,$=s.updateQueue;if(s.updateQueue=null,$!==null)try{D==="input"&&N.type==="radio"&&N.name!=null&&Qe(y,N),_r(D,T);var Q=_r(D,N);for(T=0;T<$.length;T+=2){var le=$[T],ce=$[T+1];le==="style"?xa(y,ce):le==="dangerouslySetInnerHTML"?un(y,ce):le==="children"?Ke(y,ce):E(y,le,ce,Q)}switch(D){case"input":Mt(y,N);break;case"textarea":De(y,N);break;case"select":var oe=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!N.multiple;var ge=N.value;ge!=null?yn(y,!!N.multiple,ge,!1):oe!==!!N.multiple&&(N.defaultValue!=null?yn(y,!!N.multiple,N.defaultValue,!0):yn(y,!!N.multiple,N.multiple?[]:"",!1))}y[rl]=N}catch(je){mt(s,s.return,je)}}break;case 6:if(Sr(o,s),$r(s),x&4){if(s.stateNode===null)throw Error(n(162));y=s.stateNode,N=s.memoizedProps;try{y.nodeValue=N}catch(je){mt(s,s.return,je)}}break;case 3:if(Sr(o,s),$r(s),x&4&&f!==null&&f.memoizedState.isDehydrated)try{Ko(o.containerInfo)}catch(je){mt(s,s.return,je)}break;case 4:Sr(o,s),$r(s);break;case 13:Sr(o,s),$r(s),y=s.child,y.flags&8192&&(N=y.memoizedState!==null,y.stateNode.isHidden=N,!N||y.alternate!==null&&y.alternate.memoizedState!==null||(Hh=bt())),x&4&&i1(s);break;case 22:if(le=f!==null&&f.memoizedState!==null,s.mode&1?(sn=(Q=sn)||le,Sr(o,s),sn=Q):Sr(o,s),$r(s),x&8192){if(Q=s.memoizedState!==null,(s.stateNode.isHidden=Q)&&!le&&(s.mode&1)!==0)for(ve=s,le=s.child;le!==null;){for(ce=ve=le;ve!==null;){switch(oe=ve,ge=oe.child,oe.tag){case 0:case 11:case 14:case 15:hl(4,oe,oe.return);break;case 1:Fa(oe,oe.return);var be=oe.stateNode;if(typeof be.componentWillUnmount=="function"){x=oe,f=oe.return;try{o=x,be.props=o.memoizedProps,be.state=o.memoizedState,be.componentWillUnmount()}catch(je){mt(x,f,je)}}break;case 5:Fa(oe,oe.return);break;case 22:if(oe.memoizedState!==null){l1(ce);continue}}ge!==null?(ge.return=oe,ve=ge):l1(ce)}le=le.sibling}e:for(le=null,ce=s;;){if(ce.tag===5){if(le===null){le=ce;try{y=ce.stateNode,Q?(N=y.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none"):(D=ce.stateNode,$=ce.memoizedProps.style,T=$!=null&&$.hasOwnProperty("display")?$.display:null,D.style.display=ga("display",T))}catch(je){mt(s,s.return,je)}}}else if(ce.tag===6){if(le===null)try{ce.stateNode.nodeValue=Q?"":ce.memoizedProps}catch(je){mt(s,s.return,je)}}else if((ce.tag!==22&&ce.tag!==23||ce.memoizedState===null||ce===s)&&ce.child!==null){ce.child.return=ce,ce=ce.child;continue}if(ce===s)break e;for(;ce.sibling===null;){if(ce.return===null||ce.return===s)break e;le===ce&&(le=null),ce=ce.return}le===ce&&(le=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:Sr(o,s),$r(s),x&4&&i1(s);break;case 21:break;default:Sr(o,s),$r(s)}}function $r(s){var o=s.flags;if(o&2){try{e:{for(var f=s.return;f!==null;){if(t1(f)){var x=f;break e}f=f.return}throw Error(n(160))}switch(x.tag){case 5:var y=x.stateNode;x.flags&32&&(Ke(y,""),x.flags&=-33);var N=n1(s);Wh(s,N,y);break;case 3:case 4:var T=x.stateNode.containerInfo,D=n1(s);Uh(s,D,T);break;default:throw Error(n(161))}}catch($){mt(s,s.return,$)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function EI(s,o,f){ve=s,a1(s)}function a1(s,o,f){for(var x=(s.mode&1)!==0;ve!==null;){var y=ve,N=y.child;if(y.tag===22&&x){var T=y.memoizedState!==null||Pu;if(!T){var D=y.alternate,$=D!==null&&D.memoizedState!==null||sn;D=Pu;var Q=sn;if(Pu=T,(sn=$)&&!Q)for(ve=y;ve!==null;)T=ve,$=T.child,T.tag===22&&T.memoizedState!==null?c1(y):$!==null?($.return=T,ve=$):c1(y);for(;N!==null;)ve=N,a1(N),N=N.sibling;ve=y,Pu=D,sn=Q}o1(s)}else(y.subtreeFlags&8772)!==0&&N!==null?(N.return=y,ve=N):o1(s)}}function o1(s){for(;ve!==null;){var o=ve;if((o.flags&8772)!==0){var f=o.alternate;try{if((o.flags&8772)!==0)switch(o.tag){case 0:case 11:case 15:sn||Cu(5,o);break;case 1:var x=o.stateNode;if(o.flags&4&&!sn)if(f===null)x.componentDidMount();else{var y=o.elementType===o.type?f.memoizedProps:wr(o.type,f.memoizedProps);x.componentDidUpdate(y,f.memoizedState,x.__reactInternalSnapshotBeforeUpdate)}var N=o.updateQueue;N!==null&&lw(o,N,x);break;case 3:var T=o.updateQueue;if(T!==null){if(f=null,o.child!==null)switch(o.child.tag){case 5:f=o.child.stateNode;break;case 1:f=o.child.stateNode}lw(o,T,f)}break;case 5:var D=o.stateNode;if(f===null&&o.flags&4){f=D;var $=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":$.autoFocus&&f.focus();break;case"img":$.src&&(f.src=$.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var Q=o.alternate;if(Q!==null){var le=Q.memoizedState;if(le!==null){var ce=le.dehydrated;ce!==null&&Ko(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}sn||o.flags&512&&Vh(o)}catch(oe){mt(o,o.return,oe)}}if(o===s){ve=null;break}if(f=o.sibling,f!==null){f.return=o.return,ve=f;break}ve=o.return}}function l1(s){for(;ve!==null;){var o=ve;if(o===s){ve=null;break}var f=o.sibling;if(f!==null){f.return=o.return,ve=f;break}ve=o.return}}function c1(s){for(;ve!==null;){var o=ve;try{switch(o.tag){case 0:case 11:case 15:var f=o.return;try{Cu(4,o)}catch($){mt(o,f,$)}break;case 1:var x=o.stateNode;if(typeof x.componentDidMount=="function"){var y=o.return;try{x.componentDidMount()}catch($){mt(o,y,$)}}var N=o.return;try{Vh(o)}catch($){mt(o,N,$)}break;case 5:var T=o.return;try{Vh(o)}catch($){mt(o,T,$)}}}catch($){mt(o,o.return,$)}if(o===s){ve=null;break}var D=o.sibling;if(D!==null){D.return=o.return,ve=D;break}ve=o.return}}var TI=Math.ceil,Ou=A.ReactCurrentDispatcher,qh=A.ReactCurrentOwner,Jn=A.ReactCurrentBatchConfig,Be=0,Lt=null,Nt=null,Gt=0,Rn=0,Ba=Wi(0),Ot=0,ml=null,Ds=0,Au=0,Kh=0,gl=null,Sn=null,Hh=0,Va=1/0,li=null,Eu=!1,Gh=null,Xi=null,Tu=!1,Qi=null,Mu=0,xl=0,Yh=null,_u=-1,Iu=0;function fn(){return(Be&6)!==0?bt():_u!==-1?_u:_u=bt()}function Ji(s){return(s.mode&1)===0?1:(Be&2)!==0&&Gt!==0?Gt&-Gt:hI.transition!==null?(Iu===0&&(Iu=nb()),Iu):(s=He,s!==0||(s=window.event,s=s===void 0?16:db(s.type)),s)}function Nr(s,o,f,x){if(50<xl)throw xl=0,Yh=null,Error(n(185));Bo(s,f,x),((Be&2)===0||s!==Lt)&&(s===Lt&&((Be&2)===0&&(Au|=f),Ot===4&&Zi(s,Gt)),Nn(s,x),f===1&&Be===0&&(o.mode&1)===0&&(Va=bt()+500,lu&&Ki()))}function Nn(s,o){var f=s.callbackNode;h_(s,o);var x=Uc(s,s===Lt?Gt:0);if(x===0)f!==null&&Cs(f),s.callbackNode=null,s.callbackPriority=0;else if(o=x&-x,s.callbackPriority!==o){if(f!=null&&Cs(f),o===1)s.tag===0?pI(d1.bind(null,s)):Xb(d1.bind(null,s)),cI(function(){(Be&6)===0&&Ki()}),f=null;else{switch(rb(x)){case 1:f=Op;break;case 4:f=eb;break;case 16:f=zc;break;case 536870912:f=tb;break;default:f=zc}f=y1(f,u1.bind(null,s))}s.callbackPriority=o,s.callbackNode=f}}function u1(s,o){if(_u=-1,Iu=0,(Be&6)!==0)throw Error(n(327));var f=s.callbackNode;if(Ua()&&s.callbackNode!==f)return null;var x=Uc(s,s===Lt?Gt:0);if(x===0)return null;if((x&30)!==0||(x&s.expiredLanes)!==0||o)o=Du(s,x);else{o=x;var y=Be;Be|=2;var N=p1();(Lt!==s||Gt!==o)&&(li=null,Va=bt()+500,Ls(s,o));do try{II();break}catch(D){f1(s,D)}while(!0);ph(),Ou.current=N,Be=y,Nt!==null?o=0:(Lt=null,Gt=0,o=Ot)}if(o!==0){if(o===2&&(y=Ap(s),y!==0&&(x=y,o=Xh(s,y))),o===1)throw f=ml,Ls(s,0),Zi(s,x),Nn(s,bt()),f;if(o===6)Zi(s,x);else{if(y=s.current.alternate,(x&30)===0&&!MI(y)&&(o=Du(s,x),o===2&&(N=Ap(s),N!==0&&(x=N,o=Xh(s,N))),o===1))throw f=ml,Ls(s,0),Zi(s,x),Nn(s,bt()),f;switch(s.finishedWork=y,s.finishedLanes=x,o){case 0:case 1:throw Error(n(345));case 2:$s(s,Sn,li);break;case 3:if(Zi(s,x),(x&130023424)===x&&(o=Hh+500-bt(),10<o)){if(Uc(s,0)!==0)break;if(y=s.suspendedLanes,(y&x)!==x){fn(),s.pingedLanes|=s.suspendedLanes&y;break}s.timeoutHandle=nh($s.bind(null,s,Sn,li),o);break}$s(s,Sn,li);break;case 4:if(Zi(s,x),(x&4194240)===x)break;for(o=s.eventTimes,y=-1;0<x;){var T=31-vr(x);N=1<<T,T=o[T],T>y&&(y=T),x&=~N}if(x=y,x=bt()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*TI(x/1960))-x,10<x){s.timeoutHandle=nh($s.bind(null,s,Sn,li),x);break}$s(s,Sn,li);break;case 5:$s(s,Sn,li);break;default:throw Error(n(329))}}}return Nn(s,bt()),s.callbackNode===f?u1.bind(null,s):null}function Xh(s,o){var f=gl;return s.current.memoizedState.isDehydrated&&(Ls(s,o).flags|=256),s=Du(s,o),s!==2&&(o=Sn,Sn=f,o!==null&&Qh(o)),s}function Qh(s){Sn===null?Sn=s:Sn.push.apply(Sn,s)}function MI(s){for(var o=s;;){if(o.flags&16384){var f=o.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var x=0;x<f.length;x++){var y=f[x],N=y.getSnapshot;y=y.value;try{if(!yr(N(),y))return!1}catch{return!1}}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===s)break;for(;o.sibling===null;){if(o.return===null||o.return===s)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Zi(s,o){for(o&=~Kh,o&=~Au,s.suspendedLanes|=o,s.pingedLanes&=~o,s=s.expirationTimes;0<o;){var f=31-vr(o),x=1<<f;s[f]=-1,o&=~x}}function d1(s){if((Be&6)!==0)throw Error(n(327));Ua();var o=Uc(s,0);if((o&1)===0)return Nn(s,bt()),null;var f=Du(s,o);if(s.tag!==0&&f===2){var x=Ap(s);x!==0&&(o=x,f=Xh(s,x))}if(f===1)throw f=ml,Ls(s,0),Zi(s,o),Nn(s,bt()),f;if(f===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=o,$s(s,Sn,li),Nn(s,bt()),null}function Jh(s,o){var f=Be;Be|=1;try{return s(o)}finally{Be=f,Be===0&&(Va=bt()+500,lu&&Ki())}}function Rs(s){Qi!==null&&Qi.tag===0&&(Be&6)===0&&Ua();var o=Be;Be|=1;var f=Jn.transition,x=He;try{if(Jn.transition=null,He=1,s)return s()}finally{He=x,Jn.transition=f,Be=o,(Be&6)===0&&Ki()}}function Zh(){Rn=Ba.current,st(Ba)}function Ls(s,o){s.finishedWork=null,s.finishedLanes=0;var f=s.timeoutHandle;if(f!==-1&&(s.timeoutHandle=-1,lI(f)),Nt!==null)for(f=Nt.return;f!==null;){var x=f;switch(lh(x),x.tag){case 1:x=x.type.childContextTypes,x!=null&&au();break;case 3:$a(),st(bn),st(tn),wh();break;case 5:yh(x);break;case 4:$a();break;case 13:st(ft);break;case 19:st(ft);break;case 10:hh(x.type._context);break;case 22:case 23:Zh()}f=f.return}if(Lt=s,Nt=s=es(s.current,null),Gt=Rn=o,Ot=0,ml=null,Kh=Au=Ds=0,Sn=gl=null,Ms!==null){for(o=0;o<Ms.length;o++)if(f=Ms[o],x=f.interleaved,x!==null){f.interleaved=null;var y=x.next,N=f.pending;if(N!==null){var T=N.next;N.next=y,x.next=T}f.pending=x}Ms=null}return s}function f1(s,o){do{var f=Nt;try{if(ph(),vu.current=ju,yu){for(var x=pt.memoizedState;x!==null;){var y=x.queue;y!==null&&(y.pending=null),x=x.next}yu=!1}if(Is=0,Rt=Ct=pt=null,cl=!1,ul=0,qh.current=null,f===null||f.return===null){Ot=1,ml=o,Nt=null;break}e:{var N=s,T=f.return,D=f,$=o;if(o=Gt,D.flags|=32768,$!==null&&typeof $=="object"&&typeof $.then=="function"){var Q=$,le=D,ce=le.tag;if((le.mode&1)===0&&(ce===0||ce===11||ce===15)){var oe=le.alternate;oe?(le.updateQueue=oe.updateQueue,le.memoizedState=oe.memoizedState,le.lanes=oe.lanes):(le.updateQueue=null,le.memoizedState=null)}var ge=Lw(T);if(ge!==null){ge.flags&=-257,$w(ge,T,D,N,o),ge.mode&1&&Rw(N,Q,o),o=ge,$=Q;var be=o.updateQueue;if(be===null){var je=new Set;je.add($),o.updateQueue=je}else be.add($);break e}else{if((o&1)===0){Rw(N,Q,o),em();break e}$=Error(n(426))}}else if(ct&&D.mode&1){var wt=Lw(T);if(wt!==null){(wt.flags&65536)===0&&(wt.flags|=256),$w(wt,T,D,N,o),dh(za($,D));break e}}N=$=za($,D),Ot!==4&&(Ot=2),gl===null?gl=[N]:gl.push(N),N=T;do{switch(N.tag){case 3:N.flags|=65536,o&=-o,N.lanes|=o;var W=Iw(N,$,o);ow(N,W);break e;case 1:D=$;var F=N.type,H=N.stateNode;if((N.flags&128)===0&&(typeof F.getDerivedStateFromError=="function"||H!==null&&typeof H.componentDidCatch=="function"&&(Xi===null||!Xi.has(H)))){N.flags|=65536,o&=-o,N.lanes|=o;var de=Dw(N,D,o);ow(N,de);break e}}N=N.return}while(N!==null)}m1(f)}catch(Se){o=Se,Nt===f&&f!==null&&(Nt=f=f.return);continue}break}while(!0)}function p1(){var s=Ou.current;return Ou.current=ju,s===null?ju:s}function em(){(Ot===0||Ot===3||Ot===2)&&(Ot=4),Lt===null||(Ds&268435455)===0&&(Au&268435455)===0||Zi(Lt,Gt)}function Du(s,o){var f=Be;Be|=2;var x=p1();(Lt!==s||Gt!==o)&&(li=null,Ls(s,o));do try{_I();break}catch(y){f1(s,y)}while(!0);if(ph(),Be=f,Ou.current=x,Nt!==null)throw Error(n(261));return Lt=null,Gt=0,Ot}function _I(){for(;Nt!==null;)h1(Nt)}function II(){for(;Nt!==null&&!xe();)h1(Nt)}function h1(s){var o=v1(s.alternate,s,Rn);s.memoizedProps=s.pendingProps,o===null?m1(s):Nt=o,qh.current=null}function m1(s){var o=s;do{var f=o.alternate;if(s=o.return,(o.flags&32768)===0){if(f=PI(f,o,Rn),f!==null){Nt=f;return}}else{if(f=CI(f,o),f!==null){f.flags&=32767,Nt=f;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{Ot=6,Nt=null;return}}if(o=o.sibling,o!==null){Nt=o;return}Nt=o=s}while(o!==null);Ot===0&&(Ot=5)}function $s(s,o,f){var x=He,y=Jn.transition;try{Jn.transition=null,He=1,DI(s,o,f,x)}finally{Jn.transition=y,He=x}return null}function DI(s,o,f,x){do Ua();while(Qi!==null);if((Be&6)!==0)throw Error(n(327));f=s.finishedWork;var y=s.finishedLanes;if(f===null)return null;if(s.finishedWork=null,s.finishedLanes=0,f===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var N=f.lanes|f.childLanes;if(m_(s,N),s===Lt&&(Nt=Lt=null,Gt=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Tu||(Tu=!0,y1(zc,function(){return Ua(),null})),N=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||N){N=Jn.transition,Jn.transition=null;var T=He;He=1;var D=Be;Be|=4,qh.current=null,AI(s,f),s1(f,s),tI(eh),Kc=!!Zp,eh=Zp=null,s.current=f,EI(f),a_(),Be=D,He=T,Jn.transition=N}else s.current=f;if(Tu&&(Tu=!1,Qi=s,Mu=y),N=s.pendingLanes,N===0&&(Xi=null),c_(f.stateNode),Nn(s,bt()),o!==null)for(x=s.onRecoverableError,f=0;f<o.length;f++)y=o[f],x(y.value,{componentStack:y.stack,digest:y.digest});if(Eu)throw Eu=!1,s=Gh,Gh=null,s;return(Mu&1)!==0&&s.tag!==0&&Ua(),N=s.pendingLanes,(N&1)!==0?s===Yh?xl++:(xl=0,Yh=s):xl=0,Ki(),null}function Ua(){if(Qi!==null){var s=rb(Mu),o=Jn.transition,f=He;try{if(Jn.transition=null,He=16>s?16:s,Qi===null)var x=!1;else{if(s=Qi,Qi=null,Mu=0,(Be&6)!==0)throw Error(n(331));var y=Be;for(Be|=4,ve=s.current;ve!==null;){var N=ve,T=N.child;if((ve.flags&16)!==0){var D=N.deletions;if(D!==null){for(var $=0;$<D.length;$++){var Q=D[$];for(ve=Q;ve!==null;){var le=ve;switch(le.tag){case 0:case 11:case 15:hl(8,le,N)}var ce=le.child;if(ce!==null)ce.return=le,ve=ce;else for(;ve!==null;){le=ve;var oe=le.sibling,ge=le.return;if(e1(le),le===Q){ve=null;break}if(oe!==null){oe.return=ge,ve=oe;break}ve=ge}}}var be=N.alternate;if(be!==null){var je=be.child;if(je!==null){be.child=null;do{var wt=je.sibling;je.sibling=null,je=wt}while(je!==null)}}ve=N}}if((N.subtreeFlags&2064)!==0&&T!==null)T.return=N,ve=T;else e:for(;ve!==null;){if(N=ve,(N.flags&2048)!==0)switch(N.tag){case 0:case 11:case 15:hl(9,N,N.return)}var W=N.sibling;if(W!==null){W.return=N.return,ve=W;break e}ve=N.return}}var F=s.current;for(ve=F;ve!==null;){T=ve;var H=T.child;if((T.subtreeFlags&2064)!==0&&H!==null)H.return=T,ve=H;else e:for(T=F;ve!==null;){if(D=ve,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Cu(9,D)}}catch(Se){mt(D,D.return,Se)}if(D===T){ve=null;break e}var de=D.sibling;if(de!==null){de.return=D.return,ve=de;break e}ve=D.return}}if(Be=y,Ki(),Ir&&typeof Ir.onPostCommitFiberRoot=="function")try{Ir.onPostCommitFiberRoot(Fc,s)}catch{}x=!0}return x}finally{He=f,Jn.transition=o}}return!1}function g1(s,o,f){o=za(f,o),o=Iw(s,o,1),s=Gi(s,o,1),o=fn(),s!==null&&(Bo(s,1,o),Nn(s,o))}function mt(s,o,f){if(s.tag===3)g1(s,s,f);else for(;o!==null;){if(o.tag===3){g1(o,s,f);break}else if(o.tag===1){var x=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(Xi===null||!Xi.has(x))){s=za(f,s),s=Dw(o,s,1),o=Gi(o,s,1),s=fn(),o!==null&&(Bo(o,1,s),Nn(o,s));break}}o=o.return}}function RI(s,o,f){var x=s.pingCache;x!==null&&x.delete(o),o=fn(),s.pingedLanes|=s.suspendedLanes&f,Lt===s&&(Gt&f)===f&&(Ot===4||Ot===3&&(Gt&130023424)===Gt&&500>bt()-Hh?Ls(s,0):Kh|=f),Nn(s,o)}function x1(s,o){o===0&&((s.mode&1)===0?o=1:(o=Vc,Vc<<=1,(Vc&130023424)===0&&(Vc=4194304)));var f=fn();s=si(s,o),s!==null&&(Bo(s,o,f),Nn(s,f))}function LI(s){var o=s.memoizedState,f=0;o!==null&&(f=o.retryLane),x1(s,f)}function $I(s,o){var f=0;switch(s.tag){case 13:var x=s.stateNode,y=s.memoizedState;y!==null&&(f=y.retryLane);break;case 19:x=s.stateNode;break;default:throw Error(n(314))}x!==null&&x.delete(o),x1(s,f)}var v1;v1=function(s,o,f){if(s!==null)if(s.memoizedProps!==o.pendingProps||bn.current)jn=!0;else{if((s.lanes&f)===0&&(o.flags&128)===0)return jn=!1,kI(s,o,f);jn=(s.flags&131072)!==0}else jn=!1,ct&&(o.flags&1048576)!==0&&Qb(o,uu,o.index);switch(o.lanes=0,o.tag){case 2:var x=o.type;ku(s,o),s=o.pendingProps;var y=Ta(o,tn.current);La(o,f),y=Nh(null,o,x,s,y,f);var N=kh();return o.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,wn(x)?(N=!0,ou(o)):N=!1,o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,xh(o),y.updater=Su,o.stateNode=y,y._reactInternals=o,Th(o,x,s,f),o=Dh(null,o,x,!0,N,f)):(o.tag=0,ct&&N&&oh(o),dn(null,o,y,f),o=o.child),o;case 16:x=o.elementType;e:{switch(ku(s,o),s=o.pendingProps,y=x._init,x=y(x._payload),o.type=x,y=o.tag=FI(x),s=wr(x,s),y){case 0:o=Ih(null,o,x,s,f);break e;case 1:o=Ww(null,o,x,s,f);break e;case 11:o=zw(null,o,x,s,f);break e;case 14:o=Fw(null,o,x,wr(x.type,s),f);break e}throw Error(n(306,x,""))}return o;case 0:return x=o.type,y=o.pendingProps,y=o.elementType===x?y:wr(x,y),Ih(s,o,x,y,f);case 1:return x=o.type,y=o.pendingProps,y=o.elementType===x?y:wr(x,y),Ww(s,o,x,y,f);case 3:e:{if(qw(o),s===null)throw Error(n(387));x=o.pendingProps,N=o.memoizedState,y=N.element,aw(s,o),gu(o,x,null,f);var T=o.memoizedState;if(x=T.element,N.isDehydrated)if(N={element:x,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=N,o.memoizedState=N,o.flags&256){y=za(Error(n(423)),o),o=Kw(s,o,x,f,y);break e}else if(x!==y){y=za(Error(n(424)),o),o=Kw(s,o,x,f,y);break e}else for(Dn=Ui(o.stateNode.containerInfo.firstChild),In=o,ct=!0,br=null,f=iw(o,null,x,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Ia(),x===y){o=oi(s,o,f);break e}dn(s,o,x,f)}o=o.child}return o;case 5:return cw(o),s===null&&uh(o),x=o.type,y=o.pendingProps,N=s!==null?s.memoizedProps:null,T=y.children,th(x,y)?T=null:N!==null&&th(x,N)&&(o.flags|=32),Uw(s,o),dn(s,o,T,f),o.child;case 6:return s===null&&uh(o),null;case 13:return Hw(s,o,f);case 4:return vh(o,o.stateNode.containerInfo),x=o.pendingProps,s===null?o.child=Da(o,null,x,f):dn(s,o,x,f),o.child;case 11:return x=o.type,y=o.pendingProps,y=o.elementType===x?y:wr(x,y),zw(s,o,x,y,f);case 7:return dn(s,o,o.pendingProps,f),o.child;case 8:return dn(s,o,o.pendingProps.children,f),o.child;case 12:return dn(s,o,o.pendingProps.children,f),o.child;case 10:e:{if(x=o.type._context,y=o.pendingProps,N=o.memoizedProps,T=y.value,et(pu,x._currentValue),x._currentValue=T,N!==null)if(yr(N.value,T)){if(N.children===y.children&&!bn.current){o=oi(s,o,f);break e}}else for(N=o.child,N!==null&&(N.return=o);N!==null;){var D=N.dependencies;if(D!==null){T=N.child;for(var $=D.firstContext;$!==null;){if($.context===x){if(N.tag===1){$=ai(-1,f&-f),$.tag=2;var Q=N.updateQueue;if(Q!==null){Q=Q.shared;var le=Q.pending;le===null?$.next=$:($.next=le.next,le.next=$),Q.pending=$}}N.lanes|=f,$=N.alternate,$!==null&&($.lanes|=f),mh(N.return,f,o),D.lanes|=f;break}$=$.next}}else if(N.tag===10)T=N.type===o.type?null:N.child;else if(N.tag===18){if(T=N.return,T===null)throw Error(n(341));T.lanes|=f,D=T.alternate,D!==null&&(D.lanes|=f),mh(T,f,o),T=N.sibling}else T=N.child;if(T!==null)T.return=N;else for(T=N;T!==null;){if(T===o){T=null;break}if(N=T.sibling,N!==null){N.return=T.return,T=N;break}T=T.return}N=T}dn(s,o,y.children,f),o=o.child}return o;case 9:return y=o.type,x=o.pendingProps.children,La(o,f),y=Xn(y),x=x(y),o.flags|=1,dn(s,o,x,f),o.child;case 14:return x=o.type,y=wr(x,o.pendingProps),y=wr(x.type,y),Fw(s,o,x,y,f);case 15:return Bw(s,o,o.type,o.pendingProps,f);case 17:return x=o.type,y=o.pendingProps,y=o.elementType===x?y:wr(x,y),ku(s,o),o.tag=1,wn(x)?(s=!0,ou(o)):s=!1,La(o,f),Mw(o,x,y),Th(o,x,y,f),Dh(null,o,x,!0,s,f);case 19:return Yw(s,o,f);case 22:return Vw(s,o,f)}throw Error(n(156,o.tag))};function y1(s,o){return Ps(s,o)}function zI(s,o,f,x){this.tag=s,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(s,o,f,x){return new zI(s,o,f,x)}function tm(s){return s=s.prototype,!(!s||!s.isReactComponent)}function FI(s){if(typeof s=="function")return tm(s)?1:0;if(s!=null){if(s=s.$$typeof,s===R)return 11;if(s===ne)return 14}return 2}function es(s,o){var f=s.alternate;return f===null?(f=Zn(s.tag,o,s.key,s.mode),f.elementType=s.elementType,f.type=s.type,f.stateNode=s.stateNode,f.alternate=s,s.alternate=f):(f.pendingProps=o,f.type=s.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=s.flags&14680064,f.childLanes=s.childLanes,f.lanes=s.lanes,f.child=s.child,f.memoizedProps=s.memoizedProps,f.memoizedState=s.memoizedState,f.updateQueue=s.updateQueue,o=s.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=s.sibling,f.index=s.index,f.ref=s.ref,f}function Ru(s,o,f,x,y,N){var T=2;if(x=s,typeof s=="function")tm(s)&&(T=1);else if(typeof s=="string")T=5;else e:switch(s){case M:return zs(f.children,y,N,o);case I:T=8,y|=8;break;case z:return s=Zn(12,f,o,y|2),s.elementType=z,s.lanes=N,s;case ee:return s=Zn(13,f,o,y),s.elementType=ee,s.lanes=N,s;case J:return s=Zn(19,f,o,y),s.elementType=J,s.lanes=N,s;case U:return Lu(f,y,N,o);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case K:T=10;break e;case L:T=9;break e;case R:T=11;break e;case ne:T=14;break e;case re:T=16,x=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return o=Zn(T,f,o,y),o.elementType=s,o.type=x,o.lanes=N,o}function zs(s,o,f,x){return s=Zn(7,s,x,o),s.lanes=f,s}function Lu(s,o,f,x){return s=Zn(22,s,x,o),s.elementType=U,s.lanes=f,s.stateNode={isHidden:!1},s}function nm(s,o,f){return s=Zn(6,s,null,o),s.lanes=f,s}function rm(s,o,f){return o=Zn(4,s.children!==null?s.children:[],s.key,o),o.lanes=f,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}function BI(s,o,f,x,y){this.tag=o,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ep(0),this.expirationTimes=Ep(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ep(0),this.identifierPrefix=x,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function im(s,o,f,x,y,N,T,D,$){return s=new BI(s,o,f,D,$),o===1?(o=1,N===!0&&(o|=8)):o=0,N=Zn(3,null,null,o),s.current=N,N.stateNode=s,N.memoizedState={element:x,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},xh(N),s}function VI(s,o,f){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:O,key:x==null?null:""+x,children:s,containerInfo:o,implementation:f}}function b1(s){if(!s)return qi;s=s._reactInternals;e:{if(ei(s)!==s||s.tag!==1)throw Error(n(170));var o=s;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(wn(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(o!==null);throw Error(n(171))}if(s.tag===1){var f=s.type;if(wn(f))return Gb(s,f,o)}return o}function w1(s,o,f,x,y,N,T,D,$){return s=im(f,x,!0,s,y,N,T,D,$),s.context=b1(null),f=s.current,x=fn(),y=Ji(f),N=ai(x,y),N.callback=o??null,Gi(f,N,y),s.current.lanes=y,Bo(s,y,x),Nn(s,x),s}function $u(s,o,f,x){var y=o.current,N=fn(),T=Ji(y);return f=b1(f),o.context===null?o.context=f:o.pendingContext=f,o=ai(N,T),o.payload={element:s},x=x===void 0?null:x,x!==null&&(o.callback=x),s=Gi(y,o,T),s!==null&&(Nr(s,y,T,N),mu(s,y,T)),T}function zu(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function j1(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<o?f:o}}function sm(s,o){j1(s,o),(s=s.alternate)&&j1(s,o)}function UI(){return null}var S1=typeof reportError=="function"?reportError:function(s){console.error(s)};function am(s){this._internalRoot=s}Fu.prototype.render=am.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(n(409));$u(s,o,null,null)},Fu.prototype.unmount=am.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;Rs(function(){$u(null,s,null,null)}),o[ti]=null}};function Fu(s){this._internalRoot=s}Fu.prototype.unstable_scheduleHydration=function(s){if(s){var o=ab();s={blockedOn:null,target:s,priority:o};for(var f=0;f<Fi.length&&o!==0&&o<Fi[f].priority;f++);Fi.splice(f,0,s),f===0&&cb(s)}};function om(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Bu(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function N1(){}function WI(s,o,f,x,y){if(y){if(typeof x=="function"){var N=x;x=function(){var Q=zu(T);N.call(Q)}}var T=w1(o,x,s,0,null,!1,!1,"",N1);return s._reactRootContainer=T,s[ti]=T.current,tl(s.nodeType===8?s.parentNode:s),Rs(),T}for(;y=s.lastChild;)s.removeChild(y);if(typeof x=="function"){var D=x;x=function(){var Q=zu($);D.call(Q)}}var $=im(s,0,!1,null,null,!1,!1,"",N1);return s._reactRootContainer=$,s[ti]=$.current,tl(s.nodeType===8?s.parentNode:s),Rs(function(){$u(o,$,f,x)}),$}function Vu(s,o,f,x,y){var N=f._reactRootContainer;if(N){var T=N;if(typeof y=="function"){var D=y;y=function(){var $=zu(T);D.call($)}}$u(o,T,s,y)}else T=WI(f,o,s,y,x);return zu(T)}ib=function(s){switch(s.tag){case 3:var o=s.stateNode;if(o.current.memoizedState.isDehydrated){var f=Fo(o.pendingLanes);f!==0&&(Tp(o,f|1),Nn(o,bt()),(Be&6)===0&&(Va=bt()+500,Ki()))}break;case 13:Rs(function(){var x=si(s,1);if(x!==null){var y=fn();Nr(x,s,1,y)}}),sm(s,1)}},Mp=function(s){if(s.tag===13){var o=si(s,134217728);if(o!==null){var f=fn();Nr(o,s,134217728,f)}sm(s,134217728)}},sb=function(s){if(s.tag===13){var o=Ji(s),f=si(s,o);if(f!==null){var x=fn();Nr(f,s,o,x)}sm(s,o)}},ab=function(){return He},ob=function(s,o){var f=He;try{return He=s,o()}finally{He=f}},Ii=function(s,o,f){switch(o){case"input":if(Mt(s,f),o=f.name,f.type==="radio"&&o!=null){for(f=s;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),o=0;o<f.length;o++){var x=f[o];if(x!==s&&x.form===s.form){var y=su(x);if(!y)throw Error(n(90));ae(x),Mt(x,y)}}}break;case"textarea":De(s,f);break;case"select":o=f.value,o!=null&&yn(s,!!f.multiple,o,!1)}},ba=Jh,Ns=Rs;var qI={usingClientEntryPoint:!1,Events:[il,Aa,su,ya,Ss,Jh]},vl={findFiberByHostInstance:Os,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},KI={bundleType:vl.bundleType,version:vl.version,rendererPackageName:vl.rendererPackageName,rendererConfig:vl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:A.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=xr(s),s===null?null:s.stateNode},findFiberByHostInstance:vl.findFiberByHostInstance||UI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uu.isDisabled&&Uu.supportsFiber)try{Fc=Uu.inject(KI),Ir=Uu}catch{}}return kn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qI,kn.createPortal=function(s,o){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!om(o))throw Error(n(200));return VI(s,o,null,f)},kn.createRoot=function(s,o){if(!om(s))throw Error(n(299));var f=!1,x="",y=S1;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(x=o.identifierPrefix),o.onRecoverableError!==void 0&&(y=o.onRecoverableError)),o=im(s,1,!1,null,null,f,!1,x,y),s[ti]=o.current,tl(s.nodeType===8?s.parentNode:s),new am(o)},kn.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var o=s._reactInternals;if(o===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=xr(o),s=s===null?null:s.stateNode,s},kn.flushSync=function(s){return Rs(s)},kn.hydrate=function(s,o,f){if(!Bu(o))throw Error(n(200));return Vu(null,s,o,!0,f)},kn.hydrateRoot=function(s,o,f){if(!om(s))throw Error(n(405));var x=f!=null&&f.hydratedSources||null,y=!1,N="",T=S1;if(f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(N=f.identifierPrefix),f.onRecoverableError!==void 0&&(T=f.onRecoverableError)),o=w1(o,null,s,1,f??null,y,!1,N,T),s[ti]=o.current,tl(s),x)for(s=0;s<x.length;s++)f=x[s],y=f._getVersion,y=y(f._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[f,y]:o.mutableSourceEagerHydrationData.push(f,y);return new Fu(o)},kn.render=function(s,o,f){if(!Bu(o))throw Error(n(200));return Vu(null,s,o,!1,f)},kn.unmountComponentAtNode=function(s){if(!Bu(s))throw Error(n(40));return s._reactRootContainer?(Rs(function(){Vu(null,null,s,!1,function(){s._reactRootContainer=null,s[ti]=null})}),!0):!1},kn.unstable_batchedUpdates=Jh,kn.unstable_renderSubtreeIntoContainer=function(s,o,f,x){if(!Bu(f))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return Vu(s,o,f,!1,x)},kn.version="18.3.1-next-f1338f8080-20240426",kn}var M1;function gC(){if(M1)return dm.exports;M1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),dm.exports=r3(),dm.exports}var _1;function i3(){if(_1)return Wu;_1=1;var e=gC();return Wu.createRoot=e.createRoot,Wu.hydrateRoot=e.hydrateRoot,Wu}var s3=i3();const a3=Jr(s3);/**
|
|
41
|
+
* @license lucide-react v0.468.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const o3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),xC=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
46
|
+
* @license lucide-react v0.468.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/var l3={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"};/**
|
|
51
|
+
* @license lucide-react v0.468.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const c3=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:c,...u},d)=>b.createElement("svg",{ref:d,...l3,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:xC("lucide",i),...u},[...c.map(([p,h])=>b.createElement(p,h)),...Array.isArray(a)?a:[a]]));/**
|
|
56
|
+
* @license lucide-react v0.468.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const _e=(e,t)=>{const n=b.forwardRef(({className:r,...i},a)=>b.createElement(c3,{ref:a,iconNode:t,className:xC(`lucide-${o3(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
61
|
+
* @license lucide-react v0.468.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const u3=_e("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
66
|
+
* @license lucide-react v0.468.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const Ef=_e("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
|
|
71
|
+
* @license lucide-react v0.468.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const vC=_e("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
76
|
+
* @license lucide-react v0.468.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const d3=_e("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
81
|
+
* @license lucide-react v0.468.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const f3=_e("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
|
|
86
|
+
* @license lucide-react v0.468.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const yC=_e("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
|
|
91
|
+
* @license lucide-react v0.468.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const ql=_e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
96
|
+
* @license lucide-react v0.468.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const ds=_e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
101
|
+
* @license lucide-react v0.468.0 - ISC
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the ISC license.
|
|
104
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/const p3=_e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
106
|
+
* @license lucide-react v0.468.0 - ISC
|
|
107
|
+
*
|
|
108
|
+
* This source code is licensed under the ISC license.
|
|
109
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
+
*/const ar=_e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
111
|
+
* @license lucide-react v0.468.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/const h3=_e("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
116
|
+
* @license lucide-react v0.468.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/const m3=_e("CircleAlert",[["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"}]]);/**
|
|
121
|
+
* @license lucide-react v0.468.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*/const I1=_e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
126
|
+
* @license lucide-react v0.468.0 - ISC
|
|
127
|
+
*
|
|
128
|
+
* This source code is licensed under the ISC license.
|
|
129
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
+
*/const D1=_e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
131
|
+
* @license lucide-react v0.468.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/const bC=_e("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
|
|
136
|
+
* @license lucide-react v0.468.0 - ISC
|
|
137
|
+
*
|
|
138
|
+
* This source code is licensed under the ISC license.
|
|
139
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
+
*/const g3=_e("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
141
|
+
* @license lucide-react v0.468.0 - ISC
|
|
142
|
+
*
|
|
143
|
+
* This source code is licensed under the ISC license.
|
|
144
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
+
*/const $x=_e("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
146
|
+
* @license lucide-react v0.468.0 - ISC
|
|
147
|
+
*
|
|
148
|
+
* This source code is licensed under the ISC license.
|
|
149
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
+
*/const Pd=_e("Eye",[["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"}]]);/**
|
|
151
|
+
* @license lucide-react v0.468.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/const hm=_e("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
|
|
156
|
+
* @license lucide-react v0.468.0 - ISC
|
|
157
|
+
*
|
|
158
|
+
* This source code is licensed under the ISC license.
|
|
159
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
+
*/const x3=_e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
161
|
+
* @license lucide-react v0.468.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*/const v3=_e("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
166
|
+
* @license lucide-react v0.468.0 - ISC
|
|
167
|
+
*
|
|
168
|
+
* This source code is licensed under the ISC license.
|
|
169
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
+
*/const y3=_e("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 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.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
171
|
+
* @license lucide-react v0.468.0 - ISC
|
|
172
|
+
*
|
|
173
|
+
* This source code is licensed under the ISC license.
|
|
174
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
+
*/const b3=_e("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
176
|
+
* @license lucide-react v0.468.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/const zx=_e("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
181
|
+
* @license lucide-react v0.468.0 - ISC
|
|
182
|
+
*
|
|
183
|
+
* This source code is licensed under the ISC license.
|
|
184
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
+
*/const w3=_e("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
|
186
|
+
* @license lucide-react v0.468.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/const wC=_e("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
191
|
+
* @license lucide-react v0.468.0 - ISC
|
|
192
|
+
*
|
|
193
|
+
* This source code is licensed under the ISC license.
|
|
194
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
+
*/const gg=_e("ListChecks",[["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"}]]);/**
|
|
196
|
+
* @license lucide-react v0.468.0 - ISC
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the ISC license.
|
|
199
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
+
*/const j3=_e("ListOrdered",[["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"}]]);/**
|
|
201
|
+
* @license lucide-react v0.468.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/const Tf=_e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
206
|
+
* @license lucide-react v0.468.0 - ISC
|
|
207
|
+
*
|
|
208
|
+
* This source code is licensed under the ISC license.
|
|
209
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
+
*/const R1=_e("Lock",[["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"}]]);/**
|
|
211
|
+
* @license lucide-react v0.468.0 - ISC
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the ISC license.
|
|
214
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/const Cd=_e("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
|
|
216
|
+
* @license lucide-react v0.468.0 - ISC
|
|
217
|
+
*
|
|
218
|
+
* This source code is licensed under the ISC license.
|
|
219
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
+
*/const mc=_e("Pencil",[["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"}]]);/**
|
|
221
|
+
* @license lucide-react v0.468.0 - ISC
|
|
222
|
+
*
|
|
223
|
+
* This source code is licensed under the ISC license.
|
|
224
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
+
*/const xg=_e("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
226
|
+
* @license lucide-react v0.468.0 - ISC
|
|
227
|
+
*
|
|
228
|
+
* This source code is licensed under the ISC license.
|
|
229
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
+
*/const S3=_e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
231
|
+
* @license lucide-react v0.468.0 - ISC
|
|
232
|
+
*
|
|
233
|
+
* This source code is licensed under the ISC license.
|
|
234
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
+
*/const N3=_e("RefreshCw",[["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"}]]);/**
|
|
236
|
+
* @license lucide-react v0.468.0 - ISC
|
|
237
|
+
*
|
|
238
|
+
* This source code is licensed under the ISC license.
|
|
239
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
+
*/const jC=_e("RotateCcw",[["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"}]]);/**
|
|
241
|
+
* @license lucide-react v0.468.0 - ISC
|
|
242
|
+
*
|
|
243
|
+
* This source code is licensed under the ISC license.
|
|
244
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
+
*/const k3=_e("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
246
|
+
* @license lucide-react v0.468.0 - ISC
|
|
247
|
+
*
|
|
248
|
+
* This source code is licensed under the ISC license.
|
|
249
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
+
*/const P3=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
251
|
+
* @license lucide-react v0.468.0 - ISC
|
|
252
|
+
*
|
|
253
|
+
* This source code is licensed under the ISC license.
|
|
254
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
+
*/const lo=_e("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
256
|
+
* @license lucide-react v0.468.0 - ISC
|
|
257
|
+
*
|
|
258
|
+
* This source code is licensed under the ISC license.
|
|
259
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
+
*/const C3=_e("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
261
|
+
* @license lucide-react v0.468.0 - ISC
|
|
262
|
+
*
|
|
263
|
+
* This source code is licensed under the ISC license.
|
|
264
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
+
*/const SC=_e("Sprout",[["path",{d:"M7 20h10",key:"e6iznv"}],["path",{d:"M10 20c5.5-2.5.8-6.4 3-10",key:"161w41"}],["path",{d:"M9.5 9.4c1.1.8 1.8 2.2 2.3 3.7-2 .4-3.5.4-4.8-.3-1.2-.6-2.3-1.9-3-4.2 2.8-.5 4.4 0 5.5.8z",key:"9gtqwd"}],["path",{d:"M14.1 6a7 7 0 0 0-1.1 4c1.9-.1 3.3-.6 4.3-1.4 1-1 1.6-2.3 1.7-4.6-2.7.1-4 1-4.9 2z",key:"bkxnd2"}]]);/**
|
|
266
|
+
* @license lucide-react v0.468.0 - ISC
|
|
267
|
+
*
|
|
268
|
+
* This source code is licensed under the ISC license.
|
|
269
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
+
*/const O3=_e("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
271
|
+
* @license lucide-react v0.468.0 - ISC
|
|
272
|
+
*
|
|
273
|
+
* This source code is licensed under the ISC license.
|
|
274
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
+
*/const A3=_e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
276
|
+
* @license lucide-react v0.468.0 - ISC
|
|
277
|
+
*
|
|
278
|
+
* This source code is licensed under the ISC license.
|
|
279
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
+
*/const na=_e("TriangleAlert",[["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"}]]);/**
|
|
281
|
+
* @license lucide-react v0.468.0 - ISC
|
|
282
|
+
*
|
|
283
|
+
* This source code is licensed under the ISC license.
|
|
284
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
+
*/const E3=_e("Users",[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
286
|
+
* @license lucide-react v0.468.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/const vg=_e("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
291
|
+
* @license lucide-react v0.468.0 - ISC
|
|
292
|
+
*
|
|
293
|
+
* This source code is licensed under the ISC license.
|
|
294
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
+
*/const T3=_e("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/**
|
|
296
|
+
* @license lucide-react v0.468.0 - ISC
|
|
297
|
+
*
|
|
298
|
+
* This source code is licensed under the ISC license.
|
|
299
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
+
*/const cn=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),gc="/api";async function we(e,t={}){const n=`${gc}${e}`;try{const r=await fetch(n,{...t,headers:{"Content-Type":"application/json",...t.headers}});if(!r.ok){const i=await r.json().catch(()=>({}));throw new Error(i.error||`HTTP ${r.status}: ${r.statusText}`)}return await r.json()}catch(r){throw console.error(`API Error [${e}]:`,r),r}}async function M3(){return we("/health")}async function _3(e={}){const t=new URLSearchParams;e.type&&t.append("type",e.type),e.status&&t.append("status",e.status),e.search&&t.append("search",e.search);const n=t.toString(),r=n?`/work-items?${n}`:"/work-items";return we(r)}async function I3(){return we("/work-items/grouped")}async function NC(e){return we(`/work-items/${e}`)}async function D3(e,t){return we(`/work-items/${e}/worktree-file?path=${encodeURIComponent(t)}`)}async function yg(e){const t=`${gc}/work-items/${e}/doc`,n=await fetch(t);return n.ok?await n.text():""}async function R3(e){const t=`${gc}/work-items/${e}/doc/raw`,n=await fetch(t);return n.ok?await n.text():""}async function L3(e,t){return we(`/work-items/${e}/doc`,{method:"PUT",body:JSON.stringify({content:t})})}async function L1(){return(await we("/settings/title")).title||"AVC Kanban Board"}async function $3(){return(await we("/settings/docs-url")).url||"http://localhost:4173"}async function z3(e){return we("/settings/title",{method:"PUT",body:JSON.stringify({title:e})})}async function F3(){const e=`${gc}/project/doc`,t=await fetch(e);return t.ok?t.text():""}async function B3(){const e=`${gc}/project/doc/raw`,t=await fetch(e);return t.ok?t.text():""}async function V3(e){return we("/project/doc",{method:"PUT",body:JSON.stringify({content:e})})}async function $1(){return we("/project/status")}async function On(){return we("/settings")}async function Od(e){return we("/settings/api-keys",{method:"PUT",body:JSON.stringify(e)})}async function Kl(e,t){return we("/settings/ceremonies",{method:"PUT",body:JSON.stringify({ceremonies:e,missionGenerator:t})})}async function z1(e){return we("/settings/general",{method:"PUT",body:JSON.stringify(e)})}async function U3(e){return we("/settings/models",{method:"PUT",body:JSON.stringify({models:e})})}async function W3(e){return we("/settings/cost-thresholds",{method:"PUT",body:JSON.stringify({thresholds:e})})}async function q3(){return we("/ceremony/status")}async function K3(e,t,n){return we("/ceremony/analyze/database",{method:"POST",body:JSON.stringify({mission:e,scope:t,strategy:n})})}async function F1(e,t,n,r){return we("/ceremony/analyze/architecture",{method:"POST",body:JSON.stringify({mission:e,scope:t,dbContext:n,strategy:r})})}async function H3(e,t,n,r,i){return we("/ceremony/analyze/prefill",{method:"POST",body:JSON.stringify({mission:e,scope:t,arch:n,dbContext:r,strategy:i})})}async function G3(e){return we("/ceremony/run",{method:"POST",body:JSON.stringify({requirements:e})})}async function Y3(e=null){return we("/ceremony/sprint-planning/run",{method:"POST",...e?{body:JSON.stringify({resumeFrom:e})}:{}})}async function X3(){return we("/ceremony/sprint-planning/resumable")}const Q3=(e,t)=>we("/ceremony/sprint-planning/confirm-selection",{method:"POST",body:JSON.stringify({selectedEpicIds:e,selectedStoryIds:t})}),kC=()=>we("/ceremony/pause",{method:"POST"}),PC=()=>we("/ceremony/resume",{method:"POST"}),io=(e=!1)=>we("/ceremony/cancel",{method:"POST",body:JSON.stringify({keepItems:e})}),CC=()=>we("/ceremony/reset",{method:"POST"}),B1=()=>we("/ceremony/cost-limit-continue",{method:"POST"}),J3=(e=null,t=null)=>we("/ceremony/quota-continue",{method:"POST",body:JSON.stringify({newProvider:e,newModel:t})});async function fs(){const[e,t]=await Promise.all([we("/ceremony/models"),we("/settings/local-models").catch(()=>({servers:[]}))]),n=(t.servers||[]).flatMap(r=>r.models.map(i=>({modelId:i.id,displayName:`${i.id} (${r.label})`,provider:"local",hasApiKey:!0})));return[...e,...n]}async function Z3(){return we("/settings/local-models")}async function eD(e,t,n,r,i){return we("/ceremony/generate-mission",{method:"POST",body:JSON.stringify({description:e,modelId:t,provider:n,validatorModelId:r,validatorProvider:i})})}async function tD(e,t,n,r,i,a,c){return we("/ceremony/refine-mission",{method:"POST",body:JSON.stringify({missionStatement:e,initialScope:t,refinementRequest:n,modelId:r,provider:i,validatorModelId:a,validatorProvider:c})})}async function nD(e,t,n){return we("/ceremony/generate-architecture",{method:"POST",body:JSON.stringify({description:e,modelId:t,provider:n})})}async function rD(e,t,n,r){return we("/ceremony/refine-architecture",{method:"POST",body:JSON.stringify({currentArch:e,refinementRequest:t,modelId:n,provider:r})})}async function iD(e,t,n,r,i,a,c){return we("/ceremony/refine-field",{method:"POST",body:JSON.stringify({fieldKey:e,fieldLabel:t,currentValue:n,refinementRequest:r,context:i,modelId:a,provider:c})})}async function sD(){try{return await we("/ceremony/sponsor-call/draft")}catch{return null}}async function aD(e){return we("/ceremony/sponsor-call/draft",{method:"PUT",body:JSON.stringify(e)})}async function V1(){try{return await we("/ceremony/sponsor-call/draft",{method:"DELETE"})}catch{}}async function oD(){return we("/settings/agents")}async function lD(e){return we(`/settings/agents/${encodeURIComponent(e)}`)}async function cD(e,t){return we(`/settings/agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({content:t})})}async function uD(e){return we(`/settings/agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function dD(){return we("/settings/checks")}async function fD(e,t){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async function pD(e,t,n){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({content:n})})}async function hD(e,t){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"})}async function mD(e,t){return we(`/work-items/${e}/refine`,{method:"POST",body:JSON.stringify(t)})}async function gD(e,t,n=[]){return we(`/work-items/${e}`,{method:"PUT",body:JSON.stringify({proposedItem:t,storyChanges:n})})}async function xD(){return we("/settings/openai-oauth/login",{method:"POST"})}async function vD(){return we("/settings/openai-oauth/logout",{method:"POST"})}async function yD(){return we("/settings/openai-oauth/status")}async function bD(){return we("/settings/openai-oauth/test",{method:"POST"})}async function wD(e){return we("/settings/openai-oauth/fallback",{method:"POST",body:JSON.stringify({enabled:e})})}async function mm(){return we("/costs/summary")}async function jD(e=30){return we(typeof e=="number"?`/costs/history?days=${e}`:`/costs/history?from=${e.from}&to=${e.to}`)}async function OC(e){return we(`/work-items/${e}/dependency-status`)}async function SD(e){return we("/ceremony/seed/run",{method:"POST",body:JSON.stringify({storyId:e})})}async function ND(e){return we("/ceremony/run-task/run",{method:"POST",body:JSON.stringify({taskId:e})})}const kD=`ws://${window.location.host}/ws`,PD=5,CD=2e3;function OD(e={}){const{onMessage:t,onConnected:n,onDisconnected:r,onError:i}=e,[a,c]=b.useState("connecting"),u=b.useRef(null),d=b.useRef(null),p=b.useRef(0),h=b.useRef(t),m=b.useRef(n),g=b.useRef(r),v=b.useRef(i);h.current=t,m.current=n,g.current=r,v.current=i;const w=b.useCallback(()=>{var k,C;if(((k=u.current)==null?void 0:k.readyState)!==WebSocket.OPEN)try{const E=new WebSocket(kD);E.onopen=()=>{var A;console.log("WebSocket connected"),p.current=0,c("connected"),(A=m.current)==null||A.call(m)},E.onmessage=A=>{var P;try{const O=JSON.parse(A.data);(P=h.current)==null||P.call(h,O)}catch(O){console.error("WebSocket message parse error:",O)}},E.onerror=A=>{var P;console.error("WebSocket error:",A),(P=v.current)==null||P.call(v,A)},E.onclose=()=>{var A;console.log("WebSocket disconnected"),u.current=null,(A=g.current)==null||A.call(g),p.current<PD?(p.current++,console.log(`Reconnecting... (attempt ${p.current})`),c("connecting"),d.current=setTimeout(w,CD)):(console.error("Max reconnection attempts reached"),c("disconnected"))},u.current=E}catch(E){console.error("WebSocket connection error:",E),(C=v.current)==null||C.call(v,E)}},[]),S=b.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),u.current&&(u.current.close(),u.current=null)},[]),j=b.useCallback(k=>{var C;((C=u.current)==null?void 0:C.readyState)===WebSocket.OPEN?u.current.send(JSON.stringify(k)):console.warn("WebSocket not connected, cannot send message")},[]);return b.useEffect(()=>(w(),()=>{S()}),[w,S]),{wsStatus:a,send:j,disconnect:S,reconnect:w}}const U1=e=>{let t;const n=new Set,r=(p,h)=>{const m=typeof p=="function"?p(t):p;if(!Object.is(m,t)){const g=t;t=h??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(v=>v(t,g))}},i=()=>t,u={setState:r,getState:i,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p))},d=t=e(r,i,u);return u},AD=(e=>e?U1(e):U1),ED=e=>e;function TD(e,t=ED){const n=Ya.useSyncExternalStore(e.subscribe,Ya.useCallback(()=>t(e.getState()),[e,t]),Ya.useCallback(()=>t(e.getInitialState()),[e,t]));return Ya.useDebugValue(n),n}const W1=e=>{const t=AD(e),n=r=>TD(t,r);return Object.assign(n,t),n},ua=(e=>e?W1(e):W1),Mf=ua((e,t)=>({workItems:[],groupedItems:{},loading:!1,error:null,lastUpdated:null,ceremonyActive:!1,loadWorkItems:async(n={})=>{e({loading:!0,error:null});try{const r=await _3(n);e({workItems:r.items||[],loading:!1,lastUpdated:Date.now(),error:null})}catch(r){e({loading:!1,error:r.message}),console.error("Failed to load work items:",r)}},loadGroupedItems:async()=>{e({loading:!0,error:null});try{const n=await I3();e({groupedItems:n,loading:!1,lastUpdated:Date.now(),error:null})}catch(n){e({loading:!1,error:n.message}),console.error("Failed to load grouped items:",n)}},refresh:async()=>{const{loadWorkItems:n}=t();await n()},updateWorkItem:(n,r)=>{e(i=>({workItems:i.workItems.map(a=>a.id===n?{...a,...r}:a)}))},addWorkItem:n=>{e(r=>({workItems:[...r.workItems,n]}))},removeWorkItem:n=>{e(r=>({workItems:r.workItems.filter(i=>i.id!==n)}))},clearError:()=>{e({error:null})},setCeremonyActive:n=>{e({ceremonyActive:n})}}));function MD(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var a;const c=d=>d===null?null:JSON.parse(d,void 0),u=(a=n.getItem(i))!=null?a:null;return u instanceof Promise?u.then(c):c(u)},setItem:(i,a)=>n.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>n.removeItem(i)}}const bg=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return bg(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return bg(r)(n)}}}},_D=(e,t)=>(n,r,i)=>{let a={storage:MD(()=>window.localStorage),partialize:j=>j,version:0,merge:(j,k)=>({...k,...j}),...t},c=!1,u=0;const d=new Set,p=new Set;let h=a.storage;if(!h)return e((...j)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...j)},r,i);const m=()=>{const j=a.partialize({...r()});return h.setItem(a.name,{state:j,version:a.version})},g=i.setState;i.setState=(j,k)=>(g(j,k),m());const v=e((...j)=>(n(...j),m()),r,i);i.getInitialState=()=>v;let w;const S=()=>{var j,k;if(!h)return;const C=++u;c=!1,d.forEach(A=>{var P;return A((P=r())!=null?P:v)});const E=((k=a.onRehydrateStorage)==null?void 0:k.call(a,(j=r())!=null?j:v))||void 0;return bg(h.getItem.bind(h))(a.name).then(A=>{if(A)if(typeof A.version=="number"&&A.version!==a.version){if(a.migrate){const P=a.migrate(A.state,A.version);return P instanceof Promise?P.then(O=>[!0,O]):[!0,P]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,A.state];return[!1,void 0]}).then(A=>{var P;if(C!==u)return;const[O,M]=A;if(w=a.merge(M,(P=r())!=null?P:v),n(w,!0),O)return m()}).then(()=>{C===u&&(E==null||E(w,void 0),w=r(),c=!0,p.forEach(A=>A(w)))}).catch(A=>{C===u&&(E==null||E(void 0,A))})};return i.persist={setOptions:j=>{a={...a,...j},j.storage&&(h=j.storage)},clearStorage:()=>{h==null||h.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>S(),hasHydrated:()=>c,onHydrate:j=>(d.add(j),()=>{d.delete(j)}),onFinishHydration:j=>(p.add(j),()=>{p.delete(j)})},a.skipHydration||S(),w||v},ID=_D,_f=ua(ID((e,t)=>({typeFilters:{epic:!0,story:!0,task:!0,subtask:!1},columnVisibility:{Backlog:!0,Ready:!0,"In Progress":!0,Review:!0,Done:!0},searchQuery:"",groupBy:"epic",toggleTypeFilter:n=>{e(r=>({typeFilters:{...r.typeFilters,[n]:!r.typeFilters[n]}}))},setAllTypeFilters:n=>{e({typeFilters:{epic:n,story:n,task:n,subtask:n}})},toggleColumnVisibility:n=>{e(r=>({columnVisibility:{...r.columnVisibility,[n]:!r.columnVisibility[n]}}))},setAllColumnsVisibility:n=>{e(r=>{const i={};return Object.keys(r.columnVisibility).forEach(a=>{i[a]=n}),{columnVisibility:i}})},applyPreset:n=>{switch(n){case"all":t().setAllColumnsVisibility(!0),t().setAllTypeFilters(!0);break;case"active":e({columnVisibility:{Backlog:!1,Ready:!0,"In Progress":!0,Review:!0,Done:!1}});break;case"hide-completed":e({columnVisibility:{Backlog:!0,Ready:!0,"In Progress":!0,Review:!0,Done:!1}});break}},setSearchQuery:n=>{e({searchQuery:n})},clearSearch:()=>{e({searchQuery:""})},setGroupBy:n=>{e({groupBy:n})},getActiveTypes:()=>{const{typeFilters:n}=t();return Object.entries(n).filter(([r,i])=>i).map(([r])=>r)},getVisibleColumns:()=>{const{columnVisibility:n}=t();return Object.entries(n).filter(([r,i])=>i).map(([r])=>r)},resetFilters:()=>{e({typeFilters:{epic:!0,story:!0,task:!0,subtask:!1},columnVisibility:{Backlog:!0,Ready:!0,"In Progress":!0,Review:!0,Done:!0},searchQuery:"",groupBy:"epic"})}}),{name:"avc-kanban-filters",version:2,partialize:e=>({typeFilters:e.typeFilters,columnVisibility:e.columnVisibility,groupBy:e.groupBy}),migrate:(e,t)=>t<2?{...e,typeFilters:{...e.typeFilters,subtask:!1}}:e})),or=ua((e,t)=>({isOpen:!1,wizardStep:1,analyzing:!1,strategy:null,mission:"",initialScope:"",dbResult:null,dbChoice:null,archOptions:[],selectedArch:null,prefillResult:null,requirements:{MISSION_STATEMENT:"",INITIAL_SCOPE:"",TARGET_USERS:"",DEPLOYMENT_TARGET:"",TECHNICAL_CONSIDERATIONS:"",TECHNICAL_EXCLUSIONS:"",SECURITY_AND_COMPLIANCE_REQUIREMENTS:""},missionProgressLog:[],progressLog:[],ceremonyStatus:"idle",ceremonyResult:null,ceremonyError:null,isPaused:!1,processId:null,openWizard:()=>e({isOpen:!0}),closeWizard:()=>e({isOpen:!1}),reopenWizard:()=>e(n=>({isOpen:!0,wizardStep:n.ceremonyStatus==="complete"?7:6})),resetWizard:()=>e({wizardStep:1,analyzing:!1,strategy:null,mission:"",initialScope:"",dbResult:null,dbChoice:null,archOptions:[],selectedArch:null,prefillResult:null,requirements:{MISSION_STATEMENT:"",INITIAL_SCOPE:"",TARGET_USERS:"",DEPLOYMENT_TARGET:"",TECHNICAL_CONSIDERATIONS:"",TECHNICAL_EXCLUSIONS:"",SECURITY_AND_COMPLIANCE_REQUIREMENTS:""},progressLog:[],ceremonyStatus:"idle",ceremonyResult:null,ceremonyError:null}),setStrategy:n=>e({strategy:n}),setMission:n=>e({mission:n}),setInitialScope:n=>e({initialScope:n}),setDbResult:n=>e({dbResult:n}),setDbChoice:n=>e({dbChoice:n}),setArchOptions:n=>e({archOptions:n}),setSelectedArch:n=>e({selectedArch:n}),setPrefillResult:n=>e({prefillResult:n}),setAnalyzing:n=>e({analyzing:n}),setWizardStep:n=>e({wizardStep:n}),updateRequirement:(n,r)=>e(i=>({requirements:{...i.requirements,[n]:r}})),setRequirements:n=>e({requirements:n}),appendProgress:n=>e(r=>({progressLog:[...r.progressLog,n]})),setProgressLog:n=>e({progressLog:Array.isArray(n)?n:[]}),appendMissionProgress:n=>e(r=>({missionProgressLog:[...r.missionProgressLog,n]})),clearMissionProgress:()=>e({missionProgressLog:[]}),setCeremonyStatus:n=>e({ceremonyStatus:n}),setCeremonyResult:n=>e({ceremonyResult:n}),setCeremonyError:n=>e({ceremonyError:n}),setPaused:n=>e({isPaused:n}),setProcessId:n=>e({processId:n}),applyPrefill:(n,r,i,a)=>{e(c=>({prefillResult:n,requirements:{...c.requirements,MISSION_STATEMENT:i,INITIAL_SCOPE:a,TARGET_USERS:n.TARGET_USERS||"",DEPLOYMENT_TARGET:n.DEPLOYMENT_TARGET||"",TECHNICAL_CONSIDERATIONS:n.TECHNICAL_CONSIDERATIONS||"",SECURITY_AND_COMPLIANCE_REQUIREMENTS:n.SECURITY_AND_COMPLIANCE_REQUIREMENTS||""}}))},startRun:()=>e({ceremonyStatus:"running",progressLog:[],ceremonyResult:null,ceremonyError:null})})),ko=ua(e=>({isOpen:!1,step:1,status:"idle",isPaused:!1,progressLog:[],result:null,error:null,processId:null,decomposedHierarchy:null,openModal:()=>e({isOpen:!0,step:1,status:"idle",isPaused:!1,progressLog:[],result:null,error:null,processId:null,decomposedHierarchy:null}),closeModal:()=>e({isOpen:!1}),reopenModal:()=>e(t=>({isOpen:!0,step:t.status==="complete"?4:t.status==="awaiting-selection"?3:t.status==="running"||t.status==="error"?2:1})),setStep:t=>e({step:t}),setStatus:t=>e({status:t}),setPaused:t=>e({isPaused:t}),appendProgress:t=>e(n=>({progressLog:[...n.progressLog,t]})),setProgressLog:t=>e({progressLog:Array.isArray(t)?t:[]}),setResult:t=>e({result:t}),setError:t=>e({error:t}),setProcessId:t=>e({processId:t}),setDecomposedHierarchy:t=>e({decomposedHierarchy:t})})),AC=ua((e,t)=>({processes:[],handleProcessMessage:n=>{const{processes:r}=t();switch(n.type){case"process:list":e({processes:n.processes});break;case"process:started":if(r.find(i=>i.id===n.processId))break;e({processes:[...r,{id:n.processId,type:n.processType,label:n.label,status:"running",startedAt:n.startedAt,endedAt:null}]});break;case"process:status":{const i=r.map(a=>a.id===n.processId?{...a,status:n.status,endedAt:n.endedAt??a.endedAt}:a);e({processes:i}),n.status==="cancelled"&&setTimeout(()=>{e(a=>({processes:a.processes.filter(c=>c.id!==n.processId)}))},1e3);break}}},clearCompleted:async()=>{try{await fetch("/api/processes",{method:"DELETE"})}catch{}e(n=>({processes:n.processes.filter(r=>!["complete","error","cancelled"].includes(r.status))}))}})),Hl=ua((e,t)=>({sessions:{},activeStoryId:null,isOpen:!1,openModal:(n,r)=>e(i=>({isOpen:!0,activeStoryId:n,sessions:{...i.sessions,[n]:i.sessions[n]||{status:"idle",progressLog:[],processId:null,storyName:r||n,error:null,startedAt:null}}})),closeModal:()=>e({isOpen:!1}),reopenModal:n=>e({isOpen:!0,activeStoryId:n}),setStatus:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,status:r,...r==="seeding"?{startedAt:Date.now()}:{}}}}:{}}),appendProgress:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,progressLog:[...a.progressLog,r]}}}:{}}),setProcessId:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,processId:r}}}:{}}),setError:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,error:r,status:"error"}}}:{}}),removeSession:n=>e(r=>{const{[n]:i,...a}=r.sessions;return{sessions:a,...r.activeStoryId===n?{activeStoryId:null,isOpen:!1}:{}}}),getStoryIdByProcessId:n=>{const r=t().sessions;for(const[i,a]of Object.entries(r))if(a.processId===n)return i;return null},getRunningSessions:()=>{const n=t().sessions;return Object.entries(n).filter(([,r])=>r.status==="seeding"||r.status==="checking").map(([r,i])=>({storyId:r,...i}))}})),Gl=ua((e,t)=>({sessions:{},activeTaskId:null,isOpen:!1,openModal:(n,r)=>e(i=>({isOpen:!0,activeTaskId:n,sessions:{...i.sessions,[n]:i.sessions[n]||{status:"idle",progressLog:[],processId:null,taskName:r||n,error:null,reviewInfo:null,startedAt:null}}})),closeModal:()=>e({isOpen:!1}),reopenModal:n=>e({isOpen:!0,activeTaskId:n}),setStatus:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,status:r,...r==="running"?{startedAt:Date.now()}:{}}}}:{}}),appendProgress:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,progressLog:[...a.progressLog,r]}}}:{}}),setProcessId:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,processId:r}}}:{}}),setError:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,error:r,status:"error"}}}:{}}),setReviewInfo:(n,r)=>e(i=>{const a=i.sessions[n];return a?{sessions:{...i.sessions,[n]:{...a,reviewInfo:r}}}:{}}),removeSession:n=>e(r=>{const{[n]:i,...a}=r.sessions;return{sessions:a,...r.activeTaskId===n?{activeTaskId:null,isOpen:!1}:{}}}),getTaskIdByProcessId:n=>{const r=t().sessions;for(const[i,a]of Object.entries(r))if(a.processId===n)return i;return null}})),Fx=b.createContext({});function Bx(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const If=b.createContext(null),Vx=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class DD extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function RD({children:e,isPresent:t}){const n=b.useId(),r=b.useRef(null),i=b.useRef({width:0,height:0,top:0,left:0}),{nonce:a}=b.useContext(Vx);return b.useInsertionEffect(()=>{const{width:c,height:u,top:d,left:p}=i.current;if(t||!r.current||!c||!u)return;r.current.dataset.motionPopId=n;const h=document.createElement("style");return a&&(h.nonce=a),document.head.appendChild(h),h.sheet&&h.sheet.insertRule(`
|
|
301
|
+
[data-motion-pop-id="${n}"] {
|
|
302
|
+
position: absolute !important;
|
|
303
|
+
width: ${c}px !important;
|
|
304
|
+
height: ${u}px !important;
|
|
305
|
+
top: ${d}px !important;
|
|
306
|
+
left: ${p}px !important;
|
|
307
|
+
}
|
|
308
|
+
`),()=>{document.head.removeChild(h)}},[t]),l.jsx(DD,{isPresent:t,childRef:r,sizeRef:i,children:b.cloneElement(e,{ref:r})})}const LD=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:c})=>{const u=Bx($D),d=b.useId(),p=b.useCallback(m=>{u.set(m,!0);for(const g of u.values())if(!g)return;r&&r()},[u,r]),h=b.useMemo(()=>({id:d,initial:t,isPresent:n,custom:i,onExitComplete:p,register:m=>(u.set(m,!1),()=>u.delete(m))}),a?[Math.random(),p]:[n,p]);return b.useMemo(()=>{u.forEach((m,g)=>u.set(g,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),c==="popLayout"&&(e=l.jsx(RD,{isPresent:n,children:e})),l.jsx(If.Provider,{value:h,children:e})};function $D(){return new Map}function EC(e=!0){const t=b.useContext(If);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=b.useId();b.useEffect(()=>{e&&i(a)},[e]);const c=b.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,c]:[!0]}const qu=e=>e.key||"";function q1(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const Ux=typeof window<"u",TC=Ux?b.useLayoutEffect:b.useEffect,MC=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:c=!1})=>{const[u,d]=EC(c),p=b.useMemo(()=>q1(e),[e]),h=c&&!u?[]:p.map(qu),m=b.useRef(!0),g=b.useRef(p),v=Bx(()=>new Map),[w,S]=b.useState(p),[j,k]=b.useState(p);TC(()=>{m.current=!1,g.current=p;for(let A=0;A<j.length;A++){const P=qu(j[A]);h.includes(P)?v.delete(P):v.get(P)!==!0&&v.set(P,!1)}},[j,h.length,h.join("-")]);const C=[];if(p!==w){let A=[...p];for(let P=0;P<j.length;P++){const O=j[P],M=qu(O);h.includes(M)||(A.splice(P,0,O),C.push(O))}a==="wait"&&C.length&&(A=C),k(q1(A)),S(p);return}const{forceRender:E}=b.useContext(Fx);return l.jsx(l.Fragment,{children:j.map(A=>{const P=qu(A),O=c&&!u?!1:p===j||h.includes(P),M=()=>{if(v.has(P))v.set(P,!0);else return;let I=!0;v.forEach(z=>{z||(I=!1)}),I&&(E==null||E(),k(g.current),c&&(d==null||d()),r&&r())};return l.jsx(LD,{isPresent:O,initial:!m.current||n?void 0:!1,custom:O?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:O?void 0:M,children:A},P)})})},Fn=e=>e;let _C=Fn;function Wx(e){let t;return()=>(t===void 0&&(t=e()),t)}const co=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},hi=e=>e*1e3,mi=e=>e/1e3,zD={useManualTiming:!1};function FD(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let c={delta:0,timestamp:0,isProcessing:!1};function u(p){a.has(p)&&(d.schedule(p),e()),p(c)}const d={schedule:(p,h=!1,m=!1)=>{const v=m&&r?t:n;return h&&a.add(p),v.has(p)||v.add(p),p},cancel:p=>{n.delete(p),a.delete(p)},process:p=>{if(c=p,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(u),t.clear(),r=!1,i&&(i=!1,d.process(p))}};return d}const Ku=["read","resolveKeyframes","update","preRender","render","postRender"],BD=40;function IC(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,c=Ku.reduce((k,C)=>(k[C]=FD(a),k),{}),{read:u,resolveKeyframes:d,update:p,preRender:h,render:m,postRender:g}=c,v=()=>{const k=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(k-i.timestamp,BD),1),i.timestamp=k,i.isProcessing=!0,u.process(i),d.process(i),p.process(i),h.process(i),m.process(i),g.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(v))},w=()=>{n=!0,r=!0,i.isProcessing||e(v)};return{schedule:Ku.reduce((k,C)=>{const E=c[C];return k[C]=(A,P=!1,O=!1)=>(n||w(),E.schedule(A,P,O)),k},{}),cancel:k=>{for(let C=0;C<Ku.length;C++)c[Ku[C]].cancel(k)},state:i,steps:c}}const{schedule:lt,cancel:ps,state:Xt,steps:gm}=IC(typeof requestAnimationFrame<"u"?requestAnimationFrame:Fn,!0),DC=b.createContext({strict:!1}),K1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},uo={};for(const e in K1)uo[e]={isEnabled:t=>K1[e].some(n=>!!t[n])};function VD(e){for(const t in e)uo[t]={...uo[t],...e[t]}}const UD=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ad(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||UD.has(e)}let RC=e=>!Ad(e);function WD(e){e&&(RC=t=>t.startsWith("on")?!Ad(t):e(t))}try{WD(require("@emotion/is-prop-valid").default)}catch{}function qD(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(RC(i)||n===!0&&Ad(i)||!t&&!Ad(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function KD(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Df=b.createContext({});function Yl(e){return typeof e=="string"||Array.isArray(e)}function Rf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const qx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Kx=["initial",...qx];function Lf(e){return Rf(e.animate)||Kx.some(t=>Yl(e[t]))}function LC(e){return!!(Lf(e)||e.variants)}function HD(e,t){if(Lf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Yl(n)?n:void 0,animate:Yl(r)?r:void 0}}return e.inherit!==!1?t:{}}function GD(e){const{initial:t,animate:n}=HD(e,b.useContext(Df));return b.useMemo(()=>({initial:t,animate:n}),[H1(t),H1(n)])}function H1(e){return Array.isArray(e)?e.join(" "):e}const YD=Symbol.for("motionComponentSymbol");function Xa(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function XD(e,t,n){return b.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Xa(n)&&(n.current=r))},[t])}const Hx=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),QD="framerAppearId",$C="data-"+Hx(QD),{schedule:Gx}=IC(queueMicrotask,!1),zC=b.createContext({});function JD(e,t,n,r,i){var a,c;const{visualElement:u}=b.useContext(Df),d=b.useContext(DC),p=b.useContext(If),h=b.useContext(Vx).reducedMotion,m=b.useRef(null);r=r||d.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:u,props:n,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:h}));const g=m.current,v=b.useContext(zC);g&&!g.projection&&i&&(g.type==="html"||g.type==="svg")&&ZD(m.current,n,i,v);const w=b.useRef(!1);b.useInsertionEffect(()=>{g&&w.current&&g.update(n,p)});const S=n[$C],j=b.useRef(!!S&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,S))&&((c=window.MotionHasOptimisedAnimation)===null||c===void 0?void 0:c.call(window,S)));return TC(()=>{g&&(w.current=!0,window.MotionIsMounted=!0,g.updateFeatures(),Gx.render(g.render),j.current&&g.animationState&&g.animationState.animateChanges())}),b.useEffect(()=>{g&&(!j.current&&g.animationState&&g.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,S)}),j.current=!1))}),g}function ZD(e,t,n,r){const{layoutId:i,layout:a,drag:c,dragConstraints:u,layoutScroll:d,layoutRoot:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:FC(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!c||u&&Xa(u),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:d,layoutRoot:p})}function FC(e){if(e)return e.options.allowProjection!==!1?e.projection:FC(e.parent)}function e4({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var a,c;e&&VD(e);function u(p,h){let m;const g={...b.useContext(Vx),...p,layoutId:t4(p)},{isStatic:v}=g,w=GD(p),S=r(p,v);if(!v&&Ux){n4();const j=r4(g);m=j.MeasureLayout,w.visualElement=JD(i,S,g,t,j.ProjectionNode)}return l.jsxs(Df.Provider,{value:w,children:[m&&w.visualElement?l.jsx(m,{visualElement:w.visualElement,...g}):null,n(i,p,XD(S,w.visualElement,h),S,v,w.visualElement)]})}u.displayName=`motion.${typeof i=="string"?i:`create(${(c=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&c!==void 0?c:""})`}`;const d=b.forwardRef(u);return d[YD]=i,d}function t4({layoutId:e}){const t=b.useContext(Fx).id;return t&&e!==void 0?t+"-"+e:e}function n4(e,t){b.useContext(DC).strict}function r4(e){const{drag:t,layout:n}=uo;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const i4=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Yx(e){return typeof e!="string"||e.includes("-")?!1:!!(i4.indexOf(e)>-1||/[A-Z]/u.test(e))}function G1(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xx(e,t,n,r){if(typeof t=="function"){const[i,a]=G1(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=G1(r);t=t(n!==void 0?n:e.custom,i,a)}return t}const wg=e=>Array.isArray(e),s4=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),a4=e=>wg(e)?e[e.length-1]||0:e,ln=e=>!!(e&&e.getVelocity);function gd(e){const t=ln(e)?e.get():e;return s4(t)?t.toValue():t}function o4({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){const c={latestValues:l4(r,i,a,e),renderState:t()};return n&&(c.onMount=u=>n({props:r,current:u,...c}),c.onUpdate=u=>n(u)),c}const BC=e=>(t,n)=>{const r=b.useContext(Df),i=b.useContext(If),a=()=>o4(e,t,r,i);return n?a():Bx(a)};function l4(e,t,n,r){const i={},a=r(e,{});for(const g in a)i[g]=gd(a[g]);let{initial:c,animate:u}=e;const d=Lf(e),p=LC(e);t&&p&&!d&&e.inherit!==!1&&(c===void 0&&(c=t.initial),u===void 0&&(u=t.animate));let h=n?n.initial===!1:!1;h=h||c===!1;const m=h?u:c;if(m&&typeof m!="boolean"&&!Rf(m)){const g=Array.isArray(m)?m:[m];for(let v=0;v<g.length;v++){const w=Xx(e,g[v]);if(w){const{transitionEnd:S,transition:j,...k}=w;for(const C in k){let E=k[C];if(Array.isArray(E)){const A=h?E.length-1:0;E=E[A]}E!==null&&(i[C]=E)}for(const C in S)i[C]=S[C]}}}return i}const Po=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],da=new Set(Po),VC=e=>t=>typeof t=="string"&&t.startsWith(e),UC=VC("--"),c4=VC("var(--"),Qx=e=>c4(e)?u4.test(e.split("/*")[0].trim()):!1,u4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,WC=(e,t)=>t&&typeof e=="number"?t.transform(e):e,xi=(e,t,n)=>n>t?t:n<e?e:n,Co={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Xl={...Co,transform:e=>xi(0,1,e)},Hu={...Co,default:1},xc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),is=xc("deg"),qr=xc("%"),Te=xc("px"),d4=xc("vh"),f4=xc("vw"),Y1={...qr,parse:e=>qr.parse(e)/100,transform:e=>qr.transform(e*100)},p4={borderWidth:Te,borderTopWidth:Te,borderRightWidth:Te,borderBottomWidth:Te,borderLeftWidth:Te,borderRadius:Te,radius:Te,borderTopLeftRadius:Te,borderTopRightRadius:Te,borderBottomRightRadius:Te,borderBottomLeftRadius:Te,width:Te,maxWidth:Te,height:Te,maxHeight:Te,top:Te,right:Te,bottom:Te,left:Te,padding:Te,paddingTop:Te,paddingRight:Te,paddingBottom:Te,paddingLeft:Te,margin:Te,marginTop:Te,marginRight:Te,marginBottom:Te,marginLeft:Te,backgroundPositionX:Te,backgroundPositionY:Te},h4={rotate:is,rotateX:is,rotateY:is,rotateZ:is,scale:Hu,scaleX:Hu,scaleY:Hu,scaleZ:Hu,skew:is,skewX:is,skewY:is,distance:Te,translateX:Te,translateY:Te,translateZ:Te,x:Te,y:Te,z:Te,perspective:Te,transformPerspective:Te,opacity:Xl,originX:Y1,originY:Y1,originZ:Te},X1={...Co,transform:Math.round},Jx={...p4,...h4,zIndex:X1,size:Te,fillOpacity:Xl,strokeOpacity:Xl,numOctaves:X1},m4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},g4=Po.length;function x4(e,t,n){let r="",i=!0;for(let a=0;a<g4;a++){const c=Po[a],u=e[c];if(u===void 0)continue;let d=!0;if(typeof u=="number"?d=u===(c.startsWith("scale")?1:0):d=parseFloat(u)===0,!d||n){const p=WC(u,Jx[c]);if(!d){i=!1;const h=m4[c]||c;r+=`${h}(${p}) `}n&&(t[c]=p)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function Zx(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let c=!1,u=!1;for(const d in t){const p=t[d];if(da.has(d)){c=!0;continue}else if(UC(d)){i[d]=p;continue}else{const h=WC(p,Jx[d]);d.startsWith("origin")?(u=!0,a[d]=h):r[d]=h}}if(t.transform||(c||n?r.transform=x4(t,e.transform,n):r.transform&&(r.transform="none")),u){const{originX:d="50%",originY:p="50%",originZ:h=0}=a;r.transformOrigin=`${d} ${p} ${h}`}}const v4={offset:"stroke-dashoffset",array:"stroke-dasharray"},y4={offset:"strokeDashoffset",array:"strokeDasharray"};function b4(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?v4:y4;e[a.offset]=Te.transform(-r);const c=Te.transform(t),u=Te.transform(n);e[a.array]=`${c} ${u}`}function Q1(e,t,n){return typeof e=="string"?e:Te.transform(t+n*e)}function w4(e,t,n){const r=Q1(t,e.x,e.width),i=Q1(n,e.y,e.height);return`${r} ${i}`}function ev(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:c,pathSpacing:u=1,pathOffset:d=0,...p},h,m){if(Zx(e,p,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:v,dimensions:w}=e;g.transform&&(w&&(v.transform=g.transform),delete g.transform),w&&(i!==void 0||a!==void 0||v.transform)&&(v.transformOrigin=w4(w,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),c!==void 0&&b4(g,c,u,d,!1)}const tv=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),qC=()=>({...tv(),attrs:{}}),nv=e=>typeof e=="string"&&e.toLowerCase()==="svg";function KC(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const a in n)e.style.setProperty(a,n[a])}const HC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function GC(e,t,n,r){KC(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(HC.has(i)?i:Hx(i),t.attrs[i])}const Ed={};function j4(e){Object.assign(Ed,e)}function YC(e,{layout:t,layoutId:n}){return da.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ed[e]||e==="opacity")}function rv(e,t,n){var r;const{style:i}=e,a={};for(const c in i)(ln(i[c])||t.style&&ln(t.style[c])||YC(c,e)||((r=n==null?void 0:n.getValue(c))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[c]=i[c]);return a}function XC(e,t,n){const r=rv(e,t,n);for(const i in e)if(ln(e[i])||ln(t[i])){const a=Po.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function S4(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const J1=["x","y","width","height","cx","cy","r"],N4={useVisualState:BC({scrapeMotionValuesFromProps:XC,createRenderState:qC,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let a=!!e.drag;if(!a){for(const u in i)if(da.has(u)){a=!0;break}}if(!a)return;let c=!t;if(t)for(let u=0;u<J1.length;u++){const d=J1[u];e[d]!==t[d]&&(c=!0)}c&<.read(()=>{S4(n,r),lt.render(()=>{ev(r,i,nv(n.tagName),e.transformTemplate),GC(n,r)})})}})},k4={useVisualState:BC({scrapeMotionValuesFromProps:rv,createRenderState:tv})};function QC(e,t,n){for(const r in t)!ln(t[r])&&!YC(r,n)&&(e[r]=t[r])}function P4({transformTemplate:e},t){return b.useMemo(()=>{const n=tv();return Zx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function C4(e,t){const n=e.style||{},r={};return QC(r,n,e),Object.assign(r,P4(e,t)),r}function O4(e,t){const n={},r=C4(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function A4(e,t,n,r){const i=b.useMemo(()=>{const a=qC();return ev(a,t,nv(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};QC(a,e.style,e),i.style={...a,...i.style}}return i}function E4(e=!1){return(n,r,i,{latestValues:a},c)=>{const d=(Yx(n)?A4:O4)(r,a,c,n),p=qD(r,typeof n=="string",e),h=n!==b.Fragment?{...p,...d,ref:i}:{},{children:m}=r,g=b.useMemo(()=>ln(m)?m.get():m,[m]);return b.createElement(n,{...h,children:g})}}function T4(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const c={...Yx(r)?N4:k4,preloadedFeatures:e,useRender:E4(i),createVisualElement:t,Component:r};return e4(c)}}function JC(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function $f(e,t,n){const r=e.getProps();return Xx(r,t,n!==void 0?n:r.custom,e)}const M4=Wx(()=>window.ScrollTimeline!==void 0);class _4{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(M4()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,a)=>{i&&i(),this.animations[a].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class I4 extends _4{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function iv(e,t){return e?e[t]||e.default||e:void 0}const jg=2e4;function ZC(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<jg;)t+=n,r=e.next(t);return t>=jg?1/0:t}function sv(e){return typeof e=="function"}function Z1(e,t){e.timeline=t,e.onfinish=null}const av=e=>Array.isArray(e)&&typeof e[0]=="number",D4={linearEasing:void 0};function R4(e,t){const n=Wx(e);return()=>{var r;return(r=D4[t])!==null&&r!==void 0?r:n()}}const Td=R4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),eO=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=e(co(0,i-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function tO(e){return!!(typeof e=="function"&&Td()||!e||typeof e=="string"&&(e in Sg||Td())||av(e)||Array.isArray(e)&&e.every(tO))}const _l=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Sg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_l([0,.65,.55,1]),circOut:_l([.55,0,1,.45]),backIn:_l([.31,.01,.66,-.59]),backOut:_l([.33,1.53,.69,.99])};function nO(e,t){if(e)return typeof e=="function"&&Td()?eO(e,t):av(e)?_l(e):Array.isArray(e)?e.map(n=>nO(n,t)||Sg.easeOut):Sg[e]}const kr={x:!1,y:!1};function rO(){return kr.x||kr.y}function L4(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const a=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function iO(e,t){const n=L4(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function ej(e){return t=>{t.pointerType==="touch"||rO()||e(t)}}function $4(e,t,n={}){const[r,i,a]=iO(e,n),c=ej(u=>{const{target:d}=u,p=t(u);if(typeof p!="function"||!d)return;const h=ej(m=>{p(m),d.removeEventListener("pointerleave",h)});d.addEventListener("pointerleave",h,i)});return r.forEach(u=>{u.addEventListener("pointerenter",c,i)}),a}const sO=(e,t)=>t?e===t?!0:sO(e,t.parentElement):!1,ov=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,z4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function F4(e){return z4.has(e.tagName)||e.tabIndex!==-1}const Il=new WeakSet;function tj(e){return t=>{t.key==="Enter"&&e(t)}}function xm(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const B4=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=tj(()=>{if(Il.has(n))return;xm(n,"down");const i=tj(()=>{xm(n,"up")}),a=()=>xm(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",a,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function nj(e){return ov(e)&&!rO()}function V4(e,t,n={}){const[r,i,a]=iO(e,n),c=u=>{const d=u.currentTarget;if(!nj(u)||Il.has(d))return;Il.add(d);const p=t(u),h=(v,w)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",g),!(!nj(v)||!Il.has(d))&&(Il.delete(d),typeof p=="function"&&p(v,{success:w}))},m=v=>{h(v,n.useGlobalTarget||sO(d,v.target))},g=v=>{h(v,!1)};window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",g,i)};return r.forEach(u=>{!F4(u)&&u.getAttribute("tabindex")===null&&(u.tabIndex=0),(n.useGlobalTarget?window:u).addEventListener("pointerdown",c,i),u.addEventListener("focus",p=>B4(p,i),i)}),a}function U4(e){return e==="x"||e==="y"?kr[e]?null:(kr[e]=!0,()=>{kr[e]=!1}):kr.x||kr.y?null:(kr.x=kr.y=!0,()=>{kr.x=kr.y=!1})}const aO=new Set(["width","height","top","left","right","bottom",...Po]);let xd;function W4(){xd=void 0}const Kr={now:()=>(xd===void 0&&Kr.set(Xt.isProcessing||zD.useManualTiming?Xt.timestamp:performance.now()),xd),set:e=>{xd=e,queueMicrotask(W4)}};function lv(e,t){e.indexOf(t)===-1&&e.push(t)}function cv(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class uv{constructor(){this.subscriptions=[]}add(t){return lv(this.subscriptions,t),()=>cv(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const c=this.subscriptions[a];c&&c(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function oO(e,t){return t?e*(1e3/t):0}const rj=30,q4=e=>!isNaN(parseFloat(e));class K4{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=Kr.now();this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Kr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=q4(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new uv);const r=this.events[t].add(n);return t==="change"?()=>{r(),lt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Kr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>rj)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,rj);return oO(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Ql(e,t){return new K4(e,t)}function H4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Ql(n))}function G4(e,t){const n=$f(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const c in a){const u=a4(a[c]);H4(e,c,u)}}function Y4(e){return!!(ln(e)&&e.add)}function Ng(e,t){const n=e.getValue("willChange");if(Y4(n))return n.add(t)}function lO(e){return e.props[$C]}const cO=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,X4=1e-7,Q4=12;function J4(e,t,n,r,i){let a,c,u=0;do c=t+(n-t)/2,a=cO(c,r,i)-e,a>0?n=c:t=c;while(Math.abs(a)>X4&&++u<Q4);return c}function vc(e,t,n,r){if(e===t&&n===r)return Fn;const i=a=>J4(a,0,1,e,n);return a=>a===0||a===1?a:cO(i(a),t,r)}const uO=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,dO=e=>t=>1-e(1-t),fO=vc(.33,1.53,.69,.99),dv=dO(fO),pO=uO(dv),hO=e=>(e*=2)<1?.5*dv(e):.5*(2-Math.pow(2,-10*(e-1))),fv=e=>1-Math.sin(Math.acos(e)),mO=dO(fv),gO=uO(fv),xO=e=>/^0[^.\s]+$/u.test(e);function Z4(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||xO(e):!0}const zl=e=>Math.round(e*1e5)/1e5,pv=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function eR(e){return e==null}const tR=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,hv=(e,t)=>n=>!!(typeof n=="string"&&tR.test(n)&&n.startsWith(e)||t&&!eR(n)&&Object.prototype.hasOwnProperty.call(n,t)),vO=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,c,u]=r.match(pv);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(c),alpha:u!==void 0?parseFloat(u):1}},nR=e=>xi(0,255,e),vm={...Co,transform:e=>Math.round(nR(e))},Hs={test:hv("rgb","red"),parse:vO("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+vm.transform(e)+", "+vm.transform(t)+", "+vm.transform(n)+", "+zl(Xl.transform(r))+")"};function rR(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const kg={test:hv("#"),parse:rR,transform:Hs.transform},Qa={test:hv("hsl","hue"),parse:vO("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+qr.transform(zl(t))+", "+qr.transform(zl(n))+", "+zl(Xl.transform(r))+")"},an={test:e=>Hs.test(e)||kg.test(e)||Qa.test(e),parse:e=>Hs.test(e)?Hs.parse(e):Qa.test(e)?Qa.parse(e):kg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hs.transform(e):Qa.transform(e)},iR=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sR(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(pv))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(iR))===null||n===void 0?void 0:n.length)||0)>0}const yO="number",bO="color",aR="var",oR="var(",ij="${}",lR=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Jl(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const u=t.replace(lR,d=>(an.test(d)?(r.color.push(a),i.push(bO),n.push(an.parse(d))):d.startsWith(oR)?(r.var.push(a),i.push(aR),n.push(d)):(r.number.push(a),i.push(yO),n.push(parseFloat(d))),++a,ij)).split(ij);return{values:n,split:u,indexes:r,types:i}}function wO(e){return Jl(e).values}function jO(e){const{split:t,types:n}=Jl(e),r=t.length;return i=>{let a="";for(let c=0;c<r;c++)if(a+=t[c],i[c]!==void 0){const u=n[c];u===yO?a+=zl(i[c]):u===bO?a+=an.transform(i[c]):a+=i[c]}return a}}const cR=e=>typeof e=="number"?0:e;function uR(e){const t=wO(e);return jO(e)(t.map(cR))}const hs={test:sR,parse:wO,createTransformer:jO,getAnimatableNone:uR},dR=new Set(["brightness","contrast","saturate","opacity"]);function fR(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(pv)||[];if(!r)return e;const i=n.replace(r,"");let a=dR.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const pR=/\b([a-z-]*)\(.*?\)/gu,Pg={...hs,getAnimatableNone:e=>{const t=e.match(pR);return t?t.map(fR).join(" "):e}},hR={...Jx,color:an,backgroundColor:an,outlineColor:an,fill:an,stroke:an,borderColor:an,borderTopColor:an,borderRightColor:an,borderBottomColor:an,borderLeftColor:an,filter:Pg,WebkitFilter:Pg},mv=e=>hR[e];function SO(e,t){let n=mv(e);return n!==Pg&&(n=hs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const mR=new Set(["auto","none","0"]);function gR(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!mR.has(a)&&Jl(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=SO(n,i)}const sj=e=>e===Co||e===Te,aj=(e,t)=>parseFloat(e.split(", ")[t]),oj=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return aj(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?aj(a[1],e):0}},xR=new Set(["x","y","z"]),vR=Po.filter(e=>!xR.has(e));function yR(e){const t=[];return vR.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const fo={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:oj(4,13),y:oj(5,14)};fo.translateX=fo.x;fo.translateY=fo.y;const Qs=new Set;let Cg=!1,Og=!1;function NO(){if(Og){const e=Array.from(Qs).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=yR(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,c])=>{var u;(u=r.getValue(a))===null||u===void 0||u.set(c)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Og=!1,Cg=!1,Qs.forEach(e=>e.complete()),Qs.clear()}function kO(){Qs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Og=!0)})}function bR(){kO(),NO()}class gv{constructor(t,n,r,i,a,c=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=c}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Qs.add(this),Cg||(Cg=!0,lt.read(kO),lt.resolveKeyframes(NO))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let a=0;a<t.length;a++)if(t[a]===null)if(a===0){const c=i==null?void 0:i.get(),u=t[t.length-1];if(c!==void 0)t[0]=c;else if(r&&n){const d=r.readValue(n,u);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=u),i&&c===void 0&&i.set(t[0])}else t[a]=t[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Qs.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Qs.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const PO=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),wR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function jR(e){const t=wR.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function CO(e,t,n=1){const[r,i]=jR(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const c=a.trim();return PO(c)?parseFloat(c):c}return Qx(i)?CO(i,t,n+1):i}const OO=e=>t=>t.test(e),SR={test:e=>e==="auto",parse:e=>e},AO=[Co,Te,qr,is,f4,d4,SR],lj=e=>AO.find(OO(e));class EO extends gv{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let p=t[d];if(typeof p=="string"&&(p=p.trim(),Qx(p))){const h=CO(p,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!aO.has(r)||t.length!==2)return;const[i,a]=t,c=lj(i),u=lj(a);if(c!==u)if(sj(c)&&sj(u))for(let d=0;d<t.length;d++){const p=t[d];typeof p=="string"&&(t[d]=parseFloat(p))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)Z4(t[i])&&r.push(i);r.length&&gR(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=fo[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const a=n.getValue(r);a&&a.jump(this.measuredOrigin,!1);const c=i.length-1,u=i[c];i[c]=fo[r](n.measureViewportBox(),window.getComputedStyle(n.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([d,p])=>{n.getValue(d).set(p)}),this.resolveNoneKeyframes()}}const cj=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(hs.test(e)||e==="0")&&!e.startsWith("url("));function NR(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function kR(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],c=cj(i,t),u=cj(a,t);return!c||!u?!1:NR(e)||(n==="spring"||sv(n))&&r}const PR=e=>e!==null;function zf(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(PR),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const CR=40;class TO{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:c="loop",...u}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Kr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:c,...u},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>CR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&bR(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Kr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:c,onComplete:u,onUpdate:d,isGenerator:p}=this.options;if(!p&&!kR(t,r,i,a))if(c)this.options.duration=0;else{d&&d(zf(t,this.options,n)),u&&u(),this.resolveFinishedPromise();return}const h=this.initPlayback(t,n);h!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...h},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const ht=(e,t,n)=>e+(t-e)*n;function ym(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function OR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,c=0;if(!t)i=a=c=n;else{const u=n<.5?n*(1+t):n+t-n*t,d=2*n-u;i=ym(d,u,e+1/3),a=ym(d,u,e),c=ym(d,u,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(c*255),alpha:r}}function Md(e,t){return n=>n>0?t:e}const bm=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},AR=[kg,Hs,Qa],ER=e=>AR.find(t=>t.test(e));function uj(e){const t=ER(e);if(!t)return!1;let n=t.parse(e);return t===Qa&&(n=OR(n)),n}const dj=(e,t)=>{const n=uj(e),r=uj(t);if(!n||!r)return Md(e,t);const i={...n};return a=>(i.red=bm(n.red,r.red,a),i.green=bm(n.green,r.green,a),i.blue=bm(n.blue,r.blue,a),i.alpha=ht(n.alpha,r.alpha,a),Hs.transform(i))},TR=(e,t)=>n=>t(e(n)),yc=(...e)=>e.reduce(TR),Ag=new Set(["none","hidden"]);function MR(e,t){return Ag.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function _R(e,t){return n=>ht(e,t,n)}function xv(e){return typeof e=="number"?_R:typeof e=="string"?Qx(e)?Md:an.test(e)?dj:RR:Array.isArray(e)?MO:typeof e=="object"?an.test(e)?dj:IR:Md}function MO(e,t){const n=[...e],r=n.length,i=e.map((a,c)=>xv(a)(a,t[c]));return a=>{for(let c=0;c<r;c++)n[c]=i[c](a);return n}}function IR(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=xv(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function DR(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const c=t.types[a],u=e.indexes[c][i[c]],d=(n=e.values[u])!==null&&n!==void 0?n:0;r[a]=d,i[c]++}return r}const RR=(e,t)=>{const n=hs.createTransformer(t),r=Jl(e),i=Jl(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Ag.has(e)&&!i.values.length||Ag.has(t)&&!r.values.length?MR(e,t):yc(MO(DR(r,i),i.values),n):Md(e,t)};function _O(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?ht(e,t,n):xv(e)(e,t)}const LR=5;function IO(e,t,n){const r=Math.max(t-LR,0);return oO(n-e(r),t-r)}const xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},wm=.001;function $R({duration:e=xt.duration,bounce:t=xt.bounce,velocity:n=xt.velocity,mass:r=xt.mass}){let i,a,c=1-t;c=xi(xt.minDamping,xt.maxDamping,c),e=xi(xt.minDuration,xt.maxDuration,mi(e)),c<1?(i=p=>{const h=p*c,m=h*e,g=h-n,v=Eg(p,c),w=Math.exp(-m);return wm-g/v*w},a=p=>{const m=p*c*e,g=m*n+n,v=Math.pow(c,2)*Math.pow(p,2)*e,w=Math.exp(-m),S=Eg(Math.pow(p,2),c);return(-i(p)+wm>0?-1:1)*((g-v)*w)/S}):(i=p=>{const h=Math.exp(-p*e),m=(p-n)*e+1;return-wm+h*m},a=p=>{const h=Math.exp(-p*e),m=(n-p)*(e*e);return h*m});const u=5/e,d=FR(i,a,u);if(e=hi(e),isNaN(d))return{stiffness:xt.stiffness,damping:xt.damping,duration:e};{const p=Math.pow(d,2)*r;return{stiffness:p,damping:c*2*Math.sqrt(r*p),duration:e}}}const zR=12;function FR(e,t,n){let r=n;for(let i=1;i<zR;i++)r=r-e(r)/t(r);return r}function Eg(e,t){return e*Math.sqrt(1-t*t)}const BR=["duration","bounce"],VR=["stiffness","damping","mass"];function fj(e,t){return t.some(n=>e[n]!==void 0)}function UR(e){let t={velocity:xt.velocity,stiffness:xt.stiffness,damping:xt.damping,mass:xt.mass,isResolvedFromDuration:!1,...e};if(!fj(e,VR)&&fj(e,BR))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*xi(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:xt.mass,stiffness:i,damping:a}}else{const n=$R(e);t={...t,...n,mass:xt.mass},t.isResolvedFromDuration=!0}return t}function DO(e=xt.visualDuration,t=xt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],u={done:!1,value:a},{stiffness:d,damping:p,mass:h,duration:m,velocity:g,isResolvedFromDuration:v}=UR({...n,velocity:-mi(n.velocity||0)}),w=g||0,S=p/(2*Math.sqrt(d*h)),j=c-a,k=mi(Math.sqrt(d/h)),C=Math.abs(j)<5;r||(r=C?xt.restSpeed.granular:xt.restSpeed.default),i||(i=C?xt.restDelta.granular:xt.restDelta.default);let E;if(S<1){const P=Eg(k,S);E=O=>{const M=Math.exp(-S*k*O);return c-M*((w+S*k*j)/P*Math.sin(P*O)+j*Math.cos(P*O))}}else if(S===1)E=P=>c-Math.exp(-k*P)*(j+(w+k*j)*P);else{const P=k*Math.sqrt(S*S-1);E=O=>{const M=Math.exp(-S*k*O),I=Math.min(P*O,300);return c-M*((w+S*k*j)*Math.sinh(I)+P*j*Math.cosh(I))/P}}const A={calculatedDuration:v&&m||null,next:P=>{const O=E(P);if(v)u.done=P>=m;else{let M=0;S<1&&(M=P===0?hi(w):IO(E,P,O));const I=Math.abs(M)<=r,z=Math.abs(c-O)<=i;u.done=I&&z}return u.value=u.done?c:O,u},toString:()=>{const P=Math.min(ZC(A),jg),O=eO(M=>A.next(P*M).value,P,30);return P+"ms "+O}};return A}function pj({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:c,min:u,max:d,restDelta:p=.5,restSpeed:h}){const m=e[0],g={done:!1,value:m},v=I=>u!==void 0&&I<u||d!==void 0&&I>d,w=I=>u===void 0?d:d===void 0||Math.abs(u-I)<Math.abs(d-I)?u:d;let S=n*t;const j=m+S,k=c===void 0?j:c(j);k!==j&&(S=k-m);const C=I=>-S*Math.exp(-I/r),E=I=>k+C(I),A=I=>{const z=C(I),K=E(I);g.done=Math.abs(z)<=p,g.value=g.done?k:K};let P,O;const M=I=>{v(g.value)&&(P=I,O=DO({keyframes:[g.value,w(g.value)],velocity:IO(E,I,g.value),damping:i,stiffness:a,restDelta:p,restSpeed:h}))};return M(0),{calculatedDuration:null,next:I=>{let z=!1;return!O&&P===void 0&&(z=!0,A(I),M(I)),P!==void 0&&I>=P?O.next(I-P):(!z&&A(I),g)}}}const WR=vc(.42,0,1,1),qR=vc(0,0,.58,1),RO=vc(.42,0,.58,1),KR=e=>Array.isArray(e)&&typeof e[0]!="number",HR={linear:Fn,easeIn:WR,easeInOut:RO,easeOut:qR,circIn:fv,circInOut:gO,circOut:mO,backIn:dv,backInOut:pO,backOut:fO,anticipate:hO},hj=e=>{if(av(e)){_C(e.length===4);const[t,n,r,i]=e;return vc(t,n,r,i)}else if(typeof e=="string")return HR[e];return e};function GR(e,t,n){const r=[],i=n||_O,a=e.length-1;for(let c=0;c<a;c++){let u=i(e[c],e[c+1]);if(t){const d=Array.isArray(t)?t[c]||Fn:t;u=yc(d,u)}r.push(u)}return r}function YR(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(_C(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=GR(t,r,i),d=u.length,p=h=>{if(c&&h<e[0])return t[0];let m=0;if(d>1)for(;m<e.length-2&&!(h<e[m+1]);m++);const g=co(e[m],e[m+1],h);return u[m](g)};return n?h=>p(xi(e[0],e[a-1],h)):p}function XR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=co(0,t,r);e.push(ht(n,1,i))}}function QR(e){const t=[0];return XR(t,e.length-1),t}function JR(e,t){return e.map(n=>n*t)}function ZR(e,t){return e.map(()=>t||RO).splice(0,e.length-1)}function _d({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=KR(r)?r.map(hj):hj(r),a={done:!1,value:t[0]},c=JR(n&&n.length===t.length?n:QR(t),e),u=YR(c,t,{ease:Array.isArray(i)?i:ZR(t,i)});return{calculatedDuration:e,next:d=>(a.value=u(d),a.done=d>=e,a)}}const eL=e=>{const t=({timestamp:n})=>e(n);return{start:()=>lt.update(t,!0),stop:()=>ps(t),now:()=>Xt.isProcessing?Xt.timestamp:Kr.now()}},tL={decay:pj,inertia:pj,tween:_d,keyframes:_d,spring:DO},nL=e=>e/100;class vv extends TO{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:d}=this.options;d&&d()};const{name:n,motionValue:r,element:i,keyframes:a}=this.options,c=(i==null?void 0:i.KeyframeResolver)||gv,u=(d,p)=>this.onKeyframesResolved(d,p);this.resolver=new c(a,u,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:c=0}=this.options,u=sv(n)?n:tL[n]||_d;let d,p;u!==_d&&typeof t[0]!="number"&&(d=yc(nL,_O(t[0],t[1])),t=[0,100]);const h=u({...this.options,keyframes:t});a==="mirror"&&(p=u({...this.options,keyframes:[...t].reverse(),velocity:-c})),h.calculatedDuration===null&&(h.calculatedDuration=ZC(h));const{calculatedDuration:m}=h,g=m+i,v=g*(r+1)-i;return{generator:h,mirroredGenerator:p,mapPercentToKeyframes:d,calculatedDuration:m,resolvedDuration:g,totalDuration:v}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:I}=this.options;return{done:!0,value:I[I.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:c,mapPercentToKeyframes:u,keyframes:d,calculatedDuration:p,totalDuration:h,resolvedDuration:m}=r;if(this.startTime===null)return a.next(0);const{delay:g,repeat:v,repeatType:w,repeatDelay:S,onUpdate:j}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-h/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const k=this.currentTime-g*(this.speed>=0?1:-1),C=this.speed>=0?k<0:k>h;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=h);let E=this.currentTime,A=a;if(v){const I=Math.min(this.currentTime,h)/m;let z=Math.floor(I),K=I%1;!K&&I>=1&&(K=1),K===1&&z--,z=Math.min(z,v+1),!!(z%2)&&(w==="reverse"?(K=1-K,S&&(K-=S/m)):w==="mirror"&&(A=c)),E=xi(0,1,K)*m}const P=C?{done:!1,value:d[0]}:A.next(E);u&&(P.value=u(P.value));let{done:O}=P;!C&&p!==null&&(O=this.speed>=0?this.currentTime>=h:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return M&&i!==void 0&&(P.value=zf(d,this.options,i)),j&&j(P.value),M&&this.finish(),P}get duration(){const{resolved:t}=this;return t?mi(t.calculatedDuration):0}get time(){return mi(this.currentTime)}set time(t){t=hi(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=mi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=eL,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(a=>this.tick(a))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const rL=new Set(["opacity","clipPath","filter","transform"]);function iL(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:c="loop",ease:u="easeInOut",times:d}={}){const p={[t]:n};d&&(p.offset=d);const h=nO(u,i);return Array.isArray(h)&&(p.easing=h),e.animate(p,{delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:c==="reverse"?"alternate":"normal"})}const sL=Wx(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Id=10,aL=2e4;function oL(e){return sv(e.type)||e.type==="spring"||!tO(e.ease)}function lL(e,t){const n=new vv({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let a=0;for(;!r.done&&a<aL;)r=n.sample(a),i.push(r.value),a+=Id;return{times:void 0,keyframes:i,duration:a-Id,ease:"linear"}}const LO={anticipate:hO,backInOut:pO,circInOut:gO};function cL(e){return e in LO}class mj extends TO{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new EO(a,(c,u)=>this.onKeyframesResolved(c,u),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:a,type:c,motionValue:u,name:d,startTime:p}=this.options;if(!u.owner||!u.owner.current)return!1;if(typeof a=="string"&&Td()&&cL(a)&&(a=LO[a]),oL(this.options)){const{onComplete:m,onUpdate:g,motionValue:v,element:w,...S}=this.options,j=lL(t,S);t=j.keyframes,t.length===1&&(t[1]=t[0]),r=j.duration,i=j.times,a=j.ease,c="keyframes"}const h=iL(u.owner.current,d,t,{...this.options,duration:r,times:i,ease:a});return h.startTime=p??this.calcStartTime(),this.pendingTimeline?(Z1(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:m}=this.options;u.set(zf(t,this.options,n)),m&&m(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:r,times:i,type:c,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return mi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return mi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=hi(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Fn;const{animation:r}=n;Z1(r,t)}return Fn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:a,ease:c,times:u}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:p,onUpdate:h,onComplete:m,element:g,...v}=this.options,w=new vv({...v,keyframes:r,duration:i,type:a,ease:c,times:u,isGenerator:!0}),S=hi(this.time);p.setWithVelocity(w.sample(S-Id).value,w.sample(S).value,Id)}const{onStop:d}=this.options;d&&d(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:a,damping:c,type:u}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:p}=n.owner.getProps();return sL()&&r&&rL.has(r)&&!d&&!p&&!i&&a!=="mirror"&&c!==0&&u!=="inertia"}}const uL={type:"spring",stiffness:500,damping:25,restSpeed:10},dL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),fL={type:"keyframes",duration:.8},pL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hL=(e,{keyframes:t})=>t.length>2?fL:da.has(e)?e.startsWith("scale")?dL(t[1]):uL:pL;function mL({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:c,repeatDelay:u,from:d,elapsed:p,...h}){return!!Object.keys(h).length}const yv=(e,t,n,r={},i,a)=>c=>{const u=iv(r,e)||{},d=u.delay||r.delay||0;let{elapsed:p=0}=r;p=p-hi(d);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-p,onUpdate:g=>{t.set(g),u.onUpdate&&u.onUpdate(g)},onComplete:()=>{c(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:a?void 0:i};mL(u)||(h={...h,...hL(e,h)}),h.duration&&(h.duration=hi(h.duration)),h.repeatDelay&&(h.repeatDelay=hi(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let m=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(h.duration=0,h.delay===0&&(m=!0)),m&&!a&&t.get()!==void 0){const g=zf(h.keyframes,u);if(g!==void 0)return lt.update(()=>{h.onUpdate(g),h.onComplete()}),new I4([])}return!a&&mj.supports(h)?new mj(h):new vv(h)};function gL({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function $O(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:c=e.getDefaultTransition(),transitionEnd:u,...d}=t;r&&(c=r);const p=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in d){const g=e.getValue(m,(a=e.latestValues[m])!==null&&a!==void 0?a:null),v=d[m];if(v===void 0||h&&gL(h,m))continue;const w={delay:n,...iv(c||{},m)};let S=!1;if(window.MotionHandoffAnimation){const k=lO(e);if(k){const C=window.MotionHandoffAnimation(k,m,lt);C!==null&&(w.startTime=C,S=!0)}}Ng(e,m),g.start(yv(m,g,v,e.shouldReduceMotion&&aO.has(m)?{type:!1}:w,e,S));const j=g.animation;j&&p.push(j)}return u&&Promise.all(p).then(()=>{lt.update(()=>{u&&G4(e,u)})}),p}function Tg(e,t,n={}){var r;const i=$f(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const c=i?()=>Promise.all($O(e,i,n)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(p=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:g}=a;return xL(e,t,h+p,m,g,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[p,h]=d==="beforeChildren"?[c,u]:[u,c];return p().then(()=>h())}else return Promise.all([c(),u(n.delay)])}function xL(e,t,n=0,r=0,i=1,a){const c=[],u=(e.variantChildren.size-1)*r,d=i===1?(p=0)=>p*r:(p=0)=>u-p*r;return Array.from(e.variantChildren).sort(vL).forEach((p,h)=>{p.notify("AnimationStart",t),c.push(Tg(p,t,{...a,delay:n+d(h)}).then(()=>p.notify("AnimationComplete",t)))}),Promise.all(c)}function vL(e,t){return e.sortNodePosition(t)}function yL(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>Tg(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=Tg(e,t,n);else{const i=typeof t=="function"?$f(e,t,n.custom):t;r=Promise.all($O(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const bL=Kx.length;function zO(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?zO(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<bL;n++){const r=Kx[n],i=e.props[r];(Yl(i)||i===!1)&&(t[r]=i)}return t}const wL=[...qx].reverse(),jL=qx.length;function SL(e){return t=>Promise.all(t.map(({animation:n,options:r})=>yL(e,n,r)))}function NL(e){let t=SL(e),n=gj(),r=!0;const i=d=>(p,h)=>{var m;const g=$f(e,h,d==="exit"?(m=e.presenceContext)===null||m===void 0?void 0:m.custom:void 0);if(g){const{transition:v,transitionEnd:w,...S}=g;p={...p,...S,...w}}return p};function a(d){t=d(e)}function c(d){const{props:p}=e,h=zO(e.parent)||{},m=[],g=new Set;let v={},w=1/0;for(let j=0;j<jL;j++){const k=wL[j],C=n[k],E=p[k]!==void 0?p[k]:h[k],A=Yl(E),P=k===d?C.isActive:null;P===!1&&(w=j);let O=E===h[k]&&E!==p[k]&&A;if(O&&r&&e.manuallyAnimateOnMount&&(O=!1),C.protectedKeys={...v},!C.isActive&&P===null||!E&&!C.prevProp||Rf(E)||typeof E=="boolean")continue;const M=kL(C.prevProp,E);let I=M||k===d&&C.isActive&&!O&&A||j>w&&A,z=!1;const K=Array.isArray(E)?E:[E];let L=K.reduce(i(k),{});P===!1&&(L={});const{prevResolvedValues:R={}}=C,ee={...R,...L},J=U=>{I=!0,g.has(U)&&(z=!0,g.delete(U)),C.needsAnimating[U]=!0;const B=e.getValue(U);B&&(B.liveStyle=!1)};for(const U in ee){const B=L[U],G=R[U];if(v.hasOwnProperty(U))continue;let q=!1;wg(B)&&wg(G)?q=!JC(B,G):q=B!==G,q?B!=null?J(U):g.add(U):B!==void 0&&g.has(U)?J(U):C.protectedKeys[U]=!0}C.prevProp=E,C.prevResolvedValues=L,C.isActive&&(v={...v,...L}),r&&e.blockInitialAnimation&&(I=!1),I&&(!(O&&M)||z)&&m.push(...K.map(U=>({animation:U,options:{type:k}})))}if(g.size){const j={};g.forEach(k=>{const C=e.getBaseTarget(k),E=e.getValue(k);E&&(E.liveStyle=!0),j[k]=C??null}),m.push({animation:j})}let S=!!m.length;return r&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,S?t(m):Promise.resolve()}function u(d,p){var h;if(n[d].isActive===p)return Promise.resolve();(h=e.variantChildren)===null||h===void 0||h.forEach(g=>{var v;return(v=g.animationState)===null||v===void 0?void 0:v.setActive(d,p)}),n[d].isActive=p;const m=c(d);for(const g in n)n[g].protectedKeys={};return m}return{animateChanges:c,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=gj(),r=!0}}}function kL(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!JC(t,e):!1}function Fs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function gj(){return{animate:Fs(!0),whileInView:Fs(),whileHover:Fs(),whileTap:Fs(),whileDrag:Fs(),whileFocus:Fs(),exit:Fs()}}class xs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class PL extends xs{constructor(t){super(t),t.animationState||(t.animationState=NL(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Rf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let CL=0;class OL extends xs{constructor(){super(...arguments),this.id=CL++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const AL={animation:{Feature:PL},exit:{Feature:OL}};function Zl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function bc(e){return{point:{x:e.pageX,y:e.pageY}}}const EL=e=>t=>ov(t)&&e(t,bc(t));function Fl(e,t,n,r){return Zl(e,t,EL(n),r)}const xj=(e,t)=>Math.abs(e-t);function TL(e,t){const n=xj(e.x,t.x),r=xj(e.y,t.y);return Math.sqrt(n**2+r**2)}class FO{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=Sm(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,v=TL(m.offset,{x:0,y:0})>=3;if(!g&&!v)return;const{point:w}=m,{timestamp:S}=Xt;this.history.push({...w,timestamp:S});const{onStart:j,onMove:k}=this.handlers;g||(j&&j(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=jm(g,this.transformPagePoint),lt.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:v,onSessionEnd:w,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=Sm(m.type==="pointercancel"?this.lastMoveEventInfo:jm(g,this.transformPagePoint),this.history);this.startEvent&&v&&v(m,j),w&&w(m,j)},!ov(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const c=bc(t),u=jm(c,this.transformPagePoint),{point:d}=u,{timestamp:p}=Xt;this.history=[{...d,timestamp:p}];const{onSessionStart:h}=n;h&&h(t,Sm(u,this.history)),this.removeListeners=yc(Fl(this.contextWindow,"pointermove",this.handlePointerMove),Fl(this.contextWindow,"pointerup",this.handlePointerUp),Fl(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ps(this.updatePoint)}}function jm(e,t){return t?{point:t(e.point)}:e}function vj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sm({point:e},t){return{point:e,delta:vj(e,BO(t)),offset:vj(e,ML(t)),velocity:_L(t,.1)}}function ML(e){return e[0]}function BO(e){return e[e.length-1]}function _L(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=BO(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>hi(t)));)n--;if(!r)return{x:0,y:0};const a=mi(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const c={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}const VO=1e-4,IL=1-VO,DL=1+VO,UO=.01,RL=0-UO,LL=0+UO;function Vn(e){return e.max-e.min}function $L(e,t,n){return Math.abs(e-t)<=n}function yj(e,t,n,r=.5){e.origin=r,e.originPoint=ht(t.min,t.max,e.origin),e.scale=Vn(n)/Vn(t),e.translate=ht(n.min,n.max,e.origin)-e.originPoint,(e.scale>=IL&&e.scale<=DL||isNaN(e.scale))&&(e.scale=1),(e.translate>=RL&&e.translate<=LL||isNaN(e.translate))&&(e.translate=0)}function Bl(e,t,n,r){yj(e.x,t.x,n.x,r?r.originX:void 0),yj(e.y,t.y,n.y,r?r.originY:void 0)}function bj(e,t,n){e.min=n.min+t.min,e.max=e.min+Vn(t)}function zL(e,t,n){bj(e.x,t.x,n.x),bj(e.y,t.y,n.y)}function wj(e,t,n){e.min=t.min-n.min,e.max=e.min+Vn(t)}function Vl(e,t,n){wj(e.x,t.x,n.x),wj(e.y,t.y,n.y)}function FL(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ht(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ht(n,e,r.max):Math.min(e,n)),e}function jj(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function BL(e,{top:t,left:n,bottom:r,right:i}){return{x:jj(e.x,n,i),y:jj(e.y,t,r)}}function Sj(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function VL(e,t){return{x:Sj(e.x,t.x),y:Sj(e.y,t.y)}}function UL(e,t){let n=.5;const r=Vn(e),i=Vn(t);return i>r?n=co(t.min,t.max-r,e.min):r>i&&(n=co(e.min,e.max-i,t.min)),xi(0,1,n)}function WL(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Mg=.35;function qL(e=Mg){return e===!1?e=0:e===!0&&(e=Mg),{x:Nj(e,"left","right"),y:Nj(e,"top","bottom")}}function Nj(e,t,n){return{min:kj(e,t),max:kj(e,n)}}function kj(e,t){return typeof e=="number"?e:e[t]||0}const Pj=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ja=()=>({x:Pj(),y:Pj()}),Cj=()=>({min:0,max:0}),jt=()=>({x:Cj(),y:Cj()});function ir(e){return[e("x"),e("y")]}function WO({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function KL({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function HL(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Nm(e){return e===void 0||e===1}function _g({scale:e,scaleX:t,scaleY:n}){return!Nm(e)||!Nm(t)||!Nm(n)}function Vs(e){return _g(e)||qO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qO(e){return Oj(e.x)||Oj(e.y)}function Oj(e){return e&&e!=="0%"}function Dd(e,t,n){const r=e-n,i=t*r;return n+i}function Aj(e,t,n,r,i){return i!==void 0&&(e=Dd(e,i,r)),Dd(e,n,r)+t}function Ig(e,t=0,n=1,r,i){e.min=Aj(e.min,t,n,r,i),e.max=Aj(e.max,t,n,r,i)}function KO(e,{x:t,y:n}){Ig(e.x,t.translate,t.scale,t.originPoint),Ig(e.y,n.translate,n.scale,n.originPoint)}const Ej=.999999999999,Tj=1.0000000000001;function GL(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,c;for(let u=0;u<i;u++){a=n[u],c=a.projectionDelta;const{visualElement:d}=a.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&eo(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),c&&(t.x*=c.x.scale,t.y*=c.y.scale,KO(e,c)),r&&Vs(a.latestValues)&&eo(e,a.latestValues))}t.x<Tj&&t.x>Ej&&(t.x=1),t.y<Tj&&t.y>Ej&&(t.y=1)}function Za(e,t){e.min=e.min+t,e.max=e.max+t}function Mj(e,t,n,r,i=.5){const a=ht(e.min,e.max,i);Ig(e,t,n,a,r)}function eo(e,t){Mj(e.x,t.x,t.scaleX,t.scale,t.originX),Mj(e.y,t.y,t.scaleY,t.scale,t.originY)}function HO(e,t){return WO(HL(e.getBoundingClientRect(),t))}function YL(e,t,n){const r=HO(e,n),{scroll:i}=t;return i&&(Za(r.x,i.offset.x),Za(r.y,i.offset.y)),r}const GO=({current:e})=>e?e.ownerDocument.defaultView:null,XL=new WeakMap;class QL{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=jt(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=h=>{const{dragSnapToOrigin:m}=this.getProps();m?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(bc(h).point)},a=(h,m)=>{const{drag:g,dragPropagation:v,onDragStart:w}=this.getProps();if(g&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=U4(g),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ir(j=>{let k=this.getAxisMotionValue(j).get()||0;if(qr.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const E=C.layout.layoutBox[j];E&&(k=Vn(E)*(parseFloat(k)/100))}}this.originPoint[j]=k}),w&<.postRender(()=>w(h,m)),Ng(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},c=(h,m)=>{const{dragPropagation:g,dragDirectionLock:v,onDirectionLock:w,onDrag:S}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:j}=m;if(v&&this.currentDirection===null){this.currentDirection=JL(j),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",m.point,j),this.updateAxis("y",m.point,j),this.visualElement.render(),S&&S(h,m)},u=(h,m)=>this.stop(h,m),d=()=>ir(h=>{var m;return this.getAnimationState(h)==="paused"&&((m=this.getAxisMotionValue(h).animation)===null||m===void 0?void 0:m.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new FO(t,{onSessionStart:i,onStart:a,onMove:c,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:GO(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:a}=this.getProps();a&<.postRender(()=>a(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Gu(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let c=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(c=FL(c,this.constraints[t],this.elastic[t])),a.set(c)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,a=this.constraints;n&&Xa(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=BL(i.layoutBox,n):this.constraints=!1,this.elastic=qL(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&ir(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=WL(i.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xa(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=YL(r,i.root,this.visualElement.getTransformPagePoint());let c=VL(i.layout.layoutBox,a);if(n){const u=n(KL(c));this.hasMutatedConstraints=!!u,u&&(c=WO(u))}return c}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:c,onDragTransitionEnd:u}=this.getProps(),d=this.constraints||{},p=ir(h=>{if(!Gu(h,n,this.currentDirection))return;let m=d&&d[h]||{};c&&(m={min:0,max:0});const g=i?200:1e6,v=i?40:1e7,w={type:"inertia",velocity:r?t[h]:0,bounceStiffness:g,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...a,...m};return this.startAxisValueAnimation(h,w)});return Promise.all(p).then(u)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Ng(this.visualElement,t),r.start(yv(t,r,0,n,this.visualElement,!1))}stopAnimation(){ir(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ir(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ir(n=>{const{drag:r}=this.getProps();if(!Gu(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:c,max:u}=i.layout.layoutBox[n];a.set(t[n]-ht(c,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Xa(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ir(c=>{const u=this.getAxisMotionValue(c);if(u&&this.constraints!==!1){const d=u.get();i[c]=UL({min:d,max:d},this.constraints[c])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),ir(c=>{if(!Gu(c,t,null))return;const u=this.getAxisMotionValue(c),{min:d,max:p}=this.constraints[c];u.set(ht(d,p,i[c]))})}addListeners(){if(!this.visualElement.current)return;XL.set(this.visualElement,this);const t=this.visualElement.current,n=Fl(t,"pointerdown",d=>{const{drag:p,dragListener:h=!0}=this.getProps();p&&h&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();Xa(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,a=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),lt.read(r);const c=Zl(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(ir(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=d[h].translate,m.set(m.get()+d[h].translate))}),this.visualElement.render())}));return()=>{c(),n(),a(),u&&u()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:c=Mg,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:c,dragMomentum:u}}}function Gu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function JL(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class ZL extends xs{constructor(t){super(t),this.removeGroupControls=Fn,this.removeListeners=Fn,this.controls=new QL(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Fn}unmount(){this.removeGroupControls(),this.removeListeners()}}const _j=e=>(t,n)=>{e&<.postRender(()=>e(t,n))};class e6 extends xs{constructor(){super(...arguments),this.removePointerDownListener=Fn}onPointerDown(t){this.session=new FO(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:GO(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:_j(t),onStart:_j(n),onMove:r,onEnd:(a,c)=>{delete this.session,i&<.postRender(()=>i(a,c))}}}mount(){this.removePointerDownListener=Fl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const vd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Ij(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const bl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Te.test(e))e=parseFloat(e);else return e;const n=Ij(e,t.target.x),r=Ij(e,t.target.y);return`${n}% ${r}%`}},t6={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=hs.parse(e);if(i.length>5)return r;const a=hs.createTransformer(e),c=typeof i[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;i[0+c]/=u,i[1+c]/=d;const p=ht(u,d,.5);return typeof i[2+c]=="number"&&(i[2+c]/=p),typeof i[3+c]=="number"&&(i[3+c]/=p),a(i)}};class n6 extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;j4(r6),a&&(n.group&&n.group.add(a),r&&r.register&&i&&r.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),vd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,c=r.projection;return c&&(c.isPresent=a,i||t.layoutDependency!==n||n===void 0?c.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?c.promote():c.relegate()||lt.postRender(()=>{const u=c.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Gx.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function YO(e){const[t,n]=EC(),r=b.useContext(Fx);return l.jsx(n6,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(zC),isPresent:t,safeToRemove:n})}const r6={borderRadius:{...bl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bl,borderTopRightRadius:bl,borderBottomLeftRadius:bl,borderBottomRightRadius:bl,boxShadow:t6};function i6(e,t,n){const r=ln(e)?e:Ql(e);return r.start(yv("",r,t,n)),r.animation}function s6(e){return e instanceof SVGElement&&e.tagName!=="svg"}const a6=(e,t)=>e.depth-t.depth;class o6{constructor(){this.children=[],this.isDirty=!1}add(t){lv(this.children,t),this.isDirty=!0}remove(t){cv(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(a6),this.isDirty=!1,this.children.forEach(t)}}function l6(e,t){const n=Kr.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(ps(r),e(a-t))};return lt.read(r,!0),()=>ps(r)}const XO=["TopLeft","TopRight","BottomLeft","BottomRight"],c6=XO.length,Dj=e=>typeof e=="string"?parseFloat(e):e,Rj=e=>typeof e=="number"||Te.test(e);function u6(e,t,n,r,i,a){i?(e.opacity=ht(0,n.opacity!==void 0?n.opacity:1,d6(r)),e.opacityExit=ht(t.opacity!==void 0?t.opacity:1,0,f6(r))):a&&(e.opacity=ht(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let c=0;c<c6;c++){const u=`border${XO[c]}Radius`;let d=Lj(t,u),p=Lj(n,u);if(d===void 0&&p===void 0)continue;d||(d=0),p||(p=0),d===0||p===0||Rj(d)===Rj(p)?(e[u]=Math.max(ht(Dj(d),Dj(p),r),0),(qr.test(p)||qr.test(d))&&(e[u]+="%")):e[u]=p}(t.rotate||n.rotate)&&(e.rotate=ht(t.rotate||0,n.rotate||0,r))}function Lj(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const d6=QO(0,.5,mO),f6=QO(.5,.95,Fn);function QO(e,t,n){return r=>r<e?0:r>t?1:n(co(e,t,r))}function $j(e,t){e.min=t.min,e.max=t.max}function er(e,t){$j(e.x,t.x),$j(e.y,t.y)}function zj(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Fj(e,t,n,r,i){return e-=t,e=Dd(e,1/n,r),i!==void 0&&(e=Dd(e,1/i,r)),e}function p6(e,t=0,n=1,r=.5,i,a=e,c=e){if(qr.test(t)&&(t=parseFloat(t),t=ht(c.min,c.max,t/100)-c.min),typeof t!="number")return;let u=ht(a.min,a.max,r);e===a&&(u-=t),e.min=Fj(e.min,t,n,u,i),e.max=Fj(e.max,t,n,u,i)}function Bj(e,t,[n,r,i],a,c){p6(e,t[n],t[r],t[i],t.scale,a,c)}const h6=["x","scaleX","originX"],m6=["y","scaleY","originY"];function Vj(e,t,n,r){Bj(e.x,t,h6,n?n.x:void 0,r?r.x:void 0),Bj(e.y,t,m6,n?n.y:void 0,r?r.y:void 0)}function Uj(e){return e.translate===0&&e.scale===1}function JO(e){return Uj(e.x)&&Uj(e.y)}function Wj(e,t){return e.min===t.min&&e.max===t.max}function g6(e,t){return Wj(e.x,t.x)&&Wj(e.y,t.y)}function qj(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function ZO(e,t){return qj(e.x,t.x)&&qj(e.y,t.y)}function Kj(e){return Vn(e.x)/Vn(e.y)}function Hj(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class x6{constructor(){this.members=[]}add(t){lv(this.members,t),t.scheduleRender()}remove(t){if(cv(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const a=this.members[i];if(a.isPresent!==!1){r=a;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function v6(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,c=(n==null?void 0:n.z)||0;if((i||a||c)&&(r=`translate3d(${i}px, ${a}px, ${c}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:p,rotate:h,rotateX:m,rotateY:g,skewX:v,skewY:w}=n;p&&(r=`perspective(${p}px) ${r}`),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),g&&(r+=`rotateY(${g}deg) `),v&&(r+=`skewX(${v}deg) `),w&&(r+=`skewY(${w}deg) `)}const u=e.x.scale*t.x,d=e.y.scale*t.y;return(u!==1||d!==1)&&(r+=`scale(${u}, ${d})`),r||"none"}const Us={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Dl=typeof window<"u"&&window.MotionDebug!==void 0,km=["","X","Y","Z"],y6={visibility:"hidden"},Gj=1e3;let b6=0;function Pm(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function eA(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=lO(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",lt,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&eA(r)}function tA({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(c={},u=t==null?void 0:t()){this.id=b6++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Dl&&(Us.totalNodes=Us.resolvedTargetDeltas=Us.recalculatedProjection=0),this.nodes.forEach(S6),this.nodes.forEach(O6),this.nodes.forEach(A6),this.nodes.forEach(N6),Dl&&window.MotionDebug.record(Us)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new o6)}addEventListener(c,u){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new uv),this.eventHandlers.get(c).add(u)}notifyListeners(c,...u){const d=this.eventHandlers.get(c);d&&d.notify(...u)}hasListeners(c){return this.eventHandlers.has(c)}mount(c,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=s6(c),this.instance=c;const{layoutId:d,layout:p,visualElement:h}=this.options;if(h&&!h.current&&h.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(p||d)&&(this.isLayoutDirty=!0),e){let m;const g=()=>this.root.updateBlockedByResize=!1;e(c,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=l6(g,250),vd.hasAnimatedSinceResize&&(vd.hasAnimatedSinceResize=!1,this.nodes.forEach(Xj))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||p)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:g,hasRelativeTargetChanged:v,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||h.getDefaultTransition()||I6,{onLayoutAnimationStart:j,onLayoutAnimationComplete:k}=h.getProps(),C=!this.targetLayout||!ZO(this.targetLayout,w)||v,E=!g&&v;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||E||g&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,E);const A={...iv(S,"layout"),onPlay:j,onComplete:k};(h.shouldReduceMotion||this.options.layoutRoot)&&(A.delay=0,A.type=!1),this.startAnimation(A)}else g||Xj(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ps(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(E6),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&eA(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const m=this.path[h];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:u,layout:d}=this.options;if(u===void 0&&!d)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Yj);return}this.isUpdating||this.nodes.forEach(P6),this.isUpdating=!1,this.nodes.forEach(C6),this.nodes.forEach(w6),this.nodes.forEach(j6),this.clearAllSnapshots();const u=Kr.now();Xt.delta=xi(0,1e3/60,u-Xt.timestamp),Xt.timestamp=u,Xt.isProcessing=!0,gm.update.process(Xt),gm.preRender.process(Xt),gm.render.process(Xt),Xt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Gx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(k6),this.sharedNodes.forEach(T6)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,lt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){lt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutCorrected=jt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(u=!1),u){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!i)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!JO(this.projectionDelta),d=this.getTransformTemplate(),p=d?d(this.latestValues,""):void 0,h=p!==this.prevTransformTemplateValue;c&&(u||Vs(this.latestValues)||h)&&(i(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const u=this.measurePageBox();let d=this.removeElementScroll(u);return c&&(d=this.removeTransform(d)),D6(d),{animationId:this.root.animationId,measuredBox:u,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:u}=this.options;if(!u)return jt();const d=u.measureViewportBox();if(!(((c=this.scroll)===null||c===void 0?void 0:c.wasRoot)||this.path.some(R6))){const{scroll:h}=this.root;h&&(Za(d.x,h.offset.x),Za(d.y,h.offset.y))}return d}removeElementScroll(c){var u;const d=jt();if(er(d,c),!((u=this.scroll)===null||u===void 0)&&u.wasRoot)return d;for(let p=0;p<this.path.length;p++){const h=this.path[p],{scroll:m,options:g}=h;h!==this.root&&m&&g.layoutScroll&&(m.wasRoot&&er(d,c),Za(d.x,m.offset.x),Za(d.y,m.offset.y))}return d}applyTransform(c,u=!1){const d=jt();er(d,c);for(let p=0;p<this.path.length;p++){const h=this.path[p];!u&&h.options.layoutScroll&&h.scroll&&h!==h.root&&eo(d,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),Vs(h.latestValues)&&eo(d,h.latestValues)}return Vs(this.latestValues)&&eo(d,this.latestValues),d}removeTransform(c){const u=jt();er(u,c);for(let d=0;d<this.path.length;d++){const p=this.path[d];if(!p.instance||!Vs(p.latestValues))continue;_g(p.latestValues)&&p.updateSnapshot();const h=jt(),m=p.measurePageBox();er(h,m),Vj(u,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,h)}return Vs(this.latestValues)&&Vj(u,this.latestValues),u}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Xt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){var u;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const p=!!this.resumingFrom||this!==d;if(!(c||p&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:g}=this.options;if(!(!this.layout||!(m||g))){if(this.resolvedRelativeTargetAt=Xt.timestamp,!this.targetDelta&&!this.relativeTarget){const v=this.getClosestProjectingParent();v&&v.layout&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=jt(),this.relativeTargetOrigin=jt(),Vl(this.relativeTargetOrigin,this.layout.layoutBox,v.layout.layoutBox),er(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=jt(),this.targetWithTransforms=jt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),zL(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):er(this.target,this.layout.layoutBox),KO(this.target,this.targetDelta)):er(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const v=this.getClosestProjectingParent();v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=jt(),this.relativeTargetOrigin=jt(),Vl(this.relativeTargetOrigin,this.target,v.target),er(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Dl&&Us.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||_g(this.parent.latestValues)||qO(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var c;const u=this.getLead(),d=!!this.resumingFrom||this!==u;let p=!0;if((this.isProjectionDirty||!((c=this.parent)===null||c===void 0)&&c.isProjectionDirty)&&(p=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(p=!1),this.resolvedRelativeTargetAt===Xt.timestamp&&(p=!1),p)return;const{layout:h,layoutId:m}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(h||m))return;er(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;GL(this.layoutCorrected,this.treeScale,this.path,d),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=jt());const{target:w}=u;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(zj(this.prevProjectionDelta.x,this.projectionDelta.x),zj(this.prevProjectionDelta.y,this.projectionDelta.y)),Bl(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!Hj(this.projectionDelta.x,this.prevProjectionDelta.x)||!Hj(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w)),Dl&&Us.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){var u;if((u=this.options.visualElement)===null||u===void 0||u.scheduleRender(),c){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ja(),this.projectionDelta=Ja(),this.projectionDeltaWithTransform=Ja()}setAnimationOrigin(c,u=!1){const d=this.snapshot,p=d?d.latestValues:{},h={...this.latestValues},m=Ja();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const g=jt(),v=d?d.source:void 0,w=this.layout?this.layout.source:void 0,S=v!==w,j=this.getStack(),k=!j||j.members.length<=1,C=!!(S&&!k&&this.options.crossfade===!0&&!this.path.some(_6));this.animationProgress=0;let E;this.mixTargetDelta=A=>{const P=A/1e3;Qj(m.x,c.x,P),Qj(m.y,c.y,P),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Vl(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),M6(this.relativeTarget,this.relativeTargetOrigin,g,P),E&&g6(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=jt()),er(E,this.relativeTarget)),S&&(this.animationValues=h,u6(h,p,this.latestValues,P,C,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ps(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=lt.update(()=>{vd.hasAnimatedSinceResize=!0,this.currentAnimation=i6(0,Gj,{...c,onUpdate:u=>{this.mixTargetDelta(u),c.onUpdate&&c.onUpdate(u)},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Gj),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:u,target:d,layout:p,latestValues:h}=c;if(!(!u||!d||!p)){if(this!==c&&this.layout&&p&&nA(this.options.animationType,this.layout.layoutBox,p.layoutBox)){d=this.target||jt();const m=Vn(this.layout.layoutBox.x);d.x.min=c.target.x.min,d.x.max=d.x.min+m;const g=Vn(this.layout.layoutBox.y);d.y.min=c.target.y.min,d.y.max=d.y.min+g}er(u,d),eo(u,h),Bl(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(c,u){this.sharedNodes.has(c)||this.sharedNodes.set(c,new x6),this.sharedNodes.get(c).add(u);const p=u.options.initialPromotionConfig;u.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(u):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){var c;const{layoutId:u}=this.options;return u?((c=this.getStack())===null||c===void 0?void 0:c.lead)||this:this}getPrevLead(){var c;const{layoutId:u}=this.options;return u?(c=this.getStack())===null||c===void 0?void 0:c.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:u,preserveFollowOpacity:d}={}){const p=this.getStack();p&&p.promote(this,d),c&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let u=!1;const{latestValues:d}=c;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(u=!0),!u)return;const p={};d.z&&Pm("z",c,p,this.animationValues);for(let h=0;h<km.length;h++)Pm(`rotate${km[h]}`,c,p,this.animationValues),Pm(`skew${km[h]}`,c,p,this.animationValues);c.render();for(const h in p)c.setStaticValue(h,p[h]),this.animationValues&&(this.animationValues[h]=p[h]);c.scheduleRender()}getProjectionStyles(c){var u,d;if(!this.instance||this.isSVG)return;if(!this.isVisible)return y6;const p={visibility:""},h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,p.opacity="",p.pointerEvents=gd(c==null?void 0:c.pointerEvents)||"",p.transform=h?h(this.latestValues,""):"none",p;const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){const S={};return this.options.layoutId&&(S.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,S.pointerEvents=gd(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Vs(this.latestValues)&&(S.transform=h?h({},""):"none",this.hasProjected=!1),S}const g=m.animationValues||m.latestValues;this.applyTransformsToTarget(),p.transform=v6(this.projectionDeltaWithTransform,this.treeScale,g),h&&(p.transform=h(g,p.transform));const{x:v,y:w}=this.projectionDelta;p.transformOrigin=`${v.origin*100}% ${w.origin*100}% 0`,m.animationValues?p.opacity=m===this?(d=(u=g.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&d!==void 0?d:1:this.preserveOpacity?this.latestValues.opacity:g.opacityExit:p.opacity=m===this?g.opacity!==void 0?g.opacity:"":g.opacityExit!==void 0?g.opacityExit:0;for(const S in Ed){if(g[S]===void 0)continue;const{correct:j,applyTo:k}=Ed[S],C=p.transform==="none"?g[S]:j(g[S],m);if(k){const E=k.length;for(let A=0;A<E;A++)p[k[A]]=C}else p[S]=C}return this.options.layoutId&&(p.pointerEvents=m===this?gd(c==null?void 0:c.pointerEvents)||"":"none"),p}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>{var u;return(u=c.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(Yj),this.root.sharedNodes.clear()}}}function w6(e){e.updateLayout()}function j6(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:a}=e.options,c=n.source!==e.layout.source;a==="size"?ir(m=>{const g=c?n.measuredBox[m]:n.layoutBox[m],v=Vn(g);g.min=r[m].min,g.max=g.min+v}):nA(a,n.layoutBox,r)&&ir(m=>{const g=c?n.measuredBox[m]:n.layoutBox[m],v=Vn(r[m]);g.max=g.min+v,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+v)});const u=Ja();Bl(u,r,n.layoutBox);const d=Ja();c?Bl(d,e.applyTransform(i,!0),n.measuredBox):Bl(d,r,n.layoutBox);const p=!JO(u);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:g,layout:v}=m;if(g&&v){const w=jt();Vl(w,n.layoutBox,g.layoutBox);const S=jt();Vl(S,r,v.layoutBox),ZO(w,S)||(h=!0),m.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=w,e.relativeParent=m)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:d,layoutDelta:u,hasLayoutChanged:p,hasRelativeTargetChanged:h})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function S6(e){Dl&&Us.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function N6(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function k6(e){e.clearSnapshot()}function Yj(e){e.clearMeasurements()}function P6(e){e.isLayoutDirty=!1}function C6(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Xj(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function O6(e){e.resolveTargetDelta()}function A6(e){e.calcProjection()}function E6(e){e.resetSkewAndRotation()}function T6(e){e.removeLeadSnapshot()}function Qj(e,t,n){e.translate=ht(t.translate,0,n),e.scale=ht(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Jj(e,t,n,r){e.min=ht(t.min,n.min,r),e.max=ht(t.max,n.max,r)}function M6(e,t,n,r){Jj(e.x,t.x,n.x,r),Jj(e.y,t.y,n.y,r)}function _6(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const I6={duration:.45,ease:[.4,0,.1,1]},Zj=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),eS=Zj("applewebkit/")&&!Zj("chrome/")?Math.round:Fn;function tS(e){e.min=eS(e.min),e.max=eS(e.max)}function D6(e){tS(e.x),tS(e.y)}function nA(e,t,n){return e==="position"||e==="preserve-aspect"&&!$L(Kj(t),Kj(n),.2)}function R6(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const L6=tA({attachResizeListener:(e,t)=>Zl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cm={current:void 0},rA=tA({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Cm.current){const e=new L6({});e.mount(window),e.setOptions({layoutScroll:!0}),Cm.current=e}return Cm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),$6={pan:{Feature:e6},drag:{Feature:ZL,ProjectionNode:rA,MeasureLayout:YO}};function nS(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,a=r[i];a&<.postRender(()=>a(t,bc(t)))}class z6 extends xs{mount(){const{current:t}=this.node;t&&(this.unmount=$4(t,n=>(nS(this.node,n,"Start"),r=>nS(this.node,r,"End"))))}unmount(){}}class F6 extends xs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=yc(Zl(this.node.current,"focus",()=>this.onFocus()),Zl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function rS(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),a=r[i];a&<.postRender(()=>a(t,bc(t)))}class B6 extends xs{mount(){const{current:t}=this.node;t&&(this.unmount=V4(t,n=>(rS(this.node,n,"Start"),(r,{success:i})=>rS(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Dg=new WeakMap,Om=new WeakMap,V6=e=>{const t=Dg.get(e.target);t&&t(e)},U6=e=>{e.forEach(V6)};function W6({root:e,...t}){const n=e||document;Om.has(n)||Om.set(n,{});const r=Om.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(U6,{root:e,...t})),r[i]}function q6(e,t,n){const r=W6(t);return Dg.set(e,n),r.observe(e),()=>{Dg.delete(e),r.unobserve(e)}}const K6={some:0,all:1};class H6 extends xs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:a}=t,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:K6[i]},u=d=>{const{isIntersecting:p}=d;if(this.isInView===p||(this.isInView=p,a&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),g=p?h:m;g&&g(d)};return q6(this.node.current,c,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(G6(t,n))&&this.startObserver()}unmount(){}}function G6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Y6={inView:{Feature:H6},tap:{Feature:B6},focus:{Feature:F6},hover:{Feature:z6}},X6={layout:{ProjectionNode:rA,MeasureLayout:YO}},Rg={current:null},iA={current:!1};function Q6(){if(iA.current=!0,!!Ux)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Rg.current=e.matches;e.addListener(t),t()}else Rg.current=!1}const J6=[...AO,an,hs],Z6=e=>J6.find(OO(e)),iS=new WeakMap;function e$(e,t,n){for(const r in t){const i=t[r],a=n[r];if(ln(i))e.addValue(r,i);else if(ln(a))e.addValue(r,Ql(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const c=e.getValue(r);c.liveStyle===!0?c.jump(i):c.hasAnimated||c.set(i)}else{const c=e.getStaticValue(r);e.addValue(r,Ql(c!==void 0?c:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const sS=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class t${scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:c},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=gv,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=Kr.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,lt.render(this.render,!1,!0))};const{latestValues:d,renderState:p,onUpdate:h}=c;this.onUpdate=h,this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=u,this.blockInitialAnimation=!!a,this.isControllingVariants=Lf(n),this.isVariantNode=LC(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:m,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const w=g[v];d[v]!==void 0&&ln(w)&&w.set(d[v],!1)}}mount(t){this.current=t,iS.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),iA.current||Q6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Rg.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){iS.delete(this.current),this.projection&&this.projection.unmount(),ps(this.notifyUpdate),ps(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=da.has(t),i=n.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&<.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let c;window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),c&&c(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in uo){const n=uo[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):jt()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<sS.length;r++){const i=sS[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,c=t[a];c&&(this.propEventSubscriptions[i]=this.on(i,c))}this.prevMotionValues=e$(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Ql(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(PO(i)||xO(i))?i=parseFloat(i):!Z6(i)&&hs.test(n)&&(i=SO(t,n)),this.setBaseTarget(t,ln(i)?i.get():i)),ln(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const c=Xx(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);c&&(i=c[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!ln(a)?a:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new uv),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class sA extends t${constructor(){super(...arguments),this.KeyframeResolver=EO}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ln(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function n$(e){return window.getComputedStyle(e)}class r$ extends sA{constructor(){super(...arguments),this.type="html",this.renderInstance=KC}readValueFromInstance(t,n){if(da.has(n)){const r=mv(n);return r&&r.default||0}else{const r=n$(t),i=(UC(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return HO(t,n)}build(t,n,r){Zx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return rv(t,n,r)}}class i$ extends sA{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=jt}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(da.has(n)){const r=mv(n);return r&&r.default||0}return n=HC.has(n)?n:Hx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return XC(t,n,r)}build(t,n,r){ev(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){GC(t,n,r,i)}mount(t){this.isSVGTag=nv(t.tagName),super.mount(t)}}const s$=(e,t)=>Yx(e)?new i$(t):new r$(t,{allowProjection:e!==b.Fragment}),a$=T4({...AL,...Y6,...$6,...X6},s$),Hr=KD(a$),bv={Backlog:["planned","pending"],Ready:["ready"],"In Progress":["implementing","feedback"],Review:["implemented","testing"],Done:["completed"]},o$={planned:{color:"gray",icon:"📋",label:"Planned"},pending:{color:"slate",icon:"⏸️",label:"Pending"},ready:{color:"blue",icon:"🚀",label:"Ready"},implementing:{color:"yellow",icon:"⚙️",label:"Implementing"},feedback:{color:"amber",icon:"💬",label:"Feedback"},implemented:{color:"purple",icon:"✅",label:"Implemented"},testing:{color:"violet",icon:"🧪",label:"Testing"},completed:{color:"green",icon:"🎉",label:"Completed"},blocked:{color:"red",icon:"🚫",label:"Blocked"}},Rd=["Backlog","Ready","In Progress","Review","Done"],l$={Backlog:{color:"slate",bgColor:"bg-slate-100",borderColor:"border-slate-300"},Ready:{color:"blue",bgColor:"bg-blue-100",borderColor:"border-blue-300"},"In Progress":{color:"yellow",bgColor:"bg-yellow-100",borderColor:"border-yellow-300"},Review:{color:"purple",bgColor:"bg-purple-100",borderColor:"border-purple-300"},Done:{color:"green",bgColor:"bg-green-100",borderColor:"border-green-300"}};function c$(e){for(const[t,n]of Object.entries(bv))if(n.includes(e))return t;return null}function po(e){return o$[e]||null}function u$(e){return l$[e]||null}function ho(e){const t={};Rd.forEach(n=>{t[n]=[]}),e.forEach(n=>{const r=c$(n.status);r&&t[r]&&t[r].push(n)});for(const n of Rd)t[n].sort((r,i)=>{var u,d;const a=((u=r.metadata)==null?void 0:u.codingOrder)??1/0,c=((d=i.metadata)==null?void 0:d.codingOrder)??1/0;return a!==c?a-c:(r.id||"").localeCompare(i.id||"")});return t}function aA(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=aA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=aA(e))&&(r&&(r+=" "),r+=t);return r}const wv="-",d$=e=>{const t=p$(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const u=c.split(wv);return u[0]===""&&u.length!==1&&u.shift(),oA(u,t)||f$(c)},getConflictingClassGroupIds:(c,u)=>{const d=n[c]||[];return u&&r[c]?[...d,...r[c]]:d}}},oA=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?oA(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(wv);return(c=t.validators.find(({validator:u})=>u(a)))==null?void 0:c.classGroupId},aS=/^\[(.+)\]$/,f$=e=>{if(aS.test(e)){const t=aS.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},p$=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return m$(Object.entries(e.classGroups),n).forEach(([a,c])=>{Lg(c,r,a,t)}),r},Lg=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:oS(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(h$(i)){Lg(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,c])=>{Lg(c,oS(t,a),n,r)})})},oS=(e,t)=>{let n=e;return t.split(wv).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},h$=e=>e.isThemeGetter,m$=(e,t)=>t?e.map(([n,r])=>{const i=r.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([c,u])=>[t+c,u])):a);return[n,i]}):e,g$=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,c)=>{n.set(a,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let c=n.get(a);if(c!==void 0)return c;if((c=r.get(a))!==void 0)return i(a,c),c},set(a,c){n.has(a)?n.set(a,c):i(a,c)}}},lA="!",x$=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,c=u=>{const d=[];let p=0,h=0,m;for(let j=0;j<u.length;j++){let k=u[j];if(p===0){if(k===i&&(r||u.slice(j,j+a)===t)){d.push(u.slice(h,j)),h=j+a;continue}if(k==="/"){m=j;continue}}k==="["?p++:k==="]"&&p--}const g=d.length===0?u:u.substring(h),v=g.startsWith(lA),w=v?g.substring(1):g,S=m&&m>h?m-h:void 0;return{modifiers:d,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:S}};return n?u=>n({className:u,parseClassName:c}):c},v$=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},y$=e=>({cache:g$(e.cacheSize),parseClassName:x$(e),...d$(e)}),b$=/\s+/,w$=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],c=e.trim().split(b$);let u="";for(let d=c.length-1;d>=0;d-=1){const p=c[d],{modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:v}=n(p);let w=!!v,S=r(w?g.substring(0,v):g);if(!S){if(!w){u=p+(u.length>0?" "+u:u);continue}if(S=r(g),!S){u=p+(u.length>0?" "+u:u);continue}w=!1}const j=v$(h).join(":"),k=m?j+lA:j,C=k+S;if(a.includes(C))continue;a.push(C);const E=i(S,w);for(let A=0;A<E.length;++A){const P=E[A];a.push(k+P)}u=p+(u.length>0?" "+u:u)}return u};function j$(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=cA(t))&&(r&&(r+=" "),r+=n);return r}const cA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=cA(e[r]))&&(n&&(n+=" "),n+=t);return n};function S$(e,...t){let n,r,i,a=c;function c(d){const p=t.reduce((h,m)=>m(h),e());return n=y$(p),r=n.cache.get,i=n.cache.set,a=u,u(d)}function u(d){const p=r(d);if(p)return p;const h=w$(d,n);return i(d,h),h}return function(){return a(j$.apply(null,arguments))}}const at=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},uA=/^\[(?:([a-z-]+):)?(.+)\]$/i,N$=/^\d+\/\d+$/,k$=new Set(["px","full","screen"]),P$=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,C$=/\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$/,O$=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,A$=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,E$=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ci=e=>so(e)||k$.has(e)||N$.test(e),ns=e=>Oo(e,"length",$$),so=e=>!!e&&!Number.isNaN(Number(e)),Am=e=>Oo(e,"number",so),wl=e=>!!e&&Number.isInteger(Number(e)),T$=e=>e.endsWith("%")&&so(e.slice(0,-1)),Le=e=>uA.test(e),rs=e=>P$.test(e),M$=new Set(["length","size","percentage"]),_$=e=>Oo(e,M$,dA),I$=e=>Oo(e,"position",dA),D$=new Set(["image","url"]),R$=e=>Oo(e,D$,F$),L$=e=>Oo(e,"",z$),jl=()=>!0,Oo=(e,t,n)=>{const r=uA.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},$$=e=>C$.test(e)&&!O$.test(e),dA=()=>!1,z$=e=>A$.test(e),F$=e=>E$.test(e),B$=()=>{const e=at("colors"),t=at("spacing"),n=at("blur"),r=at("brightness"),i=at("borderColor"),a=at("borderRadius"),c=at("borderSpacing"),u=at("borderWidth"),d=at("contrast"),p=at("grayscale"),h=at("hueRotate"),m=at("invert"),g=at("gap"),v=at("gradientColorStops"),w=at("gradientColorStopPositions"),S=at("inset"),j=at("margin"),k=at("opacity"),C=at("padding"),E=at("saturate"),A=at("scale"),P=at("sepia"),O=at("skew"),M=at("space"),I=at("translate"),z=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",Le,t],R=()=>[Le,t],ee=()=>["",ci,ns],J=()=>["auto",so,Le],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",Le],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[so,Le];return{cacheSize:500,separator:":",theme:{colors:[jl],spacing:[ci,ns],blur:["none","",rs,Le],brightness:_(),borderColor:[e],borderRadius:["none","","full",rs,Le],borderSpacing:R(),borderWidth:ee(),contrast:_(),grayscale:G(),hueRotate:_(),invert:G(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[T$,ns],inset:L(),margin:L(),opacity:_(),padding:R(),saturate:_(),scale:_(),sepia:G(),skew:_(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",Le]}],container:["container"],columns:[{columns:[rs]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"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"],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:[...ne(),Le]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[S]}],"inset-x":[{"inset-x":[S]}],"inset-y":[{"inset-y":[S]}],start:[{start:[S]}],end:[{end:[S]}],top:[{top:[S]}],right:[{right:[S]}],bottom:[{bottom:[S]}],left:[{left:[S]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",wl,Le]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Le]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",wl,Le]}],"grid-cols":[{"grid-cols":[jl]}],"col-start-end":[{col:["auto",{span:["full",wl,Le]},Le]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[jl]}],"row-start-end":[{row:["auto",{span:[wl,Le]},Le]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Le]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Le]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[M]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[M]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Le,t]}],"min-w":[{"min-w":[Le,t,"min","max","fit"]}],"max-w":[{"max-w":[Le,t,"none","full","min","max","fit","prose",{screen:[rs]},rs]}],h:[{h:[Le,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Le,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Le,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Le,t,"auto","min","max","fit"]}],"font-size":[{text:["base",rs,ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Am]}],"font-family":[{font:[jl]}],"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:["tighter","tight","normal","wide","wider","widest",Le]}],"line-clamp":[{"line-clamp":["none",so,Am]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ci,Le]}],"list-image":[{"list-image":["none",Le]}],"list-style-type":[{list:["none","disc","decimal",Le]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ci,ns]}],"underline-offset":[{"underline-offset":["auto",ci,Le]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ne(),I$]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_$]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},R$]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:re()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[ci,Le]}],"outline-w":[{outline:[ci,ns]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ci,ns]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",rs,L$]}],"shadow-color":[{shadow:[jl]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",rs,Le]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[E]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Le]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",Le]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",Le]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[wl,Le]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Le]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Le]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Le]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ci,ns,Am]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},V$=S$(B$);function nt(...e){return V$(rt(e))}const lS={epic:{color:"indigo",icon:"🏛️",label:"Epic"},story:{color:"blue",icon:"📖",label:"Story"},task:{color:"emerald",icon:"⚙️",label:"Task"},subtask:{color:"gray",icon:"📝",label:"Subtask"}};function U$({workItem:e,onClick:t}){var a;const n=po(e.status),r=lS[e.type]||lS.task,i=e.status==="blocked";return l.jsxs(Hr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.2,ease:"easeOut"},whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},onClick:t,className:nt("group cursor-pointer bg-white rounded-lg border shadow-sm","hover:shadow-lg transition-all duration-200",i?"border-red-300":"border-slate-200"),children:[l.jsx("div",{className:"p-3 pb-2 border-b border-slate-100",children:l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:nt("px-2 py-1 rounded-full text-xs font-medium",(n==null?void 0:n.color)==="gray"&&"bg-gray-100 text-gray-700",(n==null?void 0:n.color)==="slate"&&"bg-slate-100 text-slate-700",(n==null?void 0:n.color)==="blue"&&"bg-blue-100 text-blue-700",(n==null?void 0:n.color)==="yellow"&&"bg-yellow-100 text-yellow-700",(n==null?void 0:n.color)==="amber"&&"bg-amber-100 text-amber-700",(n==null?void 0:n.color)==="purple"&&"bg-purple-100 text-purple-700",(n==null?void 0:n.color)==="violet"&&"bg-violet-100 text-violet-700",(n==null?void 0:n.color)==="green"&&"bg-green-100 text-green-700",(n==null?void 0:n.color)==="red"&&"bg-red-100 text-red-700"),children:[n==null?void 0:n.icon," ",n==null?void 0:n.label]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[((a=e.metadata)==null?void 0:a.codingPhase)&&l.jsxs("div",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold bg-amber-100 text-amber-800 border border-amber-300",title:`Implementation Phase ${e.metadata.codingPhase}`,children:["P",e.metadata.codingPhase]}),l.jsx("div",{className:nt("px-2 py-1 rounded border text-xs font-medium",r.color==="indigo"&&"border-indigo-300 bg-indigo-50 text-indigo-700",r.color==="blue"&&"border-blue-300 bg-blue-50 text-blue-700",r.color==="emerald"&&"border-emerald-300 bg-emerald-50 text-emerald-700",r.color==="gray"&&"border-gray-300 bg-gray-50 text-gray-700"),children:r.label})]})]})}),l.jsxs("div",{className:"p-3 pb-2",children:[i&&l.jsxs("div",{className:"flex items-center gap-2 mb-2 text-red-600 text-sm",children:[l.jsx(m3,{className:"w-4 h-4"}),l.jsx("span",{className:"font-medium",children:"Blocked"})]}),l.jsx("h4",{className:"font-semibold text-base text-slate-900 mb-2 line-clamp-2 group-hover:text-blue-600 transition-colors",children:e.name}),l.jsxs("div",{className:"space-y-1 text-sm text-slate-600",children:[e.epicName&&e.type!=="epic"&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Cd,{className:"w-4 h-4 flex-shrink-0"}),l.jsxs("span",{className:"truncate",children:["Epic: ",e.epicName]})]}),e.children&&e.children.length>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(O3,{className:"w-4 h-4 flex-shrink-0"}),l.jsxs("span",{children:[e.children.length," ",e.children.length===1?"child":"children"," •"," ",e.children.filter(c=>c.status==="completed").length," ","completed"]})]}),e.dependencies&&e.dependencies.length>0&&l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(wC,{className:"w-4 h-4 flex-shrink-0"}),l.jsxs("span",{children:[e.dependencies.length," ",e.dependencies.length===1?"dependency":"dependencies"]})]})]})]}),l.jsx("div",{className:"px-3 py-2 border-t border-slate-100",children:l.jsx("span",{className:"text-xs text-slate-400",children:e.id})})]})}function fA({columnName:e,statuses:t,workItems:n,onCardClick:r}){const i=u$(e),a=t.reduce((u,d)=>(u[d]=n.filter(p=>p.status===d).length,u),{}),c=n.length;return l.jsxs("div",{className:nt("flex flex-col rounded-lg p-4 min-w-[320px] max-w-[380px]",(i==null?void 0:i.bgColor)||"bg-slate-100"),children:[l.jsxs("div",{className:"flex items-center justify-between mb-3",children:[l.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:e}),l.jsxs("span",{className:nt("text-sm px-3 py-1 rounded-full font-medium",(i==null?void 0:i.color)==="slate"&&"bg-slate-200 text-slate-700",(i==null?void 0:i.color)==="blue"&&"bg-blue-200 text-blue-700",(i==null?void 0:i.color)==="yellow"&&"bg-yellow-200 text-yellow-700",(i==null?void 0:i.color)==="purple"&&"bg-purple-200 text-purple-700",(i==null?void 0:i.color)==="green"&&"bg-green-200 text-green-700"),children:[c," ",c===1?"item":"items"]})]}),t.length>1&&c>0&&l.jsx("div",{className:"text-xs text-slate-600 mb-3 flex flex-wrap gap-2",children:t.map(u=>{const d=a[u],p=po(u);return d===0?null:l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx("span",{children:p==null?void 0:p.icon}),l.jsxs("span",{children:[p==null?void 0:p.label,": ",d]})]},u)})}),l.jsx("div",{className:"flex flex-col gap-3 overflow-y-auto flex-1 min-h-0",children:n.length===0?l.jsx(Hr.div,{initial:{opacity:0},animate:{opacity:1},className:"flex items-center justify-center py-8 text-slate-400 text-sm",children:"No items"}):n.map((u,d)=>l.jsx(Hr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.2,delay:d*.05},children:l.jsx(U$,{workItem:u,onClick:()=>r==null?void 0:r(u)})},u.id))})]})}function W$({group:e,columnVisibility:t,onCardClick:n}){const[r,i]=b.useState(!0),{name:a,epic:c,items:u,columns:d}=e,p=e.type==="ungrouped",h=u.length,m=u.filter(S=>S.status==="completed").length,g=h>0?m/h*100:0,v=c==null?void 0:c.status,w=v?po(v):null;return l.jsxs("div",{className:"mb-8",children:[l.jsx("div",{className:nt("mb-4 pb-4 border-b-2",p?"border-slate-300":"border-indigo-300"),children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[l.jsx("button",{onClick:()=>i(!r),className:"text-slate-600 hover:text-slate-900 transition-colors mt-3 flex-shrink-0",children:r?l.jsx(ds,{className:"w-5 h-5"}):l.jsx(ar,{className:"w-5 h-5"})}),c&&!p?l.jsx("button",{onClick:()=>n==null?void 0:n(c),className:"flex-1 min-w-0 text-left p-3 border border-indigo-200 rounded-lg hover:border-indigo-400 hover:bg-indigo-50 transition-colors",title:"View epic details",children:l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[l.jsxs("span",{className:"text-lg font-bold text-indigo-900",children:["🏛️ ",a]}),w&&l.jsxs("span",{className:nt("px-2 py-0.5 rounded-full text-xs font-medium",w.color==="green"&&"bg-green-100 text-green-700",w.color==="blue"&&"bg-blue-100 text-blue-700",w.color==="yellow"&&"bg-yellow-100 text-yellow-700"),children:[w.icon," ",w.label]})]}),(c==null?void 0:c.description)&&l.jsx("p",{className:"text-sm text-slate-500 line-clamp-2",children:c.description})]}),l.jsx(ar,{className:"w-4 h-4 text-indigo-400 mt-1 flex-shrink-0"})]})}):l.jsx("div",{className:"flex-1 py-2",children:l.jsxs("h2",{className:nt("text-xl font-bold",p?"text-slate-600":"text-indigo-900"),children:[p?"📂":"🏛️"," ",a]})})]}),l.jsxs("div",{className:"text-right flex-shrink-0",children:[l.jsxs("div",{className:"text-sm text-slate-600 mb-1",children:[m," / ",h," completed"]}),l.jsx("div",{className:"w-48 h-2 bg-slate-200 rounded-full overflow-hidden",children:l.jsx(Hr.div,{initial:{width:0},animate:{width:`${g}%`},transition:{duration:.5,ease:"easeOut"},className:nt("h-full",p?"bg-slate-500":"bg-indigo-600")})})]})]})}),r&&l.jsx(Hr.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"flex gap-4 overflow-x-auto pb-4",children:Rd.filter(S=>t[S]).map(S=>{const j=bv[S],k=d[S]||[];return l.jsx(fA,{columnName:S,statuses:j,workItems:k,onCardClick:n},`${e.id}-${S}`)})})]})}function q$(e,t){return b.useMemo(()=>{switch(t){case"status":return cS(e);case"epic":return K$(e);case"type":return H$(e);case"phase":return G$(e);default:return cS(e)}},[e,t])}function cS(e){const t=ho(e);return{mode:"columns",groups:Rd.map(n=>({id:n,name:n,items:t[n]||[],type:"column"}))}}function K$(e){const n=e.filter(i=>i.type==="epic").map(i=>{const a=e.filter(u=>u.epicId===i.id),c=ho(a);return{id:i.id,name:i.name,epic:i,items:a,columns:c,type:"epic"}}),r=e.filter(i=>!i.epicId&&i.type!=="epic");if(r.length>0){const i=ho(r);n.push({id:"ungrouped",name:"No Epic",items:r,columns:i,type:"ungrouped"})}return{mode:"sections",groups:n}}function H$(e){return{mode:"sections",groups:[{id:"epic",name:"Epics"},{id:"story",name:"Stories"},{id:"task",name:"Tasks"},{id:"subtask",name:"Subtasks"}].map(r=>{const i=e.filter(c=>c.type===r.id),a=ho(i);return{id:r.id,name:r.name,items:i,columns:a,type:"type"}}).filter(r=>r.items.length>0)}}function G$(e){var a;const t=new Map,n=[];for(const c of e){const u=(a=c.metadata)==null?void 0:a.codingPhase;u!=null?(t.has(u)||t.set(u,[]),t.get(u).push(c)):n.push(c)}const i=[...t.entries()].sort((c,u)=>c[0]-u[0]).map(([c,u])=>{u.sort((m,g)=>{var v,w;return(((v=m.metadata)==null?void 0:v.codingOrder)??0)-(((w=g.metadata)==null?void 0:w.codingOrder)??0)});const d=ho(u),p=[...new Set(u.filter(m=>m.type==="epic").map(m=>m.name))],h=p.length>0?`Phase ${c}: ${p.join(", ")}`:`Phase ${c}`;return{id:`phase-${c}`,name:h,items:u,columns:d,type:"phase"}});return n.length>0&&i.push({id:"unphased",name:"No Phase",items:n,columns:ho(n),type:"ungrouped"}),{mode:"sections",groups:i}}function Y$({onCardClick:e,onStartProject:t,projectFilesReady:n,onEditProjectDoc:r,onStartSprintPlanning:i,onOpenSprintPlanningSelection:a,sponsorCallRunning:c}){const[u,d]=b.useState(null),{workItems:p,loading:h}=Mf(),{typeFilters:m,columnVisibility:g,searchQuery:v,groupBy:w}=_f(),S=b.useMemo(()=>{let C=p.filter(E=>m[E.type]);if(v.trim()){const E=v.toLowerCase();C=C.filter(A=>A.name.toLowerCase().includes(E)||A.id.toLowerCase().includes(E)||A.description&&A.description.toLowerCase().includes(E)||A.epicName&&A.epicName.toLowerCase().includes(E))}return C},[p,m,v]),j=q$(S,w),k=C=>{d(C),e==null||e(C)};return h&&p.length===0?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),l.jsx("p",{className:"text-slate-600",children:"Loading work items..."})]})}):S.length===0&&p.length>0?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-6xl mb-4",children:"🔍"}),l.jsx("h3",{className:"text-xl font-semibold text-slate-900 mb-2",children:"No items match your filters"}),l.jsx("p",{className:"text-slate-600",children:"Try adjusting your filters or search query"})]})}):p.length===0?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx("div",{className:"text-center",children:t?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-6xl mb-4",children:"📋"}),l.jsx("h3",{className:"text-xl font-semibold text-slate-900 mb-2",children:"No Work Items"}),l.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"Run the Sponsor Call ceremony to set up your project."}),l.jsx("button",{onClick:t,className:"px-5 py-2.5 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors",children:"🚀 Start Project"})]}):n?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-5xl mb-4",children:"🏃"}),l.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-3",children:"Ready for Sprint Planning"}),l.jsx("p",{className:"text-sm text-slate-500 mb-2 max-w-sm",children:"Your project is set up and ready for sprint planning."}),l.jsxs("p",{className:"text-sm text-slate-700 font-medium mb-5 max-w-sm",children:["Review ",l.jsx("code",{className:"bg-slate-100 px-1 rounded text-xs",children:"doc.md"})," before starting — this file is the foundation of every Epic and Story that will be planned."]}),l.jsx("div",{className:"flex items-center justify-center gap-3 mb-6",children:l.jsx("button",{onClick:r,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium border border-slate-200 rounded-lg hover:bg-slate-50 transition-colors text-slate-700",children:"📄 Documentation"})}),i?l.jsx("button",{onClick:i,className:"px-5 py-2.5 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors",children:"🚀 Start Sprint Planning"}):a?l.jsxs("button",{onClick:a,className:"flex items-center gap-2 px-5 py-2.5 text-sm font-medium bg-amber-500 text-white rounded-lg hover:bg-amber-600 transition-colors animate-pulse",children:[l.jsx("span",{children:"⚠"}),"Sprint planning needs your input"]}):l.jsx("p",{className:"text-xs text-slate-400",children:"Sprint planning is running…"})]}):c?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-5xl mb-4",children:"📋"}),l.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-3",children:"Sponsor Call is running…"}),l.jsx("p",{className:"text-sm text-slate-500 max-w-sm",children:"The Sponsor Call ceremony is generating your project definition. Work items will appear here once it completes."})]}):null})}):j.mode==="sections"?l.jsx(Hr.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.3},children:j.groups.length===0?l.jsx("div",{className:"text-center py-12",children:l.jsx("p",{className:"text-slate-600",children:"No groups to display"})}):j.groups.map((C,E)=>l.jsx(Hr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:E*.1},children:l.jsx(W$,{group:C,columnVisibility:g,onCardClick:k})},C.id))},w):l.jsx(Hr.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.3},className:"flex gap-4 overflow-x-auto pb-4",children:l.jsx(MC,{mode:"sync",children:j.groups.filter(C=>g[C.name]).map(C=>l.jsx(fA,{columnName:C.name,statuses:bv[C.name],workItems:C.items,onCardClick:k},C.id))})},w)}const X$={doc:{title:"Project Documentation",filename:"doc.md",load:B3,save:V3}};function Q$({fileType:e,onClose:t}){const n=X$[e],[r,i]=b.useState(""),[a,c]=b.useState(""),[u,d]=b.useState(!0),[p,h]=b.useState(!1),[m,g]=b.useState(!1),v=r!==a;b.useEffect(()=>{n.load().then(j=>{i(j??""),c(j??""),d(!1)})},[e]);const w=async()=>{if(!(!v||p)){h(!0);try{await n.save(r),c(r),g(!0),setTimeout(()=>g(!1),2e3)}finally{h(!1)}}},S=()=>{v?i(a):t()};return l.jsxs("div",{className:"fixed inset-0 z-[80] flex items-center justify-center",onClick:j=>{j.target===j.currentTarget&&t()},children:[l.jsx("div",{className:"absolute inset-0 bg-black/40"}),l.jsxs("div",{className:"relative z-10 w-full max-w-3xl h-[80vh] mx-4 bg-white rounded-xl shadow-2xl flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-slate-200 flex-shrink-0",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-base font-semibold text-slate-900",children:n.title}),l.jsx("p",{className:"text-xs text-slate-500 mt-0.5 font-mono",children:n.filename})]}),l.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors",title:"Close",children:l.jsx(cn,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex-1 overflow-hidden p-4",children:u?l.jsx("div",{className:"flex items-center justify-center h-full",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-slate-400"})}):l.jsx("textarea",{className:"w-full h-full resize-none font-mono text-sm text-slate-800 border border-slate-200 rounded-lg p-3 focus:outline-none focus:ring-2 focus:ring-slate-300",value:r,onChange:j=>i(j.target.value),spellCheck:!1})}),l.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-3 border-t border-slate-200 flex-shrink-0",children:[m&&l.jsx("span",{className:"text-sm text-green-600 font-medium mr-auto",children:"Saved ✓"}),l.jsx("button",{onClick:S,disabled:!v,className:"px-4 py-2 text-sm font-medium text-slate-700 border border-slate-200 rounded-lg hover:bg-slate-50 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:"Cancel"}),l.jsx("button",{onClick:w,disabled:!v||p,className:"px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:p?"Saving…":"Save"})]})]})]})}function J$(){const{groupBy:e,setGroupBy:t}=_f(),n=[{value:"status",label:"Status",icon:w3,description:"Traditional kanban columns"},{value:"epic",label:"Epic",icon:Cd,description:"Hierarchical epic sections"},{value:"type",label:"Type",icon:d3,description:"Separate boards by type"},{value:"phase",label:"Phase",icon:j3,description:"Implementation order by dependencies"}];return l.jsx("div",{className:"flex items-center gap-0.5 bg-slate-100 rounded-md p-0.5",children:n.map(({value:r,label:i,icon:a,description:c})=>{const u=e===r;return l.jsxs("button",{onClick:()=>t(r),title:c,className:nt("flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium transition-all",u?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:bg-slate-200"),children:[l.jsx(a,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:i})]},r)})})}function Z$(){const[e,t]=b.useState(""),{typeFilters:n,columnVisibility:r,searchQuery:i,toggleTypeFilter:a,setAllTypeFilters:c,toggleColumnVisibility:u,applyPreset:d,setSearchQuery:p,clearSearch:h,resetFilters:m}=_f(),{refresh:g,loading:v}=Mf(),w=[{key:"epic",label:"Epics",icon:"🏛️"},{key:"story",label:"Stories",icon:"📖"},{key:"task",label:"Tasks",icon:"⚙️"},{key:"subtask",label:"Subtasks",icon:"📝"}],S=[{key:"Backlog",label:"Backlog"},{key:"Ready",label:"Ready"},{key:"In Progress",label:"In Progress"},{key:"Review",label:"Review"},{key:"Done",label:"Done"}],j=A=>{const P=A.target.value;t(P),clearTimeout(window.searchDebounce),window.searchDebounce=setTimeout(()=>{p(P)},300)},k=()=>{t(""),h()},C=Object.values(n).every(A=>A),E=Object.values(n).some(A=>A);return l.jsx("div",{className:"bg-white border-b border-slate-200 shadow-sm",children:l.jsx("div",{className:"max-w-full px-4 py-2",children:l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("button",{onClick:()=>c(!C),className:nt("-ml-1.5 p-1.5 rounded-md transition-colors flex-shrink-0",C?"text-blue-600 hover:bg-blue-50":E?"text-slate-500 hover:bg-slate-100":"text-slate-400 hover:bg-slate-100"),title:C?"Deselect all types":"Select all types",children:l.jsx(v3,{className:"w-4 h-4"})}),l.jsx("div",{className:"flex items-center gap-1",children:w.map(({key:A,label:P,icon:O})=>l.jsxs("button",{onClick:()=>a(A),className:nt("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","flex items-center gap-1",n[A]?"bg-blue-100 text-blue-700 hover:bg-blue-200":"bg-slate-100 text-slate-400 hover:bg-slate-200"),children:[l.jsx("span",{className:"text-sm leading-none",children:O}),l.jsx("span",{children:P})]},A))}),l.jsx("div",{className:"w-px h-5 bg-slate-200 flex-shrink-0"}),l.jsx(J$,{})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[l.jsxs("div",{className:"relative group",children:[l.jsxs("button",{className:"px-2.5 py-1 rounded-md text-xs font-medium bg-slate-100 text-slate-700 hover:bg-slate-200 transition-colors flex items-center gap-1.5",children:[l.jsx(Pd,{className:"w-3.5 h-3.5"}),"Columns"]}),l.jsxs("div",{className:"absolute right-0 top-full mt-2 bg-white border border-slate-200 rounded-lg shadow-lg py-2 min-w-[180px] opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all z-10",children:[l.jsx("div",{className:"px-3 py-2 text-xs font-semibold text-slate-500 border-b border-slate-100",children:"COLUMN VISIBILITY"}),S.map(({key:A,label:P})=>l.jsxs("button",{onClick:()=>u(A),className:"w-full px-3 py-2 text-sm text-left hover:bg-slate-50 flex items-center justify-between",children:[l.jsx("span",{children:P}),r[A]?l.jsx(Pd,{className:"w-4 h-4 text-blue-600"}):l.jsx($x,{className:"w-4 h-4 text-slate-400"})]},A)),l.jsxs("div",{className:"border-t border-slate-100 mt-2 pt-2 px-3",children:[l.jsx("button",{onClick:()=>d("all"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Show All"}),l.jsx("span",{className:"text-slate-300 mx-2",children:"•"}),l.jsx("button",{onClick:()=>d("active"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Active Work"}),l.jsx("span",{className:"text-slate-300 mx-2",children:"•"}),l.jsx("button",{onClick:()=>d("hide-completed"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Hide Done"})]})]})]}),l.jsxs("div",{className:"relative",children:[l.jsx(P3,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400"}),l.jsx("input",{type:"text",placeholder:"Search...",value:e,onChange:j,className:"pl-8 pr-7 py-1 w-44 border border-slate-200 rounded-md text-xs focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"}),e&&l.jsx("button",{onClick:k,className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:l.jsx(cn,{className:"w-3.5 h-3.5"})})]}),l.jsx("button",{onClick:g,disabled:v,className:nt("p-1.5 rounded-md transition-colors",v?"bg-slate-100 text-slate-400 cursor-not-allowed":"bg-slate-100 text-slate-700 hover:bg-slate-200"),title:"Refresh",children:l.jsx(N3,{className:nt("w-3.5 h-3.5",v&&"animate-spin")})}),l.jsx("button",{onClick:m,className:"px-2.5 py-1 rounded-md text-xs font-medium bg-slate-100 text-slate-700 hover:bg-slate-200 transition-colors",children:"Reset"})]})]})})})}const uS={running:"bg-blue-50 text-blue-700 border-blue-200 hover:bg-blue-100",paused:"bg-amber-50 text-amber-700 border-amber-200 hover:bg-amber-100",complete:"bg-green-50 text-green-700 border-green-200 hover:bg-green-100",error:"bg-red-50 text-red-700 border-red-200 hover:bg-red-100",cancelled:"bg-slate-50 text-slate-500 border-slate-200 hover:bg-slate-100"},dS={running:l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-500 animate-pulse flex-shrink-0"}),paused:l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 flex-shrink-0"}),complete:l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 flex-shrink-0"}),error:l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 flex-shrink-0"}),cancelled:l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-400 flex-shrink-0"})};function ez(e,t){const n=(t??Date.now())-e,r=Math.floor(n/1e3);return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}function tz(){const{processes:e,clearCompleted:t}=AC(),n=e.filter(a=>!(a.type==="sponsor-call"&&a.status!=="running")&&!(a.type==="sprint-planning"&&a.status==="cancelled"));if(n.length===0)return null;const r=n.some(a=>["complete","error","cancelled"].includes(a.status)),i=a=>{if(a.type==="sprint-planning")ko.getState().reopenModal();else if(a.type==="sponsor-call")or.getState().reopenWizard();else if(a.type==="seed"){const c=Hl.getState().getStoryIdByProcessId(a.id);c&&Hl.getState().reopenModal(c)}else if(a.type==="run-task"){const c=Gl.getState().getTaskIdByProcessId(a.id);c&&Gl.getState().reopenModal(c)}};return l.jsxs("div",{className:"flex items-center gap-2 px-4 py-1.5 bg-white border-b border-slate-200 flex-shrink-0 flex-wrap",children:[l.jsx(u3,{className:"w-4 h-4 text-slate-400 flex-shrink-0"}),n.map(a=>l.jsxs("button",{onClick:()=>i(a),title:"Click to view",className:`flex items-center gap-1.5 text-xs px-2.5 py-1 rounded-full border transition-colors cursor-pointer ${uS[a.status]??uS.cancelled}`,children:[dS[a.status]??dS.cancelled,l.jsx("span",{className:"font-medium",children:a.label}),l.jsx("span",{className:"opacity-60",children:ez(a.startedAt,a.endedAt)})]},a.id)),r&&l.jsx("button",{onClick:t,className:"ml-auto text-xs text-slate-400 hover:text-slate-600 px-2 py-0.5 transition-colors",children:"Clear done"})]})}function nz({open:e,onOpenChange:t,children:n}){return b.useEffect(()=>{const r=i=>{i.key==="Escape"&&e&&t(!1)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),b.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[e]),l.jsx(MC,{children:e&&l.jsxs(l.Fragment,{children:[l.jsx(Hr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>t(!1),className:"fixed inset-0 bg-black/50 z-50"}),l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:n})]})})}function rz({className:e,children:t,onClose:n}){return l.jsxs(Hr.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},onClick:r=>r.stopPropagation(),className:nt("relative bg-white rounded-lg shadow-xl max-w-4xl w-full h-[90vh] overflow-hidden","flex flex-col",e),children:[l.jsxs("button",{onClick:n,className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 transition-opacity z-10",children:[l.jsx(cn,{className:"h-5 w-5"}),l.jsx("span",{className:"sr-only",children:"Close"})]}),t]})}function iz({className:e,children:t}){return l.jsx("div",{className:nt("flex flex-col space-y-1.5 px-6 pt-6 pb-4",e),children:t})}function sz({className:e,children:t}){return l.jsx("h2",{className:nt("text-2xl font-semibold leading-none tracking-tight",e),children:t})}function az({className:e,children:t}){return l.jsx("p",{className:nt("text-sm text-slate-600",e),children:t})}const jv=b.createContext();function fS({defaultValue:e,value:t,onValueChange:n,children:r,className:i}){const[a,c]=b.useState(t||e);b.useEffect(()=>{t!==void 0&&c(t)},[t]);const u=d=>{c(d),n==null||n(d)};return l.jsx(jv.Provider,{value:{selectedTab:a,setSelectedTab:u},children:l.jsx("div",{className:nt("w-full",i),children:r})})}function oz({className:e,children:t}){return l.jsx("div",{className:nt("inline-flex h-10 items-center justify-start rounded-md bg-slate-100 p-1 text-slate-600",e),children:t})}function Yu({value:e,children:t,className:n}){const{selectedTab:r,setSelectedTab:i}=b.useContext(jv),a=r===e;return l.jsx("button",{onClick:()=>i(e),className:nt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5","text-sm font-medium ring-offset-white transition-all","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50",a?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:bg-slate-200",n),children:t})}function Xu({value:e,children:t,className:n}){const{selectedTab:r}=b.useContext(jv);return r!==e?null:l.jsx("div",{className:nt("mt-2 ring-offset-white focus-visible:outline-none focus-visible:ring-2","focus-visible:ring-slate-950 focus-visible:ring-offset-2",n),children:t})}function to({variant:e="default",className:t,children:n}){return l.jsx("div",{className:nt("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold","transition-colors focus:outline-none focus:ring-2 focus:ring-slate-950 focus:ring-offset-2",{"border-transparent bg-slate-900 text-slate-50 hover:bg-slate-900/80":e==="default","border-transparent bg-slate-100 text-slate-900 hover:bg-slate-100/80":e==="secondary","border-transparent bg-red-100 text-red-900 hover:bg-red-100/80":e==="destructive","border-slate-200 text-slate-900":e==="outline"},t),children:n})}function lz({storyId:e,storyName:t}){const{sessions:n,openModal:r,reopenModal:i}=Hl(),a=n[e],c=a&&(a.status==="seeding"||a.status==="checking"),u=()=>{c?i(e):r(e,t||e)};return l.jsx("button",{onClick:u,className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${c?"bg-green-100 text-green-700 hover:bg-green-200":"bg-green-600 text-white hover:bg-green-700"}`,children:c?l.jsxs(l.Fragment,{children:[l.jsx(Tf,{className:"w-4 h-4 animate-spin"}),"View Seed"]}):l.jsxs(l.Fragment,{children:[l.jsx(SC,{className:"w-4 h-4"}),"Seed"]})})}function cz({taskId:e,taskName:t}){const{sessions:n,openModal:r,reopenModal:i}=Gl(),a=n[e],c=a&&(a.status==="running"||a.status==="checking"),u=()=>{c?i(e):r(e,t||e)};return l.jsx("button",{onClick:u,className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${c?"bg-blue-100 text-blue-700 hover:bg-blue-200":"bg-blue-600 text-white hover:bg-blue-700"}`,children:c?l.jsxs(l.Fragment,{children:[l.jsx(Tf,{className:"w-4 h-4 animate-spin"}),"View Run"]}):l.jsxs(l.Fragment,{children:[l.jsx(xg,{className:"w-4 h-4"}),"Run"]})})}function uz(e=""){return e==="claude"?"anthropic":e}function pS({label:e,value:t,onChange:n,models:r,disabled:i}){const a=[...new Set(r.map(u=>u.provider))],c=r.find(u=>u.modelId===t);return l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:e}),l.jsxs("select",{value:t,onChange:u=>n(u.target.value),disabled:i||r.length===0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 focus:outline-none focus:ring-2 focus:ring-violet-500 disabled:opacity-60 bg-white",children:[r.length===0&&l.jsx("option",{value:"",children:"Loading…"}),a.map(u=>l.jsx("optgroup",{label:u.charAt(0).toUpperCase()+u.slice(1),children:r.filter(d=>d.provider===u).map(d=>l.jsxs("option",{value:d.modelId,children:[d.displayName,d.hasApiKey?"":" (no key)"]},d.modelId))},u))]}),c&&!c.hasApiKey&&l.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",l.jsx("code",{children:".env"})]})]})}function Em({label:e,before:t,after:n}){const r=Array.isArray(t)?t.join(`
|
|
309
|
+
`):t??"",i=Array.isArray(n)?n.join(`
|
|
310
|
+
`):n??"";return!r&&!i||r===i?null:l.jsxs("div",{className:"mb-3",children:[l.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-1",children:e}),r&&l.jsx("div",{className:"mb-1 px-2.5 py-2 bg-red-50 border border-red-100 rounded text-xs text-red-700 leading-relaxed line-through",children:r}),i&&l.jsx("div",{className:"px-2.5 py-2 bg-green-50 border border-green-100 rounded text-xs text-green-700 leading-relaxed",children:i})]})}function dz({impact:e,checked:t,onToggle:n}){var a;const[r,i]=b.useState(!1);return l.jsxs("div",{className:`border rounded-lg overflow-hidden transition-colors ${t?"border-violet-300 bg-violet-50":"border-slate-200 bg-white"}`,children:[l.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[l.jsx("input",{type:"checkbox",checked:t,onChange:n,className:"flex-shrink-0 accent-violet-600"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-xs font-medium text-slate-800 truncate",children:((a=e.proposedStory)==null?void 0:a.name)??e.storyId}),l.jsx("p",{className:"text-xs text-slate-400 truncate",children:e.storyId})]}),e.changesNeeded&&l.jsx("button",{type:"button",onClick:()=>i(c=>!c),className:"flex-shrink-0 text-slate-400 hover:text-slate-600",children:r?l.jsx(ds,{className:"w-3.5 h-3.5"}):l.jsx(ar,{className:"w-3.5 h-3.5"})})]}),r&&e.changesNeeded&&l.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-slate-100",children:l.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:e.changesNeeded})})]})}function fz({story:e,checked:t,onToggle:n}){const[r,i]=b.useState(!1),a=(e==null?void 0:e.acceptance)??(e==null?void 0:e.acceptanceCriteria)??[];return l.jsxs("div",{className:`border rounded-lg overflow-hidden transition-colors ${t?"border-emerald-300 bg-emerald-50":"border-slate-200 bg-white"}`,children:[l.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[l.jsx("input",{type:"checkbox",checked:t,onChange:n,className:"flex-shrink-0 accent-emerald-600"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[l.jsx("span",{className:"flex-shrink-0 text-xs font-bold px-1.5 py-0.5 rounded bg-emerald-100 text-emerald-700",children:"NEW"}),l.jsx("p",{className:"text-xs font-medium text-slate-800 truncate",children:e==null?void 0:e.name})]}),(e==null?void 0:e.description)&&l.jsx("p",{className:"text-xs text-slate-500 truncate",children:e.description})]}),l.jsx("button",{type:"button",onClick:()=>i(c=>!c),className:"flex-shrink-0 text-slate-400 hover:text-slate-600",children:r?l.jsx(ds,{className:"w-3.5 h-3.5"}):l.jsx(ar,{className:"w-3.5 h-3.5"})})]}),r&&l.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-slate-100 space-y-2",children:[(e==null?void 0:e.description)&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-medium text-slate-500 mb-0.5",children:"Description"}),l.jsx("p",{className:"text-xs text-slate-700 leading-relaxed",children:e.description})]}),a.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-medium text-slate-500 mb-0.5",children:"Acceptance Criteria"}),l.jsx("ul",{className:"space-y-0.5",children:a.map((c,u)=>l.jsxs("li",{className:"flex items-start gap-1 text-xs text-slate-700",children:[l.jsx("span",{className:"text-slate-400 mt-0.5 flex-shrink-0",children:"•"}),l.jsx("span",{children:c})]},u))})]})]})]})}const pz={critical:"text-red-600",major:"text-orange-600",minor:"text-amber-600"},hz={critical:"bg-red-50 border-red-100",major:"bg-orange-50 border-orange-100",minor:"bg-amber-50 border-amber-100"};function hS(e){return e>=95?"bg-green-100 text-green-700":e>=80?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700"}function mz({item:e,refineProgress:t,refineResult:n,refineError:r,onClose:i,onAccepted:a}){var Y,me,Ae,ae,$e,Re,Ye,Qe,Mt,En,xn,vn,yn;const c=(Y=e==null?void 0:e.metadata)==null?void 0:Y.validationResult,u=[...((c==null?void 0:c.criticalIssues)||[]).map(he=>({...he,severity:"critical"})),...((c==null?void 0:c.majorIssues)||[]).map(he=>({...he,severity:"major"})),...((c==null?void 0:c.minorIssues)||[]).map(he=>({...he,severity:"minor"}))],[d,p]=b.useState(()=>new Set(u.map((he,Pe)=>he.severity==="critical"?Pe:null).filter(he=>he!==null))),[h,m]=b.useState(""),[g,v]=b.useState([]),[w,S]=b.useState(""),[j,k]=b.useState(""),[C,E]=b.useState(""),[A,P]=b.useState(!1),[O,M]=b.useState([]),I=b.useRef(null),[z,K]=b.useState(null),[L,R]=b.useState(!1),[ee,J]=b.useState(""),ne=n?"results":A||t?"running":"configure";b.useEffect(()=>{Promise.all([fs(),On()]).then(([he,Pe])=>{v(he);const De=he.filter(Ke=>{var Dt,Tn;return(Tn=(Dt=Pe.apiKeys)==null?void 0:Dt[uz(Ke.provider)])==null?void 0:Tn.isSet}),Xe=Ke=>/pro|opus|sonnet/i.test(Ke),Pt=Ke=>/flash|lite|haiku|mini/i.test(Ke),_t=De.find(Ke=>Xe(Ke.modelId))||De[0],It=_t?_t.modelId:he.length>0?he[0].modelId:"";S(It);const un=De.find(Ke=>Pt(Ke.modelId)&&Ke.modelId!==It)||De.find(Ke=>Ke.modelId!==It)||_t;k(un?un.modelId:It)}).catch(()=>E("Failed to load models."))},[]),b.useEffect(()=>{t!=null&&t.message&&M(he=>[...he,t.message])},[t]),b.useEffect(()=>{var he;(he=I.current)==null||he.scrollIntoView({behavior:"smooth"})},[O]),b.useEffect(()=>{var De;if(!n)return;P(!1);const he=((De=n.result)==null?void 0:De.storyImpacts)||[],Pe={};he.forEach((Xe,Pt)=>{Pe[Pt]=Xe.type==="new"||Xe.impacted===!0}),K(Pe)},[n]),b.useEffect(()=>{r&&(P(!1),E(typeof r.error=="string"?r.error:"Refinement failed — please try again."))},[r]);function re(he){p(Pe=>{const De=new Set(Pe);return De.has(he)?De.delete(he):De.add(he),De})}async function U(){const he=g.find(Xe=>Xe.modelId===w),Pe=g.find(Xe=>Xe.modelId===j);if(!he||!Pe)return;const De=u.filter((Xe,Pt)=>d.has(Pt));P(!0),E(""),M([]);try{await mD(e.id,{refinementRequest:h,selectedIssues:De,modelId:w,provider:he.provider,validatorModelId:j,validatorProvider:Pe.provider})}catch(Xe){P(!1),E(Xe.message||"Failed to start refinement.")}}async function B(){if(!n)return;const{proposedItem:he,storyImpacts:Pe=[]}=n.result,De=Pe.filter((Xe,Pt)=>z==null?void 0:z[Pt]).map(Xe=>({type:Xe.type,storyId:Xe.storyId??null,proposedStory:Xe.proposedStory}));R(!0),J("");try{await gD(e.id,he,De),a==null||a()}catch(Xe){J(Xe.message||"Failed to apply changes."),R(!1)}}const G=g.find(he=>he.modelId===w),q=g.find(he=>he.modelId===j),_=!A&&!!w&&!!j&&!!G&&!!q,V=d.size,ie=n==null?void 0:n.result,ue=(ie==null?void 0:ie.storyImpacts)||[],te=ue.map((he,Pe)=>({impact:he,i:Pe})).filter(({impact:he})=>he.type==="update"&&he.impacted),se=ue.map((he,Pe)=>({impact:he,i:Pe})).filter(({impact:he})=>he.type==="new"),pe=Object.values(z||{}).filter(Boolean).length,Ne=e.type==="epic";return l.jsx("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:he=>{he.target===he.currentTarget&&ne!=="running"&&i()},children:l.jsxs("div",{className:`bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden w-full transition-all duration-200 ${ne==="results"?"max-w-2xl":"max-w-xl"}`,style:{maxHeight:"88vh"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[l.jsxs("div",{children:[l.jsxs("h3",{className:"text-sm font-semibold text-slate-900 flex items-center gap-1.5",children:[l.jsx(vg,{className:"w-3.5 h-3.5 text-violet-600"}),"Refine with AI",ne!=="configure"&&l.jsx("span",{className:`ml-1 text-xs font-medium px-1.5 py-0.5 rounded ${ne==="running"?"bg-blue-100 text-blue-700":"bg-violet-100 text-violet-700"}`,children:ne==="running"?"Running…":"Results"})]}),l.jsx("p",{className:"text-xs text-slate-400 mt-0.5 truncate max-w-xs",children:e.name})]}),ne!=="running"&&l.jsx("button",{type:"button",onClick:i,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4 flex-shrink-0","aria-label":"Close",children:l.jsx(cn,{className:"w-4 h-4"})})]}),ne==="configure"&&l.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4 min-h-0",children:[u.length>0?l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("p",{className:"text-xs font-semibold text-slate-600 uppercase tracking-wide",children:["Validation Issues (",u.length,")"]}),l.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[l.jsx("button",{type:"button",onClick:()=>p(new Set(u.map((he,Pe)=>Pe))),className:"text-violet-600 hover:text-violet-800 transition-colors",children:"All"}),l.jsx("span",{className:"text-slate-300",children:"|"}),l.jsx("button",{type:"button",onClick:()=>p(new Set),className:"text-slate-400 hover:text-slate-600 transition-colors",children:"None"})]})]}),l.jsx("ul",{className:"space-y-1.5 max-h-52 overflow-y-auto pr-0.5",children:u.map((he,Pe)=>l.jsxs("li",{onClick:()=>re(Pe),className:`rounded-lg border px-3 py-2 cursor-pointer flex items-start gap-2.5 transition-shadow ${d.has(Pe)?"ring-2 ring-violet-400":""} ${hz[he.severity]??"bg-slate-50 border-slate-100"}`,children:[l.jsx("input",{type:"checkbox",checked:d.has(Pe),onChange:()=>re(Pe),onClick:De=>De.stopPropagation(),className:"mt-0.5 flex-shrink-0 accent-violet-600"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:`text-xs font-semibold uppercase ${pz[he.severity]??"text-slate-500"}`,children:he.severity}),l.jsx("p",{className:"text-xs text-slate-800 mt-0.5 leading-snug",children:he.description}),he.suggestion&&l.jsxs("p",{className:"text-xs text-slate-500 mt-0.5 leading-snug",children:[l.jsx("span",{className:"font-medium",children:"Suggestion:"})," ",he.suggestion]})]})]},Pe))})]}):l.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 bg-green-50 border border-green-100 rounded-lg",children:[l.jsx(ql,{className:"w-3.5 h-3.5 text-green-600 flex-shrink-0"}),l.jsx("p",{className:"text-xs text-green-700",children:"No validation issues found — you can still refine with a custom request."})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:["Refinement request"," ",l.jsx("span",{className:"text-slate-400",children:"(optional)"})]}),l.jsx("textarea",{value:h,onChange:he=>m(he.target.value),rows:3,placeholder:Ne?"E.g. Sharpen the scope, add examples, expand the features list…":"E.g. Make acceptance criteria more testable, add edge cases…",className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-violet-500 resize-none"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(pS,{label:"Generator Model",value:w,onChange:S,models:g,disabled:!1}),l.jsx(pS,{label:"Validator Model",value:j,onChange:k,models:g,disabled:!1})]}),C&&l.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-red-50 border border-red-100 rounded-lg",children:[l.jsx(na,{className:"w-3.5 h-3.5 text-red-500 flex-shrink-0 mt-0.5"}),l.jsx("p",{className:"text-xs text-red-700",children:C})]})]}),ne==="running"&&l.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden px-5 py-4 min-h-0",children:[l.jsxs("div",{className:"flex flex-col items-center gap-3 mb-4 flex-shrink-0",children:[l.jsx("span",{className:"w-8 h-8 border-2 border-violet-200 border-t-violet-600 rounded-full animate-spin"}),l.jsxs("p",{className:"text-sm font-medium text-slate-700",children:["Refining ",e.type,"…"]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto bg-slate-50 rounded-lg px-3 py-2.5 space-y-1 min-h-0",children:[O.length===0?l.jsx("p",{className:"text-xs text-slate-400 italic",children:"Starting…"}):O.map((he,Pe)=>l.jsx("p",{className:"text-xs text-slate-600 leading-snug",children:he},Pe)),l.jsx("div",{ref:I})]})]}),ne==="results"&&ie&&l.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5 min-h-0",children:[(()=>{var De,Xe,Pt,_t,It,un;const he=(Xe=(De=e==null?void 0:e.metadata)==null?void 0:De.validationResult)==null?void 0:Xe.averageScore,Pe=((Pt=ie.validationResult)==null?void 0:Pt.averageScore)??((un=(It=(_t=ie.proposedItem)==null?void 0:_t.metadata)==null?void 0:It.validationResult)==null?void 0:un.averageScore);return Pe==null?null:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide",children:"Validation Score"}),l.jsxs("div",{className:"flex items-center gap-2",children:[he!=null&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${hS(he)}`,children:[he,"/100"]}),l.jsx("span",{className:"text-slate-400 text-xs",children:"→"})]}),l.jsxs("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${hS(Pe)}`,children:[Pe,"/100"]})]})]})})(),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Proposed Changes"}),l.jsx(Em,{label:"Description",before:(me=ie.originalItem)==null?void 0:me.description,after:(Ae=ie.proposedItem)==null?void 0:Ae.description}),Ne&&l.jsx(Em,{label:"Features",before:(ae=ie.originalItem)==null?void 0:ae.features,after:($e=ie.proposedItem)==null?void 0:$e.features}),!Ne&&l.jsx(Em,{label:"Acceptance Criteria",before:((Re=ie.originalItem)==null?void 0:Re.acceptance)??((Ye=ie.originalItem)==null?void 0:Ye.acceptanceCriteria),after:((Qe=ie.proposedItem)==null?void 0:Qe.acceptance)??((Mt=ie.proposedItem)==null?void 0:Mt.acceptanceCriteria)}),((En=ie.originalItem)==null?void 0:En.description)===((xn=ie.proposedItem)==null?void 0:xn.description)&&!((vn=ie.originalItem)!=null&&vn.features)&&!((yn=ie.originalItem)!=null&&yn.acceptanceCriteria)&&l.jsx("p",{className:"text-xs text-slate-400 italic",children:"No textual changes detected — check dependencies or metadata."})]}),te.length>0&&l.jsxs("div",{children:[l.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["Existing Stories to Update (",te.length,")"]}),l.jsx("div",{className:"space-y-2",children:te.map(({impact:he,i:Pe})=>l.jsx(dz,{impact:he,checked:(z==null?void 0:z[Pe])??!0,onToggle:()=>K(De=>({...De,[Pe]:!(De!=null&&De[Pe])}))},Pe))})]}),se.length>0&&l.jsxs("div",{children:[l.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["New Stories to Add (",se.length,")"]}),l.jsx("div",{className:"space-y-2",children:se.map(({impact:he,i:Pe})=>l.jsx(fz,{story:he.proposedStory,checked:(z==null?void 0:z[Pe])??!0,onToggle:()=>K(De=>({...De,[Pe]:!(De!=null&&De[Pe])}))},Pe))})]}),ee&&l.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-red-50 border border-red-100 rounded-lg",children:[l.jsx(na,{className:"w-3.5 h-3.5 text-red-500 flex-shrink-0 mt-0.5"}),l.jsx("p",{className:"text-xs text-red-700",children:ee})]})]}),l.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-between gap-2",children:[ne==="configure"&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:i,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Cancel"}),l.jsxs("button",{type:"button",onClick:U,disabled:!_,className:"flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium text-white bg-violet-600 rounded-lg hover:bg-violet-700 transition-colors disabled:opacity-40",children:[l.jsx(vg,{className:"w-3.5 h-3.5"}),V>0?`Refine (${V} issue${V!==1?"s":""})`:"Refine"]})]}),ne==="running"&&l.jsx("p",{className:"w-full text-center text-xs text-slate-400 italic",children:"Waiting for LLM response — please keep this window open."}),ne==="results"&&l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:i,disabled:L,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors disabled:opacity-40",children:"Discard"}),l.jsx("button",{type:"button",onClick:B,disabled:L,className:"flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium text-white bg-violet-600 rounded-lg hover:bg-violet-700 transition-colors disabled:opacity-40",children:L?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Applying…"]}):l.jsxs(l.Fragment,{children:[l.jsx(ql,{className:"w-3.5 h-3.5"}),pe>0?`Accept + ${pe} story change${pe!==1?"s":""}`:"Accept Changes"]})})]})]})]})})}function Tm({item:e,fallbackName:t,fallbackId:n,onItemClick:r}){const i=e?yd[e.type]:null,a=e?po(e.status):null;return l.jsx("button",{onClick:()=>e&&(r==null?void 0:r(e)),disabled:!e,className:"w-full text-left p-4 border border-slate-200 rounded-lg hover:border-blue-300 hover:bg-blue-50 transition-colors disabled:opacity-50 disabled:cursor-default",children:l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"font-medium text-slate-900 mb-1 truncate",children:(e==null?void 0:e.name)??t}),(e==null?void 0:e.description)&&l.jsx("p",{className:"text-xs text-slate-500 mb-1 line-clamp-2",children:e.description}),(a||i)&&l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a&&l.jsxs(to,{variant:"secondary",className:nt("text-xs",a.color==="green"&&"bg-green-100 text-green-700",a.color==="blue"&&"bg-blue-100 text-blue-700",a.color==="yellow"&&"bg-yellow-100 text-yellow-700",a.color==="purple"&&"bg-purple-100 text-purple-700",a.color==="red"&&"bg-red-100 text-red-700"),children:[a.icon," ",a.label]}),i&&l.jsxs(to,{variant:"outline",className:"text-xs",children:[i.icon," ",i.label]})]})]}),e&&l.jsx(ar,{className:"w-4 h-4 text-slate-400 mt-1 flex-shrink-0 ml-2"})]})})}function gz({item:e}){const[t,n]=b.useState(!1),[r,i]=b.useState(null),a=async()=>{if(r!==null){n(!t);return}const u=e.id==="project"?await F3():await yg(e.id).catch(()=>"");i(u||'<p class="text-slate-400 italic">No content</p>'),n(!0)},c=e.id==="project";return l.jsxs("div",{className:"w-full",children:[l.jsxs("button",{onClick:a,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded font-medium ${c?"bg-indigo-50 hover:bg-indigo-100 text-indigo-700":"bg-slate-100 hover:bg-slate-200 text-slate-600"}`,children:[t?l.jsx(h3,{className:"w-3 h-3"}):l.jsx(ar,{className:"w-3 h-3"}),e.name," — doc.md"]}),t&&r&&l.jsx("div",{className:"mt-2 ml-4 p-3 border-l-2 border-slate-200 prose prose-sm prose-slate max-w-none",children:l.jsx("div",{dangerouslySetInnerHTML:{__html:r}})})]})}const yd={epic:{color:"indigo",icon:"🏛️",label:"Epic"},story:{color:"blue",icon:"📖",label:"Story"},task:{color:"emerald",icon:"⚙️",label:"Task"},subtask:{color:"gray",icon:"📝",label:"Subtask"}};function xz({workItem:e,open:t,onOpenChange:n,onNavigate:r,onItemClick:i,allItems:a,refineProgress:c,refineResult:u,refineError:d,onClearRefine:p}){const[h,m]=b.useState("documentation"),[g,v]=b.useState(null),[w,S]=b.useState(null),[j,k]=b.useState(!1),[C,E]=b.useState(null),[A,P]=b.useState(!1),[O,M]=b.useState(""),[I,z]=b.useState(!1),[K,L]=b.useState([]),R=Mf(_=>_.ceremonyActive),[ee,J]=b.useState(!1),ne=()=>{J(!1),p==null||p(),re()};b.useEffect(()=>{t&&e&&re()},[t,e==null?void 0:e.id,e==null?void 0:e.status]),b.useEffect(()=>{!j&&w===null&&m("details")},[j,w]),b.useEffect(()=>{if(!t)return;const _=V=>{V.key==="ArrowLeft"?r==null||r("prev"):V.key==="ArrowRight"&&(r==null||r("next"))};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[t,r]);const re=async()=>{if(e){k(!0),E(null),P(!1);try{const _=await NC(e.id);v(_);const V=[{id:"project",name:"Project"}];if(a){const ue=[];let te=_.parentId;for(;te;){const se=a.find(pe=>pe.id===te);if(!se)break;ue.unshift(se),te=se.parentId}V.push(...ue)}L(V);const ie=await yg(e.id).catch(()=>null);S(ie||null)}catch(_){E(_.message),console.error("Failed to load work item details:",_)}finally{k(!1)}}},U=async()=>{const _=await R3(e.id);M(_),P(!0)},B=async()=>{z(!0);try{await L3(e.id,O);const _=await yg(e.id);S(_),P(!1)}finally{z(!1)}};if(!e)return null;const G=po(e.status),q=yd[e.type]||yd.task;return l.jsxs(nz,{open:t,onOpenChange:n,children:[l.jsxs(rz,{onClose:()=>n(!1),children:[l.jsx(iz,{children:l.jsx("div",{className:"flex items-start justify-between pr-8",children:l.jsxs("div",{className:"flex-1",children:[l.jsx(sz,{className:"mb-2",children:e.name}),l.jsxs(az,{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs(to,{variant:"secondary",className:nt((G==null?void 0:G.color)==="blue"&&"bg-blue-100 text-blue-700",(G==null?void 0:G.color)==="yellow"&&"bg-yellow-100 text-yellow-700",(G==null?void 0:G.color)==="green"&&"bg-green-100 text-green-700",(G==null?void 0:G.color)==="purple"&&"bg-purple-100 text-purple-700",(G==null?void 0:G.color)==="red"&&"bg-red-100 text-red-700"),children:[G==null?void 0:G.icon," ",G==null?void 0:G.label]}),l.jsxs(to,{variant:"outline",children:[q.icon," ",q.label]}),l.jsx("span",{className:"text-slate-400 text-xs",children:e.id})]})]})})}),l.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[l.jsxs("div",{className:"px-6 pb-2 border-b border-slate-100 flex items-center justify-between gap-4",children:[l.jsx(fS,{value:h,onValueChange:m,children:l.jsxs(oz,{children:[w&&l.jsxs(Yu,{value:"documentation",children:[l.jsx(vC,{className:"w-4 h-4 mr-2"}),"Documentation"]}),l.jsxs(Yu,{value:"details",children:[l.jsx(x3,{className:"w-4 h-4 mr-2"}),"Details"]}),(g==null?void 0:g.children)&&g.children.length>0&&e.type!=="task"&&l.jsxs(Yu,{value:"children",children:[l.jsx(E3,{className:"w-4 h-4 mr-2"}),"Children (",g.children.length,")"]}),(g==null?void 0:g.functions)&&g.functions.length>0&&l.jsxs(Yu,{value:"code",children:["Code (",g.functions.length,")"]})]})}),l.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(()=>{var pe;const _=(pe=g==null?void 0:g.metadata)==null?void 0:pe.validationResult;if(!_)return null;const V=_.averageScore??null,ie=(_.criticalIssues||[]).length,ue=(_.majorIssues||[]).length,te=(_.minorIssues||[]).length,se=ie+ue+te;return l.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[l.jsxs("span",{className:`font-bold px-2 py-0.5 rounded-full ${V>=95?"bg-green-100 text-green-700":V>=80?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700"}`,children:[V,"/100"]}),se>0&&l.jsxs("span",{children:[ie>0&&l.jsxs("span",{className:"text-red-600 font-medium",children:[ie," critical"]}),ie>0&&ue>0&&l.jsx("span",{className:"mx-0.5",children:"·"}),ue>0&&l.jsxs("span",{className:"text-orange-600 font-medium",children:[ue," major"]}),(ie>0||ue>0)&&te>0&&l.jsx("span",{className:"mx-0.5",children:"·"}),te>0&&l.jsxs("span",{className:"text-amber-600",children:[te," minor"]})]})]})})(),g&&!R&&l.jsxs("div",{className:"flex items-center gap-2",children:[e.type==="story"&&(!g.children||g.children.length===0)&&l.jsx(lz,{storyId:e.id,storyName:e.name}),e.type==="task"&&(e.status==="planned"||e.status==="ready"||e.status==="failed")&&l.jsx(cz,{taskId:e.id,taskName:e.name}),l.jsxs("button",{onClick:()=>J(!0),className:"flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-violet-700 bg-violet-50 border border-violet-200 rounded-lg hover:bg-violet-100 transition-colors",children:[l.jsx(vg,{className:"w-3.5 h-3.5"}),"Refine with AI"]})]})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:j?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):C?l.jsx("div",{className:"text-center py-12",children:l.jsxs("p",{className:"text-red-600",children:["Failed to load details: ",C]})}):l.jsxs(fS,{value:h,children:[w&&l.jsxs(Xu,{value:"documentation",children:[K.length>0&&l.jsx("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-xs text-slate-500",children:K.map(_=>l.jsx(gz,{item:_,fileType:"doc"},_.id))}),l.jsx("div",{className:"flex justify-end mb-2",children:R?l.jsxs("span",{className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-400",children:[l.jsx(R1,{className:"w-3 h-3"})," Read-only during ceremony"]}):A?l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("button",{onClick:()=>P(!1),className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-600 hover:text-slate-900 border border-slate-200 rounded",children:[l.jsx(cn,{className:"w-3 h-3"})," Cancel"]}),l.jsxs("button",{onClick:B,disabled:I,className:"flex items-center gap-1 px-2 py-1 text-xs text-white bg-indigo-600 hover:bg-indigo-700 rounded disabled:opacity-50",children:[l.jsx(k3,{className:"w-3 h-3"})," ",I?"Saving…":"Save"]})]}):l.jsxs("button",{onClick:U,className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-600 hover:text-slate-900 border border-slate-200 rounded",children:[l.jsx(mc,{className:"w-3 h-3"})," Edit"]})}),A?l.jsx("textarea",{className:"w-full h-96 p-3 text-sm font-mono border border-slate-300 rounded focus:outline-none focus:ring-2 focus:ring-indigo-400 resize-y",value:O,onChange:_=>M(_.target.value)}):l.jsx("div",{className:"prose prose-slate max-w-none",children:l.jsx("div",{dangerouslySetInnerHTML:{__html:w}})})]}),l.jsx(Xu,{value:"details",children:l.jsxs("div",{className:"space-y-6",children:[(g==null?void 0:g.created)&&l.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[l.jsx(f3,{className:"w-4 h-4"}),l.jsxs("span",{children:["Created ",new Date(g.created).toLocaleDateString()]})]}),(g==null?void 0:g.parentName)&&(()=>{const _=a==null?void 0:a.find(V=>V.id===g.parentId);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[l.jsx(Cd,{className:"w-4 h-4"}),l.jsx("span",{children:"Parent"})]}),l.jsx(Tm,{item:_,fallbackName:g.parentName,fallbackId:g.parentId,onItemClick:i})]})})(),(g==null?void 0:g.epicName)&&e.type!=="epic"&&(()=>{const _=a==null?void 0:a.find(V=>V.id===g.epicId);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[l.jsx(Cd,{className:"w-4 h-4"}),l.jsx("span",{children:"Epic"})]}),l.jsx(Tm,{item:_,fallbackName:g.epicName,fallbackId:g.epicId,onItemClick:i})]})})(),(()=>{const _=e.type==="epic"?g==null?void 0:g.features:g==null?void 0:g.acceptance;if(!_||_.length===0)return null;const V=g==null?void 0:g.acceptanceStatus,ie=V==null?void 0:V.some(ue=>ue.passed);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[l.jsx(gg,{className:"w-4 h-4"}),l.jsx("span",{children:"Acceptance Criteria"}),ie?l.jsx("span",{className:"ml-auto text-xs font-normal text-green-600",children:"verified by tests"}):l.jsxs("span",{className:"ml-auto flex items-center gap-1 text-xs font-normal text-slate-400",children:[l.jsx(R1,{className:"w-3 h-3"}),"updated by tests"]})]}),l.jsx("ul",{className:"space-y-1.5",children:_.map((ue,te)=>{var pe;const se=(pe=V==null?void 0:V[te])==null?void 0:pe.passed;return l.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-slate-700",children:[l.jsx("input",{type:"checkbox",checked:!!se,readOnly:!0,disabled:!0,className:`mt-0.5 h-4 w-4 flex-shrink-0 rounded border-slate-300 cursor-not-allowed ${se?"text-green-600 opacity-100":"text-indigo-600 opacity-60"}`}),l.jsx("span",{className:`leading-snug ${se?"text-green-700":""}`,children:ue})]},te)})})]})})(),(g==null?void 0:g.testResults)&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[l.jsx("span",{children:g.testResults.passed?"✅":"❌"}),l.jsx("span",{children:"Test Results"}),l.jsx("span",{className:`ml-auto text-xs font-normal ${g.testResults.passed?"text-green-600":"text-red-600"}`,children:g.testResults.passed?"All tests passed":"Tests failed"})]}),g.testResults.command&&l.jsxs("p",{className:"text-xs text-slate-500 mb-1 font-mono",children:["$ ",g.testResults.command]}),l.jsx("pre",{className:"bg-slate-900 text-slate-300 text-xs font-mono rounded-lg p-3 max-h-40 overflow-y-auto whitespace-pre-wrap",children:g.testResults.output||"(no output)"})]}),e.type==="task"&&(g==null?void 0:g.children)&&g.children.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[l.jsx(gg,{className:"w-4 h-4"}),l.jsx("span",{children:"Subtasks"}),l.jsxs("span",{className:"ml-auto text-xs font-normal text-slate-400",children:[g.children.filter(_=>_.status==="completed").length,"/",g.children.length," done"]})]}),l.jsx("div",{className:"space-y-2",children:g.children.map(_=>{const V=_.status==="completed",ie=a==null?void 0:a.find(ue=>ue.id===_.id);return l.jsx("button",{onClick:()=>ie&&(i==null?void 0:i(ie)),className:`w-full text-left border rounded-lg p-3 transition-colors cursor-pointer ${V?"border-green-200 bg-green-50/50 hover:border-green-300":"border-slate-200 hover:border-blue-300 hover:bg-blue-50"}`,children:l.jsxs("div",{className:"flex items-start gap-2.5",children:[l.jsx("input",{type:"checkbox",checked:V,readOnly:!0,tabIndex:-1,className:`mt-0.5 h-4 w-4 flex-shrink-0 rounded pointer-events-none ${V?"text-green-600 opacity-100":"text-slate-400 opacity-60"}`}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:`text-sm font-medium ${V?"text-green-700":"text-slate-700"}`,children:_.name}),_.acceptance&&_.acceptance.length>0&&l.jsx("ul",{className:"mt-1 space-y-0.5",children:_.acceptance.map((ue,te)=>l.jsxs("li",{className:"flex items-start gap-1.5 text-xs text-slate-500",children:[l.jsx("span",{className:"flex-shrink-0 mt-0.5",children:V?"✓":"·"}),l.jsx("span",{children:ue})]},te))})]})]})},_.id)})})]}),(g==null?void 0:g.dependencies)&&g.dependencies.length>0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[l.jsx(wC,{className:"w-4 h-4"}),l.jsxs("span",{children:["Depends On (",g.dependencies.length,")"]})]}),l.jsx("div",{className:"space-y-2",children:g.dependencies.map(_=>{const V=a==null?void 0:a.find(ie=>ie.id===_);return l.jsx(Tm,{item:V,fallbackName:_,fallbackId:_,onItemClick:i},_)})})]})]})}),(g==null?void 0:g.children)&&g.children.length>0&&e.type!=="task"&&l.jsx(Xu,{value:"children",children:l.jsx("div",{className:"space-y-2",children:g.children.map(_=>{const V=po(_.status),ie=yd[_.type],ue=a==null?void 0:a.find(te=>te.id===_.id);return l.jsx("button",{onClick:()=>ue&&(i==null?void 0:i(ue)),className:"w-full text-left p-4 border border-slate-200 rounded-lg hover:border-blue-300 hover:bg-blue-50 transition-colors cursor-pointer",children:l.jsxs("div",{className:"flex items-start justify-between",children:[l.jsxs("div",{children:[l.jsx("h4",{className:"font-medium text-slate-900 mb-1",children:_.name}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(to,{variant:"secondary",className:nt("text-xs",(V==null?void 0:V.color)==="green"&&"bg-green-100 text-green-700",(V==null?void 0:V.color)==="blue"&&"bg-blue-100 text-blue-700",(V==null?void 0:V.color)==="yellow"&&"bg-yellow-100 text-yellow-700"),children:[V==null?void 0:V.icon," ",V==null?void 0:V.label]}),l.jsxs(to,{variant:"outline",className:"text-xs",children:[ie==null?void 0:ie.icon," ",ie==null?void 0:ie.label]})]})]}),l.jsx(ar,{className:"w-4 h-4 text-slate-400 mt-1 flex-shrink-0"})]})},_.id)})})}),(g==null?void 0:g.functions)&&g.functions.length>0&&l.jsx(Xu,{value:"code",children:l.jsx("div",{className:"space-y-2",children:g.functions.map((_,V)=>l.jsxs("div",{className:"flex items-start gap-3 p-2 rounded-lg border border-slate-200 hover:bg-slate-50",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("code",{className:"text-sm font-mono text-blue-700 truncate",children:_.name}),_.pure&&l.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-medium rounded bg-green-100 text-green-700 border border-green-200",children:"pure"}),_.type==="exported"&&l.jsx("span",{className:"px-1.5 py-0.5 text-[10px] font-medium rounded bg-blue-100 text-blue-700 border border-blue-200",children:"export"})]}),l.jsx("div",{className:"text-xs text-slate-500 mt-0.5 truncate",children:_.file}),_.satisfies&&l.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:_.satisfies}),_.task&&l.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:["Task: ",_.task]})]}),_.lines&&l.jsxs("span",{className:"text-xs text-slate-400 whitespace-nowrap",children:[_.lines,"L"]})]},_.name||V))})})]})})]}),r&&l.jsxs("div",{className:"px-6 py-4 border-t border-slate-100 flex items-center justify-between",children:[l.jsxs("button",{onClick:()=>r("prev"),className:"flex items-center gap-2 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:[l.jsx(p3,{className:"w-4 h-4"}),"Previous"]}),l.jsx("span",{className:"text-xs text-slate-400",children:"Use ← → to navigate"}),l.jsxs("button",{onClick:()=>r("next"),className:"flex items-center gap-2 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:["Next",l.jsx(ar,{className:"w-4 h-4"})]})]})]}),ee&&g&&l.jsx(mz,{item:g,refineProgress:(c==null?void 0:c.itemId)===g.id?c:null,refineResult:(u==null?void 0:u.itemId)===g.id?u:null,refineError:(d==null?void 0:d.itemId)===g.id?d:null,onClose:()=>{J(!1),p==null||p()},onAccepted:ne})]})}function pA({agentName:e,onClose:t,onSaved:n,onReset:r}){const[i,a]=b.useState(null),[c,u]=b.useState(""),[d,p]=b.useState(!0),[h,m]=b.useState(!1),[g,v]=b.useState(!1),[w,S]=b.useState(null),[j,k]=b.useState(!1);b.useEffect(()=>{p(!0),S(null),k(!1),lD(e).then(M=>{a(M),u(M.content)}).catch(M=>S(M.message)).finally(()=>p(!1))},[e]);const C=i&&c!==i.content,E=async()=>{if(!(!i||!C)){m(!0),S(null);try{j?(await uD(e),a(M=>({...M,content:M.defaultContent,isCustomized:!1})),k(!1),r==null||r()):(await cD(e,c),a(M=>({...M,content:c,isCustomized:!0})),n==null||n()),v(!0),setTimeout(()=>v(!1),2e3)}catch(M){S(M.message)}finally{m(!1)}}},A=()=>{t()},P=()=>{i!=null&&i.defaultContent&&(u(i.defaultContent),k(!0))},O=(i==null?void 0:i.isCustomized)&&!j;return l.jsx("div",{className:"fixed inset-0 z-[90] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:M=>{M.target===M.currentTarget&&t()},children:l.jsxs("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx("span",{className:"text-sm font-mono font-medium text-slate-700 truncate",children:e}),(i==null?void 0:i.isCustomized)&&!j&&l.jsx("span",{className:"flex-shrink-0 text-xs font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:"Custom"}),j&&l.jsx("span",{className:"flex-shrink-0 text-xs font-medium px-1.5 py-0.5 rounded bg-blue-100 text-blue-700",children:"Reset pending — save to apply"})]}),l.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4 flex-shrink-0","aria-label":"Close",children:l.jsx(cn,{className:"w-4 h-4"})})]}),d?l.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-slate-400",children:[l.jsx("span",{className:"w-4 h-4 border border-slate-300 border-t-slate-600 rounded-full animate-spin mr-2"}),"Loading…"]}):w&&!i?l.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-red-500 px-6 text-center",children:w}):l.jsx("textarea",{value:c,onChange:M=>{u(M.target.value),k(!1)},className:"flex-1 resize-none font-mono text-xs text-slate-800 leading-relaxed px-5 py-4 focus:outline-none",spellCheck:!1}),l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-slate-100 flex-shrink-0",children:[l.jsxs("div",{children:[w&&!d&&l.jsx("p",{className:"text-xs text-red-600",children:w}),g&&l.jsx("p",{className:"text-xs text-green-600 font-medium",children:"Saved ✓"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:P,disabled:!O,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-slate-500 hover:text-amber-600 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:O?"Load default content into editor":"Only available for customized agents",children:[l.jsx(jC,{className:"w-3 h-3"}),"Reset to default"]}),l.jsx("button",{type:"button",onClick:A,className:"px-3 py-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:E,disabled:!C||h,className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:h?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):j?"Save & Reset":"Save"})]})]})]})})}const vz=["critical","major","minor"],Ul={critical:"bg-red-100 text-red-800 border-red-200",major:"bg-amber-100 text-amber-800 border-amber-200",minor:"bg-slate-100 text-slate-600 border-slate-200"};function yz({isCrossRef:e}){const[t,n]=b.useState(!1);return l.jsxs("div",{className:"mb-2",children:[l.jsxs("button",{type:"button",onClick:()=>n(!t),className:"flex items-center gap-1.5 text-[11px] text-blue-600 hover:text-blue-800 transition-colors",children:[l.jsx(zx,{className:"w-3.5 h-3.5"}),t?"Hide guide":"How micro-checks work & field reference"]}),t&&l.jsxs("div",{className:"mt-2 text-[11px] leading-relaxed text-slate-600 bg-blue-50/60 border border-blue-100 rounded-lg px-4 py-3 space-y-3",children:[l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"How micro-checks are used in ceremonies"}),l.jsxs("p",{children:["During Sprint Planning validation, each epic and story is evaluated by hundreds of small, independent checks instead of a single monolithic LLM call.",e?" Cross-reference checks (Tier 2) run after all domain checks complete. They verify consistency across perspectives — for example, that security requirements match API endpoint access controls, or that database PII fields align with privacy policies.":" Domain checks (Tier 1) run first, in parallel. Each check makes 1–2 short LLM calls: an optional applicability gate, then a YES/NO quality question. Failed checks are scored deterministically and critical/major failures trigger atomic auto-fixes (Tier 3)."]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"Severity levels"}),l.jsxs("ul",{className:"list-none space-y-0.5 ml-1",children:[l.jsxs("li",{children:[l.jsx("span",{className:"font-mono font-semibold text-red-700",children:"critical"})," — Failure blocks the score below 70. A single critical failure caps the score at 60; each additional one drops it by 10. Auto-fix is always attempted."]}),l.jsxs("li",{children:[l.jsx("span",{className:"font-mono font-semibold text-amber-700",children:"major"})," — Failure caps the score between 70–89. Each major failure reduces the cap by 5. Auto-fix is attempted."]}),l.jsxs("li",{children:[l.jsx("span",{className:"font-mono font-semibold text-slate-500",children:"minor"})," — Only minor failures allow scores of 95–100. Minor failures are reported but not auto-fixed."]})]})]}),l.jsxs("div",{children:[l.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"Field reference"}),l.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 ml-1",children:[l.jsx("dt",{className:"font-mono text-slate-700",children:"severity"}),l.jsx("dd",{children:"How much a failure impacts the score (see above)."}),l.jsx("dt",{className:"font-mono text-slate-700",children:"category"}),l.jsx("dd",{children:'Grouping label for reporting (e.g. "security", "data-modeling"). Helps cluster related failures.'}),!e&&l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"font-mono text-slate-700",children:"applicabilityQuestion"}),l.jsx("dd",{children:'Optional gate question asked before the main check. If the LLM answers NO, the check is skipped as not applicable. Leave empty to always run. Example: "Does this epic involve user authentication?"'}),l.jsx("dt",{className:"font-mono text-slate-700",children:"universal"}),l.jsx("dd",{children:"If true, the applicability gate is skipped and the check always runs. Useful for checks that apply to every epic/story regardless of domain."})]}),l.jsx("dt",{className:"font-mono text-slate-700",children:"question"}),l.jsx("dd",{children:'The YES/NO quality question sent to the LLM. A YES answer means the check passes. Write it so that YES = good quality. Example: "Does this story include acceptance criteria that cover error scenarios?"'}),l.jsx("dt",{className:"font-mono text-slate-700",children:"failDescription"}),l.jsx("dd",{children:"Human-readable explanation shown when the check fails. Describes what quality gap was detected."}),l.jsx("dt",{className:"font-mono text-slate-700",children:"failSuggestion"}),l.jsx("dd",{children:"Actionable guidance for the auto-fixer (or a human) on how to address the failure. Be specific — this drives the Tier 3 atomic fix prompt."}),e&&l.jsxs(l.Fragment,{children:[l.jsx("dt",{className:"font-mono text-slate-700",children:"perspectives"}),l.jsx("dd",{children:'Which domain perspectives this cross-reference check bridges (e.g. ["security", "api"]). Read-only — set in the JSON directly.'}),l.jsx("dt",{className:"font-mono text-slate-700",children:"dependsOn"}),l.jsx("dd",{children:"Tier 1 check IDs whose evidence this check needs. The cross-ref check only runs if all dependencies have results. Read-only — set in the JSON directly."})]})]})]}),l.jsxs("p",{className:"text-[10px] text-slate-400 italic",children:["Customized checks are saved to ",l.jsx("span",{className:"font-mono",children:".avc/customized-agents/checks/"}),' and override the built-in defaults. Use "Reset to default" to revert.']})]})]})}function Qu({label:e,value:t,onChange:n,placeholder:r,rows:i=2}){return l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:e}),l.jsx("textarea",{value:t||"",onChange:a=>n(a.target.value),placeholder:r,rows:i,className:"mt-0.5 w-full text-xs text-slate-800 border border-slate-200 rounded-md px-2.5 py-1.5 focus:outline-none focus:ring-1 focus:ring-blue-400 focus:border-blue-400 resize-none leading-relaxed"})]})}function bz({value:e,onChange:t}){return l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:"Severity"}),l.jsx("select",{value:e||"major",onChange:n=>t(n.target.value),className:"mt-0.5 w-full text-xs border border-slate-200 rounded-md px-2 py-1.5 bg-white text-slate-800 focus:outline-none focus:ring-1 focus:ring-blue-400",children:vz.map(n=>l.jsx("option",{value:n,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]})}function Sl({label:e,value:t}){return l.jsxs("span",{className:"text-[10px] text-slate-400",children:[l.jsxs("span",{className:"font-medium",children:[e,":"]})," ",l.jsx("span",{className:"font-mono text-slate-500",children:t})]})}function wz({check:e,index:t,isCrossRef:n,expanded:r,onToggle:i,onChange:a,onDelete:c}){const u=Ul[e.severity]||Ul.minor,d=(h,m)=>{a(t,{...e,[h]:m})},p=(e.question||"").length>90?e.question.slice(0,90)+"…":e.question||"(no question)";return l.jsxs("div",{className:`border rounded-lg overflow-hidden ${r?"border-blue-200 shadow-sm":"border-slate-200"}`,children:[l.jsxs("button",{type:"button",onClick:i,className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors ${r?"bg-blue-50/50":"bg-white hover:bg-slate-50"}`,children:[r?l.jsx(ds,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}):l.jsx(ar,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}),l.jsx("span",{className:`flex-shrink-0 text-[10px] font-semibold px-1.5 py-0.5 rounded border ${u}`,children:e.severity||"major"}),l.jsx("span",{className:"flex-shrink-0 text-[10px] font-mono text-slate-400",children:e.id}),l.jsx("span",{className:"flex-1 text-xs text-slate-600 truncate min-w-0",children:p})]}),r&&l.jsxs("div",{className:"px-3 pb-3 pt-1 bg-white border-t border-slate-100",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2 flex-wrap",children:[l.jsx(Sl,{label:"id",value:e.id}),e.category&&l.jsx(Sl,{label:"category",value:e.category}),n&&e.perspectives&&l.jsx(Sl,{label:"perspectives",value:e.perspectives.join(", ")}),n&&e.dependsOn&&l.jsx(Sl,{label:"dependsOn",value:e.dependsOn.join(", ")}),!n&&e.universal!==void 0&&l.jsx(Sl,{label:"universal",value:e.universal?"yes":"no"})]}),l.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-x-3 gap-y-2",children:[l.jsx("div",{className:"col-span-2 sm:col-span-1",children:l.jsx(bz,{value:e.severity,onChange:h=>d("severity",h)})}),l.jsx("div",{className:"col-span-2 sm:col-span-1",children:l.jsxs("label",{className:"block",children:[l.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:"Category"}),l.jsx("input",{type:"text",value:e.category||"",onChange:h=>d("category",h.target.value),className:"mt-0.5 w-full text-xs border border-slate-200 rounded-md px-2.5 py-1.5 text-slate-800 focus:outline-none focus:ring-1 focus:ring-blue-400"})]})})]}),l.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[!n&&!e.universal&&l.jsx(Qu,{label:"Applicability Question",value:e.applicabilityQuestion,onChange:h=>d("applicabilityQuestion",h),placeholder:"When should this check run? (leave empty = always)",rows:2}),l.jsx(Qu,{label:"Question",value:e.question,onChange:h=>d("question",h),placeholder:"The YES/NO quality question asked to the LLM",rows:3}),l.jsx(Qu,{label:"Fail Description",value:e.failDescription,onChange:h=>d("failDescription",h),placeholder:"What's wrong when this check fails",rows:2}),l.jsx(Qu,{label:"Fail Suggestion",value:e.failSuggestion,onChange:h=>d("failSuggestion",h),placeholder:"How to fix the failure",rows:2})]}),l.jsx("div",{className:"mt-3 flex justify-end",children:l.jsxs("button",{type:"button",onClick:()=>c(t),className:"flex items-center gap-1 text-[11px] text-red-500 hover:text-red-700 transition-colors",children:[l.jsx(A3,{className:"w-3 h-3"}),"Remove check"]})})]})]})}function hA({scope:e,perspective:t,onClose:n,onSaved:r,onReset:i}){const[a,c]=b.useState(null),[u,d]=b.useState(null),[p,h]=b.useState([]),[m,g]=b.useState(null),[v,w]=b.useState(!0),[S,j]=b.useState(!1),[k,C]=b.useState(!1),[E,A]=b.useState(null),[P,O]=b.useState(!1),M=e==="cross-refs",I=M?`cross-refs/${t}.json`:`${e}/${t}.json`;b.useEffect(()=>{w(!0),A(null),O(!1),g(null),fD(e,t).then(U=>{c(U);try{const B=JSON.parse(U.content);d(B),h(JSON.parse(JSON.stringify(B.checks||[])))}catch{A("Failed to parse check file")}}).catch(U=>A(U.message)).finally(()=>w(!1))},[e,t]);const z=(()=>{if(!a)return!1;try{const U=JSON.parse(a.content);return JSON.stringify(p)!==JSON.stringify(U.checks||[])}catch{return!1}})(),K=(U,B)=>{h(G=>G.map((q,_)=>_===U?B:q)),O(!1)},L=U=>{h(B=>B.filter((G,q)=>q!==U)),m===U?g(null):m>U&&g(m-1),O(!1)},R=()=>{const B=`${M?"xref":e==="epic"?t.slice(0,3)+"-epic":t.slice(0,3)+"-story"}-${String(p.length+1).padStart(2,"0")}`,G=M?{id:B,tier:2,perspectives:[],severity:"major",category:"consistency",dependsOn:[],question:"",failDescription:"",failSuggestion:""}:{id:B,tier:1,perspective:t,severity:"major",category:"",universal:!1,applicabilityQuestion:"",question:"",failDescription:"",failSuggestion:""};h(q=>[...q,G]),g(p.length),O(!1)},ee=async()=>{if(a){j(!0),A(null);try{if(P){await hD(e,t);const U=JSON.parse(a.defaultContent);d(U),h(JSON.parse(JSON.stringify(U.checks||[]))),c(B=>({...B,content:B.defaultContent,isCustomized:!1})),O(!1),i==null||i()}else{const U={...u,checks:p},B=JSON.stringify(U,null,2);await pD(e,t,B),c(G=>({...G,content:B,isCustomized:!0})),r==null||r()}C(!0),setTimeout(()=>C(!1),2e3)}catch(U){A(U.message)}finally{j(!1)}}},J=()=>{if(a!=null&&a.defaultContent){try{const U=JSON.parse(a.defaultContent);h(JSON.parse(JSON.stringify(U.checks||[])))}catch{}O(!0),g(null)}},ne=(a==null?void 0:a.isCustomized)&&!P,re={critical:0,major:0,minor:0};return p.forEach(U=>{re[U.severity]!==void 0&&re[U.severity]++}),l.jsx("div",{className:"fixed inset-0 z-[90] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:U=>{U.target===U.currentTarget&&n()},children:l.jsxs("div",{className:"w-full max-w-3xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[l.jsx("span",{className:"text-sm font-mono font-medium text-slate-700 truncate",children:I}),l.jsxs("span",{className:"flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded bg-blue-50 text-blue-600",children:[p.length," checks"]}),re.critical>0&&l.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Ul.critical}`,children:[re.critical," critical"]}),re.major>0&&l.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Ul.major}`,children:[re.major," major"]}),re.minor>0&&l.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Ul.minor}`,children:[re.minor," minor"]}),(a==null?void 0:a.isCustomized)&&!P&&l.jsx("span",{className:"flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:"Custom"}),P&&l.jsx("span",{className:"flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded bg-blue-100 text-blue-700",children:"Reset pending — save to apply"})]}),l.jsx("button",{type:"button",onClick:n,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4 flex-shrink-0","aria-label":"Close",children:l.jsx(cn,{className:"w-4 h-4"})})]}),v?l.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-slate-400",children:[l.jsx("span",{className:"w-4 h-4 border border-slate-300 border-t-slate-600 rounded-full animate-spin mr-2"}),"Loading…"]}):E&&!a?l.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-red-500 px-6 text-center",children:E}):l.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-4 py-3",children:l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx(yz,{isCrossRef:M}),p.map((U,B)=>l.jsx(wz,{check:U,index:B,isCrossRef:M,expanded:m===B,onToggle:()=>g(m===B?null:B),onChange:K,onDelete:L},U.id||B)),l.jsxs("button",{type:"button",onClick:R,className:"flex items-center justify-center gap-1.5 py-2 border-2 border-dashed border-slate-200 rounded-lg text-xs text-slate-400 hover:text-blue-600 hover:border-blue-300 transition-colors",children:[l.jsx(S3,{className:"w-3.5 h-3.5"}),"Add check"]})]})}),l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-slate-100 flex-shrink-0",children:[l.jsxs("div",{children:[E&&!v&&l.jsx("p",{className:"text-xs text-red-600",children:E}),k&&l.jsx("p",{className:"text-xs text-green-600 font-medium",children:"Saved"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{type:"button",onClick:J,disabled:!ne,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs text-slate-500 hover:text-amber-600 transition-colors disabled:opacity-30 disabled:cursor-not-allowed",title:ne?"Revert to built-in defaults":"Only available for customized checks",children:[l.jsx(jC,{className:"w-3 h-3"}),"Reset to default"]}),l.jsx("button",{type:"button",onClick:n,className:"px-3 py-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:ee,disabled:!z&&!P||S,className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:S?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):P?"Save & Reset":"Save"})]})]})]})})}const jz={claude:"anthropic",gemini:"gemini",openai:"openai",xiaomi:"xiaomi",local:"local"},mS={claude:"Claude",gemini:"Gemini",openai:"OpenAI",xiaomi:"Xiaomi MiMo",local:"Local LLM",custom:"Custom"};function Sz(e){var n,r,i,a,c;const t=new Set;for(const u of Object.values((e==null?void 0:e.stages)||{}))u!=null&&u.provider&&t.add(u.provider);return(n=e==null?void 0:e.validation)!=null&&n.provider&&t.add(e.validation.provider),(i=(r=e==null?void 0:e.validation)==null?void 0:r.documentation)!=null&&i.provider&&t.add(e.validation.documentation.provider),(c=(a=e==null?void 0:e.validation)==null?void 0:a.refinement)!=null&&c.provider&&t.add(e.validation.refinement.provider),t.size===0?(e==null?void 0:e.provider)||null:t.size===1?[...t][0]:"custom"}function Nz(e,t){var c,u,d;const n=(c=e.providerPresets)==null?void 0:c[t];if(!n)return e;const r={...e,provider:n.provider,defaultModel:n.defaultModel},i={},a=new Set([...Object.keys(r.stages||{}),...Object.keys(n.stages||{})]);for(const p of a){const h=((u=r.stages)==null?void 0:u[p])??{},m=(d=n.stages)==null?void 0:d[p];m?i[p]={...h,provider:m.provider,model:m.model}:i[p]=h}return r.stages=i,n.validation&&r.validation&&(r.validation={...r.validation,provider:n.validation.provider,model:n.validation.model},n.validation.refinement&&r.validation.refinement&&(r.validation.refinement={...r.validation.refinement,provider:n.validation.refinement.provider,model:n.validation.refinement.model}),n.validation.documentation&&r.validation.documentation&&(r.validation.documentation={...r.validation.documentation,provider:n.validation.documentation.provider,model:n.validation.documentation.model})),r}function kz(e,t){const n={...e,provider:"local",defaultModel:t},r={};for(const[i,a]of Object.entries(n.stages||{}))r[i]={...a,provider:"local",model:t};return n.stages=r,n.validation&&(n.validation={...n.validation,provider:"local",model:t},n.validation.documentation&&(n.validation.documentation={...n.validation.documentation,provider:"local",model:t}),n.validation.refinement&&(n.validation.refinement={...n.validation.refinement,provider:"local",model:t})),n}function Pz({ceremonyName:e,ceremonies:t,apiKeys:n,onApplied:r}){const[i,a]=b.useState(!1),[c,u]=b.useState(!1),[d,p]=b.useState(null),[h,m]=b.useState(!1),g=b.useRef(null),v=t==null?void 0:t.find(P=>P.name===e),w=Sz(v),S=v==null?void 0:v.providerPresets;if(b.useEffect(()=>{if(!i)return;const P=O=>{g.current&&!g.current.contains(O.target)&&(a(!1),m(!1))};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[i]),b.useEffect(()=>{!i||d!==null||Z3().then(P=>p(P.servers||[])).catch(()=>p([]))},[i,d]),!S||Object.keys(S).length===0)return null;const j=Object.keys(S),k=mS[w]||w||"—",C=async P=>{if(!v||P===w){a(!1);return}a(!1),m(!1),u(!0);try{const O=Nz(v,P),M=t.map(I=>I.name===e?O:I);await Kl(M,null),r(M)}finally{u(!1)}},E=async P=>{if(v){a(!1),m(!1),u(!0);try{const O=kz(v,P),M=t.map(I=>I.name===e?O:I);await Kl(M,null),r(M)}finally{u(!1)}}},A=(d||[]).flatMap(P=>P.models.map(O=>({id:O.id,server:P.label})));return l.jsxs("div",{className:"relative",ref:g,children:[l.jsxs("button",{type:"button",disabled:c,onClick:()=>{a(P=>!P),m(!1)},className:"flex items-center gap-1 text-xs px-2 py-1 rounded-md bg-slate-100 hover:bg-slate-200 text-slate-600 hover:text-slate-800 transition-colors disabled:opacity-60",title:"Switch AI provider preset",children:[c?l.jsx("span",{className:"w-3 h-3 border border-slate-400 border-t-slate-700 rounded-full animate-spin"}):l.jsxs("span",{className:"font-medium",children:["⚡ ",k]}),!c&&l.jsx(ds,{className:"w-3 h-3"})]}),i&&l.jsxs("div",{className:"absolute right-0 mt-1 w-56 bg-white border border-slate-200 rounded-lg shadow-lg z-50 py-1",children:[j.filter(P=>P!=="local").map(P=>{var K;const O=mS[P]||P,M=jz[P],I=((K=n==null?void 0:n[M])==null?void 0:K.isSet)??!1,z=P===w;return l.jsxs("button",{type:"button",onClick:()=>C(P),className:"w-full flex items-center justify-between px-3 py-2 text-sm text-left hover:bg-slate-50 transition-colors",children:[l.jsx("span",{className:z?"font-medium text-slate-900":"text-slate-700",children:O}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[z&&l.jsx(ql,{className:"w-3.5 h-3.5 text-blue-500"}),l.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${I?"bg-green-100 text-green-700":"bg-slate-100 text-slate-400"}`,children:I?"key set":"no key"})]})]},P)}),l.jsx("div",{className:"border-t border-slate-100 my-1"}),l.jsxs("button",{type:"button",onClick:()=>{A.length===1?E(A[0].id):m(P=>!P)},className:"w-full flex items-center justify-between px-3 py-2 text-sm text-left hover:bg-slate-50 transition-colors",children:[l.jsx("span",{className:w==="local"?"font-medium text-slate-900":"text-slate-700",children:"🖥 Local LLM"}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[w==="local"&&l.jsx(ql,{className:"w-3.5 h-3.5 text-blue-500"}),d===null?l.jsx("span",{className:"w-3 h-3 border border-slate-300 border-t-slate-500 rounded-full animate-spin"}):A.length>0?l.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-green-100 text-green-700",children:[A.length," model",A.length!==1?"s":""]}):l.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-slate-100 text-slate-400",children:"offline"})]})]}),h&&A.length>0&&l.jsx("div",{className:"border-t border-slate-100 bg-slate-50 py-1 max-h-48 overflow-y-auto",children:A.map(P=>l.jsxs("button",{type:"button",onClick:()=>E(P.id),className:"w-full px-4 py-1.5 text-xs text-left hover:bg-slate-100 transition-colors flex items-center justify-between gap-2",children:[l.jsx("span",{className:"text-slate-700 truncate",children:P.id}),l.jsx("span",{className:"text-[10px] text-slate-400 flex-shrink-0",children:P.server})]},`${P.server}-${P.id}`))}),h&&A.length===0&&l.jsx("div",{className:"px-4 py-2 text-xs text-slate-400",children:"No local server detected. Start LM Studio, Ollama, or similar."})]})]})}const Cz={"mission-scope-generator":"Mission Scope Generator","mission-scope-validator":"Mission Scope Validator","suggestion-ux-researcher":"UX Researcher","suggestion-product-manager":"Product Manager","suggestion-deployment-architect":"Deployment Architect","suggestion-technical-architect":"Technical Architect","suggestion-security-specialist":"Security Specialist","architecture-recommender":"Architecture Recommender","question-prefiller":"Question Prefiller","project-documentation-creator":"Documentation Creator","validator-documentation":"Documentation Validator","doc-distributor":"Doc Distributor","feature-context-generator":"Feature Context Generator","epic-story-decomposer":"Epic/Story Decomposer","story-scope-reviewer":"Story Scope Reviewer","project-context-extractor":"Project Context Extractor","agent-selector":"Agent Selector","context-writer-epic":"Context Writer (Epic)","context-reviewer-epic":"Context Reviewer (Epic)","context-writer-story":"Context Writer (Story)","context-reviewer-story":"Context Reviewer (Story)","doc-writer-epic":"Doc Writer (Epic)","doc-writer-story":"Doc Writer (Story)","story-doc-enricher":"Story Doc Enricher","validator-selector":"Validator Selector","validator-epic-solution-architect":"Solution Architect (Epic)","validator-epic-developer":"Developer (Epic)","validator-epic-security":"Security (Epic)","validator-epic-backend":"Backend (Epic)","validator-epic-frontend":"Frontend (Epic)","validator-epic-ux":"UX (Epic)","validator-story-developer":"Developer (Story)","validator-story-qa":"QA (Story)","validator-story-test-architect":"Test Architect (Story)","validator-story-solution-architect":"Solution Architect (Story)","validator-story-security":"Security (Story)","validator-story-backend":"Backend (Story)","validator-story-frontend":"Frontend (Story)","validator-story-ux":"UX (Story)","story-splitter":"Story Splitter"},Oz=["solution-architect","developer","security","devops","cloud","backend","database","api","frontend","ui","ux","mobile","data","qa","test-architect"],Az={generate:{label:"Generate",cls:"bg-blue-50 text-blue-700 border-blue-200"},validate:{label:"Validate",cls:"bg-amber-50 text-amber-700 border-amber-200"},refine:{label:"Refine",cls:"bg-orange-50 text-orange-700 border-orange-200"},input:{label:"User Input",cls:"bg-purple-50 text-purple-700 border-purple-200"},cross:{label:"Cross-validate",cls:"bg-indigo-50 text-indigo-700 border-indigo-200"},output:{label:"Write",cls:"bg-emerald-50 text-emerald-700 border-emerald-200"},read:{label:"Read",cls:"bg-sky-50 text-sky-700 border-sky-200"},process:{label:"Process",cls:"bg-slate-50 text-slate-600 border-slate-200"}},Ez={blue:{dot:"bg-blue-500",label:"text-blue-600"},purple:{dot:"bg-purple-500",label:"text-purple-600"},amber:{dot:"bg-amber-500",label:"text-amber-600"},green:{dot:"bg-green-500",label:"text-green-600"},emerald:{dot:"bg-emerald-500",label:"text-emerald-600"}},gS={amber:{border:"border-amber-400",bg:"bg-amber-50",hdr:"bg-amber-100",hdrBorder:"border-amber-300",text:"text-amber-800",subtext:"text-amber-600",line:"bg-amber-400",chip:"bg-amber-200 text-amber-900",arrow:"text-amber-500",condLine:"bg-amber-300"},indigo:{border:"border-indigo-400",bg:"bg-indigo-50",hdr:"bg-indigo-100",hdrBorder:"border-indigo-300",text:"text-indigo-800",subtext:"text-indigo-600",line:"bg-indigo-400",chip:"bg-indigo-200 text-indigo-900",arrow:"text-indigo-500",condLine:"bg-indigo-300"}};function Tz(e,t){var n,r,i,a,c,u,d,p,h,m,g,v,w,S,j,k,C,E,A,P;return[{id:"mission",label:"Mission & Scope",color:"blue",steps:[{type:"generate",label:"Generate mission statement & initial scope",model:(r=(n=e.stages)==null?void 0:n.suggestions)==null?void 0:r.model,stageKey:"suggestions",agent:"mission-scope-generator"},{type:"loop-group",loopParamType:"missionGen",loop:{max:(t==null?void 0:t.maxIterations)??3,threshold:(t==null?void 0:t.acceptanceThreshold)??95},steps:[{type:"validate",label:"Validate quality against acceptance threshold",model:(i=e.validation)==null?void 0:i.model,validationKey:"top",agent:"mission-scope-validator"},{type:"refine",label:"Refine based on validation issues",model:(c=(a=e.stages)==null?void 0:a.suggestions)==null?void 0:c.model,stageKey:"suggestions",sharedWith:"Mission generator",agent:"mission-scope-generator"}]}]},{id:"questionnaire",label:"Questionnaire",color:"purple",steps:[{type:"input",label:"5 project definition questions (user-provided or skipped)"},{type:"generate",label:"Auto-fill any skipped questions",model:(d=(u=e.stages)==null?void 0:u.suggestions)==null?void 0:d.model,stageKey:"suggestions",sharedWith:"Mission generator",agents:[{slug:"suggestion-product-manager",note:"fills Initial Scope"},{slug:"suggestion-ux-researcher",note:"fills Target Users"},{slug:"suggestion-deployment-architect",note:"fills Deployment Target"},{slug:"suggestion-technical-architect",note:"fills Technical Considerations"},{slug:"suggestion-security-specialist",note:"fills Security & Compliance"}]},{type:"generate",label:"Architecture recommendation",model:(h=(p=e.stages)==null?void 0:p["architecture-recommendation"])==null?void 0:h.model,stageKey:"architecture-recommendation",agent:"architecture-recommender"},{type:"generate",label:"Pre-fill answers from architecture analysis",model:(g=(m=e.stages)==null?void 0:m["question-prefilling"])==null?void 0:g.model,stageKey:"question-prefilling",agent:"question-prefiller"}]},{id:"documentation",label:"Documentation",color:"amber",steps:[{type:"generate",label:"Generate project documentation (doc.md)",model:(w=(v=e.stages)==null?void 0:v.documentation)==null?void 0:w.model,stageKey:"documentation",agent:"project-documentation-creator"},{type:"loop-group",loopParamType:"docContext",loop:{max:((S=e.validation)==null?void 0:S.maxIterations)??100,threshold:((j=e.validation)==null?void 0:j.acceptanceThreshold)??95},steps:[{type:"validate",label:"Validate documentation quality",model:((C=(k=e.validation)==null?void 0:k.documentation)==null?void 0:C.model)??((E=e.validation)==null?void 0:E.model),validationKey:"documentation",agent:"validator-documentation"},{type:"refine",label:"Improve documentation based on issues",model:(P=(A=e.stages)==null?void 0:A.documentation)==null?void 0:P.model,stageKey:"documentation",sharedWith:"Documentation generator",agent:"project-documentation-creator"}]}]},{id:"output",label:"Output",color:"emerald",steps:[{type:"output",label:".avc/project/doc.md written",files:[{name:"project/doc.md",direction:"out"}]}]}]}function Mz(e){var n,r,i,a,c,u,d,p,h,m,g,v,w,S,j,k,C,E,A,P,O,M,I,z,K,L,R,ee,J,ne,re,U;const t=e.defaultModel;return[{id:"scope",label:"Scope Collection",color:"blue",steps:[{type:"read",label:"Read project scope",files:[{name:"project/doc.md",direction:"in",note:".avc/project/doc.md — scope section extracted and sent to decomposer"}]},{type:"read",label:"Analyse existing Epics & Stories (deduplication baseline)"}]},{id:"decomposition",label:"Decomposition",color:"purple",steps:[{type:"generate",label:"Decompose scope into Epics and Stories",model:((r=(n=e.stages)==null?void 0:n.decomposition)==null?void 0:r.model)??t,stageKey:"decomposition",agent:"epic-story-decomposer",files:[{name:"project/doc.md",direction:"in",note:"scope text extracted from doc.md"}]},{type:"generate",label:"Detect semantic duplicates among new epics and against existing on-disk epics — merge overlapping items automatically",model:((a=(i=e.stages)==null?void 0:i.decomposition)==null?void 0:a.model)??t,stageKey:"decomposition",sharedWith:"Decomposer",agent:"duplicate-detector"},{type:"process",label:"Review each Epic's stories and split any that mix too many concerns (one LLM call per Epic in parallel)",model:((u=(c=e.stages)==null?void 0:c.decomposition)==null?void 0:u.model)??t,stageKey:"decomposition",sharedWith:"Decomposer",agent:"story-scope-reviewer"}]},{id:"context-generation",label:"Context Generation",color:"violet",steps:[{type:"generate",label:"Write + independently review each Epic/Story context.md (Write → Review → Refine, up to 3 rounds per item)",model:((p=(d=e.stages)==null?void 0:d["context-generation"])==null?void 0:p.model)??t,stageKey:"context-generation",agents:[{slug:"context-writer-epic",note:"writes epic context.md"},{slug:"context-reviewer-epic",note:"audits epic context against source JSON"},{slug:"context-writer-story",note:"writes story context.md"},{slug:"context-reviewer-story",note:"audits story context against source JSON"}],files:[{name:"{epic}/context.md",direction:"out"},{name:"{story}/context.md",direction:"out"}]}]},{id:"validation",label:"Micro-Check Validation (3-Tier)",color:"amber",steps:[{type:"generate",label:"Extract project context (once) — infers deployment type, tech stack, cloud/mobile presence to filter validators",model:((m=(h=e.stages)==null?void 0:h.validation)==null?void 0:m.model)??t,stageKey:"validation",agent:"project-context-extractor"},{type:"generate",label:"AI-select relevant validators per Epic / Story — excludes inapplicable roles (e.g. cloud if no cloud services). Runs once per Epic, once per Story.",model:((v=(g=e.stages)==null?void 0:g.validation)==null?void 0:v.model)??t,stageKey:"validation",sharedWith:"Validation",agent:"agent-selector"},{type:"validate",label:"Tier 1: Run domain checks per perspective — each check is 1-2 YES/NO LLM calls, run in parallel",model:((S=(w=e.stages)==null?void 0:w.validation)==null?void 0:S.model)??t,stageKey:"validation",sharedWith:"Validation",params:[{key:"concurrency",label:"Parallel checks",value:((k=(j=e.stages)==null?void 0:j.validation)==null?void 0:k.concurrency)??5,min:1,max:20},{key:"batchSize",label:"Checks per batch",value:((E=(C=e.stages)==null?void 0:C.validation)==null?void 0:E.batchSize)??8,min:1,max:20}],checks:Oz.flatMap(B=>[{scope:"epic",perspective:B,label:`${B} (Epic)`},{scope:"story",perspective:B,label:`${B} (Story)`}])},{type:"cross",label:"Tier 2: Cross-reference consistency checks — verify perspectives agree (e.g., security ↔ API, database ↔ architecture). Runs after Tier 1 using evidence from domain checks.",model:((P=(A=e.stages)==null?void 0:A.validation)==null?void 0:P.model)??t,stageKey:"validation",sharedWith:"Validation",checks:[{scope:"cross-refs",perspective:"epic",label:"Epic Cross-Refs"},{scope:"cross-refs",perspective:"story",label:"Story Cross-Refs"}]},{type:"refine",label:"Tier 3: Deterministic scoring + auto-fix critical/major failures (atomic per-check fixes with regression revert)",model:((M=(O=e.stages)==null?void 0:O.validation)==null?void 0:M.model)??t,stageKey:"validation",sharedWith:"Validation",params:[{key:"maxFixAttempts",label:"Max fix attempts",value:((z=(I=e.stages)==null?void 0:I.validation)==null?void 0:z.maxFixAttempts)??3,min:0,max:10}]},{type:"process",label:"If story still below threshold with 15+ ACs and scope issues detected: split into 2-3 focused stories, replace in epic, and re-validate each split story",model:((L=(K=e.stages)==null?void 0:K.validation)==null?void 0:L.model)??t,stageKey:"validation",sharedWith:"Validation",agent:"story-splitter"}]},{id:"output",label:"Documentation & Output",color:"emerald",steps:[{type:"process",label:"Renumber hierarchy IDs + write context.md files with final IDs"},{type:"generate",label:"Generate narrative doc.md for each Epic from its canonical context.md",model:((ee=(R=e.stages)==null?void 0:R["doc-generation"])==null?void 0:ee.model)??t,stageKey:"doc-generation",agent:"doc-writer-epic",files:[{name:"project/doc.md",direction:"in",note:"project context"},{name:"{epic}/context.md",direction:"in",note:"canonical spec — single source of truth"},{name:"{epic}/doc.md",direction:"out",note:"narrative documentation"}]},{type:"generate",label:"Generate narrative doc.md for each Story from its canonical context.md",model:((ne=(J=e.stages)==null?void 0:J["doc-generation"])==null?void 0:ne.model)??t,stageKey:"doc-generation",agent:"doc-writer-story",files:[{name:"{epic}/context.md",direction:"in",note:"parent epic context"},{name:"{story}/context.md",direction:"in",note:"canonical spec — single source of truth"},{name:"{story}/doc.md",direction:"out",note:"narrative documentation"}]},{type:"generate",label:"Enrich Story docs with missing implementation detail — API contracts, error tables, DB fields, business rules. Runs once per Story.",model:((U=(re=e.stages)==null?void 0:re.enrichment)==null?void 0:U.model)??t,stageKey:"enrichment",agent:"story-doc-enricher",files:[{name:"{story}/doc.md",direction:"inout",note:"read then overwritten with enriched content"}]},{type:"output",label:"Write Epic & Story work.json files",files:[{name:"{epic}/work.json",direction:"out"},{name:"{story}/work.json",direction:"out"}]}]}]}function _z(e){var t,n,r,i;return[{id:"decompose",label:"Decompose Story",color:"blue",steps:[{type:"read",label:"Read story, epic, and project context"},{type:"generate",label:"Decompose story into tasks and subtasks",model:(n=(t=e==null?void 0:e.stages)==null?void 0:t.decomposition)==null?void 0:n.model,stageKey:"decomposition",agent:"task-subtask-decomposer"},{type:"process",label:"Validate task/subtask structure and IDs (deterministic)"}]},{id:"context-gen",label:"Task Documentation",color:"green",steps:[{type:"generate",label:"Generate context.md for each task and subtask",model:(i=(r=e==null?void 0:e.stages)==null?void 0:r["context-generation"])==null?void 0:i.model,stageKey:"context-generation"},{type:"output",label:"Write work.json, context.md, and doc.md files"}]}]}function Iz(e){var t,n,r,i,a,c;return[{id:"implement",label:"Code Generation",color:"blue",steps:[{type:"read",label:"Create git worktree and read documentation chain"},{type:"generate",label:"AI generates code following traceability rules",model:(n=(t=e==null?void 0:e.stages)==null?void 0:t["code-generation"])==null?void 0:n.model,stageKey:"code-generation",agent:"code-implementer"}]},{id:"validate",label:"Code Validation",color:"amber",steps:[{type:"validate",label:"Verify code against quality and traceability checks",model:(i=(r=e==null?void 0:e.stages)==null?void 0:r["code-validation"])==null?void 0:i.model,stageKey:"code-validation",agent:"code-validator"},{type:"generate",label:"Fix violations and regenerate (if needed, up to 3 iterations)",model:(c=(a=e==null?void 0:e.stages)==null?void 0:a["code-generation"])==null?void 0:c.model,stageKey:"code-generation"}]},{id:"test-merge",label:"Test & Merge",color:"green",steps:[{type:"validate",label:"Run tests in worktree"},{type:"output",label:"Commit, merge to main, update function registry"}]}]}const Dz={"sponsor-call":Tz,"sprint-planning":e=>Mz(e),seed:e=>_z(e),run:e=>Iz(e)};function Rz(e,t){var n;return e?((n=t.find(r=>r.modelId===e))==null?void 0:n.displayName)||e:"—"}function Lz({value:e,models:t,onChange:n}){const r=[...new Set(t.map(i=>i.provider))];return l.jsxs("select",{value:e||"",onChange:i=>n(i.target.value),onClick:i=>i.stopPropagation(),className:"text-xs border border-slate-300 rounded px-1.5 py-0.5 bg-white text-slate-800 focus:outline-none focus:ring-1 focus:ring-blue-400 max-w-[200px]",children:[!e&&l.jsx("option",{value:"",children:"— select —"}),r.map(i=>l.jsx("optgroup",{label:i.charAt(0).toUpperCase()+i.slice(1),children:t.filter(a=>a.provider===i).map(a=>l.jsx("option",{value:a.modelId,children:a.displayName||a.modelId},a.modelId))},i))]})}function $z({slug:e,onOpen:t}){const n=Cz[e]||e;return l.jsxs("button",{type:"button",onClick:()=>t(e),className:"inline-flex items-center gap-1 text-[10px] font-medium text-blue-600 hover:text-blue-800 bg-blue-50 hover:bg-blue-100 border border-blue-200 hover:border-blue-300 px-1.5 py-0.5 rounded transition-colors whitespace-nowrap",title:`Edit ${n} agent instructions`,children:[n,l.jsx(mc,{className:"w-2.5 h-2.5 flex-shrink-0"})]})}function zz({step:e,onOpenAgent:t}){const n=e.agents?e.agents.map(r=>typeof r=="string"?{slug:r,note:null}:r):e.agent?[{slug:e.agent,note:null}]:[];return n.length===0?null:l.jsxs("div",{className:"mt-1.5",children:[l.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Agent(s)"}),l.jsx("div",{className:"mt-1 flex flex-col gap-1",children:n.map(({slug:r,note:i})=>l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx($z,{slug:r,onOpen:t}),i&&l.jsx("span",{className:"text-[10px] text-slate-400 italic",children:i})]},r))})]})}function Fz({step:e,onOpenCheck:t}){return!e.checks||e.checks.length===0?null:l.jsxs("div",{className:"mt-1.5",children:[l.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Check definitions"}),l.jsx("div",{className:"mt-1 max-h-28 overflow-y-auto border border-slate-100 rounded-md px-1.5 py-1 flex flex-wrap gap-1",children:e.checks.map(n=>l.jsxs("button",{type:"button",onClick:()=>t({scope:n.scope,perspective:n.perspective}),className:"inline-flex items-center gap-1 text-[10px] font-medium text-amber-700 hover:text-amber-900 bg-amber-50 hover:bg-amber-100 border border-amber-200 hover:border-amber-300 px-1.5 py-0.5 rounded transition-colors whitespace-nowrap",title:`Edit ${n.scope}/${n.perspective}.json`,children:[n.label,l.jsx(mc,{className:"w-2.5 h-2.5 flex-shrink-0"})]},`${n.scope}/${n.perspective}`))})]})}function Bz({files:e,className:t=""}){return!e||e.length===0?null:l.jsx("div",{className:`flex items-center gap-1 flex-wrap ${t}`,children:e.map((n,r)=>{const i=n.direction==="in",a=n.direction==="inout",c=a?"bg-purple-50 text-purple-700 border-purple-200":i?"bg-sky-50 text-sky-700 border-sky-200":"bg-emerald-50 text-emerald-700 border-emerald-200",u=a?"↕":i?"←":"→";return l.jsxs("span",{className:`inline-flex items-center gap-0.5 text-[10px] font-mono font-medium px-1.5 py-0.5 rounded border whitespace-nowrap ${c}`,title:n.note,children:[l.jsx("span",{className:"font-sans mr-0.5",children:u}),n.name]},r)})})}function Vz({type:e}){const t=Az[e]||{label:e,cls:"bg-slate-50 text-slate-600 border-slate-200"};return l.jsx("span",{className:`inline-block text-xs font-medium px-2 py-0.5 rounded border whitespace-nowrap ${t.cls}`,children:t.label})}function mA({step:e,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onOpenAgent:c,onOpenCheck:u}){const d=!["input","output","read","process"].includes(e.type),p=n&&!e.sharedWith&&(e.stageKey||e.validationKey);return l.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg px-3 py-2.5 shadow-sm",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-shrink-0",children:l.jsx(Vz,{type:e.type})}),l.jsx(Bz,{files:e.files,className:"flex-1 min-w-0"}),d&&(e.sharedWith?l.jsxs("p",{className:"text-[10px] text-slate-400 italic flex-shrink-0",children:["↑ ",e.sharedWith]}):p?l.jsx(Lz,{value:e.model,models:t,onChange:h=>{e.stageKey?r(e.stageKey,h):i(e.validationKey,h)}}):l.jsx("p",{className:"text-[10px] text-slate-400 flex-shrink-0",children:e.note?e.note:Rz(e.model,t)}))]}),l.jsx("p",{className:"text-xs text-slate-700 leading-snug text-left mt-2 pl-1",children:e.label}),l.jsxs("div",{className:"pl-1",children:[l.jsx(zz,{step:e,onOpenAgent:c}),u&&l.jsx(Fz,{step:e,onOpenCheck:u})]}),e.params&&e.params.length>0&&l.jsx("div",{className:"mt-2 pl-1 flex items-center gap-3 flex-wrap",children:e.params.map(h=>l.jsxs("label",{className:"flex items-center gap-1.5 text-[11px] text-slate-600",children:[l.jsxs("span",{className:"font-medium",children:[h.label,":"]}),n&&e.stageKey&&a?l.jsx("input",{type:"number",min:h.min,max:h.max,value:h.value,onChange:m=>a(e.stageKey,h.key,Number(m.target.value)),onClick:m=>m.stopPropagation(),className:"w-12 text-xs border border-slate-300 rounded px-1.5 py-0.5 bg-white text-slate-800 text-center focus:outline-none focus:ring-1 focus:ring-blue-400"}):l.jsx("span",{className:"font-mono",children:h.value})]},h.key))})]})}function Uz({group:e,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onLoopParamChange:c,onOpenAgent:u,onOpenCheck:d}){const{loop:p,steps:h}=e,g=h.some(S=>S.type==="cross")?gS.indigo:gS.amber,v=h.length>1,w=n&&e.loopParamType&&!e.loopParamReadOnly;return l.jsxs("div",{className:`rounded-xl border-2 border-dashed ${g.border} overflow-hidden`,children:[l.jsxs("div",{className:`${g.hdr} border-b-2 border-dashed ${g.hdrBorder} px-3 py-2 flex items-center gap-2 flex-wrap`,children:[l.jsx("span",{className:`text-xl font-black leading-none ${g.text}`,children:"↺"}),l.jsx("span",{className:`text-xs font-bold ${g.text} tracking-wide`,children:"Iteration Loop"}),l.jsxs("div",{className:"ml-auto flex items-center gap-1.5 flex-wrap",children:[p.max!=null&&(w?l.jsxs("label",{className:`text-xs font-semibold ${g.chip} px-2 py-0.5 rounded-full flex items-center gap-1`,children:["up to",l.jsx("input",{type:"number",min:"1",max:"200",value:p.max,onChange:S=>c(e.loopParamType,"maxIterations",Number(S.target.value)),onClick:S=>S.stopPropagation(),className:"w-10 bg-transparent border-b border-current text-center focus:outline-none"}),"iter"]}):l.jsx("span",{className:`text-xs font-semibold ${g.chip} px-2 py-0.5 rounded-full`,children:e.loopParamReadOnly?`↑ ${p.max} iter`:`up to ${p.max} iter`})),p.threshold!=null&&(w?l.jsxs("label",{className:`text-xs font-semibold ${g.chip} px-2 py-0.5 rounded-full flex items-center gap-1`,children:["≥",l.jsx("input",{type:"number",min:"0",max:"100",value:p.threshold,onChange:S=>c(e.loopParamType,"acceptanceThreshold",Number(S.target.value)),onClick:S=>S.stopPropagation(),className:"w-10 bg-transparent border-b border-current text-center focus:outline-none"}),"/100"]}):l.jsx("span",{className:`text-xs font-semibold ${g.chip} px-2 py-0.5 rounded-full`,children:e.loopParamReadOnly?`↑ ≥${p.threshold}/100`:`≥${p.threshold}/100`}))]})]}),l.jsxs("div",{className:`${g.bg} p-3 flex gap-2 items-stretch`,children:[l.jsx("div",{className:"flex-1 flex flex-col",children:h.map((S,j)=>l.jsxs("div",{children:[l.jsx(mA,{step:S,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onOpenAgent:u,onOpenCheck:d}),j<h.length-1&&l.jsxs("div",{className:"flex items-center gap-2 my-1.5 ml-3",children:[l.jsx("div",{className:`w-px h-4 ${g.condLine}`}),l.jsx("span",{className:`text-xs ${g.subtext} italic`,children:"score < threshold → retry"})]})]},j))}),v&&l.jsxs("div",{className:`flex flex-col items-center flex-shrink-0 ${g.arrow}`,style:{width:22},children:[l.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:l.jsx("path",{d:"M2 7 L7 1 L12 7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}),l.jsx("div",{className:`w-0.5 flex-1 ${g.line} my-1 rounded-full`,style:{minHeight:36}}),l.jsx("span",{className:`text-[9px] font-bold tracking-widest uppercase ${g.text} opacity-70`,style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:"retry"})]})]})]})}function Wz({label:e,color:t}){const n=Ez[t]||{dot:"bg-slate-400",label:"text-slate-600"};return l.jsxs("div",{className:"flex items-center gap-2 mt-5 mb-2",children:[l.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${n.dot}`}),l.jsx("span",{className:`text-xs font-semibold uppercase tracking-wide ${n.label}`,children:e})]})}function qz(){return l.jsx("div",{className:"w-px h-4 bg-slate-200 ml-4"})}function Sv({ceremony:e,allCeremonies:t,apiKeys:n,models:r=[],missionGenValidation:i=null,onClose:a,onSave:c,onCeremoniesUpdated:u,readOnly:d=!1}){const[p,h]=b.useState(()=>JSON.parse(JSON.stringify(e||{}))),[m,g]=b.useState(()=>JSON.parse(JSON.stringify(i||{maxIterations:3,acceptanceThreshold:95}))),[v,w]=b.useState(!1),[S,j]=b.useState(null),[k,C]=b.useState(null),[E,A]=b.useState(null),P=e!=null&&e.name?Dz[e.name]:null,O=P?P(p,m):null,M=!d&&!!c,I=(J,ne)=>{const re=r.find(U=>U.modelId===ne);h(U=>{var B,G,q;return{...U,stages:{...U.stages,[J]:{...(B=U.stages)==null?void 0:B[J],model:ne,provider:(re==null?void 0:re.provider)||((q=(G=U.stages)==null?void 0:G[J])==null?void 0:q.provider)||""}}}})},z=(J,ne)=>{const re=r.find(U=>U.modelId===ne);h(J==="top"?U=>{var B;return{...U,validation:{...U.validation,model:ne,provider:(re==null?void 0:re.provider)||((B=U.validation)==null?void 0:B.provider)||""}}}:U=>{var B,G,q;return{...U,validation:{...U.validation,[J]:{...(B=U.validation)==null?void 0:B[J],model:ne,provider:(re==null?void 0:re.provider)||((q=(G=U.validation)==null?void 0:G[J])==null?void 0:q.provider)||""}}}})},K=(J,ne,re)=>{h(U=>{var B;return{...U,stages:{...U.stages,[J]:{...(B=U.stages)==null?void 0:B[J],[ne]:re}}}})},L=(J,ne,re)=>{J==="missionGen"?g(U=>({...U,[ne]:re})):J==="docContext"&&h(U=>({...U,validation:{...U.validation,[ne]:re}}))},R=async()=>{w(!0),j(null);try{await c(p,m),a()}catch{j("Failed to save. Please try again.")}finally{w(!1)}},ee=()=>{h(JSON.parse(JSON.stringify(e||{}))),g(JSON.parse(JSON.stringify(i||{maxIterations:3,acceptanceThreshold:95}))),a()};return l.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:M?void 0:a}),l.jsxs("div",{className:"relative bg-slate-50 rounded-2xl shadow-2xl w-full max-w-xl mx-4 flex flex-col",style:{height:"85vh"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 pt-4 pb-3 border-b border-slate-200 flex-shrink-0 bg-white rounded-t-2xl",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-semibold text-slate-900",children:M?"Configure Models":"Ceremony Workflow"}),l.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:(e==null?void 0:e.displayName)||(e==null?void 0:e.name)||"Unknown ceremony"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[M&&t&&l.jsx(Pz,{ceremonyName:e==null?void 0:e.name,ceremonies:t.map(J=>J.name===(e==null?void 0:e.name)?p:J),apiKeys:n,onApplied:J=>{const ne=J.find(re=>re.name===(e==null?void 0:e.name));ne&&h(JSON.parse(JSON.stringify(ne))),u==null||u(J)}}),l.jsx("button",{type:"button",onClick:M?ee:a,className:"text-slate-400 hover:text-slate-600 transition-colors",children:l.jsx(cn,{className:"w-4 h-4"})})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-5 pb-5",children:O===null?l.jsx("div",{className:"flex items-center justify-center h-32",children:l.jsx("p",{className:"text-sm text-slate-400",children:"Workflow diagram coming soon for this ceremony."})}):O.map((J,ne)=>l.jsxs("div",{children:[l.jsx(Wz,{label:J.label,color:J.color}),J.steps.map((re,U)=>l.jsxs("div",{children:[re.type==="loop-group"?l.jsx(Uz,{group:re,models:r,editable:M,onStageModelChange:I,onValidationModelChange:z,onStageParamChange:K,onLoopParamChange:L,onOpenAgent:C,onOpenCheck:A}):l.jsx(mA,{step:re,models:r,editable:M,onStageModelChange:I,onValidationModelChange:z,onStageParamChange:K,onOpenAgent:C,onOpenCheck:A}),U<J.steps.length-1&&l.jsx(qz,{})]},U)),ne<O.length-1&&l.jsx("div",{className:"mt-3 border-t border-dashed border-slate-200"})]},J.id))}),M&&l.jsxs("div",{className:"flex-shrink-0 border-t border-slate-200 bg-white rounded-b-2xl px-5 py-3 flex items-center justify-between",children:[l.jsx("div",{children:S&&l.jsx("p",{className:"text-xs text-red-600",children:S})}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:ee,className:"px-3 py-1.5 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:R,disabled:v,className:"px-4 py-1.5 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors disabled:opacity-40 flex items-center gap-2",children:v?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-3.5 h-3.5 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving…"]}):"Save Changes"})]})]})]}),k&&l.jsx(pA,{agentName:`${k}.md`,onClose:()=>C(null)}),E&&l.jsx(hA,{scope:E.scope,perspective:E.perspective,onClose:()=>A(null)})]})}const Kz=[{id:"local-mvp",icon:"💻",title:"Local MVP First",subtitle:"Start on your machine, migrate later",bullets:["Zero cloud costs during development","Fast iteration — no deployment delays","SQLite or local PostgreSQL/MongoDB","Docker Compose for production parity"],color:"blue"},{id:"cloud",icon:"☁️",title:"Cloud Deployment",subtitle:"Production-ready from day one",bullets:["Managed infrastructure (AWS / Azure / GCP)","Auto-scaling and high availability","Managed databases with backups","CI/CD pipeline recommendations","Monthly cost estimates included"],color:"purple"}];function Hz({onNext:e}){const{strategy:t,setStrategy:n}=or(),r={blue:{border:"border-blue-500",bg:"bg-blue-50",icon:"text-blue-600",bullet:"bg-blue-500",btn:"bg-blue-600 hover:bg-blue-700"},purple:{border:"border-purple-500",bg:"bg-purple-50",icon:"text-purple-600",bullet:"bg-purple-500",btn:"bg-purple-600 hover:bg-purple-700"}},i=a=>{n(a)};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Deployment Strategy"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Choose how you want to deploy your project. This shapes architecture and technology recommendations."})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:Kz.map(a=>{const c=r[a.color],u=t===a.id;return l.jsxs("button",{onClick:()=>i(a.id),className:`text-left rounded-xl border-2 p-5 transition-all ${u?`${c.border} ${c.bg}`:"border-slate-200 hover:border-slate-300 bg-white"}`,children:[l.jsx("div",{className:`text-3xl mb-3 ${c.icon}`,children:a.icon}),l.jsx("div",{className:"font-semibold text-slate-900 text-base",children:a.title}),l.jsx("div",{className:"text-xs text-slate-500 mb-3",children:a.subtitle}),l.jsx("ul",{className:"space-y-1",children:a.bullets.map((d,p)=>l.jsxs("li",{className:"flex items-start gap-2 text-xs text-slate-600",children:[l.jsx("span",{className:`mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 ${c.bullet}`}),d]},p))})]},a.id)})}),l.jsxs("div",{className:"flex items-start gap-2 px-1 py-2 text-xs text-slate-400",children:[l.jsx(zx,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 text-slate-300"}),l.jsx("p",{children:"Technologies listed (e.g. SQLite, MongoDB) are illustrative examples. The ceremony tailors all recommendations to your actual requirements — your project may end up using a vector database, a search engine, no database at all, or something else entirely."})]}),l.jsxs("div",{className:"flex items-center justify-end gap-3 pt-2",children:[l.jsx("button",{type:"button",onClick:e,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:"Skip — let the model decide"}),l.jsx("button",{type:"button",onClick:e,disabled:!t,className:"px-5 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-slate-700 transition-colors",children:"Continue"})]})]})}function Mm(e=""){return e==="claude"?"anthropic":e}const Gz={claude:"Anthropic API Key (ANTHROPIC_API_KEY)",anthropic:"Anthropic API Key (ANTHROPIC_API_KEY)",gemini:"Google Gemini API Key (GEMINI_API_KEY)",openai:"OpenAI API Key (OPENAI_API_KEY)",xiaomi:"Xiaomi MiMo API Key (XIAOMI_API_KEY)"};function Yz({issues:e,onClose:t,onRefineWithIssues:n}){const[r,i]=b.useState(new Set),a={critical:"text-red-600",major:"text-orange-600",minor:"text-amber-600"},c={critical:"bg-red-50 border-red-100",major:"bg-orange-50 border-orange-100",minor:"bg-amber-50 border-amber-100"};function u(d){i(p=>{const h=new Set(p);return h.has(d)?h.delete(d):h.add(d),h})}return l.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/40 backdrop-blur-sm p-4",onClick:d=>{d.target===d.currentTarget&&t()},children:l.jsxs("div",{className:"w-full max-w-lg bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden max-h-[70vh]",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Validation Issues"}),l.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:[e.length," issue",e.length!==1?"s":""," found during validation"]})]}),l.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),l.jsx("ul",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-2",children:e.map((d,p)=>l.jsxs("li",{onClick:()=>u(p),className:`rounded-lg border px-3 py-2.5 cursor-pointer flex items-start gap-2.5 ${r.has(p)?"ring-2 ring-blue-500":""} ${c[d.severity]??"bg-slate-50 border-slate-100"}`,children:[l.jsx("input",{type:"checkbox",checked:r.has(p),onChange:()=>u(p),onClick:h=>h.stopPropagation(),className:"mt-0.5 flex-shrink-0 accent-blue-600"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"flex items-center gap-2 mb-1",children:l.jsx("span",{className:`text-xs font-semibold uppercase ${a[d.severity]??"text-slate-600"}`,children:d.severity})}),l.jsx("p",{className:"text-sm text-slate-800 leading-snug",children:d.description}),d.suggestion&&l.jsxs("p",{className:"text-xs text-slate-500 mt-1 leading-snug",children:[l.jsx("span",{className:"font-medium",children:"Suggestion:"})," ",d.suggestion]})]})]},p))}),l.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-between gap-2",children:[l.jsx("button",{type:"button",onClick:()=>{n(e.filter((d,p)=>r.has(p))),t()},disabled:r.size===0,className:"px-4 py-1.5 text-xs text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-40",children:"Refine with selected"}),l.jsx("button",{type:"button",onClick:t,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Close"})]})]})})}function Xz({onSubmit:e,onClose:t}){const[n,r]=b.useState("");return l.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/40 backdrop-blur-sm p-4",onClick:i=>{i.target===i.currentTarget&&t()},children:l.jsxs("div",{className:"w-full max-w-md bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Refine Mission & Scope"}),l.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe what you'd like to change or improve."})]}),l.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),l.jsx("div",{className:"px-5 py-4 flex flex-col gap-3",children:l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What would you like to change or improve?"}),l.jsx("textarea",{value:n,onChange:i=>r(i.target.value),rows:4,placeholder:"E.g. Focus more on enterprise teams, make the mission mention mobile specifically…",autoFocus:!0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"})]})}),l.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:t,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:()=>e(n),disabled:!n.trim(),className:"px-4 py-1.5 text-xs text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-40",children:"Refine"})]})]})})}function Qz({onUse:e,onClose:t,onOpenSettings:n}){var ie,ue;const[r,i]=b.useState([]),[a,c]=b.useState(""),[u,d]=b.useState(""),[p,h]=b.useState(""),[m,g]=b.useState(!1),[v,w]=b.useState(null),[S,j]=b.useState(""),[k,C]=b.useState(!1),[E,A]=b.useState(!1),{missionProgressLog:P,clearMissionProgress:O}=or(),M=P[P.length-1]??null,[I,z]=b.useState(null);b.useEffect(()=>{Promise.all([fs(),On()]).then(([te,se])=>{i(te),z(se.apiKeys??{});const pe=te.filter($e=>{var Re,Ye;return(Ye=(Re=se.apiKeys)==null?void 0:Re[Mm($e.provider)])==null?void 0:Ye.isSet}),Ne=$e=>/pro|opus|sonnet/i.test($e),Y=$e=>/flash|lite|haiku|mini/i.test($e),me=pe.find($e=>Ne($e.modelId))||pe[0],Ae=me?me.modelId:te.length>0?te[0].modelId:"";c(Ae);const ae=pe.find($e=>Y($e.modelId)&&$e.modelId!==Ae)||pe.find($e=>$e.modelId!==Ae)||me;d(ae?ae.modelId:Ae)}).catch(()=>j("Failed to load available models."))},[]);function K(){Promise.all([On(),fs()]).then(([te,se])=>{z(te.apiKeys??{}),i(se)}).catch(()=>{})}b.useEffect(()=>(document.addEventListener("avc:settings-saved",K),()=>document.removeEventListener("avc:settings-saved",K)),[]);const L=r.find(te=>te.modelId===a),R=r.find(te=>te.modelId===u),ee=(()=>{var se,pe;if(!I)return[];const te=new Set;return L&&!((se=I[Mm(L.provider)])!=null&&se.isSet)&&te.add(L.provider),R&&!((pe=I[Mm(R.provider)])!=null&&pe.isSet)&&te.add(R.provider),[...te]})();async function J(){if(!(!p.trim()||!a||!L||!u||!R)){g(!0),j(""),w(null),C(!1),O();try{const te=await eD(p.trim(),a,L.provider,u,R.provider);w(te)}catch(te){j(te.message||"Generation failed. Please try again.")}finally{g(!1)}}}async function ne(te){const{missionStatement:se,initialScope:pe}=v;A(!1),w(null),g(!0),j(""),C(!1),O();try{const Ne=await tD(se,pe,te,a,L.provider,u,R.provider);w(Ne)}catch(Ne){j(Ne.message||"Refinement failed. Please try again.")}finally{g(!1)}}function re(te){C(!1);const se=`Fix the following validation issues:
|
|
311
|
+
`+te.map(pe=>`- [${pe.severity.toUpperCase()}] ${pe.field}: ${pe.description} → ${pe.suggestion}`).join(`
|
|
312
|
+
`);ne(se)}function U(){v&&e(v.missionStatement,v.initialScope)}function B(){w(null),j(""),C(!1)}const G=[...new Set(r.map(te=>te.provider))],q=(v==null?void 0:v.validationScore)!=null&&v.validationScore>=75,_=!m&&p.trim().length>0&&!!a&&!!u&&ee.length===0;function V({label:te,value:se,onChange:pe}){const Ne=r.find(Y=>Y.modelId===se);return l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:te}),l.jsxs("select",{value:se,onChange:Y=>pe(Y.target.value),disabled:m||r.length===0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60 bg-white",children:[r.length===0&&l.jsx("option",{value:"",children:"Loading…"}),G.map(Y=>l.jsx("optgroup",{label:Y.charAt(0).toUpperCase()+Y.slice(1),children:r.filter(me=>me.provider===Y).map(me=>l.jsxs("option",{value:me.modelId,children:[me.displayName,me.hasApiKey?"":" (no key)"]},me.modelId))},Y))]}),Ne&&!Ne.hasApiKey&&l.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",l.jsx("code",{children:".env"})]})]})}return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:te=>{te.target===te.currentTarget&&t()},children:l.jsxs("div",{className:"w-full max-w-5xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden h-[540px]",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"✨ Ask a Model"}),l.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe your idea — an LLM generates and validates your mission & scope."})]}),l.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),l.jsxs("div",{className:"flex flex-1 min-h-0",children:[l.jsxs("div",{className:"w-2/5 min-w-0 border-r border-slate-100 flex flex-col px-4 py-4 gap-3",children:[l.jsx(V,{label:"Generator Model",value:a,onChange:c}),l.jsx(V,{label:"Validator Model",value:u,onChange:d}),ee.length>0&&l.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(na,{className:"w-3.5 h-3.5 text-amber-500 flex-shrink-0 mt-0.5"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold text-amber-900",children:"API Key Missing"}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:ee.map(te=>l.jsxs("li",{className:"flex items-center gap-1.5 text-xs text-amber-800",children:[l.jsx("span",{className:"w-1 h-1 rounded-full bg-amber-400 flex-shrink-0"}),Gz[te]||te]},te))})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[n&&l.jsxs("button",{type:"button",onClick:()=>n(),className:"flex items-center gap-1 text-xs font-medium bg-slate-900 text-white px-2.5 py-1 rounded-md hover:bg-slate-700 transition-colors",children:[l.jsx(lo,{className:"w-3 h-3"}),"Settings"]}),l.jsx("button",{type:"button",onClick:K,className:"text-xs text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What are you building?"}),l.jsx("textarea",{value:p,onChange:te=>h(te.target.value),rows:4,placeholder:"E.g. A recipe sharing app for home cooks…",disabled:m,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none disabled:opacity-60"})]}),S&&l.jsx("p",{className:"text-xs text-red-600 bg-red-50 rounded-md px-2 py-1.5",children:S}),(v==null?void 0:v.validationScore)!=null&&l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs("span",{className:`inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full ${q?"bg-green-50 text-green-700 border border-green-200":"bg-amber-50 text-amber-700 border border-amber-200"}`,children:[q?"✓":"⚠"," ",v.validationScore,"/100 · ",v.iterations," iter",v.iterations!==1?"s":""]}),((ie=v.issues)==null?void 0:ie.length)>0&&l.jsxs("button",{type:"button",onClick:()=>C(!0),className:"text-xs text-slate-400 hover:text-slate-600 underline underline-offset-2 transition-colors",children:["Issues (",v.issues.length,")"]})]}),l.jsx("div",{className:"flex-1"}),l.jsxs("div",{className:"flex flex-col gap-2",children:[v?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:U,className:"w-full px-3 py-2 bg-slate-900 text-white text-xs font-medium rounded-lg hover:bg-slate-700 transition-colors",children:"Use This"}),l.jsx("button",{type:"button",onClick:()=>A(!0),className:"w-full px-3 py-2 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Refine"}),l.jsx("button",{type:"button",onClick:B,className:"w-full px-3 py-2 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Try Again"})]}):l.jsx("button",{type:"button",onClick:J,disabled:!_,className:"w-full px-3 py-2 bg-blue-600 text-white text-xs font-medium rounded-lg disabled:opacity-40 hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",children:m?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Generating…"]}):"Generate"}),l.jsx("button",{type:"button",onClick:t,className:"w-full px-3 py-1.5 text-xs text-slate-400 hover:text-slate-600 transition-colors",children:"Cancel"})]})]}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[m&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-8 text-center",children:[l.jsx("span",{className:"w-8 h-8 border-3 border-blue-200 border-t-blue-600 rounded-full animate-spin",style:{borderWidth:3}}),l.jsx("p",{className:"text-sm font-medium text-slate-700",children:M?M.message:"Starting…"}),l.jsx("p",{className:"text-xs text-slate-400",children:"This may take a moment while the models validate and refine the output."})]}),!m&&!v&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 px-8 text-center text-slate-300",children:[l.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})}),l.jsx("p",{className:"text-sm font-medium text-slate-400",children:"Generated mission & scope will appear here"}),l.jsx("p",{className:"text-xs text-slate-300",children:"Fill in the form and click Generate"})]}),!m&&v&&l.jsxs("div",{className:"flex-1 flex flex-col gap-4 px-5 py-4 overflow-y-auto",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Mission Statement"}),l.jsx("p",{className:"text-sm text-slate-800 bg-slate-50 rounded-lg px-3 py-2.5 leading-relaxed",children:v.missionStatement})]}),l.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[l.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Initial Scope"}),l.jsx("div",{className:"flex-1 text-sm text-slate-800 bg-slate-50 rounded-lg px-3 py-2.5 leading-relaxed overflow-y-auto min-h-0",children:v.initialScope.split(`
|
|
313
|
+
`).map((te,se)=>l.jsx("p",{className:"mb-1 last:mb-0",children:te},se))})]})]})]})]})]})}),k&&((ue=v==null?void 0:v.issues)==null?void 0:ue.length)>0&&l.jsx(Yz,{issues:v.issues,onClose:()=>C(!1),onRefineWithIssues:re}),E&&v&&l.jsx(Xz,{onSubmit:ne,onClose:()=>A(!1)})]})}function Jz({onNext:e,onBack:t,analyzing:n,onOpenSettings:r}){const{mission:i,setMission:a,initialScope:c,setInitialScope:u}=or(),[d,p]=b.useState(!1),h=i.trim().length>0&&c.trim().length>0;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Mission & Scope"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Describe what your project does and what it will deliver in the first version."})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Mission Statement ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("button",{type:"button",onClick:()=>p(!0),className:"text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1 transition-colors",children:"✨ Ask a Model"})]}),l.jsx("p",{className:"text-xs text-slate-400 mb-2",children:'A concise statement describing the core purpose and value proposition. Example: "Enable small businesses to manage inventory through an intuitive mobile-first platform."'}),l.jsx("textarea",{value:i,onChange:m=>a(m.target.value),rows:3,placeholder:"Enter your mission statement...",className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"}),!i.trim()&&l.jsx("p",{className:"text-xs text-red-500 mt-1",children:"Mission statement is required."})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:["Initial Scope ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("p",{className:"text-xs text-slate-400 mb-2",children:'Describe key features, main workflows, and core functionality for the first version. Example: "Users can create tasks, assign them to team members, track progress, and set deadlines."'}),l.jsx("textarea",{value:c,onChange:m=>u(m.target.value),rows:4,placeholder:"Describe the initial scope and features...",className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"})]})]}),l.jsxs("div",{className:"flex items-center justify-between pt-2",children:[l.jsx("button",{type:"button",onClick:t,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"← Back"}),l.jsx("button",{onClick:e,disabled:!h||n,className:"px-5 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-slate-700 transition-colors flex items-center gap-2",children:n?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Analysing…"]}):"Continue"})]}),d&&l.jsx(Qz,{onUse:(m,g)=>{a(m),u(g),p(!1)},onClose:()=>p(!1),onOpenSettings:r})]})}function Zz(e){if(!e)return null;const n=(String(e).toLowerCase().match(/\d+/g)||[]).map(Number).filter(i=>i>0),r=n.length?n.reduce((i,a)=>i+a,0)/n.length:0;return r===0?{symbols:"Free",color:"text-green-600"}:r<=50?{symbols:"$",color:"text-green-600"}:r<=150?{symbols:"$$",color:"text-amber-500"}:r<=350?{symbols:"$$$",color:"text-orange-500"}:{symbols:"$$$$",color:"text-red-500"}}function xS({option:e,type:t,selected:n,onSelect:r}){const i=t==="sql"?"SQL":"NoSQL",u={blue:{badge:"bg-blue-100 text-blue-700",border:"border-blue-500",bg:"bg-blue-50",btn:"ring-blue-500"},emerald:{badge:"bg-emerald-100 text-emerald-700",border:"border-emerald-500",bg:"bg-emerald-50",btn:"ring-emerald-500"}}[t==="sql"?"blue":"emerald"];return l.jsxs("button",{onClick:()=>r(t),className:`text-left rounded-xl border-2 p-5 w-full transition-all ${n?`${u.border} ${u.bg}`:"border-slate-200 hover:border-slate-300 bg-white"}`,children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${u.badge}`,children:i}),l.jsx("span",{className:"font-semibold text-slate-900",children:e.database})]}),e.specificVersion&&l.jsxs("p",{className:"text-xs text-slate-500 mb-2",children:["Version: ",e.specificVersion]}),e.estimatedCosts&&(()=>{const d=Zz(e.estimatedCosts.monthly);return d?l.jsx("p",{className:`text-sm font-semibold mb-2 ${d.color}`,children:d.symbols}):null})(),e.keyStrengths&&e.keyStrengths.length>0&&l.jsxs("div",{className:"mt-2",children:[l.jsx("p",{className:"text-xs font-medium text-slate-500 mb-1",children:"Strengths"}),l.jsx("ul",{className:"space-y-0.5",children:e.keyStrengths.slice(0,3).map((d,p)=>l.jsxs("li",{className:"text-xs text-slate-600 flex items-start gap-1.5",children:[l.jsx("span",{className:"mt-1 w-1 h-1 rounded-full bg-slate-400 flex-shrink-0"}),d]},p))})]}),e.tradeoffs&&l.jsx("p",{className:"text-xs text-slate-400 mt-2 italic",children:e.tradeoffs})]})}function eF({onNext:e,onBack:t,analyzing:n}){const{dbResult:r,dbChoice:i,setDbChoice:a}=or();if(!r)return l.jsx("div",{className:"flex items-center justify-center py-16",children:l.jsx("div",{className:"text-center text-slate-400",children:l.jsx("p",{children:"Loading database analysis..."})})});const{comparison:c,rationale:u}=r;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Database Choice"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Choose between SQL and NoSQL based on your project's data needs."}),u&&l.jsx("p",{className:"text-sm text-slate-600 mt-2 bg-slate-50 border border-slate-200 rounded-lg px-3 py-2",children:u})]}),c&&l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsx(xS,{option:c.sqlOption,type:"sql",selected:i==="sql",onSelect:a}),l.jsx(xS,{option:c.nosqlOption,type:"nosql",selected:i==="nosql",onSelect:a})]}),r.keyMetrics&&l.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-50 overflow-hidden",children:[l.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 border-b border-slate-200 bg-white",children:[l.jsx(yC,{className:"w-3.5 h-3.5 text-slate-400"}),l.jsx("span",{className:"text-xs font-semibold text-slate-500",children:"Project metrics analysed"})]}),l.jsxs("div",{className:"flex divide-x divide-slate-200",children:[r.keyMetrics.estimatedReadWriteRatio&&l.jsxs("div",{className:"flex-1 px-4 py-3",children:[l.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Read / Write ratio"}),l.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.estimatedReadWriteRatio})]}),r.keyMetrics.expectedThroughput&&l.jsxs("div",{className:"flex-1 px-4 py-3",children:[l.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Expected throughput"}),l.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.expectedThroughput})]}),r.keyMetrics.dataComplexity&&l.jsxs("div",{className:"flex-1 px-4 py-3",children:[l.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Data complexity"}),l.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.dataComplexity})]})]})]}),l.jsxs("div",{className:"flex items-start gap-2 px-1 py-2 text-xs text-slate-400",children:[l.jsx(zx,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 text-slate-300"}),l.jsx("p",{children:"The SQL and NoSQL candidates above are AI-suggested based on your mission and scope — specific technology (e.g. PostgreSQL vs MySQL, MongoDB vs DynamoDB) and configuration will be refined during architecture analysis. Skipping lets the model choose the best fit autonomously, which may include a vector database, a time-series store, or no database at all."})]}),l.jsxs("div",{className:"flex items-center justify-between pt-2",children:[l.jsx("button",{type:"button",onClick:t,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"← Back"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{type:"button",onClick:e,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"Skip — let the model decide"}),l.jsx("button",{onClick:e,disabled:!i||n,className:"px-5 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-slate-700 transition-colors flex items-center gap-2",children:n?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Analyzing..."]}):"Continue"})]})]})]})}function vS(e=""){return e==="claude"?"anthropic":e}const tF={claude:"Anthropic API Key (ANTHROPIC_API_KEY)",anthropic:"Anthropic API Key (ANTHROPIC_API_KEY)",gemini:"Google Gemini API Key (GEMINI_API_KEY)",openai:"OpenAI API Key (OPENAI_API_KEY)",xiaomi:"Xiaomi MiMo API Key (XIAOMI_API_KEY)"},nF={Free:"text-green-600",$:"text-green-600",$$:"text-amber-500",$$$:"text-orange-500",$$$$:"text-red-500"};function rF({onSubmit:e,onClose:t}){const[n,r]=b.useState("");return l.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/40 backdrop-blur-sm p-4",onClick:i=>{i.target===i.currentTarget&&t()},children:l.jsxs("div",{className:"w-full max-w-md bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Refine Architecture"}),l.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe what you'd like to change or improve."})]}),l.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),l.jsx("div",{className:"px-5 py-4 flex flex-col gap-3",children:l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What would you like to change or improve?"}),l.jsx("textarea",{value:n,onChange:i=>r(i.target.value),rows:4,placeholder:"E.g. Make it fully serverless, add edge caching, keep everything local…",autoFocus:!0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none"})]})}),l.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:t,className:"px-4 py-1.5 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Cancel"}),l.jsx("button",{type:"button",onClick:()=>e(n),disabled:!n.trim(),className:"px-4 py-1.5 text-xs text-white bg-blue-600 rounded-lg hover:bg-blue-700 transition-colors disabled:opacity-40",children:"Refine"})]})]})})}function iF({onUse:e,onClose:t,onOpenSettings:n}){const[r,i]=b.useState([]),[a,c]=b.useState(""),[u,d]=b.useState(""),[p,h]=b.useState(!1),[m,g]=b.useState(null),[v,w]=b.useState(""),[S,j]=b.useState(!1),[k,C]=b.useState(null);b.useEffect(()=>{Promise.all([fs(),On()]).then(([ee,J])=>{i(ee),C(J.apiKeys??{});const ne=ee.filter(B=>{var G,q;return(q=(G=J.apiKeys)==null?void 0:G[vS(B.provider)])==null?void 0:q.isSet}),re=B=>/pro|opus|sonnet/i.test(B),U=ne.find(B=>re(B.modelId))||ne[0];c(U?U.modelId:ee.length>0?ee[0].modelId:"")}).catch(()=>w("Failed to load available models."))},[]);function E(){On().then(ee=>C(ee.apiKeys??{})).catch(()=>{})}const A=r.find(ee=>ee.modelId===a),P=(()=>{var J;if(!k||!A)return[];const ee=new Set;return(J=k[vS(A.provider)])!=null&&J.isSet||ee.add(A.provider),[...ee]})();async function O(){if(!(!u.trim()||!a||!A)){h(!0),w(""),g(null);try{const ee=await nD(u.trim(),a,A.provider);g(ee)}catch(ee){w(ee.message||"Generation failed. Please try again.")}finally{h(!1)}}}async function M(ee){j(!1),g(null),h(!0),w("");try{const J=await rD(m,ee,a,A.provider);g(J)}catch(J){w(J.message||"Refinement failed. Please try again.")}finally{h(!1)}}function I(){m&&e(m)}function z(){g(null),w("")}const K=[...new Set(r.map(ee=>ee.provider))],L=!p&&u.trim().length>0&&!!a&&P.length===0;function R({label:ee,value:J,onChange:ne}){const re=r.find(U=>U.modelId===J);return l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:ee}),l.jsxs("select",{value:J,onChange:U=>ne(U.target.value),disabled:p||r.length===0,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60 bg-white",children:[r.length===0&&l.jsx("option",{value:"",children:"Loading…"}),K.map(U=>l.jsx("optgroup",{label:U.charAt(0).toUpperCase()+U.slice(1),children:r.filter(B=>B.provider===U).map(B=>l.jsxs("option",{value:B.modelId,children:[B.displayName,B.hasApiKey?"":" (no key)"]},B.modelId))},U))]}),re&&!re.hasApiKey&&l.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",l.jsx("code",{children:".env"})]})]})}return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:ee=>{ee.target===ee.currentTarget&&t()},children:l.jsxs("div",{className:"w-full max-w-5xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden h-[540px]",children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"✨ Ask a Model"}),l.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe the architecture you need — an LLM will generate it for you."})]}),l.jsx("button",{type:"button",onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors text-xl leading-none ml-4","aria-label":"Close",children:"×"})]}),l.jsxs("div",{className:"flex flex-1 min-h-0",children:[l.jsxs("div",{className:"w-2/5 min-w-0 border-r border-slate-100 flex flex-col px-4 py-4 gap-3",children:[l.jsx(R,{label:"Generator Model",value:a,onChange:c}),P.length>0&&l.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:[l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx(na,{className:"w-3.5 h-3.5 text-amber-500 flex-shrink-0 mt-0.5"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold text-amber-900",children:"API Key Missing"}),l.jsx("ul",{className:"mt-1 space-y-0.5",children:P.map(ee=>l.jsxs("li",{className:"flex items-center gap-1.5 text-xs text-amber-800",children:[l.jsx("span",{className:"w-1 h-1 rounded-full bg-amber-400 flex-shrink-0"}),tF[ee]||ee]},ee))})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[n&&l.jsxs("button",{type:"button",onClick:()=>n(),className:"flex items-center gap-1 text-xs font-medium bg-slate-900 text-white px-2.5 py-1 rounded-md hover:bg-slate-700 transition-colors",children:[l.jsx(lo,{className:"w-3 h-3"}),"Settings"]}),l.jsx("button",{type:"button",onClick:E,className:"text-xs text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}),l.jsxs("div",{children:[l.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"Describe the architecture you need"}),l.jsx("textarea",{value:u,onChange:ee=>d(ee.target.value),rows:4,placeholder:"E.g. Microservices with Docker, local first, easy to scale to cloud later…",disabled:p,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none disabled:opacity-60"})]}),v&&l.jsx("p",{className:"text-xs text-red-600 bg-red-50 rounded-md px-2 py-1.5",children:v}),l.jsx("div",{className:"flex-1"}),l.jsxs("div",{className:"flex flex-col gap-2",children:[m?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",onClick:I,className:"w-full px-3 py-2 bg-slate-900 text-white text-xs font-medium rounded-lg hover:bg-slate-700 transition-colors",children:"Use This"}),l.jsx("button",{type:"button",onClick:()=>j(!0),className:"w-full px-3 py-2 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Refine"}),l.jsx("button",{type:"button",onClick:z,className:"w-full px-3 py-2 text-xs text-slate-600 border border-slate-300 rounded-lg hover:bg-slate-50 transition-colors",children:"Try Again"})]}):l.jsx("button",{type:"button",onClick:O,disabled:!L,className:"w-full px-3 py-2 bg-blue-600 text-white text-xs font-medium rounded-lg disabled:opacity-40 hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",children:p?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Generating…"]}):"Generate"}),l.jsx("button",{type:"button",onClick:t,className:"w-full px-3 py-1.5 text-xs text-slate-400 hover:text-slate-600 transition-colors",children:"Cancel"})]})]}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[p&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-8 text-center",children:[l.jsx("span",{className:"w-8 h-8 border-3 border-blue-200 border-t-blue-600 rounded-full animate-spin",style:{borderWidth:3}}),l.jsx("p",{className:"text-sm font-medium text-slate-700",children:"Generating architecture…"}),l.jsx("p",{className:"text-xs text-slate-400",children:"The model is crafting a custom architecture based on your description."})]}),!p&&!m&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 px-8 text-center text-slate-300",children:[l.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z"})}),l.jsx("p",{className:"text-sm font-medium text-slate-400",children:"Custom architecture will appear here"}),l.jsx("p",{className:"text-xs text-slate-300",children:"Fill in the form and click Generate"})]}),!p&&m&&l.jsxs("div",{className:"flex-1 flex flex-col gap-3 px-5 py-4 overflow-y-auto",children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsx("span",{className:"font-semibold text-slate-900 text-sm",children:m.name}),m.requiresCloudProvider?l.jsx("span",{className:"text-xs bg-purple-100 text-purple-700 px-2 py-0.5 rounded-full",children:"Cloud"}):l.jsx("span",{className:"text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded-full",children:"Local"})]}),l.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:m.description}),m.bestFor&&l.jsxs("p",{className:"text-xs text-slate-500 italic",children:["Best for: ",m.bestFor]}),m.costTier&&l.jsx("p",{className:`text-sm font-semibold ${nF[m.costTier]??"text-slate-500"}`,children:m.costTier}),m.migrationPath&&l.jsxs("p",{className:"text-xs text-slate-400",children:["Migration: ",m.migrationPath.estimatedMigrationEffort,"(",m.migrationPath.migrationComplexity,")"]})]})]})]})]})}),S&&m&&l.jsx(rF,{onSubmit:M,onClose:()=>j(!1)})]})}const sF={Free:"text-green-600",$:"text-green-600",$$:"text-amber-500",$$$:"text-orange-500",$$$$:"text-red-500"};function aF({arch:e,selected:t,onSelect:n}){return l.jsxs("button",{onClick:()=>n(e),className:`text-left rounded-xl border-2 p-4 w-full transition-all ${t?"border-indigo-500 bg-indigo-50":"border-slate-200 hover:border-slate-300 bg-white"}`,children:[l.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[l.jsx("span",{className:"font-semibold text-slate-900 text-sm",children:e.name}),e.requiresCloudProvider?l.jsx("span",{className:"text-xs bg-purple-100 text-purple-700 px-2 py-0.5 rounded-full whitespace-nowrap",children:"Cloud"}):l.jsx("span",{className:"text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded-full whitespace-nowrap",children:"Local"})]}),l.jsx("p",{className:"text-xs text-slate-600 mb-2 line-clamp-3",children:e.description}),e.bestFor&&l.jsxs("p",{className:"text-xs text-slate-500 italic",children:["Best for: ",e.bestFor]}),e.costTier&&l.jsx("p",{className:`mt-2 text-sm font-semibold ${sF[e.costTier]??"text-slate-500"}`,children:e.costTier}),e.migrationPath&&l.jsxs("div",{className:"mt-2 text-xs text-slate-400",children:["Migration to cloud: ",e.migrationPath.estimatedMigrationEffort," (",e.migrationPath.migrationComplexity,")"]})]})}function oF({onNext:e,onBack:t,analyzing:n,onOpenSettings:r}){const{archOptions:i,selectedArch:a,setSelectedArch:c,setArchOptions:u}=or(),[d,p]=b.useState(!1);return!i||i.length===0?l.jsx("div",{className:"flex items-center justify-center py-16",children:l.jsx("div",{className:"text-center text-slate-400",children:l.jsx("p",{children:"Loading architecture recommendations..."})})}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Architecture Selection"}),l.jsx("button",{type:"button",onClick:()=>p(!0),disabled:n,className:"text-xs text-blue-600 hover:text-blue-700 flex items-center gap-1 transition-colors disabled:opacity-40",children:"✨ Ask a Model"})]}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Choose the deployment architecture that fits your project best."})]}),l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:i.map((h,m)=>l.jsx(aF,{arch:h,selected:a===h,onSelect:c},m))}),l.jsxs("div",{className:"flex items-center justify-between pt-2",children:[l.jsx("button",{type:"button",onClick:t,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"← Back"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{type:"button",onClick:e,disabled:n,className:"text-sm text-slate-400 hover:text-slate-600 disabled:opacity-40 transition-colors",children:"Skip — let the model decide"}),l.jsx("button",{onClick:e,disabled:!a||n,className:"px-5 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-slate-700 transition-colors flex items-center gap-2",children:n?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Preparing requirements…"]}):"Continue"})]})]}),d&&l.jsx(iF,{onUse:h=>{u([...i,h]),c(h),p(!1)},onClose:()=>p(!1),onOpenSettings:r})]})}const yS=[{key:"TARGET_USERS",label:"Target Users",description:"Who will use this application? List different user types and their roles.",rows:3,required:!0},{key:"DEPLOYMENT_TARGET",label:"Deployment Target",description:"Where and how will this application be deployed?",rows:3,required:!0},{key:"TECHNICAL_CONSIDERATIONS",label:"Technical Considerations",description:"Technology stack, architectural patterns, scalability, and performance requirements.",rows:4,required:!0},{key:"TECHNICAL_EXCLUSIONS",label:"Technical Exclusions",description:"Technologies, frameworks, or services to explicitly exclude from recommendations. Leave blank if none.",rows:2,required:!1},{key:"SECURITY_AND_COMPLIANCE_REQUIREMENTS",label:"Security & Compliance Requirements",description:"Security, privacy, or regulatory requirements your application must meet. Examples: GDPR compliance, PCI DSS, two-factor authentication.",rows:3,required:!0}];function lF(e=""){return e==="claude"?"anthropic":e}function _m({fieldKey:e,fieldLabel:t,currentValue:n,context:r,onApply:i,onClose:a}){const[c,u]=b.useState([]),[d,p]=b.useState(""),[h,m]=b.useState(""),[g,v]=b.useState(!1),[w,S]=b.useState(null),[j,k]=b.useState("");b.useEffect(()=>{Promise.all([fs(),On()]).then(([P,O])=>{var L;u(P);const M=O.apiKeys??{},I=P.filter(R=>{var ee;return(ee=M[lF(R.provider)])==null?void 0:ee.isSet}),z=R=>/pro|opus|sonnet/i.test(R),K=I.find(R=>z(R.modelId))||I[0];p(K?K.modelId:((L=P[0])==null?void 0:L.modelId)||"")}).catch(()=>k("Failed to load models."))},[]);const C=c.find(P=>P.modelId===d),E=[...new Set(c.map(P=>P.provider))];async function A(){if(!(!C||!h.trim())){v(!0),k(""),S(null);try{const P=await iD(e,t,n,h.trim(),r,d,C.provider);S(P.value)}catch(P){k(P.message||"Refinement failed.")}finally{v(!1)}}}return l.jsxs("div",{className:"mt-2 rounded-lg border border-blue-200 bg-blue-50/50 p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("span",{className:"text-xs font-semibold text-blue-700",children:["Ask a Model — ",t]}),l.jsx("button",{type:"button",onClick:a,className:"text-xs text-slate-400 hover:text-slate-600",children:"×"})]}),!w&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex gap-2",children:l.jsxs("select",{value:d,onChange:P=>p(P.target.value),disabled:g||c.length===0,className:"flex-1 rounded-md border border-slate-300 px-2 py-1 text-xs text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-60 bg-white",children:[c.length===0&&l.jsx("option",{value:"",children:"Loading…"}),E.map(P=>l.jsx("optgroup",{label:P.charAt(0).toUpperCase()+P.slice(1),children:c.filter(O=>O.provider===P).map(O=>l.jsxs("option",{value:O.modelId,children:[O.displayName,O.hasApiKey?"":" (no key)"]},O.modelId))},P))]})}),l.jsx("textarea",{value:h,onChange:P=>m(P.target.value),rows:2,placeholder:"What would you like to improve? E.g. Be more specific about enterprise users…",disabled:g,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none disabled:opacity-60"}),j&&l.jsx("p",{className:"text-xs text-red-600",children:j}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:a,className:"px-3 py-1 text-xs text-slate-500 hover:text-slate-700",children:"Cancel"}),l.jsx("button",{type:"button",onClick:A,disabled:g||!h.trim()||!d,className:"px-3 py-1 text-xs font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-40 flex items-center gap-1.5",children:g?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Refining…"]}):"Refine"})]})]}),w&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"text-xs text-slate-700 bg-white rounded-md border border-slate-200 px-2.5 py-2 whitespace-pre-wrap max-h-40 overflow-y-auto",children:w}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{type:"button",onClick:()=>{S(null),m("")},className:"px-3 py-1 text-xs text-slate-500 hover:text-slate-700",children:"Try Again"}),l.jsx("button",{type:"button",onClick:()=>{i(w),a()},className:"px-3 py-1 text-xs font-medium text-white bg-slate-900 rounded-md hover:bg-slate-700",children:"Use This"})]})]})]})}function cF({onNext:e,onBack:t}){const{requirements:n,updateRequirement:r,mission:i,setMission:a,initialScope:c,setInitialScope:u}=or(),[d,p]=b.useState(null),h={mission:i,scope:c},m=i.trim().length>0&&c.trim().length>0&&yS.filter(v=>v.required).every(v=>{var w;return(w=n[v.key])==null?void 0:w.trim()});function g({fieldKey:v}){return l.jsxs("button",{type:"button",onClick:()=>p(d===v?null:v),className:`inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-md transition-colors ${d===v?"bg-blue-100 text-blue-700":"text-slate-400 hover:text-blue-600 hover:bg-blue-50"}`,title:"Ask a model to improve this field",children:[l.jsx(C3,{className:"w-3 h-3"}),"Ask Model"]})}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Review & Edit Requirements"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"AI has pre-filled these requirements based on your selections. Review and edit as needed."})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Mission Statement ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx(g,{fieldKey:"MISSION_STATEMENT"})]}),l.jsx("textarea",{value:i,onChange:v=>a(v.target.value),rows:3,className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Required..."}),d==="MISSION_STATEMENT"&&l.jsx(_m,{fieldKey:"MISSION_STATEMENT",fieldLabel:"Mission Statement",currentValue:i,context:h,onApply:v=>a(v),onClose:()=>p(null)})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Initial Scope ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx(g,{fieldKey:"INITIAL_SCOPE"})]}),l.jsx("textarea",{value:c,onChange:v=>u(v.target.value),rows:4,className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:"Required..."}),d==="INITIAL_SCOPE"&&l.jsx(_m,{fieldKey:"INITIAL_SCOPE",fieldLabel:"Initial Scope",currentValue:c,context:h,onApply:v=>u(v),onClose:()=>p(null)})]}),l.jsx("hr",{className:"border-slate-200"}),yS.map(v=>l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[l.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:[v.label,v.required&&l.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),l.jsx(g,{fieldKey:v.key})]}),l.jsx("p",{className:"text-xs text-slate-400 mb-1",children:v.description}),l.jsx("textarea",{value:n[v.key]||"",onChange:w=>r(v.key,w.target.value),rows:v.rows,className:"w-full rounded-lg border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 resize-none",placeholder:v.required?"Required...":"Optional..."}),d===v.key&&l.jsx(_m,{fieldKey:v.key,fieldLabel:v.label,currentValue:n[v.key]||"",context:h,onApply:w=>r(v.key,w),onClose:()=>p(null)})]},v.key))]}),l.jsxs("div",{className:"flex items-center justify-between pt-2",children:[l.jsx("button",{type:"button",onClick:t,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:"← Back"}),l.jsx("button",{onClick:e,disabled:!m,className:"px-5 py-2 bg-green-600 text-white text-sm font-medium rounded-lg disabled:opacity-40 hover:bg-green-700 transition-colors",children:"Generate Project Brief"})]})]})}function uF(e){const t=e==null?void 0:e.match(/Stage\s+(\d+(?:\.\d+)?)\/(\d+)/i);return t?{current:parseFloat(t[1]),total:parseInt(t[2])}:null}function dF(e){const t=[];for(const n of e)if(n.type==="progress")t.push({message:n.message,substeps:[],orphanDetails:[]});else if(n.type==="substep"&&t.length>0)t[t.length-1].substeps.push({text:n.substep,details:[]});else if(n.type==="detail"&&t.length>0){const r=t[t.length-1],i=r.substeps;i.length>0?i[i.length-1].details.push(n.detail):r.orphanDetails.push(n.detail)}return t}function fF({transitioning:e,onPause:t,onResume:n,onCancel:r,onBackground:i}){var P;const{progressLog:a,ceremonyStatus:c,ceremonyError:u,isPaused:d,setWizardStep:p,setCeremonyStatus:h,setCeremonyError:m}=or(),g=b.useRef(null),[v,w]=b.useState(!1);b.useEffect(()=>{if(e==="cancelling"){w(!1);const O=setTimeout(()=>w(!0),5e3);return()=>clearTimeout(O)}w(!1)},[e]);const S=async()=>{try{await CC()}catch{}h("idle"),m(null),p(1)};b.useEffect(()=>{var O;(O=g.current)==null||O.scrollIntoView({behavior:"smooth"})},[a]),b.useEffect(()=>{c==="complete"&&p(7)},[c,p]);const j=dF(a);let k=null,C=5;for(const O of[...j].reverse()){const M=uF(O.message);if(M){k=M.current,C=M.total;break}}const E=k?Math.round(k/C*100):5,A=((P=j[j.length-1])==null?void 0:P.message)||"Starting ceremony...";if(c==="error"){const O=u==null?void 0:u.includes("already running");return l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Generation Failed"}),l.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[l.jsx("p",{className:"text-sm font-medium text-red-700 mb-1",children:"Error"}),l.jsx("p",{className:"text-sm text-red-600",children:u||"An unknown error occurred."})]}),O?l.jsxs("div",{className:"space-y-3",children:[l.jsx("p",{className:"text-sm text-slate-500",children:"A ceremony is already running on the server. You can force-stop it and reset the state — this will discard any in-progress work."}),l.jsx("button",{onClick:S,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700 transition-colors",children:"Force Stop & Reset"})]}):l.jsxs("p",{className:"text-sm text-slate-500",children:["Check that your API key is configured correctly in your project's ",l.jsx("code",{children:".env"})," file."]})]})}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Generating Documentation"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"The AI is generating your project documentation. Duration varies depending on the number of validation iterations — typically a few minutes, but may take longer."})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-xs font-medium text-slate-600",children:A}),l.jsxs("span",{className:"text-xs text-slate-400",children:[E,"%"]})]}),l.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:l.jsx("div",{className:"bg-blue-500 h-2 rounded-full transition-all duration-500",style:{width:`${E}%`}})})]}),l.jsx("div",{className:"bg-slate-900 rounded-lg p-4 h-56 overflow-y-auto font-mono text-xs",children:j.length===0?l.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing..."}):l.jsxs("div",{className:"space-y-2",children:[j.map((O,M)=>{var z;const I=M===j.length-1&&c==="running";return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[I?l.jsx("span",{className:"inline-block w-3 h-3 border border-blue-400 border-t-blue-200 rounded-full animate-spin flex-shrink-0"}):l.jsx("span",{className:"text-green-500 flex-shrink-0",children:"✓"}),l.jsx("span",{className:I?"text-blue-300 font-medium":"text-slate-400",children:O.message})]}),((z=O.orphanDetails)==null?void 0:z.length)>0&&l.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:O.orphanDetails.map((K,L)=>l.jsx("p",{className:"text-slate-500",children:K},L))}),O.substeps.length>0&&l.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:O.substeps.map((K,L)=>l.jsxs("div",{children:[l.jsx("p",{className:"text-slate-400",children:K.text}),K.details.length>0&&l.jsx("div",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:K.details.map((R,ee)=>l.jsx("p",{className:"text-slate-500",children:R},ee))})]},L))})]},M)}),e==="cancelling"&&l.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[l.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin flex-shrink-0"}),l.jsx("span",{className:"text-red-400 font-medium",children:"Cancelling…"})]}),l.jsx("div",{ref:g})]})}),l.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2",children:[i&&!e&&l.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded-md px-2.5 py-1.5 transition-colors",title:"Hide this window — ceremony keeps running in the background",children:[l.jsx(Ef,{className:"w-3.5 h-3.5"}),"Run in Background"]}),e&&l.jsx("span",{}),l.jsxs("div",{className:"flex items-center gap-2",children:[e==="pausing"?l.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-slate-400",children:[l.jsx("span",{className:"inline-block w-3 h-3 border border-slate-400 border-t-slate-200 rounded-full animate-spin"}),"Pausing…"]}):e==="cancelling"?l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[l.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin"}),"Cancelling…"]}),v&&l.jsx("button",{onClick:S,className:"px-3 py-1.5 text-xs rounded-lg bg-red-600 text-white hover:bg-red-700 transition-colors",children:"Force Stop"})]}):d?l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg border border-amber-300 bg-amber-50 text-amber-700 hover:bg-amber-100 transition-colors",children:"▶ Resume"}):l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"⏸ Pause"}),!e&&l.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50 transition-colors",children:"✕ Cancel"})]})]})]})}function pF({severity:e}){const t=e==="critical"?"bg-red-100 text-red-700":e==="major"?"bg-amber-100 text-amber-700":"bg-slate-100 text-slate-500";return l.jsx("span",{className:`flex-shrink-0 px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${t}`,children:e})}function hF({path:e}){const t=(e==null?void 0:e.split("/").slice(-2).join("/"))||e;return l.jsxs("span",{className:"inline-flex items-center gap-1 bg-green-50 border border-green-200 text-green-700 text-xs px-2 py-1 rounded-md font-mono",children:[l.jsx("span",{children:"📄"}),t]})}function bS({label:e,value:t}){return l.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3 text-center",children:[l.jsx("div",{className:"text-lg font-bold text-slate-900",children:t}),l.jsx("div",{className:"text-xs text-slate-500",children:e})]})}function mF({onClose:e}){var p,h,m,g,v,w;const{ceremonyResult:t}=or(),n=t||{},r=((p=n.tokenUsage)==null?void 0:p.input)||((h=n.tokenUsage)==null?void 0:h.inputTokens)||0,i=((m=n.tokenUsage)==null?void 0:m.output)||((g=n.tokenUsage)==null?void 0:g.outputTokens)||0;(v=n.tokenUsage)!=null&&v.total||(w=n.tokenUsage)!=null&&w.totalTokens||r+i;const a=n.outputPath&&n.contextPath?[n.outputPath,n.contextPath]:n.filesGenerated||[],c=Array.isArray(n.validationIssues)?n.validationIssues:[],u={};for(const S of c){const j=S.ruleId||S.name;u[j]?(u[j].count++,S.iteration&&!u[j].iterations.includes(S.iteration)&&u[j].iterations.push(S.iteration)):u[j]={...S,count:1,iterations:S.iteration?[S.iteration]:[]}}const d=Object.values(u);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Documentation Generated!"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Your project documentation is ready. The kanban board will refresh automatically."})]}),a.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"Files created"}),l.jsx("div",{className:"flex flex-wrap gap-2",children:a.map((S,j)=>l.jsx(hF,{path:S},j))})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(bS,{label:"Input tokens",value:r.toLocaleString()}),l.jsx(bS,{label:"Output tokens",value:i.toLocaleString()})]}),n.model&&l.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Model: ",l.jsx("span",{className:"font-mono",children:n.model})]}),d.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Quality fixes applied"}),l.jsx("div",{className:"space-y-1.5",children:d.map((S,j)=>{var k;return l.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-md px-3 py-2 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(pF,{severity:S.severity}),l.jsx("span",{className:"text-slate-400 flex-shrink-0",children:S.stage}),l.jsx("span",{className:"text-slate-700 font-medium",children:S.name}),S.count>1&&l.jsxs("span",{className:"ml-auto flex-shrink-0 bg-amber-200 text-amber-800 text-[10px] font-bold px-1.5 py-0.5 rounded-full",children:["×",S.count]}),((k=S.iterations)==null?void 0:k.length)>0&&l.jsxs("span",{className:"flex-shrink-0 text-slate-400",children:["iter ",S.iterations.sort((C,E)=>C-E).join(", ")]})]}),S.description&&l.jsx("p",{className:"mt-1 text-slate-500 pl-1",children:S.description})]},j)})})]}),l.jsx("div",{className:"flex justify-center pt-2",children:l.jsx("button",{onClick:e,className:"px-6 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg hover:bg-slate-700 transition-colors",children:"Close"})})]})}const gF={anthropic:"Anthropic API Key (ANTHROPIC_API_KEY)",gemini:"Google Gemini API Key (GEMINI_API_KEY)",openai:"OpenAI API Key (OPENAI_API_KEY)",xiaomi:"Xiaomi MiMo API Key (XIAOMI_API_KEY)"};function Im(e=""){const t=e.toLowerCase();return t==="claude"||t==="anthropic"?"anthropic":t}function wS(e){var i;const t=(i=e.ceremonies)==null?void 0:i.find(a=>a.name==="sponsor-call"),n=new Set;if(t!=null&&t.stages&&typeof t.stages=="object")for(const a of Object.values(t.stages))a!=null&&a.provider&&n.add(Im(a.provider));if(t!=null&&t.validation&&typeof t.validation=="object"){t.validation.provider&&n.add(Im(t.validation.provider));for(const a of Object.values(t.validation))a&&typeof a=="object"&&typeof a.provider=="string"&&n.add(Im(a.provider))}const r=e.apiKeys??{};return[...n].filter(a=>{var c;return a!=="local"&&!((c=r[a])!=null&&c.isSet)})}const jS=[{id:1,label:"Strategy"},{id:2,label:"Mission"},{id:3,label:"Database"},{id:4,label:"Architecture"},{id:5,label:"Review"},{id:6,label:"Generate"},{id:7,label:"Done"}];function xF({currentStep:e,hasDb:t}){const n=t?jS:jS.filter(a=>a.id!==3),i=(a=>!t&&a>=4?a-1:a)(e);return l.jsx("div",{className:"flex items-center gap-1 flex-nowrap overflow-x-auto pb-0.5",children:n.map((a,c)=>{const u=c+1,d=i>u,p=i===u;return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsxs("div",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full whitespace-nowrap ${p?"bg-blue-600 text-white font-medium":d?"bg-green-100 text-green-700":"bg-slate-100 text-slate-400"}`,children:[d?"✓":u," ",a.label]}),c<n.length-1&&l.jsx("span",{className:"text-slate-300 text-xs",children:"›"})]},a.id)})})}function vF({onClose:e,onOpenSettings:t,costLimitPending:n,onContinuePastCostLimit:r,onCancelFromCostLimit:i}){var Ns,Di,mr,Mn;const{isOpen:a,wizardStep:c,setWizardStep:u,analyzing:d,setAnalyzing:p,strategy:h,mission:m,initialScope:g,dbResult:v,setDbResult:w,dbChoice:S,archOptions:j,setArchOptions:k,selectedArch:C,applyPrefill:E,requirements:A,ceremonyStatus:P,isPaused:O,setCeremonyStatus:M,setCeremonyResult:I,setCeremonyError:z,appendProgress:K,startRun:L,resetWizard:R,closeWizard:ee,setProcessId:J,setStrategy:ne,setMission:re,setInitialScope:U,setDbChoice:B,setSelectedArch:G,setPrefillResult:q,setRequirements:_}=or(),[V,ie]=b.useState(""),[ue,te]=b.useState(null),se=(fe,Me=null)=>te(fe?{message:fe,retry:Me}:null),[pe,Ne]=b.useState(!1),[Y,me]=b.useState(null),[Ae,ae]=b.useState(!1),[$e,Re]=b.useState(null),[Ye,Qe]=b.useState([]),[Mt,En]=b.useState(null),[xn,vn]=b.useState([]),[yn,he]=b.useState({}),[Pe,De]=b.useState({loading:!0,missing:[]}),[Xe,Pt]=b.useState(!1),[_t,It]=b.useState(null),[un,Ke]=b.useState({ceremonies:[],apiKeys:{}});b.useEffect(()=>{let fe=!1;return On().then(Me=>{fe||(De({loading:!1,missing:wS(Me)}),Ke(Me))}).catch(()=>{fe||De({loading:!1,missing:[]})}),()=>{fe=!0}},[]),b.useEffect(()=>{if(!a||c!==1||P!=="idle")return;let fe=!1;return sD().then(Me=>{!fe&&Me&&Me.wizardStep&&Me.wizardStep>1&&(It(Me),Pt(!0))}),()=>{fe=!0}},[a]);const Dt=b.useCallback(()=>{De({loading:!0,missing:[]}),On().then(fe=>De({loading:!1,missing:wS(fe)})).catch(()=>De({loading:!1,missing:[]}))},[]);b.useEffect(()=>(document.addEventListener("avc:settings-saved",Dt),()=>document.removeEventListener("avc:settings-saved",Dt)),[Dt]);const Tn=(fe={})=>{const Me=or.getState();aD({wizardStep:Me.wizardStep,strategy:Me.strategy,mission:Me.mission,initialScope:Me.initialScope,dbResult:Me.dbResult,dbChoice:Me.dbChoice,archOptions:Me.archOptions,selectedArch:Me.selectedArch,prefillResult:Me.prefillResult,requirements:Me.requirements,...fe}).catch(()=>{})},ga=()=>{const fe=_t;Pt(!1),It(null),fe&&(fe.strategy!=null&&ne(fe.strategy),fe.mission!=null&&re(fe.mission),fe.initialScope!=null&&U(fe.initialScope),fe.dbResult!=null&&w(fe.dbResult),fe.dbChoice!=null&&B(fe.dbChoice),fe.archOptions!=null&&k(fe.archOptions),fe.selectedArch!=null&&G(fe.selectedArch),fe.prefillResult!=null&&q(fe.prefillResult),fe.requirements!=null&&_(fe.requirements),u(fe.wizardStep))},xa=()=>{Pt(!1),It(null),V1(),R()},js=async(fe,Me)=>{const Hn=(xn.length>0?xn:[fe]).map(gr=>gr.name===fe.name?fe:gr);await Kl(Hn,{validation:Me}),Re(fe),En(Me),vn(Hn)},Zr=()=>{ae(!1),Dt()};if(b.useEffect(()=>{Y==="pausing"&&O&&me(null)},[O,Y]),b.useEffect(()=>{Y==="cancelling"&&P==="idle"&&me(null)},[P,Y]),!a)return null;const _r=(v==null?void 0:v.hasDatabaseNeeds)===!0,pr=async()=>{me("pausing");try{await kC()}catch{}},_i=async()=>{try{await PC()}catch{}},Ii=async()=>{Ne(!1),me("cancelling");try{await io()}catch{}},qn=()=>{P!=="running"&&(ee(),e&&e())},hr=async()=>{se(null),p(!0),ie("Checking database needs…");try{const fe=await K3(m,g,h);if(w(fe),fe.hasDatabaseNeeds)u(3),Tn({wizardStep:3,dbResult:fe});else{ie("Analysing architecture options…");const Me=await F1(m,g,null,h);k(Me),u(4),Tn({wizardStep:4,dbResult:fe,archOptions:Me})}}catch(fe){console.error("Mission analysis error:",fe),se(fe.message,hr)}finally{p(!1),ie("")}},va=async()=>{se(null),p(!0),ie("Analysing architecture options…");try{const fe=v?{...v,userChoice:S}:null,Me=await F1(m,g,fe,h);k(Me),u(4),Tn({wizardStep:4,archOptions:Me})}catch(fe){console.error("Architecture analysis error:",fe),se(fe.message,va)}finally{p(!1),ie("")}},ya=async()=>{se(null),p(!0),ie("Pre-filling requirements from your selections…");try{const fe=v?{...v,userChoice:S}:null,Me=await H3(m,g,C,fe,h);E(Me,h,m,g),u(5),setTimeout(()=>Tn({wizardStep:5,prefillResult:Me}),0)}catch(fe){console.error("Prefill error:",fe),se(fe.message,ya)}finally{p(!1),ie("")}},Ss=async()=>{V1();try{L(),u(6);const fe=await G3(A);fe!=null&&fe.processId&&J(fe.processId)}catch(fe){console.error("Run ceremony error:",fe),M("error"),z(fe.message)}},ba=()=>{switch(c){case 1:return l.jsx(Hz,{onNext:()=>{u(2),Tn({wizardStep:2})}});case 2:return l.jsx(Jz,{onNext:hr,onBack:()=>u(1),analyzing:d,onOpenSettings:t});case 3:return l.jsx(eF,{onNext:va,onBack:()=>u(2),analyzing:d});case 4:return l.jsx(oF,{onNext:ya,onBack:()=>u(_r?3:2),analyzing:d,onOpenSettings:t});case 5:return l.jsx(cF,{onNext:Ss,onBack:()=>u(4)});case 6:return l.jsx(fF,{transitioning:Y,onPause:pr,onResume:_i,onCancel:()=>Ne(!0),onBackground:ee});case 7:return l.jsx(mF,{onClose:qn});default:return null}};return l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:c!==6?qn:void 0}),l.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-3xl mx-4 max-h-[90vh] flex flex-col",children:[Xe&&l.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:l.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[l.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Resume previous session?"}),l.jsxs("p",{className:"text-sm text-slate-500",children:["A previous wizard session was saved",_t!=null&&_t.savedAt?` on ${new Date(_t.savedAt).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`:"",". Would you like to continue where you left off?"]}),l.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[l.jsx("button",{onClick:xa,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Start Fresh"}),l.jsx("button",{onClick:ga,className:"px-4 py-2 text-sm rounded-lg bg-blue-600 text-white hover:bg-blue-700",children:"Resume"})]})]})}),n&&l.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:l.jsxs("div",{className:"bg-white border border-amber-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[l.jsx("div",{className:"text-3xl",children:"⚠️"}),l.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cost Limit Reached"}),l.jsxs("p",{className:"text-sm text-slate-600",children:[l.jsxs("span",{className:"font-mono font-medium",children:["$",n.cost.toFixed(4)]})," spent",n.threshold!=null&&l.jsxs(l.Fragment,{children:[" (limit: ",l.jsxs("span",{className:"font-mono",children:["$",Number(n.threshold).toFixed(2)]}),")"]})]}),l.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),l.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[l.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg bg-slate-900 text-white hover:bg-slate-700",children:"Continue Anyway"}),l.jsx("button",{onClick:i,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50",children:"Cancel Ceremony"})]}),l.jsx("p",{className:"text-xs text-slate-400",children:"Continue disables cost checking for the rest of this run."})]})}),pe&&l.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:l.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[l.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Stop documentation generation?"}),l.jsx("p",{className:"text-sm text-slate-500",children:"You can restart the ceremony later. Any files written so far will be kept."}),l.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[l.jsx("button",{onClick:()=>Ne(!1),className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Keep Running"}),l.jsx("button",{onClick:Ii,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700",children:"Cancel Run"})]})]})}),l.jsxs("div",{className:"flex items-start justify-between px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h1",{className:"text-base font-semibold text-slate-900",children:"Sponsor Call Ceremony"}),l.jsx("div",{className:"mt-2",children:l.jsx(xF,{currentStep:c,hasDb:_r})})]}),l.jsxs("div",{className:"flex items-center gap-3 ml-4 mt-0.5 flex-shrink-0",children:[P!=="running"&&l.jsxs("button",{type:"button",onClick:async()=>{var fe,Me;try{const[Kn,Hn]=await Promise.all([On(),fs()]),gr=((fe=Kn.ceremonies)==null?void 0:fe.find(Ri=>Ri.name==="sponsor-call"))??{};Re(gr),Qe(Hn),En(((Me=Kn.missionGenerator)==null?void 0:Me.validation)??null),vn(Kn.ceremonies||[]),he(Kn.apiKeys||{}),ae(!0)}catch{}},className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-blue-600 bg-slate-50 hover:bg-blue-50 border border-slate-200 hover:border-blue-200 rounded-md px-2.5 py-1.5 transition-colors whitespace-nowrap",title:"Configure ceremony models",children:[l.jsx(lo,{className:"w-3.5 h-3.5"}),"Select Model(s)"]}),P!=="running"&&l.jsx("button",{onClick:qn,className:"text-slate-400 hover:text-slate-600 transition-colors",children:l.jsx(cn,{className:"w-5 h-5"})})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:Pe.loading?l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"})}):Pe.missing.length>0?l.jsxs("div",{className:"flex flex-col gap-5",children:[l.jsxs("div",{className:"flex items-start gap-3 p-4 bg-amber-50 border border-amber-200 rounded-lg",children:[l.jsx(na,{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold text-amber-900",children:"API Keys Required"}),l.jsx("p",{className:"text-xs text-amber-700 mt-1",children:"Configure the following API keys before running the Sponsor Call ceremony:"}),l.jsx("ul",{className:"mt-2 space-y-1.5",children:Pe.missing.map(fe=>l.jsxs("li",{className:"flex items-center gap-2 text-xs text-amber-800",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 flex-shrink-0"}),gF[fe]||fe]},fe))})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("button",{onClick:()=>t==null?void 0:t(),className:"flex items-center gap-1.5 px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 transition-colors",children:[l.jsx(lo,{className:"w-4 h-4"}),"Open Settings"]}),l.jsx("button",{onClick:Dt,className:"px-3 py-2 text-sm text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}):ba()}),ue&&l.jsx("div",{className:"flex-shrink-0 border-t border-red-200 bg-red-50 px-6 py-3",children:l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("span",{className:"text-red-500 flex-shrink-0 mt-0.5 text-sm",children:"✕"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[(Ns=ue.message)!=null&&Ns.includes("n_keep")||(Di=ue.message)!=null&&Di.includes("n_ctx")||(mr=ue.message)!=null&&mr.includes("context length")||(Mn=ue.message)!=null&&Mn.includes("context_length")?l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-xs font-medium text-red-700",children:"Context length exceeded"}),l.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:"The prompt is too large for this model's context window. Increase the context length in your local server (e.g. LM Studio → Model Settings → Context Length), then click Retry."})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:"text-xs font-medium text-red-700",children:"Analysis failed"}),l.jsx("p",{className:"text-xs text-red-600 mt-0.5 break-words",children:ue.message})]}),l.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[ue.retry&&l.jsx("button",{type:"button",onClick:()=>{const fe=ue.retry;se(null),fe()},className:"text-xs font-medium text-white bg-red-600 hover:bg-red-700 px-3 py-1 rounded transition-colors",children:"Retry"}),l.jsx("button",{type:"button",onClick:()=>se(null),className:"text-xs font-medium text-red-700 hover:text-red-900 underline underline-offset-2",children:"Dismiss"})]})]})]})}),l.jsxs("div",{className:"flex-shrink-0 border-t border-slate-100 px-6 h-8 flex items-center gap-2",children:[V&&l.jsx("span",{className:"w-3 h-3 border-2 border-blue-300 border-t-blue-600 rounded-full animate-spin flex-shrink-0"}),l.jsx("p",{className:`text-xs truncate ${V?"text-blue-600 font-medium":"text-slate-400"}`,children:V})]})]}),Ae&&$e&&l.jsx(Sv,{ceremony:$e,allCeremonies:xn,apiKeys:yn,models:Ye,missionGenValidation:Mt,readOnly:P==="running",onSave:P!=="running"?js:void 0,onClose:Zr,onCeremoniesUpdated:fe=>{vn(fe);const Me=fe.find(Kn=>Kn.name==="sponsor-call");Me&&Re(Me)}})]})}const SS=[{id:1,label:"Ready"},{id:2,label:"Running"},{id:3,label:"Select Epics/Stories"},{id:4,label:"Complete"}];function yF({currentStep:e}){return l.jsx("div",{className:"flex items-center gap-1 flex-nowrap",children:SS.map((t,n)=>{const r=e>t.id,i=e===t.id;return l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsxs("div",{className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${i?"bg-blue-600 text-white font-medium":r?"bg-green-100 text-green-700":"bg-slate-100 text-slate-400"}`,children:[r?"✓":t.id," ",t.label]}),n<SS.length-1&&l.jsx("span",{className:"text-slate-300 text-xs",children:"›"})]},t.id)})})}function NS({label:e,value:t}){return l.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3 text-center",children:[l.jsx("div",{className:"text-lg font-bold text-slate-900",children:t}),l.jsx("div",{className:"text-xs text-slate-500",children:e})]})}function bF({onStart:e,onResume:t,resumeInfo:n}){return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Ready to Plan"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"AI will decompose your project documentation into Epics and Stories using multi-agent analysis."})]}),n&&l.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2",children:[l.jsx("p",{className:"text-sm font-medium text-amber-800",children:"Previous run can be resumed"}),l.jsxs("p",{className:"text-xs text-amber-600",children:["Stopped at: ",l.jsx("span",{className:"font-medium",children:n.checkpointLabel}),n.epics>0&&l.jsxs(l.Fragment,{children:[" · ",n.epics," epics on disk"]})]}),n.timestamp&&l.jsx("p",{className:"text-xs text-amber-500",children:new Date(n.timestamp).toLocaleString()})]}),l.jsxs("div",{className:"flex items-center justify-end gap-3 pt-2",children:[n&&l.jsx("button",{onClick:t,className:"px-5 py-2 text-sm font-medium bg-amber-600 text-white rounded-lg hover:bg-amber-500 transition-colors",children:"Resume"}),l.jsx("button",{onClick:e,className:`px-5 py-2 text-sm font-medium rounded-lg transition-colors ${n?"border border-slate-200 text-slate-700 hover:bg-slate-50":"bg-slate-900 text-white hover:bg-slate-700"}`,children:n?"Start Fresh":"Start"})]})]})}function kS(e){const t=e==null?void 0:e.match(/Stage\s+(\d+(?:\.\d+)?)\/(\d+)/i);return t?{current:parseFloat(t[1]),total:parseInt(t[2])}:null}function wF(e){const t=e==null?void 0:e.match(/\((\d+)\s+epics?,\s*(\d+)\s+stories?\)/i);if(t)return{total:parseInt(t[1])+parseInt(t[2])};const n=e==null?void 0:e.match(/\((\d+)\s+stories?\)/i);return n?{total:parseInt(n[1])}:null}function jF(e){const t=[];for(const n of e)if(n.type==="progress")t.push({message:n.message,substeps:[],orphanDetails:[]});else if(n.type==="substep"&&t.length>0)t[t.length-1].substeps.push({text:n.substep,details:[]});else if(n.type==="detail"&&t.length>0){const r=t[t.length-1],i=r.substeps;i.length>0?i[i.length-1].details.push(n.detail):r.orphanDetails.push(n.detail)}return t}function SF({transitioning:e,onPause:t,onResume:n,onCancel:r,onBackground:i}){var E;const{progressLog:a,status:c,error:u,isPaused:d,setStatus:p,setStep:h,setError:m}=ko(),g=b.useRef(null),v=async()=>{try{await CC()}catch{}p("idle"),h(1),m(null)};b.useEffect(()=>{var A;(A=g.current)==null||A.scrollIntoView({behavior:"smooth"})},[a]);const w=jF(a),S={"1/6":[0,3],"2/6":[3,7],"3/6":[7,12],"4/6":[12,22],"4.5/6":[22,24],"5/6":[24,76],"6/7":[76,90],"7/7":[90,100]},j=[...w].reverse().find(A=>kS(A.message));let k=5;if(j){const A=kS(j.message),P=`${A.current}/${A.total}`,[O,M]=S[P]??[0,90],I=wF(j.message);if(I&&I.total>0){let z=0;P==="5/6"?z=j.substeps.filter(L=>{var R;return(R=L.text)==null?void 0:R.includes("Validating ")}).length:P==="6/7"?z=j.substeps.filter(L=>{var R;return(R=L.text)==null?void 0:R.includes("Distributing documentation")}).length:P==="7/7"&&(z=j.substeps.filter(L=>{var R;return(R=L.text)==null?void 0:R.includes("Enriching documentation")}).length);const K=Math.min(z,I.total)/I.total;k=Math.round(O+K*(M-O))}else k=O}const C=((E=w[w.length-1])==null?void 0:E.message)||"Starting…";if(c==="error"){const A=u==null?void 0:u.includes("already running");return l.jsxs("div",{className:"space-y-4",children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Sprint Planning Failed"}),l.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[l.jsx("p",{className:"text-sm font-medium text-red-700 mb-1",children:"Error"}),l.jsx("p",{className:"text-sm text-red-600",children:u||"An unknown error occurred."})]}),A?l.jsxs("div",{className:"space-y-3",children:[l.jsx("p",{className:"text-sm text-slate-500",children:"A ceremony is already running on the server. You can force-stop it and reset the state — this will discard any in-progress work."}),l.jsx("button",{onClick:v,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700 transition-colors",children:"Force Stop & Reset"})]}):u==="Not found"?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{className:"text-sm text-slate-500",children:["The server may be running an older version. Run"," ",l.jsx("code",{className:"bg-slate-100 px-1 rounded",children:"/kanban"})," in the AVC terminal to restart it, then try again."]}),l.jsx("button",{onClick:v,className:"px-4 py-2 text-sm rounded-lg bg-slate-600 text-white hover:bg-slate-700 transition-colors",children:"Cancel & Retry"})]}):l.jsxs("div",{className:"space-y-3",children:[l.jsx("p",{className:"text-sm text-slate-500",children:"You can dismiss this error and start a new sprint planning session."}),l.jsx("button",{onClick:v,className:"px-4 py-2 text-sm rounded-lg bg-slate-600 text-white hover:bg-slate-700 transition-colors",children:"Cancel & Retry"})]})]})}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Running Sprint Planning"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"The AI is decomposing your project scope and validating each work item. Duration varies with project size and validation iterations — from a few minutes to 30+ minutes for larger projects."})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-1",children:[l.jsx("span",{className:"text-xs font-medium text-slate-600",children:C}),l.jsxs("span",{className:"text-xs text-slate-400",children:[k,"%"]})]}),l.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:l.jsx("div",{className:"bg-blue-500 h-2 rounded-full transition-all duration-500",style:{width:`${k}%`}})})]}),l.jsx("div",{className:"bg-slate-900 rounded-lg p-4 h-64 overflow-y-auto font-mono text-xs",children:w.length===0?l.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing…"}):l.jsxs("div",{className:"space-y-2",children:[w.map((A,P)=>{var M;const O=P===w.length-1&&c==="running";return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[O?l.jsx("span",{className:"inline-block w-3 h-3 border border-blue-400 border-t-blue-200 rounded-full animate-spin flex-shrink-0"}):l.jsx("span",{className:"text-green-500 flex-shrink-0",children:"✓"}),l.jsx("span",{className:O?"text-blue-300 font-medium":"text-slate-400",children:A.message})]}),((M=A.orphanDetails)==null?void 0:M.length)>0&&l.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:A.orphanDetails.map((I,z)=>l.jsx("p",{className:"text-slate-500",children:I},z))}),A.substeps.length>0&&l.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:A.substeps.map((I,z)=>l.jsxs("div",{children:[l.jsx("p",{className:"text-slate-400",children:I.text}),I.details.length>0&&l.jsx("div",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:I.details.map((K,L)=>l.jsx("p",{className:"text-slate-500",children:K},L))})]},z))})]},P)}),e==="cancelling"&&l.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[l.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin flex-shrink-0"}),l.jsx("span",{className:"text-red-400 font-medium",children:"Cancelling…"})]}),l.jsx("div",{ref:g})]})}),l.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2",children:[i&&!e?l.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded-md px-2.5 py-1.5 transition-colors",title:"Hide this window — ceremony keeps running in the background",children:[l.jsx(Ef,{className:"w-3.5 h-3.5"}),"Run in Background"]}):l.jsx("span",{}),l.jsxs("div",{className:"flex items-center gap-2",children:[e==="pausing"?l.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-slate-400",children:[l.jsx("span",{className:"inline-block w-3 h-3 border border-slate-400 border-t-slate-200 rounded-full animate-spin"}),"Pausing…"]}):e==="cancelling"?l.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[l.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin"}),"Cancelling…"]}):d?l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg border border-amber-300 bg-amber-50 text-amber-700 hover:bg-amber-100 transition-colors",children:"▶ Resume"}):l.jsx("button",{onClick:t,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"⏸ Pause"}),!e&&l.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50 transition-colors",children:"✕ Cancel"})]})]})]})}const NF=[{stage:"Project Documentation",ruleId:"fix-header-formatting",name:"Fix Header Spacing",severity:"major"},{stage:"Project Documentation",ruleId:"add-section-spacing",name:"Add Section Spacing",severity:"minor"},{stage:"Project Context",ruleId:"token-count-too-short",name:"Expand If Too Short",severity:"major"},{stage:"Project Context",ruleId:"no-redundant-info",name:"Remove Truly Redundant Information",severity:"minor"},{stage:"Context Validation",ruleId:"fix-unclosed-code-blocks",name:"Fix Unclosed Code Blocks",severity:"major"}];function kF({severity:e}){const t=e==="critical"?"bg-red-100 text-red-700":e==="major"?"bg-amber-100 text-amber-700":"bg-slate-100 text-slate-500";return l.jsx("span",{className:`flex-shrink-0 px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${t}`,children:e})}function PF({onClose:e}){var a,c;const{result:t}=ko(),n=t||{},r=((a=n.tokenUsage)==null?void 0:a.input)||0,i=((c=n.tokenUsage)==null?void 0:c.output)||0;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"text-5xl mb-3",children:"✅"}),l.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Sprint Planning Complete"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Your project has been decomposed into Epics and Stories. The kanban board will refresh."})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3 text-center",children:[l.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3",children:[l.jsx("div",{className:"text-2xl font-bold text-slate-900",children:n.epicsCreated??0}),l.jsx("div",{className:"text-xs text-slate-500",children:"Epics created"})]}),l.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3",children:[l.jsx("div",{className:"text-2xl font-bold text-slate-900",children:n.storiesCreated??0}),l.jsx("div",{className:"text-xs text-slate-500",children:"Stories created"})]})]}),(n.totalEpics!=null||n.totalStories!=null)&&l.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Total in project: ",n.totalEpics??0," Epics · ",n.totalStories??0," Stories"]}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsx(NS,{label:"Input tokens",value:r.toLocaleString()}),l.jsx(NS,{label:"Output tokens",value:i.toLocaleString()})]}),n.model&&l.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Model: ",l.jsx("span",{className:"font-mono",children:n.model})]}),(()=>{const u=n.validationIssues===void 0,d=n.validationIssues??NF;return d.length>0?l.jsxs("div",{children:[l.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["Quality fixes applied",u&&l.jsx("span",{className:"ml-2 normal-case font-normal text-slate-300",children:"(example preview)"})]}),l.jsx("div",{className:"space-y-1.5",children:d.map((p,h)=>l.jsxs("div",{className:"flex items-center gap-2 text-xs bg-amber-50 border border-amber-100 rounded-md px-3 py-2",children:[l.jsx(kF,{severity:p.severity}),l.jsx("span",{className:"text-slate-400 flex-shrink-0",children:p.stage}),l.jsx("span",{className:"text-slate-600",children:p.name})]},h))})]}):null})(),l.jsx("div",{className:"flex justify-center pt-2",children:l.jsx("button",{onClick:e,className:"px-6 py-2 bg-slate-900 text-white text-sm font-medium rounded-lg hover:bg-slate-700 transition-colors",children:"Close"})})]})}function CF({quotaLimitPending:e,onContinueAfterQuota:t,onCancel:n,onConfigureModels:r}){const[i,a]=b.useState(!1);async function c(){var u,d,p,h,m;a(!0);try{const v=(u=(await On()).ceremonies)==null?void 0:u.find(j=>j.name==="sprint-planning"),w=((p=(d=v==null?void 0:v.stages)==null?void 0:d.validation)==null?void 0:p.provider)||null,S=((m=(h=v==null?void 0:v.stages)==null?void 0:h.validation)==null?void 0:m.model)||null;await t(w,S)}finally{a(!1)}}return l.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:l.jsxs("div",{className:"bg-white border border-red-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[l.jsx("div",{className:"text-3xl",children:"⚠️"}),l.jsx("p",{className:"text-base font-semibold text-slate-900",children:"API Quota Exceeded"}),l.jsxs("p",{className:"text-sm text-slate-600",children:[l.jsx("span",{className:"font-mono font-medium",children:e.provider})," / ",l.jsx("span",{className:"font-mono text-xs",children:e.model})," returned a quota error."]}),e.validatorName&&l.jsxs("p",{className:"text-xs text-slate-400",children:["Validator: ",e.validatorName.replace("validator-story-","").replace("validator-epic-","")]}),l.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),l.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[l.jsx("button",{onClick:c,disabled:i,className:"px-4 py-2 text-sm rounded-lg bg-slate-900 text-white hover:bg-slate-700 disabled:opacity-50",children:i?"Resuming…":"Resume"}),l.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Configure Models"}),l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50",children:"Cancel Ceremony"})]}),l.jsxs("p",{className:"text-xs text-slate-400",children:["Use ",l.jsx("strong",{children:"Configure Models"})," to switch provider, then ",l.jsx("strong",{children:"Resume"}),"."]})]})})}function OF({onClose:e,costLimitPending:t,onContinuePastCostLimit:n,onCancelFromCostLimit:r,quotaLimitPending:i,onContinueAfterQuota:a,onCancelFromQuota:c}){const{isOpen:u,step:d,status:p,isPaused:h,setStep:m,setStatus:g,setError:v,closeModal:w,setProcessId:S}=ko(),[j,k]=b.useState(!1),[C,E]=b.useState(null),[A,P]=b.useState([]),[O,M]=b.useState([]),[I,z]=b.useState({}),[K,L]=b.useState(!1),[R,ee]=b.useState(null),[J,ne]=b.useState(null);if(b.useEffect(()=>{u&&d===1&&p!=="running"&&X3().then(te=>ne(te!=null&&te.resumable?te:null)).catch(()=>ne(null))},[u,d,p]),!u)return null;const re=p==="running"||p==="awaiting-selection",U=()=>{re||(w(),e==null||e())},B=async(te=null)=>{g("running"),m(2),ne(null);try{const se=await Y3(te);se!=null&&se.processId&&S(se.processId)}catch(se){g("error"),v(se.message)}},G=async()=>{var te;try{const[se,pe]=await Promise.all([On(),fs()]),Ne=((te=se.ceremonies)==null?void 0:te.find(Y=>Y.name==="sprint-planning"))??{name:"sprint-planning"};E(Ne),P(pe),M(se.ceremonies||[]),z(se.apiKeys||{}),k(!0)}catch{}},q=async te=>{const pe=(O.length>0?O:[te]).map(Ne=>Ne.name===te.name?te:Ne);await Kl(pe,null),E(te),M(pe)},_=async()=>{ee("pausing");try{await kC()}catch{}},V=async()=>{try{await PC()}catch{}},ie=async(te=!1)=>{L(!1),ee("cancelling");try{await io(te)}catch{}};b.useEffect(()=>{R==="pausing"&&h&&ee(null)},[h,R]),b.useEffect(()=>{R==="cancelling"&&p==="idle"&&ee(null)},[p,R]);const ue=()=>{switch(d){case 1:return l.jsx(bF,{onStart:()=>B(null),onResume:()=>B(J==null?void 0:J.checkpoint),resumeInfo:J});case 2:return l.jsx(SF,{transitioning:R,onPause:_,onResume:V,onCancel:()=>L(!0),onBackground:w});case 3:return l.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4 text-center",children:[l.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400"}),l.jsx("p",{className:"text-sm text-slate-500",children:"Reviewing decomposed work…"})]});case 4:return l.jsx(PF,{onClose:U});default:return null}};return l.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:re?void 0:U}),l.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-2xl mx-4 max-h-[90vh] flex flex-col",children:[t&&l.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:l.jsxs("div",{className:"bg-white border border-amber-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[l.jsx("div",{className:"text-3xl",children:"⚠️"}),l.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cost Limit Reached"}),l.jsxs("p",{className:"text-sm text-slate-600",children:[l.jsxs("span",{className:"font-mono font-medium",children:["$",t.cost.toFixed(4)]})," spent",t.threshold!=null&&l.jsxs(l.Fragment,{children:[" (limit: ",l.jsxs("span",{className:"font-mono",children:["$",Number(t.threshold).toFixed(2)]}),")"]})]}),l.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),l.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg bg-slate-900 text-white hover:bg-slate-700",children:"Continue Anyway"}),l.jsx("button",{onClick:r,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50",children:"Cancel Ceremony"})]}),l.jsx("p",{className:"text-xs text-slate-400",children:"Continue disables cost checking for the rest of this run."})]})}),i&&l.jsx(CF,{quotaLimitPending:i,onContinueAfterQuota:a,onCancel:c,onConfigureModels:G}),K&&l.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:l.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[l.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cancel sprint planning?"}),l.jsx("p",{className:"text-sm text-slate-500",children:"What should happen with epics and stories already created in this run?"}),l.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[l.jsx("button",{onClick:()=>L(!1),className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Keep Running"}),l.jsx("button",{onClick:()=>ie(!0),className:"px-4 py-2 text-sm rounded-lg border border-amber-300 bg-amber-50 text-amber-700 hover:bg-amber-100",children:"Cancel & Keep Items"}),l.jsx("button",{onClick:()=>ie(!1),className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700",children:"Cancel & Delete Items"})]})]})}),l.jsxs("div",{className:"flex items-start justify-between px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h1",{className:"text-base font-semibold text-slate-900",children:"Sprint Planning Ceremony"}),l.jsx("div",{className:"mt-2",children:l.jsx(yF,{currentStep:d})})]}),l.jsxs("div",{className:"flex items-center gap-3 ml-4 mt-0.5 flex-shrink-0",children:[!re&&l.jsxs("button",{type:"button",onClick:G,className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-blue-600 bg-slate-50 hover:bg-blue-50 border border-slate-200 hover:border-blue-200 rounded-md px-2.5 py-1.5 transition-colors whitespace-nowrap",title:"Configure ceremony models",children:[l.jsx(lo,{className:"w-3.5 h-3.5"}),"Select Model(s)"]}),!re&&l.jsx("button",{onClick:U,className:"text-slate-400 hover:text-slate-600 transition-colors",children:l.jsx(cn,{className:"w-5 h-5"})})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:ue()}),l.jsxs("div",{className:"flex-shrink-0 border-t border-slate-100 px-6 h-8 flex items-center gap-2",children:[p==="running"&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-3 h-3 border-2 border-blue-300 border-t-blue-600 rounded-full animate-spin flex-shrink-0"}),l.jsx("p",{className:"text-xs text-blue-600 font-medium truncate",children:"Running sprint planning…"})]}),p==="awaiting-selection"&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400 flex-shrink-0"}),l.jsx("p",{className:"text-xs text-amber-600 font-medium truncate",children:"Waiting for your selection to continue…"})]})]})]}),j&&C&&l.jsx(Sv,{ceremony:C,allCeremonies:O,apiKeys:I,models:A,readOnly:p==="running"&&!i,onSave:p!=="running"||i?q:void 0,onClose:()=>k(!1),onCeremoniesUpdated:te=>{M(te);const se=te.find(pe=>pe.name==="sprint-planning");se&&E(se)}})]})}function AF(){var k;const{isOpen:e,activeStoryId:t,sessions:n,closeModal:r,setStatus:i,appendProgress:a,setProcessId:c,setError:u,removeSession:d}=Hl(),p=b.useRef(null),h=t?n[t]:null;b.useEffect(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight)},[(k=h==null?void 0:h.progressLog)==null?void 0:k.length]);const m=b.useCallback(async C=>{i(C,"checking"),a(C,"Checking dependencies...");try{const E=await OC(C);if(!E.ready){i(C,"blocked");const P=(E.blockers||[]).map(O=>` ${O.id}: ${O.name} (${O.status})`).join(`
|
|
314
|
+
`);a(C,`Dependencies not met:
|
|
315
|
+
${P}`);return}a(C,"Dependencies OK. Starting seed ceremony..."),i(C,"seeding");const A=await SD(C);c(C,A.processId),a(C,`Process started: ${A.processId}`)}catch(E){u(C,E.message),a(C,`Error: ${E.message}`)}},[i,a,c,u]);if(b.useEffect(()=>{e&&t&&(h==null?void 0:h.status)==="idle"&&m(t)},[e,t,h==null?void 0:h.status,m]),!e||!h)return null;const{status:g,progressLog:v,storyName:w,error:S}=h,j=g==="seeding"||g==="checking";return l.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:j?void 0:r}),l.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-2xl mx-4 max-h-[90vh] flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-200",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`p-2 rounded-lg ${j||g==="complete"?"bg-green-100":g==="error"?"bg-red-100":"bg-slate-100"}`,children:j?l.jsx(Tf,{className:"w-5 h-5 text-green-600 animate-spin"}):g==="error"?l.jsx(na,{className:"w-5 h-5 text-red-600"}):l.jsx(SC,{className:"w-5 h-5 text-green-600"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"Seed Ceremony"}),l.jsx("p",{className:"text-xs text-slate-500 truncate max-w-[280px]",children:w})]})]}),l.jsx("button",{onClick:r,className:"p-1.5 text-slate-400 hover:text-slate-600 rounded-lg hover:bg-slate-100 transition-colors",children:l.jsx(cn,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-hidden px-6 py-4 space-y-4",children:[g==="complete"&&l.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3 text-center",children:[l.jsx("p",{className:"text-sm font-medium text-green-800",children:"Seed complete — tasks created"}),l.jsx("p",{className:"text-xs text-green-600 mt-1",children:"The kanban board will refresh automatically."})]}),g==="error"&&l.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:[l.jsx("p",{className:"text-sm font-medium text-red-800",children:"Seed failed"}),l.jsx("p",{className:"text-xs text-red-600 mt-1",children:S})]}),g==="blocked"&&l.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3",children:[l.jsx("p",{className:"text-sm font-medium text-amber-800",children:"Dependencies not met"}),l.jsx("p",{className:"text-xs text-amber-600 mt-1",children:"Complete the blocking items first, then retry."})]}),l.jsx("div",{ref:p,className:"bg-slate-900 rounded-lg p-4 h-80 overflow-y-auto font-mono text-xs",children:v.length===0?l.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing..."}):l.jsxs("div",{className:"space-y-0.5",children:[v.map((C,E)=>{var A,P,O,M;return l.jsx("div",{className:(A=C.startsWith)!=null&&A.call(C,"Error")?"text-red-400":(P=C.includes)!=null&&P.call(C,"complete")||(O=C.includes)!=null&&O.call(C,"Complete")?"text-green-400":(M=C.includes)!=null&&M.call(C,"Dependencies OK")?"text-blue-400":"text-slate-300",children:C},E)}),j&&l.jsx("div",{className:"text-slate-500 animate-pulse",children:"..."})]})})]}),l.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-slate-200",children:[j?l.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded-md px-2.5 py-1.5 transition-colors",title:"Hide this window — seed keeps running in the background",children:[l.jsx(Ef,{className:"w-3.5 h-3.5"}),"Run in Background"]}):l.jsx("span",{}),l.jsxs("div",{className:"flex items-center gap-2",children:[g==="blocked"&&l.jsx("button",{onClick:()=>{i(t,"idle")},className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"Retry"}),(g==="complete"||g==="error"||g==="blocked")&&l.jsx("button",{onClick:()=>{d(t)},className:"px-4 py-2 text-sm rounded-lg bg-slate-900 text-white hover:bg-slate-700 transition-colors",children:g==="complete"?"Done":"Dismiss"})]})]})]})]})}function EF(){var M,I,z,K;const{isOpen:e,activeTaskId:t,sessions:n,closeModal:r,setStatus:i,appendProgress:a,setProcessId:c,setError:u,removeSession:d}=Gl(),[p,h]=b.useState(null),[m,g]=b.useState(null),v=b.useRef(null),w=t?n[t]:null;b.useEffect(()=>{v.current&&(v.current.scrollTop=v.current.scrollHeight)},[(M=w==null?void 0:w.progressLog)==null?void 0:M.length]);const S=b.useCallback(async L=>{i(L,"checking"),a(L,"Checking dependencies...");try{const R=await OC(L);if(!R.ready){i(L,"blocked");const J=(R.blockers||[]).map(ne=>` ${ne.id}: ${ne.name} (${ne.status})`).join(`
|
|
316
|
+
`);a(L,`Dependencies not met:
|
|
317
|
+
${J}`);return}a(L,"Dependencies OK. Starting run ceremony..."),i(L,"running");const ee=await ND(L);c(L,ee.processId),a(L,`Process started: ${ee.processId}`)}catch(R){u(L,R.message),a(L,`Error: ${R.message}`)}},[i,a,c,u]);b.useEffect(()=>{(w==null?void 0:w.status)==="complete"&&t&&NC(t).then(L=>h(L)).catch(()=>h(null))},[w==null?void 0:w.status,t]),b.useEffect(()=>{e&&t&&(w==null?void 0:w.status)==="idle"&&S(t)},[e,t,w==null?void 0:w.status,S]);const j=b.useCallback(async L=>{if(t){g({path:L,content:null,loading:!0});try{const R=await D3(t,L);g({path:L,content:R.content,loading:!1})}catch(R){g({path:L,content:`Error: ${R.message}`,loading:!1})}}},[t]);if(!e||!w)return null;const{status:k,progressLog:C,taskName:E,error:A,reviewInfo:P}=w,O=k==="running"||k==="checking";return l.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:O?void 0:r}),l.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-[85vw] max-w-[1400px] mx-4 h-[90vh] flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-200",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:`p-2 rounded-lg ${O?"bg-blue-100":k==="complete"?"bg-green-100":k==="error"?"bg-red-100":"bg-slate-100"}`,children:O?l.jsx(Tf,{className:"w-5 h-5 text-blue-600 animate-spin"}):k==="error"?l.jsx(na,{className:"w-5 h-5 text-red-600"}):l.jsx(xg,{className:"w-5 h-5 text-blue-600"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"Run Task"}),l.jsx("p",{className:"text-xs text-slate-500 truncate max-w-[280px]",children:E})]})]}),l.jsx("button",{onClick:r,className:"p-1.5 text-slate-400 hover:text-slate-600 rounded-lg hover:bg-slate-100 transition-colors",children:l.jsx(cn,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 flex flex-col gap-3 min-h-0",children:[k==="blocked"&&l.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3 flex-shrink-0",children:[l.jsx("p",{className:"text-sm font-medium text-amber-800",children:"Dependencies not met"}),l.jsx("p",{className:"text-xs text-amber-600 mt-1",children:"Complete the blocking items first, then retry."})]}),k==="error"&&l.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 flex-shrink-0",children:[l.jsx("p",{className:"text-sm font-medium text-red-800",children:"Run failed"}),l.jsx("p",{className:"text-xs text-red-600 mt-1",children:A})]}),k==="complete"&&l.jsx("div",{className:"bg-green-50 border border-green-200 rounded-lg p-2.5 flex-shrink-0",children:l.jsx("p",{className:"text-sm font-medium text-green-800",children:"Implementation complete — ready for review"})}),l.jsxs("div",{className:"flex-1 flex gap-3 min-h-0",children:[l.jsxs("div",{className:"w-[30%] flex-shrink-0 flex flex-col gap-3 overflow-y-auto",children:[l.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(gg,{className:"w-4 h-4 text-slate-500"}),l.jsx("p",{className:"text-xs font-medium text-slate-700 uppercase tracking-wide",children:"Acceptance Criteria"}),(p==null?void 0:p.acceptanceStatus)&&l.jsxs("span",{className:"ml-auto text-xs text-green-600 font-medium",children:[p.acceptanceStatus.filter(L=>L.passed).length,"/",p.acceptanceStatus.length," passed"]})]}),p!=null&&p.acceptanceStatus?l.jsx("ul",{className:"space-y-1",children:p.acceptanceStatus.map((L,R)=>l.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[L.passed?l.jsx(I1,{className:"w-3.5 h-3.5 text-green-600 flex-shrink-0 mt-0.5"}):l.jsx(D1,{className:"w-3.5 h-3.5 text-red-500 flex-shrink-0 mt-0.5"}),l.jsx("span",{className:L.passed?"text-green-700":"text-red-700",children:L.criterion})]},R))}):l.jsx("p",{className:"text-xs text-slate-400 italic",children:"Pending — verified after tests pass"})]}),l.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-3 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[p!=null&&p.testResults?p.testResults.passed?l.jsx(I1,{className:"w-4 h-4 text-green-600"}):l.jsx(D1,{className:"w-4 h-4 text-red-600"}):l.jsx(xg,{className:"w-4 h-4 text-slate-400"}),l.jsx("p",{className:"text-xs font-medium text-slate-700 uppercase tracking-wide",children:"Test Results"}),(p==null?void 0:p.testResults)&&l.jsx("span",{className:`ml-auto text-xs font-medium ${p.testResults.passed?"text-green-600":"text-red-600"}`,children:p.testResults.passed?"All passed":"Failed"})]}),p!=null&&p.testResults?l.jsxs(l.Fragment,{children:[p.testResults.command&&l.jsxs("p",{className:"text-xs text-slate-500 font-mono",children:["$ ",p.testResults.command]}),l.jsx("pre",{className:"bg-slate-900 text-slate-300 text-xs font-mono rounded-md p-2.5 max-h-40 overflow-y-auto whitespace-pre-wrap",children:p.testResults.output||"(no output)"})]}):l.jsx("p",{className:"text-xs text-slate-400 italic",children:"Pending — agent runs tests during implementation"})]}),l.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-3 space-y-2",children:[l.jsx("p",{className:"text-xs font-medium text-slate-700 uppercase tracking-wide",children:"Files Modified"}),p!=null&&p.files&&((I=p.files.created)!=null&&I.length||(z=p.files.edited)!=null&&z.length||(K=p.files.deleted)!=null&&K.length)?l.jsxs("div",{className:"space-y-1",children:[(p.files.created||[]).map(L=>l.jsxs("button",{onClick:()=>j(L),className:"flex items-center gap-2 text-xs w-full text-left hover:bg-slate-100 rounded px-1 py-0.5 transition-colors",children:[l.jsx("span",{className:"text-green-600 font-medium w-14 flex-shrink-0",children:"created"}),l.jsx(hm,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}),l.jsx("span",{className:"font-mono text-blue-700 hover:underline truncate",children:L})]},L)),(p.files.edited||[]).map(L=>l.jsxs("button",{onClick:()=>j(L),className:"flex items-center gap-2 text-xs w-full text-left hover:bg-slate-100 rounded px-1 py-0.5 transition-colors",children:[l.jsx("span",{className:"text-amber-600 font-medium w-14 flex-shrink-0",children:"edited"}),l.jsx(hm,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}),l.jsx("span",{className:"font-mono text-blue-700 hover:underline truncate",children:L})]},L)),(p.files.deleted||[]).map(L=>l.jsxs("div",{className:"flex items-center gap-2 text-xs px-1 py-0.5",children:[l.jsx("span",{className:"text-red-600 font-medium w-14 flex-shrink-0",children:"deleted"}),l.jsx("span",{className:"font-mono text-slate-400 line-through truncate",children:L})]},L))]}):l.jsx("p",{className:"text-xs text-slate-400 italic",children:"Pending — tracked during implementation"})]}),l.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-3 space-y-2",children:[l.jsx("p",{className:"text-xs font-medium text-slate-700 uppercase tracking-wide",children:"Review Info"}),P?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-600",children:[l.jsx(b3,{className:"w-3.5 h-3.5 text-slate-400"}),l.jsx("span",{className:"font-mono bg-white border border-slate-200 rounded px-1.5 py-0.5 truncate",children:P.branchName})]}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-600",children:[l.jsx(y3,{className:"w-3.5 h-3.5 text-slate-400"}),l.jsx("span",{className:"font-mono bg-white border border-slate-200 rounded px-1.5 py-0.5 break-all text-[10px]",children:P.worktreePath})]})]}),l.jsxs("p",{className:"text-[10px] text-slate-500",children:["Tests passed. To verify: ",l.jsxs("code",{className:"bg-white border border-slate-200 rounded px-1",children:["cd ",P.worktreePath," && npm test"]})]})]}):l.jsx("p",{className:"text-xs text-slate-400 italic",children:"Pending — available after implementation"})]})]}),l.jsx("div",{ref:v,className:"flex-1 bg-slate-900 rounded-lg p-4 overflow-y-auto font-mono text-xs min-h-0",children:C.length===0?l.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing..."}):l.jsxs("div",{className:"space-y-0.5",children:[C.map((L,R)=>{var ee,J,ne,re,U,B,G,q,_,V,ie,ue;return l.jsx("div",{className:(ee=L.startsWith)!=null&&ee.call(L,"Error")?"text-red-400":(J=L.includes)!=null&&J.call(L,"complete")||(ne=L.includes)!=null&&ne.call(L,"Complete")?"text-green-400":(re=L.includes)!=null&&re.call(L,"Dependencies OK")?"text-blue-400":(U=L.includes)!=null&&U.call(L,"review")||(B=L.includes)!=null&&B.call(L,"Review")?"text-cyan-400":(G=L.startsWith)!=null&&G.call(L,"[run_command]")?"text-amber-300":(q=L.startsWith)!=null&&q.call(L,"[write_file]")||(_=L.startsWith)!=null&&_.call(L,"[edit_file]")?"text-blue-300":(V=L.startsWith)!=null&&V.call(L,"[read_file]")||(ie=L.startsWith)!=null&&ie.call(L,"[list_files]")||(ue=L.startsWith)!=null&&ue.call(L,"[search_code]")?"text-slate-400":"text-slate-300",children:L},R)}),O&&l.jsx("div",{className:"text-slate-500 animate-pulse",children:"..."})]})})]})]}),l.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-slate-200",children:[O?l.jsxs("button",{onClick:r,className:"flex items-center gap-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 bg-slate-50 hover:bg-slate-100 border border-slate-200 rounded-md px-2.5 py-1.5 transition-colors",title:"Hide this window — run keeps going in the background",children:[l.jsx(Ef,{className:"w-3.5 h-3.5"}),"Run in Background"]}):l.jsx("span",{}),l.jsxs("div",{className:"flex items-center gap-2",children:[k==="blocked"&&l.jsx("button",{onClick:()=>{i(t,"idle")},className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"Retry"}),(k==="complete"||k==="error"||k==="blocked")&&l.jsx("button",{onClick:()=>{d(t)},className:"px-4 py-2 text-sm rounded-lg bg-slate-900 text-white hover:bg-slate-700 transition-colors",children:k==="complete"?"Done":"Dismiss"})]})]}),m&&l.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-black/50 rounded-2xl",children:l.jsxs("div",{className:"bg-white rounded-xl shadow-2xl w-[90%] h-[85%] flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-slate-200",children:[l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(hm,{className:"w-4 h-4 text-slate-500 flex-shrink-0"}),l.jsx("span",{className:"font-mono text-sm text-slate-700 truncate",children:m.path})]}),l.jsx("button",{onClick:()=>g(null),className:"p-1 text-slate-400 hover:text-slate-600 rounded hover:bg-slate-100",children:l.jsx(cn,{className:"w-4 h-4"})})]}),l.jsx("pre",{className:"flex-1 overflow-auto bg-slate-900 text-slate-300 text-xs font-mono p-4 rounded-b-xl whitespace-pre",children:m.loading?"Loading...":m.content})]})})]})]})}function TF({hierarchy:e,onConfirm:t,onCancel:n}){const[r,i]=b.useState(()=>{const k={};for(const C of e.epics)k[C.id]=!0;return k}),[a,c]=b.useState(()=>{const k={};for(const C of e.epics)for(const E of C.stories||[])k[E.id]=!0;return k}),u=Object.values(r).filter(Boolean).length,d=e.epics.length,p=Object.values(a).filter(Boolean).length,h=e.epics.reduce((k,C)=>{var E;return k+(((E=C.stories)==null?void 0:E.length)||0)},0),m=u>0,g=(k,C)=>{i(A=>({...A,[k]:C}));const E=e.epics.find(A=>A.id===k);if(E){const A={};for(const P of E.stories||[])A[P.id]=C;c(P=>({...P,...A}))}},v=(k,C,E)=>{const A={...a,[C]:E};c(A);const P=e.epics.find(O=>O.id===k);if(P){const O=(P.stories||[]).some(M=>A[M.id]);i(M=>({...M,[k]:O}))}},w=()=>{const k={},C={};for(const E of e.epics){k[E.id]=!0;for(const A of E.stories||[])C[A.id]=!0}i(k),c(C)},S=()=>{const k={},C={};for(const E of e.epics){k[E.id]=!1;for(const A of E.stories||[])C[A.id]=!1}i(k),c(C)},j=()=>{const k=Object.entries(r).filter(([,E])=>E).map(([E])=>E),C=Object.entries(a).filter(([,E])=>E).map(([E])=>E);t(k,C)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[l.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"Review Decomposed Work"}),l.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"The AI has decomposed your scope into epics and stories. Select which items to carry forward into validation — deselected items will be skipped entirely."})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4 min-h-0",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("p",{className:"text-xs text-slate-500",children:[l.jsxs("span",{className:"font-medium text-slate-700",children:[u,"/",d]})," epics ·"," ",l.jsxs("span",{className:"font-medium text-slate-700",children:[p,"/",h]})," stories selected"]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("button",{onClick:w,className:"text-xs px-2 py-0.5 rounded border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"Select all"}),l.jsx("button",{onClick:S,className:"text-xs px-2 py-0.5 rounded border border-slate-200 text-slate-600 hover:bg-slate-50 transition-colors",children:"Deselect all"})]})]}),l.jsx("div",{className:"space-y-2",children:e.epics.map(k=>{const C=r[k.id]??!1,E=k.stories||[];return l.jsxs("div",{className:"rounded-lg border border-slate-200 overflow-hidden",children:[l.jsxs("label",{className:"flex items-start gap-3 px-4 py-3 bg-slate-50 cursor-pointer hover:bg-slate-100 select-none",children:[l.jsx("input",{type:"checkbox",checked:C,onChange:A=>g(k.id,A.target.checked),className:"mt-0.5 flex-shrink-0 accent-slate-900"}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("p",{className:"text-sm font-semibold text-slate-900 leading-snug",children:k.name}),k.description&&l.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:k.description}),l.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:[E.length," ",E.length===1?"story":"stories",k.domain?l.jsxs("span",{className:"ml-1 text-slate-300",children:["· ",k.domain]}):null]})]})]}),E.length>0&&l.jsx("div",{className:"divide-y divide-slate-100",children:E.map(A=>l.jsxs("label",{className:"flex items-start gap-3 px-4 py-2 pl-10 cursor-pointer hover:bg-slate-50 select-none",children:[l.jsx("input",{type:"checkbox",checked:a[A.id]??!1,onChange:P=>v(k.id,A.id,P.target.checked),className:"mt-0.5 flex-shrink-0 accent-slate-600"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-xs font-medium text-slate-800",children:A.name}),A.userType&&l.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:A.userType})]})]},A.id))})]},k.id)})})]}),l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-slate-200 flex-shrink-0",children:[l.jsx("button",{onClick:n,className:"px-4 py-2 text-sm rounded-lg border border-red-200 text-red-600 hover:bg-red-50 transition-colors",children:"✕ Cancel Run"}),l.jsx("button",{onClick:j,disabled:!m,className:"px-6 py-2 text-sm font-medium bg-slate-900 text-white rounded-lg hover:bg-slate-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors",children:"Confirm Selection →"})]})]})}function MF(){const{status:e,decomposedHierarchy:t,setStatus:n,setStep:r,setDecomposedHierarchy:i,setError:a}=ko(),[c,u]=b.useState(!1);if(e!=="awaiting-selection"||!t)return null;const d=async(h,m)=>{i(null),n("running"),r(2);try{await Q3(h,m)}catch(g){n("error"),a(g.message)}},p=async()=>{u(!1);try{await io()}catch{}};return l.jsxs("div",{className:"fixed inset-0 z-[80] flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 bg-black/60"}),l.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-2xl mx-4 max-h-[90vh] flex flex-col",children:[c&&l.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:l.jsxs("div",{className:"bg-white border border-slate-200 rounded-xl shadow-lg p-6 max-w-sm mx-4 text-center space-y-4",children:[l.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cancel sprint planning?"}),l.jsx("p",{className:"text-sm text-slate-500",children:"Any epics and stories created in this run will be permanently deleted."}),l.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[l.jsx("button",{onClick:()=>u(!1),className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Go Back"}),l.jsx("button",{onClick:p,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700",children:"Cancel Run"})]})]})}),l.jsx(TF,{hierarchy:t,onConfirm:d,onCancel:()=>u(!0)})]})]})}function _F(e){if(e<=0)return"expired";if(e<60)return`${e}s`;const t=Math.floor(e/60);return t<60?`${t} min`:`${Math.floor(t/60)}h ${t%60}m`}function IF({apiKeyInfo:e,onSaved:t}){var B,G;const[n,r]=b.useState((e==null?void 0:e.authMode)||"api-key"),[i,a]=b.useState(""),[c,u]=b.useState(!1),[d,p]=b.useState(null),[h,m]=b.useState((B=e==null?void 0:e.oauth)!=null&&B.connected?"connected":"idle"),[g,v]=b.useState((e==null?void 0:e.oauth)||{connected:!1}),[w,S]=b.useState(null),j=b.useRef(null),k=b.useRef(null),[C,E]=b.useState(null),[A,P]=b.useState(((G=e==null?void 0:e.oauth)==null?void 0:G.fallback)??!1),[O,M]=b.useState(null);b.useEffect(()=>{var q,_;r((e==null?void 0:e.authMode)||"api-key"),v((e==null?void 0:e.oauth)||{connected:!1}),P(((q=e==null?void 0:e.oauth)==null?void 0:q.fallback)??!1),(_=e==null?void 0:e.oauth)!=null&&_.connected&&m("connected")},[e]),b.useEffect(()=>()=>{j.current&&clearInterval(j.current),k.current&&clearTimeout(k.current)},[]);const I=()=>{j.current=setInterval(async()=>{try{const q=await yD();q.connected&&(v(q),m("connected"),S(null),z(),t())}catch{}},2e3),k.current=setTimeout(()=>{z(),m("idle")},3e5)},z=()=>{j.current&&(clearInterval(j.current),j.current=null),k.current&&(clearTimeout(k.current),k.current=null)},K=q=>{q!==n&&(n==="oauth"&&h==="connecting"&&(z(),m("idle"),S(null)),q==="oauth"&&m(g.connected?"connected":"idle"),r(q))},L=async()=>{m("connecting"),S(null);try{const q=await xD();S(q.authorizeUrl||null),I()}catch(q){m("idle"),console.error("OAuth connect error:",q)}},R=()=>{z(),m("idle"),S(null)},ee=async()=>{try{await vD()}catch{}m("idle"),v({connected:!1}),E(null),r("api-key"),t()},J=async q=>{M("saving");try{await wD(q),P(q),M(null)}catch(_){M({error:_.message}),setTimeout(()=>M(null),4e3)}},ne=async()=>{E("running");try{const q=await bD();E(q)}catch(q){E({error:q.message})}},re=async()=>{p("saving");try{await Od({openai:i}),p("saved"),a(""),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}},U=async()=>{p("clearing");try{await Od({openai:""}),p("saved"),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}};return l.jsxs("div",{className:"py-3 border-b border-slate-100 last:border-0",children:[l.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[l.jsxs("div",{className:"w-36 flex-shrink-0",children:[l.jsx("p",{className:"text-sm font-medium text-slate-800",children:"OpenAI"}),l.jsx("p",{className:"text-xs text-slate-400",children:"Auth mode"})]}),l.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 rounded-lg p-1",children:[l.jsx("button",{type:"button",onClick:()=>K("api-key"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${n==="api-key"?"bg-white text-slate-800 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:"API Key"}),l.jsx("button",{type:"button",onClick:()=>K("oauth"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${n==="oauth"?"bg-white text-slate-800 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:"Subscription"})]})]}),n==="api-key"&&l.jsxs("div",{className:"flex items-center gap-3 pl-0 pt-1",children:[l.jsx("div",{className:"w-36 flex-shrink-0",children:l.jsx("p",{className:"text-xs text-slate-400",children:"OPENAI_API_KEY"})}),l.jsx("div",{className:"w-16 flex-shrink-0",children:e!=null&&e.isSet?l.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 rounded-full px-2 py-0.5",children:"✓ Set"}):l.jsx("span",{className:"inline-flex items-center text-xs font-medium text-slate-400 bg-slate-50 border border-slate-200 rounded-full px-2 py-0.5",children:"Not set"})}),(e==null?void 0:e.isSet)&&!i&&l.jsx("p",{className:"text-xs text-slate-400 font-mono flex-shrink-0",children:e.preview}),l.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{type:c?"text":"password",value:i,onChange:q=>a(q.target.value),placeholder:e!=null&&e.isSet?"Enter new key to update…":"sk-…",className:"w-full rounded-md border border-slate-300 px-2 py-1.5 pr-8 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono"}),l.jsx("button",{type:"button",onClick:()=>u(q=>!q),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:c?l.jsx($x,{className:"w-3.5 h-3.5"}):l.jsx(Pd,{className:"w-3.5 h-3.5"})})]}),(e==null?void 0:e.isSet)&&!i&&l.jsx("button",{type:"button",onClick:U,disabled:d==="clearing",className:"px-3 py-1.5 text-xs font-medium border border-red-200 text-red-600 rounded-md hover:bg-red-50 transition-colors disabled:opacity-40 flex-shrink-0",children:d==="clearing"?"…":"Reset"}),l.jsx("button",{type:"button",onClick:re,disabled:!i.trim()||d==="saving",className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40 flex-shrink-0",children:d==="saving"?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):d==="saved"?"✓ Saved":d==="error"?"✗ Error":"Save"})]})]}),n==="oauth"&&l.jsxs("div",{className:"pl-0 pt-1",children:[h==="idle"&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("p",{className:"text-xs text-slate-500",children:[l.jsx("span",{className:"font-medium text-amber-700",children:"ℹ"})," ","Requires a ",l.jsx("strong",{children:"ChatGPT Pro"})," subscription ($200/mo). Only Codex-endpoint models work (",l.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"gpt-5.2-codex"}),","," ",l.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"gpt-5.3-codex"}),"). This endpoint is unofficial and may change without notice."]}),l.jsx("div",{children:l.jsx("button",{type:"button",onClick:L,className:"inline-flex items-center gap-1.5 px-4 py-1.5 text-xs font-medium bg-emerald-600 text-white rounded-md hover:bg-emerald-700 transition-colors",children:"Connect with ChatGPT ↗"})})]}),h==="connecting"&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("p",{className:"text-xs text-slate-600 flex items-center gap-2",children:[l.jsx("span",{className:"w-3 h-3 border border-slate-400 border-t-slate-700 rounded-full animate-spin inline-block"}),"Waiting for browser login…"]}),w&&l.jsxs("p",{className:"text-xs text-slate-500",children:["If your browser did not open,"," ",l.jsx("a",{href:w,target:"_blank",rel:"noreferrer",className:"text-blue-600 underline break-all",children:"click here to authenticate"}),"."]}),l.jsx("div",{children:l.jsx("button",{type:"button",onClick:R,className:"px-3 py-1 text-xs font-medium border border-slate-300 rounded-md text-slate-600 hover:bg-slate-50 transition-colors",children:"Cancel"})})]}),h==="connected"&&l.jsxs("div",{className:"flex flex-col gap-2",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-emerald-700 bg-emerald-50 border border-emerald-200 rounded-full px-2 py-0.5",children:"✓ Connected"}),g.accountId&&l.jsx("span",{className:"text-xs text-slate-500 font-mono",children:g.accountId}),g.expiresIn!=null&&l.jsxs("span",{className:"text-xs text-slate-400",children:["· expires in ",_F(g.expiresIn)]}),l.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[l.jsx("button",{type:"button",onClick:ne,disabled:C==="running",className:"w-14 flex items-center justify-center py-1 text-xs font-medium border border-emerald-300 rounded-md text-emerald-700 hover:bg-emerald-50 transition-colors disabled:opacity-40",children:C==="running"?l.jsx("span",{className:"w-3 h-3 border border-emerald-400 border-t-emerald-700 rounded-full animate-spin"}):"Test"}),l.jsx("button",{type:"button",onClick:ee,className:"px-3 py-1 text-xs font-medium border border-slate-300 rounded-md text-slate-600 hover:bg-slate-50 transition-colors",children:"Disconnect"})]})]}),C&&C!=="running"&&l.jsx("div",{className:`text-xs rounded-md px-3 py-2 font-mono ${C.error?"bg-red-50 text-red-700 border border-red-200":"bg-slate-50 text-slate-700 border border-slate-200"}`,children:C.error?`✗ ${C.error}`:`✓ ${C.response||"Connected"} [${C.model} · ${C.elapsed}ms]`}),(e==null?void 0:e.isSet)&&l.jsxs("div",{className:"flex items-center gap-3 pt-1 border-t border-slate-100",children:[l.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:"checkbox",checked:A,disabled:O==="saving",onChange:q=>J(q.target.checked),className:"sr-only"}),l.jsx("div",{onClick:()=>O!=="saving"&&J(!A),className:`w-8 h-4 rounded-full transition-colors cursor-pointer ${A?"bg-blue-500":"bg-slate-300"} ${O==="saving"?"opacity-40":""}`,children:l.jsx("div",{className:`absolute top-0.5 left-0.5 w-3 h-3 bg-white rounded-full shadow transition-transform ${A?"translate-x-4":""}`})})]}),l.jsx("span",{className:"text-xs text-slate-600",children:"Fallback to API Key on failure"})]}),(O==null?void 0:O.error)&&l.jsx("span",{className:"text-xs text-red-600",children:O.error})]})]})]})]})}const DF=[{key:"anthropic",label:"Anthropic",envKey:"ANTHROPIC_API_KEY",placeholder:"sk-ant-…"},{key:"gemini",label:"Google (Gemini)",envKey:"GEMINI_API_KEY",placeholder:"AIza…"},{key:"xiaomi",label:"Xiaomi (MiMo)",envKey:"XIAOMI_API_KEY",placeholder:"sk-…"}];function RF({provider:e,apiKeyInfo:t,onSaved:n}){const[r,i]=b.useState(""),[a,c]=b.useState(!1),[u,d]=b.useState(null),p=async()=>{d("saving");try{await Od({[e.key]:r}),d("saved"),i(""),n(),setTimeout(()=>d(null),2e3)}catch{d("error"),setTimeout(()=>d(null),2e3)}},h=async()=>{d("clearing");try{await Od({[e.key]:""}),d("saved"),n(),setTimeout(()=>d(null),2e3)}catch{d("error"),setTimeout(()=>d(null),2e3)}};return l.jsxs("div",{className:"flex items-center gap-3 py-3 border-b border-slate-100 last:border-0",children:[l.jsxs("div",{className:"w-36 flex-shrink-0",children:[l.jsx("p",{className:"text-sm font-medium text-slate-800",children:e.label}),l.jsx("p",{className:"text-xs text-slate-400",children:e.envKey})]}),l.jsx("div",{className:"w-16 flex-shrink-0",children:t.isSet?l.jsx("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 rounded-full px-2 py-0.5",children:"✓ Set"}):l.jsx("span",{className:"inline-flex items-center text-xs font-medium text-slate-400 bg-slate-50 border border-slate-200 rounded-full px-2 py-0.5",children:"Not set"})}),t.isSet&&!r&&l.jsx("p",{className:"text-xs text-slate-400 font-mono flex-shrink-0",children:t.preview}),l.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{type:a?"text":"password",value:r,onChange:m=>i(m.target.value),placeholder:t.isSet?"Enter new key to update…":e.placeholder,className:"w-full rounded-md border border-slate-300 px-2 py-1.5 pr-8 text-xs text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono"}),l.jsx("button",{type:"button",onClick:()=>c(m=>!m),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:a?l.jsx($x,{className:"w-3.5 h-3.5"}):l.jsx(Pd,{className:"w-3.5 h-3.5"})})]}),t.isSet&&!r&&l.jsx("button",{type:"button",onClick:h,disabled:u==="clearing",className:"px-3 py-1.5 text-xs font-medium border border-red-200 text-red-600 rounded-md hover:bg-red-50 transition-colors disabled:opacity-40 flex-shrink-0",children:u==="clearing"?"…":"Reset"}),l.jsx("button",{type:"button",onClick:p,disabled:!r.trim()||u==="saving",className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40 flex-shrink-0",children:u==="saving"?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):u==="saved"?"✓ Saved":u==="error"?"✗ Error":"Save"})]})]})}function LF({settings:e,onSaved:t}){return l.jsxs("div",{className:"px-5 py-4",children:[l.jsxs("p",{className:"text-xs text-slate-500 mb-4",children:["API keys are stored in your project's ",l.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:".env"})," file. Enter a new key and click Save to update. Clear the field and save to remove a key."]}),l.jsxs("div",{children:[DF.map(n=>l.jsx(RF,{provider:n,apiKeyInfo:e.apiKeys[n.key],onSaved:t},n.key)),l.jsx(IF,{apiKeyInfo:e.apiKeys.openai,onSaved:t})]})]})}function $F(e){return e.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}const zF={"sponsor-call":"Generates mission statement and project documentation through a structured AI-guided interview.","sprint-planning":"Decomposes project scope into epics and stories with multi-agent validation and context generation.",seed:"Decomposes a story into implementable tasks and subtasks with documentation and context files.",run:"Implements task code in a git worktree using AI agents with traceability rules validation."};function FF({settings:e,models:t,onSaved:n}){const[r,i]=b.useState(()=>JSON.parse(JSON.stringify(e.ceremonies||[]))),[a,c]=b.useState(()=>{var m;return JSON.parse(JSON.stringify(((m=e.missionGenerator)==null?void 0:m.validation)||{maxIterations:3,acceptanceThreshold:95}))}),[u,d]=b.useState(null),p=async(m,g)=>{const v=r.map(S=>S.name===m.name?m:S),w=m.name==="sponsor-call"?{validation:g||a}:{validation:a};await Kl(v,w),i(v),m.name==="sponsor-call"&&g&&c(g),n()};if(!r.length)return l.jsx("div",{className:"px-5 py-8 text-center",children:l.jsx("p",{className:"text-sm text-slate-500",children:"No ceremony configurations found yet. Run your first ceremony from the kanban board to populate settings here."})});const h=r.find(m=>m.name===u);return l.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[r.map(m=>{const g=zF[m.name];return l.jsxs("div",{className:"border border-slate-200 rounded-lg px-4 py-3 flex items-center justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-semibold text-slate-800",children:m.displayName||$F(m.name||"")}),g&&l.jsx("p",{className:"text-xs text-slate-500 mt-0.5 leading-relaxed",children:g})]}),l.jsxs("button",{type:"button",onClick:()=>d(m.name),className:"flex items-center gap-1.5 text-xs font-medium text-blue-600 hover:text-blue-700 bg-blue-50 hover:bg-blue-100 border border-blue-200 rounded-md px-3 py-1.5 transition-colors flex-shrink-0",children:[l.jsx(T3,{className:"w-3.5 h-3.5"}),"Configure Models"]})]},m.name)}),u&&h&&l.jsx(Sv,{ceremony:h,allCeremonies:r,apiKeys:e.apiKeys,models:t,missionGenValidation:u==="sponsor-call"?a:null,onClose:()=>d(null),onSave:p,onCeremoniesUpdated:m=>{i(m),n()}})]})}function BF({settings:e,onSaved:t}){const[n,r]=b.useState(String(e.kanbanPort||4174)),[i,a]=b.useState(String(e.docsPort||4173)),[c,u]=b.useState(e.boardTitle||"AVC Kanban Board"),[d,p]=b.useState(null),[h,m]=b.useState(null),g=async()=>{p("saving");try{await z1({kanbanPort:Number(n),docsPort:Number(i)}),p("saved"),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}},v=async()=>{const w=c.trim();if(w){m("saving");try{await z1({boardTitle:w}),m("saved"),t(),setTimeout(()=>m(null),2e3)}catch{m("error"),setTimeout(()=>m(null),2e3)}}};return l.jsxs("div",{className:"px-5 py-4 flex flex-col gap-6",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-3",children:"General"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Board title"}),l.jsx("input",{type:"text",value:c,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&v()},className:"flex-1 max-w-xs rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500"}),l.jsx("button",{type:"button",onClick:v,disabled:!c.trim()||h==="saving",className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:h==="saving"?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):h==="saved"?"✓ Saved":h==="error"?"✗ Error":"Save"})]})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-3",children:"Server Ports"}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Kanban board"}),l.jsx("input",{type:"number",min:"1024",max:"65535",value:n,onChange:w=>r(w.target.value),className:"w-24 rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Documentation"}),l.jsx("input",{type:"number",min:"1024",max:"65535",value:i,onChange:w=>a(w.target.value),className:"w-24 rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),l.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[l.jsx("div",{className:"w-28 flex-shrink-0"}),l.jsx("button",{type:"button",onClick:g,disabled:d==="saving",className:"px-3 py-1.5 text-xs font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:d==="saving"?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):d==="saved"?"✓ Saved":d==="error"?"✗ Error":"Save"})]})]}),l.jsxs("p",{className:"text-xs text-slate-400 mt-3",children:["Changing ports requires restarting the servers (run ",l.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"/kanban"})," and ",l.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"/documentation"}),")."]})]})]})}const VF=["claude","gemini","openai","xiaomi"],UF={claude:"Claude",gemini:"Gemini",openai:"OpenAI",xiaomi:"Xiaomi MiMo"},WF={claude:{active:"border-orange-500 text-orange-700",badge:"bg-orange-50 text-orange-700 border-orange-200"},gemini:{active:"border-blue-500 text-blue-700",badge:"bg-blue-50 text-blue-700 border-blue-200"},openai:{active:"border-green-500 text-green-700",badge:"bg-green-50 text-green-700 border-green-200"},xiaomi:{active:"border-purple-500 text-purple-700",badge:"bg-purple-50 text-purple-700 border-purple-200"}},qF={claude:"bg-orange-50 text-orange-700 border-orange-200",gemini:"bg-blue-50 text-blue-700 border-blue-200",openai:"bg-green-50 text-green-700 border-green-200",xiaomi:"bg-purple-50 text-purple-700 border-purple-200"},Dm=[{value:"million",label:"per 1M tokens"},{value:"thousand",label:"per 1K tokens"}];function KF(e){var n,r,i,a,c,u;const t={};for(const[d,p]of Object.entries(e))t[d]={input:String(((n=p.pricing)==null?void 0:n.input)??""),inputCached:String(((r=p.pricing)==null?void 0:r.inputCached)??""),output:String(((i=p.pricing)==null?void 0:i.output)??""),unit:((a=p.pricing)==null?void 0:a.unit)??"million",source:((c=p.pricing)==null?void 0:c.source)??"",lastUpdated:((u=p.pricing)==null?void 0:u.lastUpdated)??""};return t}function HF(e){return e?new Date(e+"T00:00:00").toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):null}function GF({settings:e,onSaved:t}){const n=e.models||{},[r,i]=b.useState(()=>KF(n)),[a,c]=b.useState(null),u=VF.filter(v=>Object.values(n).some(w=>w.provider===v)),[d,p]=b.useState(()=>u[0]||"claude"),h=Object.entries(n).filter(([,v])=>v.provider===d),m=(v,w,S)=>{i(j=>({...j,[v]:{...j[v],[w]:S}}))},g=async()=>{c("saving");try{const v={};for(const[w,S]of Object.entries(r))v[w]={pricing:{input:parseFloat(S.input)||0,inputCached:parseFloat(S.inputCached)||0,output:parseFloat(S.output)||0,unit:S.unit,source:S.source}};await U3(v),c("saved"),t(),setTimeout(()=>c(null),2e3)}catch{c("error"),setTimeout(()=>c(null),2e3)}};return h.length===0?l.jsx("div",{className:"px-5 py-8 text-center",children:l.jsx("p",{className:"text-sm text-slate-500",children:"No models configured yet. Run your first ceremony to populate model settings."})}):l.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[l.jsxs("p",{className:"text-xs text-slate-500",children:["Set the cost per token for each model. These rates are used by the cost tracker to estimate LLM spend. Prices are in ",l.jsx("strong",{children:"USD"}),"."]}),u.length>1&&l.jsx("div",{className:"flex border-b border-slate-200 -mx-5 px-5",children:u.map(v=>{const w=WF[v]||{active:"border-slate-900 text-slate-900"},S=v===d,j=Object.values(n).filter(k=>k.provider===v).length;return l.jsxs("button",{type:"button",onClick:()=>p(v),className:`px-4 py-2.5 text-sm font-medium border-b-2 -mb-px transition-colors ${S?w.active:"border-transparent text-slate-500 hover:text-slate-700"}`,children:[UF[v]||v,l.jsx("span",{className:`ml-1.5 text-xs px-1.5 py-0.5 rounded-full border ${S?w.badge:"bg-slate-100 text-slate-400 border-slate-200"}`,children:j})]},v)})}),l.jsx("div",{className:"flex flex-col gap-2",children:h.map(([v,w])=>{var k,C;const S=r[v]??{input:"",output:"",unit:"million"},j=qF[w.provider]||"bg-slate-50 text-slate-600 border-slate-200";return l.jsxs("div",{className:"border border-slate-200 rounded-lg p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[l.jsx("span",{className:"text-sm font-semibold text-slate-800",children:w.displayName||v}),l.jsx("span",{className:`text-xs font-medium border rounded-full px-2 py-0.5 ${j}`,children:w.provider}),l.jsx("span",{className:"text-xs text-slate-400 font-mono ml-auto",children:v}),S.lastUpdated&&l.jsxs("span",{className:"text-xs text-slate-400 whitespace-nowrap",children:["verified ",HF(S.lastUpdated)]})]}),l.jsxs("div",{className:"grid grid-cols-[80px_1fr_1fr] gap-x-3 gap-y-2 items-center text-xs",children:[l.jsx("div",{}),l.jsx("div",{className:"text-slate-400 font-medium",children:"Price (USD $)"}),l.jsx("div",{className:"text-slate-400 font-medium",children:"Unit"}),l.jsx("label",{className:"text-slate-600 font-medium",children:"Input"}),l.jsx("input",{type:"number",min:"0",step:"0.01",value:S.input,onChange:E=>m(v,"input",E.target.value),placeholder:"0.00",className:"rounded-md border border-slate-300 px-2 py-1.5 text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full max-w-[120px]"}),l.jsx("select",{value:S.unit,onChange:E=>m(v,"unit",E.target.value),className:"rounded-md border border-slate-300 px-2 py-1.5 text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white w-full max-w-[160px]",children:Dm.map(E=>l.jsx("option",{value:E.value,children:E.label},E.value))}),l.jsx("label",{className:"text-slate-600 font-medium",children:"Cache Read"}),l.jsx("input",{type:"number",min:"0",step:"0.01",value:S.inputCached,onChange:E=>m(v,"inputCached",E.target.value),placeholder:"0.00",className:"rounded-md border border-slate-300 px-2 py-1.5 text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full max-w-[120px]"}),l.jsxs("span",{className:"text-slate-400 text-xs",children:[(k=Dm.find(E=>E.value===S.unit))==null?void 0:k.label," · discounted"]}),l.jsx("label",{className:"text-slate-600 font-medium",children:"Output"}),l.jsx("input",{type:"number",min:"0",step:"0.01",value:S.output,onChange:E=>m(v,"output",E.target.value),placeholder:"0.00",className:"rounded-md border border-slate-300 px-2 py-1.5 text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full max-w-[120px]"}),l.jsx("span",{className:"text-slate-400",children:(C=Dm.find(E=>E.value===S.unit))==null?void 0:C.label}),l.jsx("label",{className:"text-slate-600 font-medium",children:"Source"}),l.jsxs("div",{className:"col-span-2 flex items-center gap-1.5",children:[l.jsx("input",{type:"url",value:S.source,readOnly:!0,placeholder:"https://provider.com/pricing",className:"flex-1 rounded-md border border-slate-200 bg-slate-50 px-2 py-1.5 text-xs text-slate-500 cursor-default focus:outline-none min-w-0"}),S.source&&l.jsx("a",{href:S.source,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:text-blue-700 shrink-0",title:"Open pricing page",children:l.jsx(g3,{className:"w-3.5 h-3.5"})})]})]})]},v)})}),l.jsx("div",{className:"flex justify-end pt-1",children:l.jsx("button",{type:"button",onClick:g,disabled:a==="saving",className:"px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:a==="saving"?l.jsxs("span",{className:"inline-flex items-center gap-2",children:[l.jsx("span",{className:"w-3.5 h-3.5 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving…"]}):a==="saved"?"✓ Saved":a==="error"?"✗ Error":"Save Pricing"})})]})}const gA=[{ceremony:"Sponsor Call",color:"blue",phases:[{phase:"Mission & Scope",agents:[{slug:"mission-scope-generator",label:"Mission Scope Generator",note:"Generates mission & initial scope"},{slug:"mission-scope-validator",label:"Mission Scope Validator",note:"Validates mission quality"}]},{phase:"Questionnaire",agents:[{slug:"suggestion-product-manager",label:"Product Manager",note:"Fills Initial Scope"},{slug:"suggestion-ux-researcher",label:"UX Researcher",note:"Fills Target Users"},{slug:"suggestion-deployment-architect",label:"Deployment Architect",note:"Fills Deployment Target"},{slug:"suggestion-technical-architect",label:"Technical Architect",note:"Fills Technical Considerations"},{slug:"suggestion-security-specialist",label:"Security Specialist",note:"Fills Security & Compliance"},{slug:"architecture-recommender",label:"Architecture Recommender",note:"Recommends deployment architectures"},{slug:"database-recommender",label:"Database Recommender",note:"Recommends database type"},{slug:"database-deep-dive",label:"Database Deep Dive",note:"Detailed database analysis"},{slug:"question-prefiller",label:"Question Prefiller",note:"Pre-fills answers from architecture"}]},{phase:"Documentation",agents:[{slug:"project-documentation-creator",label:"Documentation Creator",note:"Creates project documentation"},{slug:"validator-documentation",label:"Documentation Validator",note:"Validates documentation quality"}]},{phase:"Context",agents:[{slug:"migration-guide-generator",label:"Migration Guide Generator",note:"Generates cloud migration guide"}]}]},{ceremony:"Sprint Planning",color:"purple",phases:[{phase:"Decomposition",agents:[{slug:"epic-story-decomposer",label:"Epic Story Decomposer",note:"Breaks scope into epics & stories"}]},{phase:"Contextual Selection",agents:[{slug:"project-context-extractor",label:"Project Context Extractor",note:"Extracts project traits (once per run) to inform validator selection"},{slug:"validator-selector",label:"Validator Selector",note:"Selects appropriate domain validators"},{slug:"agent-selector",label:"Agent Selector",note:"Selects relevant validators per Epic/Story based on project context"}]},{phase:"Context Generation",agents:[{slug:"context-writer-epic",label:"Context Writer (Epic)",note:"Writes complete canonical context.md — Purpose, Scope, NFRs, Success Criteria"},{slug:"context-reviewer-epic",label:"Context Reviewer (Epic)",note:"Independent accuracy audit: checks all features present, no hallucinations, sections complete"},{slug:"context-writer-story",label:"Context Writer (Story)",note:"Writes complete canonical context.md — User Story framing, Technical Notes, Scope boundaries"},{slug:"context-reviewer-story",label:"Context Reviewer (Story)",note:"Independent accuracy audit: checks all ACs present, no hallucinations, sections complete"}]},{phase:"Documentation & Enrichment",agents:[{slug:"doc-writer-epic",label:"Doc Writer (Epic)",note:"Generates narrative epic doc.md from canonical context.md"},{slug:"doc-writer-story",label:"Doc Writer (Story)",note:"Generates narrative story doc.md from canonical context.md"},{slug:"story-doc-enricher",label:"Story Doc Enricher",note:"Enriches story docs with API contracts, error tables, DB fields, business rules"}]},{phase:"Micro-Check Definitions — Epic",agents:[{slug:"checks/epic/solution-architect",label:"Solution Architect",note:"JSON",isCheck:!0},{slug:"checks/epic/developer",label:"Developer",note:"JSON",isCheck:!0},{slug:"checks/epic/security",label:"Security",note:"JSON",isCheck:!0},{slug:"checks/epic/devops",label:"DevOps",note:"JSON",isCheck:!0},{slug:"checks/epic/cloud",label:"Cloud",note:"JSON",isCheck:!0},{slug:"checks/epic/backend",label:"Backend",note:"JSON",isCheck:!0},{slug:"checks/epic/database",label:"Database",note:"JSON",isCheck:!0},{slug:"checks/epic/api",label:"API",note:"JSON",isCheck:!0},{slug:"checks/epic/frontend",label:"Frontend",note:"JSON",isCheck:!0},{slug:"checks/epic/ui",label:"UI",note:"JSON",isCheck:!0},{slug:"checks/epic/ux",label:"UX",note:"JSON",isCheck:!0},{slug:"checks/epic/mobile",label:"Mobile",note:"JSON",isCheck:!0},{slug:"checks/epic/data",label:"Data",note:"JSON",isCheck:!0},{slug:"checks/epic/qa",label:"QA",note:"JSON",isCheck:!0},{slug:"checks/epic/test-architect",label:"Test Architect",note:"JSON",isCheck:!0}]},{phase:"Micro-Check Definitions — Story",agents:[{slug:"checks/story/solution-architect",label:"Solution Architect",note:"JSON",isCheck:!0},{slug:"checks/story/developer",label:"Developer",note:"JSON",isCheck:!0},{slug:"checks/story/security",label:"Security",note:"JSON",isCheck:!0},{slug:"checks/story/devops",label:"DevOps",note:"JSON",isCheck:!0},{slug:"checks/story/cloud",label:"Cloud",note:"JSON",isCheck:!0},{slug:"checks/story/backend",label:"Backend",note:"JSON",isCheck:!0},{slug:"checks/story/database",label:"Database",note:"JSON",isCheck:!0},{slug:"checks/story/api",label:"API",note:"JSON",isCheck:!0},{slug:"checks/story/frontend",label:"Frontend",note:"JSON",isCheck:!0},{slug:"checks/story/ui",label:"UI",note:"JSON",isCheck:!0},{slug:"checks/story/ux",label:"UX",note:"JSON",isCheck:!0},{slug:"checks/story/mobile",label:"Mobile",note:"JSON",isCheck:!0},{slug:"checks/story/data",label:"Data",note:"JSON",isCheck:!0},{slug:"checks/story/qa",label:"QA",note:"JSON",isCheck:!0},{slug:"checks/story/test-architect",label:"Test Architect",note:"JSON",isCheck:!0},{slug:"story-splitter",label:"Story Splitter",note:"Splits oversized stories (15+ ACs) into 2-3 focused stories"}]},{phase:"Cross-Reference Checks",agents:[{slug:"checks/cross-refs/epic",label:"Epic Cross-Refs",note:"JSON",isCheck:!0},{slug:"checks/cross-refs/story",label:"Story Cross-Refs",note:"JSON",isCheck:!0}]}]},{ceremony:"Seed",color:"amber",phases:[{phase:"Decomposition",agents:[{slug:"task-subtask-decomposer",label:"Task Decomposer",note:"Breaks stories into tasks & subtasks"}]},{phase:"Documentation",agents:[{slug:"doc-distributor",label:"Doc Distributor",note:"Moves content from story doc into task/subtask docs"},{slug:"feature-context-generator",label:"Feature Context Generator",note:"Generates implementation context.md for each task/subtask"}]}]}],PS={blue:{border:"border-blue-200",header:"bg-blue-50",accent:"border-l-blue-400",text:"text-blue-800"},purple:{border:"border-purple-200",header:"bg-purple-50",accent:"border-l-purple-400",text:"text-purple-800"},amber:{border:"border-amber-200",header:"bg-amber-50",accent:"border-l-amber-400",text:"text-amber-800"},green:{border:"border-green-200",header:"bg-green-50",accent:"border-l-green-400",text:"text-green-800"},slate:{border:"border-slate-200",header:"bg-slate-50",accent:"border-l-slate-400",text:"text-slate-800"}},YF=new Set(gA.flatMap(e=>e.phases.flatMap(t=>t.agents.map(n=>n.slug))));function XF(){const[e,t]=b.useState({}),[n,r]=b.useState({}),[i,a]=b.useState(null),[c,u]=b.useState(null),[d,p]=b.useState(""),[h,m]=b.useState(null),[g,v]=b.useState({});b.useEffect(()=>{oD().then(M=>{const I={};M.agents.forEach(z=>{const K=z.name.replace(/\.md$/,"");I[K]=z.isCustomized}),t(I)}).catch(M=>m(M.message)),dD().then(M=>{const I={};M.checks.forEach(z=>{const K=`checks/${z.scope}/${z.perspective}`;I[K]={isCustomized:z.isCustomized,checkCount:z.checkCount}}),r(I)}).catch(()=>{})},[]);const w=M=>v(I=>({...I,[M]:!I[M]})),S=M=>g[M]===!0,j=Object.keys(e).filter(M=>!YF.has(M)).map(M=>({slug:M,label:M,note:null})),k=[...gA,...j.length>0?[{ceremony:"Other",color:"slate",phases:[{phase:"Other",agents:j}]}]:[]],C=d.toLowerCase(),E=C?k.map(M=>({...M,phases:M.phases.map(I=>({...I,agents:I.agents.filter(z=>z.label.toLowerCase().includes(C)||z.slug.toLowerCase().includes(C)||M.ceremony.toLowerCase().includes(C)||I.phase.toLowerCase().includes(C))})).filter(I=>I.agents.length>0)})).filter(M=>M.phases.length>0):k,A=Object.keys(e).length>0||Object.keys(n).length>0,P=C.length>0,O=M=>M.phases.flatMap(I=>I.agents).filter(I=>{var z;return I.isCheck?(z=n[I.slug])==null?void 0:z.isCustomized:e[I.slug]}).length;return l.jsxs("div",{children:[l.jsxs("div",{className:"sticky top-0 bg-white z-10 px-4 py-2.5 border-b border-slate-100 flex items-center justify-between gap-3",children:[l.jsx("input",{type:"search",placeholder:"Search agents…",value:d,onChange:M=>p(M.target.value),className:"w-48 rounded border border-slate-200 px-3 py-1.5 text-xs text-slate-700 focus:outline-none focus:ring-1 focus:ring-blue-500"}),l.jsx("span",{className:"text-xs text-slate-400 italic flex-shrink-0",children:"Click any agent to edit its prompt"})]}),l.jsxs("div",{className:"px-4 py-4 flex flex-col gap-3",children:[h&&l.jsx("p",{className:"text-xs text-red-500",children:h}),E.length===0&&l.jsx("p",{className:"text-sm text-slate-400 py-4",children:"No agents match your search."}),E.map(M=>{const I=PS[M.color]||PS.slate,z=P||S(M.ceremony),K=O(M);return l.jsxs("div",{className:`rounded-xl border ${I.border} overflow-hidden`,children:[l.jsxs("button",{type:"button",onClick:()=>!P&&w(M.ceremony),className:`w-full flex items-center gap-2 px-4 py-2.5 border-l-4 ${I.header} ${I.accent} text-left`,children:[z?l.jsx(ds,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):l.jsx(ar,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}),l.jsx("span",{className:`text-sm font-semibold flex-1 ${I.text}`,children:M.ceremony}),K>0&&l.jsxs("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:[K," custom"]})]}),z&&l.jsx("div",{className:"divide-y divide-slate-100",children:M.phases.map(L=>{const R=`${M.ceremony}::${L.phase}`,ee=P||S(R),J=L.agents.filter(ne=>!A||ne.isCheck||ne.slug in e);return J.length===0?null:l.jsxs("div",{children:[l.jsxs("button",{type:"button",onClick:()=>!P&&w(R),className:"w-full flex items-center gap-2 pl-6 pr-4 py-2 bg-slate-50 hover:bg-slate-100 transition-colors text-left",children:[ee?l.jsx(ds,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}):l.jsx(ar,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}),l.jsx("span",{className:"text-xs font-semibold text-slate-600 uppercase tracking-wide",children:L.phase}),l.jsx("span",{className:"text-xs text-slate-400 ml-1",children:J.length})]}),ee&&l.jsx("div",{className:"pb-1",children:J.map(ne=>{var q,_;const re=ne.isCheck,U=re?((q=n[ne.slug])==null?void 0:q.isCustomized)??!1:e[ne.slug]??!1,B=re?((_=n[ne.slug])==null?void 0:_.checkCount)??0:0,G=()=>{if(re){const V=ne.slug.split("/");u({scope:V[1],perspective:V[2]})}else a(ne.slug)};return l.jsxs("button",{type:"button",onClick:G,className:"w-full text-left pl-10 pr-4 py-1.5 hover:bg-slate-50 transition-colors flex items-center gap-3 group",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"text-sm text-slate-700 group-hover:text-slate-900",children:ne.label}),re&&B>0&&l.jsxs("span",{className:"text-xs text-blue-500 ml-2",children:[B," checks"]}),ne.note&&!re&&l.jsx("span",{className:"text-xs text-slate-400 italic ml-2",children:ne.note})]}),U&&l.jsx("span",{className:"flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:"Custom"}),l.jsx(mc,{className:"w-3.5 h-3.5 text-slate-300 group-hover:text-slate-500 flex-shrink-0 transition-colors"})]},`${M.ceremony}-${ne.slug}`)})})]},L.phase)})})]},M.ceremony)})]}),i&&l.jsx(pA,{agentName:`${i}.md`,onClose:()=>a(null),onSaved:()=>t(M=>({...M,[i]:!0})),onReset:()=>t(M=>({...M,[i]:!1}))}),c&&l.jsx(hA,{scope:c.scope,perspective:c.perspective,onClose:()=>u(null),onSaved:()=>{const M=`checks/${c.scope}/${c.perspective}`;r(I=>({...I,[M]:{...I[M],isCustomized:!0}}))},onReset:()=>{const M=`checks/${c.scope}/${c.perspective}`;r(I=>({...I,[M]:{...I[M],isCustomized:!1}}))}})]})}const $g=[{key:"sponsor-call",label:"Sponsor Call",desc:"Wizard to define project mission, scope, and architecture"},{key:"sprint-planning",label:"Sprint Planning",desc:"Decomposes project scope into epics, stories, and contexts"},{key:"seed",label:"Seed",desc:"Decomposes stories into implementable tasks and subtasks"},{key:"run",label:"Run",desc:"Implements task code in worktree with AI-powered generation and validation"}];function QF(e){const t={};for(const{key:n}of $g){const r=e==null?void 0:e[n];t[n]=r!=null?String(r):""}return t}function JF({settings:e,onSaved:t}){const[n,r]=b.useState(()=>QF(e.costThresholds)),[i,a]=b.useState(null),c=(d,p)=>{r(h=>({...h,[d]:p}))},u=async()=>{a("saving");try{const d={};for(const{key:p}of $g){const h=n[p].trim();d[p]=h===""?null:parseFloat(h)||null}await W3(d),a("saved"),t(),setTimeout(()=>a(null),2e3)}catch{a("error"),setTimeout(()=>a(null),2e3)}};return l.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[l.jsxs("p",{className:"text-xs text-slate-500",children:["Set a maximum spend (in ",l.jsx("strong",{children:"USD"}),") per ceremony run. Leave empty for unlimited. When the running cost exceeds the limit, the ceremony stops automatically."]}),l.jsx("div",{className:"flex flex-col gap-2",children:$g.map(({key:d,label:p,desc:h})=>l.jsx("div",{className:"border border-slate-200 rounded-lg p-4",children:l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-semibold text-slate-800",children:p}),l.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:h})]}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[l.jsx("span",{className:"text-sm text-slate-500",children:"$"}),l.jsx("input",{type:"number",min:"0",step:"0.01",value:n[d],onChange:m=>c(d,m.target.value),placeholder:"Unlimited",className:"rounded-md border border-slate-300 px-2 py-1.5 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-blue-500 w-28 placeholder:text-slate-400"})]})]})},d))}),l.jsx("div",{className:"flex justify-end pt-1",children:l.jsx("button",{type:"button",onClick:u,disabled:i==="saving",className:"px-4 py-2 text-sm font-medium bg-slate-900 text-white rounded-md hover:bg-slate-700 transition-colors disabled:opacity-40",children:i==="saving"?l.jsxs("span",{className:"inline-flex items-center gap-2",children:[l.jsx("span",{className:"w-3.5 h-3.5 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving…"]}):i==="saved"?"✓ Saved":i==="error"?"✗ Error":"Save Cost Limits"})})]})}const ZF=[{id:"api-keys",label:"API Keys"},{id:"ceremonies",label:"Ceremony Models"},{id:"agents",label:"Agents"},{id:"pricing",label:"Model Pricing"},{id:"cost-thresholds",label:"Cost Limits"},{id:"servers",label:"Servers & Ports"}];function eB({settings:e,models:t,onClose:n,onSaved:r,initialTab:i}){const[a,c]=b.useState(i||"api-keys");return l.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:u=>{u.target===u.currentTarget&&n()},children:l.jsxs("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[l.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-slate-100 flex-shrink-0",children:[l.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"⚙ Project Settings"}),l.jsx("button",{type:"button",onClick:n,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4","aria-label":"Close",children:l.jsx(cn,{className:"w-5 h-5"})})]}),l.jsx("div",{className:"flex border-b border-slate-100 flex-shrink-0 px-5",children:ZF.map(u=>l.jsx("button",{type:"button",onClick:()=>c(u.id),className:`px-3 py-3 text-sm font-medium transition-colors border-b-2 -mb-px ${a===u.id?"border-slate-900 text-slate-900":"border-transparent text-slate-500 hover:text-slate-700"}`,children:u.label},u.id))}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a==="api-keys"&&l.jsx(LF,{settings:e,onSaved:r}),a==="ceremonies"&&l.jsx(FF,{settings:e,models:t,onSaved:r}),a==="pricing"&&l.jsx(GF,{settings:e,onSaved:r}),a==="cost-thresholds"&&l.jsx(JF,{settings:e,onSaved:r}),a==="servers"&&l.jsx(BF,{settings:e,onSaved:r}),a==="agents"&&l.jsx(XF,{})]})]})})}var tB=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Nv(e){if(typeof e!="string")return!1;var t=tB;return t.includes(e)}var nB=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],rB=new Set(nB);function xA(e){return typeof e!="string"?!1:rB.has(e)}function vA(e){return typeof e=="string"&&e.startsWith("data-")}function ms(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(xA(n)||vA(n))&&(t[n]=e[n]);return t}function kv(e){if(e==null)return null;if(b.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return ms(t)}return typeof e=="object"&&!Array.isArray(e)?ms(e):null}function lr(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(xA(n)||vA(n)||Nv(n))&&(t[n]=e[n]);return t}var iB=["children","width","height","viewBox","className","style","title","desc"];function zg(){return zg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zg.apply(null,arguments)}function sB(e,t){if(e==null)return{};var n,r,i=aB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function aB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var yA=b.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:c,style:u,title:d,desc:p}=e,h=sB(e,iB),m=a||{width:r,height:i,x:0,y:0},g=rt("recharts-surface",c);return b.createElement("svg",zg({},lr(h),{className:g,width:r,height:i,style:u,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:t}),b.createElement("title",null,d),b.createElement("desc",null,p),n)}),oB=["children","className"];function Fg(){return Fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fg.apply(null,arguments)}function lB(e,t){if(e==null)return{};var n,r,i=cB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function cB(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var vi=b.forwardRef((e,t)=>{var{children:n,className:r}=e,i=lB(e,oB),a=rt("recharts-layer",r);return b.createElement("g",Fg({className:a},lr(i),{ref:t}),n)}),bA=gC(),uB=b.createContext(null);function tt(e){return function(){return e}}const wA=Math.cos,Ld=Math.sin,Mr=Math.sqrt,$d=Math.PI,Ff=2*$d,Bg=Math.PI,Vg=2*Bg,Ws=1e-6,dB=Vg-Ws;function jA(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function fB(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return jA;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i<a;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}class pB{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?jA:fB(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,a,c){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+c}`}arcTo(t,n,r,i,a){if(t=+t,n=+n,r=+r,i=+i,a=+a,a<0)throw new Error(`negative radius: ${a}`);let c=this._x1,u=this._y1,d=r-t,p=i-n,h=c-t,m=u-n,g=h*h+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(g>Ws)if(!(Math.abs(m*d-p*h)>Ws)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let v=r-c,w=i-u,S=d*d+p*p,j=v*v+w*w,k=Math.sqrt(S),C=Math.sqrt(g),E=a*Math.tan((Bg-Math.acos((S+g-j)/(2*k*C)))/2),A=E/C,P=E/k;Math.abs(A-1)>Ws&&this._append`L${t+A*h},${n+A*m}`,this._append`A${a},${a},0,0,${+(m*v>h*w)},${this._x1=t+P*d},${this._y1=n+P*p}`}}arc(t,n,r,i,a,c){if(t=+t,n=+n,r=+r,c=!!c,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(i),d=r*Math.sin(i),p=t+u,h=n+d,m=1^c,g=c?i-a:a-i;this._x1===null?this._append`M${p},${h}`:(Math.abs(this._x1-p)>Ws||Math.abs(this._y1-h)>Ws)&&this._append`L${p},${h}`,r&&(g<0&&(g=g%Vg+Vg),g>dB?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=p},${this._y1=h}`:g>Ws&&this._append`A${r},${r},0,${+(g>=Bg)},${m},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}}function Pv(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new pB(t)}function Cv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function SA(e){this._context=e}SA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Bf(e){return new SA(e)}function NA(e){return e[0]}function kA(e){return e[1]}function PA(e,t){var n=tt(!0),r=null,i=Bf,a=null,c=Pv(u);e=typeof e=="function"?e:e===void 0?NA:tt(e),t=typeof t=="function"?t:t===void 0?kA:tt(t);function u(d){var p,h=(d=Cv(d)).length,m,g=!1,v;for(r==null&&(a=i(v=c())),p=0;p<=h;++p)!(p<h&&n(m=d[p],p,d))===g&&((g=!g)?a.lineStart():a.lineEnd()),g&&a.point(+e(m,p,d),+t(m,p,d));if(v)return a=null,v+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:tt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:tt(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:tt(!!d),u):n},u.curve=function(d){return arguments.length?(i=d,r!=null&&(a=i(r)),u):i},u.context=function(d){return arguments.length?(d==null?r=a=null:a=i(r=d),u):r},u}function Ju(e,t,n){var r=null,i=tt(!0),a=null,c=Bf,u=null,d=Pv(p);e=typeof e=="function"?e:e===void 0?NA:tt(+e),t=typeof t=="function"?t:tt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?kA:tt(+n);function p(m){var g,v,w,S=(m=Cv(m)).length,j,k=!1,C,E=new Array(S),A=new Array(S);for(a==null&&(u=c(C=d())),g=0;g<=S;++g){if(!(g<S&&i(j=m[g],g,m))===k)if(k=!k)v=g,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),w=g-1;w>=v;--w)u.point(E[w],A[w]);u.lineEnd(),u.areaEnd()}k&&(E[g]=+e(j,g,m),A[g]=+t(j,g,m),u.point(r?+r(j,g,m):E[g],n?+n(j,g,m):A[g]))}if(C)return u=null,C+""||null}function h(){return PA().defined(i).curve(c).context(a)}return p.x=function(m){return arguments.length?(e=typeof m=="function"?m:tt(+m),r=null,p):e},p.x0=function(m){return arguments.length?(e=typeof m=="function"?m:tt(+m),p):e},p.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:tt(+m),p):r},p.y=function(m){return arguments.length?(t=typeof m=="function"?m:tt(+m),n=null,p):t},p.y0=function(m){return arguments.length?(t=typeof m=="function"?m:tt(+m),p):t},p.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:tt(+m),p):n},p.lineX0=p.lineY0=function(){return h().x(e).y(t)},p.lineY1=function(){return h().x(e).y(n)},p.lineX1=function(){return h().x(r).y(t)},p.defined=function(m){return arguments.length?(i=typeof m=="function"?m:tt(!!m),p):i},p.curve=function(m){return arguments.length?(c=m,a!=null&&(u=c(a)),p):c},p.context=function(m){return arguments.length?(m==null?a=u=null:u=c(a=m),p):a},p}class CA{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function hB(e){return new CA(e,!0)}function mB(e){return new CA(e,!1)}const Ov={draw(e,t){const n=Mr(t/$d);e.moveTo(n,0),e.arc(0,0,n,0,Ff)}},gB={draw(e,t){const n=Mr(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},OA=Mr(1/3),xB=OA*2,vB={draw(e,t){const n=Mr(t/xB),r=n*OA;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},yB={draw(e,t){const n=Mr(t),r=-n/2;e.rect(r,r,n,n)}},bB=.8908130915292852,AA=Ld($d/10)/Ld(7*$d/10),wB=Ld(Ff/10)*AA,jB=-wA(Ff/10)*AA,SB={draw(e,t){const n=Mr(t*bB),r=wB*n,i=jB*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const c=Ff*a/5,u=wA(c),d=Ld(c);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},Rm=Mr(3),NB={draw(e,t){const n=-Mr(t/(Rm*3));e.moveTo(0,n*2),e.lineTo(-Rm*n,-n),e.lineTo(Rm*n,-n),e.closePath()}},tr=-.5,nr=Mr(3)/2,Ug=1/Mr(12),kB=(Ug/2+1)*3,PB={draw(e,t){const n=Mr(t/kB),r=n/2,i=n*Ug,a=r,c=n*Ug+n,u=-a,d=c;e.moveTo(r,i),e.lineTo(a,c),e.lineTo(u,d),e.lineTo(tr*r-nr*i,nr*r+tr*i),e.lineTo(tr*a-nr*c,nr*a+tr*c),e.lineTo(tr*u-nr*d,nr*u+tr*d),e.lineTo(tr*r+nr*i,tr*i-nr*r),e.lineTo(tr*a+nr*c,tr*c-nr*a),e.lineTo(tr*u+nr*d,tr*d-nr*u),e.closePath()}};function CB(e,t){let n=null,r=Pv(i);e=typeof e=="function"?e:tt(e||Ov),t=typeof t=="function"?t:tt(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:tt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:tt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function zd(){}function Fd(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function EA(e){this._context=e}EA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Fd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Fd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OB(e){return new EA(e)}function TA(e){this._context=e}TA.prototype={areaStart:zd,areaEnd:zd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:Fd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AB(e){return new TA(e)}function MA(e){this._context=e}MA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:Fd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function EB(e){return new MA(e)}function _A(e){this._context=e}_A.prototype={areaStart:zd,areaEnd:zd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function TB(e){return new _A(e)}function CS(e){return e<0?-1:1}function OS(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),c=(n-e._y1)/(i||r<0&&-0),u=(a*i+c*r)/(r+i);return(CS(a)+CS(c))*Math.min(Math.abs(a),Math.abs(c),.5*Math.abs(u))||0}function AS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Lm(e,t,n){var r=e._x0,i=e._y0,a=e._x1,c=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,c-u*n,a,c)}function Bd(e){this._context=e}Bd.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Lm(this,this._t0,AS(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Lm(this,AS(this,n=OS(this,e,t)),n);break;default:Lm(this,this._t0,n=OS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function IA(e){this._context=new DA(e)}(IA.prototype=Object.create(Bd.prototype)).point=function(e,t){Bd.prototype.point.call(this,t,e)};function DA(e){this._context=e}DA.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function MB(e){return new Bd(e)}function _B(e){return new IA(e)}function RA(e){this._context=e}RA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=ES(e),i=ES(t),a=0,c=1;c<n;++a,++c)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[c],t[c]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function ES(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),c=new Array(n);for(i[0]=0,a[0]=2,c[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,c[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,c[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,c[t]-=r*c[t-1];for(i[n-1]=c[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(c[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function IB(e){return new RA(e)}function Vf(e,t){this._context=e,this._t=t}Vf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function DB(e){return new Vf(e,.5)}function RB(e){return new Vf(e,0)}function LB(e){return new Vf(e,1)}function ra(e,t){if((c=e.length)>1)for(var n=1,r,i,a=e[t[0]],c,u=a.length;n<c;++n)for(i=a,a=e[t[n]],r=0;r<u;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Wg(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function $B(e,t){return e[t]}function zB(e){const t=[];return t.key=e,t}function FB(){var e=tt([]),t=Wg,n=ra,r=$B;function i(a){var c=Array.from(e.apply(this,arguments),zB),u,d=c.length,p=-1,h;for(const m of a)for(u=0,++p;u<d;++u)(c[u][p]=[0,+r(m,c[u].key,p,a)]).data=m;for(u=0,h=Cv(t(c));u<d;++u)c[h[u]].index=u;return n(c,h),c}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:tt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:tt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Wg:typeof a=="function"?a:tt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??ra,i):n},i}function BB(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,c;i<a;++i){for(c=n=0;n<r;++n)c+=e[n][i][1]||0;if(c)for(n=0;n<r;++n)e[n][i][1]/=c}ra(e,t)}}function VB(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var c=0,u=0;c<i;++c)u+=e[c][n][1]||0;r[n][1]+=r[n][0]=-u/2}ra(e,t)}}function UB(e,t){if(!(!((c=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,c;r<a;++r){for(var u=0,d=0,p=0;u<c;++u){for(var h=e[t[u]],m=h[r][1]||0,g=h[r-1][1]||0,v=(m-g)/2,w=0;w<u;++w){var S=e[t[w]],j=S[r][1]||0,k=S[r-1][1]||0;v+=j-k}d+=m,p+=v*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=p/d)}i[r-1][1]+=i[r-1][0]=n,ra(e,t)}}var $m={},zm={},TS;function WB(){return TS||(TS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(zm)),zm}var Fm={},MS;function LA(){return MS||(MS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n.includes(".")||n.includes("[")||n.includes("]")}}e.isDeepKey=t})(Fm)),Fm}var Bm={},_S;function Av(){return _S||(_S=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var r;return typeof n=="string"||typeof n=="symbol"?n:Object.is((r=n==null?void 0:n.valueOf)==null?void 0:r.call(n),-0)?"-0":String(n)}e.toKey=t})(Bm)),Bm}var Vm={},Um={},IS;function qB(){return IS||(IS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){if(n==null)return"";if(typeof n=="string")return n;if(Array.isArray(n))return n.map(t).join(",");const r=String(n);return r==="0"&&Object.is(Number(n),-0)?"-0":r}e.toString=t})(Um)),Um}var DS;function Ev(){return DS||(DS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qB(),n=Av();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],c=i.length;if(c===0)return a;let u=0,d="",p="",h=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<c;){const m=i[u];p?m==="\\"&&u+1<c?(u++,d+=i[u]):m===p?p="":d+=m:h?m==='"'||m==="'"?p=m:m==="]"?(h=!1,a.push(d),d=""):d+=m:m==="["?(h=!0,d&&(a.push(d),d="")):m==="."?d&&(a.push(d),d=""):d+=m,u++}return d&&a.push(d),a}e.toPath=r})(Vm)),Vm}var RS;function Tv(){return RS||(RS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=WB(),n=LA(),r=Av(),i=Ev();function a(u,d,p){if(u==null)return p;switch(typeof d){case"string":{if(t.isUnsafeProperty(d))return p;const h=u[d];return h===void 0?n.isDeepKey(d)?a(u,i.toPath(d),p):p:h}case"number":case"symbol":{typeof d=="number"&&(d=r.toKey(d));const h=u[d];return h===void 0?p:h}default:{if(Array.isArray(d))return c(u,d,p);if(Object.is(d==null?void 0:d.valueOf(),-0)?d="-0":d=String(d),t.isUnsafeProperty(d))return p;const h=u[d];return h===void 0?p:h}}}function c(u,d,p){if(d.length===0)return p;let h=u;for(let m=0;m<d.length;m++){if(h==null||t.isUnsafeProperty(d[m]))return p;h=h[d[m]]}return h===void 0?p:h}e.get=a})($m)),$m}var Wm,LS;function KB(){return LS||(LS=1,Wm=Tv().get),Wm}var HB=KB();const mo=Jr(HB);var GB=4;function ls(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:GB,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function vt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return e.reduce((i,a,c)=>{var u=n[c-1];return typeof u=="string"?i+u+a:u!==void 0?i+ls(u)+a:i+a},"")}var $n=e=>e===0?0:e>0?1:-1,Yr=e=>typeof e=="number"&&e!=+e,ia=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ke=e=>(typeof e=="number"||e instanceof Number)&&!Yr(e),Xr=e=>ke(e)||typeof e=="string",YB=0,ec=e=>{var t=++YB;return"".concat(e||"").concat(t)},Er=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ke(t)&&typeof t!="string")return r;var a;if(ia(t)){if(n==null)return r;var c=t.indexOf("%");a=n*parseFloat(t.slice(0,c))/100}else a=+t;return Yr(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},$A=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[String(e[r])])n[String(e[r])]=!0;else return!0;return!1};function Jt(e,t,n){return ke(e)&&ke(t)?ls(e+n*(t-e)):t}function XB(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):mo(r,t))===n)}var Vt=e=>e===null||typeof e>"u",wc=e=>Vt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Vr(e){return e!=null}function Ao(){}var QB=["type","size","sizeType"];function qg(){return qg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qg.apply(null,arguments)}function $S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$S(Object(n),!0).forEach(function(r){JB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$S(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JB(e,t,n){return(t=ZB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZB(e){var t=e7(e,"string");return typeof t=="symbol"?t:t+""}function e7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function t7(e,t){if(e==null)return{};var n,r,i=n7(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function n7(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var zA={symbolCircle:Ov,symbolCross:gB,symbolDiamond:vB,symbolSquare:yB,symbolStar:SB,symbolTriangle:NB,symbolWye:PB},r7=Math.PI/180,i7=e=>{var t="symbol".concat(wc(e));return zA[t]||Ov},s7=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*r7;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},a7=(e,t)=>{zA["symbol".concat(wc(e))]=t},FA=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=t7(e,QB),a=zS(zS({},i),{},{type:t,size:n,sizeType:r}),c="circle";typeof t=="string"&&(c=t);var u=()=>{var g=i7(c),v=CB().type(g).size(s7(n,r,c)),w=v();if(w!==null)return w},{className:d,cx:p,cy:h}=a,m=lr(a);return ke(p)&&ke(h)&&ke(n)?b.createElement("path",qg({},m,{className:rt("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(h,")"),d:u()})):null};FA.registerSymbol=a7;var BA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,o7=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(b.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{Nv(i)&&(r[i]=(a=>n[i](n,a)))}),r},l7=(e,t,n)=>r=>(e(t,n,r),null),Mv=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];Nv(i)&&typeof a=="function"&&(r||(r={}),r[i]=l7(a,t,n))}),r};function FS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function c7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FS(Object(n),!0).forEach(function(r){u7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function u7(e,t,n){return(t=d7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d7(e){var t=f7(e,"string");return typeof t=="symbol"?t:t+""}function f7(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dr(e,t){var n=c7({},e),r=t,i=Object.keys(t),a=i.reduce((c,u)=>(c[u]===void 0&&r[u]!==void 0&&(c[u]=r[u]),c),n);return a}var qm={},Km={},BS;function p7(){return BS||(BS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a<n.length;a++){const c=n[a],u=r(c,a,n);i.has(u)||i.set(u,c)}return Array.from(i.values())}e.uniqBy=t})(Km)),Km}var Hm={},VS;function h7(){return VS||(VS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return function(...i){return n.apply(this,i.slice(0,r))}}e.ary=t})(Hm)),Hm}var Gm={},US;function VA(){return US||(US=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Gm)),Gm}var Ym={},Xm={},Qm={},WS;function m7(){return WS||(WS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Qm)),Qm}var qS;function _v(){return qS||(qS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=m7();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Xm)),Xm}var Jm={},KS;function g7(){return KS||(KS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Jm)),Jm}var HS;function x7(){return HS||(HS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_v(),n=g7();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Ym)),Ym}var Zm={},e0={},GS;function v7(){return GS||(GS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tv();function n(r){return function(i){return t.get(i,r)}}e.property=n})(e0)),e0}var t0={},n0={},r0={},i0={},YS;function UA(){return YS||(YS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(i0)),i0}var s0={},XS;function WA(){return XS||(XS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(s0)),s0}var a0={},QS;function qA(){return QS||(QS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(a0)),a0}var JS;function y7(){return JS||(JS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UA(),n=WA(),r=qA();function i(h,m,g){return typeof g!="function"?i(h,m,()=>{}):a(h,m,function v(w,S,j,k,C,E){const A=g(w,S,j,k,C,E);return A!==void 0?!!A:a(w,S,v,E)},new Map)}function a(h,m,g,v){if(m===h)return!0;switch(typeof m){case"object":return c(h,m,g,v);case"function":return Object.keys(m).length>0?a(h,{...m},g,v):r.isEqualsSameValueZero(h,m);default:return t.isObject(h)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(h,m)}}function c(h,m,g,v){if(m==null)return!0;if(Array.isArray(m))return d(h,m,g,v);if(m instanceof Map)return u(h,m,g,v);if(m instanceof Set)return p(h,m,g,v);const w=Object.keys(m);if(h==null||n.isPrimitive(h))return w.length===0;if(w.length===0)return!0;if(v!=null&&v.has(m))return v.get(m)===h;v==null||v.set(m,h);try{for(let S=0;S<w.length;S++){const j=w[S];if(!n.isPrimitive(h)&&!(j in h)||m[j]===void 0&&h[j]!==void 0||m[j]===null&&h[j]!==null||!g(h[j],m[j],j,h,m,v))return!1}return!0}finally{v==null||v.delete(m)}}function u(h,m,g,v){if(m.size===0)return!0;if(!(h instanceof Map))return!1;for(const[w,S]of m.entries()){const j=h.get(w);if(g(j,S,w,h,m,v)===!1)return!1}return!0}function d(h,m,g,v){if(m.length===0)return!0;if(!Array.isArray(h))return!1;const w=new Set;for(let S=0;S<m.length;S++){const j=m[S];let k=!1;for(let C=0;C<h.length;C++){if(w.has(C))continue;const E=h[C];let A=!1;if(g(E,j,S,h,m,v)&&(A=!0),A){w.add(C),k=!0;break}}if(!k)return!1}return!0}function p(h,m,g,v){return m.size===0?!0:h instanceof Set?d([...h],[...m],g,v):!1}e.isMatchWith=i,e.isSetMatch=p})(r0)),r0}var ZS;function KA(){return ZS||(ZS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=y7();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(n0)),n0}var o0={},l0={},c0={},eN;function b7(){return eN||(eN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(c0)),c0}var u0={},tN;function Iv(){return tN||(tN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(u0)),u0}var d0={},nN;function HA(){return nN||(nN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",c="[object Symbol]",u="[object Date]",d="[object Map]",p="[object Set]",h="[object Array]",m="[object Function]",g="[object ArrayBuffer]",v="[object Object]",w="[object Error]",S="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",C="[object Uint16Array]",E="[object Uint32Array]",A="[object BigUint64Array]",P="[object Int8Array]",O="[object Int16Array]",M="[object Int32Array]",I="[object BigInt64Array]",z="[object Float32Array]",K="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=g,e.arrayTag=h,e.bigInt64ArrayTag=I,e.bigUint64ArrayTag=A,e.booleanTag=i,e.dataViewTag=S,e.dateTag=u,e.errorTag=w,e.float32ArrayTag=z,e.float64ArrayTag=K,e.functionTag=m,e.int16ArrayTag=O,e.int32ArrayTag=M,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=v,e.regexpTag=t,e.setTag=p,e.stringTag=n,e.symbolTag=c,e.uint16ArrayTag=C,e.uint32ArrayTag=E,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(d0)),d0}var f0={},rN;function w7(){return rN||(rN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(f0)),f0}var iN;function GA(){return iN||(iN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=b7(),n=Iv(),r=HA(),i=WA(),a=w7();function c(h,m){return u(h,void 0,h,new Map,m)}function u(h,m,g,v=new Map,w=void 0){const S=w==null?void 0:w(h,m,g,v);if(S!==void 0)return S;if(i.isPrimitive(h))return h;if(v.has(h))return v.get(h);if(Array.isArray(h)){const j=new Array(h.length);v.set(h,j);for(let k=0;k<h.length;k++)j[k]=u(h[k],k,g,v,w);return Object.hasOwn(h,"index")&&(j.index=h.index),Object.hasOwn(h,"input")&&(j.input=h.input),j}if(h instanceof Date)return new Date(h.getTime());if(h instanceof RegExp){const j=new RegExp(h.source,h.flags);return j.lastIndex=h.lastIndex,j}if(h instanceof Map){const j=new Map;v.set(h,j);for(const[k,C]of h)j.set(k,u(C,k,g,v,w));return j}if(h instanceof Set){const j=new Set;v.set(h,j);for(const k of h)j.add(u(k,void 0,g,v,w));return j}if(typeof Buffer<"u"&&Buffer.isBuffer(h))return h.subarray();if(a.isTypedArray(h)){const j=new(Object.getPrototypeOf(h)).constructor(h.length);v.set(h,j);for(let k=0;k<h.length;k++)j[k]=u(h[k],k,g,v,w);return j}if(h instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&h instanceof SharedArrayBuffer)return h.slice(0);if(h instanceof DataView){const j=new DataView(h.buffer.slice(0),h.byteOffset,h.byteLength);return v.set(h,j),d(j,h,g,v,w),j}if(typeof File<"u"&&h instanceof File){const j=new File([h],h.name,{type:h.type});return v.set(h,j),d(j,h,g,v,w),j}if(typeof Blob<"u"&&h instanceof Blob){const j=new Blob([h],{type:h.type});return v.set(h,j),d(j,h,g,v,w),j}if(h instanceof Error){const j=new h.constructor;return v.set(h,j),j.message=h.message,j.name=h.name,j.stack=h.stack,j.cause=h.cause,d(j,h,g,v,w),j}if(h instanceof Boolean){const j=new Boolean(h.valueOf());return v.set(h,j),d(j,h,g,v,w),j}if(h instanceof Number){const j=new Number(h.valueOf());return v.set(h,j),d(j,h,g,v,w),j}if(h instanceof String){const j=new String(h.valueOf());return v.set(h,j),d(j,h,g,v,w),j}if(typeof h=="object"&&p(h)){const j=Object.create(Object.getPrototypeOf(h));return v.set(h,j),d(j,h,g,v,w),j}return h}function d(h,m,g=h,v,w){const S=[...Object.keys(m),...t.getSymbols(m)];for(let j=0;j<S.length;j++){const k=S[j],C=Object.getOwnPropertyDescriptor(h,k);(C==null||C.writable)&&(h[k]=u(m[k],k,g,v,w))}}function p(h){switch(n.getTag(h)){case r.argumentsTag:case r.arrayTag:case r.arrayBufferTag:case r.dataViewTag:case r.booleanTag:case r.dateTag:case r.float32ArrayTag:case r.float64ArrayTag:case r.int8ArrayTag:case r.int16ArrayTag:case r.int32ArrayTag:case r.mapTag:case r.numberTag:case r.objectTag:case r.regexpTag:case r.setTag:case r.stringTag:case r.symbolTag:case r.uint8ArrayTag:case r.uint8ClampedArrayTag:case r.uint16ArrayTag:case r.uint32ArrayTag:return!0;default:return!1}}e.cloneDeepWith=c,e.cloneDeepWithImpl=u,e.copyProperties=d})(l0)),l0}var sN;function j7(){return sN||(sN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GA();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(o0)),o0}var aN;function S7(){return aN||(aN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KA(),n=j7();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(t0)),t0}var p0={},h0={},m0={},oN;function N7(){return oN||(oN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=GA(),n=Iv(),r=HA();function i(a,c){return t.cloneDeepWith(a,(u,d,p,h)=>{const m=c==null?void 0:c(u,d,p,h);if(m!==void 0)return m;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const g={};return h.set(a,g),t.copyProperties(g,a,p,h),g}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const g=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(g,a),g}case r.argumentsTag:{const g={};return t.copyProperties(g,a),g.length=a.length,g[Symbol.iterator]=a[Symbol.iterator],g}default:return}}})}e.cloneDeepWith=i})(m0)),m0}var lN;function k7(){return lN||(lN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=N7();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(h0)),h0}var g0={},x0={},cN;function YA(){return cN||(cN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r<i;case"symbol":return!1;case"string":return t.test(r)}}e.isIndex=n})(x0)),x0}var v0={},uN;function P7(){return uN||(uN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Iv();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(v0)),v0}var dN;function C7(){return dN||(dN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LA(),n=YA(),r=P7(),i=Ev();function a(c,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&(c==null?void 0:c[u])==null?d=i.toPath(u):d=[u],d.length===0)return!1;let p=c;for(let h=0;h<d.length;h++){const m=d[h];if((p==null||!Object.hasOwn(p,m))&&!((Array.isArray(p)||r.isArguments(p))&&n.isIndex(m)&&m<p.length))return!1;p=p[m]}return!0}e.has=a})(g0)),g0}var fN;function O7(){return fN||(fN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KA(),n=Av(),r=k7(),i=Tv(),a=C7();function c(u,d){switch(typeof u){case"object":{Object.is(u==null?void 0:u.valueOf(),-0)&&(u="-0");break}case"number":{u=n.toKey(u);break}}return d=r.cloneDeep(d),function(p){const h=i.get(p,u);return h===void 0?a.has(p,u):d===void 0?h===void 0:t.isMatch(h,d)}}e.matchesProperty=c})(p0)),p0}var pN;function A7(){return pN||(pN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VA(),n=v7(),r=S7(),i=O7();function a(c){if(c==null)return t.identity;switch(typeof c){case"function":return c;case"object":return Array.isArray(c)&&c.length===2?i.matchesProperty(c[0],c[1]):r.matches(c);case"string":case"symbol":case"number":return n.property(c)}}e.iteratee=a})(Zm)),Zm}var hN;function E7(){return hN||(hN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=p7(),n=h7(),r=VA(),i=x7(),a=A7();function c(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=c})(qm)),qm}var y0,mN;function T7(){return mN||(mN=1,y0=E7().uniqBy),y0}var M7=T7();const gN=Jr(M7);function _7(e,t,n){return t===!0?gN(e,n):typeof t=="function"?gN(e,t):e}var b0={exports:{}},w0={},j0={exports:{}},S0={};/**
|
|
318
|
+
* @license React
|
|
319
|
+
* use-sync-external-store-shim.production.js
|
|
320
|
+
*
|
|
321
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
322
|
+
*
|
|
323
|
+
* This source code is licensed under the MIT license found in the
|
|
324
|
+
* LICENSE file in the root directory of this source tree.
|
|
325
|
+
*/var xN;function I7(){if(xN)return S0;xN=1;var e=No();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,c=e.useDebugValue;function u(m,g){var v=g(),w=r({inst:{value:v,getSnapshot:g}}),S=w[0].inst,j=w[1];return a(function(){S.value=v,S.getSnapshot=g,d(S)&&j({inst:S})},[m,v,g]),i(function(){return d(S)&&j({inst:S}),m(function(){d(S)&&j({inst:S})})},[m]),c(v),v}function d(m){var g=m.getSnapshot;m=m.value;try{var v=g();return!n(m,v)}catch{return!0}}function p(m,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:u;return S0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,S0}var vN;function D7(){return vN||(vN=1,j0.exports=I7()),j0.exports}/**
|
|
326
|
+
* @license React
|
|
327
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
328
|
+
*
|
|
329
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the MIT license found in the
|
|
332
|
+
* LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/var yN;function R7(){if(yN)return w0;yN=1;var e=No(),t=D7();function n(p,h){return p===h&&(p!==0||1/p===1/h)||p!==p&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,c=e.useEffect,u=e.useMemo,d=e.useDebugValue;return w0.useSyncExternalStoreWithSelector=function(p,h,m,g,v){var w=a(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=u(function(){function k(O){if(!C){if(C=!0,E=O,O=g(O),v!==void 0&&S.hasValue){var M=S.value;if(v(M,O))return A=M}return A=O}if(M=A,r(E,O))return M;var I=g(O);return v!==void 0&&v(M,I)?(E=O,M):(E=O,A=I)}var C=!1,E,A,P=m===void 0?null:m;return[function(){return k(h())},P===null?void 0:function(){return k(P())}]},[h,m,g,v]);var j=i(p,w[0],w[1]);return c(function(){S.hasValue=!0,S.value=j},[j]),d(j),j},w0}var bN;function L7(){return bN||(bN=1,b0.exports=R7()),b0.exports}var $7=L7(),Dv=b.createContext(null),z7=e=>e,St=()=>{var e=b.useContext(Dv);return e?e.store.dispatch:z7},bd=()=>{},F7=()=>bd,B7=(e,t)=>e===t;function Ee(e){var t=b.useContext(Dv),n=b.useMemo(()=>t?r=>{if(r!=null)return e(r)}:bd,[t,e]);return $7.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:F7,t?t.store.getState:bd,t?t.store.getState:bd,n,B7)}function V7(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function U7(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function W7(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var wN=e=>Array.isArray(e)?e:[e];function q7(e){const t=Array.isArray(e[0])?e[0]:e;return W7(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function K7(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var H7=class{constructor(e){this.value=e}deref(){return this.value}},G7=typeof WeakRef<"u"?WeakRef:H7,Y7=0,jN=1;function Zu(){return{s:Y7,v:void 0,o:null,p:null}}function XA(e,t={}){let n=Zu();const{resultEqualityCheck:r}=t;let i,a=0;function c(){var m;let u=n;const{length:d}=arguments;for(let g=0,v=d;g<v;g++){const w=arguments[g];if(typeof w=="function"||typeof w=="object"&&w!==null){let S=u.o;S===null&&(u.o=S=new WeakMap);const j=S.get(w);j===void 0?(u=Zu(),S.set(w,u)):u=j}else{let S=u.p;S===null&&(u.p=S=new Map);const j=S.get(w);j===void 0?(u=Zu(),S.set(w,u)):u=j}}const p=u;let h;if(u.s===jN)h=u.v;else if(h=e.apply(null,arguments),a++,r){const g=((m=i==null?void 0:i.deref)==null?void 0:m.call(i))??i;g!=null&&r(g,h)&&(h=g,a!==0&&a--),i=typeof h=="object"&&h!==null||typeof h=="function"?new G7(h):h}return p.s=jN,p.v=h,h}return c.clearCache=()=>{n=Zu(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}function X7(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,c=0,u,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),V7(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const h={...n,...d},{memoize:m,memoizeOptions:g=[],argsMemoize:v=XA,argsMemoizeOptions:w=[]}=h,S=wN(g),j=wN(w),k=q7(i),C=m(function(){return a++,p.apply(null,arguments)},...S),E=v(function(){c++;const P=K7(k,arguments);return u=C.apply(null,P),u},...j);return Object.assign(E,{resultFunc:p,memoizedResultFunc:C,dependencies:k,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:v})};return Object.assign(r,{withTypes:()=>r}),r}var Z=X7(XA),Q7=Object.assign((e,t=Z)=>{U7(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((c,u,d)=>(c[n[d]]=u,c),{}))},{withTypes:()=>Q7}),N0={},k0={},P0={},SN;function J7(){return SN||(SN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const c=t(r),u=t(i);if(c===u&&c===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-c:c-u}return 0};e.compareValues=n})(P0)),P0}var C0={},O0={},NN;function QA(){return NN||(NN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(O0)),O0}var kN;function Z7(){return kN||(kN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QA(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,c){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||c!=null&&Object.hasOwn(c,a)}e.isKey=i})(C0)),C0}var PN;function e8(){return PN||(PN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=J7(),n=Z7(),r=Ev();function i(a,c,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(c)||(c=c==null?[null]:[c]),c.length===0&&(c=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(v=>String(v));const p=(v,w)=>{let S=v;for(let j=0;j<w.length&&S!=null;++j)S=S[w[j]];return S},h=(v,w)=>w==null||v==null?w:typeof v=="object"&&"key"in v?Object.hasOwn(w,v.key)?w[v.key]:p(w,v.path):typeof v=="function"?v(w):Array.isArray(v)?p(w,v):typeof w=="object"?w[v]:w,m=c.map(v=>(Array.isArray(v)&&v.length===1&&(v=v[0]),v==null||typeof v=="function"||Array.isArray(v)||n.isKey(v)?v:{key:v,path:r.toPath(v)}));return a.map(v=>({original:v,criteria:m.map(w=>h(w,v))})).slice().sort((v,w)=>{for(let S=0;S<m.length;S++){const j=t.compareValues(v.criteria[S],w.criteria[S],u[S]);if(j!==0)return j}return 0}).map(v=>v.original)}e.orderBy=i})(k0)),k0}var A0={},CN;function t8(){return CN||(CN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),c=(u,d)=>{for(let p=0;p<u.length;p++){const h=u[p];Array.isArray(h)&&d<a?c(h,d+1):i.push(h)}};return c(n,0),i}e.flatten=t})(A0)),A0}var E0={},ON;function JA(){return ON||(ON=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=YA(),n=_v(),r=UA(),i=qA();function a(c,u,d){return r.isObject(d)&&(typeof u=="number"&&n.isArrayLike(d)&&t.isIndex(u)&&u<d.length||typeof u=="string"&&u in d)?i.isEqualsSameValueZero(d[u],c):!1}e.isIterateeCall=a})(E0)),E0}var AN;function n8(){return AN||(AN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=e8(),n=t8(),r=JA();function i(a,...c){const u=c.length;return u>1&&r.isIterateeCall(a,c[0],c[1])?c=[]:u>2&&r.isIterateeCall(c[0],c[1],c[2])&&(c=[c[0]]),t.orderBy(a,n.flatten(c),["asc"])}e.sortBy=i})(N0)),N0}var T0,EN;function r8(){return EN||(EN=1,T0=n8().sortBy),T0}var i8=r8();const Uf=Jr(i8);var ZA=e=>e.legend.settings,s8=e=>e.legend.size,a8=e=>e.legend.payload;Z([a8,ZA],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?Uf(r,n):r});var ed=1;function o8(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=b.useState({height:0,left:0,top:0,width:0}),r=b.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),c={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(c.height-t.height)>ed||Math.abs(c.left-t.left)>ed||Math.abs(c.top-t.top)>ed||Math.abs(c.width-t.width)>ed)&&n({height:c.height,left:c.left,top:c.top,width:c.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Yt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var l8=typeof Symbol=="function"&&Symbol.observable||"@@observable",TN=l8,M0=()=>Math.random().toString(36).substring(7).split("").join("."),c8={INIT:`@@redux/INIT${M0()}`,REPLACE:`@@redux/REPLACE${M0()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${M0()}`},Vd=c8;function Rv(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function eE(e,t,n){if(typeof e!="function")throw new Error(Yt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Yt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Yt(1));return n(eE)(e,t)}let r=e,i=t,a=new Map,c=a,u=0,d=!1;function p(){c===a&&(c=new Map,a.forEach((j,k)=>{c.set(k,j)}))}function h(){if(d)throw new Error(Yt(3));return i}function m(j){if(typeof j!="function")throw new Error(Yt(4));if(d)throw new Error(Yt(5));let k=!0;p();const C=u++;return c.set(C,j),function(){if(k){if(d)throw new Error(Yt(6));k=!1,p(),c.delete(C),a=null}}}function g(j){if(!Rv(j))throw new Error(Yt(7));if(typeof j.type>"u")throw new Error(Yt(8));if(typeof j.type!="string")throw new Error(Yt(17));if(d)throw new Error(Yt(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=c).forEach(C=>{C()}),j}function v(j){if(typeof j!="function")throw new Error(Yt(10));r=j,g({type:Vd.REPLACE})}function w(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Yt(11));function C(){const A=k;A.next&&A.next(h())}return C(),{unsubscribe:j(C)}},[TN](){return this}}}return g({type:Vd.INIT}),{dispatch:g,subscribe:m,getState:h,replaceReducer:v,[TN]:w}}function u8(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Vd.INIT})>"u")throw new Error(Yt(12));if(typeof n(void 0,{type:Vd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Yt(13))})}function tE(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const c=t[a];typeof e[c]=="function"&&(n[c]=e[c])}const r=Object.keys(n);let i;try{u8(n)}catch(a){i=a}return function(c={},u){if(i)throw i;let d=!1;const p={};for(let h=0;h<r.length;h++){const m=r[h],g=n[m],v=c[m],w=g(v,u);if(typeof w>"u")throw u&&u.type,new Error(Yt(14));p[m]=w,d=d||w!==v}return d=d||r.length!==Object.keys(c).length,d?p:c}}function Ud(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function d8(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Yt(15))};const c={getState:i.getState,dispatch:(d,...p)=>a(d,...p)},u=e.map(d=>d(c));return a=Ud(...u)(i.dispatch),{...i,dispatch:a}}}function nE(e){return Rv(e)&&"type"in e&&typeof e.type=="string"}var rE=Symbol.for("immer-nothing"),MN=Symbol.for("immer-draftable"),mn=Symbol.for("immer-state");function Pr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zn=Object,go=zn.getPrototypeOf,Wd="constructor",Wf="prototype",Kg="configurable",qd="enumerable",wd="writable",tc="value",yi=e=>!!e&&!!e[mn];function Tr(e){var t;return e?iE(e)||Kf(e)||!!e[MN]||!!((t=e[Wd])!=null&&t[MN])||Hf(e)||Gf(e):!1}var f8=zn[Wf][Wd].toString(),_N=new WeakMap;function iE(e){if(!e||!Lv(e))return!1;const t=go(e);if(t===null||t===zn[Wf])return!0;const n=zn.hasOwnProperty.call(t,Wd)&&t[Wd];if(n===Object)return!0;if(!Ga(n))return!1;let r=_N.get(n);return r===void 0&&(r=Function.toString.call(n),_N.set(n,r)),r===f8}function qf(e,t,n=!0){jc(e)===0?(n?Reflect.ownKeys(e):zn.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function jc(e){const t=e[mn];return t?t.type_:Kf(e)?1:Hf(e)?2:Gf(e)?3:0}var IN=(e,t,n=jc(e))=>n===2?e.has(t):zn[Wf].hasOwnProperty.call(e,t),Hg=(e,t,n=jc(e))=>n===2?e.get(t):e[t],Kd=(e,t,n,r=jc(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function p8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Kf=Array.isArray,Hf=e=>e instanceof Map,Gf=e=>e instanceof Set,Lv=e=>typeof e=="object",Ga=e=>typeof e=="function",_0=e=>typeof e=="boolean";function h8(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ui=e=>e.copy_||e.base_,$v=e=>e.modified_?e.copy_:e.base_;function Gg(e,t){if(Hf(e))return new Map(e);if(Gf(e))return new Set(e);if(Kf(e))return Array[Wf].slice.call(e);const n=iE(e);if(t===!0||t==="class_only"&&!n){const r=zn.getOwnPropertyDescriptors(e);delete r[mn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const c=i[a],u=r[c];u[wd]===!1&&(u[wd]=!0,u[Kg]=!0),(u.get||u.set)&&(r[c]={[Kg]:!0,[wd]:!0,[qd]:u[qd],[tc]:e[c]})}return zn.create(go(e),r)}else{const r=go(e);if(r!==null&&n)return{...e};const i=zn.create(r);return zn.assign(i,e)}}function zv(e,t=!1){return Yf(e)||yi(e)||!Tr(e)||(jc(e)>1&&zn.defineProperties(e,{set:td,add:td,clear:td,delete:td}),zn.freeze(e),t&&qf(e,(n,r)=>{zv(r,!0)},!1)),e}function m8(){Pr(2)}var td={[tc]:m8};function Yf(e){return e===null||!Lv(e)?!0:zn.isFrozen(e)}var Hd="MapSet",Yg="Patches",DN="ArrayMethods",sE={};function sa(e){const t=sE[e];return t||Pr(0,e),t}var RN=e=>!!sE[e],nc,aE=()=>nc,g8=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:RN(Hd)?sa(Hd):void 0,arrayMethodsPlugin_:RN(DN)?sa(DN):void 0});function LN(e,t){t&&(e.patchPlugin_=sa(Yg),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xg(e){Qg(e),e.drafts_.forEach(x8),e.drafts_=null}function Qg(e){e===nc&&(nc=e.parent_)}var $N=e=>nc=g8(nc,e);function x8(e){const t=e[mn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function zN(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[mn].modified_&&(Xg(t),Pr(4)),Tr(e)&&(e=FN(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[mn].base_,e,t)}else e=FN(t,n);return v8(t,e,!0),Xg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rE?e:void 0}function FN(e,t){if(Yf(t))return t;const n=t[mn];if(!n)return Gd(t,e.handledSet_,e);if(!Xf(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);cE(n,e)}return n.copy_}function v8(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&zv(t,n)}function oE(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Xf=(e,t)=>e.scope_===t,y8=[];function lE(e,t,n,r){const i=ui(e),a=e.type_;if(r!==void 0&&Hg(i,r,a)===t){Kd(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;qf(i,(d,p)=>{if(yi(p)){const h=u.get(p)||[];h.push(d),u.set(p,h)}})}const c=e.draftLocations_.get(t)??y8;for(const u of c)Kd(i,u,n,a)}function b8(e,t,n){e.callbacks_.push(function(i){var u;const a=t;if(!a||!Xf(a,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(a);const c=$v(a);lE(e,a.draft_??a,c,n),cE(a,i)})}function cE(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}oE(e)}}function w8(e,t,n){const{scope_:r}=e;if(yi(n)){const i=n[mn];Xf(i,r)&&i.callbacks_.push(function(){jd(e);const c=$v(i);lE(e,n,c,t)})}else Tr(n)&&e.callbacks_.push(function(){const a=ui(e);e.type_===3?a.has(n)&&Gd(n,r.handledSet_,r):Hg(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Gd(Hg(e.copy_,t,e.type_),r.handledSet_,r)})}function Gd(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||yi(e)||t.has(e)||!Tr(e)||Yf(e)||(t.add(e),qf(e,(r,i)=>{if(yi(i)){const a=i[mn];if(Xf(a,n)){const c=$v(a);Kd(e,r,c,e.type_),oE(a)}}else Tr(i)&&Gd(i,t,n)})),e}function j8(e,t){const n=Kf(e),r={type_:n?1:0,scope_:t?t.scope_:aE(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Yd;n&&(i=[r],a=rc);const{revoke:c,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=c,[u,r]}var Yd={get(e,t){if(t===mn)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=ui(e);if(!IN(i,t,e.type_))return S8(e,i,t);const a=i[t];if(e.finalized_||!Tr(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&h8(t))return a;if(a===I0(e.base_,t)){jd(e);const c=e.type_===1?+t:t,u=Zg(e.scope_,a,e,c);return e.copy_[c]=u}return a},has(e,t){return t in ui(e)},ownKeys(e){return Reflect.ownKeys(ui(e))},set(e,t,n){const r=uE(ui(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=I0(ui(e),t),a=i==null?void 0:i[mn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(p8(n,i)&&(n!==void 0||IN(e.base_,t,e.type_)))return!0;jd(e),Jg(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),w8(e,t,n)),!0},deleteProperty(e,t){return jd(e),I0(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Jg(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ui(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[wd]:!0,[Kg]:e.type_!==1||t!=="length",[qd]:r[qd],[tc]:n[t]}},defineProperty(){Pr(11)},getPrototypeOf(e){return go(e.base_)},setPrototypeOf(){Pr(12)}},rc={};for(let e in Yd){let t=Yd[e];rc[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}rc.deleteProperty=function(e,t){return rc.set.call(this,e,t,void 0)};rc.set=function(e,t,n){return Yd.set.call(this,e[0],t,n,e[0])};function I0(e,t){const n=e[mn];return(n?ui(n):e)[t]}function S8(e,t,n){var i;const r=uE(t,n);return r?tc in r?r[tc]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function uE(e,t){if(!(t in e))return;let n=go(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=go(n)}}function Jg(e){e.modified_||(e.modified_=!0,e.parent_&&Jg(e.parent_))}function jd(e){e.copy_||(e.assigned_=new Map,e.copy_=Gg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var N8=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Ga(n)&&!Ga(r)){const c=r;r=n;const u=this;return function(p=c,...h){return u.produce(p,m=>r.call(this,m,...h))}}Ga(r)||Pr(6),i!==void 0&&!Ga(i)&&Pr(7);let a;if(Tr(n)){const c=$N(this),u=Zg(c,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?Xg(c):Qg(c)}return LN(c,i),zN(a,c)}else if(!n||!Lv(n)){if(a=r(n),a===void 0&&(a=n),a===rE&&(a=void 0),this.autoFreeze_&&zv(a,!0),i){const c=[],u=[];sa(Yg).generateReplacementPatches_(n,a,{patches_:c,inversePatches_:u}),i(c,u)}return a}else Pr(1,n)},this.produceWithPatches=(n,r)=>{if(Ga(n))return(u,...d)=>this.produceWithPatches(u,p=>n(p,...d));let i,a;return[this.produce(n,r,(u,d)=>{i=u,a=d}),i,a]},_0(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),_0(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),_0(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Tr(t)||Pr(8),yi(t)&&(t=Ar(t));const n=$N(this),r=Zg(n,t,void 0);return r[mn].isManual_=!0,Qg(n),r}finishDraft(t,n){const r=t&&t[mn];(!r||!r.isManual_)&&Pr(9);const{scope_:i}=r;return LN(i,n),zN(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=sa(Yg).applyPatches_;return yi(t)?i(t,n):this.produce(t,a=>i(a,n))}};function Zg(e,t,n,r){const[i,a]=Hf(t)?sa(Hd).proxyMap_(t,n):Gf(t)?sa(Hd).proxySet_(t,n):j8(t,n);return((n==null?void 0:n.scope_)??aE()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?b8(n,a,r):a.callbacks_.push(function(d){var h;(h=d.mapSetPlugin_)==null||h.fixSetContents(a);const{patchPlugin_:p}=d;a.modified_&&p&&p.generatePatches_(a,[],d)}),i}function Ar(e){return yi(e)||Pr(10,e),dE(e)}function dE(e){if(!Tr(e)||Yf(e))return e;const t=e[mn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Gg(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Gg(e,!0);return qf(n,(i,a)=>{Kd(n,i,dE(a))},r),t&&(t.finalized_=!1),n}var k8=new N8,fE=k8.produce;function pE(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var P8=pE(),C8=pE,O8=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ud:Ud.apply(null,arguments)};function cr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Bn(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>nE(r)&&r.type===e,n}var hE=class Rl extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Rl.prototype)}static get[Symbol.species](){return Rl}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Rl(...t[0].concat(this)):new Rl(...t.concat(this))}};function BN(e){return Tr(e)?fE(e,()=>{}):e}function nd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function A8(e){return typeof e=="boolean"}var E8=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let c=new hE;return n&&(A8(n)?c.push(P8):c.push(C8(n.extraArgument))),c},mE="RTK_autoBatch",ut=()=>e=>({payload:e,meta:{[mE]:!0}}),VN=e=>t=>{setTimeout(t,e)},gE=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,c=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:VN(10):e.type==="callback"?e.queueNotification:VN(e.timeout),p=()=>{c=!1,a&&(a=!1,u.forEach(h=>h()))};return Object.assign({},r,{subscribe(h){const m=()=>i&&h(),g=r.subscribe(m);return u.add(h),()=>{g(),u.delete(h)}},dispatch(h){var m;try{return i=!((m=h==null?void 0:h.meta)!=null&&m[mE]),a=!i,a&&(c||(c=!0,d(p))),r.dispatch(h)}finally{i=!0}}})},T8=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new hE(e);return r&&i.push(gE(typeof r=="object"?r:void 0)),i};function M8(e){const t=E8(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:c=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(Rv(n))u=tE(n);else throw new Error(Bn(1));let d;typeof r=="function"?d=r(t):d=t();let p=Ud;i&&(p=O8({trace:!1,...typeof i=="object"&&i}));const h=d8(...d),m=T8(h);let g=typeof c=="function"?c(m):m();const v=p(...g);return eE(u,a,v)}function xE(e){const t={},n=[];let r;const i={addCase(a,c){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(Bn(28));if(u in t)throw new Error(Bn(29));return t[u]=c,i},addAsyncThunk(a,c){return c.pending&&(t[a.pending.type]=c.pending),c.rejected&&(t[a.rejected.type]=c.rejected),c.fulfilled&&(t[a.fulfilled.type]=c.fulfilled),c.settled&&n.push({matcher:a.settled,reducer:c.settled}),i},addMatcher(a,c){return n.push({matcher:a,reducer:c}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function _8(e){return typeof e=="function"}function I8(e,t){let[n,r,i]=xE(t),a;if(_8(e))a=()=>BN(e());else{const u=BN(e);a=()=>u}function c(u=a(),d){let p=[n[d.type],...r.filter(({matcher:h})=>h(d)).map(({reducer:h})=>h)];return p.filter(h=>!!h).length===0&&(p=[i]),p.reduce((h,m)=>{if(m)if(yi(h)){const v=m(h,d);return v===void 0?h:v}else{if(Tr(h))return fE(h,g=>m(g,d));{const g=m(h,d);if(g===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}}return h},u)}return c.getInitialState=a,c}var D8="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",R8=(e=21)=>{let t="",n=e;for(;n--;)t+=D8[Math.random()*64|0];return t},L8=Symbol.for("rtk-slice-createasyncthunk");function $8(e,t){return`${e}/${t}`}function z8({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[L8];return function(i){const{name:a,reducerPath:c=a}=i;if(!a)throw new Error(Bn(11));const u=(typeof i.reducers=="function"?i.reducers(B8()):i.reducers)||{},d=Object.keys(u),p={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(A,P){const O=typeof A=="string"?A:A.type;if(!O)throw new Error(Bn(12));if(O in p.sliceCaseReducersByType)throw new Error(Bn(13));return p.sliceCaseReducersByType[O]=P,h},addMatcher(A,P){return p.sliceMatchers.push({matcher:A,reducer:P}),h},exposeAction(A,P){return p.actionCreators[A]=P,h},exposeCaseReducer(A,P){return p.sliceCaseReducersByName[A]=P,h}};d.forEach(A=>{const P=u[A],O={reducerName:A,type:$8(a,A),createNotation:typeof i.reducers=="function"};U8(P)?q8(O,P,h,t):V8(O,P,h)});function m(){const[A={},P=[],O=void 0]=typeof i.extraReducers=="function"?xE(i.extraReducers):[i.extraReducers],M={...A,...p.sliceCaseReducersByType};return I8(i.initialState,I=>{for(let z in M)I.addCase(z,M[z]);for(let z of p.sliceMatchers)I.addMatcher(z.matcher,z.reducer);for(let z of P)I.addMatcher(z.matcher,z.reducer);O&&I.addDefaultCase(O)})}const g=A=>A,v=new Map,w=new WeakMap;let S;function j(A,P){return S||(S=m()),S(A,P)}function k(){return S||(S=m()),S.getInitialState()}function C(A,P=!1){function O(I){let z=I[A];return typeof z>"u"&&P&&(z=nd(w,O,k)),z}function M(I=g){const z=nd(v,P,()=>new WeakMap);return nd(z,I,()=>{const K={};for(const[L,R]of Object.entries(i.selectors??{}))K[L]=F8(R,I,()=>nd(w,I,k),P);return K})}return{reducerPath:A,getSelectors:M,get selectors(){return M(O)},selectSlice:O}}const E={name:a,reducer:j,actions:p.actionCreators,caseReducers:p.sliceCaseReducersByName,getInitialState:k,...C(c),injectInto(A,{reducerPath:P,...O}={}){const M=P??c;return A.inject({reducerPath:M,reducer:j},O),{...E,...C(M,!0)}}};return E}}function F8(e,t,n,r){function i(a,...c){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...c)}return i.unwrapped=e,i}var An=z8();function B8(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function V8({type:e,reducerName:t,createNotation:n},r,i){let a,c;if("reducer"in r){if(n&&!W8(r))throw new Error(Bn(17));a=r.reducer,c=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,c?cr(e,c):cr(e))}function U8(e){return e._reducerDefinitionType==="asyncThunk"}function W8(e){return e._reducerDefinitionType==="reducerWithPrepare"}function q8({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Bn(18));const{payloadCreator:a,fulfilled:c,pending:u,rejected:d,settled:p,options:h}=n,m=i(e,a,h);r.exposeAction(t,m),c&&r.addCase(m.fulfilled,c),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),p&&r.addMatcher(m.settled,p),r.exposeCaseReducer(t,{fulfilled:c||rd,pending:u||rd,rejected:d||rd,settled:p||rd})}function rd(){}var K8="task",vE="listener",yE="completed",Fv="cancelled",H8=`task-${Fv}`,G8=`task-${yE}`,ex=`${vE}-${Fv}`,Y8=`${vE}-${yE}`,Qf=class{constructor(e){lm(this,"name","TaskAbortError");lm(this,"message");this.code=e,this.message=`${K8} ${Fv} (reason: ${e})`}},Bv=(e,t)=>{if(typeof e!="function")throw new TypeError(Bn(32))},Xd=()=>{},bE=(e,t=Xd)=>(e.catch(t),e),wE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Js=e=>{if(e.aborted)throw new Qf(e.reason)};function jE(e,t){let n=Xd;return new Promise((r,i)=>{const a=()=>i(new Qf(e.reason));if(e.aborted){a();return}n=wE(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Xd})}var X8=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Qf?"cancelled":"rejected",error:n}}finally{t==null||t()}},Qd=e=>t=>bE(jE(e,t).then(n=>(Js(e),n))),SE=e=>{const t=Qd(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:ao}=Object,UN={},Jf="listenerMiddleware",Q8=(e,t)=>{const n=r=>wE(e,()=>r.abort(e.reason));return(r,i)=>{Bv(r);const a=new AbortController;n(a);const c=X8(async()=>{Js(e),Js(a.signal);const u=await r({pause:Qd(a.signal),delay:SE(a.signal),signal:a.signal});return Js(a.signal),u},()=>a.abort(G8));return i!=null&&i.autoJoin&&t.push(c.catch(Xd)),{result:Qd(e)(c),cancel(){a.abort(H8)}}}},J8=(e,t)=>{const n=async(r,i)=>{Js(t);let a=()=>{};const u=[new Promise((d,p)=>{let h=e({predicate:r,effect:(m,g)=>{g.unsubscribe(),d([m,g.getState(),g.getOriginalState()])}});a=()=>{h(),p()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await jE(t,Promise.race(u));return Js(t),d}finally{a()}};return(r,i)=>bE(n(r,i))},NE=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=cr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Bn(21));return Bv(a),{predicate:i,type:t,effect:a}},kE=ao(e=>{const{type:t,predicate:n,effect:r}=NE(e);return{id:R8(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Bn(22))}}},{withTypes:()=>kE}),WN=(e,t)=>{const{type:n,effect:r,predicate:i}=NE(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},tx=e=>{e.pending.forEach(t=>{t.abort(ex)})},Z8=(e,t)=>()=>{for(const n of t.keys())tx(n);e.clear()},qN=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},PE=ao(cr(`${Jf}/add`),{withTypes:()=>PE}),eV=cr(`${Jf}/removeAll`),CE=ao(cr(`${Jf}/remove`),{withTypes:()=>CE}),tV=(...e)=>{console.error(`${Jf}/error`,...e)},Sc=(e={})=>{const t=new Map,n=new Map,r=v=>{const w=n.get(v)??0;n.set(v,w+1)},i=v=>{const w=n.get(v)??1;w===1?n.delete(v):n.set(v,w-1)},{extra:a,onError:c=tV}=e;Bv(c);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),w=>{v.unsubscribe(),w!=null&&w.cancelActive&&tx(v)}),d=v=>{const w=WN(t,v)??kE(v);return u(w)};ao(d,{withTypes:()=>d});const p=v=>{const w=WN(t,v);return w&&(w.unsubscribe(),v.cancelActive&&tx(w)),!!w};ao(p,{withTypes:()=>p});const h=async(v,w,S,j)=>{const k=new AbortController,C=J8(d,k.signal),E=[];try{v.pending.add(k),r(v),await Promise.resolve(v.effect(w,ao({},S,{getOriginalState:j,condition:(A,P)=>C(A,P).then(Boolean),take:C,delay:SE(k.signal),pause:Qd(k.signal),extra:a,signal:k.signal,fork:Q8(k.signal,E),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,P,O)=>{A!==k&&(A.abort(ex),O.delete(A))})},cancel:()=>{k.abort(ex),v.pending.delete(k)},throwIfCancelled:()=>{Js(k.signal)}})))}catch(A){A instanceof Qf||qN(c,A,{raisedBy:"effect"})}finally{await Promise.all(E),k.abort(Y8),i(v),v.pending.delete(k)}},m=Z8(t,n);return{middleware:v=>w=>S=>{if(!nE(S))return w(S);if(PE.match(S))return d(S.payload);if(eV.match(S)){m();return}if(CE.match(S))return p(S.payload);let j=v.getState();const k=()=>{if(j===UN)throw new Error(Bn(23));return j};let C;try{if(C=w(S),t.size>0){const E=v.getState(),A=Array.from(t.values());for(const P of A){let O=!1;try{O=P.predicate(S,E,j)}catch(M){O=!1,qN(c,M,{raisedBy:"predicate"})}O&&h(P,S,v,k)}}}finally{j=UN}return C},startListening:d,stopListening:p,clearListeners:m}};function Bn(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var nV={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},OE=An({name:"chartLayout",initialState:nV,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:rV,setLayout:iV,setChartSize:sV,setScale:aV}=OE.actions,oV=OE.reducer;function AE(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function We(e){return Number.isFinite(e)}function gs(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function KN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KN(Object(n),!0).forEach(function(r){lV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lV(e,t,n){return(t=cV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cV(e){var t=uV(e,"string");return typeof t=="symbol"?t:t+""}function uV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function en(e,t,n){return Vt(e)||Vt(t)?n:Xr(t)?mo(e,t,n):typeof t=="function"?t(e):n}var dV=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:c,layout:u}=t;if((u==="vertical"||u==="horizontal"&&c==="middle")&&a!=="center"&&ke(e[a]))return no(no({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&c!=="middle"&&ke(e[c]))return no(no({},e),{},{[c]:e[c]+(i||0)})}return e},vs=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",fV=(e,t)=>{if(!t||t.length!==2||!ke(t[0])||!ke(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!ke(e[0])||e[0]<n)&&(i[0]=n),(!ke(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},pV=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,c=0,u=0;u<n;++u){var d=e[u],p=d==null?void 0:d[i];if(p!=null){var h=p[1],m=p[0],g=Yr(h)?m:h;g>=0?(p[0]=a,a+=g,p[1]=a):(p[0]=c,c+=g,p[1]=c)}}}},hV=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i<r;++i)for(var a=0,c=0;c<n;++c){var u=e[c],d=u==null?void 0:u[i];if(d!=null){var p=Yr(d[1])?d[0]:d[1];p>=0?(d[0]=a,a+=p,d[1]=a):(d[0]=0,d[1]=0)}}}},mV={sign:pV,expand:BB,none:ra,silhouette:VB,wiggle:UB,positive:hV},gV=(e,t,n)=>{var r,i=(r=mV[n])!==null&&r!==void 0?r:ra,a=FB().keys(t).value((u,d)=>Number(en(u,d,0))).order(Wg).offset(i),c=a(e);return c.forEach((u,d)=>{u.forEach((p,h)=>{var m=en(e[h],t[d],0);Array.isArray(m)&&m.length===2&&ke(m[0])&&ke(m[1])&&(p[0]=m[0],p[1]=m[1])})}),c};function xV(e){return e==null?void 0:String(e)}var HN=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:c}=e;if(t.type==="category")return n[c]?n[c].coordinate+r:null;var u=en(a,t.dataKey,t.scale.domain()[c]);if(Vt(u))return null;var d=t.scale.map(u);return ke(d)?d-i/2+r:null},vV=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},yV=e=>{var t=e.flat(2).filter(ke);return[Math.min(...t),Math.max(...t)]},bV=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],wV=(e,t,n)=>{if(e!=null)return bV(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:c}=a,u=c.reduce((d,p)=>{var h=AE(p,t,n),m=yV(h);return!We(m[0])||!We(m[1])?d:[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],r[0]),Math.max(u[1],r[1])]},[1/0,-1/0]))},GN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,YN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Jd=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=Uf(t,h=>h.coordinate),a=1/0,c=1,u=i.length;c<u;c++){var d=i[c],p=i[c-1];a=Math.min(((d==null?void 0:d.coordinate)||0)-((p==null?void 0:p.coordinate)||0),a)}return a===1/0?0:a}return n?void 0:0};function XN(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return no(no({},t),{},{dataKey:n,payload:r,value:i,name:a})}function EE(e,t){if(e)return String(e);if(typeof t=="string")return t}var jV=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},SV=(e,t)=>t==="centric"?e.angle:e.radius,Pi=e=>e.layout.width,Ci=e=>e.layout.height,NV=e=>e.layout.scale,TE=e=>e.layout.margin,Zf=Z(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),ep=Z(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),kV="data-recharts-item-index",PV="data-recharts-item-id",Nc=60;function QN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function id(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QN(Object(n),!0).forEach(function(r){CV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CV(e,t,n){return(t=OV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OV(e){var t=AV(e,"string");return typeof t=="symbol"?t:t+""}function AV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var EV=e=>e.brush.height;function TV(e){var t=ep(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Nc;return n+i}return n},0)}function MV(e){var t=ep(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Nc;return n+i}return n},0)}function _V(e){var t=Zf(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function IV(e){var t=Zf(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Ut=Z([Pi,Ci,TE,EV,TV,MV,_V,IV,ZA,s8],(e,t,n,r,i,a,c,u,d,p)=>{var h={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+c,bottom:(n.bottom||0)+u},g=id(id({},m),h),v=g.bottom;g.bottom+=r,g=dV(g,d,p);var w=e-g.left-g.right,S=t-g.top-g.bottom;return id(id({brushBottom:v},g),{},{width:Math.max(w,0),height:Math.max(S,0)})}),DV=Z(Ut,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Vv=Z(Pi,Ci,(e,t)=>({x:0,y:0,width:e,height:t})),RV=b.createContext(null),Wn=()=>b.useContext(RV)!=null,tp=e=>e.brush,np=Z([tp,Ut,TE],(e,t,n)=>({height:e.height,x:ke(e.x)?e.x:t.left,y:ke(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:ke(e.width)?e.width:t.width})),D0={},R0={},L0={},JN;function LV(){return JN||(JN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let c,u=null;const d=a!=null&&a.includes("leading"),p=a==null||a.includes("trailing"),h=()=>{u!==null&&(n.apply(c,u),c=void 0,u=null)},m=()=>{p&&h(),S()};let g=null;const v=()=>{g!=null&&clearTimeout(g),g=setTimeout(()=>{g=null,m()},r)},w=()=>{g!==null&&(clearTimeout(g),g=null)},S=()=>{w(),c=void 0,u=null},j=()=>{h()},k=function(...C){if(i!=null&&i.aborted)return;c=this,u=C;const E=g==null;v(),d&&E&&h()};return k.schedule=v,k.cancel=S,k.flush=j,i==null||i.addEventListener("abort",S,{once:!0}),k}e.debounce=t})(L0)),L0}var ZN;function $V(){return ZN||(ZN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LV();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:c=!1,trailing:u=!0,maxWait:d}=a,p=Array(2);c&&(p[0]="leading"),u&&(p[1]="trailing");let h,m=null;const g=t.debounce(function(...S){h=r.apply(this,S),m=null},i,{edges:p}),v=function(...S){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(h=r.apply(this,S),m=Date.now(),g.cancel(),g.schedule(),h):(g.apply(this,S),h)},w=()=>(g.flush(),h);return v.cancel=g.cancel,v.flush=w,v}e.debounce=n})(R0)),R0}var ek;function zV(){return ek||(ek=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$V();function n(r,i=0,a={}){const{leading:c=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:c,maxWait:i,trailing:u})}e.throttle=n})(D0)),D0}var $0,tk;function FV(){return tk||(tk=1,$0=zV().throttle),$0}var BV=FV();const VV=Jr(BV);var nk=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=0;console.warn(n.replace(/%s/g,()=>i[c++]))}},Ur={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},ME=(e,t,n)=>{var{width:r=Ur.width,height:i=Ur.height,aspect:a,maxHeight:c}=n,u=ia(r)?e:Number(r),d=ia(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),c&&d!=null&&d>c&&(d=c)),{calculatedWidth:u,calculatedHeight:d}},UV={width:0,height:0,overflow:"visible"},WV={width:0,overflowX:"visible"},qV={height:0,overflowY:"visible"},KV={},HV=e=>{var{width:t,height:n}=e,r=ia(t),i=ia(n);return r&&i?UV:r?WV:i?qV:KV};function GV(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Ur.width,a=Ur.height):i===void 0?i=r&&r>0?void 0:Ur.width:a===void 0&&(a=r&&r>0?void 0:Ur.height),{width:i,height:a}}function nx(){return nx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nx.apply(null,arguments)}function rk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ik(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rk(Object(n),!0).forEach(function(r){YV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YV(e,t,n){return(t=XV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XV(e){var t=QV(e,"string");return typeof t=="symbol"?t:t+""}function QV(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var _E=b.createContext(Ur.initialDimension);function JV(e){return gs(e.width)&&gs(e.height)}function IE(e){var{children:t,width:n,height:r}=e,i=b.useMemo(()=>({width:n,height:r}),[n,r]);return JV(i)?b.createElement(_E.Provider,{value:i},t):null}var Uv=()=>b.useContext(_E),ZV=b.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Ur.initialDimension,width:i,height:a,minWidth:c=Ur.minWidth,minHeight:u,maxHeight:d,children:p,debounce:h=Ur.debounce,id:m,className:g,onResize:v,style:w={}}=e,S=b.useRef(null),j=b.useRef();j.current=v,b.useImperativeHandle(t,()=>S.current);var[k,C]=b.useState({containerWidth:r.width,containerHeight:r.height}),E=b.useCallback((I,z)=>{C(K=>{var L=Math.round(I),R=Math.round(z);return K.containerWidth===L&&K.containerHeight===R?K:{containerWidth:L,containerHeight:R}})},[]);b.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return Ao;var I=R=>{var ee,J=R[0];if(J!=null){var{width:ne,height:re}=J.contentRect;E(ne,re),(ee=j.current)===null||ee===void 0||ee.call(j,ne,re)}};h>0&&(I=VV(I,h,{trailing:!0,leading:!1}));var z=new ResizeObserver(I),{width:K,height:L}=S.current.getBoundingClientRect();return E(K,L),z.observe(S.current),()=>{z.disconnect()}},[E,h]);var{containerWidth:A,containerHeight:P}=k;nk(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:O,calculatedHeight:M}=ME(A,P,{width:i,height:a,aspect:n,maxHeight:d});return nk(O!=null&&O>0||M!=null&&M>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
334
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
335
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
336
|
+
height and width.`,O,M,i,a,c,u,n),b.createElement("div",{id:m?"".concat(m):void 0,className:rt("recharts-responsive-container",g),style:ik(ik({},w),{},{width:i,height:a,minWidth:c,minHeight:u,maxHeight:d}),ref:S},b.createElement("div",{style:HV({width:i,height:a})},b.createElement(IE,{width:O,height:M},p)))}),e9=b.forwardRef((e,t)=>{var n=Uv();if(gs(n.width)&&gs(n.height))return e.children;var{width:r,height:i}=GV({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:c}=ME(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ke(a)&&ke(c)?b.createElement(IE,{width:a,height:c},e.children):b.createElement(ZV,nx({},e,{width:r,height:i,ref:t}))});function Wv(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var rp=()=>{var e,t=Wn(),n=Ee(DV),r=Ee(np),i=(e=Ee(tp))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},t9={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},n9=()=>{var e;return(e=Ee(Ut))!==null&&e!==void 0?e:t9},r9=()=>Ee(Pi),i9=()=>Ee(Ci),Ze=e=>e.layout.layoutType,Eo=()=>Ee(Ze),DE=()=>{var e=Eo();if(e==="horizontal"||e==="vertical")return e},RE=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},s9=()=>{var e=Eo();return e!==void 0},kc=e=>{var t=St(),n=Wn(),{width:r,height:i}=e,a=Uv(),c=r,u=i;return a&&(c=a.width>0?a.width:r,u=a.height>0?a.height:i),b.useEffect(()=>{!n&&gs(c)&&gs(u)&&t(sV({width:c,height:u}))},[t,n,c,u]),null},LE=Symbol.for("immer-nothing"),sk=Symbol.for("immer-draftable"),Un=Symbol.for("immer-state");function Cr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ic=Object.getPrototypeOf;function xo(e){return!!e&&!!e[Un]}function aa(e){var t;return e?$E(e)||Array.isArray(e)||!!e[sk]||!!((t=e.constructor)!=null&&t[sk])||Pc(e)||sp(e):!1}var a9=Object.prototype.constructor.toString(),ak=new WeakMap;function $E(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=ak.get(n);return r===void 0&&(r=Function.toString.call(n),ak.set(n,r)),r===a9}function Zd(e,t,n=!0){ip(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function ip(e){const t=e[Un];return t?t.type_:Array.isArray(e)?1:Pc(e)?2:sp(e)?3:0}function rx(e,t){return ip(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function zE(e,t,n){const r=ip(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function o9(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Pc(e){return e instanceof Map}function sp(e){return e instanceof Set}function qs(e){return e.copy_||e.base_}function ix(e,t){if(Pc(e))return new Map(e);if(sp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=$E(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Un];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const c=i[a],u=r[c];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[c]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[c]})}return Object.create(ic(e),r)}else{const r=ic(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function qv(e,t=!1){return ap(e)||xo(e)||!aa(e)||(ip(e)>1&&Object.defineProperties(e,{set:sd,add:sd,clear:sd,delete:sd}),Object.freeze(e),t&&Object.values(e).forEach(n=>qv(n,!0))),e}function l9(){Cr(2)}var sd={value:l9};function ap(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var c9={};function oa(e){const t=c9[e];return t||Cr(0,e),t}var sc;function FE(){return sc}function u9(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ok(e,t){t&&(oa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function sx(e){ax(e),e.drafts_.forEach(d9),e.drafts_=null}function ax(e){e===sc&&(sc=e.parent_)}function lk(e){return sc=u9(sc,e)}function d9(e){const t=e[Un];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ck(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Un].modified_&&(sx(t),Cr(4)),aa(e)&&(e=ef(t,e),t.parent_||tf(t,e)),t.patches_&&oa("Patches").generateReplacementPatches_(n[Un].base_,e,t.patches_,t.inversePatches_)):e=ef(t,n,[]),sx(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==LE?e:void 0}function ef(e,t,n){if(ap(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Un];if(!i)return Zd(t,(a,c)=>uk(e,i,t,a,c,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return tf(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let c=a,u=!1;i.type_===3&&(c=new Set(a),a.clear(),u=!0),Zd(c,(d,p)=>uk(e,i,a,d,p,n,u),r),tf(e,a,!1),n&&e.patches_&&oa("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function uk(e,t,n,r,i,a,c){if(i==null||typeof i!="object"&&!c)return;const u=ap(i);if(!(u&&!c)){if(xo(i)){const d=a&&t&&t.type_!==3&&!rx(t.assigned_,r)?a.concat(r):void 0,p=ef(e,i,d);if(zE(n,r,p),xo(p))e.canAutoFreeze_=!1;else return}else c&&n.add(i);if(aa(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;ef(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Pc(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&tf(e,i)}}}function tf(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&qv(t,n)}function f9(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:FE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Kv;n&&(i=[r],a=ac);const{revoke:c,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=c,u}var Kv={get(e,t){if(t===Un)return e;const n=qs(e);if(!rx(n,t))return p9(e,n,t);const r=n[t];return e.finalized_||!aa(r)?r:r===z0(e.base_,t)?(F0(e),e.copy_[t]=lx(r,e)):r},has(e,t){return t in qs(e)},ownKeys(e){return Reflect.ownKeys(qs(e))},set(e,t,n){const r=BE(qs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=z0(qs(e),t),a=i==null?void 0:i[Un];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(o9(n,i)&&(n!==void 0||rx(e.base_,t)))return!0;F0(e),ox(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return z0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,F0(e),ox(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=qs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Cr(11)},getPrototypeOf(e){return ic(e.base_)},setPrototypeOf(){Cr(12)}},ac={};Zd(Kv,(e,t)=>{ac[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ac.deleteProperty=function(e,t){return ac.set.call(this,e,t,void 0)};ac.set=function(e,t,n){return Kv.set.call(this,e[0],t,n,e[0])};function z0(e,t){const n=e[Un];return(n?qs(n):e)[t]}function p9(e,t,n){var i;const r=BE(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function BE(e,t){if(!(t in e))return;let n=ic(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=ic(n)}}function ox(e){e.modified_||(e.modified_=!0,e.parent_&&ox(e.parent_))}function F0(e){e.copy_||(e.copy_=ix(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var h9=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const c=this;return function(d=a,...p){return c.produce(d,h=>n.call(this,h,...p))}}typeof n!="function"&&Cr(6),r!==void 0&&typeof r!="function"&&Cr(7);let i;if(aa(t)){const a=lk(this),c=lx(t,void 0);let u=!0;try{i=n(c),u=!1}finally{u?sx(a):ax(a)}return ok(a,r),ck(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===LE&&(i=void 0),this.autoFreeze_&&qv(i,!0),r){const a=[],c=[];oa("Patches").generateReplacementPatches_(t,i,a,c),r(a,c)}return i}else Cr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(c,...u)=>this.produceWithPatches(c,d=>t(d,...u));let r,i;return[this.produce(t,n,(c,u)=>{r=c,i=u}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){aa(e)||Cr(8),xo(e)&&(e=m9(e));const t=lk(this),n=lx(e,void 0);return n[Un].isManual_=!0,ax(t),n}finishDraft(e,t){const n=e&&e[Un];(!n||!n.isManual_)&&Cr(9);const{scope_:r}=n;return ok(r,t),ck(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=oa("Patches").applyPatches_;return xo(e)?r(e,t):this.produce(e,i=>r(i,t))}};function lx(e,t){const n=Pc(e)?oa("MapSet").proxyMap_(e,t):sp(e)?oa("MapSet").proxySet_(e,t):f9(e,t);return(t?t.scope_:FE()).drafts_.push(n),n}function m9(e){return xo(e)||Cr(10,e),VE(e)}function VE(e){if(!aa(e)||ap(e))return e;const t=e[Un];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ix(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ix(e,!0);return Zd(n,(i,a)=>{zE(n,i,VE(a))},r),t&&(t.finalized_=!1),n}var g9=new h9;g9.produce;var x9={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},UE=An({name:"legend",initialState:x9,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:ut()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ar(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:ut()},removeLegendPayload:{reducer(e,t){var n=Ar(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:ut()}}}),{setLegendSize:Dte,setLegendSettings:Rte,addLegendPayload:v9,replaceLegendPayload:y9,removeLegendPayload:b9}=UE.actions,w9=UE.reducer;function cx(){return cx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cx.apply(null,arguments)}function dk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Nl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dk(Object(n),!0).forEach(function(r){j9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function j9(e,t,n){return(t=S9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S9(e){var t=N9(e,"string");return typeof t=="symbol"?t:t+""}function N9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function k9(e){return Array.isArray(e)&&Xr(e[0])&&Xr(e[1])?e.join(" ~ "):e}var Wa={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1},P9=e=>{var{separator:t=Wa.separator,contentStyle:n,itemStyle:r,labelStyle:i=Wa.labelStyle,payload:a,formatter:c,itemSorter:u,wrapperClassName:d,labelClassName:p,label:h,labelFormatter:m,accessibilityLayer:g=Wa.accessibilityLayer}=e,v=()=>{if(a&&a.length){var P={padding:0,margin:0},O=(u?Uf(a,u):a).map((M,I)=>{if(M.type==="none")return null;var z=M.formatter||c||k9,{value:K,name:L}=M,R=K,ee=L;if(z){var J=z(K,L,M,I,a);if(Array.isArray(J))[R,ee]=J;else if(J!=null)R=J;else return null}var ne=Nl(Nl({},Wa.itemStyle),{},{color:M.color||Wa.itemStyle.color},r);return b.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:ne},Xr(ee)?b.createElement("span",{className:"recharts-tooltip-item-name"},ee):null,Xr(ee)?b.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,b.createElement("span",{className:"recharts-tooltip-item-value"},R),b.createElement("span",{className:"recharts-tooltip-item-unit"},M.unit||""))});return b.createElement("ul",{className:"recharts-tooltip-item-list",style:P},O)}return null},w=Nl(Nl({},Wa.contentStyle),n),S=Nl({margin:0},i),j=!Vt(h),k=j?h:"",C=rt("recharts-default-tooltip",d),E=rt("recharts-tooltip-label",p);j&&m&&a!==void 0&&a!==null&&(k=m(h,a));var A=g?{role:"status","aria-live":"assertive"}:{};return b.createElement("div",cx({className:C,style:w},A),b.createElement("p",{className:E,style:S},b.isValidElement(k)?k:"".concat(k)),v())},kl="recharts-tooltip-wrapper",C9={visibility:"hidden"};function O9(e){var{coordinate:t,translateX:n,translateY:r}=e;return rt(kl,{["".concat(kl,"-right")]:ke(n)&&t&&ke(t.x)&&n>=t.x,["".concat(kl,"-left")]:ke(n)&&t&&ke(t.x)&&n<t.x,["".concat(kl,"-bottom")]:ke(r)&&t&&ke(t.y)&&r>=t.y,["".concat(kl,"-top")]:ke(r)&&t&&ke(t.y)&&r<t.y})}function fk(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:c,tooltipDimension:u,viewBox:d,viewBoxDimension:p}=e;if(a&&ke(a[r]))return a[r];var h=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return c[r]?h:m;var g=d[r];if(g==null)return 0;if(c[r]){var v=h,w=g;return v<w?Math.max(m,g):Math.max(h,g)}if(p==null)return 0;var S=m+u,j=g+p;return S>j?Math.max(h,g):Math.max(m,g)}function A9(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function E9(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:c,tooltipBox:u,useTranslate3d:d,viewBox:p}=e,h,m,g;return u.height>0&&u.width>0&&n?(m=fk({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:c,tooltipDimension:u.width,viewBox:p,viewBoxDimension:p.width}),g=fk({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:c,tooltipDimension:u.height,viewBox:p,viewBoxDimension:p.height}),h=A9({translateX:m,translateY:g,useTranslate3d:d})):h=C9,{cssProperties:h,cssClasses:O9({translateX:m,translateY:g,coordinate:n})}}function pk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ad(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?pk(Object(n),!0).forEach(function(r){ux(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ux(e,t,n){return(t=T9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T9(e){var t=M9(e,"string");return typeof t=="symbol"?t:t+""}function M9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class _9 extends b.PureComponent{constructor(){super(...arguments),ux(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),ux(this,"handleKeyDown",t=>{if(t.key==="Escape"){var n,r,i,a;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0,y:(i=(a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:r,animationEasing:i,children:a,coordinate:c,hasPayload:u,isAnimationActive:d,offset:p,position:h,reverseDirection:m,useTranslate3d:g,viewBox:v,wrapperStyle:w,lastBoundingBox:S,innerRef:j,hasPortalFromProps:k}=this.props,C=typeof p=="number"?p:p.x,E=typeof p=="number"?p:p.y,{cssClasses:A,cssProperties:P}=E9({allowEscapeViewBox:n,coordinate:c,offsetLeft:C,offsetTop:E,position:h,reverseDirection:m,tooltipBox:{height:S.height,width:S.width},useTranslate3d:g,viewBox:v}),O=k?{}:ad(ad({transition:d&&t?"transform ".concat(r,"ms ").concat(i):void 0},P),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&u?"visible":"hidden",position:"absolute",top:0,left:0}),M=ad(ad({},O),{},{visibility:!this.state.dismissed&&t&&u?"visible":"hidden"},w);return b.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:A,style:M,ref:j},a)}}var WE=()=>{var e;return(e=Ee(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function dx(){return dx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dx.apply(null,arguments)}function hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hk(Object(n),!0).forEach(function(r){I9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function I9(e,t,n){return(t=D9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function D9(e){var t=R9(e,"string");return typeof t=="symbol"?t:t+""}function R9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var gk={curveBasisClosed:AB,curveBasisOpen:EB,curveBasis:OB,curveBumpX:hB,curveBumpY:mB,curveLinearClosed:TB,curveLinear:Bf,curveMonotoneX:MB,curveMonotoneY:_B,curveNatural:IB,curveStep:DB,curveStepAfter:LB,curveStepBefore:RB},nf=e=>We(e.x)&&We(e.y),xk=e=>e.base!=null&&nf(e.base)&&nf(e),Pl=e=>e.x,Cl=e=>e.y,L9=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(wc(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=gk["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return gk[n]||Bf},vk={connectNulls:!1,type:"linear"},$9=e=>{var{type:t=vk.type,points:n=[],baseLine:r,layout:i,connectNulls:a=vk.connectNulls}=e,c=L9(t,i),u=a?n.filter(nf):n;if(Array.isArray(r)){var d,p=n.map((w,S)=>mk(mk({},w),{},{base:r[S]}));i==="vertical"?d=Ju().y(Cl).x1(Pl).x0(w=>w.base.x):d=Ju().x(Pl).y1(Cl).y0(w=>w.base.y);var h=d.defined(xk).curve(c),m=a?p.filter(xk):p;return h(m)}var g;i==="vertical"&&ke(r)?g=Ju().y(Cl).x1(Pl).x0(r):ke(r)?g=Ju().x(Pl).y1(Cl).y0(r):g=PA().x(Pl).y(Cl);var v=g.defined(nf).curve(c);return v(u)},qE=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Eo();if((!n||!n.length)&&!r)return null;var c={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?$9(c):r;return b.createElement("path",dx({},ms(e),o7(e),{className:rt("recharts-curve",t),d:u===null?void 0:u,ref:i}))},z9=["x","y","top","left","width","height","className"];function fx(){return fx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fx.apply(null,arguments)}function yk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function F9(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yk(Object(n),!0).forEach(function(r){B9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function B9(e,t,n){return(t=V9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V9(e){var t=U9(e,"string");return typeof t=="symbol"?t:t+""}function U9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function W9(e,t){if(e==null)return{};var n,r,i=q9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function q9(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var K9=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),H9=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:c=0,className:u}=e,d=W9(e,z9),p=F9({x:t,y:n,top:r,left:i,width:a,height:c},d);return!ke(t)||!ke(n)||!ke(a)||!ke(c)||!ke(r)||!ke(i)?null:b.createElement("path",fx({},lr(p),{className:rt("recharts-cross",u),d:K9(t,n,a,c,r,i)}))};function G9(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function bk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function wk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bk(Object(n),!0).forEach(function(r){Y9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Y9(e,t,n){return(t=X9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function X9(e){var t=Q9(e,"string");return typeof t=="symbol"?t:t+""}function Q9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var J9=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),KE=(e,t,n)=>e.map(r=>"".concat(J9(r)," ").concat(t,"ms ").concat(n)).join(","),Z9=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),oc=(e,t)=>Object.keys(t).reduce((n,r)=>wk(wk({},n),{},{[r]:e(r,t[r])}),{});function jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jk(Object(n),!0).forEach(function(r){eU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eU(e,t,n){return(t=tU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tU(e){var t=nU(e,"string");return typeof t=="symbol"?t:t+""}function nU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rf=(e,t,n)=>e+(t-e)*n,px=e=>{var{from:t,to:n}=e;return t!==n},HE=(e,t,n)=>{var r=oc((i,a)=>{if(px(a)){var[c,u]=e(a.from,a.to,a.velocity);return At(At({},a),{},{from:c,velocity:u})}return a},t);return n<1?oc((i,a)=>px(a)&&r[i]!=null?At(At({},a),{},{velocity:rf(a.velocity,r[i].velocity,n),from:rf(a.from,r[i].from,n)}):a,t):HE(e,r,n-1)};function rU(e,t,n,r,i,a){var c,u=r.reduce((g,v)=>At(At({},g),{},{[v]:{from:e[v],velocity:0,to:t[v]}}),{}),d=()=>oc((g,v)=>v.from,u),p=()=>!Object.values(u).filter(px).length,h=null,m=g=>{c||(c=g);var v=g-c,w=v/n.dt;u=HE(n,u,w),i(At(At(At({},e),t),d())),c=g,p()||(h=a.setTimeout(m))};return()=>(h=a.setTimeout(m),()=>{var g;(g=h)===null||g===void 0||g()})}function iU(e,t,n,r,i,a,c){var u=null,d=i.reduce((m,g)=>{var v=e[g],w=t[g];return v==null||w==null?m:At(At({},m),{},{[g]:[v,w]})},{}),p,h=m=>{p||(p=m);var g=(m-p)/r,v=oc((S,j)=>rf(...j,n(g)),d);if(a(At(At(At({},e),t),v)),g<1)u=c.setTimeout(h);else{var w=oc((S,j)=>rf(...j,n(1)),d);a(At(At(At({},e),t),w))}};return()=>(u=c.setTimeout(h),()=>{var m;(m=u)===null||m===void 0||m()})}const sU=(e,t,n,r,i,a)=>{var c=Z9(e,t);return n==null?()=>(i(At(At({},e),t)),()=>{}):n.isStepper===!0?rU(e,t,n,c,i,a):iU(e,t,n,r,c,i,a)};var sf=1e-4,GE=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],YE=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),Sk=(e,t)=>n=>{var r=GE(e,t);return YE(r,n)},aU=(e,t)=>n=>{var r=GE(e,t),i=[...r.map((a,c)=>a*c).slice(1),0];return YE(i,n)},oU=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},lU=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(n.length===1)switch(n[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var i=oU(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},cU=(e,t,n,r)=>{var i=Sk(e,n),a=Sk(t,r),c=aU(e,n),u=p=>p>1?1:p<0?0:p,d=p=>{for(var h=p>1?1:p,m=h,g=0;g<8;++g){var v=i(m)-h,w=c(m);if(Math.abs(v-h)<sf||w<sf)return a(m);m=u(m-v/w)}return a(m)};return d.isStepper=!1,d},Nk=function(){return cU(...lU(...arguments))},uU=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(c,u,d)=>{var p=-(c-u)*n,h=d*r,m=d+(p-h)*i/1e3,g=d*i/1e3+c;return Math.abs(g-u)<sf&&Math.abs(m)<sf?[u,0]:[g,m]};return a.isStepper=!0,a.dt=i,a},dU=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Nk(e);case"spring":return uU();default:if(e.split("(")[0]==="cubic-bezier")return Nk(e)}return typeof e=="function"?e:null};function fU(e){var t,n=()=>null,r=!1,i=null,a=c=>{if(!r){if(Array.isArray(c)){if(!c.length)return;var u=c,[d,...p]=u;if(typeof d=="number"){i=e.setTimeout(a.bind(null,p),d);return}a(d),i=e.setTimeout(a.bind(null,p));return}typeof c=="string"&&(t=c,n(t)),typeof c=="object"&&(t=c,n(t)),typeof c=="function"&&c()}};return{stop:()=>{r=!0},start:c=>{r=!1,i&&(i(),i=null),a(c)},subscribe:c=>(n=c,()=>{n=()=>null}),getTimeoutController:()=>e}}class pU{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=c=>{c-r>=n?t(c):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function hU(){return fU(new pU)}var mU=b.createContext(hU);function gU(e,t){var n=b.useContext(mU);return b.useMemo(()=>t??n(e),[e,t,n])}var xU=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),op={isSsr:xU()},vU={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},kk={t:0},B0={t:1};function Hv(e){var t=dr(e,vU),{isActive:n,canBegin:r,duration:i,easing:a,begin:c,onAnimationEnd:u,onAnimationStart:d,children:p}=t,h=n==="auto"?!op.isSsr:n,m=gU(t.animationId,t.animationManager),[g,v]=b.useState(h?kk:B0),w=b.useRef(null);return b.useEffect(()=>{h||v(B0)},[h]),b.useEffect(()=>{if(!h||!r)return Ao;var S=sU(kk,B0,dU(a),i,v,m.getTimeoutController()),j=()=>{w.current=S()};return m.start([d,c,j,i,u]),()=>{m.stop(),w.current&&w.current(),u()}},[h,r,i,a,c,d,u,m]),p(g.t)}function Gv(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=b.useRef(ec(t)),r=b.useRef(e);return r.current!==e&&(n.current=ec(t),r.current=e),n.current}var yU=["radius"],bU=["radius"],Pk,Ck,Ok,Ak,Ek,Tk,Mk,_k,Ik,Dk;function Rk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Lk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Rk(Object(n),!0).forEach(function(r){wU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wU(e,t,n){return(t=jU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jU(e){var t=SU(e,"string");return typeof t=="symbol"?t:t+""}function SU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function af(){return af=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},af.apply(null,arguments)}function $k(e,t){if(e==null)return{};var n,r,i=NU(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function NU(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function zr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var zk=(e,t,n,r,i)=>{var a=ls(n),c=ls(r),u=Math.min(Math.abs(a)/2,Math.abs(c)/2),d=c>=0?1:-1,p=a>=0?1:-1,h=c>=0&&a>=0||c<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var g=[0,0,0,0],v=0,w=4;v<w;v++){var S,j=(S=i[v])!==null&&S!==void 0?S:0;g[v]=j>u?u:j}m=vt(Pk||(Pk=zr(["M",",",""])),e,t+d*g[0]),g[0]>0&&(m+=vt(Ck||(Ck=zr(["A ",",",",0,0,",",",",",""])),g[0],g[0],h,e+p*g[0],t)),m+=vt(Ok||(Ok=zr(["L ",",",""])),e+n-p*g[1],t),g[1]>0&&(m+=vt(Ak||(Ak=zr(["A ",",",",0,0,",`,
|
|
337
|
+
`,",",""])),g[1],g[1],h,e+n,t+d*g[1])),m+=vt(Ek||(Ek=zr(["L ",",",""])),e+n,t+r-d*g[2]),g[2]>0&&(m+=vt(Tk||(Tk=zr(["A ",",",",0,0,",`,
|
|
338
|
+
`,",",""])),g[2],g[2],h,e+n-p*g[2],t+r)),m+=vt(Mk||(Mk=zr(["L ",",",""])),e+p*g[3],t+r),g[3]>0&&(m+=vt(_k||(_k=zr(["A ",",",",0,0,",`,
|
|
339
|
+
`,",",""])),g[3],g[3],h,e,t+r-d*g[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=vt(Ik||(Ik=zr(["M ",",",`
|
|
340
|
+
A `,",",",0,0,",",",",",`
|
|
341
|
+
L `,",",`
|
|
342
|
+
A `,",",",0,0,",",",",",`
|
|
343
|
+
L `,",",`
|
|
344
|
+
A `,",",",0,0,",",",",",`
|
|
345
|
+
L `,",",`
|
|
346
|
+
A `,",",",0,0,",",",","," Z"])),e,t+d*k,k,k,h,e+p*k,t,e+n-p*k,t,k,k,h,e+n,t+d*k,e+n,t+r-d*k,k,k,h,e+n-p*k,t+r,e+p*k,t+r,k,k,h,e,t+r-d*k)}else m=vt(Dk||(Dk=zr(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},Fk={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},XE=e=>{var t=dr(e,Fk),n=b.useRef(null),[r,i]=b.useState(-1);b.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var U=n.current.getTotalLength();U&&i(U)}catch{}},[]);var{x:a,y:c,width:u,height:d,radius:p,className:h}=t,{animationEasing:m,animationDuration:g,animationBegin:v,isAnimationActive:w,isUpdateAnimationActive:S}=t,j=b.useRef(u),k=b.useRef(d),C=b.useRef(a),E=b.useRef(c),A=b.useMemo(()=>({x:a,y:c,width:u,height:d,radius:p}),[a,c,u,d,p]),P=Gv(A,"rectangle-");if(a!==+a||c!==+c||u!==+u||d!==+d||u===0||d===0)return null;var O=rt("recharts-rectangle",h);if(!S){var M=lr(t),{radius:I}=M,z=$k(M,yU);return b.createElement("path",af({},z,{x:ls(a),y:ls(c),width:ls(u),height:ls(d),radius:typeof p=="number"?p:void 0,className:O,d:zk(a,c,u,d,p)}))}var K=j.current,L=k.current,R=C.current,ee=E.current,J="0px ".concat(r===-1?1:r,"px"),ne="".concat(r,"px 0px"),re=KE(["strokeDasharray"],g,typeof m=="string"?m:Fk.animationEasing);return b.createElement(Hv,{animationId:P,key:P,canBegin:r>0,duration:g,easing:m,isActive:S,begin:v},U=>{var B=Jt(K,u,U),G=Jt(L,d,U),q=Jt(R,a,U),_=Jt(ee,c,U);n.current&&(j.current=B,k.current=G,C.current=q,E.current=_);var V;w?U>0?V={transition:re,strokeDasharray:ne}:V={strokeDasharray:J}:V={strokeDasharray:ne};var ie=lr(t),{radius:ue}=ie,te=$k(ie,bU);return b.createElement("path",af({},te,{radius:typeof p=="number"?p:void 0,className:O,d:zk(q,_,B,G,p),ref:n,style:Lk(Lk({},V),t.style)}))})};function Bk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bk(Object(n),!0).forEach(function(r){kU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kU(e,t,n){return(t=PU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PU(e){var t=CU(e,"string");return typeof t=="symbol"?t:t+""}function CU(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var of=Math.PI/180,OU=e=>e*180/Math.PI,Zt=(e,t,n,r)=>({x:e+Math.cos(-of*r)*n,y:t+Math.sin(-of*r)*n}),AU=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},EU=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},TU=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,c=EU({x:n,y:r},{x:i,y:a});if(c<=0)return{radius:c,angle:0};var u=(n-i)/c,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:c,angle:OU(d),angleInRadian:d}},MU=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},_U=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),c=Math.min(i,a);return e+c*360},IU=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:i,angle:a}=TU({x:n,y:r},t),{innerRadius:c,outerRadius:u}=t;if(i<c||i>u||i===0)return null;var{startAngle:d,endAngle:p}=MU(t),h=a,m;if(d<=p){for(;h>p;)h-=360;for(;h<d;)h+=360;m=h>=d&&h<=p}else{for(;h>d;)h-=360;for(;h<p;)h+=360;m=h>=p&&h<=d}return m?Vk(Vk({},t),{},{radius:i,angle:_U(h,t)}):null};function QE(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,c=Zt(t,n,r,i),u=Zt(t,n,r,a);return{points:[c,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var Uk,Wk,qk,Kk,Hk,Gk,Yk;function hx(){return hx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hx.apply(null,arguments)}function Gs(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var DU=(e,t)=>{var n=$n(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},od=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:c,cornerRadius:u,cornerIsExternal:d}=e,p=u*(c?1:-1)+r,h=Math.asin(u/p)/of,m=d?i:i+a*h,g=Zt(t,n,p,m),v=Zt(t,n,r,m),w=d?i-a*h:i,S=Zt(t,n,p*Math.cos(h*of),w);return{center:g,circleTangency:v,lineTangency:S,theta:h}},JE=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:c}=e,u=DU(a,c),d=a+u,p=Zt(t,n,i,a),h=Zt(t,n,i,d),m=vt(Uk||(Uk=Gs(["M ",",",`
|
|
347
|
+
A `,",",`,0,
|
|
348
|
+
`,",",`,
|
|
349
|
+
`,",",`
|
|
350
|
+
`])),p.x,p.y,i,i,+(Math.abs(u)>180),+(a>d),h.x,h.y);if(r>0){var g=Zt(t,n,r,a),v=Zt(t,n,r,d);m+=vt(Wk||(Wk=Gs(["L ",",",`
|
|
351
|
+
A `,",",`,0,
|
|
352
|
+
`,",",`,
|
|
353
|
+
`,","," Z"])),v.x,v.y,r,r,+(Math.abs(u)>180),+(a<=d),g.x,g.y)}else m+=vt(qk||(qk=Gs(["L ",","," Z"])),t,n);return m},RU=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:p}=e,h=$n(p-d),{circleTangency:m,lineTangency:g,theta:v}=od({cx:t,cy:n,radius:i,angle:d,sign:h,cornerRadius:a,cornerIsExternal:u}),{circleTangency:w,lineTangency:S,theta:j}=od({cx:t,cy:n,radius:i,angle:p,sign:-h,cornerRadius:a,cornerIsExternal:u}),k=u?Math.abs(d-p):Math.abs(d-p)-v-j;if(k<0)return c?vt(Kk||(Kk=Gs(["M ",",",`
|
|
354
|
+
a`,",",",0,0,1,",`,0
|
|
355
|
+
a`,",",",0,0,1,",`,0
|
|
356
|
+
`])),g.x,g.y,a,a,a*2,a,a,-a*2):JE({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:p});var C=vt(Hk||(Hk=Gs(["M ",",",`
|
|
357
|
+
A`,",",",0,0,",",",",",`
|
|
358
|
+
A`,",",",0,",",",",",",",`
|
|
359
|
+
A`,",",",0,0,",",",",",`
|
|
360
|
+
`])),g.x,g.y,a,a,+(h<0),m.x,m.y,i,i,+(k>180),+(h<0),w.x,w.y,a,a,+(h<0),S.x,S.y);if(r>0){var{circleTangency:E,lineTangency:A,theta:P}=od({cx:t,cy:n,radius:r,angle:d,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:O,lineTangency:M,theta:I}=od({cx:t,cy:n,radius:r,angle:p,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),z=u?Math.abs(d-p):Math.abs(d-p)-P-I;if(z<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=vt(Gk||(Gk=Gs(["L",",",`
|
|
361
|
+
A`,",",",0,0,",",",",",`
|
|
362
|
+
A`,",",",0,",",",",",",",`
|
|
363
|
+
A`,",",",0,0,",",",",","Z"])),M.x,M.y,a,a,+(h<0),O.x,O.y,r,r,+(z>180),+(h>0),E.x,E.y,a,a,+(h<0),A.x,A.y)}else C+=vt(Yk||(Yk=Gs(["L",",","Z"])),t,n);return C},LU={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},ZE=e=>{var t=dr(e,LU),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:c,forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:h,className:m}=t;if(a<i||p===h)return null;var g=rt("recharts-sector",m),v=a-i,w=Er(c,v,0,!0),S;return w>0&&Math.abs(p-h)<360?S=RU({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,v/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:h}):S=JE({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:p,endAngle:h}),b.createElement("path",hx({},lr(t),{className:g,d:S}))};function $U(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(BA(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:c,angle:u}=t,d=Zt(r,i,a,u),p=Zt(r,i,c,u);return[{x:d.x,y:d.y},{x:p.x,y:p.y}]}return QE(t)}}var V0={},U0={},W0={},Xk;function zU(){return Xk||(Xk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QA();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(W0)),W0}var Qk;function FU(){return Qk||(Qk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zU();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(U0)),U0}var Jk;function BU(){return Jk||(Jk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JA(),n=FU();function r(i,a,c){c&&typeof c!="number"&&t.isIterateeCall(i,a,c)&&(a=c=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),c=c===void 0?i<a?1:-1:n.toFinite(c);const u=Math.max(Math.ceil((a-i)/(c||1)),0),d=new Array(u);for(let p=0;p<u;p++)d[p]=i,i+=c;return d}e.range=r})(V0)),V0}var q0,Zk;function VU(){return Zk||(Zk=1,q0=BU().range),q0}var UU=VU();const eT=Jr(UU);function cs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function WU(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Yv(e){let t,n,r;e.length!==2?(t=cs,n=(u,d)=>cs(e(u),d),r=(u,d)=>e(u)-d):(t=e===cs||e===WU?e:qU,n=e,r=e);function i(u,d,p=0,h=u.length){if(p<h){if(t(d,d)!==0)return h;do{const m=p+h>>>1;n(u[m],d)<0?p=m+1:h=m}while(p<h)}return p}function a(u,d,p=0,h=u.length){if(p<h){if(t(d,d)!==0)return h;do{const m=p+h>>>1;n(u[m],d)<=0?p=m+1:h=m}while(p<h)}return p}function c(u,d,p=0,h=u.length){const m=i(u,d,p,h-1);return m>p&&r(u[m-1],d)>-r(u[m],d)?m-1:m}return{left:i,center:c,right:a}}function qU(){return 0}function tT(e){return e===null?NaN:+e}function*KU(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const HU=Yv(cs),Cc=HU.right;Yv(tT).center;class eP extends Map{constructor(t,n=XU){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(tP(this,t))}has(t){return super.has(tP(this,t))}set(t,n){return super.set(GU(this,t),n)}delete(t){return super.delete(YU(this,t))}}function tP({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function GU({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function YU({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function XU(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QU(e=cs){if(e===cs)return nT;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function nT(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const JU=Math.sqrt(50),ZU=Math.sqrt(10),eW=Math.sqrt(2);function lf(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),c=a>=JU?10:a>=ZU?5:a>=eW?2:1;let u,d,p;return i<0?(p=Math.pow(10,-i)/c,u=Math.round(e*p),d=Math.round(t*p),u/p<e&&++u,d/p>t&&--d,p=-p):(p=Math.pow(10,i)*c,u=Math.round(e/p),d=Math.round(t/p),u*p<e&&++u,d*p>t&&--d),d<u&&.5<=n&&n<2?lf(e,t,n*2):[u,d,p]}function mx(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,c]=r?lf(t,e,n):lf(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(c<0)for(let p=0;p<u;++p)d[p]=(a-p)/-c;else for(let p=0;p<u;++p)d[p]=(a-p)*c;else if(c<0)for(let p=0;p<u;++p)d[p]=(i+p)/-c;else for(let p=0;p<u;++p)d[p]=(i+p)*c;return d}function gx(e,t,n){return t=+t,e=+e,n=+n,lf(e,t,n)[2]}function xx(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?gx(t,e,n):gx(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function nP(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function rP(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function rT(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?nT:QU(i);r>n;){if(r-n>600){const d=r-n+1,p=t-n+1,h=Math.log(d),m=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*m*(d-m)/d)*(p-d/2<0?-1:1),v=Math.max(n,Math.floor(t-p*m/d+g)),w=Math.min(r,Math.floor(t+(d-p)*m/d+g));rT(e,t,v,w,i)}const a=e[t];let c=n,u=r;for(Ol(e,n,t),i(e[r],a)>0&&Ol(e,n,r);c<u;){for(Ol(e,c,u),++c,--u;i(e[c],a)<0;)++c;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?Ol(e,n,u):(++u,Ol(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Ol(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function tW(e,t,n){if(e=Float64Array.from(KU(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return rP(e);if(t>=1)return nP(e);var r,i=(r-1)*t,a=Math.floor(i),c=nP(rT(e,a).subarray(0,a+1)),u=rP(e.subarray(a+1));return c+(u-c)*(i-a)}}function nW(e,t,n=tT){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),c=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return c+(u-c)*(i-a)}}function rW(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=new Array(i);++r<i;)a[r]=e+r*n;return a}function fr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Oi(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const vx=Symbol("implicit");function Xv(){var e=new eP,t=[],n=[],r=vx;function i(a){let c=e.get(a);if(c===void 0){if(r!==vx)return r;e.set(a,c=t.push(a)-1)}return n[c%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new eP;for(const c of a)e.has(c)||e.set(c,t.push(c)-1);return i},i.range=function(a){return arguments.length?(n=Array.from(a),i):n.slice()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return Xv(t,n).unknown(r)},fr.apply(i,arguments),i}function Qv(){var e=Xv().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,c,u=!1,d=0,p=0,h=.5;delete e.unknown;function m(){var g=t().length,v=i<r,w=v?i:r,S=v?r:i;a=(S-w)/Math.max(1,g-d+p*2),u&&(a=Math.floor(a)),w+=(S-w-a*(g-d))*h,c=a*(1-d),u&&(w=Math.round(w),c=Math.round(c));var j=rW(g).map(function(k){return w+a*k});return n(v?j.reverse():j)}return e.domain=function(g){return arguments.length?(t(g),m()):t()},e.range=function(g){return arguments.length?([r,i]=g,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(g){return[r,i]=g,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return c},e.step=function(){return a},e.round=function(g){return arguments.length?(u=!!g,m()):u},e.padding=function(g){return arguments.length?(d=Math.min(1,p=+g),m()):d},e.paddingInner=function(g){return arguments.length?(d=Math.min(1,g),m()):d},e.paddingOuter=function(g){return arguments.length?(p=+g,m()):p},e.align=function(g){return arguments.length?(h=Math.max(0,Math.min(1,g)),m()):h},e.copy=function(){return Qv(t(),[r,i]).round(u).paddingInner(d).paddingOuter(p).align(h)},fr.apply(m(),arguments)}function iT(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return iT(t())},e}function iW(){return iT(Qv.apply(null,arguments).paddingInner(1))}function Jv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function sT(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Oc(){}var lc=.7,cf=1/lc,oo="\\s*([+-]?\\d+)\\s*",cc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sW=/^#([0-9a-f]{3,8})$/,aW=new RegExp(`^rgb\\(${oo},${oo},${oo}\\)$`),oW=new RegExp(`^rgb\\(${Gr},${Gr},${Gr}\\)$`),lW=new RegExp(`^rgba\\(${oo},${oo},${oo},${cc}\\)$`),cW=new RegExp(`^rgba\\(${Gr},${Gr},${Gr},${cc}\\)$`),uW=new RegExp(`^hsl\\(${cc},${Gr},${Gr}\\)$`),dW=new RegExp(`^hsla\\(${cc},${Gr},${Gr},${cc}\\)$`),iP={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Jv(Oc,uc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sP,formatHex:sP,formatHex8:fW,formatHsl:pW,formatRgb:aP,toString:aP});function sP(){return this.rgb().formatHex()}function fW(){return this.rgb().formatHex8()}function pW(){return aT(this).formatHsl()}function aP(){return this.rgb().formatRgb()}function uc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sW.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?oP(t):n===3?new Pn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ld(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ld(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=aW.exec(e))?new Pn(t[1],t[2],t[3],1):(t=oW.exec(e))?new Pn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lW.exec(e))?ld(t[1],t[2],t[3],t[4]):(t=cW.exec(e))?ld(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=uW.exec(e))?uP(t[1],t[2]/100,t[3]/100,1):(t=dW.exec(e))?uP(t[1],t[2]/100,t[3]/100,t[4]):iP.hasOwnProperty(e)?oP(iP[e]):e==="transparent"?new Pn(NaN,NaN,NaN,0):null}function oP(e){return new Pn(e>>16&255,e>>8&255,e&255,1)}function ld(e,t,n,r){return r<=0&&(e=t=n=NaN),new Pn(e,t,n,r)}function hW(e){return e instanceof Oc||(e=uc(e)),e?(e=e.rgb(),new Pn(e.r,e.g,e.b,e.opacity)):new Pn}function yx(e,t,n,r){return arguments.length===1?hW(e):new Pn(e,t,n,r??1)}function Pn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Jv(Pn,yx,sT(Oc,{brighter(e){return e=e==null?cf:Math.pow(cf,e),new Pn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?lc:Math.pow(lc,e),new Pn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pn(Zs(this.r),Zs(this.g),Zs(this.b),uf(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:lP,formatHex:lP,formatHex8:mW,formatRgb:cP,toString:cP}));function lP(){return`#${Ys(this.r)}${Ys(this.g)}${Ys(this.b)}`}function mW(){return`#${Ys(this.r)}${Ys(this.g)}${Ys(this.b)}${Ys((isNaN(this.opacity)?1:this.opacity)*255)}`}function cP(){const e=uf(this.opacity);return`${e===1?"rgb(":"rgba("}${Zs(this.r)}, ${Zs(this.g)}, ${Zs(this.b)}${e===1?")":`, ${e})`}`}function uf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Zs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ys(e){return e=Zs(e),(e<16?"0":"")+e.toString(16)}function uP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Or(e,t,n,r)}function aT(e){if(e instanceof Or)return new Or(e.h,e.s,e.l,e.opacity);if(e instanceof Oc||(e=uc(e)),!e)return new Or;if(e instanceof Or)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),c=NaN,u=a-i,d=(a+i)/2;return u?(t===a?c=(n-r)/u+(n<r)*6:n===a?c=(r-t)/u+2:c=(t-n)/u+4,u/=d<.5?a+i:2-a-i,c*=60):u=d>0&&d<1?0:c,new Or(c,u,d,e.opacity)}function gW(e,t,n,r){return arguments.length===1?aT(e):new Or(e,t,n,r??1)}function Or(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Jv(Or,gW,sT(Oc,{brighter(e){return e=e==null?cf:Math.pow(cf,e),new Or(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?lc:Math.pow(lc,e),new Or(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Pn(K0(e>=240?e-240:e+120,i,r),K0(e,i,r),K0(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Or(dP(this.h),cd(this.s),cd(this.l),uf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=uf(this.opacity);return`${e===1?"hsl(":"hsla("}${dP(this.h)}, ${cd(this.s)*100}%, ${cd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dP(e){return e=(e||0)%360,e<0?e+360:e}function cd(e){return Math.max(0,Math.min(1,e||0))}function K0(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Zv=e=>()=>e;function xW(e,t){return function(n){return e+n*t}}function vW(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function yW(e){return(e=+e)==1?oT:function(t,n){return n-t?vW(t,n,e):Zv(isNaN(t)?n:t)}}function oT(e,t){var n=t-e;return n?xW(e,n):Zv(isNaN(e)?t:e)}const fP=(function e(t){var n=yW(t);function r(i,a){var c=n((i=yx(i)).r,(a=yx(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),p=oT(i.opacity,a.opacity);return function(h){return i.r=c(h),i.g=u(h),i.b=d(h),i.opacity=p(h),i+""}}return r.gamma=e,r})(1);function bW(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function wW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function jW(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),c;for(c=0;c<r;++c)i[c]=To(e[c],t[c]);for(;c<n;++c)a[c]=t[c];return function(u){for(c=0;c<r;++c)a[c]=i[c](u);return a}}function SW(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function df(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function NW(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=To(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var bx=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,H0=new RegExp(bx.source,"g");function kW(e){return function(){return e}}function PW(e){return function(t){return e(t)+""}}function CW(e,t){var n=bx.lastIndex=H0.lastIndex=0,r,i,a,c=-1,u=[],d=[];for(e=e+"",t=t+"";(r=bx.exec(e))&&(i=H0.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[c]?u[c]+=a:u[++c]=a),(r=r[0])===(i=i[0])?u[c]?u[c]+=i:u[++c]=i:(u[++c]=null,d.push({i:c,x:df(r,i)})),n=H0.lastIndex;return n<t.length&&(a=t.slice(n),u[c]?u[c]+=a:u[++c]=a),u.length<2?d[0]?PW(d[0].x):kW(t):(t=d.length,function(p){for(var h=0,m;h<t;++h)u[(m=d[h]).i]=m.x(p);return u.join("")})}function To(e,t){var n=typeof t,r;return t==null||n==="boolean"?Zv(t):(n==="number"?df:n==="string"?(r=uc(t))?(t=r,fP):CW:t instanceof uc?fP:t instanceof Date?SW:wW(t)?bW:Array.isArray(t)?jW:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?NW:df)(e,t)}function ey(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function OW(e,t){t===void 0&&(t=e,e=To);for(var n=0,r=t.length-1,i=t[0],a=new Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(c){var u=Math.max(0,Math.min(r-1,Math.floor(c*=r)));return a[u](c-u)}}function AW(e){return function(){return e}}function ff(e){return+e}var pP=[0,1];function hn(e){return e}function wx(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:AW(isNaN(t)?NaN:.5)}function EW(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function TW(e,t,n){var r=e[0],i=e[1],a=t[0],c=t[1];return i<r?(r=wx(i,r),a=n(c,a)):(r=wx(r,i),a=n(a,c)),function(u){return a(r(u))}}function MW(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),c=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++c<r;)i[c]=wx(e[c],e[c+1]),a[c]=n(t[c],t[c+1]);return function(u){var d=Cc(e,u,1,r)-1;return a[d](i[d](u))}}function Ac(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function lp(){var e=pP,t=pP,n=To,r,i,a,c=hn,u,d,p;function h(){var g=Math.min(e.length,t.length);return c!==hn&&(c=EW(e[0],e[g-1])),u=g>2?MW:TW,d=p=null,m}function m(g){return g==null||isNaN(g=+g)?a:(d||(d=u(e.map(r),t,n)))(r(c(g)))}return m.invert=function(g){return c(i((p||(p=u(t,e.map(r),df)))(g)))},m.domain=function(g){return arguments.length?(e=Array.from(g,ff),h()):e.slice()},m.range=function(g){return arguments.length?(t=Array.from(g),h()):t.slice()},m.rangeRound=function(g){return t=Array.from(g),n=ey,h()},m.clamp=function(g){return arguments.length?(c=g?!0:hn,h()):c!==hn},m.interpolate=function(g){return arguments.length?(n=g,h()):n},m.unknown=function(g){return arguments.length?(a=g,m):a},function(g,v){return r=g,i=v,h()}}function ty(){return lp()(hn,hn)}function _W(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function pf(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function vo(e){return e=pf(Math.abs(e)),e?e[1]:NaN}function IW(e,t){return function(n,r){for(var i=n.length,a=[],c=0,u=e[0],d=0;i>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),a.push(n.substring(i-=u,i+u)),!((d+=u+1)>r));)u=e[c=(c+1)%e.length];return a.reverse().join(t)}}function DW(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var RW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function dc(e){if(!(t=RW.exec(e)))throw new Error("invalid format: "+e);var t;return new ny({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}dc.prototype=ny.prototype;function ny(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}ny.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function LW(e){e:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case".":r=i=n;break;case"0":r===0&&(r=n),i=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var hf;function $W(e,t){var n=pf(e,t);if(!n)return hf=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(hf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,c=r.length;return a===c?r:a>c?r+new Array(a-c+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+pf(e,Math.max(0,t+a-1))[0]}function hP(e,t){var n=pf(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}const mP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:_W,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>hP(e*100,t),r:hP,s:$W,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function gP(e){return e}var xP=Array.prototype.map,vP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function zW(e){var t=e.grouping===void 0||e.thousands===void 0?gP:IW(xP.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?gP:DW(xP.call(e.numerals,String)),c=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function p(m,g){m=dc(m);var v=m.fill,w=m.align,S=m.sign,j=m.symbol,k=m.zero,C=m.width,E=m.comma,A=m.precision,P=m.trim,O=m.type;O==="n"?(E=!0,O="g"):mP[O]||(A===void 0&&(A=12),P=!0,O="g"),(k||v==="0"&&w==="=")&&(k=!0,v="0",w="=");var M=(g&&g.prefix!==void 0?g.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),I=(j==="$"?r:/[%p]/.test(O)?c:"")+(g&&g.suffix!==void 0?g.suffix:""),z=mP[O],K=/[defgprs%]/.test(O);A=A===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function L(R){var ee=M,J=I,ne,re,U;if(O==="c")J=z(R)+J,R="";else{R=+R;var B=R<0||1/R<0;if(R=isNaN(R)?d:z(Math.abs(R),A),P&&(R=LW(R)),B&&+R==0&&S!=="+"&&(B=!1),ee=(B?S==="("?S:u:S==="-"||S==="("?"":S)+ee,J=(O==="s"&&!isNaN(R)&&hf!==void 0?vP[8+hf/3]:"")+J+(B&&S==="("?")":""),K){for(ne=-1,re=R.length;++ne<re;)if(U=R.charCodeAt(ne),48>U||U>57){J=(U===46?i+R.slice(ne+1):R.slice(ne))+J,R=R.slice(0,ne);break}}}E&&!k&&(R=t(R,1/0));var G=ee.length+R.length+J.length,q=G<C?new Array(C-G+1).join(v):"";switch(E&&k&&(R=t(q+R,q.length?C-J.length:1/0),q=""),w){case"<":R=ee+R+J+q;break;case"=":R=ee+q+R+J;break;case"^":R=q.slice(0,G=q.length>>1)+ee+R+J+q.slice(G);break;default:R=q+ee+R+J;break}return a(R)}return L.toString=function(){return m+""},L}function h(m,g){var v=Math.max(-8,Math.min(8,Math.floor(vo(g)/3)))*3,w=Math.pow(10,-v),S=p((m=dc(m),m.type="f",m),{suffix:vP[8+v/3]});return function(j){return S(w*j)}}return{format:p,formatPrefix:h}}var ud,ry,lT;FW({thousands:",",grouping:[3],currency:["$",""]});function FW(e){return ud=zW(e),ry=ud.format,lT=ud.formatPrefix,ud}function BW(e){return Math.max(0,-vo(Math.abs(e)))}function VW(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(vo(t)/3)))*3-vo(Math.abs(e)))}function UW(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,vo(t)-vo(e))+1}function cT(e,t,n,r){var i=xx(e,t,n),a;switch(r=dc(r??",f"),r.type){case"s":{var c=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=VW(i,c))&&(r.precision=a),lT(r,c)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=UW(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=BW(i))&&(r.precision=a-(r.type==="%")*2);break}}return ry(r)}function ys(e){var t=e.domain;return e.ticks=function(n){var r=t();return mx(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return cT(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,c=r[i],u=r[a],d,p,h=10;for(u<c&&(p=c,c=u,u=p,p=i,i=a,a=p);h-- >0;){if(p=gx(c,u,n),p===d)return r[i]=c,r[a]=u,t(r);if(p>0)c=Math.floor(c/p)*p,u=Math.ceil(u/p)*p;else if(p<0)c=Math.ceil(c*p)/p,u=Math.floor(u*p)/p;else break;d=p}return e},e}function uT(){var e=ty();return e.copy=function(){return Ac(e,uT())},fr.apply(e,arguments),ys(e)}function dT(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,ff),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return dT(e).unknown(t)},e=arguments.length?Array.from(e,ff):[0,1],ys(n)}function fT(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],c;return a<i&&(c=n,n=r,r=c,c=i,i=a,a=c),e[n]=t.floor(i),e[r]=t.ceil(a),e}function yP(e){return Math.log(e)}function bP(e){return Math.exp(e)}function WW(e){return-Math.log(-e)}function qW(e){return-Math.exp(-e)}function KW(e){return isFinite(e)?+("1e"+e):e<0?0:e}function HW(e){return e===10?KW:e===Math.E?Math.exp:t=>Math.pow(e,t)}function GW(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function wP(e){return(t,n)=>-e(-t,n)}function iy(e){const t=e(yP,bP),n=t.domain;let r=10,i,a;function c(){return i=GW(r),a=HW(r),n()[0]<0?(i=wP(i),a=wP(a),e(WW,qW)):e(yP,bP),t}return t.base=function(u){return arguments.length?(r=+u,c()):r},t.domain=function(u){return arguments.length?(n(u),c()):n()},t.ticks=u=>{const d=n();let p=d[0],h=d[d.length-1];const m=h<p;m&&([p,h]=[h,p]);let g=i(p),v=i(h),w,S;const j=u==null?10:+u;let k=[];if(!(r%1)&&v-g<j){if(g=Math.floor(g),v=Math.ceil(v),p>0){for(;g<=v;++g)for(w=1;w<r;++w)if(S=g<0?w/a(-g):w*a(g),!(S<p)){if(S>h)break;k.push(S)}}else for(;g<=v;++g)for(w=r-1;w>=1;--w)if(S=g>0?w/a(-g):w*a(g),!(S<p)){if(S>h)break;k.push(S)}k.length*2<j&&(k=mx(p,h,j))}else k=mx(g,v,Math.min(v-g,j)).map(a);return m?k.reverse():k},t.tickFormat=(u,d)=>{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=dc(d)).precision==null&&(d.trim=!0),d=ry(d)),u===1/0)return d;const p=Math.max(1,r*u/t.ticks().length);return h=>{let m=h/a(Math.round(i(h)));return m*r<r-.5&&(m*=r),m<=p?d(h):""}},t.nice=()=>n(fT(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function pT(){const e=iy(lp()).domain([1,10]);return e.copy=()=>Ac(e,pT()).base(e.base()),fr.apply(e,arguments),e}function jP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function SP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function sy(e){var t=1,n=e(jP(t),SP(t));return n.constant=function(r){return arguments.length?e(jP(t=+r),SP(t)):t},ys(n)}function hT(){var e=sy(lp());return e.copy=function(){return Ac(e,hT()).constant(e.constant())},fr.apply(e,arguments)}function NP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function YW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function XW(e){return e<0?-e*e:e*e}function ay(e){var t=e(hn,hn),n=1;function r(){return n===1?e(hn,hn):n===.5?e(YW,XW):e(NP(n),NP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ys(t)}function oy(){var e=ay(lp());return e.copy=function(){return Ac(e,oy()).exponent(e.exponent())},fr.apply(e,arguments),e}function QW(){return oy.apply(null,arguments).exponent(.5)}function kP(e){return Math.sign(e)*e*e}function JW(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function mT(){var e=ty(),t=[0,1],n=!1,r;function i(a){var c=JW(e(a));return isNaN(c)?r:n?Math.round(c):c}return i.invert=function(a){return e.invert(kP(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,ff)).map(kP)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return mT(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},fr.apply(i,arguments),ys(i)}function gT(){var e=[],t=[],n=[],r;function i(){var c=0,u=Math.max(1,t.length);for(n=new Array(u-1);++c<u;)n[c-1]=nW(e,c/u);return a}function a(c){return c==null||isNaN(c=+c)?r:t[Cc(n,c)]}return a.invertExtent=function(c){var u=t.indexOf(c);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(c){if(!arguments.length)return e.slice();e=[];for(let u of c)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(cs),i()},a.range=function(c){return arguments.length?(t=Array.from(c),i()):t.slice()},a.unknown=function(c){return arguments.length?(r=c,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return gT().domain(e).range(t).unknown(r)},fr.apply(a,arguments)}function xT(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function c(d){return d!=null&&d<=d?i[Cc(r,d,0,n)]:a}function u(){var d=-1;for(r=new Array(n);++d<n;)r[d]=((d+1)*t-(d-n)*e)/(n+1);return c}return c.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},c.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},c.invertExtent=function(d){var p=i.indexOf(d);return p<0?[NaN,NaN]:p<1?[e,r[0]]:p>=n?[r[n-1],t]:[r[p-1],r[p]]},c.unknown=function(d){return arguments.length&&(a=d),c},c.thresholds=function(){return r.slice()},c.copy=function(){return xT().domain([e,t]).range(i).unknown(a)},fr.apply(ys(c),arguments)}function vT(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Cc(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var c=t.indexOf(a);return[e[c-1],e[c]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return vT().domain(e).range(t).unknown(n)},fr.apply(i,arguments)}const G0=new Date,Y0=new Date;function Et(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const c=i(a),u=i.ceil(a);return a-c<u-a?c:u},i.offset=(a,c)=>(t(a=new Date(+a),c==null?1:Math.floor(c)),a),i.range=(a,c,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<c)||!(u>0))return d;let p;do d.push(p=new Date(+a)),t(a,u),e(a);while(p<a&&a<c);return d},i.filter=a=>Et(c=>{if(c>=c)for(;e(c),!a(c);)c.setTime(c-1)},(c,u)=>{if(c>=c)if(u<0)for(;++u<=0;)for(;t(c,-1),!a(c););else for(;--u>=0;)for(;t(c,1),!a(c););}),n&&(i.count=(a,c)=>(G0.setTime(+a),Y0.setTime(+c),e(G0),e(Y0),Math.floor(n(G0,Y0))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?c=>r(c)%a===0:c=>i.count(0,c)%a===0):i)),i}const mf=Et(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);mf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Et(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):mf);mf.range;const fi=1e3,sr=fi*60,pi=sr*60,bi=pi*24,ly=bi*7,PP=bi*30,X0=bi*365,Xs=Et(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*fi)},(e,t)=>(t-e)/fi,e=>e.getUTCSeconds());Xs.range;const cy=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fi)},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getMinutes());cy.range;const uy=Et(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getUTCMinutes());uy.range;const dy=Et(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*fi-e.getMinutes()*sr)},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getHours());dy.range;const fy=Et(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getUTCHours());fy.range;const Ec=Et(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*sr)/bi,e=>e.getDate()-1);Ec.range;const cp=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bi,e=>e.getUTCDate()-1);cp.range;const yT=Et(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/bi,e=>Math.floor(e/bi));yT.range;function fa(e){return Et(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*sr)/ly)}const up=fa(0),gf=fa(1),ZW=fa(2),eq=fa(3),yo=fa(4),tq=fa(5),nq=fa(6);up.range;gf.range;ZW.range;eq.range;yo.range;tq.range;nq.range;function pa(e){return Et(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/ly)}const dp=pa(0),xf=pa(1),rq=pa(2),iq=pa(3),bo=pa(4),sq=pa(5),aq=pa(6);dp.range;xf.range;rq.range;iq.range;bo.range;sq.range;aq.range;const py=Et(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());py.range;const hy=Et(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());hy.range;const wi=Et(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());wi.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});wi.range;const ji=Et(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Et(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});ji.range;function bT(e,t,n,r,i,a){const c=[[Xs,1,fi],[Xs,5,5*fi],[Xs,15,15*fi],[Xs,30,30*fi],[a,1,sr],[a,5,5*sr],[a,15,15*sr],[a,30,30*sr],[i,1,pi],[i,3,3*pi],[i,6,6*pi],[i,12,12*pi],[r,1,bi],[r,2,2*bi],[n,1,ly],[t,1,PP],[t,3,3*PP],[e,1,X0]];function u(p,h,m){const g=h<p;g&&([p,h]=[h,p]);const v=m&&typeof m.range=="function"?m:d(p,h,m),w=v?v.range(p,+h+1):[];return g?w.reverse():w}function d(p,h,m){const g=Math.abs(h-p)/m,v=Yv(([,,j])=>j).right(c,g);if(v===c.length)return e.every(xx(p/X0,h/X0,m));if(v===0)return mf.every(Math.max(xx(p,h,m),1));const[w,S]=c[g/c[v-1][2]<c[v][2]/g?v-1:v];return w.every(S)}return[u,d]}const[oq,lq]=bT(ji,hy,dp,yT,fy,uy),[cq,uq]=bT(wi,py,up,Ec,dy,cy);function Q0(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function J0(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Al(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function dq(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,c=e.shortDays,u=e.months,d=e.shortMonths,p=El(i),h=Tl(i),m=El(a),g=Tl(a),v=El(c),w=Tl(c),S=El(u),j=Tl(u),k=El(d),C=Tl(d),E={a:U,A:B,b:G,B:q,c:null,d:MP,e:MP,f:Iq,g:Wq,G:Kq,H:Tq,I:Mq,j:_q,L:wT,m:Dq,M:Rq,p:_,q:V,Q:DP,s:RP,S:Lq,u:$q,U:zq,V:Fq,w:Bq,W:Vq,x:null,X:null,y:Uq,Y:qq,Z:Hq,"%":IP},A={a:ie,A:ue,b:te,B:se,c:null,d:_P,e:_P,f:Qq,g:oK,G:cK,H:Gq,I:Yq,j:Xq,L:ST,m:Jq,M:Zq,p:pe,q:Ne,Q:DP,s:RP,S:eK,u:tK,U:nK,V:rK,w:iK,W:sK,x:null,X:null,y:aK,Y:lK,Z:uK,"%":IP},P={a:K,A:L,b:R,B:ee,c:J,d:EP,e:EP,f:Cq,g:AP,G:OP,H:TP,I:TP,j:Sq,L:Pq,m:jq,M:Nq,p:z,q:wq,Q:Aq,s:Eq,S:kq,u:gq,U:xq,V:vq,w:mq,W:yq,x:ne,X:re,y:AP,Y:OP,Z:bq,"%":Oq};E.x=O(n,E),E.X=O(r,E),E.c=O(t,E),A.x=O(n,A),A.X=O(r,A),A.c=O(t,A);function O(Y,me){return function(Ae){var ae=[],$e=-1,Re=0,Ye=Y.length,Qe,Mt,En;for(Ae instanceof Date||(Ae=new Date(+Ae));++$e<Ye;)Y.charCodeAt($e)===37&&(ae.push(Y.slice(Re,$e)),(Mt=CP[Qe=Y.charAt(++$e)])!=null?Qe=Y.charAt(++$e):Mt=Qe==="e"?" ":"0",(En=me[Qe])&&(Qe=En(Ae,Mt)),ae.push(Qe),Re=$e+1);return ae.push(Y.slice(Re,$e)),ae.join("")}}function M(Y,me){return function(Ae){var ae=Al(1900,void 0,1),$e=I(ae,Y,Ae+="",0),Re,Ye;if($e!=Ae.length)return null;if("Q"in ae)return new Date(ae.Q);if("s"in ae)return new Date(ae.s*1e3+("L"in ae?ae.L:0));if(me&&!("Z"in ae)&&(ae.Z=0),"p"in ae&&(ae.H=ae.H%12+ae.p*12),ae.m===void 0&&(ae.m="q"in ae?ae.q:0),"V"in ae){if(ae.V<1||ae.V>53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Re=J0(Al(ae.y,0,1)),Ye=Re.getUTCDay(),Re=Ye>4||Ye===0?xf.ceil(Re):xf(Re),Re=cp.offset(Re,(ae.V-1)*7),ae.y=Re.getUTCFullYear(),ae.m=Re.getUTCMonth(),ae.d=Re.getUTCDate()+(ae.w+6)%7):(Re=Q0(Al(ae.y,0,1)),Ye=Re.getDay(),Re=Ye>4||Ye===0?gf.ceil(Re):gf(Re),Re=Ec.offset(Re,(ae.V-1)*7),ae.y=Re.getFullYear(),ae.m=Re.getMonth(),ae.d=Re.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),Ye="Z"in ae?J0(Al(ae.y,0,1)).getUTCDay():Q0(Al(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Ye+5)%7:ae.w+ae.U*7-(Ye+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,J0(ae)):Q0(ae)}}function I(Y,me,Ae,ae){for(var $e=0,Re=me.length,Ye=Ae.length,Qe,Mt;$e<Re;){if(ae>=Ye)return-1;if(Qe=me.charCodeAt($e++),Qe===37){if(Qe=me.charAt($e++),Mt=P[Qe in CP?me.charAt($e++):Qe],!Mt||(ae=Mt(Y,Ae,ae))<0)return-1}else if(Qe!=Ae.charCodeAt(ae++))return-1}return ae}function z(Y,me,Ae){var ae=p.exec(me.slice(Ae));return ae?(Y.p=h.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function K(Y,me,Ae){var ae=v.exec(me.slice(Ae));return ae?(Y.w=w.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function L(Y,me,Ae){var ae=m.exec(me.slice(Ae));return ae?(Y.w=g.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function R(Y,me,Ae){var ae=k.exec(me.slice(Ae));return ae?(Y.m=C.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function ee(Y,me,Ae){var ae=S.exec(me.slice(Ae));return ae?(Y.m=j.get(ae[0].toLowerCase()),Ae+ae[0].length):-1}function J(Y,me,Ae){return I(Y,t,me,Ae)}function ne(Y,me,Ae){return I(Y,n,me,Ae)}function re(Y,me,Ae){return I(Y,r,me,Ae)}function U(Y){return c[Y.getDay()]}function B(Y){return a[Y.getDay()]}function G(Y){return d[Y.getMonth()]}function q(Y){return u[Y.getMonth()]}function _(Y){return i[+(Y.getHours()>=12)]}function V(Y){return 1+~~(Y.getMonth()/3)}function ie(Y){return c[Y.getUTCDay()]}function ue(Y){return a[Y.getUTCDay()]}function te(Y){return d[Y.getUTCMonth()]}function se(Y){return u[Y.getUTCMonth()]}function pe(Y){return i[+(Y.getUTCHours()>=12)]}function Ne(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var me=O(Y+="",E);return me.toString=function(){return Y},me},parse:function(Y){var me=M(Y+="",!1);return me.toString=function(){return Y},me},utcFormat:function(Y){var me=O(Y+="",A);return me.toString=function(){return Y},me},utcParse:function(Y){var me=M(Y+="",!0);return me.toString=function(){return Y},me}}}var CP={"-":"",_:" ",0:"0"},Wt=/^\s*\d+/,fq=/^%/,pq=/[\\^$*+?|[\]().{}]/g;function Ue(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a<n?new Array(n-a+1).join(t)+i:i)}function hq(e){return e.replace(pq,"\\$&")}function El(e){return new RegExp("^(?:"+e.map(hq).join("|")+")","i")}function Tl(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function mq(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function gq(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function xq(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function vq(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function yq(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function OP(e,t,n){var r=Wt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function AP(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bq(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function wq(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function jq(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function EP(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Sq(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function TP(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Nq(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function kq(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Pq(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Cq(e,t,n){var r=Wt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Oq(e,t,n){var r=fq.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Aq(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Eq(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function MP(e,t){return Ue(e.getDate(),t,2)}function Tq(e,t){return Ue(e.getHours(),t,2)}function Mq(e,t){return Ue(e.getHours()%12||12,t,2)}function _q(e,t){return Ue(1+Ec.count(wi(e),e),t,3)}function wT(e,t){return Ue(e.getMilliseconds(),t,3)}function Iq(e,t){return wT(e,t)+"000"}function Dq(e,t){return Ue(e.getMonth()+1,t,2)}function Rq(e,t){return Ue(e.getMinutes(),t,2)}function Lq(e,t){return Ue(e.getSeconds(),t,2)}function $q(e){var t=e.getDay();return t===0?7:t}function zq(e,t){return Ue(up.count(wi(e)-1,e),t,2)}function jT(e){var t=e.getDay();return t>=4||t===0?yo(e):yo.ceil(e)}function Fq(e,t){return e=jT(e),Ue(yo.count(wi(e),e)+(wi(e).getDay()===4),t,2)}function Bq(e){return e.getDay()}function Vq(e,t){return Ue(gf.count(wi(e)-1,e),t,2)}function Uq(e,t){return Ue(e.getFullYear()%100,t,2)}function Wq(e,t){return e=jT(e),Ue(e.getFullYear()%100,t,2)}function qq(e,t){return Ue(e.getFullYear()%1e4,t,4)}function Kq(e,t){var n=e.getDay();return e=n>=4||n===0?yo(e):yo.ceil(e),Ue(e.getFullYear()%1e4,t,4)}function Hq(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ue(t/60|0,"0",2)+Ue(t%60,"0",2)}function _P(e,t){return Ue(e.getUTCDate(),t,2)}function Gq(e,t){return Ue(e.getUTCHours(),t,2)}function Yq(e,t){return Ue(e.getUTCHours()%12||12,t,2)}function Xq(e,t){return Ue(1+cp.count(ji(e),e),t,3)}function ST(e,t){return Ue(e.getUTCMilliseconds(),t,3)}function Qq(e,t){return ST(e,t)+"000"}function Jq(e,t){return Ue(e.getUTCMonth()+1,t,2)}function Zq(e,t){return Ue(e.getUTCMinutes(),t,2)}function eK(e,t){return Ue(e.getUTCSeconds(),t,2)}function tK(e){var t=e.getUTCDay();return t===0?7:t}function nK(e,t){return Ue(dp.count(ji(e)-1,e),t,2)}function NT(e){var t=e.getUTCDay();return t>=4||t===0?bo(e):bo.ceil(e)}function rK(e,t){return e=NT(e),Ue(bo.count(ji(e),e)+(ji(e).getUTCDay()===4),t,2)}function iK(e){return e.getUTCDay()}function sK(e,t){return Ue(xf.count(ji(e)-1,e),t,2)}function aK(e,t){return Ue(e.getUTCFullYear()%100,t,2)}function oK(e,t){return e=NT(e),Ue(e.getUTCFullYear()%100,t,2)}function lK(e,t){return Ue(e.getUTCFullYear()%1e4,t,4)}function cK(e,t){var n=e.getUTCDay();return e=n>=4||n===0?bo(e):bo.ceil(e),Ue(e.getUTCFullYear()%1e4,t,4)}function uK(){return"+0000"}function IP(){return"%"}function DP(e){return+e}function RP(e){return Math.floor(+e/1e3)}var qa,kT,PT;dK({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function dK(e){return qa=dq(e),kT=qa.format,qa.parse,PT=qa.utcFormat,qa.utcParse,qa}function fK(e){return new Date(e)}function pK(e){return e instanceof Date?+e:+new Date(+e)}function my(e,t,n,r,i,a,c,u,d,p){var h=ty(),m=h.invert,g=h.domain,v=p(".%L"),w=p(":%S"),S=p("%I:%M"),j=p("%I %p"),k=p("%a %d"),C=p("%b %d"),E=p("%B"),A=p("%Y");function P(O){return(d(O)<O?v:u(O)<O?w:c(O)<O?S:a(O)<O?j:r(O)<O?i(O)<O?k:C:n(O)<O?E:A)(O)}return h.invert=function(O){return new Date(m(O))},h.domain=function(O){return arguments.length?g(Array.from(O,pK)):g().map(fK)},h.ticks=function(O){var M=g();return e(M[0],M[M.length-1],O??10)},h.tickFormat=function(O,M){return M==null?P:p(M)},h.nice=function(O){var M=g();return(!O||typeof O.range!="function")&&(O=t(M[0],M[M.length-1],O??10)),O?g(fT(M,O)):h},h.copy=function(){return Ac(h,my(e,t,n,r,i,a,c,u,d,p))},h}function hK(){return fr.apply(my(cq,uq,wi,py,up,Ec,dy,cy,Xs,kT).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function mK(){return fr.apply(my(oq,lq,ji,hy,dp,cp,fy,uy,Xs,PT).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function fp(){var e=0,t=1,n,r,i,a,c=hn,u=!1,d;function p(m){return m==null||isNaN(m=+m)?d:c(i===0?.5:(m=(a(m)-n)*i,u?Math.max(0,Math.min(1,m)):m))}p.domain=function(m){return arguments.length?([e,t]=m,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),p):[e,t]},p.clamp=function(m){return arguments.length?(u=!!m,p):u},p.interpolator=function(m){return arguments.length?(c=m,p):c};function h(m){return function(g){var v,w;return arguments.length?([v,w]=g,c=m(v,w),p):[c(0),c(1)]}}return p.range=h(To),p.rangeRound=h(ey),p.unknown=function(m){return arguments.length?(d=m,p):d},function(m){return a=m,n=m(e),r=m(t),i=n===r?0:1/(r-n),p}}function bs(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function CT(){var e=ys(fp()(hn));return e.copy=function(){return bs(e,CT())},Oi.apply(e,arguments)}function OT(){var e=iy(fp()).domain([1,10]);return e.copy=function(){return bs(e,OT()).base(e.base())},Oi.apply(e,arguments)}function AT(){var e=sy(fp());return e.copy=function(){return bs(e,AT()).constant(e.constant())},Oi.apply(e,arguments)}function gy(){var e=ay(fp());return e.copy=function(){return bs(e,gy()).exponent(e.exponent())},Oi.apply(e,arguments)}function gK(){return gy.apply(null,arguments).exponent(.5)}function ET(){var e=[],t=hn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Cc(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let i of r)i!=null&&!isNaN(i=+i)&&e.push(i);return e.sort(cs),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,i)=>t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>tW(e,a/r))},n.copy=function(){return ET(t).domain(e)},Oi.apply(n,arguments)}function pp(){var e=0,t=.5,n=1,r=1,i,a,c,u,d,p=hn,h,m=!1,g;function v(S){return isNaN(S=+S)?g:(S=.5+((S=+h(S))-a)*(r*S<r*a?u:d),p(m?Math.max(0,Math.min(1,S)):S))}v.domain=function(S){return arguments.length?([e,t,n]=S,i=h(e=+e),a=h(t=+t),c=h(n=+n),u=i===a?0:.5/(a-i),d=a===c?0:.5/(c-a),r=a<i?-1:1,v):[e,t,n]},v.clamp=function(S){return arguments.length?(m=!!S,v):m},v.interpolator=function(S){return arguments.length?(p=S,v):p};function w(S){return function(j){var k,C,E;return arguments.length?([k,C,E]=j,p=OW(S,[k,C,E]),v):[p(0),p(.5),p(1)]}}return v.range=w(To),v.rangeRound=w(ey),v.unknown=function(S){return arguments.length?(g=S,v):g},function(S){return h=S,i=S(e),a=S(t),c=S(n),u=i===a?0:.5/(a-i),d=a===c?0:.5/(c-a),r=a<i?-1:1,v}}function TT(){var e=ys(pp()(hn));return e.copy=function(){return bs(e,TT())},Oi.apply(e,arguments)}function MT(){var e=iy(pp()).domain([.1,1,10]);return e.copy=function(){return bs(e,MT()).base(e.base())},Oi.apply(e,arguments)}function _T(){var e=sy(pp());return e.copy=function(){return bs(e,_T()).constant(e.constant())},Oi.apply(e,arguments)}function xy(){var e=ay(pp());return e.copy=function(){return bs(e,xy()).exponent(e.exponent())},Oi.apply(e,arguments)}function xK(){return xy.apply(null,arguments).exponent(.5)}const Ll=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Qv,scaleDiverging:TT,scaleDivergingLog:MT,scaleDivergingPow:xy,scaleDivergingSqrt:xK,scaleDivergingSymlog:_T,scaleIdentity:dT,scaleImplicit:vx,scaleLinear:uT,scaleLog:pT,scaleOrdinal:Xv,scalePoint:iW,scalePow:oy,scaleQuantile:gT,scaleQuantize:xT,scaleRadial:mT,scaleSequential:CT,scaleSequentialLog:OT,scaleSequentialPow:gy,scaleSequentialQuantile:ET,scaleSequentialSqrt:gK,scaleSequentialSymlog:AT,scaleSqrt:QW,scaleSymlog:hT,scaleThreshold:vT,scaleTime:hK,scaleUtc:mK,tickFormat:cT},Symbol.toStringTag,{value:"Module"}));var Ai=e=>e.chartData,IT=Z([Ai],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),DT=(e,t,n,r)=>r?IT(e):Ai(e),vK=(e,t,n)=>n?IT(e):Ai(e);function Si(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(We(t)&&We(n))return!0}return!1}function LP(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function RT(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(We(n))i=n;else if(typeof n=="function")return;if(We(r))a=r;else if(typeof r=="function")return;var c=[i,a];if(Si(c))return c}}function yK(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Si(r))return LP(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,c,u;if(i==="auto")t!=null&&(c=Math.min(...t));else if(ke(i))c=i;else if(typeof i=="function")try{t!=null&&(c=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&GN.test(i)){var d=GN.exec(i);if(d==null||d[1]==null||t==null)c=void 0;else{var p=+d[1];c=t[0]-p}}else c=t==null?void 0:t[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(ke(a))u=a;else if(typeof a=="function")try{t!=null&&(u=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&YN.test(a)){var h=YN.exec(a);if(h==null||h[1]==null||t==null)u=void 0;else{var m=+h[1];u=t[1]+m}}else u=t==null?void 0:t[1];var g=[c,u];if(Si(g))return t==null?g:LP(g,t,n)}}}var Mo=1e9,bK={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},yy,dt=!0,ur="[DecimalError] ",ea=ur+"Invalid argument: ",vy=ur+"Exponent out of range: ",_o=Math.floor,Ks=Math.pow,wK=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ln,Bt=1e7,ot=7,LT=9007199254740991,vf=_o(LT/ot),ye={};ye.absoluteValue=ye.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ye.comparedTo=ye.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};ye.decimalPlaces=ye.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ot;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ye.dividedBy=ye.div=function(e){return gi(this,new this.constructor(e))};ye.dividedToIntegerBy=ye.idiv=function(e){var t=this,n=t.constructor;return Je(gi(t,new n(e),0,1),n.precision)};ye.equals=ye.eq=function(e){return!this.cmp(e)};ye.exponent=function(){return kt(this)};ye.greaterThan=ye.gt=function(e){return this.cmp(e)>0};ye.greaterThanOrEqualTo=ye.gte=function(e){return this.cmp(e)>=0};ye.isInteger=ye.isint=function(){return this.e>this.d.length-2};ye.isNegative=ye.isneg=function(){return this.s<0};ye.isPositive=ye.ispos=function(){return this.s>0};ye.isZero=function(){return this.s===0};ye.lessThan=ye.lt=function(e){return this.cmp(e)<0};ye.lessThanOrEqualTo=ye.lte=function(e){return this.cmp(e)<1};ye.logarithm=ye.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Ln))throw Error(ur+"NaN");if(n.s<1)throw Error(ur+(n.s?"NaN":"-Infinity"));return n.eq(Ln)?new r(0):(dt=!1,t=gi(fc(n,a),fc(e,a),a),dt=!0,Je(t,i))};ye.minus=ye.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?FT(t,e):$T(t,(e.s=-e.s,e))};ye.modulo=ye.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(ur+"NaN");return n.s?(dt=!1,t=gi(n,e,0,1).times(e),dt=!0,n.minus(t)):Je(new r(n),i)};ye.naturalExponential=ye.exp=function(){return zT(this)};ye.naturalLogarithm=ye.ln=function(){return fc(this)};ye.negated=ye.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ye.plus=ye.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?$T(t,e):FT(t,(e.s=-e.s,e))};ye.precision=ye.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ea+e);if(t=kt(i)+1,r=i.d.length-1,n=r*ot+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};ye.squareRoot=ye.sqrt=function(){var e,t,n,r,i,a,c,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(ur+"NaN")}for(e=kt(u),dt=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Wr(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=_o((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(i.toString()),n=d.precision,i=c=n+3;;)if(a=r,r=a.plus(gi(u,a,c+2)).times(.5),Wr(a.d).slice(0,c)===(t=Wr(r.d)).slice(0,c)){if(t=t.slice(c-3,c+1),i==c&&t=="4999"){if(Je(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;c+=4}return dt=!0,Je(r,n)};ye.times=ye.mul=function(e){var t,n,r,i,a,c,u,d,p,h=this,m=h.constructor,g=h.d,v=(e=new m(e)).d;if(!h.s||!e.s)return new m(0);for(e.s*=h.s,n=h.e+e.e,d=g.length,p=v.length,d<p&&(a=g,g=v,v=a,c=d,d=p,p=c),a=[],c=d+p,r=c;r--;)a.push(0);for(r=p;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+v[r]*g[i-r-1]+t,a[i--]=u%Bt|0,t=u/Bt|0;a[i]=(a[i]+t)%Bt|0}for(;!a[--c];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,dt?Je(e,m.precision):e};ye.toDecimalPlaces=ye.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Qr(e,0,Mo),t===void 0?t=r.rounding:Qr(t,0,8),Je(n,e+kt(n)+1,t))};ye.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=la(r,!0):(Qr(e,0,Mo),t===void 0?t=i.rounding:Qr(t,0,8),r=Je(new i(r),e+1,t),n=la(r,!0,e+1)),n};ye.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?la(i):(Qr(e,0,Mo),t===void 0?t=a.rounding:Qr(t,0,8),r=Je(new a(i),e+kt(i)+1,t),n=la(r.abs(),!1,e+kt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ye.toInteger=ye.toint=function(){var e=this,t=e.constructor;return Je(new t(e),kt(e)+1,t.rounding)};ye.toNumber=function(){return+this};ye.toPower=ye.pow=function(e){var t,n,r,i,a,c,u=this,d=u.constructor,p=12,h=+(e=new d(e));if(!e.s)return new d(Ln);if(u=new d(u),!u.s){if(e.s<1)throw Error(ur+"Infinity");return u}if(u.eq(Ln))return u;if(r=d.precision,e.eq(Ln))return Je(u,r);if(t=e.e,n=e.d.length-1,c=t>=n,a=u.s,c){if((n=h<0?-h:h)<=LT){for(i=new d(Ln),t=Math.ceil(r/ot+4),dt=!1;n%2&&(i=i.times(u),zP(i.d,t)),n=_o(n/2),n!==0;)u=u.times(u),zP(u.d,t);return dt=!0,e.s<0?new d(Ln).div(i):Je(i,r)}}else if(a<0)throw Error(ur+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,dt=!1,i=e.times(fc(u,r+p)),dt=!0,i=zT(i),i.s=a,i};ye.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=kt(i),r=la(i,n<=a.toExpNeg||n>=a.toExpPos)):(Qr(e,1,Mo),t===void 0?t=a.rounding:Qr(t,0,8),i=Je(new a(i),e,t),n=kt(i),r=la(i,e<=n||n<=a.toExpNeg,e)),r};ye.toSignificantDigits=ye.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Qr(e,1,Mo),t===void 0?t=r.rounding:Qr(t,0,8)),Je(new r(n),e,t)};ye.toString=ye.valueOf=ye.val=ye.toJSON=ye[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kt(e),n=e.constructor;return la(e,t<=n.toExpNeg||t>=n.toExpPos)};function $T(e,t){var n,r,i,a,c,u,d,p,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),dt?Je(t,m):t;if(d=e.d,p=t.d,c=e.e,i=t.e,d=d.slice(),a=c-i,a){for(a<0?(r=d,a=-a,u=p.length):(r=p,i=c,u=d.length),c=Math.ceil(m/ot),u=c>u?c+1:u+1,a>u&&(a=u,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(u=d.length,a=p.length,u-a<0&&(a=u,r=p,p=d,d=r),n=0;a;)n=(d[--a]=d[a]+p[a]+n)/Bt|0,d[a]%=Bt;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,dt?Je(t,m):t}function Qr(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ea+e)}function Wr(e){var t,n,r,i=e.length-1,a="",c=e[0];if(i>0){for(a+=c,t=1;t<i;t++)r=e[t]+"",n=ot-r.length,n&&(a+=ss(n)),a+=r;c=e[t],r=c+"",n=ot-r.length,n&&(a+=ss(n))}else if(c===0)return"0";for(;c%10===0;)c/=10;return a+c}var gi=(function(){function e(r,i){var a,c=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+c,r[u]=a%Bt|0,c=a/Bt|0;return c&&r.unshift(c),r}function t(r,i,a,c){var u,d;if(a!=c)d=a>c?1:-1;else for(u=d=0;u<a;u++)if(r[u]!=i[u]){d=r[u]>i[u]?1:-1;break}return d}function n(r,i,a){for(var c=0;a--;)r[a]-=c,c=r[a]<i[a]?1:0,r[a]=c*Bt+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,c){var u,d,p,h,m,g,v,w,S,j,k,C,E,A,P,O,M,I,z=r.constructor,K=r.s==i.s?1:-1,L=r.d,R=i.d;if(!r.s)return new z(r);if(!i.s)throw Error(ur+"Division by zero");for(d=r.e-i.e,M=R.length,P=L.length,v=new z(K),w=v.d=[],p=0;R[p]==(L[p]||0);)++p;if(R[p]>(L[p]||0)&&--d,a==null?C=a=z.precision:c?C=a+(kt(r)-kt(i))+1:C=a,C<0)return new z(0);if(C=C/ot+2|0,p=0,M==1)for(h=0,R=R[0],C++;(p<P||h)&&C--;p++)E=h*Bt+(L[p]||0),w[p]=E/R|0,h=E%R|0;else{for(h=Bt/(R[0]+1)|0,h>1&&(R=e(R,h),L=e(L,h),M=R.length,P=L.length),A=M,S=L.slice(0,M),j=S.length;j<M;)S[j++]=0;I=R.slice(),I.unshift(0),O=R[0],R[1]>=Bt/2&&++O;do h=0,u=t(R,S,M,j),u<0?(k=S[0],M!=j&&(k=k*Bt+(S[1]||0)),h=k/O|0,h>1?(h>=Bt&&(h=Bt-1),m=e(R,h),g=m.length,j=S.length,u=t(m,S,g,j),u==1&&(h--,n(m,M<g?I:R,g))):(h==0&&(u=h=1),m=R.slice()),g=m.length,g<j&&m.unshift(0),n(S,m,j),u==-1&&(j=S.length,u=t(R,S,M,j),u<1&&(h++,n(S,M<j?I:R,j))),j=S.length):u===0&&(h++,S=[0]),w[p++]=h,u&&S[0]?S[j++]=L[A]||0:(S=[L[A]],j=1);while((A++<P||S[0]!==void 0)&&C--)}return w[0]||w.shift(),v.e=d,Je(v,c?a+kt(v)+1:a)}})();function zT(e,t){var n,r,i,a,c,u,d=0,p=0,h=e.constructor,m=h.precision;if(kt(e)>16)throw Error(vy+kt(e));if(!e.s)return new h(Ln);for(dt=!1,u=m,c=new h(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(Ks(2,p))/Math.LN10*2+5|0,u+=r,n=i=a=new h(Ln),h.precision=u;;){if(i=Je(i.times(e),u),n=n.times(++d),c=a.plus(gi(i,n,u)),Wr(c.d).slice(0,u)===Wr(a.d).slice(0,u)){for(;p--;)a=Je(a.times(a),u);return h.precision=m,t==null?(dt=!0,Je(a,m)):a}a=c}}function kt(e){for(var t=e.e*ot,n=e.d[0];n>=10;n/=10)t++;return t}function Z0(e,t,n){if(t>e.LN10.sd())throw dt=!0,n&&(e.precision=n),Error(ur+"LN10 precision limit exceeded");return Je(new e(e.LN10),t)}function ss(e){for(var t="";e--;)t+="0";return t}function fc(e,t){var n,r,i,a,c,u,d,p,h,m=1,g=10,v=e,w=v.d,S=v.constructor,j=S.precision;if(v.s<1)throw Error(ur+(v.s?"NaN":"-Infinity"));if(v.eq(Ln))return new S(0);if(t==null?(dt=!1,p=j):p=t,v.eq(10))return t==null&&(dt=!0),Z0(S,p);if(p+=g,S.precision=p,n=Wr(w),r=n.charAt(0),a=kt(v),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)v=v.times(e),n=Wr(v.d),r=n.charAt(0),m++;a=kt(v),r>1?(v=new S("0."+n),a++):v=new S(r+"."+n.slice(1))}else return d=Z0(S,p+2,j).times(a+""),v=fc(new S(r+"."+n.slice(1)),p-g).plus(d),S.precision=j,t==null?(dt=!0,Je(v,j)):v;for(u=c=v=gi(v.minus(Ln),v.plus(Ln),p),h=Je(v.times(v),p),i=3;;){if(c=Je(c.times(h),p),d=u.plus(gi(c,new S(i),p)),Wr(d.d).slice(0,p)===Wr(u.d).slice(0,p))return u=u.times(2),a!==0&&(u=u.plus(Z0(S,p+2,j).times(a+""))),u=gi(u,new S(m),p),S.precision=j,t==null?(dt=!0,Je(u,j)):u;u=d,i+=2}}function $P(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=_o(n/ot),e.d=[],r=(n+1)%ot,n<0&&(r+=ot),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=ot;r<i;)e.d.push(+t.slice(r,r+=ot));t=t.slice(r),r=ot-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),dt&&(e.e>vf||e.e<-vf))throw Error(vy+n)}else e.s=0,e.e=0,e.d=[0];return e}function Je(e,t,n){var r,i,a,c,u,d,p,h,m=e.d;for(c=1,a=m[0];a>=10;a/=10)c++;if(r=t-c,r<0)r+=ot,i=t,p=m[h=0];else{if(h=Math.ceil((r+1)/ot),a=m.length,h>=a)return e;for(p=a=m[h],c=1;a>=10;a/=10)c++;r%=ot,i=r-ot+c}if(n!==void 0&&(a=Ks(10,c-i-1),u=p/a%10|0,d=t<0||m[h+1]!==void 0||p%a,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?i>0?p/Ks(10,c-i):0:m[h-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=kt(e),m.length=1,t=t-a-1,m[0]=Ks(10,(ot-t%ot)%ot),e.e=_o(-t/ot)||0):(m.length=1,m[0]=e.e=e.s=0),e;if(r==0?(m.length=h,a=1,h--):(m.length=h+1,a=Ks(10,ot-r),m[h]=i>0?(p/Ks(10,c-i)%Ks(10,i)|0)*a:0),d)for(;;)if(h==0){(m[0]+=a)==Bt&&(m[0]=1,++e.e);break}else{if(m[h]+=a,m[h]!=Bt)break;m[h--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(dt&&(e.e>vf||e.e<-vf))throw Error(vy+kt(e));return e}function FT(e,t){var n,r,i,a,c,u,d,p,h,m,g=e.constructor,v=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),dt?Je(t,v):t;if(d=e.d,m=t.d,r=t.e,p=e.e,d=d.slice(),c=p-r,c){for(h=c<0,h?(n=d,c=-c,u=m.length):(n=m,r=p,u=d.length),i=Math.max(Math.ceil(v/ot),u)+2,c>i&&(c=i,n.length=1),n.reverse(),i=c;i--;)n.push(0);n.reverse()}else{for(i=d.length,u=m.length,h=i<u,h&&(u=i),i=0;i<u;i++)if(d[i]!=m[i]){h=d[i]<m[i];break}c=0}for(h&&(n=d,d=m,m=n,t.s=-t.s),u=d.length,i=m.length-u;i>0;--i)d[u++]=0;for(i=m.length;i>c;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Bt-1;--d[a],d[i]+=Bt}d[i]-=m[i]}for(;d[--u]===0;)d.pop();for(;d[0]===0;d.shift())--r;return d[0]?(t.d=d,t.e=r,dt?Je(t,v):t):new g(0)}function la(e,t,n){var r,i=kt(e),a=Wr(e.d),c=a.length;return t?(n&&(r=n-c)>0?a=a.charAt(0)+"."+a.slice(1)+ss(r):c>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ss(-i-1)+a,n&&(r=n-c)>0&&(a+=ss(r))):i>=c?(a+=ss(i+1-c),n&&(r=n-i-1)>0&&(a=a+"."+ss(r))):((r=i+1)<c&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-c)>0&&(i+1===c&&(a+="."),a+=ss(r))),e.s<0?"-"+a:a}function zP(e,t){if(e.length>t)return e.length=t,!0}function BT(e){var t,n,r;function i(a){var c=this;if(!(c instanceof i))return new i(a);if(c.constructor=i,a instanceof i){c.s=a.s,c.e=a.e,c.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ea+a);if(a>0)c.s=1;else if(a<0)a=-a,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(a===~~a&&a<1e7){c.e=0,c.d=[a];return}return $P(c,a.toString())}else if(typeof a!="string")throw Error(ea+a);if(a.charCodeAt(0)===45?(a=a.slice(1),c.s=-1):c.s=1,wK.test(a))$P(c,a);else throw Error(ea+a)}if(i.prototype=ye,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=BT,i.config=i.set=jK,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function jK(e){if(!e||typeof e!="object")throw Error(ur+"Object expected");var t,n,r,i=["precision",1,Mo,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<i.length;t+=3)if((r=e[n=i[t]])!==void 0)if(_o(r)===r&&r>=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(ea+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(ea+n+": "+r);return this}var yy=BT(bK);Ln=new yy(1);const Ge=yy;function VT(e){var t;return e===0?t=1:t=Math.floor(new Ge(e).abs().log(10).toNumber())+1,t}function UT(e,t,n){for(var r=new Ge(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var WT=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},qT=(e,t,n)=>{if(e.lte(0))return new Ge(0);var r=VT(e.toNumber()),i=new Ge(10).pow(r),a=e.div(i),c=r!==1?.05:.1,u=new Ge(Math.ceil(a.div(c).toNumber())).add(n).mul(c),d=u.mul(i);return t?new Ge(d.toNumber()):new Ge(Math.ceil(d.toNumber()))},SK=(e,t,n)=>{var r=new Ge(1),i=new Ge(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Ge(10).pow(VT(e)-1),i=new Ge(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Ge(Math.floor(e)))}else e===0?i=new Ge(Math.floor((t-1)/2)):n||(i=new Ge(Math.floor(e)));for(var c=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new Ge(d-c).mul(r)).toNumber());return u},KT=function(t,n,r,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new Ge(0),tickMin:new Ge(0),tickMax:new Ge(0)};var c=qT(new Ge(n).sub(t).div(r-1),i,a),u;t<=0&&n>=0?u=new Ge(0):(u=new Ge(t).add(n).div(2),u=u.sub(new Ge(u).mod(c)));var d=Math.ceil(u.sub(t).div(c).toNumber()),p=Math.ceil(new Ge(n).sub(u).div(c).toNumber()),h=d+p+1;return h>r?KT(t,n,r,i,a+1):(h<r&&(p=n>0?p+(r-h):p,d=n>0?d:d+(r-h)),{step:c,tickMin:u.sub(new Ge(d).mul(c)),tickMax:u.add(new Ge(p).mul(c))})},NK=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,c=Math.max(i,2),[u,d]=WT([n,r]);if(u===-1/0||d===1/0){var p=d===1/0?[u,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),d];return n>r?p.reverse():p}if(u===d)return SK(u,i,a);var{step:h,tickMin:m,tickMax:g}=KT(u,d,c,a,0),v=UT(m,g.add(new Ge(.1).mul(h)),h);return n>r?v.reverse():v},kK=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[c,u]=WT([r,i]);if(c===-1/0||u===1/0)return[r,i];if(c===u)return[c];var d=Math.max(n,2),p=qT(new Ge(u).sub(c).div(d-1),a,0),h=[...UT(new Ge(c),new Ge(u),p),u];return a===!1&&(h=h.map(m=>Math.round(m))),r>i?h.reverse():h},HT=e=>e.rootProps.maxBarSize,PK=e=>e.rootProps.barGap,GT=e=>e.rootProps.barCategoryGap,CK=e=>e.rootProps.barSize,hp=e=>e.rootProps.stackOffset,YT=e=>e.rootProps.reverseStackOrder,by=e=>e.options.chartName,wy=e=>e.rootProps.syncId,XT=e=>e.rootProps.syncMethod,jy=e=>e.options.eventEmitter,Cn={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Bs={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Fr={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},mp=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function gp(e,t,n){if(n!=="auto")return n;if(e!=null)return vs(e,t)?"category":"number"}function FP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FP(Object(n),!0).forEach(function(r){OK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OK(e,t,n){return(t=AK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AK(e){var t=EK(e,"string");return typeof t=="symbol"?t:t+""}function EK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var BP={allowDataOverflow:Bs.allowDataOverflow,allowDecimals:Bs.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Bs.angleAxisId,includeHidden:!1,name:void 0,reversed:Bs.reversed,scale:Bs.scale,tick:Bs.tick,tickCount:void 0,ticks:void 0,type:Bs.type,unit:void 0},VP={allowDataOverflow:Fr.allowDataOverflow,allowDecimals:Fr.allowDecimals,allowDuplicatedCategory:Fr.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Fr.radiusAxisId,includeHidden:Fr.includeHidden,name:void 0,reversed:Fr.reversed,scale:Fr.scale,tick:Fr.tick,tickCount:Fr.tickCount,ticks:void 0,type:Fr.type,unit:void 0},TK=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},Sy=Z([TK,RE],(e,t)=>{var n;if(e!=null)return e;var r=(n=gp(t,"angleAxis",BP.type))!==null&&n!==void 0?n:"category";return yf(yf({},BP),{},{type:r})}),MK=(e,t)=>e.polarAxis.radiusAxis[t],Ny=Z([MK,RE],(e,t)=>{var n;if(e!=null)return e;var r=(n=gp(t,"radiusAxis",VP.type))!==null&&n!==void 0?n:"category";return yf(yf({},VP),{},{type:r})}),xp=e=>e.polarOptions,ky=Z([Pi,Ci,Ut],AU),QT=Z([xp,ky],(e,t)=>{if(e!=null)return Er(e.innerRadius,t,0)}),JT=Z([xp,ky],(e,t)=>{if(e!=null)return Er(e.outerRadius,t,t*.8)}),_K=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},ZT=Z([xp],_K);Z([Sy,ZT],mp);var e5=Z([ky,QT,JT],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});Z([Ny,e5],mp);var t5=Z([Ze,xp,QT,JT,Pi,Ci],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:c,cy:u,startAngle:d,endAngle:p}=t;return{cx:Er(c,i,i/2),cy:Er(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:p,clockWise:!1}}}),qt=(e,t)=>t,vp=(e,t,n)=>n;function Py(e){return e==null?void 0:e.id}function n5(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,c=new Map;return e.forEach(u=>{var d,p=(d=u.data)!==null&&d!==void 0?d:r;if(!(p==null||p.length===0)){var h=Py(u);p.forEach((m,g)=>{var v=a==null||i?g:String(en(m,a,null)),w=en(m,u.dataKey,0),S;c.has(v)?S=c.get(v):S={},Object.assign(S,{[h]:w}),c.set(v,S)})}}),Array.from(c.values())}function yp(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var bp=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function wp(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function IK(e,t){if(e.length===t.length){for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return!1}var Kt=e=>{var t=Ze(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Io=e=>e.tooltip.settings.axisId;function DK(e){if(e in Ll)return Ll[e]();var t="scale".concat(wc(e));if(t in Ll)return Ll[t]()}function UP(e){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(a){function c(){return a.apply(this,arguments)}return c.toString=function(){return a.toString()},c})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var c=i[0],u=i[1];return c<=u?a>=c&&a<=u:a>=u&&a<=c},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,c)=>{var u=e(a);if(u!=null){if(e.bandwidth&&c!==null&&c!==void 0&&c.position){var d=e.bandwidth();switch(c.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}function WP(e,t,n){if(typeof e=="function")return UP(e.copy().domain(t).range(n));if(e!=null){var r=DK(e);if(r!=null)return r.domain(t).range(n),UP(r)}}var RK=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Si(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];We(a)&&((n===void 0||a<n)&&(n=a),(r===void 0||a>r)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function qP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function bf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qP(Object(n),!0).forEach(function(r){LK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LK(e,t,n){return(t=$K(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $K(e){var t=zK(e,"string");return typeof t=="symbol"?t:t+""}function zK(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jx=[0,"auto"],zt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0},r5=(e,t)=>e.cartesianAxis.xAxis[t],Ei=(e,t)=>{var n=r5(e,t);return n??zt},Ft={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:jx,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:Nc},i5=(e,t)=>e.cartesianAxis.yAxis[t],Ti=(e,t)=>{var n=i5(e,t);return n??Ft},FK={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Cy=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??FK},gn=(e,t,n)=>{switch(t){case"xAxis":return Ei(e,n);case"yAxis":return Ti(e,n);case"zAxis":return Cy(e,n);case"angleAxis":return Sy(e,n);case"radiusAxis":return Ny(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},BK=(e,t,n)=>{switch(t){case"xAxis":return Ei(e,n);case"yAxis":return Ti(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Tc=(e,t,n)=>{switch(t){case"xAxis":return Ei(e,n);case"yAxis":return Ti(e,n);case"angleAxis":return Sy(e,n);case"radiusAxis":return Ny(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},s5=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function a5(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var Oy=e=>e.graphicalItems.cartesianItems,VK=Z([qt,vp],a5),o5=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Mc=Z([Oy,gn,VK],o5,{memoizeOptions:{resultEqualityCheck:wp}}),l5=Z([Mc],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(yp)),c5=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),UK=Z([Mc],c5),u5=e=>e.map(t=>t.data).filter(Boolean).flat(1),WK=Z([Mc],u5,{memoizeOptions:{resultEqualityCheck:wp}}),d5=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},Ay=Z([WK,DT],d5),f5=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:en(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:en(i,r)}))):e.map(r=>({value:r})),jp=Z([Ay,gn,Mc],f5);function p5(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function Sd(e){if(Xr(e)||e instanceof Date){var t=Number(e);if(We(t))return t}}function KP(e){if(Array.isArray(e)){var t=[Sd(e[0]),Sd(e[1])];return Si(t)?t:void 0}var n=Sd(e);if(n!=null)return[n,n]}function Ni(e){return e.map(Sd).filter(Vr)}function qK(e,t,n){return!n||typeof t!="number"||Yr(t)?[]:n.length?Ni(n.flatMap(r=>{var i=en(e,r.dataKey),a,c;if(Array.isArray(i)?[a,c]=i:a=c=i,!(!We(a)||!We(c)))return[t-a,t+c]})):[]}var Tt=e=>{var t=Kt(e),n=Io(e);return Tc(e,t,n)},_c=Z([Tt],e=>e==null?void 0:e.dataKey),KK=Z([l5,DT,Tt],n5),h5=(e,t,n,r)=>{var i={},a=t.reduce((c,u)=>{if(u.stackId==null)return c;var d=c[u.stackId];return d==null&&(d=[]),d.push(u),c[u.stackId]=d,c},i);return Object.fromEntries(Object.entries(a).map(c=>{var[u,d]=c,p=r?[...d].reverse():d,h=p.map(Py);return[u,{stackedData:gV(e,h,n),graphicalItems:p}]}))},Sx=Z([KK,l5,hp,YT],h5),m5=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var c=wV(e,i,a);if(!(c!=null&&c[0]===0&&c[1]===0))return c}},HK=Z([gn],e=>e.allowDataOverflow),Ey=e=>{var t;if(e==null||!("domain"in e))return jx;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ni(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:jx},g5=Z([gn],Ey),x5=Z([g5,HK],RT),GK=Z([Sx,Ai,qt,x5],m5,{memoizeOptions:{resultEqualityCheck:bp}}),Ty=e=>e.errorBars,YK=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>p5(n,r)),wf=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=n.filter(Boolean);if(i.length!==0){var a=i.flat(),c=Math.min(...a),u=Math.max(...a);return[c,u]}},v5=(e,t,n,r,i)=>{var a,c;if(n.length>0&&e.forEach(u=>{n.forEach(d=>{var p,h,m=(p=r[d.id])===null||p===void 0?void 0:p.filter(k=>p5(i,k)),g=en(u,(h=t.dataKey)!==null&&h!==void 0?h:d.dataKey),v=qK(u,g,m);if(v.length>=2){var w=Math.min(...v),S=Math.max(...v);(a==null||w<a)&&(a=w),(c==null||S>c)&&(c=S)}var j=KP(g);j!=null&&(a=a==null?j[0]:Math.min(a,j[0]),c=c==null?j[1]:Math.max(c,j[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(u=>{var d=KP(en(u,t.dataKey));d!=null&&(a=a==null?d[0]:Math.min(a,d[0]),c=c==null?d[1]:Math.max(c,d[1]))}),We(a)&&We(c))return[a,c]},XK=Z([Ay,gn,UK,Ty,qt],v5,{memoizeOptions:{resultEqualityCheck:bp}});function QK(e){var{value:t}=e;if(Xr(t)||t instanceof Date)return t}var JK=(e,t,n)=>{var r=e.map(QK).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&$A(r))?eT(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},y5=e=>e.referenceElements.dots,Do=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),ZK=Z([y5,qt,vp],Do),b5=e=>e.referenceElements.areas,eH=Z([b5,qt,vp],Do),w5=e=>e.referenceElements.lines,tH=Z([w5,qt,vp],Do),j5=(e,t)=>{if(e!=null){var n=Ni(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},nH=Z(ZK,qt,j5),S5=(e,t)=>{if(e!=null){var n=Ni(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},rH=Z([eH,qt],S5);function iH(e){var t;if(e.x!=null)return Ni([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ni(n)}function sH(e){var t;if(e.y!=null)return Ni([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ni(n)}var N5=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?iH(r):sH(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},aH=Z([tH,qt],N5),oH=Z(nH,aH,rH,(e,t,n)=>wf(e,n,t)),k5=(e,t,n,r,i,a,c,u)=>{if(n!=null)return n;var d=c==="vertical"&&u==="xAxis"||c==="horizontal"&&u==="yAxis",p=d?wf(r,a,i):wf(a,i);return yK(t,p,e.allowDataOverflow)},lH=Z([gn,g5,x5,GK,XK,oH,Ze,qt],k5,{memoizeOptions:{resultEqualityCheck:bp}}),cH=[0,1],P5=(e,t,n,r,i,a,c)=>{if(!((e==null||n==null||n.length===0)&&c===void 0)){var{dataKey:u,type:d}=e,p=vs(t,a);if(p&&u==null){var h;return eT(0,(h=n==null?void 0:n.length)!==null&&h!==void 0?h:0)}return d==="category"?JK(r,e,p):i==="expand"?cH:c}},My=Z([gn,Ze,Ay,jp,hp,qt,lH],P5);function uH(e){return e in Ll}var C5=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string"){var a="scale".concat(wc(r));return uH(a)?a:"point"}}},Ro=Z([gn,s5,by],C5);function _y(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?WP(e.scale,n,r):WP(t,n,r)}var O5=(e,t,n)=>{var r=Ey(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&Si(e))return NK(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Si(e))return kK(e,t.tickCount,t.allowDecimals)}},Iy=Z([My,Tc,Ro],O5),A5=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Si(t)&&Array.isArray(n)&&n.length>0){var i,a,c=t[0],u=(i=n[0])!==null&&i!==void 0?i:0,d=t[1],p=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(c,u),Math.max(d,p)]}return t},dH=Z([gn,My,Iy,qt],A5),fH=Z(jp,gn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ni(e.map(m=>m.value))).sort((m,g)=>m-g),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var c=a-i;if(c===0)return 1/0;for(var u=0;u<r.length-1;u++){var d=r[u],p=r[u+1];if(!(d==null||p==null)){var h=p-d;n=Math.min(n,h)}}return n/c}}),E5=Z(fH,Ze,GT,Ut,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!We(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var c=Er(n,e*a),u=e*a/2;return u-c-(u-c)/a*c}return 0}),pH=(e,t,n)=>{var r=Ei(e,t);return r==null||typeof r.padding!="string"?0:E5(e,"xAxis",t,n,r.padding)},hH=(e,t,n)=>{var r=Ti(e,t);return r==null||typeof r.padding!="string"?0:E5(e,"yAxis",t,n,r.padding)},mH=Z(Ei,pH,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),gH=Z(Ti,hH,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),xH=Z([Ut,mH,np,tp,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),vH=Z([Ut,Ze,gH,np,tp,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:c}=i;return a?[r.height-c.bottom,c.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Ic=(e,t,n,r)=>{var i;switch(t){case"xAxis":return xH(e,n,r);case"yAxis":return vH(e,n,r);case"zAxis":return(i=Cy(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return ZT(e);case"radiusAxis":return e5(e,n);default:return}},T5=Z([gn,Ic],mp),yH=Z([Ro,dH],RK),Sp=Z([gn,Ro,yH,T5],_y);Z([Mc,Ty,qt],YK);function M5(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var Np=(e,t)=>t,kp=(e,t,n)=>n,bH=Z(Zf,Np,kp,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(M5)),wH=Z(ep,Np,kp,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(M5)),_5=(e,t)=>({width:e.width,height:t.height}),jH=(e,t)=>{var n=typeof t.width=="number"?t.width:Nc;return{width:n,height:e.height}},I5=Z(Ut,Ei,_5),SH=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},NH=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},kH=Z(Ci,Ut,bH,Np,kp,(e,t,n,r,i)=>{var a={},c;return n.forEach(u=>{var d=_5(t,u);c==null&&(c=SH(t,r,e));var p=r==="top"&&!i||r==="bottom"&&i;a[u.id]=c-Number(p)*d.height,c+=(p?-1:1)*d.height}),a}),PH=Z(Pi,Ut,wH,Np,kp,(e,t,n,r,i)=>{var a={},c;return n.forEach(u=>{var d=jH(t,u);c==null&&(c=NH(t,r,e));var p=r==="left"&&!i||r==="right"&&i;a[u.id]=c-Number(p)*d.width,c+=(p?-1:1)*d.width}),a}),CH=(e,t)=>{var n=Ei(e,t);if(n!=null)return kH(e,n.orientation,n.mirror)},OH=Z([Ut,Ei,CH,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),AH=(e,t)=>{var n=Ti(e,t);if(n!=null)return PH(e,n.orientation,n.mirror)},EH=Z([Ut,Ti,AH,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),D5=Z(Ut,Ti,(e,t)=>{var n=typeof t.width=="number"?t.width:Nc;return{width:n,height:e.height}}),HP=(e,t,n)=>{switch(t){case"xAxis":return I5(e,n).width;case"yAxis":return D5(e,n).height;default:return}},R5=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:c}=n,u=vs(e,r),d=t.map(p=>p.value);if(c&&u&&a==="category"&&i&&$A(d))return d}},Dy=Z([Ze,jp,gn,qt],R5),L5=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,c=vs(e,r);if(c&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},Ry=Z([Ze,jp,Tc,qt],L5);Z([Ze,BK,Ro,Sp,Dy,Ry,Ic,Iy,qt],(e,t,n,r,i,a,c,u,d)=>{if(t!=null){var p=vs(e,d);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:d,categoricalDomain:a,duplicateDomain:i,isCategorical:p,niceTicks:u,range:c,realScaleType:n,scale:r}}});var TH=(e,t,n,r,i,a,c,u,d)=>{if(!(t==null||r==null)){var p=vs(e,d),{type:h,ticks:m,tickCount:g}=t,v=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=h==="category"&&r.bandwidth?r.bandwidth()/v:0;w=d==="angleAxis"&&a!=null&&a.length>=2?$n(a[0]-a[1])*2*w:w;var S=m||i;return S?S.map((j,k)=>{var C=c?c.indexOf(j):j,E=r.map(C);return We(E)?{index:k,coordinate:E+w,value:j,offset:w}:null}).filter(Vr):p&&u?u.map((j,k)=>{var C=r.map(j);return We(C)?{coordinate:C+w,value:j,index:k,offset:w}:null}).filter(Vr):r.ticks?r.ticks(g).map((j,k)=>{var C=r.map(j);return We(C)?{coordinate:C+w,value:j,index:k,offset:w}:null}).filter(Vr):r.domain().map((j,k)=>{var C=r.map(j);return We(C)?{coordinate:C+w,value:c?c[j]:j,index:k,offset:w}:null}).filter(Vr)}},$5=Z([Ze,Tc,Ro,Sp,Iy,Ic,Dy,Ry,qt],TH),MH=(e,t,n,r,i,a,c)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=vs(e,c),{tickCount:d}=t,p=0;return p=c==="angleAxis"&&(r==null?void 0:r.length)>=2?$n(r[0]-r[1])*2*p:p,u&&a?a.map((h,m)=>{var g=n.map(h);return We(g)?{coordinate:g+p,value:h,index:m,offset:p}:null}).filter(Vr):n.ticks?n.ticks(d).map((h,m)=>{var g=n.map(h);return We(g)?{coordinate:g+p,value:h,index:m,offset:p}:null}).filter(Vr):n.domain().map((h,m)=>{var g=n.map(h);return We(g)?{coordinate:g+p,value:i?i[h]:h,index:m,offset:p}:null}).filter(Vr)}},wo=Z([Ze,Tc,Sp,Ic,Dy,Ry,qt],MH),jo=Z(gn,Sp,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})}),_H=Z([gn,Ro,My,T5],_y);Z((e,t,n)=>Cy(e,n),_H,(e,t)=>{if(!(e==null||t==null))return bf(bf({},e),{},{scale:t})});var IH=Z([Ze,Zf,ep],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),z5=e=>e.options.defaultTooltipEventType,F5=e=>e.options.validateTooltipEventTypes;function B5(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Ly(e,t){var n=z5(e),r=F5(e);return B5(t,n,r)}function DH(e){return Ee(t=>Ly(t,e))}var V5=(e,t)=>{var n,r=Number(t);if(!(Yr(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},RH=e=>e.tooltip.settings,os={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},LH={itemInteraction:{click:os,hover:os},axisInteraction:{click:os,hover:os},keyboardInteraction:os,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},U5=An({name:"tooltip",initialState:LH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:ut()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ar(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:ut()},removeTooltipEntrySettings:{reducer(e,t){var n=Ar(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:ut()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:$H,replaceTooltipEntrySettings:zH,removeTooltipEntrySettings:FH,setTooltipSettingsState:BH,setActiveMouseOverItemIndex:W5,mouseLeaveItem:VH,mouseLeaveChart:q5,setActiveClickItemIndex:UH,setMouseOverAxisIndex:K5,setMouseClickAxisIndex:WH,setSyncInteraction:Nx,setKeyboardInteraction:kx}=U5.actions,qH=U5.reducer;function GP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function dd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GP(Object(n),!0).forEach(function(r){KH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KH(e,t,n){return(t=HH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HH(e){var t=GH(e,"string");return typeof t=="symbol"?t:t+""}function GH(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function YH(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function XH(e){return e.index!=null}var H5=(e,t,n,r)=>{if(t==null)return os;var i=YH(e,t,n);if(i==null)return os;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(XH(i)){if(a)return dd(dd({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return dd(dd({},os),{},{coordinate:i.coordinate})};function QH(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function JH(e,t){var n=QH(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),c=Math.max(r,i);return n>=a&&n<=c}function ZH(e,t,n){if(n==null||t==null)return!0;var r=en(e,t);return r==null||!Si(n)?!0:JH(r,n)}var $y=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!We(a))return i;var c=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(c,Math.min(a,u)),p=t[d];return p==null||ZH(p,n,r)?String(d):null},G5=(e,t,n,r,i,a,c)=>{if(a!=null){var u=c[0],d=u==null?void 0:u.getPosition(a);if(d!=null)return d;var p=i==null?void 0:i[Number(a)];if(p)switch(n){case"horizontal":return{x:p.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:p.coordinate}}}},Y5=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(c=>{var u;return((u=c.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},X5=e=>e.options.tooltipPayloadSearcher,Lo=e=>e.tooltip;function YP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function XP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YP(Object(n),!0).forEach(function(r){eG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eG(e,t,n){return(t=tG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tG(e){var t=nG(e,"string");return typeof t=="symbol"?t:t+""}function nG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rG(e,t){return e??t}var Q5=(e,t,n,r,i,a,c)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:p,dataEndIndex:h}=n,m=[];return e.reduce((g,v)=>{var w,{dataDefinedOnItem:S,settings:j}=v,k=rG(S,u),C=Array.isArray(k)?AE(k,p,h):k,E=(w=j==null?void 0:j.dataKey)!==null&&w!==void 0?w:r,A=j==null?void 0:j.nameKey,P;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&c==="axis"?P=XB(C,r,i):P=a(C,t,d,A),Array.isArray(P))P.forEach(M=>{var I=XP(XP({},j),{},{name:M.name,unit:M.unit,color:void 0,fill:void 0});g.push(XN({tooltipEntrySettings:I,dataKey:M.dataKey,payload:M.payload,value:en(M.payload,M.dataKey),name:M.name}))});else{var O;g.push(XN({tooltipEntrySettings:j,dataKey:E,payload:P,value:en(P,E),name:(O=en(P,A))!==null&&O!==void 0?O:j==null?void 0:j.name}))}return g},m)}},zy=Z([Tt,s5,by],C5),iG=Z([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),sG=Z([Kt,Io],a5),$o=Z([iG,Tt,sG],o5,{memoizeOptions:{resultEqualityCheck:wp}}),aG=Z([$o],e=>e.filter(yp)),oG=Z([$o],u5,{memoizeOptions:{resultEqualityCheck:wp}}),zo=Z([oG,Ai],d5),lG=Z([aG,Ai,Tt],n5),Fy=Z([zo,Tt,$o],f5),J5=Z([Tt],Ey),cG=Z([Tt],e=>e.allowDataOverflow),Z5=Z([J5,cG],RT),uG=Z([$o],e=>e.filter(yp)),dG=Z([lG,uG,hp,YT],h5),fG=Z([dG,Ai,Kt,Z5],m5),pG=Z([$o],c5),hG=Z([zo,Tt,pG,Ty,Kt],v5,{memoizeOptions:{resultEqualityCheck:bp}}),mG=Z([y5,Kt,Io],Do),gG=Z([mG,Kt],j5),xG=Z([b5,Kt,Io],Do),vG=Z([xG,Kt],S5),yG=Z([w5,Kt,Io],Do),bG=Z([yG,Kt],N5),wG=Z([gG,bG,vG],wf),jG=Z([Tt,J5,Z5,fG,hG,wG,Ze,Kt],k5),Dc=Z([Tt,Ze,zo,Fy,hp,Kt,jG],P5),SG=Z([Dc,Tt,zy],O5),NG=Z([Tt,Dc,SG,Kt],A5),eM=e=>{var t=Kt(e),n=Io(e),r=!1;return Ic(e,t,n,r)},tM=Z([Tt,eM],mp),nM=Z([Tt,zy,NG,tM],_y),kG=Z([Ze,Fy,Tt,Kt],R5),PG=Z([Ze,Fy,Tt,Kt],L5),CG=(e,t,n,r,i,a,c,u)=>{if(t){var{type:d}=t,p=vs(e,u);if(r){var h=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=d==="category"&&r.bandwidth?r.bandwidth()/h:0;return m=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?$n(i[0]-i[1])*2*m:m,p&&c?c.map((g,v)=>{var w=r.map(g);return We(w)?{coordinate:w+m,value:g,index:v,offset:m}:null}).filter(Vr):r.domain().map((g,v)=>{var w=r.map(g);return We(w)?{coordinate:w+m,value:a?a[g]:g,index:v,offset:m}:null}).filter(Vr)}}},Mi=Z([Ze,Tt,zy,nM,eM,kG,PG,Kt],CG),By=Z([z5,F5,RH],(e,t,n)=>B5(n.shared,e,t)),rM=e=>e.tooltip.settings.trigger,Vy=e=>e.tooltip.settings.defaultIndex,Rc=Z([Lo,By,rM,Vy],H5),So=Z([Rc,zo,_c,Dc],$y),iM=Z([Mi,So],V5),sM=Z([Rc],e=>{if(e)return e.dataKey});Z([Rc],e=>{if(e)return e.graphicalItemId});var aM=Z([Lo,By,rM,Vy],Y5),OG=Z([Pi,Ci,Ze,Ut,Mi,Vy,aM],G5),AG=Z([Rc,OG],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),EG=Z([Rc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),TG=Z([aM,So,Ai,_c,iM,X5,By],Q5);Z([TG],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function QP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function JP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?QP(Object(n),!0).forEach(function(r){MG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function MG(e,t,n){return(t=_G(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _G(e){var t=IG(e,"string");return typeof t=="symbol"?t:t+""}function IG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var DG=()=>Ee(Tt),RG=()=>{var e=DG(),t=Ee(Mi),n=Ee(nM);return Jd(!e||!n?void 0:JP(JP({},e),{},{scale:n}),t)};function ZP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ka(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ZP(Object(n),!0).forEach(function(r){LG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LG(e,t,n){return(t=$G(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $G(e){var t=zG(e,"string");return typeof t=="symbol"?t:t+""}function zG(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var FG=(e,t,n,r)=>{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.chartY};if(e==="vertical")return{x:r.chartX,y:i.coordinate}}return{x:0,y:0}},BG=(e,t,n,r)=>{var i=t.find(p=>p&&p.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:c}=r;return Ka(Ka(Ka({},r),Zt(r.cx,r.cy,c,a)),{},{angle:a,radius:c})}var u=i.coordinate,{angle:d}=r;return Ka(Ka(Ka({},r),Zt(r.cx,r.cy,u,d)),{},{angle:d,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function VG(e,t){var{chartX:n,chartY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var oM=(e,t,n,r,i)=>{var a,c=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(c<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u<c;u++){var d,p,h,m,g,v=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(p=n[c-1])===null||p===void 0?void 0:p.coordinate,w=(h=n[u])===null||h===void 0?void 0:h.coordinate,S=u>=c-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(g=n[u+1])===null||g===void 0?void 0:g.coordinate,j=void 0;if(!(v==null||w==null||S==null))if($n(w-v)!==$n(S-w)){var k=[];if($n(S-w)===$n(i[1]-i[0])){j=S;var C=w+i[1]-i[0];k[0]=Math.min(C,(C+v)/2),k[1]=Math.max(C,(C+v)/2)}else{j=v;var E=S+i[1]-i[0];k[0]=Math.min(w,(E+w)/2),k[1]=Math.max(w,(E+w)/2)}var A=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>A[0]&&e<=A[1]||e>=k[0]&&e<=k[1]){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}else{var O=Math.min(v,S),M=Math.max(v,S);if(e>(O+w)/2&&e<=(M+w)/2){var I;return(I=n[u])===null||I===void 0?void 0:I.index}}}else if(t)for(var z=0;z<c;z++){var K=t[z];if(K!=null){var L=t[z+1],R=t[z-1];if(z===0&&L!=null&&e<=(K.coordinate+L.coordinate)/2||z===c-1&&R!=null&&e>(K.coordinate+R.coordinate)/2||z>0&&z<c-1&&R!=null&&L!=null&&e>(K.coordinate+R.coordinate)/2&&e<=(K.coordinate+L.coordinate)/2)return K.index}}return-1},UG=()=>Ee(by),Uy=(e,t)=>t,lM=(e,t,n)=>n,Wy=(e,t,n,r)=>r,WG=Z(Mi,e=>Uf(e,t=>t.coordinate)),qy=Z([Lo,Uy,lM,Wy],H5),Ky=Z([qy,zo,_c,Dc],$y),qG=(e,t,n)=>{if(t!=null){var r=Lo(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},cM=Z([Lo,Uy,lM,Wy],Y5),jf=Z([Pi,Ci,Ze,Ut,Mi,Wy,cM],G5),KG=Z([qy,jf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),uM=Z([Mi,Ky],V5),HG=Z([cM,Ky,Ai,_c,uM,X5,Uy],Q5),GG=Z([qy,Ky],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),YG=(e,t,n,r,i,a,c)=>{if(!(!e||!n||!r||!i)&&VG(e,c)){var u=jV(e,t),d=oM(u,a,i,n,r),p=FG(t,i,d,e);return{activeIndex:String(d),activeCoordinate:p}}},XG=(e,t,n,r,i,a,c)=>{if(!(!e||!r||!i||!a||!n)){var u=IU(e,n);if(u){var d=SV(u,t),p=oM(d,c,a,r,i),h=BG(t,a,p,u);return{activeIndex:String(p),activeCoordinate:h}}}},QG=(e,t,n,r,i,a,c,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?YG(e,t,r,i,a,c,u):XG(e,t,n,r,i,a,c)},JG=Z(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),ZG=Z(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Cn)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:IK}});function e2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function t2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e2(Object(n),!0).forEach(function(r){eY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eY(e,t,n){return(t=tY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tY(e){var t=nY(e,"string");return typeof t=="symbol"?t:t+""}function nY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var rY={},iY={zIndexMap:Object.values(Cn).reduce((e,t)=>t2(t2({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),rY)},sY=new Set(Object.values(Cn));function aY(e){return sY.has(e)}var dM=An({name:"zIndex",initialState:iY,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:ut()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!aY(n)&&delete e.zIndexMap[n])},prepare:ut()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:ut()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:ut()}}}),{registerZIndexPortal:oY,unregisterZIndexPortal:lY,registerZIndexPortalElement:cY,unregisterZIndexPortalElement:uY}=dM.actions,dY=dM.reducer;function ws(e){var{zIndex:t,children:n}=e,r=s9(),i=r&&t!==void 0&&t!==0,a=Wn(),c=St();b.useLayoutEffect(()=>i?(c(oY({zIndex:t})),()=>{c(lY({zIndex:t}))}):Ao,[c,t,i]);var u=Ee(d=>JG(d,t,a));return i?u?bA.createPortal(n,u):null:n}function Px(){return Px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Px.apply(null,arguments)}function n2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?n2(Object(n),!0).forEach(function(r){fY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):n2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fY(e,t,n){return(t=pY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pY(e){var t=hY(e,"string");return typeof t=="symbol"?t:t+""}function hY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mY(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return b.isValidElement(t)?b.cloneElement(t,r):b.createElement(n,r)}function gY(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:c,layout:u,cursor:d,tooltipEventType:p,chartName:h}=e,m=n,g=r,v=i;if(!d||!m||h!=="ScatterChart"&&p!=="axis")return null;var w,S,j;if(h==="ScatterChart")w=m,S=H9,j=Cn.cursorLine;else if(h==="BarChart")w=G9(u,m,a,c),S=XE,j=Cn.cursorRectangle;else if(u==="radial"&&BA(m)){var{cx:k,cy:C,radius:E,startAngle:A,endAngle:P}=QE(m);w={cx:k,cy:C,startAngle:A,endAngle:P,innerRadius:E,outerRadius:E},S=ZE,j=Cn.cursorLine}else w={points:$U(u,m,a)},S=qE,j=Cn.cursorLine;var O=typeof d=="object"&&"className"in d?d.className:void 0,M=fd(fd(fd(fd({stroke:"#ccc",pointerEvents:"none"},a),w),kv(d)),{},{payload:g,payloadIndex:v,className:rt("recharts-tooltip-cursor",O)});return b.createElement(ws,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},b.createElement(mY,{cursor:d,cursorComp:S,cursorProps:M}))}function xY(e){var t=RG(),n=n9(),r=Eo(),i=UG();return t==null||n==null||r==null||i==null?null:b.createElement(gY,Px({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var fM=b.createContext(null),vY=()=>b.useContext(fM),eg={exports:{}},r2;function yY(){return r2||(r2=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,p,h){this.fn=d,this.context=p,this.once=h||!1}function a(d,p,h,m,g){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new i(h,m||d,g),w=n?n+p:p;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],v]:d._events[w].push(v):(d._events[w]=v,d._eventsCount++),d}function c(d,p){--d._eventsCount===0?d._events=new r:delete d._events[p]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var p=[],h,m;if(this._eventsCount===0)return p;for(m in h=this._events)t.call(h,m)&&p.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(h)):p},u.prototype.listeners=function(p){var h=n?n+p:p,m=this._events[h];if(!m)return[];if(m.fn)return[m.fn];for(var g=0,v=m.length,w=new Array(v);g<v;g++)w[g]=m[g].fn;return w},u.prototype.listenerCount=function(p){var h=n?n+p:p,m=this._events[h];return m?m.fn?1:m.length:0},u.prototype.emit=function(p,h,m,g,v,w){var S=n?n+p:p;if(!this._events[S])return!1;var j=this._events[S],k=arguments.length,C,E;if(j.fn){switch(j.once&&this.removeListener(p,j.fn,void 0,!0),k){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,h),!0;case 3:return j.fn.call(j.context,h,m),!0;case 4:return j.fn.call(j.context,h,m,g),!0;case 5:return j.fn.call(j.context,h,m,g,v),!0;case 6:return j.fn.call(j.context,h,m,g,v,w),!0}for(E=1,C=new Array(k-1);E<k;E++)C[E-1]=arguments[E];j.fn.apply(j.context,C)}else{var A=j.length,P;for(E=0;E<A;E++)switch(j[E].once&&this.removeListener(p,j[E].fn,void 0,!0),k){case 1:j[E].fn.call(j[E].context);break;case 2:j[E].fn.call(j[E].context,h);break;case 3:j[E].fn.call(j[E].context,h,m);break;case 4:j[E].fn.call(j[E].context,h,m,g);break;default:if(!C)for(P=1,C=new Array(k-1);P<k;P++)C[P-1]=arguments[P];j[E].fn.apply(j[E].context,C)}}return!0},u.prototype.on=function(p,h,m){return a(this,p,h,m,!1)},u.prototype.once=function(p,h,m){return a(this,p,h,m,!0)},u.prototype.removeListener=function(p,h,m,g){var v=n?n+p:p;if(!this._events[v])return this;if(!h)return c(this,v),this;var w=this._events[v];if(w.fn)w.fn===h&&(!g||w.once)&&(!m||w.context===m)&&c(this,v);else{for(var S=0,j=[],k=w.length;S<k;S++)(w[S].fn!==h||g&&!w[S].once||m&&w[S].context!==m)&&j.push(w[S]);j.length?this._events[v]=j.length===1?j[0]:j:c(this,v)}return this},u.prototype.removeAllListeners=function(p){var h;return p?(h=n?n+p:p,this._events[h]&&c(this,h)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(eg)),eg.exports}var bY=yY();const wY=Jr(bY);var pc=new wY,Cx="recharts.syncEvent.tooltip",i2="recharts.syncEvent.brush",jY=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Yr(n))return e[n]}},SY={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},pM=An({name:"options",initialState:SY,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),NY=pM.reducer,{createEventEmitter:kY}=pM.actions;function PY(e){return e.tooltip.syncInteraction}var CY={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},hM=An({name:"chartData",initialState:CY,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:s2,setDataStartEndIndexes:OY,setComputedData:Lte}=hM.actions,AY=hM.reducer,EY=["x","y"];function a2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ha(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?a2(Object(n),!0).forEach(function(r){TY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TY(e,t,n){return(t=MY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MY(e){var t=_Y(e,"string");return typeof t=="symbol"?t:t+""}function _Y(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IY(e,t){if(e==null)return{};var n,r,i=DY(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function DY(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function RY(){var e=Ee(wy),t=Ee(jy),n=St(),r=Ee(XT),i=Ee(Mi),a=Eo(),c=rp(),u=Ee(d=>d.rootProps.className);b.useEffect(()=>{if(e==null)return Ao;var d=(p,h,m)=>{if(t!==m&&e===p){if(r==="index"){var g;if(c&&h!==null&&h!==void 0&&(g=h.payload)!==null&&g!==void 0&&g.coordinate&&h.payload.sourceViewBox){var v=h.payload.coordinate,{x:w,y:S}=v,j=IY(v,EY),{x:k,y:C,width:E,height:A}=h.payload.sourceViewBox,P=Ha(Ha({},j),{},{x:c.x+(E?(w-k)/E:0)*c.width,y:c.y+(A?(S-C)/A:0)*c.height});n(Ha(Ha({},h),{},{payload:Ha(Ha({},h.payload),{},{coordinate:P})}))}else n(h);return}if(i!=null){var O;if(typeof r=="function"){var M={activeTooltipIndex:h.payload.index==null?void 0:Number(h.payload.index),isTooltipActive:h.payload.active,activeIndex:h.payload.index==null?void 0:Number(h.payload.index),activeLabel:h.payload.label,activeDataKey:h.payload.dataKey,activeCoordinate:h.payload.coordinate},I=r(i,M);O=i[I]}else r==="value"&&(O=i.find(re=>String(re.value)===h.payload.label));var{coordinate:z}=h.payload;if(O==null||h.payload.active===!1||z==null||c==null){n(Nx({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:K,y:L}=z,R=Math.min(K,c.x+c.width),ee=Math.min(L,c.y+c.height),J={x:a==="horizontal"?O.coordinate:R,y:a==="horizontal"?ee:O.coordinate},ne=Nx({active:h.payload.active,coordinate:J,dataKey:h.payload.dataKey,index:String(O.index),label:h.payload.label,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:h.payload.graphicalItemId});n(ne)}}};return pc.on(Cx,d),()=>{pc.off(Cx,d)}},[u,n,t,e,r,i,a,c])}function LY(){var e=Ee(wy),t=Ee(jy),n=St();b.useEffect(()=>{if(e==null)return Ao;var r=(i,a,c)=>{t!==c&&e===i&&n(OY(a))};return pc.on(i2,r),()=>{pc.off(i2,r)}},[n,t,e])}function $Y(){var e=St();b.useEffect(()=>{e(kY())},[e]),RY(),LY()}function zY(e,t,n,r,i,a){var c=Ee(v=>qG(v,e,t)),u=Ee(jy),d=Ee(wy),p=Ee(XT),h=Ee(PY),m=h==null?void 0:h.active,g=rp();b.useEffect(()=>{if(!m&&d!=null&&u!=null){var v=Nx({active:a,coordinate:n,dataKey:c,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:g,graphicalItemId:void 0});pc.emit(Cx,d,v,u)}},[m,n,c,i,r,u,d,p,a,g])}function o2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function l2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o2(Object(n),!0).forEach(function(r){FY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FY(e,t,n){return(t=BY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function BY(e){var t=VY(e,"string");return typeof t=="symbol"?t:t+""}function VY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function UY(e){return e.dataKey}function WY(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(P9,t)}var c2=[],qY={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function KY(e){var t,n,r=dr(e,qY),{active:i,allowEscapeViewBox:a,animationDuration:c,animationEasing:u,content:d,filterNull:p,isAnimationActive:h,offset:m,payloadUniqBy:g,position:v,reverseDirection:w,useTranslate3d:S,wrapperStyle:j,cursor:k,shared:C,trigger:E,defaultIndex:A,portal:P,axisId:O}=r,M=St(),I=typeof A=="number"?String(A):A;b.useEffect(()=>{M(BH({shared:C,trigger:E,axisId:O,active:i,defaultIndex:I}))},[M,C,E,O,i,I]);var z=rp(),K=WE(),L=DH(C),{activeIndex:R,isActive:ee}=(t=Ee(pe=>GG(pe,L,E,I)))!==null&&t!==void 0?t:{},J=Ee(pe=>HG(pe,L,E,I)),ne=Ee(pe=>uM(pe,L,E,I)),re=Ee(pe=>KG(pe,L,E,I)),U=J,B=vY(),G=(n=i??ee)!==null&&n!==void 0?n:!1,[q,_]=o8([U,G]),V=L==="axis"?ne:void 0;zY(L,E,re,V,R,G);var ie=P??B;if(ie==null||z==null||L==null)return null;var ue=U??c2;G||(ue=c2),p&&ue.length&&(ue=_7(ue.filter(pe=>pe.value!=null&&(pe.hide!==!0||r.includeHidden)),g,UY));var te=ue.length>0,se=b.createElement(_9,{allowEscapeViewBox:a,animationDuration:c,animationEasing:u,isAnimationActive:h,active:G,coordinate:re,hasPayload:te,offset:m,position:v,reverseDirection:w,useTranslate3d:S,viewBox:z,wrapperStyle:j,lastBoundingBox:q,innerRef:_,hasPortalFromProps:!!P},WY(d,l2(l2({},r),{},{payload:ue,label:V,active:G,activeIndex:R,coordinate:re,accessibilityLayer:K})));return b.createElement(b.Fragment,null,bA.createPortal(se,ie),G&&b.createElement(xY,{cursor:k,tooltipEventType:L,coordinate:re,payload:ue,index:R}))}var mM=e=>null;mM.displayName="Cell";function HY(e,t,n){return(t=GY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GY(e){var t=YY(e,"string");return typeof t=="symbol"?t:t+""}function YY(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class XY{constructor(t){HY(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function u2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function QY(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u2(Object(n),!0).forEach(function(r){JY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JY(e,t,n){return(t=ZY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZY(e){var t=eX(e,"string");return typeof t=="symbol"?t:t+""}function eX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var tX={cacheSize:2e3,enableCache:!0},gM=QY({},tX),d2=new XY(gM.cacheSize),nX={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},f2="recharts_measurement_span";function rX(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",c=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(c,"|").concat(u)}var p2=(e,t)=>{try{var n=document.getElementById(f2);n||(n=document.createElement("span"),n.setAttribute("id",f2),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,nX,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Wl=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||op.isSsr)return{width:0,height:0};if(!gM.enableCache)return p2(t,n);var r=rX(t,n),i=d2.get(r);if(i)return i;var a=p2(t,n);return d2.set(r,a),a},xM;function iX(e,t,n){return(t=sX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sX(e){var t=aX(e,"string");return typeof t=="symbol"?t:t+""}function aX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var h2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,m2=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,oX=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,lX=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,cX={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},uX=["cm","mm","pt","pc","in","Q","px"];function dX(e){return uX.includes(e)}var ro="NaN";function fX(e,t){return e*cX[t]}class Qt{static parse(t){var n,[,r,i]=(n=lX.exec(t))!==null&&n!==void 0?n:[];return r==null?Qt.NaN:new Qt(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Yr(t)&&(this.unit=""),n!==""&&!oX.test(n)&&(this.num=NaN,this.unit=""),dX(n)&&(this.num=fX(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Qt(NaN,""):new Qt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Qt(NaN,""):new Qt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Qt(NaN,""):new Qt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Qt(NaN,""):new Qt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Yr(this.num)}}xM=Qt;iX(Qt,"NaN",new xM(NaN,""));function vM(e){if(e==null||e.includes(ro))return ro;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=h2.exec(t))!==null&&n!==void 0?n:[],c=Qt.parse(r??""),u=Qt.parse(a??""),d=i==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return ro;t=t.replace(h2,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,[,h,m,g]=(p=m2.exec(t))!==null&&p!==void 0?p:[],v=Qt.parse(h??""),w=Qt.parse(g??""),S=m==="+"?v.add(w):v.subtract(w);if(S.isNaN())return ro;t=t.replace(m2,S.toString())}return t}var g2=/\(([^()]*)\)/;function pX(e){for(var t=e,n;(n=g2.exec(t))!=null;){var[,r]=n;t=t.replace(g2,vM(r))}return t}function hX(e){var t=e.replace(/\s+/g,"");return t=pX(t),t=vM(t),t}function mX(e){try{return hX(e)}catch{return ro}}function tg(e){var t=mX(e.slice(5,-1));return t===ro?"":t}var gX=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],xX=["dx","dy","angle","className","breakAll"];function Ox(){return Ox=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ox.apply(null,arguments)}function x2(e,t){if(e==null)return{};var n,r,i=vX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function vX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var yM=/[ \f\n\r\t\v\u2028\u2029]+/,bM=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Vt(t)||(n?i=t.toString().split(""):i=t.toString().split(yM));var a=i.map(u=>({word:u,width:Wl(u,r).width})),c=n?0:Wl(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:c}}catch{return null}};function yX(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var wM=(e,t,n,r)=>e.reduce((i,a)=>{var{word:c,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(c),d.width+=u+n;else{var p={words:[c],width:u};i.push(p)}return i},[]),jM=e=>e.reduce((t,n)=>t.width>n.width?t:n),bX="…",v2=(e,t,n,r,i,a,c,u)=>{var d=e.slice(0,t),p=bM({breakAll:n,style:r,children:d+bX});if(!p)return[!1,[]];var h=wM(p.wordsWithComputedWidth,a,c,u),m=h.length>i||jM(h).width>Number(a);return[m,h]},wX=(e,t,n,r,i)=>{var{maxLines:a,children:c,style:u,breakAll:d}=e,p=ke(a),h=String(c),m=wM(t,r,n,i);if(!p||i)return m;var g=m.length>a||jM(m).width>Number(r);if(!g)return m;for(var v=0,w=h.length-1,S=0,j;v<=w&&S<=h.length-1;){var k=Math.floor((v+w)/2),C=k-1,[E,A]=v2(h,C,d,u,a,r,n,i),[P]=v2(h,k,d,u,a,r,n,i);if(!E&&!P&&(v=k+1),E&&P&&(w=k-1),!E&&P){j=A;break}S++}return j||m},y2=e=>{var t=Vt(e)?[]:e.toString().split(yM);return[{words:t,width:void 0}]},jX=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:c}=e;if((t||n)&&!op.isSsr){var u,d,p=bM({breakAll:a,children:r,style:i});if(p){var{wordsWithComputedWidth:h,spaceWidth:m}=p;u=h,d=m}else return y2(r);return wX({breakAll:a,children:r,maxLines:c,style:i},u,d,t,!!n)}return y2(r)},SM="#808080",SX={angle:0,breakAll:!1,capHeight:"0.71em",fill:SM,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Hy=b.forwardRef((e,t)=>{var n=dr(e,SX),{x:r,y:i,lineHeight:a,capHeight:c,fill:u,scaleToFit:d,textAnchor:p,verticalAnchor:h}=n,m=x2(n,gX),g=b.useMemo(()=>jX({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:d,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,d,m.style,m.width]),{dx:v,dy:w,angle:S,className:j,breakAll:k}=m,C=x2(m,xX);if(!Xr(r)||!Xr(i)||g.length===0)return null;var E=Number(r)+(ke(v)?v:0),A=Number(i)+(ke(w)?w:0);if(!We(E)||!We(A))return null;var P;switch(h){case"start":P=tg("calc(".concat(c,")"));break;case"middle":P=tg("calc(".concat((g.length-1)/2," * -").concat(a," + (").concat(c," / 2))"));break;default:P=tg("calc(".concat(g.length-1," * -").concat(a,")"));break}var O=[],M=g[0];if(d&&M!=null){var I=M.width,{width:z}=m;O.push("scale(".concat(ke(z)&&ke(I)?z/I:1,")"))}return S&&O.push("rotate(".concat(S,", ").concat(E,", ").concat(A,")")),O.length&&(C.transform=O.join(" ")),b.createElement("text",Ox({},lr(C),{ref:t,x:E,y:A,className:rt("recharts-text",j),textAnchor:p,fill:u.includes("url")?SM:u}),g.map((K,L)=>{var R=K.words.join(k?"":" ");return b.createElement("tspan",{x:E,dy:L===0?P:a,key:"".concat(R,"-").concat(L)},R)}))});Hy.displayName="Text";function b2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Br(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b2(Object(n),!0).forEach(function(r){NX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NX(e,t,n){return(t=kX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kX(e){var t=PX(e,"string");return typeof t=="symbol"?t:t+""}function PX(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CX=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:c,height:u,upperWidth:d,lowerWidth:p}=Wv(t),h=a,m=a+(d-p)/2,g=(h+m)/2,v=(d+p)/2,w=h+d/2,S=u>=0?1:-1,j=S*r,k=S>0?"end":"start",C=S>0?"start":"end",E=d>=0?1:-1,A=E*r,P=E>0?"end":"start",O=E>0?"start":"end",M=i;if(n==="top"){var I={x:h+d/2,y:c-j,horizontalAnchor:"middle",verticalAnchor:k};return M&&(I.height=Math.max(c-M.y,0),I.width=d),I}if(n==="bottom"){var z={x:m+p/2,y:c+u+j,horizontalAnchor:"middle",verticalAnchor:C};return M&&(z.height=Math.max(M.y+M.height-(c+u),0),z.width=p),z}if(n==="left"){var K={x:g-A,y:c+u/2,horizontalAnchor:P,verticalAnchor:"middle"};return M&&(K.width=Math.max(K.x-M.x,0),K.height=u),K}if(n==="right"){var L={x:g+v+A,y:c+u/2,horizontalAnchor:O,verticalAnchor:"middle"};return M&&(L.width=Math.max(M.x+M.width-L.x,0),L.height=u),L}var R=M?{width:v,height:u}:{};return n==="insideLeft"?Br({x:g+A,y:c+u/2,horizontalAnchor:O,verticalAnchor:"middle"},R):n==="insideRight"?Br({x:g+v-A,y:c+u/2,horizontalAnchor:P,verticalAnchor:"middle"},R):n==="insideTop"?Br({x:h+d/2,y:c+j,horizontalAnchor:"middle",verticalAnchor:C},R):n==="insideBottom"?Br({x:m+p/2,y:c+u-j,horizontalAnchor:"middle",verticalAnchor:k},R):n==="insideTopLeft"?Br({x:h+A,y:c+j,horizontalAnchor:O,verticalAnchor:C},R):n==="insideTopRight"?Br({x:h+d-A,y:c+j,horizontalAnchor:P,verticalAnchor:C},R):n==="insideBottomLeft"?Br({x:m+A,y:c+u-j,horizontalAnchor:O,verticalAnchor:k},R):n==="insideBottomRight"?Br({x:m+p-A,y:c+u-j,horizontalAnchor:P,verticalAnchor:k},R):n&&typeof n=="object"&&(ke(n.x)||ia(n.x))&&(ke(n.y)||ia(n.y))?Br({x:a+Er(n.x,v),y:c+Er(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},R):Br({x:w,y:c+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},R)},OX=["labelRef"],AX=["content"];function w2(e,t){if(e==null)return{};var n,r,i=EX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function EX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function j2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function $l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j2(Object(n),!0).forEach(function(r){TX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TX(e,t,n){return(t=MX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MX(e){var t=_X(e,"string");return typeof t=="symbol"?t:t+""}function _X(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function di(){return di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},di.apply(null,arguments)}var NM=b.createContext(null),IX=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:c,children:u}=e,d=b.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:c}),[t,n,r,i,a,c]);return b.createElement(NM.Provider,{value:d},u)},kM=()=>{var e=b.useContext(NM),t=rp();return e||(t?Wv(t):void 0)},DX=b.createContext(null),RX=()=>{var e=b.useContext(DX),t=Ee(t5);return e||t},LX=e=>{var{value:t,formatter:n}=e,r=Vt(e.children)?t:e.children;return typeof n=="function"?n(r):r},Gy=e=>e!=null&&typeof e=="function",$X=(e,t)=>{var n=$n(t-e),r=Math.min(Math.abs(t-e),360);return n*r},zX=(e,t,n,r,i)=>{var{offset:a,className:c}=e,{cx:u,cy:d,innerRadius:p,outerRadius:h,startAngle:m,endAngle:g,clockWise:v}=i,w=(p+h)/2,S=$X(m,g),j=S>=0?1:-1,k,C;switch(t){case"insideStart":k=m+j*a,C=v;break;case"insideEnd":k=g-j*a,C=!v;break;case"end":k=g+j*a,C=v;break;default:throw new Error("Unsupported position ".concat(t))}C=S<=0?C:!C;var E=Zt(u,d,w,k),A=Zt(u,d,w,k+(C?1:-1)*359),P="M".concat(E.x,",").concat(E.y,`
|
|
364
|
+
A`).concat(w,",").concat(w,",0,1,").concat(C?0:1,`,
|
|
365
|
+
`).concat(A.x,",").concat(A.y),O=Vt(e.id)?ec("recharts-radial-line-"):e.id;return b.createElement("text",di({},r,{dominantBaseline:"central",className:rt("recharts-radial-bar-label",c)}),b.createElement("defs",null,b.createElement("path",{id:O,d:P})),b.createElement("textPath",{xlinkHref:"#".concat(O)},n))},FX=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:c,startAngle:u,endAngle:d}=e,p=(u+d)/2;if(n==="outside"){var{x:h,y:m}=Zt(r,i,c+t,p);return{x:h,y:m,textAnchor:h>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var g=(a+c)/2,{x:v,y:w}=Zt(r,i,g,p);return{x:v,y:w,textAnchor:"middle",verticalAnchor:"middle"}},Nd=e=>e!=null&&"cx"in e&&ke(e.cx),BX={angle:0,offset:5,zIndex:Cn.label,position:"middle",textBreakAll:!1};function VX(e){if(!Nd(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function as(e){var t=dr(e,BX),{viewBox:n,parentViewBox:r,position:i,value:a,children:c,content:u,className:d="",textBreakAll:p,labelRef:h}=t,m=RX(),g=kM(),v=i==="center"?g:m??g,w,S,j;n==null?w=v:Nd(n)?w=n:w=Wv(n);var k=VX(w);if(!w||Vt(a)&&Vt(c)&&!b.isValidElement(u)&&typeof u!="function")return null;var C=$l($l({},t),{},{viewBox:w});if(b.isValidElement(u)){var{labelRef:E}=C,A=w2(C,OX);return b.cloneElement(u,A)}if(typeof u=="function"){var{content:P}=C,O=w2(C,AX);if(S=b.createElement(u,O),b.isValidElement(S))return S}else S=LX(t);var M=lr(t);if(Nd(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return zX(t,i,S,M,w);j=FX(w,t.offset,t.position)}else{if(!k)return null;var I=CX({viewBox:k,position:i,offset:t.offset,parentViewBox:Nd(r)?void 0:r});j=$l($l({x:I.x,y:I.y,textAnchor:I.horizontalAnchor,verticalAnchor:I.verticalAnchor},I.width!==void 0?{width:I.width}:{}),I.height!==void 0?{height:I.height}:{})}return b.createElement(ws,{zIndex:t.zIndex},b.createElement(Hy,di({ref:h,className:rt("recharts-label",d)},M,j,{textAnchor:yX(M.textAnchor)?M.textAnchor:j.textAnchor,breakAll:p}),S))}as.displayName="Label";var UX=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(as,di({key:"label-implicit"},r)):Xr(e)?b.createElement(as,di({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===as?b.cloneElement(e,$l({key:"label-implicit"},r)):b.createElement(as,di({key:"label-implicit",content:e},r)):Gy(e)?b.createElement(as,di({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(as,di({},e,{key:"label-implicit"},r)):null};function WX(e){var{label:t,labelRef:n}=e,r=kM();return UX(t,r,n)||null}var ng={},rg={},S2;function qX(){return S2||(S2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(rg)),rg}var ig={},N2;function KX(){return N2||(N2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(ig)),ig}var k2;function HX(){return k2||(k2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qX(),n=KX(),r=_v();function i(a){if(r.isArrayLike(a))return t.last(n.toArray(a))}e.last=i})(ng)),ng}var sg,P2;function GX(){return P2||(P2=1,sg=HX().last),sg}var YX=GX();const XX=Jr(YX);var QX=["valueAccessor"],JX=["dataKey","clockWise","id","textBreakAll","zIndex"];function Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sf.apply(null,arguments)}function C2(e,t){if(e==null)return{};var n,r,i=ZX(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZX(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var eQ=e=>Array.isArray(e.value)?XX(e.value):e.value,PM=b.createContext(void 0),tQ=PM.Provider,CM=b.createContext(void 0);CM.Provider;function nQ(){return b.useContext(PM)}function rQ(){return b.useContext(CM)}function kd(e){var{valueAccessor:t=eQ}=e,n=C2(e,QX),{dataKey:r,clockWise:i,id:a,textBreakAll:c,zIndex:u}=n,d=C2(n,JX),p=nQ(),h=rQ(),m=p||h;return!m||!m.length?null:b.createElement(ws,{zIndex:u??Cn.label},b.createElement(vi,{className:"recharts-label-list"},m.map((g,v)=>{var w,S=Vt(r)?t(g,v):en(g.payload,r),j=Vt(a)?{}:{id:"".concat(a,"-").concat(v)};return b.createElement(as,Sf({key:"label-".concat(v)},lr(g),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:g.fill,parentViewBox:g.parentViewBox,value:S,textBreakAll:c,viewBox:g.viewBox,index:v,zIndex:0}))})))}kd.displayName="LabelList";function iQ(e){var{label:t}=e;return t?t===!0?b.createElement(kd,{key:"labelList-implicit"}):b.isValidElement(t)||Gy(t)?b.createElement(kd,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(kd,Sf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var sQ={radiusAxis:{},angleAxis:{}},OM=An({name:"polarAxis",initialState:sQ,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:$te,removeRadiusAxis:zte,addAngleAxis:Fte,removeAngleAxis:Bte}=OM.actions,aQ=OM.reducer;function oQ(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var ag={exports:{}},qe={};/** @license React v16.13.1
|
|
366
|
+
* react-is.production.min.js
|
|
367
|
+
*
|
|
368
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the MIT license found in the
|
|
371
|
+
* LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/var O2;function lQ(){if(O2)return qe;O2=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,u=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,p=e?Symbol.for("react.concurrent_mode"):60111,h=e?Symbol.for("react.forward_ref"):60112,m=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,v=e?Symbol.for("react.memo"):60115,w=e?Symbol.for("react.lazy"):60116,S=e?Symbol.for("react.block"):60121,j=e?Symbol.for("react.fundamental"):60117,k=e?Symbol.for("react.responder"):60118,C=e?Symbol.for("react.scope"):60119;function E(P){if(typeof P=="object"&&P!==null){var O=P.$$typeof;switch(O){case t:switch(P=P.type,P){case d:case p:case r:case a:case i:case m:return P;default:switch(P=P&&P.$$typeof,P){case u:case h:case w:case v:case c:return P;default:return O}}case n:return O}}}function A(P){return E(P)===p}return qe.AsyncMode=d,qe.ConcurrentMode=p,qe.ContextConsumer=u,qe.ContextProvider=c,qe.Element=t,qe.ForwardRef=h,qe.Fragment=r,qe.Lazy=w,qe.Memo=v,qe.Portal=n,qe.Profiler=a,qe.StrictMode=i,qe.Suspense=m,qe.isAsyncMode=function(P){return A(P)||E(P)===d},qe.isConcurrentMode=A,qe.isContextConsumer=function(P){return E(P)===u},qe.isContextProvider=function(P){return E(P)===c},qe.isElement=function(P){return typeof P=="object"&&P!==null&&P.$$typeof===t},qe.isForwardRef=function(P){return E(P)===h},qe.isFragment=function(P){return E(P)===r},qe.isLazy=function(P){return E(P)===w},qe.isMemo=function(P){return E(P)===v},qe.isPortal=function(P){return E(P)===n},qe.isProfiler=function(P){return E(P)===a},qe.isStrictMode=function(P){return E(P)===i},qe.isSuspense=function(P){return E(P)===m},qe.isValidElementType=function(P){return typeof P=="string"||typeof P=="function"||P===r||P===p||P===a||P===i||P===m||P===g||typeof P=="object"&&P!==null&&(P.$$typeof===w||P.$$typeof===v||P.$$typeof===c||P.$$typeof===u||P.$$typeof===h||P.$$typeof===j||P.$$typeof===k||P.$$typeof===C||P.$$typeof===S)},qe.typeOf=E,qe}var A2;function cQ(){return A2||(A2=1,ag.exports=lQ()),ag.exports}var uQ=cQ(),E2=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",T2=null,og=null,AM=e=>{if(e===T2&&Array.isArray(og))return og;var t=[];return b.Children.forEach(e,n=>{Vt(n)||(uQ.isFragment(n)?t=t.concat(AM(n.props.children)):t.push(n))}),og=t,T2=e,t};function dQ(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>E2(i)):r=[E2(t)],AM(e).forEach(i=>{var a=mo(i,"type.displayName")||mo(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var lg={},M2;function fQ(){return M2||(M2=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var i;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const a=n[Symbol.toStringTag];return a==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${a}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(lg)),lg}var cg,_2;function pQ(){return _2||(_2=1,cg=fQ().isPlainObject),cg}var hQ=pQ();const mQ=Jr(hQ);var I2,D2,R2,L2,$2;function z2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function F2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z2(Object(n),!0).forEach(function(r){gQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gQ(e,t,n){return(t=xQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xQ(e){var t=vQ(e,"string");return typeof t=="symbol"?t:t+""}function vQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nf(){return Nf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nf.apply(null,arguments)}function Ml(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var B2=(e,t,n,r,i)=>{var a=n-r,c;return c=vt(I2||(I2=Ml(["M ",",",""])),e,t),c+=vt(D2||(D2=Ml(["L ",",",""])),e+n,t),c+=vt(R2||(R2=Ml(["L ",",",""])),e+n-a/2,t+i),c+=vt(L2||(L2=Ml(["L ",",",""])),e+n-a/2-r,t+i),c+=vt($2||($2=Ml(["L ",","," Z"])),e,t),c},yQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bQ=e=>{var t=dr(e,yQ),{x:n,y:r,upperWidth:i,lowerWidth:a,height:c,className:u}=t,{animationEasing:d,animationDuration:p,animationBegin:h,isUpdateAnimationActive:m}=t,g=b.useRef(null),[v,w]=b.useState(-1),S=b.useRef(i),j=b.useRef(a),k=b.useRef(c),C=b.useRef(n),E=b.useRef(r),A=Gv(e,"trapezoid-");if(b.useEffect(()=>{if(g.current&&g.current.getTotalLength)try{var J=g.current.getTotalLength();J&&w(J)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||c!==+c||i===0&&a===0||c===0)return null;var P=rt("recharts-trapezoid",u);if(!m)return b.createElement("g",null,b.createElement("path",Nf({},lr(t),{className:P,d:B2(n,r,i,a,c)})));var O=S.current,M=j.current,I=k.current,z=C.current,K=E.current,L="0px ".concat(v===-1?1:v,"px"),R="".concat(v,"px 0px"),ee=KE(["strokeDasharray"],p,d);return b.createElement(Hv,{animationId:A,key:A,canBegin:v>0,duration:p,easing:d,isActive:m,begin:h},J=>{var ne=Jt(O,i,J),re=Jt(M,a,J),U=Jt(I,c,J),B=Jt(z,n,J),G=Jt(K,r,J);g.current&&(S.current=ne,j.current=re,k.current=U,C.current=B,E.current=G);var q=J>0?{transition:ee,strokeDasharray:R}:{strokeDasharray:L};return b.createElement("path",Nf({},lr(t),{className:P,d:B2(B,G,ne,re,U),ref:g,style:F2(F2({},q),t.style)}))})},wQ=["option","shapeType","activeClassName"];function jQ(e,t){if(e==null)return{};var n,r,i=SQ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function SQ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function V2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V2(Object(n),!0).forEach(function(r){NQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NQ(e,t,n){return(t=kQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kQ(e){var t=PQ(e,"string");return typeof t=="symbol"?t:t+""}function PQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function CQ(e,t){return kf(kf({},t),e)}function OQ(e,t){return e==="symbols"}function U2(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return b.createElement(XE,n);case"trapezoid":return b.createElement(bQ,n);case"sector":return b.createElement(ZE,n);case"symbols":if(OQ(t))return b.createElement(FA,n);break;case"curve":return b.createElement(qE,n);default:return null}}function AQ(e){return b.isValidElement(e)?e.props:e}function EQ(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape"}=e,i=jQ(e,wQ),a;if(b.isValidElement(t))a=b.cloneElement(t,kf(kf({},i),AQ(t)));else if(typeof t=="function")a=t(i,i.index);else if(mQ(t)&&typeof t!="boolean"){var c=CQ(t,i);a=b.createElement(U2,{shapeType:n,elementProps:c})}else{var u=i;a=b.createElement(U2,{shapeType:n,elementProps:u})}return i.isActive?b.createElement(vi,{className:r},a):a}var EM=(e,t,n)=>{var r=St();return(i,a)=>c=>{e==null||e(i,a,c),r(W5({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},TM=e=>{var t=St();return(n,r)=>i=>{e==null||e(n,r,i),t(VH())}},MM=(e,t,n)=>{var r=St();return(i,a)=>c=>{e==null||e(i,a,c),r(UH({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function TQ(e){var{tooltipEntrySettings:t}=e,n=St(),r=Wn(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n($H(t)):i.current!==t&&n(zH({prev:i.current,next:t})),i.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{i.current&&(n(FH(i.current)),i.current=null)},[n]),null}function MQ(e){var{legendPayload:t}=e,n=St(),r=Wn(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(v9(t)):i.current!==t&&n(y9({prev:i.current,next:t})),i.current=t)},[n,r,t]),b.useLayoutEffect(()=>()=>{i.current&&(n(b9(i.current)),i.current=null)},[n]),null}var ug,_Q=()=>{var[e]=b.useState(()=>ec("uid-"));return e},IQ=(ug=e3.useId)!==null&&ug!==void 0?ug:_Q;function DQ(e,t){var n=IQ();return t||(e?"".concat(e,"-").concat(n):n)}var RQ=b.createContext(void 0),LQ=e=>{var{id:t,type:n,children:r}=e,i=DQ("recharts-".concat(n),t);return b.createElement(RQ.Provider,{value:i},r(i))},$Q={cartesianItems:[],polarItems:[]},_M=An({name:"graphicalItems",initialState:$Q,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:ut()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Ar(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:ut()},removeCartesianGraphicalItem:{reducer(e,t){var n=Ar(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:ut()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:ut()},removePolarGraphicalItem:{reducer(e,t){var n=Ar(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:ut()}}}),{addCartesianGraphicalItem:zQ,replaceCartesianGraphicalItem:FQ,removeCartesianGraphicalItem:BQ,addPolarGraphicalItem:Vte,removePolarGraphicalItem:Ute}=_M.actions,VQ=_M.reducer,UQ=e=>{var t=St(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(zQ(e)):n.current!==e&&t(FQ({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(BQ(n.current)),n.current=null)},[t]),null},WQ=b.memo(UQ);function W2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function q2(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W2(Object(n),!0).forEach(function(r){qQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qQ(e,t,n){return(t=KQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KQ(e){var t=HQ(e,"string");return typeof t=="symbol"?t:t+""}function HQ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var IM=0,GQ={xAxis:{},yAxis:{},zAxis:{}},DM=An({name:"cartesianAxis",initialState:GQ,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:ut()},replaceXAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.xAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.xAxis[n.id],e.xAxis[r.id]=r)},prepare:ut()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:ut()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:ut()},replaceYAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.yAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.yAxis[n.id],e.yAxis[r.id]=r)},prepare:ut()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:ut()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:ut()},replaceZAxis:{reducer(e,t){var{prev:n,next:r}=t.payload;e.zAxis[n.id]!==void 0&&(n.id!==r.id&&delete e.zAxis[n.id],e.zAxis[r.id]=r)},prepare:ut()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:ut()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,c=i.widthHistory||[];if(c.length===3&&c[0]===c[2]&&r===c[1]&&r!==i.width&&Math.abs(r-((a=c[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...c,r].slice(-3);e.yAxis[n]=q2(q2({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:YQ,replaceXAxis:XQ,removeXAxis:QQ,addYAxis:JQ,replaceYAxis:ZQ,removeYAxis:eJ,addZAxis:Wte,replaceZAxis:qte,removeZAxis:Kte,updateYAxisWidth:tJ}=DM.actions,nJ=DM.reducer,rJ=Z([Ut],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),iJ=Z([rJ,Pi,Ci],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),RM=()=>Ee(iJ),K2=(e,t,n)=>{var r=n??e;if(!Vt(r))return Er(r,t,0)},sJ=(e,t,n)=>{var r={},i=e.filter(yp),a=e.filter(p=>p.stackId==null),c=i.reduce((p,h)=>{var m=p[h.stackId];return m==null&&(m=[]),m.push(h),p[h.stackId]=m,p},r),u=Object.entries(c).map(p=>{var h,[m,g]=p,v=g.map(S=>S.dataKey),w=K2(t,n,(h=g[0])===null||h===void 0?void 0:h.barSize);return{stackId:m,dataKeys:v,barSize:w}}),d=a.map(p=>{var h=[p.dataKey].filter(g=>g!=null),m=K2(t,n,p.barSize);return{stackId:void 0,dataKeys:h,barSize:m}});return[...u,...d]};function H2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H2(Object(n),!0).forEach(function(r){aJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aJ(e,t,n){return(t=oJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oJ(e){var t=lJ(e,"string");return typeof t=="symbol"?t:t+""}function lJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cJ(e,t,n,r,i){var a,c=r.length;if(!(c<1)){var u=Er(e,n,0,!0),d,p=[];if(We((a=r[0])===null||a===void 0?void 0:a.barSize)){var h=!1,m=n/c,g=r.reduce((C,E)=>C+(E.barSize||0),0);g+=(c-1)*u,g>=n&&(g-=(c-1)*u,u=0),g>=n&&m>0&&(h=!0,m*=.9,g=c*m);var v=(n-g)/2>>0,w={offset:v-u,size:0};d=r.reduce((C,E)=>{var A,P={stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:w.offset+w.size+u,size:h?m:(A=E.barSize)!==null&&A!==void 0?A:0}},O=[...C,P];return w=P.position,O},p)}else{var S=Er(t,n,0,!0);n-2*S-(c-1)*u<=0&&(u=0);var j=(n-2*S-(c-1)*u)/c;j>1&&(j>>=0);var k=We(i)?Math.min(j,i):j;d=r.reduce((C,E,A)=>[...C,{stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:S+(j+u)*A+(j-k)/2,size:k}}],p)}return d}}var uJ=(e,t,n,r,i,a,c)=>{var u=Vt(c)?t:c,d=cJ(n,r,i!==a?i:a,e,u);return i!==a&&d!=null&&(d=d.map(p=>pd(pd({},p),{},{position:pd(pd({},p.position),{},{offset:p.position.offset-i/2})}))),d},dJ=(e,t)=>{var n=Py(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var i=e[r];if(i){var{stackedData:a}=i;if(a)return a.find(c=>c.key===n)}}}},fJ=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function pJ(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&We(e.zIndex)?e.zIndex:t}var hJ=e=>{var{chartData:t}=e,n=St(),r=Wn();return b.useEffect(()=>r?()=>{}:(n(s2(t)),()=>{n(s2(void 0))}),[t,n,r]),null},G2={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},LM=An({name:"brush",initialState:G2,reducers:{setBrushSettings(e,t){return t.payload==null?G2:t.payload}}}),{setBrushSettings:Hte}=LM.actions,mJ=LM.reducer;function gJ(e){return(e%180+180)%180}var xJ=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=gJ(i),c=a*Math.PI/180,u=Math.atan(r/n),d=c>u&&c<Math.PI-u?r/Math.sin(c):n/Math.cos(c);return Math.abs(d)},vJ={dots:[],areas:[],lines:[]},$M=An({name:"referenceElements",initialState:vJ,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Ar(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=Ar(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=Ar(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Gte,removeDot:Yte,addArea:Xte,removeArea:Qte,addLine:Jte,removeLine:Zte}=$M.actions,yJ=$M.reducer,bJ=b.createContext(void 0),wJ=e=>{var{children:t}=e,[n]=b.useState("".concat(ec("recharts"),"-clip")),r=RM();if(r==null)return null;var{x:i,y:a,width:c,height:u}=r;return b.createElement(bJ.Provider,{value:n},b.createElement("defs",null,b.createElement("clipPath",{id:n},b.createElement("rect",{x:i,y:a,height:u,width:c}))),t)};function zM(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;r<e.length;r+=t){var i=e[r];i!==void 0&&n.push(i)}return n}function jJ(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return xJ(r,n)}function SJ(e,t,n){var r=n==="width",{x:i,y:a,width:c,height:u}=e;return t===1?{start:r?i:a,end:r?i+c:a+u}:{start:r?i+c:a+u,end:r?i:a}}function hc(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function NJ(e,t){return zM(e,t+1)}function kJ(e,t,n,r,i){for(var a=(r||[]).slice(),{start:c,end:u}=t,d=0,p=1,h=c,m=function(){var w=r==null?void 0:r[d];if(w===void 0)return{v:zM(r,p)};var S=d,j,k=()=>(j===void 0&&(j=n(w,S)),j),C=w.coordinate,E=d===0||hc(e,C,k,h,u);E||(d=0,h=c,p+=1),E&&(h=C+e*(k()/2+i),d+=p)},g;p<=a.length;)if(g=m(),g)return g.v;return[]}function PJ(e,t,n,r,i){var a=(r||[]).slice(),c=a.length;if(c===0)return[];for(var{start:u,end:d}=t,p=1;p<=c;p++){for(var h=(c-1)%p,m=u,g=!0,v=function(){var A=r[S];if(A==null)return 0;var P=S,O,M=()=>(O===void 0&&(O=n(A,P)),O),I=A.coordinate,z=S===h||hc(e,I,M,m,d);if(!z)return g=!1,1;z&&(m=I+e*(M()/2+i))},w,S=h;S<c&&(w=v(),!(w!==0&&w===1));S+=p);if(g){for(var j=[],k=h;k<c;k+=p){var C=r[k];C!=null&&j.push(C)}return j}}return[]}function Y2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function on(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y2(Object(n),!0).forEach(function(r){CJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CJ(e,t,n){return(t=OJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OJ(e){var t=AJ(e,"string");return typeof t=="symbol"?t:t+""}function AJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function EJ(e,t,n,r,i){for(var a=(r||[]).slice(),c=a.length,{start:u}=t,{end:d}=t,p=function(g){var v=a[g];if(v==null)return 1;var w=v,S,j=()=>(S===void 0&&(S=n(v,g)),S);if(g===c-1){var k=e*(w.coordinate+e*j()/2-d);a[g]=w=on(on({},w),{},{tickCoord:k>0?w.coordinate-k*e:w.coordinate})}else a[g]=w=on(on({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var C=hc(e,w.tickCoord,j,u,d);C&&(d=w.tickCoord-e*(j()/2+i),a[g]=on(on({},w),{},{isShow:!0}))}},h=c-1;h>=0;h--)p(h);return a}function TJ(e,t,n,r,i,a){var c=(r||[]).slice(),u=c.length,{start:d,end:p}=t;if(a){var h=r[u-1];if(h!=null){var m=n(h,u-1),g=e*(h.coordinate+e*m/2-p);if(c[u-1]=h=on(on({},h),{},{tickCoord:g>0?h.coordinate-g*e:h.coordinate}),h.tickCoord!=null){var v=hc(e,h.tickCoord,()=>m,d,p);v&&(p=h.tickCoord-e*(m/2+i),c[u-1]=on(on({},h),{},{isShow:!0}))}}}for(var w=a?u-1:u,S=function(C){var E=c[C];if(E==null)return 1;var A=E,P,O=()=>(P===void 0&&(P=n(E,C)),P);if(C===0){var M=e*(A.coordinate-e*O()/2-d);c[C]=A=on(on({},A),{},{tickCoord:M<0?A.coordinate-M*e:A.coordinate})}else c[C]=A=on(on({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var I=hc(e,A.tickCoord,O,d,p);I&&(d=A.tickCoord+e*(O()/2+i),c[C]=on(on({},A),{},{isShow:!0}))}},j=0;j<w;j++)S(j);return c}function MJ(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:c,orientation:u,interval:d,tickFormatter:p,unit:h,angle:m}=e;if(!i||!i.length||!r)return[];if(ke(d)||op.isSsr){var g;return(g=NJ(i,ke(d)?d:0))!==null&&g!==void 0?g:[]}var v=[],w=u==="top"||u==="bottom"?"width":"height",S=h&&w==="width"?Wl(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(P,O)=>{var M=typeof p=="function"?p(P.value,O):P.value;return w==="width"?jJ(Wl(M,{fontSize:t,letterSpacing:n}),S,m):Wl(M,{fontSize:t,letterSpacing:n})[w]},k=i[0],C=i[1],E=i.length>=2&&k!=null&&C!=null?$n(C.coordinate-k.coordinate):1,A=SJ(a,E,w);return d==="equidistantPreserveStart"?kJ(E,A,j,i,c):d==="equidistantPreserveEnd"?PJ(E,A,j,i,c):(d==="preserveStart"||d==="preserveStartEnd"?v=TJ(E,A,j,i,c,d==="preserveStartEnd"):v=EJ(E,A,j,i,c),v.filter(P=>P.isShow))}var _J=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,c=0;if(t){Array.from(t).forEach(h=>{if(h){var m=h.getBoundingClientRect();m.width>c&&(c=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,p=c+d+u+(n?r:0);return Math.round(p)}return 0},IJ=["axisLine","width","height","className","hide","ticks","axisType"];function DJ(e,t){if(e==null)return{};var n,r,i=RJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function RJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ca.apply(null,arguments)}function X2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X2(Object(n),!0).forEach(function(r){LJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X2(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LJ(e,t,n){return(t=$J(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $J(e){var t=zJ(e,"string");return typeof t=="symbol"?t:t+""}function zJ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ta={x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd",zIndex:Cn.axis};function FJ(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:c,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var p=gt(gt(gt({},d),ms(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var h=+(a==="top"&&!c||a==="bottom"&&c);p=gt(gt({},p),{},{x1:t,y1:n+h*i,x2:t+r,y2:n+h*i})}else{var m=+(a==="left"&&!c||a==="right"&&c);p=gt(gt({},p),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return b.createElement("line",ca({},p,{className:rt("recharts-cartesian-axis-line",mo(u,"className"))}))}function BJ(e,t,n,r,i,a,c,u,d){var p,h,m,g,v,w,S=u?-1:1,j=e.tickSize||c,k=ke(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":p=h=e.coordinate,g=n+ +!u*i,m=g-S*j,w=m-S*d,v=k;break;case"left":m=g=e.coordinate,h=t+ +!u*r,p=h-S*j,v=p-S*d,w=k;break;case"right":m=g=e.coordinate,h=t+ +u*r,p=h+S*j,v=p+S*d,w=k;break;default:p=h=e.coordinate,g=n+ +u*i,m=g+S*j,w=m+S*d,v=k;break}return{line:{x1:p,y1:m,x2:h,y2:g},tick:{x:v,y:w}}}function VJ(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function UJ(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function WJ(e){var{option:t,tickProps:n,value:r}=e,i,a=rt(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))i=b.cloneElement(t,gt(gt({},n),{},{className:a}));else if(typeof t=="function")i=t(gt(gt({},n),{},{className:a}));else{var c="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(c=rt(c,oQ(t))),i=b.createElement(Hy,ca({},n,{className:c}),r)}return i}var qJ=b.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:c,unit:u,padding:d,tickTextProps:p,orientation:h,mirror:m,x:g,y:v,width:w,height:S,tickSize:j,tickMargin:k,fontSize:C,letterSpacing:E,getTicksConfig:A,events:P,axisType:O}=e,M=MJ(gt(gt({},A),{},{ticks:n}),C,E),I=VJ(h,m),z=UJ(h,m),K=ms(A),L=kv(r),R={};typeof i=="object"&&(R=i);var ee=gt(gt({},K),{},{fill:"none"},R),J=M.map(U=>gt({entry:U},BJ(U,g,v,w,S,h,j,m,k))),ne=J.map(U=>{var{entry:B,line:G}=U;return b.createElement(vi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(B.value,"-").concat(B.coordinate,"-").concat(B.tickCoord)},i&&b.createElement("line",ca({},ee,G,{className:rt("recharts-cartesian-axis-tick-line",mo(i,"className"))})))}),re=J.map((U,B)=>{var G,q,{entry:_,tick:V}=U,ie=gt(gt(gt(gt({verticalAnchor:z},K),{},{textAnchor:I,stroke:"none",fill:a},V),{},{index:B,payload:_,visibleTicksCount:M.length,tickFormatter:c,padding:d},p),{},{angle:(G=(q=p==null?void 0:p.angle)!==null&&q!==void 0?q:K.angle)!==null&&G!==void 0?G:0}),ue=gt(gt({},ie),L);return b.createElement(vi,ca({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(_.value,"-").concat(_.coordinate,"-").concat(_.tickCoord)},Mv(P,_,B)),r&&b.createElement(WJ,{option:r,tickProps:ue,value:"".concat(typeof c=="function"?c(_.value,B):_.value).concat(u||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(O,"-ticks")},re.length>0&&b.createElement(ws,{zIndex:Cn.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(O,"-tick-labels"),ref:t},re)),ne.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(O,"-tick-lines")},ne))}),KJ=b.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:c,ticks:u,axisType:d}=e,p=DJ(e,IJ),[h,m]=b.useState(""),[g,v]=b.useState(""),w=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return _J({ticks:w.current,label:(j=e.labelRef)===null||j===void 0?void 0:j.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var S=b.useCallback(j=>{if(j){var k=j.getElementsByClassName("recharts-cartesian-axis-tick-value");w.current=k;var C=k[0];if(C){var E=window.getComputedStyle(C),A=E.fontSize,P=E.letterSpacing;(A!==h||P!==g)&&(m(A),v(P))}}},[h,g]);return c||r!=null&&r<=0||i!=null&&i<=0?null:b.createElement(ws,{zIndex:e.zIndex},b.createElement(vi,{className:rt("recharts-cartesian-axis",a)},b.createElement(FJ,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:ms(e)}),b.createElement(qJ,{ref:S,axisType:d,events:p,fontSize:h,getTicksConfig:e,height:e.height,letterSpacing:g,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y}),b.createElement(IX,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(WX,{label:e.label,labelRef:e.labelRef}),e.children)))}),Yy=b.forwardRef((e,t)=>{var n=dr(e,ta);return b.createElement(KJ,ca({},n,{ref:t}))});Yy.displayName="CartesianAxis";var HJ={},FM=An({name:"errorBars",initialState:HJ,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:ene,replaceErrorBar:tne,removeErrorBar:nne}=FM.actions,GJ=FM.reducer,YJ=["children"];function XJ(e,t){if(e==null)return{};var n,r,i=QJ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function QJ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var JJ={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},ZJ=b.createContext(JJ);function eZ(e){var{children:t}=e,n=XJ(e,YJ);return b.createElement(ZJ.Provider,{value:n},t)}function BM(e,t){var n,r,i=Ee(p=>Ei(p,e)),a=Ee(p=>Ti(p,t)),c=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:zt.allowDataOverflow,u=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:Ft.allowDataOverflow,d=c||u;return{needClip:d,needClipX:c,needClipY:u}}function tZ(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=RM(),{needClipX:a,needClipY:c,needClip:u}=BM(t,n);if(!u||!i)return null;var{x:d,y:p,width:h,height:m}=i;return b.createElement("clipPath",{id:"clipPath-".concat(r)},b.createElement("rect",{x:a?d:d-h/2,y:c?p:p-m/2,width:a?h:h*2,height:c?m:m*2}))}var dg={exports:{}},fg={};/**
|
|
373
|
+
* @license React
|
|
374
|
+
* use-sync-external-store-with-selector.production.js
|
|
375
|
+
*
|
|
376
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
377
|
+
*
|
|
378
|
+
* This source code is licensed under the MIT license found in the
|
|
379
|
+
* LICENSE file in the root directory of this source tree.
|
|
380
|
+
*/var Q2;function nZ(){if(Q2)return fg;Q2=1;var e=No();function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,c=e.useMemo,u=e.useDebugValue;return fg.useSyncExternalStoreWithSelector=function(d,p,h,m,g){var v=i(null);if(v.current===null){var w={hasValue:!1,value:null};v.current=w}else w=v.current;v=c(function(){function j(P){if(!k){if(k=!0,C=P,P=m(P),g!==void 0&&w.hasValue){var O=w.value;if(g(O,P))return E=O}return E=P}if(O=E,n(C,P))return O;var M=m(P);return g!==void 0&&g(O,M)?(C=P,O):(C=P,E=M)}var k=!1,C,E,A=h===void 0?null:h;return[function(){return j(p())},A===null?void 0:function(){return j(A())}]},[p,h,m,g]);var S=r(d,v[0],v[1]);return a(function(){w.hasValue=!0,w.value=S},[S]),u(S),S},fg}var J2;function rZ(){return J2||(J2=1,dg.exports=nZ()),dg.exports}rZ();function iZ(e){e()}function sZ(){let e=null,t=null;return{clear(){e=null,t=null},notify(){iZ(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Z2={notify(){},get:()=>[]};function aZ(e,t){let n,r=Z2,i=0,a=!1;function c(S){h();const j=r.subscribe(S);let k=!1;return()=>{k||(k=!0,j(),m())}}function u(){r.notify()}function d(){w.onStateChange&&w.onStateChange()}function p(){return a}function h(){i++,n||(n=e.subscribe(d),r=sZ())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Z2)}function g(){a||(a=!0,h())}function v(){a&&(a=!1,m())}const w={addNestedSub:c,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:p,trySubscribe:g,tryUnsubscribe:v,getListeners:()=>r};return w}var oZ=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lZ=oZ(),cZ=()=>typeof navigator<"u"&&navigator.product==="ReactNative",uZ=cZ(),dZ=()=>lZ||uZ?b.useLayoutEffect:b.useEffect,fZ=dZ();function eC(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function pZ(e,t){if(eC(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!eC(e[n[i]],t[n[i]]))return!1;return!0}var pg=Symbol.for("react-redux-context"),hg=typeof globalThis<"u"?globalThis:{};function hZ(){if(!b.createContext)return{};const e=hg[pg]??(hg[pg]=new Map);let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var mZ=hZ();function gZ(e){const{children:t,context:n,serverState:r,store:i}=e,a=b.useMemo(()=>{const d=aZ(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),c=b.useMemo(()=>i.getState(),[i]);fZ(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),c!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,c]);const u=n||mZ;return b.createElement(u.Provider,{value:a},t)}var xZ=gZ,vZ=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function yZ(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Xy(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(vZ.has(r)){if(e[r]==null&&t[r]==null)continue;if(!pZ(e[r],t[r]))return!1}else if(!yZ(e[r],t[r]))return!1;return!0}function ha(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:IM}function ma(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:IM}var bZ="Invariant failed";function wZ(e,t){throw new Error(bZ)}function Ax(){return Ax=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ax.apply(null,arguments)}function Pf(e){return b.createElement(EQ,Ax({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var jZ=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(ke(t))return t;var a=ke(r)||Vt(r);return a?t(r,i):(a||wZ(),n)}},SZ=(e,t,n)=>n,NZ=(e,t)=>t,Lc=Z([Oy,NZ],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),kZ=Z([Lc],e=>e==null?void 0:e.maxBarSize),PZ=(e,t,n,r)=>r,CZ=Z([Ze,Oy,ha,ma,SZ],(e,t,n,r,i)=>t.filter(a=>e==="horizontal"?a.xAxisId===n:a.yAxisId===r).filter(a=>a.isPanorama===i).filter(a=>a.hide===!1).filter(a=>a.type==="bar")),OZ=(e,t,n)=>{var r=Ze(e),i=ha(e,t),a=ma(e,t);if(!(i==null||a==null))return r==="horizontal"?Sx(e,"yAxis",a,n):Sx(e,"xAxis",i,n)},AZ=(e,t)=>{var n=Ze(e),r=ha(e,t),i=ma(e,t);if(!(r==null||i==null))return n==="horizontal"?HP(e,"xAxis",r):HP(e,"yAxis",i)},EZ=Z([CZ,CK,AZ],sJ),TZ=(e,t,n)=>{var r,i,a=Lc(e,t);if(a==null)return 0;var c=ha(e,t),u=ma(e,t);if(c==null||u==null)return 0;var d=Ze(e),p=HT(e),{maxBarSize:h}=a,m=Vt(h)?p:h,g,v;return d==="horizontal"?(g=jo(e,"xAxis",c,n),v=wo(e,"xAxis",c,n)):(g=jo(e,"yAxis",u,n),v=wo(e,"yAxis",u,n)),(r=(i=Jd(g,v,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},VM=(e,t,n)=>{var r=Ze(e),i=ha(e,t),a=ma(e,t);if(!(i==null||a==null)){var c,u;return r==="horizontal"?(c=jo(e,"xAxis",i,n),u=wo(e,"xAxis",i,n)):(c=jo(e,"yAxis",a,n),u=wo(e,"yAxis",a,n)),Jd(c,u)}},MZ=Z([EZ,HT,PK,GT,TZ,VM,kZ],uJ),_Z=(e,t,n)=>{var r=ha(e,t);if(r!=null)return jo(e,"xAxis",r,n)},IZ=(e,t,n)=>{var r=ma(e,t);if(r!=null)return jo(e,"yAxis",r,n)},DZ=(e,t,n)=>{var r=ha(e,t);if(r!=null)return wo(e,"xAxis",r,n)},RZ=(e,t,n)=>{var r=ma(e,t);if(r!=null)return wo(e,"yAxis",r,n)},LZ=Z([MZ,Lc],fJ),$Z=Z([OZ,Lc],dJ),zZ=Z([Ut,Vv,_Z,IZ,DZ,RZ,LZ,Ze,vK,VM,$Z,Lc,PZ],(e,t,n,r,i,a,c,u,d,p,h,m,g)=>{var{chartData:v,dataStartIndex:w,dataEndIndex:S}=d;if(!(m==null||c==null||t==null||u!=="horizontal"&&u!=="vertical"||n==null||r==null||i==null||a==null||p==null)){var{data:j}=m,k;if(j!=null&&j.length>0?k=j:k=v==null?void 0:v.slice(w,S+1),k!=null)return pee({layout:u,barSettings:m,pos:c,parentViewBox:t,bandSize:p,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:h,displayedData:k,offset:e,cells:g,dataStartIndex:w})}}),FZ=["index"];function Ex(){return Ex=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ex.apply(null,arguments)}function BZ(e,t){if(e==null)return{};var n,r,i=VZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function VZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var UM=b.createContext(void 0),UZ=e=>{var t=b.useContext(UM);if(t!=null)return t.stackId;if(e!=null)return xV(e)},WZ=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),qZ=e=>{var t=b.useContext(UM);if(t!=null){var{stackId:n}=t;return"url(#".concat(WZ(n,e),")")}},WM=e=>{var{index:t}=e,n=BZ(e,FZ),r=qZ(t);return b.createElement(vi,Ex({className:"recharts-bar-stack-layer",clipPath:r},n))},KZ=["onMouseEnter","onMouseLeave","onClick"],HZ=["value","background","tooltipPosition"],GZ=["id"],YZ=["onMouseEnter","onClick","onMouseLeave"];function ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ki.apply(null,arguments)}function tC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tC(Object(n),!0).forEach(function(r){XZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XZ(e,t,n){return(t=QZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QZ(e){var t=JZ(e,"string");return typeof t=="symbol"?t:t+""}function JZ(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cf(e,t){if(e==null)return{};var n,r,i=ZZ(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function ZZ(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var eee=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:EE(n,t),payload:e}]},tee=b.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:c,unit:u,tooltipType:d,id:p}=e,h={dataDefinedOnItem:void 0,getPosition:Ao,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:EE(a,t),hide:c,type:d,color:i,unit:u,graphicalItemId:p}};return b.createElement(TQ,{tooltipEntrySettings:h})});function nee(e){var t=Ee(So),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:c,onMouseLeave:u,onClick:d}=a,p=Cf(a,KZ),h=EM(c,r,a.id),m=TM(u),g=MM(d,r,a.id);if(!i||n==null)return null;var v=kv(i);return b.createElement(ws,{zIndex:pJ(i,Cn.barBackground)},n.map((w,S)=>{var{value:j,background:k,tooltipPosition:C}=w,E=Cf(w,HZ);if(!k)return null;var A=h(w,S),P=m(w,S),O=g(w,S),M=pn(pn(pn(pn(pn({option:i,isActive:String(S)===t},E),{},{fill:"#eee"},k),v),Mv(p,w,S)),{},{onMouseEnter:A,onMouseLeave:P,onClick:O,dataKey:r,index:S,className:"recharts-bar-background-rectangle"});return b.createElement(Pf,ki({key:"background-bar-".concat(S)},M))}))}function ree(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var c={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return pn(pn({},c),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:c,fill:a.fill})});return b.createElement(tQ,{value:t?i:void 0},n)}function iee(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:c}=e,u=Ee(So),d=Ee(sM),p=n&&String(a)===u&&(d==null||c===d),h=p?n:t;return p?b.createElement(ws,{zIndex:Cn.activeBar},b.createElement(WM,{index:a},b.createElement(Pf,ki({},r,{name:String(r.name)},i,{isActive:p,option:h,index:a,dataKey:c})))):b.createElement(Pf,ki({},r,{name:String(r.name)},i,{isActive:p,option:h,index:a,dataKey:c}))}function see(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return b.createElement(Pf,ki({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function aee(e){var t,{data:n,props:r}=e,i=(t=ms(r))!==null&&t!==void 0?t:{},{id:a}=i,c=Cf(i,GZ),{shape:u,dataKey:d,activeBar:p}=r,{onMouseEnter:h,onClick:m,onMouseLeave:g}=r,v=Cf(r,YZ),w=EM(h,d,a),S=TM(g),j=MM(m,d,a);return n?b.createElement(b.Fragment,null,n.map((k,C)=>b.createElement(WM,ki({index:C,key:"rectangle-".concat(k==null?void 0:k.x,"-").concat(k==null?void 0:k.y,"-").concat(k==null?void 0:k.value,"-").concat(C),className:"recharts-bar-rectangle"},Mv(v,k,C),{onMouseEnter:w(k,C),onMouseLeave:S(k,C),onClick:j(k,C)}),p?b.createElement(iee,{shape:u,activeBar:p,baseProps:c,entry:k,index:C,dataKey:d}):b.createElement(see,{shape:u,baseProps:c,entry:k,index:C,dataKey:d})))):null}function oee(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:c,animationDuration:u,animationEasing:d,onAnimationEnd:p,onAnimationStart:h}=t,m=n.current,g=Gv(t,"recharts-bar-"),[v,w]=b.useState(!1),S=!v,j=b.useCallback(()=>{typeof p=="function"&&p(),w(!1)},[p]),k=b.useCallback(()=>{typeof h=="function"&&h(),w(!0)},[h]);return b.createElement(ree,{showLabels:S,rects:r},b.createElement(Hv,{animationId:g,begin:c,duration:u,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:k,key:g},C=>{var E=C===1?r:r==null?void 0:r.map((A,P)=>{var O=m&&m[P];if(O)return pn(pn({},A),{},{x:Jt(O.x,A.x,C),y:Jt(O.y,A.y,C),width:Jt(O.width,A.width,C),height:Jt(O.height,A.height,C)});if(i==="horizontal"){var M=Jt(0,A.height,C),I=Jt(A.stackedBarStart,A.y,C);return pn(pn({},A),{},{y:I,height:M})}var z=Jt(0,A.width,C),K=Jt(A.stackedBarStart,A.x,C);return pn(pn({},A),{},{width:z,x:K})});return C>0&&(n.current=E??null),E==null?null:b.createElement(vi,null,b.createElement(aee,{props:t,data:E}))}),b.createElement(iQ,{label:t.label}),t.children)}function lee(e){var t=b.useRef(null);return b.createElement(oee,{previousRectanglesRef:t,props:e})}var qM=0,cee=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:en(e,t)}};class uee extends b.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:c,needClip:u,background:d,id:p}=this.props;if(t||n==null)return null;var h=rt("recharts-bar",i),m=p;return b.createElement(vi,{className:h,id:p},u&&b.createElement("defs",null,b.createElement(tZ,{clipPathId:m,xAxisId:a,yAxisId:c})),b.createElement(vi,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},b.createElement(nee,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),b.createElement(lee,this.props)))}}var dee={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:qM,xAxisId:0,yAxisId:0,zIndex:Cn.bar};function fee(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:c,animationBegin:u,animationDuration:d,animationEasing:p,isAnimationActive:h}=e,{needClip:m}=BM(t,n),g=Eo(),v=Wn(),w=dQ(e.children,mM),S=Ee(C=>zZ(C,e.id,v,w));if(g!=="vertical"&&g!=="horizontal")return null;var j,k=S==null?void 0:S[0];return k==null||k.height==null||k.width==null?j=0:j=g==="vertical"?k.height/2:k.width/2,b.createElement(eZ,{xAxisId:t,yAxisId:n,data:S,dataPointFormatter:cee,errorBarOffset:j},b.createElement(uee,ki({},e,{layout:g,needClip:m,data:S,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:c,animationBegin:u,animationDuration:d,animationEasing:p,isAnimationActive:h})))}function pee(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r},pos:i,bandSize:a,xAxis:c,yAxis:u,xAxisTicks:d,yAxisTicks:p,stackedData:h,displayedData:m,offset:g,cells:v,parentViewBox:w,dataStartIndex:S}=e,j=t==="horizontal"?u:c,k=h?j.scale.domain():null,C=vV({numericAxis:j}),E=j.scale.map(C);return m.map((A,P)=>{var O,M,I,z,K,L;if(h){var R=h[P+S];if(R==null)return null;O=fV(R,k)}else O=en(A,n),Array.isArray(O)||(O=[C,O]);var ee=jZ(r,qM)(O[1],P);if(t==="horizontal"){var J,ne=u.scale.map(O[0]),re=u.scale.map(O[1]);if(ne==null||re==null)return null;M=HN({axis:c,ticks:d,bandSize:a,offset:i.offset,entry:A,index:P}),I=(J=re??ne)!==null&&J!==void 0?J:void 0,z=i.size;var U=ne-re;if(K=Yr(U)?0:U,L={x:M,y:g.top,width:z,height:g.height},Math.abs(ee)>0&&Math.abs(K)<Math.abs(ee)){var B=$n(K||ee)*(Math.abs(ee)-Math.abs(K));I-=B,K+=B}}else{var G=c.scale.map(O[0]),q=c.scale.map(O[1]);if(G==null||q==null)return null;if(M=G,I=HN({axis:u,ticks:p,bandSize:a,offset:i.offset,entry:A,index:P}),z=q-G,K=i.size,L={x:g.left,y:I,width:g.width,height:K},Math.abs(ee)>0&&Math.abs(z)<Math.abs(ee)){var _=$n(z||ee)*(Math.abs(ee)-Math.abs(z));z+=_}}if(M==null||I==null||z==null||K==null)return null;var V=pn(pn({},A),{},{stackedBarStart:E,x:M,y:I,width:z,height:K,value:h?O:O[1],payload:A,background:L,tooltipPosition:{x:M+z/2,y:I+K/2},parentViewBox:w},v&&v[P]&&v[P].props);return V}).filter(Boolean)}function hee(e){var t=dr(e,dee),n=UZ(t.stackId),r=Wn();return b.createElement(LQ,{id:t.id,type:"bar"},i=>b.createElement(b.Fragment,null,b.createElement(MQ,{legendPayload:eee(t)}),b.createElement(tee,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:i}),b.createElement(WQ,{type:"bar",id:i,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r}),b.createElement(ws,{zIndex:t.zIndex},b.createElement(fee,ki({},t,{id:i})))))}var KM=b.memo(hee,Xy);KM.displayName="Bar";var mee=["domain","range"],gee=["domain","range"];function nC(e,t){if(e==null)return{};var n,r,i=xee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function xee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function rC(e,t){return e===t?!0:Array.isArray(e)&&e.length===2&&Array.isArray(t)&&t.length===2?e[0]===t[0]&&e[1]===t[1]:!1}function HM(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=nC(e,mee),{domain:a,range:c}=t,u=nC(t,gee);return!rC(n,a)||!rC(r,c)?!1:Xy(i,u)}var vee=["type"],yee=["dangerouslySetInnerHTML","ticks","scale"],bee=["id","scale"];function Tx(){return Tx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tx.apply(null,arguments)}function iC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function sC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iC(Object(n),!0).forEach(function(r){wee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wee(e,t,n){return(t=jee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jee(e){var t=See(e,"string");return typeof t=="symbol"?t:t+""}function See(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Mx(e,t){if(e==null)return{};var n,r,i=Nee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Nee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function kee(e){var t=St(),n=b.useRef(null),r=DE(),{type:i}=e,a=Mx(e,vee),c=gp(r,"xAxis",i),u=b.useMemo(()=>{if(c!=null)return sC(sC({},a),{},{type:c})},[a,c]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(YQ(u)):n.current!==u&&t(XQ({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(QQ(n.current)),n.current=null)},[t]),null}var Pee=e=>{var{xAxisId:t,className:n}=e,r=Ee(Vv),i=Wn(),a="xAxis",c=Ee(k=>$5(k,a,t,i)),u=Ee(k=>I5(k,t)),d=Ee(k=>OH(k,t)),p=Ee(k=>r5(k,t));if(u==null||d==null||p==null)return null;var{dangerouslySetInnerHTML:h,ticks:m,scale:g}=e,v=Mx(e,yee),{id:w,scale:S}=p,j=Mx(p,bee);return b.createElement(Yy,Tx({},v,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:rt("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:c,axisType:a}))},Cee={allowDataOverflow:zt.allowDataOverflow,allowDecimals:zt.allowDecimals,allowDuplicatedCategory:zt.allowDuplicatedCategory,angle:zt.angle,axisLine:ta.axisLine,height:zt.height,hide:!1,includeHidden:zt.includeHidden,interval:zt.interval,label:!1,minTickGap:zt.minTickGap,mirror:zt.mirror,orientation:zt.orientation,padding:zt.padding,reversed:zt.reversed,scale:zt.scale,tick:zt.tick,tickCount:zt.tickCount,tickLine:ta.tickLine,tickSize:ta.tickSize,type:zt.type,xAxisId:0},Oee=e=>{var t=dr(e,Cee);return b.createElement(b.Fragment,null,b.createElement(kee,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit}),b.createElement(Pee,t))},GM=b.memo(Oee,HM);GM.displayName="XAxis";var Aee=["type"],Eee=["dangerouslySetInnerHTML","ticks","scale"],Tee=["id","scale"];function _x(){return _x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_x.apply(null,arguments)}function aC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function oC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aC(Object(n),!0).forEach(function(r){Mee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mee(e,t,n){return(t=_ee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _ee(e){var t=Iee(e,"string");return typeof t=="symbol"?t:t+""}function Iee(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ix(e,t){if(e==null)return{};var n,r,i=Dee(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dee(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Ree(e){var t=St(),n=b.useRef(null),r=DE(),{type:i}=e,a=Ix(e,Aee),c=gp(r,"yAxis",i),u=b.useMemo(()=>{if(c!=null)return oC(oC({},a),{},{type:c})},[c,a]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(JQ(u)):n.current!==u&&t(ZQ({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(eJ(n.current)),n.current=null)},[t]),null}function Lee(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=b.useRef(null),c=b.useRef(null),u=Ee(Vv),d=Wn(),p=St(),h="yAxis",m=Ee(O=>D5(O,t)),g=Ee(O=>EH(O,t)),v=Ee(O=>$5(O,h,t,d)),w=Ee(O=>i5(O,t));if(b.useLayoutEffect(()=>{if(!(r!=="auto"||!m||Gy(i)||b.isValidElement(i)||w==null)){var O=a.current;if(O){var M=O.getCalculatedWidth();Math.round(m.width)!==Math.round(M)&&p(tJ({id:t,width:M}))}}},[v,m,p,i,t,r,w]),m==null||g==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:j,scale:k}=e,C=Ix(e,Eee),{id:E,scale:A}=w,P=Ix(w,Tee);return b.createElement(Yy,_x({},C,P,{ref:a,labelRef:c,x:g.x,y:g.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:rt("recharts-".concat(h," ").concat(h),n),viewBox:u,ticks:v,axisType:h}))}var $ee={allowDataOverflow:Ft.allowDataOverflow,allowDecimals:Ft.allowDecimals,allowDuplicatedCategory:Ft.allowDuplicatedCategory,angle:Ft.angle,axisLine:ta.axisLine,hide:!1,includeHidden:Ft.includeHidden,interval:Ft.interval,label:!1,minTickGap:Ft.minTickGap,mirror:Ft.mirror,orientation:Ft.orientation,padding:Ft.padding,reversed:Ft.reversed,scale:Ft.scale,tick:Ft.tick,tickCount:Ft.tickCount,tickLine:ta.tickLine,tickSize:ta.tickSize,type:Ft.type,width:Ft.width,yAxisId:0},zee=e=>{var t=dr(e,$ee);return b.createElement(b.Fragment,null,b.createElement(Ree,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter}),b.createElement(Lee,t))},YM=b.memo(zee,HM);YM.displayName="YAxis";var Fee=(e,t)=>t,Qy=Z([Fee,Ze,t5,Kt,tM,Mi,WG,Ut],QG),Jy=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,r=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/r)}},XM=cr("mouseClick"),QM=Sc();QM.startListening({actionCreator:XM,effect:(e,t)=>{var n=e.payload,r=Qy(t.getState(),Jy(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(WH({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Dx=cr("mouseMove"),JM=Sc(),hd=null;JM.startListening({actionCreator:Dx,effect:(e,t)=>{var n=e.payload;hd!==null&&cancelAnimationFrame(hd);var r=Jy(n);hd=requestAnimationFrame(()=>{var i=t.getState(),a=Ly(i,i.tooltip.settings.shared);if(a==="axis"){var c=Qy(i,r);(c==null?void 0:c.activeIndex)!=null?t.dispatch(K5({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate})):t.dispatch(q5())}hd=null})}});function Bee(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<<CHILDREN>>":t}var lC={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},ZM=An({name:"rootProps",initialState:lC,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:lC.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Vee=ZM.reducer,{updateOptions:Uee}=ZM.actions,Wee=null,qee={updatePolarOptions:(e,t)=>t.payload},e_=An({name:"polarOptions",initialState:Wee,reducers:qee}),{updatePolarOptions:rne}=e_.actions,Kee=e_.reducer,t_=cr("keyDown"),n_=cr("focus"),Zy=Sc();Zy.startListening({actionCreator:t_,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var c=$y(i,zo(n),_c(n),Dc(n)),u=c==null?-1:Number(c);if(!(!Number.isFinite(u)||u<0)){var d=Mi(n);if(a==="Enter"){var p=jf(n,"axis","hover",String(i.index));t.dispatch(kx({active:!i.active,activeIndex:i.index,activeCoordinate:p}));return}var h=IH(n),m=h==="left-to-right"?1:-1,g=a==="ArrowRight"?1:-1,v=u+g*m;if(!(d==null||v>=d.length||v<0)){var w=jf(n,"axis","hover",String(v));t.dispatch(kx({active:!0,activeIndex:v.toString(),activeCoordinate:w}))}}}}}});Zy.startListening({actionCreator:n_,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",c=jf(n,"axis","hover",String(a));t.dispatch(kx({active:!0,activeIndex:a,activeCoordinate:c}))}}}});var rr=cr("externalEvent"),r_=Sc(),mg=new Map;r_.startListening({actionCreator:rr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){r.persist();var i=r.type,a=mg.get(i);a!==void 0&&cancelAnimationFrame(a);var c=requestAnimationFrame(()=>{try{var u=t.getState(),d={activeCoordinate:AG(u),activeDataKey:sM(u),activeIndex:So(u),activeLabel:iM(u),activeTooltipIndex:So(u),isTooltipActive:EG(u)};n(d,r)}finally{mg.delete(i)}});mg.set(i,c)}}});var Hee=Z([Lo],e=>e.tooltipItemPayloads),Gee=Z([Hee,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),i_=cr("touchMove"),s_=Sc();s_.startListening({actionCreator:i_,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var r=t.getState(),i=Ly(r,r.tooltip.settings.shared);if(i==="axis"){var a=n.touches[0];if(a==null)return;var c=Qy(r,Jy({clientX:a.clientX,clientY:a.clientY,currentTarget:n.currentTarget}));(c==null?void 0:c.activeIndex)!=null&&t.dispatch(K5({activeIndex:c.activeIndex,activeDataKey:void 0,activeCoordinate:c.activeCoordinate}))}else if(i==="item"){var u,d=n.touches[0];if(document.elementFromPoint==null||d==null)return;var p=document.elementFromPoint(d.clientX,d.clientY);if(!p||!p.getAttribute)return;var h=p.getAttribute(kV),m=(u=p.getAttribute(PV))!==null&&u!==void 0?u:void 0,g=$o(r).find(S=>S.id===m);if(h==null||g==null||m==null)return;var{dataKey:v}=g,w=Gee(r,h,m);t.dispatch(W5({activeDataKey:v,activeIndex:h,activeCoordinate:w,activeGraphicalItemId:m}))}}}});var Yee=tE({brush:mJ,cartesianAxis:nJ,chartData:AY,errorBars:GJ,graphicalItems:VQ,layout:oV,legend:w9,options:NY,polarAxis:aQ,polarOptions:Kee,referenceElements:yJ,rootProps:Vee,tooltip:qH,zIndex:dY}),Xee=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return M8({reducer:Yee,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([QM.middleware,JM.middleware,Zy.middleware,r_.middleware,s_.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(gE({type:"raf"}))},devTools:{serialize:{replacer:Bee},name:"recharts-".concat(n)}})};function Qee(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Wn(),a=b.useRef(null);if(i)return n;a.current==null&&(a.current=Xee(t,r));var c=Dv;return b.createElement(xZ,{context:c,store:a.current},n)}function Jee(e){var{layout:t,margin:n}=e,r=St(),i=Wn();return b.useEffect(()=>{i||(r(iV(t)),r(rV(n)))},[r,i,t,n]),null}var Zee=b.memo(Jee,Xy);function ete(e){var t=St();return b.useEffect(()=>{t(Uee(e))},[t,e]),null}function cC(e){var{zIndex:t,isPanorama:n}=e,r=b.useRef(null),i=St();return b.useLayoutEffect(()=>(r.current&&i(cY({zIndex:t,element:r.current,isPanorama:n})),()=>{i(uY({zIndex:t,isPanorama:n}))}),[i,t,n]),b.createElement("g",{tabIndex:-1,ref:r})}function uC(e){var{children:t,isPanorama:n}=e,r=Ee(ZG);if(!r||r.length===0)return t;var i=r.filter(c=>c<0),a=r.filter(c=>c>0);return b.createElement(b.Fragment,null,i.map(c=>b.createElement(cC,{key:c,zIndex:c,isPanorama:n})),t,a.map(c=>b.createElement(cC,{key:c,zIndex:c,isPanorama:n})))}var tte=["children"];function nte(e,t){if(e==null)return{};var n,r,i=rte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function rte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Of(){return Of=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Of.apply(null,arguments)}var ite={width:"100%",height:"100%",display:"block"},ste=b.forwardRef((e,t)=>{var n=r9(),r=i9(),i=WE();if(!gs(n)||!gs(r))return null;var{children:a,otherAttributes:c,title:u,desc:d}=e,p,h;return c!=null&&(typeof c.tabIndex=="number"?p=c.tabIndex:p=i?0:void 0,typeof c.role=="string"?h=c.role:h=i?"application":void 0),b.createElement(yA,Of({},c,{title:u,desc:d,role:h,tabIndex:p,width:n,height:r,style:ite,ref:t}),a)}),ate=e=>{var{children:t}=e,n=Ee(np);if(!n)return null;var{width:r,height:i,y:a,x:c}=n;return b.createElement(yA,{width:r,height:i,x:c,y:a},t)},dC=b.forwardRef((e,t)=>{var{children:n}=e,r=nte(e,tte),i=Wn();return i?b.createElement(ate,null,b.createElement(uC,{isPanorama:!0},n)):b.createElement(ste,Of({ref:t},r),b.createElement(uC,{isPanorama:!1},n))});function ote(){var e=St(),[t,n]=b.useState(null),r=Ee(NV);return b.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;We(a)&&a!==r&&e(aV(a))}},[t,e,r]),n}function fC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function lte(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fC(Object(n),!0).forEach(function(r){cte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cte(e,t,n){return(t=ute(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ute(e){var t=dte(e,"string");return typeof t=="symbol"?t:t+""}function dte(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function us(){return us=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},us.apply(null,arguments)}var fte=()=>($Y(),null);function Af(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var pte=b.forwardRef((e,t)=>{var n,r,i=b.useRef(null),[a,c]=b.useState({containerWidth:Af((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Af((r=e.style)===null||r===void 0?void 0:r.height)}),u=b.useCallback((p,h)=>{c(m=>{var g=Math.round(p),v=Math.round(h);return m.containerWidth===g&&m.containerHeight===v?m:{containerWidth:g,containerHeight:v}})},[]),d=b.useCallback(p=>{if(typeof t=="function"&&t(p),p!=null&&typeof ResizeObserver<"u"){var{width:h,height:m}=p.getBoundingClientRect();u(h,m);var g=w=>{var S=w[0];if(S!=null){var{width:j,height:k}=S.contentRect;u(j,k)}},v=new ResizeObserver(g);v.observe(p),i.current=v}},[t,u]);return b.useEffect(()=>()=>{var p=i.current;p!=null&&p.disconnect()},[u]),b.createElement(b.Fragment,null,b.createElement(kc,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",us({ref:d},e)))}),hte=b.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=b.useState({containerWidth:Af(n),containerHeight:Af(r)}),c=b.useCallback((d,p)=>{a(h=>{var m=Math.round(d),g=Math.round(p);return h.containerWidth===m&&h.containerHeight===g?h:{containerWidth:m,containerHeight:g}})},[]),u=b.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:p,height:h}=d.getBoundingClientRect();c(p,h)}},[t,c]);return b.createElement(b.Fragment,null,b.createElement(kc,{width:i.containerWidth,height:i.containerHeight}),b.createElement("div",us({ref:u},e)))}),mte=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return b.createElement(b.Fragment,null,b.createElement(kc,{width:n,height:r}),b.createElement("div",us({ref:t},e)))}),gte=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?b.createElement(hte,us({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement(mte,us({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(kc,{width:n,height:r}),b.createElement("div",us({ref:t},e)))});function xte(e){return e?pte:gte}var vte=b.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:c,onDoubleClick:u,onMouseDown:d,onMouseEnter:p,onMouseLeave:h,onMouseMove:m,onMouseUp:g,onTouchEnd:v,onTouchMove:w,onTouchStart:S,style:j,width:k,responsive:C,dispatchTouchEvents:E=!0}=e,A=b.useRef(null),P=St(),[O,M]=b.useState(null),[I,z]=b.useState(null),K=ote(),L=Uv(),R=(L==null?void 0:L.width)>0?L.width:k,ee=(L==null?void 0:L.height)>0?L.height:i,J=b.useCallback(Y=>{K(Y),typeof t=="function"&&t(Y),M(Y),z(Y),Y!=null&&(A.current=Y)},[K,t,M,z]),ne=b.useCallback(Y=>{P(XM(Y)),P(rr({handler:a,reactEvent:Y}))},[P,a]),re=b.useCallback(Y=>{P(Dx(Y)),P(rr({handler:p,reactEvent:Y}))},[P,p]),U=b.useCallback(Y=>{P(q5()),P(rr({handler:h,reactEvent:Y}))},[P,h]),B=b.useCallback(Y=>{P(Dx(Y)),P(rr({handler:m,reactEvent:Y}))},[P,m]),G=b.useCallback(()=>{P(n_())},[P]),q=b.useCallback(Y=>{P(t_(Y.key))},[P]),_=b.useCallback(Y=>{P(rr({handler:c,reactEvent:Y}))},[P,c]),V=b.useCallback(Y=>{P(rr({handler:u,reactEvent:Y}))},[P,u]),ie=b.useCallback(Y=>{P(rr({handler:d,reactEvent:Y}))},[P,d]),ue=b.useCallback(Y=>{P(rr({handler:g,reactEvent:Y}))},[P,g]),te=b.useCallback(Y=>{P(rr({handler:S,reactEvent:Y}))},[P,S]),se=b.useCallback(Y=>{E&&P(i_(Y)),P(rr({handler:w,reactEvent:Y}))},[P,E,w]),pe=b.useCallback(Y=>{P(rr({handler:v,reactEvent:Y}))},[P,v]),Ne=xte(C);return b.createElement(fM.Provider,{value:O},b.createElement(uB.Provider,{value:I},b.createElement(Ne,{width:R??(j==null?void 0:j.width),height:ee??(j==null?void 0:j.height),className:rt("recharts-wrapper",r),style:lte({position:"relative",cursor:"default",width:R,height:ee},j),onClick:ne,onContextMenu:_,onDoubleClick:V,onFocus:G,onKeyDown:q,onMouseDown:ie,onMouseEnter:re,onMouseLeave:U,onMouseMove:B,onMouseUp:ue,onTouchEnd:pe,onTouchMove:se,onTouchStart:te,ref:J},b.createElement(fte,null),n)))}),yte=["width","height","responsive","children","className","style","compact","title","desc"];function bte(e,t){if(e==null)return{};var n,r,i=wte(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function wte(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var jte=b.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:c,style:u,compact:d,title:p,desc:h}=e,m=bte(e,yte),g=ms(m);return d?b.createElement(b.Fragment,null,b.createElement(kc,{width:n,height:r}),b.createElement(dC,{otherAttributes:g,title:p,desc:h},a)):b.createElement(vte,{className:c,style:u,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},b.createElement(dC,{otherAttributes:g,title:p,desc:h,ref:t},b.createElement(wJ,null,a)))});function Rx(){return Rx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rx.apply(null,arguments)}var Ste={top:5,right:5,bottom:5,left:5},Nte={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:Ste,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},kte=b.forwardRef(function(t,n){var r,i=dr(t.categoricalChartProps,Nte),{chartName:a,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:p}=t,h={chartName:a,defaultTooltipEventType:c,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return b.createElement(Qee,{preloadedState:{options:h},reduxStoreName:(r=p.id)!==null&&r!==void 0?r:a},b.createElement(hJ,{chartData:p.data}),b.createElement(Zee,{layout:i.layout,margin:i.margin}),b.createElement(ete,{baseValue:i.baseValue,accessibilityLayer:i.accessibilityLayer,barCategoryGap:i.barCategoryGap,maxBarSize:i.maxBarSize,stackOffset:i.stackOffset,barGap:i.barGap,barSize:i.barSize,syncId:i.syncId,syncMethod:i.syncMethod,className:i.className,reverseStackOrder:i.reverseStackOrder}),b.createElement(jte,Rx({},i,{ref:n})))}),Pte=["axis","item"],Cte=b.forwardRef((e,t)=>b.createElement(kte,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Pte,tooltipPayloadSearcher:jY,categoricalChartProps:e,ref:t}));const Ote=[{label:"Today",value:"today"},{label:"7 days",value:7},{label:"30 days",value:30},{label:"90 days",value:90}];function pC(e){return e===0?"$0.00":e<.01?"< $0.01":`$${e.toFixed(2)}`}function hC(e){return e===0?"$0.0000":`$${e.toFixed(4)}`}function md(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function mC(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Lx(e){return e.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function Ate(e,t){if(e===t)return"Documentation";const n=`${t}-`;return e.startsWith(n)?Lx(e.slice(n.length)):Lx(e)}function Ete({onClose:e}){const[t,n]=b.useState("today"),[r,i]=b.useState(""),[a,c]=b.useState(""),[u,d]=b.useState(null),[p,h]=b.useState(!0),[m,g]=b.useState({}),[v,w]=b.useState(!1);b.useEffect(()=>{On().then(O=>{var I,z;const M=(I=O==null?void 0:O.apiKeys)==null?void 0:I.openai;w((M==null?void 0:M.authMode)==="oauth"&&((z=M==null?void 0:M.oauth)==null?void 0:z.connected)===!0)}).catch(()=>{})},[]),b.useEffect(()=>{h(!0),d(null);let O;if(t==="today"){const M=new Date().toISOString().split("T")[0];O={from:M,to:M}}else if(t==="custom"){if(!r||!a){h(!1);return}O={from:r,to:a}}else O=parseInt(t,10);jD(O).then(M=>{d(M),h(!1);const I={};(M.ceremonies||[]).forEach(z=>{z.stages&&z.stages.length>0&&(I[z.name]=!0)}),g(I)}).catch(()=>{d({daily:[],ceremonies:[]}),h(!1)})},[t,r,a]),b.useEffect(()=>{const O=M=>{M.key==="Escape"&&e()};return document.addEventListener("keydown",O),()=>document.removeEventListener("keydown",O)},[e]);const S=O=>g(M=>({...M,[O]:!M[O]})),j=(u==null?void 0:u.ceremonies.reduce((O,M)=>O+M.cost,0))??0,k=(u==null?void 0:u.ceremonies.reduce((O,M)=>O+M.tokens,0))??0,C=(u==null?void 0:u.ceremonies.reduce((O,M)=>O+M.calls,0))??0,E=(u==null?void 0:u.ceremonies.reduce((O,M)=>O+(M.saved??0),0))??0,A=(u==null?void 0:u.ceremonies.reduce((O,M)=>O+(M.cached??0),0))??0,P=u&&(u.daily.length>0||u.ceremonies.length>0);return l.jsxs("div",{className:"fixed inset-0 z-[65] flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e,"aria-hidden":"true"}),l.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-full max-w-2xl flex flex-col",style:{height:"90vh",maxHeight:"900px"},onClick:O=>O.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-200 flex-shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(bC,{className:"w-5 h-5 text-slate-500"}),l.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"LLM Cost Tracker"})]}),l.jsx("button",{onClick:e,className:"text-slate-400 hover:text-slate-600 transition-colors","aria-label":"Close",children:l.jsx(cn,{className:"w-5 h-5"})})]}),l.jsxs("div",{className:"overflow-y-auto flex-1 px-6 py-4 flex flex-col gap-5",children:[l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[Ote.map(O=>l.jsx("button",{onClick:()=>n(String(O.value)),className:`px-3 py-1 rounded text-sm font-medium transition-colors ${t===String(O.value)?"bg-blue-600 text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:O.label},O.value)),l.jsx("button",{onClick:()=>n("custom"),className:`px-3 py-1 rounded text-sm font-medium transition-colors ${t==="custom"?"bg-blue-600 text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:"Custom"})]}),l.jsxs("div",{className:`flex items-center gap-2 ${t!=="custom"?"invisible":""}`,children:[l.jsx("input",{type:"date",value:r,onChange:O=>i(O.target.value),className:"text-sm border border-slate-300 rounded px-2 py-0.5 text-slate-700"}),l.jsx("span",{className:"text-slate-400 text-sm",children:"to"}),l.jsx("input",{type:"date",value:a,onChange:O=>c(O.target.value),className:"text-sm border border-slate-300 rounded px-2 py-0.5 text-slate-700"})]})]}),v&&l.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg px-4 py-3 text-xs text-blue-700 flex items-start gap-2",children:[l.jsx("span",{className:"flex-shrink-0 mt-0.5",children:"ℹ️"}),l.jsxs("span",{children:[l.jsx("strong",{children:"OpenAI OAuth active"})," — API calls made via OAuth (ChatGPT subscription) are not billed per token. No cost is recorded for OpenAI usage in this mode; token counts are still tracked for informational purposes."]})]}),p&&l.jsx("div",{className:"flex-1 flex items-center justify-center",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}),!p&&!P&&l.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-slate-400 gap-3",children:[l.jsx(yC,{className:"w-10 h-10"}),l.jsx("p",{className:"text-sm",children:"No usage data for this period."}),l.jsx("p",{className:"text-xs text-slate-300",children:"Run a ceremony to start tracking costs."})]}),!p&&P&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`grid gap-3 ${E>0?"grid-cols-2":"grid-cols-3"}`,children:[l.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[l.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Total Cost"}),l.jsx("p",{className:"text-xl font-bold text-slate-900",children:pC(j)}),l.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"this period"})]}),l.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[l.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Total Tokens"}),l.jsx("p",{className:"text-xl font-bold text-slate-900",children:md(k)}),A>0&&l.jsxs("p",{className:"text-xs text-blue-500 mt-0.5",children:[md(A)," cached"]})]}),l.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[l.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"API Calls"}),l.jsx("p",{className:"text-xl font-bold text-slate-900",children:C.toLocaleString()}),l.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"this period"})]}),E>0&&l.jsxs("div",{className:"bg-green-50 rounded-lg p-3",children:[l.jsx("p",{className:"text-xs text-green-600 mb-1",children:"Cache Saved"}),l.jsx("p",{className:"text-xl font-bold text-green-700",children:pC(E)}),l.jsx("p",{className:"text-xs text-green-500 mt-0.5",children:"vs. no cache"})]})]}),u.daily.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2 uppercase tracking-wide",children:"Daily Cost"}),l.jsx(e9,{width:"100%",height:180,children:l.jsxs(Cte,{data:u.daily,margin:{top:0,right:0,bottom:0,left:0},children:[l.jsx(GM,{dataKey:"date",tickFormatter:mC,tick:{fontSize:11,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),l.jsx(YM,{tickFormatter:O=>`$${O.toFixed(2)}`,tick:{fontSize:11,fill:"#94a3b8"},width:56,axisLine:!1,tickLine:!1}),l.jsx(KY,{formatter:O=>[`$${O.toFixed(4)}`,"Cost"],labelFormatter:O=>mC(O),contentStyle:{fontSize:12}}),l.jsx(KM,{dataKey:"cost",fill:"#3b82f6",radius:[3,3,0,0]})]})})]}),u.ceremonies.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2 uppercase tracking-wide",children:"By Ceremony"}),l.jsx("div",{className:"overflow-x-auto",children:l.jsxs("table",{className:"w-full text-sm",children:[l.jsx("thead",{children:l.jsxs("tr",{className:"text-left text-xs text-slate-400 border-b border-slate-100",children:[l.jsx("th",{className:"pb-2 font-medium",children:"Ceremony / Stage"}),l.jsx("th",{className:"pb-2 font-medium text-right",children:"Calls"}),l.jsx("th",{className:"pb-2 font-medium text-right",children:"Tokens"}),l.jsx("th",{className:"pb-2 font-medium text-right",children:"Cost"}),l.jsx("th",{className:"pb-2 font-medium pl-4",children:"Share"})]})}),l.jsx("tbody",{children:u.ceremonies.map(O=>{const M=j>0?O.cost/j*100:0,I=O.stages&&O.stages.length>0,z=m[O.name];return[l.jsxs("tr",{className:`border-b border-slate-100 ${I?"cursor-pointer hover:bg-slate-50":""}`,onClick:I?()=>S(O.name):void 0,children:[l.jsx("td",{className:"py-2 text-slate-800 font-semibold",children:l.jsxs("div",{className:"flex items-center gap-1.5",children:[I?z?l.jsx(ds,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):l.jsx(ar,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):l.jsx("span",{className:"w-3.5 flex-shrink-0"}),Lx(O.name)]})}),l.jsx("td",{className:"py-2 text-right text-slate-500",children:O.calls}),l.jsx("td",{className:"py-2 text-right text-slate-500",children:md(O.tokens)}),l.jsx("td",{className:"py-2 text-right text-slate-800 font-semibold",children:hC(O.cost)}),l.jsx("td",{className:"py-2 pl-4",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-20 bg-slate-100 rounded-full h-1.5 flex-shrink-0",children:l.jsx("div",{className:"bg-blue-500 h-1.5 rounded-full",style:{width:`${M}%`}})}),l.jsxs("span",{className:"text-xs text-slate-400",children:[Math.round(M),"%"]})]})})]},O.name),...z&&I?O.stages.map(K=>{const L=O.cost>0?K.cost/O.cost*100:0;return l.jsxs("tr",{className:"border-b border-slate-50 bg-slate-50/50",children:[l.jsx("td",{className:"py-1.5 text-slate-500 pl-7",children:Ate(K.name,O.name)}),l.jsx("td",{className:"py-1.5 text-right text-slate-400 text-xs",children:K.calls}),l.jsx("td",{className:"py-1.5 text-right text-slate-400 text-xs",children:md(K.tokens)}),l.jsx("td",{className:"py-1.5 text-right text-slate-500 text-xs",children:hC(K.cost)}),l.jsx("td",{className:"py-1.5 pl-4",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-20 bg-slate-100 rounded-full h-1 flex-shrink-0",children:l.jsx("div",{className:"bg-blue-300 h-1 rounded-full",style:{width:`${L}%`}})}),l.jsxs("span",{className:"text-[10px] text-slate-300",children:[Math.round(L),"%"]})]})})]},`${O.name}/${K.name}`)}):[]]})})]})})]})]})]})]})]})}function Tte(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState(!1),[c,u]=b.useState("AVC Kanban Board"),[d,p]=b.useState("http://localhost:4173"),[h,m]=b.useState(!1),[g,v]=b.useState(""),w=b.useRef(null),[S,j]=b.useState(!1),[k,C]=b.useState(null),[E,A]=b.useState([]),[P,O]=b.useState(null),[M,I]=b.useState(!1),[z,K]=b.useState(null),[L,R]=b.useState(null),[ee,J]=b.useState(null),[ne,re]=b.useState(null),[U,B]=b.useState(null),[G,q]=b.useState({docExists:!1}),[_,V]=b.useState(!1),[ie,ue]=b.useState(null),{workItems:te,loadWorkItems:se,loading:pe,error:Ne,setCeremonyActive:Y}=Mf(),{typeFilters:me,searchQuery:Ae}=_f(),{isOpen:ae,openWizard:$e,resetWizard:Re,ceremonyStatus:Ye,setCeremonyStatus:Qe,setCeremonyResult:Mt,setCeremonyError:En,appendProgress:xn,appendMissionProgress:vn,setProgressLog:yn,setWizardStep:he,setPaused:Pe,setProcessId:De}=or(),{isOpen:Xe,openModal:Pt,closeModal:_t,reopenModal:It,setStep:un,setStatus:Ke,appendProgress:Dt,setProgressLog:Tn,setResult:ga,setError:xa,status:js,setPaused:Zr,setProcessId:_r,setDecomposedHierarchy:pr}=ko(),{handleProcessMessage:_i}=AC(),{appendProgress:Ii,setStatus:qn,setError:hr,setProcessId:va,getStoryIdByProcessId:ya}=Hl(),{appendProgress:Ss,setStatus:ba,setError:Ns,setReviewInfo:Di}=Gl(),mr=b.useMemo(()=>{let X=te.filter(Fe=>me[Fe.type]);if(Ae.trim()){const Fe=Ae.toLowerCase();X=X.filter(yt=>yt.name.toLowerCase().includes(Fe)||yt.id.toLowerCase().includes(Fe)||yt.description&&yt.description.toLowerCase().includes(Fe)||yt.epicName&&yt.epicName.toLowerCase().includes(Fe))}return X},[te,me,Ae]),{wsStatus:Mn}=OD({onMessage:X=>{var Fe,yt,xr,ks,Ps,Cs;if(X.type==="refresh"||X.type==="work-item-update")se();else if(X.type==="ceremony:progress")xn({type:"progress",message:X.message});else if(X.type==="ceremony:substep")xn({type:"substep",substep:X.substep,meta:X.meta});else if(X.type==="ceremony:detail")xn({type:"detail",detail:X.detail});else if(X.type==="ceremony:complete")K(null),R(null),Qe("complete"),Mt(X.result),he(7),se(),$1().then(q).catch(()=>{});else if(X.type==="ceremony:error")Qe("error"),En(X.error);else if(X.type==="mission:progress")vn({step:X.step,message:X.message});else if(X.type==="ceremony:cost-limit")K({cost:X.cost,threshold:X.threshold,runningType:X.runningType});else if(X.type==="ceremony:quota-limit")R({provider:X.provider,model:X.model,errMsg:X.errMsg,validatorName:X.validatorName,runningType:X.runningType});else if(X.type==="cost:update")mm().then(O).catch(()=>{});else if(X.type==="sprint-planning:progress")Dt({type:"progress",message:X.message});else if(X.type==="sprint-planning:substep")Dt({type:"substep",substep:X.substep,meta:X.meta});else if(X.type==="sprint-planning:detail")Dt({type:"detail",detail:X.detail});else if(X.type==="sprint-planning:decomposition-complete")pr(X.hierarchy),Ke("awaiting-selection"),un(3);else if(X.type==="sprint-planning:complete")K(null),R(null),Ke("complete"),ga(X.result),pr(null),un(4),Y(!1),se();else if(X.type==="sprint-planning:error")Ke("error"),xa(X.error),Y(!1);else if(X.type==="sprint-planning:paused")Zr(!0);else if(X.type==="sprint-planning:resumed")Zr(!1);else if(X.type==="sprint-planning:cancelled")K(null),R(null),Ke("idle"),un(1),Zr(!1),pr(null),Y(!1);else if(X.type==="ceremony:paused")Pe(!0);else if(X.type==="ceremony:resumed")Pe(!1);else if(X.type==="ceremony:cancelled")K(null),R(null),Qe("idle"),he(1),Pe(!1);else if(X.type==="seed:progress"&&X.itemId)Ii(X.itemId,X.message);else if(X.type==="seed:complete"&&X.itemId)qn(X.itemId,"complete"),Ii(X.itemId,"Seed complete — tasks created."),se();else if(X.type==="seed:error"&&X.itemId)hr(X.itemId,typeof X.error=="string"?X.error:((Fe=X.error)==null?void 0:Fe.message)||"Seed failed"),se();else if(X.type==="run-task:progress"&&X.itemId)Ss(X.itemId,X.message);else if(X.type==="run-task:complete"&&X.itemId)ba(X.itemId,"complete"),Ss(X.itemId,"Implementation complete — ready for review."),((yt=X.result)!=null&&yt.worktreePath||(xr=X.result)!=null&&xr.branchName)&&Di(X.itemId,{worktreePath:X.result.worktreePath,branchName:X.result.branchName}),se();else if(X.type==="run-task:error"&&X.itemId)Ns(X.itemId,typeof X.error=="string"?X.error:((ks=X.error)==null?void 0:ks.message)||"Run failed"),se();else if(X.type==="refresh")se();else if(X.type==="refine:progress")J({itemId:X.itemId,jobId:X.jobId,message:X.message});else if(X.type==="refine:complete")J(null),re({itemId:X.itemId,jobId:X.jobId,result:X.result});else if(X.type==="refine:error")J(null),B({itemId:X.itemId,jobId:X.jobId,error:X.error});else if(X.type==="process:started")_i(X),X.processType==="sprint-planning"?(_r(X.processId),Y(!0)):X.processType==="sponsor-call"&&De(X.processId);else if(X.type==="process:list"||X.type==="process:status")_i(X);else if(X.type==="ceremony:sync"){const xe=X.ceremonyStatus;((xe==null?void 0:xe.status)==="running"||(xe==null?void 0:xe.status)==="cost-limit-pending"||(xe==null?void 0:xe.status)==="quota-limit-pending"||(xe==null?void 0:xe.status)==="awaiting-selection")&&(xe.runningType==="sprint-planning"?(Y(!0),xe.status==="awaiting-selection"?(Ke("awaiting-selection"),pr(xe.decomposedHierarchy||null),un(3)):Ke("running"),xe.processId&&_r(xe.processId),(Ps=xe.progress)!=null&&Ps.length&&Tn(xe.progress)):xe.runningType==="sponsor-call"&&(Qe("running"),xe.processId&&De(xe.processId),(Cs=xe.progress)!=null&&Cs.length&&yn(xe.progress)),xe.status==="cost-limit-pending"&&xe.costLimitInfo&&K({...xe.costLimitInfo,runningType:xe.runningType}),xe.status==="quota-limit-pending"&&xe.quotaLimitInfo&&R({...xe.quotaLimitInfo,runningType:xe.runningType}))}}});b.useEffect(()=>{(async()=>{var Fe,yt;try{const[xr,ks,Ps,Cs,xe]=await Promise.all([M3(),L1(),$3(),$1(),q3().catch(()=>null)]);t(xr),u(ks),p(Ps),q(Cs),((xe==null?void 0:xe.status)==="running"||(xe==null?void 0:xe.status)==="cost-limit-pending"||(xe==null?void 0:xe.status)==="quota-limit-pending"||(xe==null?void 0:xe.status)==="awaiting-selection")&&(xe.runningType==="sprint-planning"?(xe.status==="awaiting-selection"?(Ke("awaiting-selection"),pr(xe.decomposedHierarchy||null),un(3)):Ke("running"),xe.processId&&_r(xe.processId),(Fe=xe.progress)!=null&&Fe.length&&Tn(xe.progress)):xe.runningType==="sponsor-call"&&(Qe("running"),xe.processId&&De(xe.processId),(yt=xe.progress)!=null&&yt.length&&yn(xe.progress)),xe.status==="cost-limit-pending"&&xe.costLimitInfo&&K({...xe.costLimitInfo,runningType:xe.runningType}),xe.status==="quota-limit-pending"&&xe.quotaLimitInfo&&R({...xe.quotaLimitInfo,runningType:xe.runningType})),V(!0),await se()}catch(xr){console.error("Initialization error:",xr)}})()},[se]),b.useEffect(()=>{var X,Fe;h&&((X=w.current)==null||X.focus(),(Fe=w.current)==null||Fe.select())},[h]),b.useEffect(()=>{mm().then(O).catch(()=>{});const X=setInterval(()=>mm().then(O).catch(()=>{}),6e4);return()=>clearInterval(X)},[]);const fe=()=>{v(c),m(!0)},Me=()=>{m(!1),v("")},Kn=async()=>{const X=g.trim();if(!X||X===c){Me();return}try{await z3(X),u(X)}catch(Fe){console.error("Failed to save title:",Fe)}m(!1),v("")},Hn=X=>{X.key==="Enter"&&Kn(),X.key==="Escape"&&Me()},[gr,Ri]=b.useState("api-keys"),wa=async(X="api-keys")=>{try{const[Fe,yt]=await Promise.all([On(),fs()]);C(Fe),A(yt),Ri(X),j(!0)}catch(Fe){console.error("Failed to load settings:",Fe)}},Pp=async()=>{try{const X=await On();C(X);const Fe=await L1();u(Fe),document.dispatchEvent(new CustomEvent("avc:settings-saved"))}catch(X){console.error("Failed to refresh settings:",X)}},$c=X=>{r(X),a(!0)},Cp=X=>{if(!n||mr.length===0)return;const Fe=mr.findIndex(xr=>xr.id===n.id);if(Fe===-1)return;let yt;X==="prev"?yt=Fe>0?Fe-1:mr.length-1:yt=Fe<mr.length-1?Fe+1:0,r(mr[yt])},ei=()=>{a(!1),setTimeout(()=>r(null),200)};return b.useEffect(()=>{if(n&&te.length>0){const X=te.find(Fe=>Fe.id===n.id);X&&X.status!==n.status&&r(X)}},[te,n]),pe&&!e?l.jsx("div",{className:"flex items-center justify-center min-h-screen bg-slate-50",children:l.jsxs("div",{className:"text-center",children:[l.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),l.jsxs("p",{className:"text-slate-600",children:["Loading ",c,"..."]})]})}):Ne&&!e?l.jsx("div",{className:"flex items-center justify-center min-h-screen bg-slate-50",children:l.jsxs("div",{className:"text-center max-w-md p-6 bg-white rounded-lg shadow-md",children:[l.jsx("div",{className:"text-red-600 text-5xl mb-4",children:"⚠️"}),l.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-2",children:"Connection Error"}),l.jsx("p",{className:"text-slate-600 mb-4",children:Ne}),l.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors",children:"Retry"})]})}):l.jsxs("div",{className:"min-h-screen bg-slate-50 flex flex-col",children:[l.jsx("header",{className:"bg-white border-b border-slate-200 shadow-sm flex-shrink-0",children:l.jsx("div",{className:"max-w-full px-4 sm:px-6 lg:px-8 py-4",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[h?l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("input",{ref:w,value:g,onChange:X=>v(X.target.value),onKeyDown:Hn,className:"text-2xl font-bold text-slate-900 bg-transparent border-b-2 border-blue-500 outline-none min-w-0 w-72"}),l.jsx("button",{onClick:Kn,className:"text-green-600 hover:text-green-700 transition-colors",title:"Save",children:l.jsx(ql,{className:"w-5 h-5"})}),l.jsx("button",{onClick:Me,className:"text-slate-400 hover:text-slate-600 transition-colors",title:"Cancel",children:l.jsx(cn,{className:"w-5 h-5"})})]}):l.jsxs("button",{onClick:fe,className:"group flex items-center gap-2 text-left",title:"Click to edit board title",children:[l.jsx("h1",{className:"text-2xl font-bold text-slate-900 group-hover:text-slate-700 transition-colors",children:c}),l.jsx(mc,{className:"w-4 h-4 text-slate-300 group-hover:text-slate-500 transition-colors flex-shrink-0"})]}),l.jsx("p",{className:"text-sm text-slate-600 mt-1",children:(e==null?void 0:e.projectRoot)||"Loading..."})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${Mn==="connected"?"bg-green-500 animate-pulse":Mn==="connecting"?"bg-amber-400 animate-pulse":"bg-slate-400"}`}),l.jsx("span",{className:"text-sm text-slate-500",children:Mn==="connected"?"Live updates":Mn==="connecting"?"Connecting...":"No live updates"})]}),P!=null&&l.jsxs("button",{onClick:()=>I(!0),className:"flex items-center gap-1 text-xs text-slate-500 hover:text-slate-700 border border-slate-200 rounded px-2 py-0.5 hover:border-slate-300 transition-colors",title:"LLM cost this month — click for details",children:[l.jsx(bC,{className:"w-3 h-3"}),P.totalCost<.01&&P.totalCost>0?"< 0.01":P.totalCost.toFixed(2),l.jsx("span",{className:"text-slate-400",children:"/mo"})]}),l.jsxs("button",{onClick:()=>wa(),className:"flex items-center gap-1.5 text-sm text-slate-500 hover:text-slate-800 transition-colors",title:"Project settings",children:[l.jsx(lo,{className:"w-4 h-4"}),"Settings"]}),l.jsxs("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-slate-500 hover:text-slate-800 transition-colors",title:"Open project documentation",children:[l.jsx(vC,{className:"w-4 h-4"}),"Project Documentation"]})]})]})})}),l.jsx(Z$,{}),l.jsx(tz,{}),l.jsx("main",{className:"flex-1 overflow-hidden",children:l.jsx("div",{className:"h-full px-4 sm:px-6 lg:px-8 py-6",children:l.jsx(Y$,{onCardClick:$c,projectFilesReady:G.docExists,onStartProject:_&&!G.docExists&&Ye!=="running"?()=>{Re(),$e()}:void 0,onEditProjectDoc:()=>ue("doc"),onStartSprintPlanning:_&&G.docExists&&js!=="running"&&js!=="awaiting-selection"&&Ye!=="running"?Pt:void 0,onOpenSprintPlanningSelection:js==="awaiting-selection"?It:void 0,sponsorCallRunning:Ye==="running"})})}),l.jsx("footer",{className:"bg-white border-t border-slate-200 py-4 text-center text-sm text-slate-500 flex-shrink-0",children:"Agile Vibe Coding"}),l.jsx(xz,{workItem:n,open:i,onOpenChange:ei,onNavigate:Cp,onItemClick:$c,allItems:te,refineProgress:ee,refineResult:ne,refineError:U,onClearRefine:()=>{re(null),B(null),J(null)}}),ae&&l.jsx(vF,{onOpenSettings:wa,costLimitPending:(z==null?void 0:z.runningType)==="sponsor-call"?z:null,onContinuePastCostLimit:async()=>{try{await B1(),K(null)}catch{}},onCancelFromCostLimit:async()=>{try{await io(),K(null)}catch{}}}),Xe&&l.jsx(OF,{onClose:_t,costLimitPending:(z==null?void 0:z.runningType)==="sprint-planning"?z:null,onContinuePastCostLimit:async()=>{try{await B1(),K(null)}catch{}},onCancelFromCostLimit:async()=>{try{await io(),K(null)}catch{}},quotaLimitPending:(L==null?void 0:L.runningType)==="sprint-planning"?L:null,onContinueAfterQuota:async(X,Fe)=>{try{await J3(X,Fe),R(null)}catch{}},onCancelFromQuota:async()=>{try{await io(),R(null)}catch{}}}),l.jsx(AF,{}),l.jsx(EF,{}),l.jsx(MF,{}),S&&k&&l.jsx(eB,{settings:k,models:E,onClose:()=>j(!1),onSaved:Pp,initialTab:gr}),M&&l.jsx(Ete,{onClose:()=>I(!1)}),ie&&l.jsx(Q$,{fileType:ie,onClose:()=>ue(null)})]})}a3.createRoot(document.getElementById("root")).render(l.jsx(Ya.StrictMode,{children:l.jsx(Tte,{})}));
|