@agile-vibe-coding/avc 0.3.5 → 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/worktree-runner.js +243 -15
- 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 +38 -0
- package/kanban/server/workers/run-task-worker.js +51 -9
- 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
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
var UI=Object.defineProperty;var WI=(e,t,n)=>t in e?UI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var nm=(e,t,n)=>WI(e,typeof t!="symbol"?t+"":t,n);function qI(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 l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).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 ei(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rm={exports:{}},vl={},im={exports:{}},$e={};/**
|
|
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 b1;function KI(){if(b1)return $e;b1=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"),l=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 v(_){return _===null||typeof _!="object"?null:(_=m&&_[m]||_["@@iterator"],typeof _=="function"?_:null)}var x={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||x}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||x}var E=C.prototype=new k;E.constructor=C,w(E,j.prototype),E.isPureReactComponent=!0;var O=Array.isArray,P=Object.prototype.hasOwnProperty,A={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function D(_,V,ie){var fe,te={},le=null,pe=null;if(V!=null)for(fe in V.ref!==void 0&&(pe=V.ref),V.key!==void 0&&(le=""+V.key),V)P.call(V,fe)&&!M.hasOwnProperty(fe)&&(te[fe]=V[fe]);var Se=arguments.length-2;if(Se===1)te.children=ie;else if(1<Se){for(var H=Array(Se),me=0;me<Se;me++)H[me]=arguments[me+2];te.children=H}if(_&&_.defaultProps)for(fe in Se=_.defaultProps,Se)te[fe]===void 0&&(te[fe]=Se[fe]);return{$$typeof:e,type:_,key:le,ref:pe,props:te,_owner:A.current}}function $(_,V){return{$$typeof:e,type:_.type,key:V,ref:_.ref,props:_.props,_owner:_._owner}}function q(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function X(_){var V={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(ie){return V[ie]})}var L=/\/+/g;function Z(_,V){return typeof _=="object"&&_!==null&&_.key!=null?X(""+_.key):V.toString(36)}function J(_,V,ie,fe,te){var le=typeof _;(le==="undefined"||le==="boolean")&&(_=null);var pe=!1;if(_===null)pe=!0;else switch(le){case"string":case"number":pe=!0;break;case"object":switch(_.$$typeof){case e:case t:pe=!0}}if(pe)return pe=_,te=te(pe),_=fe===""?"."+Z(pe,0):fe,O(te)?(ie="",_!=null&&(ie=_.replace(L,"$&/")+"/"),J(te,V,ie,"",function(me){return me})):te!=null&&(q(te)&&(te=$(te,ie+(!te.key||pe&&pe.key===te.key?"":(""+te.key).replace(L,"$&/")+"/")+_)),V.push(te)),1;if(pe=0,fe=fe===""?".":fe+":",O(_))for(var Se=0;Se<_.length;Se++){le=_[Se];var H=fe+Z(le,Se);pe+=J(le,V,ie,H,te)}else if(H=v(_),typeof H=="function")for(_=H.call(_),Se=0;!(le=_.next()).done;)le=le.value,H=fe+Z(le,Se++),pe+=J(le,V,ie,H,te);else if(le==="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 fe=[],te=0;return J(_,fe,"","",function(le){return V.call(ie,le,te++)}),fe}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 B={current:null},F={transition:null},G={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:F,ReactCurrentOwner:A};function W(){throw Error("act(...) is not supported in production builds of React.")}return $e.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(!q(_))throw Error("React.Children.only expected to receive a single React element child.");return _}},$e.Component=j,$e.Fragment=n,$e.Profiler=i,$e.PureComponent=C,$e.StrictMode=r,$e.Suspense=d,$e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=G,$e.act=W,$e.cloneElement=function(_,V,ie){if(_==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+_+".");var fe=w({},_.props),te=_.key,le=_.ref,pe=_._owner;if(V!=null){if(V.ref!==void 0&&(le=V.ref,pe=A.current),V.key!==void 0&&(te=""+V.key),_.type&&_.type.defaultProps)var Se=_.type.defaultProps;for(H in V)P.call(V,H)&&!M.hasOwnProperty(H)&&(fe[H]=V[H]===void 0&&Se!==void 0?Se[H]:V[H])}var H=arguments.length-2;if(H===1)fe.children=ie;else if(1<H){Se=Array(H);for(var me=0;me<H;me++)Se[me]=arguments[me+2];fe.children=Se}return{$$typeof:e,type:_.type,key:te,ref:le,props:fe,_owner:pe}},$e.createContext=function(_){return _={$$typeof:l,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},_.Provider={$$typeof:a,_context:_},_.Consumer=_},$e.createElement=D,$e.createFactory=function(_){var V=D.bind(null,_);return V.type=_,V},$e.createRef=function(){return{current:null}},$e.forwardRef=function(_){return{$$typeof:u,render:_}},$e.isValidElement=q,$e.lazy=function(_){return{$$typeof:h,_payload:{_status:-1,_result:_},_init:re}},$e.memo=function(_,V){return{$$typeof:p,type:_,compare:V===void 0?null:V}},$e.startTransition=function(_){var V=F.transition;F.transition={};try{_()}finally{F.transition=V}},$e.unstable_act=W,$e.useCallback=function(_,V){return B.current.useCallback(_,V)},$e.useContext=function(_){return B.current.useContext(_)},$e.useDebugValue=function(){},$e.useDeferredValue=function(_){return B.current.useDeferredValue(_)},$e.useEffect=function(_,V){return B.current.useEffect(_,V)},$e.useId=function(){return B.current.useId()},$e.useImperativeHandle=function(_,V,ie){return B.current.useImperativeHandle(_,V,ie)},$e.useInsertionEffect=function(_,V){return B.current.useInsertionEffect(_,V)},$e.useLayoutEffect=function(_,V){return B.current.useLayoutEffect(_,V)},$e.useMemo=function(_,V){return B.current.useMemo(_,V)},$e.useReducer=function(_,V,ie){return B.current.useReducer(_,V,ie)},$e.useRef=function(_){return B.current.useRef(_)},$e.useState=function(_){return B.current.useState(_)},$e.useSyncExternalStore=function(_,V,ie){return B.current.useSyncExternalStore(_,V,ie)},$e.useTransition=function(){return B.current.useTransition()},$e.version="18.3.1",$e}var w1;function bo(){return w1||(w1=1,im.exports=KI()),im.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 j1;function HI(){if(j1)return vl;j1=1;var e=bo(),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 l(u,d,p){var h,m={},v=null,x=null;p!==void 0&&(v=""+p),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(x=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:v,ref:x,props:m,_owner:i.current}}return vl.Fragment=n,vl.jsx=l,vl.jsxs=l,vl}var S1;function GI(){return S1||(S1=1,rm.exports=HI()),rm.exports}var c=GI(),b=bo();const qa=ei(b),YI=qI({__proto__:null,default:qa},[b]);var Fu={},sm={exports:{}},Cn={},am={exports:{}},om={};/**
|
|
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 N1;function XI(){return N1||(N1=1,(function(e){function t(F,G){var W=F.length;F.push(G);e:for(;0<W;){var _=W-1>>>1,V=F[_];if(0<i(V,G))F[_]=G,F[W]=V,W=_;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var G=F[0],W=F.pop();if(W!==G){F[0]=W;e:for(var _=0,V=F.length,ie=V>>>1;_<ie;){var fe=2*(_+1)-1,te=F[fe],le=fe+1,pe=F[le];if(0>i(te,W))le<V&&0>i(pe,te)?(F[_]=pe,F[le]=W,_=le):(F[_]=te,F[fe]=W,_=fe);else if(le<V&&0>i(pe,W))F[_]=pe,F[le]=W,_=le;else break e}}return G}function i(F,G){var W=F.sortIndex-G.sortIndex;return W!==0?W:F.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],h=1,m=null,v=3,x=!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(F){for(var G=n(p);G!==null;){if(G.callback===null)r(p);else if(G.startTime<=F)r(p),G.sortIndex=G.expirationTime,t(d,G);else break;G=n(p)}}function O(F){if(S=!1,E(F),!w)if(n(d)!==null)w=!0,re(P);else{var G=n(p);G!==null&&B(O,G.startTime-F)}}function P(F,G){w=!1,S&&(S=!1,k(D),D=-1),x=!0;var W=v;try{for(E(G),m=n(d);m!==null&&(!(m.expirationTime>G)||F&&!X());){var _=m.callback;if(typeof _=="function"){m.callback=null,v=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 fe=n(p);fe!==null&&B(O,fe.startTime-G),ie=!1}return ie}finally{m=null,v=W,x=!1}}var A=!1,M=null,D=-1,$=5,q=-1;function X(){return!(e.unstable_now()-q<$)}function L(){if(M!==null){var F=e.unstable_now();q=F;var G=!0;try{G=M(!0,F)}finally{G?Z():(A=!1,M=null)}}else A=!1}var Z;if(typeof C=="function")Z=function(){C(L)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ne=J.port2;J.port1.onmessage=L,Z=function(){ne.postMessage(null)}}else Z=function(){j(L,0)};function re(F){M=F,A||(A=!0,Z())}function B(F,G){D=j(function(){F(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(F){F.callback=null},e.unstable_continueExecution=function(){w||x||(w=!0,re(P))},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(F){switch(v){case 1:case 2:case 3:var G=3;break;default:G=v}var W=v;v=G;try{return F()}finally{v=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(F,G){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var W=v;v=F;try{return G()}finally{v=W}},e.unstable_scheduleCallback=function(F,G,W){var _=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?_+W:_):W=_,F){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=W+V,F={id:h++,callback:G,priorityLevel:F,startTime:W,expirationTime:V,sortIndex:-1},W>_?(F.sortIndex=W,t(p,F),n(d)===null&&F===n(p)&&(S?(k(D),D=-1):S=!0,B(O,W-_))):(F.sortIndex=V,t(d,F),w||x||(w=!0,re(P))),F},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(F){var G=v;return function(){var W=v;v=G;try{return F.apply(this,arguments)}finally{v=W}}}})(om)),om}var k1;function QI(){return k1||(k1=1,am.exports=XI()),am.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 P1;function JI(){if(P1)return Cn;P1=1;var e=bo(),t=QI();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){l(s,o),l(s+"Capture",o)}function l(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 v(s){return d.call(m,s)?!0:d.call(h,s)?!1:p.test(s)?m[s]=!0:(h[s]=!0,!1)}function x(s,o,f,g){if(f!==null&&f.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return g?!1:f!==null?!f.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function w(s,o,f,g){if(o===null||typeof o>"u"||x(s,o,f,g))return!0;if(g)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,g,y,N,T){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=g,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,g){var y=j.hasOwnProperty(o)?j[o]:null;(y!==null?y.type!==0:g||!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(w(o,f,y,g)&&(f=null),g||y===null?v(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,g=y.attributeNamespace,f===null?s.removeAttribute(o):(y=y.type,f=y===3||y===4&&f===!0?"":""+f,g?s.setAttributeNS(g,o,f):s.setAttribute(o,f))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),A=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),X=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),F=Symbol.iterator;function G(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var W=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 fe(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(Y){var g=Y}Reflect.construct(s,[],o)}else{try{o.call()}catch(Y){g=Y}s.call(o.prototype)}else{try{throw Error()}catch(Y){g=Y}s()}}catch(Y){if(Y&&g&&typeof Y.stack=="string"){for(var y=Y.stack.split(`
|
|
35
|
-
`),N=g.stack.split(`
|
|
36
|
-
`),T=y.length-1,I=N.length-1;1<=T&&0<=I&&y[T]!==N[I];)I--;for(;1<=T&&0<=I;T--,I--)if(y[T]!==N[I]){if(T!==1||I!==1)do if(T--,I--,0>I||y[T]!==N[I]){var R=`
|
|
37
|
-
`+y[T].replace(" at new "," at ");return s.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",s.displayName)),R}while(1<=T&&0<=I);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=fe(s.type,!1),s;case 11:return s=fe(s.type.render,!1),s;case 1:return s=fe(s.type,!0),s;default:return""}}function le(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 A:return"Portal";case $:return"Profiler";case D:return"StrictMode";case Z:return"Suspense";case J:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case X:return(s.displayName||"Context")+".Consumer";case q:return(s._context.displayName||"Context")+".Provider";case L: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:le(s.type)||"Memo";case re:o=s._payload,s=s._init;try{return le(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 le(o);case 8:return o===D?"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 Se(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function H(s){var o=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function me(s){var o=H(s)?"checked":"value",f=Object.getOwnPropertyDescriptor(s.constructor.prototype,o),g=""+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){g=""+T,N.call(this,T)}}),Object.defineProperty(s,o,{enumerable:f.enumerable}),{getValue:function(){return g},setValue:function(T){g=""+T},stopTracking:function(){s._valueTracker=null,delete s[o]}}}}function Oe(s){s._valueTracker||(s._valueTracker=me(s))}function se(s){if(!s)return!1;var o=s._valueTracker;if(!o)return!0;var f=o.getValue(),g="";return s&&(g=H(s)?s.checked?"true":"false":s.value),s=g,s!==f?(o.setValue(s),!0):!1}function Le(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 De(s,o){var f=o.checked;return W({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??s._wrapperState.initialChecked})}function Qe(s,o){var f=o.defaultValue==null?"":o.defaultValue,g=o.checked!=null?o.checked:o.defaultChecked;f=Se(o.value!=null?o.value:f),s._wrapperState={initialChecked:g,initialValue:f,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function Ze(s,o){o=o.checked,o!=null&&E(s,"checked",o,!1)}function _t(s,o){Ze(s,o);var f=Se(o.value),g=o.type;if(f!=null)g==="number"?(f===0&&s.value===""||s.value!=f)&&(s.value=""+f):s.value!==""+f&&(s.value=""+f);else if(g==="submit"||g==="reset"){s.removeAttribute("value");return}o.hasOwnProperty("value")?yn(s,o.type,f):o.hasOwnProperty("defaultValue")&&yn(s,o.type,Se(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(s.defaultChecked=!!o.defaultChecked)}function Mn(s,o,f){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var g=o.type;if(!(g!=="submit"&&g!=="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 yn(s,o,f){(o!=="number"||Le(s.ownerDocument)!==s)&&(f==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+f&&(s.defaultValue=""+f))}var bn=Array.isArray;function wn(s,o,f,g){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&&g&&(s[f].defaultSelected=!0)}else{for(f=""+Se(f),o=null,y=0;y<s.length;y++){if(s[y].value===f){s[y].selected=!0,g&&(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 W({},o,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function ke(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(bn(f)){if(1<f.length)throw Error(n(93));f=f[0]}o=f}o==null&&(o=""),f=o}s._wrapperState={initialValue:Se(f)}}function _e(s,o){var f=Se(o.value),g=Se(o.defaultValue);f!=null&&(f=""+f,f!==s.value&&(s.value=f),o.defaultValue==null&&s.defaultValue!==f&&(s.defaultValue=f)),g!=null&&(s.defaultValue=""+g)}function Je(s){var o=s.textContent;o===s._wrapperState.initialValue&&o!==""&&o!==null&&(s.value=o)}function Ct(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 It(s,o){return s==null||s==="http://www.w3.org/1999/xhtml"?Ct(o):s==="http://www.w3.org/2000/svg"&&o==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var Dt,dn=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(o,f,g,y){MSApp.execUnsafeLocalFunction(function(){return s(o,f,g,y)})}:s})(function(s,o){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=o;else{for(Dt=Dt||document.createElement("div"),Dt.innerHTML="<svg>"+o.valueOf().toString()+"</svg>",o=Dt.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;o.firstChild;)s.appendChild(o.firstChild)}});function He(s,o){if(o){var f=s.firstChild;if(f&&f===s.lastChild&&f.nodeType===3){f.nodeValue=o;return}}s.textContent=o}var Rt={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},_n=["Webkit","ms","Moz","O"];Object.keys(Rt).forEach(function(s){_n.forEach(function(o){o=o+s.charAt(0).toUpperCase()+s.substring(1),Rt[o]=Rt[s]})});function ha(s,o,f){return o==null||typeof o=="boolean"||o===""?"":f||typeof o!="number"||o===0||Rt.hasOwnProperty(s)&&Rt[s]?(""+o).trim():o+"px"}function ma(s,o){s=s.style;for(var f in o)if(o.hasOwnProperty(f)){var g=f.indexOf("--")===0,y=ha(f,o[f],g);f==="float"&&(f="cssFloat"),g?s.setProperty(f,y):s[f]=y}}var ks=W({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 ti(s,o){if(o){if(ks[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 Mr(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 mr=null;function Ri(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Li=null,Kn=null,gr=null;function ga(s){if(s=nl(s)){if(typeof Li!="function")throw Error(n(280));var o=s.stateNode;o&&(o=tu(o),Li(s.stateNode,s.type,o))}}function va(s){Kn?gr?gr.push(s):gr=[s]:Kn=s}function _r(){if(Kn){var s=Kn,o=gr;if(gr=Kn=null,ga(s),o)for(s=0;s<o.length;s++)ga(o[s])}}function ni(s,o){return s(o)}function Ps(){}var Ir=!1;function $i(s,o,f){if(Ir)return s(o,f);Ir=!0;try{return ni(s,o,f)}finally{Ir=!1,(Kn!==null||gr!==null)&&(Ps(),_r())}}function Dr(s,o){var f=s.stateNode;if(f===null)return null;var g=tu(f);if(g===null)return null;f=g[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":(g=!g.disabled)||(s=s.type,g=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!g;break e;default:s=!1}if(s)return null;if(f&&typeof f!="function")throw Error(n(231,o,typeof f));return f}var de=!1;if(u)try{var Me={};Object.defineProperty(Me,"passive",{get:function(){de=!0}}),window.addEventListener("test",Me,Me),window.removeEventListener("test",Me,Me)}catch{de=!1}function Hn(s,o,f,g,y,N,T,I,R){var Y=Array.prototype.slice.call(arguments,3);try{o.apply(f,Y)}catch(oe){this.onError(oe)}}var Gn=!1,Yn=null,zi=!1,Lo=null,ee={onError:function(s){Gn=!0,Yn=s}};function Be(s,o,f,g,y,N,T,I,R){Gn=!1,Yn=null,Hn.apply(ee,arguments)}function bt(s,o,f,g,y,N,T,I,R){if(Be.apply(this,arguments),Gn){if(Gn){var Y=Yn;Gn=!1,Yn=null}else throw Error(n(198));zi||(zi=!0,Lo=Y)}}function nn(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 Cs(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 ze(s){if(nn(s)!==s)throw Error(n(188))}function wp(s){var o=s.alternate;if(!o){if(o=nn(s),o===null)throw Error(n(188));return o!==s?null:s}for(var f=s,g=o;;){var y=f.return;if(y===null)break;var N=y.alternate;if(N===null){if(g=y.return,g!==null){f=g;continue}break}if(y.child===N.child){for(N=y.child;N;){if(N===f)return ze(y),s;if(N===g)return ze(y),o;N=N.sibling}throw Error(n(188))}if(f.return!==g.return)f=y,g=N;else{for(var T=!1,I=y.child;I;){if(I===f){T=!0,f=y,g=N;break}if(I===g){T=!0,g=y,f=N;break}I=I.sibling}if(!T){for(I=N.child;I;){if(I===f){T=!0,f=N,g=y;break}if(I===g){T=!0,g=N,f=y;break}I=I.sibling}if(!T)throw Error(n(189))}}if(f.alternate!==g)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?s:o}function Fe(s){return s=wp(s),s!==null?Ky(s):null}function Ky(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var o=Ky(s);if(o!==null)return o;s=s.sibling}return null}var Hy=t.unstable_scheduleCallback,Gy=t.unstable_cancelCallback,e_=t.unstable_shouldYield,t_=t.unstable_requestPaint,wt=t.unstable_now,n_=t.unstable_getCurrentPriorityLevel,jp=t.unstable_ImmediatePriority,Yy=t.unstable_UserBlockingPriority,Dc=t.unstable_NormalPriority,r_=t.unstable_LowPriority,Xy=t.unstable_IdlePriority,Rc=null,Rr=null;function i_(s){if(Rr&&typeof Rr.onCommitFiberRoot=="function")try{Rr.onCommitFiberRoot(Rc,s,void 0,(s.current.flags&128)===128)}catch{}}var vr=Math.clz32?Math.clz32:o_,s_=Math.log,a_=Math.LN2;function o_(s){return s>>>=0,s===0?32:31-(s_(s)/a_|0)|0}var Lc=64,$c=4194304;function $o(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 zc(s,o){var f=s.pendingLanes;if(f===0)return 0;var g=0,y=s.suspendedLanes,N=s.pingedLanes,T=f&268435455;if(T!==0){var I=T&~y;I!==0?g=$o(I):(N&=T,N!==0&&(g=$o(N)))}else T=f&~y,T!==0?g=$o(T):N!==0&&(g=$o(N));if(g===0)return 0;if(o!==0&&o!==g&&(o&y)===0&&(y=g&-g,N=o&-o,y>=N||y===16&&(N&4194240)!==0))return o;if((g&4)!==0&&(g|=f&16),o=s.entangledLanes,o!==0)for(s=s.entanglements,o&=g;0<o;)f=31-vr(o),y=1<<f,g|=s[f],o&=~y;return g}function l_(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 c_(s,o){for(var f=s.suspendedLanes,g=s.pingedLanes,y=s.expirationTimes,N=s.pendingLanes;0<N;){var T=31-vr(N),I=1<<T,R=y[T];R===-1?((I&f)===0||(I&g)!==0)&&(y[T]=l_(I,o)):R<=o&&(s.expiredLanes|=I),N&=~I}}function Sp(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Qy(){var s=Lc;return Lc<<=1,(Lc&4194240)===0&&(Lc=64),s}function Np(s){for(var o=[],f=0;31>f;f++)o.push(s);return o}function zo(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 u_(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 g=s.eventTimes;for(s=s.expirationTimes;0<f;){var y=31-vr(f),N=1<<y;o[y]=0,g[y]=-1,s[y]=-1,f&=~N}}function kp(s,o){var f=s.entangledLanes|=o;for(s=s.entanglements;f;){var g=31-vr(f),y=1<<g;y&o|s[g]&o&&(s[g]|=o),f&=~y}}var Ge=0;function Jy(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Zy,Pp,eb,tb,nb,Cp=!1,Fc=[],Fi=null,Bi=null,Vi=null,Fo=new Map,Bo=new Map,Ui=[],d_="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 rb(s,o){switch(s){case"focusin":case"focusout":Fi=null;break;case"dragenter":case"dragleave":Bi=null;break;case"mouseover":case"mouseout":Vi=null;break;case"pointerover":case"pointerout":Fo.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bo.delete(o.pointerId)}}function Vo(s,o,f,g,y,N){return s===null||s.nativeEvent!==N?(s={blockedOn:o,domEventName:f,eventSystemFlags:g,nativeEvent:N,targetContainers:[y]},o!==null&&(o=nl(o),o!==null&&Pp(o)),s):(s.eventSystemFlags|=g,o=s.targetContainers,y!==null&&o.indexOf(y)===-1&&o.push(y),s)}function f_(s,o,f,g,y){switch(o){case"focusin":return Fi=Vo(Fi,s,o,f,g,y),!0;case"dragenter":return Bi=Vo(Bi,s,o,f,g,y),!0;case"mouseover":return Vi=Vo(Vi,s,o,f,g,y),!0;case"pointerover":var N=y.pointerId;return Fo.set(N,Vo(Fo.get(N)||null,s,o,f,g,y)),!0;case"gotpointercapture":return N=y.pointerId,Bo.set(N,Vo(Bo.get(N)||null,s,o,f,g,y)),!0}return!1}function ib(s){var o=Os(s.target);if(o!==null){var f=nn(o);if(f!==null){if(o=f.tag,o===13){if(o=Cs(f),o!==null){s.blockedOn=o,nb(s.priority,function(){eb(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 Bc(s){if(s.blockedOn!==null)return!1;for(var o=s.targetContainers;0<o.length;){var f=Ap(s.domEventName,s.eventSystemFlags,o[0],s.nativeEvent);if(f===null){f=s.nativeEvent;var g=new f.constructor(f.type,f);mr=g,f.target.dispatchEvent(g),mr=null}else return o=nl(f),o!==null&&Pp(o),s.blockedOn=f,!1;o.shift()}return!0}function sb(s,o,f){Bc(s)&&f.delete(o)}function p_(){Cp=!1,Fi!==null&&Bc(Fi)&&(Fi=null),Bi!==null&&Bc(Bi)&&(Bi=null),Vi!==null&&Bc(Vi)&&(Vi=null),Fo.forEach(sb),Bo.forEach(sb)}function Uo(s,o){s.blockedOn===o&&(s.blockedOn=null,Cp||(Cp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,p_)))}function Wo(s){function o(y){return Uo(y,s)}if(0<Fc.length){Uo(Fc[0],s);for(var f=1;f<Fc.length;f++){var g=Fc[f];g.blockedOn===s&&(g.blockedOn=null)}}for(Fi!==null&&Uo(Fi,s),Bi!==null&&Uo(Bi,s),Vi!==null&&Uo(Vi,s),Fo.forEach(o),Bo.forEach(o),f=0;f<Ui.length;f++)g=Ui[f],g.blockedOn===s&&(g.blockedOn=null);for(;0<Ui.length&&(f=Ui[0],f.blockedOn===null);)ib(f),f.blockedOn===null&&Ui.shift()}var xa=O.ReactCurrentBatchConfig,Vc=!0;function h_(s,o,f,g){var y=Ge,N=xa.transition;xa.transition=null;try{Ge=1,Op(s,o,f,g)}finally{Ge=y,xa.transition=N}}function m_(s,o,f,g){var y=Ge,N=xa.transition;xa.transition=null;try{Ge=4,Op(s,o,f,g)}finally{Ge=y,xa.transition=N}}function Op(s,o,f,g){if(Vc){var y=Ap(s,o,f,g);if(y===null)Kp(s,o,g,Uc,f),rb(s,g);else if(f_(y,s,o,f,g))g.stopPropagation();else if(rb(s,g),o&4&&-1<d_.indexOf(s)){for(;y!==null;){var N=nl(y);if(N!==null&&Zy(N),N=Ap(s,o,f,g),N===null&&Kp(s,o,g,Uc,f),N===y)break;y=N}y!==null&&g.stopPropagation()}else Kp(s,o,g,null,f)}}var Uc=null;function Ap(s,o,f,g){if(Uc=null,s=Ri(g),s=Os(s),s!==null)if(o=nn(s),o===null)s=null;else if(f=o.tag,f===13){if(s=Cs(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 Uc=s,null}function ab(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(n_()){case jp:return 1;case Yy:return 4;case Dc:case r_:return 16;case Xy:return 536870912;default:return 16}default:return 16}}var Wi=null,Ep=null,Wc=null;function ob(){if(Wc)return Wc;var s,o=Ep,f=o.length,g,y="value"in Wi?Wi.value:Wi.textContent,N=y.length;for(s=0;s<f&&o[s]===y[s];s++);var T=f-s;for(g=1;g<=T&&o[f-g]===y[N-g];g++);return Wc=y.slice(s,1<g?1-g:void 0)}function qc(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 Kc(){return!0}function lb(){return!1}function In(s){function o(f,g,y,N,T){this._reactName=f,this._targetInst=y,this.type=g,this.nativeEvent=N,this.target=T,this.currentTarget=null;for(var I in s)s.hasOwnProperty(I)&&(f=s[I],this[I]=f?f(N):N[I]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?Kc:lb,this.isPropagationStopped=lb,this}return W(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=Kc)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Kc)},persist:function(){},isPersistent:Kc}),o}var ya={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tp=In(ya),qo=W({},ya,{view:0,detail:0}),g_=In(qo),Mp,_p,Ko,Hc=W({},qo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dp,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!==Ko&&(Ko&&s.type==="mousemove"?(Mp=s.screenX-Ko.screenX,_p=s.screenY-Ko.screenY):_p=Mp=0,Ko=s),Mp)},movementY:function(s){return"movementY"in s?s.movementY:_p}}),cb=In(Hc),v_=W({},Hc,{dataTransfer:0}),x_=In(v_),y_=W({},qo,{relatedTarget:0}),Ip=In(y_),b_=W({},ya,{animationName:0,elapsedTime:0,pseudoElement:0}),w_=In(b_),j_=W({},ya,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),S_=In(j_),N_=W({},ya,{data:0}),ub=In(N_),k_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},P_={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"},C_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function O_(s){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(s):(s=C_[s])?!!o[s]:!1}function Dp(){return O_}var A_=W({},qo,{key:function(s){if(s.key){var o=k_[s.key]||s.key;if(o!=="Unidentified")return o}return s.type==="keypress"?(s=qc(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?P_[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dp,charCode:function(s){return s.type==="keypress"?qc(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?qc(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),E_=In(A_),T_=W({},Hc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),db=In(T_),M_=W({},qo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dp}),__=In(M_),I_=W({},ya,{propertyName:0,elapsedTime:0,pseudoElement:0}),D_=In(I_),R_=W({},Hc,{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}),L_=In(R_),$_=[9,13,27,32],Rp=u&&"CompositionEvent"in window,Ho=null;u&&"documentMode"in document&&(Ho=document.documentMode);var z_=u&&"TextEvent"in window&&!Ho,fb=u&&(!Rp||Ho&&8<Ho&&11>=Ho),pb=" ",hb=!1;function mb(s,o){switch(s){case"keyup":return $_.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gb(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var ba=!1;function F_(s,o){switch(s){case"compositionend":return gb(o);case"keypress":return o.which!==32?null:(hb=!0,pb);case"textInput":return s=o.data,s===pb&&hb?null:s;default:return null}}function B_(s,o){if(ba)return s==="compositionend"||!Rp&&mb(s,o)?(s=ob(),Wc=Ep=Wi=null,ba=!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 fb&&o.locale!=="ko"?null:o.data;default:return null}}var V_={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 vb(s){var o=s&&s.nodeName&&s.nodeName.toLowerCase();return o==="input"?!!V_[s.type]:o==="textarea"}function xb(s,o,f,g){va(g),o=Jc(o,"onChange"),0<o.length&&(f=new Tp("onChange","change",null,f,g),s.push({event:f,listeners:o}))}var Go=null,Yo=null;function U_(s){Rb(s,0)}function Gc(s){var o=ka(s);if(se(o))return s}function W_(s,o){if(s==="change")return o}var yb=!1;if(u){var Lp;if(u){var $p="oninput"in document;if(!$p){var bb=document.createElement("div");bb.setAttribute("oninput","return;"),$p=typeof bb.oninput=="function"}Lp=$p}else Lp=!1;yb=Lp&&(!document.documentMode||9<document.documentMode)}function wb(){Go&&(Go.detachEvent("onpropertychange",jb),Yo=Go=null)}function jb(s){if(s.propertyName==="value"&&Gc(Yo)){var o=[];xb(o,Yo,s,Ri(s)),$i(U_,o)}}function q_(s,o,f){s==="focusin"?(wb(),Go=o,Yo=f,Go.attachEvent("onpropertychange",jb)):s==="focusout"&&wb()}function K_(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Gc(Yo)}function H_(s,o){if(s==="click")return Gc(o)}function G_(s,o){if(s==="input"||s==="change")return Gc(o)}function Y_(s,o){return s===o&&(s!==0||1/s===1/o)||s!==s&&o!==o}var xr=typeof Object.is=="function"?Object.is:Y_;function Xo(s,o){if(xr(s,o))return!0;if(typeof s!="object"||s===null||typeof o!="object"||o===null)return!1;var f=Object.keys(s),g=Object.keys(o);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var y=f[g];if(!d.call(o,y)||!xr(s[y],o[y]))return!1}return!0}function Sb(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Nb(s,o){var f=Sb(s);s=0;for(var g;f;){if(f.nodeType===3){if(g=s+f.textContent.length,s<=o&&g>=o)return{node:f,offset:o-s};s=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Sb(f)}}function kb(s,o){return s&&o?s===o?!0:s&&s.nodeType===3?!1:o&&o.nodeType===3?kb(s,o.parentNode):"contains"in s?s.contains(o):s.compareDocumentPosition?!!(s.compareDocumentPosition(o)&16):!1:!1}function Pb(){for(var s=window,o=Le();o instanceof s.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)s=o.contentWindow;else break;o=Le(s.document)}return o}function zp(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 X_(s){var o=Pb(),f=s.focusedElem,g=s.selectionRange;if(o!==f&&f&&f.ownerDocument&&kb(f.ownerDocument.documentElement,f)){if(g!==null&&zp(f)){if(o=g.start,s=g.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(g.start,y);g=g.end===void 0?N:Math.min(g.end,y),!s.extend&&N>g&&(y=g,g=N,N=y),y=Nb(f,N);var T=Nb(f,g);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>g?(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 Q_=u&&"documentMode"in document&&11>=document.documentMode,wa=null,Fp=null,Qo=null,Bp=!1;function Cb(s,o,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Bp||wa==null||wa!==Le(g)||(g=wa,"selectionStart"in g&&zp(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Qo&&Xo(Qo,g)||(Qo=g,g=Jc(Fp,"onSelect"),0<g.length&&(o=new Tp("onSelect","select",null,o,f),s.push({event:o,listeners:g}),o.target=wa)))}function Yc(s,o){var f={};return f[s.toLowerCase()]=o.toLowerCase(),f["Webkit"+s]="webkit"+o,f["Moz"+s]="moz"+o,f}var ja={animationend:Yc("Animation","AnimationEnd"),animationiteration:Yc("Animation","AnimationIteration"),animationstart:Yc("Animation","AnimationStart"),transitionend:Yc("Transition","TransitionEnd")},Vp={},Ob={};u&&(Ob=document.createElement("div").style,"AnimationEvent"in window||(delete ja.animationend.animation,delete ja.animationiteration.animation,delete ja.animationstart.animation),"TransitionEvent"in window||delete ja.transitionend.transition);function Xc(s){if(Vp[s])return Vp[s];if(!ja[s])return s;var o=ja[s],f;for(f in o)if(o.hasOwnProperty(f)&&f in Ob)return Vp[s]=o[f];return s}var Ab=Xc("animationend"),Eb=Xc("animationiteration"),Tb=Xc("animationstart"),Mb=Xc("transitionend"),_b=new Map,Ib="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 qi(s,o){_b.set(s,o),a(o,[s])}for(var Up=0;Up<Ib.length;Up++){var Wp=Ib[Up],J_=Wp.toLowerCase(),Z_=Wp[0].toUpperCase()+Wp.slice(1);qi(J_,"on"+Z_)}qi(Ab,"onAnimationEnd"),qi(Eb,"onAnimationIteration"),qi(Tb,"onAnimationStart"),qi("dblclick","onDoubleClick"),qi("focusin","onFocus"),qi("focusout","onBlur"),qi(Mb,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("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 Jo="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(" "),eI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jo));function Db(s,o,f){var g=s.type||"unknown-event";s.currentTarget=f,bt(g,o,void 0,s),s.currentTarget=null}function Rb(s,o){o=(o&4)!==0;for(var f=0;f<s.length;f++){var g=s[f],y=g.event;g=g.listeners;e:{var N=void 0;if(o)for(var T=g.length-1;0<=T;T--){var I=g[T],R=I.instance,Y=I.currentTarget;if(I=I.listener,R!==N&&y.isPropagationStopped())break e;Db(y,I,Y),N=R}else for(T=0;T<g.length;T++){if(I=g[T],R=I.instance,Y=I.currentTarget,I=I.listener,R!==N&&y.isPropagationStopped())break e;Db(y,I,Y),N=R}}}if(zi)throw s=Lo,zi=!1,Lo=null,s}function st(s,o){var f=o[Jp];f===void 0&&(f=o[Jp]=new Set);var g=s+"__bubble";f.has(g)||(Lb(o,s,2,!1),f.add(g))}function qp(s,o,f){var g=0;o&&(g|=4),Lb(f,s,g,o)}var Qc="_reactListening"+Math.random().toString(36).slice(2);function Zo(s){if(!s[Qc]){s[Qc]=!0,r.forEach(function(f){f!=="selectionchange"&&(eI.has(f)||qp(f,!1,s),qp(f,!0,s))});var o=s.nodeType===9?s:s.ownerDocument;o===null||o[Qc]||(o[Qc]=!0,qp("selectionchange",!1,o))}}function Lb(s,o,f,g){switch(ab(o)){case 1:var y=h_;break;case 4:y=m_;break;default:y=Op}f=y.bind(null,o,f,s),y=void 0,!de||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(y=!0),g?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 Kp(s,o,f,g,y){var N=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var T=g.tag;if(T===3||T===4){var I=g.stateNode.containerInfo;if(I===y||I.nodeType===8&&I.parentNode===y)break;if(T===4)for(T=g.return;T!==null;){var R=T.tag;if((R===3||R===4)&&(R=T.stateNode.containerInfo,R===y||R.nodeType===8&&R.parentNode===y))return;T=T.return}for(;I!==null;){if(T=Os(I),T===null)return;if(R=T.tag,R===5||R===6){g=N=T;continue e}I=I.parentNode}}g=g.return}$i(function(){var Y=N,oe=Ri(f),ce=[];e:{var ae=_b.get(s);if(ae!==void 0){var ge=Tp,ye=s;switch(s){case"keypress":if(qc(f)===0)break e;case"keydown":case"keyup":ge=E_;break;case"focusin":ye="focus",ge=Ip;break;case"focusout":ye="blur",ge=Ip;break;case"beforeblur":case"afterblur":ge=Ip;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=cb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=x_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=__;break;case Ab:case Eb:case Tb:ge=w_;break;case Mb:ge=D_;break;case"scroll":ge=g_;break;case"wheel":ge=L_;break;case"copy":case"cut":case"paste":ge=S_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=db}var be=(o&4)!==0,jt=!be&&s==="scroll",U=be?ae!==null?ae+"Capture":null:ae;be=[];for(var z=Y,K;z!==null;){K=z;var ue=K.stateNode;if(K.tag===5&&ue!==null&&(K=ue,U!==null&&(ue=Dr(z,U),ue!=null&&be.push(el(z,ue,K)))),jt)break;z=z.return}0<be.length&&(ae=new ge(ae,ye,null,f,oe),ce.push({event:ae,listeners:be}))}}if((o&7)===0){e:{if(ae=s==="mouseover"||s==="pointerover",ge=s==="mouseout"||s==="pointerout",ae&&f!==mr&&(ye=f.relatedTarget||f.fromElement)&&(Os(ye)||ye[ri]))break e;if((ge||ae)&&(ae=oe.window===oe?oe:(ae=oe.ownerDocument)?ae.defaultView||ae.parentWindow:window,ge?(ye=f.relatedTarget||f.toElement,ge=Y,ye=ye?Os(ye):null,ye!==null&&(jt=nn(ye),ye!==jt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(ge=null,ye=Y),ge!==ye)){if(be=cb,ue="onMouseLeave",U="onMouseEnter",z="mouse",(s==="pointerout"||s==="pointerover")&&(be=db,ue="onPointerLeave",U="onPointerEnter",z="pointer"),jt=ge==null?ae:ka(ge),K=ye==null?ae:ka(ye),ae=new be(ue,z+"leave",ge,f,oe),ae.target=jt,ae.relatedTarget=K,ue=null,Os(oe)===Y&&(be=new be(U,z+"enter",ye,f,oe),be.target=K,be.relatedTarget=jt,ue=be),jt=ue,ge&&ye)t:{for(be=ge,U=ye,z=0,K=be;K;K=Sa(K))z++;for(K=0,ue=U;ue;ue=Sa(ue))K++;for(;0<z-K;)be=Sa(be),z--;for(;0<K-z;)U=Sa(U),K--;for(;z--;){if(be===U||U!==null&&be===U.alternate)break t;be=Sa(be),U=Sa(U)}be=null}else be=null;ge!==null&&$b(ce,ae,ge,be,!1),ye!==null&&jt!==null&&$b(ce,jt,ye,be,!0)}}e:{if(ae=Y?ka(Y):window,ge=ae.nodeName&&ae.nodeName.toLowerCase(),ge==="select"||ge==="input"&&ae.type==="file")var je=W_;else if(vb(ae))if(yb)je=G_;else{je=K_;var Pe=q_}else(ge=ae.nodeName)&&ge.toLowerCase()==="input"&&(ae.type==="checkbox"||ae.type==="radio")&&(je=H_);if(je&&(je=je(s,Y))){xb(ce,je,f,oe);break e}Pe&&Pe(s,ae,Y),s==="focusout"&&(Pe=ae._wrapperState)&&Pe.controlled&&ae.type==="number"&&yn(ae,"number",ae.value)}switch(Pe=Y?ka(Y):window,s){case"focusin":(vb(Pe)||Pe.contentEditable==="true")&&(wa=Pe,Fp=Y,Qo=null);break;case"focusout":Qo=Fp=wa=null;break;case"mousedown":Bp=!0;break;case"contextmenu":case"mouseup":case"dragend":Bp=!1,Cb(ce,f,oe);break;case"selectionchange":if(Q_)break;case"keydown":case"keyup":Cb(ce,f,oe)}var Ce;if(Rp)e:{switch(s){case"compositionstart":var Te="onCompositionStart";break e;case"compositionend":Te="onCompositionEnd";break e;case"compositionupdate":Te="onCompositionUpdate";break e}Te=void 0}else ba?mb(s,f)&&(Te="onCompositionEnd"):s==="keydown"&&f.keyCode===229&&(Te="onCompositionStart");Te&&(fb&&f.locale!=="ko"&&(ba||Te!=="onCompositionStart"?Te==="onCompositionEnd"&&ba&&(Ce=ob()):(Wi=oe,Ep="value"in Wi?Wi.value:Wi.textContent,ba=!0)),Pe=Jc(Y,Te),0<Pe.length&&(Te=new ub(Te,s,null,f,oe),ce.push({event:Te,listeners:Pe}),Ce?Te.data=Ce:(Ce=gb(f),Ce!==null&&(Te.data=Ce)))),(Ce=z_?F_(s,f):B_(s,f))&&(Y=Jc(Y,"onBeforeInput"),0<Y.length&&(oe=new ub("onBeforeInput","beforeinput",null,f,oe),ce.push({event:oe,listeners:Y}),oe.data=Ce))}Rb(ce,o)})}function el(s,o,f){return{instance:s,listener:o,currentTarget:f}}function Jc(s,o){for(var f=o+"Capture",g=[];s!==null;){var y=s,N=y.stateNode;y.tag===5&&N!==null&&(y=N,N=Dr(s,f),N!=null&&g.unshift(el(s,N,y)),N=Dr(s,o),N!=null&&g.push(el(s,N,y))),s=s.return}return g}function Sa(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function $b(s,o,f,g,y){for(var N=o._reactName,T=[];f!==null&&f!==g;){var I=f,R=I.alternate,Y=I.stateNode;if(R!==null&&R===g)break;I.tag===5&&Y!==null&&(I=Y,y?(R=Dr(f,N),R!=null&&T.unshift(el(f,R,I))):y||(R=Dr(f,N),R!=null&&T.push(el(f,R,I)))),f=f.return}T.length!==0&&s.push({event:o,listeners:T})}var tI=/\r\n?/g,nI=/\u0000|\uFFFD/g;function zb(s){return(typeof s=="string"?s:""+s).replace(tI,`
|
|
38
|
-
`).replace(nI,"")}function Zc(s,o,f){if(o=zb(o),zb(s)!==o&&f)throw Error(n(425))}function eu(){}var Hp=null,Gp=null;function Yp(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 Xp=typeof setTimeout=="function"?setTimeout:void 0,rI=typeof clearTimeout=="function"?clearTimeout:void 0,Fb=typeof Promise=="function"?Promise:void 0,iI=typeof queueMicrotask=="function"?queueMicrotask:typeof Fb<"u"?function(s){return Fb.resolve(null).then(s).catch(sI)}:Xp;function sI(s){setTimeout(function(){throw s})}function Qp(s,o){var f=o,g=0;do{var y=f.nextSibling;if(s.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"){if(g===0){s.removeChild(y),Wo(o);return}g--}else f!=="$"&&f!=="$?"&&f!=="$!"||g++;f=y}while(f);Wo(o)}function Ki(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 Bb(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 Na=Math.random().toString(36).slice(2),Lr="__reactFiber$"+Na,tl="__reactProps$"+Na,ri="__reactContainer$"+Na,Jp="__reactEvents$"+Na,aI="__reactListeners$"+Na,oI="__reactHandles$"+Na;function Os(s){var o=s[Lr];if(o)return o;for(var f=s.parentNode;f;){if(o=f[ri]||f[Lr]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(s=Bb(s);s!==null;){if(f=s[Lr])return f;s=Bb(s)}return o}s=f,f=s.parentNode}return null}function nl(s){return s=s[Lr]||s[ri],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function ka(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function tu(s){return s[tl]||null}var Zp=[],Pa=-1;function Hi(s){return{current:s}}function at(s){0>Pa||(s.current=Zp[Pa],Zp[Pa]=null,Pa--)}function nt(s,o){Pa++,Zp[Pa]=s.current,s.current=o}var Gi={},rn=Hi(Gi),jn=Hi(!1),As=Gi;function Ca(s,o){var f=s.type.contextTypes;if(!f)return Gi;var g=s.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===o)return g.__reactInternalMemoizedMaskedChildContext;var y={},N;for(N in f)y[N]=o[N];return g&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=o,s.__reactInternalMemoizedMaskedChildContext=y),y}function Sn(s){return s=s.childContextTypes,s!=null}function nu(){at(jn),at(rn)}function Vb(s,o,f){if(rn.current!==Gi)throw Error(n(168));nt(rn,o),nt(jn,f)}function Ub(s,o,f){var g=s.stateNode;if(o=o.childContextTypes,typeof g.getChildContext!="function")return f;g=g.getChildContext();for(var y in g)if(!(y in o))throw Error(n(108,pe(s)||"Unknown",y));return W({},f,g)}function ru(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Gi,As=rn.current,nt(rn,s),nt(jn,jn.current),!0}function Wb(s,o,f){var g=s.stateNode;if(!g)throw Error(n(169));f?(s=Ub(s,o,As),g.__reactInternalMemoizedMergedChildContext=s,at(jn),at(rn),nt(rn,s)):at(jn),nt(jn,f)}var ii=null,iu=!1,eh=!1;function qb(s){ii===null?ii=[s]:ii.push(s)}function lI(s){iu=!0,qb(s)}function Yi(){if(!eh&&ii!==null){eh=!0;var s=0,o=Ge;try{var f=ii;for(Ge=1;s<f.length;s++){var g=f[s];do g=g(!0);while(g!==null)}ii=null,iu=!1}catch(y){throw ii!==null&&(ii=ii.slice(s+1)),Hy(jp,Yi),y}finally{Ge=o,eh=!1}}return null}var Oa=[],Aa=0,su=null,au=0,Xn=[],Qn=0,Es=null,si=1,ai="";function Ts(s,o){Oa[Aa++]=au,Oa[Aa++]=su,su=s,au=o}function Kb(s,o,f){Xn[Qn++]=si,Xn[Qn++]=ai,Xn[Qn++]=Es,Es=s;var g=si;s=ai;var y=32-vr(g)-1;g&=~(1<<y),f+=1;var N=32-vr(o)+y;if(30<N){var T=y-y%5;N=(g&(1<<T)-1).toString(32),g>>=T,y-=T,si=1<<32-vr(o)+y|f<<y|g,ai=N+s}else si=1<<N|f<<y|g,ai=s}function th(s){s.return!==null&&(Ts(s,1),Kb(s,1,0))}function nh(s){for(;s===su;)su=Oa[--Aa],Oa[Aa]=null,au=Oa[--Aa],Oa[Aa]=null;for(;s===Es;)Es=Xn[--Qn],Xn[Qn]=null,ai=Xn[--Qn],Xn[Qn]=null,si=Xn[--Qn],Xn[Qn]=null}var Dn=null,Rn=null,ut=!1,yr=null;function Hb(s,o){var f=tr(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 Gb(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,Dn=s,Rn=Ki(o.firstChild),!0):!1;case 6:return o=s.pendingProps===""||o.nodeType!==3?null:o,o!==null?(s.stateNode=o,Dn=s,Rn=null,!0):!1;case 13:return o=o.nodeType!==8?null:o,o!==null?(f=Es!==null?{id:si,overflow:ai}:null,s.memoizedState={dehydrated:o,treeContext:f,retryLane:1073741824},f=tr(18,null,null,0),f.stateNode=o,f.return=s,s.child=f,Dn=s,Rn=null,!0):!1;default:return!1}}function rh(s){return(s.mode&1)!==0&&(s.flags&128)===0}function ih(s){if(ut){var o=Rn;if(o){var f=o;if(!Gb(s,o)){if(rh(s))throw Error(n(418));o=Ki(f.nextSibling);var g=Dn;o&&Gb(s,o)?Hb(g,f):(s.flags=s.flags&-4097|2,ut=!1,Dn=s)}}else{if(rh(s))throw Error(n(418));s.flags=s.flags&-4097|2,ut=!1,Dn=s}}}function Yb(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Dn=s}function ou(s){if(s!==Dn)return!1;if(!ut)return Yb(s),ut=!0,!1;var o;if((o=s.tag!==3)&&!(o=s.tag!==5)&&(o=s.type,o=o!=="head"&&o!=="body"&&!Yp(s.type,s.memoizedProps)),o&&(o=Rn)){if(rh(s))throw Xb(),Error(n(418));for(;o;)Hb(s,o),o=Ki(o.nextSibling)}if(Yb(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){Rn=Ki(s.nextSibling);break e}o--}else f!=="$"&&f!=="$!"&&f!=="$?"||o++}s=s.nextSibling}Rn=null}}else Rn=Dn?Ki(s.stateNode.nextSibling):null;return!0}function Xb(){for(var s=Rn;s;)s=Ki(s.nextSibling)}function Ea(){Rn=Dn=null,ut=!1}function sh(s){yr===null?yr=[s]:yr.push(s)}var cI=O.ReactCurrentBatchConfig;function rl(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 g=f.stateNode}if(!g)throw Error(n(147,s));var y=g,N=""+s;return o!==null&&o.ref!==null&&typeof o.ref=="function"&&o.ref._stringRef===N?o.ref:(o=function(T){var I=y.refs;T===null?delete I[N]:I[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 lu(s,o){throw s=Object.prototype.toString.call(o),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":s))}function Qb(s){var o=s._init;return o(s._payload)}function Jb(s){function o(U,z){if(s){var K=U.deletions;K===null?(U.deletions=[z],U.flags|=16):K.push(z)}}function f(U,z){if(!s)return null;for(;z!==null;)o(U,z),z=z.sibling;return null}function g(U,z){for(U=new Map;z!==null;)z.key!==null?U.set(z.key,z):U.set(z.index,z),z=z.sibling;return U}function y(U,z){return U=rs(U,z),U.index=0,U.sibling=null,U}function N(U,z,K){return U.index=K,s?(K=U.alternate,K!==null?(K=K.index,K<z?(U.flags|=2,z):K):(U.flags|=2,z)):(U.flags|=1048576,z)}function T(U){return s&&U.alternate===null&&(U.flags|=2),U}function I(U,z,K,ue){return z===null||z.tag!==6?(z=Xh(K,U.mode,ue),z.return=U,z):(z=y(z,K),z.return=U,z)}function R(U,z,K,ue){var je=K.type;return je===M?oe(U,z,K.props.children,ue,K.key):z!==null&&(z.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===re&&Qb(je)===z.type)?(ue=y(z,K.props),ue.ref=rl(U,z,K),ue.return=U,ue):(ue=Mu(K.type,K.key,K.props,null,U.mode,ue),ue.ref=rl(U,z,K),ue.return=U,ue)}function Y(U,z,K,ue){return z===null||z.tag!==4||z.stateNode.containerInfo!==K.containerInfo||z.stateNode.implementation!==K.implementation?(z=Qh(K,U.mode,ue),z.return=U,z):(z=y(z,K.children||[]),z.return=U,z)}function oe(U,z,K,ue,je){return z===null||z.tag!==7?(z=zs(K,U.mode,ue,je),z.return=U,z):(z=y(z,K),z.return=U,z)}function ce(U,z,K){if(typeof z=="string"&&z!==""||typeof z=="number")return z=Xh(""+z,U.mode,K),z.return=U,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case P:return K=Mu(z.type,z.key,z.props,null,U.mode,K),K.ref=rl(U,null,z),K.return=U,K;case A:return z=Qh(z,U.mode,K),z.return=U,z;case re:var ue=z._init;return ce(U,ue(z._payload),K)}if(bn(z)||G(z))return z=zs(z,U.mode,K,null),z.return=U,z;lu(U,z)}return null}function ae(U,z,K,ue){var je=z!==null?z.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return je!==null?null:I(U,z,""+K,ue);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case P:return K.key===je?R(U,z,K,ue):null;case A:return K.key===je?Y(U,z,K,ue):null;case re:return je=K._init,ae(U,z,je(K._payload),ue)}if(bn(K)||G(K))return je!==null?null:oe(U,z,K,ue,null);lu(U,K)}return null}function ge(U,z,K,ue,je){if(typeof ue=="string"&&ue!==""||typeof ue=="number")return U=U.get(K)||null,I(z,U,""+ue,je);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case P:return U=U.get(ue.key===null?K:ue.key)||null,R(z,U,ue,je);case A:return U=U.get(ue.key===null?K:ue.key)||null,Y(z,U,ue,je);case re:var Pe=ue._init;return ge(U,z,K,Pe(ue._payload),je)}if(bn(ue)||G(ue))return U=U.get(K)||null,oe(z,U,ue,je,null);lu(z,ue)}return null}function ye(U,z,K,ue){for(var je=null,Pe=null,Ce=z,Te=z=0,zt=null;Ce!==null&&Te<K.length;Te++){Ce.index>Te?(zt=Ce,Ce=null):zt=Ce.sibling;var Ue=ae(U,Ce,K[Te],ue);if(Ue===null){Ce===null&&(Ce=zt);break}s&&Ce&&Ue.alternate===null&&o(U,Ce),z=N(Ue,z,Te),Pe===null?je=Ue:Pe.sibling=Ue,Pe=Ue,Ce=zt}if(Te===K.length)return f(U,Ce),ut&&Ts(U,Te),je;if(Ce===null){for(;Te<K.length;Te++)Ce=ce(U,K[Te],ue),Ce!==null&&(z=N(Ce,z,Te),Pe===null?je=Ce:Pe.sibling=Ce,Pe=Ce);return ut&&Ts(U,Te),je}for(Ce=g(U,Ce);Te<K.length;Te++)zt=ge(Ce,U,Te,K[Te],ue),zt!==null&&(s&&zt.alternate!==null&&Ce.delete(zt.key===null?Te:zt.key),z=N(zt,z,Te),Pe===null?je=zt:Pe.sibling=zt,Pe=zt);return s&&Ce.forEach(function(is){return o(U,is)}),ut&&Ts(U,Te),je}function be(U,z,K,ue){var je=G(K);if(typeof je!="function")throw Error(n(150));if(K=je.call(K),K==null)throw Error(n(151));for(var Pe=je=null,Ce=z,Te=z=0,zt=null,Ue=K.next();Ce!==null&&!Ue.done;Te++,Ue=K.next()){Ce.index>Te?(zt=Ce,Ce=null):zt=Ce.sibling;var is=ae(U,Ce,Ue.value,ue);if(is===null){Ce===null&&(Ce=zt);break}s&&Ce&&is.alternate===null&&o(U,Ce),z=N(is,z,Te),Pe===null?je=is:Pe.sibling=is,Pe=is,Ce=zt}if(Ue.done)return f(U,Ce),ut&&Ts(U,Te),je;if(Ce===null){for(;!Ue.done;Te++,Ue=K.next())Ue=ce(U,Ue.value,ue),Ue!==null&&(z=N(Ue,z,Te),Pe===null?je=Ue:Pe.sibling=Ue,Pe=Ue);return ut&&Ts(U,Te),je}for(Ce=g(U,Ce);!Ue.done;Te++,Ue=K.next())Ue=ge(Ce,U,Te,Ue.value,ue),Ue!==null&&(s&&Ue.alternate!==null&&Ce.delete(Ue.key===null?Te:Ue.key),z=N(Ue,z,Te),Pe===null?je=Ue:Pe.sibling=Ue,Pe=Ue);return s&&Ce.forEach(function(VI){return o(U,VI)}),ut&&Ts(U,Te),je}function jt(U,z,K,ue){if(typeof K=="object"&&K!==null&&K.type===M&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case P:e:{for(var je=K.key,Pe=z;Pe!==null;){if(Pe.key===je){if(je=K.type,je===M){if(Pe.tag===7){f(U,Pe.sibling),z=y(Pe,K.props.children),z.return=U,U=z;break e}}else if(Pe.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===re&&Qb(je)===Pe.type){f(U,Pe.sibling),z=y(Pe,K.props),z.ref=rl(U,Pe,K),z.return=U,U=z;break e}f(U,Pe);break}else o(U,Pe);Pe=Pe.sibling}K.type===M?(z=zs(K.props.children,U.mode,ue,K.key),z.return=U,U=z):(ue=Mu(K.type,K.key,K.props,null,U.mode,ue),ue.ref=rl(U,z,K),ue.return=U,U=ue)}return T(U);case A:e:{for(Pe=K.key;z!==null;){if(z.key===Pe)if(z.tag===4&&z.stateNode.containerInfo===K.containerInfo&&z.stateNode.implementation===K.implementation){f(U,z.sibling),z=y(z,K.children||[]),z.return=U,U=z;break e}else{f(U,z);break}else o(U,z);z=z.sibling}z=Qh(K,U.mode,ue),z.return=U,U=z}return T(U);case re:return Pe=K._init,jt(U,z,Pe(K._payload),ue)}if(bn(K))return ye(U,z,K,ue);if(G(K))return be(U,z,K,ue);lu(U,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,z!==null&&z.tag===6?(f(U,z.sibling),z=y(z,K),z.return=U,U=z):(f(U,z),z=Xh(K,U.mode,ue),z.return=U,U=z),T(U)):f(U,z)}return jt}var Ta=Jb(!0),Zb=Jb(!1),cu=Hi(null),uu=null,Ma=null,ah=null;function oh(){ah=Ma=uu=null}function lh(s){var o=cu.current;at(cu),s._currentValue=o}function ch(s,o,f){for(;s!==null;){var g=s.alternate;if((s.childLanes&o)!==o?(s.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),s===f)break;s=s.return}}function _a(s,o){uu=s,ah=Ma=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&o)!==0&&(Nn=!0),s.firstContext=null)}function Jn(s){var o=s._currentValue;if(ah!==s)if(s={context:s,memoizedValue:o,next:null},Ma===null){if(uu===null)throw Error(n(308));Ma=s,uu.dependencies={lanes:0,firstContext:s}}else Ma=Ma.next=s;return o}var Ms=null;function uh(s){Ms===null?Ms=[s]:Ms.push(s)}function ew(s,o,f,g){var y=o.interleaved;return y===null?(f.next=f,uh(o)):(f.next=y.next,y.next=f),o.interleaved=f,oi(s,g)}function oi(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 Xi=!1;function dh(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tw(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 li(s,o){return{eventTime:s,lane:o,tag:0,payload:null,callback:null,next:null}}function Qi(s,o,f){var g=s.updateQueue;if(g===null)return null;if(g=g.shared,(Ve&2)!==0){var y=g.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),g.pending=o,oi(s,f)}return y=g.interleaved,y===null?(o.next=o,uh(g)):(o.next=y.next,y.next=o),g.interleaved=o,oi(s,f)}function du(s,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194240)!==0)){var g=o.lanes;g&=s.pendingLanes,f|=g,o.lanes=f,kp(s,f)}}function nw(s,o){var f=s.updateQueue,g=s.alternate;if(g!==null&&(g=g.updateQueue,f===g)){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:g.baseState,firstBaseUpdate:y,lastBaseUpdate:N,shared:g.shared,effects:g.effects},s.updateQueue=f;return}s=f.lastBaseUpdate,s===null?f.firstBaseUpdate=o:s.next=o,f.lastBaseUpdate=o}function fu(s,o,f,g){var y=s.updateQueue;Xi=!1;var N=y.firstBaseUpdate,T=y.lastBaseUpdate,I=y.shared.pending;if(I!==null){y.shared.pending=null;var R=I,Y=R.next;R.next=null,T===null?N=Y:T.next=Y,T=R;var oe=s.alternate;oe!==null&&(oe=oe.updateQueue,I=oe.lastBaseUpdate,I!==T&&(I===null?oe.firstBaseUpdate=Y:I.next=Y,oe.lastBaseUpdate=R))}if(N!==null){var ce=y.baseState;T=0,oe=Y=R=null,I=N;do{var ae=I.lane,ge=I.eventTime;if((g&ae)===ae){oe!==null&&(oe=oe.next={eventTime:ge,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var ye=s,be=I;switch(ae=o,ge=f,be.tag){case 1:if(ye=be.payload,typeof ye=="function"){ce=ye.call(ge,ce,ae);break e}ce=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=be.payload,ae=typeof ye=="function"?ye.call(ge,ce,ae):ye,ae==null)break e;ce=W({},ce,ae);break e;case 2:Xi=!0}}I.callback!==null&&I.lane!==0&&(s.flags|=64,ae=y.effects,ae===null?y.effects=[I]:ae.push(I))}else ge={eventTime:ge,lane:ae,tag:I.tag,payload:I.payload,callback:I.callback,next:null},oe===null?(Y=oe=ge,R=ce):oe=oe.next=ge,T|=ae;if(I=I.next,I===null){if(I=y.shared.pending,I===null)break;ae=I,I=ae.next,ae.next=null,y.lastBaseUpdate=ae,y.shared.pending=null}}while(!0);if(oe===null&&(R=ce),y.baseState=R,y.firstBaseUpdate=Y,y.lastBaseUpdate=oe,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 rw(s,o,f){if(s=o.effects,o.effects=null,s!==null)for(o=0;o<s.length;o++){var g=s[o],y=g.callback;if(y!==null){if(g.callback=null,g=f,typeof y!="function")throw Error(n(191,y));y.call(g)}}}var il={},$r=Hi(il),sl=Hi(il),al=Hi(il);function _s(s){if(s===il)throw Error(n(174));return s}function fh(s,o){switch(nt(al,o),nt(sl,s),nt($r,il),s=o.nodeType,s){case 9:case 11:o=(o=o.documentElement)?o.namespaceURI:It(null,"");break;default:s=s===8?o.parentNode:o,o=s.namespaceURI||null,s=s.tagName,o=It(o,s)}at($r),nt($r,o)}function Ia(){at($r),at(sl),at(al)}function iw(s){_s(al.current);var o=_s($r.current),f=It(o,s.type);o!==f&&(nt(sl,s),nt($r,f))}function ph(s){sl.current===s&&(at($r),at(sl))}var pt=Hi(0);function pu(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 hh=[];function mh(){for(var s=0;s<hh.length;s++)hh[s]._workInProgressVersionPrimary=null;hh.length=0}var hu=O.ReactCurrentDispatcher,gh=O.ReactCurrentBatchConfig,Is=0,ht=null,Ot=null,Lt=null,mu=!1,ol=!1,ll=0,uI=0;function sn(){throw Error(n(321))}function vh(s,o){if(o===null)return!1;for(var f=0;f<o.length&&f<s.length;f++)if(!xr(s[f],o[f]))return!1;return!0}function xh(s,o,f,g,y,N){if(Is=N,ht=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,hu.current=s===null||s.memoizedState===null?hI:mI,s=f(g,y),ol){N=0;do{if(ol=!1,ll=0,25<=N)throw Error(n(301));N+=1,Lt=Ot=null,o.updateQueue=null,hu.current=gI,s=f(g,y)}while(ol)}if(hu.current=xu,o=Ot!==null&&Ot.next!==null,Is=0,Lt=Ot=ht=null,mu=!1,o)throw Error(n(300));return s}function yh(){var s=ll!==0;return ll=0,s}function zr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?ht.memoizedState=Lt=s:Lt=Lt.next=s,Lt}function Zn(){if(Ot===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=Ot.next;var o=Lt===null?ht.memoizedState:Lt.next;if(o!==null)Lt=o,Ot=s;else{if(s===null)throw Error(n(310));Ot=s,s={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},Lt===null?ht.memoizedState=Lt=s:Lt=Lt.next=s}return Lt}function cl(s,o){return typeof o=="function"?o(s):o}function bh(s){var o=Zn(),f=o.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=s;var g=Ot,y=g.baseQueue,N=f.pending;if(N!==null){if(y!==null){var T=y.next;y.next=N.next,N.next=T}g.baseQueue=y=N,f.pending=null}if(y!==null){N=y.next,g=g.baseState;var I=T=null,R=null,Y=N;do{var oe=Y.lane;if((Is&oe)===oe)R!==null&&(R=R.next={lane:0,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null}),g=Y.hasEagerState?Y.eagerState:s(g,Y.action);else{var ce={lane:oe,action:Y.action,hasEagerState:Y.hasEagerState,eagerState:Y.eagerState,next:null};R===null?(I=R=ce,T=g):R=R.next=ce,ht.lanes|=oe,Ds|=oe}Y=Y.next}while(Y!==null&&Y!==N);R===null?T=g:R.next=I,xr(g,o.memoizedState)||(Nn=!0),o.memoizedState=g,o.baseState=T,o.baseQueue=R,f.lastRenderedState=g}if(s=f.interleaved,s!==null){y=s;do N=y.lane,ht.lanes|=N,Ds|=N,y=y.next;while(y!==s)}else y===null&&(f.lanes=0);return[o.memoizedState,f.dispatch]}function wh(s){var o=Zn(),f=o.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=s;var g=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);xr(N,o.memoizedState)||(Nn=!0),o.memoizedState=N,o.baseQueue===null&&(o.baseState=N),f.lastRenderedState=N}return[N,g]}function sw(){}function aw(s,o){var f=ht,g=Zn(),y=o(),N=!xr(g.memoizedState,y);if(N&&(g.memoizedState=y,Nn=!0),g=g.queue,jh(cw.bind(null,f,g,s),[s]),g.getSnapshot!==o||N||Lt!==null&&Lt.memoizedState.tag&1){if(f.flags|=2048,ul(9,lw.bind(null,f,g,y,o),void 0,null),$t===null)throw Error(n(349));(Is&30)!==0||ow(f,o,y)}return y}function ow(s,o,f){s.flags|=16384,s={getSnapshot:o,value:f},o=ht.updateQueue,o===null?(o={lastEffect:null,stores:null},ht.updateQueue=o,o.stores=[s]):(f=o.stores,f===null?o.stores=[s]:f.push(s))}function lw(s,o,f,g){o.value=f,o.getSnapshot=g,uw(o)&&dw(s)}function cw(s,o,f){return f(function(){uw(o)&&dw(s)})}function uw(s){var o=s.getSnapshot;s=s.value;try{var f=o();return!xr(s,f)}catch{return!0}}function dw(s){var o=oi(s,1);o!==null&&Sr(o,s,1,-1)}function fw(s){var o=zr();return typeof s=="function"&&(s=s()),o.memoizedState=o.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:cl,lastRenderedState:s},o.queue=s,s=s.dispatch=pI.bind(null,ht,s),[o.memoizedState,s]}function ul(s,o,f,g){return s={tag:s,create:o,destroy:f,deps:g,next:null},o=ht.updateQueue,o===null?(o={lastEffect:null,stores:null},ht.updateQueue=o,o.lastEffect=s.next=s):(f=o.lastEffect,f===null?o.lastEffect=s.next=s:(g=f.next,f.next=s,s.next=g,o.lastEffect=s)),s}function pw(){return Zn().memoizedState}function gu(s,o,f,g){var y=zr();ht.flags|=s,y.memoizedState=ul(1|o,f,void 0,g===void 0?null:g)}function vu(s,o,f,g){var y=Zn();g=g===void 0?null:g;var N=void 0;if(Ot!==null){var T=Ot.memoizedState;if(N=T.destroy,g!==null&&vh(g,T.deps)){y.memoizedState=ul(o,f,N,g);return}}ht.flags|=s,y.memoizedState=ul(1|o,f,N,g)}function hw(s,o){return gu(8390656,8,s,o)}function jh(s,o){return vu(2048,8,s,o)}function mw(s,o){return vu(4,2,s,o)}function gw(s,o){return vu(4,4,s,o)}function vw(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 xw(s,o,f){return f=f!=null?f.concat([s]):null,vu(4,4,vw.bind(null,o,s),f)}function Sh(){}function yw(s,o){var f=Zn();o=o===void 0?null:o;var g=f.memoizedState;return g!==null&&o!==null&&vh(o,g[1])?g[0]:(f.memoizedState=[s,o],s)}function bw(s,o){var f=Zn();o=o===void 0?null:o;var g=f.memoizedState;return g!==null&&o!==null&&vh(o,g[1])?g[0]:(s=s(),f.memoizedState=[s,o],s)}function ww(s,o,f){return(Is&21)===0?(s.baseState&&(s.baseState=!1,Nn=!0),s.memoizedState=f):(xr(f,o)||(f=Qy(),ht.lanes|=f,Ds|=f,s.baseState=!0),o)}function dI(s,o){var f=Ge;Ge=f!==0&&4>f?f:4,s(!0);var g=gh.transition;gh.transition={};try{s(!1),o()}finally{Ge=f,gh.transition=g}}function jw(){return Zn().memoizedState}function fI(s,o,f){var g=ts(s);if(f={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null},Sw(s))Nw(o,f);else if(f=ew(s,o,f,g),f!==null){var y=pn();Sr(f,s,g,y),kw(f,o,g)}}function pI(s,o,f){var g=ts(s),y={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null};if(Sw(s))Nw(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,I=N(T,f);if(y.hasEagerState=!0,y.eagerState=I,xr(I,T)){var R=o.interleaved;R===null?(y.next=y,uh(o)):(y.next=R.next,R.next=y),o.interleaved=y;return}}catch{}finally{}f=ew(s,o,y,g),f!==null&&(y=pn(),Sr(f,s,g,y),kw(f,o,g))}}function Sw(s){var o=s.alternate;return s===ht||o!==null&&o===ht}function Nw(s,o){ol=mu=!0;var f=s.pending;f===null?o.next=o:(o.next=f.next,f.next=o),s.pending=o}function kw(s,o,f){if((f&4194240)!==0){var g=o.lanes;g&=s.pendingLanes,f|=g,o.lanes=f,kp(s,f)}}var xu={readContext:Jn,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useInsertionEffect:sn,useLayoutEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useMutableSource:sn,useSyncExternalStore:sn,useId:sn,unstable_isNewReconciler:!1},hI={readContext:Jn,useCallback:function(s,o){return zr().memoizedState=[s,o===void 0?null:o],s},useContext:Jn,useEffect:hw,useImperativeHandle:function(s,o,f){return f=f!=null?f.concat([s]):null,gu(4194308,4,vw.bind(null,o,s),f)},useLayoutEffect:function(s,o){return gu(4194308,4,s,o)},useInsertionEffect:function(s,o){return gu(4,2,s,o)},useMemo:function(s,o){var f=zr();return o=o===void 0?null:o,s=s(),f.memoizedState=[s,o],s},useReducer:function(s,o,f){var g=zr();return o=f!==void 0?f(o):o,g.memoizedState=g.baseState=o,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:o},g.queue=s,s=s.dispatch=fI.bind(null,ht,s),[g.memoizedState,s]},useRef:function(s){var o=zr();return s={current:s},o.memoizedState=s},useState:fw,useDebugValue:Sh,useDeferredValue:function(s){return zr().memoizedState=s},useTransition:function(){var s=fw(!1),o=s[0];return s=dI.bind(null,s[1]),zr().memoizedState=s,[o,s]},useMutableSource:function(){},useSyncExternalStore:function(s,o,f){var g=ht,y=zr();if(ut){if(f===void 0)throw Error(n(407));f=f()}else{if(f=o(),$t===null)throw Error(n(349));(Is&30)!==0||ow(g,o,f)}y.memoizedState=f;var N={value:f,getSnapshot:o};return y.queue=N,hw(cw.bind(null,g,N,s),[s]),g.flags|=2048,ul(9,lw.bind(null,g,N,f,o),void 0,null),f},useId:function(){var s=zr(),o=$t.identifierPrefix;if(ut){var f=ai,g=si;f=(g&~(1<<32-vr(g)-1)).toString(32)+f,o=":"+o+"R"+f,f=ll++,0<f&&(o+="H"+f.toString(32)),o+=":"}else f=uI++,o=":"+o+"r"+f.toString(32)+":";return s.memoizedState=o},unstable_isNewReconciler:!1},mI={readContext:Jn,useCallback:yw,useContext:Jn,useEffect:jh,useImperativeHandle:xw,useInsertionEffect:mw,useLayoutEffect:gw,useMemo:bw,useReducer:bh,useRef:pw,useState:function(){return bh(cl)},useDebugValue:Sh,useDeferredValue:function(s){var o=Zn();return ww(o,Ot.memoizedState,s)},useTransition:function(){var s=bh(cl)[0],o=Zn().memoizedState;return[s,o]},useMutableSource:sw,useSyncExternalStore:aw,useId:jw,unstable_isNewReconciler:!1},gI={readContext:Jn,useCallback:yw,useContext:Jn,useEffect:jh,useImperativeHandle:xw,useInsertionEffect:mw,useLayoutEffect:gw,useMemo:bw,useReducer:wh,useRef:pw,useState:function(){return wh(cl)},useDebugValue:Sh,useDeferredValue:function(s){var o=Zn();return Ot===null?o.memoizedState=s:ww(o,Ot.memoizedState,s)},useTransition:function(){var s=wh(cl)[0],o=Zn().memoizedState;return[s,o]},useMutableSource:sw,useSyncExternalStore:aw,useId:jw,unstable_isNewReconciler:!1};function br(s,o){if(s&&s.defaultProps){o=W({},o),s=s.defaultProps;for(var f in s)o[f]===void 0&&(o[f]=s[f]);return o}return o}function Nh(s,o,f,g){o=s.memoizedState,f=f(g,o),f=f==null?o:W({},o,f),s.memoizedState=f,s.lanes===0&&(s.updateQueue.baseState=f)}var yu={isMounted:function(s){return(s=s._reactInternals)?nn(s)===s:!1},enqueueSetState:function(s,o,f){s=s._reactInternals;var g=pn(),y=ts(s),N=li(g,y);N.payload=o,f!=null&&(N.callback=f),o=Qi(s,N,y),o!==null&&(Sr(o,s,y,g),du(o,s,y))},enqueueReplaceState:function(s,o,f){s=s._reactInternals;var g=pn(),y=ts(s),N=li(g,y);N.tag=1,N.payload=o,f!=null&&(N.callback=f),o=Qi(s,N,y),o!==null&&(Sr(o,s,y,g),du(o,s,y))},enqueueForceUpdate:function(s,o){s=s._reactInternals;var f=pn(),g=ts(s),y=li(f,g);y.tag=2,o!=null&&(y.callback=o),o=Qi(s,y,g),o!==null&&(Sr(o,s,g,f),du(o,s,g))}};function Pw(s,o,f,g,y,N,T){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(g,N,T):o.prototype&&o.prototype.isPureReactComponent?!Xo(f,g)||!Xo(y,N):!0}function Cw(s,o,f){var g=!1,y=Gi,N=o.contextType;return typeof N=="object"&&N!==null?N=Jn(N):(y=Sn(o)?As:rn.current,g=o.contextTypes,N=(g=g!=null)?Ca(s,y):Gi),o=new o(f,N),s.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=yu,s.stateNode=o,o._reactInternals=s,g&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=y,s.__reactInternalMemoizedMaskedChildContext=N),o}function Ow(s,o,f,g){s=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,g),o.state!==s&&yu.enqueueReplaceState(o,o.state,null)}function kh(s,o,f,g){var y=s.stateNode;y.props=f,y.state=s.memoizedState,y.refs={},dh(s);var N=o.contextType;typeof N=="object"&&N!==null?y.context=Jn(N):(N=Sn(o)?As:rn.current,y.context=Ca(s,N)),y.state=s.memoizedState,N=o.getDerivedStateFromProps,typeof N=="function"&&(Nh(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&&yu.enqueueReplaceState(y,y.state,null),fu(s,f,y,g),y.state=s.memoizedState),typeof y.componentDidMount=="function"&&(s.flags|=4194308)}function Da(s,o){try{var f="",g=o;do f+=te(g),g=g.return;while(g);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 Ph(s,o,f){return{value:s,source:null,stack:f??null,digest:o??null}}function Ch(s,o){try{console.error(o.value)}catch(f){setTimeout(function(){throw f})}}var vI=typeof WeakMap=="function"?WeakMap:Map;function Aw(s,o,f){f=li(-1,f),f.tag=3,f.payload={element:null};var g=o.value;return f.callback=function(){Pu||(Pu=!0,Vh=g),Ch(s,o)},f}function Ew(s,o,f){f=li(-1,f),f.tag=3;var g=s.type.getDerivedStateFromError;if(typeof g=="function"){var y=o.value;f.payload=function(){return g(y)},f.callback=function(){Ch(s,o)}}var N=s.stateNode;return N!==null&&typeof N.componentDidCatch=="function"&&(f.callback=function(){Ch(s,o),typeof g!="function"&&(Zi===null?Zi=new Set([this]):Zi.add(this));var T=o.stack;this.componentDidCatch(o.value,{componentStack:T!==null?T:""})}),f}function Tw(s,o,f){var g=s.pingCache;if(g===null){g=s.pingCache=new vI;var y=new Set;g.set(o,y)}else y=g.get(o),y===void 0&&(y=new Set,g.set(o,y));y.has(f)||(y.add(f),s=TI.bind(null,s,o,f),o.then(s,s))}function Mw(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,g,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=li(-1,1),o.tag=2,Qi(f,o,1))),f.lanes|=1),s):(s.flags|=65536,s.lanes=y,s)}var xI=O.ReactCurrentOwner,Nn=!1;function fn(s,o,f,g){o.child=s===null?Zb(o,null,f,g):Ta(o,s.child,f,g)}function Iw(s,o,f,g,y){f=f.render;var N=o.ref;return _a(o,y),g=xh(s,o,f,g,N,y),f=yh(),s!==null&&!Nn?(o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~y,ci(s,o,y)):(ut&&f&&th(o),o.flags|=1,fn(s,o,g,y),o.child)}function Dw(s,o,f,g,y){if(s===null){var N=f.type;return typeof N=="function"&&!Yh(N)&&N.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(o.tag=15,o.type=N,Rw(s,o,N,g,y)):(s=Mu(f.type,null,g,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:Xo,f(T,g)&&s.ref===o.ref)return ci(s,o,y)}return o.flags|=1,s=rs(N,g),s.ref=o.ref,s.return=o,o.child=s}function Rw(s,o,f,g,y){if(s!==null){var N=s.memoizedProps;if(Xo(N,g)&&s.ref===o.ref)if(Nn=!1,o.pendingProps=g=N,(s.lanes&y)!==0)(s.flags&131072)!==0&&(Nn=!0);else return o.lanes=s.lanes,ci(s,o,y)}return Oh(s,o,f,g,y)}function Lw(s,o,f){var g=o.pendingProps,y=g.children,N=s!==null?s.memoizedState:null;if(g.mode==="hidden")if((o.mode&1)===0)o.memoizedState={baseLanes:0,cachePool:null,transitions:null},nt(La,Ln),Ln|=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,nt(La,Ln),Ln|=s,null;o.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=N!==null?N.baseLanes:f,nt(La,Ln),Ln|=g}else N!==null?(g=N.baseLanes|f,o.memoizedState=null):g=f,nt(La,Ln),Ln|=g;return fn(s,o,y,f),o.child}function $w(s,o){var f=o.ref;(s===null&&f!==null||s!==null&&s.ref!==f)&&(o.flags|=512,o.flags|=2097152)}function Oh(s,o,f,g,y){var N=Sn(f)?As:rn.current;return N=Ca(o,N),_a(o,y),f=xh(s,o,f,g,N,y),g=yh(),s!==null&&!Nn?(o.updateQueue=s.updateQueue,o.flags&=-2053,s.lanes&=~y,ci(s,o,y)):(ut&&g&&th(o),o.flags|=1,fn(s,o,f,y),o.child)}function zw(s,o,f,g,y){if(Sn(f)){var N=!0;ru(o)}else N=!1;if(_a(o,y),o.stateNode===null)wu(s,o),Cw(o,f,g),kh(o,f,g,y),g=!0;else if(s===null){var T=o.stateNode,I=o.memoizedProps;T.props=I;var R=T.context,Y=f.contextType;typeof Y=="object"&&Y!==null?Y=Jn(Y):(Y=Sn(f)?As:rn.current,Y=Ca(o,Y));var oe=f.getDerivedStateFromProps,ce=typeof oe=="function"||typeof T.getSnapshotBeforeUpdate=="function";ce||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(I!==g||R!==Y)&&Ow(o,T,g,Y),Xi=!1;var ae=o.memoizedState;T.state=ae,fu(o,g,T,y),R=o.memoizedState,I!==g||ae!==R||jn.current||Xi?(typeof oe=="function"&&(Nh(o,f,oe,g),R=o.memoizedState),(I=Xi||Pw(o,f,I,g,ae,R,Y))?(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=g,o.memoizedState=R),T.props=g,T.state=R,T.context=Y,g=I):(typeof T.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{T=o.stateNode,tw(s,o),I=o.memoizedProps,Y=o.type===o.elementType?I:br(o.type,I),T.props=Y,ce=o.pendingProps,ae=T.context,R=f.contextType,typeof R=="object"&&R!==null?R=Jn(R):(R=Sn(f)?As:rn.current,R=Ca(o,R));var ge=f.getDerivedStateFromProps;(oe=typeof ge=="function"||typeof T.getSnapshotBeforeUpdate=="function")||typeof T.UNSAFE_componentWillReceiveProps!="function"&&typeof T.componentWillReceiveProps!="function"||(I!==ce||ae!==R)&&Ow(o,T,g,R),Xi=!1,ae=o.memoizedState,T.state=ae,fu(o,g,T,y);var ye=o.memoizedState;I!==ce||ae!==ye||jn.current||Xi?(typeof ge=="function"&&(Nh(o,f,ge,g),ye=o.memoizedState),(Y=Xi||Pw(o,f,Y,g,ae,ye,R)||!1)?(oe||typeof T.UNSAFE_componentWillUpdate!="function"&&typeof T.componentWillUpdate!="function"||(typeof T.componentWillUpdate=="function"&&T.componentWillUpdate(g,ye,R),typeof T.UNSAFE_componentWillUpdate=="function"&&T.UNSAFE_componentWillUpdate(g,ye,R)),typeof T.componentDidUpdate=="function"&&(o.flags|=4),typeof T.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof T.componentDidUpdate!="function"||I===s.memoizedProps&&ae===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===s.memoizedProps&&ae===s.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=ye),T.props=g,T.state=ye,T.context=R,g=Y):(typeof T.componentDidUpdate!="function"||I===s.memoizedProps&&ae===s.memoizedState||(o.flags|=4),typeof T.getSnapshotBeforeUpdate!="function"||I===s.memoizedProps&&ae===s.memoizedState||(o.flags|=1024),g=!1)}return Ah(s,o,f,g,N,y)}function Ah(s,o,f,g,y,N){$w(s,o);var T=(o.flags&128)!==0;if(!g&&!T)return y&&Wb(o,f,!1),ci(s,o,N);g=o.stateNode,xI.current=o;var I=T&&typeof f.getDerivedStateFromError!="function"?null:g.render();return o.flags|=1,s!==null&&T?(o.child=Ta(o,s.child,null,N),o.child=Ta(o,null,I,N)):fn(s,o,I,N),o.memoizedState=g.state,y&&Wb(o,f,!0),o.child}function Fw(s){var o=s.stateNode;o.pendingContext?Vb(s,o.pendingContext,o.pendingContext!==o.context):o.context&&Vb(s,o.context,!1),fh(s,o.containerInfo)}function Bw(s,o,f,g,y){return Ea(),sh(y),o.flags|=256,fn(s,o,f,g),o.child}var Eh={dehydrated:null,treeContext:null,retryLane:0};function Th(s){return{baseLanes:s,cachePool:null,transitions:null}}function Vw(s,o,f){var g=o.pendingProps,y=pt.current,N=!1,T=(o.flags&128)!==0,I;if((I=T)||(I=s!==null&&s.memoizedState===null?!1:(y&2)!==0),I?(N=!0,o.flags&=-129):(s===null||s.memoizedState!==null)&&(y|=1),nt(pt,y&1),s===null)return ih(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=g.children,s=g.fallback,N?(g=o.mode,N=o.child,T={mode:"hidden",children:T},(g&1)===0&&N!==null?(N.childLanes=0,N.pendingProps=T):N=_u(T,g,0,null),s=zs(s,g,f,null),N.return=o,s.return=o,N.sibling=s,o.child=N,o.child.memoizedState=Th(f),o.memoizedState=Eh,s):Mh(o,T));if(y=s.memoizedState,y!==null&&(I=y.dehydrated,I!==null))return yI(s,o,T,g,I,y,f);if(N){N=g.fallback,T=o.mode,y=s.child,I=y.sibling;var R={mode:"hidden",children:g.children};return(T&1)===0&&o.child!==y?(g=o.child,g.childLanes=0,g.pendingProps=R,o.deletions=null):(g=rs(y,R),g.subtreeFlags=y.subtreeFlags&14680064),I!==null?N=rs(I,N):(N=zs(N,T,f,null),N.flags|=2),N.return=o,g.return=o,g.sibling=N,o.child=g,g=N,N=o.child,T=s.child.memoizedState,T=T===null?Th(f):{baseLanes:T.baseLanes|f,cachePool:null,transitions:T.transitions},N.memoizedState=T,N.childLanes=s.childLanes&~f,o.memoizedState=Eh,g}return N=s.child,s=N.sibling,g=rs(N,{mode:"visible",children:g.children}),(o.mode&1)===0&&(g.lanes=f),g.return=o,g.sibling=null,s!==null&&(f=o.deletions,f===null?(o.deletions=[s],o.flags|=16):f.push(s)),o.child=g,o.memoizedState=null,g}function Mh(s,o){return o=_u({mode:"visible",children:o},s.mode,0,null),o.return=s,s.child=o}function bu(s,o,f,g){return g!==null&&sh(g),Ta(o,s.child,null,f),s=Mh(o,o.pendingProps.children),s.flags|=2,o.memoizedState=null,s}function yI(s,o,f,g,y,N,T){if(f)return o.flags&256?(o.flags&=-257,g=Ph(Error(n(422))),bu(s,o,T,g)):o.memoizedState!==null?(o.child=s.child,o.flags|=128,null):(N=g.fallback,y=o.mode,g=_u({mode:"visible",children:g.children},y,0,null),N=zs(N,y,T,null),N.flags|=2,g.return=o,N.return=o,g.sibling=N,o.child=g,(o.mode&1)!==0&&Ta(o,s.child,null,T),o.child.memoizedState=Th(T),o.memoizedState=Eh,N);if((o.mode&1)===0)return bu(s,o,T,null);if(y.data==="$!"){if(g=y.nextSibling&&y.nextSibling.dataset,g)var I=g.dgst;return g=I,N=Error(n(419)),g=Ph(N,g,void 0),bu(s,o,T,g)}if(I=(T&s.childLanes)!==0,Nn||I){if(g=$t,g!==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&(g.suspendedLanes|T))!==0?0:y,y!==0&&y!==N.retryLane&&(N.retryLane=y,oi(s,y),Sr(g,s,y,-1))}return Gh(),g=Ph(Error(n(421))),bu(s,o,T,g)}return y.data==="$?"?(o.flags|=128,o.child=s.child,o=MI.bind(null,s),y._reactRetry=o,null):(s=N.treeContext,Rn=Ki(y.nextSibling),Dn=o,ut=!0,yr=null,s!==null&&(Xn[Qn++]=si,Xn[Qn++]=ai,Xn[Qn++]=Es,si=s.id,ai=s.overflow,Es=o),o=Mh(o,g.children),o.flags|=4096,o)}function Uw(s,o,f){s.lanes|=o;var g=s.alternate;g!==null&&(g.lanes|=o),ch(s.return,o,f)}function _h(s,o,f,g,y){var N=s.memoizedState;N===null?s.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:y}:(N.isBackwards=o,N.rendering=null,N.renderingStartTime=0,N.last=g,N.tail=f,N.tailMode=y)}function Ww(s,o,f){var g=o.pendingProps,y=g.revealOrder,N=g.tail;if(fn(s,o,g.children,f),g=pt.current,(g&2)!==0)g=g&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&&Uw(s,f,o);else if(s.tag===19)Uw(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}g&=1}if(nt(pt,g),(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&&pu(s)===null&&(y=f),f=f.sibling;f=y,f===null?(y=o.child,o.child=null):(y=f.sibling,f.sibling=null),_h(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&&pu(s)===null){o.child=y;break}s=y.sibling,y.sibling=f,f=y,y=s}_h(o,!0,f,null,N);break;case"together":_h(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function wu(s,o){(o.mode&1)===0&&s!==null&&(s.alternate=null,o.alternate=null,o.flags|=2)}function ci(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=rs(s,s.pendingProps),o.child=f,f.return=o;s.sibling!==null;)s=s.sibling,f=f.sibling=rs(s,s.pendingProps),f.return=o;f.sibling=null}return o.child}function bI(s,o,f){switch(o.tag){case 3:Fw(o),Ea();break;case 5:iw(o);break;case 1:Sn(o.type)&&ru(o);break;case 4:fh(o,o.stateNode.containerInfo);break;case 10:var g=o.type._context,y=o.memoizedProps.value;nt(cu,g._currentValue),g._currentValue=y;break;case 13:if(g=o.memoizedState,g!==null)return g.dehydrated!==null?(nt(pt,pt.current&1),o.flags|=128,null):(f&o.child.childLanes)!==0?Vw(s,o,f):(nt(pt,pt.current&1),s=ci(s,o,f),s!==null?s.sibling:null);nt(pt,pt.current&1);break;case 19:if(g=(f&o.childLanes)!==0,(s.flags&128)!==0){if(g)return Ww(s,o,f);o.flags|=128}if(y=o.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),nt(pt,pt.current),g)break;return null;case 22:case 23:return o.lanes=0,Lw(s,o,f)}return ci(s,o,f)}var qw,Ih,Kw,Hw;qw=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}},Ih=function(){},Kw=function(s,o,f,g){var y=s.memoizedProps;if(y!==g){s=o.stateNode,_s($r.current);var N=null;switch(f){case"input":y=De(s,y),g=De(s,g),N=[];break;case"select":y=W({},y,{value:void 0}),g=W({},g,{value:void 0}),N=[];break;case"textarea":y=he(s,y),g=he(s,g),N=[];break;default:typeof y.onClick!="function"&&typeof g.onClick=="function"&&(s.onclick=eu)}ti(f,g);var T;f=null;for(Y in y)if(!g.hasOwnProperty(Y)&&y.hasOwnProperty(Y)&&y[Y]!=null)if(Y==="style"){var I=y[Y];for(T in I)I.hasOwnProperty(T)&&(f||(f={}),f[T]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(i.hasOwnProperty(Y)?N||(N=[]):(N=N||[]).push(Y,null));for(Y in g){var R=g[Y];if(I=y!=null?y[Y]:void 0,g.hasOwnProperty(Y)&&R!==I&&(R!=null||I!=null))if(Y==="style")if(I){for(T in I)!I.hasOwnProperty(T)||R&&R.hasOwnProperty(T)||(f||(f={}),f[T]="");for(T in R)R.hasOwnProperty(T)&&I[T]!==R[T]&&(f||(f={}),f[T]=R[T])}else f||(N||(N=[]),N.push(Y,f)),f=R;else Y==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,I=I?I.__html:void 0,R!=null&&I!==R&&(N=N||[]).push(Y,R)):Y==="children"?typeof R!="string"&&typeof R!="number"||(N=N||[]).push(Y,""+R):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(i.hasOwnProperty(Y)?(R!=null&&Y==="onScroll"&&st("scroll",s),N||I===R||(N=[])):(N=N||[]).push(Y,R))}f&&(N=N||[]).push("style",f);var Y=N;(o.updateQueue=Y)&&(o.flags|=4)}},Hw=function(s,o,f,g){f!==g&&(o.flags|=4)};function dl(s,o){if(!ut)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 g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?o||s.tail===null?s.tail=null:s.tail.sibling=null:g.sibling=null}}function an(s){var o=s.alternate!==null&&s.alternate.child===s.child,f=0,g=0;if(o)for(var y=s.child;y!==null;)f|=y.lanes|y.childLanes,g|=y.subtreeFlags&14680064,g|=y.flags&14680064,y.return=s,y=y.sibling;else for(y=s.child;y!==null;)f|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=s,y=y.sibling;return s.subtreeFlags|=g,s.childLanes=f,o}function wI(s,o,f){var g=o.pendingProps;switch(nh(o),o.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(o),null;case 1:return Sn(o.type)&&nu(),an(o),null;case 3:return g=o.stateNode,Ia(),at(jn),at(rn),mh(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(s===null||s.child===null)&&(ou(o)?o.flags|=4:s===null||s.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,yr!==null&&(qh(yr),yr=null))),Ih(s,o),an(o),null;case 5:ph(o);var y=_s(al.current);if(f=o.type,s!==null&&o.stateNode!=null)Kw(s,o,f,g,y),s.ref!==o.ref&&(o.flags|=512,o.flags|=2097152);else{if(!g){if(o.stateNode===null)throw Error(n(166));return an(o),null}if(s=_s($r.current),ou(o)){g=o.stateNode,f=o.type;var N=o.memoizedProps;switch(g[Lr]=o,g[tl]=N,s=(o.mode&1)!==0,f){case"dialog":st("cancel",g),st("close",g);break;case"iframe":case"object":case"embed":st("load",g);break;case"video":case"audio":for(y=0;y<Jo.length;y++)st(Jo[y],g);break;case"source":st("error",g);break;case"img":case"image":case"link":st("error",g),st("load",g);break;case"details":st("toggle",g);break;case"input":Qe(g,N),st("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!N.multiple},st("invalid",g);break;case"textarea":ke(g,N),st("invalid",g)}ti(f,N),y=null;for(var T in N)if(N.hasOwnProperty(T)){var I=N[T];T==="children"?typeof I=="string"?g.textContent!==I&&(N.suppressHydrationWarning!==!0&&Zc(g.textContent,I,s),y=["children",I]):typeof I=="number"&&g.textContent!==""+I&&(N.suppressHydrationWarning!==!0&&Zc(g.textContent,I,s),y=["children",""+I]):i.hasOwnProperty(T)&&I!=null&&T==="onScroll"&&st("scroll",g)}switch(f){case"input":Oe(g),Mn(g,N,!0);break;case"textarea":Oe(g),Je(g);break;case"select":case"option":break;default:typeof N.onClick=="function"&&(g.onclick=eu)}g=y,o.updateQueue=g,g!==null&&(o.flags|=4)}else{T=y.nodeType===9?y:y.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=Ct(f)),s==="http://www.w3.org/1999/xhtml"?f==="script"?(s=T.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof g.is=="string"?s=T.createElement(f,{is:g.is}):(s=T.createElement(f),f==="select"&&(T=s,g.multiple?T.multiple=!0:g.size&&(T.size=g.size))):s=T.createElementNS(s,f),s[Lr]=o,s[tl]=g,qw(s,o,!1,!1),o.stateNode=s;e:{switch(T=Mr(f,g),f){case"dialog":st("cancel",s),st("close",s),y=g;break;case"iframe":case"object":case"embed":st("load",s),y=g;break;case"video":case"audio":for(y=0;y<Jo.length;y++)st(Jo[y],s);y=g;break;case"source":st("error",s),y=g;break;case"img":case"image":case"link":st("error",s),st("load",s),y=g;break;case"details":st("toggle",s),y=g;break;case"input":Qe(s,g),y=De(s,g),st("invalid",s);break;case"option":y=g;break;case"select":s._wrapperState={wasMultiple:!!g.multiple},y=W({},g,{value:void 0}),st("invalid",s);break;case"textarea":ke(s,g),y=he(s,g),st("invalid",s);break;default:y=g}ti(f,y),I=y;for(N in I)if(I.hasOwnProperty(N)){var R=I[N];N==="style"?ma(s,R):N==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&dn(s,R)):N==="children"?typeof R=="string"?(f!=="textarea"||R!=="")&&He(s,R):typeof R=="number"&&He(s,""+R):N!=="suppressContentEditableWarning"&&N!=="suppressHydrationWarning"&&N!=="autoFocus"&&(i.hasOwnProperty(N)?R!=null&&N==="onScroll"&&st("scroll",s):R!=null&&E(s,N,R,T))}switch(f){case"input":Oe(s),Mn(s,g,!1);break;case"textarea":Oe(s),Je(s);break;case"option":g.value!=null&&s.setAttribute("value",""+Se(g.value));break;case"select":s.multiple=!!g.multiple,N=g.value,N!=null?wn(s,!!g.multiple,N,!1):g.defaultValue!=null&&wn(s,!!g.multiple,g.defaultValue,!0);break;default:typeof y.onClick=="function"&&(s.onclick=eu)}switch(f){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(o.flags|=4)}o.ref!==null&&(o.flags|=512,o.flags|=2097152)}return an(o),null;case 6:if(s&&o.stateNode!=null)Hw(s,o,s.memoizedProps,g);else{if(typeof g!="string"&&o.stateNode===null)throw Error(n(166));if(f=_s(al.current),_s($r.current),ou(o)){if(g=o.stateNode,f=o.memoizedProps,g[Lr]=o,(N=g.nodeValue!==f)&&(s=Dn,s!==null))switch(s.tag){case 3:Zc(g.nodeValue,f,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Zc(g.nodeValue,f,(s.mode&1)!==0)}N&&(o.flags|=4)}else g=(f.nodeType===9?f:f.ownerDocument).createTextNode(g),g[Lr]=o,o.stateNode=g}return an(o),null;case 13:if(at(pt),g=o.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(ut&&Rn!==null&&(o.mode&1)!==0&&(o.flags&128)===0)Xb(),Ea(),o.flags|=98560,N=!1;else if(N=ou(o),g!==null&&g.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[Lr]=o}else Ea(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;an(o),N=!1}else yr!==null&&(qh(yr),yr=null),N=!0;if(!N)return o.flags&65536?o:null}return(o.flags&128)!==0?(o.lanes=f,o):(g=g!==null,g!==(s!==null&&s.memoizedState!==null)&&g&&(o.child.flags|=8192,(o.mode&1)!==0&&(s===null||(pt.current&1)!==0?At===0&&(At=3):Gh())),o.updateQueue!==null&&(o.flags|=4),an(o),null);case 4:return Ia(),Ih(s,o),s===null&&Zo(o.stateNode.containerInfo),an(o),null;case 10:return lh(o.type._context),an(o),null;case 17:return Sn(o.type)&&nu(),an(o),null;case 19:if(at(pt),N=o.memoizedState,N===null)return an(o),null;if(g=(o.flags&128)!==0,T=N.rendering,T===null)if(g)dl(N,!1);else{if(At!==0||s!==null&&(s.flags&128)!==0)for(s=o.child;s!==null;){if(T=pu(s),T!==null){for(o.flags|=128,dl(N,!1),g=T.updateQueue,g!==null&&(o.updateQueue=g,o.flags|=4),o.subtreeFlags=0,g=f,f=o.child;f!==null;)N=f,s=g,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 nt(pt,pt.current&1|2),o.child}s=s.sibling}N.tail!==null&&wt()>$a&&(o.flags|=128,g=!0,dl(N,!1),o.lanes=4194304)}else{if(!g)if(s=pu(T),s!==null){if(o.flags|=128,g=!0,f=s.updateQueue,f!==null&&(o.updateQueue=f,o.flags|=4),dl(N,!0),N.tail===null&&N.tailMode==="hidden"&&!T.alternate&&!ut)return an(o),null}else 2*wt()-N.renderingStartTime>$a&&f!==1073741824&&(o.flags|=128,g=!0,dl(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=wt(),o.sibling=null,f=pt.current,nt(pt,g?f&1|2:f&1),o):(an(o),null);case 22:case 23:return Hh(),g=o.memoizedState!==null,s!==null&&s.memoizedState!==null!==g&&(o.flags|=8192),g&&(o.mode&1)!==0?(Ln&1073741824)!==0&&(an(o),o.subtreeFlags&6&&(o.flags|=8192)):an(o),null;case 24:return null;case 25:return null}throw Error(n(156,o.tag))}function jI(s,o){switch(nh(o),o.tag){case 1:return Sn(o.type)&&nu(),s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 3:return Ia(),at(jn),at(rn),mh(),s=o.flags,(s&65536)!==0&&(s&128)===0?(o.flags=s&-65537|128,o):null;case 5:return ph(o),null;case 13:if(at(pt),s=o.memoizedState,s!==null&&s.dehydrated!==null){if(o.alternate===null)throw Error(n(340));Ea()}return s=o.flags,s&65536?(o.flags=s&-65537|128,o):null;case 19:return at(pt),null;case 4:return Ia(),null;case 10:return lh(o.type._context),null;case 22:case 23:return Hh(),null;case 24:return null;default:return null}}var ju=!1,on=!1,SI=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Ra(s,o){var f=s.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(g){gt(s,o,g)}else f.current=null}function Dh(s,o,f){try{f()}catch(g){gt(s,o,g)}}var Gw=!1;function NI(s,o){if(Hp=Vc,s=Pb(),zp(s)){if("selectionStart"in s)var f={start:s.selectionStart,end:s.selectionEnd};else e:{f=(f=s.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var y=g.anchorOffset,N=g.focusNode;g=g.focusOffset;try{f.nodeType,N.nodeType}catch{f=null;break e}var T=0,I=-1,R=-1,Y=0,oe=0,ce=s,ae=null;t:for(;;){for(var ge;ce!==f||y!==0&&ce.nodeType!==3||(I=T+y),ce!==N||g!==0&&ce.nodeType!==3||(R=T+g),ce.nodeType===3&&(T+=ce.nodeValue.length),(ge=ce.firstChild)!==null;)ae=ce,ce=ge;for(;;){if(ce===s)break t;if(ae===f&&++Y===y&&(I=T),ae===N&&++oe===g&&(R=T),(ge=ce.nextSibling)!==null)break;ce=ae,ae=ce.parentNode}ce=ge}f=I===-1||R===-1?null:{start:I,end:R}}else f=null}f=f||{start:0,end:0}}else f=null;for(Gp={focusedElem:s,selectionRange:f},Vc=!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 ye=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var be=ye.memoizedProps,jt=ye.memoizedState,U=o.stateNode,z=U.getSnapshotBeforeUpdate(o.elementType===o.type?be:br(o.type,be),jt);U.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var K=o.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ue){gt(o,o.return,ue)}if(s=o.sibling,s!==null){s.return=o.return,ve=s;break}ve=o.return}return ye=Gw,Gw=!1,ye}function fl(s,o,f){var g=o.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var y=g=g.next;do{if((y.tag&s)===s){var N=y.destroy;y.destroy=void 0,N!==void 0&&Dh(o,f,N)}y=y.next}while(y!==g)}}function Su(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 g=f.create;f.destroy=g()}f=f.next}while(f!==o)}}function Rh(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 Yw(s){var o=s.alternate;o!==null&&(s.alternate=null,Yw(o)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(o=s.stateNode,o!==null&&(delete o[Lr],delete o[tl],delete o[Jp],delete o[aI],delete o[oI])),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 Xw(s){return s.tag===5||s.tag===3||s.tag===4}function Qw(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Xw(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 Lh(s,o,f){var g=s.tag;if(g===5||g===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=eu));else if(g!==4&&(s=s.child,s!==null))for(Lh(s,o,f),s=s.sibling;s!==null;)Lh(s,o,f),s=s.sibling}function $h(s,o,f){var g=s.tag;if(g===5||g===6)s=s.stateNode,o?f.insertBefore(s,o):f.appendChild(s);else if(g!==4&&(s=s.child,s!==null))for($h(s,o,f),s=s.sibling;s!==null;)$h(s,o,f),s=s.sibling}var Gt=null,wr=!1;function Ji(s,o,f){for(f=f.child;f!==null;)Jw(s,o,f),f=f.sibling}function Jw(s,o,f){if(Rr&&typeof Rr.onCommitFiberUnmount=="function")try{Rr.onCommitFiberUnmount(Rc,f)}catch{}switch(f.tag){case 5:on||Ra(f,o);case 6:var g=Gt,y=wr;Gt=null,Ji(s,o,f),Gt=g,wr=y,Gt!==null&&(wr?(s=Gt,f=f.stateNode,s.nodeType===8?s.parentNode.removeChild(f):s.removeChild(f)):Gt.removeChild(f.stateNode));break;case 18:Gt!==null&&(wr?(s=Gt,f=f.stateNode,s.nodeType===8?Qp(s.parentNode,f):s.nodeType===1&&Qp(s,f),Wo(s)):Qp(Gt,f.stateNode));break;case 4:g=Gt,y=wr,Gt=f.stateNode.containerInfo,wr=!0,Ji(s,o,f),Gt=g,wr=y;break;case 0:case 11:case 14:case 15:if(!on&&(g=f.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){y=g=g.next;do{var N=y,T=N.destroy;N=N.tag,T!==void 0&&((N&2)!==0||(N&4)!==0)&&Dh(f,o,T),y=y.next}while(y!==g)}Ji(s,o,f);break;case 1:if(!on&&(Ra(f,o),g=f.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=f.memoizedProps,g.state=f.memoizedState,g.componentWillUnmount()}catch(I){gt(f,o,I)}Ji(s,o,f);break;case 21:Ji(s,o,f);break;case 22:f.mode&1?(on=(g=on)||f.memoizedState!==null,Ji(s,o,f),on=g):Ji(s,o,f);break;default:Ji(s,o,f)}}function Zw(s){var o=s.updateQueue;if(o!==null){s.updateQueue=null;var f=s.stateNode;f===null&&(f=s.stateNode=new SI),o.forEach(function(g){var y=_I.bind(null,s,g);f.has(g)||(f.add(g),g.then(y,y))})}}function jr(s,o){var f=o.deletions;if(f!==null)for(var g=0;g<f.length;g++){var y=f[g];try{var N=s,T=o,I=T;e:for(;I!==null;){switch(I.tag){case 5:Gt=I.stateNode,wr=!1;break e;case 3:Gt=I.stateNode.containerInfo,wr=!0;break e;case 4:Gt=I.stateNode.containerInfo,wr=!0;break e}I=I.return}if(Gt===null)throw Error(n(160));Jw(N,T,y),Gt=null,wr=!1;var R=y.alternate;R!==null&&(R.return=null),y.return=null}catch(Y){gt(y,o,Y)}}if(o.subtreeFlags&12854)for(o=o.child;o!==null;)e1(o,s),o=o.sibling}function e1(s,o){var f=s.alternate,g=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(jr(o,s),Fr(s),g&4){try{fl(3,s,s.return),Su(3,s)}catch(be){gt(s,s.return,be)}try{fl(5,s,s.return)}catch(be){gt(s,s.return,be)}}break;case 1:jr(o,s),Fr(s),g&512&&f!==null&&Ra(f,f.return);break;case 5:if(jr(o,s),Fr(s),g&512&&f!==null&&Ra(f,f.return),s.flags&32){var y=s.stateNode;try{He(y,"")}catch(be){gt(s,s.return,be)}}if(g&4&&(y=s.stateNode,y!=null)){var N=s.memoizedProps,T=f!==null?f.memoizedProps:N,I=s.type,R=s.updateQueue;if(s.updateQueue=null,R!==null)try{I==="input"&&N.type==="radio"&&N.name!=null&&Ze(y,N),Mr(I,T);var Y=Mr(I,N);for(T=0;T<R.length;T+=2){var oe=R[T],ce=R[T+1];oe==="style"?ma(y,ce):oe==="dangerouslySetInnerHTML"?dn(y,ce):oe==="children"?He(y,ce):E(y,oe,ce,Y)}switch(I){case"input":_t(y,N);break;case"textarea":_e(y,N);break;case"select":var ae=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!N.multiple;var ge=N.value;ge!=null?wn(y,!!N.multiple,ge,!1):ae!==!!N.multiple&&(N.defaultValue!=null?wn(y,!!N.multiple,N.defaultValue,!0):wn(y,!!N.multiple,N.multiple?[]:"",!1))}y[tl]=N}catch(be){gt(s,s.return,be)}}break;case 6:if(jr(o,s),Fr(s),g&4){if(s.stateNode===null)throw Error(n(162));y=s.stateNode,N=s.memoizedProps;try{y.nodeValue=N}catch(be){gt(s,s.return,be)}}break;case 3:if(jr(o,s),Fr(s),g&4&&f!==null&&f.memoizedState.isDehydrated)try{Wo(o.containerInfo)}catch(be){gt(s,s.return,be)}break;case 4:jr(o,s),Fr(s);break;case 13:jr(o,s),Fr(s),y=s.child,y.flags&8192&&(N=y.memoizedState!==null,y.stateNode.isHidden=N,!N||y.alternate!==null&&y.alternate.memoizedState!==null||(Bh=wt())),g&4&&Zw(s);break;case 22:if(oe=f!==null&&f.memoizedState!==null,s.mode&1?(on=(Y=on)||oe,jr(o,s),on=Y):jr(o,s),Fr(s),g&8192){if(Y=s.memoizedState!==null,(s.stateNode.isHidden=Y)&&!oe&&(s.mode&1)!==0)for(ve=s,oe=s.child;oe!==null;){for(ce=ve=oe;ve!==null;){switch(ae=ve,ge=ae.child,ae.tag){case 0:case 11:case 14:case 15:fl(4,ae,ae.return);break;case 1:Ra(ae,ae.return);var ye=ae.stateNode;if(typeof ye.componentWillUnmount=="function"){g=ae,f=ae.return;try{o=g,ye.props=o.memoizedProps,ye.state=o.memoizedState,ye.componentWillUnmount()}catch(be){gt(g,f,be)}}break;case 5:Ra(ae,ae.return);break;case 22:if(ae.memoizedState!==null){r1(ce);continue}}ge!==null?(ge.return=ae,ve=ge):r1(ce)}oe=oe.sibling}e:for(oe=null,ce=s;;){if(ce.tag===5){if(oe===null){oe=ce;try{y=ce.stateNode,Y?(N=y.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none"):(I=ce.stateNode,R=ce.memoizedProps.style,T=R!=null&&R.hasOwnProperty("display")?R.display:null,I.style.display=ha("display",T))}catch(be){gt(s,s.return,be)}}}else if(ce.tag===6){if(oe===null)try{ce.stateNode.nodeValue=Y?"":ce.memoizedProps}catch(be){gt(s,s.return,be)}}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;oe===ce&&(oe=null),ce=ce.return}oe===ce&&(oe=null),ce.sibling.return=ce.return,ce=ce.sibling}}break;case 19:jr(o,s),Fr(s),g&4&&Zw(s);break;case 21:break;default:jr(o,s),Fr(s)}}function Fr(s){var o=s.flags;if(o&2){try{e:{for(var f=s.return;f!==null;){if(Xw(f)){var g=f;break e}f=f.return}throw Error(n(160))}switch(g.tag){case 5:var y=g.stateNode;g.flags&32&&(He(y,""),g.flags&=-33);var N=Qw(s);$h(s,N,y);break;case 3:case 4:var T=g.stateNode.containerInfo,I=Qw(s);Lh(s,I,T);break;default:throw Error(n(161))}}catch(R){gt(s,s.return,R)}s.flags&=-3}o&4096&&(s.flags&=-4097)}function kI(s,o,f){ve=s,t1(s)}function t1(s,o,f){for(var g=(s.mode&1)!==0;ve!==null;){var y=ve,N=y.child;if(y.tag===22&&g){var T=y.memoizedState!==null||ju;if(!T){var I=y.alternate,R=I!==null&&I.memoizedState!==null||on;I=ju;var Y=on;if(ju=T,(on=R)&&!Y)for(ve=y;ve!==null;)T=ve,R=T.child,T.tag===22&&T.memoizedState!==null?i1(y):R!==null?(R.return=T,ve=R):i1(y);for(;N!==null;)ve=N,t1(N),N=N.sibling;ve=y,ju=I,on=Y}n1(s)}else(y.subtreeFlags&8772)!==0&&N!==null?(N.return=y,ve=N):n1(s)}}function n1(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:on||Su(5,o);break;case 1:var g=o.stateNode;if(o.flags&4&&!on)if(f===null)g.componentDidMount();else{var y=o.elementType===o.type?f.memoizedProps:br(o.type,f.memoizedProps);g.componentDidUpdate(y,f.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var N=o.updateQueue;N!==null&&rw(o,N,g);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}rw(o,T,f)}break;case 5:var I=o.stateNode;if(f===null&&o.flags&4){f=I;var R=o.memoizedProps;switch(o.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&f.focus();break;case"img":R.src&&(f.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(o.memoizedState===null){var Y=o.alternate;if(Y!==null){var oe=Y.memoizedState;if(oe!==null){var ce=oe.dehydrated;ce!==null&&Wo(ce)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}on||o.flags&512&&Rh(o)}catch(ae){gt(o,o.return,ae)}}if(o===s){ve=null;break}if(f=o.sibling,f!==null){f.return=o.return,ve=f;break}ve=o.return}}function r1(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 i1(s){for(;ve!==null;){var o=ve;try{switch(o.tag){case 0:case 11:case 15:var f=o.return;try{Su(4,o)}catch(R){gt(o,f,R)}break;case 1:var g=o.stateNode;if(typeof g.componentDidMount=="function"){var y=o.return;try{g.componentDidMount()}catch(R){gt(o,y,R)}}var N=o.return;try{Rh(o)}catch(R){gt(o,N,R)}break;case 5:var T=o.return;try{Rh(o)}catch(R){gt(o,T,R)}}}catch(R){gt(o,o.return,R)}if(o===s){ve=null;break}var I=o.sibling;if(I!==null){I.return=o.return,ve=I;break}ve=o.return}}var PI=Math.ceil,Nu=O.ReactCurrentDispatcher,zh=O.ReactCurrentOwner,er=O.ReactCurrentBatchConfig,Ve=0,$t=null,kt=null,Yt=0,Ln=0,La=Hi(0),At=0,pl=null,Ds=0,ku=0,Fh=0,hl=null,kn=null,Bh=0,$a=1/0,ui=null,Pu=!1,Vh=null,Zi=null,Cu=!1,es=null,Ou=0,ml=0,Uh=null,Au=-1,Eu=0;function pn(){return(Ve&6)!==0?wt():Au!==-1?Au:Au=wt()}function ts(s){return(s.mode&1)===0?1:(Ve&2)!==0&&Yt!==0?Yt&-Yt:cI.transition!==null?(Eu===0&&(Eu=Qy()),Eu):(s=Ge,s!==0||(s=window.event,s=s===void 0?16:ab(s.type)),s)}function Sr(s,o,f,g){if(50<ml)throw ml=0,Uh=null,Error(n(185));zo(s,f,g),((Ve&2)===0||s!==$t)&&(s===$t&&((Ve&2)===0&&(ku|=f),At===4&&ns(s,Yt)),Pn(s,g),f===1&&Ve===0&&(o.mode&1)===0&&($a=wt()+500,iu&&Yi()))}function Pn(s,o){var f=s.callbackNode;c_(s,o);var g=zc(s,s===$t?Yt:0);if(g===0)f!==null&&Gy(f),s.callbackNode=null,s.callbackPriority=0;else if(o=g&-g,s.callbackPriority!==o){if(f!=null&&Gy(f),o===1)s.tag===0?lI(a1.bind(null,s)):qb(a1.bind(null,s)),iI(function(){(Ve&6)===0&&Yi()}),f=null;else{switch(Jy(g)){case 1:f=jp;break;case 4:f=Yy;break;case 16:f=Dc;break;case 536870912:f=Xy;break;default:f=Dc}f=h1(f,s1.bind(null,s))}s.callbackPriority=o,s.callbackNode=f}}function s1(s,o){if(Au=-1,Eu=0,(Ve&6)!==0)throw Error(n(327));var f=s.callbackNode;if(za()&&s.callbackNode!==f)return null;var g=zc(s,s===$t?Yt:0);if(g===0)return null;if((g&30)!==0||(g&s.expiredLanes)!==0||o)o=Tu(s,g);else{o=g;var y=Ve;Ve|=2;var N=l1();($t!==s||Yt!==o)&&(ui=null,$a=wt()+500,Ls(s,o));do try{AI();break}catch(I){o1(s,I)}while(!0);oh(),Nu.current=N,Ve=y,kt!==null?o=0:($t=null,Yt=0,o=At)}if(o!==0){if(o===2&&(y=Sp(s),y!==0&&(g=y,o=Wh(s,y))),o===1)throw f=pl,Ls(s,0),ns(s,g),Pn(s,wt()),f;if(o===6)ns(s,g);else{if(y=s.current.alternate,(g&30)===0&&!CI(y)&&(o=Tu(s,g),o===2&&(N=Sp(s),N!==0&&(g=N,o=Wh(s,N))),o===1))throw f=pl,Ls(s,0),ns(s,g),Pn(s,wt()),f;switch(s.finishedWork=y,s.finishedLanes=g,o){case 0:case 1:throw Error(n(345));case 2:$s(s,kn,ui);break;case 3:if(ns(s,g),(g&130023424)===g&&(o=Bh+500-wt(),10<o)){if(zc(s,0)!==0)break;if(y=s.suspendedLanes,(y&g)!==g){pn(),s.pingedLanes|=s.suspendedLanes&y;break}s.timeoutHandle=Xp($s.bind(null,s,kn,ui),o);break}$s(s,kn,ui);break;case 4:if(ns(s,g),(g&4194240)===g)break;for(o=s.eventTimes,y=-1;0<g;){var T=31-vr(g);N=1<<T,T=o[T],T>y&&(y=T),g&=~N}if(g=y,g=wt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*PI(g/1960))-g,10<g){s.timeoutHandle=Xp($s.bind(null,s,kn,ui),g);break}$s(s,kn,ui);break;case 5:$s(s,kn,ui);break;default:throw Error(n(329))}}}return Pn(s,wt()),s.callbackNode===f?s1.bind(null,s):null}function Wh(s,o){var f=hl;return s.current.memoizedState.isDehydrated&&(Ls(s,o).flags|=256),s=Tu(s,o),s!==2&&(o=kn,kn=f,o!==null&&qh(o)),s}function qh(s){kn===null?kn=s:kn.push.apply(kn,s)}function CI(s){for(var o=s;;){if(o.flags&16384){var f=o.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var g=0;g<f.length;g++){var y=f[g],N=y.getSnapshot;y=y.value;try{if(!xr(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 ns(s,o){for(o&=~Fh,o&=~ku,s.suspendedLanes|=o,s.pingedLanes&=~o,s=s.expirationTimes;0<o;){var f=31-vr(o),g=1<<f;s[f]=-1,o&=~g}}function a1(s){if((Ve&6)!==0)throw Error(n(327));za();var o=zc(s,0);if((o&1)===0)return Pn(s,wt()),null;var f=Tu(s,o);if(s.tag!==0&&f===2){var g=Sp(s);g!==0&&(o=g,f=Wh(s,g))}if(f===1)throw f=pl,Ls(s,0),ns(s,o),Pn(s,wt()),f;if(f===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=o,$s(s,kn,ui),Pn(s,wt()),null}function Kh(s,o){var f=Ve;Ve|=1;try{return s(o)}finally{Ve=f,Ve===0&&($a=wt()+500,iu&&Yi())}}function Rs(s){es!==null&&es.tag===0&&(Ve&6)===0&&za();var o=Ve;Ve|=1;var f=er.transition,g=Ge;try{if(er.transition=null,Ge=1,s)return s()}finally{Ge=g,er.transition=f,Ve=o,(Ve&6)===0&&Yi()}}function Hh(){Ln=La.current,at(La)}function Ls(s,o){s.finishedWork=null,s.finishedLanes=0;var f=s.timeoutHandle;if(f!==-1&&(s.timeoutHandle=-1,rI(f)),kt!==null)for(f=kt.return;f!==null;){var g=f;switch(nh(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&nu();break;case 3:Ia(),at(jn),at(rn),mh();break;case 5:ph(g);break;case 4:Ia();break;case 13:at(pt);break;case 19:at(pt);break;case 10:lh(g.type._context);break;case 22:case 23:Hh()}f=f.return}if($t=s,kt=s=rs(s.current,null),Yt=Ln=o,At=0,pl=null,Fh=ku=Ds=0,kn=hl=null,Ms!==null){for(o=0;o<Ms.length;o++)if(f=Ms[o],g=f.interleaved,g!==null){f.interleaved=null;var y=g.next,N=f.pending;if(N!==null){var T=N.next;N.next=y,g.next=T}f.pending=g}Ms=null}return s}function o1(s,o){do{var f=kt;try{if(oh(),hu.current=xu,mu){for(var g=ht.memoizedState;g!==null;){var y=g.queue;y!==null&&(y.pending=null),g=g.next}mu=!1}if(Is=0,Lt=Ot=ht=null,ol=!1,ll=0,zh.current=null,f===null||f.return===null){At=1,pl=o,kt=null;break}e:{var N=s,T=f.return,I=f,R=o;if(o=Yt,I.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var Y=R,oe=I,ce=oe.tag;if((oe.mode&1)===0&&(ce===0||ce===11||ce===15)){var ae=oe.alternate;ae?(oe.updateQueue=ae.updateQueue,oe.memoizedState=ae.memoizedState,oe.lanes=ae.lanes):(oe.updateQueue=null,oe.memoizedState=null)}var ge=Mw(T);if(ge!==null){ge.flags&=-257,_w(ge,T,I,N,o),ge.mode&1&&Tw(N,Y,o),o=ge,R=Y;var ye=o.updateQueue;if(ye===null){var be=new Set;be.add(R),o.updateQueue=be}else ye.add(R);break e}else{if((o&1)===0){Tw(N,Y,o),Gh();break e}R=Error(n(426))}}else if(ut&&I.mode&1){var jt=Mw(T);if(jt!==null){(jt.flags&65536)===0&&(jt.flags|=256),_w(jt,T,I,N,o),sh(Da(R,I));break e}}N=R=Da(R,I),At!==4&&(At=2),hl===null?hl=[N]:hl.push(N),N=T;do{switch(N.tag){case 3:N.flags|=65536,o&=-o,N.lanes|=o;var U=Aw(N,R,o);nw(N,U);break e;case 1:I=R;var z=N.type,K=N.stateNode;if((N.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(Zi===null||!Zi.has(K)))){N.flags|=65536,o&=-o,N.lanes|=o;var ue=Ew(N,I,o);nw(N,ue);break e}}N=N.return}while(N!==null)}u1(f)}catch(je){o=je,kt===f&&f!==null&&(kt=f=f.return);continue}break}while(!0)}function l1(){var s=Nu.current;return Nu.current=xu,s===null?xu:s}function Gh(){(At===0||At===3||At===2)&&(At=4),$t===null||(Ds&268435455)===0&&(ku&268435455)===0||ns($t,Yt)}function Tu(s,o){var f=Ve;Ve|=2;var g=l1();($t!==s||Yt!==o)&&(ui=null,Ls(s,o));do try{OI();break}catch(y){o1(s,y)}while(!0);if(oh(),Ve=f,Nu.current=g,kt!==null)throw Error(n(261));return $t=null,Yt=0,At}function OI(){for(;kt!==null;)c1(kt)}function AI(){for(;kt!==null&&!e_();)c1(kt)}function c1(s){var o=p1(s.alternate,s,Ln);s.memoizedProps=s.pendingProps,o===null?u1(s):kt=o,zh.current=null}function u1(s){var o=s;do{var f=o.alternate;if(s=o.return,(o.flags&32768)===0){if(f=wI(f,o,Ln),f!==null){kt=f;return}}else{if(f=jI(f,o),f!==null){f.flags&=32767,kt=f;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{At=6,kt=null;return}}if(o=o.sibling,o!==null){kt=o;return}kt=o=s}while(o!==null);At===0&&(At=5)}function $s(s,o,f){var g=Ge,y=er.transition;try{er.transition=null,Ge=1,EI(s,o,f,g)}finally{er.transition=y,Ge=g}return null}function EI(s,o,f,g){do za();while(es!==null);if((Ve&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(u_(s,N),s===$t&&(kt=$t=null,Yt=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Cu||(Cu=!0,h1(Dc,function(){return za(),null})),N=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||N){N=er.transition,er.transition=null;var T=Ge;Ge=1;var I=Ve;Ve|=4,zh.current=null,NI(s,f),e1(f,s),X_(Gp),Vc=!!Hp,Gp=Hp=null,s.current=f,kI(f),t_(),Ve=I,Ge=T,er.transition=N}else s.current=f;if(Cu&&(Cu=!1,es=s,Ou=y),N=s.pendingLanes,N===0&&(Zi=null),i_(f.stateNode),Pn(s,wt()),o!==null)for(g=s.onRecoverableError,f=0;f<o.length;f++)y=o[f],g(y.value,{componentStack:y.stack,digest:y.digest});if(Pu)throw Pu=!1,s=Vh,Vh=null,s;return(Ou&1)!==0&&s.tag!==0&&za(),N=s.pendingLanes,(N&1)!==0?s===Uh?ml++:(ml=0,Uh=s):ml=0,Yi(),null}function za(){if(es!==null){var s=Jy(Ou),o=er.transition,f=Ge;try{if(er.transition=null,Ge=16>s?16:s,es===null)var g=!1;else{if(s=es,es=null,Ou=0,(Ve&6)!==0)throw Error(n(331));var y=Ve;for(Ve|=4,ve=s.current;ve!==null;){var N=ve,T=N.child;if((ve.flags&16)!==0){var I=N.deletions;if(I!==null){for(var R=0;R<I.length;R++){var Y=I[R];for(ve=Y;ve!==null;){var oe=ve;switch(oe.tag){case 0:case 11:case 15:fl(8,oe,N)}var ce=oe.child;if(ce!==null)ce.return=oe,ve=ce;else for(;ve!==null;){oe=ve;var ae=oe.sibling,ge=oe.return;if(Yw(oe),oe===Y){ve=null;break}if(ae!==null){ae.return=ge,ve=ae;break}ve=ge}}}var ye=N.alternate;if(ye!==null){var be=ye.child;if(be!==null){ye.child=null;do{var jt=be.sibling;be.sibling=null,be=jt}while(be!==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:fl(9,N,N.return)}var U=N.sibling;if(U!==null){U.return=N.return,ve=U;break e}ve=N.return}}var z=s.current;for(ve=z;ve!==null;){T=ve;var K=T.child;if((T.subtreeFlags&2064)!==0&&K!==null)K.return=T,ve=K;else e:for(T=z;ve!==null;){if(I=ve,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:Su(9,I)}}catch(je){gt(I,I.return,je)}if(I===T){ve=null;break e}var ue=I.sibling;if(ue!==null){ue.return=I.return,ve=ue;break e}ve=I.return}}if(Ve=y,Yi(),Rr&&typeof Rr.onPostCommitFiberRoot=="function")try{Rr.onPostCommitFiberRoot(Rc,s)}catch{}g=!0}return g}finally{Ge=f,er.transition=o}}return!1}function d1(s,o,f){o=Da(f,o),o=Aw(s,o,1),s=Qi(s,o,1),o=pn(),s!==null&&(zo(s,1,o),Pn(s,o))}function gt(s,o,f){if(s.tag===3)d1(s,s,f);else for(;o!==null;){if(o.tag===3){d1(o,s,f);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Zi===null||!Zi.has(g))){s=Da(f,s),s=Ew(o,s,1),o=Qi(o,s,1),s=pn(),o!==null&&(zo(o,1,s),Pn(o,s));break}}o=o.return}}function TI(s,o,f){var g=s.pingCache;g!==null&&g.delete(o),o=pn(),s.pingedLanes|=s.suspendedLanes&f,$t===s&&(Yt&f)===f&&(At===4||At===3&&(Yt&130023424)===Yt&&500>wt()-Bh?Ls(s,0):Fh|=f),Pn(s,o)}function f1(s,o){o===0&&((s.mode&1)===0?o=1:(o=$c,$c<<=1,($c&130023424)===0&&($c=4194304)));var f=pn();s=oi(s,o),s!==null&&(zo(s,o,f),Pn(s,f))}function MI(s){var o=s.memoizedState,f=0;o!==null&&(f=o.retryLane),f1(s,f)}function _I(s,o){var f=0;switch(s.tag){case 13:var g=s.stateNode,y=s.memoizedState;y!==null&&(f=y.retryLane);break;case 19:g=s.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(o),f1(s,f)}var p1;p1=function(s,o,f){if(s!==null)if(s.memoizedProps!==o.pendingProps||jn.current)Nn=!0;else{if((s.lanes&f)===0&&(o.flags&128)===0)return Nn=!1,bI(s,o,f);Nn=(s.flags&131072)!==0}else Nn=!1,ut&&(o.flags&1048576)!==0&&Kb(o,au,o.index);switch(o.lanes=0,o.tag){case 2:var g=o.type;wu(s,o),s=o.pendingProps;var y=Ca(o,rn.current);_a(o,f),y=xh(null,o,g,s,y,f);var N=yh();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,Sn(g)?(N=!0,ru(o)):N=!1,o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,dh(o),y.updater=yu,o.stateNode=y,y._reactInternals=o,kh(o,g,s,f),o=Ah(null,o,g,!0,N,f)):(o.tag=0,ut&&N&&th(o),fn(null,o,y,f),o=o.child),o;case 16:g=o.elementType;e:{switch(wu(s,o),s=o.pendingProps,y=g._init,g=y(g._payload),o.type=g,y=o.tag=DI(g),s=br(g,s),y){case 0:o=Oh(null,o,g,s,f);break e;case 1:o=zw(null,o,g,s,f);break e;case 11:o=Iw(null,o,g,s,f);break e;case 14:o=Dw(null,o,g,br(g.type,s),f);break e}throw Error(n(306,g,""))}return o;case 0:return g=o.type,y=o.pendingProps,y=o.elementType===g?y:br(g,y),Oh(s,o,g,y,f);case 1:return g=o.type,y=o.pendingProps,y=o.elementType===g?y:br(g,y),zw(s,o,g,y,f);case 3:e:{if(Fw(o),s===null)throw Error(n(387));g=o.pendingProps,N=o.memoizedState,y=N.element,tw(s,o),fu(o,g,null,f);var T=o.memoizedState;if(g=T.element,N.isDehydrated)if(N={element:g,isDehydrated:!1,cache:T.cache,pendingSuspenseBoundaries:T.pendingSuspenseBoundaries,transitions:T.transitions},o.updateQueue.baseState=N,o.memoizedState=N,o.flags&256){y=Da(Error(n(423)),o),o=Bw(s,o,g,f,y);break e}else if(g!==y){y=Da(Error(n(424)),o),o=Bw(s,o,g,f,y);break e}else for(Rn=Ki(o.stateNode.containerInfo.firstChild),Dn=o,ut=!0,yr=null,f=Zb(o,null,g,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Ea(),g===y){o=ci(s,o,f);break e}fn(s,o,g,f)}o=o.child}return o;case 5:return iw(o),s===null&&ih(o),g=o.type,y=o.pendingProps,N=s!==null?s.memoizedProps:null,T=y.children,Yp(g,y)?T=null:N!==null&&Yp(g,N)&&(o.flags|=32),$w(s,o),fn(s,o,T,f),o.child;case 6:return s===null&&ih(o),null;case 13:return Vw(s,o,f);case 4:return fh(o,o.stateNode.containerInfo),g=o.pendingProps,s===null?o.child=Ta(o,null,g,f):fn(s,o,g,f),o.child;case 11:return g=o.type,y=o.pendingProps,y=o.elementType===g?y:br(g,y),Iw(s,o,g,y,f);case 7:return fn(s,o,o.pendingProps,f),o.child;case 8:return fn(s,o,o.pendingProps.children,f),o.child;case 12:return fn(s,o,o.pendingProps.children,f),o.child;case 10:e:{if(g=o.type._context,y=o.pendingProps,N=o.memoizedProps,T=y.value,nt(cu,g._currentValue),g._currentValue=T,N!==null)if(xr(N.value,T)){if(N.children===y.children&&!jn.current){o=ci(s,o,f);break e}}else for(N=o.child,N!==null&&(N.return=o);N!==null;){var I=N.dependencies;if(I!==null){T=N.child;for(var R=I.firstContext;R!==null;){if(R.context===g){if(N.tag===1){R=li(-1,f&-f),R.tag=2;var Y=N.updateQueue;if(Y!==null){Y=Y.shared;var oe=Y.pending;oe===null?R.next=R:(R.next=oe.next,oe.next=R),Y.pending=R}}N.lanes|=f,R=N.alternate,R!==null&&(R.lanes|=f),ch(N.return,f,o),I.lanes|=f;break}R=R.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,I=T.alternate,I!==null&&(I.lanes|=f),ch(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}fn(s,o,y.children,f),o=o.child}return o;case 9:return y=o.type,g=o.pendingProps.children,_a(o,f),y=Jn(y),g=g(y),o.flags|=1,fn(s,o,g,f),o.child;case 14:return g=o.type,y=br(g,o.pendingProps),y=br(g.type,y),Dw(s,o,g,y,f);case 15:return Rw(s,o,o.type,o.pendingProps,f);case 17:return g=o.type,y=o.pendingProps,y=o.elementType===g?y:br(g,y),wu(s,o),o.tag=1,Sn(g)?(s=!0,ru(o)):s=!1,_a(o,f),Cw(o,g,y),kh(o,g,y,f),Ah(null,o,g,!0,s,f);case 19:return Ww(s,o,f);case 22:return Lw(s,o,f)}throw Error(n(156,o.tag))};function h1(s,o){return Hy(s,o)}function II(s,o,f,g){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=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tr(s,o,f,g){return new II(s,o,f,g)}function Yh(s){return s=s.prototype,!(!s||!s.isReactComponent)}function DI(s){if(typeof s=="function")return Yh(s)?1:0;if(s!=null){if(s=s.$$typeof,s===L)return 11;if(s===ne)return 14}return 2}function rs(s,o){var f=s.alternate;return f===null?(f=tr(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 Mu(s,o,f,g,y,N){var T=2;if(g=s,typeof s=="function")Yh(s)&&(T=1);else if(typeof s=="string")T=5;else e:switch(s){case M:return zs(f.children,y,N,o);case D:T=8,y|=8;break;case $:return s=tr(12,f,o,y|2),s.elementType=$,s.lanes=N,s;case Z:return s=tr(13,f,o,y),s.elementType=Z,s.lanes=N,s;case J:return s=tr(19,f,o,y),s.elementType=J,s.lanes=N,s;case B:return _u(f,y,N,o);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case q:T=10;break e;case X:T=9;break e;case L:T=11;break e;case ne:T=14;break e;case re:T=16,g=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return o=tr(T,f,o,y),o.elementType=s,o.type=g,o.lanes=N,o}function zs(s,o,f,g){return s=tr(7,s,g,o),s.lanes=f,s}function _u(s,o,f,g){return s=tr(22,s,g,o),s.elementType=B,s.lanes=f,s.stateNode={isHidden:!1},s}function Xh(s,o,f){return s=tr(6,s,null,o),s.lanes=f,s}function Qh(s,o,f){return o=tr(4,s.children!==null?s.children:[],s.key,o),o.lanes=f,o.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},o}function RI(s,o,f,g,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=Np(0),this.expirationTimes=Np(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Np(0),this.identifierPrefix=g,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Jh(s,o,f,g,y,N,T,I,R){return s=new RI(s,o,f,I,R),o===1?(o=1,N===!0&&(o|=8)):o=0,N=tr(3,null,null,o),s.current=N,N.stateNode=s,N.memoizedState={element:g,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},dh(N),s}function LI(s,o,f){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:g==null?null:""+g,children:s,containerInfo:o,implementation:f}}function m1(s){if(!s)return Gi;s=s._reactInternals;e:{if(nn(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(Sn(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(Sn(f))return Ub(s,f,o)}return o}function g1(s,o,f,g,y,N,T,I,R){return s=Jh(f,g,!0,s,y,N,T,I,R),s.context=m1(null),f=s.current,g=pn(),y=ts(f),N=li(g,y),N.callback=o??null,Qi(f,N,y),s.current.lanes=y,zo(s,y,g),Pn(s,g),s}function Iu(s,o,f,g){var y=o.current,N=pn(),T=ts(y);return f=m1(f),o.context===null?o.context=f:o.pendingContext=f,o=li(N,T),o.payload={element:s},g=g===void 0?null:g,g!==null&&(o.callback=g),s=Qi(y,o,T),s!==null&&(Sr(s,y,T,N),du(s,y,T)),T}function Du(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 v1(s,o){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var f=s.retryLane;s.retryLane=f!==0&&f<o?f:o}}function Zh(s,o){v1(s,o),(s=s.alternate)&&v1(s,o)}function $I(){return null}var x1=typeof reportError=="function"?reportError:function(s){console.error(s)};function em(s){this._internalRoot=s}Ru.prototype.render=em.prototype.render=function(s){var o=this._internalRoot;if(o===null)throw Error(n(409));Iu(s,o,null,null)},Ru.prototype.unmount=em.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var o=s.containerInfo;Rs(function(){Iu(null,s,null,null)}),o[ri]=null}};function Ru(s){this._internalRoot=s}Ru.prototype.unstable_scheduleHydration=function(s){if(s){var o=tb();s={blockedOn:null,target:s,priority:o};for(var f=0;f<Ui.length&&o!==0&&o<Ui[f].priority;f++);Ui.splice(f,0,s),f===0&&ib(s)}};function tm(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Lu(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function y1(){}function zI(s,o,f,g,y){if(y){if(typeof g=="function"){var N=g;g=function(){var Y=Du(T);N.call(Y)}}var T=g1(o,g,s,0,null,!1,!1,"",y1);return s._reactRootContainer=T,s[ri]=T.current,Zo(s.nodeType===8?s.parentNode:s),Rs(),T}for(;y=s.lastChild;)s.removeChild(y);if(typeof g=="function"){var I=g;g=function(){var Y=Du(R);I.call(Y)}}var R=Jh(s,0,!1,null,null,!1,!1,"",y1);return s._reactRootContainer=R,s[ri]=R.current,Zo(s.nodeType===8?s.parentNode:s),Rs(function(){Iu(o,R,f,g)}),R}function $u(s,o,f,g,y){var N=f._reactRootContainer;if(N){var T=N;if(typeof y=="function"){var I=y;y=function(){var R=Du(T);I.call(R)}}Iu(o,T,s,y)}else T=zI(f,o,s,y,g);return Du(T)}Zy=function(s){switch(s.tag){case 3:var o=s.stateNode;if(o.current.memoizedState.isDehydrated){var f=$o(o.pendingLanes);f!==0&&(kp(o,f|1),Pn(o,wt()),(Ve&6)===0&&($a=wt()+500,Yi()))}break;case 13:Rs(function(){var g=oi(s,1);if(g!==null){var y=pn();Sr(g,s,1,y)}}),Zh(s,1)}},Pp=function(s){if(s.tag===13){var o=oi(s,134217728);if(o!==null){var f=pn();Sr(o,s,134217728,f)}Zh(s,134217728)}},eb=function(s){if(s.tag===13){var o=ts(s),f=oi(s,o);if(f!==null){var g=pn();Sr(f,s,o,g)}Zh(s,o)}},tb=function(){return Ge},nb=function(s,o){var f=Ge;try{return Ge=s,o()}finally{Ge=f}},Li=function(s,o,f){switch(o){case"input":if(_t(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 g=f[o];if(g!==s&&g.form===s.form){var y=tu(g);if(!y)throw Error(n(90));se(g),_t(g,y)}}}break;case"textarea":_e(s,f);break;case"select":o=f.value,o!=null&&wn(s,!!f.multiple,o,!1)}},ni=Kh,Ps=Rs;var FI={usingClientEntryPoint:!1,Events:[nl,ka,tu,va,_r,Kh]},gl={findFiberByHostInstance:Os,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},BI={bundleType:gl.bundleType,version:gl.version,rendererPackageName:gl.rendererPackageName,rendererConfig:gl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=Fe(s),s===null?null:s.stateNode},findFiberByHostInstance:gl.findFiberByHostInstance||$I,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 zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zu.isDisabled&&zu.supportsFiber)try{Rc=zu.inject(BI),Rr=zu}catch{}}return Cn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FI,Cn.createPortal=function(s,o){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!tm(o))throw Error(n(200));return LI(s,o,null,f)},Cn.createRoot=function(s,o){if(!tm(s))throw Error(n(299));var f=!1,g="",y=x1;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onRecoverableError!==void 0&&(y=o.onRecoverableError)),o=Jh(s,1,!1,null,null,f,!1,g,y),s[ri]=o.current,Zo(s.nodeType===8?s.parentNode:s),new em(o)},Cn.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=Fe(o),s=s===null?null:s.stateNode,s},Cn.flushSync=function(s){return Rs(s)},Cn.hydrate=function(s,o,f){if(!Lu(o))throw Error(n(200));return $u(null,s,o,!0,f)},Cn.hydrateRoot=function(s,o,f){if(!tm(s))throw Error(n(405));var g=f!=null&&f.hydratedSources||null,y=!1,N="",T=x1;if(f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(N=f.identifierPrefix),f.onRecoverableError!==void 0&&(T=f.onRecoverableError)),o=g1(o,null,s,1,f??null,y,!1,N,T),s[ri]=o.current,Zo(s),g)for(s=0;s<g.length;s++)f=g[s],y=f._getVersion,y=y(f._source),o.mutableSourceEagerHydrationData==null?o.mutableSourceEagerHydrationData=[f,y]:o.mutableSourceEagerHydrationData.push(f,y);return new Ru(o)},Cn.render=function(s,o,f){if(!Lu(o))throw Error(n(200));return $u(null,s,o,!1,f)},Cn.unmountComponentAtNode=function(s){if(!Lu(s))throw Error(n(40));return s._reactRootContainer?(Rs(function(){$u(null,null,s,!1,function(){s._reactRootContainer=null,s[ri]=null})}),!0):!1},Cn.unstable_batchedUpdates=Kh,Cn.unstable_renderSubtreeIntoContainer=function(s,o,f,g){if(!Lu(f))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return $u(s,o,f,!1,g)},Cn.version="18.3.1-next-f1338f8080-20240426",Cn}var C1;function u2(){if(C1)return sm.exports;C1=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(),sm.exports=JI(),sm.exports}var O1;function ZI(){if(O1)return Fu;O1=1;var e=u2();return Fu.createRoot=e.createRoot,Fu.hydrateRoot=e.hydrateRoot,Fu}var e3=ZI();const t3=ei(e3);/**
|
|
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 n3=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d2=(...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 r3={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 i3=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:a,iconNode:l,...u},d)=>b.createElement("svg",{ref:d,...r3,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:d2("lucide",i),...u},[...l.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 Ie=(e,t)=>{const n=b.forwardRef(({className:r,...i},a)=>b.createElement(i3,{ref:a,iconNode:t,className:d2(`lucide-${n3(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 s3=Ie("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 Av=Ie("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 f2=Ie("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 a3=Ie("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 o3=Ie("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 p2=Ie("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 Ul=Ie("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 yi=Ie("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 l3=Ie("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 lr=Ie("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 h2=Ie("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 c3=Ie("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 m2=Ie("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"}]]);/**
|
|
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 u3=Ie("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"}]]);/**
|
|
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 Ev=Ie("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"}]]);/**
|
|
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 jd=Ie("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"}]]);/**
|
|
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 d3=Ie("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"}]]);/**
|
|
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 f3=Ie("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
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 Tv=Ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
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 p3=Ie("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"}]]);/**
|
|
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 g2=Ie("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"}]]);/**
|
|
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 h3=Ie("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"}]]);/**
|
|
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 m3=Ie("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"}]]);/**
|
|
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 Sd=Ie("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 A1=Ie("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"}]]);/**
|
|
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 Nd=Ie("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"}]]);/**
|
|
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 fc=Ie("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"}]]);/**
|
|
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 E1=Ie("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 g3=Ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 v3=Ie("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"}]]);/**
|
|
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 v2=Ie("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"}]]);/**
|
|
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 x3=Ie("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"}]]);/**
|
|
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 y3=Ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 io=Ie("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"}]]);/**
|
|
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 b3=Ie("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"}]]);/**
|
|
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 x2=Ie("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"}]]);/**
|
|
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 w3=Ie("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"}]]);/**
|
|
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 j3=Ie("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"}]]);/**
|
|
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 hs=Ie("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"}]]);/**
|
|
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 S3=Ie("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"}]]);/**
|
|
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 cg=Ie("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"}]]);/**
|
|
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 N3=Ie("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"}]]);/**
|
|
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 vn=Ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pc="/api";async function we(e,t={}){const n=`${pc}${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 k3(){return we("/health")}async function P3(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 C3(){return we("/work-items/grouped")}async function O3(e){return we(`/work-items/${e}`)}async function ug(e){const t=`${pc}/work-items/${e}/doc`,n=await fetch(t);return n.ok?await n.text():""}async function A3(e){const t=`${pc}/work-items/${e}/doc/raw`,n=await fetch(t);return n.ok?await n.text():""}async function E3(e,t){return we(`/work-items/${e}/doc`,{method:"PUT",body:JSON.stringify({content:t})})}async function T1(){return(await we("/settings/title")).title||"AVC Kanban Board"}async function T3(){return(await we("/settings/docs-url")).url||"http://localhost:4173"}async function M3(e){return we("/settings/title",{method:"PUT",body:JSON.stringify({title:e})})}async function _3(){const e=`${pc}/project/doc`,t=await fetch(e);return t.ok?t.text():""}async function I3(){const e=`${pc}/project/doc/raw`,t=await fetch(e);return t.ok?t.text():""}async function D3(e){return we("/project/doc",{method:"PUT",body:JSON.stringify({content:e})})}async function M1(){return we("/project/status")}async function En(){return we("/settings")}async function kd(e){return we("/settings/api-keys",{method:"PUT",body:JSON.stringify(e)})}async function Wl(e,t){return we("/settings/ceremonies",{method:"PUT",body:JSON.stringify({ceremonies:e,missionGenerator:t})})}async function _1(e){return we("/settings/general",{method:"PUT",body:JSON.stringify(e)})}async function R3(e){return we("/settings/models",{method:"PUT",body:JSON.stringify({models:e})})}async function L3(e){return we("/settings/cost-thresholds",{method:"PUT",body:JSON.stringify({thresholds:e})})}async function $3(){return we("/ceremony/status")}async function z3(e,t,n){return we("/ceremony/analyze/database",{method:"POST",body:JSON.stringify({mission:e,scope:t,strategy:n})})}async function I1(e,t,n,r){return we("/ceremony/analyze/architecture",{method:"POST",body:JSON.stringify({mission:e,scope:t,dbContext:n,strategy:r})})}async function F3(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 B3(e){return we("/ceremony/run",{method:"POST",body:JSON.stringify({requirements:e})})}async function V3(e=null){return we("/ceremony/sprint-planning/run",{method:"POST",...e?{body:JSON.stringify({resumeFrom:e})}:{}})}async function U3(){return we("/ceremony/sprint-planning/resumable")}const W3=(e,t)=>we("/ceremony/sprint-planning/confirm-selection",{method:"POST",body:JSON.stringify({selectedEpicIds:e,selectedStoryIds:t})}),y2=()=>we("/ceremony/pause",{method:"POST"}),b2=()=>we("/ceremony/resume",{method:"POST"}),eo=(e=!1)=>we("/ceremony/cancel",{method:"POST",body:JSON.stringify({keepItems:e})}),w2=()=>we("/ceremony/reset",{method:"POST"}),D1=()=>we("/ceremony/cost-limit-continue",{method:"POST"}),q3=(e=null,t=null)=>we("/ceremony/quota-continue",{method:"POST",body:JSON.stringify({newProvider:e,newModel:t})});async function ms(){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 K3(){return we("/settings/local-models")}async function H3(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 G3(e,t,n,r,i,a,l){return we("/ceremony/refine-mission",{method:"POST",body:JSON.stringify({missionStatement:e,initialScope:t,refinementRequest:n,modelId:r,provider:i,validatorModelId:a,validatorProvider:l})})}async function Y3(e,t,n){return we("/ceremony/generate-architecture",{method:"POST",body:JSON.stringify({description:e,modelId:t,provider:n})})}async function X3(e,t,n,r){return we("/ceremony/refine-architecture",{method:"POST",body:JSON.stringify({currentArch:e,refinementRequest:t,modelId:n,provider:r})})}async function Q3(e,t,n,r,i,a,l){return we("/ceremony/refine-field",{method:"POST",body:JSON.stringify({fieldKey:e,fieldLabel:t,currentValue:n,refinementRequest:r,context:i,modelId:a,provider:l})})}async function J3(){try{return await we("/ceremony/sponsor-call/draft")}catch{return null}}async function Z3(e){return we("/ceremony/sponsor-call/draft",{method:"PUT",body:JSON.stringify(e)})}async function R1(){try{return await we("/ceremony/sponsor-call/draft",{method:"DELETE"})}catch{}}async function eD(){return we("/settings/agents")}async function tD(e){return we(`/settings/agents/${encodeURIComponent(e)}`)}async function nD(e,t){return we(`/settings/agents/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify({content:t})})}async function rD(e){return we(`/settings/agents/${encodeURIComponent(e)}`,{method:"DELETE"})}async function iD(){return we("/settings/checks")}async function sD(e,t){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`)}async function aD(e,t,n){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"PUT",body:JSON.stringify({content:n})})}async function oD(e,t){return we(`/settings/checks/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"})}async function lD(e,t){return we(`/work-items/${e}/refine`,{method:"POST",body:JSON.stringify(t)})}async function cD(e,t,n=[]){return we(`/work-items/${e}`,{method:"PUT",body:JSON.stringify({proposedItem:t,storyChanges:n})})}async function uD(){return we("/settings/openai-oauth/login",{method:"POST"})}async function dD(){return we("/settings/openai-oauth/logout",{method:"POST"})}async function fD(){return we("/settings/openai-oauth/status")}async function pD(){return we("/settings/openai-oauth/test",{method:"POST"})}async function hD(e){return we("/settings/openai-oauth/fallback",{method:"POST",body:JSON.stringify({enabled:e})})}async function lm(){return we("/costs/summary")}async function mD(e=30){return we(typeof e=="number"?`/costs/history?days=${e}`:`/costs/history?from=${e.from}&to=${e.to}`)}async function j2(e){return we(`/work-items/${e}/dependency-status`)}async function gD(e){return we("/ceremony/seed/run",{method:"POST",body:JSON.stringify({storyId:e})})}async function vD(e){return we("/ceremony/run-task/run",{method:"POST",body:JSON.stringify({taskId:e})})}const xD=`ws://${window.location.host}/ws`,yD=5,bD=2e3;function wD(e={}){const{onMessage:t,onConnected:n,onDisconnected:r,onError:i}=e,[a,l]=b.useState("connecting"),u=b.useRef(null),d=b.useRef(null),p=b.useRef(0),h=b.useRef(t),m=b.useRef(n),v=b.useRef(r),x=b.useRef(i);h.current=t,m.current=n,v.current=r,x.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(xD);E.onopen=()=>{var O;console.log("WebSocket connected"),p.current=0,l("connected"),(O=m.current)==null||O.call(m)},E.onmessage=O=>{var P;try{const A=JSON.parse(O.data);(P=h.current)==null||P.call(h,A)}catch(A){console.error("WebSocket message parse error:",A)}},E.onerror=O=>{var P;console.error("WebSocket error:",O),(P=x.current)==null||P.call(x,O)},E.onclose=()=>{var O;console.log("WebSocket disconnected"),u.current=null,(O=v.current)==null||O.call(v),p.current<yD?(p.current++,console.log(`Reconnecting... (attempt ${p.current})`),l("connecting"),d.current=setTimeout(w,bD)):(console.error("Max reconnection attempts reached"),l("disconnected"))},u.current=E}catch(E){console.error("WebSocket connection error:",E),(C=x.current)==null||C.call(x,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 L1=e=>{let t;const n=new Set,r=(p,h)=>{const m=typeof p=="function"?p(t):p;if(!Object.is(m,t)){const v=t;t=h??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(x=>x(t,v))}},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},jD=(e=>e?L1(e):L1),SD=e=>e;function ND(e,t=SD){const n=qa.useSyncExternalStore(e.subscribe,qa.useCallback(()=>t(e.getState()),[e,t]),qa.useCallback(()=>t(e.getInitialState()),[e,t]));return qa.useDebugValue(n),n}const $1=e=>{const t=jD(e),n=r=>ND(t,r);return Object.assign(n,t),n},wo=(e=>e?$1(e):$1),Cf=wo((e,t)=>({workItems:[],groupedItems:{},loading:!1,error:null,lastUpdated:null,ceremonyActive:!1,loadWorkItems:async(n={})=>{e({loading:!0,error:null});try{const r=await P3(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 C3();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 kD(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var a;const l=d=>d===null?null:JSON.parse(d,void 0),u=(a=n.getItem(i))!=null?a:null;return u instanceof Promise?u.then(l):l(u)},setItem:(i,a)=>n.setItem(i,JSON.stringify(a,void 0)),removeItem:i=>n.removeItem(i)}}const dg=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return dg(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return dg(r)(n)}}}},PD=(e,t)=>(n,r,i)=>{let a={storage:kD(()=>window.localStorage),partialize:j=>j,version:0,merge:(j,k)=>({...k,...j}),...t},l=!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})},v=i.setState;i.setState=(j,k)=>(v(j,k),m());const x=e((...j)=>(n(...j),m()),r,i);i.getInitialState=()=>x;let w;const S=()=>{var j,k;if(!h)return;const C=++u;l=!1,d.forEach(O=>{var P;return O((P=r())!=null?P:x)});const E=((k=a.onRehydrateStorage)==null?void 0:k.call(a,(j=r())!=null?j:x))||void 0;return dg(h.getItem.bind(h))(a.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==a.version){if(a.migrate){const P=a.migrate(O.state,O.version);return P instanceof Promise?P.then(A=>[!0,A]):[!0,P]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var P;if(C!==u)return;const[A,M]=O;if(w=a.merge(M,(P=r())!=null?P:x),n(w,!0),A)return m()}).then(()=>{C===u&&(E==null||E(w,void 0),w=r(),l=!0,p.forEach(O=>O(w)))}).catch(O=>{C===u&&(E==null||E(void 0,O))})};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:()=>l,onHydrate:j=>(d.add(j),()=>{d.delete(j)}),onFinishHydration:j=>(p.add(j),()=>{p.delete(j)})},a.skipHydration||S(),w||x},CD=PD,Of=wo(CD((e,t)=>({typeFilters:{epic:!0,story:!0,task:!0,subtask:!0},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:!0},columnVisibility:{Backlog:!0,Ready:!0,"In Progress":!0,Review:!0,Done:!0},searchQuery:"",groupBy:"epic"})}}),{name:"avc-kanban-filters",partialize:e=>({typeFilters:e.typeFilters,columnVisibility:e.columnVisibility,groupBy:e.groupBy})})),cr=wo((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(l=>({prefillResult:n,requirements:{...l.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})})),jo=wo(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})})),S2=wo((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(l=>l.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))}))}})),ql=wo((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}))}})),Mv=b.createContext({});function _v(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const Af=b.createContext(null),Iv=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class OD 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 AD({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(Iv);return b.useInsertionEffect(()=>{const{width:l,height:u,top:d,left:p}=i.current;if(t||!r.current||!l||!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(`
|
|
276
|
-
[data-motion-pop-id="${n}"] {
|
|
277
|
-
position: absolute !important;
|
|
278
|
-
width: ${l}px !important;
|
|
279
|
-
height: ${u}px !important;
|
|
280
|
-
top: ${d}px !important;
|
|
281
|
-
left: ${p}px !important;
|
|
282
|
-
}
|
|
283
|
-
`),()=>{document.head.removeChild(h)}},[t]),c.jsx(OD,{isPresent:t,childRef:r,sizeRef:i,children:b.cloneElement(e,{ref:r})})}const ED=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:l})=>{const u=_v(TD),d=b.useId(),p=b.useCallback(m=>{u.set(m,!0);for(const v of u.values())if(!v)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,v)=>u.set(v,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),l==="popLayout"&&(e=c.jsx(AD,{isPresent:n,children:e})),c.jsx(Af.Provider,{value:h,children:e})};function TD(){return new Map}function N2(e=!0){const t=b.useContext(Af);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,a=b.useId();b.useEffect(()=>{e&&i(a)},[e]);const l=b.useCallback(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,l]:[!0]}const Bu=e=>e.key||"";function z1(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const Dv=typeof window<"u",k2=Dv?b.useLayoutEffect:b.useEffect,P2=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a="sync",propagate:l=!1})=>{const[u,d]=N2(l),p=b.useMemo(()=>z1(e),[e]),h=l&&!u?[]:p.map(Bu),m=b.useRef(!0),v=b.useRef(p),x=_v(()=>new Map),[w,S]=b.useState(p),[j,k]=b.useState(p);k2(()=>{m.current=!1,v.current=p;for(let O=0;O<j.length;O++){const P=Bu(j[O]);h.includes(P)?x.delete(P):x.get(P)!==!0&&x.set(P,!1)}},[j,h.length,h.join("-")]);const C=[];if(p!==w){let O=[...p];for(let P=0;P<j.length;P++){const A=j[P],M=Bu(A);h.includes(M)||(O.splice(P,0,A),C.push(A))}a==="wait"&&C.length&&(O=C),k(z1(O)),S(p);return}const{forceRender:E}=b.useContext(Mv);return c.jsx(c.Fragment,{children:j.map(O=>{const P=Bu(O),A=l&&!u?!1:p===j||h.includes(P),M=()=>{if(x.has(P))x.set(P,!0);else return;let D=!0;x.forEach($=>{$||(D=!1)}),D&&(E==null||E(),k(v.current),l&&(d==null||d()),r&&r())};return c.jsx(ED,{isPresent:A,initial:!m.current||n?void 0:!1,custom:A?void 0:t,presenceAffectsLayout:i,mode:a,onExitComplete:A?void 0:M,children:O},P)})})},Bn=e=>e;let C2=Bn;function Rv(e){let t;return()=>(t===void 0&&(t=e()),t)}const so=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},gi=e=>e*1e3,vi=e=>e/1e3,MD={useManualTiming:!1};function _D(e){let t=new Set,n=new Set,r=!1,i=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function u(p){a.has(p)&&(d.schedule(p),e()),p(l)}const d={schedule:(p,h=!1,m=!1)=>{const x=m&&r?t:n;return h&&a.add(p),x.has(p)||x.add(p),p},cancel:p=>{n.delete(p),a.delete(p)},process:p=>{if(l=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 Vu=["read","resolveKeyframes","update","preRender","render","postRender"],ID=40;function O2(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,l=Vu.reduce((k,C)=>(k[C]=_D(a),k),{}),{read:u,resolveKeyframes:d,update:p,preRender:h,render:m,postRender:v}=l,x=()=>{const k=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(k-i.timestamp,ID),1),i.timestamp=k,i.isProcessing=!0,u.process(i),d.process(i),p.process(i),h.process(i),m.process(i),v.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(x))},w=()=>{n=!0,r=!0,i.isProcessing||e(x)};return{schedule:Vu.reduce((k,C)=>{const E=l[C];return k[C]=(O,P=!1,A=!1)=>(n||w(),E.schedule(O,P,A)),k},{}),cancel:k=>{for(let C=0;C<Vu.length;C++)l[Vu[C]].cancel(k)},state:i,steps:l}}const{schedule:ct,cancel:gs,state:Qt,steps:cm}=O2(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bn,!0),A2=b.createContext({strict:!1}),F1={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"]},ao={};for(const e in F1)ao[e]={isEnabled:t=>F1[e].some(n=>!!t[n])};function DD(e){for(const t in e)ao[t]={...ao[t],...e[t]}}const RD=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 Pd(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||RD.has(e)}let E2=e=>!Pd(e);function LD(e){e&&(E2=t=>t.startsWith("on")?!Pd(t):e(t))}try{LD(require("@emotion/is-prop-valid").default)}catch{}function $D(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(E2(i)||n===!0&&Pd(i)||!t&&!Pd(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function zD(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 Ef=b.createContext({});function Kl(e){return typeof e=="string"||Array.isArray(e)}function Tf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Lv=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],$v=["initial",...Lv];function Mf(e){return Tf(e.animate)||$v.some(t=>Kl(e[t]))}function T2(e){return!!(Mf(e)||e.variants)}function FD(e,t){if(Mf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Kl(n)?n:void 0,animate:Kl(r)?r:void 0}}return e.inherit!==!1?t:{}}function BD(e){const{initial:t,animate:n}=FD(e,b.useContext(Ef));return b.useMemo(()=>({initial:t,animate:n}),[B1(t),B1(n)])}function B1(e){return Array.isArray(e)?e.join(" "):e}const VD=Symbol.for("motionComponentSymbol");function Ka(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function UD(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):Ka(n)&&(n.current=r))},[t])}const zv=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),WD="framerAppearId",M2="data-"+zv(WD),{schedule:Fv}=O2(queueMicrotask,!1),_2=b.createContext({});function qD(e,t,n,r,i){var a,l;const{visualElement:u}=b.useContext(Ef),d=b.useContext(A2),p=b.useContext(Af),h=b.useContext(Iv).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 v=m.current,x=b.useContext(_2);v&&!v.projection&&i&&(v.type==="html"||v.type==="svg")&&KD(m.current,n,i,x);const w=b.useRef(!1);b.useInsertionEffect(()=>{v&&w.current&&v.update(n,p)});const S=n[M2],j=b.useRef(!!S&&!(!((a=window.MotionHandoffIsComplete)===null||a===void 0)&&a.call(window,S))&&((l=window.MotionHasOptimisedAnimation)===null||l===void 0?void 0:l.call(window,S)));return k2(()=>{v&&(w.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),Fv.render(v.render),j.current&&v.animationState&&v.animationState.animateChanges())}),b.useEffect(()=>{v&&(!j.current&&v.animationState&&v.animationState.animateChanges(),j.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,S)}),j.current=!1))}),v}function KD(e,t,n,r){const{layoutId:i,layout:a,drag:l,dragConstraints:u,layoutScroll:d,layoutRoot:p}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:I2(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!l||u&&Ka(u),visualElement:e,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,layoutScroll:d,layoutRoot:p})}function I2(e){if(e)return e.options.allowProjection!==!1?e.projection:I2(e.parent)}function HD({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var a,l;e&&DD(e);function u(p,h){let m;const v={...b.useContext(Iv),...p,layoutId:GD(p)},{isStatic:x}=v,w=BD(p),S=r(p,x);if(!x&&Dv){YD();const j=XD(v);m=j.MeasureLayout,w.visualElement=qD(i,S,v,t,j.ProjectionNode)}return c.jsxs(Ef.Provider,{value:w,children:[m&&w.visualElement?c.jsx(m,{visualElement:w.visualElement,...v}):null,n(i,p,UD(S,w.visualElement,h),S,x,w.visualElement)]})}u.displayName=`motion.${typeof i=="string"?i:`create(${(l=(a=i.displayName)!==null&&a!==void 0?a:i.name)!==null&&l!==void 0?l:""})`}`;const d=b.forwardRef(u);return d[VD]=i,d}function GD({layoutId:e}){const t=b.useContext(Mv).id;return t&&e!==void 0?t+"-"+e:e}function YD(e,t){b.useContext(A2).strict}function XD(e){const{drag:t,layout:n}=ao;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 QD=["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 Bv(e){return typeof e!="string"||e.includes("-")?!1:!!(QD.indexOf(e)>-1||/[A-Z]/u.test(e))}function V1(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Vv(e,t,n,r){if(typeof t=="function"){const[i,a]=V1(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]=V1(r);t=t(n!==void 0?n:e.custom,i,a)}return t}const fg=e=>Array.isArray(e),JD=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),ZD=e=>fg(e)?e[e.length-1]||0:e,un=e=>!!(e&&e.getVelocity);function fd(e){const t=un(e)?e.get():e;return JD(t)?t.toValue():t}function e4({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,a){const l={latestValues:t4(r,i,a,e),renderState:t()};return n&&(l.onMount=u=>n({props:r,current:u,...l}),l.onUpdate=u=>n(u)),l}const D2=e=>(t,n)=>{const r=b.useContext(Ef),i=b.useContext(Af),a=()=>e4(e,t,r,i);return n?a():_v(a)};function t4(e,t,n,r){const i={},a=r(e,{});for(const v in a)i[v]=fd(a[v]);let{initial:l,animate:u}=e;const d=Mf(e),p=T2(e);t&&p&&!d&&e.inherit!==!1&&(l===void 0&&(l=t.initial),u===void 0&&(u=t.animate));let h=n?n.initial===!1:!1;h=h||l===!1;const m=h?u:l;if(m&&typeof m!="boolean"&&!Tf(m)){const v=Array.isArray(m)?m:[m];for(let x=0;x<v.length;x++){const w=Vv(e,v[x]);if(w){const{transitionEnd:S,transition:j,...k}=w;for(const C in k){let E=k[C];if(Array.isArray(E)){const O=h?E.length-1:0;E=E[O]}E!==null&&(i[C]=E)}for(const C in S)i[C]=S[C]}}}return i}const So=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ca=new Set(So),R2=e=>t=>typeof t=="string"&&t.startsWith(e),L2=R2("--"),n4=R2("var(--"),Uv=e=>n4(e)?r4.test(e.split("/*")[0].trim()):!1,r4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,$2=(e,t)=>t&&typeof e=="number"?t.transform(e):e,bi=(e,t,n)=>n>t?t:n<e?e:n,No={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Hl={...No,transform:e=>bi(0,1,e)},Uu={...No,default:1},hc=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),os=hc("deg"),Hr=hc("%"),Ee=hc("px"),i4=hc("vh"),s4=hc("vw"),U1={...Hr,parse:e=>Hr.parse(e)/100,transform:e=>Hr.transform(e*100)},a4={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,radius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee},o4={rotate:os,rotateX:os,rotateY:os,rotateZ:os,scale:Uu,scaleX:Uu,scaleY:Uu,scaleZ:Uu,skew:os,skewX:os,skewY:os,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:Hl,originX:U1,originY:U1,originZ:Ee},W1={...No,transform:Math.round},Wv={...a4,...o4,zIndex:W1,size:Ee,fillOpacity:Hl,strokeOpacity:Hl,numOctaves:W1},l4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},c4=So.length;function u4(e,t,n){let r="",i=!0;for(let a=0;a<c4;a++){const l=So[a],u=e[l];if(u===void 0)continue;let d=!0;if(typeof u=="number"?d=u===(l.startsWith("scale")?1:0):d=parseFloat(u)===0,!d||n){const p=$2(u,Wv[l]);if(!d){i=!1;const h=l4[l]||l;r+=`${h}(${p}) `}n&&(t[l]=p)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function qv(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let l=!1,u=!1;for(const d in t){const p=t[d];if(ca.has(d)){l=!0;continue}else if(L2(d)){i[d]=p;continue}else{const h=$2(p,Wv[d]);d.startsWith("origin")?(u=!0,a[d]=h):r[d]=h}}if(t.transform||(l||n?r.transform=u4(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 d4={offset:"stroke-dashoffset",array:"stroke-dasharray"},f4={offset:"strokeDashoffset",array:"strokeDasharray"};function p4(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?d4:f4;e[a.offset]=Ee.transform(-r);const l=Ee.transform(t),u=Ee.transform(n);e[a.array]=`${l} ${u}`}function q1(e,t,n){return typeof e=="string"?e:Ee.transform(t+n*e)}function h4(e,t,n){const r=q1(t,e.x,e.width),i=q1(n,e.y,e.height);return`${r} ${i}`}function Kv(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:a,pathLength:l,pathSpacing:u=1,pathOffset:d=0,...p},h,m){if(qv(e,p,m),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:v,style:x,dimensions:w}=e;v.transform&&(w&&(x.transform=v.transform),delete v.transform),w&&(i!==void 0||a!==void 0||x.transform)&&(x.transformOrigin=h4(w,i!==void 0?i:.5,a!==void 0?a:.5)),t!==void 0&&(v.x=t),n!==void 0&&(v.y=n),r!==void 0&&(v.scale=r),l!==void 0&&p4(v,l,u,d,!1)}const Hv=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),z2=()=>({...Hv(),attrs:{}}),Gv=e=>typeof e=="string"&&e.toLowerCase()==="svg";function F2(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 B2=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 V2(e,t,n,r){F2(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(B2.has(i)?i:zv(i),t.attrs[i])}const Cd={};function m4(e){Object.assign(Cd,e)}function U2(e,{layout:t,layoutId:n}){return ca.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Cd[e]||e==="opacity")}function Yv(e,t,n){var r;const{style:i}=e,a={};for(const l in i)(un(i[l])||t.style&&un(t.style[l])||U2(l,e)||((r=n==null?void 0:n.getValue(l))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(a[l]=i[l]);return a}function W2(e,t,n){const r=Yv(e,t,n);for(const i in e)if(un(e[i])||un(t[i])){const a=So.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}function g4(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 K1=["x","y","width","height","cx","cy","r"],v4={useVisualState:D2({scrapeMotionValuesFromProps:W2,createRenderState:z2,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(ca.has(u)){a=!0;break}}if(!a)return;let l=!t;if(t)for(let u=0;u<K1.length;u++){const d=K1[u];e[d]!==t[d]&&(l=!0)}l&&ct.read(()=>{g4(n,r),ct.render(()=>{Kv(r,i,Gv(n.tagName),e.transformTemplate),V2(n,r)})})}})},x4={useVisualState:D2({scrapeMotionValuesFromProps:Yv,createRenderState:Hv})};function q2(e,t,n){for(const r in t)!un(t[r])&&!U2(r,n)&&(e[r]=t[r])}function y4({transformTemplate:e},t){return b.useMemo(()=>{const n=Hv();return qv(n,t,e),Object.assign({},n.vars,n.style)},[t])}function b4(e,t){const n=e.style||{},r={};return q2(r,n,e),Object.assign(r,y4(e,t)),r}function w4(e,t){const n={},r=b4(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 j4(e,t,n,r){const i=b.useMemo(()=>{const a=z2();return Kv(a,t,Gv(r),e.transformTemplate),{...a.attrs,style:{...a.style}}},[t]);if(e.style){const a={};q2(a,e.style,e),i.style={...a,...i.style}}return i}function S4(e=!1){return(n,r,i,{latestValues:a},l)=>{const d=(Bv(n)?j4:w4)(r,a,l,n),p=$D(r,typeof n=="string",e),h=n!==b.Fragment?{...p,...d,ref:i}:{},{children:m}=r,v=b.useMemo(()=>un(m)?m.get():m,[m]);return b.createElement(n,{...h,children:v})}}function N4(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const l={...Bv(r)?v4:x4,preloadedFeatures:e,useRender:S4(i),createVisualElement:t,Component:r};return HD(l)}}function K2(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 Vv(r,t,n!==void 0?n:r.custom,e)}const k4=Rv(()=>window.ScrollTimeline!==void 0);class P4{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(k4()&&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 C4 extends P4{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function Xv(e,t){return e?e[t]||e.default||e:void 0}const pg=2e4;function H2(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<pg;)t+=n,r=e.next(t);return t>=pg?1/0:t}function Qv(e){return typeof e=="function"}function H1(e,t){e.timeline=t,e.onfinish=null}const Jv=e=>Array.isArray(e)&&typeof e[0]=="number",O4={linearEasing:void 0};function A4(e,t){const n=Rv(e);return()=>{var r;return(r=O4[t])!==null&&r!==void 0?r:n()}}const Od=A4(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),G2=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=e(so(0,i-1,a))+", ";return`linear(${r.substring(0,r.length-2)})`};function Y2(e){return!!(typeof e=="function"&&Od()||!e||typeof e=="string"&&(e in hg||Od())||Jv(e)||Array.isArray(e)&&e.every(Y2))}const Tl=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,hg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Tl([0,.65,.55,1]),circOut:Tl([.55,0,1,.45]),backIn:Tl([.31,.01,.66,-.59]),backOut:Tl([.33,1.53,.69,.99])};function X2(e,t){if(e)return typeof e=="function"&&Od()?G2(e,t):Jv(e)?Tl(e):Array.isArray(e)?e.map(n=>X2(n,t)||hg.easeOut):hg[e]}const Nr={x:!1,y:!1};function Q2(){return Nr.x||Nr.y}function E4(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 J2(e,t){const n=E4(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function G1(e){return t=>{t.pointerType==="touch"||Q2()||e(t)}}function T4(e,t,n={}){const[r,i,a]=J2(e,n),l=G1(u=>{const{target:d}=u,p=t(u);if(typeof p!="function"||!d)return;const h=G1(m=>{p(m),d.removeEventListener("pointerleave",h)});d.addEventListener("pointerleave",h,i)});return r.forEach(u=>{u.addEventListener("pointerenter",l,i)}),a}const Z2=(e,t)=>t?e===t?!0:Z2(e,t.parentElement):!1,Zv=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,M4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function _4(e){return M4.has(e.tagName)||e.tabIndex!==-1}const Ml=new WeakSet;function Y1(e){return t=>{t.key==="Enter"&&e(t)}}function um(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const I4=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Y1(()=>{if(Ml.has(n))return;um(n,"down");const i=Y1(()=>{um(n,"up")}),a=()=>um(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 X1(e){return Zv(e)&&!Q2()}function D4(e,t,n={}){const[r,i,a]=J2(e,n),l=u=>{const d=u.currentTarget;if(!X1(u)||Ml.has(d))return;Ml.add(d);const p=t(u),h=(x,w)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",v),!(!X1(x)||!Ml.has(d))&&(Ml.delete(d),typeof p=="function"&&p(x,{success:w}))},m=x=>{h(x,n.useGlobalTarget||Z2(d,x.target))},v=x=>{h(x,!1)};window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",v,i)};return r.forEach(u=>{!_4(u)&&u.getAttribute("tabindex")===null&&(u.tabIndex=0),(n.useGlobalTarget?window:u).addEventListener("pointerdown",l,i),u.addEventListener("focus",p=>I4(p,i),i)}),a}function R4(e){return e==="x"||e==="y"?Nr[e]?null:(Nr[e]=!0,()=>{Nr[e]=!1}):Nr.x||Nr.y?null:(Nr.x=Nr.y=!0,()=>{Nr.x=Nr.y=!1})}const eO=new Set(["width","height","top","left","right","bottom",...So]);let pd;function L4(){pd=void 0}const Gr={now:()=>(pd===void 0&&Gr.set(Qt.isProcessing||MD.useManualTiming?Qt.timestamp:performance.now()),pd),set:e=>{pd=e,queueMicrotask(L4)}};function ex(e,t){e.indexOf(t)===-1&&e.push(t)}function tx(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class nx{constructor(){this.subscriptions=[]}add(t){return ex(this.subscriptions,t),()=>tx(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 l=this.subscriptions[a];l&&l(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function tO(e,t){return t?e*(1e3/t):0}const Q1=30,$4=e=>!isNaN(parseFloat(e));class z4{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const a=Gr.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=Gr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$4(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 nx);const r=this.events[t].add(n);return t==="change"?()=>{r(),ct.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=Gr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Q1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Q1);return tO(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 Gl(e,t){return new z4(e,t)}function F4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Gl(n))}function B4(e,t){const n=_f(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const l in a){const u=ZD(a[l]);F4(e,l,u)}}function V4(e){return!!(un(e)&&e.add)}function mg(e,t){const n=e.getValue("willChange");if(V4(n))return n.add(t)}function nO(e){return e.props[M2]}const rO=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,U4=1e-7,W4=12;function q4(e,t,n,r,i){let a,l,u=0;do l=t+(n-t)/2,a=rO(l,r,i)-e,a>0?n=l:t=l;while(Math.abs(a)>U4&&++u<W4);return l}function mc(e,t,n,r){if(e===t&&n===r)return Bn;const i=a=>q4(a,0,1,e,n);return a=>a===0||a===1?a:rO(i(a),t,r)}const iO=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,sO=e=>t=>1-e(1-t),aO=mc(.33,1.53,.69,.99),rx=sO(aO),oO=iO(rx),lO=e=>(e*=2)<1?.5*rx(e):.5*(2-Math.pow(2,-10*(e-1))),ix=e=>1-Math.sin(Math.acos(e)),cO=sO(ix),uO=iO(ix),dO=e=>/^0[^.\s]+$/u.test(e);function K4(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||dO(e):!0}const Ll=e=>Math.round(e*1e5)/1e5,sx=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function H4(e){return e==null}const G4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,ax=(e,t)=>n=>!!(typeof n=="string"&&G4.test(n)&&n.startsWith(e)||t&&!H4(n)&&Object.prototype.hasOwnProperty.call(n,t)),fO=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,l,u]=r.match(sx);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(l),alpha:u!==void 0?parseFloat(u):1}},Y4=e=>bi(0,255,e),dm={...No,transform:e=>Math.round(Y4(e))},Hs={test:ax("rgb","red"),parse:fO("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+dm.transform(e)+", "+dm.transform(t)+", "+dm.transform(n)+", "+Ll(Hl.transform(r))+")"};function X4(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 gg={test:ax("#"),parse:X4,transform:Hs.transform},Ha={test:ax("hsl","hue"),parse:fO("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Hr.transform(Ll(t))+", "+Hr.transform(Ll(n))+", "+Ll(Hl.transform(r))+")"},ln={test:e=>Hs.test(e)||gg.test(e)||Ha.test(e),parse:e=>Hs.test(e)?Hs.parse(e):Ha.test(e)?Ha.parse(e):gg.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Hs.transform(e):Ha.transform(e)},Q4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function J4(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sx))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Q4))===null||n===void 0?void 0:n.length)||0)>0}const pO="number",hO="color",Z4="var",eR="var(",J1="${}",tR=/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 Yl(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const u=t.replace(tR,d=>(ln.test(d)?(r.color.push(a),i.push(hO),n.push(ln.parse(d))):d.startsWith(eR)?(r.var.push(a),i.push(Z4),n.push(d)):(r.number.push(a),i.push(pO),n.push(parseFloat(d))),++a,J1)).split(J1);return{values:n,split:u,indexes:r,types:i}}function mO(e){return Yl(e).values}function gO(e){const{split:t,types:n}=Yl(e),r=t.length;return i=>{let a="";for(let l=0;l<r;l++)if(a+=t[l],i[l]!==void 0){const u=n[l];u===pO?a+=Ll(i[l]):u===hO?a+=ln.transform(i[l]):a+=i[l]}return a}}const nR=e=>typeof e=="number"?0:e;function rR(e){const t=mO(e);return gO(e)(t.map(nR))}const vs={test:J4,parse:mO,createTransformer:gO,getAnimatableNone:rR},iR=new Set(["brightness","contrast","saturate","opacity"]);function sR(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(sx)||[];if(!r)return e;const i=n.replace(r,"");let a=iR.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const aR=/\b([a-z-]*)\(.*?\)/gu,vg={...vs,getAnimatableNone:e=>{const t=e.match(aR);return t?t.map(sR).join(" "):e}},oR={...Wv,color:ln,backgroundColor:ln,outlineColor:ln,fill:ln,stroke:ln,borderColor:ln,borderTopColor:ln,borderRightColor:ln,borderBottomColor:ln,borderLeftColor:ln,filter:vg,WebkitFilter:vg},ox=e=>oR[e];function vO(e,t){let n=ox(e);return n!==vg&&(n=vs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const lR=new Set(["auto","none","0"]);function cR(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!lR.has(a)&&Yl(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=vO(n,i)}const Z1=e=>e===No||e===Ee,ej=(e,t)=>parseFloat(e.split(", ")[t]),tj=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return ej(i[1],t);{const a=r.match(/^matrix\((.+)\)$/u);return a?ej(a[1],e):0}},uR=new Set(["x","y","z"]),dR=So.filter(e=>!uR.has(e));function fR(e){const t=[];return dR.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const oo={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:tj(4,13),y:tj(5,14)};oo.translateX=oo.x;oo.translateY=oo.y;const Qs=new Set;let xg=!1,yg=!1;function xO(){if(yg){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=fR(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,l])=>{var u;(u=r.getValue(a))===null||u===void 0||u.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}yg=!1,xg=!1,Qs.forEach(e=>e.complete()),Qs.clear()}function yO(){Qs.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yg=!0)})}function pR(){yO(),xO()}class lx{constructor(t,n,r,i,a,l=!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=l}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Qs.add(this),xg||(xg=!0,ct.read(yO),ct.resolveKeyframes(xO))):(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 l=i==null?void 0:i.get(),u=t[t.length-1];if(l!==void 0)t[0]=l;else if(r&&n){const d=r.readValue(n,u);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=u),i&&l===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 bO=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),hR=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function mR(e){const t=hR.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function wO(e,t,n=1){const[r,i]=mR(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const l=a.trim();return bO(l)?parseFloat(l):l}return Uv(i)?wO(i,t,n+1):i}const jO=e=>t=>t.test(e),gR={test:e=>e==="auto",parse:e=>e},SO=[No,Ee,Hr,os,s4,i4,gR],nj=e=>SO.find(jO(e));class NO extends lx{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(),Uv(p))){const h=wO(p,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!eO.has(r)||t.length!==2)return;const[i,a]=t,l=nj(i),u=nj(a);if(l!==u)if(Z1(l)&&Z1(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++)K4(t[i])&&r.push(i);r.length&&cR(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=oo[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 l=i.length-1,u=i[l];i[l]=oo[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 rj=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(vs.test(e)||e==="0")&&!e.startsWith("url("));function vR(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 xR(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],l=rj(i,t),u=rj(a,t);return!l||!u?!1:vR(e)||(n==="spring"||Qv(n))&&r}const yR=e=>e!==null;function If(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(yR),a=t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const bR=40;class kO{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:l="loop",...u}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Gr.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:l,...u},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>bR?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&pR(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Gr.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:a,delay:l,onComplete:u,onUpdate:d,isGenerator:p}=this.options;if(!p&&!xR(t,r,i,a))if(l)this.options.duration=0;else{d&&d(If(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 mt=(e,t,n)=>e+(t-e)*n;function fm(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 wR({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,l=0;if(!t)i=a=l=n;else{const u=n<.5?n*(1+t):n+t-n*t,d=2*n-u;i=fm(d,u,e+1/3),a=fm(d,u,e),l=fm(d,u,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(l*255),alpha:r}}function Ad(e,t){return n=>n>0?t:e}const pm=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},jR=[gg,Hs,Ha],SR=e=>jR.find(t=>t.test(e));function ij(e){const t=SR(e);if(!t)return!1;let n=t.parse(e);return t===Ha&&(n=wR(n)),n}const sj=(e,t)=>{const n=ij(e),r=ij(t);if(!n||!r)return Ad(e,t);const i={...n};return a=>(i.red=pm(n.red,r.red,a),i.green=pm(n.green,r.green,a),i.blue=pm(n.blue,r.blue,a),i.alpha=mt(n.alpha,r.alpha,a),Hs.transform(i))},NR=(e,t)=>n=>t(e(n)),gc=(...e)=>e.reduce(NR),bg=new Set(["none","hidden"]);function kR(e,t){return bg.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function PR(e,t){return n=>mt(e,t,n)}function cx(e){return typeof e=="number"?PR:typeof e=="string"?Uv(e)?Ad:ln.test(e)?sj:AR:Array.isArray(e)?PO:typeof e=="object"?ln.test(e)?sj:CR:Ad}function PO(e,t){const n=[...e],r=n.length,i=e.map((a,l)=>cx(a)(a,t[l]));return a=>{for(let l=0;l<r;l++)n[l]=i[l](a);return n}}function CR(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=cx(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function OR(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const l=t.types[a],u=e.indexes[l][i[l]],d=(n=e.values[u])!==null&&n!==void 0?n:0;r[a]=d,i[l]++}return r}const AR=(e,t)=>{const n=vs.createTransformer(t),r=Yl(e),i=Yl(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?bg.has(e)&&!i.values.length||bg.has(t)&&!r.values.length?kR(e,t):gc(PO(OR(r,i),i.values),n):Ad(e,t)};function CO(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?mt(e,t,n):cx(e)(e,t)}const ER=5;function OO(e,t,n){const r=Math.max(t-ER,0);return tO(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},hm=.001;function TR({duration:e=xt.duration,bounce:t=xt.bounce,velocity:n=xt.velocity,mass:r=xt.mass}){let i,a,l=1-t;l=bi(xt.minDamping,xt.maxDamping,l),e=bi(xt.minDuration,xt.maxDuration,vi(e)),l<1?(i=p=>{const h=p*l,m=h*e,v=h-n,x=wg(p,l),w=Math.exp(-m);return hm-v/x*w},a=p=>{const m=p*l*e,v=m*n+n,x=Math.pow(l,2)*Math.pow(p,2)*e,w=Math.exp(-m),S=wg(Math.pow(p,2),l);return(-i(p)+hm>0?-1:1)*((v-x)*w)/S}):(i=p=>{const h=Math.exp(-p*e),m=(p-n)*e+1;return-hm+h*m},a=p=>{const h=Math.exp(-p*e),m=(n-p)*(e*e);return h*m});const u=5/e,d=_R(i,a,u);if(e=gi(e),isNaN(d))return{stiffness:xt.stiffness,damping:xt.damping,duration:e};{const p=Math.pow(d,2)*r;return{stiffness:p,damping:l*2*Math.sqrt(r*p),duration:e}}}const MR=12;function _R(e,t,n){let r=n;for(let i=1;i<MR;i++)r=r-e(r)/t(r);return r}function wg(e,t){return e*Math.sqrt(1-t*t)}const IR=["duration","bounce"],DR=["stiffness","damping","mass"];function aj(e,t){return t.some(n=>e[n]!==void 0)}function RR(e){let t={velocity:xt.velocity,stiffness:xt.stiffness,damping:xt.damping,mass:xt.mass,isResolvedFromDuration:!1,...e};if(!aj(e,DR)&&aj(e,IR))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*bi(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:xt.mass,stiffness:i,damping:a}}else{const n=TR(e);t={...t,...n,mass:xt.mass},t.isResolvedFromDuration=!0}return t}function AO(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],l=n.keyframes[n.keyframes.length-1],u={done:!1,value:a},{stiffness:d,damping:p,mass:h,duration:m,velocity:v,isResolvedFromDuration:x}=RR({...n,velocity:-vi(n.velocity||0)}),w=v||0,S=p/(2*Math.sqrt(d*h)),j=l-a,k=vi(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=wg(k,S);E=A=>{const M=Math.exp(-S*k*A);return l-M*((w+S*k*j)/P*Math.sin(P*A)+j*Math.cos(P*A))}}else if(S===1)E=P=>l-Math.exp(-k*P)*(j+(w+k*j)*P);else{const P=k*Math.sqrt(S*S-1);E=A=>{const M=Math.exp(-S*k*A),D=Math.min(P*A,300);return l-M*((w+S*k*j)*Math.sinh(D)+P*j*Math.cosh(D))/P}}const O={calculatedDuration:x&&m||null,next:P=>{const A=E(P);if(x)u.done=P>=m;else{let M=0;S<1&&(M=P===0?gi(w):OO(E,P,A));const D=Math.abs(M)<=r,$=Math.abs(l-A)<=i;u.done=D&&$}return u.value=u.done?l:A,u},toString:()=>{const P=Math.min(H2(O),pg),A=G2(M=>O.next(P*M).value,P,30);return P+"ms "+A}};return O}function oj({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:l,min:u,max:d,restDelta:p=.5,restSpeed:h}){const m=e[0],v={done:!1,value:m},x=D=>u!==void 0&&D<u||d!==void 0&&D>d,w=D=>u===void 0?d:d===void 0||Math.abs(u-D)<Math.abs(d-D)?u:d;let S=n*t;const j=m+S,k=l===void 0?j:l(j);k!==j&&(S=k-m);const C=D=>-S*Math.exp(-D/r),E=D=>k+C(D),O=D=>{const $=C(D),q=E(D);v.done=Math.abs($)<=p,v.value=v.done?k:q};let P,A;const M=D=>{x(v.value)&&(P=D,A=AO({keyframes:[v.value,w(v.value)],velocity:OO(E,D,v.value),damping:i,stiffness:a,restDelta:p,restSpeed:h}))};return M(0),{calculatedDuration:null,next:D=>{let $=!1;return!A&&P===void 0&&($=!0,O(D),M(D)),P!==void 0&&D>=P?A.next(D-P):(!$&&O(D),v)}}}const LR=mc(.42,0,1,1),$R=mc(0,0,.58,1),EO=mc(.42,0,.58,1),zR=e=>Array.isArray(e)&&typeof e[0]!="number",FR={linear:Bn,easeIn:LR,easeInOut:EO,easeOut:$R,circIn:ix,circInOut:uO,circOut:cO,backIn:rx,backInOut:oO,backOut:aO,anticipate:lO},lj=e=>{if(Jv(e)){C2(e.length===4);const[t,n,r,i]=e;return mc(t,n,r,i)}else if(typeof e=="string")return FR[e];return e};function BR(e,t,n){const r=[],i=n||CO,a=e.length-1;for(let l=0;l<a;l++){let u=i(e[l],e[l+1]);if(t){const d=Array.isArray(t)?t[l]||Bn:t;u=gc(d,u)}r.push(u)}return r}function VR(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(C2(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const u=BR(t,r,i),d=u.length,p=h=>{if(l&&h<e[0])return t[0];let m=0;if(d>1)for(;m<e.length-2&&!(h<e[m+1]);m++);const v=so(e[m],e[m+1],h);return u[m](v)};return n?h=>p(bi(e[0],e[a-1],h)):p}function UR(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=so(0,t,r);e.push(mt(n,1,i))}}function WR(e){const t=[0];return UR(t,e.length-1),t}function qR(e,t){return e.map(n=>n*t)}function KR(e,t){return e.map(()=>t||EO).splice(0,e.length-1)}function Ed({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=zR(r)?r.map(lj):lj(r),a={done:!1,value:t[0]},l=qR(n&&n.length===t.length?n:WR(t),e),u=VR(l,t,{ease:Array.isArray(i)?i:KR(t,i)});return{calculatedDuration:e,next:d=>(a.value=u(d),a.done=d>=e,a)}}const HR=e=>{const t=({timestamp:n})=>e(n);return{start:()=>ct.update(t,!0),stop:()=>gs(t),now:()=>Qt.isProcessing?Qt.timestamp:Gr.now()}},GR={decay:oj,inertia:oj,tween:Ed,keyframes:Ed,spring:AO},YR=e=>e/100;class ux extends kO{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,l=(i==null?void 0:i.KeyframeResolver)||lx,u=(d,p)=>this.onKeyframesResolved(d,p);this.resolver=new l(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:l=0}=this.options,u=Qv(n)?n:GR[n]||Ed;let d,p;u!==Ed&&typeof t[0]!="number"&&(d=gc(YR,CO(t[0],t[1])),t=[0,100]);const h=u({...this.options,keyframes:t});a==="mirror"&&(p=u({...this.options,keyframes:[...t].reverse(),velocity:-l})),h.calculatedDuration===null&&(h.calculatedDuration=H2(h));const{calculatedDuration:m}=h,v=m+i,x=v*(r+1)-i;return{generator:h,mirroredGenerator:p,mapPercentToKeyframes:d,calculatedDuration:m,resolvedDuration:v,totalDuration:x}}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:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:a,mirroredGenerator:l,mapPercentToKeyframes:u,keyframes:d,calculatedDuration:p,totalDuration:h,resolvedDuration:m}=r;if(this.startTime===null)return a.next(0);const{delay:v,repeat:x,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-v*(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,O=a;if(x){const D=Math.min(this.currentTime,h)/m;let $=Math.floor(D),q=D%1;!q&&D>=1&&(q=1),q===1&&$--,$=Math.min($,x+1),!!($%2)&&(w==="reverse"?(q=1-q,S&&(q-=S/m)):w==="mirror"&&(O=l)),E=bi(0,1,q)*m}const P=C?{done:!1,value:d[0]}:O.next(E);u&&(P.value=u(P.value));let{done:A}=P;!C&&p!==null&&(A=this.speed>=0?this.currentTime>=h:this.currentTime<=0);const M=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return M&&i!==void 0&&(P.value=If(d,this.options,i)),j&&j(P.value),M&&this.finish(),P}get duration(){const{resolved:t}=this;return t?vi(t.calculatedDuration):0}get time(){return vi(this.currentTime)}set time(t){t=gi(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=vi(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=HR,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 XR=new Set(["opacity","clipPath","filter","transform"]);function QR(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:l="loop",ease:u="easeInOut",times:d}={}){const p={[t]:n};d&&(p.offset=d);const h=X2(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:l==="reverse"?"alternate":"normal"})}const JR=Rv(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Td=10,ZR=2e4;function eL(e){return Qv(e.type)||e.type==="spring"||!Y2(e.ease)}function tL(e,t){const n=new ux({...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<ZR;)r=n.sample(a),i.push(r.value),a+=Td;return{times:void 0,keyframes:i,duration:a-Td,ease:"linear"}}const TO={anticipate:lO,backInOut:oO,circInOut:uO};function nL(e){return e in TO}class cj extends kO{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:a}=this.options;this.resolver=new NO(a,(l,u)=>this.onKeyframesResolved(l,u),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:a,type:l,motionValue:u,name:d,startTime:p}=this.options;if(!u.owner||!u.owner.current)return!1;if(typeof a=="string"&&Od()&&nL(a)&&(a=TO[a]),eL(this.options)){const{onComplete:m,onUpdate:v,motionValue:x,element:w,...S}=this.options,j=tL(t,S);t=j.keyframes,t.length===1&&(t[1]=t[0]),r=j.duration,i=j.times,a=j.ease,l="keyframes"}const h=QR(u.owner.current,d,t,{...this.options,duration:r,times:i,ease:a});return h.startTime=p??this.calcStartTime(),this.pendingTimeline?(H1(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:m}=this.options;u.set(If(t,this.options,n)),m&&m(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:r,times:i,type:l,ease:a,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return vi(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return vi(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=gi(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 Bn;const{animation:r}=n;H1(r,t)}return Bn}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:l,times:u}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:p,onUpdate:h,onComplete:m,element:v,...x}=this.options,w=new ux({...x,keyframes:r,duration:i,type:a,ease:l,times:u,isGenerator:!0}),S=gi(this.time);p.setWithVelocity(w.sample(S-Td).value,w.sample(S).value,Td)}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:l,type:u}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:p}=n.owner.getProps();return JR()&&r&&XR.has(r)&&!d&&!p&&!i&&a!=="mirror"&&l!==0&&u!=="inertia"}}const rL={type:"spring",stiffness:500,damping:25,restSpeed:10},iL=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),sL={type:"keyframes",duration:.8},aL={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oL=(e,{keyframes:t})=>t.length>2?sL:ca.has(e)?e.startsWith("scale")?iL(t[1]):rL:aL;function lL({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:a,repeatType:l,repeatDelay:u,from:d,elapsed:p,...h}){return!!Object.keys(h).length}const dx=(e,t,n,r={},i,a)=>l=>{const u=Xv(r,e)||{},d=u.delay||r.delay||0;let{elapsed:p=0}=r;p=p-gi(d);let h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...u,delay:-p,onUpdate:v=>{t.set(v),u.onUpdate&&u.onUpdate(v)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:e,motionValue:t,element:a?void 0:i};lL(u)||(h={...h,...oL(e,h)}),h.duration&&(h.duration=gi(h.duration)),h.repeatDelay&&(h.repeatDelay=gi(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 v=If(h.keyframes,u);if(v!==void 0)return ct.update(()=>{h.onUpdate(v),h.onComplete()}),new C4([])}return!a&&cj.supports(h)?new cj(h):new ux(h)};function cL({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function MO(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var a;let{transition:l=e.getDefaultTransition(),transitionEnd:u,...d}=t;r&&(l=r);const p=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in d){const v=e.getValue(m,(a=e.latestValues[m])!==null&&a!==void 0?a:null),x=d[m];if(x===void 0||h&&cL(h,m))continue;const w={delay:n,...Xv(l||{},m)};let S=!1;if(window.MotionHandoffAnimation){const k=nO(e);if(k){const C=window.MotionHandoffAnimation(k,m,ct);C!==null&&(w.startTime=C,S=!0)}}mg(e,m),v.start(dx(m,v,x,e.shouldReduceMotion&&eO.has(m)?{type:!1}:w,e,S));const j=v.animation;j&&p.push(j)}return u&&Promise.all(p).then(()=>{ct.update(()=>{u&&B4(e,u)})}),p}function jg(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 l=i?()=>Promise.all(MO(e,i,n)):()=>Promise.resolve(),u=e.variantChildren&&e.variantChildren.size?(p=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:v}=a;return uL(e,t,h+p,m,v,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[p,h]=d==="beforeChildren"?[l,u]:[u,l];return p().then(()=>h())}else return Promise.all([l(),u(n.delay)])}function uL(e,t,n=0,r=0,i=1,a){const l=[],u=(e.variantChildren.size-1)*r,d=i===1?(p=0)=>p*r:(p=0)=>u-p*r;return Array.from(e.variantChildren).sort(dL).forEach((p,h)=>{p.notify("AnimationStart",t),l.push(jg(p,t,{...a,delay:n+d(h)}).then(()=>p.notify("AnimationComplete",t)))}),Promise.all(l)}function dL(e,t){return e.sortNodePosition(t)}function fL(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(a=>jg(e,a,n));r=Promise.all(i)}else if(typeof t=="string")r=jg(e,t,n);else{const i=typeof t=="function"?_f(e,t,n.custom):t;r=Promise.all(MO(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const pL=$v.length;function _O(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?_O(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<pL;n++){const r=$v[n],i=e.props[r];(Kl(i)||i===!1)&&(t[r]=i)}return t}const hL=[...Lv].reverse(),mL=Lv.length;function gL(e){return t=>Promise.all(t.map(({animation:n,options:r})=>fL(e,n,r)))}function vL(e){let t=gL(e),n=uj(),r=!0;const i=d=>(p,h)=>{var m;const v=_f(e,h,d==="exit"?(m=e.presenceContext)===null||m===void 0?void 0:m.custom:void 0);if(v){const{transition:x,transitionEnd:w,...S}=v;p={...p,...S,...w}}return p};function a(d){t=d(e)}function l(d){const{props:p}=e,h=_O(e.parent)||{},m=[],v=new Set;let x={},w=1/0;for(let j=0;j<mL;j++){const k=hL[j],C=n[k],E=p[k]!==void 0?p[k]:h[k],O=Kl(E),P=k===d?C.isActive:null;P===!1&&(w=j);let A=E===h[k]&&E!==p[k]&&O;if(A&&r&&e.manuallyAnimateOnMount&&(A=!1),C.protectedKeys={...x},!C.isActive&&P===null||!E&&!C.prevProp||Tf(E)||typeof E=="boolean")continue;const M=xL(C.prevProp,E);let D=M||k===d&&C.isActive&&!A&&O||j>w&&O,$=!1;const q=Array.isArray(E)?E:[E];let X=q.reduce(i(k),{});P===!1&&(X={});const{prevResolvedValues:L={}}=C,Z={...L,...X},J=B=>{D=!0,v.has(B)&&($=!0,v.delete(B)),C.needsAnimating[B]=!0;const F=e.getValue(B);F&&(F.liveStyle=!1)};for(const B in Z){const F=X[B],G=L[B];if(x.hasOwnProperty(B))continue;let W=!1;fg(F)&&fg(G)?W=!K2(F,G):W=F!==G,W?F!=null?J(B):v.add(B):F!==void 0&&v.has(B)?J(B):C.protectedKeys[B]=!0}C.prevProp=E,C.prevResolvedValues=X,C.isActive&&(x={...x,...X}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(A&&M)||$)&&m.push(...q.map(B=>({animation:B,options:{type:k}})))}if(v.size){const j={};v.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(v=>{var x;return(x=v.animationState)===null||x===void 0?void 0:x.setActive(d,p)}),n[d].isActive=p;const m=l(d);for(const v in n)n[v].protectedKeys={};return m}return{animateChanges:l,setActive:u,setAnimateFunction:a,getState:()=>n,reset:()=>{n=uj(),r=!0}}}function xL(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!K2(t,e):!1}function Fs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function uj(){return{animate:Fs(!0),whileInView:Fs(),whileHover:Fs(),whileTap:Fs(),whileDrag:Fs(),whileFocus:Fs(),exit:Fs()}}class bs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class yL extends bs{constructor(t){super(t),t.animationState||(t.animationState=vL(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Tf(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 bL=0;class wL extends bs{constructor(){super(...arguments),this.id=bL++}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 jL={animation:{Feature:yL},exit:{Feature:wL}};function Xl(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vc(e){return{point:{x:e.pageX,y:e.pageY}}}const SL=e=>t=>Zv(t)&&e(t,vc(t));function $l(e,t,n,r){return Xl(e,t,SL(n),r)}const dj=(e,t)=>Math.abs(e-t);function NL(e,t){const n=dj(e.x,t.x),r=dj(e.y,t.y);return Math.sqrt(n**2+r**2)}class IO{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=gm(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,x=NL(m.offset,{x:0,y:0})>=3;if(!v&&!x)return;const{point:w}=m,{timestamp:S}=Qt;this.history.push({...w,timestamp:S});const{onStart:j,onMove:k}=this.handlers;v||(j&&j(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,m)},this.handlePointerMove=(m,v)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=mm(v,this.transformPagePoint),ct.update(this.updatePoint,!0)},this.handlePointerUp=(m,v)=>{this.end();const{onEnd:x,onSessionEnd:w,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=gm(m.type==="pointercancel"?this.lastMoveEventInfo:mm(v,this.transformPagePoint),this.history);this.startEvent&&x&&x(m,j),w&&w(m,j)},!Zv(t))return;this.dragSnapToOrigin=a,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const l=vc(t),u=mm(l,this.transformPagePoint),{point:d}=u,{timestamp:p}=Qt;this.history=[{...d,timestamp:p}];const{onSessionStart:h}=n;h&&h(t,gm(u,this.history)),this.removeListeners=gc($l(this.contextWindow,"pointermove",this.handlePointerMove),$l(this.contextWindow,"pointerup",this.handlePointerUp),$l(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),gs(this.updatePoint)}}function mm(e,t){return t?{point:t(e.point)}:e}function fj(e,t){return{x:e.x-t.x,y:e.y-t.y}}function gm({point:e},t){return{point:e,delta:fj(e,DO(t)),offset:fj(e,kL(t)),velocity:PL(t,.1)}}function kL(e){return e[0]}function DO(e){return e[e.length-1]}function PL(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=DO(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>gi(t)));)n--;if(!r)return{x:0,y:0};const a=vi(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const l={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}const RO=1e-4,CL=1-RO,OL=1+RO,LO=.01,AL=0-LO,EL=0+LO;function Un(e){return e.max-e.min}function TL(e,t,n){return Math.abs(e-t)<=n}function pj(e,t,n,r=.5){e.origin=r,e.originPoint=mt(t.min,t.max,e.origin),e.scale=Un(n)/Un(t),e.translate=mt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=CL&&e.scale<=OL||isNaN(e.scale))&&(e.scale=1),(e.translate>=AL&&e.translate<=EL||isNaN(e.translate))&&(e.translate=0)}function zl(e,t,n,r){pj(e.x,t.x,n.x,r?r.originX:void 0),pj(e.y,t.y,n.y,r?r.originY:void 0)}function hj(e,t,n){e.min=n.min+t.min,e.max=e.min+Un(t)}function ML(e,t,n){hj(e.x,t.x,n.x),hj(e.y,t.y,n.y)}function mj(e,t,n){e.min=t.min-n.min,e.max=e.min+Un(t)}function Fl(e,t,n){mj(e.x,t.x,n.x),mj(e.y,t.y,n.y)}function _L(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?mt(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?mt(n,e,r.max):Math.min(e,n)),e}function gj(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 IL(e,{top:t,left:n,bottom:r,right:i}){return{x:gj(e.x,n,i),y:gj(e.y,t,r)}}function vj(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 DL(e,t){return{x:vj(e.x,t.x),y:vj(e.y,t.y)}}function RL(e,t){let n=.5;const r=Un(e),i=Un(t);return i>r?n=so(t.min,t.max-r,e.min):r>i&&(n=so(e.min,e.max-i,t.min)),bi(0,1,n)}function LL(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 Sg=.35;function $L(e=Sg){return e===!1?e=0:e===!0&&(e=Sg),{x:xj(e,"left","right"),y:xj(e,"top","bottom")}}function xj(e,t,n){return{min:yj(e,t),max:yj(e,n)}}function yj(e,t){return typeof e=="number"?e:e[t]||0}const bj=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ga=()=>({x:bj(),y:bj()}),wj=()=>({min:0,max:0}),St=()=>({x:wj(),y:wj()});function ar(e){return[e("x"),e("y")]}function $O({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function zL({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function FL(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 vm(e){return e===void 0||e===1}function Ng({scale:e,scaleX:t,scaleY:n}){return!vm(e)||!vm(t)||!vm(n)}function Vs(e){return Ng(e)||zO(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function zO(e){return jj(e.x)||jj(e.y)}function jj(e){return e&&e!=="0%"}function Md(e,t,n){const r=e-n,i=t*r;return n+i}function Sj(e,t,n,r,i){return i!==void 0&&(e=Md(e,i,r)),Md(e,n,r)+t}function kg(e,t=0,n=1,r,i){e.min=Sj(e.min,t,n,r,i),e.max=Sj(e.max,t,n,r,i)}function FO(e,{x:t,y:n}){kg(e.x,t.translate,t.scale,t.originPoint),kg(e.y,n.translate,n.scale,n.originPoint)}const Nj=.999999999999,kj=1.0000000000001;function BL(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let a,l;for(let u=0;u<i;u++){a=n[u],l=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&&Xa(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(t.x*=l.x.scale,t.y*=l.y.scale,FO(e,l)),r&&Vs(a.latestValues)&&Xa(e,a.latestValues))}t.x<kj&&t.x>Nj&&(t.x=1),t.y<kj&&t.y>Nj&&(t.y=1)}function Ya(e,t){e.min=e.min+t,e.max=e.max+t}function Pj(e,t,n,r,i=.5){const a=mt(e.min,e.max,i);kg(e,t,n,a,r)}function Xa(e,t){Pj(e.x,t.x,t.scaleX,t.scale,t.originX),Pj(e.y,t.y,t.scaleY,t.scale,t.originY)}function BO(e,t){return $O(FL(e.getBoundingClientRect(),t))}function VL(e,t,n){const r=BO(e,n),{scroll:i}=t;return i&&(Ya(r.x,i.offset.x),Ya(r.y,i.offset.y)),r}const VO=({current:e})=>e?e.ownerDocument.defaultView:null,UL=new WeakMap;class WL{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=St(),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(vc(h).point)},a=(h,m)=>{const{drag:v,dragPropagation:x,onDragStart:w}=this.getProps();if(v&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=R4(v),!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),ar(j=>{let k=this.getAxisMotionValue(j).get()||0;if(Hr.test(k)){const{projection:C}=this.visualElement;if(C&&C.layout){const E=C.layout.layoutBox[j];E&&(k=Un(E)*(parseFloat(k)/100))}}this.originPoint[j]=k}),w&&ct.postRender(()=>w(h,m)),mg(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},l=(h,m)=>{const{dragPropagation:v,dragDirectionLock:x,onDirectionLock:w,onDrag:S}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:j}=m;if(x&&this.currentDirection===null){this.currentDirection=qL(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=()=>ar(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 IO(t,{onSessionStart:i,onStart:a,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:VO(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&&ct.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||!Wu(t,i,this.currentDirection))return;const a=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=_L(l,this.constraints[t],this.elastic[t])),a.set(l)}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&&Ka(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=IL(i.layoutBox,n):this.constraints=!1,this.elastic=$L(r),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&ar(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=LL(i.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ka(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const a=VL(r,i.root,this.visualElement.getTransformPagePoint());let l=DL(i.layout.layoutBox,a);if(n){const u=n(zL(l));this.hasMutatedConstraints=!!u,u&&(l=$O(u))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:a,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),d=this.constraints||{},p=ar(h=>{if(!Wu(h,n,this.currentDirection))return;let m=d&&d[h]||{};l&&(m={min:0,max:0});const v=i?200:1e6,x=i?40:1e7,w={type:"inertia",velocity:r?t[h]:0,bounceStiffness:v,bounceDamping:x,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 mg(this.visualElement,t),r.start(dx(t,r,0,n,this.visualElement,!1))}stopAnimation(){ar(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ar(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){ar(n=>{const{drag:r}=this.getProps();if(!Wu(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,a=this.getAxisMotionValue(n);if(i&&i.layout){const{min:l,max:u}=i.layout.layoutBox[n];a.set(t[n]-mt(l,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ka(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ar(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const d=u.get();i[l]=RL({min:d,max:d},this.constraints[l])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),ar(l=>{if(!Wu(l,t,null))return;const u=this.getAxisMotionValue(l),{min:d,max:p}=this.constraints[l];u.set(mt(d,p,i[l]))})}addListeners(){if(!this.visualElement.current)return;UL.set(this.visualElement,this);const t=this.visualElement.current,n=$l(t,"pointerdown",d=>{const{drag:p,dragListener:h=!0}=this.getProps();p&&h&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();Ka(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()),ct.read(r);const l=Xl(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:p})=>{this.isDragging&&p&&(ar(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=d[h].translate,m.set(m.get()+d[h].translate))}),this.visualElement.render())}));return()=>{l(),n(),a(),u&&u()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:a=!1,dragElastic:l=Sg,dragMomentum:u=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:a,dragElastic:l,dragMomentum:u}}}function Wu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function qL(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class KL extends bs{constructor(t){super(t),this.removeGroupControls=Bn,this.removeListeners=Bn,this.controls=new WL(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Cj=e=>(t,n)=>{e&&ct.postRender(()=>e(t,n))};class HL extends bs{constructor(){super(...arguments),this.removePointerDownListener=Bn}onPointerDown(t){this.session=new IO(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:VO(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Cj(t),onStart:Cj(n),onMove:r,onEnd:(a,l)=>{delete this.session,i&&ct.postRender(()=>i(a,l))}}}mount(){this.removePointerDownListener=$l(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 hd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Oj(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const xl={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ee.test(e))e=parseFloat(e);else return e;const n=Oj(e,t.target.x),r=Oj(e,t.target.y);return`${n}% ${r}%`}},GL={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=vs.parse(e);if(i.length>5)return r;const a=vs.createTransformer(e),l=typeof i[0]!="number"?1:0,u=n.x.scale*t.x,d=n.y.scale*t.y;i[0+l]/=u,i[1+l]/=d;const p=mt(u,d,.5);return typeof i[2+l]=="number"&&(i[2+l]/=p),typeof i[3+l]=="number"&&(i[3+l]/=p),a(i)}};class YL extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:a}=t;m4(XL),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()})),hd.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:a}=this.props,l=r.projection;return l&&(l.isPresent=a,i||t.layoutDependency!==n||n===void 0?l.willUpdate():this.safeToRemove(),t.isPresent!==a&&(a?l.promote():l.relegate()||ct.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Fv.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 UO(e){const[t,n]=N2(),r=b.useContext(Mv);return c.jsx(YL,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(_2),isPresent:t,safeToRemove:n})}const XL={borderRadius:{...xl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:xl,borderTopRightRadius:xl,borderBottomLeftRadius:xl,borderBottomRightRadius:xl,boxShadow:GL};function QL(e,t,n){const r=un(e)?e:Gl(e);return r.start(dx("",r,t,n)),r.animation}function JL(e){return e instanceof SVGElement&&e.tagName!=="svg"}const ZL=(e,t)=>e.depth-t.depth;class e${constructor(){this.children=[],this.isDirty=!1}add(t){ex(this.children,t),this.isDirty=!0}remove(t){tx(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ZL),this.isDirty=!1,this.children.forEach(t)}}function t$(e,t){const n=Gr.now(),r=({timestamp:i})=>{const a=i-n;a>=t&&(gs(r),e(a-t))};return ct.read(r,!0),()=>gs(r)}const WO=["TopLeft","TopRight","BottomLeft","BottomRight"],n$=WO.length,Aj=e=>typeof e=="string"?parseFloat(e):e,Ej=e=>typeof e=="number"||Ee.test(e);function r$(e,t,n,r,i,a){i?(e.opacity=mt(0,n.opacity!==void 0?n.opacity:1,i$(r)),e.opacityExit=mt(t.opacity!==void 0?t.opacity:1,0,s$(r))):a&&(e.opacity=mt(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let l=0;l<n$;l++){const u=`border${WO[l]}Radius`;let d=Tj(t,u),p=Tj(n,u);if(d===void 0&&p===void 0)continue;d||(d=0),p||(p=0),d===0||p===0||Ej(d)===Ej(p)?(e[u]=Math.max(mt(Aj(d),Aj(p),r),0),(Hr.test(p)||Hr.test(d))&&(e[u]+="%")):e[u]=p}(t.rotate||n.rotate)&&(e.rotate=mt(t.rotate||0,n.rotate||0,r))}function Tj(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const i$=qO(0,.5,cO),s$=qO(.5,.95,Bn);function qO(e,t,n){return r=>r<e?0:r>t?1:n(so(e,t,r))}function Mj(e,t){e.min=t.min,e.max=t.max}function nr(e,t){Mj(e.x,t.x),Mj(e.y,t.y)}function _j(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ij(e,t,n,r,i){return e-=t,e=Md(e,1/n,r),i!==void 0&&(e=Md(e,1/i,r)),e}function a$(e,t=0,n=1,r=.5,i,a=e,l=e){if(Hr.test(t)&&(t=parseFloat(t),t=mt(l.min,l.max,t/100)-l.min),typeof t!="number")return;let u=mt(a.min,a.max,r);e===a&&(u-=t),e.min=Ij(e.min,t,n,u,i),e.max=Ij(e.max,t,n,u,i)}function Dj(e,t,[n,r,i],a,l){a$(e,t[n],t[r],t[i],t.scale,a,l)}const o$=["x","scaleX","originX"],l$=["y","scaleY","originY"];function Rj(e,t,n,r){Dj(e.x,t,o$,n?n.x:void 0,r?r.x:void 0),Dj(e.y,t,l$,n?n.y:void 0,r?r.y:void 0)}function Lj(e){return e.translate===0&&e.scale===1}function KO(e){return Lj(e.x)&&Lj(e.y)}function $j(e,t){return e.min===t.min&&e.max===t.max}function c$(e,t){return $j(e.x,t.x)&&$j(e.y,t.y)}function zj(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function HO(e,t){return zj(e.x,t.x)&&zj(e.y,t.y)}function Fj(e){return Un(e.x)/Un(e.y)}function Bj(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class u${constructor(){this.members=[]}add(t){ex(this.members,t),t.scheduleRender()}remove(t){if(tx(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 d$(e,t,n){let r="";const i=e.x.translate/t.x,a=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((i||a||l)&&(r=`translate3d(${i}px, ${a}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:p,rotate:h,rotateX:m,rotateY:v,skewX:x,skewY:w}=n;p&&(r=`perspective(${p}px) ${r}`),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),v&&(r+=`rotateY(${v}deg) `),x&&(r+=`skewX(${x}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},_l=typeof window<"u"&&window.MotionDebug!==void 0,xm=["","X","Y","Z"],f$={visibility:"hidden"},Vj=1e3;let p$=0;function ym(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function GO(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=nO(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:a}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",ct,!(i||a))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&GO(r)}function YO({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(l={},u=t==null?void 0:t()){this.id=p$++,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,_l&&(Us.totalNodes=Us.resolvedTargetDeltas=Us.recalculatedProjection=0),this.nodes.forEach(g$),this.nodes.forEach(w$),this.nodes.forEach(j$),this.nodes.forEach(v$),_l&&window.MotionDebug.record(Us)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,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 e$)}addEventListener(l,u){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new nx),this.eventHandlers.get(l).add(u)}notifyListeners(l,...u){const d=this.eventHandlers.get(l);d&&d.notify(...u)}hasListeners(l){return this.eventHandlers.has(l)}mount(l,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=JL(l),this.instance=l;const{layoutId:d,layout:p,visualElement:h}=this.options;if(h&&!h.current&&h.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(p||d)&&(this.isLayoutDirty=!0),e){let m;const v=()=>this.root.updateBlockedByResize=!1;e(l,()=>{this.root.updateBlockedByResize=!0,m&&m(),m=t$(v,250),hd.hasAnimatedSinceResize&&(hd.hasAnimatedSinceResize=!1,this.nodes.forEach(Wj))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&h&&(d||p)&&this.addEventListener("didUpdate",({delta:m,hasLayoutChanged:v,hasRelativeTargetChanged:x,layout:w})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||h.getDefaultTransition()||C$,{onLayoutAnimationStart:j,onLayoutAnimationComplete:k}=h.getProps(),C=!this.targetLayout||!HO(this.targetLayout,w)||x,E=!v&&x;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||E||v&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(m,E);const O={...Xv(S,"layout"),onPlay:j,onComplete:k};(h.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else v||Wj(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=w})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,gs(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(S$),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&GO(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(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Uj);return}this.isUpdating||this.nodes.forEach(y$),this.isUpdating=!1,this.nodes.forEach(b$),this.nodes.forEach(h$),this.nodes.forEach(m$),this.clearAllSnapshots();const u=Gr.now();Qt.delta=bi(0,1e3/60,u-Qt.timestamp),Qt.timestamp=u,Qt.isProcessing=!0,cm.update.process(Qt),cm.preRender.process(Qt),cm.render.process(Qt),Qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Fv.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(x$),this.sharedNodes.forEach(N$)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ct.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ct.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 l=this.layout;this.layout=this.measure(!1),this.layoutCorrected=St(),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,l?l.layoutBox:void 0)}updateScroll(l="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(u=!1),u){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!i)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!KO(this.projectionDelta),d=this.getTransformTemplate(),p=d?d(this.latestValues,""):void 0,h=p!==this.prevTransformTemplateValue;l&&(u||Vs(this.latestValues)||h)&&(i(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const u=this.measurePageBox();let d=this.removeElementScroll(u);return l&&(d=this.removeTransform(d)),O$(d),{animationId:this.root.animationId,measuredBox:u,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:u}=this.options;if(!u)return St();const d=u.measureViewportBox();if(!(((l=this.scroll)===null||l===void 0?void 0:l.wasRoot)||this.path.some(A$))){const{scroll:h}=this.root;h&&(Ya(d.x,h.offset.x),Ya(d.y,h.offset.y))}return d}removeElementScroll(l){var u;const d=St();if(nr(d,l),!((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:v}=h;h!==this.root&&m&&v.layoutScroll&&(m.wasRoot&&nr(d,l),Ya(d.x,m.offset.x),Ya(d.y,m.offset.y))}return d}applyTransform(l,u=!1){const d=St();nr(d,l);for(let p=0;p<this.path.length;p++){const h=this.path[p];!u&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Xa(d,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),Vs(h.latestValues)&&Xa(d,h.latestValues)}return Vs(this.latestValues)&&Xa(d,this.latestValues),d}removeTransform(l){const u=St();nr(u,l);for(let d=0;d<this.path.length;d++){const p=this.path[d];if(!p.instance||!Vs(p.latestValues))continue;Ng(p.latestValues)&&p.updateSnapshot();const h=St(),m=p.measurePageBox();nr(h,m),Rj(u,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,h)}return Vs(this.latestValues)&&Rj(u,this.latestValues),u}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.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!==Qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!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(!(l||p&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:m,layoutId:v}=this.options;if(!(!this.layout||!(m||v))){if(this.resolvedRelativeTargetAt=Qt.timestamp,!this.targetDelta&&!this.relativeTarget){const x=this.getClosestProjectingParent();x&&x.layout&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=St(),this.relativeTargetOrigin=St(),Fl(this.relativeTargetOrigin,this.layout.layoutBox,x.layout.layoutBox),nr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=St(),this.targetWithTransforms=St()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ML(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):nr(this.target,this.layout.layoutBox),FO(this.target,this.targetDelta)):nr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const x=this.getClosestProjectingParent();x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=St(),this.relativeTargetOrigin=St(),Fl(this.relativeTargetOrigin,this.target,x.target),nr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}_l&&Us.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Ng(this.parent.latestValues)||zO(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 l;const u=this.getLead(),d=!!this.resumingFrom||this!==u;let p=!0;if((this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty)&&(p=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(p=!1),this.resolvedRelativeTargetAt===Qt.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;nr(this.layoutCorrected,this.layout.layoutBox);const v=this.treeScale.x,x=this.treeScale.y;BL(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=St());const{target:w}=u;if(!w){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_j(this.prevProjectionDelta.x,this.projectionDelta.x),_j(this.prevProjectionDelta.y,this.projectionDelta.y)),zl(this.projectionDelta,this.layoutCorrected,w,this.latestValues),(this.treeScale.x!==v||this.treeScale.y!==x||!Bj(this.projectionDelta.x,this.prevProjectionDelta.x)||!Bj(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",w)),_l&&Us.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var u;if((u=this.options.visualElement)===null||u===void 0||u.scheduleRender(),l){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ga(),this.projectionDelta=Ga(),this.projectionDeltaWithTransform=Ga()}setAnimationOrigin(l,u=!1){const d=this.snapshot,p=d?d.latestValues:{},h={...this.latestValues},m=Ga();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const v=St(),x=d?d.source:void 0,w=this.layout?this.layout.source:void 0,S=x!==w,j=this.getStack(),k=!j||j.members.length<=1,C=!!(S&&!k&&this.options.crossfade===!0&&!this.path.some(P$));this.animationProgress=0;let E;this.mixTargetDelta=O=>{const P=O/1e3;qj(m.x,l.x,P),qj(m.y,l.y,P),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Fl(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),k$(this.relativeTarget,this.relativeTargetOrigin,v,P),E&&c$(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=St()),nr(E,this.relativeTarget)),S&&(this.animationValues=h,r$(h,p,this.latestValues,P,C,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(gs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ct.update(()=>{hd.hasAnimatedSinceResize=!0,this.currentAnimation=QL(0,Vj,{...l,onUpdate:u=>{this.mixTargetDelta(u),l.onUpdate&&l.onUpdate(u)},onComplete:()=>{l.onComplete&&l.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 l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Vj),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:u,target:d,layout:p,latestValues:h}=l;if(!(!u||!d||!p)){if(this!==l&&this.layout&&p&&XO(this.options.animationType,this.layout.layoutBox,p.layoutBox)){d=this.target||St();const m=Un(this.layout.layoutBox.x);d.x.min=l.target.x.min,d.x.max=d.x.min+m;const v=Un(this.layout.layoutBox.y);d.y.min=l.target.y.min,d.y.max=d.y.min+v}nr(u,d),Xa(u,h),zl(this.projectionDeltaWithTransform,this.layoutCorrected,u,h)}}registerSharedNode(l,u){this.sharedNodes.has(l)||this.sharedNodes.set(l,new u$),this.sharedNodes.get(l).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 l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:u}=this.options;return u?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:u}=this.options;return u?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:u,preserveFollowOpacity:d}={}){const p=this.getStack();p&&p.promote(this,d),l&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let u=!1;const{latestValues:d}=l;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(u=!0),!u)return;const p={};d.z&&ym("z",l,p,this.animationValues);for(let h=0;h<xm.length;h++)ym(`rotate${xm[h]}`,l,p,this.animationValues),ym(`skew${xm[h]}`,l,p,this.animationValues);l.render();for(const h in p)l.setStaticValue(h,p[h]),this.animationValues&&(this.animationValues[h]=p[h]);l.scheduleRender()}getProjectionStyles(l){var u,d;if(!this.instance||this.isSVG)return;if(!this.isVisible)return f$;const p={visibility:""},h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,p.opacity="",p.pointerEvents=fd(l==null?void 0:l.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=fd(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Vs(this.latestValues)&&(S.transform=h?h({},""):"none",this.hasProjected=!1),S}const v=m.animationValues||m.latestValues;this.applyTransformsToTarget(),p.transform=d$(this.projectionDeltaWithTransform,this.treeScale,v),h&&(p.transform=h(v,p.transform));const{x,y:w}=this.projectionDelta;p.transformOrigin=`${x.origin*100}% ${w.origin*100}% 0`,m.animationValues?p.opacity=m===this?(d=(u=v.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&d!==void 0?d:1:this.preserveOpacity?this.latestValues.opacity:v.opacityExit:p.opacity=m===this?v.opacity!==void 0?v.opacity:"":v.opacityExit!==void 0?v.opacityExit:0;for(const S in Cd){if(v[S]===void 0)continue;const{correct:j,applyTo:k}=Cd[S],C=p.transform==="none"?v[S]:j(v[S],m);if(k){const E=k.length;for(let O=0;O<E;O++)p[k[O]]=C}else p[S]=C}return this.options.layoutId&&(p.pointerEvents=m===this?fd(l==null?void 0:l.pointerEvents)||"":"none"),p}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var u;return(u=l.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(Uj),this.root.sharedNodes.clear()}}}function h$(e){e.updateLayout()}function m$(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,l=n.source!==e.layout.source;a==="size"?ar(m=>{const v=l?n.measuredBox[m]:n.layoutBox[m],x=Un(v);v.min=r[m].min,v.max=v.min+x}):XO(a,n.layoutBox,r)&&ar(m=>{const v=l?n.measuredBox[m]:n.layoutBox[m],x=Un(r[m]);v.max=v.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[m].max=e.relativeTarget[m].min+x)});const u=Ga();zl(u,r,n.layoutBox);const d=Ga();l?zl(d,e.applyTransform(i,!0),n.measuredBox):zl(d,r,n.layoutBox);const p=!KO(u);let h=!1;if(!e.resumeFrom){const m=e.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:v,layout:x}=m;if(v&&x){const w=St();Fl(w,n.layoutBox,v.layoutBox);const S=St();Fl(S,r,x.layoutBox),HO(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 g$(e){_l&&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 v$(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function x$(e){e.clearSnapshot()}function Uj(e){e.clearMeasurements()}function y$(e){e.isLayoutDirty=!1}function b$(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Wj(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function w$(e){e.resolveTargetDelta()}function j$(e){e.calcProjection()}function S$(e){e.resetSkewAndRotation()}function N$(e){e.removeLeadSnapshot()}function qj(e,t,n){e.translate=mt(t.translate,0,n),e.scale=mt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Kj(e,t,n,r){e.min=mt(t.min,n.min,r),e.max=mt(t.max,n.max,r)}function k$(e,t,n,r){Kj(e.x,t.x,n.x,r),Kj(e.y,t.y,n.y,r)}function P$(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const C$={duration:.45,ease:[.4,0,.1,1]},Hj=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Gj=Hj("applewebkit/")&&!Hj("chrome/")?Math.round:Bn;function Yj(e){e.min=Gj(e.min),e.max=Gj(e.max)}function O$(e){Yj(e.x),Yj(e.y)}function XO(e,t,n){return e==="position"||e==="preserve-aspect"&&!TL(Fj(t),Fj(n),.2)}function A$(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const E$=YO({attachResizeListener:(e,t)=>Xl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),bm={current:void 0},QO=YO({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!bm.current){const e=new E$({});e.mount(window),e.setOptions({layoutScroll:!0}),bm.current=e}return bm.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),T$={pan:{Feature:HL},drag:{Feature:KL,ProjectionNode:QO,MeasureLayout:UO}};function Xj(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&&ct.postRender(()=>a(t,vc(t)))}class M$ extends bs{mount(){const{current:t}=this.node;t&&(this.unmount=T4(t,n=>(Xj(this.node,n,"Start"),r=>Xj(this.node,r,"End"))))}unmount(){}}class _$ extends bs{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=gc(Xl(this.node.current,"focus",()=>this.onFocus()),Xl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Qj(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&&ct.postRender(()=>a(t,vc(t)))}class I$ extends bs{mount(){const{current:t}=this.node;t&&(this.unmount=D4(t,n=>(Qj(this.node,n,"Start"),(r,{success:i})=>Qj(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Pg=new WeakMap,wm=new WeakMap,D$=e=>{const t=Pg.get(e.target);t&&t(e)},R$=e=>{e.forEach(D$)};function L$({root:e,...t}){const n=e||document;wm.has(n)||wm.set(n,{});const r=wm.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(R$,{root:e,...t})),r[i]}function $$(e,t,n){const r=L$(t);return Pg.set(e,n),r.observe(e),()=>{Pg.delete(e),r.unobserve(e)}}const z$={some:0,all:1};class F$ extends bs{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,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:z$[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(),v=p?h:m;v&&v(d)};return $$(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(B$(t,n))&&this.startObserver()}unmount(){}}function B$({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const V$={inView:{Feature:F$},tap:{Feature:I$},focus:{Feature:_$},hover:{Feature:M$}},U$={layout:{ProjectionNode:QO,MeasureLayout:UO}},Cg={current:null},JO={current:!1};function W$(){if(JO.current=!0,!!Dv)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Cg.current=e.matches;e.addListener(t),t()}else Cg.current=!1}const q$=[...SO,ln,vs],K$=e=>q$.find(jO(e)),Jj=new WeakMap;function H$(e,t,n){for(const r in t){const i=t[r],a=n[r];if(un(i))e.addValue(r,i);else if(un(a))e.addValue(r,Gl(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(i):l.hasAnimated||l.set(i)}else{const l=e.getStaticValue(r);e.addValue(r,Gl(l!==void 0?l:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Zj=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class G${scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:a,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=lx,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 x=Gr.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,ct.render(this.render,!1,!0))};const{latestValues:d,renderState:p,onUpdate:h}=l;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=Mf(n),this.isVariantNode=T2(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:m,...v}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in v){const w=v[x];d[x]!==void 0&&un(w)&&w.set(d[x],!1)}}mount(t){this.current=t,Jj.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)),JO.current||W$(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Cg.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Jj.delete(this.current),this.projection&&this.projection.unmount(),gs(this.notifyUpdate),gs(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=ca.has(t),i=n.on("change",u=>{this.latestValues[t]=u,this.props.onUpdate&&ct.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),a=n.on("renderRequest",this.scheduleRender);let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a(),l&&l(),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 ao){const n=ao[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):St()}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<Zj.length;r++){const i=Zj[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,l=t[a];l&&(this.propEventSubscriptions[i]=this.on(i,l))}this.prevMotionValues=H$(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=Gl(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"&&(bO(i)||dO(i))?i=parseFloat(i):!K$(i)&&vs.test(n)&&(i=vO(t,n)),this.setBaseTarget(t,un(i)?i.get():i)),un(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 l=Vv(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);l&&(i=l[t])}if(r&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!un(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 nx),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class ZO extends G${constructor(){super(...arguments),this.KeyframeResolver=NO}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;un(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function Y$(e){return window.getComputedStyle(e)}class X$ extends ZO{constructor(){super(...arguments),this.type="html",this.renderInstance=F2}readValueFromInstance(t,n){if(ca.has(n)){const r=ox(n);return r&&r.default||0}else{const r=Y$(t),i=(L2(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return BO(t,n)}build(t,n,r){qv(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Yv(t,n,r)}}class Q$ extends ZO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=St}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ca.has(n)){const r=ox(n);return r&&r.default||0}return n=B2.has(n)?n:zv(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return W2(t,n,r)}build(t,n,r){Kv(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){V2(t,n,r,i)}mount(t){this.isSVGTag=Gv(t.tagName),super.mount(t)}}const J$=(e,t)=>Bv(e)?new Q$(t):new X$(t,{allowProjection:e!==b.Fragment}),Z$=N4({...jL,...V$,...T$,...U$},J$),Yr=zD(Z$),fx={Backlog:["planned","pending"],Ready:["ready"],"In Progress":["implementing","feedback"],Review:["implemented","testing"],Done:["completed"]},e6={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"}},_d=["Backlog","Ready","In Progress","Review","Done"],t6={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 n6(e){for(const[t,n]of Object.entries(fx))if(n.includes(e))return t;return null}function lo(e){return e6[e]||null}function r6(e){return t6[e]||null}function co(e){const t={};_d.forEach(n=>{t[n]=[]}),e.forEach(n=>{const r=n6(n.status);r&&t[r]&&t[r].push(n)});for(const n of _d)t[n].sort((r,i)=>{var u,d;const a=((u=r.metadata)==null?void 0:u.codingOrder)??1/0,l=((d=i.metadata)==null?void 0:d.codingOrder)??1/0;return a!==l?a-l:(r.id||"").localeCompare(i.id||"")});return t}function eA(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=eA(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function it(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=eA(e))&&(r&&(r+=" "),r+=t);return r}const px="-",i6=e=>{const t=a6(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{const u=l.split(px);return u[0]===""&&u.length!==1&&u.shift(),tA(u,t)||s6(l)},getConflictingClassGroupIds:(l,u)=>{const d=n[l]||[];return u&&r[l]?[...d,...r[l]]:d}}},tA=(e,t)=>{var l;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?tA(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const a=e.join(px);return(l=t.validators.find(({validator:u})=>u(a)))==null?void 0:l.classGroupId},eS=/^\[(.+)\]$/,s6=e=>{if(eS.test(e)){const t=eS.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},a6=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return l6(Object.entries(e.classGroups),n).forEach(([a,l])=>{Og(l,r,a,t)}),r},Og=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const a=i===""?t:tS(t,i);a.classGroupId=n;return}if(typeof i=="function"){if(o6(i)){Og(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([a,l])=>{Og(l,tS(t,a),n,r)})})},tS=(e,t)=>{let n=e;return t.split(px).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},o6=e=>e.isThemeGetter,l6=(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(([l,u])=>[t+l,u])):a);return[n,i]}):e,c6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(a,l)=>{n.set(a,l),t++,t>e&&(t=0,r=n,n=new Map)};return{get(a){let l=n.get(a);if(l!==void 0)return l;if((l=r.get(a))!==void 0)return i(a,l),l},set(a,l){n.has(a)?n.set(a,l):i(a,l)}}},nA="!",u6=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,l=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 v=d.length===0?u:u.substring(h),x=v.startsWith(nA),w=x?v.substring(1):v,S=m&&m>h?m-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:S}};return n?u=>n({className:u,parseClassName:l}):l},d6=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},f6=e=>({cache:c6(e.cacheSize),parseClassName:u6(e),...i6(e)}),p6=/\s+/,h6=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],l=e.trim().split(p6);let u="";for(let d=l.length-1;d>=0;d-=1){const p=l[d],{modifiers:h,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:x}=n(p);let w=!!x,S=r(w?v.substring(0,x):v);if(!S){if(!w){u=p+(u.length>0?" "+u:u);continue}if(S=r(v),!S){u=p+(u.length>0?" "+u:u);continue}w=!1}const j=d6(h).join(":"),k=m?j+nA:j,C=k+S;if(a.includes(C))continue;a.push(C);const E=i(S,w);for(let O=0;O<E.length;++O){const P=E[O];a.push(k+P)}u=p+(u.length>0?" "+u:u)}return u};function m6(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=rA(t))&&(r&&(r+=" "),r+=n);return r}const rA=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rA(e[r]))&&(n&&(n+=" "),n+=t);return n};function g6(e,...t){let n,r,i,a=l;function l(d){const p=t.reduce((h,m)=>m(h),e());return n=f6(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=h6(d,n);return i(d,h),h}return function(){return a(m6.apply(null,arguments))}}const ot=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},iA=/^\[(?:([a-z-]+):)?(.+)\]$/i,v6=/^\d+\/\d+$/,x6=new Set(["px","full","screen"]),y6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,b6=/\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$/,w6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,j6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,S6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,di=e=>to(e)||x6.has(e)||v6.test(e),ss=e=>ko(e,"length",T6),to=e=>!!e&&!Number.isNaN(Number(e)),jm=e=>ko(e,"number",to),yl=e=>!!e&&Number.isInteger(Number(e)),N6=e=>e.endsWith("%")&&to(e.slice(0,-1)),Re=e=>iA.test(e),as=e=>y6.test(e),k6=new Set(["length","size","percentage"]),P6=e=>ko(e,k6,sA),C6=e=>ko(e,"position",sA),O6=new Set(["image","url"]),A6=e=>ko(e,O6,_6),E6=e=>ko(e,"",M6),bl=()=>!0,ko=(e,t,n)=>{const r=iA.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},T6=e=>b6.test(e)&&!w6.test(e),sA=()=>!1,M6=e=>j6.test(e),_6=e=>S6.test(e),I6=()=>{const e=ot("colors"),t=ot("spacing"),n=ot("blur"),r=ot("brightness"),i=ot("borderColor"),a=ot("borderRadius"),l=ot("borderSpacing"),u=ot("borderWidth"),d=ot("contrast"),p=ot("grayscale"),h=ot("hueRotate"),m=ot("invert"),v=ot("gap"),x=ot("gradientColorStops"),w=ot("gradientColorStopPositions"),S=ot("inset"),j=ot("margin"),k=ot("opacity"),C=ot("padding"),E=ot("saturate"),O=ot("scale"),P=ot("sepia"),A=ot("skew"),M=ot("space"),D=ot("translate"),$=()=>["auto","contain","none"],q=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto",Re,t],L=()=>[Re,t],Z=()=>["",di,ss],J=()=>["auto",to,Re],ne=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",Re],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>[to,Re];return{cacheSize:500,separator:":",theme:{colors:[bl],spacing:[di,ss],blur:["none","",as,Re],brightness:_(),borderColor:[e],borderRadius:["none","","full",as,Re],borderSpacing:L(),borderWidth:Z(),contrast:_(),grayscale:G(),hueRotate:_(),invert:G(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[N6,ss],inset:X(),margin:X(),opacity:_(),padding:L(),saturate:_(),scale:_(),sepia:G(),skew:_(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Re]}],container:["container"],columns:[{columns:[as]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"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(),Re]}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],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",yl,Re]}],basis:[{basis:X()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Re]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",yl,Re]}],"grid-cols":[{"grid-cols":[bl]}],"col-start-end":[{col:["auto",{span:["full",yl,Re]},Re]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[bl]}],"row-start-end":[{row:["auto",{span:[yl,Re]},Re]}],"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",Re]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Re]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"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",Re,t]}],"min-w":[{"min-w":[Re,t,"min","max","fit"]}],"max-w":[{"max-w":[Re,t,"none","full","min","max","fit","prose",{screen:[as]},as]}],h:[{h:[Re,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Re,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Re,t,"auto","min","max","fit"]}],"font-size":[{text:["base",as,ss]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jm]}],"font-family":[{font:[bl]}],"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",Re]}],"line-clamp":[{"line-clamp":["none",to,jm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",di,Re]}],"list-image":[{"list-image":["none",Re]}],"list-style-type":[{list:["none","disc","decimal",Re]}],"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",di,ss]}],"underline-offset":[{"underline-offset":["auto",di,Re]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re]}],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",Re]}],"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(),C6]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",P6]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},A6]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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":[di,Re]}],"outline-w":[{outline:[di,ss]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[di,ss]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",as,E6]}],"shadow-color":[{shadow:[bl]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",as,Re]}],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":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Re]}],duration:[{duration:_()}],ease:[{ease:["linear","in","out","in-out",Re]}],delay:[{delay:_()}],animate:[{animate:["none","spin","ping","pulse","bounce",Re]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[O]}],"scale-x":[{"scale-x":[O]}],"scale-y":[{"scale-y":[O]}],rotate:[{rotate:[yl,Re]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Re]}],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",Re]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Re]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[di,ss,jm]}],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"]}}},D6=g6(I6);function Xe(...e){return D6(it(e))}const nS={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 R6({workItem:e,onClick:t}){var a;const n=lo(e.status),r=nS[e.type]||nS.task,i=e.status==="blocked";return c.jsxs(Yr.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:Xe("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:[c.jsx("div",{className:"p-3 pb-2 border-b border-slate-100",children:c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:Xe("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]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[((a=e.metadata)==null?void 0:a.codingPhase)&&c.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]}),c.jsx("div",{className:Xe("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})]})]})}),c.jsxs("div",{className:"p-3 pb-2",children:[i&&c.jsxs("div",{className:"flex items-center gap-2 mb-2 text-red-600 text-sm",children:[c.jsx(c3,{className:"w-4 h-4"}),c.jsx("span",{className:"font-medium",children:"Blocked"})]}),c.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}),c.jsxs("div",{className:"space-y-1 text-sm text-slate-600",children:[e.epicName&&e.type!=="epic"&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Nd,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("span",{className:"truncate",children:["Epic: ",e.epicName]})]}),e.children&&e.children.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(w3,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("span",{children:[e.children.length," ",e.children.length===1?"child":"children"," •"," ",e.children.filter(l=>l.status==="completed").length," ","completed"]})]}),e.dependencies&&e.dependencies.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(g2,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("span",{children:[e.dependencies.length," ",e.dependencies.length===1?"dependency":"dependencies"]})]})]})]}),c.jsx("div",{className:"px-3 py-2 border-t border-slate-100",children:c.jsx("span",{className:"text-xs text-slate-400",children:e.id})})]})}function aA({columnName:e,statuses:t,workItems:n,onCardClick:r}){const i=r6(e),a=t.reduce((u,d)=>(u[d]=n.filter(p=>p.status===d).length,u),{}),l=n.length;return c.jsxs("div",{className:Xe("flex flex-col rounded-lg p-4 min-w-[320px] max-w-[380px]",(i==null?void 0:i.bgColor)||"bg-slate-100"),children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:e}),c.jsxs("span",{className:Xe("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:[l," ",l===1?"item":"items"]})]}),t.length>1&&l>0&&c.jsx("div",{className:"text-xs text-slate-600 mb-3 flex flex-wrap gap-2",children:t.map(u=>{const d=a[u],p=lo(u);return d===0?null:c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx("span",{children:p==null?void 0:p.icon}),c.jsxs("span",{children:[p==null?void 0:p.label,": ",d]})]},u)})}),c.jsx("div",{className:"flex flex-col gap-3 overflow-y-auto flex-1 min-h-0",children:n.length===0?c.jsx(Yr.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)=>c.jsx(Yr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.2,delay:d*.05},children:c.jsx(R6,{workItem:u,onClick:()=>r==null?void 0:r(u)})},u.id))})]})}function L6({group:e,columnVisibility:t,onCardClick:n}){const[r,i]=b.useState(!0),{name:a,epic:l,items:u,columns:d}=e,p=e.type==="ungrouped",h=u.length,m=u.filter(S=>S.status==="completed").length,v=h>0?m/h*100:0,x=l==null?void 0:l.status,w=x?lo(x):null;return c.jsxs("div",{className:"mb-8",children:[c.jsx("div",{className:Xe("mb-4 pb-4 border-b-2",p?"border-slate-300":"border-indigo-300"),children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[c.jsx("button",{onClick:()=>i(!r),className:"text-slate-600 hover:text-slate-900 transition-colors mt-3 flex-shrink-0",children:r?c.jsx(yi,{className:"w-5 h-5"}):c.jsx(lr,{className:"w-5 h-5"})}),l&&!p?c.jsx("button",{onClick:()=>n==null?void 0:n(l),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:c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[c.jsxs("span",{className:"text-lg font-bold text-indigo-900",children:["🏛️ ",a]}),w&&c.jsxs("span",{className:Xe("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]})]}),(l==null?void 0:l.description)&&c.jsx("p",{className:"text-sm text-slate-500 line-clamp-2",children:l.description})]}),c.jsx(lr,{className:"w-4 h-4 text-indigo-400 mt-1 flex-shrink-0"})]})}):c.jsx("div",{className:"flex-1 py-2",children:c.jsxs("h2",{className:Xe("text-xl font-bold",p?"text-slate-600":"text-indigo-900"),children:[p?"📂":"🏛️"," ",a]})})]}),c.jsxs("div",{className:"text-right flex-shrink-0",children:[c.jsxs("div",{className:"text-sm text-slate-600 mb-1",children:[m," / ",h," completed"]}),c.jsx("div",{className:"w-48 h-2 bg-slate-200 rounded-full overflow-hidden",children:c.jsx(Yr.div,{initial:{width:0},animate:{width:`${v}%`},transition:{duration:.5,ease:"easeOut"},className:Xe("h-full",p?"bg-slate-500":"bg-indigo-600")})})]})]})}),r&&c.jsx(Yr.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:_d.filter(S=>t[S]).map(S=>{const j=fx[S],k=d[S]||[];return c.jsx(aA,{columnName:S,statuses:j,workItems:k,onCardClick:n},`${e.id}-${S}`)})})]})}function $6(e,t){return b.useMemo(()=>{switch(t){case"status":return rS(e);case"epic":return z6(e);case"type":return F6(e);case"phase":return B6(e);default:return rS(e)}},[e,t])}function rS(e){const t=co(e);return{mode:"columns",groups:_d.map(n=>({id:n,name:n,items:t[n]||[],type:"column"}))}}function z6(e){const n=e.filter(i=>i.type==="epic").map(i=>{const a=e.filter(u=>u.epicId===i.id),l=co(a);return{id:i.id,name:i.name,epic:i,items:a,columns:l,type:"epic"}}),r=e.filter(i=>!i.epicId&&i.type!=="epic");if(r.length>0){const i=co(r);n.push({id:"ungrouped",name:"No Epic",items:r,columns:i,type:"ungrouped"})}return{mode:"sections",groups:n}}function F6(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(l=>l.type===r.id),a=co(i);return{id:r.id,name:r.name,items:i,columns:a,type:"type"}}).filter(r=>r.items.length>0)}}function B6(e){var a;const t=new Map,n=[];for(const l of e){const u=(a=l.metadata)==null?void 0:a.codingPhase;u!=null?(t.has(u)||t.set(u,[]),t.get(u).push(l)):n.push(l)}const i=[...t.entries()].sort((l,u)=>l[0]-u[0]).map(([l,u])=>{u.sort((m,v)=>{var x,w;return(((x=m.metadata)==null?void 0:x.codingOrder)??0)-(((w=v.metadata)==null?void 0:w.codingOrder)??0)});const d=co(u),p=[...new Set(u.filter(m=>m.type==="epic").map(m=>m.name))],h=p.length>0?`Phase ${l}: ${p.join(", ")}`:`Phase ${l}`;return{id:`phase-${l}`,name:h,items:u,columns:d,type:"phase"}});return n.length>0&&i.push({id:"unphased",name:"No Phase",items:n,columns:co(n),type:"ungrouped"}),{mode:"sections",groups:i}}function V6({onCardClick:e,onStartProject:t,projectFilesReady:n,onEditProjectDoc:r,onStartSprintPlanning:i,onOpenSprintPlanningSelection:a,sponsorCallRunning:l}){const[u,d]=b.useState(null),{workItems:p,loading:h}=Cf(),{typeFilters:m,columnVisibility:v,searchQuery:x,groupBy:w}=Of(),S=b.useMemo(()=>{let C=p.filter(E=>m[E.type]);if(x.trim()){const E=x.toLowerCase();C=C.filter(O=>O.name.toLowerCase().includes(E)||O.id.toLowerCase().includes(E)||O.description&&O.description.toLowerCase().includes(E)||O.epicName&&O.epicName.toLowerCase().includes(E))}return C},[p,m,x]),j=$6(S,w),k=C=>{d(C),e==null||e(C)};return h&&p.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),c.jsx("p",{className:"text-slate-600",children:"Loading work items..."})]})}):S.length===0&&p.length>0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-6xl mb-4",children:"🔍"}),c.jsx("h3",{className:"text-xl font-semibold text-slate-900 mb-2",children:"No items match your filters"}),c.jsx("p",{className:"text-slate-600",children:"Try adjusting your filters or search query"})]})}):p.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx("div",{className:"text-center",children:t?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-6xl mb-4",children:"📋"}),c.jsx("h3",{className:"text-xl font-semibold text-slate-900 mb-2",children:"No Work Items"}),c.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"Run the Sponsor Call ceremony to set up your project."}),c.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?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-5xl mb-4",children:"🏃"}),c.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-3",children:"Ready for Sprint Planning"}),c.jsx("p",{className:"text-sm text-slate-500 mb-2 max-w-sm",children:"Your project is set up and ready for sprint planning."}),c.jsxs("p",{className:"text-sm text-slate-700 font-medium mb-5 max-w-sm",children:["Review ",c.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."]}),c.jsx("div",{className:"flex items-center justify-center gap-3 mb-6",children:c.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?c.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?c.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:[c.jsx("span",{children:"⚠"}),"Sprint planning needs your input"]}):c.jsx("p",{className:"text-xs text-slate-400",children:"Sprint planning is running…"})]}):l?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"text-5xl mb-4",children:"📋"}),c.jsx("h3",{className:"text-lg font-semibold text-slate-900 mb-3",children:"Sponsor Call is running…"}),c.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"?c.jsx(Yr.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.3},children:j.groups.length===0?c.jsx("div",{className:"text-center py-12",children:c.jsx("p",{className:"text-slate-600",children:"No groups to display"})}):j.groups.map((C,E)=>c.jsx(Yr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:E*.1},children:c.jsx(L6,{group:C,columnVisibility:v,onCardClick:k})},C.id))},w):c.jsx(Yr.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:c.jsx(P2,{mode:"sync",children:j.groups.filter(C=>v[C.name]).map(C=>c.jsx(aA,{columnName:C.name,statuses:fx[C.name],workItems:C.items,onCardClick:k},C.id))})},w)}const U6={doc:{title:"Project Documentation",filename:"doc.md",load:I3,save:D3}};function W6({fileType:e,onClose:t}){const n=U6[e],[r,i]=b.useState(""),[a,l]=b.useState(""),[u,d]=b.useState(!0),[p,h]=b.useState(!1),[m,v]=b.useState(!1),x=r!==a;b.useEffect(()=>{n.load().then(j=>{i(j??""),l(j??""),d(!1)})},[e]);const w=async()=>{if(!(!x||p)){h(!0);try{await n.save(r),l(r),v(!0),setTimeout(()=>v(!1),2e3)}finally{h(!1)}}},S=()=>{x?i(a):t()};return c.jsxs("div",{className:"fixed inset-0 z-[80] flex items-center justify-center",onClick:j=>{j.target===j.currentTarget&&t()},children:[c.jsx("div",{className:"absolute inset-0 bg-black/40"}),c.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:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-slate-200 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-semibold text-slate-900",children:n.title}),c.jsx("p",{className:"text-xs text-slate-500 mt-0.5 font-mono",children:n.filename})]}),c.jsx("button",{onClick:t,className:"text-slate-400 hover:text-slate-600 transition-colors",title:"Close",children:c.jsx(vn,{className:"w-5 h-5"})})]}),c.jsx("div",{className:"flex-1 overflow-hidden p-4",children:u?c.jsx("div",{className:"flex items-center justify-center h-full",children:c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-slate-400"})}):c.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})}),c.jsxs("div",{className:"flex items-center justify-end gap-3 px-5 py-3 border-t border-slate-200 flex-shrink-0",children:[m&&c.jsx("span",{className:"text-sm text-green-600 font-medium mr-auto",children:"Saved ✓"}),c.jsx("button",{onClick:S,disabled:!x,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"}),c.jsx("button",{onClick:w,disabled:!x||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 q6(){const{groupBy:e,setGroupBy:t}=Of(),n=[{value:"status",label:"Status",icon:p3,description:"Traditional kanban columns"},{value:"epic",label:"Epic",icon:Nd,description:"Hierarchical epic sections"},{value:"type",label:"Type",icon:a3,description:"Separate boards by type"},{value:"phase",label:"Phase",icon:m3,description:"Implementation order by dependencies"}];return c.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:l})=>{const u=e===r;return c.jsxs("button",{onClick:()=>t(r),title:l,className:Xe("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:[c.jsx(a,{className:"w-3.5 h-3.5"}),c.jsx("span",{children:i})]},r)})})}function K6(){const[e,t]=b.useState(""),{typeFilters:n,columnVisibility:r,searchQuery:i,toggleTypeFilter:a,setAllTypeFilters:l,toggleColumnVisibility:u,applyPreset:d,setSearchQuery:p,clearSearch:h,resetFilters:m}=Of(),{refresh:v,loading:x}=Cf(),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=O=>{const P=O.target.value;t(P),clearTimeout(window.searchDebounce),window.searchDebounce=setTimeout(()=>{p(P)},300)},k=()=>{t(""),h()},C=Object.values(n).every(O=>O),E=Object.values(n).some(O=>O);return c.jsx("div",{className:"bg-white border-b border-slate-200 shadow-sm",children:c.jsx("div",{className:"max-w-full px-4 py-2",children:c.jsxs("div",{className:"flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("button",{onClick:()=>l(!C),className:Xe("-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:c.jsx(f3,{className:"w-4 h-4"})}),c.jsx("div",{className:"flex items-center gap-1",children:w.map(({key:O,label:P,icon:A})=>c.jsxs("button",{onClick:()=>a(O),className:Xe("px-2.5 py-1 rounded-md text-xs font-medium transition-colors","flex items-center gap-1",n[O]?"bg-blue-100 text-blue-700 hover:bg-blue-200":"bg-slate-100 text-slate-400 hover:bg-slate-200"),children:[c.jsx("span",{className:"text-sm leading-none",children:A}),c.jsx("span",{children:P})]},O))}),c.jsx("div",{className:"w-px h-5 bg-slate-200 flex-shrink-0"}),c.jsx(q6,{})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[c.jsxs("div",{className:"relative group",children:[c.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:[c.jsx(jd,{className:"w-3.5 h-3.5"}),"Columns"]}),c.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:[c.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:O,label:P})=>c.jsxs("button",{onClick:()=>u(O),className:"w-full px-3 py-2 text-sm text-left hover:bg-slate-50 flex items-center justify-between",children:[c.jsx("span",{children:P}),r[O]?c.jsx(jd,{className:"w-4 h-4 text-blue-600"}):c.jsx(Ev,{className:"w-4 h-4 text-slate-400"})]},O)),c.jsxs("div",{className:"border-t border-slate-100 mt-2 pt-2 px-3",children:[c.jsx("button",{onClick:()=>d("all"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Show All"}),c.jsx("span",{className:"text-slate-300 mx-2",children:"•"}),c.jsx("button",{onClick:()=>d("active"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Active Work"}),c.jsx("span",{className:"text-slate-300 mx-2",children:"•"}),c.jsx("button",{onClick:()=>d("hide-completed"),className:"text-xs text-blue-600 hover:text-blue-700 font-medium",children:"Hide Done"})]})]})]}),c.jsxs("div",{className:"relative",children:[c.jsx(y3,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-slate-400"}),c.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&&c.jsx("button",{onClick:k,className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",children:c.jsx(vn,{className:"w-3.5 h-3.5"})})]}),c.jsx("button",{onClick:v,disabled:x,className:Xe("p-1.5 rounded-md transition-colors",x?"bg-slate-100 text-slate-400 cursor-not-allowed":"bg-slate-100 text-slate-700 hover:bg-slate-200"),title:"Refresh",children:c.jsx(v3,{className:Xe("w-3.5 h-3.5",x&&"animate-spin")})}),c.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 iS={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"},sS={running:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-blue-500 animate-pulse flex-shrink-0"}),paused:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-500 flex-shrink-0"}),complete:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-500 flex-shrink-0"}),error:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-500 flex-shrink-0"}),cancelled:c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-400 flex-shrink-0"})};function H6(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 G6(){const{processes:e,clearCompleted:t}=S2(),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")jo.getState().reopenModal();else if(a.type==="sponsor-call")cr.getState().reopenWizard();else if(a.type==="seed"){const l=ql.getState().getStoryIdByProcessId(a.id);l&&ql.getState().reopenModal(l)}};return c.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:[c.jsx(s3,{className:"w-4 h-4 text-slate-400 flex-shrink-0"}),n.map(a=>c.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 ${iS[a.status]??iS.cancelled}`,children:[sS[a.status]??sS.cancelled,c.jsx("span",{className:"font-medium",children:a.label}),c.jsx("span",{className:"opacity-60",children:H6(a.startedAt,a.endedAt)})]},a.id)),r&&c.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 Y6({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]),c.jsx(P2,{children:e&&c.jsxs(c.Fragment,{children:[c.jsx(Yr.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:()=>t(!1),className:"fixed inset-0 bg-black/50 z-50"}),c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:n})]})})}function X6({className:e,children:t,onClose:n}){return c.jsxs(Yr.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:Xe("relative bg-white rounded-lg shadow-xl max-w-4xl w-full h-[90vh] overflow-hidden","flex flex-col",e),children:[c.jsxs("button",{onClick:n,className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100 transition-opacity z-10",children:[c.jsx(vn,{className:"h-5 w-5"}),c.jsx("span",{className:"sr-only",children:"Close"})]}),t]})}function Q6({className:e,children:t}){return c.jsx("div",{className:Xe("flex flex-col space-y-1.5 px-6 pt-6 pb-4",e),children:t})}function J6({className:e,children:t}){return c.jsx("h2",{className:Xe("text-2xl font-semibold leading-none tracking-tight",e),children:t})}function Z6({className:e,children:t}){return c.jsx("p",{className:Xe("text-sm text-slate-600",e),children:t})}const hx=b.createContext();function aS({defaultValue:e,value:t,onValueChange:n,children:r,className:i}){const[a,l]=b.useState(t||e);b.useEffect(()=>{t!==void 0&&l(t)},[t]);const u=d=>{l(d),n==null||n(d)};return c.jsx(hx.Provider,{value:{selectedTab:a,setSelectedTab:u},children:c.jsx("div",{className:Xe("w-full",i),children:r})})}function ez({className:e,children:t}){return c.jsx("div",{className:Xe("inline-flex h-10 items-center justify-start rounded-md bg-slate-100 p-1 text-slate-600",e),children:t})}function qu({value:e,children:t,className:n}){const{selectedTab:r,setSelectedTab:i}=b.useContext(hx),a=r===e;return c.jsx("button",{onClick:()=>i(e),className:Xe("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 Ku({value:e,children:t,className:n}){const{selectedTab:r}=b.useContext(hx);return r!==e?null:c.jsx("div",{className:Xe("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 Qa({variant:e="default",className:t,children:n}){return c.jsx("div",{className:Xe("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 tz({storyId:e,storyName:t}){const{sessions:n,openModal:r,reopenModal:i}=ql(),a=n[e],l=a&&(a.status==="seeding"||a.status==="checking"),u=()=>{l?i(e):r(e,t||e)};return c.jsx("button",{onClick:u,className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${l?"bg-green-100 text-green-700 hover:bg-green-200":"bg-green-600 text-white hover:bg-green-700"}`,children:l?c.jsxs(c.Fragment,{children:[c.jsx(Sd,{className:"w-4 h-4 animate-spin"}),"View Seed"]}):c.jsxs(c.Fragment,{children:[c.jsx(x2,{className:"w-4 h-4"}),"Seed"]})})}function nz({taskId:e,onStarted:t}){const[n,r]=b.useState("idle"),[i,a]=b.useState([]),[l,u]=b.useState(null),[d,p]=b.useState([]),[h,m]=b.useState(!1),[v,x]=b.useState(null),w=b.useRef(null);b.useEffect(()=>{w.current&&(w.current.scrollTop=w.current.scrollHeight)},[d]),b.useEffect(()=>{if(!v)return;const k=C=>{const E=C.detail;!E||E.processId!==v||(E.type==="run-task:progress"?p(O=>[...O,E.message]):E.type==="run-task:complete"?(r("complete"),p(O=>[...O,"Task complete — code committed."]),t==null||t()):E.type==="run-task:error"&&(r("error"),u(E.error||"Run failed"),p(O=>[...O,`Error: ${E.error}`])))};return window.addEventListener("avc-ws-message",k),()=>window.removeEventListener("avc-ws-message",k)},[v,t]);const S=async()=>{if(!(n==="checking"||n==="running")){r("checking"),u(null),a([]),p([]);try{const k=await j2(e);if(!k.ready){r("blocked"),a(k.blockers||[]);return}r("running"),m(!0),p(["Starting task implementation..."]);const C=await vD(e);x(C.processId),p(E=>[...E,`Process started: ${C.processId}`])}catch(k){u(k.message),r("error")}}},j=()=>{r("idle"),a([]),u(null),p([]),m(!1),x(null)};return n==="blocked"?c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2 text-amber-700 text-sm bg-amber-50 border border-amber-200 rounded-lg px-3 py-2",children:[c.jsx(hs,{className:"w-4 h-4 flex-shrink-0"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium",children:"Dependencies not met"}),c.jsx("ul",{className:"mt-1 text-xs space-y-0.5",children:i.map(k=>c.jsxs("li",{children:[k.id,": ",k.name," (",k.status,")"]},k.id))})]})]}),c.jsx("button",{onClick:j,className:"text-xs text-slate-500 hover:text-slate-700",children:"Dismiss"})]}):(n==="running"||n==="complete"||n==="error")&&h?c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[n==="running"&&c.jsx(Sd,{className:"w-4 h-4 animate-spin text-blue-600"}),n==="complete"&&c.jsx(E1,{className:"w-4 h-4 text-green-600"}),n==="error"&&c.jsx(hs,{className:"w-4 h-4 text-red-600"}),c.jsx("span",{className:Xe(n==="running"&&"text-blue-700",n==="complete"&&"text-green-700",n==="error"&&"text-red-700"),children:n==="running"?"Implementing...":n==="complete"?"Complete":"Failed"})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{onClick:()=>m(!h),className:"p-1 text-slate-400 hover:text-slate-600",children:h?c.jsx(h2,{className:"w-3.5 h-3.5"}):c.jsx(yi,{className:"w-3.5 h-3.5"})}),n!=="running"&&c.jsx("button",{onClick:j,className:"p-1 text-slate-400 hover:text-slate-600",children:c.jsx(vn,{className:"w-3.5 h-3.5"})})]})]}),h&&c.jsxs("div",{ref:w,className:"max-h-32 overflow-y-auto bg-slate-900 text-slate-300 text-xs font-mono rounded-md p-2 space-y-0.5",children:[d.map((k,C)=>c.jsx("div",{className:Xe(k.startsWith("Error")&&"text-red-400",k.includes("complete")&&"text-green-400"),children:k},C)),n==="running"&&c.jsx("div",{className:"text-slate-500 animate-pulse",children:"..."})]})]}):c.jsxs("div",{className:"space-y-1",children:[c.jsxs("button",{onClick:S,disabled:n==="checking",className:Xe("flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors",n==="checking"?"bg-blue-100 text-blue-700 cursor-wait":"bg-blue-600 text-white hover:bg-blue-700"),children:[n==="checking"?c.jsx(Sd,{className:"w-4 h-4 animate-spin"}):c.jsx(E1,{className:"w-4 h-4"}),n==="checking"?"Checking...":"Run"]}),l&&c.jsx("p",{className:"text-xs text-red-600",children:l})]})}function rz(e=""){return e==="claude"?"anthropic":e}function oS({label:e,value:t,onChange:n,models:r,disabled:i}){const a=[...new Set(r.map(u=>u.provider))],l=r.find(u=>u.modelId===t);return c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:e}),c.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&&c.jsx("option",{value:"",children:"Loading…"}),a.map(u=>c.jsx("optgroup",{label:u.charAt(0).toUpperCase()+u.slice(1),children:r.filter(d=>d.provider===u).map(d=>c.jsxs("option",{value:d.modelId,children:[d.displayName,d.hasApiKey?"":" (no key)"]},d.modelId))},u))]}),l&&!l.hasApiKey&&c.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",c.jsx("code",{children:".env"})]})]})}function Sm({label:e,before:t,after:n}){const r=Array.isArray(t)?t.join(`
|
|
284
|
-
`):t??"",i=Array.isArray(n)?n.join(`
|
|
285
|
-
`):n??"";return!r&&!i||r===i?null:c.jsxs("div",{className:"mb-3",children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-1",children:e}),r&&c.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&&c.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 iz({impact:e,checked:t,onToggle:n}){var a;const[r,i]=b.useState(!1);return c.jsxs("div",{className:`border rounded-lg overflow-hidden transition-colors ${t?"border-violet-300 bg-violet-50":"border-slate-200 bg-white"}`,children:[c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[c.jsx("input",{type:"checkbox",checked:t,onChange:n,className:"flex-shrink-0 accent-violet-600"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("p",{className:"text-xs font-medium text-slate-800 truncate",children:((a=e.proposedStory)==null?void 0:a.name)??e.storyId}),c.jsx("p",{className:"text-xs text-slate-400 truncate",children:e.storyId})]}),e.changesNeeded&&c.jsx("button",{type:"button",onClick:()=>i(l=>!l),className:"flex-shrink-0 text-slate-400 hover:text-slate-600",children:r?c.jsx(yi,{className:"w-3.5 h-3.5"}):c.jsx(lr,{className:"w-3.5 h-3.5"})})]}),r&&e.changesNeeded&&c.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-slate-100",children:c.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:e.changesNeeded})})]})}function sz({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 c.jsxs("div",{className:`border rounded-lg overflow-hidden transition-colors ${t?"border-emerald-300 bg-emerald-50":"border-slate-200 bg-white"}`,children:[c.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5",children:[c.jsx("input",{type:"checkbox",checked:t,onChange:n,className:"flex-shrink-0 accent-emerald-600"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[c.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"}),c.jsx("p",{className:"text-xs font-medium text-slate-800 truncate",children:e==null?void 0:e.name})]}),(e==null?void 0:e.description)&&c.jsx("p",{className:"text-xs text-slate-500 truncate",children:e.description})]}),c.jsx("button",{type:"button",onClick:()=>i(l=>!l),className:"flex-shrink-0 text-slate-400 hover:text-slate-600",children:r?c.jsx(yi,{className:"w-3.5 h-3.5"}):c.jsx(lr,{className:"w-3.5 h-3.5"})})]}),r&&c.jsxs("div",{className:"px-3 pb-3 pt-1 border-t border-slate-100 space-y-2",children:[(e==null?void 0:e.description)&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-0.5",children:"Description"}),c.jsx("p",{className:"text-xs text-slate-700 leading-relaxed",children:e.description})]}),a.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-0.5",children:"Acceptance Criteria"}),c.jsx("ul",{className:"space-y-0.5",children:a.map((l,u)=>c.jsxs("li",{className:"flex items-start gap-1 text-xs text-slate-700",children:[c.jsx("span",{className:"text-slate-400 mt-0.5 flex-shrink-0",children:"•"}),c.jsx("span",{children:l})]},u))})]})]})]})}const az={critical:"text-red-600",major:"text-orange-600",minor:"text-amber-600"},oz={critical:"bg-red-50 border-red-100",major:"bg-orange-50 border-orange-100",minor:"bg-amber-50 border-amber-100"};function lS(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 lz({item:e,refineProgress:t,refineResult:n,refineError:r,onClose:i,onAccepted:a}){var H,me,Oe,se,Le,De,Qe,Ze,_t,Mn,yn,bn,wn;const l=(H=e==null?void 0:e.metadata)==null?void 0:H.validationResult,u=[...((l==null?void 0:l.criticalIssues)||[]).map(he=>({...he,severity:"critical"})),...((l==null?void 0:l.majorIssues)||[]).map(he=>({...he,severity:"major"})),...((l==null?void 0:l.minorIssues)||[]).map(he=>({...he,severity:"minor"}))],[d,p]=b.useState(()=>new Set(u.map((he,ke)=>he.severity==="critical"?ke:null).filter(he=>he!==null))),[h,m]=b.useState(""),[v,x]=b.useState([]),[w,S]=b.useState(""),[j,k]=b.useState(""),[C,E]=b.useState(""),[O,P]=b.useState(!1),[A,M]=b.useState([]),D=b.useRef(null),[$,q]=b.useState(null),[X,L]=b.useState(!1),[Z,J]=b.useState(""),ne=n?"results":O||t?"running":"configure";b.useEffect(()=>{Promise.all([ms(),En()]).then(([he,ke])=>{x(he);const _e=he.filter(He=>{var Rt,_n;return(_n=(Rt=ke.apiKeys)==null?void 0:Rt[rz(He.provider)])==null?void 0:_n.isSet}),Je=He=>/pro|opus|sonnet/i.test(He),Ct=He=>/flash|lite|haiku|mini/i.test(He),It=_e.find(He=>Je(He.modelId))||_e[0],Dt=It?It.modelId:he.length>0?he[0].modelId:"";S(Dt);const dn=_e.find(He=>Ct(He.modelId)&&He.modelId!==Dt)||_e.find(He=>He.modelId!==Dt)||It;k(dn?dn.modelId:Dt)}).catch(()=>E("Failed to load models."))},[]),b.useEffect(()=>{t!=null&&t.message&&M(he=>[...he,t.message])},[t]),b.useEffect(()=>{var he;(he=D.current)==null||he.scrollIntoView({behavior:"smooth"})},[A]),b.useEffect(()=>{var _e;if(!n)return;P(!1);const he=((_e=n.result)==null?void 0:_e.storyImpacts)||[],ke={};he.forEach((Je,Ct)=>{ke[Ct]=Je.type==="new"||Je.impacted===!0}),q(ke)},[n]),b.useEffect(()=>{r&&(P(!1),E(typeof r.error=="string"?r.error:"Refinement failed — please try again."))},[r]);function re(he){p(ke=>{const _e=new Set(ke);return _e.has(he)?_e.delete(he):_e.add(he),_e})}async function B(){const he=v.find(Je=>Je.modelId===w),ke=v.find(Je=>Je.modelId===j);if(!he||!ke)return;const _e=u.filter((Je,Ct)=>d.has(Ct));P(!0),E(""),M([]);try{await lD(e.id,{refinementRequest:h,selectedIssues:_e,modelId:w,provider:he.provider,validatorModelId:j,validatorProvider:ke.provider})}catch(Je){P(!1),E(Je.message||"Failed to start refinement.")}}async function F(){if(!n)return;const{proposedItem:he,storyImpacts:ke=[]}=n.result,_e=ke.filter((Je,Ct)=>$==null?void 0:$[Ct]).map(Je=>({type:Je.type,storyId:Je.storyId??null,proposedStory:Je.proposedStory}));L(!0),J("");try{await cD(e.id,he,_e),a==null||a()}catch(Je){J(Je.message||"Failed to apply changes."),L(!1)}}const G=v.find(he=>he.modelId===w),W=v.find(he=>he.modelId===j),_=!O&&!!w&&!!j&&!!G&&!!W,V=d.size,ie=n==null?void 0:n.result,fe=(ie==null?void 0:ie.storyImpacts)||[],te=fe.map((he,ke)=>({impact:he,i:ke})).filter(({impact:he})=>he.type==="update"&&he.impacted),le=fe.map((he,ke)=>({impact:he,i:ke})).filter(({impact:he})=>he.type==="new"),pe=Object.values($||{}).filter(Boolean).length,Se=e.type==="epic";return c.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:c.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:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsxs("h3",{className:"text-sm font-semibold text-slate-900 flex items-center gap-1.5",children:[c.jsx(cg,{className:"w-3.5 h-3.5 text-violet-600"}),"Refine with AI",ne!=="configure"&&c.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"})]}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5 truncate max-w-xs",children:e.name})]}),ne!=="running"&&c.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:c.jsx(vn,{className:"w-4 h-4"})})]}),ne==="configure"&&c.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4 min-h-0",children:[u.length>0?c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsxs("p",{className:"text-xs font-semibold text-slate-600 uppercase tracking-wide",children:["Validation Issues (",u.length,")"]}),c.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[c.jsx("button",{type:"button",onClick:()=>p(new Set(u.map((he,ke)=>ke))),className:"text-violet-600 hover:text-violet-800 transition-colors",children:"All"}),c.jsx("span",{className:"text-slate-300",children:"|"}),c.jsx("button",{type:"button",onClick:()=>p(new Set),className:"text-slate-400 hover:text-slate-600 transition-colors",children:"None"})]})]}),c.jsx("ul",{className:"space-y-1.5 max-h-52 overflow-y-auto pr-0.5",children:u.map((he,ke)=>c.jsxs("li",{onClick:()=>re(ke),className:`rounded-lg border px-3 py-2 cursor-pointer flex items-start gap-2.5 transition-shadow ${d.has(ke)?"ring-2 ring-violet-400":""} ${oz[he.severity]??"bg-slate-50 border-slate-100"}`,children:[c.jsx("input",{type:"checkbox",checked:d.has(ke),onChange:()=>re(ke),onClick:_e=>_e.stopPropagation(),className:"mt-0.5 flex-shrink-0 accent-violet-600"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:`text-xs font-semibold uppercase ${az[he.severity]??"text-slate-500"}`,children:he.severity}),c.jsx("p",{className:"text-xs text-slate-800 mt-0.5 leading-snug",children:he.description}),he.suggestion&&c.jsxs("p",{className:"text-xs text-slate-500 mt-0.5 leading-snug",children:[c.jsx("span",{className:"font-medium",children:"Suggestion:"})," ",he.suggestion]})]})]},ke))})]}):c.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 bg-green-50 border border-green-100 rounded-lg",children:[c.jsx(Ul,{className:"w-3.5 h-3.5 text-green-600 flex-shrink-0"}),c.jsx("p",{className:"text-xs text-green-700",children:"No validation issues found — you can still refine with a custom request."})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:["Refinement request"," ",c.jsx("span",{className:"text-slate-400",children:"(optional)"})]}),c.jsx("textarea",{value:h,onChange:he=>m(he.target.value),rows:3,placeholder:Se?"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"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(oS,{label:"Generator Model",value:w,onChange:S,models:v,disabled:!1}),c.jsx(oS,{label:"Validator Model",value:j,onChange:k,models:v,disabled:!1})]}),C&&c.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-red-50 border border-red-100 rounded-lg",children:[c.jsx(hs,{className:"w-3.5 h-3.5 text-red-500 flex-shrink-0 mt-0.5"}),c.jsx("p",{className:"text-xs text-red-700",children:C})]})]}),ne==="running"&&c.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden px-5 py-4 min-h-0",children:[c.jsxs("div",{className:"flex flex-col items-center gap-3 mb-4 flex-shrink-0",children:[c.jsx("span",{className:"w-8 h-8 border-2 border-violet-200 border-t-violet-600 rounded-full animate-spin"}),c.jsxs("p",{className:"text-sm font-medium text-slate-700",children:["Refining ",e.type,"…"]})]}),c.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:[A.length===0?c.jsx("p",{className:"text-xs text-slate-400 italic",children:"Starting…"}):A.map((he,ke)=>c.jsx("p",{className:"text-xs text-slate-600 leading-snug",children:he},ke)),c.jsx("div",{ref:D})]})]}),ne==="results"&&ie&&c.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5 min-h-0",children:[(()=>{var _e,Je,Ct,It,Dt,dn;const he=(Je=(_e=e==null?void 0:e.metadata)==null?void 0:_e.validationResult)==null?void 0:Je.averageScore,ke=((Ct=ie.validationResult)==null?void 0:Ct.averageScore)??((dn=(Dt=(It=ie.proposedItem)==null?void 0:It.metadata)==null?void 0:Dt.validationResult)==null?void 0:dn.averageScore);return ke==null?null:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide",children:"Validation Score"}),c.jsxs("div",{className:"flex items-center gap-2",children:[he!=null&&c.jsxs(c.Fragment,{children:[c.jsxs("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${lS(he)}`,children:[he,"/100"]}),c.jsx("span",{className:"text-slate-400 text-xs",children:"→"})]}),c.jsxs("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${lS(ke)}`,children:[ke,"/100"]})]})]})})(),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Proposed Changes"}),c.jsx(Sm,{label:"Description",before:(me=ie.originalItem)==null?void 0:me.description,after:(Oe=ie.proposedItem)==null?void 0:Oe.description}),Se&&c.jsx(Sm,{label:"Features",before:(se=ie.originalItem)==null?void 0:se.features,after:(Le=ie.proposedItem)==null?void 0:Le.features}),!Se&&c.jsx(Sm,{label:"Acceptance Criteria",before:((De=ie.originalItem)==null?void 0:De.acceptance)??((Qe=ie.originalItem)==null?void 0:Qe.acceptanceCriteria),after:((Ze=ie.proposedItem)==null?void 0:Ze.acceptance)??((_t=ie.proposedItem)==null?void 0:_t.acceptanceCriteria)}),((Mn=ie.originalItem)==null?void 0:Mn.description)===((yn=ie.proposedItem)==null?void 0:yn.description)&&!((bn=ie.originalItem)!=null&&bn.features)&&!((wn=ie.originalItem)!=null&&wn.acceptanceCriteria)&&c.jsx("p",{className:"text-xs text-slate-400 italic",children:"No textual changes detected — check dependencies or metadata."})]}),te.length>0&&c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["Existing Stories to Update (",te.length,")"]}),c.jsx("div",{className:"space-y-2",children:te.map(({impact:he,i:ke})=>c.jsx(iz,{impact:he,checked:($==null?void 0:$[ke])??!0,onToggle:()=>q(_e=>({..._e,[ke]:!(_e!=null&&_e[ke])}))},ke))})]}),le.length>0&&c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["New Stories to Add (",le.length,")"]}),c.jsx("div",{className:"space-y-2",children:le.map(({impact:he,i:ke})=>c.jsx(sz,{story:he.proposedStory,checked:($==null?void 0:$[ke])??!0,onToggle:()=>q(_e=>({..._e,[ke]:!(_e!=null&&_e[ke])}))},ke))})]}),Z&&c.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 bg-red-50 border border-red-100 rounded-lg",children:[c.jsx(hs,{className:"w-3.5 h-3.5 text-red-500 flex-shrink-0 mt-0.5"}),c.jsx("p",{className:"text-xs text-red-700",children:Z})]})]}),c.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"&&c.jsxs(c.Fragment,{children:[c.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"}),c.jsxs("button",{type:"button",onClick:B,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:[c.jsx(cg,{className:"w-3.5 h-3.5"}),V>0?`Refine (${V} issue${V!==1?"s":""})`:"Refine"]})]}),ne==="running"&&c.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"&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:i,disabled:X,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"}),c.jsx("button",{type:"button",onClick:F,disabled:X,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:X?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Applying…"]}):c.jsxs(c.Fragment,{children:[c.jsx(Ul,{className:"w-3.5 h-3.5"}),pe>0?`Accept + ${pe} story change${pe!==1?"s":""}`:"Accept Changes"]})})]})]})]})})}function Nm({item:e,fallbackName:t,fallbackId:n,onItemClick:r}){const i=e?md[e.type]:null,a=e?lo(e.status):null;return c.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:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.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)&&c.jsx("p",{className:"text-xs text-slate-500 mb-1 line-clamp-2",children:e.description}),(a||i)&&c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a&&c.jsxs(Qa,{variant:"secondary",className:Xe("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&&c.jsxs(Qa,{variant:"outline",className:"text-xs",children:[i.icon," ",i.label]})]})]}),e&&c.jsx(lr,{className:"w-4 h-4 text-slate-400 mt-1 flex-shrink-0 ml-2"})]})})}function cz({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 _3():await ug(e.id).catch(()=>"");i(u||'<p class="text-slate-400 italic">No content</p>'),n(!0)},l=e.id==="project";return c.jsxs("div",{className:"w-full",children:[c.jsxs("button",{onClick:a,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded font-medium ${l?"bg-indigo-50 hover:bg-indigo-100 text-indigo-700":"bg-slate-100 hover:bg-slate-200 text-slate-600"}`,children:[t?c.jsx(h2,{className:"w-3 h-3"}):c.jsx(lr,{className:"w-3 h-3"}),e.name," — doc.md"]}),t&&r&&c.jsx("div",{className:"mt-2 ml-4 p-3 border-l-2 border-slate-200 prose prose-sm prose-slate max-w-none",children:c.jsx("div",{dangerouslySetInnerHTML:{__html:r}})})]})}const md={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 uz({workItem:e,open:t,onOpenChange:n,onNavigate:r,onItemClick:i,allItems:a,refineProgress:l,refineResult:u,refineError:d,onClearRefine:p}){const[h,m]=b.useState("documentation"),[v,x]=b.useState(null),[w,S]=b.useState(null),[j,k]=b.useState(!1),[C,E]=b.useState(null),[O,P]=b.useState(!1),[A,M]=b.useState(""),[D,$]=b.useState(!1),[q,X]=b.useState([]),L=Cf(_=>_.ceremonyActive),[Z,J]=b.useState(!1),ne=()=>{J(!1),p==null||p(),re()};b.useEffect(()=>{t&&e&&re()},[t,e==null?void 0:e.id]),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 O3(e.id);x(_);const V=[{id:"project",name:"Project"}];if(a){const fe=[];let te=_.parentId;for(;te;){const le=a.find(pe=>pe.id===te);if(!le)break;fe.unshift(le),te=le.parentId}V.push(...fe)}X(V);const ie=await ug(e.id).catch(()=>null);S(ie||null)}catch(_){E(_.message),console.error("Failed to load work item details:",_)}finally{k(!1)}}},B=async()=>{const _=await A3(e.id);M(_),P(!0)},F=async()=>{$(!0);try{await E3(e.id,A);const _=await ug(e.id);S(_),P(!1)}finally{$(!1)}};if(!e)return null;const G=lo(e.status),W=md[e.type]||md.task;return c.jsxs(Y6,{open:t,onOpenChange:n,children:[c.jsxs(X6,{onClose:()=>n(!1),children:[c.jsx(Q6,{children:c.jsx("div",{className:"flex items-start justify-between pr-8",children:c.jsxs("div",{className:"flex-1",children:[c.jsx(J6,{className:"mb-2",children:e.name}),c.jsxs(Z6,{className:"flex items-center gap-2 flex-wrap",children:[c.jsxs(Qa,{variant:"secondary",className:Xe((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]}),c.jsxs(Qa,{variant:"outline",children:[W.icon," ",W.label]}),c.jsx("span",{className:"text-slate-400 text-xs",children:e.id})]})]})})}),c.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[c.jsxs("div",{className:"px-6 pb-2 border-b border-slate-100 flex items-center justify-between gap-4",children:[c.jsx(aS,{value:h,onValueChange:m,children:c.jsxs(ez,{children:[w&&c.jsxs(qu,{value:"documentation",children:[c.jsx(f2,{className:"w-4 h-4 mr-2"}),"Documentation"]}),c.jsxs(qu,{value:"details",children:[c.jsx(d3,{className:"w-4 h-4 mr-2"}),"Details"]}),(v==null?void 0:v.children)&&v.children.length>0&&c.jsxs(qu,{value:"children",children:[c.jsx(S3,{className:"w-4 h-4 mr-2"}),"Children (",v.children.length,")"]}),(v==null?void 0:v.functions)&&v.functions.length>0&&c.jsxs(qu,{value:"code",children:["Code (",v.functions.length,")"]})]})}),c.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[(()=>{var pe;const _=(pe=v==null?void 0:v.metadata)==null?void 0:pe.validationResult;if(!_)return null;const V=_.averageScore??null,ie=(_.criticalIssues||[]).length,fe=(_.majorIssues||[]).length,te=(_.minorIssues||[]).length,le=ie+fe+te;return c.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[c.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"]}),le>0&&c.jsxs("span",{children:[ie>0&&c.jsxs("span",{className:"text-red-600 font-medium",children:[ie," critical"]}),ie>0&&fe>0&&c.jsx("span",{className:"mx-0.5",children:"·"}),fe>0&&c.jsxs("span",{className:"text-orange-600 font-medium",children:[fe," major"]}),(ie>0||fe>0)&&te>0&&c.jsx("span",{className:"mx-0.5",children:"·"}),te>0&&c.jsxs("span",{className:"text-amber-600",children:[te," minor"]})]})]})})(),v&&!L&&c.jsxs("div",{className:"flex items-center gap-2",children:[e.type==="story"&&(!v.children||v.children.length===0)&&c.jsx(tz,{storyId:e.id,storyName:e.name}),e.type==="task"&&(e.status==="planned"||e.status==="ready"||e.status==="failed")&&c.jsx(nz,{taskId:e.id,onStarted:re}),c.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:[c.jsx(cg,{className:"w-3.5 h-3.5"}),"Refine with AI"]})]})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",children:j?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}):C?c.jsx("div",{className:"text-center py-12",children:c.jsxs("p",{className:"text-red-600",children:["Failed to load details: ",C]})}):c.jsxs(aS,{value:h,children:[w&&c.jsxs(Ku,{value:"documentation",children:[q.length>0&&c.jsx("div",{className:"mb-4 flex flex-wrap items-center gap-2 text-xs text-slate-500",children:q.map(_=>c.jsx(cz,{item:_,fileType:"doc"},_.id))}),c.jsx("div",{className:"flex justify-end mb-2",children:L?c.jsxs("span",{className:"flex items-center gap-1 px-2 py-1 text-xs text-slate-400",children:[c.jsx(A1,{className:"w-3 h-3"})," Read-only during ceremony"]}):O?c.jsxs("div",{className:"flex gap-2",children:[c.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:[c.jsx(vn,{className:"w-3 h-3"})," Cancel"]}),c.jsxs("button",{onClick:F,disabled:D,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:[c.jsx(x3,{className:"w-3 h-3"})," ",D?"Saving…":"Save"]})]}):c.jsxs("button",{onClick:B,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:[c.jsx(fc,{className:"w-3 h-3"})," Edit"]})}),O?c.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:A,onChange:_=>M(_.target.value)}):c.jsx("div",{className:"prose prose-slate max-w-none",children:c.jsx("div",{dangerouslySetInnerHTML:{__html:w}})})]}),c.jsx(Ku,{value:"details",children:c.jsxs("div",{className:"space-y-6",children:[(v==null?void 0:v.created)&&c.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[c.jsx(o3,{className:"w-4 h-4"}),c.jsxs("span",{children:["Created ",new Date(v.created).toLocaleDateString()]})]}),(v==null?void 0:v.parentName)&&(()=>{const _=a==null?void 0:a.find(V=>V.id===v.parentId);return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[c.jsx(Nd,{className:"w-4 h-4"}),c.jsx("span",{children:"Parent"})]}),c.jsx(Nm,{item:_,fallbackName:v.parentName,fallbackId:v.parentId,onItemClick:i})]})})(),(v==null?void 0:v.epicName)&&e.type!=="epic"&&(()=>{const _=a==null?void 0:a.find(V=>V.id===v.epicId);return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[c.jsx(Nd,{className:"w-4 h-4"}),c.jsx("span",{children:"Epic"})]}),c.jsx(Nm,{item:_,fallbackName:v.epicName,fallbackId:v.epicId,onItemClick:i})]})})(),(()=>{const _=e.type==="epic"?v==null?void 0:v.features:v==null?void 0:v.acceptance;return!_||_.length===0?null:c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[c.jsx(h3,{className:"w-4 h-4"}),c.jsx("span",{children:"Acceptance Criteria"}),c.jsxs("span",{className:"ml-auto flex items-center gap-1 text-xs font-normal text-slate-400",children:[c.jsx(A1,{className:"w-3 h-3"}),"updated by tests"]})]}),c.jsx("ul",{className:"space-y-1.5",children:_.map((V,ie)=>c.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-slate-700",children:[c.jsx("input",{type:"checkbox",readOnly:!0,disabled:!0,className:"mt-0.5 h-4 w-4 flex-shrink-0 rounded border-slate-300 text-indigo-600 cursor-not-allowed opacity-60"}),c.jsx("span",{className:"leading-snug",children:V})]},ie))})]})})(),(v==null?void 0:v.dependencies)&&v.dependencies.length>0&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-slate-700 mb-2",children:[c.jsx(g2,{className:"w-4 h-4"}),c.jsxs("span",{children:["Depends On (",v.dependencies.length,")"]})]}),c.jsx("div",{className:"space-y-2",children:v.dependencies.map(_=>{const V=a==null?void 0:a.find(ie=>ie.id===_);return c.jsx(Nm,{item:V,fallbackName:_,fallbackId:_,onItemClick:i},_)})})]})]})}),(v==null?void 0:v.children)&&v.children.length>0&&c.jsx(Ku,{value:"children",children:c.jsx("div",{className:"space-y-2",children:v.children.map(_=>{const V=lo(_.status),ie=md[_.type],fe=a==null?void 0:a.find(te=>te.id===_.id);return c.jsx("button",{onClick:()=>fe&&(i==null?void 0:i(fe)),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:c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"font-medium text-slate-900 mb-1",children:_.name}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(Qa,{variant:"secondary",className:Xe("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]}),c.jsxs(Qa,{variant:"outline",className:"text-xs",children:[ie==null?void 0:ie.icon," ",ie==null?void 0:ie.label]})]})]}),c.jsx(lr,{className:"w-4 h-4 text-slate-400 mt-1 flex-shrink-0"})]})},_.id)})})}),(v==null?void 0:v.functions)&&v.functions.length>0&&c.jsx(Ku,{value:"code",children:c.jsx("div",{className:"space-y-2",children:v.functions.map((_,V)=>c.jsxs("div",{className:"flex items-start gap-3 p-2 rounded-lg border border-slate-200 hover:bg-slate-50",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"text-sm font-mono text-blue-700 truncate",children:_.name}),_.pure&&c.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"&&c.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"})]}),c.jsx("div",{className:"text-xs text-slate-500 mt-0.5 truncate",children:_.file}),_.satisfies&&c.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:_.satisfies}),_.task&&c.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:["Task: ",_.task]})]}),_.lines&&c.jsxs("span",{className:"text-xs text-slate-400 whitespace-nowrap",children:[_.lines,"L"]})]},_.name||V))})})]})})]}),r&&c.jsxs("div",{className:"px-6 py-4 border-t border-slate-100 flex items-center justify-between",children:[c.jsxs("button",{onClick:()=>r("prev"),className:"flex items-center gap-2 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:[c.jsx(l3,{className:"w-4 h-4"}),"Previous"]}),c.jsx("span",{className:"text-xs text-slate-400",children:"Use ← → to navigate"}),c.jsxs("button",{onClick:()=>r("next"),className:"flex items-center gap-2 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:["Next",c.jsx(lr,{className:"w-4 h-4"})]})]})]}),Z&&v&&c.jsx(lz,{item:v,refineProgress:(l==null?void 0:l.itemId)===v.id?l:null,refineResult:(u==null?void 0:u.itemId)===v.id?u:null,refineError:(d==null?void 0:d.itemId)===v.id?d:null,onClose:()=>{J(!1),p==null||p()},onAccepted:ne})]})}function oA({agentName:e,onClose:t,onSaved:n,onReset:r}){const[i,a]=b.useState(null),[l,u]=b.useState(""),[d,p]=b.useState(!0),[h,m]=b.useState(!1),[v,x]=b.useState(!1),[w,S]=b.useState(null),[j,k]=b.useState(!1);b.useEffect(()=>{p(!0),S(null),k(!1),tD(e).then(M=>{a(M),u(M.content)}).catch(M=>S(M.message)).finally(()=>p(!1))},[e]);const C=i&&l!==i.content,E=async()=>{if(!(!i||!C)){m(!0),S(null);try{j?(await rD(e),a(M=>({...M,content:M.defaultContent,isCustomized:!1})),k(!1),r==null||r()):(await nD(e,l),a(M=>({...M,content:l,isCustomized:!0})),n==null||n()),x(!0),setTimeout(()=>x(!1),2e3)}catch(M){S(M.message)}finally{m(!1)}}},O=()=>{t()},P=()=>{i!=null&&i.defaultContent&&(u(i.defaultContent),k(!0))},A=(i==null?void 0:i.isCustomized)&&!j;return c.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:c.jsxs("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:"text-sm font-mono font-medium text-slate-700 truncate",children:e}),(i==null?void 0:i.isCustomized)&&!j&&c.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&&c.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"})]}),c.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:c.jsx(vn,{className:"w-4 h-4"})})]}),d?c.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-slate-400",children:[c.jsx("span",{className:"w-4 h-4 border border-slate-300 border-t-slate-600 rounded-full animate-spin mr-2"}),"Loading…"]}):w&&!i?c.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-red-500 px-6 text-center",children:w}):c.jsx("textarea",{value:l,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}),c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[w&&!d&&c.jsx("p",{className:"text-xs text-red-600",children:w}),v&&c.jsx("p",{className:"text-xs text-green-600 font-medium",children:"Saved ✓"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:P,disabled:!A,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:A?"Load default content into editor":"Only available for customized agents",children:[c.jsx(v2,{className:"w-3 h-3"}),"Reset to default"]}),c.jsx("button",{type:"button",onClick:O,className:"px-3 py-1.5 text-xs font-medium text-slate-500 hover:text-slate-700 transition-colors",children:"Cancel"}),c.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?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):j?"Save & Reset":"Save"})]})]})]})})}const dz=["critical","major","minor"],Bl={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 fz({isCrossRef:e}){const[t,n]=b.useState(!1);return c.jsxs("div",{className:"mb-2",children:[c.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:[c.jsx(Tv,{className:"w-3.5 h-3.5"}),t?"Hide guide":"How micro-checks work & field reference"]}),t&&c.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:[c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"How micro-checks are used in ceremonies"}),c.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)."]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"Severity levels"}),c.jsxs("ul",{className:"list-none space-y-0.5 ml-1",children:[c.jsxs("li",{children:[c.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."]}),c.jsxs("li",{children:[c.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."]}),c.jsxs("li",{children:[c.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."]})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"font-semibold text-slate-700 mb-1",children:"Field reference"}),c.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 ml-1",children:[c.jsx("dt",{className:"font-mono text-slate-700",children:"severity"}),c.jsx("dd",{children:"How much a failure impacts the score (see above)."}),c.jsx("dt",{className:"font-mono text-slate-700",children:"category"}),c.jsx("dd",{children:'Grouping label for reporting (e.g. "security", "data-modeling"). Helps cluster related failures.'}),!e&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-mono text-slate-700",children:"applicabilityQuestion"}),c.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?"'}),c.jsx("dt",{className:"font-mono text-slate-700",children:"universal"}),c.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."})]}),c.jsx("dt",{className:"font-mono text-slate-700",children:"question"}),c.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?"'}),c.jsx("dt",{className:"font-mono text-slate-700",children:"failDescription"}),c.jsx("dd",{children:"Human-readable explanation shown when the check fails. Describes what quality gap was detected."}),c.jsx("dt",{className:"font-mono text-slate-700",children:"failSuggestion"}),c.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&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-mono text-slate-700",children:"perspectives"}),c.jsx("dd",{children:'Which domain perspectives this cross-reference check bridges (e.g. ["security", "api"]). Read-only — set in the JSON directly.'}),c.jsx("dt",{className:"font-mono text-slate-700",children:"dependsOn"}),c.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."})]})]})]}),c.jsxs("p",{className:"text-[10px] text-slate-400 italic",children:["Customized checks are saved to ",c.jsx("span",{className:"font-mono",children:".avc/customized-agents/checks/"}),' and override the built-in defaults. Use "Reset to default" to revert.']})]})]})}function Hu({label:e,value:t,onChange:n,placeholder:r,rows:i=2}){return c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:e}),c.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 pz({value:e,onChange:t}){return c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:"Severity"}),c.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:dz.map(n=>c.jsx("option",{value:n,children:n.charAt(0).toUpperCase()+n.slice(1)},n))})]})}function wl({label:e,value:t}){return c.jsxs("span",{className:"text-[10px] text-slate-400",children:[c.jsxs("span",{className:"font-medium",children:[e,":"]})," ",c.jsx("span",{className:"font-mono text-slate-500",children:t})]})}function hz({check:e,index:t,isCrossRef:n,expanded:r,onToggle:i,onChange:a,onDelete:l}){const u=Bl[e.severity]||Bl.minor,d=(h,m)=>{a(t,{...e,[h]:m})},p=(e.question||"").length>90?e.question.slice(0,90)+"…":e.question||"(no question)";return c.jsxs("div",{className:`border rounded-lg overflow-hidden ${r?"border-blue-200 shadow-sm":"border-slate-200"}`,children:[c.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?c.jsx(yi,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}):c.jsx(lr,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}),c.jsx("span",{className:`flex-shrink-0 text-[10px] font-semibold px-1.5 py-0.5 rounded border ${u}`,children:e.severity||"major"}),c.jsx("span",{className:"flex-shrink-0 text-[10px] font-mono text-slate-400",children:e.id}),c.jsx("span",{className:"flex-1 text-xs text-slate-600 truncate min-w-0",children:p})]}),r&&c.jsxs("div",{className:"px-3 pb-3 pt-1 bg-white border-t border-slate-100",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2 flex-wrap",children:[c.jsx(wl,{label:"id",value:e.id}),e.category&&c.jsx(wl,{label:"category",value:e.category}),n&&e.perspectives&&c.jsx(wl,{label:"perspectives",value:e.perspectives.join(", ")}),n&&e.dependsOn&&c.jsx(wl,{label:"dependsOn",value:e.dependsOn.join(", ")}),!n&&e.universal!==void 0&&c.jsx(wl,{label:"universal",value:e.universal?"yes":"no"})]}),c.jsxs("div",{className:"grid grid-cols-[1fr_auto] gap-x-3 gap-y-2",children:[c.jsx("div",{className:"col-span-2 sm:col-span-1",children:c.jsx(pz,{value:e.severity,onChange:h=>d("severity",h)})}),c.jsx("div",{className:"col-span-2 sm:col-span-1",children:c.jsxs("label",{className:"block",children:[c.jsx("span",{className:"text-[11px] font-medium text-slate-500 uppercase tracking-wide",children:"Category"}),c.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"})]})})]}),c.jsxs("div",{className:"mt-2 flex flex-col gap-2",children:[!n&&!e.universal&&c.jsx(Hu,{label:"Applicability Question",value:e.applicabilityQuestion,onChange:h=>d("applicabilityQuestion",h),placeholder:"When should this check run? (leave empty = always)",rows:2}),c.jsx(Hu,{label:"Question",value:e.question,onChange:h=>d("question",h),placeholder:"The YES/NO quality question asked to the LLM",rows:3}),c.jsx(Hu,{label:"Fail Description",value:e.failDescription,onChange:h=>d("failDescription",h),placeholder:"What's wrong when this check fails",rows:2}),c.jsx(Hu,{label:"Fail Suggestion",value:e.failSuggestion,onChange:h=>d("failSuggestion",h),placeholder:"How to fix the failure",rows:2})]}),c.jsx("div",{className:"mt-3 flex justify-end",children:c.jsxs("button",{type:"button",onClick:()=>l(t),className:"flex items-center gap-1 text-[11px] text-red-500 hover:text-red-700 transition-colors",children:[c.jsx(j3,{className:"w-3 h-3"}),"Remove check"]})})]})]})}function lA({scope:e,perspective:t,onClose:n,onSaved:r,onReset:i}){const[a,l]=b.useState(null),[u,d]=b.useState(null),[p,h]=b.useState([]),[m,v]=b.useState(null),[x,w]=b.useState(!0),[S,j]=b.useState(!1),[k,C]=b.useState(!1),[E,O]=b.useState(null),[P,A]=b.useState(!1),M=e==="cross-refs",D=M?`cross-refs/${t}.json`:`${e}/${t}.json`;b.useEffect(()=>{w(!0),O(null),A(!1),v(null),sD(e,t).then(B=>{l(B);try{const F=JSON.parse(B.content);d(F),h(JSON.parse(JSON.stringify(F.checks||[])))}catch{O("Failed to parse check file")}}).catch(B=>O(B.message)).finally(()=>w(!1))},[e,t]);const $=(()=>{if(!a)return!1;try{const B=JSON.parse(a.content);return JSON.stringify(p)!==JSON.stringify(B.checks||[])}catch{return!1}})(),q=(B,F)=>{h(G=>G.map((W,_)=>_===B?F:W)),A(!1)},X=B=>{h(F=>F.filter((G,W)=>W!==B)),m===B?v(null):m>B&&v(m-1),A(!1)},L=()=>{const F=`${M?"xref":e==="epic"?t.slice(0,3)+"-epic":t.slice(0,3)+"-story"}-${String(p.length+1).padStart(2,"0")}`,G=M?{id:F,tier:2,perspectives:[],severity:"major",category:"consistency",dependsOn:[],question:"",failDescription:"",failSuggestion:""}:{id:F,tier:1,perspective:t,severity:"major",category:"",universal:!1,applicabilityQuestion:"",question:"",failDescription:"",failSuggestion:""};h(W=>[...W,G]),v(p.length),A(!1)},Z=async()=>{if(a){j(!0),O(null);try{if(P){await oD(e,t);const B=JSON.parse(a.defaultContent);d(B),h(JSON.parse(JSON.stringify(B.checks||[]))),l(F=>({...F,content:F.defaultContent,isCustomized:!1})),A(!1),i==null||i()}else{const B={...u,checks:p},F=JSON.stringify(B,null,2);await aD(e,t,F),l(G=>({...G,content:F,isCustomized:!0})),r==null||r()}C(!0),setTimeout(()=>C(!1),2e3)}catch(B){O(B.message)}finally{j(!1)}}},J=()=>{if(a!=null&&a.defaultContent){try{const B=JSON.parse(a.defaultContent);h(JSON.parse(JSON.stringify(B.checks||[])))}catch{}A(!0),v(null)}},ne=(a==null?void 0:a.isCustomized)&&!P,re={critical:0,major:0,minor:0};return p.forEach(B=>{re[B.severity]!==void 0&&re[B.severity]++}),c.jsx("div",{className:"fixed inset-0 z-[90] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:B=>{B.target===B.currentTarget&&n()},children:c.jsxs("div",{className:"w-full max-w-3xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[c.jsx("span",{className:"text-sm font-mono font-medium text-slate-700 truncate",children:D}),c.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&&c.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Bl.critical}`,children:[re.critical," critical"]}),re.major>0&&c.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Bl.major}`,children:[re.major," major"]}),re.minor>0&&c.jsxs("span",{className:`flex-shrink-0 text-[10px] font-medium px-1.5 py-0.5 rounded border ${Bl.minor}`,children:[re.minor," minor"]}),(a==null?void 0:a.isCustomized)&&!P&&c.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&&c.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"})]}),c.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:c.jsx(vn,{className:"w-4 h-4"})})]}),x?c.jsxs("div",{className:"flex-1 flex items-center justify-center text-sm text-slate-400",children:[c.jsx("span",{className:"w-4 h-4 border border-slate-300 border-t-slate-600 rounded-full animate-spin mr-2"}),"Loading…"]}):E&&!a?c.jsx("div",{className:"flex-1 flex items-center justify-center text-sm text-red-500 px-6 text-center",children:E}):c.jsx("div",{className:"flex-1 overflow-y-auto min-h-0 px-4 py-3",children:c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsx(fz,{isCrossRef:M}),p.map((B,F)=>c.jsx(hz,{check:B,index:F,isCrossRef:M,expanded:m===F,onToggle:()=>v(m===F?null:F),onChange:q,onDelete:X},B.id||F)),c.jsxs("button",{type:"button",onClick:L,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:[c.jsx(g3,{className:"w-3.5 h-3.5"}),"Add check"]})]})}),c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-t border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[E&&!x&&c.jsx("p",{className:"text-xs text-red-600",children:E}),k&&c.jsx("p",{className:"text-xs text-green-600 font-medium",children:"Saved"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.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:[c.jsx(v2,{className:"w-3 h-3"}),"Reset to default"]}),c.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"}),c.jsx("button",{type:"button",onClick:Z,disabled:!$&&!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?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.jsx("span",{className:"w-3 h-3 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving"]}):P?"Save & Reset":"Save"})]})]})]})})}const mz={claude:"anthropic",gemini:"gemini",openai:"openai",xiaomi:"xiaomi",local:"local"},cS={claude:"Claude",gemini:"Gemini",openai:"OpenAI",xiaomi:"Xiaomi MiMo",local:"Local LLM",custom:"Custom"};function gz(e){var n,r,i,a,l;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),(l=(a=e==null?void 0:e.validation)==null?void 0:a.refinement)!=null&&l.provider&&t.add(e.validation.refinement.provider),t.size===0?(e==null?void 0:e.provider)||null:t.size===1?[...t][0]:"custom"}function vz(e,t){var l,u,d;const n=(l=e.providerPresets)==null?void 0:l[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 xz(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 yz({ceremonyName:e,ceremonies:t,apiKeys:n,onApplied:r}){const[i,a]=b.useState(!1),[l,u]=b.useState(!1),[d,p]=b.useState(null),[h,m]=b.useState(!1),v=b.useRef(null),x=t==null?void 0:t.find(P=>P.name===e),w=gz(x),S=x==null?void 0:x.providerPresets;if(b.useEffect(()=>{if(!i)return;const P=A=>{v.current&&!v.current.contains(A.target)&&(a(!1),m(!1))};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[i]),b.useEffect(()=>{!i||d!==null||K3().then(P=>p(P.servers||[])).catch(()=>p([]))},[i,d]),!S||Object.keys(S).length===0)return null;const j=Object.keys(S),k=cS[w]||w||"—",C=async P=>{if(!x||P===w){a(!1);return}a(!1),m(!1),u(!0);try{const A=vz(x,P),M=t.map(D=>D.name===e?A:D);await Wl(M,null),r(M)}finally{u(!1)}},E=async P=>{if(x){a(!1),m(!1),u(!0);try{const A=xz(x,P),M=t.map(D=>D.name===e?A:D);await Wl(M,null),r(M)}finally{u(!1)}}},O=(d||[]).flatMap(P=>P.models.map(A=>({id:A.id,server:P.label})));return c.jsxs("div",{className:"relative",ref:v,children:[c.jsxs("button",{type:"button",disabled:l,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:[l?c.jsx("span",{className:"w-3 h-3 border border-slate-400 border-t-slate-700 rounded-full animate-spin"}):c.jsxs("span",{className:"font-medium",children:["⚡ ",k]}),!l&&c.jsx(yi,{className:"w-3 h-3"})]}),i&&c.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 q;const A=cS[P]||P,M=mz[P],D=((q=n==null?void 0:n[M])==null?void 0:q.isSet)??!1,$=P===w;return c.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:[c.jsx("span",{className:$?"font-medium text-slate-900":"text-slate-700",children:A}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[$&&c.jsx(Ul,{className:"w-3.5 h-3.5 text-blue-500"}),c.jsx("span",{className:`text-xs px-1.5 py-0.5 rounded-full ${D?"bg-green-100 text-green-700":"bg-slate-100 text-slate-400"}`,children:D?"key set":"no key"})]})]},P)}),c.jsx("div",{className:"border-t border-slate-100 my-1"}),c.jsxs("button",{type:"button",onClick:()=>{O.length===1?E(O[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:[c.jsx("span",{className:w==="local"?"font-medium text-slate-900":"text-slate-700",children:"🖥 Local LLM"}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[w==="local"&&c.jsx(Ul,{className:"w-3.5 h-3.5 text-blue-500"}),d===null?c.jsx("span",{className:"w-3 h-3 border border-slate-300 border-t-slate-500 rounded-full animate-spin"}):O.length>0?c.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-green-100 text-green-700",children:[O.length," model",O.length!==1?"s":""]}):c.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-full bg-slate-100 text-slate-400",children:"offline"})]})]}),h&&O.length>0&&c.jsx("div",{className:"border-t border-slate-100 bg-slate-50 py-1 max-h-48 overflow-y-auto",children:O.map(P=>c.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:[c.jsx("span",{className:"text-slate-700 truncate",children:P.id}),c.jsx("span",{className:"text-[10px] text-slate-400 flex-shrink-0",children:P.server})]},`${P.server}-${P.id}`))}),h&&O.length===0&&c.jsx("div",{className:"px-4 py-2 text-xs text-slate-400",children:"No local server detected. Start LM Studio, Ollama, or similar."})]})]})}const bz={"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"},wz=["solution-architect","developer","security","devops","cloud","backend","database","api","frontend","ui","ux","mobile","data","qa","test-architect"],jz={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"}},Sz={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"}},uS={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 Nz(e,t){var n,r,i,a,l,u,d,p,h,m,v,x,w,S,j,k,C,E,O,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:(l=(a=e.stages)==null?void 0:a.suggestions)==null?void 0:l.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:(v=(m=e.stages)==null?void 0:m["question-prefilling"])==null?void 0:v.model,stageKey:"question-prefilling",agent:"question-prefiller"}]},{id:"documentation",label:"Documentation",color:"amber",steps:[{type:"generate",label:"Generate project documentation (doc.md)",model:(w=(x=e.stages)==null?void 0:x.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=(O=e.stages)==null?void 0:O.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 kz(e){var n,r,i,a,l,u,d,p,h,m,v,x,w,S,j,k,C,E,O,P,A,M,D,$,q,X,L,Z,J,ne,re,B;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=(l=e.stages)==null?void 0:l.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:((x=(v=e.stages)==null?void 0:v.validation)==null?void 0:x.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:wz.flatMap(F=>[{scope:"epic",perspective:F,label:`${F} (Epic)`},{scope:"story",perspective:F,label:`${F} (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=(O=e.stages)==null?void 0:O.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=(A=e.stages)==null?void 0:A.validation)==null?void 0:M.model)??t,stageKey:"validation",sharedWith:"Validation",params:[{key:"maxFixAttempts",label:"Max fix attempts",value:(($=(D=e.stages)==null?void 0:D.validation)==null?void 0:$.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:((X=(q=e.stages)==null?void 0:q.validation)==null?void 0:X.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:((Z=(L=e.stages)==null?void 0:L["doc-generation"])==null?void 0:Z.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:((B=(re=e.stages)==null?void 0:re.enrichment)==null?void 0:B.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 Pz(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 Cz(e){var t,n,r,i,a,l;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:(l=(a=e==null?void 0:e.stages)==null?void 0:a["code-generation"])==null?void 0:l.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 Oz={"sponsor-call":Nz,"sprint-planning":e=>kz(e),seed:e=>Pz(e),run:e=>Cz(e)};function Az(e,t){var n;return e?((n=t.find(r=>r.modelId===e))==null?void 0:n.displayName)||e:"—"}function Ez({value:e,models:t,onChange:n}){const r=[...new Set(t.map(i=>i.provider))];return c.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&&c.jsx("option",{value:"",children:"— select —"}),r.map(i=>c.jsx("optgroup",{label:i.charAt(0).toUpperCase()+i.slice(1),children:t.filter(a=>a.provider===i).map(a=>c.jsx("option",{value:a.modelId,children:a.displayName||a.modelId},a.modelId))},i))]})}function Tz({slug:e,onOpen:t}){const n=bz[e]||e;return c.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,c.jsx(fc,{className:"w-2.5 h-2.5 flex-shrink-0"})]})}function Mz({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:c.jsxs("div",{className:"mt-1.5",children:[c.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Agent(s)"}),c.jsx("div",{className:"mt-1 flex flex-col gap-1",children:n.map(({slug:r,note:i})=>c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx(Tz,{slug:r,onOpen:t}),i&&c.jsx("span",{className:"text-[10px] text-slate-400 italic",children:i})]},r))})]})}function _z({step:e,onOpenCheck:t}){return!e.checks||e.checks.length===0?null:c.jsxs("div",{className:"mt-1.5",children:[c.jsx("span",{className:"text-[10px] text-slate-400 font-medium",children:"Check definitions"}),c.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=>c.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,c.jsx(fc,{className:"w-2.5 h-2.5 flex-shrink-0"})]},`${n.scope}/${n.perspective}`))})]})}function Iz({files:e,className:t=""}){return!e||e.length===0?null:c.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",l=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 c.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 ${l}`,title:n.note,children:[c.jsx("span",{className:"font-sans mr-0.5",children:u}),n.name]},r)})})}function Dz({type:e}){const t=jz[e]||{label:e,cls:"bg-slate-50 text-slate-600 border-slate-200"};return c.jsx("span",{className:`inline-block text-xs font-medium px-2 py-0.5 rounded border whitespace-nowrap ${t.cls}`,children:t.label})}function cA({step:e,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onOpenAgent:l,onOpenCheck:u}){const d=!["input","output","read","process"].includes(e.type),p=n&&!e.sharedWith&&(e.stageKey||e.validationKey);return c.jsxs("div",{className:"bg-white border border-slate-200 rounded-lg px-3 py-2.5 shadow-sm",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"flex-shrink-0",children:c.jsx(Dz,{type:e.type})}),c.jsx(Iz,{files:e.files,className:"flex-1 min-w-0"}),d&&(e.sharedWith?c.jsxs("p",{className:"text-[10px] text-slate-400 italic flex-shrink-0",children:["↑ ",e.sharedWith]}):p?c.jsx(Ez,{value:e.model,models:t,onChange:h=>{e.stageKey?r(e.stageKey,h):i(e.validationKey,h)}}):c.jsx("p",{className:"text-[10px] text-slate-400 flex-shrink-0",children:e.note?e.note:Az(e.model,t)}))]}),c.jsx("p",{className:"text-xs text-slate-700 leading-snug text-left mt-2 pl-1",children:e.label}),c.jsxs("div",{className:"pl-1",children:[c.jsx(Mz,{step:e,onOpenAgent:l}),u&&c.jsx(_z,{step:e,onOpenCheck:u})]}),e.params&&e.params.length>0&&c.jsx("div",{className:"mt-2 pl-1 flex items-center gap-3 flex-wrap",children:e.params.map(h=>c.jsxs("label",{className:"flex items-center gap-1.5 text-[11px] text-slate-600",children:[c.jsxs("span",{className:"font-medium",children:[h.label,":"]}),n&&e.stageKey&&a?c.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"}):c.jsx("span",{className:"font-mono",children:h.value})]},h.key))})]})}function Rz({group:e,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onLoopParamChange:l,onOpenAgent:u,onOpenCheck:d}){const{loop:p,steps:h}=e,v=h.some(S=>S.type==="cross")?uS.indigo:uS.amber,x=h.length>1,w=n&&e.loopParamType&&!e.loopParamReadOnly;return c.jsxs("div",{className:`rounded-xl border-2 border-dashed ${v.border} overflow-hidden`,children:[c.jsxs("div",{className:`${v.hdr} border-b-2 border-dashed ${v.hdrBorder} px-3 py-2 flex items-center gap-2 flex-wrap`,children:[c.jsx("span",{className:`text-xl font-black leading-none ${v.text}`,children:"↺"}),c.jsx("span",{className:`text-xs font-bold ${v.text} tracking-wide`,children:"Iteration Loop"}),c.jsxs("div",{className:"ml-auto flex items-center gap-1.5 flex-wrap",children:[p.max!=null&&(w?c.jsxs("label",{className:`text-xs font-semibold ${v.chip} px-2 py-0.5 rounded-full flex items-center gap-1`,children:["up to",c.jsx("input",{type:"number",min:"1",max:"200",value:p.max,onChange:S=>l(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"]}):c.jsx("span",{className:`text-xs font-semibold ${v.chip} px-2 py-0.5 rounded-full`,children:e.loopParamReadOnly?`↑ ${p.max} iter`:`up to ${p.max} iter`})),p.threshold!=null&&(w?c.jsxs("label",{className:`text-xs font-semibold ${v.chip} px-2 py-0.5 rounded-full flex items-center gap-1`,children:["≥",c.jsx("input",{type:"number",min:"0",max:"100",value:p.threshold,onChange:S=>l(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"]}):c.jsx("span",{className:`text-xs font-semibold ${v.chip} px-2 py-0.5 rounded-full`,children:e.loopParamReadOnly?`↑ ≥${p.threshold}/100`:`≥${p.threshold}/100`}))]})]}),c.jsxs("div",{className:`${v.bg} p-3 flex gap-2 items-stretch`,children:[c.jsx("div",{className:"flex-1 flex flex-col",children:h.map((S,j)=>c.jsxs("div",{children:[c.jsx(cA,{step:S,models:t,editable:n,onStageModelChange:r,onValidationModelChange:i,onStageParamChange:a,onOpenAgent:u,onOpenCheck:d}),j<h.length-1&&c.jsxs("div",{className:"flex items-center gap-2 my-1.5 ml-3",children:[c.jsx("div",{className:`w-px h-4 ${v.condLine}`}),c.jsx("span",{className:`text-xs ${v.subtext} italic`,children:"score < threshold → retry"})]})]},j))}),x&&c.jsxs("div",{className:`flex flex-col items-center flex-shrink-0 ${v.arrow}`,style:{width:22},children:[c.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:c.jsx("path",{d:"M2 7 L7 1 L12 7",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}),c.jsx("div",{className:`w-0.5 flex-1 ${v.line} my-1 rounded-full`,style:{minHeight:36}}),c.jsx("span",{className:`text-[9px] font-bold tracking-widest uppercase ${v.text} opacity-70`,style:{writingMode:"vertical-rl",transform:"rotate(180deg)"},children:"retry"})]})]})]})}function Lz({label:e,color:t}){const n=Sz[t]||{dot:"bg-slate-400",label:"text-slate-600"};return c.jsxs("div",{className:"flex items-center gap-2 mt-5 mb-2",children:[c.jsx("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${n.dot}`}),c.jsx("span",{className:`text-xs font-semibold uppercase tracking-wide ${n.label}`,children:e})]})}function $z(){return c.jsx("div",{className:"w-px h-4 bg-slate-200 ml-4"})}function mx({ceremony:e,allCeremonies:t,apiKeys:n,models:r=[],missionGenValidation:i=null,onClose:a,onSave:l,onCeremoniesUpdated:u,readOnly:d=!1}){const[p,h]=b.useState(()=>JSON.parse(JSON.stringify(e||{}))),[m,v]=b.useState(()=>JSON.parse(JSON.stringify(i||{maxIterations:3,acceptanceThreshold:95}))),[x,w]=b.useState(!1),[S,j]=b.useState(null),[k,C]=b.useState(null),[E,O]=b.useState(null),P=e!=null&&e.name?Oz[e.name]:null,A=P?P(p,m):null,M=!d&&!!l,D=(J,ne)=>{const re=r.find(B=>B.modelId===ne);h(B=>{var F,G,W;return{...B,stages:{...B.stages,[J]:{...(F=B.stages)==null?void 0:F[J],model:ne,provider:(re==null?void 0:re.provider)||((W=(G=B.stages)==null?void 0:G[J])==null?void 0:W.provider)||""}}}})},$=(J,ne)=>{const re=r.find(B=>B.modelId===ne);h(J==="top"?B=>{var F;return{...B,validation:{...B.validation,model:ne,provider:(re==null?void 0:re.provider)||((F=B.validation)==null?void 0:F.provider)||""}}}:B=>{var F,G,W;return{...B,validation:{...B.validation,[J]:{...(F=B.validation)==null?void 0:F[J],model:ne,provider:(re==null?void 0:re.provider)||((W=(G=B.validation)==null?void 0:G[J])==null?void 0:W.provider)||""}}}})},q=(J,ne,re)=>{h(B=>{var F;return{...B,stages:{...B.stages,[J]:{...(F=B.stages)==null?void 0:F[J],[ne]:re}}}})},X=(J,ne,re)=>{J==="missionGen"?v(B=>({...B,[ne]:re})):J==="docContext"&&h(B=>({...B,validation:{...B.validation,[ne]:re}}))},L=async()=>{w(!0),j(null);try{await l(p,m),a()}catch{j("Failed to save. Please try again.")}finally{w(!1)}},Z=()=>{h(JSON.parse(JSON.stringify(e||{}))),v(JSON.parse(JSON.stringify(i||{maxIterations:3,acceptanceThreshold:95}))),a()};return c.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:M?void 0:a}),c.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:[c.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:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-slate-900",children:M?"Configure Models":"Ceremony Workflow"}),c.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"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[M&&t&&c.jsx(yz,{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)}}),c.jsx("button",{type:"button",onClick:M?Z:a,className:"text-slate-400 hover:text-slate-600 transition-colors",children:c.jsx(vn,{className:"w-4 h-4"})})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-5 pb-5",children:A===null?c.jsx("div",{className:"flex items-center justify-center h-32",children:c.jsx("p",{className:"text-sm text-slate-400",children:"Workflow diagram coming soon for this ceremony."})}):A.map((J,ne)=>c.jsxs("div",{children:[c.jsx(Lz,{label:J.label,color:J.color}),J.steps.map((re,B)=>c.jsxs("div",{children:[re.type==="loop-group"?c.jsx(Rz,{group:re,models:r,editable:M,onStageModelChange:D,onValidationModelChange:$,onStageParamChange:q,onLoopParamChange:X,onOpenAgent:C,onOpenCheck:O}):c.jsx(cA,{step:re,models:r,editable:M,onStageModelChange:D,onValidationModelChange:$,onStageParamChange:q,onOpenAgent:C,onOpenCheck:O}),B<J.steps.length-1&&c.jsx($z,{})]},B)),ne<A.length-1&&c.jsx("div",{className:"mt-3 border-t border-dashed border-slate-200"})]},J.id))}),M&&c.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:[c.jsx("div",{children:S&&c.jsx("p",{className:"text-xs text-red-600",children:S})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:Z,className:"px-3 py-1.5 text-sm text-slate-600 hover:text-slate-900 transition-colors",children:"Cancel"}),c.jsx("button",{type:"button",onClick:L,disabled:x,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:x?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3.5 h-3.5 border border-white/40 border-t-white rounded-full animate-spin"}),"Saving…"]}):"Save Changes"})]})]})]}),k&&c.jsx(oA,{agentName:`${k}.md`,onClose:()=>C(null)}),E&&c.jsx(lA,{scope:E.scope,perspective:E.perspective,onClose:()=>O(null)})]})}const zz=[{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 Fz({onNext:e}){const{strategy:t,setStrategy:n}=cr(),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 c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Deployment Strategy"}),c.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."})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:zz.map(a=>{const l=r[a.color],u=t===a.id;return c.jsxs("button",{onClick:()=>i(a.id),className:`text-left rounded-xl border-2 p-5 transition-all ${u?`${l.border} ${l.bg}`:"border-slate-200 hover:border-slate-300 bg-white"}`,children:[c.jsx("div",{className:`text-3xl mb-3 ${l.icon}`,children:a.icon}),c.jsx("div",{className:"font-semibold text-slate-900 text-base",children:a.title}),c.jsx("div",{className:"text-xs text-slate-500 mb-3",children:a.subtitle}),c.jsx("ul",{className:"space-y-1",children:a.bullets.map((d,p)=>c.jsxs("li",{className:"flex items-start gap-2 text-xs text-slate-600",children:[c.jsx("span",{className:`mt-1.5 w-1.5 h-1.5 rounded-full flex-shrink-0 ${l.bullet}`}),d]},p))})]},a.id)})}),c.jsxs("div",{className:"flex items-start gap-2 px-1 py-2 text-xs text-slate-400",children:[c.jsx(Tv,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 text-slate-300"}),c.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."})]}),c.jsxs("div",{className:"flex items-center justify-end gap-3 pt-2",children:[c.jsx("button",{type:"button",onClick:e,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:"Skip — let the model decide"}),c.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 km(e=""){return e==="claude"?"anthropic":e}const Bz={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 Vz({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"},l={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 c.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:c.jsxs("div",{className:"w-full max-w-lg bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden max-h-[70vh]",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Validation Issues"}),c.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:[e.length," issue",e.length!==1?"s":""," found during validation"]})]}),c.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:"×"})]}),c.jsx("ul",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-2",children:e.map((d,p)=>c.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":""} ${l[d.severity]??"bg-slate-50 border-slate-100"}`,children:[c.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"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"flex items-center gap-2 mb-1",children:c.jsx("span",{className:`text-xs font-semibold uppercase ${a[d.severity]??"text-slate-600"}`,children:d.severity})}),c.jsx("p",{className:"text-sm text-slate-800 leading-snug",children:d.description}),d.suggestion&&c.jsxs("p",{className:"text-xs text-slate-500 mt-1 leading-snug",children:[c.jsx("span",{className:"font-medium",children:"Suggestion:"})," ",d.suggestion]})]})]},p))}),c.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-between gap-2",children:[c.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"}),c.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 Uz({onSubmit:e,onClose:t}){const[n,r]=b.useState("");return c.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:c.jsxs("div",{className:"w-full max-w-md bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Refine Mission & Scope"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe what you'd like to change or improve."})]}),c.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:"×"})]}),c.jsx("div",{className:"px-5 py-4 flex flex-col gap-3",children:c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What would you like to change or improve?"}),c.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"})]})}),c.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-end gap-2",children:[c.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"}),c.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 Wz({onUse:e,onClose:t,onOpenSettings:n}){var ie,fe;const[r,i]=b.useState([]),[a,l]=b.useState(""),[u,d]=b.useState(""),[p,h]=b.useState(""),[m,v]=b.useState(!1),[x,w]=b.useState(null),[S,j]=b.useState(""),[k,C]=b.useState(!1),[E,O]=b.useState(!1),{missionProgressLog:P,clearMissionProgress:A}=cr(),M=P[P.length-1]??null,[D,$]=b.useState(null);b.useEffect(()=>{Promise.all([ms(),En()]).then(([te,le])=>{i(te),$(le.apiKeys??{});const pe=te.filter(Le=>{var De,Qe;return(Qe=(De=le.apiKeys)==null?void 0:De[km(Le.provider)])==null?void 0:Qe.isSet}),Se=Le=>/pro|opus|sonnet/i.test(Le),H=Le=>/flash|lite|haiku|mini/i.test(Le),me=pe.find(Le=>Se(Le.modelId))||pe[0],Oe=me?me.modelId:te.length>0?te[0].modelId:"";l(Oe);const se=pe.find(Le=>H(Le.modelId)&&Le.modelId!==Oe)||pe.find(Le=>Le.modelId!==Oe)||me;d(se?se.modelId:Oe)}).catch(()=>j("Failed to load available models."))},[]);function q(){Promise.all([En(),ms()]).then(([te,le])=>{$(te.apiKeys??{}),i(le)}).catch(()=>{})}b.useEffect(()=>(document.addEventListener("avc:settings-saved",q),()=>document.removeEventListener("avc:settings-saved",q)),[]);const X=r.find(te=>te.modelId===a),L=r.find(te=>te.modelId===u),Z=(()=>{var le,pe;if(!D)return[];const te=new Set;return X&&!((le=D[km(X.provider)])!=null&&le.isSet)&&te.add(X.provider),L&&!((pe=D[km(L.provider)])!=null&&pe.isSet)&&te.add(L.provider),[...te]})();async function J(){if(!(!p.trim()||!a||!X||!u||!L)){v(!0),j(""),w(null),C(!1),A();try{const te=await H3(p.trim(),a,X.provider,u,L.provider);w(te)}catch(te){j(te.message||"Generation failed. Please try again.")}finally{v(!1)}}}async function ne(te){const{missionStatement:le,initialScope:pe}=x;O(!1),w(null),v(!0),j(""),C(!1),A();try{const Se=await G3(le,pe,te,a,X.provider,u,L.provider);w(Se)}catch(Se){j(Se.message||"Refinement failed. Please try again.")}finally{v(!1)}}function re(te){C(!1);const le=`Fix the following validation issues:
|
|
286
|
-
`+te.map(pe=>`- [${pe.severity.toUpperCase()}] ${pe.field}: ${pe.description} → ${pe.suggestion}`).join(`
|
|
287
|
-
`);ne(le)}function B(){x&&e(x.missionStatement,x.initialScope)}function F(){w(null),j(""),C(!1)}const G=[...new Set(r.map(te=>te.provider))],W=(x==null?void 0:x.validationScore)!=null&&x.validationScore>=75,_=!m&&p.trim().length>0&&!!a&&!!u&&Z.length===0;function V({label:te,value:le,onChange:pe}){const Se=r.find(H=>H.modelId===le);return c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:te}),c.jsxs("select",{value:le,onChange:H=>pe(H.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&&c.jsx("option",{value:"",children:"Loading…"}),G.map(H=>c.jsx("optgroup",{label:H.charAt(0).toUpperCase()+H.slice(1),children:r.filter(me=>me.provider===H).map(me=>c.jsxs("option",{value:me.modelId,children:[me.displayName,me.hasApiKey?"":" (no key)"]},me.modelId))},H))]}),Se&&!Se.hasApiKey&&c.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",c.jsx("code",{children:".env"})]})]})}return c.jsxs(c.Fragment,{children:[c.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:c.jsxs("div",{className:"w-full max-w-5xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden h-[540px]",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"✨ Ask a Model"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe your idea — an LLM generates and validates your mission & scope."})]}),c.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:"×"})]}),c.jsxs("div",{className:"flex flex-1 min-h-0",children:[c.jsxs("div",{className:"w-2/5 min-w-0 border-r border-slate-100 flex flex-col px-4 py-4 gap-3",children:[c.jsx(V,{label:"Generator Model",value:a,onChange:l}),c.jsx(V,{label:"Validator Model",value:u,onChange:d}),Z.length>0&&c.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(hs,{className:"w-3.5 h-3.5 text-amber-500 flex-shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-amber-900",children:"API Key Missing"}),c.jsx("ul",{className:"mt-1 space-y-0.5",children:Z.map(te=>c.jsxs("li",{className:"flex items-center gap-1.5 text-xs text-amber-800",children:[c.jsx("span",{className:"w-1 h-1 rounded-full bg-amber-400 flex-shrink-0"}),Bz[te]||te]},te))})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[n&&c.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:[c.jsx(io,{className:"w-3 h-3"}),"Settings"]}),c.jsx("button",{type:"button",onClick:q,className:"text-xs text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What are you building?"}),c.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&&c.jsx("p",{className:"text-xs text-red-600 bg-red-50 rounded-md px-2 py-1.5",children:S}),(x==null?void 0:x.validationScore)!=null&&c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsxs("span",{className:`inline-flex items-center gap-1 text-xs font-medium px-2 py-0.5 rounded-full ${W?"bg-green-50 text-green-700 border border-green-200":"bg-amber-50 text-amber-700 border border-amber-200"}`,children:[W?"✓":"⚠"," ",x.validationScore,"/100 · ",x.iterations," iter",x.iterations!==1?"s":""]}),((ie=x.issues)==null?void 0:ie.length)>0&&c.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 (",x.issues.length,")"]})]}),c.jsx("div",{className:"flex-1"}),c.jsxs("div",{className:"flex flex-col gap-2",children:[x?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:B,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"}),c.jsx("button",{type:"button",onClick:()=>O(!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"}),c.jsx("button",{type:"button",onClick:F,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"})]}):c.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?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Generating…"]}):"Generate"}),c.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"})]})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[m&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-8 text-center",children:[c.jsx("span",{className:"w-8 h-8 border-3 border-blue-200 border-t-blue-600 rounded-full animate-spin",style:{borderWidth:3}}),c.jsx("p",{className:"text-sm font-medium text-slate-700",children:M?M.message:"Starting…"}),c.jsx("p",{className:"text-xs text-slate-400",children:"This may take a moment while the models validate and refine the output."})]}),!m&&!x&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 px-8 text-center text-slate-300",children:[c.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.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"})}),c.jsx("p",{className:"text-sm font-medium text-slate-400",children:"Generated mission & scope will appear here"}),c.jsx("p",{className:"text-xs text-slate-300",children:"Fill in the form and click Generate"})]}),!m&&x&&c.jsxs("div",{className:"flex-1 flex flex-col gap-4 px-5 py-4 overflow-y-auto",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Mission Statement"}),c.jsx("p",{className:"text-sm text-slate-800 bg-slate-50 rounded-lg px-3 py-2.5 leading-relaxed",children:x.missionStatement})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-h-0",children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Initial Scope"}),c.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:x.initialScope.split(`
|
|
288
|
-
`).map((te,le)=>c.jsx("p",{className:"mb-1 last:mb-0",children:te},le))})]})]})]})]})]})}),k&&((fe=x==null?void 0:x.issues)==null?void 0:fe.length)>0&&c.jsx(Vz,{issues:x.issues,onClose:()=>C(!1),onRefineWithIssues:re}),E&&x&&c.jsx(Uz,{onSubmit:ne,onClose:()=>O(!1)})]})}function qz({onNext:e,onBack:t,analyzing:n,onOpenSettings:r}){const{mission:i,setMission:a,initialScope:l,setInitialScope:u}=cr(),[d,p]=b.useState(!1),h=i.trim().length>0&&l.trim().length>0;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Mission & Scope"}),c.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."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Mission Statement ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.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"})]}),c.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."'}),c.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()&&c.jsx("p",{className:"text-xs text-red-500 mt-1",children:"Mission statement is required."})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:["Initial Scope ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.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."'}),c.jsx("textarea",{value:l,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"})]})]}),c.jsxs("div",{className:"flex items-center justify-between pt-2",children:[c.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"}),c.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?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Analysing…"]}):"Continue"})]}),d&&c.jsx(Wz,{onUse:(m,v)=>{a(m),u(v),p(!1)},onClose:()=>p(!1),onOpenSettings:r})]})}function Kz(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 dS({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 c.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:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx("span",{className:`text-xs font-semibold px-2 py-0.5 rounded-full ${u.badge}`,children:i}),c.jsx("span",{className:"font-semibold text-slate-900",children:e.database})]}),e.specificVersion&&c.jsxs("p",{className:"text-xs text-slate-500 mb-2",children:["Version: ",e.specificVersion]}),e.estimatedCosts&&(()=>{const d=Kz(e.estimatedCosts.monthly);return d?c.jsx("p",{className:`text-sm font-semibold mb-2 ${d.color}`,children:d.symbols}):null})(),e.keyStrengths&&e.keyStrengths.length>0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-1",children:"Strengths"}),c.jsx("ul",{className:"space-y-0.5",children:e.keyStrengths.slice(0,3).map((d,p)=>c.jsxs("li",{className:"text-xs text-slate-600 flex items-start gap-1.5",children:[c.jsx("span",{className:"mt-1 w-1 h-1 rounded-full bg-slate-400 flex-shrink-0"}),d]},p))})]}),e.tradeoffs&&c.jsx("p",{className:"text-xs text-slate-400 mt-2 italic",children:e.tradeoffs})]})}function Hz({onNext:e,onBack:t,analyzing:n}){const{dbResult:r,dbChoice:i,setDbChoice:a}=cr();if(!r)return c.jsx("div",{className:"flex items-center justify-center py-16",children:c.jsx("div",{className:"text-center text-slate-400",children:c.jsx("p",{children:"Loading database analysis..."})})});const{comparison:l,rationale:u}=r;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Database Choice"}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Choose between SQL and NoSQL based on your project's data needs."}),u&&c.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})]}),l&&c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsx(dS,{option:l.sqlOption,type:"sql",selected:i==="sql",onSelect:a}),c.jsx(dS,{option:l.nosqlOption,type:"nosql",selected:i==="nosql",onSelect:a})]}),r.keyMetrics&&c.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-50 overflow-hidden",children:[c.jsxs("div",{className:"flex items-center gap-1.5 px-4 py-2 border-b border-slate-200 bg-white",children:[c.jsx(p2,{className:"w-3.5 h-3.5 text-slate-400"}),c.jsx("span",{className:"text-xs font-semibold text-slate-500",children:"Project metrics analysed"})]}),c.jsxs("div",{className:"flex divide-x divide-slate-200",children:[r.keyMetrics.estimatedReadWriteRatio&&c.jsxs("div",{className:"flex-1 px-4 py-3",children:[c.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Read / Write ratio"}),c.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.estimatedReadWriteRatio})]}),r.keyMetrics.expectedThroughput&&c.jsxs("div",{className:"flex-1 px-4 py-3",children:[c.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Expected throughput"}),c.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.expectedThroughput})]}),r.keyMetrics.dataComplexity&&c.jsxs("div",{className:"flex-1 px-4 py-3",children:[c.jsx("p",{className:"text-[10px] font-medium text-slate-400 uppercase tracking-wide mb-1",children:"Data complexity"}),c.jsx("p",{className:"text-sm font-semibold text-slate-700",children:r.keyMetrics.dataComplexity})]})]})]}),c.jsxs("div",{className:"flex items-start gap-2 px-1 py-2 text-xs text-slate-400",children:[c.jsx(Tv,{className:"w-3.5 h-3.5 flex-shrink-0 mt-0.5 text-slate-300"}),c.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."})]}),c.jsxs("div",{className:"flex items-center justify-between pt-2",children:[c.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"}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.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"}),c.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?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Analyzing..."]}):"Continue"})]})]})]})}function fS(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)"},Yz={Free:"text-green-600",$:"text-green-600",$$:"text-amber-500",$$$:"text-orange-500",$$$$:"text-red-500"};function Xz({onSubmit:e,onClose:t}){const[n,r]=b.useState("");return c.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:c.jsxs("div",{className:"w-full max-w-md bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"Refine Architecture"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe what you'd like to change or improve."})]}),c.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:"×"})]}),c.jsx("div",{className:"px-5 py-4 flex flex-col gap-3",children:c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"What would you like to change or improve?"}),c.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"})]})}),c.jsxs("div",{className:"px-5 py-3 border-t border-slate-100 flex-shrink-0 flex items-center justify-end gap-2",children:[c.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"}),c.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}){const[r,i]=b.useState([]),[a,l]=b.useState(""),[u,d]=b.useState(""),[p,h]=b.useState(!1),[m,v]=b.useState(null),[x,w]=b.useState(""),[S,j]=b.useState(!1),[k,C]=b.useState(null);b.useEffect(()=>{Promise.all([ms(),En()]).then(([Z,J])=>{i(Z),C(J.apiKeys??{});const ne=Z.filter(F=>{var G,W;return(W=(G=J.apiKeys)==null?void 0:G[fS(F.provider)])==null?void 0:W.isSet}),re=F=>/pro|opus|sonnet/i.test(F),B=ne.find(F=>re(F.modelId))||ne[0];l(B?B.modelId:Z.length>0?Z[0].modelId:"")}).catch(()=>w("Failed to load available models."))},[]);function E(){En().then(Z=>C(Z.apiKeys??{})).catch(()=>{})}const O=r.find(Z=>Z.modelId===a),P=(()=>{var J;if(!k||!O)return[];const Z=new Set;return(J=k[fS(O.provider)])!=null&&J.isSet||Z.add(O.provider),[...Z]})();async function A(){if(!(!u.trim()||!a||!O)){h(!0),w(""),v(null);try{const Z=await Y3(u.trim(),a,O.provider);v(Z)}catch(Z){w(Z.message||"Generation failed. Please try again.")}finally{h(!1)}}}async function M(Z){j(!1),v(null),h(!0),w("");try{const J=await X3(m,Z,a,O.provider);v(J)}catch(J){w(J.message||"Refinement failed. Please try again.")}finally{h(!1)}}function D(){m&&e(m)}function $(){v(null),w("")}const q=[...new Set(r.map(Z=>Z.provider))],X=!p&&u.trim().length>0&&!!a&&P.length===0;function L({label:Z,value:J,onChange:ne}){const re=r.find(B=>B.modelId===J);return c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:Z}),c.jsxs("select",{value:J,onChange:B=>ne(B.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&&c.jsx("option",{value:"",children:"Loading…"}),q.map(B=>c.jsx("optgroup",{label:B.charAt(0).toUpperCase()+B.slice(1),children:r.filter(F=>F.provider===B).map(F=>c.jsxs("option",{value:F.modelId,children:[F.displayName,F.hasApiKey?"":" (no key)"]},F.modelId))},B))]}),re&&!re.hasApiKey&&c.jsxs("p",{className:"text-xs text-amber-600 mt-0.5",children:["⚠ No API key — add to ",c.jsx("code",{children:".env"})]})]})}return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 backdrop-blur-sm p-4",onClick:Z=>{Z.target===Z.currentTarget&&t()},children:c.jsxs("div",{className:"w-full max-w-5xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden h-[540px]",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-slate-100 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-slate-900",children:"✨ Ask a Model"}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"Describe the architecture you need — an LLM will generate it for you."})]}),c.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:"×"})]}),c.jsxs("div",{className:"flex flex-1 min-h-0",children:[c.jsxs("div",{className:"w-2/5 min-w-0 border-r border-slate-100 flex flex-col px-4 py-4 gap-3",children:[c.jsx(L,{label:"Generator Model",value:a,onChange:l}),P.length>0&&c.jsxs("div",{className:"flex flex-col gap-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:[c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx(hs,{className:"w-3.5 h-3.5 text-amber-500 flex-shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-amber-900",children:"API Key Missing"}),c.jsx("ul",{className:"mt-1 space-y-0.5",children:P.map(Z=>c.jsxs("li",{className:"flex items-center gap-1.5 text-xs text-amber-800",children:[c.jsx("span",{className:"w-1 h-1 rounded-full bg-amber-400 flex-shrink-0"}),Gz[Z]||Z]},Z))})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[n&&c.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:[c.jsx(io,{className:"w-3 h-3"}),"Settings"]}),c.jsx("button",{type:"button",onClick:E,className:"text-xs text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-xs font-medium text-slate-500 mb-1",children:"Describe the architecture you need"}),c.jsx("textarea",{value:u,onChange:Z=>d(Z.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"})]}),x&&c.jsx("p",{className:"text-xs text-red-600 bg-red-50 rounded-md px-2 py-1.5",children:x}),c.jsx("div",{className:"flex-1"}),c.jsxs("div",{className:"flex flex-col gap-2",children:[m?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:D,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"}),c.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"}),c.jsx("button",{type:"button",onClick:$,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"})]}):c.jsx("button",{type:"button",onClick:A,disabled:!X,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?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3.5 h-3.5 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Generating…"]}):"Generate"}),c.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"})]})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[p&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3 px-8 text-center",children:[c.jsx("span",{className:"w-8 h-8 border-3 border-blue-200 border-t-blue-600 rounded-full animate-spin",style:{borderWidth:3}}),c.jsx("p",{className:"text-sm font-medium text-slate-700",children:"Generating architecture…"}),c.jsx("p",{className:"text-xs text-slate-400",children:"The model is crafting a custom architecture based on your description."})]}),!p&&!m&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-2 px-8 text-center text-slate-300",children:[c.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.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"})}),c.jsx("p",{className:"text-sm font-medium text-slate-400",children:"Custom architecture will appear here"}),c.jsx("p",{className:"text-xs text-slate-300",children:"Fill in the form and click Generate"})]}),!p&&m&&c.jsxs("div",{className:"flex-1 flex flex-col gap-3 px-5 py-4 overflow-y-auto",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsx("span",{className:"font-semibold text-slate-900 text-sm",children:m.name}),m.requiresCloudProvider?c.jsx("span",{className:"text-xs bg-purple-100 text-purple-700 px-2 py-0.5 rounded-full",children:"Cloud"}):c.jsx("span",{className:"text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded-full",children:"Local"})]}),c.jsx("p",{className:"text-xs text-slate-600 leading-relaxed",children:m.description}),m.bestFor&&c.jsxs("p",{className:"text-xs text-slate-500 italic",children:["Best for: ",m.bestFor]}),m.costTier&&c.jsx("p",{className:`text-sm font-semibold ${Yz[m.costTier]??"text-slate-500"}`,children:m.costTier}),m.migrationPath&&c.jsxs("p",{className:"text-xs text-slate-400",children:["Migration: ",m.migrationPath.estimatedMigrationEffort,"(",m.migrationPath.migrationComplexity,")"]})]})]})]})]})}),S&&m&&c.jsx(Xz,{onSubmit:M,onClose:()=>j(!1)})]})}const Jz={Free:"text-green-600",$:"text-green-600",$$:"text-amber-500",$$$:"text-orange-500",$$$$:"text-red-500"};function Zz({arch:e,selected:t,onSelect:n}){return c.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:[c.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[c.jsx("span",{className:"font-semibold text-slate-900 text-sm",children:e.name}),e.requiresCloudProvider?c.jsx("span",{className:"text-xs bg-purple-100 text-purple-700 px-2 py-0.5 rounded-full whitespace-nowrap",children:"Cloud"}):c.jsx("span",{className:"text-xs bg-green-100 text-green-700 px-2 py-0.5 rounded-full whitespace-nowrap",children:"Local"})]}),c.jsx("p",{className:"text-xs text-slate-600 mb-2 line-clamp-3",children:e.description}),e.bestFor&&c.jsxs("p",{className:"text-xs text-slate-500 italic",children:["Best for: ",e.bestFor]}),e.costTier&&c.jsx("p",{className:`mt-2 text-sm font-semibold ${Jz[e.costTier]??"text-slate-500"}`,children:e.costTier}),e.migrationPath&&c.jsxs("div",{className:"mt-2 text-xs text-slate-400",children:["Migration to cloud: ",e.migrationPath.estimatedMigrationEffort," (",e.migrationPath.migrationComplexity,")"]})]})}function eF({onNext:e,onBack:t,analyzing:n,onOpenSettings:r}){const{archOptions:i,selectedArch:a,setSelectedArch:l,setArchOptions:u}=cr(),[d,p]=b.useState(!1);return!i||i.length===0?c.jsx("div",{className:"flex items-center justify-center py-16",children:c.jsx("div",{className:"text-center text-slate-400",children:c.jsx("p",{children:"Loading architecture recommendations..."})})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Architecture Selection"}),c.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"})]}),c.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Choose the deployment architecture that fits your project best."})]}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:i.map((h,m)=>c.jsx(Zz,{arch:h,selected:a===h,onSelect:l},m))}),c.jsxs("div",{className:"flex items-center justify-between pt-2",children:[c.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"}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.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"}),c.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?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Preparing requirements…"]}):"Continue"})]})]}),d&&c.jsx(Qz,{onUse:h=>{u([...i,h]),l(h),p(!1)},onClose:()=>p(!1),onOpenSettings:r})]})}const pS=[{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 tF(e=""){return e==="claude"?"anthropic":e}function Pm({fieldKey:e,fieldLabel:t,currentValue:n,context:r,onApply:i,onClose:a}){const[l,u]=b.useState([]),[d,p]=b.useState(""),[h,m]=b.useState(""),[v,x]=b.useState(!1),[w,S]=b.useState(null),[j,k]=b.useState("");b.useEffect(()=>{Promise.all([ms(),En()]).then(([P,A])=>{var X;u(P);const M=A.apiKeys??{},D=P.filter(L=>{var Z;return(Z=M[tF(L.provider)])==null?void 0:Z.isSet}),$=L=>/pro|opus|sonnet/i.test(L),q=D.find(L=>$(L.modelId))||D[0];p(q?q.modelId:((X=P[0])==null?void 0:X.modelId)||"")}).catch(()=>k("Failed to load models."))},[]);const C=l.find(P=>P.modelId===d),E=[...new Set(l.map(P=>P.provider))];async function O(){if(!(!C||!h.trim())){x(!0),k(""),S(null);try{const P=await Q3(e,t,n,h.trim(),r,d,C.provider);S(P.value)}catch(P){k(P.message||"Refinement failed.")}finally{x(!1)}}}return c.jsxs("div",{className:"mt-2 rounded-lg border border-blue-200 bg-blue-50/50 p-3 space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-semibold text-blue-700",children:["Ask a Model — ",t]}),c.jsx("button",{type:"button",onClick:a,className:"text-xs text-slate-400 hover:text-slate-600",children:"×"})]}),!w&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex gap-2",children:c.jsxs("select",{value:d,onChange:P=>p(P.target.value),disabled:v||l.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:[l.length===0&&c.jsx("option",{value:"",children:"Loading…"}),E.map(P=>c.jsx("optgroup",{label:P.charAt(0).toUpperCase()+P.slice(1),children:l.filter(A=>A.provider===P).map(A=>c.jsxs("option",{value:A.modelId,children:[A.displayName,A.hasApiKey?"":" (no key)"]},A.modelId))},P))]})}),c.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:v,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&&c.jsx("p",{className:"text-xs text-red-600",children:j}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx("button",{type:"button",onClick:a,className:"px-3 py-1 text-xs text-slate-500 hover:text-slate-700",children:"Cancel"}),c.jsx("button",{type:"button",onClick:O,disabled:v||!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:v?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Refining…"]}):"Refine"})]})]}),w&&c.jsxs(c.Fragment,{children:[c.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}),c.jsxs("div",{className:"flex justify-end gap-2",children:[c.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"}),c.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 nF({onNext:e,onBack:t}){const{requirements:n,updateRequirement:r,mission:i,setMission:a,initialScope:l,setInitialScope:u}=cr(),[d,p]=b.useState(null),h={mission:i,scope:l},m=i.trim().length>0&&l.trim().length>0&&pS.filter(x=>x.required).every(x=>{var w;return(w=n[x.key])==null?void 0:w.trim()});function v({fieldKey:x}){return c.jsxs("button",{type:"button",onClick:()=>p(d===x?null:x),className:`inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-md transition-colors ${d===x?"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:[c.jsx(b3,{className:"w-3 h-3"}),"Ask Model"]})}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Review & Edit Requirements"}),c.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."})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Mission Statement ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx(v,{fieldKey:"MISSION_STATEMENT"})]}),c.jsx("textarea",{value:i,onChange:x=>a(x.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"&&c.jsx(Pm,{fieldKey:"MISSION_STATEMENT",fieldLabel:"Mission Statement",currentValue:i,context:h,onApply:x=>a(x),onClose:()=>p(null)})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:["Initial Scope ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx(v,{fieldKey:"INITIAL_SCOPE"})]}),c.jsx("textarea",{value:l,onChange:x=>u(x.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"&&c.jsx(Pm,{fieldKey:"INITIAL_SCOPE",fieldLabel:"Initial Scope",currentValue:l,context:h,onApply:x=>u(x),onClose:()=>p(null)})]}),c.jsx("hr",{className:"border-slate-200"}),pS.map(x=>c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[c.jsxs("label",{className:"block text-sm font-medium text-slate-700",children:[x.label,x.required&&c.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),c.jsx(v,{fieldKey:x.key})]}),c.jsx("p",{className:"text-xs text-slate-400 mb-1",children:x.description}),c.jsx("textarea",{value:n[x.key]||"",onChange:w=>r(x.key,w.target.value),rows:x.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:x.required?"Required...":"Optional..."}),d===x.key&&c.jsx(Pm,{fieldKey:x.key,fieldLabel:x.label,currentValue:n[x.key]||"",context:h,onApply:w=>r(x.key,w),onClose:()=>p(null)})]},x.key))]}),c.jsxs("div",{className:"flex items-center justify-between pt-2",children:[c.jsx("button",{type:"button",onClick:t,className:"text-sm text-slate-400 hover:text-slate-600 transition-colors",children:"← Back"}),c.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 rF(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 iF(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 P;const{progressLog:a,ceremonyStatus:l,ceremonyError:u,isPaused:d,setWizardStep:p,setCeremonyStatus:h,setCeremonyError:m}=cr(),v=b.useRef(null),[x,w]=b.useState(!1);b.useEffect(()=>{if(e==="cancelling"){w(!1);const A=setTimeout(()=>w(!0),5e3);return()=>clearTimeout(A)}w(!1)},[e]);const S=async()=>{try{await w2()}catch{}h("idle"),m(null),p(1)};b.useEffect(()=>{var A;(A=v.current)==null||A.scrollIntoView({behavior:"smooth"})},[a]),b.useEffect(()=>{l==="complete"&&p(7)},[l,p]);const j=iF(a);let k=null,C=5;for(const A of[...j].reverse()){const M=rF(A.message);if(M){k=M.current,C=M.total;break}}const E=k?Math.round(k/C*100):5,O=((P=j[j.length-1])==null?void 0:P.message)||"Starting ceremony...";if(l==="error"){const A=u==null?void 0:u.includes("already running");return c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Generation Failed"}),c.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[c.jsx("p",{className:"text-sm font-medium text-red-700 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-600",children:u||"An unknown error occurred."})]}),A?c.jsxs("div",{className:"space-y-3",children:[c.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."}),c.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"})]}):c.jsxs("p",{className:"text-sm text-slate-500",children:["Check that your API key is configured correctly in your project's ",c.jsx("code",{children:".env"})," file."]})]})}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Generating Documentation"}),c.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."})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-xs font-medium text-slate-600",children:O}),c.jsxs("span",{className:"text-xs text-slate-400",children:[E,"%"]})]}),c.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:c.jsx("div",{className:"bg-blue-500 h-2 rounded-full transition-all duration-500",style:{width:`${E}%`}})})]}),c.jsx("div",{className:"bg-slate-900 rounded-lg p-4 h-56 overflow-y-auto font-mono text-xs",children:j.length===0?c.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing..."}):c.jsxs("div",{className:"space-y-2",children:[j.map((A,M)=>{var $;const D=M===j.length-1&&l==="running";return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[D?c.jsx("span",{className:"inline-block w-3 h-3 border border-blue-400 border-t-blue-200 rounded-full animate-spin flex-shrink-0"}):c.jsx("span",{className:"text-green-500 flex-shrink-0",children:"✓"}),c.jsx("span",{className:D?"text-blue-300 font-medium":"text-slate-400",children:A.message})]}),(($=A.orphanDetails)==null?void 0:$.length)>0&&c.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:A.orphanDetails.map((q,X)=>c.jsx("p",{className:"text-slate-500",children:q},X))}),A.substeps.length>0&&c.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:A.substeps.map((q,X)=>c.jsxs("div",{children:[c.jsx("p",{className:"text-slate-400",children:q.text}),q.details.length>0&&c.jsx("div",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:q.details.map((L,Z)=>c.jsx("p",{className:"text-slate-500",children:L},Z))})]},X))})]},M)}),e==="cancelling"&&c.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin flex-shrink-0"}),c.jsx("span",{className:"text-red-400 font-medium",children:"Cancelling…"})]}),c.jsx("div",{ref:v})]})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2",children:[i&&!e&&c.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:[c.jsx(Av,{className:"w-3.5 h-3.5"}),"Run in Background"]}),e&&c.jsx("span",{}),c.jsxs("div",{className:"flex items-center gap-2",children:[e==="pausing"?c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-slate-400",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-slate-400 border-t-slate-200 rounded-full animate-spin"}),"Pausing…"]}):e==="cancelling"?c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin"}),"Cancelling…"]}),x&&c.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?c.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"}):c.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&&c.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 aF({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 c.jsx("span",{className:`flex-shrink-0 px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${t}`,children:e})}function oF({path:e}){const t=(e==null?void 0:e.split("/").slice(-2).join("/"))||e;return c.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:[c.jsx("span",{children:"📄"}),t]})}function hS({label:e,value:t}){return c.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3 text-center",children:[c.jsx("div",{className:"text-lg font-bold text-slate-900",children:t}),c.jsx("div",{className:"text-xs text-slate-500",children:e})]})}function lF({onClose:e}){var p,h,m,v,x,w;const{ceremonyResult:t}=cr(),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)||((v=n.tokenUsage)==null?void 0:v.outputTokens)||0;(x=n.tokenUsage)!=null&&x.total||(w=n.tokenUsage)!=null&&w.totalTokens||r+i;const a=n.outputPath&&n.contextPath?[n.outputPath,n.contextPath]:n.filesGenerated||[],l=Array.isArray(n.validationIssues)?n.validationIssues:[],u={};for(const S of l){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 c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Documentation Generated!"}),c.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&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2",children:"Files created"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:a.map((S,j)=>c.jsx(oF,{path:S},j))})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(hS,{label:"Input tokens",value:r.toLocaleString()}),c.jsx(hS,{label:"Output tokens",value:i.toLocaleString()})]}),n.model&&c.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Model: ",c.jsx("span",{className:"font-mono",children:n.model})]}),d.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Quality fixes applied"}),c.jsx("div",{className:"space-y-1.5",children:d.map((S,j)=>{var k;return c.jsxs("div",{className:"bg-amber-50 border border-amber-100 rounded-md px-3 py-2 text-xs",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(aF,{severity:S.severity}),c.jsx("span",{className:"text-slate-400 flex-shrink-0",children:S.stage}),c.jsx("span",{className:"text-slate-700 font-medium",children:S.name}),S.count>1&&c.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&&c.jsxs("span",{className:"flex-shrink-0 text-slate-400",children:["iter ",S.iterations.sort((C,E)=>C-E).join(", ")]})]}),S.description&&c.jsx("p",{className:"mt-1 text-slate-500 pl-1",children:S.description})]},j)})})]}),c.jsx("div",{className:"flex justify-center pt-2",children:c.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 cF={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 Cm(e=""){const t=e.toLowerCase();return t==="claude"||t==="anthropic"?"anthropic":t}function mS(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(Cm(a.provider));if(t!=null&&t.validation&&typeof t.validation=="object"){t.validation.provider&&n.add(Cm(t.validation.provider));for(const a of Object.values(t.validation))a&&typeof a=="object"&&typeof a.provider=="string"&&n.add(Cm(a.provider))}const r=e.apiKeys??{};return[...n].filter(a=>{var l;return a!=="local"&&!((l=r[a])!=null&&l.isSet)})}const gS=[{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 uF({currentStep:e,hasDb:t}){const n=t?gS:gS.filter(a=>a.id!==3),i=(a=>!t&&a>=4?a-1:a)(e);return c.jsx("div",{className:"flex items-center gap-1 flex-nowrap overflow-x-auto pb-0.5",children:n.map((a,l)=>{const u=l+1,d=i>u,p=i===u;return c.jsxs("div",{className:"flex items-center gap-1",children:[c.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]}),l<n.length-1&&c.jsx("span",{className:"text-slate-300 text-xs",children:"›"})]},a.id)})})}function dF({onClose:e,onOpenSettings:t,costLimitPending:n,onContinuePastCostLimit:r,onCancelFromCostLimit:i}){var Ps,Ir,$i,Dr;const{isOpen:a,wizardStep:l,setWizardStep:u,analyzing:d,setAnalyzing:p,strategy:h,mission:m,initialScope:v,dbResult:x,setDbResult:w,dbChoice:S,archOptions:j,setArchOptions:k,selectedArch:C,applyPrefill:E,requirements:O,ceremonyStatus:P,isPaused:A,setCeremonyStatus:M,setCeremonyResult:D,setCeremonyError:$,appendProgress:q,startRun:X,resetWizard:L,closeWizard:Z,setProcessId:J,setStrategy:ne,setMission:re,setInitialScope:B,setDbChoice:F,setSelectedArch:G,setPrefillResult:W,setRequirements:_}=cr(),[V,ie]=b.useState(""),[fe,te]=b.useState(null),le=(de,Me=null)=>te(de?{message:de,retry:Me}:null),[pe,Se]=b.useState(!1),[H,me]=b.useState(null),[Oe,se]=b.useState(!1),[Le,De]=b.useState(null),[Qe,Ze]=b.useState([]),[_t,Mn]=b.useState(null),[yn,bn]=b.useState([]),[wn,he]=b.useState({}),[ke,_e]=b.useState({loading:!0,missing:[]}),[Je,Ct]=b.useState(!1),[It,Dt]=b.useState(null),[dn,He]=b.useState({ceremonies:[],apiKeys:{}});b.useEffect(()=>{let de=!1;return En().then(Me=>{de||(_e({loading:!1,missing:mS(Me)}),He(Me))}).catch(()=>{de||_e({loading:!1,missing:[]})}),()=>{de=!0}},[]),b.useEffect(()=>{if(!a||l!==1||P!=="idle")return;let de=!1;return J3().then(Me=>{!de&&Me&&Me.wizardStep&&Me.wizardStep>1&&(Dt(Me),Ct(!0))}),()=>{de=!0}},[a]);const Rt=b.useCallback(()=>{_e({loading:!0,missing:[]}),En().then(de=>_e({loading:!1,missing:mS(de)})).catch(()=>_e({loading:!1,missing:[]}))},[]);b.useEffect(()=>(document.addEventListener("avc:settings-saved",Rt),()=>document.removeEventListener("avc:settings-saved",Rt)),[Rt]);const _n=(de={})=>{const Me=cr.getState();Z3({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,...de}).catch(()=>{})},ha=()=>{const de=It;Ct(!1),Dt(null),de&&(de.strategy!=null&&ne(de.strategy),de.mission!=null&&re(de.mission),de.initialScope!=null&&B(de.initialScope),de.dbResult!=null&&w(de.dbResult),de.dbChoice!=null&&F(de.dbChoice),de.archOptions!=null&&k(de.archOptions),de.selectedArch!=null&&G(de.selectedArch),de.prefillResult!=null&&W(de.prefillResult),de.requirements!=null&&_(de.requirements),u(de.wizardStep))},ma=()=>{Ct(!1),Dt(null),R1(),L()},ks=async(de,Me)=>{const Gn=(yn.length>0?yn:[de]).map(Yn=>Yn.name===de.name?de:Yn);await Wl(Gn,{validation:Me}),De(de),Mn(Me),bn(Gn)},ti=()=>{se(!1),Rt()};if(b.useEffect(()=>{H==="pausing"&&A&&me(null)},[A,H]),b.useEffect(()=>{H==="cancelling"&&P==="idle"&&me(null)},[P,H]),!a)return null;const Mr=(x==null?void 0:x.hasDatabaseNeeds)===!0,mr=async()=>{me("pausing");try{await y2()}catch{}},Ri=async()=>{try{await b2()}catch{}},Li=async()=>{Se(!1),me("cancelling");try{await eo()}catch{}},Kn=()=>{P!=="running"&&(Z(),e&&e())},gr=async()=>{le(null),p(!0),ie("Checking database needs…");try{const de=await z3(m,v,h);if(w(de),de.hasDatabaseNeeds)u(3),_n({wizardStep:3,dbResult:de});else{ie("Analysing architecture options…");const Me=await I1(m,v,null,h);k(Me),u(4),_n({wizardStep:4,dbResult:de,archOptions:Me})}}catch(de){console.error("Mission analysis error:",de),le(de.message,gr)}finally{p(!1),ie("")}},ga=async()=>{le(null),p(!0),ie("Analysing architecture options…");try{const de=x?{...x,userChoice:S}:null,Me=await I1(m,v,de,h);k(Me),u(4),_n({wizardStep:4,archOptions:Me})}catch(de){console.error("Architecture analysis error:",de),le(de.message,ga)}finally{p(!1),ie("")}},va=async()=>{le(null),p(!0),ie("Pre-filling requirements from your selections…");try{const de=x?{...x,userChoice:S}:null,Me=await F3(m,v,C,de,h);E(Me,h,m,v),u(5),setTimeout(()=>_n({wizardStep:5,prefillResult:Me}),0)}catch(de){console.error("Prefill error:",de),le(de.message,va)}finally{p(!1),ie("")}},_r=async()=>{R1();try{X(),u(6);const de=await B3(O);de!=null&&de.processId&&J(de.processId)}catch(de){console.error("Run ceremony error:",de),M("error"),$(de.message)}},ni=()=>{switch(l){case 1:return c.jsx(Fz,{onNext:()=>{u(2),_n({wizardStep:2})}});case 2:return c.jsx(qz,{onNext:gr,onBack:()=>u(1),analyzing:d,onOpenSettings:t});case 3:return c.jsx(Hz,{onNext:ga,onBack:()=>u(2),analyzing:d});case 4:return c.jsx(eF,{onNext:va,onBack:()=>u(Mr?3:2),analyzing:d,onOpenSettings:t});case 5:return c.jsx(nF,{onNext:_r,onBack:()=>u(4)});case 6:return c.jsx(sF,{transitioning:H,onPause:mr,onResume:Ri,onCancel:()=>Se(!0),onBackground:Z});case 7:return c.jsx(lF,{onClose:Kn});default:return null}};return c.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:l!==6?Kn:void 0}),c.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-3xl mx-4 max-h-[90vh] flex flex-col",children:[Je&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:c.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:[c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Resume previous session?"}),c.jsxs("p",{className:"text-sm text-slate-500",children:["A previous wizard session was saved",It!=null&&It.savedAt?` on ${new Date(It.savedAt).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`:"",". Would you like to continue where you left off?"]}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.jsx("button",{onClick:ma,className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Start Fresh"}),c.jsx("button",{onClick:ha,className:"px-4 py-2 text-sm rounded-lg bg-blue-600 text-white hover:bg-blue-700",children:"Resume"})]})]})}),n&&c.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:c.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:[c.jsx("div",{className:"text-3xl",children:"⚠️"}),c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cost Limit Reached"}),c.jsxs("p",{className:"text-sm text-slate-600",children:[c.jsxs("span",{className:"font-mono font-medium",children:["$",n.cost.toFixed(4)]})," spent",n.threshold!=null&&c.jsxs(c.Fragment,{children:[" (limit: ",c.jsxs("span",{className:"font-mono",children:["$",Number(n.threshold).toFixed(2)]}),")"]})]}),c.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.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"}),c.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"})]}),c.jsx("p",{className:"text-xs text-slate-400",children:"Continue disables cost checking for the rest of this run."})]})}),pe&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:c.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:[c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Stop documentation generation?"}),c.jsx("p",{className:"text-sm text-slate-500",children:"You can restart the ceremony later. Any files written so far will be kept."}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.jsx("button",{onClick:()=>Se(!1),className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Keep Running"}),c.jsx("button",{onClick:Li,className:"px-4 py-2 text-sm rounded-lg bg-red-600 text-white hover:bg-red-700",children:"Cancel Run"})]})]})}),c.jsxs("div",{className:"flex items-start justify-between px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("h1",{className:"text-base font-semibold text-slate-900",children:"Sponsor Call Ceremony"}),c.jsx("div",{className:"mt-2",children:c.jsx(uF,{currentStep:l,hasDb:Mr})})]}),c.jsxs("div",{className:"flex items-center gap-3 ml-4 mt-0.5 flex-shrink-0",children:[P!=="running"&&c.jsxs("button",{type:"button",onClick:async()=>{var de,Me;try{const[Hn,Gn]=await Promise.all([En(),ms()]),Yn=((de=Hn.ceremonies)==null?void 0:de.find(zi=>zi.name==="sponsor-call"))??{};De(Yn),Ze(Gn),Mn(((Me=Hn.missionGenerator)==null?void 0:Me.validation)??null),bn(Hn.ceremonies||[]),he(Hn.apiKeys||{}),se(!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:[c.jsx(io,{className:"w-3.5 h-3.5"}),"Select Model(s)"]}),P!=="running"&&c.jsx("button",{onClick:Kn,className:"text-slate-400 hover:text-slate-600 transition-colors",children:c.jsx(vn,{className:"w-5 h-5"})})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:ke.loading?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-blue-600"})}):ke.missing.length>0?c.jsxs("div",{className:"flex flex-col gap-5",children:[c.jsxs("div",{className:"flex items-start gap-3 p-4 bg-amber-50 border border-amber-200 rounded-lg",children:[c.jsx(hs,{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-semibold text-amber-900",children:"API Keys Required"}),c.jsx("p",{className:"text-xs text-amber-700 mt-1",children:"Configure the following API keys before running the Sponsor Call ceremony:"}),c.jsx("ul",{className:"mt-2 space-y-1.5",children:ke.missing.map(de=>c.jsxs("li",{className:"flex items-center gap-2 text-xs text-amber-800",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 flex-shrink-0"}),cF[de]||de]},de))})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.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:[c.jsx(io,{className:"w-4 h-4"}),"Open Settings"]}),c.jsx("button",{onClick:Rt,className:"px-3 py-2 text-sm text-slate-500 hover:text-slate-800 transition-colors",children:"Re-check"})]})]}):ni()}),fe&&c.jsx("div",{className:"flex-shrink-0 border-t border-red-200 bg-red-50 px-6 py-3",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"text-red-500 flex-shrink-0 mt-0.5 text-sm",children:"✕"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[(Ps=fe.message)!=null&&Ps.includes("n_keep")||(Ir=fe.message)!=null&&Ir.includes("n_ctx")||($i=fe.message)!=null&&$i.includes("context length")||(Dr=fe.message)!=null&&Dr.includes("context_length")?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-xs font-medium text-red-700",children:"Context length exceeded"}),c.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."})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-xs font-medium text-red-700",children:"Analysis failed"}),c.jsx("p",{className:"text-xs text-red-600 mt-0.5 break-words",children:fe.message})]}),c.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[fe.retry&&c.jsx("button",{type:"button",onClick:()=>{const de=fe.retry;le(null),de()},className:"text-xs font-medium text-white bg-red-600 hover:bg-red-700 px-3 py-1 rounded transition-colors",children:"Retry"}),c.jsx("button",{type:"button",onClick:()=>le(null),className:"text-xs font-medium text-red-700 hover:text-red-900 underline underline-offset-2",children:"Dismiss"})]})]})]})}),c.jsxs("div",{className:"flex-shrink-0 border-t border-slate-100 px-6 h-8 flex items-center gap-2",children:[V&&c.jsx("span",{className:"w-3 h-3 border-2 border-blue-300 border-t-blue-600 rounded-full animate-spin flex-shrink-0"}),c.jsx("p",{className:`text-xs truncate ${V?"text-blue-600 font-medium":"text-slate-400"}`,children:V})]})]}),Oe&&Le&&c.jsx(mx,{ceremony:Le,allCeremonies:yn,apiKeys:wn,models:Qe,missionGenValidation:_t,readOnly:P==="running",onSave:P!=="running"?ks:void 0,onClose:ti,onCeremoniesUpdated:de=>{bn(de);const Me=de.find(Hn=>Hn.name==="sponsor-call");Me&&De(Me)}})]})}const vS=[{id:1,label:"Ready"},{id:2,label:"Running"},{id:3,label:"Select Epics/Stories"},{id:4,label:"Complete"}];function fF({currentStep:e}){return c.jsx("div",{className:"flex items-center gap-1 flex-nowrap",children:vS.map((t,n)=>{const r=e>t.id,i=e===t.id;return c.jsxs("div",{className:"flex items-center gap-1",children:[c.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<vS.length-1&&c.jsx("span",{className:"text-slate-300 text-xs",children:"›"})]},t.id)})})}function xS({label:e,value:t}){return c.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3 text-center",children:[c.jsx("div",{className:"text-lg font-bold text-slate-900",children:t}),c.jsx("div",{className:"text-xs text-slate-500",children:e})]})}function pF({onStart:e,onResume:t,resumeInfo:n}){return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Ready to Plan"}),c.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&&c.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2",children:[c.jsx("p",{className:"text-sm font-medium text-amber-800",children:"Previous run can be resumed"}),c.jsxs("p",{className:"text-xs text-amber-600",children:["Stopped at: ",c.jsx("span",{className:"font-medium",children:n.checkpointLabel}),n.epics>0&&c.jsxs(c.Fragment,{children:[" · ",n.epics," epics on disk"]})]}),n.timestamp&&c.jsx("p",{className:"text-xs text-amber-500",children:new Date(n.timestamp).toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-end gap-3 pt-2",children:[n&&c.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"}),c.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 yS(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 hF(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 mF(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 gF({transitioning:e,onPause:t,onResume:n,onCancel:r,onBackground:i}){var E;const{progressLog:a,status:l,error:u,isPaused:d,setStatus:p,setStep:h,setError:m}=jo(),v=b.useRef(null),x=async()=>{try{await w2()}catch{}p("idle"),h(1),m(null)};b.useEffect(()=>{var O;(O=v.current)==null||O.scrollIntoView({behavior:"smooth"})},[a]);const w=mF(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(O=>yS(O.message));let k=5;if(j){const O=yS(j.message),P=`${O.current}/${O.total}`,[A,M]=S[P]??[0,90],D=hF(j.message);if(D&&D.total>0){let $=0;P==="5/6"?$=j.substeps.filter(X=>{var L;return(L=X.text)==null?void 0:L.includes("Validating ")}).length:P==="6/7"?$=j.substeps.filter(X=>{var L;return(L=X.text)==null?void 0:L.includes("Distributing documentation")}).length:P==="7/7"&&($=j.substeps.filter(X=>{var L;return(L=X.text)==null?void 0:L.includes("Enriching documentation")}).length);const q=Math.min($,D.total)/D.total;k=Math.round(A+q*(M-A))}else k=A}const C=((E=w[w.length-1])==null?void 0:E.message)||"Starting…";if(l==="error"){const O=u==null?void 0:u.includes("already running");return c.jsxs("div",{className:"space-y-4",children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Sprint Planning Failed"}),c.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[c.jsx("p",{className:"text-sm font-medium text-red-700 mb-1",children:"Error"}),c.jsx("p",{className:"text-sm text-red-600",children:u||"An unknown error occurred."})]}),O?c.jsxs("div",{className:"space-y-3",children:[c.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."}),c.jsx("button",{onClick:x,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"?c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{className:"text-sm text-slate-500",children:["The server may be running an older version. Run"," ",c.jsx("code",{className:"bg-slate-100 px-1 rounded",children:"/kanban"})," in the AVC terminal to restart it, then try again."]}),c.jsx("button",{onClick:x,className:"px-4 py-2 text-sm rounded-lg bg-slate-600 text-white hover:bg-slate-700 transition-colors",children:"Cancel & Retry"})]}):c.jsxs("div",{className:"space-y-3",children:[c.jsx("p",{className:"text-sm text-slate-500",children:"You can dismiss this error and start a new sprint planning session."}),c.jsx("button",{onClick:x,className:"px-4 py-2 text-sm rounded-lg bg-slate-600 text-white hover:bg-slate-700 transition-colors",children:"Cancel & Retry"})]})]})}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Running Sprint Planning"}),c.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."})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-1",children:[c.jsx("span",{className:"text-xs font-medium text-slate-600",children:C}),c.jsxs("span",{className:"text-xs text-slate-400",children:[k,"%"]})]}),c.jsx("div",{className:"w-full bg-slate-200 rounded-full h-2",children:c.jsx("div",{className:"bg-blue-500 h-2 rounded-full transition-all duration-500",style:{width:`${k}%`}})})]}),c.jsx("div",{className:"bg-slate-900 rounded-lg p-4 h-64 overflow-y-auto font-mono text-xs",children:w.length===0?c.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing…"}):c.jsxs("div",{className:"space-y-2",children:[w.map((O,P)=>{var M;const A=P===w.length-1&&l==="running";return c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[A?c.jsx("span",{className:"inline-block w-3 h-3 border border-blue-400 border-t-blue-200 rounded-full animate-spin flex-shrink-0"}):c.jsx("span",{className:"text-green-500 flex-shrink-0",children:"✓"}),c.jsx("span",{className:A?"text-blue-300 font-medium":"text-slate-400",children:O.message})]}),((M=O.orphanDetails)==null?void 0:M.length)>0&&c.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:O.orphanDetails.map((D,$)=>c.jsx("p",{className:"text-slate-500",children:D},$))}),O.substeps.length>0&&c.jsx("div",{className:"ml-5 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:O.substeps.map((D,$)=>c.jsxs("div",{children:[c.jsx("p",{className:"text-slate-400",children:D.text}),D.details.length>0&&c.jsx("div",{className:"ml-3 mt-0.5 space-y-0.5 border-l border-slate-700 pl-2",children:D.details.map((q,X)=>c.jsx("p",{className:"text-slate-500",children:q},X))})]},$))})]},P)}),e==="cancelling"&&c.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin flex-shrink-0"}),c.jsx("span",{className:"text-red-400 font-medium",children:"Cancelling…"})]}),c.jsx("div",{ref:v})]})}),c.jsxs("div",{className:"flex items-center justify-between gap-2 pt-2",children:[i&&!e?c.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:[c.jsx(Av,{className:"w-3.5 h-3.5"}),"Run in Background"]}):c.jsx("span",{}),c.jsxs("div",{className:"flex items-center gap-2",children:[e==="pausing"?c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-slate-400",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-slate-400 border-t-slate-200 rounded-full animate-spin"}),"Pausing…"]}):e==="cancelling"?c.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-red-400",children:[c.jsx("span",{className:"inline-block w-3 h-3 border border-red-400 border-t-red-200 rounded-full animate-spin"}),"Cancelling…"]}):d?c.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"}):c.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&&c.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 vF=[{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 xF({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 c.jsx("span",{className:`flex-shrink-0 px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase ${t}`,children:e})}function yF({onClose:e}){var a,l;const{result:t}=jo(),n=t||{},r=((a=n.tokenUsage)==null?void 0:a.input)||0,i=((l=n.tokenUsage)==null?void 0:l.output)||0;return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"text-5xl mb-3",children:"✅"}),c.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Sprint Planning Complete"}),c.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."})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-center",children:[c.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3",children:[c.jsx("div",{className:"text-2xl font-bold text-slate-900",children:n.epicsCreated??0}),c.jsx("div",{className:"text-xs text-slate-500",children:"Epics created"})]}),c.jsxs("div",{className:"bg-slate-50 rounded-lg border border-slate-200 p-3",children:[c.jsx("div",{className:"text-2xl font-bold text-slate-900",children:n.storiesCreated??0}),c.jsx("div",{className:"text-xs text-slate-500",children:"Stories created"})]})]}),(n.totalEpics!=null||n.totalStories!=null)&&c.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Total in project: ",n.totalEpics??0," Epics · ",n.totalStories??0," Stories"]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsx(xS,{label:"Input tokens",value:r.toLocaleString()}),c.jsx(xS,{label:"Output tokens",value:i.toLocaleString()})]}),n.model&&c.jsxs("p",{className:"text-xs text-center text-slate-400",children:["Model: ",c.jsx("span",{className:"font-mono",children:n.model})]}),(()=>{const u=n.validationIssues===void 0,d=n.validationIssues??vF;return d.length>0?c.jsxs("div",{children:[c.jsxs("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:["Quality fixes applied",u&&c.jsx("span",{className:"ml-2 normal-case font-normal text-slate-300",children:"(example preview)"})]}),c.jsx("div",{className:"space-y-1.5",children:d.map((p,h)=>c.jsxs("div",{className:"flex items-center gap-2 text-xs bg-amber-50 border border-amber-100 rounded-md px-3 py-2",children:[c.jsx(xF,{severity:p.severity}),c.jsx("span",{className:"text-slate-400 flex-shrink-0",children:p.stage}),c.jsx("span",{className:"text-slate-600",children:p.name})]},h))})]}):null})(),c.jsx("div",{className:"flex justify-center pt-2",children:c.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 bF({quotaLimitPending:e,onContinueAfterQuota:t,onCancel:n,onConfigureModels:r}){const[i,a]=b.useState(!1);async function l(){var u,d,p,h,m;a(!0);try{const x=(u=(await En()).ceremonies)==null?void 0:u.find(j=>j.name==="sprint-planning"),w=((p=(d=x==null?void 0:x.stages)==null?void 0:d.validation)==null?void 0:p.provider)||null,S=((m=(h=x==null?void 0:x.stages)==null?void 0:h.validation)==null?void 0:m.model)||null;await t(w,S)}finally{a(!1)}}return c.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:c.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:[c.jsx("div",{className:"text-3xl",children:"⚠️"}),c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"API Quota Exceeded"}),c.jsxs("p",{className:"text-sm text-slate-600",children:[c.jsx("span",{className:"font-mono font-medium",children:e.provider})," / ",c.jsx("span",{className:"font-mono text-xs",children:e.model})," returned a quota error."]}),e.validatorName&&c.jsxs("p",{className:"text-xs text-slate-400",children:["Validator: ",e.validatorName.replace("validator-story-","").replace("validator-epic-","")]}),c.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),c.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[c.jsx("button",{onClick:l,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"}),c.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"}),c.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"})]}),c.jsxs("p",{className:"text-xs text-slate-400",children:["Use ",c.jsx("strong",{children:"Configure Models"})," to switch provider, then ",c.jsx("strong",{children:"Resume"}),"."]})]})})}function wF({onClose:e,costLimitPending:t,onContinuePastCostLimit:n,onCancelFromCostLimit:r,quotaLimitPending:i,onContinueAfterQuota:a,onCancelFromQuota:l}){const{isOpen:u,step:d,status:p,isPaused:h,setStep:m,setStatus:v,setError:x,closeModal:w,setProcessId:S}=jo(),[j,k]=b.useState(!1),[C,E]=b.useState(null),[O,P]=b.useState([]),[A,M]=b.useState([]),[D,$]=b.useState({}),[q,X]=b.useState(!1),[L,Z]=b.useState(null),[J,ne]=b.useState(null);if(b.useEffect(()=>{u&&d===1&&p!=="running"&&U3().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",B=()=>{re||(w(),e==null||e())},F=async(te=null)=>{v("running"),m(2),ne(null);try{const le=await V3(te);le!=null&&le.processId&&S(le.processId)}catch(le){v("error"),x(le.message)}},G=async()=>{var te;try{const[le,pe]=await Promise.all([En(),ms()]),Se=((te=le.ceremonies)==null?void 0:te.find(H=>H.name==="sprint-planning"))??{name:"sprint-planning"};E(Se),P(pe),M(le.ceremonies||[]),$(le.apiKeys||{}),k(!0)}catch{}},W=async te=>{const pe=(A.length>0?A:[te]).map(Se=>Se.name===te.name?te:Se);await Wl(pe,null),E(te),M(pe)},_=async()=>{Z("pausing");try{await y2()}catch{}},V=async()=>{try{await b2()}catch{}},ie=async(te=!1)=>{X(!1),Z("cancelling");try{await eo(te)}catch{}};b.useEffect(()=>{L==="pausing"&&h&&Z(null)},[h,L]),b.useEffect(()=>{L==="cancelling"&&p==="idle"&&Z(null)},[p,L]);const fe=()=>{switch(d){case 1:return c.jsx(pF,{onStart:()=>F(null),onResume:()=>F(J==null?void 0:J.checkpoint),resumeInfo:J});case 2:return c.jsx(gF,{transitioning:L,onPause:_,onResume:V,onCancel:()=>X(!0),onBackground:w});case 3:return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4 text-center",children:[c.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400"}),c.jsx("p",{className:"text-sm text-slate-500",children:"Reviewing decomposed work…"})]});case 4:return c.jsx(yF,{onClose:B});default:return null}};return c.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:re?void 0:B}),c.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&&c.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-white/90 rounded-2xl",children:c.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:[c.jsx("div",{className:"text-3xl",children:"⚠️"}),c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cost Limit Reached"}),c.jsxs("p",{className:"text-sm text-slate-600",children:[c.jsxs("span",{className:"font-mono font-medium",children:["$",t.cost.toFixed(4)]})," spent",t.threshold!=null&&c.jsxs(c.Fragment,{children:[" (limit: ",c.jsxs("span",{className:"font-mono",children:["$",Number(t.threshold).toFixed(2)]}),")"]})]}),c.jsx("p",{className:"text-sm text-slate-500",children:"The ceremony is paused. What would you like to do?"}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.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"}),c.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"})]}),c.jsx("p",{className:"text-xs text-slate-400",children:"Continue disables cost checking for the rest of this run."})]})}),i&&c.jsx(bF,{quotaLimitPending:i,onContinueAfterQuota:a,onCancel:l,onConfigureModels:G}),q&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:c.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:[c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cancel sprint planning?"}),c.jsx("p",{className:"text-sm text-slate-500",children:"What should happen with epics and stories already created in this run?"}),c.jsxs("div",{className:"flex flex-col gap-2 pt-1",children:[c.jsx("button",{onClick:()=>X(!1),className:"px-4 py-2 text-sm rounded-lg border border-slate-200 text-slate-700 hover:bg-slate-50",children:"Keep Running"}),c.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"}),c.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"})]})]})}),c.jsxs("div",{className:"flex items-start justify-between px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("h1",{className:"text-base font-semibold text-slate-900",children:"Sprint Planning Ceremony"}),c.jsx("div",{className:"mt-2",children:c.jsx(fF,{currentStep:d})})]}),c.jsxs("div",{className:"flex items-center gap-3 ml-4 mt-0.5 flex-shrink-0",children:[!re&&c.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:[c.jsx(io,{className:"w-3.5 h-3.5"}),"Select Model(s)"]}),!re&&c.jsx("button",{onClick:B,className:"text-slate-400 hover:text-slate-600 transition-colors",children:c.jsx(vn,{className:"w-5 h-5"})})]})]}),c.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-5",children:fe()}),c.jsxs("div",{className:"flex-shrink-0 border-t border-slate-100 px-6 h-8 flex items-center gap-2",children:[p==="running"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-3 h-3 border-2 border-blue-300 border-t-blue-600 rounded-full animate-spin flex-shrink-0"}),c.jsx("p",{className:"text-xs text-blue-600 font-medium truncate",children:"Running sprint planning…"})]}),p==="awaiting-selection"&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400 flex-shrink-0"}),c.jsx("p",{className:"text-xs text-amber-600 font-medium truncate",children:"Waiting for your selection to continue…"})]})]})]}),j&&C&&c.jsx(mx,{ceremony:C,allCeremonies:A,apiKeys:D,models:O,readOnly:p==="running"&&!i,onSave:p!=="running"||i?W:void 0,onClose:()=>k(!1),onCeremoniesUpdated:te=>{M(te);const le=te.find(pe=>pe.name==="sprint-planning");le&&E(le)}})]})}function jF(){var k;const{isOpen:e,activeStoryId:t,sessions:n,closeModal:r,setStatus:i,appendProgress:a,setProcessId:l,setError:u,removeSession:d}=ql(),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 j2(C);if(!E.ready){i(C,"blocked");const P=(E.blockers||[]).map(A=>` ${A.id}: ${A.name} (${A.status})`).join(`
|
|
289
|
-
`);a(C,`Dependencies not met:
|
|
290
|
-
${P}`);return}a(C,"Dependencies OK. Starting seed ceremony..."),i(C,"seeding");const O=await gD(C);l(C,O.processId),a(C,`Process started: ${O.processId}`)}catch(E){u(C,E.message),a(C,`Error: ${E.message}`)}},[i,a,l,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:v,progressLog:x,storyName:w,error:S}=h,j=v==="seeding"||v==="checking";return c.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:j?void 0:r}),c.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-lg mx-4 max-h-[80vh] flex flex-col",children:[c.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-200",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:`p-2 rounded-lg ${j||v==="complete"?"bg-green-100":v==="error"?"bg-red-100":"bg-slate-100"}`,children:j?c.jsx(Sd,{className:"w-5 h-5 text-green-600 animate-spin"}):v==="error"?c.jsx(hs,{className:"w-5 h-5 text-red-600"}):c.jsx(x2,{className:"w-5 h-5 text-green-600"})}),c.jsxs("div",{children:[c.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"Seed Ceremony"}),c.jsx("p",{className:"text-xs text-slate-500 truncate max-w-[280px]",children:w})]})]}),c.jsx("button",{onClick:r,className:"p-1.5 text-slate-400 hover:text-slate-600 rounded-lg hover:bg-slate-100 transition-colors",children:c.jsx(vn,{className:"w-5 h-5"})})]}),c.jsxs("div",{className:"flex-1 overflow-hidden px-6 py-4 space-y-4",children:[v==="complete"&&c.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3 text-center",children:[c.jsx("p",{className:"text-sm font-medium text-green-800",children:"Seed complete — tasks created"}),c.jsx("p",{className:"text-xs text-green-600 mt-1",children:"The kanban board will refresh automatically."})]}),v==="error"&&c.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:[c.jsx("p",{className:"text-sm font-medium text-red-800",children:"Seed failed"}),c.jsx("p",{className:"text-xs text-red-600 mt-1",children:S})]}),v==="blocked"&&c.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3",children:[c.jsx("p",{className:"text-sm font-medium text-amber-800",children:"Dependencies not met"}),c.jsx("p",{className:"text-xs text-amber-600 mt-1",children:"Complete the blocking items first, then retry."})]}),c.jsx("div",{ref:p,className:"bg-slate-900 rounded-lg p-4 h-48 overflow-y-auto font-mono text-xs",children:x.length===0?c.jsx("p",{className:"text-slate-400 animate-pulse",children:"Initializing..."}):c.jsxs("div",{className:"space-y-0.5",children:[x.map((C,E)=>{var O,P,A,M;return c.jsx("div",{className:(O=C.startsWith)!=null&&O.call(C,"Error")?"text-red-400":(P=C.includes)!=null&&P.call(C,"complete")||(A=C.includes)!=null&&A.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&&c.jsx("div",{className:"text-slate-500 animate-pulse",children:"..."})]})})]}),c.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-slate-200",children:[j?c.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:[c.jsx(Av,{className:"w-3.5 h-3.5"}),"Run in Background"]}):c.jsx("span",{}),c.jsxs("div",{className:"flex items-center gap-2",children:[v==="blocked"&&c.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"}),(v==="complete"||v==="error"||v==="blocked")&&c.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:v==="complete"?"Done":"Dismiss"})]})]})]})]})}function SF({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,l]=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,v=(k,C)=>{i(O=>({...O,[k]:C}));const E=e.epics.find(O=>O.id===k);if(E){const O={};for(const P of E.stories||[])O[P.id]=C;l(P=>({...P,...O}))}},x=(k,C,E)=>{const O={...a,[C]:E};l(O);const P=e.epics.find(A=>A.id===k);if(P){const A=(P.stories||[]).some(M=>O[M.id]);i(M=>({...M,[k]:A}))}},w=()=>{const k={},C={};for(const E of e.epics){k[E.id]=!0;for(const O of E.stories||[])C[O.id]=!0}i(k),l(C)},S=()=>{const k={},C={};for(const E of e.epics){k[E.id]=!1;for(const O of E.stories||[])C[O.id]=!1}i(k),l(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 c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"px-6 pt-5 pb-4 border-b border-slate-200 flex-shrink-0",children:[c.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"Review Decomposed Work"}),c.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."})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto px-6 py-4 space-y-4 min-h-0",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("p",{className:"text-xs text-slate-500",children:[c.jsxs("span",{className:"font-medium text-slate-700",children:[u,"/",d]})," epics ·"," ",c.jsxs("span",{className:"font-medium text-slate-700",children:[p,"/",h]})," stories selected"]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.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"}),c.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"})]})]}),c.jsx("div",{className:"space-y-2",children:e.epics.map(k=>{const C=r[k.id]??!1,E=k.stories||[];return c.jsxs("div",{className:"rounded-lg border border-slate-200 overflow-hidden",children:[c.jsxs("label",{className:"flex items-start gap-3 px-4 py-3 bg-slate-50 cursor-pointer hover:bg-slate-100 select-none",children:[c.jsx("input",{type:"checkbox",checked:C,onChange:O=>v(k.id,O.target.checked),className:"mt-0.5 flex-shrink-0 accent-slate-900"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-900 leading-snug",children:k.name}),k.description&&c.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:k.description}),c.jsxs("p",{className:"text-xs text-slate-400 mt-0.5",children:[E.length," ",E.length===1?"story":"stories",k.domain?c.jsxs("span",{className:"ml-1 text-slate-300",children:["· ",k.domain]}):null]})]})]}),E.length>0&&c.jsx("div",{className:"divide-y divide-slate-100",children:E.map(O=>c.jsxs("label",{className:"flex items-start gap-3 px-4 py-2 pl-10 cursor-pointer hover:bg-slate-50 select-none",children:[c.jsx("input",{type:"checkbox",checked:a[O.id]??!1,onChange:P=>x(k.id,O.id,P.target.checked),className:"mt-0.5 flex-shrink-0 accent-slate-600"}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs font-medium text-slate-800",children:O.name}),O.userType&&c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:O.userType})]})]},O.id))})]},k.id)})})]}),c.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-slate-200 flex-shrink-0",children:[c.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"}),c.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 NF(){const{status:e,decomposedHierarchy:t,setStatus:n,setStep:r,setDecomposedHierarchy:i,setError:a}=jo(),[l,u]=b.useState(!1);if(e!=="awaiting-selection"||!t)return null;const d=async(h,m)=>{i(null),n("running"),r(2);try{await W3(h,m)}catch(v){n("error"),a(v.message)}},p=async()=>{u(!1);try{await eo()}catch{}};return c.jsxs("div",{className:"fixed inset-0 z-[80] flex items-center justify-center",children:[c.jsx("div",{className:"absolute inset-0 bg-black/60"}),c.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&&c.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white/90 rounded-2xl",children:c.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:[c.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Cancel sprint planning?"}),c.jsx("p",{className:"text-sm text-slate-500",children:"Any epics and stories created in this run will be permanently deleted."}),c.jsxs("div",{className:"flex gap-3 justify-center pt-1",children:[c.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"}),c.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"})]})]})}),c.jsx(SF,{hierarchy:t,onConfirm:d,onCancel:()=>u(!0)})]})]})}function kF(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 PF({apiKeyInfo:e,onSaved:t}){var F,G;const[n,r]=b.useState((e==null?void 0:e.authMode)||"api-key"),[i,a]=b.useState(""),[l,u]=b.useState(!1),[d,p]=b.useState(null),[h,m]=b.useState((F=e==null?void 0:e.oauth)!=null&&F.connected?"connected":"idle"),[v,x]=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),[O,P]=b.useState(((G=e==null?void 0:e.oauth)==null?void 0:G.fallback)??!1),[A,M]=b.useState(null);b.useEffect(()=>{var W,_;r((e==null?void 0:e.authMode)||"api-key"),x((e==null?void 0:e.oauth)||{connected:!1}),P(((W=e==null?void 0:e.oauth)==null?void 0:W.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 D=()=>{j.current=setInterval(async()=>{try{const W=await fD();W.connected&&(x(W),m("connected"),S(null),$(),t())}catch{}},2e3),k.current=setTimeout(()=>{$(),m("idle")},3e5)},$=()=>{j.current&&(clearInterval(j.current),j.current=null),k.current&&(clearTimeout(k.current),k.current=null)},q=W=>{W!==n&&(n==="oauth"&&h==="connecting"&&($(),m("idle"),S(null)),W==="oauth"&&m(v.connected?"connected":"idle"),r(W))},X=async()=>{m("connecting"),S(null);try{const W=await uD();S(W.authorizeUrl||null),D()}catch(W){m("idle"),console.error("OAuth connect error:",W)}},L=()=>{$(),m("idle"),S(null)},Z=async()=>{try{await dD()}catch{}m("idle"),x({connected:!1}),E(null),r("api-key"),t()},J=async W=>{M("saving");try{await hD(W),P(W),M(null)}catch(_){M({error:_.message}),setTimeout(()=>M(null),4e3)}},ne=async()=>{E("running");try{const W=await pD();E(W)}catch(W){E({error:W.message})}},re=async()=>{p("saving");try{await kd({openai:i}),p("saved"),a(""),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}},B=async()=>{p("clearing");try{await kd({openai:""}),p("saved"),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}};return c.jsxs("div",{className:"py-3 border-b border-slate-100 last:border-0",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsxs("div",{className:"w-36 flex-shrink-0",children:[c.jsx("p",{className:"text-sm font-medium text-slate-800",children:"OpenAI"}),c.jsx("p",{className:"text-xs text-slate-400",children:"Auth mode"})]}),c.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 rounded-lg p-1",children:[c.jsx("button",{type:"button",onClick:()=>q("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"}),c.jsx("button",{type:"button",onClick:()=>q("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"&&c.jsxs("div",{className:"flex items-center gap-3 pl-0 pt-1",children:[c.jsx("div",{className:"w-36 flex-shrink-0",children:c.jsx("p",{className:"text-xs text-slate-400",children:"OPENAI_API_KEY"})}),c.jsx("div",{className:"w-16 flex-shrink-0",children:e!=null&&e.isSet?c.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"}):c.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&&c.jsx("p",{className:"text-xs text-slate-400 font-mono flex-shrink-0",children:e.preview}),c.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{type:l?"text":"password",value:i,onChange:W=>a(W.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"}),c.jsx("button",{type:"button",onClick:()=>u(W=>!W),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:l?c.jsx(Ev,{className:"w-3.5 h-3.5"}):c.jsx(jd,{className:"w-3.5 h-3.5"})})]}),(e==null?void 0:e.isSet)&&!i&&c.jsx("button",{type:"button",onClick:B,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"}),c.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"?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.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"&&c.jsxs("div",{className:"pl-0 pt-1",children:[h==="idle"&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("p",{className:"text-xs text-slate-500",children:[c.jsx("span",{className:"font-medium text-amber-700",children:"ℹ"})," ","Requires a ",c.jsx("strong",{children:"ChatGPT Pro"})," subscription ($200/mo). Only Codex-endpoint models work (",c.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"gpt-5.2-codex"}),","," ",c.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."]}),c.jsx("div",{children:c.jsx("button",{type:"button",onClick:X,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"&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("p",{className:"text-xs text-slate-600 flex items-center gap-2",children:[c.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&&c.jsxs("p",{className:"text-xs text-slate-500",children:["If your browser did not open,"," ",c.jsx("a",{href:w,target:"_blank",rel:"noreferrer",className:"text-blue-600 underline break-all",children:"click here to authenticate"}),"."]}),c.jsx("div",{children:c.jsx("button",{type:"button",onClick:L,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"&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.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"}),v.accountId&&c.jsx("span",{className:"text-xs text-slate-500 font-mono",children:v.accountId}),v.expiresIn!=null&&c.jsxs("span",{className:"text-xs text-slate-400",children:["· expires in ",kF(v.expiresIn)]}),c.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[c.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"?c.jsx("span",{className:"w-3 h-3 border border-emerald-400 border-t-emerald-700 rounded-full animate-spin"}):"Test"}),c.jsx("button",{type:"button",onClick:Z,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"&&c.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)&&c.jsxs("div",{className:"flex items-center gap-3 pt-1 border-t border-slate-100",children:[c.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:"checkbox",checked:O,disabled:A==="saving",onChange:W=>J(W.target.checked),className:"sr-only"}),c.jsx("div",{onClick:()=>A!=="saving"&&J(!O),className:`w-8 h-4 rounded-full transition-colors cursor-pointer ${O?"bg-blue-500":"bg-slate-300"} ${A==="saving"?"opacity-40":""}`,children:c.jsx("div",{className:`absolute top-0.5 left-0.5 w-3 h-3 bg-white rounded-full shadow transition-transform ${O?"translate-x-4":""}`})})]}),c.jsx("span",{className:"text-xs text-slate-600",children:"Fallback to API Key on failure"})]}),(A==null?void 0:A.error)&&c.jsx("span",{className:"text-xs text-red-600",children:A.error})]})]})]})]})}const CF=[{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 OF({provider:e,apiKeyInfo:t,onSaved:n}){const[r,i]=b.useState(""),[a,l]=b.useState(!1),[u,d]=b.useState(null),p=async()=>{d("saving");try{await kd({[e.key]:r}),d("saved"),i(""),n(),setTimeout(()=>d(null),2e3)}catch{d("error"),setTimeout(()=>d(null),2e3)}},h=async()=>{d("clearing");try{await kd({[e.key]:""}),d("saved"),n(),setTimeout(()=>d(null),2e3)}catch{d("error"),setTimeout(()=>d(null),2e3)}};return c.jsxs("div",{className:"flex items-center gap-3 py-3 border-b border-slate-100 last:border-0",children:[c.jsxs("div",{className:"w-36 flex-shrink-0",children:[c.jsx("p",{className:"text-sm font-medium text-slate-800",children:e.label}),c.jsx("p",{className:"text-xs text-slate-400",children:e.envKey})]}),c.jsx("div",{className:"w-16 flex-shrink-0",children:t.isSet?c.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"}):c.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&&c.jsx("p",{className:"text-xs text-slate-400 font-mono flex-shrink-0",children:t.preview}),c.jsxs("div",{className:"flex-1 flex items-center gap-2 min-w-0",children:[c.jsxs("div",{className:"relative flex-1",children:[c.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"}),c.jsx("button",{type:"button",onClick:()=>l(m=>!m),className:"absolute right-2 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600",tabIndex:-1,children:a?c.jsx(Ev,{className:"w-3.5 h-3.5"}):c.jsx(jd,{className:"w-3.5 h-3.5"})})]}),t.isSet&&!r&&c.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"}),c.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"?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.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 AF({settings:e,onSaved:t}){return c.jsxs("div",{className:"px-5 py-4",children:[c.jsxs("p",{className:"text-xs text-slate-500 mb-4",children:["API keys are stored in your project's ",c.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."]}),c.jsxs("div",{children:[CF.map(n=>c.jsx(OF,{provider:n,apiKeyInfo:e.apiKeys[n.key],onSaved:t},n.key)),c.jsx(PF,{apiKeyInfo:e.apiKeys.openai,onSaved:t})]})]})}function EF(e){return e.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}const TF={"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 MF({settings:e,models:t,onSaved:n}){const[r,i]=b.useState(()=>JSON.parse(JSON.stringify(e.ceremonies||[]))),[a,l]=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,v)=>{const x=r.map(S=>S.name===m.name?m:S),w=m.name==="sponsor-call"?{validation:v||a}:{validation:a};await Wl(x,w),i(x),m.name==="sponsor-call"&&v&&l(v),n()};if(!r.length)return c.jsx("div",{className:"px-5 py-8 text-center",children:c.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 c.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[r.map(m=>{const v=TF[m.name];return c.jsxs("div",{className:"border border-slate-200 rounded-lg px-4 py-3 flex items-center justify-between gap-4",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold text-slate-800",children:m.displayName||EF(m.name||"")}),v&&c.jsx("p",{className:"text-xs text-slate-500 mt-0.5 leading-relaxed",children:v})]}),c.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:[c.jsx(N3,{className:"w-3.5 h-3.5"}),"Configure Models"]})]},m.name)}),u&&h&&c.jsx(mx,{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 _F({settings:e,onSaved:t}){const[n,r]=b.useState(String(e.kanbanPort||4174)),[i,a]=b.useState(String(e.docsPort||4173)),[l,u]=b.useState(e.boardTitle||"AVC Kanban Board"),[d,p]=b.useState(null),[h,m]=b.useState(null),v=async()=>{p("saving");try{await _1({kanbanPort:Number(n),docsPort:Number(i)}),p("saved"),t(),setTimeout(()=>p(null),2e3)}catch{p("error"),setTimeout(()=>p(null),2e3)}},x=async()=>{const w=l.trim();if(w){m("saving");try{await _1({boardTitle:w}),m("saved"),t(),setTimeout(()=>m(null),2e3)}catch{m("error"),setTimeout(()=>m(null),2e3)}}};return c.jsxs("div",{className:"px-5 py-4 flex flex-col gap-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-3",children:"General"}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Board title"}),c.jsx("input",{type:"text",value:l,onChange:w=>u(w.target.value),onKeyDown:w=>{w.key==="Enter"&&x()},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"}),c.jsx("button",{type:"button",onClick:x,disabled:!l.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"?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.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"})]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-3",children:"Server Ports"}),c.jsxs("div",{className:"flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Kanban board"}),c.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"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("label",{className:"text-sm text-slate-700 w-28 flex-shrink-0",children:"Documentation"}),c.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"})]}),c.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[c.jsx("div",{className:"w-28 flex-shrink-0"}),c.jsx("button",{type:"button",onClick:v,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"?c.jsxs("span",{className:"inline-flex items-center gap-1",children:[c.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"})]})]}),c.jsxs("p",{className:"text-xs text-slate-400 mt-3",children:["Changing ports requires restarting the servers (run ",c.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"/kanban"})," and ",c.jsx("code",{className:"font-mono bg-slate-100 px-1 rounded",children:"/documentation"}),")."]})]})]})}const IF=["claude","gemini","openai","xiaomi"],DF={claude:"Claude",gemini:"Gemini",openai:"OpenAI",xiaomi:"Xiaomi MiMo"},RF={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"}},LF={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"},Om=[{value:"million",label:"per 1M tokens"},{value:"thousand",label:"per 1K tokens"}];function $F(e){var n,r,i,a,l,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:((l=p.pricing)==null?void 0:l.source)??"",lastUpdated:((u=p.pricing)==null?void 0:u.lastUpdated)??""};return t}function zF(e){return e?new Date(e+"T00:00:00").toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):null}function FF({settings:e,onSaved:t}){const n=e.models||{},[r,i]=b.useState(()=>$F(n)),[a,l]=b.useState(null),u=IF.filter(x=>Object.values(n).some(w=>w.provider===x)),[d,p]=b.useState(()=>u[0]||"claude"),h=Object.entries(n).filter(([,x])=>x.provider===d),m=(x,w,S)=>{i(j=>({...j,[x]:{...j[x],[w]:S}}))},v=async()=>{l("saving");try{const x={};for(const[w,S]of Object.entries(r))x[w]={pricing:{input:parseFloat(S.input)||0,inputCached:parseFloat(S.inputCached)||0,output:parseFloat(S.output)||0,unit:S.unit,source:S.source}};await R3(x),l("saved"),t(),setTimeout(()=>l(null),2e3)}catch{l("error"),setTimeout(()=>l(null),2e3)}};return h.length===0?c.jsx("div",{className:"px-5 py-8 text-center",children:c.jsx("p",{className:"text-sm text-slate-500",children:"No models configured yet. Run your first ceremony to populate model settings."})}):c.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[c.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 ",c.jsx("strong",{children:"USD"}),"."]}),u.length>1&&c.jsx("div",{className:"flex border-b border-slate-200 -mx-5 px-5",children:u.map(x=>{const w=RF[x]||{active:"border-slate-900 text-slate-900"},S=x===d,j=Object.values(n).filter(k=>k.provider===x).length;return c.jsxs("button",{type:"button",onClick:()=>p(x),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:[DF[x]||x,c.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})]},x)})}),c.jsx("div",{className:"flex flex-col gap-2",children:h.map(([x,w])=>{var k,C;const S=r[x]??{input:"",output:"",unit:"million"},j=LF[w.provider]||"bg-slate-50 text-slate-600 border-slate-200";return c.jsxs("div",{className:"border border-slate-200 rounded-lg p-4",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[c.jsx("span",{className:"text-sm font-semibold text-slate-800",children:w.displayName||x}),c.jsx("span",{className:`text-xs font-medium border rounded-full px-2 py-0.5 ${j}`,children:w.provider}),c.jsx("span",{className:"text-xs text-slate-400 font-mono ml-auto",children:x}),S.lastUpdated&&c.jsxs("span",{className:"text-xs text-slate-400 whitespace-nowrap",children:["verified ",zF(S.lastUpdated)]})]}),c.jsxs("div",{className:"grid grid-cols-[80px_1fr_1fr] gap-x-3 gap-y-2 items-center text-xs",children:[c.jsx("div",{}),c.jsx("div",{className:"text-slate-400 font-medium",children:"Price (USD $)"}),c.jsx("div",{className:"text-slate-400 font-medium",children:"Unit"}),c.jsx("label",{className:"text-slate-600 font-medium",children:"Input"}),c.jsx("input",{type:"number",min:"0",step:"0.01",value:S.input,onChange:E=>m(x,"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]"}),c.jsx("select",{value:S.unit,onChange:E=>m(x,"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:Om.map(E=>c.jsx("option",{value:E.value,children:E.label},E.value))}),c.jsx("label",{className:"text-slate-600 font-medium",children:"Cache Read"}),c.jsx("input",{type:"number",min:"0",step:"0.01",value:S.inputCached,onChange:E=>m(x,"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]"}),c.jsxs("span",{className:"text-slate-400 text-xs",children:[(k=Om.find(E=>E.value===S.unit))==null?void 0:k.label," · discounted"]}),c.jsx("label",{className:"text-slate-600 font-medium",children:"Output"}),c.jsx("input",{type:"number",min:"0",step:"0.01",value:S.output,onChange:E=>m(x,"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]"}),c.jsx("span",{className:"text-slate-400",children:(C=Om.find(E=>E.value===S.unit))==null?void 0:C.label}),c.jsx("label",{className:"text-slate-600 font-medium",children:"Source"}),c.jsxs("div",{className:"col-span-2 flex items-center gap-1.5",children:[c.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&&c.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:c.jsx(u3,{className:"w-3.5 h-3.5"})})]})]})]},x)})}),c.jsx("div",{className:"flex justify-end pt-1",children:c.jsx("button",{type:"button",onClick:v,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"?c.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.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 uA=[{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"}]}]}],bS={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"}},BF=new Set(uA.flatMap(e=>e.phases.flatMap(t=>t.agents.map(n=>n.slug))));function VF(){const[e,t]=b.useState({}),[n,r]=b.useState({}),[i,a]=b.useState(null),[l,u]=b.useState(null),[d,p]=b.useState(""),[h,m]=b.useState(null),[v,x]=b.useState({});b.useEffect(()=>{eD().then(M=>{const D={};M.agents.forEach($=>{const q=$.name.replace(/\.md$/,"");D[q]=$.isCustomized}),t(D)}).catch(M=>m(M.message)),iD().then(M=>{const D={};M.checks.forEach($=>{const q=`checks/${$.scope}/${$.perspective}`;D[q]={isCustomized:$.isCustomized,checkCount:$.checkCount}}),r(D)}).catch(()=>{})},[]);const w=M=>x(D=>({...D,[M]:!D[M]})),S=M=>v[M]===!0,j=Object.keys(e).filter(M=>!BF.has(M)).map(M=>({slug:M,label:M,note:null})),k=[...uA,...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(D=>({...D,agents:D.agents.filter($=>$.label.toLowerCase().includes(C)||$.slug.toLowerCase().includes(C)||M.ceremony.toLowerCase().includes(C)||D.phase.toLowerCase().includes(C))})).filter(D=>D.agents.length>0)})).filter(M=>M.phases.length>0):k,O=Object.keys(e).length>0||Object.keys(n).length>0,P=C.length>0,A=M=>M.phases.flatMap(D=>D.agents).filter(D=>{var $;return D.isCheck?($=n[D.slug])==null?void 0:$.isCustomized:e[D.slug]}).length;return c.jsxs("div",{children:[c.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:[c.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"}),c.jsx("span",{className:"text-xs text-slate-400 italic flex-shrink-0",children:"Click any agent to edit its prompt"})]}),c.jsxs("div",{className:"px-4 py-4 flex flex-col gap-3",children:[h&&c.jsx("p",{className:"text-xs text-red-500",children:h}),E.length===0&&c.jsx("p",{className:"text-sm text-slate-400 py-4",children:"No agents match your search."}),E.map(M=>{const D=bS[M.color]||bS.slate,$=P||S(M.ceremony),q=A(M);return c.jsxs("div",{className:`rounded-xl border ${D.border} overflow-hidden`,children:[c.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 ${D.header} ${D.accent} text-left`,children:[$?c.jsx(yi,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):c.jsx(lr,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}),c.jsx("span",{className:`text-sm font-semibold flex-1 ${D.text}`,children:M.ceremony}),q>0&&c.jsxs("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded bg-amber-100 text-amber-700",children:[q," custom"]})]}),$&&c.jsx("div",{className:"divide-y divide-slate-100",children:M.phases.map(X=>{const L=`${M.ceremony}::${X.phase}`,Z=P||S(L),J=X.agents.filter(ne=>!O||ne.isCheck||ne.slug in e);return J.length===0?null:c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>!P&&w(L),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:[Z?c.jsx(yi,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}):c.jsx(lr,{className:"w-3 h-3 text-slate-400 flex-shrink-0"}),c.jsx("span",{className:"text-xs font-semibold text-slate-600 uppercase tracking-wide",children:X.phase}),c.jsx("span",{className:"text-xs text-slate-400 ml-1",children:J.length})]}),Z&&c.jsx("div",{className:"pb-1",children:J.map(ne=>{var W,_;const re=ne.isCheck,B=re?((W=n[ne.slug])==null?void 0:W.isCustomized)??!1:e[ne.slug]??!1,F=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 c.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:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("span",{className:"text-sm text-slate-700 group-hover:text-slate-900",children:ne.label}),re&&F>0&&c.jsxs("span",{className:"text-xs text-blue-500 ml-2",children:[F," checks"]}),ne.note&&!re&&c.jsx("span",{className:"text-xs text-slate-400 italic ml-2",children:ne.note})]}),B&&c.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"}),c.jsx(fc,{className:"w-3.5 h-3.5 text-slate-300 group-hover:text-slate-500 flex-shrink-0 transition-colors"})]},`${M.ceremony}-${ne.slug}`)})})]},X.phase)})})]},M.ceremony)})]}),i&&c.jsx(oA,{agentName:`${i}.md`,onClose:()=>a(null),onSaved:()=>t(M=>({...M,[i]:!0})),onReset:()=>t(M=>({...M,[i]:!1}))}),l&&c.jsx(lA,{scope:l.scope,perspective:l.perspective,onClose:()=>u(null),onSaved:()=>{const M=`checks/${l.scope}/${l.perspective}`;r(D=>({...D,[M]:{...D[M],isCustomized:!0}}))},onReset:()=>{const M=`checks/${l.scope}/${l.perspective}`;r(D=>({...D,[M]:{...D[M],isCustomized:!1}}))}})]})}const Ag=[{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 UF(e){const t={};for(const{key:n}of Ag){const r=e==null?void 0:e[n];t[n]=r!=null?String(r):""}return t}function WF({settings:e,onSaved:t}){const[n,r]=b.useState(()=>UF(e.costThresholds)),[i,a]=b.useState(null),l=(d,p)=>{r(h=>({...h,[d]:p}))},u=async()=>{a("saving");try{const d={};for(const{key:p}of Ag){const h=n[p].trim();d[p]=h===""?null:parseFloat(h)||null}await L3(d),a("saved"),t(),setTimeout(()=>a(null),2e3)}catch{a("error"),setTimeout(()=>a(null),2e3)}};return c.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[c.jsxs("p",{className:"text-xs text-slate-500",children:["Set a maximum spend (in ",c.jsx("strong",{children:"USD"}),") per ceremony run. Leave empty for unlimited. When the running cost exceeds the limit, the ceremony stops automatically."]}),c.jsx("div",{className:"flex flex-col gap-2",children:Ag.map(({key:d,label:p,desc:h})=>c.jsx("div",{className:"border border-slate-200 rounded-lg p-4",children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"text-sm font-semibold text-slate-800",children:p}),c.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:h})]}),c.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[c.jsx("span",{className:"text-sm text-slate-500",children:"$"}),c.jsx("input",{type:"number",min:"0",step:"0.01",value:n[d],onChange:m=>l(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))}),c.jsx("div",{className:"flex justify-end pt-1",children:c.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"?c.jsxs("span",{className:"inline-flex items-center gap-2",children:[c.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 qF=[{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 KF({settings:e,models:t,onClose:n,onSaved:r,initialTab:i}){const[a,l]=b.useState(i||"api-keys");return c.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:c.jsxs("div",{className:"w-full max-w-4xl bg-white rounded-2xl shadow-2xl flex flex-col overflow-hidden",style:{height:"85vh"},children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-slate-100 flex-shrink-0",children:[c.jsx("h2",{className:"text-base font-semibold text-slate-900",children:"⚙ Project Settings"}),c.jsx("button",{type:"button",onClick:n,className:"text-slate-400 hover:text-slate-600 transition-colors ml-4","aria-label":"Close",children:c.jsx(vn,{className:"w-5 h-5"})})]}),c.jsx("div",{className:"flex border-b border-slate-100 flex-shrink-0 px-5",children:qF.map(u=>c.jsx("button",{type:"button",onClick:()=>l(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))}),c.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a==="api-keys"&&c.jsx(AF,{settings:e,onSaved:r}),a==="ceremonies"&&c.jsx(MF,{settings:e,models:t,onSaved:r}),a==="pricing"&&c.jsx(FF,{settings:e,onSaved:r}),a==="cost-thresholds"&&c.jsx(WF,{settings:e,onSaved:r}),a==="servers"&&c.jsx(_F,{settings:e,onSaved:r}),a==="agents"&&c.jsx(VF,{})]})]})})}var HF=["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 gx(e){if(typeof e!="string")return!1;var t=HF;return t.includes(e)}var GF=["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"],YF=new Set(GF);function dA(e){return typeof e!="string"?!1:YF.has(e)}function fA(e){return typeof e=="string"&&e.startsWith("data-")}function xs(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(dA(n)||fA(n))&&(t[n]=e[n]);return t}function vx(e){if(e==null)return null;if(b.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return xs(t)}return typeof e=="object"&&!Array.isArray(e)?xs(e):null}function ur(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(dA(n)||fA(n)||gx(n))&&(t[n]=e[n]);return t}var XF=["children","width","height","viewBox","className","style","title","desc"];function Eg(){return Eg=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},Eg.apply(null,arguments)}function QF(e,t){if(e==null)return{};var n,r,i=JF(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 JF(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 pA=b.forwardRef((e,t)=>{var{children:n,width:r,height:i,viewBox:a,className:l,style:u,title:d,desc:p}=e,h=QF(e,XF),m=a||{width:r,height:i,x:0,y:0},v=it("recharts-surface",l);return b.createElement("svg",Eg({},ur(h),{className:v,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)}),ZF=["children","className"];function Tg(){return Tg=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},Tg.apply(null,arguments)}function eB(e,t){if(e==null)return{};var n,r,i=tB(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 tB(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 wi=b.forwardRef((e,t)=>{var{children:n,className:r}=e,i=eB(e,ZF),a=it("recharts-layer",r);return b.createElement("g",Tg({className:a},ur(i),{ref:t}),n)}),hA=u2(),nB=b.createContext(null);function rt(e){return function(){return e}}const mA=Math.cos,Id=Math.sin,Tr=Math.sqrt,Dd=Math.PI,Df=2*Dd,Mg=Math.PI,_g=2*Mg,Ws=1e-6,rB=_g-Ws;function gA(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function iB(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return gA;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 sB{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?gA:iB(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,l){this._append`C${+t},${+n},${+r},${+i},${this._x1=+a},${this._y1=+l}`}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 l=this._x1,u=this._y1,d=r-t,p=i-n,h=l-t,m=u-n,v=h*h+m*m;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(v>Ws)if(!(Math.abs(m*d-p*h)>Ws)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let x=r-l,w=i-u,S=d*d+p*p,j=x*x+w*w,k=Math.sqrt(S),C=Math.sqrt(v),E=a*Math.tan((Mg-Math.acos((S+v-j)/(2*k*C)))/2),O=E/C,P=E/k;Math.abs(O-1)>Ws&&this._append`L${t+O*h},${n+O*m}`,this._append`A${a},${a},0,0,${+(m*x>h*w)},${this._x1=t+P*d},${this._y1=n+P*p}`}}arc(t,n,r,i,a,l){if(t=+t,n=+n,r=+r,l=!!l,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^l,v=l?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&&(v<0&&(v=v%_g+_g),v>rB?this._append`A${r},${r},0,1,${m},${t-u},${n-d}A${r},${r},0,1,${m},${this._x1=p},${this._y1=h}`:v>Ws&&this._append`A${r},${r},0,${+(v>=Mg)},${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 xx(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 sB(t)}function yx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function vA(e){this._context=e}vA.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 Rf(e){return new vA(e)}function xA(e){return e[0]}function yA(e){return e[1]}function bA(e,t){var n=rt(!0),r=null,i=Rf,a=null,l=xx(u);e=typeof e=="function"?e:e===void 0?xA:rt(e),t=typeof t=="function"?t:t===void 0?yA:rt(t);function u(d){var p,h=(d=yx(d)).length,m,v=!1,x;for(r==null&&(a=i(x=l())),p=0;p<=h;++p)!(p<h&&n(m=d[p],p,d))===v&&((v=!v)?a.lineStart():a.lineEnd()),v&&a.point(+e(m,p,d),+t(m,p,d));if(x)return a=null,x+""||null}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:rt(+d),u):e},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:rt(+d),u):t},u.defined=function(d){return arguments.length?(n=typeof d=="function"?d:rt(!!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 Gu(e,t,n){var r=null,i=rt(!0),a=null,l=Rf,u=null,d=xx(p);e=typeof e=="function"?e:e===void 0?xA:rt(+e),t=typeof t=="function"?t:rt(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?yA:rt(+n);function p(m){var v,x,w,S=(m=yx(m)).length,j,k=!1,C,E=new Array(S),O=new Array(S);for(a==null&&(u=l(C=d())),v=0;v<=S;++v){if(!(v<S&&i(j=m[v],v,m))===k)if(k=!k)x=v,u.areaStart(),u.lineStart();else{for(u.lineEnd(),u.lineStart(),w=v-1;w>=x;--w)u.point(E[w],O[w]);u.lineEnd(),u.areaEnd()}k&&(E[v]=+e(j,v,m),O[v]=+t(j,v,m),u.point(r?+r(j,v,m):E[v],n?+n(j,v,m):O[v]))}if(C)return u=null,C+""||null}function h(){return bA().defined(i).curve(l).context(a)}return p.x=function(m){return arguments.length?(e=typeof m=="function"?m:rt(+m),r=null,p):e},p.x0=function(m){return arguments.length?(e=typeof m=="function"?m:rt(+m),p):e},p.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:rt(+m),p):r},p.y=function(m){return arguments.length?(t=typeof m=="function"?m:rt(+m),n=null,p):t},p.y0=function(m){return arguments.length?(t=typeof m=="function"?m:rt(+m),p):t},p.y1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:rt(+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:rt(!!m),p):i},p.curve=function(m){return arguments.length?(l=m,a!=null&&(u=l(a)),p):l},p.context=function(m){return arguments.length?(m==null?a=u=null:u=l(a=m),p):a},p}class wA{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 aB(e){return new wA(e,!0)}function oB(e){return new wA(e,!1)}const bx={draw(e,t){const n=Tr(t/Dd);e.moveTo(n,0),e.arc(0,0,n,0,Df)}},lB={draw(e,t){const n=Tr(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()}},jA=Tr(1/3),cB=jA*2,uB={draw(e,t){const n=Tr(t/cB),r=n*jA;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},dB={draw(e,t){const n=Tr(t),r=-n/2;e.rect(r,r,n,n)}},fB=.8908130915292852,SA=Id(Dd/10)/Id(7*Dd/10),pB=Id(Df/10)*SA,hB=-mA(Df/10)*SA,mB={draw(e,t){const n=Tr(t*fB),r=pB*n,i=hB*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const l=Df*a/5,u=mA(l),d=Id(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*i,d*r+u*i)}e.closePath()}},Am=Tr(3),gB={draw(e,t){const n=-Tr(t/(Am*3));e.moveTo(0,n*2),e.lineTo(-Am*n,-n),e.lineTo(Am*n,-n),e.closePath()}},rr=-.5,ir=Tr(3)/2,Ig=1/Tr(12),vB=(Ig/2+1)*3,xB={draw(e,t){const n=Tr(t/vB),r=n/2,i=n*Ig,a=r,l=n*Ig+n,u=-a,d=l;e.moveTo(r,i),e.lineTo(a,l),e.lineTo(u,d),e.lineTo(rr*r-ir*i,ir*r+rr*i),e.lineTo(rr*a-ir*l,ir*a+rr*l),e.lineTo(rr*u-ir*d,ir*u+rr*d),e.lineTo(rr*r+ir*i,rr*i-ir*r),e.lineTo(rr*a+ir*l,rr*l-ir*a),e.lineTo(rr*u+ir*d,rr*d-ir*u),e.closePath()}};function yB(e,t){let n=null,r=xx(i);e=typeof e=="function"?e:rt(e||bx),t=typeof t=="function"?t:rt(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:rt(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:rt(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Rd(){}function Ld(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 NA(e){this._context=e}NA.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:Ld(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:Ld(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function bB(e){return new NA(e)}function kA(e){this._context=e}kA.prototype={areaStart:Rd,areaEnd:Rd,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:Ld(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function wB(e){return new kA(e)}function PA(e){this._context=e}PA.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:Ld(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function jB(e){return new PA(e)}function CA(e){this._context=e}CA.prototype={areaStart:Rd,areaEnd:Rd,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 SB(e){return new CA(e)}function wS(e){return e<0?-1:1}function jS(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),l=(n-e._y1)/(i||r<0&&-0),u=(a*i+l*r)/(r+i);return(wS(a)+wS(l))*Math.min(Math.abs(a),Math.abs(l),.5*Math.abs(u))||0}function SS(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Em(e,t,n){var r=e._x0,i=e._y0,a=e._x1,l=e._y1,u=(a-r)/3;e._context.bezierCurveTo(r+u,i+u*t,a-u,l-u*n,a,l)}function $d(e){this._context=e}$d.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:Em(this,this._t0,SS(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,Em(this,SS(this,n=jS(this,e,t)),n);break;default:Em(this,this._t0,n=jS(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function OA(e){this._context=new AA(e)}(OA.prototype=Object.create($d.prototype)).point=function(e,t){$d.prototype.point.call(this,t,e)};function AA(e){this._context=e}AA.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 NB(e){return new $d(e)}function kB(e){return new OA(e)}function EA(e){this._context=e}EA.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=NS(e),i=NS(t),a=0,l=1;l<n;++a,++l)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[l],t[l]);(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 NS(e){var t,n=e.length-1,r,i=new Array(n),a=new Array(n),l=new Array(n);for(i[0]=0,a[0]=2,l[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,l[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,l[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,l[t]-=r*l[t-1];for(i[n-1]=l[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(l[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 PB(e){return new EA(e)}function Lf(e,t){this._context=e,this._t=t}Lf.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 CB(e){return new Lf(e,.5)}function OB(e){return new Lf(e,0)}function AB(e){return new Lf(e,1)}function na(e,t){if((l=e.length)>1)for(var n=1,r,i,a=e[t[0]],l,u=a.length;n<l;++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 Dg(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function EB(e,t){return e[t]}function TB(e){const t=[];return t.key=e,t}function MB(){var e=rt([]),t=Dg,n=na,r=EB;function i(a){var l=Array.from(e.apply(this,arguments),TB),u,d=l.length,p=-1,h;for(const m of a)for(u=0,++p;u<d;++u)(l[u][p]=[0,+r(m,l[u].key,p,a)]).data=m;for(u=0,h=yx(t(l));u<d;++u)l[h[u]].index=u;return n(l,h),l}return i.keys=function(a){return arguments.length?(e=typeof a=="function"?a:rt(Array.from(a)),i):e},i.value=function(a){return arguments.length?(r=typeof a=="function"?a:rt(+a),i):r},i.order=function(a){return arguments.length?(t=a==null?Dg:typeof a=="function"?a:rt(Array.from(a)),i):t},i.offset=function(a){return arguments.length?(n=a??na,i):n},i}function _B(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,l;i<a;++i){for(l=n=0;n<r;++n)l+=e[n][i][1]||0;if(l)for(n=0;n<r;++n)e[n][i][1]/=l}na(e,t)}}function IB(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var l=0,u=0;l<i;++l)u+=e[l][n][1]||0;r[n][1]+=r[n][0]=-u/2}na(e,t)}}function DB(e,t){if(!(!((l=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,l;r<a;++r){for(var u=0,d=0,p=0;u<l;++u){for(var h=e[t[u]],m=h[r][1]||0,v=h[r-1][1]||0,x=(m-v)/2,w=0;w<u;++w){var S=e[t[w]],j=S[r][1]||0,k=S[r-1][1]||0;x+=j-k}d+=m,p+=x*m}i[r-1][1]+=i[r-1][0]=n,d&&(n-=p/d)}i[r-1][1]+=i[r-1][0]=n,na(e,t)}}var Tm={},Mm={},kS;function RB(){return kS||(kS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==="__proto__"}e.isUnsafeProperty=t})(Mm)),Mm}var _m={},PS;function TA(){return PS||(PS=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})(_m)),_m}var Im={},CS;function wx(){return CS||(CS=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})(Im)),Im}var Dm={},Rm={},OS;function LB(){return OS||(OS=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})(Rm)),Rm}var AS;function jx(){return AS||(AS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LB(),n=wx();function r(i){if(Array.isArray(i))return i.map(n.toKey);if(typeof i=="symbol")return[i];i=t.toString(i);const a=[],l=i.length;if(l===0)return a;let u=0,d="",p="",h=!1;for(i.charCodeAt(0)===46&&(a.push(""),u++);u<l;){const m=i[u];p?m==="\\"&&u+1<l?(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})(Dm)),Dm}var ES;function Sx(){return ES||(ES=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RB(),n=TA(),r=wx(),i=jx();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 l(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 l(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})(Tm)),Tm}var Lm,TS;function $B(){return TS||(TS=1,Lm=Sx().get),Lm}var zB=$B();const uo=ei(zB);var FB=4;function ds(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:FB,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function yt(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,l)=>{var u=n[l-1];return typeof u=="string"?i+u+a:u!==void 0?i+ds(u)+a:i+a},"")}var zn=e=>e===0?0:e>0?1:-1,Qr=e=>typeof e=="number"&&e!=+e,ra=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Ne=e=>(typeof e=="number"||e instanceof Number)&&!Qr(e),Jr=e=>Ne(e)||typeof e=="string",BB=0,Ql=e=>{var t=++BB;return"".concat(e||"").concat(t)},Ar=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(!Ne(t)&&typeof t!="string")return r;var a;if(ra(t)){if(n==null)return r;var l=t.indexOf("%");a=n*parseFloat(t.slice(0,l))/100}else a=+t;return Qr(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},MA=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 Zt(e,t,n){return Ne(e)&&Ne(t)?ds(e+n*(t-e)):t}function VB(e,t,n){if(!(!e||!e.length))return e.find(r=>r&&(typeof t=="function"?t(r):uo(r,t))===n)}var Ut=e=>e===null||typeof e>"u",xc=e=>Ut(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Wr(e){return e!=null}function Po(){}var UB=["type","size","sizeType"];function Rg(){return Rg=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},Rg.apply(null,arguments)}function MS(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 _S(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MS(Object(n),!0).forEach(function(r){WB(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WB(e,t,n){return(t=qB(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qB(e){var t=KB(e,"string");return typeof t=="symbol"?t:t+""}function KB(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 HB(e,t){if(e==null)return{};var n,r,i=GB(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 GB(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 _A={symbolCircle:bx,symbolCross:lB,symbolDiamond:uB,symbolSquare:dB,symbolStar:mB,symbolTriangle:gB,symbolWye:xB},YB=Math.PI/180,XB=e=>{var t="symbol".concat(xc(e));return _A[t]||bx},QB=(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*YB;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}},JB=(e,t)=>{_A["symbol".concat(xc(e))]=t},IA=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=HB(e,UB),a=_S(_S({},i),{},{type:t,size:n,sizeType:r}),l="circle";typeof t=="string"&&(l=t);var u=()=>{var v=XB(l),x=yB().type(v).size(QB(n,r,l)),w=x();if(w!==null)return w},{className:d,cx:p,cy:h}=a,m=ur(a);return Ne(p)&&Ne(h)&&Ne(n)?b.createElement("path",Rg({},m,{className:it("recharts-symbols",d),transform:"translate(".concat(p,", ").concat(h,")"),d:u()})):null};IA.registerSymbol=JB;var DA=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,ZB=(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=>{gx(i)&&(r[i]=(a=>n[i](n,a)))}),r},e7=(e,t,n)=>r=>(e(t,n,r),null),Nx=(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];gx(i)&&typeof a=="function"&&(r||(r={}),r[i]=e7(a,t,n))}),r};function IS(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 t7(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IS(Object(n),!0).forEach(function(r){n7(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n7(e,t,n){return(t=r7(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r7(e){var t=i7(e,"string");return typeof t=="symbol"?t:t+""}function i7(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 pr(e,t){var n=t7({},e),r=t,i=Object.keys(t),a=i.reduce((l,u)=>(l[u]===void 0&&r[u]!==void 0&&(l[u]=r[u]),l),n);return a}var $m={},zm={},DS;function s7(){return DS||(DS=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 l=n[a],u=r(l,a,n);i.has(u)||i.set(u,l)}return Array.from(i.values())}e.uniqBy=t})(zm)),zm}var Fm={},RS;function a7(){return RS||(RS=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})(Fm)),Fm}var Bm={},LS;function RA(){return LS||(LS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n}e.identity=t})(Bm)),Bm}var Vm={},Um={},Wm={},$S;function o7(){return $S||($S=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Number.isSafeInteger(n)&&n>=0}e.isLength=t})(Wm)),Wm}var zS;function kx(){return zS||(zS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=o7();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(Um)),Um}var qm={},FS;function l7(){return FS||(FS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(qm)),qm}var BS;function c7(){return BS||(BS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=kx(),n=l7();function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Vm)),Vm}var Km={},Hm={},VS;function u7(){return VS||(VS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Sx();function n(r){return function(i){return t.get(i,r)}}e.property=n})(Hm)),Hm}var Gm={},Ym={},Xm={},Qm={},US;function LA(){return US||(US=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})(Qm)),Qm}var Jm={},WS;function $A(){return WS||(WS=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})(Jm)),Jm}var Zm={},qS;function zA(){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})(Zm)),Zm}var KS;function d7(){return KS||(KS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LA(),n=$A(),r=zA();function i(h,m,v){return typeof v!="function"?i(h,m,()=>{}):a(h,m,function x(w,S,j,k,C,E){const O=v(w,S,j,k,C,E);return O!==void 0?!!O:a(w,S,x,E)},new Map)}function a(h,m,v,x){if(m===h)return!0;switch(typeof m){case"object":return l(h,m,v,x);case"function":return Object.keys(m).length>0?a(h,{...m},v,x):r.isEqualsSameValueZero(h,m);default:return t.isObject(h)?typeof m=="string"?m==="":!0:r.isEqualsSameValueZero(h,m)}}function l(h,m,v,x){if(m==null)return!0;if(Array.isArray(m))return d(h,m,v,x);if(m instanceof Map)return u(h,m,v,x);if(m instanceof Set)return p(h,m,v,x);const w=Object.keys(m);if(h==null||n.isPrimitive(h))return w.length===0;if(w.length===0)return!0;if(x!=null&&x.has(m))return x.get(m)===h;x==null||x.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||!v(h[j],m[j],j,h,m,x))return!1}return!0}finally{x==null||x.delete(m)}}function u(h,m,v,x){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(v(j,S,w,h,m,x)===!1)return!1}return!0}function d(h,m,v,x){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 O=!1;if(v(E,j,S,h,m,x)&&(O=!0),O){w.add(C),k=!0;break}}if(!k)return!1}return!0}function p(h,m,v,x){return m.size===0?!0:h instanceof Set?d([...h],[...m],v,x):!1}e.isMatchWith=i,e.isSetMatch=p})(Xm)),Xm}var HS;function FA(){return HS||(HS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=d7();function n(r,i){return t.isMatchWith(r,i,()=>{})}e.isMatch=n})(Ym)),Ym}var e0={},t0={},n0={},GS;function f7(){return GS||(GS=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})(n0)),n0}var r0={},YS;function Px(){return YS||(YS=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})(r0)),r0}var i0={},XS;function BA(){return XS||(XS=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]",l="[object Symbol]",u="[object Date]",d="[object Map]",p="[object Set]",h="[object Array]",m="[object Function]",v="[object ArrayBuffer]",x="[object Object]",w="[object Error]",S="[object DataView]",j="[object Uint8Array]",k="[object Uint8ClampedArray]",C="[object Uint16Array]",E="[object Uint32Array]",O="[object BigUint64Array]",P="[object Int8Array]",A="[object Int16Array]",M="[object Int32Array]",D="[object BigInt64Array]",$="[object Float32Array]",q="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=v,e.arrayTag=h,e.bigInt64ArrayTag=D,e.bigUint64ArrayTag=O,e.booleanTag=i,e.dataViewTag=S,e.dateTag=u,e.errorTag=w,e.float32ArrayTag=$,e.float64ArrayTag=q,e.functionTag=m,e.int16ArrayTag=A,e.int32ArrayTag=M,e.int8ArrayTag=P,e.mapTag=d,e.numberTag=r,e.objectTag=x,e.regexpTag=t,e.setTag=p,e.stringTag=n,e.symbolTag=l,e.uint16ArrayTag=C,e.uint32ArrayTag=E,e.uint8ArrayTag=j,e.uint8ClampedArrayTag=k})(i0)),i0}var s0={},QS;function p7(){return QS||(QS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(s0)),s0}var JS;function VA(){return JS||(JS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=f7(),n=Px(),r=BA(),i=$A(),a=p7();function l(h,m){return u(h,void 0,h,new Map,m)}function u(h,m,v,x=new Map,w=void 0){const S=w==null?void 0:w(h,m,v,x);if(S!==void 0)return S;if(i.isPrimitive(h))return h;if(x.has(h))return x.get(h);if(Array.isArray(h)){const j=new Array(h.length);x.set(h,j);for(let k=0;k<h.length;k++)j[k]=u(h[k],k,v,x,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;x.set(h,j);for(const[k,C]of h)j.set(k,u(C,k,v,x,w));return j}if(h instanceof Set){const j=new Set;x.set(h,j);for(const k of h)j.add(u(k,void 0,v,x,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);x.set(h,j);for(let k=0;k<h.length;k++)j[k]=u(h[k],k,v,x,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 x.set(h,j),d(j,h,v,x,w),j}if(typeof File<"u"&&h instanceof File){const j=new File([h],h.name,{type:h.type});return x.set(h,j),d(j,h,v,x,w),j}if(typeof Blob<"u"&&h instanceof Blob){const j=new Blob([h],{type:h.type});return x.set(h,j),d(j,h,v,x,w),j}if(h instanceof Error){const j=new h.constructor;return x.set(h,j),j.message=h.message,j.name=h.name,j.stack=h.stack,j.cause=h.cause,d(j,h,v,x,w),j}if(h instanceof Boolean){const j=new Boolean(h.valueOf());return x.set(h,j),d(j,h,v,x,w),j}if(h instanceof Number){const j=new Number(h.valueOf());return x.set(h,j),d(j,h,v,x,w),j}if(h instanceof String){const j=new String(h.valueOf());return x.set(h,j),d(j,h,v,x,w),j}if(typeof h=="object"&&p(h)){const j=Object.create(Object.getPrototypeOf(h));return x.set(h,j),d(j,h,v,x,w),j}return h}function d(h,m,v=h,x,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,v,x,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=l,e.cloneDeepWithImpl=u,e.copyProperties=d})(t0)),t0}var ZS;function h7(){return ZS||(ZS=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VA();function n(r){return t.cloneDeepWithImpl(r,void 0,r,new Map,void 0)}e.cloneDeep=n})(e0)),e0}var eN;function m7(){return eN||(eN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=FA(),n=h7();function r(i){return i=n.cloneDeep(i),a=>t.isMatch(a,i)}e.matches=r})(Gm)),Gm}var a0={},o0={},l0={},tN;function g7(){return tN||(tN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VA(),n=Px(),r=BA();function i(a,l){return t.cloneDeepWith(a,(u,d,p,h)=>{const m=l==null?void 0:l(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 v={};return h.set(a,v),t.copyProperties(v,a,p,h),v}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const v=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(v,a),v}case r.argumentsTag:{const v={};return t.copyProperties(v,a),v.length=a.length,v[Symbol.iterator]=a[Symbol.iterator],v}default:return}}})}e.cloneDeepWith=i})(l0)),l0}var nN;function v7(){return nN||(nN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=g7();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(o0)),o0}var c0={},u0={},rN;function UA(){return rN||(rN=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})(u0)),u0}var d0={},iN;function x7(){return iN||(iN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Px();function n(r){return r!==null&&typeof r=="object"&&t.getTag(r)==="[object Arguments]"}e.isArguments=n})(d0)),d0}var sN;function y7(){return sN||(sN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TA(),n=UA(),r=x7(),i=jx();function a(l,u){let d;if(Array.isArray(u)?d=u:typeof u=="string"&&t.isDeepKey(u)&&(l==null?void 0:l[u])==null?d=i.toPath(u):d=[u],d.length===0)return!1;let p=l;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})(c0)),c0}var aN;function b7(){return aN||(aN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=FA(),n=wx(),r=v7(),i=Sx(),a=y7();function l(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=l})(a0)),a0}var oN;function w7(){return oN||(oN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=RA(),n=u7(),r=m7(),i=b7();function a(l){if(l==null)return t.identity;switch(typeof l){case"function":return l;case"object":return Array.isArray(l)&&l.length===2?i.matchesProperty(l[0],l[1]):r.matches(l);case"string":case"symbol":case"number":return n.property(l)}}e.iteratee=a})(Km)),Km}var lN;function j7(){return lN||(lN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=s7(),n=a7(),r=RA(),i=c7(),a=w7();function l(u,d=r.identity){return i.isArrayLikeObject(u)?t.uniqBy(Array.from(u),n.ary(a.iteratee(d),1)):[]}e.uniqBy=l})($m)),$m}var f0,cN;function S7(){return cN||(cN=1,f0=j7().uniqBy),f0}var N7=S7();const uN=ei(N7);function k7(e,t,n){return t===!0?uN(e,n):typeof t=="function"?uN(e,t):e}var p0={exports:{}},h0={},m0={exports:{}},g0={};/**
|
|
291
|
-
* @license React
|
|
292
|
-
* use-sync-external-store-shim.production.js
|
|
293
|
-
*
|
|
294
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
295
|
-
*
|
|
296
|
-
* This source code is licensed under the MIT license found in the
|
|
297
|
-
* LICENSE file in the root directory of this source tree.
|
|
298
|
-
*/var dN;function P7(){if(dN)return g0;dN=1;var e=bo();function t(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function u(m,v){var x=v(),w=r({inst:{value:x,getSnapshot:v}}),S=w[0].inst,j=w[1];return a(function(){S.value=x,S.getSnapshot=v,d(S)&&j({inst:S})},[m,x,v]),i(function(){return d(S)&&j({inst:S}),m(function(){d(S)&&j({inst:S})})},[m]),l(x),x}function d(m){var v=m.getSnapshot;m=m.value;try{var x=v();return!n(m,x)}catch{return!0}}function p(m,v){return v()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:u;return g0.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,g0}var fN;function C7(){return fN||(fN=1,m0.exports=P7()),m0.exports}/**
|
|
299
|
-
* @license React
|
|
300
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
301
|
-
*
|
|
302
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
303
|
-
*
|
|
304
|
-
* This source code is licensed under the MIT license found in the
|
|
305
|
-
* LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/var pN;function O7(){if(pN)return h0;pN=1;var e=bo(),t=C7();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,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return h0.useSyncExternalStoreWithSelector=function(p,h,m,v,x){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(A){if(!C){if(C=!0,E=A,A=v(A),x!==void 0&&S.hasValue){var M=S.value;if(x(M,A))return O=M}return O=A}if(M=O,r(E,A))return M;var D=v(A);return x!==void 0&&x(M,D)?(E=A,M):(E=A,O=D)}var C=!1,E,O,P=m===void 0?null:m;return[function(){return k(h())},P===null?void 0:function(){return k(P())}]},[h,m,v,x]);var j=i(p,w[0],w[1]);return l(function(){S.hasValue=!0,S.value=j},[j]),d(j),j},h0}var hN;function A7(){return hN||(hN=1,p0.exports=O7()),p0.exports}var E7=A7(),Cx=b.createContext(null),T7=e=>e,Nt=()=>{var e=b.useContext(Cx);return e?e.store.dispatch:T7},gd=()=>{},M7=()=>gd,_7=(e,t)=>e===t;function Ae(e){var t=b.useContext(Cx),n=b.useMemo(()=>t?r=>{if(r!=null)return e(r)}:gd,[t,e]);return E7.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:M7,t?t.store.getState:gd,t?t.store.getState:gd,n,_7)}function I7(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function D7(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function R7(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 mN=e=>Array.isArray(e)?e:[e];function L7(e){const t=Array.isArray(e[0])?e[0]:e;return R7(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function $7(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var z7=class{constructor(e){this.value=e}deref(){return this.value}},F7=typeof WeakRef<"u"?WeakRef:z7,B7=0,gN=1;function Yu(){return{s:B7,v:void 0,o:null,p:null}}function WA(e,t={}){let n=Yu();const{resultEqualityCheck:r}=t;let i,a=0;function l(){var m;let u=n;const{length:d}=arguments;for(let v=0,x=d;v<x;v++){const w=arguments[v];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=Yu(),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=Yu(),S.set(w,u)):u=j}}const p=u;let h;if(u.s===gN)h=u.v;else if(h=e.apply(null,arguments),a++,r){const v=((m=i==null?void 0:i.deref)==null?void 0:m.call(i))??i;v!=null&&r(v,h)&&(h=v,a!==0&&a--),i=typeof h=="object"&&h!==null||typeof h=="function"?new F7(h):h}return p.s=gN,p.v=h,h}return l.clearCache=()=>{n=Yu(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}function V7(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,l=0,u,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),I7(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const h={...n,...d},{memoize:m,memoizeOptions:v=[],argsMemoize:x=WA,argsMemoizeOptions:w=[]}=h,S=mN(v),j=mN(w),k=L7(i),C=m(function(){return a++,p.apply(null,arguments)},...S),E=x(function(){l++;const P=$7(k,arguments);return u=C.apply(null,P),u},...j);return Object.assign(E,{resultFunc:p,memoizedResultFunc:C,dependencies:k,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:x})};return Object.assign(r,{withTypes:()=>r}),r}var Q=V7(WA),U7=Object.assign((e,t=Q)=>{D7(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((l,u,d)=>(l[n[d]]=u,l),{}))},{withTypes:()=>U7}),v0={},x0={},y0={},vN;function W7(){return vN||(vN=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 l=t(r),u=t(i);if(l===u&&l===0){if(r<i)return a==="desc"?1:-1;if(r>i)return a==="desc"?-1:1}return a==="desc"?u-l:l-u}return 0};e.compareValues=n})(y0)),y0}var b0={},w0={},xN;function qA(){return xN||(xN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(w0)),w0}var yN;function q7(){return yN||(yN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=qA(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,l){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))||l!=null&&Object.hasOwn(l,a)}e.isKey=i})(b0)),b0}var bN;function K7(){return bN||(bN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=W7(),n=q7(),r=jx();function i(a,l,u,d){if(a==null)return[];u=d?void 0:u,Array.isArray(a)||(a=Object.values(a)),Array.isArray(l)||(l=l==null?[null]:[l]),l.length===0&&(l=[null]),Array.isArray(u)||(u=u==null?[]:[u]),u=u.map(x=>String(x));const p=(x,w)=>{let S=x;for(let j=0;j<w.length&&S!=null;++j)S=S[w[j]];return S},h=(x,w)=>w==null||x==null?w:typeof x=="object"&&"key"in x?Object.hasOwn(w,x.key)?w[x.key]:p(w,x.path):typeof x=="function"?x(w):Array.isArray(x)?p(w,x):typeof w=="object"?w[x]:w,m=l.map(x=>(Array.isArray(x)&&x.length===1&&(x=x[0]),x==null||typeof x=="function"||Array.isArray(x)||n.isKey(x)?x:{key:x,path:r.toPath(x)}));return a.map(x=>({original:x,criteria:m.map(w=>h(w,x))})).slice().sort((x,w)=>{for(let S=0;S<m.length;S++){const j=t.compareValues(x.criteria[S],w.criteria[S],u[S]);if(j!==0)return j}return 0}).map(x=>x.original)}e.orderBy=i})(x0)),x0}var j0={},wN;function H7(){return wN||(wN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),l=(u,d)=>{for(let p=0;p<u.length;p++){const h=u[p];Array.isArray(h)&&d<a?l(h,d+1):i.push(h)}};return l(n,0),i}e.flatten=t})(j0)),j0}var S0={},jN;function KA(){return jN||(jN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=UA(),n=kx(),r=LA(),i=zA();function a(l,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],l):!1}e.isIterateeCall=a})(S0)),S0}var SN;function G7(){return SN||(SN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=K7(),n=H7(),r=KA();function i(a,...l){const u=l.length;return u>1&&r.isIterateeCall(a,l[0],l[1])?l=[]:u>2&&r.isIterateeCall(l[0],l[1],l[2])&&(l=[l[0]]),t.orderBy(a,n.flatten(l),["asc"])}e.sortBy=i})(v0)),v0}var N0,NN;function Y7(){return NN||(NN=1,N0=G7().sortBy),N0}var X7=Y7();const $f=ei(X7);var HA=e=>e.legend.settings,Q7=e=>e.legend.size,J7=e=>e.legend.payload;Q([J7,HA],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?$f(r,n):r});var Xu=1;function Z7(){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(),l={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(l.height-t.height)>Xu||Math.abs(l.left-t.left)>Xu||Math.abs(l.top-t.top)>Xu||Math.abs(l.width-t.width)>Xu)&&n({height:l.height,left:l.left,top:l.top,width:l.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function Xt(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 e8=typeof Symbol=="function"&&Symbol.observable||"@@observable",kN=e8,k0=()=>Math.random().toString(36).substring(7).split("").join("."),t8={INIT:`@@redux/INIT${k0()}`,REPLACE:`@@redux/REPLACE${k0()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${k0()}`},zd=t8;function Ox(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 GA(e,t,n){if(typeof e!="function")throw new Error(Xt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Xt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Xt(1));return n(GA)(e,t)}let r=e,i=t,a=new Map,l=a,u=0,d=!1;function p(){l===a&&(l=new Map,a.forEach((j,k)=>{l.set(k,j)}))}function h(){if(d)throw new Error(Xt(3));return i}function m(j){if(typeof j!="function")throw new Error(Xt(4));if(d)throw new Error(Xt(5));let k=!0;p();const C=u++;return l.set(C,j),function(){if(k){if(d)throw new Error(Xt(6));k=!1,p(),l.delete(C),a=null}}}function v(j){if(!Ox(j))throw new Error(Xt(7));if(typeof j.type>"u")throw new Error(Xt(8));if(typeof j.type!="string")throw new Error(Xt(17));if(d)throw new Error(Xt(9));try{d=!0,i=r(i,j)}finally{d=!1}return(a=l).forEach(C=>{C()}),j}function x(j){if(typeof j!="function")throw new Error(Xt(10));r=j,v({type:zd.REPLACE})}function w(){const j=m;return{subscribe(k){if(typeof k!="object"||k===null)throw new Error(Xt(11));function C(){const O=k;O.next&&O.next(h())}return C(),{unsubscribe:j(C)}},[kN](){return this}}}return v({type:zd.INIT}),{dispatch:v,subscribe:m,getState:h,replaceReducer:x,[kN]:w}}function n8(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:zd.INIT})>"u")throw new Error(Xt(12));if(typeof n(void 0,{type:zd.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Xt(13))})}function YA(e){const t=Object.keys(e),n={};for(let a=0;a<t.length;a++){const l=t[a];typeof e[l]=="function"&&(n[l]=e[l])}const r=Object.keys(n);let i;try{n8(n)}catch(a){i=a}return function(l={},u){if(i)throw i;let d=!1;const p={};for(let h=0;h<r.length;h++){const m=r[h],v=n[m],x=l[m],w=v(x,u);if(typeof w>"u")throw u&&u.type,new Error(Xt(14));p[m]=w,d=d||w!==x}return d=d||r.length!==Object.keys(l).length,d?p:l}}function Fd(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function r8(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(Xt(15))};const l={getState:i.getState,dispatch:(d,...p)=>a(d,...p)},u=e.map(d=>d(l));return a=Fd(...u)(i.dispatch),{...i,dispatch:a}}}function XA(e){return Ox(e)&&"type"in e&&typeof e.type=="string"}var QA=Symbol.for("immer-nothing"),PN=Symbol.for("immer-draftable"),gn=Symbol.for("immer-state");function kr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Fn=Object,fo=Fn.getPrototypeOf,Bd="constructor",zf="prototype",Lg="configurable",Vd="enumerable",vd="writable",Jl="value",ji=e=>!!e&&!!e[gn];function Er(e){var t;return e?JA(e)||Bf(e)||!!e[PN]||!!((t=e[Bd])!=null&&t[PN])||Vf(e)||Uf(e):!1}var i8=Fn[zf][Bd].toString(),CN=new WeakMap;function JA(e){if(!e||!Ax(e))return!1;const t=fo(e);if(t===null||t===Fn[zf])return!0;const n=Fn.hasOwnProperty.call(t,Bd)&&t[Bd];if(n===Object)return!0;if(!Wa(n))return!1;let r=CN.get(n);return r===void 0&&(r=Function.toString.call(n),CN.set(n,r)),r===i8}function Ff(e,t,n=!0){yc(e)===0?(n?Reflect.ownKeys(e):Fn.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function yc(e){const t=e[gn];return t?t.type_:Bf(e)?1:Vf(e)?2:Uf(e)?3:0}var ON=(e,t,n=yc(e))=>n===2?e.has(t):Fn[zf].hasOwnProperty.call(e,t),$g=(e,t,n=yc(e))=>n===2?e.get(t):e[t],Ud=(e,t,n,r=yc(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function s8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Bf=Array.isArray,Vf=e=>e instanceof Map,Uf=e=>e instanceof Set,Ax=e=>typeof e=="object",Wa=e=>typeof e=="function",P0=e=>typeof e=="boolean";function a8(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var fi=e=>e.copy_||e.base_,Ex=e=>e.modified_?e.copy_:e.base_;function zg(e,t){if(Vf(e))return new Map(e);if(Uf(e))return new Set(e);if(Bf(e))return Array[zf].slice.call(e);const n=JA(e);if(t===!0||t==="class_only"&&!n){const r=Fn.getOwnPropertyDescriptors(e);delete r[gn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u[vd]===!1&&(u[vd]=!0,u[Lg]=!0),(u.get||u.set)&&(r[l]={[Lg]:!0,[vd]:!0,[Vd]:u[Vd],[Jl]:e[l]})}return Fn.create(fo(e),r)}else{const r=fo(e);if(r!==null&&n)return{...e};const i=Fn.create(r);return Fn.assign(i,e)}}function Tx(e,t=!1){return Wf(e)||ji(e)||!Er(e)||(yc(e)>1&&Fn.defineProperties(e,{set:Qu,add:Qu,clear:Qu,delete:Qu}),Fn.freeze(e),t&&Ff(e,(n,r)=>{Tx(r,!0)},!1)),e}function o8(){kr(2)}var Qu={[Jl]:o8};function Wf(e){return e===null||!Ax(e)?!0:Fn.isFrozen(e)}var Wd="MapSet",Fg="Patches",AN="ArrayMethods",ZA={};function ia(e){const t=ZA[e];return t||kr(0,e),t}var EN=e=>!!ZA[e],Zl,eE=()=>Zl,l8=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:EN(Wd)?ia(Wd):void 0,arrayMethodsPlugin_:EN(AN)?ia(AN):void 0});function TN(e,t){t&&(e.patchPlugin_=ia(Fg),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bg(e){Vg(e),e.drafts_.forEach(c8),e.drafts_=null}function Vg(e){e===Zl&&(Zl=e.parent_)}var MN=e=>Zl=l8(Zl,e);function c8(e){const t=e[gn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _N(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[gn].modified_&&(Bg(t),kr(4)),Er(e)&&(e=IN(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[gn].base_,e,t)}else e=IN(t,n);return u8(t,e,!0),Bg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==QA?e:void 0}function IN(e,t){if(Wf(t))return t;const n=t[gn];if(!n)return qd(t,e.handledSet_,e);if(!qf(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);rE(n,e)}return n.copy_}function u8(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tx(t,n)}function tE(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var qf=(e,t)=>e.scope_===t,d8=[];function nE(e,t,n,r){const i=fi(e),a=e.type_;if(r!==void 0&&$g(i,r,a)===t){Ud(i,r,n,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;Ff(i,(d,p)=>{if(ji(p)){const h=u.get(p)||[];h.push(d),u.set(p,h)}})}const l=e.draftLocations_.get(t)??d8;for(const u of l)Ud(i,u,n,a)}function f8(e,t,n){e.callbacks_.push(function(i){var u;const a=t;if(!a||!qf(a,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(a);const l=Ex(a);nE(e,a.draft_??a,l,n),rE(a,i)})}function rE(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)}tE(e)}}function p8(e,t,n){const{scope_:r}=e;if(ji(n)){const i=n[gn];qf(i,r)&&i.callbacks_.push(function(){xd(e);const l=Ex(i);nE(e,n,l,t)})}else Er(n)&&e.callbacks_.push(function(){const a=fi(e);e.type_===3?a.has(n)&&qd(n,r.handledSet_,r):$g(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&qd($g(e.copy_,t,e.type_),r.handledSet_,r)})}function qd(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||ji(e)||t.has(e)||!Er(e)||Wf(e)||(t.add(e),Ff(e,(r,i)=>{if(ji(i)){const a=i[gn];if(qf(a,n)){const l=Ex(a);Ud(e,r,l,e.type_),tE(a)}}else Er(i)&&qd(i,t,n)})),e}function h8(e,t){const n=Bf(e),r={type_:n?1:0,scope_:t?t.scope_:eE(),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=Kd;n&&(i=[r],a=ec);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,[u,r]}var Kd={get(e,t){if(t===gn)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=fi(e);if(!ON(i,t,e.type_))return m8(e,i,t);const a=i[t];if(e.finalized_||!Er(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&a8(t))return a;if(a===C0(e.base_,t)){xd(e);const l=e.type_===1?+t:t,u=Wg(e.scope_,a,e,l);return e.copy_[l]=u}return a},has(e,t){return t in fi(e)},ownKeys(e){return Reflect.ownKeys(fi(e))},set(e,t,n){const r=iE(fi(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=C0(fi(e),t),a=i==null?void 0:i[gn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(s8(n,i)&&(n!==void 0||ON(e.base_,t,e.type_)))return!0;xd(e),Ug(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),p8(e,t,n)),!0},deleteProperty(e,t){return xd(e),C0(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ug(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=fi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[vd]:!0,[Lg]:e.type_!==1||t!=="length",[Vd]:r[Vd],[Jl]:n[t]}},defineProperty(){kr(11)},getPrototypeOf(e){return fo(e.base_)},setPrototypeOf(){kr(12)}},ec={};for(let e in Kd){let t=Kd[e];ec[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ec.deleteProperty=function(e,t){return ec.set.call(this,e,t,void 0)};ec.set=function(e,t,n){return Kd.set.call(this,e[0],t,n,e[0])};function C0(e,t){const n=e[gn];return(n?fi(n):e)[t]}function m8(e,t,n){var i;const r=iE(t,n);return r?Jl in r?r[Jl]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function iE(e,t){if(!(t in e))return;let n=fo(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=fo(n)}}function Ug(e){e.modified_||(e.modified_=!0,e.parent_&&Ug(e.parent_))}function xd(e){e.copy_||(e.assigned_=new Map,e.copy_=zg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var g8=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(Wa(n)&&!Wa(r)){const l=r;r=n;const u=this;return function(p=l,...h){return u.produce(p,m=>r.call(this,m,...h))}}Wa(r)||kr(6),i!==void 0&&!Wa(i)&&kr(7);let a;if(Er(n)){const l=MN(this),u=Wg(l,n,void 0);let d=!0;try{a=r(u),d=!1}finally{d?Bg(l):Vg(l)}return TN(l,i),_N(a,l)}else if(!n||!Ax(n)){if(a=r(n),a===void 0&&(a=n),a===QA&&(a=void 0),this.autoFreeze_&&Tx(a,!0),i){const l=[],u=[];ia(Fg).generateReplacementPatches_(n,a,{patches_:l,inversePatches_:u}),i(l,u)}return a}else kr(1,n)},this.produceWithPatches=(n,r)=>{if(Wa(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]},P0(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),P0(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),P0(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Er(t)||kr(8),ji(t)&&(t=Or(t));const n=MN(this),r=Wg(n,t,void 0);return r[gn].isManual_=!0,Vg(n),r}finishDraft(t,n){const r=t&&t[gn];(!r||!r.isManual_)&&kr(9);const{scope_:i}=r;return TN(i,n),_N(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=ia(Fg).applyPatches_;return ji(t)?i(t,n):this.produce(t,a=>i(a,n))}};function Wg(e,t,n,r){const[i,a]=Vf(t)?ia(Wd).proxyMap_(t,n):Uf(t)?ia(Wd).proxySet_(t,n):h8(t,n);return((n==null?void 0:n.scope_)??eE()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?f8(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 Or(e){return ji(e)||kr(10,e),sE(e)}function sE(e){if(!Er(e)||Wf(e))return e;const t=e[gn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=zg(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=zg(e,!0);return Ff(n,(i,a)=>{Ud(n,i,sE(a))},r),t&&(t.finalized_=!1),n}var v8=new g8,aE=v8.produce;function oE(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var x8=oE(),y8=oE,b8=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Fd:Fd.apply(null,arguments)};function dr(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Vn(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=>XA(r)&&r.type===e,n}var lE=class Il extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Il.prototype)}static get[Symbol.species](){return Il}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Il(...t[0].concat(this)):new Il(...t.concat(this))}};function DN(e){return Er(e)?aE(e,()=>{}):e}function Ju(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function w8(e){return typeof e=="boolean"}var j8=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let l=new lE;return n&&(w8(n)?l.push(x8):l.push(y8(n.extraArgument))),l},cE="RTK_autoBatch",dt=()=>e=>({payload:e,meta:{[cE]:!0}}),RN=e=>t=>{setTimeout(t,e)},uE=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,l=!1;const u=new Set,d=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:RN(10):e.type==="callback"?e.queueNotification:RN(e.timeout),p=()=>{l=!1,a&&(a=!1,u.forEach(h=>h()))};return Object.assign({},r,{subscribe(h){const m=()=>i&&h(),v=r.subscribe(m);return u.add(h),()=>{v(),u.delete(h)}},dispatch(h){var m;try{return i=!((m=h==null?void 0:h.meta)!=null&&m[cE]),a=!i,a&&(l||(l=!0,d(p))),r.dispatch(h)}finally{i=!0}}})},S8=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new lE(e);return r&&i.push(uE(typeof r=="object"?r:void 0)),i};function N8(e){const t=j8(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:l=void 0}=e||{};let u;if(typeof n=="function")u=n;else if(Ox(n))u=YA(n);else throw new Error(Vn(1));let d;typeof r=="function"?d=r(t):d=t();let p=Fd;i&&(p=b8({trace:!1,...typeof i=="object"&&i}));const h=r8(...d),m=S8(h);let v=typeof l=="function"?l(m):m();const x=p(...v);return GA(u,a,x)}function dE(e){const t={},n=[];let r;const i={addCase(a,l){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(Vn(28));if(u in t)throw new Error(Vn(29));return t[u]=l,i},addAsyncThunk(a,l){return l.pending&&(t[a.pending.type]=l.pending),l.rejected&&(t[a.rejected.type]=l.rejected),l.fulfilled&&(t[a.fulfilled.type]=l.fulfilled),l.settled&&n.push({matcher:a.settled,reducer:l.settled}),i},addMatcher(a,l){return n.push({matcher:a,reducer:l}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function k8(e){return typeof e=="function"}function P8(e,t){let[n,r,i]=dE(t),a;if(k8(e))a=()=>DN(e());else{const u=DN(e);a=()=>u}function l(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(ji(h)){const x=m(h,d);return x===void 0?h:x}else{if(Er(h))return aE(h,v=>m(v,d));{const v=m(h,d);if(v===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return h},u)}return l.getInitialState=a,l}var C8="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",O8=(e=21)=>{let t="",n=e;for(;n--;)t+=C8[Math.random()*64|0];return t},A8=Symbol.for("rtk-slice-createasyncthunk");function E8(e,t){return`${e}/${t}`}function T8({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[A8];return function(i){const{name:a,reducerPath:l=a}=i;if(!a)throw new Error(Vn(11));const u=(typeof i.reducers=="function"?i.reducers(_8()):i.reducers)||{},d=Object.keys(u),p={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(O,P){const A=typeof O=="string"?O:O.type;if(!A)throw new Error(Vn(12));if(A in p.sliceCaseReducersByType)throw new Error(Vn(13));return p.sliceCaseReducersByType[A]=P,h},addMatcher(O,P){return p.sliceMatchers.push({matcher:O,reducer:P}),h},exposeAction(O,P){return p.actionCreators[O]=P,h},exposeCaseReducer(O,P){return p.sliceCaseReducersByName[O]=P,h}};d.forEach(O=>{const P=u[O],A={reducerName:O,type:E8(a,O),createNotation:typeof i.reducers=="function"};D8(P)?L8(A,P,h,t):I8(A,P,h)});function m(){const[O={},P=[],A=void 0]=typeof i.extraReducers=="function"?dE(i.extraReducers):[i.extraReducers],M={...O,...p.sliceCaseReducersByType};return P8(i.initialState,D=>{for(let $ in M)D.addCase($,M[$]);for(let $ of p.sliceMatchers)D.addMatcher($.matcher,$.reducer);for(let $ of P)D.addMatcher($.matcher,$.reducer);A&&D.addDefaultCase(A)})}const v=O=>O,x=new Map,w=new WeakMap;let S;function j(O,P){return S||(S=m()),S(O,P)}function k(){return S||(S=m()),S.getInitialState()}function C(O,P=!1){function A(D){let $=D[O];return typeof $>"u"&&P&&($=Ju(w,A,k)),$}function M(D=v){const $=Ju(x,P,()=>new WeakMap);return Ju($,D,()=>{const q={};for(const[X,L]of Object.entries(i.selectors??{}))q[X]=M8(L,D,()=>Ju(w,D,k),P);return q})}return{reducerPath:O,getSelectors:M,get selectors(){return M(A)},selectSlice:A}}const E={name:a,reducer:j,actions:p.actionCreators,caseReducers:p.sliceCaseReducersByName,getInitialState:k,...C(l),injectInto(O,{reducerPath:P,...A}={}){const M=P??l;return O.inject({reducerPath:M,reducer:j},A),{...E,...C(M,!0)}}};return E}}function M8(e,t,n,r){function i(a,...l){let u=t(a);return typeof u>"u"&&r&&(u=n()),e(u,...l)}return i.unwrapped=e,i}var Tn=T8();function _8(){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 I8({type:e,reducerName:t,createNotation:n},r,i){let a,l;if("reducer"in r){if(n&&!R8(r))throw new Error(Vn(17));a=r.reducer,l=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,l?dr(e,l):dr(e))}function D8(e){return e._reducerDefinitionType==="asyncThunk"}function R8(e){return e._reducerDefinitionType==="reducerWithPrepare"}function L8({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Vn(18));const{payloadCreator:a,fulfilled:l,pending:u,rejected:d,settled:p,options:h}=n,m=i(e,a,h);r.exposeAction(t,m),l&&r.addCase(m.fulfilled,l),u&&r.addCase(m.pending,u),d&&r.addCase(m.rejected,d),p&&r.addMatcher(m.settled,p),r.exposeCaseReducer(t,{fulfilled:l||Zu,pending:u||Zu,rejected:d||Zu,settled:p||Zu})}function Zu(){}var $8="task",fE="listener",pE="completed",Mx="cancelled",z8=`task-${Mx}`,F8=`task-${pE}`,qg=`${fE}-${Mx}`,B8=`${fE}-${pE}`,Kf=class{constructor(e){nm(this,"name","TaskAbortError");nm(this,"message");this.code=e,this.message=`${$8} ${Mx} (reason: ${e})`}},_x=(e,t)=>{if(typeof e!="function")throw new TypeError(Vn(32))},Hd=()=>{},hE=(e,t=Hd)=>(e.catch(t),e),mE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Js=e=>{if(e.aborted)throw new Kf(e.reason)};function gE(e,t){let n=Hd;return new Promise((r,i)=>{const a=()=>i(new Kf(e.reason));if(e.aborted){a();return}n=mE(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Hd})}var V8=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof Kf?"cancelled":"rejected",error:n}}finally{t==null||t()}},Gd=e=>t=>hE(gE(e,t).then(n=>(Js(e),n))),vE=e=>{const t=Gd(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:no}=Object,LN={},Hf="listenerMiddleware",U8=(e,t)=>{const n=r=>mE(e,()=>r.abort(e.reason));return(r,i)=>{_x(r);const a=new AbortController;n(a);const l=V8(async()=>{Js(e),Js(a.signal);const u=await r({pause:Gd(a.signal),delay:vE(a.signal),signal:a.signal});return Js(a.signal),u},()=>a.abort(F8));return i!=null&&i.autoJoin&&t.push(l.catch(Hd)),{result:Gd(e)(l),cancel(){a.abort(z8)}}}},W8=(e,t)=>{const n=async(r,i)=>{Js(t);let a=()=>{};const u=[new Promise((d,p)=>{let h=e({predicate:r,effect:(m,v)=>{v.unsubscribe(),d([m,v.getState(),v.getOriginalState()])}});a=()=>{h(),p()}})];i!=null&&u.push(new Promise(d=>setTimeout(d,i,null)));try{const d=await gE(t,Promise.race(u));return Js(t),d}finally{a()}};return(r,i)=>hE(n(r,i))},xE=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=dr(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Vn(21));return _x(a),{predicate:i,type:t,effect:a}},yE=no(e=>{const{type:t,predicate:n,effect:r}=xE(e);return{id:O8(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Vn(22))}}},{withTypes:()=>yE}),$N=(e,t)=>{const{type:n,effect:r,predicate:i}=xE(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Kg=e=>{e.pending.forEach(t=>{t.abort(qg)})},q8=(e,t)=>()=>{for(const n of t.keys())Kg(n);e.clear()},zN=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},bE=no(dr(`${Hf}/add`),{withTypes:()=>bE}),K8=dr(`${Hf}/removeAll`),wE=no(dr(`${Hf}/remove`),{withTypes:()=>wE}),H8=(...e)=>{console.error(`${Hf}/error`,...e)},bc=(e={})=>{const t=new Map,n=new Map,r=x=>{const w=n.get(x)??0;n.set(x,w+1)},i=x=>{const w=n.get(x)??1;w===1?n.delete(x):n.set(x,w-1)},{extra:a,onError:l=H8}=e;_x(l);const u=x=>(x.unsubscribe=()=>t.delete(x.id),t.set(x.id,x),w=>{x.unsubscribe(),w!=null&&w.cancelActive&&Kg(x)}),d=x=>{const w=$N(t,x)??yE(x);return u(w)};no(d,{withTypes:()=>d});const p=x=>{const w=$N(t,x);return w&&(w.unsubscribe(),x.cancelActive&&Kg(w)),!!w};no(p,{withTypes:()=>p});const h=async(x,w,S,j)=>{const k=new AbortController,C=W8(d,k.signal),E=[];try{x.pending.add(k),r(x),await Promise.resolve(x.effect(w,no({},S,{getOriginalState:j,condition:(O,P)=>C(O,P).then(Boolean),take:C,delay:vE(k.signal),pause:Gd(k.signal),extra:a,signal:k.signal,fork:U8(k.signal,E),unsubscribe:x.unsubscribe,subscribe:()=>{t.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((O,P,A)=>{O!==k&&(O.abort(qg),A.delete(O))})},cancel:()=>{k.abort(qg),x.pending.delete(k)},throwIfCancelled:()=>{Js(k.signal)}})))}catch(O){O instanceof Kf||zN(l,O,{raisedBy:"effect"})}finally{await Promise.all(E),k.abort(B8),i(x),x.pending.delete(k)}},m=q8(t,n);return{middleware:x=>w=>S=>{if(!XA(S))return w(S);if(bE.match(S))return d(S.payload);if(K8.match(S)){m();return}if(wE.match(S))return p(S.payload);let j=x.getState();const k=()=>{if(j===LN)throw new Error(Vn(23));return j};let C;try{if(C=w(S),t.size>0){const E=x.getState(),O=Array.from(t.values());for(const P of O){let A=!1;try{A=P.predicate(S,E,j)}catch(M){A=!1,zN(l,M,{raisedBy:"predicate"})}A&&h(P,S,x,k)}}}finally{j=LN}return C},startListening:d,stopListening:p,clearListeners:m}};function Vn(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 G8={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},jE=Tn({name:"chartLayout",initialState:G8,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:Y8,setLayout:X8,setChartSize:Q8,setScale:J8}=jE.actions,Z8=jE.reducer;function SE(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function qe(e){return Number.isFinite(e)}function ys(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function FN(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 Ja(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?FN(Object(n),!0).forEach(function(r){eV(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function eV(e,t,n){return(t=tV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tV(e){var t=nV(e,"string");return typeof t=="symbol"?t:t+""}function nV(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 tn(e,t,n){return Ut(e)||Ut(t)?n:Jr(t)?uo(e,t,n):typeof t=="function"?t(e):n}var rV=(e,t,n)=>{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:l,layout:u}=t;if((u==="vertical"||u==="horizontal"&&l==="middle")&&a!=="center"&&Ne(e[a]))return Ja(Ja({},e),{},{[a]:e[a]+(r||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&l!=="middle"&&Ne(e[l]))return Ja(Ja({},e),{},{[l]:e[l]+(i||0)})}return e},ws=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",iV=(e,t)=>{if(!t||t.length!==2||!Ne(t[0])||!Ne(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(!Ne(e[0])||e[0]<n)&&(i[0]=n),(!Ne(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},sV=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,l=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],v=Qr(h)?m:h;v>=0?(p[0]=a,a+=v,p[1]=a):(p[0]=l,l+=v,p[1]=l)}}}},aV=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,l=0;l<n;++l){var u=e[l],d=u==null?void 0:u[i];if(d!=null){var p=Qr(d[1])?d[0]:d[1];p>=0?(d[0]=a,a+=p,d[1]=a):(d[0]=0,d[1]=0)}}}},oV={sign:sV,expand:_B,none:na,silhouette:IB,wiggle:DB,positive:aV},lV=(e,t,n)=>{var r,i=(r=oV[n])!==null&&r!==void 0?r:na,a=MB().keys(t).value((u,d)=>Number(tn(u,d,0))).order(Dg).offset(i),l=a(e);return l.forEach((u,d)=>{u.forEach((p,h)=>{var m=tn(e[h],t[d],0);Array.isArray(m)&&m.length===2&&Ne(m[0])&&Ne(m[1])&&(p[0]=m[0],p[1]=m[1])})}),l};function cV(e){return e==null?void 0:String(e)}var BN=e=>{var{axis:t,ticks:n,offset:r,bandSize:i,entry:a,index:l}=e;if(t.type==="category")return n[l]?n[l].coordinate+r:null;var u=tn(a,t.dataKey,t.scale.domain()[l]);if(Ut(u))return null;var d=t.scale.map(u);return Ne(d)?d-i/2+r:null},uV=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]},dV=e=>{var t=e.flat(2).filter(Ne);return[Math.min(...t),Math.max(...t)]},fV=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],pV=(e,t,n)=>{if(e!=null)return fV(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:l}=a,u=l.reduce((d,p)=>{var h=SE(p,t,n),m=dV(h);return!qe(m[0])||!qe(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]))},VN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,UN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Yd=(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=$f(t,h=>h.coordinate),a=1/0,l=1,u=i.length;l<u;l++){var d=i[l],p=i[l-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 WN(e){var{tooltipEntrySettings:t,dataKey:n,payload:r,value:i,name:a}=e;return Ja(Ja({},t),{},{dataKey:n,payload:r,value:i,name:a})}function NE(e,t){if(e)return String(e);if(typeof t=="string")return t}var hV=(e,t)=>{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},mV=(e,t)=>t==="centric"?e.angle:e.radius,Ai=e=>e.layout.width,Ei=e=>e.layout.height,gV=e=>e.layout.scale,kE=e=>e.layout.margin,Gf=Q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Yf=Q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),vV="data-recharts-item-index",xV="data-recharts-item-id",wc=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 ed(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){yV(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 yV(e,t,n){return(t=bV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bV(e){var t=wV(e,"string");return typeof t=="symbol"?t:t+""}function wV(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 jV=e=>e.brush.height;function SV(e){var t=Yf(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:wc;return n+i}return n},0)}function NV(e){var t=Yf(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:wc;return n+i}return n},0)}function kV(e){var t=Gf(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function PV(e){var t=Gf(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Wt=Q([Ai,Ei,kE,jV,SV,NV,kV,PV,HA,Q7],(e,t,n,r,i,a,l,u,d,p)=>{var h={left:(n.left||0)+i,right:(n.right||0)+a},m={top:(n.top||0)+l,bottom:(n.bottom||0)+u},v=ed(ed({},m),h),x=v.bottom;v.bottom+=r,v=rV(v,d,p);var w=e-v.left-v.right,S=t-v.top-v.bottom;return ed(ed({brushBottom:x},v),{},{width:Math.max(w,0),height:Math.max(S,0)})}),CV=Q(Wt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Ix=Q(Ai,Ei,(e,t)=>({x:0,y:0,width:e,height:t})),OV=b.createContext(null),qn=()=>b.useContext(OV)!=null,Xf=e=>e.brush,Qf=Q([Xf,Wt,kE],(e,t,n)=>({height:e.height,x:Ne(e.x)?e.x:t.left,y:Ne(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Ne(e.width)?e.width:t.width})),O0={},A0={},E0={},KN;function AV(){return KN||(KN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let l,u=null;const d=a!=null&&a.includes("leading"),p=a==null||a.includes("trailing"),h=()=>{u!==null&&(n.apply(l,u),l=void 0,u=null)},m=()=>{p&&h(),S()};let v=null;const x=()=>{v!=null&&clearTimeout(v),v=setTimeout(()=>{v=null,m()},r)},w=()=>{v!==null&&(clearTimeout(v),v=null)},S=()=>{w(),l=void 0,u=null},j=()=>{h()},k=function(...C){if(i!=null&&i.aborted)return;l=this,u=C;const E=v==null;x(),d&&E&&h()};return k.schedule=x,k.cancel=S,k.flush=j,i==null||i.addEventListener("abort",S,{once:!0}),k}e.debounce=t})(E0)),E0}var HN;function EV(){return HN||(HN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AV();function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:l=!1,trailing:u=!0,maxWait:d}=a,p=Array(2);l&&(p[0]="leading"),u&&(p[1]="trailing");let h,m=null;const v=t.debounce(function(...S){h=r.apply(this,S),m=null},i,{edges:p}),x=function(...S){return d!=null&&(m===null&&(m=Date.now()),Date.now()-m>=d)?(h=r.apply(this,S),m=Date.now(),v.cancel(),v.schedule(),h):(v.apply(this,S),h)},w=()=>(v.flush(),h);return x.cancel=v.cancel,x.flush=w,x}e.debounce=n})(A0)),A0}var GN;function TV(){return GN||(GN=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EV();function n(r,i=0,a={}){const{leading:l=!0,trailing:u=!0}=a;return t.debounce(r,i,{leading:l,maxWait:i,trailing:u})}e.throttle=n})(O0)),O0}var T0,YN;function MV(){return YN||(YN=1,T0=TV().throttle),T0}var _V=MV();const IV=ei(_V);var XN=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 l=0;console.warn(n.replace(/%s/g,()=>i[l++]))}},qr={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},PE=(e,t,n)=>{var{width:r=qr.width,height:i=qr.height,aspect:a,maxHeight:l}=n,u=ra(r)?e:Number(r),d=ra(i)?t:Number(i);return a&&a>0&&(u?d=u/a:d&&(u=d*a),l&&d!=null&&d>l&&(d=l)),{calculatedWidth:u,calculatedHeight:d}},DV={width:0,height:0,overflow:"visible"},RV={width:0,overflowX:"visible"},LV={height:0,overflowY:"visible"},$V={},zV=e=>{var{width:t,height:n}=e,r=ra(t),i=ra(n);return r&&i?DV:r?RV:i?LV:$V};function FV(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=qr.width,a=qr.height):i===void 0?i=r&&r>0?void 0:qr.width:a===void 0&&(a=r&&r>0?void 0:qr.height),{width:i,height:a}}function Hg(){return Hg=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},Hg.apply(null,arguments)}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 JN(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){BV(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 BV(e,t,n){return(t=VV(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VV(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)}var CE=b.createContext(qr.initialDimension);function WV(e){return ys(e.width)&&ys(e.height)}function OE(e){var{children:t,width:n,height:r}=e,i=b.useMemo(()=>({width:n,height:r}),[n,r]);return WV(i)?b.createElement(CE.Provider,{value:i},t):null}var Dx=()=>b.useContext(CE),qV=b.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=qr.initialDimension,width:i,height:a,minWidth:l=qr.minWidth,minHeight:u,maxHeight:d,children:p,debounce:h=qr.debounce,id:m,className:v,onResize:x,style:w={}}=e,S=b.useRef(null),j=b.useRef();j.current=x,b.useImperativeHandle(t,()=>S.current);var[k,C]=b.useState({containerWidth:r.width,containerHeight:r.height}),E=b.useCallback((D,$)=>{C(q=>{var X=Math.round(D),L=Math.round($);return q.containerWidth===X&&q.containerHeight===L?q:{containerWidth:X,containerHeight:L}})},[]);b.useEffect(()=>{if(S.current==null||typeof ResizeObserver>"u")return Po;var D=L=>{var Z,J=L[0];if(J!=null){var{width:ne,height:re}=J.contentRect;E(ne,re),(Z=j.current)===null||Z===void 0||Z.call(j,ne,re)}};h>0&&(D=IV(D,h,{trailing:!0,leading:!1}));var $=new ResizeObserver(D),{width:q,height:X}=S.current.getBoundingClientRect();return E(q,X),$.observe(S.current),()=>{$.disconnect()}},[E,h]);var{containerWidth:O,containerHeight:P}=k;XN(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:A,calculatedHeight:M}=PE(O,P,{width:i,height:a,aspect:n,maxHeight:d});return XN(A!=null&&A>0||M!=null&&M>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
307
|
-
please check the style of container, or the props width(%s) and height(%s),
|
|
308
|
-
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
309
|
-
height and width.`,A,M,i,a,l,u,n),b.createElement("div",{id:m?"".concat(m):void 0,className:it("recharts-responsive-container",v),style:JN(JN({},w),{},{width:i,height:a,minWidth:l,minHeight:u,maxHeight:d}),ref:S},b.createElement("div",{style:zV({width:i,height:a})},b.createElement(OE,{width:A,height:M},p)))}),KV=b.forwardRef((e,t)=>{var n=Dx();if(ys(n.width)&&ys(n.height))return e.children;var{width:r,height:i}=FV({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:l}=PE(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ne(a)&&Ne(l)?b.createElement(OE,{width:a,height:l},e.children):b.createElement(qV,Hg({},e,{width:r,height:i,ref:t}))});function Rx(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 Jf=()=>{var e,t=qn(),n=Ae(CV),r=Ae(Qf),i=(e=Ae(Xf))===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}},HV={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},GV=()=>{var e;return(e=Ae(Wt))!==null&&e!==void 0?e:HV},YV=()=>Ae(Ai),XV=()=>Ae(Ei),tt=e=>e.layout.layoutType,Co=()=>Ae(tt),AE=()=>{var e=Co();if(e==="horizontal"||e==="vertical")return e},EE=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},QV=()=>{var e=Co();return e!==void 0},jc=e=>{var t=Nt(),n=qn(),{width:r,height:i}=e,a=Dx(),l=r,u=i;return a&&(l=a.width>0?a.width:r,u=a.height>0?a.height:i),b.useEffect(()=>{!n&&ys(l)&&ys(u)&&t(Q8({width:l,height:u}))},[t,n,l,u]),null},TE=Symbol.for("immer-nothing"),ZN=Symbol.for("immer-draftable"),Wn=Symbol.for("immer-state");function Pr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tc=Object.getPrototypeOf;function po(e){return!!e&&!!e[Wn]}function sa(e){var t;return e?ME(e)||Array.isArray(e)||!!e[ZN]||!!((t=e.constructor)!=null&&t[ZN])||Sc(e)||ep(e):!1}var JV=Object.prototype.constructor.toString(),ek=new WeakMap;function ME(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=ek.get(n);return r===void 0&&(r=Function.toString.call(n),ek.set(n,r)),r===JV}function Xd(e,t,n=!0){Zf(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 Zf(e){const t=e[Wn];return t?t.type_:Array.isArray(e)?1:Sc(e)?2:ep(e)?3:0}function Gg(e,t){return Zf(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _E(e,t,n){const r=Zf(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function ZV(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Sc(e){return e instanceof Map}function ep(e){return e instanceof Set}function qs(e){return e.copy_||e.base_}function Yg(e,t){if(Sc(e))return new Map(e);if(ep(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ME(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Wn];let i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++){const l=i[a],u=r[l];u.writable===!1&&(u.writable=!0,u.configurable=!0),(u.get||u.set)&&(r[l]={configurable:!0,writable:!0,enumerable:u.enumerable,value:e[l]})}return Object.create(tc(e),r)}else{const r=tc(e);if(r!==null&&n)return{...e};const i=Object.create(r);return Object.assign(i,e)}}function Lx(e,t=!1){return tp(e)||po(e)||!sa(e)||(Zf(e)>1&&Object.defineProperties(e,{set:td,add:td,clear:td,delete:td}),Object.freeze(e),t&&Object.values(e).forEach(n=>Lx(n,!0))),e}function eU(){Pr(2)}var td={value:eU};function tp(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var tU={};function aa(e){const t=tU[e];return t||Pr(0,e),t}var nc;function IE(){return nc}function nU(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function tk(e,t){t&&(aa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xg(e){Qg(e),e.drafts_.forEach(rU),e.drafts_=null}function Qg(e){e===nc&&(nc=e.parent_)}function nk(e){return nc=nU(nc,e)}function rU(e){const t=e[Wn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function rk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Wn].modified_&&(Xg(t),Pr(4)),sa(e)&&(e=Qd(t,e),t.parent_||Jd(t,e)),t.patches_&&aa("Patches").generateReplacementPatches_(n[Wn].base_,e,t.patches_,t.inversePatches_)):e=Qd(t,n,[]),Xg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==TE?e:void 0}function Qd(e,t,n){if(tp(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[Wn];if(!i)return Xd(t,(a,l)=>ik(e,i,t,a,l,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Jd(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let l=a,u=!1;i.type_===3&&(l=new Set(a),a.clear(),u=!0),Xd(l,(d,p)=>ik(e,i,a,d,p,n,u),r),Jd(e,a,!1),n&&e.patches_&&aa("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function ik(e,t,n,r,i,a,l){if(i==null||typeof i!="object"&&!l)return;const u=tp(i);if(!(u&&!l)){if(po(i)){const d=a&&t&&t.type_!==3&&!Gg(t.assigned_,r)?a.concat(r):void 0,p=Qd(e,i,d);if(_E(n,r,p),po(p))e.canAutoFreeze_=!1;else return}else l&&n.add(i);if(sa(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&u)return;Qd(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Sc(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Jd(e,i)}}}function Jd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Lx(t,n)}function iU(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:IE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=$x;n&&(i=[r],a=rc);const{revoke:l,proxy:u}=Proxy.revocable(i,a);return r.draft_=u,r.revoke_=l,u}var $x={get(e,t){if(t===Wn)return e;const n=qs(e);if(!Gg(n,t))return sU(e,n,t);const r=n[t];return e.finalized_||!sa(r)?r:r===M0(e.base_,t)?(_0(e),e.copy_[t]=Zg(r,e)):r},has(e,t){return t in qs(e)},ownKeys(e){return Reflect.ownKeys(qs(e))},set(e,t,n){const r=DE(qs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=M0(qs(e),t),a=i==null?void 0:i[Wn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(ZV(n,i)&&(n!==void 0||Gg(e.base_,t)))return!0;_0(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_[t]=!0),!0},deleteProperty(e,t){return M0(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,_0(e),Jg(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(){Pr(11)},getPrototypeOf(e){return tc(e.base_)},setPrototypeOf(){Pr(12)}},rc={};Xd($x,(e,t)=>{rc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});rc.deleteProperty=function(e,t){return rc.set.call(this,e,t,void 0)};rc.set=function(e,t,n){return $x.set.call(this,e[0],t,n,e[0])};function M0(e,t){const n=e[Wn];return(n?qs(n):e)[t]}function sU(e,t,n){var i;const r=DE(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function DE(e,t){if(!(t in e))return;let n=tc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=tc(n)}}function Jg(e){e.modified_||(e.modified_=!0,e.parent_&&Jg(e.parent_))}function _0(e){e.copy_||(e.copy_=Yg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var aU=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 l=this;return function(d=a,...p){return l.produce(d,h=>n.call(this,h,...p))}}typeof n!="function"&&Pr(6),r!==void 0&&typeof r!="function"&&Pr(7);let i;if(sa(t)){const a=nk(this),l=Zg(t,void 0);let u=!0;try{i=n(l),u=!1}finally{u?Xg(a):Qg(a)}return tk(a,r),rk(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===TE&&(i=void 0),this.autoFreeze_&&Lx(i,!0),r){const a=[],l=[];aa("Patches").generateReplacementPatches_(t,i,a,l),r(a,l)}return i}else Pr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...u)=>this.produceWithPatches(l,d=>t(d,...u));let r,i;return[this.produce(t,n,(l,u)=>{r=l,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){sa(e)||Pr(8),po(e)&&(e=oU(e));const t=nk(this),n=Zg(e,void 0);return n[Wn].isManual_=!0,Qg(t),n}finishDraft(e,t){const n=e&&e[Wn];(!n||!n.isManual_)&&Pr(9);const{scope_:r}=n;return tk(r,t),rk(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=aa("Patches").applyPatches_;return po(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Zg(e,t){const n=Sc(e)?aa("MapSet").proxyMap_(e,t):ep(e)?aa("MapSet").proxySet_(e,t):iU(e,t);return(t?t.scope_:IE()).drafts_.push(n),n}function oU(e){return po(e)||Pr(10,e),RE(e)}function RE(e){if(!sa(e)||tp(e))return e;const t=e[Wn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Yg(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Yg(e,!0);return Xd(n,(i,a)=>{_E(n,i,RE(a))},r),t&&(t.finalized_=!1),n}var lU=new aU;lU.produce;var cU={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},LE=Tn({name:"legend",initialState:cU,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:dt()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Or(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:dt()},removeLegendPayload:{reducer(e,t){var n=Or(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:dt()}}}),{setLegendSize:Cte,setLegendSettings:Ote,addLegendPayload:uU,replaceLegendPayload:dU,removeLegendPayload:fU}=LE.actions,pU=LE.reducer;function ev(){return ev=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},ev.apply(null,arguments)}function sk(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 jl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sk(Object(n),!0).forEach(function(r){hU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hU(e,t,n){return(t=mU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mU(e){var t=gU(e,"string");return typeof t=="symbol"?t:t+""}function gU(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 vU(e){return Array.isArray(e)&&Jr(e[0])&&Jr(e[1])?e.join(" ~ "):e}var Fa={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},xU=e=>{var{separator:t=Fa.separator,contentStyle:n,itemStyle:r,labelStyle:i=Fa.labelStyle,payload:a,formatter:l,itemSorter:u,wrapperClassName:d,labelClassName:p,label:h,labelFormatter:m,accessibilityLayer:v=Fa.accessibilityLayer}=e,x=()=>{if(a&&a.length){var P={padding:0,margin:0},A=(u?$f(a,u):a).map((M,D)=>{if(M.type==="none")return null;var $=M.formatter||l||vU,{value:q,name:X}=M,L=q,Z=X;if($){var J=$(q,X,M,D,a);if(Array.isArray(J))[L,Z]=J;else if(J!=null)L=J;else return null}var ne=jl(jl({},Fa.itemStyle),{},{color:M.color||Fa.itemStyle.color},r);return b.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(D),style:ne},Jr(Z)?b.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Jr(Z)?b.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,b.createElement("span",{className:"recharts-tooltip-item-value"},L),b.createElement("span",{className:"recharts-tooltip-item-unit"},M.unit||""))});return b.createElement("ul",{className:"recharts-tooltip-item-list",style:P},A)}return null},w=jl(jl({},Fa.contentStyle),n),S=jl({margin:0},i),j=!Ut(h),k=j?h:"",C=it("recharts-default-tooltip",d),E=it("recharts-tooltip-label",p);j&&m&&a!==void 0&&a!==null&&(k=m(h,a));var O=v?{role:"status","aria-live":"assertive"}:{};return b.createElement("div",ev({className:C,style:w},O),b.createElement("p",{className:E,style:S},b.isValidElement(k)?k:"".concat(k)),x())},Sl="recharts-tooltip-wrapper",yU={visibility:"hidden"};function bU(e){var{coordinate:t,translateX:n,translateY:r}=e;return it(Sl,{["".concat(Sl,"-right")]:Ne(n)&&t&&Ne(t.x)&&n>=t.x,["".concat(Sl,"-left")]:Ne(n)&&t&&Ne(t.x)&&n<t.x,["".concat(Sl,"-bottom")]:Ne(r)&&t&&Ne(t.y)&&r>=t.y,["".concat(Sl,"-top")]:Ne(r)&&t&&Ne(t.y)&&r<t.y})}function ak(e){var{allowEscapeViewBox:t,coordinate:n,key:r,offset:i,position:a,reverseDirection:l,tooltipDimension:u,viewBox:d,viewBoxDimension:p}=e;if(a&&Ne(a[r]))return a[r];var h=n[r]-u-(i>0?i:0),m=n[r]+i;if(t[r])return l[r]?h:m;var v=d[r];if(v==null)return 0;if(l[r]){var x=h,w=v;return x<w?Math.max(m,v):Math.max(h,v)}if(p==null)return 0;var S=m+u,j=v+p;return S>j?Math.max(h,v):Math.max(m,v)}function wU(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 jU(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:l,tooltipBox:u,useTranslate3d:d,viewBox:p}=e,h,m,v;return u.height>0&&u.width>0&&n?(m=ak({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:l,tooltipDimension:u.width,viewBox:p,viewBoxDimension:p.width}),v=ak({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:l,tooltipDimension:u.height,viewBox:p,viewBoxDimension:p.height}),h=wU({translateX:m,translateY:v,useTranslate3d:d})):h=yU,{cssProperties:h,cssClasses:bU({translateX:m,translateY:v,coordinate:n})}}function ok(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 nd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ok(Object(n),!0).forEach(function(r){tv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ok(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tv(e,t,n){return(t=SU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SU(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)}class kU extends b.PureComponent{constructor(){super(...arguments),tv(this,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0}}),tv(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:l,hasPayload:u,isAnimationActive:d,offset:p,position:h,reverseDirection:m,useTranslate3d:v,viewBox:x,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:O,cssProperties:P}=jU({allowEscapeViewBox:n,coordinate:l,offsetLeft:C,offsetTop:E,position:h,reverseDirection:m,tooltipBox:{height:S.height,width:S.width},useTranslate3d:v,viewBox:x}),A=k?{}:nd(nd({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=nd(nd({},A),{},{visibility:!this.state.dismissed&&t&&u?"visible":"hidden"},w);return b.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:O,style:M,ref:j},a)}}var $E=()=>{var e;return(e=Ae(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function nv(){return nv=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},nv.apply(null,arguments)}function lk(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 ck(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lk(Object(n),!0).forEach(function(r){PU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PU(e,t,n){return(t=CU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CU(e){var t=OU(e,"string");return typeof t=="symbol"?t:t+""}function OU(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 uk={curveBasisClosed:wB,curveBasisOpen:jB,curveBasis:bB,curveBumpX:aB,curveBumpY:oB,curveLinearClosed:SB,curveLinear:Rf,curveMonotoneX:NB,curveMonotoneY:kB,curveNatural:PB,curveStep:CB,curveStepAfter:AB,curveStepBefore:OB},Zd=e=>qe(e.x)&&qe(e.y),dk=e=>e.base!=null&&Zd(e.base)&&Zd(e),Nl=e=>e.x,kl=e=>e.y,AU=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(xc(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=uk["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return uk[n]||Rf},fk={connectNulls:!1,type:"linear"},EU=e=>{var{type:t=fk.type,points:n=[],baseLine:r,layout:i,connectNulls:a=fk.connectNulls}=e,l=AU(t,i),u=a?n.filter(Zd):n;if(Array.isArray(r)){var d,p=n.map((w,S)=>ck(ck({},w),{},{base:r[S]}));i==="vertical"?d=Gu().y(kl).x1(Nl).x0(w=>w.base.x):d=Gu().x(Nl).y1(kl).y0(w=>w.base.y);var h=d.defined(dk).curve(l),m=a?p.filter(dk):p;return h(m)}var v;i==="vertical"&&Ne(r)?v=Gu().y(kl).x1(Nl).x0(r):Ne(r)?v=Gu().x(Nl).y1(kl).y0(r):v=bA().x(Nl).y(kl);var x=v.defined(Zd).curve(l);return x(u)},zE=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Co();if((!n||!n.length)&&!r)return null;var l={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=n&&n.length?EU(l):r;return b.createElement("path",nv({},xs(e),ZB(e),{className:it("recharts-curve",t),d:u===null?void 0:u,ref:i}))},TU=["x","y","top","left","width","height","className"];function rv(){return rv=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},rv.apply(null,arguments)}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 MU(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){_U(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 _U(e,t,n){return(t=IU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IU(e){var t=DU(e,"string");return typeof t=="symbol"?t:t+""}function DU(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 RU(e,t){if(e==null)return{};var n,r,i=LU(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 LU(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 $U=(e,t,n,r,i,a)=>"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),zU=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:l=0,className:u}=e,d=RU(e,TU),p=MU({x:t,y:n,top:r,left:i,width:a,height:l},d);return!Ne(t)||!Ne(n)||!Ne(a)||!Ne(l)||!Ne(r)||!Ne(i)?null:b.createElement("path",rv({},ur(p),{className:it("recharts-cross",u),d:$U(t,n,a,l,r,i)}))};function FU(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 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){BU(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 BU(e,t,n){return(t=VU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VU(e){var t=UU(e,"string");return typeof t=="symbol"?t:t+""}function UU(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 WU=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),FE=(e,t,n)=>e.map(r=>"".concat(WU(r)," ").concat(t,"ms ").concat(n)).join(","),qU=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),ic=(e,t)=>Object.keys(t).reduce((n,r)=>mk(mk({},n),{},{[r]:e(r,t[r])}),{});function gk(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 Et(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gk(Object(n),!0).forEach(function(r){KU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KU(e,t,n){return(t=HU(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HU(e){var t=GU(e,"string");return typeof t=="symbol"?t:t+""}function GU(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 ef=(e,t,n)=>e+(t-e)*n,iv=e=>{var{from:t,to:n}=e;return t!==n},BE=(e,t,n)=>{var r=ic((i,a)=>{if(iv(a)){var[l,u]=e(a.from,a.to,a.velocity);return Et(Et({},a),{},{from:l,velocity:u})}return a},t);return n<1?ic((i,a)=>iv(a)&&r[i]!=null?Et(Et({},a),{},{velocity:ef(a.velocity,r[i].velocity,n),from:ef(a.from,r[i].from,n)}):a,t):BE(e,r,n-1)};function YU(e,t,n,r,i,a){var l,u=r.reduce((v,x)=>Et(Et({},v),{},{[x]:{from:e[x],velocity:0,to:t[x]}}),{}),d=()=>ic((v,x)=>x.from,u),p=()=>!Object.values(u).filter(iv).length,h=null,m=v=>{l||(l=v);var x=v-l,w=x/n.dt;u=BE(n,u,w),i(Et(Et(Et({},e),t),d())),l=v,p()||(h=a.setTimeout(m))};return()=>(h=a.setTimeout(m),()=>{var v;(v=h)===null||v===void 0||v()})}function XU(e,t,n,r,i,a,l){var u=null,d=i.reduce((m,v)=>{var x=e[v],w=t[v];return x==null||w==null?m:Et(Et({},m),{},{[v]:[x,w]})},{}),p,h=m=>{p||(p=m);var v=(m-p)/r,x=ic((S,j)=>ef(...j,n(v)),d);if(a(Et(Et(Et({},e),t),x)),v<1)u=l.setTimeout(h);else{var w=ic((S,j)=>ef(...j,n(1)),d);a(Et(Et(Et({},e),t),w))}};return()=>(u=l.setTimeout(h),()=>{var m;(m=u)===null||m===void 0||m()})}const QU=(e,t,n,r,i,a)=>{var l=qU(e,t);return n==null?()=>(i(Et(Et({},e),t)),()=>{}):n.isStepper===!0?YU(e,t,n,l,i,a):XU(e,t,n,r,l,i,a)};var tf=1e-4,VE=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],UE=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),vk=(e,t)=>n=>{var r=VE(e,t);return UE(r,n)},JU=(e,t)=>n=>{var r=VE(e,t),i=[...r.map((a,l)=>a*l).slice(1),0];return UE(i,n)},ZU=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]]},e9=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=ZU(n[0]);if(i)return i}}return n.length===4?n:[0,0,1,1]},t9=(e,t,n,r)=>{var i=vk(e,n),a=vk(t,r),l=JU(e,n),u=p=>p>1?1:p<0?0:p,d=p=>{for(var h=p>1?1:p,m=h,v=0;v<8;++v){var x=i(m)-h,w=l(m);if(Math.abs(x-h)<tf||w<tf)return a(m);m=u(m-x/w)}return a(m)};return d.isStepper=!1,d},xk=function(){return t9(...e9(...arguments))},n9=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(l,u,d)=>{var p=-(l-u)*n,h=d*r,m=d+(p-h)*i/1e3,v=d*i/1e3+l;return Math.abs(v-u)<tf&&Math.abs(m)<tf?[u,0]:[v,m]};return a.isStepper=!0,a.dt=i,a},r9=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return xk(e);case"spring":return n9();default:if(e.split("(")[0]==="cubic-bezier")return xk(e)}return typeof e=="function"?e:null};function i9(e){var t,n=()=>null,r=!1,i=null,a=l=>{if(!r){if(Array.isArray(l)){if(!l.length)return;var u=l,[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 l=="string"&&(t=l,n(t)),typeof l=="object"&&(t=l,n(t)),typeof l=="function"&&l()}};return{stop:()=>{r=!0},start:l=>{r=!1,i&&(i(),i=null),a(l)},subscribe:l=>(n=l,()=>{n=()=>null}),getTimeoutController:()=>e}}class s9{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=l=>{l-r>=n?t(l):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function a9(){return i9(new s9)}var o9=b.createContext(a9);function l9(e,t){var n=b.useContext(o9);return b.useMemo(()=>t??n(e),[e,t,n])}var c9=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),np={isSsr:c9()},u9={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},yk={t:0},I0={t:1};function zx(e){var t=pr(e,u9),{isActive:n,canBegin:r,duration:i,easing:a,begin:l,onAnimationEnd:u,onAnimationStart:d,children:p}=t,h=n==="auto"?!np.isSsr:n,m=l9(t.animationId,t.animationManager),[v,x]=b.useState(h?yk:I0),w=b.useRef(null);return b.useEffect(()=>{h||x(I0)},[h]),b.useEffect(()=>{if(!h||!r)return Po;var S=QU(yk,I0,r9(a),i,x,m.getTimeoutController()),j=()=>{w.current=S()};return m.start([d,l,j,i,u]),()=>{m.stop(),w.current&&w.current(),u()}},[h,r,i,a,l,d,u,m]),p(v.t)}function Fx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=b.useRef(Ql(t)),r=b.useRef(e);return r.current!==e&&(n.current=Ql(t),r.current=e),n.current}var d9=["radius"],f9=["radius"],bk,wk,jk,Sk,Nk,kk,Pk,Ck,Ok,Ak;function Ek(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 Tk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ek(Object(n),!0).forEach(function(r){p9(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ek(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function p9(e,t,n){return(t=h9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h9(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)}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 Mk(e,t){if(e==null)return{};var n,r,i=g9(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 g9(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 Br(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var _k=(e,t,n,r,i)=>{var a=ds(n),l=ds(r),u=Math.min(Math.abs(a)/2,Math.abs(l)/2),d=l>=0?1:-1,p=a>=0?1:-1,h=l>=0&&a>=0||l<0&&a<0?1:0,m;if(u>0&&Array.isArray(i)){for(var v=[0,0,0,0],x=0,w=4;x<w;x++){var S,j=(S=i[x])!==null&&S!==void 0?S:0;v[x]=j>u?u:j}m=yt(bk||(bk=Br(["M",",",""])),e,t+d*v[0]),v[0]>0&&(m+=yt(wk||(wk=Br(["A ",",",",0,0,",",",",",""])),v[0],v[0],h,e+p*v[0],t)),m+=yt(jk||(jk=Br(["L ",",",""])),e+n-p*v[1],t),v[1]>0&&(m+=yt(Sk||(Sk=Br(["A ",",",",0,0,",`,
|
|
310
|
-
`,",",""])),v[1],v[1],h,e+n,t+d*v[1])),m+=yt(Nk||(Nk=Br(["L ",",",""])),e+n,t+r-d*v[2]),v[2]>0&&(m+=yt(kk||(kk=Br(["A ",",",",0,0,",`,
|
|
311
|
-
`,",",""])),v[2],v[2],h,e+n-p*v[2],t+r)),m+=yt(Pk||(Pk=Br(["L ",",",""])),e+p*v[3],t+r),v[3]>0&&(m+=yt(Ck||(Ck=Br(["A ",",",",0,0,",`,
|
|
312
|
-
`,",",""])),v[3],v[3],h,e,t+r-d*v[3])),m+="Z"}else if(u>0&&i===+i&&i>0){var k=Math.min(u,i);m=yt(Ok||(Ok=Br(["M ",",",`
|
|
313
|
-
A `,",",",0,0,",",",",",`
|
|
314
|
-
L `,",",`
|
|
315
|
-
A `,",",",0,0,",",",",",`
|
|
316
|
-
L `,",",`
|
|
317
|
-
A `,",",",0,0,",",",",",`
|
|
318
|
-
L `,",",`
|
|
319
|
-
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=yt(Ak||(Ak=Br(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return m},Ik={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},WE=e=>{var t=pr(e,Ik),n=b.useRef(null),[r,i]=b.useState(-1);b.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var B=n.current.getTotalLength();B&&i(B)}catch{}},[]);var{x:a,y:l,width:u,height:d,radius:p,className:h}=t,{animationEasing:m,animationDuration:v,animationBegin:x,isAnimationActive:w,isUpdateAnimationActive:S}=t,j=b.useRef(u),k=b.useRef(d),C=b.useRef(a),E=b.useRef(l),O=b.useMemo(()=>({x:a,y:l,width:u,height:d,radius:p}),[a,l,u,d,p]),P=Fx(O,"rectangle-");if(a!==+a||l!==+l||u!==+u||d!==+d||u===0||d===0)return null;var A=it("recharts-rectangle",h);if(!S){var M=ur(t),{radius:D}=M,$=Mk(M,d9);return b.createElement("path",nf({},$,{x:ds(a),y:ds(l),width:ds(u),height:ds(d),radius:typeof p=="number"?p:void 0,className:A,d:_k(a,l,u,d,p)}))}var q=j.current,X=k.current,L=C.current,Z=E.current,J="0px ".concat(r===-1?1:r,"px"),ne="".concat(r,"px 0px"),re=FE(["strokeDasharray"],v,typeof m=="string"?m:Ik.animationEasing);return b.createElement(zx,{animationId:P,key:P,canBegin:r>0,duration:v,easing:m,isActive:S,begin:x},B=>{var F=Zt(q,u,B),G=Zt(X,d,B),W=Zt(L,a,B),_=Zt(Z,l,B);n.current&&(j.current=F,k.current=G,C.current=W,E.current=_);var V;w?B>0?V={transition:re,strokeDasharray:ne}:V={strokeDasharray:J}:V={strokeDasharray:ne};var ie=ur(t),{radius:fe}=ie,te=Mk(ie,f9);return b.createElement("path",nf({},te,{radius:typeof p=="number"?p:void 0,className:A,d:_k(W,_,F,G,p),ref:n,style:Tk(Tk({},V),t.style)}))})};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 Rk(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){v9(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 v9(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=y9(e,"string");return typeof t=="symbol"?t:t+""}function y9(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=Math.PI/180,b9=e=>e*180/Math.PI,en=(e,t,n,r)=>({x:e+Math.cos(-rf*r)*n,y:t+Math.sin(-rf*r)*n}),w9=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},j9=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},S9=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,l=j9({x:n,y:r},{x:i,y:a});if(l<=0)return{radius:l,angle:0};var u=(n-i)/l,d=Math.acos(u);return r>a&&(d=2*Math.PI-d),{radius:l,angle:b9(d),angleInRadian:d}},N9=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}},k9=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),l=Math.min(i,a);return e+l*360},P9=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:i,angle:a}=S9({x:n,y:r},t),{innerRadius:l,outerRadius:u}=t;if(i<l||i>u||i===0)return null;var{startAngle:d,endAngle:p}=N9(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?Rk(Rk({},t),{},{radius:i,angle:k9(h,t)}):null};function qE(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,l=en(t,n,r,i),u=en(t,n,r,a);return{points:[l,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var Lk,$k,zk,Fk,Bk,Vk,Uk;function sv(){return sv=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},sv.apply(null,arguments)}function Gs(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var C9=(e,t)=>{var n=zn(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},rd=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:l,cornerRadius:u,cornerIsExternal:d}=e,p=u*(l?1:-1)+r,h=Math.asin(u/p)/rf,m=d?i:i+a*h,v=en(t,n,p,m),x=en(t,n,r,m),w=d?i-a*h:i,S=en(t,n,p*Math.cos(h*rf),w);return{center:v,circleTangency:x,lineTangency:S,theta:h}},KE=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:l}=e,u=C9(a,l),d=a+u,p=en(t,n,i,a),h=en(t,n,i,d),m=yt(Lk||(Lk=Gs(["M ",",",`
|
|
320
|
-
A `,",",`,0,
|
|
321
|
-
`,",",`,
|
|
322
|
-
`,",",`
|
|
323
|
-
`])),p.x,p.y,i,i,+(Math.abs(u)>180),+(a>d),h.x,h.y);if(r>0){var v=en(t,n,r,a),x=en(t,n,r,d);m+=yt($k||($k=Gs(["L ",",",`
|
|
324
|
-
A `,",",`,0,
|
|
325
|
-
`,",",`,
|
|
326
|
-
`,","," Z"])),x.x,x.y,r,r,+(Math.abs(u)>180),+(a<=d),v.x,v.y)}else m+=yt(zk||(zk=Gs(["L ",","," Z"])),t,n);return m},O9=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:l,cornerIsExternal:u,startAngle:d,endAngle:p}=e,h=zn(p-d),{circleTangency:m,lineTangency:v,theta:x}=rd({cx:t,cy:n,radius:i,angle:d,sign:h,cornerRadius:a,cornerIsExternal:u}),{circleTangency:w,lineTangency:S,theta:j}=rd({cx:t,cy:n,radius:i,angle:p,sign:-h,cornerRadius:a,cornerIsExternal:u}),k=u?Math.abs(d-p):Math.abs(d-p)-x-j;if(k<0)return l?yt(Fk||(Fk=Gs(["M ",",",`
|
|
327
|
-
a`,",",",0,0,1,",`,0
|
|
328
|
-
a`,",",",0,0,1,",`,0
|
|
329
|
-
`])),v.x,v.y,a,a,a*2,a,a,-a*2):KE({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:d,endAngle:p});var C=yt(Bk||(Bk=Gs(["M ",",",`
|
|
330
|
-
A`,",",",0,0,",",",",",`
|
|
331
|
-
A`,",",",0,",",",",",",",`
|
|
332
|
-
A`,",",",0,0,",",",",",`
|
|
333
|
-
`])),v.x,v.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:O,theta:P}=rd({cx:t,cy:n,radius:r,angle:d,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),{circleTangency:A,lineTangency:M,theta:D}=rd({cx:t,cy:n,radius:r,angle:p,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),$=u?Math.abs(d-p):Math.abs(d-p)-P-D;if($<0&&a===0)return"".concat(C,"L").concat(t,",").concat(n,"Z");C+=yt(Vk||(Vk=Gs(["L",",",`
|
|
334
|
-
A`,",",",0,0,",",",",",`
|
|
335
|
-
A`,",",",0,",",",",",",",`
|
|
336
|
-
A`,",",",0,0,",",",",","Z"])),M.x,M.y,a,a,+(h<0),A.x,A.y,r,r,+($>180),+(h>0),E.x,E.y,a,a,+(h<0),O.x,O.y)}else C+=yt(Uk||(Uk=Gs(["L",",","Z"])),t,n);return C},A9={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},HE=e=>{var t=pr(e,A9),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:l,forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:h,className:m}=t;if(a<i||p===h)return null;var v=it("recharts-sector",m),x=a-i,w=Ar(l,x,0,!0),S;return w>0&&Math.abs(p-h)<360?S=O9({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(w,x/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:p,endAngle:h}):S=KE({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:p,endAngle:h}),b.createElement("path",sv({},ur(t),{className:v,d:S}))};function E9(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(DA(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:l,angle:u}=t,d=en(r,i,a,u),p=en(r,i,l,u);return[{x:d.x,y:d.y},{x:p.x,y:p.y}]}return qE(t)}}var D0={},R0={},L0={},Wk;function T9(){return Wk||(Wk=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})(L0)),L0}var qk;function M9(){return qk||(qk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=T9();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})(R0)),R0}var Kk;function _9(){return Kk||(Kk=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=KA(),n=M9();function r(i,a,l){l&&typeof l!="number"&&t.isIterateeCall(i,a,l)&&(a=l=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),l=l===void 0?i<a?1:-1:n.toFinite(l);const u=Math.max(Math.ceil((a-i)/(l||1)),0),d=new Array(u);for(let p=0;p<u;p++)d[p]=i,i+=l;return d}e.range=r})(D0)),D0}var $0,Hk;function I9(){return Hk||(Hk=1,$0=_9().range),$0}var D9=I9();const GE=ei(D9);function fs(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function R9(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Bx(e){let t,n,r;e.length!==2?(t=fs,n=(u,d)=>fs(e(u),d),r=(u,d)=>e(u)-d):(t=e===fs||e===R9?e:L9,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 l(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:l,right:a}}function L9(){return 0}function YE(e){return e===null?NaN:+e}function*$9(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const z9=Bx(fs),Nc=z9.right;Bx(YE).center;class Gk extends Map{constructor(t,n=V9){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(Yk(this,t))}has(t){return super.has(Yk(this,t))}set(t,n){return super.set(F9(this,t),n)}delete(t){return super.delete(B9(this,t))}}function Yk({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function F9({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function B9({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function V9(e){return e!==null&&typeof e=="object"?e.valueOf():e}function U9(e=fs){if(e===fs)return XE;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 XE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const W9=Math.sqrt(50),q9=Math.sqrt(10),K9=Math.sqrt(2);function sf(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=W9?10:a>=q9?5:a>=K9?2:1;let u,d,p;return i<0?(p=Math.pow(10,-i)/l,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)*l,u=Math.round(e/p),d=Math.round(t/p),u*p<e&&++u,d*p>t&&--d),d<u&&.5<=n&&n<2?sf(e,t,n*2):[u,d,p]}function av(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,a,l]=r?sf(t,e,n):sf(e,t,n);if(!(a>=i))return[];const u=a-i+1,d=new Array(u);if(r)if(l<0)for(let p=0;p<u;++p)d[p]=(a-p)/-l;else for(let p=0;p<u;++p)d[p]=(a-p)*l;else if(l<0)for(let p=0;p<u;++p)d[p]=(i+p)/-l;else for(let p=0;p<u;++p)d[p]=(i+p)*l;return d}function ov(e,t,n){return t=+t,e=+e,n=+n,sf(e,t,n)[2]}function lv(e,t,n){t=+t,e=+e,n=+n;const r=t<e,i=r?ov(t,e,n):ov(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function Xk(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function Qk(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function QE(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?XE:U9(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),v=.5*Math.sqrt(h*m*(d-m)/d)*(p-d/2<0?-1:1),x=Math.max(n,Math.floor(t-p*m/d+v)),w=Math.min(r,Math.floor(t+(d-p)*m/d+v));QE(e,t,x,w,i)}const a=e[t];let l=n,u=r;for(Pl(e,n,t),i(e[r],a)>0&&Pl(e,n,r);l<u;){for(Pl(e,l,u),++l,--u;i(e[l],a)<0;)++l;for(;i(e[u],a)>0;)--u}i(e[n],a)===0?Pl(e,n,u):(++u,Pl(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Pl(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function H9(e,t,n){if(e=Float64Array.from($9(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Qk(e);if(t>=1)return Xk(e);var r,i=(r-1)*t,a=Math.floor(i),l=Xk(QE(e,a).subarray(0,a+1)),u=Qk(e.subarray(a+1));return l+(u-l)*(i-a)}}function G9(e,t,n=YE){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),l=+n(e[a],a,e),u=+n(e[a+1],a+1,e);return l+(u-l)*(i-a)}}function Y9(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 hr(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Ti(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 cv=Symbol("implicit");function Vx(){var e=new Gk,t=[],n=[],r=cv;function i(a){let l=e.get(a);if(l===void 0){if(r!==cv)return r;e.set(a,l=t.push(a)-1)}return n[l%n.length]}return i.domain=function(a){if(!arguments.length)return t.slice();t=[],e=new Gk;for(const l of a)e.has(l)||e.set(l,t.push(l)-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 Vx(t,n).unknown(r)},hr.apply(i,arguments),i}function Ux(){var e=Vx().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,l,u=!1,d=0,p=0,h=.5;delete e.unknown;function m(){var v=t().length,x=i<r,w=x?i:r,S=x?r:i;a=(S-w)/Math.max(1,v-d+p*2),u&&(a=Math.floor(a)),w+=(S-w-a*(v-d))*h,l=a*(1-d),u&&(w=Math.round(w),l=Math.round(l));var j=Y9(v).map(function(k){return w+a*k});return n(x?j.reverse():j)}return e.domain=function(v){return arguments.length?(t(v),m()):t()},e.range=function(v){return arguments.length?([r,i]=v,r=+r,i=+i,m()):[r,i]},e.rangeRound=function(v){return[r,i]=v,r=+r,i=+i,u=!0,m()},e.bandwidth=function(){return l},e.step=function(){return a},e.round=function(v){return arguments.length?(u=!!v,m()):u},e.padding=function(v){return arguments.length?(d=Math.min(1,p=+v),m()):d},e.paddingInner=function(v){return arguments.length?(d=Math.min(1,v),m()):d},e.paddingOuter=function(v){return arguments.length?(p=+v,m()):p},e.align=function(v){return arguments.length?(h=Math.max(0,Math.min(1,v)),m()):h},e.copy=function(){return Ux(t(),[r,i]).round(u).paddingInner(d).paddingOuter(p).align(h)},hr.apply(m(),arguments)}function JE(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return JE(t())},e}function X9(){return JE(Ux.apply(null,arguments).paddingInner(1))}function Wx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ZE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function kc(){}var sc=.7,af=1/sc,ro="\\s*([+-]?\\d+)\\s*",ac="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Xr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q9=/^#([0-9a-f]{3,8})$/,J9=new RegExp(`^rgb\\(${ro},${ro},${ro}\\)$`),Z9=new RegExp(`^rgb\\(${Xr},${Xr},${Xr}\\)$`),eW=new RegExp(`^rgba\\(${ro},${ro},${ro},${ac}\\)$`),tW=new RegExp(`^rgba\\(${Xr},${Xr},${Xr},${ac}\\)$`),nW=new RegExp(`^hsl\\(${ac},${Xr},${Xr}\\)$`),rW=new RegExp(`^hsla\\(${ac},${Xr},${Xr},${ac}\\)$`),Jk={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};Wx(kc,oc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zk,formatHex:Zk,formatHex8:iW,formatHsl:sW,formatRgb:eP,toString:eP});function Zk(){return this.rgb().formatHex()}function iW(){return this.rgb().formatHex8()}function sW(){return eT(this).formatHsl()}function eP(){return this.rgb().formatRgb()}function oc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Q9.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tP(t):n===3?new On(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?id(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?id(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=J9.exec(e))?new On(t[1],t[2],t[3],1):(t=Z9.exec(e))?new On(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=eW.exec(e))?id(t[1],t[2],t[3],t[4]):(t=tW.exec(e))?id(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=nW.exec(e))?iP(t[1],t[2]/100,t[3]/100,1):(t=rW.exec(e))?iP(t[1],t[2]/100,t[3]/100,t[4]):Jk.hasOwnProperty(e)?tP(Jk[e]):e==="transparent"?new On(NaN,NaN,NaN,0):null}function tP(e){return new On(e>>16&255,e>>8&255,e&255,1)}function id(e,t,n,r){return r<=0&&(e=t=n=NaN),new On(e,t,n,r)}function aW(e){return e instanceof kc||(e=oc(e)),e?(e=e.rgb(),new On(e.r,e.g,e.b,e.opacity)):new On}function uv(e,t,n,r){return arguments.length===1?aW(e):new On(e,t,n,r??1)}function On(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Wx(On,uv,ZE(kc,{brighter(e){return e=e==null?af:Math.pow(af,e),new On(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?sc:Math.pow(sc,e),new On(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new On(Zs(this.r),Zs(this.g),Zs(this.b),of(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:nP,formatHex:nP,formatHex8:oW,formatRgb:rP,toString:rP}));function nP(){return`#${Ys(this.r)}${Ys(this.g)}${Ys(this.b)}`}function oW(){return`#${Ys(this.r)}${Ys(this.g)}${Ys(this.b)}${Ys((isNaN(this.opacity)?1:this.opacity)*255)}`}function rP(){const e=of(this.opacity);return`${e===1?"rgb(":"rgba("}${Zs(this.r)}, ${Zs(this.g)}, ${Zs(this.b)}${e===1?")":`, ${e})`}`}function of(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 iP(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Cr(e,t,n,r)}function eT(e){if(e instanceof Cr)return new Cr(e.h,e.s,e.l,e.opacity);if(e instanceof kc||(e=oc(e)),!e)return new Cr;if(e instanceof Cr)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),l=NaN,u=a-i,d=(a+i)/2;return u?(t===a?l=(n-r)/u+(n<r)*6:n===a?l=(r-t)/u+2:l=(t-n)/u+4,u/=d<.5?a+i:2-a-i,l*=60):u=d>0&&d<1?0:l,new Cr(l,u,d,e.opacity)}function lW(e,t,n,r){return arguments.length===1?eT(e):new Cr(e,t,n,r??1)}function Cr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Wx(Cr,lW,ZE(kc,{brighter(e){return e=e==null?af:Math.pow(af,e),new Cr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?sc:Math.pow(sc,e),new Cr(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 On(z0(e>=240?e-240:e+120,i,r),z0(e,i,r),z0(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Cr(sP(this.h),sd(this.s),sd(this.l),of(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=of(this.opacity);return`${e===1?"hsl(":"hsla("}${sP(this.h)}, ${sd(this.s)*100}%, ${sd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sP(e){return e=(e||0)%360,e<0?e+360:e}function sd(e){return Math.max(0,Math.min(1,e||0))}function z0(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 qx=e=>()=>e;function cW(e,t){return function(n){return e+n*t}}function uW(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 dW(e){return(e=+e)==1?tT:function(t,n){return n-t?uW(t,n,e):qx(isNaN(t)?n:t)}}function tT(e,t){var n=t-e;return n?cW(e,n):qx(isNaN(e)?t:e)}const aP=(function e(t){var n=dW(t);function r(i,a){var l=n((i=uv(i)).r,(a=uv(a)).r),u=n(i.g,a.g),d=n(i.b,a.b),p=tT(i.opacity,a.opacity);return function(h){return i.r=l(h),i.g=u(h),i.b=d(h),i.opacity=p(h),i+""}}return r.gamma=e,r})(1);function fW(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 pW(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function hW(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),a=new Array(n),l;for(l=0;l<r;++l)i[l]=Oo(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(u){for(l=0;l<r;++l)a[l]=i[l](u);return a}}function mW(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function lf(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function gW(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]=Oo(e[i],t[i]):r[i]=t[i];return function(a){for(i in n)r[i]=n[i](a);return r}}var dv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,F0=new RegExp(dv.source,"g");function vW(e){return function(){return e}}function xW(e){return function(t){return e(t)+""}}function yW(e,t){var n=dv.lastIndex=F0.lastIndex=0,r,i,a,l=-1,u=[],d=[];for(e=e+"",t=t+"";(r=dv.exec(e))&&(i=F0.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),u[l]?u[l]+=a:u[++l]=a),(r=r[0])===(i=i[0])?u[l]?u[l]+=i:u[++l]=i:(u[++l]=null,d.push({i:l,x:lf(r,i)})),n=F0.lastIndex;return n<t.length&&(a=t.slice(n),u[l]?u[l]+=a:u[++l]=a),u.length<2?d[0]?xW(d[0].x):vW(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 Oo(e,t){var n=typeof t,r;return t==null||n==="boolean"?qx(t):(n==="number"?lf:n==="string"?(r=oc(t))?(t=r,aP):yW:t instanceof oc?aP:t instanceof Date?mW:pW(t)?fW:Array.isArray(t)?hW:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?gW:lf)(e,t)}function Kx(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function bW(e,t){t===void 0&&(t=e,e=Oo);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(l){var u=Math.max(0,Math.min(r-1,Math.floor(l*=r)));return a[u](l-u)}}function wW(e){return function(){return e}}function cf(e){return+e}var oP=[0,1];function mn(e){return e}function fv(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:wW(isNaN(t)?NaN:.5)}function jW(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function SW(e,t,n){var r=e[0],i=e[1],a=t[0],l=t[1];return i<r?(r=fv(i,r),a=n(l,a)):(r=fv(r,i),a=n(a,l)),function(u){return a(r(u))}}function NW(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),a=new Array(r),l=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++l<r;)i[l]=fv(e[l],e[l+1]),a[l]=n(t[l],t[l+1]);return function(u){var d=Nc(e,u,1,r)-1;return a[d](i[d](u))}}function Pc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function rp(){var e=oP,t=oP,n=Oo,r,i,a,l=mn,u,d,p;function h(){var v=Math.min(e.length,t.length);return l!==mn&&(l=jW(e[0],e[v-1])),u=v>2?NW:SW,d=p=null,m}function m(v){return v==null||isNaN(v=+v)?a:(d||(d=u(e.map(r),t,n)))(r(l(v)))}return m.invert=function(v){return l(i((p||(p=u(t,e.map(r),lf)))(v)))},m.domain=function(v){return arguments.length?(e=Array.from(v,cf),h()):e.slice()},m.range=function(v){return arguments.length?(t=Array.from(v),h()):t.slice()},m.rangeRound=function(v){return t=Array.from(v),n=Kx,h()},m.clamp=function(v){return arguments.length?(l=v?!0:mn,h()):l!==mn},m.interpolate=function(v){return arguments.length?(n=v,h()):n},m.unknown=function(v){return arguments.length?(a=v,m):a},function(v,x){return r=v,i=x,h()}}function Hx(){return rp()(mn,mn)}function kW(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function uf(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 ho(e){return e=uf(Math.abs(e)),e?e[1]:NaN}function PW(e,t){return function(n,r){for(var i=n.length,a=[],l=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[l=(l+1)%e.length];return a.reverse().join(t)}}function CW(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var OW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function lc(e){if(!(t=OW.exec(e)))throw new Error("invalid format: "+e);var t;return new Gx({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]})}lc.prototype=Gx.prototype;function Gx(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+""}Gx.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 AW(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 df;function EW(e,t){var n=uf(e,t);if(!n)return df=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(df=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+uf(e,Math.max(0,t+a-1))[0]}function lP(e,t){var n=uf(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 cP={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:kW,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)=>lP(e*100,t),r:lP,s:EW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function uP(e){return e}var dP=Array.prototype.map,fP=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function TW(e){var t=e.grouping===void 0||e.thousands===void 0?uP:PW(dP.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?uP:CW(dP.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function p(m,v){m=lc(m);var x=m.fill,w=m.align,S=m.sign,j=m.symbol,k=m.zero,C=m.width,E=m.comma,O=m.precision,P=m.trim,A=m.type;A==="n"?(E=!0,A="g"):cP[A]||(O===void 0&&(O=12),P=!0,A="g"),(k||x==="0"&&w==="=")&&(k=!0,x="0",w="=");var M=(v&&v.prefix!==void 0?v.prefix:"")+(j==="$"?n:j==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),D=(j==="$"?r:/[%p]/.test(A)?l:"")+(v&&v.suffix!==void 0?v.suffix:""),$=cP[A],q=/[defgprs%]/.test(A);O=O===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,O)):Math.max(0,Math.min(20,O));function X(L){var Z=M,J=D,ne,re,B;if(A==="c")J=$(L)+J,L="";else{L=+L;var F=L<0||1/L<0;if(L=isNaN(L)?d:$(Math.abs(L),O),P&&(L=AW(L)),F&&+L==0&&S!=="+"&&(F=!1),Z=(F?S==="("?S:u:S==="-"||S==="("?"":S)+Z,J=(A==="s"&&!isNaN(L)&&df!==void 0?fP[8+df/3]:"")+J+(F&&S==="("?")":""),q){for(ne=-1,re=L.length;++ne<re;)if(B=L.charCodeAt(ne),48>B||B>57){J=(B===46?i+L.slice(ne+1):L.slice(ne))+J,L=L.slice(0,ne);break}}}E&&!k&&(L=t(L,1/0));var G=Z.length+L.length+J.length,W=G<C?new Array(C-G+1).join(x):"";switch(E&&k&&(L=t(W+L,W.length?C-J.length:1/0),W=""),w){case"<":L=Z+L+J+W;break;case"=":L=Z+W+L+J;break;case"^":L=W.slice(0,G=W.length>>1)+Z+L+J+W.slice(G);break;default:L=W+Z+L+J;break}return a(L)}return X.toString=function(){return m+""},X}function h(m,v){var x=Math.max(-8,Math.min(8,Math.floor(ho(v)/3)))*3,w=Math.pow(10,-x),S=p((m=lc(m),m.type="f",m),{suffix:fP[8+x/3]});return function(j){return S(w*j)}}return{format:p,formatPrefix:h}}var ad,Yx,nT;MW({thousands:",",grouping:[3],currency:["$",""]});function MW(e){return ad=TW(e),Yx=ad.format,nT=ad.formatPrefix,ad}function _W(e){return Math.max(0,-ho(Math.abs(e)))}function IW(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ho(t)/3)))*3-ho(Math.abs(e)))}function DW(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ho(t)-ho(e))+1}function rT(e,t,n,r){var i=lv(e,t,n),a;switch(r=lc(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=IW(i,l))&&(r.precision=a),nT(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=DW(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=_W(i))&&(r.precision=a-(r.type==="%")*2);break}}return Yx(r)}function js(e){var t=e.domain;return e.ticks=function(n){var r=t();return av(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return rT(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,l=r[i],u=r[a],d,p,h=10;for(u<l&&(p=l,l=u,u=p,p=i,i=a,a=p);h-- >0;){if(p=ov(l,u,n),p===d)return r[i]=l,r[a]=u,t(r);if(p>0)l=Math.floor(l/p)*p,u=Math.ceil(u/p)*p;else if(p<0)l=Math.ceil(l*p)/p,u=Math.floor(u*p)/p;else break;d=p}return e},e}function iT(){var e=Hx();return e.copy=function(){return Pc(e,iT())},hr.apply(e,arguments),js(e)}function sT(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,cf),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return sT(e).unknown(t)},e=arguments.length?Array.from(e,cf):[0,1],js(n)}function aT(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],l;return a<i&&(l=n,n=r,r=l,l=i,i=a,a=l),e[n]=t.floor(i),e[r]=t.ceil(a),e}function pP(e){return Math.log(e)}function hP(e){return Math.exp(e)}function RW(e){return-Math.log(-e)}function LW(e){return-Math.exp(-e)}function $W(e){return isFinite(e)?+("1e"+e):e<0?0:e}function zW(e){return e===10?$W:e===Math.E?Math.exp:t=>Math.pow(e,t)}function FW(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 mP(e){return(t,n)=>-e(-t,n)}function Xx(e){const t=e(pP,hP),n=t.domain;let r=10,i,a;function l(){return i=FW(r),a=zW(r),n()[0]<0?(i=mP(i),a=mP(a),e(RW,LW)):e(pP,hP),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):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 v=i(p),x=i(h),w,S;const j=u==null?10:+u;let k=[];if(!(r%1)&&x-v<j){if(v=Math.floor(v),x=Math.ceil(x),p>0){for(;v<=x;++v)for(w=1;w<r;++w)if(S=v<0?w/a(-v):w*a(v),!(S<p)){if(S>h)break;k.push(S)}}else for(;v<=x;++v)for(w=r-1;w>=1;--w)if(S=v>0?w/a(-v):w*a(v),!(S<p)){if(S>h)break;k.push(S)}k.length*2<j&&(k=av(p,h,j))}else k=av(v,x,Math.min(x-v,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=lc(d)).precision==null&&(d.trim=!0),d=Yx(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(aT(n(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function oT(){const e=Xx(rp()).domain([1,10]);return e.copy=()=>Pc(e,oT()).base(e.base()),hr.apply(e,arguments),e}function gP(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function vP(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Qx(e){var t=1,n=e(gP(t),vP(t));return n.constant=function(r){return arguments.length?e(gP(t=+r),vP(t)):t},js(n)}function lT(){var e=Qx(rp());return e.copy=function(){return Pc(e,lT()).constant(e.constant())},hr.apply(e,arguments)}function xP(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function BW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function VW(e){return e<0?-e*e:e*e}function Jx(e){var t=e(mn,mn),n=1;function r(){return n===1?e(mn,mn):n===.5?e(BW,VW):e(xP(n),xP(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},js(t)}function Zx(){var e=Jx(rp());return e.copy=function(){return Pc(e,Zx()).exponent(e.exponent())},hr.apply(e,arguments),e}function UW(){return Zx.apply(null,arguments).exponent(.5)}function yP(e){return Math.sign(e)*e*e}function WW(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function cT(){var e=Hx(),t=[0,1],n=!1,r;function i(a){var l=WW(e(a));return isNaN(l)?r:n?Math.round(l):l}return i.invert=function(a){return e.invert(yP(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,cf)).map(yP)),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 cT(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},hr.apply(i,arguments),js(i)}function uT(){var e=[],t=[],n=[],r;function i(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l<u;)n[l-1]=G9(e,l/u);return a}function a(l){return l==null||isNaN(l=+l)?r:t[Nc(n,l)]}return a.invertExtent=function(l){var u=t.indexOf(l);return u<0?[NaN,NaN]:[u>0?n[u-1]:e[0],u<n.length?n[u]:e[e.length-1]]},a.domain=function(l){if(!arguments.length)return e.slice();e=[];for(let u of l)u!=null&&!isNaN(u=+u)&&e.push(u);return e.sort(fs),i()},a.range=function(l){return arguments.length?(t=Array.from(l),i()):t.slice()},a.unknown=function(l){return arguments.length?(r=l,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return uT().domain(e).range(t).unknown(r)},hr.apply(a,arguments)}function dT(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function l(d){return d!=null&&d<=d?i[Nc(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 l}return l.domain=function(d){return arguments.length?([e,t]=d,e=+e,t=+t,u()):[e,t]},l.range=function(d){return arguments.length?(n=(i=Array.from(d)).length-1,u()):i.slice()},l.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]]},l.unknown=function(d){return arguments.length&&(a=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return dT().domain([e,t]).range(i).unknown(a)},hr.apply(js(l),arguments)}function fT(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Nc(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 l=t.indexOf(a);return[e[l-1],e[l]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return fT().domain(e).range(t).unknown(n)},hr.apply(i,arguments)}const B0=new Date,V0=new Date;function Tt(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 l=i(a),u=i.ceil(a);return a-l<u-a?l:u},i.offset=(a,l)=>(t(a=new Date(+a),l==null?1:Math.floor(l)),a),i.range=(a,l,u)=>{const d=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a<l)||!(u>0))return d;let p;do d.push(p=new Date(+a)),t(a,u),e(a);while(p<a&&a<l);return d},i.filter=a=>Tt(l=>{if(l>=l)for(;e(l),!a(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!a(l););else for(;--u>=0;)for(;t(l,1),!a(l););}),n&&(i.count=(a,l)=>(B0.setTime(+a),V0.setTime(+l),e(B0),e(V0),Math.floor(n(B0,V0))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?l=>r(l)%a===0:l=>i.count(0,l)%a===0):i)),i}const ff=Tt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ff.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Tt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ff);ff.range;const hi=1e3,or=hi*60,mi=or*60,Si=mi*24,ey=Si*7,bP=Si*30,U0=Si*365,Xs=Tt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*hi)},(e,t)=>(t-e)/hi,e=>e.getUTCSeconds());Xs.range;const ty=Tt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hi)},(e,t)=>{e.setTime(+e+t*or)},(e,t)=>(t-e)/or,e=>e.getMinutes());ty.range;const ny=Tt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*or)},(e,t)=>(t-e)/or,e=>e.getUTCMinutes());ny.range;const ry=Tt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*hi-e.getMinutes()*or)},(e,t)=>{e.setTime(+e+t*mi)},(e,t)=>(t-e)/mi,e=>e.getHours());ry.range;const iy=Tt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*mi)},(e,t)=>(t-e)/mi,e=>e.getUTCHours());iy.range;const Cc=Tt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*or)/Si,e=>e.getDate()-1);Cc.range;const ip=Tt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Si,e=>e.getUTCDate()-1);ip.range;const pT=Tt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Si,e=>Math.floor(e/Si));pT.range;function ua(e){return Tt(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())*or)/ey)}const sp=ua(0),pf=ua(1),qW=ua(2),KW=ua(3),mo=ua(4),HW=ua(5),GW=ua(6);sp.range;pf.range;qW.range;KW.range;mo.range;HW.range;GW.range;function da(e){return Tt(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)/ey)}const ap=da(0),hf=da(1),YW=da(2),XW=da(3),go=da(4),QW=da(5),JW=da(6);ap.range;hf.range;YW.range;XW.range;go.range;QW.range;JW.range;const sy=Tt(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());sy.range;const ay=Tt(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());ay.range;const Ni=Tt(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());Ni.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tt(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)});Ni.range;const ki=Tt(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());ki.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Tt(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)});ki.range;function hT(e,t,n,r,i,a){const l=[[Xs,1,hi],[Xs,5,5*hi],[Xs,15,15*hi],[Xs,30,30*hi],[a,1,or],[a,5,5*or],[a,15,15*or],[a,30,30*or],[i,1,mi],[i,3,3*mi],[i,6,6*mi],[i,12,12*mi],[r,1,Si],[r,2,2*Si],[n,1,ey],[t,1,bP],[t,3,3*bP],[e,1,U0]];function u(p,h,m){const v=h<p;v&&([p,h]=[h,p]);const x=m&&typeof m.range=="function"?m:d(p,h,m),w=x?x.range(p,+h+1):[];return v?w.reverse():w}function d(p,h,m){const v=Math.abs(h-p)/m,x=Bx(([,,j])=>j).right(l,v);if(x===l.length)return e.every(lv(p/U0,h/U0,m));if(x===0)return ff.every(Math.max(lv(p,h,m),1));const[w,S]=l[v/l[x-1][2]<l[x][2]/v?x-1:x];return w.every(S)}return[u,d]}const[ZW,eq]=hT(ki,ay,ap,pT,iy,ny),[tq,nq]=hT(Ni,sy,sp,Cc,ry,ty);function W0(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 q0(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 Cl(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function rq(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,l=e.shortDays,u=e.months,d=e.shortMonths,p=Ol(i),h=Al(i),m=Ol(a),v=Al(a),x=Ol(l),w=Al(l),S=Ol(u),j=Al(u),k=Ol(d),C=Al(d),E={a:B,A:F,b:G,B:W,c:null,d:PP,e:PP,f:Pq,g:Rq,G:$q,H:Sq,I:Nq,j:kq,L:mT,m:Cq,M:Oq,p:_,q:V,Q:AP,s:EP,S:Aq,u:Eq,U:Tq,V:Mq,w:_q,W:Iq,x:null,X:null,y:Dq,Y:Lq,Z:zq,"%":OP},O={a:ie,A:fe,b:te,B:le,c:null,d:CP,e:CP,f:Uq,g:Zq,G:tK,H:Fq,I:Bq,j:Vq,L:vT,m:Wq,M:qq,p:pe,q:Se,Q:AP,s:EP,S:Kq,u:Hq,U:Gq,V:Yq,w:Xq,W:Qq,x:null,X:null,y:Jq,Y:eK,Z:nK,"%":OP},P={a:q,A:X,b:L,B:Z,c:J,d:NP,e:NP,f:yq,g:SP,G:jP,H:kP,I:kP,j:mq,L:xq,m:hq,M:gq,p:$,q:pq,Q:wq,s:jq,S:vq,u:lq,U:cq,V:uq,w:oq,W:dq,x:ne,X:re,y:SP,Y:jP,Z:fq,"%":bq};E.x=A(n,E),E.X=A(r,E),E.c=A(t,E),O.x=A(n,O),O.X=A(r,O),O.c=A(t,O);function A(H,me){return function(Oe){var se=[],Le=-1,De=0,Qe=H.length,Ze,_t,Mn;for(Oe instanceof Date||(Oe=new Date(+Oe));++Le<Qe;)H.charCodeAt(Le)===37&&(se.push(H.slice(De,Le)),(_t=wP[Ze=H.charAt(++Le)])!=null?Ze=H.charAt(++Le):_t=Ze==="e"?" ":"0",(Mn=me[Ze])&&(Ze=Mn(Oe,_t)),se.push(Ze),De=Le+1);return se.push(H.slice(De,Le)),se.join("")}}function M(H,me){return function(Oe){var se=Cl(1900,void 0,1),Le=D(se,H,Oe+="",0),De,Qe;if(Le!=Oe.length)return null;if("Q"in se)return new Date(se.Q);if("s"in se)return new Date(se.s*1e3+("L"in se?se.L:0));if(me&&!("Z"in se)&&(se.Z=0),"p"in se&&(se.H=se.H%12+se.p*12),se.m===void 0&&(se.m="q"in se?se.q:0),"V"in se){if(se.V<1||se.V>53)return null;"w"in se||(se.w=1),"Z"in se?(De=q0(Cl(se.y,0,1)),Qe=De.getUTCDay(),De=Qe>4||Qe===0?hf.ceil(De):hf(De),De=ip.offset(De,(se.V-1)*7),se.y=De.getUTCFullYear(),se.m=De.getUTCMonth(),se.d=De.getUTCDate()+(se.w+6)%7):(De=W0(Cl(se.y,0,1)),Qe=De.getDay(),De=Qe>4||Qe===0?pf.ceil(De):pf(De),De=Cc.offset(De,(se.V-1)*7),se.y=De.getFullYear(),se.m=De.getMonth(),se.d=De.getDate()+(se.w+6)%7)}else("W"in se||"U"in se)&&("w"in se||(se.w="u"in se?se.u%7:"W"in se?1:0),Qe="Z"in se?q0(Cl(se.y,0,1)).getUTCDay():W0(Cl(se.y,0,1)).getDay(),se.m=0,se.d="W"in se?(se.w+6)%7+se.W*7-(Qe+5)%7:se.w+se.U*7-(Qe+6)%7);return"Z"in se?(se.H+=se.Z/100|0,se.M+=se.Z%100,q0(se)):W0(se)}}function D(H,me,Oe,se){for(var Le=0,De=me.length,Qe=Oe.length,Ze,_t;Le<De;){if(se>=Qe)return-1;if(Ze=me.charCodeAt(Le++),Ze===37){if(Ze=me.charAt(Le++),_t=P[Ze in wP?me.charAt(Le++):Ze],!_t||(se=_t(H,Oe,se))<0)return-1}else if(Ze!=Oe.charCodeAt(se++))return-1}return se}function $(H,me,Oe){var se=p.exec(me.slice(Oe));return se?(H.p=h.get(se[0].toLowerCase()),Oe+se[0].length):-1}function q(H,me,Oe){var se=x.exec(me.slice(Oe));return se?(H.w=w.get(se[0].toLowerCase()),Oe+se[0].length):-1}function X(H,me,Oe){var se=m.exec(me.slice(Oe));return se?(H.w=v.get(se[0].toLowerCase()),Oe+se[0].length):-1}function L(H,me,Oe){var se=k.exec(me.slice(Oe));return se?(H.m=C.get(se[0].toLowerCase()),Oe+se[0].length):-1}function Z(H,me,Oe){var se=S.exec(me.slice(Oe));return se?(H.m=j.get(se[0].toLowerCase()),Oe+se[0].length):-1}function J(H,me,Oe){return D(H,t,me,Oe)}function ne(H,me,Oe){return D(H,n,me,Oe)}function re(H,me,Oe){return D(H,r,me,Oe)}function B(H){return l[H.getDay()]}function F(H){return a[H.getDay()]}function G(H){return d[H.getMonth()]}function W(H){return u[H.getMonth()]}function _(H){return i[+(H.getHours()>=12)]}function V(H){return 1+~~(H.getMonth()/3)}function ie(H){return l[H.getUTCDay()]}function fe(H){return a[H.getUTCDay()]}function te(H){return d[H.getUTCMonth()]}function le(H){return u[H.getUTCMonth()]}function pe(H){return i[+(H.getUTCHours()>=12)]}function Se(H){return 1+~~(H.getUTCMonth()/3)}return{format:function(H){var me=A(H+="",E);return me.toString=function(){return H},me},parse:function(H){var me=M(H+="",!1);return me.toString=function(){return H},me},utcFormat:function(H){var me=A(H+="",O);return me.toString=function(){return H},me},utcParse:function(H){var me=M(H+="",!0);return me.toString=function(){return H},me}}}var wP={"-":"",_:" ",0:"0"},qt=/^\s*\d+/,iq=/^%/,sq=/[\\^$*+?|[\]().{}]/g;function We(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 aq(e){return e.replace(sq,"\\$&")}function Ol(e){return new RegExp("^(?:"+e.map(aq).join("|")+")","i")}function Al(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function oq(e,t,n){var r=qt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function lq(e,t,n){var r=qt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function cq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function uq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function dq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function jP(e,t,n){var r=qt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function SP(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fq(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 pq(e,t,n){var r=qt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function hq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function NP(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function mq(e,t,n){var r=qt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function kP(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function gq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function vq(e,t,n){var r=qt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function xq(e,t,n){var r=qt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function yq(e,t,n){var r=qt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function bq(e,t,n){var r=iq.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function wq(e,t,n){var r=qt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function jq(e,t,n){var r=qt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function PP(e,t){return We(e.getDate(),t,2)}function Sq(e,t){return We(e.getHours(),t,2)}function Nq(e,t){return We(e.getHours()%12||12,t,2)}function kq(e,t){return We(1+Cc.count(Ni(e),e),t,3)}function mT(e,t){return We(e.getMilliseconds(),t,3)}function Pq(e,t){return mT(e,t)+"000"}function Cq(e,t){return We(e.getMonth()+1,t,2)}function Oq(e,t){return We(e.getMinutes(),t,2)}function Aq(e,t){return We(e.getSeconds(),t,2)}function Eq(e){var t=e.getDay();return t===0?7:t}function Tq(e,t){return We(sp.count(Ni(e)-1,e),t,2)}function gT(e){var t=e.getDay();return t>=4||t===0?mo(e):mo.ceil(e)}function Mq(e,t){return e=gT(e),We(mo.count(Ni(e),e)+(Ni(e).getDay()===4),t,2)}function _q(e){return e.getDay()}function Iq(e,t){return We(pf.count(Ni(e)-1,e),t,2)}function Dq(e,t){return We(e.getFullYear()%100,t,2)}function Rq(e,t){return e=gT(e),We(e.getFullYear()%100,t,2)}function Lq(e,t){return We(e.getFullYear()%1e4,t,4)}function $q(e,t){var n=e.getDay();return e=n>=4||n===0?mo(e):mo.ceil(e),We(e.getFullYear()%1e4,t,4)}function zq(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+We(t/60|0,"0",2)+We(t%60,"0",2)}function CP(e,t){return We(e.getUTCDate(),t,2)}function Fq(e,t){return We(e.getUTCHours(),t,2)}function Bq(e,t){return We(e.getUTCHours()%12||12,t,2)}function Vq(e,t){return We(1+ip.count(ki(e),e),t,3)}function vT(e,t){return We(e.getUTCMilliseconds(),t,3)}function Uq(e,t){return vT(e,t)+"000"}function Wq(e,t){return We(e.getUTCMonth()+1,t,2)}function qq(e,t){return We(e.getUTCMinutes(),t,2)}function Kq(e,t){return We(e.getUTCSeconds(),t,2)}function Hq(e){var t=e.getUTCDay();return t===0?7:t}function Gq(e,t){return We(ap.count(ki(e)-1,e),t,2)}function xT(e){var t=e.getUTCDay();return t>=4||t===0?go(e):go.ceil(e)}function Yq(e,t){return e=xT(e),We(go.count(ki(e),e)+(ki(e).getUTCDay()===4),t,2)}function Xq(e){return e.getUTCDay()}function Qq(e,t){return We(hf.count(ki(e)-1,e),t,2)}function Jq(e,t){return We(e.getUTCFullYear()%100,t,2)}function Zq(e,t){return e=xT(e),We(e.getUTCFullYear()%100,t,2)}function eK(e,t){return We(e.getUTCFullYear()%1e4,t,4)}function tK(e,t){var n=e.getUTCDay();return e=n>=4||n===0?go(e):go.ceil(e),We(e.getUTCFullYear()%1e4,t,4)}function nK(){return"+0000"}function OP(){return"%"}function AP(e){return+e}function EP(e){return Math.floor(+e/1e3)}var Ba,yT,bT;rK({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 rK(e){return Ba=rq(e),yT=Ba.format,Ba.parse,bT=Ba.utcFormat,Ba.utcParse,Ba}function iK(e){return new Date(e)}function sK(e){return e instanceof Date?+e:+new Date(+e)}function oy(e,t,n,r,i,a,l,u,d,p){var h=Hx(),m=h.invert,v=h.domain,x=p(".%L"),w=p(":%S"),S=p("%I:%M"),j=p("%I %p"),k=p("%a %d"),C=p("%b %d"),E=p("%B"),O=p("%Y");function P(A){return(d(A)<A?x:u(A)<A?w:l(A)<A?S:a(A)<A?j:r(A)<A?i(A)<A?k:C:n(A)<A?E:O)(A)}return h.invert=function(A){return new Date(m(A))},h.domain=function(A){return arguments.length?v(Array.from(A,sK)):v().map(iK)},h.ticks=function(A){var M=v();return e(M[0],M[M.length-1],A??10)},h.tickFormat=function(A,M){return M==null?P:p(M)},h.nice=function(A){var M=v();return(!A||typeof A.range!="function")&&(A=t(M[0],M[M.length-1],A??10)),A?v(aT(M,A)):h},h.copy=function(){return Pc(h,oy(e,t,n,r,i,a,l,u,d,p))},h}function aK(){return hr.apply(oy(tq,nq,Ni,sy,sp,Cc,ry,ty,Xs,yT).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function oK(){return hr.apply(oy(ZW,eq,ki,ay,ap,ip,iy,ny,Xs,bT).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function op(){var e=0,t=1,n,r,i,a,l=mn,u=!1,d;function p(m){return m==null||isNaN(m=+m)?d:l(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?(l=m,p):l};function h(m){return function(v){var x,w;return arguments.length?([x,w]=v,l=m(x,w),p):[l(0),l(1)]}}return p.range=h(Oo),p.rangeRound=h(Kx),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 Ss(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function wT(){var e=js(op()(mn));return e.copy=function(){return Ss(e,wT())},Ti.apply(e,arguments)}function jT(){var e=Xx(op()).domain([1,10]);return e.copy=function(){return Ss(e,jT()).base(e.base())},Ti.apply(e,arguments)}function ST(){var e=Qx(op());return e.copy=function(){return Ss(e,ST()).constant(e.constant())},Ti.apply(e,arguments)}function ly(){var e=Jx(op());return e.copy=function(){return Ss(e,ly()).exponent(e.exponent())},Ti.apply(e,arguments)}function lK(){return ly.apply(null,arguments).exponent(.5)}function NT(){var e=[],t=mn;function n(r){if(r!=null&&!isNaN(r=+r))return t((Nc(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(fs),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)=>H9(e,a/r))},n.copy=function(){return NT(t).domain(e)},Ti.apply(n,arguments)}function lp(){var e=0,t=.5,n=1,r=1,i,a,l,u,d,p=mn,h,m=!1,v;function x(S){return isNaN(S=+S)?v:(S=.5+((S=+h(S))-a)*(r*S<r*a?u:d),p(m?Math.max(0,Math.min(1,S)):S))}x.domain=function(S){return arguments.length?([e,t,n]=S,i=h(e=+e),a=h(t=+t),l=h(n=+n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,x):[e,t,n]},x.clamp=function(S){return arguments.length?(m=!!S,x):m},x.interpolator=function(S){return arguments.length?(p=S,x):p};function w(S){return function(j){var k,C,E;return arguments.length?([k,C,E]=j,p=bW(S,[k,C,E]),x):[p(0),p(.5),p(1)]}}return x.range=w(Oo),x.rangeRound=w(Kx),x.unknown=function(S){return arguments.length?(v=S,x):v},function(S){return h=S,i=S(e),a=S(t),l=S(n),u=i===a?0:.5/(a-i),d=a===l?0:.5/(l-a),r=a<i?-1:1,x}}function kT(){var e=js(lp()(mn));return e.copy=function(){return Ss(e,kT())},Ti.apply(e,arguments)}function PT(){var e=Xx(lp()).domain([.1,1,10]);return e.copy=function(){return Ss(e,PT()).base(e.base())},Ti.apply(e,arguments)}function CT(){var e=Qx(lp());return e.copy=function(){return Ss(e,CT()).constant(e.constant())},Ti.apply(e,arguments)}function cy(){var e=Jx(lp());return e.copy=function(){return Ss(e,cy()).exponent(e.exponent())},Ti.apply(e,arguments)}function cK(){return cy.apply(null,arguments).exponent(.5)}const Dl=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Ux,scaleDiverging:kT,scaleDivergingLog:PT,scaleDivergingPow:cy,scaleDivergingSqrt:cK,scaleDivergingSymlog:CT,scaleIdentity:sT,scaleImplicit:cv,scaleLinear:iT,scaleLog:oT,scaleOrdinal:Vx,scalePoint:X9,scalePow:Zx,scaleQuantile:uT,scaleQuantize:dT,scaleRadial:cT,scaleSequential:wT,scaleSequentialLog:jT,scaleSequentialPow:ly,scaleSequentialQuantile:NT,scaleSequentialSqrt:lK,scaleSequentialSymlog:ST,scaleSqrt:UW,scaleSymlog:lT,scaleThreshold:fT,scaleTime:aK,scaleUtc:oK,tickFormat:rT},Symbol.toStringTag,{value:"Module"}));var Mi=e=>e.chartData,OT=Q([Mi],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),AT=(e,t,n,r)=>r?OT(e):Mi(e),uK=(e,t,n)=>n?OT(e):Mi(e);function Pi(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(qe(t)&&qe(n))return!0}return!1}function TP(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function ET(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(qe(n))i=n;else if(typeof n=="function")return;if(qe(r))a=r;else if(typeof r=="function")return;var l=[i,a];if(Pi(l))return l}}function dK(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Pi(r))return TP(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,l,u;if(i==="auto")t!=null&&(l=Math.min(...t));else if(Ne(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&VN.test(i)){var d=VN.exec(i);if(d==null||d[1]==null||t==null)l=void 0;else{var p=+d[1];l=t[0]-p}}else l=t==null?void 0:t[0];if(a==="auto")t!=null&&(u=Math.max(...t));else if(Ne(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"&&UN.test(a)){var h=UN.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 v=[l,u];if(Pi(v))return t==null?v:TP(v,t,n)}}}var Ao=1e9,fK={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},dy,ft=!0,fr="[DecimalError] ",ea=fr+"Invalid argument: ",uy=fr+"Exponent out of range: ",Eo=Math.floor,Ks=Math.pow,pK=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,$n,Vt=1e7,lt=7,TT=9007199254740991,mf=Eo(TT/lt),xe={};xe.absoluteValue=xe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};xe.comparedTo=xe.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};xe.decimalPlaces=xe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*lt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};xe.dividedBy=xe.div=function(e){return xi(this,new this.constructor(e))};xe.dividedToIntegerBy=xe.idiv=function(e){var t=this,n=t.constructor;return et(xi(t,new n(e),0,1),n.precision)};xe.equals=xe.eq=function(e){return!this.cmp(e)};xe.exponent=function(){return Pt(this)};xe.greaterThan=xe.gt=function(e){return this.cmp(e)>0};xe.greaterThanOrEqualTo=xe.gte=function(e){return this.cmp(e)>=0};xe.isInteger=xe.isint=function(){return this.e>this.d.length-2};xe.isNegative=xe.isneg=function(){return this.s<0};xe.isPositive=xe.ispos=function(){return this.s>0};xe.isZero=function(){return this.s===0};xe.lessThan=xe.lt=function(e){return this.cmp(e)<0};xe.lessThanOrEqualTo=xe.lte=function(e){return this.cmp(e)<1};xe.logarithm=xe.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($n))throw Error(fr+"NaN");if(n.s<1)throw Error(fr+(n.s?"NaN":"-Infinity"));return n.eq($n)?new r(0):(ft=!1,t=xi(cc(n,a),cc(e,a),a),ft=!0,et(t,i))};xe.minus=xe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?IT(t,e):MT(t,(e.s=-e.s,e))};xe.modulo=xe.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(fr+"NaN");return n.s?(ft=!1,t=xi(n,e,0,1).times(e),ft=!0,n.minus(t)):et(new r(n),i)};xe.naturalExponential=xe.exp=function(){return _T(this)};xe.naturalLogarithm=xe.ln=function(){return cc(this)};xe.negated=xe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};xe.plus=xe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?MT(t,e):IT(t,(e.s=-e.s,e))};xe.precision=xe.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=Pt(i)+1,r=i.d.length-1,n=r*lt+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};xe.squareRoot=xe.sqrt=function(){var e,t,n,r,i,a,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(fr+"NaN")}for(e=Pt(u),ft=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Kr(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Eo((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=l=n+3;;)if(a=r,r=a.plus(xi(u,a,l+2)).times(.5),Kr(a.d).slice(0,l)===(t=Kr(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),i==l&&t=="4999"){if(et(a,n+1,0),a.times(a).eq(u)){r=a;break}}else if(t!="9999")break;l+=4}return ft=!0,et(r,n)};xe.times=xe.mul=function(e){var t,n,r,i,a,l,u,d,p,h=this,m=h.constructor,v=h.d,x=(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=v.length,p=x.length,d<p&&(a=v,v=x,x=a,l=d,d=p,p=l),a=[],l=d+p,r=l;r--;)a.push(0);for(r=p;--r>=0;){for(t=0,i=d+r;i>r;)u=a[i]+x[r]*v[i-r-1]+t,a[i--]=u%Vt|0,t=u/Vt|0;a[i]=(a[i]+t)%Vt|0}for(;!a[--l];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,ft?et(e,m.precision):e};xe.toDecimalPlaces=xe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Zr(e,0,Ao),t===void 0?t=r.rounding:Zr(t,0,8),et(n,e+Pt(n)+1,t))};xe.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=oa(r,!0):(Zr(e,0,Ao),t===void 0?t=i.rounding:Zr(t,0,8),r=et(new i(r),e+1,t),n=oa(r,!0,e+1)),n};xe.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?oa(i):(Zr(e,0,Ao),t===void 0?t=a.rounding:Zr(t,0,8),r=et(new a(i),e+Pt(i)+1,t),n=oa(r.abs(),!1,e+Pt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};xe.toInteger=xe.toint=function(){var e=this,t=e.constructor;return et(new t(e),Pt(e)+1,t.rounding)};xe.toNumber=function(){return+this};xe.toPower=xe.pow=function(e){var t,n,r,i,a,l,u=this,d=u.constructor,p=12,h=+(e=new d(e));if(!e.s)return new d($n);if(u=new d(u),!u.s){if(e.s<1)throw Error(fr+"Infinity");return u}if(u.eq($n))return u;if(r=d.precision,e.eq($n))return et(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,a=u.s,l){if((n=h<0?-h:h)<=TT){for(i=new d($n),t=Math.ceil(r/lt+4),ft=!1;n%2&&(i=i.times(u),_P(i.d,t)),n=Eo(n/2),n!==0;)u=u.times(u),_P(u.d,t);return ft=!0,e.s<0?new d($n).div(i):et(i,r)}}else if(a<0)throw Error(fr+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,ft=!1,i=e.times(cc(u,r+p)),ft=!0,i=_T(i),i.s=a,i};xe.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=Pt(i),r=oa(i,n<=a.toExpNeg||n>=a.toExpPos)):(Zr(e,1,Ao),t===void 0?t=a.rounding:Zr(t,0,8),i=et(new a(i),e,t),n=Pt(i),r=oa(i,e<=n||n<=a.toExpNeg,e)),r};xe.toSignificantDigits=xe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Zr(e,1,Ao),t===void 0?t=r.rounding:Zr(t,0,8)),et(new r(n),e,t)};xe.toString=xe.valueOf=xe.val=xe.toJSON=xe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Pt(e),n=e.constructor;return oa(e,t<=n.toExpNeg||t>=n.toExpPos)};function MT(e,t){var n,r,i,a,l,u,d,p,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),ft?et(t,m):t;if(d=e.d,p=t.d,l=e.e,i=t.e,d=d.slice(),a=l-i,a){for(a<0?(r=d,a=-a,u=p.length):(r=p,i=l,u=d.length),l=Math.ceil(m/lt),u=l>u?l+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)/Vt|0,d[a]%=Vt;for(n&&(d.unshift(n),++i),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=i,ft?et(t,m):t}function Zr(e,t,n){if(e!==~~e||e<t||e>n)throw Error(ea+e)}function Kr(e){var t,n,r,i=e.length-1,a="",l=e[0];if(i>0){for(a+=l,t=1;t<i;t++)r=e[t]+"",n=lt-r.length,n&&(a+=ls(n)),a+=r;l=e[t],r=l+"",n=lt-r.length,n&&(a+=ls(n))}else if(l===0)return"0";for(;l%10===0;)l/=10;return a+l}var xi=(function(){function e(r,i){var a,l=0,u=r.length;for(r=r.slice();u--;)a=r[u]*i+l,r[u]=a%Vt|0,l=a/Vt|0;return l&&r.unshift(l),r}function t(r,i,a,l){var u,d;if(a!=l)d=a>l?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 l=0;a--;)r[a]-=l,l=r[a]<i[a]?1:0,r[a]=l*Vt+r[a]-i[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,i,a,l){var u,d,p,h,m,v,x,w,S,j,k,C,E,O,P,A,M,D,$=r.constructor,q=r.s==i.s?1:-1,X=r.d,L=i.d;if(!r.s)return new $(r);if(!i.s)throw Error(fr+"Division by zero");for(d=r.e-i.e,M=L.length,P=X.length,x=new $(q),w=x.d=[],p=0;L[p]==(X[p]||0);)++p;if(L[p]>(X[p]||0)&&--d,a==null?C=a=$.precision:l?C=a+(Pt(r)-Pt(i))+1:C=a,C<0)return new $(0);if(C=C/lt+2|0,p=0,M==1)for(h=0,L=L[0],C++;(p<P||h)&&C--;p++)E=h*Vt+(X[p]||0),w[p]=E/L|0,h=E%L|0;else{for(h=Vt/(L[0]+1)|0,h>1&&(L=e(L,h),X=e(X,h),M=L.length,P=X.length),O=M,S=X.slice(0,M),j=S.length;j<M;)S[j++]=0;D=L.slice(),D.unshift(0),A=L[0],L[1]>=Vt/2&&++A;do h=0,u=t(L,S,M,j),u<0?(k=S[0],M!=j&&(k=k*Vt+(S[1]||0)),h=k/A|0,h>1?(h>=Vt&&(h=Vt-1),m=e(L,h),v=m.length,j=S.length,u=t(m,S,v,j),u==1&&(h--,n(m,M<v?D:L,v))):(h==0&&(u=h=1),m=L.slice()),v=m.length,v<j&&m.unshift(0),n(S,m,j),u==-1&&(j=S.length,u=t(L,S,M,j),u<1&&(h++,n(S,M<j?D:L,j))),j=S.length):u===0&&(h++,S=[0]),w[p++]=h,u&&S[0]?S[j++]=X[O]||0:(S=[X[O]],j=1);while((O++<P||S[0]!==void 0)&&C--)}return w[0]||w.shift(),x.e=d,et(x,l?a+Pt(x)+1:a)}})();function _T(e,t){var n,r,i,a,l,u,d=0,p=0,h=e.constructor,m=h.precision;if(Pt(e)>16)throw Error(uy+Pt(e));if(!e.s)return new h($n);for(ft=!1,u=m,l=new h(.03125);e.abs().gte(.1);)e=e.times(l),p+=5;for(r=Math.log(Ks(2,p))/Math.LN10*2+5|0,u+=r,n=i=a=new h($n),h.precision=u;;){if(i=et(i.times(e),u),n=n.times(++d),l=a.plus(xi(i,n,u)),Kr(l.d).slice(0,u)===Kr(a.d).slice(0,u)){for(;p--;)a=et(a.times(a),u);return h.precision=m,t==null?(ft=!0,et(a,m)):a}a=l}}function Pt(e){for(var t=e.e*lt,n=e.d[0];n>=10;n/=10)t++;return t}function K0(e,t,n){if(t>e.LN10.sd())throw ft=!0,n&&(e.precision=n),Error(fr+"LN10 precision limit exceeded");return et(new e(e.LN10),t)}function ls(e){for(var t="";e--;)t+="0";return t}function cc(e,t){var n,r,i,a,l,u,d,p,h,m=1,v=10,x=e,w=x.d,S=x.constructor,j=S.precision;if(x.s<1)throw Error(fr+(x.s?"NaN":"-Infinity"));if(x.eq($n))return new S(0);if(t==null?(ft=!1,p=j):p=t,x.eq(10))return t==null&&(ft=!0),K0(S,p);if(p+=v,S.precision=p,n=Kr(w),r=n.charAt(0),a=Pt(x),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)x=x.times(e),n=Kr(x.d),r=n.charAt(0),m++;a=Pt(x),r>1?(x=new S("0."+n),a++):x=new S(r+"."+n.slice(1))}else return d=K0(S,p+2,j).times(a+""),x=cc(new S(r+"."+n.slice(1)),p-v).plus(d),S.precision=j,t==null?(ft=!0,et(x,j)):x;for(u=l=x=xi(x.minus($n),x.plus($n),p),h=et(x.times(x),p),i=3;;){if(l=et(l.times(h),p),d=u.plus(xi(l,new S(i),p)),Kr(d.d).slice(0,p)===Kr(u.d).slice(0,p))return u=u.times(2),a!==0&&(u=u.plus(K0(S,p+2,j).times(a+""))),u=xi(u,new S(m),p),S.precision=j,t==null?(ft=!0,et(u,j)):u;u=d,i+=2}}function MP(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=Eo(n/lt),e.d=[],r=(n+1)%lt,n<0&&(r+=lt),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=lt;r<i;)e.d.push(+t.slice(r,r+=lt));t=t.slice(r),r=lt-t.length}else r-=i;for(;r--;)t+="0";if(e.d.push(+t),ft&&(e.e>mf||e.e<-mf))throw Error(uy+n)}else e.s=0,e.e=0,e.d=[0];return e}function et(e,t,n){var r,i,a,l,u,d,p,h,m=e.d;for(l=1,a=m[0];a>=10;a/=10)l++;if(r=t-l,r<0)r+=lt,i=t,p=m[h=0];else{if(h=Math.ceil((r+1)/lt),a=m.length,h>=a)return e;for(p=a=m[h],l=1;a>=10;a/=10)l++;r%=lt,i=r-lt+l}if(n!==void 0&&(a=Ks(10,l-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,l-i):0:m[h-1])%10&1||n==(e.s<0?8:7))),t<1||!m[0])return d?(a=Pt(e),m.length=1,t=t-a-1,m[0]=Ks(10,(lt-t%lt)%lt),e.e=Eo(-t/lt)||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,lt-r),m[h]=i>0?(p/Ks(10,l-i)%Ks(10,i)|0)*a:0),d)for(;;)if(h==0){(m[0]+=a)==Vt&&(m[0]=1,++e.e);break}else{if(m[h]+=a,m[h]!=Vt)break;m[h--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(ft&&(e.e>mf||e.e<-mf))throw Error(uy+Pt(e));return e}function IT(e,t){var n,r,i,a,l,u,d,p,h,m,v=e.constructor,x=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),ft?et(t,x):t;if(d=e.d,m=t.d,r=t.e,p=e.e,d=d.slice(),l=p-r,l){for(h=l<0,h?(n=d,l=-l,u=m.length):(n=m,r=p,u=d.length),i=Math.max(Math.ceil(x/lt),u)+2,l>i&&(l=i,n.length=1),n.reverse(),i=l;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}l=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>l;){if(d[--i]<m[i]){for(a=i;a&&d[--a]===0;)d[a]=Vt-1;--d[a],d[i]+=Vt}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,ft?et(t,x):t):new v(0)}function oa(e,t,n){var r,i=Pt(e),a=Kr(e.d),l=a.length;return t?(n&&(r=n-l)>0?a=a.charAt(0)+"."+a.slice(1)+ls(r):l>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ls(-i-1)+a,n&&(r=n-l)>0&&(a+=ls(r))):i>=l?(a+=ls(i+1-l),n&&(r=n-i-1)>0&&(a=a+"."+ls(r))):((r=i+1)<l&&(a=a.slice(0,r)+"."+a.slice(r)),n&&(r=n-l)>0&&(i+1===l&&(a+="."),a+=ls(r))),e.s<0?"-"+a:a}function _P(e,t){if(e.length>t)return e.length=t,!0}function DT(e){var t,n,r;function i(a){var l=this;if(!(l instanceof i))return new i(a);if(l.constructor=i,a instanceof i){l.s=a.s,l.e=a.e,l.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(ea+a);if(a>0)l.s=1;else if(a<0)a=-a,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(a===~~a&&a<1e7){l.e=0,l.d=[a];return}return MP(l,a.toString())}else if(typeof a!="string")throw Error(ea+a);if(a.charCodeAt(0)===45?(a=a.slice(1),l.s=-1):l.s=1,pK.test(a))MP(l,a);else throw Error(ea+a)}if(i.prototype=xe,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=DT,i.config=i.set=hK,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 hK(e){if(!e||typeof e!="object")throw Error(fr+"Object expected");var t,n,r,i=["precision",1,Ao,"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(Eo(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 dy=DT(fK);$n=new dy(1);const Ye=dy;function RT(e){var t;return e===0?t=1:t=Math.floor(new Ye(e).abs().log(10).toNumber())+1,t}function LT(e,t,n){for(var r=new Ye(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var $T=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},zT=(e,t,n)=>{if(e.lte(0))return new Ye(0);var r=RT(e.toNumber()),i=new Ye(10).pow(r),a=e.div(i),l=r!==1?.05:.1,u=new Ye(Math.ceil(a.div(l).toNumber())).add(n).mul(l),d=u.mul(i);return t?new Ye(d.toNumber()):new Ye(Math.ceil(d.toNumber()))},mK=(e,t,n)=>{var r=new Ye(1),i=new Ye(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Ye(10).pow(RT(e)-1),i=new Ye(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Ye(Math.floor(e)))}else e===0?i=new Ye(Math.floor((t-1)/2)):n||(i=new Ye(Math.floor(e)));for(var l=Math.floor((t-1)/2),u=[],d=0;d<t;d++)u.push(i.add(new Ye(d-l).mul(r)).toNumber());return u},FT=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 Ye(0),tickMin:new Ye(0),tickMax:new Ye(0)};var l=zT(new Ye(n).sub(t).div(r-1),i,a),u;t<=0&&n>=0?u=new Ye(0):(u=new Ye(t).add(n).div(2),u=u.sub(new Ye(u).mod(l)));var d=Math.ceil(u.sub(t).div(l).toNumber()),p=Math.ceil(new Ye(n).sub(u).div(l).toNumber()),h=d+p+1;return h>r?FT(t,n,r,i,a+1):(h<r&&(p=n>0?p+(r-h):p,d=n>0?d:d+(r-h)),{step:l,tickMin:u.sub(new Ye(d).mul(l)),tickMax:u.add(new Ye(p).mul(l))})},gK=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,l=Math.max(i,2),[u,d]=$T([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 mK(u,i,a);var{step:h,tickMin:m,tickMax:v}=FT(u,d,l,a,0),x=LT(m,v.add(new Ye(.1).mul(h)),h);return n>r?x.reverse():x},vK=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[l,u]=$T([r,i]);if(l===-1/0||u===1/0)return[r,i];if(l===u)return[l];var d=Math.max(n,2),p=zT(new Ye(u).sub(l).div(d-1),a,0),h=[...LT(new Ye(l),new Ye(u),p),u];return a===!1&&(h=h.map(m=>Math.round(m))),r>i?h.reverse():h},BT=e=>e.rootProps.maxBarSize,xK=e=>e.rootProps.barGap,VT=e=>e.rootProps.barCategoryGap,yK=e=>e.rootProps.barSize,cp=e=>e.rootProps.stackOffset,UT=e=>e.rootProps.reverseStackOrder,fy=e=>e.options.chartName,py=e=>e.rootProps.syncId,WT=e=>e.rootProps.syncMethod,hy=e=>e.options.eventEmitter,An={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"},Vr={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},up=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function dp(e,t,n){if(n!=="auto")return n;if(e!=null)return ws(e,t)?"category":"number"}function IP(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 gf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?IP(Object(n),!0).forEach(function(r){bK(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):IP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bK(e,t,n){return(t=wK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wK(e){var t=jK(e,"string");return typeof t=="symbol"?t:t+""}function jK(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 DP={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},RP={allowDataOverflow:Vr.allowDataOverflow,allowDecimals:Vr.allowDecimals,allowDuplicatedCategory:Vr.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Vr.radiusAxisId,includeHidden:Vr.includeHidden,name:void 0,reversed:Vr.reversed,scale:Vr.scale,tick:Vr.tick,tickCount:Vr.tickCount,ticks:void 0,type:Vr.type,unit:void 0},SK=(e,t)=>{if(t!=null)return e.polarAxis.angleAxis[t]},my=Q([SK,EE],(e,t)=>{var n;if(e!=null)return e;var r=(n=dp(t,"angleAxis",DP.type))!==null&&n!==void 0?n:"category";return gf(gf({},DP),{},{type:r})}),NK=(e,t)=>e.polarAxis.radiusAxis[t],gy=Q([NK,EE],(e,t)=>{var n;if(e!=null)return e;var r=(n=dp(t,"radiusAxis",RP.type))!==null&&n!==void 0?n:"category";return gf(gf({},RP),{},{type:r})}),fp=e=>e.polarOptions,vy=Q([Ai,Ei,Wt],w9),qT=Q([fp,vy],(e,t)=>{if(e!=null)return Ar(e.innerRadius,t,0)}),KT=Q([fp,vy],(e,t)=>{if(e!=null)return Ar(e.outerRadius,t,t*.8)}),kK=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},HT=Q([fp],kK);Q([my,HT],up);var GT=Q([vy,qT,KT],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});Q([gy,GT],up);var YT=Q([tt,fp,qT,KT,Ai,Ei],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:l,cy:u,startAngle:d,endAngle:p}=t;return{cx:Ar(l,i,i/2),cy:Ar(u,a,a/2),innerRadius:n,outerRadius:r,startAngle:d,endAngle:p,clockWise:!1}}}),Kt=(e,t)=>t,pp=(e,t,n)=>n;function xy(e){return e==null?void 0:e.id}function XT(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,l=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=xy(u);p.forEach((m,v)=>{var x=a==null||i?v:String(tn(m,a,null)),w=tn(m,u.dataKey,0),S;l.has(x)?S=l.get(x):S={},Object.assign(S,{[h]:w}),l.set(x,S)})}}),Array.from(l.values())}function hp(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var mp=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function gp(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function PK(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 Ht=e=>{var t=tt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},To=e=>e.tooltip.settings.axisId;function CK(e){if(e in Dl)return Dl[e]();var t="scale".concat(xc(e));if(t in Dl)return Dl[t]()}function LP(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 l(){return a.apply(this,arguments)}return l.toString=function(){return a.toString()},l})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var l=i[0],u=i[1];return l<=u?a>=l&&a<=u:a>=u&&a<=l},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,l)=>{var u=e(a);if(u!=null){if(e.bandwidth&&l!==null&&l!==void 0&&l.position){var d=e.bandwidth();switch(l.position){case"middle":u+=d/2;break;case"end":u+=d;break}}return u}}}}function $P(e,t,n){if(typeof e=="function")return LP(e.copy().domain(t).range(n));if(e!=null){var r=CK(e);if(r!=null)return r.domain(t).range(n),LP(r)}}var OK=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Pi(t)){for(var n,r,i=0;i<t.length;i++){var a=t[i];qe(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 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 vf(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){AK(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 AK(e,t,n){return(t=EK(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EK(e){var t=TK(e,"string");return typeof t=="symbol"?t:t+""}function TK(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 pv=[0,"auto"],Ft={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},QT=(e,t)=>e.cartesianAxis.xAxis[t],_i=(e,t)=>{var n=QT(e,t);return n??Ft},Bt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:pv,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:wc},JT=(e,t)=>e.cartesianAxis.yAxis[t],Ii=(e,t)=>{var n=JT(e,t);return n??Bt},MK={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:""},yy=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??MK},xn=(e,t,n)=>{switch(t){case"xAxis":return _i(e,n);case"yAxis":return Ii(e,n);case"zAxis":return yy(e,n);case"angleAxis":return my(e,n);case"radiusAxis":return gy(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},_K=(e,t,n)=>{switch(t){case"xAxis":return _i(e,n);case"yAxis":return Ii(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Oc=(e,t,n)=>{switch(t){case"xAxis":return _i(e,n);case"yAxis":return Ii(e,n);case"angleAxis":return my(e,n);case"radiusAxis":return gy(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},ZT=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function e5(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 by=e=>e.graphicalItems.cartesianItems,IK=Q([Kt,pp],e5),t5=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Ac=Q([by,xn,IK],t5,{memoizeOptions:{resultEqualityCheck:gp}}),n5=Q([Ac],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(hp)),r5=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),DK=Q([Ac],r5),i5=e=>e.map(t=>t.data).filter(Boolean).flat(1),RK=Q([Ac],i5,{memoizeOptions:{resultEqualityCheck:gp}}),s5=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},wy=Q([RK,AT],s5),a5=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:tn(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:tn(i,r)}))):e.map(r=>({value:r})),vp=Q([wy,xn,Ac],a5);function o5(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function yd(e){if(Jr(e)||e instanceof Date){var t=Number(e);if(qe(t))return t}}function FP(e){if(Array.isArray(e)){var t=[yd(e[0]),yd(e[1])];return Pi(t)?t:void 0}var n=yd(e);if(n!=null)return[n,n]}function Ci(e){return e.map(yd).filter(Wr)}function LK(e,t,n){return!n||typeof t!="number"||Qr(t)?[]:n.length?Ci(n.flatMap(r=>{var i=tn(e,r.dataKey),a,l;if(Array.isArray(i)?[a,l]=i:a=l=i,!(!qe(a)||!qe(l)))return[t-a,t+l]})):[]}var Mt=e=>{var t=Ht(e),n=To(e);return Oc(e,t,n)},Ec=Q([Mt],e=>e==null?void 0:e.dataKey),$K=Q([n5,AT,Mt],XT),l5=(e,t,n,r)=>{var i={},a=t.reduce((l,u)=>{if(u.stackId==null)return l;var d=l[u.stackId];return d==null&&(d=[]),d.push(u),l[u.stackId]=d,l},i);return Object.fromEntries(Object.entries(a).map(l=>{var[u,d]=l,p=r?[...d].reverse():d,h=p.map(xy);return[u,{stackedData:lV(e,h,n),graphicalItems:p}]}))},hv=Q([$K,n5,cp,UT],l5),c5=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var l=pV(e,i,a);if(!(l!=null&&l[0]===0&&l[1]===0))return l}},zK=Q([xn],e=>e.allowDataOverflow),jy=e=>{var t;if(e==null||!("domain"in e))return pv;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Ci(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:pv},u5=Q([xn],jy),d5=Q([u5,zK],ET),FK=Q([hv,Mi,Kt,d5],c5,{memoizeOptions:{resultEqualityCheck:mp}}),Sy=e=>e.errorBars,BK=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>o5(n,r)),xf=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(),l=Math.min(...a),u=Math.max(...a);return[l,u]}},f5=(e,t,n,r,i)=>{var a,l;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=>o5(i,k)),v=tn(u,(h=t.dataKey)!==null&&h!==void 0?h:d.dataKey),x=LK(u,v,m);if(x.length>=2){var w=Math.min(...x),S=Math.max(...x);(a==null||w<a)&&(a=w),(l==null||S>l)&&(l=S)}var j=FP(v);j!=null&&(a=a==null?j[0]:Math.min(a,j[0]),l=l==null?j[1]:Math.max(l,j[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(u=>{var d=FP(tn(u,t.dataKey));d!=null&&(a=a==null?d[0]:Math.min(a,d[0]),l=l==null?d[1]:Math.max(l,d[1]))}),qe(a)&&qe(l))return[a,l]},VK=Q([wy,xn,DK,Sy,Kt],f5,{memoizeOptions:{resultEqualityCheck:mp}});function UK(e){var{value:t}=e;if(Jr(t)||t instanceof Date)return t}var WK=(e,t,n)=>{var r=e.map(UK).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&MA(r))?GE(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},p5=e=>e.referenceElements.dots,Mo=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),qK=Q([p5,Kt,pp],Mo),h5=e=>e.referenceElements.areas,KK=Q([h5,Kt,pp],Mo),m5=e=>e.referenceElements.lines,HK=Q([m5,Kt,pp],Mo),g5=(e,t)=>{if(e!=null){var n=Ci(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},GK=Q(qK,Kt,g5),v5=(e,t)=>{if(e!=null){var n=Ci(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)]}},YK=Q([KK,Kt],v5);function XK(e){var t;if(e.x!=null)return Ci([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Ci(n)}function QK(e){var t;if(e.y!=null)return Ci([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Ci(n)}var x5=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?XK(r):QK(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},JK=Q([HK,Kt],x5),ZK=Q(GK,JK,YK,(e,t,n)=>xf(e,n,t)),y5=(e,t,n,r,i,a,l,u)=>{if(n!=null)return n;var d=l==="vertical"&&u==="xAxis"||l==="horizontal"&&u==="yAxis",p=d?xf(r,a,i):xf(a,i);return dK(t,p,e.allowDataOverflow)},eH=Q([xn,u5,d5,FK,VK,ZK,tt,Kt],y5,{memoizeOptions:{resultEqualityCheck:mp}}),tH=[0,1],b5=(e,t,n,r,i,a,l)=>{if(!((e==null||n==null||n.length===0)&&l===void 0)){var{dataKey:u,type:d}=e,p=ws(t,a);if(p&&u==null){var h;return GE(0,(h=n==null?void 0:n.length)!==null&&h!==void 0?h:0)}return d==="category"?WK(r,e,p):i==="expand"?tH:l}},Ny=Q([xn,tt,wy,vp,cp,Kt,eH],b5);function nH(e){return e in Dl}var w5=(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(xc(r));return nH(a)?a:"point"}}},_o=Q([xn,ZT,fy],w5);function ky(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?$P(e.scale,n,r):$P(t,n,r)}var j5=(e,t,n)=>{var r=jy(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&Pi(e))return gK(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Pi(e))return vK(e,t.tickCount,t.allowDecimals)}},Py=Q([Ny,Oc,_o],j5),S5=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Pi(t)&&Array.isArray(n)&&n.length>0){var i,a,l=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(l,u),Math.max(d,p)]}return t},rH=Q([xn,Ny,Py,Kt],S5),iH=Q(vp,xn,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Ci(e.map(m=>m.value))).sort((m,v)=>m-v),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var l=a-i;if(l===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/l}}),N5=Q(iH,tt,VT,Wt,(e,t,n,r,i)=>i,(e,t,n,r,i)=>{if(!qe(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var l=Ar(n,e*a),u=e*a/2;return u-l-(u-l)/a*l}return 0}),sH=(e,t,n)=>{var r=_i(e,t);return r==null||typeof r.padding!="string"?0:N5(e,"xAxis",t,n,r.padding)},aH=(e,t,n)=>{var r=Ii(e,t);return r==null||typeof r.padding!="string"?0:N5(e,"yAxis",t,n,r.padding)},oH=Q(_i,sH,(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}}),lH=Q(Ii,aH,(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}}),cH=Q([Wt,oH,Qf,Xf,(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]}),uH=Q([Wt,tt,lH,Qf,Xf,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:l}=i;return a?[r.height-l.bottom,l.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Tc=(e,t,n,r)=>{var i;switch(t){case"xAxis":return cH(e,n,r);case"yAxis":return uH(e,n,r);case"zAxis":return(i=yy(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return HT(e);case"radiusAxis":return GT(e,n);default:return}},k5=Q([xn,Tc],up),dH=Q([_o,rH],OK),xp=Q([xn,_o,dH,k5],ky);Q([Ac,Sy,Kt],BK);function P5(e,t){return e.id<t.id?-1:e.id>t.id?1:0}var yp=(e,t)=>t,bp=(e,t,n)=>n,fH=Q(Gf,yp,bp,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(P5)),pH=Q(Yf,yp,bp,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(P5)),C5=(e,t)=>({width:e.width,height:t.height}),hH=(e,t)=>{var n=typeof t.width=="number"?t.width:wc;return{width:n,height:e.height}},O5=Q(Wt,_i,C5),mH=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},gH=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},vH=Q(Ei,Wt,fH,yp,bp,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=C5(t,u);l==null&&(l=mH(t,r,e));var p=r==="top"&&!i||r==="bottom"&&i;a[u.id]=l-Number(p)*d.height,l+=(p?-1:1)*d.height}),a}),xH=Q(Ai,Wt,pH,yp,bp,(e,t,n,r,i)=>{var a={},l;return n.forEach(u=>{var d=hH(t,u);l==null&&(l=gH(t,r,e));var p=r==="left"&&!i||r==="right"&&i;a[u.id]=l-Number(p)*d.width,l+=(p?-1:1)*d.width}),a}),yH=(e,t)=>{var n=_i(e,t);if(n!=null)return vH(e,n.orientation,n.mirror)},bH=Q([Wt,_i,yH,(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}}}),wH=(e,t)=>{var n=Ii(e,t);if(n!=null)return xH(e,n.orientation,n.mirror)},jH=Q([Wt,Ii,wH,(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}}}),A5=Q(Wt,Ii,(e,t)=>{var n=typeof t.width=="number"?t.width:wc;return{width:n,height:e.height}}),BP=(e,t,n)=>{switch(t){case"xAxis":return O5(e,n).width;case"yAxis":return A5(e,n).height;default:return}},E5=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:l}=n,u=ws(e,r),d=t.map(p=>p.value);if(l&&u&&a==="category"&&i&&MA(d))return d}},Cy=Q([tt,vp,xn,Kt],E5),T5=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,l=ws(e,r);if(l&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},Oy=Q([tt,vp,Oc,Kt],T5);Q([tt,_K,_o,xp,Cy,Oy,Tc,Py,Kt],(e,t,n,r,i,a,l,u,d)=>{if(t!=null){var p=ws(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:l,realScaleType:n,scale:r}}});var SH=(e,t,n,r,i,a,l,u,d)=>{if(!(t==null||r==null)){var p=ws(e,d),{type:h,ticks:m,tickCount:v}=t,x=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,w=h==="category"&&r.bandwidth?r.bandwidth()/x:0;w=d==="angleAxis"&&a!=null&&a.length>=2?zn(a[0]-a[1])*2*w:w;var S=m||i;return S?S.map((j,k)=>{var C=l?l.indexOf(j):j,E=r.map(C);return qe(E)?{index:k,coordinate:E+w,value:j,offset:w}:null}).filter(Wr):p&&u?u.map((j,k)=>{var C=r.map(j);return qe(C)?{coordinate:C+w,value:j,index:k,offset:w}:null}).filter(Wr):r.ticks?r.ticks(v).map((j,k)=>{var C=r.map(j);return qe(C)?{coordinate:C+w,value:j,index:k,offset:w}:null}).filter(Wr):r.domain().map((j,k)=>{var C=r.map(j);return qe(C)?{coordinate:C+w,value:l?l[j]:j,index:k,offset:w}:null}).filter(Wr)}},M5=Q([tt,Oc,_o,xp,Py,Tc,Cy,Oy,Kt],SH),NH=(e,t,n,r,i,a,l)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var u=ws(e,l),{tickCount:d}=t,p=0;return p=l==="angleAxis"&&(r==null?void 0:r.length)>=2?zn(r[0]-r[1])*2*p:p,u&&a?a.map((h,m)=>{var v=n.map(h);return qe(v)?{coordinate:v+p,value:h,index:m,offset:p}:null}).filter(Wr):n.ticks?n.ticks(d).map((h,m)=>{var v=n.map(h);return qe(v)?{coordinate:v+p,value:h,index:m,offset:p}:null}).filter(Wr):n.domain().map((h,m)=>{var v=n.map(h);return qe(v)?{coordinate:v+p,value:i?i[h]:h,index:m,offset:p}:null}).filter(Wr)}},vo=Q([tt,Oc,xp,Tc,Cy,Oy,Kt],NH),xo=Q(xn,xp,(e,t)=>{if(!(e==null||t==null))return vf(vf({},e),{},{scale:t})}),kH=Q([xn,_o,Ny,k5],ky);Q((e,t,n)=>yy(e,n),kH,(e,t)=>{if(!(e==null||t==null))return vf(vf({},e),{},{scale:t})});var PH=Q([tt,Gf,Yf],(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}}),_5=e=>e.options.defaultTooltipEventType,I5=e=>e.options.validateTooltipEventTypes;function D5(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function Ay(e,t){var n=_5(e),r=I5(e);return D5(t,n,r)}function CH(e){return Ae(t=>Ay(t,e))}var R5=(e,t)=>{var n,r=Number(t);if(!(Qr(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},OH=e=>e.tooltip.settings,us={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},AH={itemInteraction:{click:us,hover:us},axisInteraction:{click:us,hover:us},keyboardInteraction:us,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}},L5=Tn({name:"tooltip",initialState:AH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:dt()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Or(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:dt()},removeTooltipEntrySettings:{reducer(e,t){var n=Or(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:dt()},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:EH,replaceTooltipEntrySettings:TH,removeTooltipEntrySettings:MH,setTooltipSettingsState:_H,setActiveMouseOverItemIndex:$5,mouseLeaveItem:IH,mouseLeaveChart:z5,setActiveClickItemIndex:DH,setMouseOverAxisIndex:F5,setMouseClickAxisIndex:RH,setSyncInteraction:mv,setKeyboardInteraction:gv}=L5.actions,LH=L5.reducer;function VP(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 od(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VP(Object(n),!0).forEach(function(r){$H(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $H(e,t,n){return(t=zH(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zH(e){var t=FH(e,"string");return typeof t=="symbol"?t:t+""}function FH(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 BH(e,t,n){return t==="axis"?n==="click"?e.axisInteraction.click:e.axisInteraction.hover:n==="click"?e.itemInteraction.click:e.itemInteraction.hover}function VH(e){return e.index!=null}var B5=(e,t,n,r)=>{if(t==null)return us;var i=BH(e,t,n);if(i==null)return us;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(VH(i)){if(a)return od(od({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return od(od({},us),{},{coordinate:i.coordinate})};function UH(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 WH(e,t){var n=UH(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),l=Math.max(r,i);return n>=a&&n<=l}function qH(e,t,n){if(n==null||t==null)return!0;var r=tn(e,t);return r==null||!Pi(n)?!0:WH(r,n)}var Ey=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!qe(a))return i;var l=0,u=1/0;t.length>0&&(u=t.length-1);var d=Math.max(l,Math.min(a,u)),p=t[d];return p==null||qH(p,n,r)?String(d):null},V5=(e,t,n,r,i,a,l)=>{if(a!=null){var u=l[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}}}},U5=(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(l=>{var u;return((u=l.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},W5=e=>e.options.tooltipPayloadSearcher,Io=e=>e.tooltip;function UP(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 WP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UP(Object(n),!0).forEach(function(r){KH(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UP(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){return e??t}var q5=(e,t,n,r,i,a,l)=>{if(!(t==null||a==null)){var{chartData:u,computedData:d,dataStartIndex:p,dataEndIndex:h}=n,m=[];return e.reduce((v,x)=>{var w,{dataDefinedOnItem:S,settings:j}=x,k=YH(S,u),C=Array.isArray(k)?SE(k,p,h):k,E=(w=j==null?void 0:j.dataKey)!==null&&w!==void 0?w:r,O=j==null?void 0:j.nameKey,P;if(r&&Array.isArray(C)&&!Array.isArray(C[0])&&l==="axis"?P=VB(C,r,i):P=a(C,t,d,O),Array.isArray(P))P.forEach(M=>{var D=WP(WP({},j),{},{name:M.name,unit:M.unit,color:void 0,fill:void 0});v.push(WN({tooltipEntrySettings:D,dataKey:M.dataKey,payload:M.payload,value:tn(M.payload,M.dataKey),name:M.name}))});else{var A;v.push(WN({tooltipEntrySettings:j,dataKey:E,payload:P,value:tn(P,E),name:(A=tn(P,O))!==null&&A!==void 0?A:j==null?void 0:j.name}))}return v},m)}},Ty=Q([Mt,ZT,fy],w5),XH=Q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),QH=Q([Ht,To],e5),Do=Q([XH,Mt,QH],t5,{memoizeOptions:{resultEqualityCheck:gp}}),JH=Q([Do],e=>e.filter(hp)),ZH=Q([Do],i5,{memoizeOptions:{resultEqualityCheck:gp}}),Ro=Q([ZH,Mi],s5),eG=Q([JH,Mi,Mt],XT),My=Q([Ro,Mt,Do],a5),K5=Q([Mt],jy),tG=Q([Mt],e=>e.allowDataOverflow),H5=Q([K5,tG],ET),nG=Q([Do],e=>e.filter(hp)),rG=Q([eG,nG,cp,UT],l5),iG=Q([rG,Mi,Ht,H5],c5),sG=Q([Do],r5),aG=Q([Ro,Mt,sG,Sy,Ht],f5,{memoizeOptions:{resultEqualityCheck:mp}}),oG=Q([p5,Ht,To],Mo),lG=Q([oG,Ht],g5),cG=Q([h5,Ht,To],Mo),uG=Q([cG,Ht],v5),dG=Q([m5,Ht,To],Mo),fG=Q([dG,Ht],x5),pG=Q([lG,fG,uG],xf),hG=Q([Mt,K5,H5,iG,aG,pG,tt,Ht],y5),Mc=Q([Mt,tt,Ro,My,cp,Ht,hG],b5),mG=Q([Mc,Mt,Ty],j5),gG=Q([Mt,Mc,mG,Ht],S5),G5=e=>{var t=Ht(e),n=To(e),r=!1;return Tc(e,t,n,r)},Y5=Q([Mt,G5],up),X5=Q([Mt,Ty,gG,Y5],ky),vG=Q([tt,My,Mt,Ht],E5),xG=Q([tt,My,Mt,Ht],T5),yG=(e,t,n,r,i,a,l,u)=>{if(t){var{type:d}=t,p=ws(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?zn(i[0]-i[1])*2*m:m,p&&l?l.map((v,x)=>{var w=r.map(v);return qe(w)?{coordinate:w+m,value:v,index:x,offset:m}:null}).filter(Wr):r.domain().map((v,x)=>{var w=r.map(v);return qe(w)?{coordinate:w+m,value:a?a[v]:v,index:x,offset:m}:null}).filter(Wr)}}},Di=Q([tt,Mt,Ty,X5,G5,vG,xG,Ht],yG),_y=Q([_5,I5,OH],(e,t,n)=>D5(n.shared,e,t)),Q5=e=>e.tooltip.settings.trigger,Iy=e=>e.tooltip.settings.defaultIndex,_c=Q([Io,_y,Q5,Iy],B5),yo=Q([_c,Ro,Ec,Mc],Ey),J5=Q([Di,yo],R5),Z5=Q([_c],e=>{if(e)return e.dataKey});Q([_c],e=>{if(e)return e.graphicalItemId});var eM=Q([Io,_y,Q5,Iy],U5),bG=Q([Ai,Ei,tt,Wt,Di,Iy,eM],V5),wG=Q([_c,bG],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),jG=Q([_c],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),SG=Q([eM,yo,Mi,Ec,J5,W5,_y],q5);Q([SG],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 KP(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){NG(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 NG(e,t,n){return(t=kG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kG(e){var t=PG(e,"string");return typeof t=="symbol"?t:t+""}function PG(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 CG=()=>Ae(Mt),OG=()=>{var e=CG(),t=Ae(Di),n=Ae(X5);return Yd(!e||!n?void 0:KP(KP({},e),{},{scale:n}),t)};function HP(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 Va(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HP(Object(n),!0).forEach(function(r){AG(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AG(e,t,n){return(t=EG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EG(e){var t=TG(e,"string");return typeof t=="symbol"?t:t+""}function TG(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 MG=(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}},_G=(e,t,n,r)=>{var i=t.find(p=>p&&p.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:l}=r;return Va(Va(Va({},r),en(r.cx,r.cy,l,a)),{},{angle:a,radius:l})}var u=i.coordinate,{angle:d}=r;return Va(Va(Va({},r),en(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 IG(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 tM=(e,t,n,r,i)=>{var a,l=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(l<=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<l;u++){var d,p,h,m,v,x=u>0?(d=n[u-1])===null||d===void 0?void 0:d.coordinate:(p=n[l-1])===null||p===void 0?void 0:p.coordinate,w=(h=n[u])===null||h===void 0?void 0:h.coordinate,S=u>=l-1?(m=n[0])===null||m===void 0?void 0:m.coordinate:(v=n[u+1])===null||v===void 0?void 0:v.coordinate,j=void 0;if(!(x==null||w==null||S==null))if(zn(w-x)!==zn(S-w)){var k=[];if(zn(S-w)===zn(i[1]-i[0])){j=S;var C=w+i[1]-i[0];k[0]=Math.min(C,(C+x)/2),k[1]=Math.max(C,(C+x)/2)}else{j=x;var E=S+i[1]-i[0];k[0]=Math.min(w,(E+w)/2),k[1]=Math.max(w,(E+w)/2)}var O=[Math.min(w,(j+w)/2),Math.max(w,(j+w)/2)];if(e>O[0]&&e<=O[1]||e>=k[0]&&e<=k[1]){var P;return(P=n[u])===null||P===void 0?void 0:P.index}}else{var A=Math.min(x,S),M=Math.max(x,S);if(e>(A+w)/2&&e<=(M+w)/2){var D;return(D=n[u])===null||D===void 0?void 0:D.index}}}else if(t)for(var $=0;$<l;$++){var q=t[$];if(q!=null){var X=t[$+1],L=t[$-1];if($===0&&X!=null&&e<=(q.coordinate+X.coordinate)/2||$===l-1&&L!=null&&e>(q.coordinate+L.coordinate)/2||$>0&&$<l-1&&L!=null&&X!=null&&e>(q.coordinate+L.coordinate)/2&&e<=(q.coordinate+X.coordinate)/2)return q.index}}return-1},DG=()=>Ae(fy),Dy=(e,t)=>t,nM=(e,t,n)=>n,Ry=(e,t,n,r)=>r,RG=Q(Di,e=>$f(e,t=>t.coordinate)),Ly=Q([Io,Dy,nM,Ry],B5),$y=Q([Ly,Ro,Ec,Mc],Ey),LG=(e,t,n)=>{if(t!=null){var r=Io(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},rM=Q([Io,Dy,nM,Ry],U5),yf=Q([Ai,Ei,tt,Wt,Di,Ry,rM],V5),$G=Q([Ly,yf],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),iM=Q([Di,$y],R5),zG=Q([rM,$y,Mi,Ec,iM,W5,Dy],q5),FG=Q([Ly,$y],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),BG=(e,t,n,r,i,a,l)=>{if(!(!e||!n||!r||!i)&&IG(e,l)){var u=hV(e,t),d=tM(u,a,i,n,r),p=MG(t,i,d,e);return{activeIndex:String(d),activeCoordinate:p}}},VG=(e,t,n,r,i,a,l)=>{if(!(!e||!r||!i||!a||!n)){var u=P9(e,n);if(u){var d=mV(u,t),p=tM(d,l,a,r,i),h=_G(t,a,p,u);return{activeIndex:String(p),activeCoordinate:h}}}},UG=(e,t,n,r,i,a,l,u)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?BG(e,t,r,i,a,l,u):VG(e,t,n,r,i,a,l)},WG=Q(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}}),qG=Q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(An)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:PK}});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 YP(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){KG(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 KG(e,t,n){return(t=HG(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HG(e){var t=GG(e,"string");return typeof t=="symbol"?t:t+""}function GG(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 YG={},XG={zIndexMap:Object.values(An).reduce((e,t)=>YP(YP({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),YG)},QG=new Set(Object.values(An));function JG(e){return QG.has(e)}var sM=Tn({name:"zIndex",initialState:XG,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:dt()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!JG(n)&&delete e.zIndexMap[n])},prepare:dt()},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:dt()},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:dt()}}}),{registerZIndexPortal:ZG,unregisterZIndexPortal:eY,registerZIndexPortalElement:tY,unregisterZIndexPortalElement:nY}=sM.actions,rY=sM.reducer;function Ns(e){var{zIndex:t,children:n}=e,r=QV(),i=r&&t!==void 0&&t!==0,a=qn(),l=Nt();b.useLayoutEffect(()=>i?(l(ZG({zIndex:t})),()=>{l(eY({zIndex:t}))}):Po,[l,t,i]);var u=Ae(d=>WG(d,t,a));return i?u?hA.createPortal(n,u):null:n}function vv(){return vv=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},vv.apply(null,arguments)}function XP(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 ld(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XP(Object(n),!0).forEach(function(r){iY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XP(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iY(e,t,n){return(t=sY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sY(e){var t=aY(e,"string");return typeof t=="symbol"?t:t+""}function aY(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 oY(e){var{cursor:t,cursorComp:n,cursorProps:r}=e;return b.isValidElement(t)?b.cloneElement(t,r):b.createElement(n,r)}function lY(e){var t,{coordinate:n,payload:r,index:i,offset:a,tooltipAxisBandSize:l,layout:u,cursor:d,tooltipEventType:p,chartName:h}=e,m=n,v=r,x=i;if(!d||!m||h!=="ScatterChart"&&p!=="axis")return null;var w,S,j;if(h==="ScatterChart")w=m,S=zU,j=An.cursorLine;else if(h==="BarChart")w=FU(u,m,a,l),S=WE,j=An.cursorRectangle;else if(u==="radial"&&DA(m)){var{cx:k,cy:C,radius:E,startAngle:O,endAngle:P}=qE(m);w={cx:k,cy:C,startAngle:O,endAngle:P,innerRadius:E,outerRadius:E},S=HE,j=An.cursorLine}else w={points:E9(u,m,a)},S=zE,j=An.cursorLine;var A=typeof d=="object"&&"className"in d?d.className:void 0,M=ld(ld(ld(ld({stroke:"#ccc",pointerEvents:"none"},a),w),vx(d)),{},{payload:v,payloadIndex:x,className:it("recharts-tooltip-cursor",A)});return b.createElement(Ns,{zIndex:(t=e.zIndex)!==null&&t!==void 0?t:j},b.createElement(oY,{cursor:d,cursorComp:S,cursorProps:M}))}function cY(e){var t=OG(),n=GV(),r=Co(),i=DG();return t==null||n==null||r==null||i==null?null:b.createElement(lY,vv({},e,{offset:n,layout:r,tooltipAxisBandSize:t,chartName:i}))}var aM=b.createContext(null),uY=()=>b.useContext(aM),H0={exports:{}},QP;function dY(){return QP||(QP=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,v){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new i(h,m||d,v),w=n?n+p:p;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],x]:d._events[w].push(x):(d._events[w]=x,d._eventsCount++),d}function l(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 v=0,x=m.length,w=new Array(x);v<x;v++)w[v]=m[v].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,v,x,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,v),!0;case 5:return j.fn.call(j.context,h,m,v,x),!0;case 6:return j.fn.call(j.context,h,m,v,x,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 O=j.length,P;for(E=0;E<O;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,v);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,v){var x=n?n+p:p;if(!this._events[x])return this;if(!h)return l(this,x),this;var w=this._events[x];if(w.fn)w.fn===h&&(!v||w.once)&&(!m||w.context===m)&&l(this,x);else{for(var S=0,j=[],k=w.length;S<k;S++)(w[S].fn!==h||v&&!w[S].once||m&&w[S].context!==m)&&j.push(w[S]);j.length?this._events[x]=j.length===1?j[0]:j:l(this,x)}return this},u.prototype.removeAllListeners=function(p){var h;return p?(h=n?n+p:p,this._events[h]&&l(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})(H0)),H0.exports}var fY=dY();const pY=ei(fY);var uc=new pY,xv="recharts.syncEvent.tooltip",JP="recharts.syncEvent.brush",hY=(e,t)=>{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Qr(n))return e[n]}},mY={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},oM=Tn({name:"options",initialState:mY,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),gY=oM.reducer,{createEventEmitter:vY}=oM.actions;function xY(e){return e.tooltip.syncInteraction}var yY={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},lM=Tn({name:"chartData",initialState:yY,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:ZP,setDataStartEndIndexes:bY,setComputedData:Ate}=lM.actions,wY=lM.reducer,jY=["x","y"];function eC(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 Ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eC(Object(n),!0).forEach(function(r){SY(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SY(e,t,n){return(t=NY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NY(e){var t=kY(e,"string");return typeof t=="symbol"?t:t+""}function kY(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 PY(e,t){if(e==null)return{};var n,r,i=CY(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 CY(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 OY(){var e=Ae(py),t=Ae(hy),n=Nt(),r=Ae(WT),i=Ae(Di),a=Co(),l=Jf(),u=Ae(d=>d.rootProps.className);b.useEffect(()=>{if(e==null)return Po;var d=(p,h,m)=>{if(t!==m&&e===p){if(r==="index"){var v;if(l&&h!==null&&h!==void 0&&(v=h.payload)!==null&&v!==void 0&&v.coordinate&&h.payload.sourceViewBox){var x=h.payload.coordinate,{x:w,y:S}=x,j=PY(x,jY),{x:k,y:C,width:E,height:O}=h.payload.sourceViewBox,P=Ua(Ua({},j),{},{x:l.x+(E?(w-k)/E:0)*l.width,y:l.y+(O?(S-C)/O:0)*l.height});n(Ua(Ua({},h),{},{payload:Ua(Ua({},h.payload),{},{coordinate:P})}))}else n(h);return}if(i!=null){var A;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},D=r(i,M);A=i[D]}else r==="value"&&(A=i.find(re=>String(re.value)===h.payload.label));var{coordinate:$}=h.payload;if(A==null||h.payload.active===!1||$==null||l==null){n(mv({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:q,y:X}=$,L=Math.min(q,l.x+l.width),Z=Math.min(X,l.y+l.height),J={x:a==="horizontal"?A.coordinate:L,y:a==="horizontal"?Z:A.coordinate},ne=mv({active:h.payload.active,coordinate:J,dataKey:h.payload.dataKey,index:String(A.index),label:h.payload.label,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:h.payload.graphicalItemId});n(ne)}}};return uc.on(xv,d),()=>{uc.off(xv,d)}},[u,n,t,e,r,i,a,l])}function AY(){var e=Ae(py),t=Ae(hy),n=Nt();b.useEffect(()=>{if(e==null)return Po;var r=(i,a,l)=>{t!==l&&e===i&&n(bY(a))};return uc.on(JP,r),()=>{uc.off(JP,r)}},[n,t,e])}function EY(){var e=Nt();b.useEffect(()=>{e(vY())},[e]),OY(),AY()}function TY(e,t,n,r,i,a){var l=Ae(x=>LG(x,e,t)),u=Ae(hy),d=Ae(py),p=Ae(WT),h=Ae(xY),m=h==null?void 0:h.active,v=Jf();b.useEffect(()=>{if(!m&&d!=null&&u!=null){var x=mv({active:a,coordinate:n,dataKey:l,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:v,graphicalItemId:void 0});uc.emit(xv,d,x,u)}},[m,n,l,i,r,u,d,p,a,v])}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 nC(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){MY(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 MY(e,t,n){return(t=_Y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Y(e){var t=IY(e,"string");return typeof t=="symbol"?t:t+""}function IY(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 DY(e){return e.dataKey}function RY(e,t){return b.isValidElement(e)?b.cloneElement(e,t):typeof e=="function"?b.createElement(e,t):b.createElement(xU,t)}var rC=[],LY={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 $Y(e){var t,n,r=pr(e,LY),{active:i,allowEscapeViewBox:a,animationDuration:l,animationEasing:u,content:d,filterNull:p,isAnimationActive:h,offset:m,payloadUniqBy:v,position:x,reverseDirection:w,useTranslate3d:S,wrapperStyle:j,cursor:k,shared:C,trigger:E,defaultIndex:O,portal:P,axisId:A}=r,M=Nt(),D=typeof O=="number"?String(O):O;b.useEffect(()=>{M(_H({shared:C,trigger:E,axisId:A,active:i,defaultIndex:D}))},[M,C,E,A,i,D]);var $=Jf(),q=$E(),X=CH(C),{activeIndex:L,isActive:Z}=(t=Ae(pe=>FG(pe,X,E,D)))!==null&&t!==void 0?t:{},J=Ae(pe=>zG(pe,X,E,D)),ne=Ae(pe=>iM(pe,X,E,D)),re=Ae(pe=>$G(pe,X,E,D)),B=J,F=uY(),G=(n=i??Z)!==null&&n!==void 0?n:!1,[W,_]=Z7([B,G]),V=X==="axis"?ne:void 0;TY(X,E,re,V,L,G);var ie=P??F;if(ie==null||$==null||X==null)return null;var fe=B??rC;G||(fe=rC),p&&fe.length&&(fe=k7(fe.filter(pe=>pe.value!=null&&(pe.hide!==!0||r.includeHidden)),v,DY));var te=fe.length>0,le=b.createElement(kU,{allowEscapeViewBox:a,animationDuration:l,animationEasing:u,isAnimationActive:h,active:G,coordinate:re,hasPayload:te,offset:m,position:x,reverseDirection:w,useTranslate3d:S,viewBox:$,wrapperStyle:j,lastBoundingBox:W,innerRef:_,hasPortalFromProps:!!P},RY(d,nC(nC({},r),{},{payload:fe,label:V,active:G,activeIndex:L,coordinate:re,accessibilityLayer:q})));return b.createElement(b.Fragment,null,hA.createPortal(le,ie),G&&b.createElement(cY,{cursor:k,tooltipEventType:X,coordinate:re,payload:fe,index:L}))}var cM=e=>null;cM.displayName="Cell";function zY(e,t,n){return(t=FY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FY(e){var t=BY(e,"string");return typeof t=="symbol"?t:t+""}function BY(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 VY{constructor(t){zY(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 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 UY(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){WY(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 WY(e,t,n){return(t=qY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qY(e){var t=KY(e,"string");return typeof t=="symbol"?t:t+""}function KY(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 HY={cacheSize:2e3,enableCache:!0},uM=UY({},HY),sC=new VY(uM.cacheSize),GY={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},aC="recharts_measurement_span";function YY(e,t){var n=t.fontSize||"",r=t.fontFamily||"",i=t.fontWeight||"",a=t.fontStyle||"",l=t.letterSpacing||"",u=t.textTransform||"";return"".concat(e,"|").concat(n,"|").concat(r,"|").concat(i,"|").concat(a,"|").concat(l,"|").concat(u)}var oC=(e,t)=>{try{var n=document.getElementById(aC);n||(n=document.createElement("span"),n.setAttribute("id",aC),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,GY,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Vl=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||np.isSsr)return{width:0,height:0};if(!uM.enableCache)return oC(t,n);var r=YY(t,n),i=sC.get(r);if(i)return i;var a=oC(t,n);return sC.set(r,a),a},dM;function XY(e,t,n){return(t=QY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QY(e){var t=JY(e,"string");return typeof t=="symbol"?t:t+""}function JY(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 lC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,cC=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ZY=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,eX=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,tX={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},nX=["cm","mm","pt","pc","in","Q","px"];function rX(e){return nX.includes(e)}var Za="NaN";function iX(e,t){return e*tX[t]}class Jt{static parse(t){var n,[,r,i]=(n=eX.exec(t))!==null&&n!==void 0?n:[];return r==null?Jt.NaN:new Jt(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Qr(t)&&(this.unit=""),n!==""&&!ZY.test(n)&&(this.num=NaN,this.unit=""),rX(n)&&(this.num=iX(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Jt(NaN,""):new Jt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Qr(this.num)}}dM=Jt;XY(Jt,"NaN",new dM(NaN,""));function fM(e){if(e==null||e.includes(Za))return Za;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=lC.exec(t))!==null&&n!==void 0?n:[],l=Jt.parse(r??""),u=Jt.parse(a??""),d=i==="*"?l.multiply(u):l.divide(u);if(d.isNaN())return Za;t=t.replace(lC,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var p,[,h,m,v]=(p=cC.exec(t))!==null&&p!==void 0?p:[],x=Jt.parse(h??""),w=Jt.parse(v??""),S=m==="+"?x.add(w):x.subtract(w);if(S.isNaN())return Za;t=t.replace(cC,S.toString())}return t}var uC=/\(([^()]*)\)/;function sX(e){for(var t=e,n;(n=uC.exec(t))!=null;){var[,r]=n;t=t.replace(uC,fM(r))}return t}function aX(e){var t=e.replace(/\s+/g,"");return t=sX(t),t=fM(t),t}function oX(e){try{return aX(e)}catch{return Za}}function G0(e){var t=oX(e.slice(5,-1));return t===Za?"":t}var lX=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],cX=["dx","dy","angle","className","breakAll"];function yv(){return yv=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},yv.apply(null,arguments)}function dC(e,t){if(e==null)return{};var n,r,i=uX(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 uX(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 pM=/[ \f\n\r\t\v\u2028\u2029]+/,hM=e=>{var{children:t,breakAll:n,style:r}=e;try{var i=[];Ut(t)||(n?i=t.toString().split(""):i=t.toString().split(pM));var a=i.map(u=>({word:u,width:Vl(u,r).width})),l=n?0:Vl(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:l}}catch{return null}};function dX(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var mM=(e,t,n,r)=>e.reduce((i,a)=>{var{word:l,width:u}=a,d=i[i.length-1];if(d&&u!=null&&(t==null||r||d.width+u+n<Number(t)))d.words.push(l),d.width+=u+n;else{var p={words:[l],width:u};i.push(p)}return i},[]),gM=e=>e.reduce((t,n)=>t.width>n.width?t:n),fX="…",fC=(e,t,n,r,i,a,l,u)=>{var d=e.slice(0,t),p=hM({breakAll:n,style:r,children:d+fX});if(!p)return[!1,[]];var h=mM(p.wordsWithComputedWidth,a,l,u),m=h.length>i||gM(h).width>Number(a);return[m,h]},pX=(e,t,n,r,i)=>{var{maxLines:a,children:l,style:u,breakAll:d}=e,p=Ne(a),h=String(l),m=mM(t,r,n,i);if(!p||i)return m;var v=m.length>a||gM(m).width>Number(r);if(!v)return m;for(var x=0,w=h.length-1,S=0,j;x<=w&&S<=h.length-1;){var k=Math.floor((x+w)/2),C=k-1,[E,O]=fC(h,C,d,u,a,r,n,i),[P]=fC(h,k,d,u,a,r,n,i);if(!E&&!P&&(x=k+1),E&&P&&(w=k-1),!E&&P){j=O;break}S++}return j||m},pC=e=>{var t=Ut(e)?[]:e.toString().split(pM);return[{words:t,width:void 0}]},hX=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:l}=e;if((t||n)&&!np.isSsr){var u,d,p=hM({breakAll:a,children:r,style:i});if(p){var{wordsWithComputedWidth:h,spaceWidth:m}=p;u=h,d=m}else return pC(r);return pX({breakAll:a,children:r,maxLines:l,style:i},u,d,t,!!n)}return pC(r)},vM="#808080",mX={angle:0,breakAll:!1,capHeight:"0.71em",fill:vM,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},zy=b.forwardRef((e,t)=>{var n=pr(e,mX),{x:r,y:i,lineHeight:a,capHeight:l,fill:u,scaleToFit:d,textAnchor:p,verticalAnchor:h}=n,m=dC(n,lX),v=b.useMemo(()=>hX({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:x,dy:w,angle:S,className:j,breakAll:k}=m,C=dC(m,cX);if(!Jr(r)||!Jr(i)||v.length===0)return null;var E=Number(r)+(Ne(x)?x:0),O=Number(i)+(Ne(w)?w:0);if(!qe(E)||!qe(O))return null;var P;switch(h){case"start":P=G0("calc(".concat(l,")"));break;case"middle":P=G0("calc(".concat((v.length-1)/2," * -").concat(a," + (").concat(l," / 2))"));break;default:P=G0("calc(".concat(v.length-1," * -").concat(a,")"));break}var A=[],M=v[0];if(d&&M!=null){var D=M.width,{width:$}=m;A.push("scale(".concat(Ne($)&&Ne(D)?$/D:1,")"))}return S&&A.push("rotate(".concat(S,", ").concat(E,", ").concat(O,")")),A.length&&(C.transform=A.join(" ")),b.createElement("text",yv({},ur(C),{ref:t,x:E,y:O,className:it("recharts-text",j),textAnchor:p,fill:u.includes("url")?vM:u}),v.map((q,X)=>{var L=q.words.join(k?"":" ");return b.createElement("tspan",{x:E,dy:X===0?P:a,key:"".concat(L,"-").concat(X)},L)}))});zy.displayName="Text";function hC(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 Ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hC(Object(n),!0).forEach(function(r){gX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gX(e,t,n){return(t=vX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vX(e){var t=xX(e,"string");return typeof t=="symbol"?t:t+""}function xX(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 yX=e=>{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:l,height:u,upperWidth:d,lowerWidth:p}=Rx(t),h=a,m=a+(d-p)/2,v=(h+m)/2,x=(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,O=E*r,P=E>0?"end":"start",A=E>0?"start":"end",M=i;if(n==="top"){var D={x:h+d/2,y:l-j,horizontalAnchor:"middle",verticalAnchor:k};return M&&(D.height=Math.max(l-M.y,0),D.width=d),D}if(n==="bottom"){var $={x:m+p/2,y:l+u+j,horizontalAnchor:"middle",verticalAnchor:C};return M&&($.height=Math.max(M.y+M.height-(l+u),0),$.width=p),$}if(n==="left"){var q={x:v-O,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"};return M&&(q.width=Math.max(q.x-M.x,0),q.height=u),q}if(n==="right"){var X={x:v+x+O,y:l+u/2,horizontalAnchor:A,verticalAnchor:"middle"};return M&&(X.width=Math.max(M.x+M.width-X.x,0),X.height=u),X}var L=M?{width:x,height:u}:{};return n==="insideLeft"?Ur({x:v+O,y:l+u/2,horizontalAnchor:A,verticalAnchor:"middle"},L):n==="insideRight"?Ur({x:v+x-O,y:l+u/2,horizontalAnchor:P,verticalAnchor:"middle"},L):n==="insideTop"?Ur({x:h+d/2,y:l+j,horizontalAnchor:"middle",verticalAnchor:C},L):n==="insideBottom"?Ur({x:m+p/2,y:l+u-j,horizontalAnchor:"middle",verticalAnchor:k},L):n==="insideTopLeft"?Ur({x:h+O,y:l+j,horizontalAnchor:A,verticalAnchor:C},L):n==="insideTopRight"?Ur({x:h+d-O,y:l+j,horizontalAnchor:P,verticalAnchor:C},L):n==="insideBottomLeft"?Ur({x:m+O,y:l+u-j,horizontalAnchor:A,verticalAnchor:k},L):n==="insideBottomRight"?Ur({x:m+p-O,y:l+u-j,horizontalAnchor:P,verticalAnchor:k},L):n&&typeof n=="object"&&(Ne(n.x)||ra(n.x))&&(Ne(n.y)||ra(n.y))?Ur({x:a+Ar(n.x,x),y:l+Ar(n.y,u),horizontalAnchor:"end",verticalAnchor:"end"},L):Ur({x:w,y:l+u/2,horizontalAnchor:"middle",verticalAnchor:"middle"},L)},bX=["labelRef"],wX=["content"];function mC(e,t){if(e==null)return{};var n,r,i=jX(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 jX(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 gC(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 Rl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gC(Object(n),!0).forEach(function(r){SX(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function SX(e,t,n){return(t=NX(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NX(e){var t=kX(e,"string");return typeof t=="symbol"?t:t+""}function kX(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 pi(){return pi=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},pi.apply(null,arguments)}var xM=b.createContext(null),PX=e=>{var{x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l,children:u}=e,d=b.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:i,width:a,height:l}),[t,n,r,i,a,l]);return b.createElement(xM.Provider,{value:d},u)},yM=()=>{var e=b.useContext(xM),t=Jf();return e||(t?Rx(t):void 0)},CX=b.createContext(null),OX=()=>{var e=b.useContext(CX),t=Ae(YT);return e||t},AX=e=>{var{value:t,formatter:n}=e,r=Ut(e.children)?t:e.children;return typeof n=="function"?n(r):r},Fy=e=>e!=null&&typeof e=="function",EX=(e,t)=>{var n=zn(t-e),r=Math.min(Math.abs(t-e),360);return n*r},TX=(e,t,n,r,i)=>{var{offset:a,className:l}=e,{cx:u,cy:d,innerRadius:p,outerRadius:h,startAngle:m,endAngle:v,clockWise:x}=i,w=(p+h)/2,S=EX(m,v),j=S>=0?1:-1,k,C;switch(t){case"insideStart":k=m+j*a,C=x;break;case"insideEnd":k=v-j*a,C=!x;break;case"end":k=v+j*a,C=x;break;default:throw new Error("Unsupported position ".concat(t))}C=S<=0?C:!C;var E=en(u,d,w,k),O=en(u,d,w,k+(C?1:-1)*359),P="M".concat(E.x,",").concat(E.y,`
|
|
337
|
-
A`).concat(w,",").concat(w,",0,1,").concat(C?0:1,`,
|
|
338
|
-
`).concat(O.x,",").concat(O.y),A=Ut(e.id)?Ql("recharts-radial-line-"):e.id;return b.createElement("text",pi({},r,{dominantBaseline:"central",className:it("recharts-radial-bar-label",l)}),b.createElement("defs",null,b.createElement("path",{id:A,d:P})),b.createElement("textPath",{xlinkHref:"#".concat(A)},n))},MX=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:l,startAngle:u,endAngle:d}=e,p=(u+d)/2;if(n==="outside"){var{x:h,y:m}=en(r,i,l+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 v=(a+l)/2,{x,y:w}=en(r,i,v,p);return{x,y:w,textAnchor:"middle",verticalAnchor:"middle"}},bd=e=>e!=null&&"cx"in e&&Ne(e.cx),_X={angle:0,offset:5,zIndex:An.label,position:"middle",textBreakAll:!1};function IX(e){if(!bd(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 cs(e){var t=pr(e,_X),{viewBox:n,parentViewBox:r,position:i,value:a,children:l,content:u,className:d="",textBreakAll:p,labelRef:h}=t,m=OX(),v=yM(),x=i==="center"?v:m??v,w,S,j;n==null?w=x:bd(n)?w=n:w=Rx(n);var k=IX(w);if(!w||Ut(a)&&Ut(l)&&!b.isValidElement(u)&&typeof u!="function")return null;var C=Rl(Rl({},t),{},{viewBox:w});if(b.isValidElement(u)){var{labelRef:E}=C,O=mC(C,bX);return b.cloneElement(u,O)}if(typeof u=="function"){var{content:P}=C,A=mC(C,wX);if(S=b.createElement(u,A),b.isValidElement(S))return S}else S=AX(t);var M=ur(t);if(bd(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return TX(t,i,S,M,w);j=MX(w,t.offset,t.position)}else{if(!k)return null;var D=yX({viewBox:k,position:i,offset:t.offset,parentViewBox:bd(r)?void 0:r});j=Rl(Rl({x:D.x,y:D.y,textAnchor:D.horizontalAnchor,verticalAnchor:D.verticalAnchor},D.width!==void 0?{width:D.width}:{}),D.height!==void 0?{height:D.height}:{})}return b.createElement(Ns,{zIndex:t.zIndex},b.createElement(zy,pi({ref:h,className:it("recharts-label",d)},M,j,{textAnchor:dX(M.textAnchor)?M.textAnchor:j.textAnchor,breakAll:p}),S))}cs.displayName="Label";var DX=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?b.createElement(cs,pi({key:"label-implicit"},r)):Jr(e)?b.createElement(cs,pi({key:"label-implicit",value:e},r)):b.isValidElement(e)?e.type===cs?b.cloneElement(e,Rl({key:"label-implicit"},r)):b.createElement(cs,pi({key:"label-implicit",content:e},r)):Fy(e)?b.createElement(cs,pi({key:"label-implicit",content:e},r)):e&&typeof e=="object"?b.createElement(cs,pi({},e,{key:"label-implicit"},r)):null};function RX(e){var{label:t,labelRef:n}=e,r=yM();return DX(t,r,n)||null}var Y0={},X0={},vC;function LX(){return vC||(vC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(X0)),X0}var Q0={},xC;function $X(){return xC||(xC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(Q0)),Q0}var yC;function zX(){return yC||(yC=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=LX(),n=$X(),r=kx();function i(a){if(r.isArrayLike(a))return t.last(n.toArray(a))}e.last=i})(Y0)),Y0}var J0,bC;function FX(){return bC||(bC=1,J0=zX().last),J0}var BX=FX();const VX=ei(BX);var UX=["valueAccessor"],WX=["dataKey","clockWise","id","textBreakAll","zIndex"];function bf(){return bf=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},bf.apply(null,arguments)}function wC(e,t){if(e==null)return{};var n,r,i=qX(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 qX(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 KX=e=>Array.isArray(e.value)?VX(e.value):e.value,bM=b.createContext(void 0),HX=bM.Provider,wM=b.createContext(void 0);wM.Provider;function GX(){return b.useContext(bM)}function YX(){return b.useContext(wM)}function wd(e){var{valueAccessor:t=KX}=e,n=wC(e,UX),{dataKey:r,clockWise:i,id:a,textBreakAll:l,zIndex:u}=n,d=wC(n,WX),p=GX(),h=YX(),m=p||h;return!m||!m.length?null:b.createElement(Ns,{zIndex:u??An.label},b.createElement(wi,{className:"recharts-label-list"},m.map((v,x)=>{var w,S=Ut(r)?t(v,x):tn(v.payload,r),j=Ut(a)?{}:{id:"".concat(a,"-").concat(x)};return b.createElement(cs,bf({key:"label-".concat(x)},ur(v),d,j,{fill:(w=n.fill)!==null&&w!==void 0?w:v.fill,parentViewBox:v.parentViewBox,value:S,textBreakAll:l,viewBox:v.viewBox,index:x,zIndex:0}))})))}wd.displayName="LabelList";function XX(e){var{label:t}=e;return t?t===!0?b.createElement(wd,{key:"labelList-implicit"}):b.isValidElement(t)||Fy(t)?b.createElement(wd,{key:"labelList-implicit",content:t}):typeof t=="object"?b.createElement(wd,bf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var QX={radiusAxis:{},angleAxis:{}},jM=Tn({name:"polarAxis",initialState:QX,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:Ete,removeRadiusAxis:Tte,addAngleAxis:Mte,removeAngleAxis:_te}=jM.actions,JX=jM.reducer;function ZX(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var Z0={exports:{}},Ke={};/** @license React v16.13.1
|
|
339
|
-
* react-is.production.min.js
|
|
340
|
-
*
|
|
341
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the MIT license found in the
|
|
344
|
-
* LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/var jC;function eQ(){if(jC)return Ke;jC=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,l=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,v=e?Symbol.for("react.suspense_list"):60120,x=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 A=P.$$typeof;switch(A){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 x:case l:return P;default:return A}}case n:return A}}}function O(P){return E(P)===p}return Ke.AsyncMode=d,Ke.ConcurrentMode=p,Ke.ContextConsumer=u,Ke.ContextProvider=l,Ke.Element=t,Ke.ForwardRef=h,Ke.Fragment=r,Ke.Lazy=w,Ke.Memo=x,Ke.Portal=n,Ke.Profiler=a,Ke.StrictMode=i,Ke.Suspense=m,Ke.isAsyncMode=function(P){return O(P)||E(P)===d},Ke.isConcurrentMode=O,Ke.isContextConsumer=function(P){return E(P)===u},Ke.isContextProvider=function(P){return E(P)===l},Ke.isElement=function(P){return typeof P=="object"&&P!==null&&P.$$typeof===t},Ke.isForwardRef=function(P){return E(P)===h},Ke.isFragment=function(P){return E(P)===r},Ke.isLazy=function(P){return E(P)===w},Ke.isMemo=function(P){return E(P)===x},Ke.isPortal=function(P){return E(P)===n},Ke.isProfiler=function(P){return E(P)===a},Ke.isStrictMode=function(P){return E(P)===i},Ke.isSuspense=function(P){return E(P)===m},Ke.isValidElementType=function(P){return typeof P=="string"||typeof P=="function"||P===r||P===p||P===a||P===i||P===m||P===v||typeof P=="object"&&P!==null&&(P.$$typeof===w||P.$$typeof===x||P.$$typeof===l||P.$$typeof===u||P.$$typeof===h||P.$$typeof===j||P.$$typeof===k||P.$$typeof===C||P.$$typeof===S)},Ke.typeOf=E,Ke}var SC;function tQ(){return SC||(SC=1,Z0.exports=eQ()),Z0.exports}var nQ=tQ(),NC=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",kC=null,eg=null,SM=e=>{if(e===kC&&Array.isArray(eg))return eg;var t=[];return b.Children.forEach(e,n=>{Ut(n)||(nQ.isFragment(n)?t=t.concat(SM(n.props.children)):t.push(n))}),eg=t,kC=e,t};function rQ(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>NC(i)):r=[NC(t)],SM(e).forEach(i=>{var a=uo(i,"type.displayName")||uo(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var tg={},PC;function iQ(){return PC||(PC=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})(tg)),tg}var ng,CC;function sQ(){return CC||(CC=1,ng=iQ().isPlainObject),ng}var aQ=sQ();const oQ=ei(aQ);var OC,AC,EC,TC,MC;function _C(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 IC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_C(Object(n),!0).forEach(function(r){lQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_C(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lQ(e,t,n){return(t=cQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cQ(e){var t=uQ(e,"string");return typeof t=="symbol"?t:t+""}function uQ(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 wf(){return wf=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},wf.apply(null,arguments)}function El(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var DC=(e,t,n,r,i)=>{var a=n-r,l;return l=yt(OC||(OC=El(["M ",",",""])),e,t),l+=yt(AC||(AC=El(["L ",",",""])),e+n,t),l+=yt(EC||(EC=El(["L ",",",""])),e+n-a/2,t+i),l+=yt(TC||(TC=El(["L ",",",""])),e+n-a/2-r,t+i),l+=yt(MC||(MC=El(["L ",","," Z"])),e,t),l},dQ={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fQ=e=>{var t=pr(e,dQ),{x:n,y:r,upperWidth:i,lowerWidth:a,height:l,className:u}=t,{animationEasing:d,animationDuration:p,animationBegin:h,isUpdateAnimationActive:m}=t,v=b.useRef(null),[x,w]=b.useState(-1),S=b.useRef(i),j=b.useRef(a),k=b.useRef(l),C=b.useRef(n),E=b.useRef(r),O=Fx(e,"trapezoid-");if(b.useEffect(()=>{if(v.current&&v.current.getTotalLength)try{var J=v.current.getTotalLength();J&&w(J)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||l!==+l||i===0&&a===0||l===0)return null;var P=it("recharts-trapezoid",u);if(!m)return b.createElement("g",null,b.createElement("path",wf({},ur(t),{className:P,d:DC(n,r,i,a,l)})));var A=S.current,M=j.current,D=k.current,$=C.current,q=E.current,X="0px ".concat(x===-1?1:x,"px"),L="".concat(x,"px 0px"),Z=FE(["strokeDasharray"],p,d);return b.createElement(zx,{animationId:O,key:O,canBegin:x>0,duration:p,easing:d,isActive:m,begin:h},J=>{var ne=Zt(A,i,J),re=Zt(M,a,J),B=Zt(D,l,J),F=Zt($,n,J),G=Zt(q,r,J);v.current&&(S.current=ne,j.current=re,k.current=B,C.current=F,E.current=G);var W=J>0?{transition:Z,strokeDasharray:L}:{strokeDasharray:X};return b.createElement("path",wf({},ur(t),{className:P,d:DC(F,G,ne,re,B),ref:v,style:IC(IC({},W),t.style)}))})},pQ=["option","shapeType","activeClassName"];function hQ(e,t){if(e==null)return{};var n,r,i=mQ(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 mQ(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){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 jf(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RC(Object(n),!0).forEach(function(r){gQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gQ(e,t,n){return(t=vQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vQ(e){var t=xQ(e,"string");return typeof t=="symbol"?t:t+""}function xQ(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 yQ(e,t){return jf(jf({},t),e)}function bQ(e,t){return e==="symbols"}function LC(e){var{shapeType:t,elementProps:n}=e;switch(t){case"rectangle":return b.createElement(WE,n);case"trapezoid":return b.createElement(fQ,n);case"sector":return b.createElement(HE,n);case"symbols":if(bQ(t))return b.createElement(IA,n);break;case"curve":return b.createElement(zE,n);default:return null}}function wQ(e){return b.isValidElement(e)?e.props:e}function jQ(e){var{option:t,shapeType:n,activeClassName:r="recharts-active-shape"}=e,i=hQ(e,pQ),a;if(b.isValidElement(t))a=b.cloneElement(t,jf(jf({},i),wQ(t)));else if(typeof t=="function")a=t(i,i.index);else if(oQ(t)&&typeof t!="boolean"){var l=yQ(t,i);a=b.createElement(LC,{shapeType:n,elementProps:l})}else{var u=i;a=b.createElement(LC,{shapeType:n,elementProps:u})}return i.isActive?b.createElement(wi,{className:r},a):a}var NM=(e,t,n)=>{var r=Nt();return(i,a)=>l=>{e==null||e(i,a,l),r($5({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},kM=e=>{var t=Nt();return(n,r)=>i=>{e==null||e(n,r,i),t(IH())}},PM=(e,t,n)=>{var r=Nt();return(i,a)=>l=>{e==null||e(i,a,l),r(DH({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function SQ(e){var{tooltipEntrySettings:t}=e,n=Nt(),r=qn(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(EH(t)):i.current!==t&&n(TH({prev:i.current,next:t})),i.current=t)},[t,n,r]),b.useLayoutEffect(()=>()=>{i.current&&(n(MH(i.current)),i.current=null)},[n]),null}function NQ(e){var{legendPayload:t}=e,n=Nt(),r=qn(),i=b.useRef(null);return b.useLayoutEffect(()=>{r||(i.current===null?n(uU(t)):i.current!==t&&n(dU({prev:i.current,next:t})),i.current=t)},[n,r,t]),b.useLayoutEffect(()=>()=>{i.current&&(n(fU(i.current)),i.current=null)},[n]),null}var rg,kQ=()=>{var[e]=b.useState(()=>Ql("uid-"));return e},PQ=(rg=YI.useId)!==null&&rg!==void 0?rg:kQ;function CQ(e,t){var n=PQ();return t||(e?"".concat(e,"-").concat(n):n)}var OQ=b.createContext(void 0),AQ=e=>{var{id:t,type:n,children:r}=e,i=CQ("recharts-".concat(n),t);return b.createElement(OQ.Provider,{value:i},r(i))},EQ={cartesianItems:[],polarItems:[]},CM=Tn({name:"graphicalItems",initialState:EQ,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:dt()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Or(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:dt()},removeCartesianGraphicalItem:{reducer(e,t){var n=Or(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:dt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:dt()},removePolarGraphicalItem:{reducer(e,t){var n=Or(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:dt()}}}),{addCartesianGraphicalItem:TQ,replaceCartesianGraphicalItem:MQ,removeCartesianGraphicalItem:_Q,addPolarGraphicalItem:Ite,removePolarGraphicalItem:Dte}=CM.actions,IQ=CM.reducer,DQ=e=>{var t=Nt(),n=b.useRef(null);return b.useLayoutEffect(()=>{n.current===null?t(TQ(e)):n.current!==e&&t(MQ({prev:n.current,next:e})),n.current=e},[t,e]),b.useLayoutEffect(()=>()=>{n.current&&(t(_Q(n.current)),n.current=null)},[t]),null},RQ=b.memo(DQ);function $C(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 zC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$C(Object(n),!0).forEach(function(r){LQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$C(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LQ(e,t,n){return(t=$Q(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $Q(e){var t=zQ(e,"string");return typeof t=="symbol"?t:t+""}function zQ(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 OM=0,FQ={xAxis:{},yAxis:{},zAxis:{}},AM=Tn({name:"cartesianAxis",initialState:FQ,reducers:{addXAxis:{reducer(e,t){e.xAxis[t.payload.id]=t.payload},prepare:dt()},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:dt()},removeXAxis:{reducer(e,t){delete e.xAxis[t.payload.id]},prepare:dt()},addYAxis:{reducer(e,t){e.yAxis[t.payload.id]=t.payload},prepare:dt()},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:dt()},removeYAxis:{reducer(e,t){delete e.yAxis[t.payload.id]},prepare:dt()},addZAxis:{reducer(e,t){e.zAxis[t.payload.id]=t.payload},prepare:dt()},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:dt()},removeZAxis:{reducer(e,t){delete e.zAxis[t.payload.id]},prepare:dt()},updateYAxisWidth(e,t){var{id:n,width:r}=t.payload,i=e.yAxis[n];if(i){var a,l=i.widthHistory||[];if(l.length===3&&l[0]===l[2]&&r===l[1]&&r!==i.width&&Math.abs(r-((a=l[0])!==null&&a!==void 0?a:0))<=1)return;var u=[...l,r].slice(-3);e.yAxis[n]=zC(zC({},i),{},{width:r,widthHistory:u})}}}}),{addXAxis:BQ,replaceXAxis:VQ,removeXAxis:UQ,addYAxis:WQ,replaceYAxis:qQ,removeYAxis:KQ,addZAxis:Rte,replaceZAxis:Lte,removeZAxis:$te,updateYAxisWidth:HQ}=AM.actions,GQ=AM.reducer,YQ=Q([Wt],e=>({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),XQ=Q([YQ,Ai,Ei],(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)}}),EM=()=>Ae(XQ),FC=(e,t,n)=>{var r=n??e;if(!Ut(r))return Ar(r,t,0)},QQ=(e,t,n)=>{var r={},i=e.filter(hp),a=e.filter(p=>p.stackId==null),l=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(l).map(p=>{var h,[m,v]=p,x=v.map(S=>S.dataKey),w=FC(t,n,(h=v[0])===null||h===void 0?void 0:h.barSize);return{stackId:m,dataKeys:x,barSize:w}}),d=a.map(p=>{var h=[p.dataKey].filter(v=>v!=null),m=FC(t,n,p.barSize);return{stackId:void 0,dataKeys:h,barSize:m}});return[...u,...d]};function BC(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 cd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BC(Object(n),!0).forEach(function(r){JQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function JQ(e,t,n){return(t=ZQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZQ(e){var t=eJ(e,"string");return typeof t=="symbol"?t:t+""}function eJ(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 tJ(e,t,n,r,i){var a,l=r.length;if(!(l<1)){var u=Ar(e,n,0,!0),d,p=[];if(qe((a=r[0])===null||a===void 0?void 0:a.barSize)){var h=!1,m=n/l,v=r.reduce((C,E)=>C+(E.barSize||0),0);v+=(l-1)*u,v>=n&&(v-=(l-1)*u,u=0),v>=n&&m>0&&(h=!0,m*=.9,v=l*m);var x=(n-v)/2>>0,w={offset:x-u,size:0};d=r.reduce((C,E)=>{var O,P={stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:w.offset+w.size+u,size:h?m:(O=E.barSize)!==null&&O!==void 0?O:0}},A=[...C,P];return w=P.position,A},p)}else{var S=Ar(t,n,0,!0);n-2*S-(l-1)*u<=0&&(u=0);var j=(n-2*S-(l-1)*u)/l;j>1&&(j>>=0);var k=qe(i)?Math.min(j,i):j;d=r.reduce((C,E,O)=>[...C,{stackId:E.stackId,dataKeys:E.dataKeys,position:{offset:S+(j+u)*O+(j-k)/2,size:k}}],p)}return d}}var nJ=(e,t,n,r,i,a,l)=>{var u=Ut(l)?t:l,d=tJ(n,r,i!==a?i:a,e,u);return i!==a&&d!=null&&(d=d.map(p=>cd(cd({},p),{},{position:cd(cd({},p.position),{},{offset:p.position.offset-i/2})}))),d},rJ=(e,t)=>{var n=xy(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(l=>l.key===n)}}}},iJ=(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 sJ(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&qe(e.zIndex)?e.zIndex:t}var aJ=e=>{var{chartData:t}=e,n=Nt(),r=qn();return b.useEffect(()=>r?()=>{}:(n(ZP(t)),()=>{n(ZP(void 0))}),[t,n,r]),null},VC={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},TM=Tn({name:"brush",initialState:VC,reducers:{setBrushSettings(e,t){return t.payload==null?VC:t.payload}}}),{setBrushSettings:zte}=TM.actions,oJ=TM.reducer;function lJ(e){return(e%180+180)%180}var cJ=function(t){var{width:n,height:r}=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=lJ(i),l=a*Math.PI/180,u=Math.atan(r/n),d=l>u&&l<Math.PI-u?r/Math.sin(l):n/Math.cos(l);return Math.abs(d)},uJ={dots:[],areas:[],lines:[]},MM=Tn({name:"referenceElements",initialState:uJ,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Or(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=Or(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=Or(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:Fte,removeDot:Bte,addArea:Vte,removeArea:Ute,addLine:Wte,removeLine:qte}=MM.actions,dJ=MM.reducer,fJ=b.createContext(void 0),pJ=e=>{var{children:t}=e,[n]=b.useState("".concat(Ql("recharts"),"-clip")),r=EM();if(r==null)return null;var{x:i,y:a,width:l,height:u}=r;return b.createElement(fJ.Provider,{value:n},b.createElement("defs",null,b.createElement("clipPath",{id:n},b.createElement("rect",{x:i,y:a,height:u,width:l}))),t)};function _M(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 hJ(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return cJ(r,n)}function mJ(e,t,n){var r=n==="width",{x:i,y:a,width:l,height:u}=e;return t===1?{start:r?i:a,end:r?i+l:a+u}:{start:r?i+l:a+u,end:r?i:a}}function dc(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 gJ(e,t){return _M(e,t+1)}function vJ(e,t,n,r,i){for(var a=(r||[]).slice(),{start:l,end:u}=t,d=0,p=1,h=l,m=function(){var w=r==null?void 0:r[d];if(w===void 0)return{v:_M(r,p)};var S=d,j,k=()=>(j===void 0&&(j=n(w,S)),j),C=w.coordinate,E=d===0||dc(e,C,k,h,u);E||(d=0,h=l,p+=1),E&&(h=C+e*(k()/2+i),d+=p)},v;p<=a.length;)if(v=m(),v)return v.v;return[]}function xJ(e,t,n,r,i){var a=(r||[]).slice(),l=a.length;if(l===0)return[];for(var{start:u,end:d}=t,p=1;p<=l;p++){for(var h=(l-1)%p,m=u,v=!0,x=function(){var O=r[S];if(O==null)return 0;var P=S,A,M=()=>(A===void 0&&(A=n(O,P)),A),D=O.coordinate,$=S===h||dc(e,D,M,m,d);if(!$)return v=!1,1;$&&(m=D+e*(M()/2+i))},w,S=h;S<l&&(w=x(),!(w!==0&&w===1));S+=p);if(v){for(var j=[],k=h;k<l;k+=p){var C=r[k];C!=null&&j.push(C)}return j}}return[]}function UC(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 cn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?UC(Object(n),!0).forEach(function(r){yJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yJ(e,t,n){return(t=bJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bJ(e){var t=wJ(e,"string");return typeof t=="symbol"?t:t+""}function wJ(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 jJ(e,t,n,r,i){for(var a=(r||[]).slice(),l=a.length,{start:u}=t,{end:d}=t,p=function(v){var x=a[v];if(x==null)return 1;var w=x,S,j=()=>(S===void 0&&(S=n(x,v)),S);if(v===l-1){var k=e*(w.coordinate+e*j()/2-d);a[v]=w=cn(cn({},w),{},{tickCoord:k>0?w.coordinate-k*e:w.coordinate})}else a[v]=w=cn(cn({},w),{},{tickCoord:w.coordinate});if(w.tickCoord!=null){var C=dc(e,w.tickCoord,j,u,d);C&&(d=w.tickCoord-e*(j()/2+i),a[v]=cn(cn({},w),{},{isShow:!0}))}},h=l-1;h>=0;h--)p(h);return a}function SJ(e,t,n,r,i,a){var l=(r||[]).slice(),u=l.length,{start:d,end:p}=t;if(a){var h=r[u-1];if(h!=null){var m=n(h,u-1),v=e*(h.coordinate+e*m/2-p);if(l[u-1]=h=cn(cn({},h),{},{tickCoord:v>0?h.coordinate-v*e:h.coordinate}),h.tickCoord!=null){var x=dc(e,h.tickCoord,()=>m,d,p);x&&(p=h.tickCoord-e*(m/2+i),l[u-1]=cn(cn({},h),{},{isShow:!0}))}}}for(var w=a?u-1:u,S=function(C){var E=l[C];if(E==null)return 1;var O=E,P,A=()=>(P===void 0&&(P=n(E,C)),P);if(C===0){var M=e*(O.coordinate-e*A()/2-d);l[C]=O=cn(cn({},O),{},{tickCoord:M<0?O.coordinate-M*e:O.coordinate})}else l[C]=O=cn(cn({},O),{},{tickCoord:O.coordinate});if(O.tickCoord!=null){var D=dc(e,O.tickCoord,A,d,p);D&&(d=O.tickCoord+e*(A()/2+i),l[C]=cn(cn({},O),{},{isShow:!0}))}},j=0;j<w;j++)S(j);return l}function NJ(e,t,n){var{tick:r,ticks:i,viewBox:a,minTickGap:l,orientation:u,interval:d,tickFormatter:p,unit:h,angle:m}=e;if(!i||!i.length||!r)return[];if(Ne(d)||np.isSsr){var v;return(v=gJ(i,Ne(d)?d:0))!==null&&v!==void 0?v:[]}var x=[],w=u==="top"||u==="bottom"?"width":"height",S=h&&w==="width"?Vl(h,{fontSize:t,letterSpacing:n}):{width:0,height:0},j=(P,A)=>{var M=typeof p=="function"?p(P.value,A):P.value;return w==="width"?hJ(Vl(M,{fontSize:t,letterSpacing:n}),S,m):Vl(M,{fontSize:t,letterSpacing:n})[w]},k=i[0],C=i[1],E=i.length>=2&&k!=null&&C!=null?zn(C.coordinate-k.coordinate):1,O=mJ(a,E,w);return d==="equidistantPreserveStart"?vJ(E,O,j,i,l):d==="equidistantPreserveEnd"?xJ(E,O,j,i,l):(d==="preserveStart"||d==="preserveStartEnd"?x=SJ(E,O,j,i,l,d==="preserveStartEnd"):x=jJ(E,O,j,i,l),x.filter(P=>P.isShow))}var kJ=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:i=0,tickMargin:a=0}=e,l=0;if(t){Array.from(t).forEach(h=>{if(h){var m=h.getBoundingClientRect();m.width>l&&(l=m.width)}});var u=n?n.getBoundingClientRect().width:0,d=i+a,p=l+d+u+(n?r:0);return Math.round(p)}return 0},PJ=["axisLine","width","height","className","hide","ticks","axisType"];function CJ(e,t){if(e==null)return{};var n,r,i=OJ(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 OJ(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 la(){return la=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},la.apply(null,arguments)}function WC(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 vt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WC(Object(n),!0).forEach(function(r){AJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AJ(e,t,n){return(t=EJ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EJ(e){var t=TJ(e,"string");return typeof t=="symbol"?t:t+""}function TJ(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:An.axis};function MJ(e){var{x:t,y:n,width:r,height:i,orientation:a,mirror:l,axisLine:u,otherSvgProps:d}=e;if(!u)return null;var p=vt(vt(vt({},d),xs(u)),{},{fill:"none"});if(a==="top"||a==="bottom"){var h=+(a==="top"&&!l||a==="bottom"&&l);p=vt(vt({},p),{},{x1:t,y1:n+h*i,x2:t+r,y2:n+h*i})}else{var m=+(a==="left"&&!l||a==="right"&&l);p=vt(vt({},p),{},{x1:t+m*r,y1:n,x2:t+m*r,y2:n+i})}return b.createElement("line",la({},p,{className:it("recharts-cartesian-axis-line",uo(u,"className"))}))}function _J(e,t,n,r,i,a,l,u,d){var p,h,m,v,x,w,S=u?-1:1,j=e.tickSize||l,k=Ne(e.tickCoord)?e.tickCoord:e.coordinate;switch(a){case"top":p=h=e.coordinate,v=n+ +!u*i,m=v-S*j,w=m-S*d,x=k;break;case"left":m=v=e.coordinate,h=t+ +!u*r,p=h-S*j,x=p-S*d,w=k;break;case"right":m=v=e.coordinate,h=t+ +u*r,p=h+S*j,x=p+S*d,w=k;break;default:p=h=e.coordinate,v=n+ +u*i,m=v+S*j,w=m+S*d,x=k;break}return{line:{x1:p,y1:m,x2:h,y2:v},tick:{x,y:w}}}function IJ(e,t){switch(e){case"left":return t?"start":"end";case"right":return t?"end":"start";default:return"middle"}}function DJ(e,t){switch(e){case"left":case"right":return"middle";case"top":return t?"start":"end";default:return t?"end":"start"}}function RJ(e){var{option:t,tickProps:n,value:r}=e,i,a=it(n.className,"recharts-cartesian-axis-tick-value");if(b.isValidElement(t))i=b.cloneElement(t,vt(vt({},n),{},{className:a}));else if(typeof t=="function")i=t(vt(vt({},n),{},{className:a}));else{var l="recharts-cartesian-axis-tick-value";typeof t!="boolean"&&(l=it(l,ZX(t))),i=b.createElement(zy,la({},n,{className:l}),r)}return i}var LJ=b.forwardRef((e,t)=>{var{ticks:n=[],tick:r,tickLine:i,stroke:a,tickFormatter:l,unit:u,padding:d,tickTextProps:p,orientation:h,mirror:m,x:v,y:x,width:w,height:S,tickSize:j,tickMargin:k,fontSize:C,letterSpacing:E,getTicksConfig:O,events:P,axisType:A}=e,M=NJ(vt(vt({},O),{},{ticks:n}),C,E),D=IJ(h,m),$=DJ(h,m),q=xs(O),X=vx(r),L={};typeof i=="object"&&(L=i);var Z=vt(vt({},q),{},{fill:"none"},L),J=M.map(B=>vt({entry:B},_J(B,v,x,w,S,h,j,m,k))),ne=J.map(B=>{var{entry:F,line:G}=B;return b.createElement(wi,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(F.value,"-").concat(F.coordinate,"-").concat(F.tickCoord)},i&&b.createElement("line",la({},Z,G,{className:it("recharts-cartesian-axis-tick-line",uo(i,"className"))})))}),re=J.map((B,F)=>{var G,W,{entry:_,tick:V}=B,ie=vt(vt(vt(vt({verticalAnchor:$},q),{},{textAnchor:D,stroke:"none",fill:a},V),{},{index:F,payload:_,visibleTicksCount:M.length,tickFormatter:l,padding:d},p),{},{angle:(G=(W=p==null?void 0:p.angle)!==null&&W!==void 0?W:q.angle)!==null&&G!==void 0?G:0}),fe=vt(vt({},ie),X);return b.createElement(wi,la({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(_.value,"-").concat(_.coordinate,"-").concat(_.tickCoord)},Nx(P,_,F)),r&&b.createElement(RJ,{option:r,tickProps:fe,value:"".concat(typeof l=="function"?l(_.value,F):_.value).concat(u||"")}))});return b.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(A,"-ticks")},re.length>0&&b.createElement(Ns,{zIndex:An.label},b.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(A,"-tick-labels"),ref:t},re)),ne.length>0&&b.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(A,"-tick-lines")},ne))}),$J=b.forwardRef((e,t)=>{var{axisLine:n,width:r,height:i,className:a,hide:l,ticks:u,axisType:d}=e,p=CJ(e,PJ),[h,m]=b.useState(""),[v,x]=b.useState(""),w=b.useRef(null);b.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var j;return kJ({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),O=E.fontSize,P=E.letterSpacing;(O!==h||P!==v)&&(m(O),x(P))}}},[h,v]);return l||r!=null&&r<=0||i!=null&&i<=0?null:b.createElement(Ns,{zIndex:e.zIndex},b.createElement(wi,{className:it("recharts-cartesian-axis",a)},b.createElement(MJ,{x:e.x,y:e.y,width:r,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:xs(e)}),b.createElement(LJ,{ref:S,axisType:d,events:p,fontSize:h,getTicksConfig:e,height:e.height,letterSpacing:v,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(PX,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},b.createElement(RX,{label:e.label,labelRef:e.labelRef}),e.children)))}),By=b.forwardRef((e,t)=>{var n=pr(e,ta);return b.createElement($J,la({},n,{ref:t}))});By.displayName="CartesianAxis";var zJ={},IM=Tn({name:"errorBars",initialState:zJ,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:Kte,replaceErrorBar:Hte,removeErrorBar:Gte}=IM.actions,FJ=IM.reducer,BJ=["children"];function VJ(e,t){if(e==null)return{};var n,r,i=UJ(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 UJ(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 WJ={data:[],xAxisId:"xAxis-0",yAxisId:"yAxis-0",dataPointFormatter:()=>({x:0,y:0,value:0}),errorBarOffset:0},qJ=b.createContext(WJ);function KJ(e){var{children:t}=e,n=VJ(e,BJ);return b.createElement(qJ.Provider,{value:n},t)}function DM(e,t){var n,r,i=Ae(p=>_i(p,e)),a=Ae(p=>Ii(p,t)),l=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:Ft.allowDataOverflow,u=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:Bt.allowDataOverflow,d=l||u;return{needClip:d,needClipX:l,needClipY:u}}function HJ(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=EM(),{needClipX:a,needClipY:l,needClip:u}=DM(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:l?p:p-m/2,width:a?h:h*2,height:l?m:m*2}))}var ig={exports:{}},sg={};/**
|
|
346
|
-
* @license React
|
|
347
|
-
* use-sync-external-store-with-selector.production.js
|
|
348
|
-
*
|
|
349
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
350
|
-
*
|
|
351
|
-
* This source code is licensed under the MIT license found in the
|
|
352
|
-
* LICENSE file in the root directory of this source tree.
|
|
353
|
-
*/var qC;function GJ(){if(qC)return sg;qC=1;var e=bo();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,l=e.useMemo,u=e.useDebugValue;return sg.useSyncExternalStoreWithSelector=function(d,p,h,m,v){var x=i(null);if(x.current===null){var w={hasValue:!1,value:null};x.current=w}else w=x.current;x=l(function(){function j(P){if(!k){if(k=!0,C=P,P=m(P),v!==void 0&&w.hasValue){var A=w.value;if(v(A,P))return E=A}return E=P}if(A=E,n(C,P))return A;var M=m(P);return v!==void 0&&v(A,M)?(C=P,A):(C=P,E=M)}var k=!1,C,E,O=h===void 0?null:h;return[function(){return j(p())},O===null?void 0:function(){return j(O())}]},[p,h,m,v]);var S=r(d,x[0],x[1]);return a(function(){w.hasValue=!0,w.value=S},[S]),u(S),S},sg}var KC;function YJ(){return KC||(KC=1,ig.exports=GJ()),ig.exports}YJ();function XJ(e){e()}function QJ(){let e=null,t=null;return{clear(){e=null,t=null},notify(){XJ(()=>{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 HC={notify(){},get:()=>[]};function JJ(e,t){let n,r=HC,i=0,a=!1;function l(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=QJ())}function m(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=HC)}function v(){a||(a=!0,h())}function x(){a&&(a=!1,m())}const w={addNestedSub:l,notifyNestedSubs:u,handleChangeWrapper:d,isSubscribed:p,trySubscribe:v,tryUnsubscribe:x,getListeners:()=>r};return w}var ZJ=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eZ=ZJ(),tZ=()=>typeof navigator<"u"&&navigator.product==="ReactNative",nZ=tZ(),rZ=()=>eZ||nZ?b.useLayoutEffect:b.useEffect,iZ=rZ();function GC(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function sZ(e,t){if(GC(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])||!GC(e[n[i]],t[n[i]]))return!1;return!0}var ag=Symbol.for("react-redux-context"),og=typeof globalThis<"u"?globalThis:{};function aZ(){if(!b.createContext)return{};const e=og[ag]??(og[ag]=new Map);let t=e.get(b.createContext);return t||(t=b.createContext(null),e.set(b.createContext,t)),t}var oZ=aZ();function lZ(e){const{children:t,context:n,serverState:r,store:i}=e,a=b.useMemo(()=>{const d=JJ(i);return{store:i,subscription:d,getServerState:r?()=>r:void 0}},[i,r]),l=b.useMemo(()=>i.getState(),[i]);iZ(()=>{const{subscription:d}=a;return d.onStateChange=d.notifyNestedSubs,d.trySubscribe(),l!==i.getState()&&d.notifyNestedSubs(),()=>{d.tryUnsubscribe(),d.onStateChange=void 0}},[a,l]);const u=n||oZ;return b.createElement(u.Provider,{value:a},t)}var cZ=lZ,uZ=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function dZ(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Vy(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(uZ.has(r)){if(e[r]==null&&t[r]==null)continue;if(!sZ(e[r],t[r]))return!1}else if(!dZ(e[r],t[r]))return!1;return!0}function fa(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:OM}function pa(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:OM}var fZ="Invariant failed";function pZ(e,t){throw new Error(fZ)}function bv(){return bv=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},bv.apply(null,arguments)}function Sf(e){return b.createElement(jQ,bv({shapeType:"rectangle",activeClassName:"recharts-active-bar"},e))}var hZ=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return(r,i)=>{if(Ne(t))return t;var a=Ne(r)||Ut(r);return a?t(r,i):(a||pZ(),n)}},mZ=(e,t,n)=>n,gZ=(e,t)=>t,Ic=Q([by,gZ],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),vZ=Q([Ic],e=>e==null?void 0:e.maxBarSize),xZ=(e,t,n,r)=>r,yZ=Q([tt,by,fa,pa,mZ],(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")),bZ=(e,t,n)=>{var r=tt(e),i=fa(e,t),a=pa(e,t);if(!(i==null||a==null))return r==="horizontal"?hv(e,"yAxis",a,n):hv(e,"xAxis",i,n)},wZ=(e,t)=>{var n=tt(e),r=fa(e,t),i=pa(e,t);if(!(r==null||i==null))return n==="horizontal"?BP(e,"xAxis",r):BP(e,"yAxis",i)},jZ=Q([yZ,yK,wZ],QQ),SZ=(e,t,n)=>{var r,i,a=Ic(e,t);if(a==null)return 0;var l=fa(e,t),u=pa(e,t);if(l==null||u==null)return 0;var d=tt(e),p=BT(e),{maxBarSize:h}=a,m=Ut(h)?p:h,v,x;return d==="horizontal"?(v=xo(e,"xAxis",l,n),x=vo(e,"xAxis",l,n)):(v=xo(e,"yAxis",u,n),x=vo(e,"yAxis",u,n)),(r=(i=Yd(v,x,!0))!==null&&i!==void 0?i:m)!==null&&r!==void 0?r:0},RM=(e,t,n)=>{var r=tt(e),i=fa(e,t),a=pa(e,t);if(!(i==null||a==null)){var l,u;return r==="horizontal"?(l=xo(e,"xAxis",i,n),u=vo(e,"xAxis",i,n)):(l=xo(e,"yAxis",a,n),u=vo(e,"yAxis",a,n)),Yd(l,u)}},NZ=Q([jZ,BT,xK,VT,SZ,RM,vZ],nJ),kZ=(e,t,n)=>{var r=fa(e,t);if(r!=null)return xo(e,"xAxis",r,n)},PZ=(e,t,n)=>{var r=pa(e,t);if(r!=null)return xo(e,"yAxis",r,n)},CZ=(e,t,n)=>{var r=fa(e,t);if(r!=null)return vo(e,"xAxis",r,n)},OZ=(e,t,n)=>{var r=pa(e,t);if(r!=null)return vo(e,"yAxis",r,n)},AZ=Q([NZ,Ic],iJ),EZ=Q([bZ,Ic],rJ),TZ=Q([Wt,Ix,kZ,PZ,CZ,OZ,AZ,tt,uK,RM,EZ,Ic,xZ],(e,t,n,r,i,a,l,u,d,p,h,m,v)=>{var{chartData:x,dataStartIndex:w,dataEndIndex:S}=d;if(!(m==null||l==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=x==null?void 0:x.slice(w,S+1),k!=null)return see({layout:u,barSettings:m,pos:l,parentViewBox:t,bandSize:p,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,stackedData:h,displayedData:k,offset:e,cells:v,dataStartIndex:w})}}),MZ=["index"];function wv(){return wv=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},wv.apply(null,arguments)}function _Z(e,t){if(e==null)return{};var n,r,i=IZ(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 IZ(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 LM=b.createContext(void 0),DZ=e=>{var t=b.useContext(LM);if(t!=null)return t.stackId;if(e!=null)return cV(e)},RZ=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),LZ=e=>{var t=b.useContext(LM);if(t!=null){var{stackId:n}=t;return"url(#".concat(RZ(n,e),")")}},$M=e=>{var{index:t}=e,n=_Z(e,MZ),r=LZ(t);return b.createElement(wi,wv({className:"recharts-bar-stack-layer",clipPath:r},n))},$Z=["onMouseEnter","onMouseLeave","onClick"],zZ=["value","background","tooltipPosition"],FZ=["id"],BZ=["onMouseEnter","onClick","onMouseLeave"];function Oi(){return Oi=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},Oi.apply(null,arguments)}function YC(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 hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?YC(Object(n),!0).forEach(function(r){VZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function VZ(e,t,n){return(t=UZ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UZ(e){var t=WZ(e,"string");return typeof t=="symbol"?t:t+""}function WZ(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(e,t){if(e==null)return{};var n,r,i=qZ(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 qZ(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 KZ=e=>{var{dataKey:t,name:n,fill:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:NE(n,t),payload:e}]},HZ=b.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:i,name:a,hide:l,unit:u,tooltipType:d,id:p}=e,h={dataDefinedOnItem:void 0,getPosition:Po,settings:{stroke:n,strokeWidth:r,fill:i,dataKey:t,nameKey:void 0,name:NE(a,t),hide:l,type:d,color:i,unit:u,graphicalItemId:p}};return b.createElement(SQ,{tooltipEntrySettings:h})});function GZ(e){var t=Ae(yo),{data:n,dataKey:r,background:i,allOtherBarProps:a}=e,{onMouseEnter:l,onMouseLeave:u,onClick:d}=a,p=Nf(a,$Z),h=NM(l,r,a.id),m=kM(u),v=PM(d,r,a.id);if(!i||n==null)return null;var x=vx(i);return b.createElement(Ns,{zIndex:sJ(i,An.barBackground)},n.map((w,S)=>{var{value:j,background:k,tooltipPosition:C}=w,E=Nf(w,zZ);if(!k)return null;var O=h(w,S),P=m(w,S),A=v(w,S),M=hn(hn(hn(hn(hn({option:i,isActive:String(S)===t},E),{},{fill:"#eee"},k),x),Nx(p,w,S)),{},{onMouseEnter:O,onMouseLeave:P,onClick:A,dataKey:r,index:S,className:"recharts-bar-background-rectangle"});return b.createElement(Sf,Oi({key:"background-bar-".concat(S)},M))}))}function YZ(e){var{showLabels:t,children:n,rects:r}=e,i=r==null?void 0:r.map(a=>{var l={x:a.x,y:a.y,width:a.width,lowerWidth:a.width,upperWidth:a.width,height:a.height};return hn(hn({},l),{},{value:a.value,payload:a.payload,parentViewBox:a.parentViewBox,viewBox:l,fill:a.fill})});return b.createElement(HX,{value:t?i:void 0},n)}function XZ(e){var{shape:t,activeBar:n,baseProps:r,entry:i,index:a,dataKey:l}=e,u=Ae(yo),d=Ae(Z5),p=n&&String(a)===u&&(d==null||l===d),h=p?n:t;return p?b.createElement(Ns,{zIndex:An.activeBar},b.createElement($M,{index:a},b.createElement(Sf,Oi({},r,{name:String(r.name)},i,{isActive:p,option:h,index:a,dataKey:l})))):b.createElement(Sf,Oi({},r,{name:String(r.name)},i,{isActive:p,option:h,index:a,dataKey:l}))}function QZ(e){var{shape:t,baseProps:n,entry:r,index:i,dataKey:a}=e;return b.createElement(Sf,Oi({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:i,dataKey:a}))}function JZ(e){var t,{data:n,props:r}=e,i=(t=xs(r))!==null&&t!==void 0?t:{},{id:a}=i,l=Nf(i,FZ),{shape:u,dataKey:d,activeBar:p}=r,{onMouseEnter:h,onClick:m,onMouseLeave:v}=r,x=Nf(r,BZ),w=NM(h,d,a),S=kM(v),j=PM(m,d,a);return n?b.createElement(b.Fragment,null,n.map((k,C)=>b.createElement($M,Oi({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"},Nx(x,k,C),{onMouseEnter:w(k,C),onMouseLeave:S(k,C),onClick:j(k,C)}),p?b.createElement(XZ,{shape:u,activeBar:p,baseProps:l,entry:k,index:C,dataKey:d}):b.createElement(QZ,{shape:u,baseProps:l,entry:k,index:C,dataKey:d})))):null}function ZZ(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:i,isAnimationActive:a,animationBegin:l,animationDuration:u,animationEasing:d,onAnimationEnd:p,onAnimationStart:h}=t,m=n.current,v=Fx(t,"recharts-bar-"),[x,w]=b.useState(!1),S=!x,j=b.useCallback(()=>{typeof p=="function"&&p(),w(!1)},[p]),k=b.useCallback(()=>{typeof h=="function"&&h(),w(!0)},[h]);return b.createElement(YZ,{showLabels:S,rects:r},b.createElement(zx,{animationId:v,begin:l,duration:u,isActive:a,easing:d,onAnimationEnd:j,onAnimationStart:k,key:v},C=>{var E=C===1?r:r==null?void 0:r.map((O,P)=>{var A=m&&m[P];if(A)return hn(hn({},O),{},{x:Zt(A.x,O.x,C),y:Zt(A.y,O.y,C),width:Zt(A.width,O.width,C),height:Zt(A.height,O.height,C)});if(i==="horizontal"){var M=Zt(0,O.height,C),D=Zt(O.stackedBarStart,O.y,C);return hn(hn({},O),{},{y:D,height:M})}var $=Zt(0,O.width,C),q=Zt(O.stackedBarStart,O.x,C);return hn(hn({},O),{},{width:$,x:q})});return C>0&&(n.current=E??null),E==null?null:b.createElement(wi,null,b.createElement(JZ,{props:t,data:E}))}),b.createElement(XX,{label:t.label}),t.children)}function eee(e){var t=b.useRef(null);return b.createElement(ZZ,{previousRectanglesRef:t,props:e})}var zM=0,tee=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:tn(e,t)}};class nee extends b.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:i,xAxisId:a,yAxisId:l,needClip:u,background:d,id:p}=this.props;if(t||n==null)return null;var h=it("recharts-bar",i),m=p;return b.createElement(wi,{className:h,id:p},u&&b.createElement("defs",null,b.createElement(HJ,{clipPathId:m,xAxisId:a,yAxisId:l})),b.createElement(wi,{className:"recharts-bar-rectangles",clipPath:u?"url(#clipPath-".concat(m,")"):void 0},b.createElement(GZ,{data:n,dataKey:r,background:d,allOtherBarProps:this.props}),b.createElement(eee,this.props)))}}var ree={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:zM,xAxisId:0,yAxisId:0,zIndex:An.bar};function iee(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:p,isAnimationActive:h}=e,{needClip:m}=DM(t,n),v=Co(),x=qn(),w=rQ(e.children,cM),S=Ae(C=>TZ(C,e.id,x,w));if(v!=="vertical"&&v!=="horizontal")return null;var j,k=S==null?void 0:S[0];return k==null||k.height==null||k.width==null?j=0:j=v==="vertical"?k.height/2:k.width/2,b.createElement(KJ,{xAxisId:t,yAxisId:n,data:S,dataPointFormatter:tee,errorBarOffset:j},b.createElement(nee,Oi({},e,{layout:v,needClip:m,data:S,xAxisId:t,yAxisId:n,hide:r,legendType:i,minPointSize:a,activeBar:l,animationBegin:u,animationDuration:d,animationEasing:p,isAnimationActive:h})))}function see(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r},pos:i,bandSize:a,xAxis:l,yAxis:u,xAxisTicks:d,yAxisTicks:p,stackedData:h,displayedData:m,offset:v,cells:x,parentViewBox:w,dataStartIndex:S}=e,j=t==="horizontal"?u:l,k=h?j.scale.domain():null,C=uV({numericAxis:j}),E=j.scale.map(C);return m.map((O,P)=>{var A,M,D,$,q,X;if(h){var L=h[P+S];if(L==null)return null;A=iV(L,k)}else A=tn(O,n),Array.isArray(A)||(A=[C,A]);var Z=hZ(r,zM)(A[1],P);if(t==="horizontal"){var J,ne=u.scale.map(A[0]),re=u.scale.map(A[1]);if(ne==null||re==null)return null;M=BN({axis:l,ticks:d,bandSize:a,offset:i.offset,entry:O,index:P}),D=(J=re??ne)!==null&&J!==void 0?J:void 0,$=i.size;var B=ne-re;if(q=Qr(B)?0:B,X={x:M,y:v.top,width:$,height:v.height},Math.abs(Z)>0&&Math.abs(q)<Math.abs(Z)){var F=zn(q||Z)*(Math.abs(Z)-Math.abs(q));D-=F,q+=F}}else{var G=l.scale.map(A[0]),W=l.scale.map(A[1]);if(G==null||W==null)return null;if(M=G,D=BN({axis:u,ticks:p,bandSize:a,offset:i.offset,entry:O,index:P}),$=W-G,q=i.size,X={x:v.left,y:D,width:v.width,height:q},Math.abs(Z)>0&&Math.abs($)<Math.abs(Z)){var _=zn($||Z)*(Math.abs(Z)-Math.abs($));$+=_}}if(M==null||D==null||$==null||q==null)return null;var V=hn(hn({},O),{},{stackedBarStart:E,x:M,y:D,width:$,height:q,value:h?A:A[1],payload:O,background:X,tooltipPosition:{x:M+$/2,y:D+q/2},parentViewBox:w},x&&x[P]&&x[P].props);return V}).filter(Boolean)}function aee(e){var t=pr(e,ree),n=DZ(t.stackId),r=qn();return b.createElement(AQ,{id:t.id,type:"bar"},i=>b.createElement(b.Fragment,null,b.createElement(NQ,{legendPayload:KZ(t)}),b.createElement(HZ,{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(RQ,{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(Ns,{zIndex:t.zIndex},b.createElement(iee,Oi({},t,{id:i})))))}var FM=b.memo(aee,Vy);FM.displayName="Bar";var oee=["domain","range"],lee=["domain","range"];function XC(e,t){if(e==null)return{};var n,r,i=cee(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 cee(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 QC(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 BM(e,t){if(e===t)return!0;var{domain:n,range:r}=e,i=XC(e,oee),{domain:a,range:l}=t,u=XC(t,lee);return!QC(n,a)||!QC(r,l)?!1:Vy(i,u)}var uee=["type"],dee=["dangerouslySetInnerHTML","ticks","scale"],fee=["id","scale"];function jv(){return jv=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},jv.apply(null,arguments)}function JC(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 ZC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?JC(Object(n),!0).forEach(function(r){pee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):JC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pee(e,t,n){return(t=hee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hee(e){var t=mee(e,"string");return typeof t=="symbol"?t:t+""}function mee(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 Sv(e,t){if(e==null)return{};var n,r,i=gee(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 gee(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 vee(e){var t=Nt(),n=b.useRef(null),r=AE(),{type:i}=e,a=Sv(e,uee),l=dp(r,"xAxis",i),u=b.useMemo(()=>{if(l!=null)return ZC(ZC({},a),{},{type:l})},[a,l]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(BQ(u)):n.current!==u&&t(VQ({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(UQ(n.current)),n.current=null)},[t]),null}var xee=e=>{var{xAxisId:t,className:n}=e,r=Ae(Ix),i=qn(),a="xAxis",l=Ae(k=>M5(k,a,t,i)),u=Ae(k=>O5(k,t)),d=Ae(k=>bH(k,t)),p=Ae(k=>QT(k,t));if(u==null||d==null||p==null)return null;var{dangerouslySetInnerHTML:h,ticks:m,scale:v}=e,x=Sv(e,dee),{id:w,scale:S}=p,j=Sv(p,fee);return b.createElement(By,jv({},x,j,{x:d.x,y:d.y,width:u.width,height:u.height,className:it("recharts-".concat(a," ").concat(a),n),viewBox:r,ticks:l,axisType:a}))},yee={allowDataOverflow:Ft.allowDataOverflow,allowDecimals:Ft.allowDecimals,allowDuplicatedCategory:Ft.allowDuplicatedCategory,angle:Ft.angle,axisLine:ta.axisLine,height:Ft.height,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,xAxisId:0},bee=e=>{var t=pr(e,yee);return b.createElement(b.Fragment,null,b.createElement(vee,{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(xee,t))},VM=b.memo(bee,BM);VM.displayName="XAxis";var wee=["type"],jee=["dangerouslySetInnerHTML","ticks","scale"],See=["id","scale"];function Nv(){return Nv=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},Nv.apply(null,arguments)}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){Nee(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 Nee(e,t,n){return(t=kee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kee(e){var t=Pee(e,"string");return typeof t=="symbol"?t:t+""}function Pee(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 kv(e,t){if(e==null)return{};var n,r,i=Cee(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 Cee(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 Oee(e){var t=Nt(),n=b.useRef(null),r=AE(),{type:i}=e,a=kv(e,wee),l=dp(r,"yAxis",i),u=b.useMemo(()=>{if(l!=null)return t2(t2({},a),{},{type:l})},[l,a]);return b.useLayoutEffect(()=>{u!=null&&(n.current===null?t(WQ(u)):n.current!==u&&t(qQ({prev:n.current,next:u})),n.current=u)},[u,t]),b.useLayoutEffect(()=>()=>{n.current&&(t(KQ(n.current)),n.current=null)},[t]),null}function Aee(e){var{yAxisId:t,className:n,width:r,label:i}=e,a=b.useRef(null),l=b.useRef(null),u=Ae(Ix),d=qn(),p=Nt(),h="yAxis",m=Ae(A=>A5(A,t)),v=Ae(A=>jH(A,t)),x=Ae(A=>M5(A,h,t,d)),w=Ae(A=>JT(A,t));if(b.useLayoutEffect(()=>{if(!(r!=="auto"||!m||Fy(i)||b.isValidElement(i)||w==null)){var A=a.current;if(A){var M=A.getCalculatedWidth();Math.round(m.width)!==Math.round(M)&&p(HQ({id:t,width:M}))}}},[x,m,p,i,t,r,w]),m==null||v==null||w==null)return null;var{dangerouslySetInnerHTML:S,ticks:j,scale:k}=e,C=kv(e,jee),{id:E,scale:O}=w,P=kv(w,See);return b.createElement(By,Nv({},C,P,{ref:a,labelRef:l,x:v.x,y:v.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:m.width,height:m.height,className:it("recharts-".concat(h," ").concat(h),n),viewBox:u,ticks:x,axisType:h}))}var Eee={allowDataOverflow:Bt.allowDataOverflow,allowDecimals:Bt.allowDecimals,allowDuplicatedCategory:Bt.allowDuplicatedCategory,angle:Bt.angle,axisLine:ta.axisLine,hide:!1,includeHidden:Bt.includeHidden,interval:Bt.interval,label:!1,minTickGap:Bt.minTickGap,mirror:Bt.mirror,orientation:Bt.orientation,padding:Bt.padding,reversed:Bt.reversed,scale:Bt.scale,tick:Bt.tick,tickCount:Bt.tickCount,tickLine:ta.tickLine,tickSize:ta.tickSize,type:Bt.type,width:Bt.width,yAxisId:0},Tee=e=>{var t=pr(e,Eee);return b.createElement(b.Fragment,null,b.createElement(Oee,{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(Aee,t))},UM=b.memo(Tee,BM);UM.displayName="YAxis";var Mee=(e,t)=>t,Uy=Q([Mee,tt,YT,Ht,Y5,Di,RG,Wt],UG),Wy=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)}},WM=dr("mouseClick"),qM=bc();qM.startListening({actionCreator:WM,effect:(e,t)=>{var n=e.payload,r=Uy(t.getState(),Wy(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(RH({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Pv=dr("mouseMove"),KM=bc(),ud=null;KM.startListening({actionCreator:Pv,effect:(e,t)=>{var n=e.payload;ud!==null&&cancelAnimationFrame(ud);var r=Wy(n);ud=requestAnimationFrame(()=>{var i=t.getState(),a=Ay(i,i.tooltip.settings.shared);if(a==="axis"){var l=Uy(i,r);(l==null?void 0:l.activeIndex)!=null?t.dispatch(F5({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.activeCoordinate})):t.dispatch(z5())}ud=null})}});function _ee(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 n2={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},HM=Tn({name:"rootProps",initialState:n2,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:n2.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}}}),Iee=HM.reducer,{updateOptions:Dee}=HM.actions,Ree=null,Lee={updatePolarOptions:(e,t)=>t.payload},GM=Tn({name:"polarOptions",initialState:Ree,reducers:Lee}),{updatePolarOptions:Yte}=GM.actions,$ee=GM.reducer,YM=dr("keyDown"),XM=dr("focus"),qy=bc();qy.startListening({actionCreator:YM,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 l=Ey(i,Ro(n),Ec(n),Mc(n)),u=l==null?-1:Number(l);if(!(!Number.isFinite(u)||u<0)){var d=Di(n);if(a==="Enter"){var p=yf(n,"axis","hover",String(i.index));t.dispatch(gv({active:!i.active,activeIndex:i.index,activeCoordinate:p}));return}var h=PH(n),m=h==="left-to-right"?1:-1,v=a==="ArrowRight"?1:-1,x=u+v*m;if(!(d==null||x>=d.length||x<0)){var w=yf(n,"axis","hover",String(x));t.dispatch(gv({active:!0,activeIndex:x.toString(),activeCoordinate:w}))}}}}}});qy.startListening({actionCreator:XM,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",l=yf(n,"axis","hover",String(a));t.dispatch(gv({active:!0,activeIndex:a,activeCoordinate:l}))}}}});var sr=dr("externalEvent"),QM=bc(),lg=new Map;QM.startListening({actionCreator:sr,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){r.persist();var i=r.type,a=lg.get(i);a!==void 0&&cancelAnimationFrame(a);var l=requestAnimationFrame(()=>{try{var u=t.getState(),d={activeCoordinate:wG(u),activeDataKey:Z5(u),activeIndex:yo(u),activeLabel:J5(u),activeTooltipIndex:yo(u),isTooltipActive:jG(u)};n(d,r)}finally{lg.delete(i)}});lg.set(i,l)}}});var zee=Q([Io],e=>e.tooltipItemPayloads),Fee=Q([zee,(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)}}}),JM=dr("touchMove"),ZM=bc();ZM.startListening({actionCreator:JM,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var r=t.getState(),i=Ay(r,r.tooltip.settings.shared);if(i==="axis"){var a=n.touches[0];if(a==null)return;var l=Uy(r,Wy({clientX:a.clientX,clientY:a.clientY,currentTarget:n.currentTarget}));(l==null?void 0:l.activeIndex)!=null&&t.dispatch(F5({activeIndex:l.activeIndex,activeDataKey:void 0,activeCoordinate:l.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(vV),m=(u=p.getAttribute(xV))!==null&&u!==void 0?u:void 0,v=Do(r).find(S=>S.id===m);if(h==null||v==null||m==null)return;var{dataKey:x}=v,w=Fee(r,h,m);t.dispatch($5({activeDataKey:x,activeIndex:h,activeCoordinate:w,activeGraphicalItemId:m}))}}}});var Bee=YA({brush:oJ,cartesianAxis:GQ,chartData:wY,errorBars:FJ,graphicalItems:IQ,layout:Z8,legend:pU,options:gY,polarAxis:JX,polarOptions:$ee,referenceElements:dJ,rootProps:Iee,tooltip:LH,zIndex:rY}),Vee=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return N8({reducer:Bee,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,KM.middleware,qy.middleware,QM.middleware,ZM.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(uE({type:"raf"}))},devTools:{serialize:{replacer:_ee},name:"recharts-".concat(n)}})};function Uee(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=qn(),a=b.useRef(null);if(i)return n;a.current==null&&(a.current=Vee(t,r));var l=Cx;return b.createElement(cZ,{context:l,store:a.current},n)}function Wee(e){var{layout:t,margin:n}=e,r=Nt(),i=qn();return b.useEffect(()=>{i||(r(X8(t)),r(Y8(n)))},[r,i,t,n]),null}var qee=b.memo(Wee,Vy);function Kee(e){var t=Nt();return b.useEffect(()=>{t(Dee(e))},[t,e]),null}function r2(e){var{zIndex:t,isPanorama:n}=e,r=b.useRef(null),i=Nt();return b.useLayoutEffect(()=>(r.current&&i(tY({zIndex:t,element:r.current,isPanorama:n})),()=>{i(nY({zIndex:t,isPanorama:n}))}),[i,t,n]),b.createElement("g",{tabIndex:-1,ref:r})}function i2(e){var{children:t,isPanorama:n}=e,r=Ae(qG);if(!r||r.length===0)return t;var i=r.filter(l=>l<0),a=r.filter(l=>l>0);return b.createElement(b.Fragment,null,i.map(l=>b.createElement(r2,{key:l,zIndex:l,isPanorama:n})),t,a.map(l=>b.createElement(r2,{key:l,zIndex:l,isPanorama:n})))}var Hee=["children"];function Gee(e,t){if(e==null)return{};var n,r,i=Yee(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 Yee(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 kf(){return kf=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},kf.apply(null,arguments)}var Xee={width:"100%",height:"100%",display:"block"},Qee=b.forwardRef((e,t)=>{var n=YV(),r=XV(),i=$E();if(!ys(n)||!ys(r))return null;var{children:a,otherAttributes:l,title:u,desc:d}=e,p,h;return l!=null&&(typeof l.tabIndex=="number"?p=l.tabIndex:p=i?0:void 0,typeof l.role=="string"?h=l.role:h=i?"application":void 0),b.createElement(pA,kf({},l,{title:u,desc:d,role:h,tabIndex:p,width:n,height:r,style:Xee,ref:t}),a)}),Jee=e=>{var{children:t}=e,n=Ae(Qf);if(!n)return null;var{width:r,height:i,y:a,x:l}=n;return b.createElement(pA,{width:r,height:i,x:l,y:a},t)},s2=b.forwardRef((e,t)=>{var{children:n}=e,r=Gee(e,Hee),i=qn();return i?b.createElement(Jee,null,b.createElement(i2,{isPanorama:!0},n)):b.createElement(Qee,kf({ref:t},r),b.createElement(i2,{isPanorama:!1},n))});function Zee(){var e=Nt(),[t,n]=b.useState(null),r=Ae(gV);return b.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;qe(a)&&a!==r&&e(J8(a))}},[t,e,r]),n}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 ete(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){tte(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 tte(e,t,n){return(t=nte(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nte(e){var t=rte(e,"string");return typeof t=="symbol"?t:t+""}function rte(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 ps(){return ps=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},ps.apply(null,arguments)}var ite=()=>(EY(),null);function Pf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var ste=b.forwardRef((e,t)=>{var n,r,i=b.useRef(null),[a,l]=b.useState({containerWidth:Pf((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Pf((r=e.style)===null||r===void 0?void 0:r.height)}),u=b.useCallback((p,h)=>{l(m=>{var v=Math.round(p),x=Math.round(h);return m.containerWidth===v&&m.containerHeight===x?m:{containerWidth:v,containerHeight:x}})},[]),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 v=w=>{var S=w[0];if(S!=null){var{width:j,height:k}=S.contentRect;u(j,k)}},x=new ResizeObserver(v);x.observe(p),i.current=x}},[t,u]);return b.useEffect(()=>()=>{var p=i.current;p!=null&&p.disconnect()},[u]),b.createElement(b.Fragment,null,b.createElement(jc,{width:a.containerWidth,height:a.containerHeight}),b.createElement("div",ps({ref:d},e)))}),ate=b.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=b.useState({containerWidth:Pf(n),containerHeight:Pf(r)}),l=b.useCallback((d,p)=>{a(h=>{var m=Math.round(d),v=Math.round(p);return h.containerWidth===m&&h.containerHeight===v?h:{containerWidth:m,containerHeight:v}})},[]),u=b.useCallback(d=>{if(typeof t=="function"&&t(d),d!=null){var{width:p,height:h}=d.getBoundingClientRect();l(p,h)}},[t,l]);return b.createElement(b.Fragment,null,b.createElement(jc,{width:i.containerWidth,height:i.containerHeight}),b.createElement("div",ps({ref:u},e)))}),ote=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return b.createElement(b.Fragment,null,b.createElement(jc,{width:n,height:r}),b.createElement("div",ps({ref:t},e)))}),lte=b.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?b.createElement(ate,ps({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?b.createElement(ote,ps({},e,{width:n,height:r,ref:t})):b.createElement(b.Fragment,null,b.createElement(jc,{width:n,height:r}),b.createElement("div",ps({ref:t},e)))});function cte(e){return e?ste:lte}var ute=b.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:l,onDoubleClick:u,onMouseDown:d,onMouseEnter:p,onMouseLeave:h,onMouseMove:m,onMouseUp:v,onTouchEnd:x,onTouchMove:w,onTouchStart:S,style:j,width:k,responsive:C,dispatchTouchEvents:E=!0}=e,O=b.useRef(null),P=Nt(),[A,M]=b.useState(null),[D,$]=b.useState(null),q=Zee(),X=Dx(),L=(X==null?void 0:X.width)>0?X.width:k,Z=(X==null?void 0:X.height)>0?X.height:i,J=b.useCallback(H=>{q(H),typeof t=="function"&&t(H),M(H),$(H),H!=null&&(O.current=H)},[q,t,M,$]),ne=b.useCallback(H=>{P(WM(H)),P(sr({handler:a,reactEvent:H}))},[P,a]),re=b.useCallback(H=>{P(Pv(H)),P(sr({handler:p,reactEvent:H}))},[P,p]),B=b.useCallback(H=>{P(z5()),P(sr({handler:h,reactEvent:H}))},[P,h]),F=b.useCallback(H=>{P(Pv(H)),P(sr({handler:m,reactEvent:H}))},[P,m]),G=b.useCallback(()=>{P(XM())},[P]),W=b.useCallback(H=>{P(YM(H.key))},[P]),_=b.useCallback(H=>{P(sr({handler:l,reactEvent:H}))},[P,l]),V=b.useCallback(H=>{P(sr({handler:u,reactEvent:H}))},[P,u]),ie=b.useCallback(H=>{P(sr({handler:d,reactEvent:H}))},[P,d]),fe=b.useCallback(H=>{P(sr({handler:v,reactEvent:H}))},[P,v]),te=b.useCallback(H=>{P(sr({handler:S,reactEvent:H}))},[P,S]),le=b.useCallback(H=>{E&&P(JM(H)),P(sr({handler:w,reactEvent:H}))},[P,E,w]),pe=b.useCallback(H=>{P(sr({handler:x,reactEvent:H}))},[P,x]),Se=cte(C);return b.createElement(aM.Provider,{value:A},b.createElement(nB.Provider,{value:D},b.createElement(Se,{width:L??(j==null?void 0:j.width),height:Z??(j==null?void 0:j.height),className:it("recharts-wrapper",r),style:ete({position:"relative",cursor:"default",width:L,height:Z},j),onClick:ne,onContextMenu:_,onDoubleClick:V,onFocus:G,onKeyDown:W,onMouseDown:ie,onMouseEnter:re,onMouseLeave:B,onMouseMove:F,onMouseUp:fe,onTouchEnd:pe,onTouchMove:le,onTouchStart:te,ref:J},b.createElement(ite,null),n)))}),dte=["width","height","responsive","children","className","style","compact","title","desc"];function fte(e,t){if(e==null)return{};var n,r,i=pte(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 pte(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 hte=b.forwardRef((e,t)=>{var{width:n,height:r,responsive:i,children:a,className:l,style:u,compact:d,title:p,desc:h}=e,m=fte(e,dte),v=xs(m);return d?b.createElement(b.Fragment,null,b.createElement(jc,{width:n,height:r}),b.createElement(s2,{otherAttributes:v,title:p,desc:h},a)):b.createElement(ute,{className:l,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(s2,{otherAttributes:v,title:p,desc:h,ref:t},b.createElement(pJ,null,a)))});function Cv(){return Cv=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},Cv.apply(null,arguments)}var mte={top:5,right:5,bottom:5,left:5},gte={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,layout:"horizontal",margin:mte,responsive:!1,reverseStackOrder:!1,stackOffset:"none",syncMethod:"index"},vte=b.forwardRef(function(t,n){var r,i=pr(t.categoricalChartProps,gte),{chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,categoricalChartProps:p}=t,h={chartName:a,defaultTooltipEventType:l,validateTooltipEventTypes:u,tooltipPayloadSearcher:d,eventEmitter:void 0};return b.createElement(Uee,{preloadedState:{options:h},reduxStoreName:(r=p.id)!==null&&r!==void 0?r:a},b.createElement(aJ,{chartData:p.data}),b.createElement(qee,{layout:i.layout,margin:i.margin}),b.createElement(Kee,{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(hte,Cv({},i,{ref:n})))}),xte=["axis","item"],yte=b.forwardRef((e,t)=>b.createElement(vte,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:xte,tooltipPayloadSearcher:hY,categoricalChartProps:e,ref:t}));const bte=[{label:"Today",value:"today"},{label:"7 days",value:7},{label:"30 days",value:30},{label:"90 days",value:90}];function o2(e){return e===0?"$0.00":e<.01?"< $0.01":`$${e.toFixed(2)}`}function l2(e){return e===0?"$0.0000":`$${e.toFixed(4)}`}function dd(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function c2(e){return new Date(e+"T00:00:00").toLocaleDateString(void 0,{month:"short",day:"numeric"})}function Ov(e){return e.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function wte(e,t){if(e===t)return"Documentation";const n=`${t}-`;return e.startsWith(n)?Ov(e.slice(n.length)):Ov(e)}function jte({onClose:e}){const[t,n]=b.useState("today"),[r,i]=b.useState(""),[a,l]=b.useState(""),[u,d]=b.useState(null),[p,h]=b.useState(!0),[m,v]=b.useState({}),[x,w]=b.useState(!1);b.useEffect(()=>{En().then(A=>{var D,$;const M=(D=A==null?void 0:A.apiKeys)==null?void 0:D.openai;w((M==null?void 0:M.authMode)==="oauth"&&(($=M==null?void 0:M.oauth)==null?void 0:$.connected)===!0)}).catch(()=>{})},[]),b.useEffect(()=>{h(!0),d(null);let A;if(t==="today"){const M=new Date().toISOString().split("T")[0];A={from:M,to:M}}else if(t==="custom"){if(!r||!a){h(!1);return}A={from:r,to:a}}else A=parseInt(t,10);mD(A).then(M=>{d(M),h(!1);const D={};(M.ceremonies||[]).forEach($=>{$.stages&&$.stages.length>0&&(D[$.name]=!0)}),v(D)}).catch(()=>{d({daily:[],ceremonies:[]}),h(!1)})},[t,r,a]),b.useEffect(()=>{const A=M=>{M.key==="Escape"&&e()};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[e]);const S=A=>v(M=>({...M,[A]:!M[A]})),j=(u==null?void 0:u.ceremonies.reduce((A,M)=>A+M.cost,0))??0,k=(u==null?void 0:u.ceremonies.reduce((A,M)=>A+M.tokens,0))??0,C=(u==null?void 0:u.ceremonies.reduce((A,M)=>A+M.calls,0))??0,E=(u==null?void 0:u.ceremonies.reduce((A,M)=>A+(M.saved??0),0))??0,O=(u==null?void 0:u.ceremonies.reduce((A,M)=>A+(M.cached??0),0))??0,P=u&&(u.daily.length>0||u.ceremonies.length>0);return c.jsxs("div",{className:"fixed inset-0 z-[65] flex items-center justify-center p-4",children:[c.jsx("div",{className:"absolute inset-0 bg-black/40",onClick:e,"aria-hidden":"true"}),c.jsxs("div",{className:"relative bg-white rounded-xl shadow-2xl w-full max-w-2xl flex flex-col",style:{height:"90vh",maxHeight:"900px"},onClick:A=>A.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-200 flex-shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(m2,{className:"w-5 h-5 text-slate-500"}),c.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"LLM Cost Tracker"})]}),c.jsx("button",{onClick:e,className:"text-slate-400 hover:text-slate-600 transition-colors","aria-label":"Close",children:c.jsx(vn,{className:"w-5 h-5"})})]}),c.jsxs("div",{className:"overflow-y-auto flex-1 px-6 py-4 flex flex-col gap-5",children:[c.jsxs("div",{className:"flex flex-col gap-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[bte.map(A=>c.jsx("button",{onClick:()=>n(String(A.value)),className:`px-3 py-1 rounded text-sm font-medium transition-colors ${t===String(A.value)?"bg-blue-600 text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:A.label},A.value)),c.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"})]}),c.jsxs("div",{className:`flex items-center gap-2 ${t!=="custom"?"invisible":""}`,children:[c.jsx("input",{type:"date",value:r,onChange:A=>i(A.target.value),className:"text-sm border border-slate-300 rounded px-2 py-0.5 text-slate-700"}),c.jsx("span",{className:"text-slate-400 text-sm",children:"to"}),c.jsx("input",{type:"date",value:a,onChange:A=>l(A.target.value),className:"text-sm border border-slate-300 rounded px-2 py-0.5 text-slate-700"})]})]}),x&&c.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:[c.jsx("span",{className:"flex-shrink-0 mt-0.5",children:"ℹ️"}),c.jsxs("span",{children:[c.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&&c.jsx("div",{className:"flex-1 flex items-center justify-center",children:c.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})}),!p&&!P&&c.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-slate-400 gap-3",children:[c.jsx(p2,{className:"w-10 h-10"}),c.jsx("p",{className:"text-sm",children:"No usage data for this period."}),c.jsx("p",{className:"text-xs text-slate-300",children:"Run a ceremony to start tracking costs."})]}),!p&&P&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:`grid gap-3 ${E>0?"grid-cols-2":"grid-cols-3"}`,children:[c.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Total Cost"}),c.jsx("p",{className:"text-xl font-bold text-slate-900",children:o2(j)}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"this period"})]}),c.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"Total Tokens"}),c.jsx("p",{className:"text-xl font-bold text-slate-900",children:dd(k)}),O>0&&c.jsxs("p",{className:"text-xs text-blue-500 mt-0.5",children:[dd(O)," cached"]})]}),c.jsxs("div",{className:"bg-slate-50 rounded-lg p-3",children:[c.jsx("p",{className:"text-xs text-slate-500 mb-1",children:"API Calls"}),c.jsx("p",{className:"text-xl font-bold text-slate-900",children:C.toLocaleString()}),c.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:"this period"})]}),E>0&&c.jsxs("div",{className:"bg-green-50 rounded-lg p-3",children:[c.jsx("p",{className:"text-xs text-green-600 mb-1",children:"Cache Saved"}),c.jsx("p",{className:"text-xl font-bold text-green-700",children:o2(E)}),c.jsx("p",{className:"text-xs text-green-500 mt-0.5",children:"vs. no cache"})]})]}),u.daily.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2 uppercase tracking-wide",children:"Daily Cost"}),c.jsx(KV,{width:"100%",height:180,children:c.jsxs(yte,{data:u.daily,margin:{top:0,right:0,bottom:0,left:0},children:[c.jsx(VM,{dataKey:"date",tickFormatter:c2,tick:{fontSize:11,fill:"#94a3b8"},axisLine:!1,tickLine:!1}),c.jsx(UM,{tickFormatter:A=>`$${A.toFixed(2)}`,tick:{fontSize:11,fill:"#94a3b8"},width:56,axisLine:!1,tickLine:!1}),c.jsx($Y,{formatter:A=>[`$${A.toFixed(4)}`,"Cost"],labelFormatter:A=>c2(A),contentStyle:{fontSize:12}}),c.jsx(FM,{dataKey:"cost",fill:"#3b82f6",radius:[3,3,0,0]})]})})]}),u.ceremonies.length>0&&c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-slate-500 mb-2 uppercase tracking-wide",children:"By Ceremony"}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"text-left text-xs text-slate-400 border-b border-slate-100",children:[c.jsx("th",{className:"pb-2 font-medium",children:"Ceremony / Stage"}),c.jsx("th",{className:"pb-2 font-medium text-right",children:"Calls"}),c.jsx("th",{className:"pb-2 font-medium text-right",children:"Tokens"}),c.jsx("th",{className:"pb-2 font-medium text-right",children:"Cost"}),c.jsx("th",{className:"pb-2 font-medium pl-4",children:"Share"})]})}),c.jsx("tbody",{children:u.ceremonies.map(A=>{const M=j>0?A.cost/j*100:0,D=A.stages&&A.stages.length>0,$=m[A.name];return[c.jsxs("tr",{className:`border-b border-slate-100 ${D?"cursor-pointer hover:bg-slate-50":""}`,onClick:D?()=>S(A.name):void 0,children:[c.jsx("td",{className:"py-2 text-slate-800 font-semibold",children:c.jsxs("div",{className:"flex items-center gap-1.5",children:[D?$?c.jsx(yi,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):c.jsx(lr,{className:"w-3.5 h-3.5 text-slate-400 flex-shrink-0"}):c.jsx("span",{className:"w-3.5 flex-shrink-0"}),Ov(A.name)]})}),c.jsx("td",{className:"py-2 text-right text-slate-500",children:A.calls}),c.jsx("td",{className:"py-2 text-right text-slate-500",children:dd(A.tokens)}),c.jsx("td",{className:"py-2 text-right text-slate-800 font-semibold",children:l2(A.cost)}),c.jsx("td",{className:"py-2 pl-4",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-20 bg-slate-100 rounded-full h-1.5 flex-shrink-0",children:c.jsx("div",{className:"bg-blue-500 h-1.5 rounded-full",style:{width:`${M}%`}})}),c.jsxs("span",{className:"text-xs text-slate-400",children:[Math.round(M),"%"]})]})})]},A.name),...$&&D?A.stages.map(q=>{const X=A.cost>0?q.cost/A.cost*100:0;return c.jsxs("tr",{className:"border-b border-slate-50 bg-slate-50/50",children:[c.jsx("td",{className:"py-1.5 text-slate-500 pl-7",children:wte(q.name,A.name)}),c.jsx("td",{className:"py-1.5 text-right text-slate-400 text-xs",children:q.calls}),c.jsx("td",{className:"py-1.5 text-right text-slate-400 text-xs",children:dd(q.tokens)}),c.jsx("td",{className:"py-1.5 text-right text-slate-500 text-xs",children:l2(q.cost)}),c.jsx("td",{className:"py-1.5 pl-4",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"w-20 bg-slate-100 rounded-full h-1 flex-shrink-0",children:c.jsx("div",{className:"bg-blue-300 h-1 rounded-full",style:{width:`${X}%`}})}),c.jsxs("span",{className:"text-[10px] text-slate-300",children:[Math.round(X),"%"]})]})})]},`${A.name}/${q.name}`)}):[]]})})]})})]})]})]})]})]})}function Ste(){const[e,t]=b.useState(null),[n,r]=b.useState(null),[i,a]=b.useState(!1),[l,u]=b.useState("AVC Kanban Board"),[d,p]=b.useState("http://localhost:4173"),[h,m]=b.useState(!1),[v,x]=b.useState(""),w=b.useRef(null),[S,j]=b.useState(!1),[k,C]=b.useState(null),[E,O]=b.useState([]),[P,A]=b.useState(null),[M,D]=b.useState(!1),[$,q]=b.useState(null),[X,L]=b.useState(null),[Z,J]=b.useState(null),[ne,re]=b.useState(null),[B,F]=b.useState(null),[G,W]=b.useState({docExists:!1}),[_,V]=b.useState(!1),[ie,fe]=b.useState(null),{workItems:te,loadWorkItems:le,loading:pe,error:Se,setCeremonyActive:H}=Cf(),{typeFilters:me,searchQuery:Oe}=Of(),{isOpen:se,openWizard:Le,resetWizard:De,ceremonyStatus:Qe,setCeremonyStatus:Ze,setCeremonyResult:_t,setCeremonyError:Mn,appendProgress:yn,appendMissionProgress:bn,setProgressLog:wn,setWizardStep:he,setPaused:ke,setProcessId:_e}=cr(),{isOpen:Je,openModal:Ct,closeModal:It,reopenModal:Dt,setStep:dn,setStatus:He,appendProgress:Rt,setProgressLog:_n,setResult:ha,setError:ma,status:ks,setPaused:ti,setProcessId:Mr,setDecomposedHierarchy:mr}=jo(),{handleProcessMessage:Ri}=S2(),{appendProgress:Li,setStatus:Kn,setError:gr,setProcessId:ga,getStoryIdByProcessId:va}=ql(),_r=b.useMemo(()=>{let ee=te.filter(Be=>me[Be.type]);if(Oe.trim()){const Be=Oe.toLowerCase();ee=ee.filter(bt=>bt.name.toLowerCase().includes(Be)||bt.id.toLowerCase().includes(Be)||bt.description&&bt.description.toLowerCase().includes(Be)||bt.epicName&&bt.epicName.toLowerCase().includes(Be))}return ee},[te,me,Oe]),{wsStatus:ni}=wD({onMessage:ee=>{var Be,bt,nn,Cs;if(ee.type==="refresh"||ee.type==="work-item-update")le();else if(ee.type==="ceremony:progress")yn({type:"progress",message:ee.message});else if(ee.type==="ceremony:substep")yn({type:"substep",substep:ee.substep,meta:ee.meta});else if(ee.type==="ceremony:detail")yn({type:"detail",detail:ee.detail});else if(ee.type==="ceremony:complete")q(null),L(null),Ze("complete"),_t(ee.result),he(7),le(),M1().then(W).catch(()=>{});else if(ee.type==="ceremony:error")Ze("error"),Mn(ee.error);else if(ee.type==="mission:progress")bn({step:ee.step,message:ee.message});else if(ee.type==="ceremony:cost-limit")q({cost:ee.cost,threshold:ee.threshold,runningType:ee.runningType});else if(ee.type==="ceremony:quota-limit")L({provider:ee.provider,model:ee.model,errMsg:ee.errMsg,validatorName:ee.validatorName,runningType:ee.runningType});else if(ee.type==="cost:update")lm().then(A).catch(()=>{});else if(ee.type==="sprint-planning:progress")Rt({type:"progress",message:ee.message});else if(ee.type==="sprint-planning:substep")Rt({type:"substep",substep:ee.substep,meta:ee.meta});else if(ee.type==="sprint-planning:detail")Rt({type:"detail",detail:ee.detail});else if(ee.type==="sprint-planning:decomposition-complete")mr(ee.hierarchy),He("awaiting-selection"),dn(3);else if(ee.type==="sprint-planning:complete")q(null),L(null),He("complete"),ha(ee.result),mr(null),dn(4),H(!1),le();else if(ee.type==="sprint-planning:error")He("error"),ma(ee.error),H(!1);else if(ee.type==="sprint-planning:paused")ti(!0);else if(ee.type==="sprint-planning:resumed")ti(!1);else if(ee.type==="sprint-planning:cancelled")q(null),L(null),He("idle"),dn(1),ti(!1),mr(null),H(!1);else if(ee.type==="ceremony:paused")ke(!0);else if(ee.type==="ceremony:resumed")ke(!1);else if(ee.type==="ceremony:cancelled")q(null),L(null),Ze("idle"),he(1),ke(!1);else if(ee.type==="seed:progress"&&ee.itemId)Li(ee.itemId,ee.message);else if(ee.type==="seed:complete"&&ee.itemId)Kn(ee.itemId,"complete"),Li(ee.itemId,"Seed complete — tasks created."),le();else if(ee.type==="seed:error"&&ee.itemId)gr(ee.itemId,typeof ee.error=="string"?ee.error:((Be=ee.error)==null?void 0:Be.message)||"Seed failed"),le();else if((bt=ee.type)!=null&&bt.startsWith("run-task:"))window.dispatchEvent(new CustomEvent("avc-ws-message",{detail:ee})),(ee.type.endsWith(":complete")||ee.type.endsWith(":error"))&&le();else if(ee.type==="refresh")le();else if(ee.type==="refine:progress")J({itemId:ee.itemId,jobId:ee.jobId,message:ee.message});else if(ee.type==="refine:complete")J(null),re({itemId:ee.itemId,jobId:ee.jobId,result:ee.result});else if(ee.type==="refine:error")J(null),F({itemId:ee.itemId,jobId:ee.jobId,error:ee.error});else if(ee.type==="process:started")Ri(ee),ee.processType==="sprint-planning"?(Mr(ee.processId),H(!0)):ee.processType==="sponsor-call"&&_e(ee.processId);else if(ee.type==="process:list"||ee.type==="process:status")Ri(ee);else if(ee.type==="ceremony:sync"){const ze=ee.ceremonyStatus;((ze==null?void 0:ze.status)==="running"||(ze==null?void 0:ze.status)==="cost-limit-pending"||(ze==null?void 0:ze.status)==="quota-limit-pending"||(ze==null?void 0:ze.status)==="awaiting-selection")&&(ze.runningType==="sprint-planning"?(H(!0),ze.status==="awaiting-selection"?(He("awaiting-selection"),mr(ze.decomposedHierarchy||null),dn(3)):He("running"),ze.processId&&Mr(ze.processId),(nn=ze.progress)!=null&&nn.length&&_n(ze.progress)):ze.runningType==="sponsor-call"&&(Ze("running"),ze.processId&&_e(ze.processId),(Cs=ze.progress)!=null&&Cs.length&&wn(ze.progress)),ze.status==="cost-limit-pending"&&ze.costLimitInfo&&q({...ze.costLimitInfo,runningType:ze.runningType}),ze.status==="quota-limit-pending"&&ze.quotaLimitInfo&&L({...ze.quotaLimitInfo,runningType:ze.runningType}))}}});b.useEffect(()=>{(async()=>{var Be,bt;try{const[nn,Cs,ze,wp,Fe]=await Promise.all([k3(),T1(),T3(),M1(),$3().catch(()=>null)]);t(nn),u(Cs),p(ze),W(wp),((Fe==null?void 0:Fe.status)==="running"||(Fe==null?void 0:Fe.status)==="cost-limit-pending"||(Fe==null?void 0:Fe.status)==="quota-limit-pending"||(Fe==null?void 0:Fe.status)==="awaiting-selection")&&(Fe.runningType==="sprint-planning"?(Fe.status==="awaiting-selection"?(He("awaiting-selection"),mr(Fe.decomposedHierarchy||null),dn(3)):He("running"),Fe.processId&&Mr(Fe.processId),(Be=Fe.progress)!=null&&Be.length&&_n(Fe.progress)):Fe.runningType==="sponsor-call"&&(Ze("running"),Fe.processId&&_e(Fe.processId),(bt=Fe.progress)!=null&&bt.length&&wn(Fe.progress)),Fe.status==="cost-limit-pending"&&Fe.costLimitInfo&&q({...Fe.costLimitInfo,runningType:Fe.runningType}),Fe.status==="quota-limit-pending"&&Fe.quotaLimitInfo&&L({...Fe.quotaLimitInfo,runningType:Fe.runningType})),V(!0),await le()}catch(nn){console.error("Initialization error:",nn)}})()},[le]),b.useEffect(()=>{var ee,Be;h&&((ee=w.current)==null||ee.focus(),(Be=w.current)==null||Be.select())},[h]),b.useEffect(()=>{lm().then(A).catch(()=>{});const ee=setInterval(()=>lm().then(A).catch(()=>{}),6e4);return()=>clearInterval(ee)},[]);const Ps=()=>{x(l),m(!0)},Ir=()=>{m(!1),x("")},$i=async()=>{const ee=v.trim();if(!ee||ee===l){Ir();return}try{await M3(ee),u(ee)}catch(Be){console.error("Failed to save title:",Be)}m(!1),x("")},Dr=ee=>{ee.key==="Enter"&&$i(),ee.key==="Escape"&&Ir()},[de,Me]=b.useState("api-keys"),Hn=async(ee="api-keys")=>{try{const[Be,bt]=await Promise.all([En(),ms()]);C(Be),O(bt),Me(ee),j(!0)}catch(Be){console.error("Failed to load settings:",Be)}},Gn=async()=>{try{const ee=await En();C(ee);const Be=await T1();u(Be),document.dispatchEvent(new CustomEvent("avc:settings-saved"))}catch(ee){console.error("Failed to refresh settings:",ee)}},Yn=ee=>{r(ee),a(!0)},zi=ee=>{if(!n||_r.length===0)return;const Be=_r.findIndex(nn=>nn.id===n.id);if(Be===-1)return;let bt;ee==="prev"?bt=Be>0?Be-1:_r.length-1:bt=Be<_r.length-1?Be+1:0,r(_r[bt])},Lo=()=>{a(!1),setTimeout(()=>r(null),200)};return pe&&!e?c.jsx("div",{className:"flex items-center justify-center min-h-screen bg-slate-50",children:c.jsxs("div",{className:"text-center",children:[c.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mx-auto mb-4"}),c.jsxs("p",{className:"text-slate-600",children:["Loading ",l,"..."]})]})}):Se&&!e?c.jsx("div",{className:"flex items-center justify-center min-h-screen bg-slate-50",children:c.jsxs("div",{className:"text-center max-w-md p-6 bg-white rounded-lg shadow-md",children:[c.jsx("div",{className:"text-red-600 text-5xl mb-4",children:"⚠️"}),c.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-2",children:"Connection Error"}),c.jsx("p",{className:"text-slate-600 mb-4",children:Se}),c.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"})]})}):c.jsxs("div",{className:"min-h-screen bg-slate-50 flex flex-col",children:[c.jsx("header",{className:"bg-white border-b border-slate-200 shadow-sm flex-shrink-0",children:c.jsx("div",{className:"max-w-full px-4 sm:px-6 lg:px-8 py-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[h?c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{ref:w,value:v,onChange:ee=>x(ee.target.value),onKeyDown:Dr,className:"text-2xl font-bold text-slate-900 bg-transparent border-b-2 border-blue-500 outline-none min-w-0 w-72"}),c.jsx("button",{onClick:$i,className:"text-green-600 hover:text-green-700 transition-colors",title:"Save",children:c.jsx(Ul,{className:"w-5 h-5"})}),c.jsx("button",{onClick:Ir,className:"text-slate-400 hover:text-slate-600 transition-colors",title:"Cancel",children:c.jsx(vn,{className:"w-5 h-5"})})]}):c.jsxs("button",{onClick:Ps,className:"group flex items-center gap-2 text-left",title:"Click to edit board title",children:[c.jsx("h1",{className:"text-2xl font-bold text-slate-900 group-hover:text-slate-700 transition-colors",children:l}),c.jsx(fc,{className:"w-4 h-4 text-slate-300 group-hover:text-slate-500 transition-colors flex-shrink-0"})]}),c.jsx("p",{className:"text-sm text-slate-600 mt-1",children:(e==null?void 0:e.projectRoot)||"Loading..."})]}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:`w-2 h-2 rounded-full ${ni==="connected"?"bg-green-500 animate-pulse":ni==="connecting"?"bg-amber-400 animate-pulse":"bg-slate-400"}`}),c.jsx("span",{className:"text-sm text-slate-500",children:ni==="connected"?"Live updates":ni==="connecting"?"Connecting...":"No live updates"})]}),P!=null&&c.jsxs("button",{onClick:()=>D(!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:[c.jsx(m2,{className:"w-3 h-3"}),P.totalCost<.01&&P.totalCost>0?"< 0.01":P.totalCost.toFixed(2),c.jsx("span",{className:"text-slate-400",children:"/mo"})]}),c.jsxs("button",{onClick:()=>Hn(),className:"flex items-center gap-1.5 text-sm text-slate-500 hover:text-slate-800 transition-colors",title:"Project settings",children:[c.jsx(io,{className:"w-4 h-4"}),"Settings"]}),c.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:[c.jsx(f2,{className:"w-4 h-4"}),"Project Documentation"]})]})]})})}),c.jsx(K6,{}),c.jsx(G6,{}),c.jsx("main",{className:"flex-1 overflow-hidden",children:c.jsx("div",{className:"h-full px-4 sm:px-6 lg:px-8 py-6",children:c.jsx(V6,{onCardClick:Yn,projectFilesReady:G.docExists,onStartProject:_&&!G.docExists&&Qe!=="running"?()=>{De(),Le()}:void 0,onEditProjectDoc:()=>fe("doc"),onStartSprintPlanning:_&&G.docExists&&ks!=="running"&&ks!=="awaiting-selection"&&Qe!=="running"?Ct:void 0,onOpenSprintPlanningSelection:ks==="awaiting-selection"?Dt:void 0,sponsorCallRunning:Qe==="running"})})}),c.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"}),c.jsx(uz,{workItem:n,open:i,onOpenChange:Lo,onNavigate:zi,onItemClick:Yn,allItems:te,refineProgress:Z,refineResult:ne,refineError:B,onClearRefine:()=>{re(null),F(null),J(null)}}),se&&c.jsx(dF,{onOpenSettings:Hn,costLimitPending:($==null?void 0:$.runningType)==="sponsor-call"?$:null,onContinuePastCostLimit:async()=>{try{await D1(),q(null)}catch{}},onCancelFromCostLimit:async()=>{try{await eo(),q(null)}catch{}}}),Je&&c.jsx(wF,{onClose:It,costLimitPending:($==null?void 0:$.runningType)==="sprint-planning"?$:null,onContinuePastCostLimit:async()=>{try{await D1(),q(null)}catch{}},onCancelFromCostLimit:async()=>{try{await eo(),q(null)}catch{}},quotaLimitPending:(X==null?void 0:X.runningType)==="sprint-planning"?X:null,onContinueAfterQuota:async(ee,Be)=>{try{await q3(ee,Be),L(null)}catch{}},onCancelFromQuota:async()=>{try{await eo(),L(null)}catch{}}}),c.jsx(jF,{}),c.jsx(NF,{}),S&&k&&c.jsx(KF,{settings:k,models:E,onClose:()=>j(!1),onSaved:Gn,initialTab:de}),M&&c.jsx(jte,{onClose:()=>D(!1)}),ie&&c.jsx(W6,{fileType:ie,onClose:()=>fe(null)})]})}t3.createRoot(document.getElementById("root")).render(c.jsx(qa.StrictMode,{children:c.jsx(Ste,{})}));
|