projax 3.3.41 → 3.3.52
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/coverage/core-bridge.ts.html +24 -3
- package/coverage/index.html +34 -19
- package/coverage/lcov-report/core-bridge.ts.html +24 -3
- package/coverage/lcov-report/index.html +34 -19
- package/coverage/lcov-report/port-extractor.ts.html +1 -1
- package/coverage/lcov-report/port-scanner.ts.html +3 -3
- package/coverage/lcov-report/port-utils.ts.html +1 -1
- package/coverage/lcov-report/script-runner.ts.html +302 -11
- package/coverage/lcov-report/test-parser.ts.html +799 -0
- package/coverage/lcov.info +270 -49
- package/coverage/port-extractor.ts.html +1 -1
- package/coverage/port-scanner.ts.html +3 -3
- package/coverage/port-utils.ts.html +1 -1
- package/coverage/script-runner.ts.html +302 -11
- package/coverage/test-parser.ts.html +799 -0
- package/dist/api/__tests__/routes.test.js +1 -0
- package/dist/api/__tests__/routes.test.js.map +1 -1
- package/dist/api/__tests__/scanner.test.js +1 -0
- package/dist/api/__tests__/scanner.test.js.map +1 -1
- package/dist/api/package.json +4 -0
- package/dist/api/routes/backup.d.ts +2 -1
- package/dist/api/routes/backup.d.ts.map +1 -1
- package/dist/api/routes/backup.js.map +1 -1
- package/dist/api/routes/index.d.ts +2 -1
- package/dist/api/routes/index.d.ts.map +1 -1
- package/dist/api/routes/index.js.map +1 -1
- package/dist/api/routes/projects.d.ts +2 -1
- package/dist/api/routes/projects.d.ts.map +1 -1
- package/dist/api/routes/projects.js.map +1 -1
- package/dist/api/routes/settings.d.ts +2 -1
- package/dist/api/routes/settings.d.ts.map +1 -1
- package/dist/api/routes/settings.js +21 -1
- package/dist/api/routes/settings.js.map +1 -1
- package/dist/api/routes/workspaces.d.ts +2 -1
- package/dist/api/routes/workspaces.d.ts.map +1 -1
- package/dist/api/routes/workspaces.js.map +1 -1
- package/dist/core/__tests__/index.test.js +1 -0
- package/dist/core/__tests__/scanner.test.js +1 -0
- package/dist/core/__tests__/settings.test.js +1 -0
- package/dist/core-bridge.js +5 -1
- package/dist/electron/core/__tests__/index.test.js +1 -0
- package/dist/electron/core/__tests__/scanner.test.js +1 -0
- package/dist/electron/core/__tests__/settings.test.js +1 -0
- package/dist/electron/core.js +5 -1
- package/dist/electron/main.js +113 -99
- package/dist/electron/port-scanner.js +1 -1
- package/dist/electron/renderer/assets/index-BjZn_mEF.js +66 -0
- package/dist/electron/renderer/assets/index-CZmDxbJO.js +66 -0
- package/dist/electron/renderer/assets/{index-CWxXs5M7.css → index-DfocdjIj.css} +1 -1
- package/dist/electron/renderer/index.html +2 -2
- package/dist/index.js +19 -19
- package/dist/port-scanner.js +1 -1
- package/dist/prxi.d.ts +1 -0
- package/dist/prxi.js +1106 -0
- package/dist/prxi.tsx +6 -6
- package/jest.config.js +8 -0
- package/package.json +8 -4
- package/dist/api/routes/mcp.d.ts +0 -3
- package/dist/api/routes/mcp.d.ts.map +0 -1
- package/dist/api/routes/mcp.js +0 -147
- package/dist/api/routes/mcp.js.map +0 -1
- package/dist/electron/renderer/assets/index-59AhiV_K.css +0 -1
- package/dist/electron/renderer/assets/index-A04svynq.js +0 -62
- package/dist/electron/renderer/assets/index-B-etDnj2.js +0 -64
- package/dist/electron/renderer/assets/index-BGodNljq.js +0 -62
- package/dist/electron/renderer/assets/index-Bx18Cyic.js +0 -64
- package/dist/electron/renderer/assets/index-ByBOaxqv.js +0 -62
- package/dist/electron/renderer/assets/index-ByHY-x-j.js +0 -62
- package/dist/electron/renderer/assets/index-C1SRt6Jx.js +0 -62
- package/dist/electron/renderer/assets/index-C8f5yNYe.js +0 -64
- package/dist/electron/renderer/assets/index-C9Fo49a8.js +0 -61
- package/dist/electron/renderer/assets/index-CGx7K7jh.js +0 -62
- package/dist/electron/renderer/assets/index-CIZ3Wl6c.css +0 -1
- package/dist/electron/renderer/assets/index-CJbsU9y8.css +0 -1
- package/dist/electron/renderer/assets/index-CJrLunKK.js +0 -62
- package/dist/electron/renderer/assets/index-CQTleudf.css +0 -1
- package/dist/electron/renderer/assets/index-CQcilqlv.js +0 -62
- package/dist/electron/renderer/assets/index-CS-85xbL.css +0 -1
- package/dist/electron/renderer/assets/index-CYph0WPA.js +0 -62
- package/dist/electron/renderer/assets/index-C_WSLD6y.css +0 -1
- package/dist/electron/renderer/assets/index-CgB-tTpV.js +0 -62
- package/dist/electron/renderer/assets/index-ChoTzPLo.css +0 -1
- package/dist/electron/renderer/assets/index-CopVNRnR.js +0 -64
- package/dist/electron/renderer/assets/index-CtXtIMer.js +0 -64
- package/dist/electron/renderer/assets/index-D1jmaGv5.css +0 -1
- package/dist/electron/renderer/assets/index-D2AOB6Er.js +0 -62
- package/dist/electron/renderer/assets/index-DAfjuYKX.js +0 -61
- package/dist/electron/renderer/assets/index-DEOOHPEi.css +0 -1
- package/dist/electron/renderer/assets/index-DTtg6XrF.css +0 -1
- package/dist/electron/renderer/assets/index-DUvcepWm.js +0 -64
- package/dist/electron/renderer/assets/index-DVWDlM1D.js +0 -62
- package/dist/electron/renderer/assets/index-DWe2TQFv.css +0 -1
- package/dist/electron/renderer/assets/index-DZzB20Xf.css +0 -1
- package/dist/electron/renderer/assets/index-Dk0EQt0u.css +0 -1
- package/dist/electron/renderer/assets/index-DknLdADV.js +0 -63
- package/dist/electron/renderer/assets/index-DocuD8Lk.js +0 -64
- package/dist/electron/renderer/assets/index-DwRy5FqP.js +0 -62
- package/dist/electron/renderer/assets/index-DyU-xfd8.css +0 -1
- package/dist/electron/renderer/assets/index-GwC-JVUy.css +0 -1
- package/dist/electron/renderer/assets/index-JXrtTB1F.js +0 -63
- package/dist/electron/renderer/assets/index-Ocrdv8Lb.css +0 -1
- package/dist/electron/renderer/assets/index-R-HsWJ0K.js +0 -62
- package/dist/electron/renderer/assets/index-Ytah0wbZ.js +0 -62
- package/dist/electron/renderer/assets/index-ZVyXUshO.css +0 -1
- package/dist/electron/renderer/assets/index-Z_8dJn3i.js +0 -62
- package/dist/electron/renderer/assets/index-fehviker.js +0 -63
- package/dist/electron/renderer/assets/index-nts9ST-M.js +0 -62
- package/dist/electron/renderer/assets/index-q8NVIH3g.css +0 -1
- package/dist/electron/renderer/assets/index-thUWIXon.js +0 -62
- package/dist/electron/renderer/assets/index-tuQmrwcm.css +0 -1
- package/dist/prxi/src/index.tsx +0 -1370
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Uc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Np(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var Bc={exports:{}},Do={},Hc={exports:{}},X={};/**
|
|
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 gs=Symbol.for("react.element"),Pp=Symbol.for("react.portal"),Cp=Symbol.for("react.fragment"),Ep=Symbol.for("react.strict_mode"),Tp=Symbol.for("react.profiler"),Dp=Symbol.for("react.provider"),_p=Symbol.for("react.context"),zp=Symbol.for("react.forward_ref"),bp=Symbol.for("react.suspense"),Rp=Symbol.for("react.memo"),Ap=Symbol.for("react.lazy"),kl=Symbol.iterator;function Op(e){return e===null||typeof e!="object"?null:(e=kl&&e[kl]||e["@@iterator"],typeof e=="function"?e:null)}var Vc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xc=Object.assign,Qc={};function kr(e,t,n){this.props=e,this.context=t,this.refs=Qc,this.updater=n||Vc}kr.prototype.isReactComponent={};kr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};kr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yc(){}Yc.prototype=kr.prototype;function wa(e,t,n){this.props=e,this.context=t,this.refs=Qc,this.updater=n||Vc}var xa=wa.prototype=new Yc;xa.constructor=wa;Xc(xa,kr.prototype);xa.isPureReactComponent=!0;var Nl=Array.isArray,Kc=Object.prototype.hasOwnProperty,ja={current:null},Gc={key:!0,ref:!0,__self:!0,__source:!0};function Jc(e,t,n){var r,s={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Kc.call(t,r)&&!Gc.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:gs,type:e,key:o,ref:a,props:s,_owner:ja.current}}function Mp(e,t){return{$$typeof:gs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Sa(e){return typeof e=="object"&&e!==null&&e.$$typeof===gs}function Lp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Pl=/\/+/g;function Ko(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Lp(""+e.key):t.toString(36)}function Vs(e,t,n,r,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case gs:case Pp:a=!0}}if(a)return a=e,s=s(a),e=r===""?"."+Ko(a,0):r,Nl(s)?(n="",e!=null&&(n=e.replace(Pl,"$&/")+"/"),Vs(s,t,n,"",function(u){return u})):s!=null&&(Sa(s)&&(s=Mp(s,n+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(Pl,"$&/")+"/")+e)),t.push(s)),1;if(a=0,r=r===""?".":r+":",Nl(e))for(var l=0;l<e.length;l++){o=e[l];var c=r+Ko(o,l);a+=Vs(o,t,n,c,s)}else if(c=Op(e),typeof c=="function")for(e=c.call(e),l=0;!(o=e.next()).done;)o=o.value,c=r+Ko(o,l++),a+=Vs(o,t,n,c,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function ks(e,t,n){if(e==null)return e;var r=[],s=0;return Vs(e,r,"","",function(o){return t.call(n,o,s++)}),r}function Ip(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ue={current:null},Xs={transition:null},Fp={ReactCurrentDispatcher:Ue,ReactCurrentBatchConfig:Xs,ReactCurrentOwner:ja};X.Children={map:ks,forEach:function(e,t,n){ks(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ks(e,function(){t++}),t},toArray:function(e){return ks(e,function(t){return t})||[]},only:function(e){if(!Sa(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};X.Component=kr;X.Fragment=Cp;X.Profiler=Tp;X.PureComponent=wa;X.StrictMode=Ep;X.Suspense=bp;X.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fp;X.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Xc({},e.props),s=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=ja.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Kc.call(t,c)&&!Gc.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:gs,type:e.type,key:s,ref:o,props:r,_owner:a}};X.createContext=function(e){return e={$$typeof:_p,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Dp,_context:e},e.Consumer=e};X.createElement=Jc;X.createFactory=function(e){var t=Jc.bind(null,e);return t.type=e,t};X.createRef=function(){return{current:null}};X.forwardRef=function(e){return{$$typeof:zp,render:e}};X.isValidElement=Sa;X.lazy=function(e){return{$$typeof:Ap,_payload:{_status:-1,_result:e},_init:Ip}};X.memo=function(e,t){return{$$typeof:Rp,type:e,compare:t===void 0?null:t}};X.startTransition=function(e){var t=Xs.transition;Xs.transition={};try{e()}finally{Xs.transition=t}};X.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};X.useCallback=function(e,t){return Ue.current.useCallback(e,t)};X.useContext=function(e){return Ue.current.useContext(e)};X.useDebugValue=function(){};X.useDeferredValue=function(e){return Ue.current.useDeferredValue(e)};X.useEffect=function(e,t){return Ue.current.useEffect(e,t)};X.useId=function(){return Ue.current.useId()};X.useImperativeHandle=function(e,t,n){return Ue.current.useImperativeHandle(e,t,n)};X.useInsertionEffect=function(e,t){return Ue.current.useInsertionEffect(e,t)};X.useLayoutEffect=function(e,t){return Ue.current.useLayoutEffect(e,t)};X.useMemo=function(e,t){return Ue.current.useMemo(e,t)};X.useReducer=function(e,t,n){return Ue.current.useReducer(e,t,n)};X.useRef=function(e){return Ue.current.useRef(e)};X.useState=function(e){return Ue.current.useState(e)};X.useSyncExternalStore=function(e,t,n){return Ue.current.useSyncExternalStore(e,t,n)};X.useTransition=function(){return Ue.current.useTransition()};X.version="18.2.0";Hc.exports=X;var y=Hc.exports;const Zc=Uc(y);/**
|
|
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 Wp=y,$p=Symbol.for("react.element"),Up=Symbol.for("react.fragment"),Bp=Object.prototype.hasOwnProperty,Hp=Wp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Vp={key:!0,ref:!0,__self:!0,__source:!0};function qc(e,t,n){var r,s={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Bp.call(t,r)&&!Vp.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:$p,type:e,key:o,ref:a,props:s,_owner:Hp.current}}Do.Fragment=Up;Do.jsx=qc;Do.jsxs=qc;Bc.exports=Do;var i=Bc.exports,Pi={},eu={exports:{}},it={},tu={exports:{}},nu={};/**
|
|
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
|
-
*/(function(e){function t(z,F){var W=z.length;z.push(F);e:for(;0<W;){var G=W-1>>>1,ne=z[G];if(0<s(ne,F))z[G]=F,z[W]=ne,W=G;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var F=z[0],W=z.pop();if(W!==F){z[0]=W;e:for(var G=0,ne=z.length,ae=ne>>>1;G<ae;){var Ee=2*(G+1)-1,wt=z[Ee],_e=Ee+1,Je=z[_e];if(0>s(wt,W))_e<ne&&0>s(Je,wt)?(z[G]=Je,z[_e]=W,G=_e):(z[G]=wt,z[Ee]=W,G=Ee);else if(_e<ne&&0>s(Je,W))z[G]=Je,z[_e]=W,G=_e;else break e}}return F}function s(z,F){var W=z.sortIndex-F.sortIndex;return W!==0?W:z.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],h=1,g=null,f=3,v=!1,j=!1,k=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(z){for(var F=n(u);F!==null;){if(F.callback===null)r(u);else if(F.startTime<=z)r(u),F.sortIndex=F.expirationTime,t(c,F);else break;F=n(u)}}function w(z){if(k=!1,p(z),!j)if(n(c)!==null)j=!0,Q(N);else{var F=n(u);F!==null&&ue(w,F.startTime-z)}}function N(z,F){j=!1,k&&(k=!1,m(T),T=-1),v=!0;var W=f;try{for(p(F),g=n(c);g!==null&&(!(g.expirationTime>F)||z&&!Y());){var G=g.callback;if(typeof G=="function"){g.callback=null,f=g.priorityLevel;var ne=G(g.expirationTime<=F);F=e.unstable_now(),typeof ne=="function"?g.callback=ne:g===n(c)&&r(c),p(F)}else r(c);g=n(c)}if(g!==null)var ae=!0;else{var Ee=n(u);Ee!==null&&ue(w,Ee.startTime-F),ae=!1}return ae}finally{g=null,f=W,v=!1}}var E=!1,P=null,T=-1,H=5,M=-1;function Y(){return!(e.unstable_now()-M<H)}function V(){if(P!==null){var z=e.unstable_now();M=z;var F=!0;try{F=P(!0,z)}finally{F?Z():(E=!1,P=null)}}else E=!1}var Z;if(typeof d=="function")Z=function(){d(V)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Se=ce.port2;ce.port1.onmessage=V,Z=function(){Se.postMessage(null)}}else Z=function(){_(V,0)};function Q(z){P=z,E||(E=!0,Z())}function ue(z,F){T=_(function(){z(e.unstable_now())},F)}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(z){z.callback=null},e.unstable_continueExecution=function(){j||v||(j=!0,Q(N))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(z){switch(f){case 1:case 2:case 3:var F=3;break;default:F=f}var W=f;f=F;try{return z()}finally{f=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,F){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var W=f;f=z;try{return F()}finally{f=W}},e.unstable_scheduleCallback=function(z,F,W){var G=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?G+W:G):W=G,z){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=W+ne,z={id:h++,callback:F,priorityLevel:z,startTime:W,expirationTime:ne,sortIndex:-1},W>G?(z.sortIndex=W,t(u,z),n(c)===null&&z===n(u)&&(k?(m(T),T=-1):k=!0,ue(w,W-G))):(z.sortIndex=ne,t(c,z),j||v||(j=!0,Q(N))),z},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(z){var F=f;return function(){var W=f;f=F;try{return z.apply(this,arguments)}finally{f=W}}}})(nu);tu.exports=nu;var Xp=tu.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 ru=y,ot=Xp;function D(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var su=new Set,Zr={};function Hn(e,t){mr(e,t),mr(e+"Capture",t)}function mr(e,t){for(Zr[e]=t,e=0;e<t.length;e++)su.add(t[e])}var Zt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ci=Object.prototype.hasOwnProperty,Qp=/^[: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]*$/,Cl={},El={};function Yp(e){return Ci.call(El,e)?!0:Ci.call(Cl,e)?!1:Qp.test(e)?El[e]=!0:(Cl[e]=!0,!1)}function Kp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Gp(e,t,n,r){if(t===null||typeof t>"u"||Kp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Be(e,t,n,r,s,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new Be(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Re[t]=new Be(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new Be(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new Be(e,2,!1,e,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(e){Re[e]=new Be(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new Be(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new Be(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new Be(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new Be(e,5,!1,e.toLowerCase(),null,!1,!1)});var ka=/[\-:]([a-z])/g;function Na(e){return e[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(e){var t=e.replace(ka,Na);Re[t]=new Be(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ka,Na);Re[t]=new Be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ka,Na);Re[t]=new Be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new Be(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new Be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new Be(e,1,!1,e.toLowerCase(),null,!0,!0)});function Pa(e,t,n,r){var s=Re.hasOwnProperty(t)?Re[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Gp(t,n,s,r)&&(n=null),r||s===null?Yp(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var nn=ru.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ns=Symbol.for("react.element"),Jn=Symbol.for("react.portal"),Zn=Symbol.for("react.fragment"),Ca=Symbol.for("react.strict_mode"),Ei=Symbol.for("react.profiler"),ou=Symbol.for("react.provider"),iu=Symbol.for("react.context"),Ea=Symbol.for("react.forward_ref"),Ti=Symbol.for("react.suspense"),Di=Symbol.for("react.suspense_list"),Ta=Symbol.for("react.memo"),cn=Symbol.for("react.lazy"),au=Symbol.for("react.offscreen"),Tl=Symbol.iterator;function Tr(e){return e===null||typeof e!="object"?null:(e=Tl&&e[Tl]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Object.assign,Go;function Fr(e){if(Go===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Go=t&&t[1]||""}return`
|
|
34
|
-
`+Go+e}var Jo=!1;function Zo(e,t){if(!e||Jo)return"";Jo=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
|
|
35
|
-
`),o=r.stack.split(`
|
|
36
|
-
`),a=s.length-1,l=o.length-1;1<=a&&0<=l&&s[a]!==o[l];)l--;for(;1<=a&&0<=l;a--,l--)if(s[a]!==o[l]){if(a!==1||l!==1)do if(a--,l--,0>l||s[a]!==o[l]){var c=`
|
|
37
|
-
`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Jo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fr(e):""}function Jp(e){switch(e.tag){case 5:return Fr(e.type);case 16:return Fr("Lazy");case 13:return Fr("Suspense");case 19:return Fr("SuspenseList");case 0:case 2:case 15:return e=Zo(e.type,!1),e;case 11:return e=Zo(e.type.render,!1),e;case 1:return e=Zo(e.type,!0),e;default:return""}}function _i(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Zn:return"Fragment";case Jn:return"Portal";case Ei:return"Profiler";case Ca:return"StrictMode";case Ti:return"Suspense";case Di:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case iu:return(e.displayName||"Context")+".Consumer";case ou:return(e._context.displayName||"Context")+".Provider";case Ea:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ta:return t=e.displayName||null,t!==null?t:_i(e.type)||"Memo";case cn:t=e._payload,e=e._init;try{return _i(e(t))}catch{}}return null}function Zp(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _i(t);case 8:return t===Ca?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qp(e){var t=lu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ps(e){e._valueTracker||(e._valueTracker=qp(e))}function cu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=lu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function so(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function zi(e,t){var n=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Dl(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=kn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uu(e,t){t=t.checked,t!=null&&Pa(e,"checked",t,!1)}function bi(e,t){uu(e,t);var n=kn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ri(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ri(e,t.type,kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function _l(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ri(e,t,n){(t!=="number"||so(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wr=Array.isArray;function ur(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+kn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Ai(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(D(91));return fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function zl(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(D(92));if(Wr(n)){if(1<n.length)throw Error(D(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:kn(n)}}function du(e,t){var n=kn(t.value),r=kn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function bl(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function pu(e){switch(e){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 Oi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?pu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Cs,fu=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Cs=Cs||document.createElement("div"),Cs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Cs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function qr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Br={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},ef=["Webkit","ms","Moz","O"];Object.keys(Br).forEach(function(e){ef.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Br[t]=Br[e]})});function hu(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Br.hasOwnProperty(e)&&Br[e]?(""+t).trim():t+"px"}function gu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=hu(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var tf=fe({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 Mi(e,t){if(t){if(tf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function Li(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ii=null;function Da(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fi=null,dr=null,pr=null;function Rl(e){if(e=ys(e)){if(typeof Fi!="function")throw Error(D(280));var t=e.stateNode;t&&(t=Ao(t),Fi(e.stateNode,e.type,t))}}function mu(e){dr?pr?pr.push(e):pr=[e]:dr=e}function vu(){if(dr){var e=dr,t=pr;if(pr=dr=null,Rl(e),t)for(e=0;e<t.length;e++)Rl(t[e])}}function yu(e,t){return e(t)}function wu(){}var qo=!1;function xu(e,t,n){if(qo)return e(t,n);qo=!0;try{return yu(e,t,n)}finally{qo=!1,(dr!==null||pr!==null)&&(wu(),vu())}}function es(e,t){var n=e.stateNode;if(n===null)return null;var r=Ao(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(D(231,t,typeof n));return n}var Wi=!1;if(Zt)try{var Dr={};Object.defineProperty(Dr,"passive",{get:function(){Wi=!0}}),window.addEventListener("test",Dr,Dr),window.removeEventListener("test",Dr,Dr)}catch{Wi=!1}function nf(e,t,n,r,s,o,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(h){this.onError(h)}}var Hr=!1,oo=null,io=!1,$i=null,rf={onError:function(e){Hr=!0,oo=e}};function sf(e,t,n,r,s,o,a,l,c){Hr=!1,oo=null,nf.apply(rf,arguments)}function of(e,t,n,r,s,o,a,l,c){if(sf.apply(this,arguments),Hr){if(Hr){var u=oo;Hr=!1,oo=null}else throw Error(D(198));io||(io=!0,$i=u)}}function Vn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ju(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Al(e){if(Vn(e)!==e)throw Error(D(188))}function af(e){var t=e.alternate;if(!t){if(t=Vn(e),t===null)throw Error(D(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var o=s.alternate;if(o===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===n)return Al(s),e;if(o===r)return Al(s),t;o=o.sibling}throw Error(D(188))}if(n.return!==r.return)n=s,r=o;else{for(var a=!1,l=s.child;l;){if(l===n){a=!0,n=s,r=o;break}if(l===r){a=!0,r=s,n=o;break}l=l.sibling}if(!a){for(l=o.child;l;){if(l===n){a=!0,n=o,r=s;break}if(l===r){a=!0,r=o,n=s;break}l=l.sibling}if(!a)throw Error(D(189))}}if(n.alternate!==r)throw Error(D(190))}if(n.tag!==3)throw Error(D(188));return n.stateNode.current===n?e:t}function Su(e){return e=af(e),e!==null?ku(e):null}function ku(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ku(e);if(t!==null)return t;e=e.sibling}return null}var Nu=ot.unstable_scheduleCallback,Ol=ot.unstable_cancelCallback,lf=ot.unstable_shouldYield,cf=ot.unstable_requestPaint,we=ot.unstable_now,uf=ot.unstable_getCurrentPriorityLevel,_a=ot.unstable_ImmediatePriority,Pu=ot.unstable_UserBlockingPriority,ao=ot.unstable_NormalPriority,df=ot.unstable_LowPriority,Cu=ot.unstable_IdlePriority,_o=null,Ft=null;function pf(e){if(Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(_o,e,void 0,(e.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:gf,ff=Math.log,hf=Math.LN2;function gf(e){return e>>>=0,e===0?32:31-(ff(e)/hf|0)|0}var Es=64,Ts=4194304;function $r(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function lo(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~s;l!==0?r=$r(l):(o&=a,o!==0&&(r=$r(o)))}else a=n&~s,a!==0?r=$r(a):o!==0&&(r=$r(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Dt(t),s=1<<n,r|=e[n],t&=~s;return r}function mf(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 vf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-Dt(o),l=1<<a,c=s[a];c===-1?(!(l&n)||l&r)&&(s[a]=mf(l,t)):c<=t&&(e.expiredLanes|=l),o&=~l}}function Ui(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Eu(){var e=Es;return Es<<=1,!(Es&4194240)&&(Es=64),e}function ei(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ms(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function yf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Dt(n),o=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~o}}function za(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Dt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ee=0;function Tu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Du,ba,_u,zu,bu,Bi=!1,Ds=[],gn=null,mn=null,vn=null,ts=new Map,ns=new Map,dn=[],wf="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 Ml(e,t){switch(e){case"focusin":case"focusout":gn=null;break;case"dragenter":case"dragleave":mn=null;break;case"mouseover":case"mouseout":vn=null;break;case"pointerover":case"pointerout":ts.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ns.delete(t.pointerId)}}function _r(e,t,n,r,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[s]},t!==null&&(t=ys(t),t!==null&&ba(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function xf(e,t,n,r,s){switch(t){case"focusin":return gn=_r(gn,e,t,n,r,s),!0;case"dragenter":return mn=_r(mn,e,t,n,r,s),!0;case"mouseover":return vn=_r(vn,e,t,n,r,s),!0;case"pointerover":var o=s.pointerId;return ts.set(o,_r(ts.get(o)||null,e,t,n,r,s)),!0;case"gotpointercapture":return o=s.pointerId,ns.set(o,_r(ns.get(o)||null,e,t,n,r,s)),!0}return!1}function Ru(e){var t=An(e.target);if(t!==null){var n=Vn(t);if(n!==null){if(t=n.tag,t===13){if(t=ju(n),t!==null){e.blockedOn=t,bu(e.priority,function(){_u(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hi(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ii=r,n.target.dispatchEvent(r),Ii=null}else return t=ys(n),t!==null&&ba(t),e.blockedOn=n,!1;t.shift()}return!0}function Ll(e,t,n){Qs(e)&&n.delete(t)}function jf(){Bi=!1,gn!==null&&Qs(gn)&&(gn=null),mn!==null&&Qs(mn)&&(mn=null),vn!==null&&Qs(vn)&&(vn=null),ts.forEach(Ll),ns.forEach(Ll)}function zr(e,t){e.blockedOn===t&&(e.blockedOn=null,Bi||(Bi=!0,ot.unstable_scheduleCallback(ot.unstable_NormalPriority,jf)))}function rs(e){function t(s){return zr(s,e)}if(0<Ds.length){zr(Ds[0],e);for(var n=1;n<Ds.length;n++){var r=Ds[n];r.blockedOn===e&&(r.blockedOn=null)}}for(gn!==null&&zr(gn,e),mn!==null&&zr(mn,e),vn!==null&&zr(vn,e),ts.forEach(t),ns.forEach(t),n=0;n<dn.length;n++)r=dn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<dn.length&&(n=dn[0],n.blockedOn===null);)Ru(n),n.blockedOn===null&&dn.shift()}var fr=nn.ReactCurrentBatchConfig,co=!0;function Sf(e,t,n,r){var s=ee,o=fr.transition;fr.transition=null;try{ee=1,Ra(e,t,n,r)}finally{ee=s,fr.transition=o}}function kf(e,t,n,r){var s=ee,o=fr.transition;fr.transition=null;try{ee=4,Ra(e,t,n,r)}finally{ee=s,fr.transition=o}}function Ra(e,t,n,r){if(co){var s=Hi(e,t,n,r);if(s===null)ui(e,t,r,uo,n),Ml(e,r);else if(xf(s,e,t,n,r))r.stopPropagation();else if(Ml(e,r),t&4&&-1<wf.indexOf(e)){for(;s!==null;){var o=ys(s);if(o!==null&&Du(o),o=Hi(e,t,n,r),o===null&&ui(e,t,r,uo,n),o===s)break;s=o}s!==null&&r.stopPropagation()}else ui(e,t,r,null,n)}}var uo=null;function Hi(e,t,n,r){if(uo=null,e=Da(r),e=An(e),e!==null)if(t=Vn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ju(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return uo=e,null}function Au(e){switch(e){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(uf()){case _a:return 1;case Pu:return 4;case ao:case df:return 16;case Cu:return 536870912;default:return 16}default:return 16}}var fn=null,Aa=null,Ys=null;function Ou(){if(Ys)return Ys;var e,t=Aa,n=t.length,r,s="value"in fn?fn.value:fn.textContent,o=s.length;for(e=0;e<n&&t[e]===s[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===s[o-r];r++);return Ys=s.slice(e,1<r?1-r:void 0)}function Ks(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _s(){return!0}function Il(){return!1}function at(e){function t(n,r,s,o,a){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?_s:Il,this.isPropagationStopped=Il,this}return fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=_s)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=_s)},persist:function(){},isPersistent:_s}),t}var Nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oa=at(Nr),vs=fe({},Nr,{view:0,detail:0}),Nf=at(vs),ti,ni,br,zo=fe({},vs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ma,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==br&&(br&&e.type==="mousemove"?(ti=e.screenX-br.screenX,ni=e.screenY-br.screenY):ni=ti=0,br=e),ti)},movementY:function(e){return"movementY"in e?e.movementY:ni}}),Fl=at(zo),Pf=fe({},zo,{dataTransfer:0}),Cf=at(Pf),Ef=fe({},vs,{relatedTarget:0}),ri=at(Ef),Tf=fe({},Nr,{animationName:0,elapsedTime:0,pseudoElement:0}),Df=at(Tf),_f=fe({},Nr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zf=at(_f),bf=fe({},Nr,{data:0}),Wl=at(bf),Rf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Af={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"},Of={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Of[e])?!!t[e]:!1}function Ma(){return Mf}var Lf=fe({},vs,{key:function(e){if(e.key){var t=Rf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ks(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Af[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ma,charCode:function(e){return e.type==="keypress"?Ks(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ks(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),If=at(Lf),Ff=fe({},zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$l=at(Ff),Wf=fe({},vs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ma}),$f=at(Wf),Uf=fe({},Nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bf=at(Uf),Hf=fe({},zo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Vf=at(Hf),Xf=[9,13,27,32],La=Zt&&"CompositionEvent"in window,Vr=null;Zt&&"documentMode"in document&&(Vr=document.documentMode);var Qf=Zt&&"TextEvent"in window&&!Vr,Mu=Zt&&(!La||Vr&&8<Vr&&11>=Vr),Ul=" ",Bl=!1;function Lu(e,t){switch(e){case"keyup":return Xf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Iu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qn=!1;function Yf(e,t){switch(e){case"compositionend":return Iu(t);case"keypress":return t.which!==32?null:(Bl=!0,Ul);case"textInput":return e=t.data,e===Ul&&Bl?null:e;default:return null}}function Kf(e,t){if(qn)return e==="compositionend"||!La&&Lu(e,t)?(e=Ou(),Ys=Aa=fn=null,qn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Mu&&t.locale!=="ko"?null:t.data;default:return null}}var Gf={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 Hl(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gf[e.type]:t==="textarea"}function Fu(e,t,n,r){mu(r),t=po(t,"onChange"),0<t.length&&(n=new Oa("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Xr=null,ss=null;function Jf(e){Gu(e,0)}function bo(e){var t=nr(e);if(cu(t))return e}function Zf(e,t){if(e==="change")return t}var Wu=!1;if(Zt){var si;if(Zt){var oi="oninput"in document;if(!oi){var Vl=document.createElement("div");Vl.setAttribute("oninput","return;"),oi=typeof Vl.oninput=="function"}si=oi}else si=!1;Wu=si&&(!document.documentMode||9<document.documentMode)}function Xl(){Xr&&(Xr.detachEvent("onpropertychange",$u),ss=Xr=null)}function $u(e){if(e.propertyName==="value"&&bo(ss)){var t=[];Fu(t,ss,e,Da(e)),xu(Jf,t)}}function qf(e,t,n){e==="focusin"?(Xl(),Xr=t,ss=n,Xr.attachEvent("onpropertychange",$u)):e==="focusout"&&Xl()}function eh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bo(ss)}function th(e,t){if(e==="click")return bo(t)}function nh(e,t){if(e==="input"||e==="change")return bo(t)}function rh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zt=typeof Object.is=="function"?Object.is:rh;function os(e,t){if(zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Ci.call(t,s)||!zt(e[s],t[s]))return!1}return!0}function Ql(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yl(e,t){var n=Ql(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ql(n)}}function Uu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bu(){for(var e=window,t=so();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=so(e.document)}return t}function Ia(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function sh(e){var t=Bu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Uu(n.ownerDocument.documentElement,n)){if(r!==null&&Ia(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=Yl(n,o);var a=Yl(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var oh=Zt&&"documentMode"in document&&11>=document.documentMode,er=null,Vi=null,Qr=null,Xi=!1;function Kl(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xi||er==null||er!==so(r)||(r=er,"selectionStart"in r&&Ia(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Qr&&os(Qr,r)||(Qr=r,r=po(Vi,"onSelect"),0<r.length&&(t=new Oa("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=er)))}function zs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var tr={animationend:zs("Animation","AnimationEnd"),animationiteration:zs("Animation","AnimationIteration"),animationstart:zs("Animation","AnimationStart"),transitionend:zs("Transition","TransitionEnd")},ii={},Hu={};Zt&&(Hu=document.createElement("div").style,"AnimationEvent"in window||(delete tr.animationend.animation,delete tr.animationiteration.animation,delete tr.animationstart.animation),"TransitionEvent"in window||delete tr.transitionend.transition);function Ro(e){if(ii[e])return ii[e];if(!tr[e])return e;var t=tr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Hu)return ii[e]=t[n];return e}var Vu=Ro("animationend"),Xu=Ro("animationiteration"),Qu=Ro("animationstart"),Yu=Ro("transitionend"),Ku=new Map,Gl="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 Pn(e,t){Ku.set(e,t),Hn(t,[e])}for(var ai=0;ai<Gl.length;ai++){var li=Gl[ai],ih=li.toLowerCase(),ah=li[0].toUpperCase()+li.slice(1);Pn(ih,"on"+ah)}Pn(Vu,"onAnimationEnd");Pn(Xu,"onAnimationIteration");Pn(Qu,"onAnimationStart");Pn("dblclick","onDoubleClick");Pn("focusin","onFocus");Pn("focusout","onBlur");Pn(Yu,"onTransitionEnd");mr("onMouseEnter",["mouseout","mouseover"]);mr("onMouseLeave",["mouseout","mouseover"]);mr("onPointerEnter",["pointerout","pointerover"]);mr("onPointerLeave",["pointerout","pointerover"]);Hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Hn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ur="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(" "),lh=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ur));function Jl(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,of(r,t,void 0,e),e.currentTarget=null}function Gu(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==o&&s.isPropagationStopped())break e;Jl(s,l,u),o=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==o&&s.isPropagationStopped())break e;Jl(s,l,u),o=c}}}if(io)throw e=$i,io=!1,$i=null,e}function oe(e,t){var n=t[Ji];n===void 0&&(n=t[Ji]=new Set);var r=e+"__bubble";n.has(r)||(Ju(t,e,2,!1),n.add(r))}function ci(e,t,n){var r=0;t&&(r|=4),Ju(n,e,r,t)}var bs="_reactListening"+Math.random().toString(36).slice(2);function is(e){if(!e[bs]){e[bs]=!0,su.forEach(function(n){n!=="selectionchange"&&(lh.has(n)||ci(n,!1,e),ci(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bs]||(t[bs]=!0,ci("selectionchange",!1,t))}}function Ju(e,t,n,r){switch(Au(t)){case 1:var s=Sf;break;case 4:s=kf;break;default:s=Ra}n=s.bind(null,t,n,e),s=void 0,!Wi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function ui(e,t,n,r,s){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;a=a.return}for(;l!==null;){if(a=An(l),a===null)return;if(c=a.tag,c===5||c===6){r=o=a;continue e}l=l.parentNode}}r=r.return}xu(function(){var u=o,h=Da(n),g=[];e:{var f=Ku.get(e);if(f!==void 0){var v=Oa,j=e;switch(e){case"keypress":if(Ks(n)===0)break e;case"keydown":case"keyup":v=If;break;case"focusin":j="focus",v=ri;break;case"focusout":j="blur",v=ri;break;case"beforeblur":case"afterblur":v=ri;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":v=Fl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=Cf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=$f;break;case Vu:case Xu:case Qu:v=Df;break;case Yu:v=Bf;break;case"scroll":v=Nf;break;case"wheel":v=Vf;break;case"copy":case"cut":case"paste":v=zf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=$l}var k=(t&4)!==0,_=!k&&e==="scroll",m=k?f!==null?f+"Capture":null:f;k=[];for(var d=u,p;d!==null;){p=d;var w=p.stateNode;if(p.tag===5&&w!==null&&(p=w,m!==null&&(w=es(d,m),w!=null&&k.push(as(d,w,p)))),_)break;d=d.return}0<k.length&&(f=new v(f,j,null,n,h),g.push({event:f,listeners:k}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",f&&n!==Ii&&(j=n.relatedTarget||n.fromElement)&&(An(j)||j[qt]))break e;if((v||f)&&(f=h.window===h?h:(f=h.ownerDocument)?f.defaultView||f.parentWindow:window,v?(j=n.relatedTarget||n.toElement,v=u,j=j?An(j):null,j!==null&&(_=Vn(j),j!==_||j.tag!==5&&j.tag!==6)&&(j=null)):(v=null,j=u),v!==j)){if(k=Fl,w="onMouseLeave",m="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(k=$l,w="onPointerLeave",m="onPointerEnter",d="pointer"),_=v==null?f:nr(v),p=j==null?f:nr(j),f=new k(w,d+"leave",v,n,h),f.target=_,f.relatedTarget=p,w=null,An(h)===u&&(k=new k(m,d+"enter",j,n,h),k.target=p,k.relatedTarget=_,w=k),_=w,v&&j)t:{for(k=v,m=j,d=0,p=k;p;p=Yn(p))d++;for(p=0,w=m;w;w=Yn(w))p++;for(;0<d-p;)k=Yn(k),d--;for(;0<p-d;)m=Yn(m),p--;for(;d--;){if(k===m||m!==null&&k===m.alternate)break t;k=Yn(k),m=Yn(m)}k=null}else k=null;v!==null&&Zl(g,f,v,k,!1),j!==null&&_!==null&&Zl(g,_,j,k,!0)}}e:{if(f=u?nr(u):window,v=f.nodeName&&f.nodeName.toLowerCase(),v==="select"||v==="input"&&f.type==="file")var N=Zf;else if(Hl(f))if(Wu)N=nh;else{N=eh;var E=qf}else(v=f.nodeName)&&v.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(N=th);if(N&&(N=N(e,u))){Fu(g,N,n,h);break e}E&&E(e,f,u),e==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&Ri(f,"number",f.value)}switch(E=u?nr(u):window,e){case"focusin":(Hl(E)||E.contentEditable==="true")&&(er=E,Vi=u,Qr=null);break;case"focusout":Qr=Vi=er=null;break;case"mousedown":Xi=!0;break;case"contextmenu":case"mouseup":case"dragend":Xi=!1,Kl(g,n,h);break;case"selectionchange":if(oh)break;case"keydown":case"keyup":Kl(g,n,h)}var P;if(La)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else qn?Lu(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Mu&&n.locale!=="ko"&&(qn||T!=="onCompositionStart"?T==="onCompositionEnd"&&qn&&(P=Ou()):(fn=h,Aa="value"in fn?fn.value:fn.textContent,qn=!0)),E=po(u,T),0<E.length&&(T=new Wl(T,e,null,n,h),g.push({event:T,listeners:E}),P?T.data=P:(P=Iu(n),P!==null&&(T.data=P)))),(P=Qf?Yf(e,n):Kf(e,n))&&(u=po(u,"onBeforeInput"),0<u.length&&(h=new Wl("onBeforeInput","beforeinput",null,n,h),g.push({event:h,listeners:u}),h.data=P))}Gu(g,t)})}function as(e,t,n){return{instance:e,listener:t,currentTarget:n}}function po(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=es(e,n),o!=null&&r.unshift(as(e,o,s)),o=es(e,t),o!=null&&r.push(as(e,o,s))),e=e.return}return r}function Yn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Zl(e,t,n,r,s){for(var o=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,s?(c=es(n,o),c!=null&&a.unshift(as(n,c,l))):s||(c=es(n,o),c!=null&&a.push(as(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var ch=/\r\n?/g,uh=/\u0000|\uFFFD/g;function ql(e){return(typeof e=="string"?e:""+e).replace(ch,`
|
|
38
|
-
`).replace(uh,"")}function Rs(e,t,n){if(t=ql(t),ql(e)!==t&&n)throw Error(D(425))}function fo(){}var Qi=null,Yi=null;function Ki(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Gi=typeof setTimeout=="function"?setTimeout:void 0,dh=typeof clearTimeout=="function"?clearTimeout:void 0,ec=typeof Promise=="function"?Promise:void 0,ph=typeof queueMicrotask=="function"?queueMicrotask:typeof ec<"u"?function(e){return ec.resolve(null).then(e).catch(fh)}:Gi;function fh(e){setTimeout(function(){throw e})}function di(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),rs(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);rs(t)}function yn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function tc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Pr=Math.random().toString(36).slice(2),It="__reactFiber$"+Pr,ls="__reactProps$"+Pr,qt="__reactContainer$"+Pr,Ji="__reactEvents$"+Pr,hh="__reactListeners$"+Pr,gh="__reactHandles$"+Pr;function An(e){var t=e[It];if(t)return t;for(var n=e.parentNode;n;){if(t=n[qt]||n[It]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=tc(e);e!==null;){if(n=e[It])return n;e=tc(e)}return t}e=n,n=e.parentNode}return null}function ys(e){return e=e[It]||e[qt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function nr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(D(33))}function Ao(e){return e[ls]||null}var Zi=[],rr=-1;function Cn(e){return{current:e}}function ie(e){0>rr||(e.current=Zi[rr],Zi[rr]=null,rr--)}function re(e,t){rr++,Zi[rr]=e.current,e.current=t}var Nn={},Ie=Cn(Nn),Ye=Cn(!1),Fn=Nn;function vr(e,t){var n=e.type.contextTypes;if(!n)return Nn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Ke(e){return e=e.childContextTypes,e!=null}function ho(){ie(Ye),ie(Ie)}function nc(e,t,n){if(Ie.current!==Nn)throw Error(D(168));re(Ie,t),re(Ye,n)}function Zu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(D(108,Zp(e)||"Unknown",s));return fe({},n,r)}function go(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Nn,Fn=Ie.current,re(Ie,e),re(Ye,Ye.current),!0}function rc(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=Zu(e,t,Fn),r.__reactInternalMemoizedMergedChildContext=e,ie(Ye),ie(Ie),re(Ie,e)):ie(Ye),re(Ye,n)}var Yt=null,Oo=!1,pi=!1;function qu(e){Yt===null?Yt=[e]:Yt.push(e)}function mh(e){Oo=!0,qu(e)}function En(){if(!pi&&Yt!==null){pi=!0;var e=0,t=ee;try{var n=Yt;for(ee=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Yt=null,Oo=!1}catch(s){throw Yt!==null&&(Yt=Yt.slice(e+1)),Nu(_a,En),s}finally{ee=t,pi=!1}}return null}var sr=[],or=0,mo=null,vo=0,ft=[],ht=0,Wn=null,Kt=1,Gt="";function bn(e,t){sr[or++]=vo,sr[or++]=mo,mo=e,vo=t}function ed(e,t,n){ft[ht++]=Kt,ft[ht++]=Gt,ft[ht++]=Wn,Wn=e;var r=Kt;e=Gt;var s=32-Dt(r)-1;r&=~(1<<s),n+=1;var o=32-Dt(t)+s;if(30<o){var a=s-s%5;o=(r&(1<<a)-1).toString(32),r>>=a,s-=a,Kt=1<<32-Dt(t)+s|n<<s|r,Gt=o+e}else Kt=1<<o|n<<s|r,Gt=e}function Fa(e){e.return!==null&&(bn(e,1),ed(e,1,0))}function Wa(e){for(;e===mo;)mo=sr[--or],sr[or]=null,vo=sr[--or],sr[or]=null;for(;e===Wn;)Wn=ft[--ht],ft[ht]=null,Gt=ft[--ht],ft[ht]=null,Kt=ft[--ht],ft[ht]=null}var rt=null,nt=null,le=!1,Tt=null;function td(e,t){var n=gt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function sc(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,rt=e,nt=yn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rt=e,nt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Wn!==null?{id:Kt,overflow:Gt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,rt=e,nt=null,!0):!1;default:return!1}}function qi(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ea(e){if(le){var t=nt;if(t){var n=t;if(!sc(e,t)){if(qi(e))throw Error(D(418));t=yn(n.nextSibling);var r=rt;t&&sc(e,t)?td(r,n):(e.flags=e.flags&-4097|2,le=!1,rt=e)}}else{if(qi(e))throw Error(D(418));e.flags=e.flags&-4097|2,le=!1,rt=e}}}function oc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rt=e}function As(e){if(e!==rt)return!1;if(!le)return oc(e),le=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ki(e.type,e.memoizedProps)),t&&(t=nt)){if(qi(e))throw nd(),Error(D(418));for(;t;)td(e,t),t=yn(t.nextSibling)}if(oc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(D(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){nt=yn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}nt=null}}else nt=rt?yn(e.stateNode.nextSibling):null;return!0}function nd(){for(var e=nt;e;)e=yn(e.nextSibling)}function yr(){nt=rt=null,le=!1}function $a(e){Tt===null?Tt=[e]:Tt.push(e)}var vh=nn.ReactCurrentBatchConfig;function Ct(e,t){if(e&&e.defaultProps){t=fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var yo=Cn(null),wo=null,ir=null,Ua=null;function Ba(){Ua=ir=wo=null}function Ha(e){var t=yo.current;ie(yo),e._currentValue=t}function ta(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function hr(e,t){wo=e,Ua=ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(Ua!==e)if(e={context:e,memoizedValue:t,next:null},ir===null){if(wo===null)throw Error(D(308));ir=e,wo.dependencies={lanes:0,firstContext:e}}else ir=ir.next=e;return t}var On=null;function Va(e){On===null?On=[e]:On.push(e)}function rd(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Va(t)):(n.next=s.next,s.next=n),t.interleaved=n,en(e,r)}function en(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var un=!1;function Xa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function sd(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function wn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,en(e,n)}return s=r.interleaved,s===null?(t.next=t,Va(r)):(t.next=s.next,s.next=t),r.interleaved=t,en(e,n)}function Gs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,za(e,n)}}function ic(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xo(e,t,n,r){var s=e.updateQueue;un=!1;var o=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?o=u:a.next=u,a=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==a&&(l===null?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c))}if(o!==null){var g=s.baseState;a=0,h=u=c=null,l=o;do{var f=l.lane,v=l.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:v,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var j=e,k=l;switch(f=t,v=n,k.tag){case 1:if(j=k.payload,typeof j=="function"){g=j.call(v,g,f);break e}g=j;break e;case 3:j.flags=j.flags&-65537|128;case 0:if(j=k.payload,f=typeof j=="function"?j.call(v,g,f):j,f==null)break e;g=fe({},g,f);break e;case 2:un=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=s.effects,f===null?s.effects=[l]:f.push(l))}else v={eventTime:v,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(u=h=v,c=g):h=h.next=v,a|=f;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;f=l,l=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(h===null&&(c=g),s.baseState=c,s.firstBaseUpdate=u,s.lastBaseUpdate=h,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Un|=a,e.lanes=a,e.memoizedState=g}}function ac(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(D(191,s));s.call(r)}}}var od=new ru.Component().refs;function na(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Mo={isMounted:function(e){return(e=e._reactInternals)?Vn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$e(),s=jn(e),o=Jt(r,s);o.payload=t,n!=null&&(o.callback=n),t=wn(e,o,s),t!==null&&(_t(t,e,s,r),Gs(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$e(),s=jn(e),o=Jt(r,s);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=wn(e,o,s),t!==null&&(_t(t,e,s,r),Gs(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$e(),r=jn(e),s=Jt(n,r);s.tag=2,t!=null&&(s.callback=t),t=wn(e,s,r),t!==null&&(_t(t,e,r,n),Gs(t,e,r))}};function lc(e,t,n,r,s,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!os(n,r)||!os(s,o):!0}function id(e,t,n){var r=!1,s=Nn,o=t.contextType;return typeof o=="object"&&o!==null?o=vt(o):(s=Ke(t)?Fn:Ie.current,r=t.contextTypes,o=(r=r!=null)?vr(e,s):Nn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Mo,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Mo.enqueueReplaceState(t,t.state,null)}function ra(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs=od,Xa(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=vt(o):(o=Ke(t)?Fn:Ie.current,s.context=vr(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(na(e,t,o,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Mo.enqueueReplaceState(s,s.state,null),xo(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Rr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(D(309));var r=n.stateNode}if(!r)throw Error(D(147,e));var s=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var l=s.refs;l===od&&(l=s.refs={}),a===null?delete l[o]:l[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(D(284));if(!n._owner)throw Error(D(290,e))}return e}function Os(e,t){throw e=Object.prototype.toString.call(t),Error(D(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function uc(e){var t=e._init;return t(e._payload)}function ad(e){function t(m,d){if(e){var p=m.deletions;p===null?(m.deletions=[d],m.flags|=16):p.push(d)}}function n(m,d){if(!e)return null;for(;d!==null;)t(m,d),d=d.sibling;return null}function r(m,d){for(m=new Map;d!==null;)d.key!==null?m.set(d.key,d):m.set(d.index,d),d=d.sibling;return m}function s(m,d){return m=Sn(m,d),m.index=0,m.sibling=null,m}function o(m,d,p){return m.index=p,e?(p=m.alternate,p!==null?(p=p.index,p<d?(m.flags|=2,d):p):(m.flags|=2,d)):(m.flags|=1048576,d)}function a(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,d,p,w){return d===null||d.tag!==6?(d=wi(p,m.mode,w),d.return=m,d):(d=s(d,p),d.return=m,d)}function c(m,d,p,w){var N=p.type;return N===Zn?h(m,d,p.props.children,w,p.key):d!==null&&(d.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===cn&&uc(N)===d.type)?(w=s(d,p.props),w.ref=Rr(m,d,p),w.return=m,w):(w=no(p.type,p.key,p.props,null,m.mode,w),w.ref=Rr(m,d,p),w.return=m,w)}function u(m,d,p,w){return d===null||d.tag!==4||d.stateNode.containerInfo!==p.containerInfo||d.stateNode.implementation!==p.implementation?(d=xi(p,m.mode,w),d.return=m,d):(d=s(d,p.children||[]),d.return=m,d)}function h(m,d,p,w,N){return d===null||d.tag!==7?(d=In(p,m.mode,w,N),d.return=m,d):(d=s(d,p),d.return=m,d)}function g(m,d,p){if(typeof d=="string"&&d!==""||typeof d=="number")return d=wi(""+d,m.mode,p),d.return=m,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case Ns:return p=no(d.type,d.key,d.props,null,m.mode,p),p.ref=Rr(m,null,d),p.return=m,p;case Jn:return d=xi(d,m.mode,p),d.return=m,d;case cn:var w=d._init;return g(m,w(d._payload),p)}if(Wr(d)||Tr(d))return d=In(d,m.mode,p,null),d.return=m,d;Os(m,d)}return null}function f(m,d,p,w){var N=d!==null?d.key:null;if(typeof p=="string"&&p!==""||typeof p=="number")return N!==null?null:l(m,d,""+p,w);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ns:return p.key===N?c(m,d,p,w):null;case Jn:return p.key===N?u(m,d,p,w):null;case cn:return N=p._init,f(m,d,N(p._payload),w)}if(Wr(p)||Tr(p))return N!==null?null:h(m,d,p,w,null);Os(m,p)}return null}function v(m,d,p,w,N){if(typeof w=="string"&&w!==""||typeof w=="number")return m=m.get(p)||null,l(d,m,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ns:return m=m.get(w.key===null?p:w.key)||null,c(d,m,w,N);case Jn:return m=m.get(w.key===null?p:w.key)||null,u(d,m,w,N);case cn:var E=w._init;return v(m,d,p,E(w._payload),N)}if(Wr(w)||Tr(w))return m=m.get(p)||null,h(d,m,w,N,null);Os(d,w)}return null}function j(m,d,p,w){for(var N=null,E=null,P=d,T=d=0,H=null;P!==null&&T<p.length;T++){P.index>T?(H=P,P=null):H=P.sibling;var M=f(m,P,p[T],w);if(M===null){P===null&&(P=H);break}e&&P&&M.alternate===null&&t(m,P),d=o(M,d,T),E===null?N=M:E.sibling=M,E=M,P=H}if(T===p.length)return n(m,P),le&&bn(m,T),N;if(P===null){for(;T<p.length;T++)P=g(m,p[T],w),P!==null&&(d=o(P,d,T),E===null?N=P:E.sibling=P,E=P);return le&&bn(m,T),N}for(P=r(m,P);T<p.length;T++)H=v(P,m,T,p[T],w),H!==null&&(e&&H.alternate!==null&&P.delete(H.key===null?T:H.key),d=o(H,d,T),E===null?N=H:E.sibling=H,E=H);return e&&P.forEach(function(Y){return t(m,Y)}),le&&bn(m,T),N}function k(m,d,p,w){var N=Tr(p);if(typeof N!="function")throw Error(D(150));if(p=N.call(p),p==null)throw Error(D(151));for(var E=N=null,P=d,T=d=0,H=null,M=p.next();P!==null&&!M.done;T++,M=p.next()){P.index>T?(H=P,P=null):H=P.sibling;var Y=f(m,P,M.value,w);if(Y===null){P===null&&(P=H);break}e&&P&&Y.alternate===null&&t(m,P),d=o(Y,d,T),E===null?N=Y:E.sibling=Y,E=Y,P=H}if(M.done)return n(m,P),le&&bn(m,T),N;if(P===null){for(;!M.done;T++,M=p.next())M=g(m,M.value,w),M!==null&&(d=o(M,d,T),E===null?N=M:E.sibling=M,E=M);return le&&bn(m,T),N}for(P=r(m,P);!M.done;T++,M=p.next())M=v(P,m,T,M.value,w),M!==null&&(e&&M.alternate!==null&&P.delete(M.key===null?T:M.key),d=o(M,d,T),E===null?N=M:E.sibling=M,E=M);return e&&P.forEach(function(V){return t(m,V)}),le&&bn(m,T),N}function _(m,d,p,w){if(typeof p=="object"&&p!==null&&p.type===Zn&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Ns:e:{for(var N=p.key,E=d;E!==null;){if(E.key===N){if(N=p.type,N===Zn){if(E.tag===7){n(m,E.sibling),d=s(E,p.props.children),d.return=m,m=d;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===cn&&uc(N)===E.type){n(m,E.sibling),d=s(E,p.props),d.ref=Rr(m,E,p),d.return=m,m=d;break e}n(m,E);break}else t(m,E);E=E.sibling}p.type===Zn?(d=In(p.props.children,m.mode,w,p.key),d.return=m,m=d):(w=no(p.type,p.key,p.props,null,m.mode,w),w.ref=Rr(m,d,p),w.return=m,m=w)}return a(m);case Jn:e:{for(E=p.key;d!==null;){if(d.key===E)if(d.tag===4&&d.stateNode.containerInfo===p.containerInfo&&d.stateNode.implementation===p.implementation){n(m,d.sibling),d=s(d,p.children||[]),d.return=m,m=d;break e}else{n(m,d);break}else t(m,d);d=d.sibling}d=xi(p,m.mode,w),d.return=m,m=d}return a(m);case cn:return E=p._init,_(m,d,E(p._payload),w)}if(Wr(p))return j(m,d,p,w);if(Tr(p))return k(m,d,p,w);Os(m,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,d!==null&&d.tag===6?(n(m,d.sibling),d=s(d,p),d.return=m,m=d):(n(m,d),d=wi(p,m.mode,w),d.return=m,m=d),a(m)):n(m,d)}return _}var wr=ad(!0),ld=ad(!1),ws={},Wt=Cn(ws),cs=Cn(ws),us=Cn(ws);function Mn(e){if(e===ws)throw Error(D(174));return e}function Qa(e,t){switch(re(us,t),re(cs,e),re(Wt,ws),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Oi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Oi(t,e)}ie(Wt),re(Wt,t)}function xr(){ie(Wt),ie(cs),ie(us)}function cd(e){Mn(us.current);var t=Mn(Wt.current),n=Oi(t,e.type);t!==n&&(re(cs,e),re(Wt,n))}function Ya(e){cs.current===e&&(ie(Wt),ie(cs))}var de=Cn(0);function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fi=[];function Ka(){for(var e=0;e<fi.length;e++)fi[e]._workInProgressVersionPrimary=null;fi.length=0}var Js=nn.ReactCurrentDispatcher,hi=nn.ReactCurrentBatchConfig,$n=0,pe=null,Pe=null,Te=null,So=!1,Yr=!1,ds=0,yh=0;function Ae(){throw Error(D(321))}function Ga(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!zt(e[n],t[n]))return!1;return!0}function Ja(e,t,n,r,s,o){if($n=o,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Js.current=e===null||e.memoizedState===null?Sh:kh,e=n(r,s),Yr){o=0;do{if(Yr=!1,ds=0,25<=o)throw Error(D(301));o+=1,Te=Pe=null,t.updateQueue=null,Js.current=Nh,e=n(r,s)}while(Yr)}if(Js.current=ko,t=Pe!==null&&Pe.next!==null,$n=0,Te=Pe=pe=null,So=!1,t)throw Error(D(300));return e}function Za(){var e=ds!==0;return ds=0,e}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Te===null?pe.memoizedState=Te=e:Te=Te.next=e,Te}function yt(){if(Pe===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=Pe.next;var t=Te===null?pe.memoizedState:Te.next;if(t!==null)Te=t,Pe=e;else{if(e===null)throw Error(D(310));Pe=e,e={memoizedState:Pe.memoizedState,baseState:Pe.baseState,baseQueue:Pe.baseQueue,queue:Pe.queue,next:null},Te===null?pe.memoizedState=Te=e:Te=Te.next=e}return Te}function ps(e,t){return typeof t=="function"?t(e):t}function gi(e){var t=yt(),n=t.queue;if(n===null)throw Error(D(311));n.lastRenderedReducer=e;var r=Pe,s=r.baseQueue,o=n.pending;if(o!==null){if(s!==null){var a=s.next;s.next=o.next,o.next=a}r.baseQueue=s=o,n.pending=null}if(s!==null){o=s.next,r=r.baseState;var l=a=null,c=null,u=o;do{var h=u.lane;if(($n&h)===h)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var g={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=g,a=r):c=c.next=g,pe.lanes|=h,Un|=h}u=u.next}while(u!==null&&u!==o);c===null?a=r:c.next=l,zt(r,t.memoizedState)||(Qe=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do o=s.lane,pe.lanes|=o,Un|=o,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function mi(e){var t=yt(),n=t.queue;if(n===null)throw Error(D(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,o=t.memoizedState;if(s!==null){n.pending=null;var a=s=s.next;do o=e(o,a.action),a=a.next;while(a!==s);zt(o,t.memoizedState)||(Qe=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ud(){}function dd(e,t){var n=pe,r=yt(),s=t(),o=!zt(r.memoizedState,s);if(o&&(r.memoizedState=s,Qe=!0),r=r.queue,qa(hd.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||Te!==null&&Te.memoizedState.tag&1){if(n.flags|=2048,fs(9,fd.bind(null,n,r,s,t),void 0,null),De===null)throw Error(D(349));$n&30||pd(n,t,s)}return s}function pd(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=pe.updateQueue,t===null?(t={lastEffect:null,stores:null},pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fd(e,t,n,r){t.value=n,t.getSnapshot=r,gd(t)&&md(e)}function hd(e,t,n){return n(function(){gd(t)&&md(e)})}function gd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!zt(e,n)}catch{return!0}}function md(e){var t=en(e,1);t!==null&&_t(t,e,1,-1)}function dc(e){var t=Mt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t.queue=e,e=e.dispatch=jh.bind(null,pe,e),[t.memoizedState,e]}function fs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=pe.updateQueue,t===null?(t={lastEffect:null,stores:null},pe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function vd(){return yt().memoizedState}function Zs(e,t,n,r){var s=Mt();pe.flags|=e,s.memoizedState=fs(1|t,n,void 0,r===void 0?null:r)}function Lo(e,t,n,r){var s=yt();r=r===void 0?null:r;var o=void 0;if(Pe!==null){var a=Pe.memoizedState;if(o=a.destroy,r!==null&&Ga(r,a.deps)){s.memoizedState=fs(t,n,o,r);return}}pe.flags|=e,s.memoizedState=fs(1|t,n,o,r)}function pc(e,t){return Zs(8390656,8,e,t)}function qa(e,t){return Lo(2048,8,e,t)}function yd(e,t){return Lo(4,2,e,t)}function wd(e,t){return Lo(4,4,e,t)}function xd(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function jd(e,t,n){return n=n!=null?n.concat([e]):null,Lo(4,4,xd.bind(null,t,e),n)}function el(){}function Sd(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ga(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function kd(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ga(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Nd(e,t,n){return $n&21?(zt(n,t)||(n=Eu(),pe.lanes|=n,Un|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qe=!0),e.memoizedState=n)}function wh(e,t){var n=ee;ee=n!==0&&4>n?n:4,e(!0);var r=hi.transition;hi.transition={};try{e(!1),t()}finally{ee=n,hi.transition=r}}function Pd(){return yt().memoizedState}function xh(e,t,n){var r=jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Cd(e))Ed(t,n);else if(n=rd(e,t,n,r),n!==null){var s=$e();_t(n,e,r,s),Td(n,t,r)}}function jh(e,t,n){var r=jn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Cd(e))Ed(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,l=o(a,n);if(s.hasEagerState=!0,s.eagerState=l,zt(l,a)){var c=t.interleaved;c===null?(s.next=s,Va(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=rd(e,t,s,r),n!==null&&(s=$e(),_t(n,e,r,s),Td(n,t,r))}}function Cd(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function Ed(e,t){Yr=So=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Td(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,za(e,n)}}var ko={readContext:vt,useCallback:Ae,useContext:Ae,useEffect:Ae,useImperativeHandle:Ae,useInsertionEffect:Ae,useLayoutEffect:Ae,useMemo:Ae,useReducer:Ae,useRef:Ae,useState:Ae,useDebugValue:Ae,useDeferredValue:Ae,useTransition:Ae,useMutableSource:Ae,useSyncExternalStore:Ae,useId:Ae,unstable_isNewReconciler:!1},Sh={readContext:vt,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:pc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zs(4194308,4,xd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zs(4,2,e,t)},useMemo:function(e,t){var n=Mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=xh.bind(null,pe,e),[r.memoizedState,e]},useRef:function(e){var t=Mt();return e={current:e},t.memoizedState=e},useState:dc,useDebugValue:el,useDeferredValue:function(e){return Mt().memoizedState=e},useTransition:function(){var e=dc(!1),t=e[0];return e=wh.bind(null,e[1]),Mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pe,s=Mt();if(le){if(n===void 0)throw Error(D(407));n=n()}else{if(n=t(),De===null)throw Error(D(349));$n&30||pd(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,pc(hd.bind(null,r,o,e),[e]),r.flags|=2048,fs(9,fd.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Mt(),t=De.identifierPrefix;if(le){var n=Gt,r=Kt;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ds++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=yh++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},kh={readContext:vt,useCallback:Sd,useContext:vt,useEffect:qa,useImperativeHandle:jd,useInsertionEffect:yd,useLayoutEffect:wd,useMemo:kd,useReducer:gi,useRef:vd,useState:function(){return gi(ps)},useDebugValue:el,useDeferredValue:function(e){var t=yt();return Nd(t,Pe.memoizedState,e)},useTransition:function(){var e=gi(ps)[0],t=yt().memoizedState;return[e,t]},useMutableSource:ud,useSyncExternalStore:dd,useId:Pd,unstable_isNewReconciler:!1},Nh={readContext:vt,useCallback:Sd,useContext:vt,useEffect:qa,useImperativeHandle:jd,useInsertionEffect:yd,useLayoutEffect:wd,useMemo:kd,useReducer:mi,useRef:vd,useState:function(){return mi(ps)},useDebugValue:el,useDeferredValue:function(e){var t=yt();return Pe===null?t.memoizedState=e:Nd(t,Pe.memoizedState,e)},useTransition:function(){var e=mi(ps)[0],t=yt().memoizedState;return[e,t]},useMutableSource:ud,useSyncExternalStore:dd,useId:Pd,unstable_isNewReconciler:!1};function jr(e,t){try{var n="",r=t;do n+=Jp(r),r=r.return;while(r);var s=n}catch(o){s=`
|
|
39
|
-
Error generating stack: `+o.message+`
|
|
40
|
-
`+o.stack}return{value:e,source:t,stack:s,digest:null}}function vi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function sa(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Ph=typeof WeakMap=="function"?WeakMap:Map;function Dd(e,t,n){n=Jt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Po||(Po=!0,ha=r),sa(e,t)},n}function _d(e,t,n){n=Jt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){sa(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){sa(e,t),typeof r!="function"&&(xn===null?xn=new Set([this]):xn.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function fc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ph;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Fh.bind(null,e,t,n),t.then(e,e))}function hc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function gc(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Jt(-1,1),t.tag=2,wn(n,t,1))),n.lanes|=1),e)}var Ch=nn.ReactCurrentOwner,Qe=!1;function We(e,t,n,r){t.child=e===null?ld(t,null,n,r):wr(t,e.child,n,r)}function mc(e,t,n,r,s){n=n.render;var o=t.ref;return hr(t,s),r=Ja(e,t,n,r,o,s),n=Za(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,tn(e,t,s)):(le&&n&&Fa(t),t.flags|=1,We(e,t,r,s),t.child)}function vc(e,t,n,r,s){if(e===null){var o=n.type;return typeof o=="function"&&!ll(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,zd(e,t,o,r,s)):(e=no(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:os,n(a,r)&&e.ref===t.ref)return tn(e,t,s)}return t.flags|=1,e=Sn(o,r),e.ref=t.ref,e.return=t,t.child=e}function zd(e,t,n,r,s){if(e!==null){var o=e.memoizedProps;if(os(o,r)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=r=o,(e.lanes&s)!==0)e.flags&131072&&(Qe=!0);else return t.lanes=e.lanes,tn(e,t,s)}return oa(e,t,n,r,s)}function bd(e,t,n){var r=t.pendingProps,s=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},re(lr,tt),tt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,re(lr,tt),tt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,re(lr,tt),tt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,re(lr,tt),tt|=r;return We(e,t,s,n),t.child}function Rd(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function oa(e,t,n,r,s){var o=Ke(n)?Fn:Ie.current;return o=vr(t,o),hr(t,s),n=Ja(e,t,n,r,o,s),r=Za(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,tn(e,t,s)):(le&&r&&Fa(t),t.flags|=1,We(e,t,n,s),t.child)}function yc(e,t,n,r,s){if(Ke(n)){var o=!0;go(t)}else o=!1;if(hr(t,s),t.stateNode===null)qs(e,t),id(t,n,r),ra(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=vt(u):(u=Ke(n)?Fn:Ie.current,u=vr(t,u));var h=n.getDerivedStateFromProps,g=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function";g||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==u)&&cc(t,a,r,u),un=!1;var f=t.memoizedState;a.state=f,xo(t,r,a,s),c=t.memoizedState,l!==r||f!==c||Ye.current||un?(typeof h=="function"&&(na(t,n,h,r),c=t.memoizedState),(l=un||lc(t,n,l,r,f,c,u))?(g||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,sd(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Ct(t.type,l),a.props=u,g=t.pendingProps,f=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=vt(c):(c=Ke(n)?Fn:Ie.current,c=vr(t,c));var v=n.getDerivedStateFromProps;(h=typeof v=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==g||f!==c)&&cc(t,a,r,c),un=!1,f=t.memoizedState,a.state=f,xo(t,r,a,s);var j=t.memoizedState;l!==g||f!==j||Ye.current||un?(typeof v=="function"&&(na(t,n,v,r),j=t.memoizedState),(u=un||lc(t,n,u,r,f,j,c)||!1)?(h||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,j,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,j,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=j),a.props=r,a.state=j,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return ia(e,t,n,r,o,s)}function ia(e,t,n,r,s,o){Rd(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&rc(t,n,!1),tn(e,t,o);r=t.stateNode,Ch.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=wr(t,e.child,null,o),t.child=wr(t,null,l,o)):We(e,t,l,o),t.memoizedState=r.state,s&&rc(t,n,!0),t.child}function Ad(e){var t=e.stateNode;t.pendingContext?nc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&nc(e,t.context,!1),Qa(e,t.containerInfo)}function wc(e,t,n,r,s){return yr(),$a(s),t.flags|=256,We(e,t,n,r),t.child}var aa={dehydrated:null,treeContext:null,retryLane:0};function la(e){return{baseLanes:e,cachePool:null,transitions:null}}function Od(e,t,n){var r=t.pendingProps,s=de.current,o=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),re(de,s&1),e===null)return ea(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=Wo(a,r,0,null),e=In(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=la(n),t.memoizedState=aa,e):tl(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return Eh(e,t,a,r,l,s,n);if(o){o=r.fallback,a=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Sn(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?o=Sn(l,o):(o=In(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?la(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=aa,r}return o=e.child,e=o.sibling,r=Sn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function tl(e,t){return t=Wo({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ms(e,t,n,r){return r!==null&&$a(r),wr(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Eh(e,t,n,r,s,o,a){if(n)return t.flags&256?(t.flags&=-257,r=vi(Error(D(422))),Ms(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,s=t.mode,r=Wo({mode:"visible",children:r.children},s,0,null),o=In(o,s,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&wr(t,e.child,null,a),t.child.memoizedState=la(a),t.memoizedState=aa,o);if(!(t.mode&1))return Ms(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(D(419)),r=vi(o,r,void 0),Ms(e,t,a,r)}if(l=(a&e.childLanes)!==0,Qe||l){if(r=De,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,en(e,s),_t(r,e,s,-1))}return al(),r=vi(Error(D(421))),Ms(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Wh.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,nt=yn(s.nextSibling),rt=t,le=!0,Tt=null,e!==null&&(ft[ht++]=Kt,ft[ht++]=Gt,ft[ht++]=Wn,Kt=e.id,Gt=e.overflow,Wn=t),t=tl(t,r.children),t.flags|=4096,t)}function xc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ta(e.return,t,n)}function yi(e,t,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=s)}function Md(e,t,n){var r=t.pendingProps,s=r.revealOrder,o=r.tail;if(We(e,t,r.children,n),r=de.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&xc(e,n,t);else if(e.tag===19)xc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(re(de,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&jo(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),yi(t,!1,s,n,o);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&jo(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}yi(t,!0,n,null,o);break;case"together":yi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function tn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Un|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(D(153));if(t.child!==null){for(e=t.child,n=Sn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Sn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Th(e,t,n){switch(t.tag){case 3:Ad(t),yr();break;case 5:cd(t);break;case 1:Ke(t.type)&&go(t);break;case 4:Qa(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;re(yo,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(re(de,de.current&1),t.flags|=128,null):n&t.child.childLanes?Od(e,t,n):(re(de,de.current&1),e=tn(e,t,n),e!==null?e.sibling:null);re(de,de.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Md(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),re(de,de.current),r)break;return null;case 22:case 23:return t.lanes=0,bd(e,t,n)}return tn(e,t,n)}var Ld,ca,Id,Fd;Ld=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ca=function(){};Id=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Mn(Wt.current);var o=null;switch(n){case"input":s=zi(e,s),r=zi(e,r),o=[];break;case"select":s=fe({},s,{value:void 0}),r=fe({},r,{value:void 0}),o=[];break;case"textarea":s=Ai(e,s),r=Ai(e,r),o=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=fo)}Mi(n,r);var a;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Zr.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var c=r[u];if(l=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(o||(o=[]),o.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(o=o||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(o=o||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Zr.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&oe("scroll",e),o||l===c||(o=[])):(o=o||[]).push(u,c))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};Fd=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ar(e,t){if(!le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Oe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Dh(e,t,n){var r=t.pendingProps;switch(Wa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oe(t),null;case 1:return Ke(t.type)&&ho(),Oe(t),null;case 3:return r=t.stateNode,xr(),ie(Ye),ie(Ie),Ka(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(As(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Tt!==null&&(va(Tt),Tt=null))),ca(e,t),Oe(t),null;case 5:Ya(t);var s=Mn(us.current);if(n=t.type,e!==null&&t.stateNode!=null)Id(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(D(166));return Oe(t),null}if(e=Mn(Wt.current),As(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[It]=t,r[ls]=o,e=(t.mode&1)!==0,n){case"dialog":oe("cancel",r),oe("close",r);break;case"iframe":case"object":case"embed":oe("load",r);break;case"video":case"audio":for(s=0;s<Ur.length;s++)oe(Ur[s],r);break;case"source":oe("error",r);break;case"img":case"image":case"link":oe("error",r),oe("load",r);break;case"details":oe("toggle",r);break;case"input":Dl(r,o),oe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},oe("invalid",r);break;case"textarea":zl(r,o),oe("invalid",r)}Mi(n,o),s=null;for(var a in o)if(o.hasOwnProperty(a)){var l=o[a];a==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&Rs(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Rs(r.textContent,l,e),s=["children",""+l]):Zr.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&oe("scroll",r)}switch(n){case"input":Ps(r),_l(r,o,!0);break;case"textarea":Ps(r),bl(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=fo)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=pu(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[It]=t,e[ls]=r,Ld(e,t,!1,!1),t.stateNode=e;e:{switch(a=Li(n,r),n){case"dialog":oe("cancel",e),oe("close",e),s=r;break;case"iframe":case"object":case"embed":oe("load",e),s=r;break;case"video":case"audio":for(s=0;s<Ur.length;s++)oe(Ur[s],e);s=r;break;case"source":oe("error",e),s=r;break;case"img":case"image":case"link":oe("error",e),oe("load",e),s=r;break;case"details":oe("toggle",e),s=r;break;case"input":Dl(e,r),s=zi(e,r),oe("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=fe({},r,{value:void 0}),oe("invalid",e);break;case"textarea":zl(e,r),s=Ai(e,r),oe("invalid",e);break;default:s=r}Mi(n,s),l=s;for(o in l)if(l.hasOwnProperty(o)){var c=l[o];o==="style"?gu(e,c):o==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&fu(e,c)):o==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&qr(e,c):typeof c=="number"&&qr(e,""+c):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Zr.hasOwnProperty(o)?c!=null&&o==="onScroll"&&oe("scroll",e):c!=null&&Pa(e,o,c,a))}switch(n){case"input":Ps(e),_l(e,r,!1);break;case"textarea":Ps(e),bl(e);break;case"option":r.value!=null&&e.setAttribute("value",""+kn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?ur(e,!!r.multiple,o,!1):r.defaultValue!=null&&ur(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=fo)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Oe(t),null;case 6:if(e&&t.stateNode!=null)Fd(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(D(166));if(n=Mn(us.current),Mn(Wt.current),As(t)){if(r=t.stateNode,n=t.memoizedProps,r[It]=t,(o=r.nodeValue!==n)&&(e=rt,e!==null))switch(e.tag){case 3:Rs(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Rs(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[It]=t,t.stateNode=r}return Oe(t),null;case 13:if(ie(de),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(le&&nt!==null&&t.mode&1&&!(t.flags&128))nd(),yr(),t.flags|=98560,o=!1;else if(o=As(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(D(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(D(317));o[It]=t}else yr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oe(t),o=!1}else Tt!==null&&(va(Tt),Tt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||de.current&1?Ce===0&&(Ce=3):al())),t.updateQueue!==null&&(t.flags|=4),Oe(t),null);case 4:return xr(),ca(e,t),e===null&&is(t.stateNode.containerInfo),Oe(t),null;case 10:return Ha(t.type._context),Oe(t),null;case 17:return Ke(t.type)&&ho(),Oe(t),null;case 19:if(ie(de),o=t.memoizedState,o===null)return Oe(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)Ar(o,!1);else{if(Ce!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=jo(e),a!==null){for(t.flags|=128,Ar(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return re(de,de.current&1|2),t.child}e=e.sibling}o.tail!==null&&we()>Sr&&(t.flags|=128,r=!0,Ar(o,!1),t.lanes=4194304)}else{if(!r)if(e=jo(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ar(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!le)return Oe(t),null}else 2*we()-o.renderingStartTime>Sr&&n!==1073741824&&(t.flags|=128,r=!0,Ar(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=we(),t.sibling=null,n=de.current,re(de,r?n&1|2:n&1),t):(Oe(t),null);case 22:case 23:return il(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?tt&1073741824&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function _h(e,t){switch(Wa(t),t.tag){case 1:return Ke(t.type)&&ho(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xr(),ie(Ye),ie(Ie),Ka(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ya(t),null;case 13:if(ie(de),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ie(de),null;case 4:return xr(),null;case 10:return Ha(t.type._context),null;case 22:case 23:return il(),null;case 24:return null;default:return null}}var Ls=!1,Le=!1,zh=typeof WeakSet=="function"?WeakSet:Set,I=null;function ar(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){me(e,t,r)}else n.current=null}function ua(e,t,n){try{n()}catch(r){me(e,t,r)}}var jc=!1;function bh(e,t){if(Qi=co,e=Bu(),Ia(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,h=0,g=e,f=null;t:for(;;){for(var v;g!==n||s!==0&&g.nodeType!==3||(l=a+s),g!==o||r!==0&&g.nodeType!==3||(c=a+r),g.nodeType===3&&(a+=g.nodeValue.length),(v=g.firstChild)!==null;)f=g,g=v;for(;;){if(g===e)break t;if(f===n&&++u===s&&(l=a),f===o&&++h===r&&(c=a),(v=g.nextSibling)!==null)break;g=f,f=g.parentNode}g=v}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yi={focusedElem:e,selectionRange:n},co=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var j=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(j!==null){var k=j.memoizedProps,_=j.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?k:Ct(t.type,k),_);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(w){me(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return j=jc,jc=!1,j}function Kr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&ua(t,n,o)}s=s.next}while(s!==r)}}function Io(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function da(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Wd(e){var t=e.alternate;t!==null&&(e.alternate=null,Wd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[It],delete t[ls],delete t[Ji],delete t[hh],delete t[gh])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $d(e){return e.tag===5||e.tag===3||e.tag===4}function Sc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$d(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=fo));else if(r!==4&&(e=e.child,e!==null))for(pa(e,t,n),e=e.sibling;e!==null;)pa(e,t,n),e=e.sibling}function fa(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(fa(e,t,n),e=e.sibling;e!==null;)fa(e,t,n),e=e.sibling}var ze=null,Et=!1;function on(e,t,n){for(n=n.child;n!==null;)Ud(e,t,n),n=n.sibling}function Ud(e,t,n){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(_o,n)}catch{}switch(n.tag){case 5:Le||ar(n,t);case 6:var r=ze,s=Et;ze=null,on(e,t,n),ze=r,Et=s,ze!==null&&(Et?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(Et?(e=ze,n=n.stateNode,e.nodeType===8?di(e.parentNode,n):e.nodeType===1&&di(e,n),rs(e)):di(ze,n.stateNode));break;case 4:r=ze,s=Et,ze=n.stateNode.containerInfo,Et=!0,on(e,t,n),ze=r,Et=s;break;case 0:case 11:case 14:case 15:if(!Le&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&ua(n,t,a),s=s.next}while(s!==r)}on(e,t,n);break;case 1:if(!Le&&(ar(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){me(n,t,l)}on(e,t,n);break;case 21:on(e,t,n);break;case 22:n.mode&1?(Le=(r=Le)||n.memoizedState!==null,on(e,t,n),Le=r):on(e,t,n);break;default:on(e,t,n)}}function kc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zh),t.forEach(function(r){var s=$h.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function kt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var o=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:ze=l.stateNode,Et=!1;break e;case 3:ze=l.stateNode.containerInfo,Et=!0;break e;case 4:ze=l.stateNode.containerInfo,Et=!0;break e}l=l.return}if(ze===null)throw Error(D(160));Ud(o,a,s),ze=null,Et=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){me(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Bd(t,e),t=t.sibling}function Bd(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(kt(t,e),At(e),r&4){try{Kr(3,e,e.return),Io(3,e)}catch(k){me(e,e.return,k)}try{Kr(5,e,e.return)}catch(k){me(e,e.return,k)}}break;case 1:kt(t,e),At(e),r&512&&n!==null&&ar(n,n.return);break;case 5:if(kt(t,e),At(e),r&512&&n!==null&&ar(n,n.return),e.flags&32){var s=e.stateNode;try{qr(s,"")}catch(k){me(e,e.return,k)}}if(r&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&uu(s,o),Li(l,a);var u=Li(l,o);for(a=0;a<c.length;a+=2){var h=c[a],g=c[a+1];h==="style"?gu(s,g):h==="dangerouslySetInnerHTML"?fu(s,g):h==="children"?qr(s,g):Pa(s,h,g,u)}switch(l){case"input":bi(s,o);break;case"textarea":du(s,o);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var v=o.value;v!=null?ur(s,!!o.multiple,v,!1):f!==!!o.multiple&&(o.defaultValue!=null?ur(s,!!o.multiple,o.defaultValue,!0):ur(s,!!o.multiple,o.multiple?[]:"",!1))}s[ls]=o}catch(k){me(e,e.return,k)}}break;case 6:if(kt(t,e),At(e),r&4){if(e.stateNode===null)throw Error(D(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(k){me(e,e.return,k)}}break;case 3:if(kt(t,e),At(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{rs(t.containerInfo)}catch(k){me(e,e.return,k)}break;case 4:kt(t,e),At(e);break;case 13:kt(t,e),At(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(sl=we())),r&4&&kc(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(Le=(u=Le)||h,kt(t,e),Le=u):kt(t,e),At(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!h&&e.mode&1)for(I=e,h=e.child;h!==null;){for(g=I=h;I!==null;){switch(f=I,v=f.child,f.tag){case 0:case 11:case 14:case 15:Kr(4,f,f.return);break;case 1:ar(f,f.return);var j=f.stateNode;if(typeof j.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,j.props=t.memoizedProps,j.state=t.memoizedState,j.componentWillUnmount()}catch(k){me(r,n,k)}}break;case 5:ar(f,f.return);break;case 22:if(f.memoizedState!==null){Pc(g);continue}}v!==null?(v.return=f,I=v):Pc(g)}h=h.sibling}e:for(h=null,g=e;;){if(g.tag===5){if(h===null){h=g;try{s=g.stateNode,u?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=g.stateNode,c=g.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=hu("display",a))}catch(k){me(e,e.return,k)}}}else if(g.tag===6){if(h===null)try{g.stateNode.nodeValue=u?"":g.memoizedProps}catch(k){me(e,e.return,k)}}else if((g.tag!==22&&g.tag!==23||g.memoizedState===null||g===e)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===e)break e;for(;g.sibling===null;){if(g.return===null||g.return===e)break e;h===g&&(h=null),g=g.return}h===g&&(h=null),g.sibling.return=g.return,g=g.sibling}}break;case 19:kt(t,e),At(e),r&4&&kc(e);break;case 21:break;default:kt(t,e),At(e)}}function At(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if($d(n)){var r=n;break e}n=n.return}throw Error(D(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(qr(s,""),r.flags&=-33);var o=Sc(e);fa(e,o,s);break;case 3:case 4:var a=r.stateNode.containerInfo,l=Sc(e);pa(e,l,a);break;default:throw Error(D(161))}}catch(c){me(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rh(e,t,n){I=e,Hd(e)}function Hd(e,t,n){for(var r=(e.mode&1)!==0;I!==null;){var s=I,o=s.child;if(s.tag===22&&r){var a=s.memoizedState!==null||Ls;if(!a){var l=s.alternate,c=l!==null&&l.memoizedState!==null||Le;l=Ls;var u=Le;if(Ls=a,(Le=c)&&!u)for(I=s;I!==null;)a=I,c=a.child,a.tag===22&&a.memoizedState!==null?Cc(s):c!==null?(c.return=a,I=c):Cc(s);for(;o!==null;)I=o,Hd(o),o=o.sibling;I=s,Ls=l,Le=u}Nc(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,I=o):Nc(e)}}function Nc(e){for(;I!==null;){var t=I;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Le||Io(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Le)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Ct(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&ac(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ac(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var h=u.memoizedState;if(h!==null){var g=h.dehydrated;g!==null&&rs(g)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(D(163))}Le||t.flags&512&&da(t)}catch(f){me(t,t.return,f)}}if(t===e){I=null;break}if(n=t.sibling,n!==null){n.return=t.return,I=n;break}I=t.return}}function Pc(e){for(;I!==null;){var t=I;if(t===e){I=null;break}var n=t.sibling;if(n!==null){n.return=t.return,I=n;break}I=t.return}}function Cc(e){for(;I!==null;){var t=I;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Io(4,t)}catch(c){me(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){me(t,s,c)}}var o=t.return;try{da(t)}catch(c){me(t,o,c)}break;case 5:var a=t.return;try{da(t)}catch(c){me(t,a,c)}}}catch(c){me(t,t.return,c)}if(t===e){I=null;break}var l=t.sibling;if(l!==null){l.return=t.return,I=l;break}I=t.return}}var Ah=Math.ceil,No=nn.ReactCurrentDispatcher,nl=nn.ReactCurrentOwner,mt=nn.ReactCurrentBatchConfig,K=0,De=null,je=null,be=0,tt=0,lr=Cn(0),Ce=0,hs=null,Un=0,Fo=0,rl=0,Gr=null,Xe=null,sl=0,Sr=1/0,Qt=null,Po=!1,ha=null,xn=null,Is=!1,hn=null,Co=0,Jr=0,ga=null,eo=-1,to=0;function $e(){return K&6?we():eo!==-1?eo:eo=we()}function jn(e){return e.mode&1?K&2&&be!==0?be&-be:vh.transition!==null?(to===0&&(to=Eu()),to):(e=ee,e!==0||(e=window.event,e=e===void 0?16:Au(e.type)),e):1}function _t(e,t,n,r){if(50<Jr)throw Jr=0,ga=null,Error(D(185));ms(e,n,r),(!(K&2)||e!==De)&&(e===De&&(!(K&2)&&(Fo|=n),Ce===4&&pn(e,be)),Ge(e,r),n===1&&K===0&&!(t.mode&1)&&(Sr=we()+500,Oo&&En()))}function Ge(e,t){var n=e.callbackNode;vf(e,t);var r=lo(e,e===De?be:0);if(r===0)n!==null&&Ol(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ol(n),t===1)e.tag===0?mh(Ec.bind(null,e)):qu(Ec.bind(null,e)),ph(function(){!(K&6)&&En()}),n=null;else{switch(Tu(r)){case 1:n=_a;break;case 4:n=Pu;break;case 16:n=ao;break;case 536870912:n=Cu;break;default:n=ao}n=Zd(n,Vd.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Vd(e,t){if(eo=-1,to=0,K&6)throw Error(D(327));var n=e.callbackNode;if(gr()&&e.callbackNode!==n)return null;var r=lo(e,e===De?be:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Eo(e,r);else{t=r;var s=K;K|=2;var o=Qd();(De!==e||be!==t)&&(Qt=null,Sr=we()+500,Ln(e,t));do try{Lh();break}catch(l){Xd(e,l)}while(!0);Ba(),No.current=o,K=s,je!==null?t=0:(De=null,be=0,t=Ce)}if(t!==0){if(t===2&&(s=Ui(e),s!==0&&(r=s,t=ma(e,s))),t===1)throw n=hs,Ln(e,0),pn(e,r),Ge(e,we()),n;if(t===6)pn(e,r);else{if(s=e.current.alternate,!(r&30)&&!Oh(s)&&(t=Eo(e,r),t===2&&(o=Ui(e),o!==0&&(r=o,t=ma(e,o))),t===1))throw n=hs,Ln(e,0),pn(e,r),Ge(e,we()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(D(345));case 2:Rn(e,Xe,Qt);break;case 3:if(pn(e,r),(r&130023424)===r&&(t=sl+500-we(),10<t)){if(lo(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){$e(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Gi(Rn.bind(null,e,Xe,Qt),t);break}Rn(e,Xe,Qt);break;case 4:if(pn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var a=31-Dt(r);o=1<<a,a=t[a],a>s&&(s=a),r&=~o}if(r=s,r=we()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ah(r/1960))-r,10<r){e.timeoutHandle=Gi(Rn.bind(null,e,Xe,Qt),r);break}Rn(e,Xe,Qt);break;case 5:Rn(e,Xe,Qt);break;default:throw Error(D(329))}}}return Ge(e,we()),e.callbackNode===n?Vd.bind(null,e):null}function ma(e,t){var n=Gr;return e.current.memoizedState.isDehydrated&&(Ln(e,t).flags|=256),e=Eo(e,t),e!==2&&(t=Xe,Xe=n,t!==null&&va(t)),e}function va(e){Xe===null?Xe=e:Xe.push.apply(Xe,e)}function Oh(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],o=s.getSnapshot;s=s.value;try{if(!zt(o(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function pn(e,t){for(t&=~rl,t&=~Fo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Dt(t),r=1<<n;e[n]=-1,t&=~r}}function Ec(e){if(K&6)throw Error(D(327));gr();var t=lo(e,0);if(!(t&1))return Ge(e,we()),null;var n=Eo(e,t);if(e.tag!==0&&n===2){var r=Ui(e);r!==0&&(t=r,n=ma(e,r))}if(n===1)throw n=hs,Ln(e,0),pn(e,t),Ge(e,we()),n;if(n===6)throw Error(D(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rn(e,Xe,Qt),Ge(e,we()),null}function ol(e,t){var n=K;K|=1;try{return e(t)}finally{K=n,K===0&&(Sr=we()+500,Oo&&En())}}function Bn(e){hn!==null&&hn.tag===0&&!(K&6)&&gr();var t=K;K|=1;var n=mt.transition,r=ee;try{if(mt.transition=null,ee=1,e)return e()}finally{ee=r,mt.transition=n,K=t,!(K&6)&&En()}}function il(){tt=lr.current,ie(lr)}function Ln(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,dh(n)),je!==null)for(n=je.return;n!==null;){var r=n;switch(Wa(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ho();break;case 3:xr(),ie(Ye),ie(Ie),Ka();break;case 5:Ya(r);break;case 4:xr();break;case 13:ie(de);break;case 19:ie(de);break;case 10:Ha(r.type._context);break;case 22:case 23:il()}n=n.return}if(De=e,je=e=Sn(e.current,null),be=tt=t,Ce=0,hs=null,rl=Fo=Un=0,Xe=Gr=null,On!==null){for(t=0;t<On.length;t++)if(n=On[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=s,r.next=a}n.pending=r}On=null}return e}function Xd(e,t){do{var n=je;try{if(Ba(),Js.current=ko,So){for(var r=pe.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}So=!1}if($n=0,Te=Pe=pe=null,Yr=!1,ds=0,nl.current=null,n===null||n.return===null){Ce=1,hs=t,je=null;break}e:{var o=e,a=n.return,l=n,c=t;if(t=be,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,h=l,g=h.tag;if(!(h.mode&1)&&(g===0||g===11||g===15)){var f=h.alternate;f?(h.updateQueue=f.updateQueue,h.memoizedState=f.memoizedState,h.lanes=f.lanes):(h.updateQueue=null,h.memoizedState=null)}var v=hc(a);if(v!==null){v.flags&=-257,gc(v,a,l,o,t),v.mode&1&&fc(o,u,t),t=v,c=u;var j=t.updateQueue;if(j===null){var k=new Set;k.add(c),t.updateQueue=k}else j.add(c);break e}else{if(!(t&1)){fc(o,u,t),al();break e}c=Error(D(426))}}else if(le&&l.mode&1){var _=hc(a);if(_!==null){!(_.flags&65536)&&(_.flags|=256),gc(_,a,l,o,t),$a(jr(c,l));break e}}o=c=jr(c,l),Ce!==4&&(Ce=2),Gr===null?Gr=[o]:Gr.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=Dd(o,c,t);ic(o,m);break e;case 1:l=c;var d=o.type,p=o.stateNode;if(!(o.flags&128)&&(typeof d.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(xn===null||!xn.has(p)))){o.flags|=65536,t&=-t,o.lanes|=t;var w=_d(o,l,t);ic(o,w);break e}}o=o.return}while(o!==null)}Kd(n)}catch(N){t=N,je===n&&n!==null&&(je=n=n.return);continue}break}while(!0)}function Qd(){var e=No.current;return No.current=ko,e===null?ko:e}function al(){(Ce===0||Ce===3||Ce===2)&&(Ce=4),De===null||!(Un&268435455)&&!(Fo&268435455)||pn(De,be)}function Eo(e,t){var n=K;K|=2;var r=Qd();(De!==e||be!==t)&&(Qt=null,Ln(e,t));do try{Mh();break}catch(s){Xd(e,s)}while(!0);if(Ba(),K=n,No.current=r,je!==null)throw Error(D(261));return De=null,be=0,Ce}function Mh(){for(;je!==null;)Yd(je)}function Lh(){for(;je!==null&&!lf();)Yd(je)}function Yd(e){var t=Jd(e.alternate,e,tt);e.memoizedProps=e.pendingProps,t===null?Kd(e):je=t,nl.current=null}function Kd(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=_h(n,t),n!==null){n.flags&=32767,je=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ce=6,je=null;return}}else if(n=Dh(n,t,tt),n!==null){je=n;return}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);Ce===0&&(Ce=5)}function Rn(e,t,n){var r=ee,s=mt.transition;try{mt.transition=null,ee=1,Ih(e,t,n,r)}finally{mt.transition=s,ee=r}return null}function Ih(e,t,n,r){do gr();while(hn!==null);if(K&6)throw Error(D(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(D(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(yf(e,o),e===De&&(je=De=null,be=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Is||(Is=!0,Zd(ao,function(){return gr(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=mt.transition,mt.transition=null;var a=ee;ee=1;var l=K;K|=4,nl.current=null,bh(e,n),Bd(n,e),sh(Yi),co=!!Qi,Yi=Qi=null,e.current=n,Rh(n),cf(),K=l,ee=a,mt.transition=o}else e.current=n;if(Is&&(Is=!1,hn=e,Co=s),o=e.pendingLanes,o===0&&(xn=null),pf(n.stateNode),Ge(e,we()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(Po)throw Po=!1,e=ha,ha=null,e;return Co&1&&e.tag!==0&&gr(),o=e.pendingLanes,o&1?e===ga?Jr++:(Jr=0,ga=e):Jr=0,En(),null}function gr(){if(hn!==null){var e=Tu(Co),t=mt.transition,n=ee;try{if(mt.transition=null,ee=16>e?16:e,hn===null)var r=!1;else{if(e=hn,hn=null,Co=0,K&6)throw Error(D(331));var s=K;for(K|=4,I=e.current;I!==null;){var o=I,a=o.child;if(I.flags&16){var l=o.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(I=u;I!==null;){var h=I;switch(h.tag){case 0:case 11:case 15:Kr(8,h,o)}var g=h.child;if(g!==null)g.return=h,I=g;else for(;I!==null;){h=I;var f=h.sibling,v=h.return;if(Wd(h),h===u){I=null;break}if(f!==null){f.return=v,I=f;break}I=v}}}var j=o.alternate;if(j!==null){var k=j.child;if(k!==null){j.child=null;do{var _=k.sibling;k.sibling=null,k=_}while(k!==null)}}I=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,I=a;else e:for(;I!==null;){if(o=I,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Kr(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,I=m;break e}I=o.return}}var d=e.current;for(I=d;I!==null;){a=I;var p=a.child;if(a.subtreeFlags&2064&&p!==null)p.return=a,I=p;else e:for(a=d;I!==null;){if(l=I,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Io(9,l)}}catch(N){me(l,l.return,N)}if(l===a){I=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,I=w;break e}I=l.return}}if(K=s,En(),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(_o,e)}catch{}r=!0}return r}finally{ee=n,mt.transition=t}}return!1}function Tc(e,t,n){t=jr(n,t),t=Dd(e,t,1),e=wn(e,t,1),t=$e(),e!==null&&(ms(e,1,t),Ge(e,t))}function me(e,t,n){if(e.tag===3)Tc(e,e,n);else for(;t!==null;){if(t.tag===3){Tc(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(xn===null||!xn.has(r))){e=jr(n,e),e=_d(t,e,1),t=wn(t,e,1),e=$e(),t!==null&&(ms(t,1,e),Ge(t,e));break}}t=t.return}}function Fh(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=$e(),e.pingedLanes|=e.suspendedLanes&n,De===e&&(be&n)===n&&(Ce===4||Ce===3&&(be&130023424)===be&&500>we()-sl?Ln(e,0):rl|=n),Ge(e,t)}function Gd(e,t){t===0&&(e.mode&1?(t=Ts,Ts<<=1,!(Ts&130023424)&&(Ts=4194304)):t=1);var n=$e();e=en(e,t),e!==null&&(ms(e,t,n),Ge(e,n))}function Wh(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gd(e,n)}function $h(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(t),Gd(e,n)}var Jd;Jd=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ye.current)Qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qe=!1,Th(e,t,n);Qe=!!(e.flags&131072)}else Qe=!1,le&&t.flags&1048576&&ed(t,vo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;qs(e,t),e=t.pendingProps;var s=vr(t,Ie.current);hr(t,n),s=Ja(null,t,r,e,s,n);var o=Za();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ke(r)?(o=!0,go(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Xa(t),s.updater=Mo,t.stateNode=s,s._reactInternals=t,ra(t,r,e,n),t=ia(null,t,r,!0,o,n)):(t.tag=0,le&&o&&Fa(t),We(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(qs(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Bh(r),e=Ct(r,e),s){case 0:t=oa(null,t,r,e,n);break e;case 1:t=yc(null,t,r,e,n);break e;case 11:t=mc(null,t,r,e,n);break e;case 14:t=vc(null,t,r,Ct(r.type,e),n);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),oa(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),yc(e,t,r,s,n);case 3:e:{if(Ad(t),e===null)throw Error(D(387));r=t.pendingProps,o=t.memoizedState,s=o.element,sd(e,t),xo(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=jr(Error(D(423)),t),t=wc(e,t,r,n,s);break e}else if(r!==s){s=jr(Error(D(424)),t),t=wc(e,t,r,n,s);break e}else for(nt=yn(t.stateNode.containerInfo.firstChild),rt=t,le=!0,Tt=null,n=ld(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yr(),r===s){t=tn(e,t,n);break e}We(e,t,r,n)}t=t.child}return t;case 5:return cd(t),e===null&&ea(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,a=s.children,Ki(r,s)?a=null:o!==null&&Ki(r,o)&&(t.flags|=32),Rd(e,t),We(e,t,a,n),t.child;case 6:return e===null&&ea(t),null;case 13:return Od(e,t,n);case 4:return Qa(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wr(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),mc(e,t,r,s,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,a=s.value,re(yo,r._currentValue),r._currentValue=a,o!==null)if(zt(o.value,a)){if(o.children===s.children&&!Ye.current){t=tn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=Jt(-1,n&-n),c.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?c.next=c:(c.next=h.next,h.next=c),u.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ta(o.return,n,t),l.lanes|=n;break}c=c.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(D(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),ta(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}We(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,hr(t,n),s=vt(s),r=r(s),t.flags|=1,We(e,t,r,n),t.child;case 14:return r=t.type,s=Ct(r,t.pendingProps),s=Ct(r.type,s),vc(e,t,r,s,n);case 15:return zd(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Ct(r,s),qs(e,t),t.tag=1,Ke(r)?(e=!0,go(t)):e=!1,hr(t,n),id(t,r,s),ra(t,r,s,n),ia(null,t,r,!0,e,n);case 19:return Md(e,t,n);case 22:return bd(e,t,n)}throw Error(D(156,t.tag))};function Zd(e,t){return Nu(e,t)}function Uh(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gt(e,t,n,r){return new Uh(e,t,n,r)}function ll(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bh(e){if(typeof e=="function")return ll(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ea)return 11;if(e===Ta)return 14}return 2}function Sn(e,t){var n=e.alternate;return n===null?(n=gt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function no(e,t,n,r,s,o){var a=2;if(r=e,typeof e=="function")ll(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Zn:return In(n.children,s,o,t);case Ca:a=8,s|=8;break;case Ei:return e=gt(12,n,t,s|2),e.elementType=Ei,e.lanes=o,e;case Ti:return e=gt(13,n,t,s),e.elementType=Ti,e.lanes=o,e;case Di:return e=gt(19,n,t,s),e.elementType=Di,e.lanes=o,e;case au:return Wo(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ou:a=10;break e;case iu:a=9;break e;case Ea:a=11;break e;case Ta:a=14;break e;case cn:a=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=gt(a,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function In(e,t,n,r){return e=gt(7,e,r,t),e.lanes=n,e}function Wo(e,t,n,r){return e=gt(22,e,r,t),e.elementType=au,e.lanes=n,e.stateNode={isHidden:!1},e}function wi(e,t,n){return e=gt(6,e,null,t),e.lanes=n,e}function xi(e,t,n){return t=gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hh(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ei(0),this.expirationTimes=ei(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ei(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function cl(e,t,n,r,s,o,a,l,c){return e=new Hh(e,t,n,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=gt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xa(o),e}function Vh(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function qd(e){if(!e)return Nn;e=e._reactInternals;e:{if(Vn(e)!==e||e.tag!==1)throw Error(D(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ke(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(D(171))}if(e.tag===1){var n=e.type;if(Ke(n))return Zu(e,n,t)}return t}function ep(e,t,n,r,s,o,a,l,c){return e=cl(n,r,!0,e,s,o,a,l,c),e.context=qd(null),n=e.current,r=$e(),s=jn(n),o=Jt(r,s),o.callback=t??null,wn(n,o,s),e.current.lanes=s,ms(e,s,r),Ge(e,r),e}function $o(e,t,n,r){var s=t.current,o=$e(),a=jn(s);return n=qd(n),t.context===null?t.context=n:t.pendingContext=n,t=Jt(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=wn(s,t,a),e!==null&&(_t(e,s,a,o),Gs(e,s,a)),a}function To(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Dc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ul(e,t){Dc(e,t),(e=e.alternate)&&Dc(e,t)}function Xh(){return null}var tp=typeof reportError=="function"?reportError:function(e){console.error(e)};function dl(e){this._internalRoot=e}Uo.prototype.render=dl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(D(409));$o(e,t,null,null)};Uo.prototype.unmount=dl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Bn(function(){$o(null,e,null,null)}),t[qt]=null}};function Uo(e){this._internalRoot=e}Uo.prototype.unstable_scheduleHydration=function(e){if(e){var t=zu();e={blockedOn:null,target:e,priority:t};for(var n=0;n<dn.length&&t!==0&&t<dn[n].priority;n++);dn.splice(n,0,e),n===0&&Ru(e)}};function pl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Bo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _c(){}function Qh(e,t,n,r,s){if(s){if(typeof r=="function"){var o=r;r=function(){var u=To(a);o.call(u)}}var a=ep(t,r,e,0,null,!1,!1,"",_c);return e._reactRootContainer=a,e[qt]=a.current,is(e.nodeType===8?e.parentNode:e),Bn(),a}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var u=To(c);l.call(u)}}var c=cl(e,0,!1,null,null,!1,!1,"",_c);return e._reactRootContainer=c,e[qt]=c.current,is(e.nodeType===8?e.parentNode:e),Bn(function(){$o(t,c,n,r)}),c}function Ho(e,t,n,r,s){var o=n._reactRootContainer;if(o){var a=o;if(typeof s=="function"){var l=s;s=function(){var c=To(a);l.call(c)}}$o(t,a,e,s)}else a=Qh(n,t,e,s,r);return To(a)}Du=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=$r(t.pendingLanes);n!==0&&(za(t,n|1),Ge(t,we()),!(K&6)&&(Sr=we()+500,En()))}break;case 13:Bn(function(){var r=en(e,1);if(r!==null){var s=$e();_t(r,e,1,s)}}),ul(e,1)}};ba=function(e){if(e.tag===13){var t=en(e,134217728);if(t!==null){var n=$e();_t(t,e,134217728,n)}ul(e,134217728)}};_u=function(e){if(e.tag===13){var t=jn(e),n=en(e,t);if(n!==null){var r=$e();_t(n,e,t,r)}ul(e,t)}};zu=function(){return ee};bu=function(e,t){var n=ee;try{return ee=e,t()}finally{ee=n}};Fi=function(e,t,n){switch(t){case"input":if(bi(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Ao(r);if(!s)throw Error(D(90));cu(r),bi(r,s)}}}break;case"textarea":du(e,n);break;case"select":t=n.value,t!=null&&ur(e,!!n.multiple,t,!1)}};yu=ol;wu=Bn;var Yh={usingClientEntryPoint:!1,Events:[ys,nr,Ao,mu,vu,ol]},Or={findFiberByHostInstance:An,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},Kh={bundleType:Or.bundleType,version:Or.version,rendererPackageName:Or.rendererPackageName,rendererConfig:Or.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:nn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Su(e),e===null?null:e.stateNode},findFiberByHostInstance:Or.findFiberByHostInstance||Xh,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fs.isDisabled&&Fs.supportsFiber)try{_o=Fs.inject(Kh),Ft=Fs}catch{}}it.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yh;it.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pl(t))throw Error(D(200));return Vh(e,t,null,n)};it.createRoot=function(e,t){if(!pl(e))throw Error(D(299));var n=!1,r="",s=tp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=cl(e,1,!1,null,null,n,!1,r,s),e[qt]=t.current,is(e.nodeType===8?e.parentNode:e),new dl(t)};it.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(D(188)):(e=Object.keys(e).join(","),Error(D(268,e)));return e=Su(t),e=e===null?null:e.stateNode,e};it.flushSync=function(e){return Bn(e)};it.hydrate=function(e,t,n){if(!Bo(t))throw Error(D(200));return Ho(null,e,t,!0,n)};it.hydrateRoot=function(e,t,n){if(!pl(e))throw Error(D(405));var r=n!=null&&n.hydratedSources||null,s=!1,o="",a=tp;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=ep(t,null,e,1,n??null,s,!1,o,a),e[qt]=t.current,is(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Uo(t)};it.render=function(e,t,n){if(!Bo(t))throw Error(D(200));return Ho(null,e,t,!1,n)};it.unmountComponentAtNode=function(e){if(!Bo(e))throw Error(D(40));return e._reactRootContainer?(Bn(function(){Ho(null,null,e,!1,function(){e._reactRootContainer=null,e[qt]=null})}),!0):!1};it.unstable_batchedUpdates=ol;it.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Bo(n))throw Error(D(200));if(e==null||e._reactInternals===void 0)throw Error(D(38));return Ho(e,t,n,!1,r)};it.version="18.2.0-next-9e3b772b8-20220608";function np(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(np)}catch(e){console.error(e)}}np(),eu.exports=it;var xs=eu.exports,zc=xs;Pi.createRoot=zc.createRoot,Pi.hydrateRoot=zc.hydrateRoot;var Vo={exports:{}},rp={},sp={exports:{}},Gh="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Jh=Gh,Zh=Jh;function op(){}function ip(){}ip.resetWarningCache=op;var qh=function(){function e(r,s,o,a,l,c){if(c!==Zh){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ip,resetWarningCache:op};return n.PropTypes=n,n};sp.exports=qh();var ap=sp.exports;function lp(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=lp(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function bc(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=lp(e))&&(r&&(r+=" "),r+=t);return r}const eg=Object.freeze(Object.defineProperty({__proto__:null,clsx:bc,default:bc},Symbol.toStringTag,{value:"Module"})),tg=Np(eg);var ve={},$t={};Object.defineProperty($t,"__esModule",{value:!0});$t.dontSetMe=ig;$t.findInArray=ng;$t.int=og;$t.isFunction=rg;$t.isNum=sg;function ng(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function rg(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function sg(e){return typeof e=="number"&&!isNaN(e)}function og(e){return parseInt(e,10)}function ig(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.browserPrefixToKey=up;Xn.browserPrefixToStyle=ag;Xn.default=void 0;Xn.getPrefix=cp;const ji=["Moz","Webkit","O","ms"];function cp(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<ji.length;r++)if(up(t,ji[r])in n)return ji[r];return""}function up(e,t){return t?"".concat(t).concat(lg(e)):e}function ag(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function lg(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Xn.default=cp();Object.defineProperty(ve,"__esModule",{value:!0});ve.addClassName=fp;ve.addEvent=dg;ve.addUserSelectStyles=Sg;ve.createCSSTransform=yg;ve.createSVGTransform=wg;ve.getTouch=xg;ve.getTouchIdentifier=jg;ve.getTranslation=fl;ve.innerHeight=gg;ve.innerWidth=mg;ve.matchesSelector=pp;ve.matchesSelectorAndParentsTo=ug;ve.offsetXYFromParent=vg;ve.outerHeight=fg;ve.outerWidth=hg;ve.removeClassName=hp;ve.removeEvent=pg;ve.removeUserSelectStyles=kg;var st=$t,Rc=cg(Xn);function dp(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(dp=function(r){return r?n:t})(e)}function cg(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=dp(t);if(n&&n.has(e))return n.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}let Ws="";function pp(e,t){return Ws||(Ws=(0,st.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,st.isFunction)(e[n])})),(0,st.isFunction)(e[Ws])?e[Ws](t):!1}function ug(e,t,n){let r=e;do{if(pp(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function dg(e,t,n,r){if(!e)return;const s={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,s):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function pg(e,t,n,r){if(!e)return;const s={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,s):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function fg(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,st.int)(n.borderTopWidth),t+=(0,st.int)(n.borderBottomWidth),t}function hg(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,st.int)(n.borderLeftWidth),t+=(0,st.int)(n.borderRightWidth),t}function gg(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,st.int)(n.paddingTop),t-=(0,st.int)(n.paddingBottom),t}function mg(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,st.int)(n.paddingLeft),t-=(0,st.int)(n.paddingRight),t}function vg(e,t,n){const s=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),o=(e.clientX+t.scrollLeft-s.left)/n,a=(e.clientY+t.scrollTop-s.top)/n;return{x:o,y:a}}function yg(e,t){const n=fl(e,t,"px");return{[(0,Rc.browserPrefixToKey)("transform",Rc.default)]:n}}function wg(e,t){return fl(e,t,"")}function fl(e,t,n){let{x:r,y:s}=e,o="translate(".concat(r).concat(n,",").concat(s).concat(n,")");if(t){const a="".concat(typeof t.x=="string"?t.x:t.x+n),l="".concat(typeof t.y=="string"?t.y:t.y+n);o="translate(".concat(a,", ").concat(l,")")+o}return o}function xg(e,t){return e.targetTouches&&(0,st.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,st.findInArray)(e.changedTouches,n=>t===n.identifier)}function jg(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Sg(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
41
|
-
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
42
|
-
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&fp(e.body,"react-draggable-transparent-selection")}function kg(e){if(e)try{if(e.body&&hp(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function fp(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function hp(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.canDragX=Cg;Ut.canDragY=Eg;Ut.createCoreData=Dg;Ut.createDraggableData=_g;Ut.getBoundPosition=Ng;Ut.getControlPosition=Tg;Ut.snapToGrid=Pg;var et=$t,cr=ve;function Ng(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:zg(r);const s=hl(e);if(typeof r=="string"){const{ownerDocument:o}=s,a=o.defaultView;let l;if(r==="parent"?l=s.parentNode:l=o.querySelector(r),!(l instanceof a.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const c=l,u=a.getComputedStyle(s),h=a.getComputedStyle(c);r={left:-s.offsetLeft+(0,et.int)(h.paddingLeft)+(0,et.int)(u.marginLeft),top:-s.offsetTop+(0,et.int)(h.paddingTop)+(0,et.int)(u.marginTop),right:(0,cr.innerWidth)(c)-(0,cr.outerWidth)(s)-s.offsetLeft+(0,et.int)(h.paddingRight)-(0,et.int)(u.marginRight),bottom:(0,cr.innerHeight)(c)-(0,cr.outerHeight)(s)-s.offsetTop+(0,et.int)(h.paddingBottom)-(0,et.int)(u.marginBottom)}}return(0,et.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,et.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,et.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,et.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Pg(e,t,n){const r=Math.round(t/e[0])*e[0],s=Math.round(n/e[1])*e[1];return[r,s]}function Cg(e){return e.props.axis==="both"||e.props.axis==="x"}function Eg(e){return e.props.axis==="both"||e.props.axis==="y"}function Tg(e,t,n){const r=typeof t=="number"?(0,cr.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const s=hl(n),o=n.props.offsetParent||s.offsetParent||s.ownerDocument.body;return(0,cr.offsetXYFromParent)(r||e,o,n.props.scale)}function Dg(e,t,n){const r=!(0,et.isNum)(e.lastX),s=hl(e);return r?{node:s,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:s,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function _g(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function zg(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function hl(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Xo={},Qo={};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.default=bg;function bg(){}Object.defineProperty(Xo,"__esModule",{value:!0});Xo.default=void 0;var Si=Ag(y),Ve=gl(ap),Rg=gl(xs),Me=ve,an=Ut,ki=$t,Mr=gl(Qo);function gl(e){return e&&e.__esModule?e:{default:e}}function gp(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(gp=function(r){return r?n:t})(e)}function Ag(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=gp(t);if(n&&n.has(e))return n.get(e);var r={},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var a=s?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Fe(e,t,n){return t=Og(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Og(e){var t=Mg(e,"string");return typeof t=="symbol"?t:String(t)}function Mg(e,t){if(typeof e!="object"||e===null)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)}const Pt={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ln=Pt.mouse,Yo=class extends Si.Component{constructor(){super(...arguments),Fe(this,"dragging",!1),Fe(this,"lastX",NaN),Fe(this,"lastY",NaN),Fe(this,"touchIdentifier",null),Fe(this,"mounted",!1),Fe(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Me.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Me.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const s=(0,Me.getTouchIdentifier)(t);this.touchIdentifier=s;const o=(0,an.getControlPosition)(t,s,this);if(o==null)return;const{x:a,y:l}=o,c=(0,an.createCoreData)(this,a,l);(0,Mr.default)("DraggableCore: handleDragStart: %j",c),(0,Mr.default)("calling",this.props.onStart),!(this.props.onStart(t,c)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Me.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=l,(0,Me.addEvent)(r,ln.move,this.handleDrag),(0,Me.addEvent)(r,ln.stop,this.handleDragStop))}),Fe(this,"handleDrag",t=>{const n=(0,an.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:s}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX,c=s-this.lastY;if([l,c]=(0,an.snapToGrid)(this.props.grid,l,c),!l&&!c)return;r=this.lastX+l,s=this.lastY+c}const o=(0,an.createCoreData)(this,r,s);if((0,Mr.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const c=document.createEvent("MouseEvents");c.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(c)}return}this.lastX=r,this.lastY=s}),Fe(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,an.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:s}=n;if(Array.isArray(this.props.grid)){let c=r-this.lastX||0,u=s-this.lastY||0;[c,u]=(0,an.snapToGrid)(this.props.grid,c,u),r=this.lastX+c,s=this.lastY+u}const o=(0,an.createCoreData)(this,r,s);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const l=this.findDOMNode();l&&this.props.enableUserSelectHack&&(0,Me.removeUserSelectStyles)(l.ownerDocument),(0,Mr.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,l&&((0,Mr.default)("DraggableCore: Removing handlers"),(0,Me.removeEvent)(l.ownerDocument,ln.move,this.handleDrag),(0,Me.removeEvent)(l.ownerDocument,ln.stop,this.handleDragStop))}),Fe(this,"onMouseDown",t=>(ln=Pt.mouse,this.handleDragStart(t))),Fe(this,"onMouseUp",t=>(ln=Pt.mouse,this.handleDragStop(t))),Fe(this,"onTouchStart",t=>(ln=Pt.touch,this.handleDragStart(t))),Fe(this,"onTouchEnd",t=>(ln=Pt.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Me.addEvent)(t,Pt.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Me.removeEvent)(n,Pt.mouse.move,this.handleDrag),(0,Me.removeEvent)(n,Pt.touch.move,this.handleDrag),(0,Me.removeEvent)(n,Pt.mouse.stop,this.handleDragStop),(0,Me.removeEvent)(n,Pt.touch.stop,this.handleDragStop),(0,Me.removeEvent)(t,Pt.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Me.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:Rg.default.findDOMNode(this)}render(){return Si.cloneElement(Si.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Xo.default=Yo;Fe(Yo,"displayName","DraggableCore");Fe(Yo,"propTypes",{allowAnyClick:Ve.default.bool,children:Ve.default.node.isRequired,disabled:Ve.default.bool,enableUserSelectHack:Ve.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Ve.default.arrayOf(Ve.default.number),handle:Ve.default.string,cancel:Ve.default.string,nodeRef:Ve.default.object,onStart:Ve.default.func,onDrag:Ve.default.func,onStop:Ve.default.func,onMouseDown:Ve.default.func,scale:Ve.default.number,className:ki.dontSetMe,style:ki.dontSetMe,transform:ki.dontSetMe});Fe(Yo,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),e.default=void 0;var t=f(y),n=h(ap),r=h(xs),s=h(tg),o=ve,a=Ut,l=$t,c=h(Xo),u=h(Qo);function h(d){return d&&d.__esModule?d:{default:d}}function g(d){if(typeof WeakMap!="function")return null;var p=new WeakMap,w=new WeakMap;return(g=function(N){return N?w:p})(d)}function f(d,p){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var w=g(p);if(w&&w.has(d))return w.get(d);var N={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var P in d)if(P!=="default"&&Object.prototype.hasOwnProperty.call(d,P)){var T=E?Object.getOwnPropertyDescriptor(d,P):null;T&&(T.get||T.set)?Object.defineProperty(N,P,T):N[P]=d[P]}return N.default=d,w&&w.set(d,N),N}function v(){return v=Object.assign?Object.assign.bind():function(d){for(var p=1;p<arguments.length;p++){var w=arguments[p];for(var N in w)Object.prototype.hasOwnProperty.call(w,N)&&(d[N]=w[N])}return d},v.apply(this,arguments)}function j(d,p,w){return p=k(p),p in d?Object.defineProperty(d,p,{value:w,enumerable:!0,configurable:!0,writable:!0}):d[p]=w,d}function k(d){var p=_(d,"string");return typeof p=="symbol"?p:String(p)}function _(d,p){if(typeof d!="object"||d===null)return d;var w=d[Symbol.toPrimitive];if(w!==void 0){var N=w.call(d,p);if(typeof N!="object")return N;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(d)}class m extends t.Component{static getDerivedStateFromProps(p,w){let{position:N}=p,{prevPropsPosition:E}=w;return N&&(!E||N.x!==E.x||N.y!==E.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:N,prevPropsPosition:E}),{x:N.x,y:N.y,prevPropsPosition:{...N}}):null}constructor(p){super(p),j(this,"onDragStart",(w,N)=>{if((0,u.default)("Draggable: onDragStart: %j",N),this.props.onStart(w,(0,a.createDraggableData)(this,N))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),j(this,"onDrag",(w,N)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",N);const E=(0,a.createDraggableData)(this,N),P={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:H,y:M}=P;P.x+=this.state.slackX,P.y+=this.state.slackY;const[Y,V]=(0,a.getBoundPosition)(this,P.x,P.y);P.x=Y,P.y=V,P.slackX=this.state.slackX+(H-P.x),P.slackY=this.state.slackY+(M-P.y),E.x=P.x,E.y=P.y,E.deltaX=P.x-this.state.x,E.deltaY=P.y-this.state.y}if(this.props.onDrag(w,E)===!1)return!1;this.setState(P)}),j(this,"onDragStop",(w,N)=>{if(!this.state.dragging||this.props.onStop(w,(0,a.createDraggableData)(this,N))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",N);const P={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:H,y:M}=this.props.position;P.x=H,P.y=M}this.setState(P)}),this.state={dragging:!1,dragged:!1,x:p.position?p.position.x:p.defaultPosition.x,y:p.position?p.position.y:p.defaultPosition.y,prevPropsPosition:{...p.position},slackX:0,slackY:0,isElementSVG:!1},p.position&&!(p.onDrag||p.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var p,w;return(p=(w=this.props)===null||w===void 0||(w=w.nodeRef)===null||w===void 0?void 0:w.current)!==null&&p!==void 0?p:r.default.findDOMNode(this)}render(){const{axis:p,bounds:w,children:N,defaultPosition:E,defaultClassName:P,defaultClassNameDragging:T,defaultClassNameDragged:H,position:M,positionOffset:Y,scale:V,...Z}=this.props;let ce={},Se=null;const ue=!!!M||this.state.dragging,z=M||E,F={x:(0,a.canDragX)(this)&&ue?this.state.x:z.x,y:(0,a.canDragY)(this)&&ue?this.state.y:z.y};this.state.isElementSVG?Se=(0,o.createSVGTransform)(F,Y):ce=(0,o.createCSSTransform)(F,Y);const W=(0,s.default)(N.props.className||"",P,{[T]:this.state.dragging,[H]:this.state.dragged});return t.createElement(c.default,v({},Z,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(N),{className:W,style:{...N.props.style,...ce},transform:Se}))}}e.default=m,j(m,"displayName","Draggable"),j(m,"propTypes",{...c.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),j(m,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(rp);const{default:mp,DraggableCore:Lg}=rp;Vo.exports=mp;Vo.exports.default=mp;Vo.exports.DraggableCore=Lg;var Ig=Vo.exports;const Fg=Uc(Ig);var xe=function(){return xe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},xe.apply(this,arguments)},Ac={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Oc={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},$s={width:"20px",height:"20px",position:"absolute",zIndex:1},Wg={top:xe(xe({},Ac),{top:"-5px"}),right:xe(xe({},Oc),{left:void 0,right:"-5px"}),bottom:xe(xe({},Ac),{top:void 0,bottom:"-5px"}),left:xe(xe({},Oc),{left:"-5px"}),topRight:xe(xe({},$s),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:xe(xe({},$s),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:xe(xe({},$s),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:xe(xe({},$s),{left:"-10px",top:"-10px",cursor:"nw-resize"})},$g=y.memo(function(e){var t=e.onResizeStart,n=e.direction,r=e.children,s=e.replaceStyles,o=e.className,a=y.useCallback(function(u){t(u,n)},[t,n]),l=y.useCallback(function(u){t(u,n)},[t,n]),c=y.useMemo(function(){return xe(xe({position:"absolute",userSelect:"none"},Wg[n]),s??{})},[s,n]);return i.jsx("div",{className:o||void 0,style:c,onMouseDown:a,onTouchStart:l,children:r})}),Ug=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(r[o]=s[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lt=function(){return Lt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},Lt.apply(this,arguments)},Bg={width:"auto",height:"auto"},Us=function(e,t,n){return Math.max(Math.min(e,n),t)},Mc=function(e,t,n){var r=Math.round(e/t);return r*t+n*(r-1)},Kn=function(e,t){return new RegExp(e,"i").test(t)},Bs=function(e){return!!(e.touches&&e.touches.length)},Hg=function(e){return!!((e.clientX||e.clientX===0)&&(e.clientY||e.clientY===0))},Lc=function(e,t,n){n===void 0&&(n=0);var r=t.reduce(function(o,a,l){return Math.abs(a-e)<Math.abs(t[o]-e)?l:o},0),s=Math.abs(t[r]-e);return n===0||s<n?t[r]:e},Ni=function(e){return e=e.toString(),e==="auto"||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:"".concat(e,"px")},Hs=function(e,t,n,r){if(e&&typeof e=="string"){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%")){var s=Number(e.replace("%",""))/100;return t*s}if(e.endsWith("vw")){var s=Number(e.replace("vw",""))/100;return n*s}if(e.endsWith("vh")){var s=Number(e.replace("vh",""))/100;return r*s}}return e},Vg=function(e,t,n,r,s,o,a){return r=Hs(r,e.width,t,n),s=Hs(s,e.height,t,n),o=Hs(o,e.width,t,n),a=Hs(a,e.height,t,n),{maxWidth:typeof r>"u"?void 0:Number(r),maxHeight:typeof s>"u"?void 0:Number(s),minWidth:typeof o>"u"?void 0:Number(o),minHeight:typeof a>"u"?void 0:Number(a)}},Xg=function(e){return Array.isArray(e)?e:[e,e]},Qg=["as","ref","style","className","grid","gridGap","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],Ic="__resizable_base__",Yg=function(e){Ug(t,e);function t(n){var r,s,o,a,l=e.call(this,n)||this;return l.ratio=1,l.resizable=null,l.parentLeft=0,l.parentTop=0,l.resizableLeft=0,l.resizableRight=0,l.resizableTop=0,l.resizableBottom=0,l.targetLeft=0,l.targetTop=0,l.delta={width:0,height:0},l.appendBase=function(){if(!l.resizable||!l.window)return null;var c=l.parentNode;if(!c)return null;var u=l.window.document.createElement("div");return u.style.width="100%",u.style.height="100%",u.style.position="absolute",u.style.transform="scale(0, 0)",u.style.left="0",u.style.flex="0 0 100%",u.classList?u.classList.add(Ic):u.className+=Ic,c.appendChild(u),u},l.removeBase=function(c){var u=l.parentNode;u&&u.removeChild(c)},l.state={isResizing:!1,width:(s=(r=l.propsSize)===null||r===void 0?void 0:r.width)!==null&&s!==void 0?s:"auto",height:(a=(o=l.propsSize)===null||o===void 0?void 0:o.height)!==null&&a!==void 0?a:"auto",direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},l.onResizeStart=l.onResizeStart.bind(l),l.onMouseMove=l.onMouseMove.bind(l),l.onMouseUp=l.onMouseUp.bind(l),l}return Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return!this.resizable||!this.resizable.ownerDocument?null:this.resizable.ownerDocument.defaultView},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||Bg},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var n=0,r=0;if(this.resizable&&this.window){var s=this.resizable.offsetWidth,o=this.resizable.offsetHeight,a=this.resizable.style.position;a!=="relative"&&(this.resizable.style.position="relative"),n=this.resizable.style.width!=="auto"?this.resizable.offsetWidth:s,r=this.resizable.style.height!=="auto"?this.resizable.offsetHeight:o,this.resizable.style.position=a}return{width:n,height:r}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var n=this,r=this.props.size,s=function(l){var c;if(typeof n.state[l]>"u"||n.state[l]==="auto")return"auto";if(n.propsSize&&n.propsSize[l]&&(!((c=n.propsSize[l])===null||c===void 0)&&c.toString().endsWith("%"))){if(n.state[l].toString().endsWith("%"))return n.state[l].toString();var u=n.getParentSize(),h=Number(n.state[l].toString().replace("px","")),g=h/u[l]*100;return"".concat(g,"%")}return Ni(n.state[l])},o=r&&typeof r.width<"u"&&!this.state.isResizing?Ni(r.width):s("width"),a=r&&typeof r.height<"u"&&!this.state.isResizing?Ni(r.height):s("height");return{width:o,height:a}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var n=this.appendBase();if(!n)return{width:0,height:0};var r=!1,s=this.parentNode.style.flexWrap;s!=="wrap"&&(r=!0,this.parentNode.style.flexWrap="wrap"),n.style.position="relative",n.style.minWidth="100%",n.style.minHeight="100%";var o={width:n.offsetWidth,height:n.offsetHeight};return r&&(this.parentNode.style.flexWrap=s),this.removeBase(n),o},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(!(!this.resizable||!this.window)){var n=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:n.flexBasis!=="auto"?n.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(n,r){var s=this.propsSize&&this.propsSize[r];return this.state[r]==="auto"&&this.state.original[r]===n&&(typeof s>"u"||s==="auto")?"auto":n},t.prototype.calculateNewMaxFromBoundary=function(n,r){var s=this.props.boundsByDirection,o=this.state.direction,a=s&&Kn("left",o),l=s&&Kn("top",o),c,u;if(this.props.bounds==="parent"){var h=this.parentNode;h&&(c=a?this.resizableRight-this.parentLeft:h.offsetWidth+(this.parentLeft-this.resizableLeft),u=l?this.resizableBottom-this.parentTop:h.offsetHeight+(this.parentTop-this.resizableTop))}else this.props.bounds==="window"?this.window&&(c=a?this.resizableRight:this.window.innerWidth-this.resizableLeft,u=l?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(c=a?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),u=l?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return c&&Number.isFinite(c)&&(n=n&&n<c?n:c),u&&Number.isFinite(u)&&(r=r&&r<u?r:u),{maxWidth:n,maxHeight:r}},t.prototype.calculateNewSizeFromDirection=function(n,r){var s=this.props.scale||1,o=Xg(this.props.resizeRatio||1),a=o[0],l=o[1],c=this.state,u=c.direction,h=c.original,g=this.props,f=g.lockAspectRatio,v=g.lockAspectRatioExtraHeight,j=g.lockAspectRatioExtraWidth,k=h.width,_=h.height,m=v||0,d=j||0;return Kn("right",u)&&(k=h.width+(n-h.x)*a/s,f&&(_=(k-d)/this.ratio+m)),Kn("left",u)&&(k=h.width-(n-h.x)*a/s,f&&(_=(k-d)/this.ratio+m)),Kn("bottom",u)&&(_=h.height+(r-h.y)*l/s,f&&(k=(_-m)*this.ratio+d)),Kn("top",u)&&(_=h.height-(r-h.y)*l/s,f&&(k=(_-m)*this.ratio+d)),{newWidth:k,newHeight:_}},t.prototype.calculateNewSizeFromAspectRatio=function(n,r,s,o){var a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,u=a.lockAspectRatioExtraWidth,h=typeof o.width>"u"?10:o.width,g=typeof s.width>"u"||s.width<0?n:s.width,f=typeof o.height>"u"?10:o.height,v=typeof s.height>"u"||s.height<0?r:s.height,j=c||0,k=u||0;if(l){var _=(f-j)*this.ratio+k,m=(v-j)*this.ratio+k,d=(h-k)/this.ratio+j,p=(g-k)/this.ratio+j,w=Math.max(h,_),N=Math.min(g,m),E=Math.max(f,d),P=Math.min(v,p);n=Us(n,w,N),r=Us(r,E,P)}else n=Us(n,h,g),r=Us(r,f,v);return{newWidth:n,newHeight:r}},t.prototype.setBoundingClientRect=function(){var n=1/(this.props.scale||1);if(this.props.bounds==="parent"){var r=this.parentNode;if(r){var s=r.getBoundingClientRect();this.parentLeft=s.left*n,this.parentTop=s.top*n}}if(this.props.bounds&&typeof this.props.bounds!="string"){var o=this.props.bounds.getBoundingClientRect();this.targetLeft=o.left*n,this.targetTop=o.top*n}if(this.resizable){var a=this.resizable.getBoundingClientRect(),l=a.left,c=a.top,u=a.right,h=a.bottom;this.resizableLeft=l*n,this.resizableRight=u*n,this.resizableTop=c*n,this.resizableBottom=h*n}},t.prototype.onResizeStart=function(n,r){if(!(!this.resizable||!this.window)){var s=0,o=0;if(n.nativeEvent&&Hg(n.nativeEvent)?(s=n.nativeEvent.clientX,o=n.nativeEvent.clientY):n.nativeEvent&&Bs(n.nativeEvent)&&(s=n.nativeEvent.touches[0].clientX,o=n.nativeEvent.touches[0].clientY),this.props.onResizeStart&&this.resizable){var a=this.props.onResizeStart(n,r,this.resizable);if(a===!1)return}this.props.size&&(typeof this.props.size.height<"u"&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),typeof this.props.size.width<"u"&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio=typeof this.props.lockAspectRatio=="number"?this.props.lockAspectRatio:this.size.width/this.size.height;var l,c=this.window.getComputedStyle(this.resizable);if(c.flexBasis!=="auto"){var u=this.parentNode;if(u){var h=this.window.getComputedStyle(u).flexDirection;this.flexDir=h.startsWith("row")?"row":"column",l=c.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var g={original:{x:s,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:Lt(Lt({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(n.target).cursor||"auto"}),direction:r,flexBasis:l};this.setState(g)}},t.prototype.onMouseMove=function(n){var r=this;if(!(!this.state.isResizing||!this.resizable||!this.window)){if(this.window.TouchEvent&&Bs(n))try{n.preventDefault(),n.stopPropagation()}catch{}var s=this.props,o=s.maxWidth,a=s.maxHeight,l=s.minWidth,c=s.minHeight,u=Bs(n)?n.touches[0].clientX:n.clientX,h=Bs(n)?n.touches[0].clientY:n.clientY,g=this.state,f=g.direction,v=g.original,j=g.width,k=g.height,_=this.getParentSize(),m=Vg(_,this.window.innerWidth,this.window.innerHeight,o,a,l,c);o=m.maxWidth,a=m.maxHeight,l=m.minWidth,c=m.minHeight;var d=this.calculateNewSizeFromDirection(u,h),p=d.newHeight,w=d.newWidth,N=this.calculateNewMaxFromBoundary(o,a);this.props.snap&&this.props.snap.x&&(w=Lc(w,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(p=Lc(p,this.props.snap.y,this.props.snapGap));var E=this.calculateNewSizeFromAspectRatio(w,p,{width:N.maxWidth,height:N.maxHeight},{width:l,height:c});if(w=E.newWidth,p=E.newHeight,this.props.grid){var P=Mc(w,this.props.grid[0],this.props.gridGap?this.props.gridGap[0]:0),T=Mc(p,this.props.grid[1],this.props.gridGap?this.props.gridGap[1]:0),H=this.props.snapGap||0,M=H===0||Math.abs(P-w)<=H?P:w,Y=H===0||Math.abs(T-p)<=H?T:p;w=M,p=Y}var V={width:w-v.width,height:p-v.height};if(this.delta=V,j&&typeof j=="string"){if(j.endsWith("%")){var Z=w/_.width*100;w="".concat(Z,"%")}else if(j.endsWith("vw")){var ce=w/this.window.innerWidth*100;w="".concat(ce,"vw")}else if(j.endsWith("vh")){var Se=w/this.window.innerHeight*100;w="".concat(Se,"vh")}}if(k&&typeof k=="string"){if(k.endsWith("%")){var Z=p/_.height*100;p="".concat(Z,"%")}else if(k.endsWith("vw")){var ce=p/this.window.innerWidth*100;p="".concat(ce,"vw")}else if(k.endsWith("vh")){var Se=p/this.window.innerHeight*100;p="".concat(Se,"vh")}}var Q={width:this.createSizeForCssProperty(w,"width"),height:this.createSizeForCssProperty(p,"height")};this.flexDir==="row"?Q.flexBasis=Q.width:this.flexDir==="column"&&(Q.flexBasis=Q.height);var ue=this.state.width!==Q.width,z=this.state.height!==Q.height,F=this.state.flexBasis!==Q.flexBasis,W=ue||z||F;W&&xs.flushSync(function(){r.setState(Q)}),this.props.onResize&&W&&this.props.onResize(n,f,this.resizable,V)}},t.prototype.onMouseUp=function(n){var r,s,o=this.state,a=o.isResizing,l=o.direction;o.original,!(!a||!this.resizable)&&(this.props.onResizeStop&&this.props.onResizeStop(n,l,this.resizable,this.delta),this.props.size&&this.setState({width:(r=this.props.size.width)!==null&&r!==void 0?r:"auto",height:(s=this.props.size.height)!==null&&s!==void 0?s:"auto"}),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:Lt(Lt({},this.state.backgroundStyle),{cursor:"auto"})}))},t.prototype.updateSize=function(n){var r,s;this.setState({width:(r=n.width)!==null&&r!==void 0?r:"auto",height:(s=n.height)!==null&&s!==void 0?s:"auto"})},t.prototype.renderResizer=function(){var n=this,r=this.props,s=r.enable,o=r.handleStyles,a=r.handleClasses,l=r.handleWrapperStyle,c=r.handleWrapperClass,u=r.handleComponent;if(!s)return null;var h=Object.keys(s).map(function(g){return s[g]!==!1?i.jsx($g,{direction:g,onResizeStart:n.onResizeStart,replaceStyles:o&&o[g],className:a&&a[g],children:u&&u[g]?u[g]:null},g):null});return i.jsx("div",{className:c,style:l,children:h})},t.prototype.render=function(){var n=this,r=Object.keys(this.props).reduce(function(a,l){return Qg.indexOf(l)!==-1||(a[l]=n.props[l]),a},{}),s=Lt(Lt(Lt({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(s.flexBasis=this.state.flexBasis);var o=this.props.as||"div";return i.jsxs(o,Lt({style:s,className:this.props.className},r,{ref:function(a){a&&(n.resizable=a)},children:[this.state.isResizing&&i.jsx("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer()]}))},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],gridGap:[0,0],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(y.PureComponent);/*! *****************************************************************************
|
|
43
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
44
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
45
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
46
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
47
|
-
|
|
48
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
49
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
50
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
51
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
52
|
-
|
|
53
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
54
|
-
and limitations under the License.
|
|
55
|
-
***************************************************************************** */var ya=function(e,t){return ya=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)r.hasOwnProperty(s)&&(n[s]=r[s])},ya(e,t)};function Kg(e,t){ya(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ne=function(){return Ne=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Ne.apply(this,arguments)};function Gg(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}var Jg={width:"auto",height:"auto",display:"inline-block",position:"absolute",top:0,left:0},Zg=function(e){return{bottom:e,bottomLeft:e,bottomRight:e,left:e,right:e,top:e,topLeft:e,topRight:e}},qg=function(e){Kg(t,e);function t(n){var r=e.call(this,n)||this;return r.resizingPosition={x:0,y:0},r.offsetFromParent={left:0,top:0},r.resizableElement={current:null},r.originalPosition={x:0,y:0},r.state={resizing:!1,bounds:{top:0,right:0,bottom:0,left:0},maxWidth:n.maxWidth,maxHeight:n.maxHeight},r.onResizeStart=r.onResizeStart.bind(r),r.onResize=r.onResize.bind(r),r.onResizeStop=r.onResizeStop.bind(r),r.onDragStart=r.onDragStart.bind(r),r.onDrag=r.onDrag.bind(r),r.onDragStop=r.onDragStop.bind(r),r.getMaxSizesFromProps=r.getMaxSizesFromProps.bind(r),r}return t.prototype.componentDidMount=function(){this.updateOffsetFromParent();var n=this.offsetFromParent,r=n.left,s=n.top,o=this.getDraggablePosition(),a=o.x,l=o.y;this.draggable.setState({x:a-r,y:l-s}),this.forceUpdate()},t.prototype.getDraggablePosition=function(){var n=this.draggable.state,r=n.x,s=n.y;return{x:r,y:s}},t.prototype.getParent=function(){return this.resizable&&this.resizable.parentNode},t.prototype.getParentSize=function(){return this.resizable.getParentSize()},t.prototype.getMaxSizesFromProps=function(){var n=typeof this.props.maxWidth>"u"?Number.MAX_SAFE_INTEGER:this.props.maxWidth,r=typeof this.props.maxHeight>"u"?Number.MAX_SAFE_INTEGER:this.props.maxHeight;return{maxWidth:n,maxHeight:r}},t.prototype.getSelfElement=function(){return this.resizable&&this.resizable.resizable},t.prototype.getOffsetHeight=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerHeight/r;case"body":return document.body.offsetHeight/r;default:return n.offsetHeight}},t.prototype.getOffsetWidth=function(n){var r=this.props.scale;switch(this.props.bounds){case"window":return window.innerWidth/r;case"body":return document.body.offsetWidth/r;default:return n.offsetWidth}},t.prototype.onDragStart=function(n,r){this.props.onDragStart&&this.props.onDragStart(n,r);var s=this.getDraggablePosition();if(this.originalPosition=s,!!this.props.bounds){var o=this.getParent(),a=this.props.scale,l;if(this.props.bounds==="parent")l=o;else if(this.props.bounds==="body"){var c=o.getBoundingClientRect(),u=c.left,h=c.top,g=document.body.getBoundingClientRect(),f=-(u-o.offsetLeft*a-g.left)/a,v=-(h-o.offsetTop*a-g.top)/a,j=(document.body.offsetWidth-this.resizable.size.width*a)/a+f,k=(document.body.offsetHeight-this.resizable.size.height*a)/a+v;return this.setState({bounds:{top:v,right:j,bottom:k,left:f}})}else if(this.props.bounds==="window"){if(!this.resizable)return;var _=o.getBoundingClientRect(),m=_.left,d=_.top,p=-(m-o.offsetLeft*a)/a,w=-(d-o.offsetTop*a)/a,j=(window.innerWidth-this.resizable.size.width*a)/a+p,k=(window.innerHeight-this.resizable.size.height*a)/a+w;return this.setState({bounds:{top:w,right:j,bottom:k,left:p}})}else typeof this.props.bounds=="string"?l=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(l=this.props.bounds);if(!(!(l instanceof HTMLElement)||!(o instanceof HTMLElement))){var N=l.getBoundingClientRect(),E=N.left,P=N.top,T=o.getBoundingClientRect(),H=T.left,M=T.top,Y=(E-H)/a,V=P-M;if(this.resizable){this.updateOffsetFromParent();var Z=this.offsetFromParent;this.setState({bounds:{top:V-Z.top,right:Y+(l.offsetWidth-this.resizable.size.width)-Z.left/a,bottom:V+(l.offsetHeight-this.resizable.size.height)-Z.top,left:Y-Z.left/a}})}}}},t.prototype.onDrag=function(n,r){if(this.props.onDrag){var s=this.offsetFromParent,o=s.left,a=s.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDrag(n,Ne(Ne({},r),{x:r.x+o,y:r.y+a}));if(this.props.dragAxis==="x")return this.props.onDrag(n,Ne(Ne({},r),{x:r.x+o,y:this.originalPosition.y+a,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDrag(n,Ne(Ne({},r),{x:this.originalPosition.x+o,y:r.y+a,deltaX:0}))}},t.prototype.onDragStop=function(n,r){if(this.props.onDragStop){var s=this.offsetFromParent,o=s.left,a=s.top;if(!this.props.dragAxis||this.props.dragAxis==="both")return this.props.onDragStop(n,Ne(Ne({},r),{x:r.x+o,y:r.y+a}));if(this.props.dragAxis==="x")return this.props.onDragStop(n,Ne(Ne({},r),{x:r.x+o,y:this.originalPosition.y+a,deltaY:0}));if(this.props.dragAxis==="y")return this.props.onDragStop(n,Ne(Ne({},r),{x:this.originalPosition.x+o,y:r.y+a,deltaX:0}))}},t.prototype.onResizeStart=function(n,r,s){n.stopPropagation(),this.setState({resizing:!0});var o=this.props.scale,a=this.offsetFromParent,l=this.getDraggablePosition();if(this.resizingPosition={x:l.x+a.left,y:l.y+a.top},this.originalPosition=l,this.props.bounds){var c=this.getParent(),u=void 0;this.props.bounds==="parent"?u=c:this.props.bounds==="body"?u=document.body:this.props.bounds==="window"?u=window:typeof this.props.bounds=="string"?u=document.querySelector(this.props.bounds):this.props.bounds instanceof HTMLElement&&(u=this.props.bounds);var h=this.getSelfElement();if(h instanceof Element&&(u instanceof HTMLElement||u===window)&&c instanceof HTMLElement){var g=this.getMaxSizesFromProps(),f=g.maxWidth,v=g.maxHeight,j=this.getParentSize();if(f&&typeof f=="string")if(f.endsWith("%")){var k=Number(f.replace("%",""))/100;f=j.width*k}else f.endsWith("px")&&(f=Number(f.replace("px","")));if(v&&typeof v=="string")if(v.endsWith("%")){var k=Number(v.replace("%",""))/100;v=j.height*k}else v.endsWith("px")&&(v=Number(v.replace("px","")));var _=h.getBoundingClientRect(),m=_.left,d=_.top,p=this.props.bounds==="window"?{left:0,top:0}:u.getBoundingClientRect(),w=p.left,N=p.top,E=this.getOffsetWidth(u),P=this.getOffsetHeight(u),T=r.toLowerCase().endsWith("left"),H=r.toLowerCase().endsWith("right"),M=r.startsWith("top"),Y=r.startsWith("bottom");if((T||M)&&this.resizable){var V=(m-w)/o+this.resizable.size.width;this.setState({maxWidth:V>Number(f)?f:V})}if(H||this.props.lockAspectRatio&&!T&&!M){var V=E+(w-m)/o;this.setState({maxWidth:V>Number(f)?f:V})}if((M||T)&&this.resizable){var V=(d-N)/o+this.resizable.size.height;this.setState({maxHeight:V>Number(v)?v:V})}if(Y||this.props.lockAspectRatio&&!M&&!T){var V=P+(N-d)/o;this.setState({maxHeight:V>Number(v)?v:V})}}}else this.setState({maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight});this.props.onResizeStart&&this.props.onResizeStart(n,r,s)},t.prototype.onResize=function(n,r,s,o){var a=this,l={x:this.originalPosition.x,y:this.originalPosition.y},c=-o.width,u=-o.height,h=["top","left","topLeft","bottomLeft","topRight"];h.includes(r)&&(r==="bottomLeft"?l.x+=c:(r==="topRight"||(l.x+=c),l.y+=u));var g=this.draggable.state;(l.x!==g.x||l.y!==g.y)&&xs.flushSync(function(){a.draggable.setState(l)}),this.updateOffsetFromParent();var f=this.offsetFromParent,v=this.getDraggablePosition().x+f.left,j=this.getDraggablePosition().y+f.top;this.resizingPosition={x:v,y:j},this.props.onResize&&this.props.onResize(n,r,s,o,{x:v,y:j})},t.prototype.onResizeStop=function(n,r,s,o){this.setState({resizing:!1});var a=this.getMaxSizesFromProps(),l=a.maxWidth,c=a.maxHeight;this.setState({maxWidth:l,maxHeight:c}),this.props.onResizeStop&&this.props.onResizeStop(n,r,s,o,this.resizingPosition)},t.prototype.updateSize=function(n){this.resizable&&this.resizable.updateSize({width:n.width,height:n.height})},t.prototype.updatePosition=function(n){this.draggable.setState(n)},t.prototype.updateOffsetFromParent=function(){var n=this.props.scale,r=this.getParent(),s=this.getSelfElement();if(!r||s===null)return{top:0,left:0};var o=r.getBoundingClientRect(),a=o.left,l=o.top,c=s.getBoundingClientRect(),u=this.getDraggablePosition(),h=r.scrollLeft,g=r.scrollTop;this.offsetFromParent={left:c.left-a+h-u.x*n,top:c.top-l+g-u.y*n}},t.prototype.render=function(){var n=this,r=this.props,s=r.disableDragging,o=r.style,a=r.dragHandleClassName,l=r.position,c=r.onMouseDown,u=r.onMouseUp,h=r.dragAxis,g=r.dragGrid,f=r.bounds,v=r.enableUserSelectHack,j=r.cancel,k=r.children;r.onResizeStart,r.onResize,r.onResizeStop,r.onDragStart,r.onDrag,r.onDragStop;var _=r.resizeHandleStyles,m=r.resizeHandleClasses,d=r.resizeHandleComponent,p=r.enableResizing,w=r.resizeGrid,N=r.resizeHandleWrapperClass,E=r.resizeHandleWrapperStyle,P=r.scale,T=r.allowAnyClick,H=r.dragPositionOffset,M=Gg(r,["disableDragging","style","dragHandleClassName","position","onMouseDown","onMouseUp","dragAxis","dragGrid","bounds","enableUserSelectHack","cancel","children","onResizeStart","onResize","onResizeStop","onDragStart","onDrag","onDragStop","resizeHandleStyles","resizeHandleClasses","resizeHandleComponent","enableResizing","resizeGrid","resizeHandleWrapperClass","resizeHandleWrapperStyle","scale","allowAnyClick","dragPositionOffset"]),Y=this.props.default?Ne({},this.props.default):void 0;delete M.default;var V=s||a?{cursor:"auto"}:{cursor:"move"},Z=Ne(Ne(Ne({},Jg),V),o),ce=this.offsetFromParent,Se=ce.left,Q=ce.top,ue;l&&(ue={x:l.x-Se,y:l.y-Q});var z=this.state.resizing?void 0:ue,F=this.state.resizing?"both":h;return y.createElement(Fg,{ref:function(W){W&&(n.draggable=W)},handle:a?".".concat(a):void 0,defaultPosition:Y,onMouseDown:c,onMouseUp:u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,axis:F,disabled:s,grid:g,bounds:f?this.state.bounds:void 0,position:z,enableUserSelectHack:v,cancel:j,scale:P,allowAnyClick:T,nodeRef:this.resizableElement,positionOffset:H},y.createElement(Yg,Ne({},M,{ref:function(W){W&&(n.resizable=W,n.resizableElement.current=W.resizable)},defaultSize:Y,size:this.props.size,enable:typeof p=="boolean"?Zg(p):p,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,style:Z,minWidth:this.props.minWidth,minHeight:this.props.minHeight,maxWidth:this.state.resizing?this.state.maxWidth:this.props.maxWidth,maxHeight:this.state.resizing?this.state.maxHeight:this.props.maxHeight,grid:w,handleWrapperClass:N,handleWrapperStyle:E,lockAspectRatio:this.props.lockAspectRatio,lockAspectRatioExtraWidth:this.props.lockAspectRatioExtraWidth,lockAspectRatioExtraHeight:this.props.lockAspectRatioExtraHeight,handleStyles:_,handleClasses:m,handleComponent:d,scale:this.props.scale}),k))},t.defaultProps={maxWidth:Number.MAX_SAFE_INTEGER,maxHeight:Number.MAX_SAFE_INTEGER,scale:1,onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},onDragStart:function(){},onDrag:function(){},onDragStop:function(){}},t}(y.PureComponent);function em(e){const t=e.split("/").filter(Boolean);if(t.length===0)return e;const n=t[t.length-1];return n==="src"&&t.length>1?t[t.length-2]:n}const tm=({projects:e,selectedProject:t,onSelectProject:n,loading:r,runningProcesses:s=[],keyboardFocusedIndex:o=-1,onKeyboardFocusChange:a,gitBranches:l})=>{const[c,u]=y.useState({showName:!0,showDescription:!0,showTags:!0,showRunningIndicator:!0,showPorts:!0,showGitBranch:!0}),h=y.useRef(null);y.useEffect(()=>{g()},[]);const g=async()=>{var f;try{const v=await window.electronAPI.getSettings();(f=v.display)!=null&&f.projectTiles&&u(v.display.projectTiles)}catch(v){console.error("Error loading display settings:",v)}};return r?i.jsx("div",{className:"project-list-loading",children:i.jsx("p",{children:"Loading projects..."})}):e.length===0?i.jsxs("div",{className:"project-list-empty",children:[i.jsx("p",{children:"No projects yet"}),i.jsx("p",{className:"hint",children:"Add a project to get started"})]}):i.jsx("div",{ref:h,className:"project-list",role:"listbox","aria-label":"Projects",tabIndex:0,onFocus:f=>{o<0&&e.length>0&&a&&a(0)},onBlur:f=>{var v;a&&!((v=h.current)!=null&&v.contains(f.relatedTarget))&&a(-1)},children:e.map((f,v)=>{const j=(t==null?void 0:t.id)===f.id,k=o===v,_=s.filter(p=>p.projectPath===f.path),m=_.length>0,d=Array.from(new Set(_.map(p=>p.port).filter(p=>p!=null))).sort((p,w)=>p-w);return i.jsxs("div",{className:`project-item ${j?"selected":""} ${m?"running":""} ${k?"keyboard-focused":""}`,onClick:()=>n(f),role:"option","aria-selected":j,tabIndex:v===0?0:-1,onFocus:p=>{p.currentTarget.scrollIntoView({block:"nearest",behavior:"smooth"}),a&&a(v)},ref:p=>{k&&p&&a&&p.scrollIntoView({block:"nearest",behavior:"smooth"})},children:[i.jsx("div",{className:"project-item-header",children:i.jsxs("h3",{className:"project-name",children:[c.showRunningIndicator&&m&&i.jsx("span",{className:"running-indicator-dot",children:"●"}),c.showName&&f.name,c.showGitBranch&&l&&l.has(f.id)&&l.get(f.id)&&i.jsx("span",{className:"git-branch-badge",children:l.get(f.id)})]})}),c.showDescription&&i.jsx("p",{className:"project-path",children:f.description||em(f.path)}),c.showTags&&f.tags&&f.tags.length>0&&i.jsx("div",{className:"project-tags",children:f.tags.map(p=>i.jsx("span",{className:"project-tag",children:p},p))}),m&&i.jsxs("div",{className:"project-meta",children:[i.jsxs("span",{className:"running-count",children:[_.length," running"]}),c.showPorts&&d.length>0&&i.jsx("div",{className:"running-ports",children:d.map(p=>i.jsxs("span",{className:"port-badge",children:[":",p]},p))})]})]},f.id)})})},nm=({urls:e,onOpenUrl:t})=>e.length===0?null:i.jsxs("div",{className:"project-urls-section",children:[i.jsx("div",{className:"section-header",children:i.jsxs("h3",{children:["Detected URLs (",e.length,")"]})}),i.jsx("div",{className:"urls-list",children:e.map((n,r)=>i.jsxs("div",{className:"url-item",children:[i.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"url-text",onClick:s=>{s.preventDefault(),window.electronAPI.openExternal(n)},children:n}),i.jsx("button",{onClick:()=>t(n),className:"btn btn-secondary btn-small",title:"Open in configured browser",children:"Open"})]},r))})]}),rm=({project:e,workspace:t,onProjectUpdate:n,onRemoveProject:r,onOpenTerminal:s,onNavigateBack:o,onSelectWorkspace:a})=>{var wl,xl,jl,Sl;const[l,c]=y.useState(!1),[u,h]=y.useState(e.name),[g,f]=y.useState(!1),[v,j]=y.useState(e.description||""),[k,_]=y.useState(null),[m,d]=y.useState(!1),[p,w]=y.useState([]),[N,E]=y.useState(!1),[P,T]=y.useState(new Set),[H,M]=y.useState([]),[Y,V]=y.useState(!1),[Z,ce]=y.useState(!1),[Se,Q]=y.useState(""),[ue,z]=y.useState([]),[F,W]=y.useState(e.tags||[]),[G,ne]=y.useState(null),[ae,Ee]=y.useState(null),[wt,_e]=y.useState(!1),[Je,bt]=y.useState("default"),[lt,xt]=y.useState(new Map),[he,jt]=y.useState({scripts_path:null,editor:null}),[Rt,Ze]=y.useState(!1),[He,Bt]=y.useState(""),[rn,sn]=y.useState(!1),[ct,Ht]=y.useState({showStats:!0,showTestResults:!0,showTags:!0,showUrls:!0,showScripts:!0,showJenkins:!1}),[ut,dt]=y.useState([]),[Qn,Tn]=y.useState(!1);y.useEffect(()=>{h(e.name),j(e.description||""),W(e.tags||[]),U(),te(),Ss(),b(),B(),qe(),A(),Dn(),Cr(),R();const S=setInterval(()=>{Ss(),qe()},5e3);return()=>clearInterval(S)},[e]);const Dn=async()=>{var S;try{const O=await window.electronAPI.getSettings();(S=O.display)!=null&&S.projectDetails&&Ht(O.display.projectDetails)}catch(O){console.error("Error loading display settings:",O)}},Cr=async()=>{try{console.log("[ProjectDetails] loadProjectWorkspaces called for project:",e.name),Tn(!0);const S=await C();if(!S){console.warn("[ProjectDetails] No API base URL found, cannot sync workspaces"),dt([]);return}console.log("[ProjectDetails] Starting automatic workspace sync...");try{const J=await fetch(`${S}/workspaces`);if(!J.ok)throw console.warn(`[ProjectDetails] Failed to fetch workspaces for sync: ${J.status}`),new Error(`Failed to fetch workspaces: ${J.status}`);const ge=await J.json();console.log(`[ProjectDetails] Syncing ${ge.length} workspace(s) from files...`);let _n=0,zn=0;for(const ke of ge)try{console.log(`[ProjectDetails] Syncing workspace "${ke.name}" (ID: ${ke.id})...`);const St=await fetch(`${S}/workspaces/${ke.id}/sync-from-file`,{method:"POST"});if(St.ok){const Xt=await St.json();console.log(`[ProjectDetails] ✓ Synced workspace "${ke.name}": added ${Xt.added}, removed ${Xt.removed}`),_n++}else{const Xt=await St.text();console.warn(`[ProjectDetails] ✗ Failed to sync workspace "${ke.name}" (ID: ${ke.id}): ${St.status} - ${Xt}`),zn++}await new Promise(Xt=>setTimeout(Xt,100))}catch(St){zn++,console.error(`[ProjectDetails] ✗ Error syncing workspace "${ke.name}" (ID: ${ke.id}):`,St)}console.log(`[ProjectDetails] Completed syncing: ${_n} succeeded, ${zn} failed out of ${ge.length} workspace(s)`),await new Promise(ke=>setTimeout(ke,300))}catch(J){console.error("[ProjectDetails] Error during workspace sync:",J)}await new Promise(J=>setTimeout(J,200));const O=await fetch(`${S}/workspaces`);if(!O.ok){console.warn(`[ProjectDetails] Failed to fetch workspaces: ${O.status}`),dt([]);return}const $=await O.json();console.log(`[ProjectDetails] Loaded ${$.length} workspace(s) after sync`),console.log("[ProjectDetails] Workspace data:",$.map(J=>({id:J.id,name:J.name,path:J.workspace_file_path})));const se=J=>{if(!J)return"";let ge=J.replace(/\\/g,"/");return ge.length>1&&ge[1]===":"?ge=ge[0]+":"+ge.substring(2).replace(/\/+/g,"/"):ge=ge.replace(/\/+/g,"/"),ge=ge.replace(/\/+$/,""),ge},pt=e.path||"",ye=se(pt);console.log("Checking project workspaces:",{projectName:e.name,projectPath:pt,normalizedProjectPath:ye});const Vt=[];for(const J of $)try{const ge=await fetch(`${S}/workspaces/${J.id}/projects`,{signal:AbortSignal.timeout(2e3)});if(ge.ok){const _n=await ge.json();console.log(`Workspace "${J.name}" (${J.id}) has ${_n.length} projects`),_n.some(ke=>{if(!ke.project_path)return!1;const St=se(ke.project_path),Xt=St===ye;return Xt?console.log(`✓ Found match in workspace "${J.name}":`,{workspacePath:ke.project_path,normalized:St}):console.debug(`Path mismatch in workspace "${J.name}":`,{workspacePath:ke.project_path,normalizedWorkspace:St,projectPath:pt,normalizedProject:ye,lengths:{workspace:St.length,project:ye.length}}),Xt})&&Vt.push(J)}}catch(ge){console.debug(`Error loading projects for workspace ${J.id}:`,ge);continue}console.log(`Found ${Vt.length} workspace(s) for project "${e.name}"`),console.log("[ProjectDetails] Matching workspaces:",Vt.map(J=>({id:J.id,name:J.name,path:J.workspace_file_path,description:J.description}))),dt(Vt)}catch(S){console.error("Error loading project workspaces:",S),dt([])}finally{Tn(!1)}},A=async()=>{try{const S=await C();if(!S)return;const O=await fetch(`${S}/projects/${e.id}/settings`);if(O.ok){const $=await O.json();bt($.script_sort_order||"default")}}catch(S){console.debug("Could not load project settings:",S)}},R=async()=>{try{const S=await C();if(!S)return;const O=await fetch(`${S}/projects/${e.id}/settings`);if(O.ok){const $=await O.json();jt({scripts_path:$.scripts_path||null,editor:$.editor||null}),Bt($.scripts_path||"")}}catch(S){console.debug("Could not load project settings:",S)}},L=async S=>{try{const O=await C();if(!O){console.warn("API server not available, cannot save project settings");return}const $=await fetch(`${O}/projects/${e.id}/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({script_sort_order:S})});if($.ok)bt(S);else{const se=await $.json().catch(()=>({error:"Unknown error"}));console.warn("Failed to save project settings:",se.error)}}catch(O){console.warn("Error saving project settings:",O)}},x=async S=>{try{if(S.scripts_path!==void 0&&S.scripts_path){const se=S.scripts_path.startsWith("/")?S.scripts_path:`${e.path}/${S.scripts_path}`.replace(/\/+/g,"/")}const O=await C();if(!O){alert("API server not available. Please ensure the PROJAX API server is running.");return}const $=await fetch(`${O}/projects/${e.id}/settings`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(S)});if($.ok){if(await R(),S.scripts_path!==void 0){await new Promise(se=>setTimeout(se,300)),d(!0);try{await U()}catch(se){console.error("Error reloading scripts after path change:",se),await new Promise(pt=>setTimeout(pt,500)),await U()}}}else{const se=await $.json().catch(()=>({error:"Unknown error"}));alert(se.error||"Failed to save project settings")}}catch(O){console.error("Error saving project settings:",O),alert(`Failed to save project settings: ${O instanceof Error?O.message:"Unknown error"}`)}},C=async()=>{const S=[38124,38125,38126,38127,38128,3001];for(const O of S)try{if((await fetch(`http://localhost:${O}/health`,{signal:AbortSignal.timeout(500)})).ok)return`http://localhost:${O}/api`}catch{continue}return null},b=async()=>{try{const S=await C();if(!S){z([]);return}const O=await fetch(`${S}/projects/tags`);if(!O.ok){console.error("Failed to load tags:",O.status),z([]);return}const $=await O.json();z(Array.isArray($)?$:[])}catch(S){console.error("Error loading tags:",S),z([])}},B=async()=>{try{const S=await window.electronAPI.getSettings();ne(S.editor)}catch(S){console.error("Error loading editor settings:",S)}},U=async()=>{try{d(!0);const S=await window.electronAPI.getProjectScripts(e.path,e.id);_(S)}catch(S){console.error("Error loading scripts:",S),_(null)}finally{d(!1)}},te=async()=>{try{E(!0);const S=await window.electronAPI.getProjectPorts(e.id);w(S)}catch(S){console.error("Error loading ports:",S),w([])}finally{E(!1)}},qe=async()=>{try{_e(!0);const S=await window.electronAPI.getLatestTestResult(e.id);Ee(S)}catch{Ee(null)}finally{_e(!1)}},Er=async()=>{if(!u.trim()||u===e.name){c(!1),h(e.name);return}try{const S=await window.electronAPI.renameProject(e.id,u.trim());c(!1),n&&n(S)}catch(S){console.error("Error renaming project:",S),alert("Failed to rename project"),h(e.name)}},js=async()=>{const S=v.trim()||null;if(S===(e.description||"")){f(!1),j(e.description||"");return}try{const O=await window.electronAPI.updateProject(e.id,{description:S});f(!1),n&&n(O)}catch(O){console.error("Error updating description:",O),alert("Failed to update description"),j(e.description||"")}},ml=async()=>{const S=Se.trim();if(!S||F.includes(S)){Q("");return}const O=[...F,S];try{const $=await window.electronAPI.updateProject(e.id,{tags:O});W(O),Q(""),n&&n($),await b(),B()}catch($){console.error("Error adding tag:",$),alert("Failed to add tag")}},wp=async S=>{const O=F.filter($=>$!==S);try{const $=await window.electronAPI.updateProject(e.id,{tags:O});W(O),n&&n($),await b(),B()}catch($){console.error("Error removing tag:",$),alert("Failed to remove tag")}},vl=ue.filter(S=>!F.includes(S)&&S.toLowerCase().includes(Se.toLowerCase())),Ss=async()=>{try{V(!0);const O=(await window.electronAPI.getRunningProcesses()).filter(se=>se.projectPath===e.path);M(O);const $=new Set(O.map(se=>se.scriptName));T($)}catch(S){console.error("Error loading running processes:",S)}finally{V(!1)}},xp=async(S,O=!0)=>{try{T($=>new Set($).add(S)),xt($=>new Map($).set(S,Date.now())),await window.electronAPI.runScript(e.path,S,[],O),O&&setTimeout(async()=>{if(await Ss(),s)try{const se=(await window.electronAPI.getRunningProcesses()).find(pt=>pt.projectPath===e.path&&pt.scriptName===S&&Date.now()-pt.startedAt<2e3);se&&s(se.pid,S,e.name)}catch($){console.debug("Error opening terminal after script run:",$)}},1e3)}catch($){console.error("Error running script:",$),alert(`Failed to run script: ${$ instanceof Error?$.message:String($)}`)}finally{T($=>{const se=new Set($);return se.delete(S),se})}},jp=async S=>{try{await window.electronAPI.stopScript(S)?await Ss():alert("Failed to stop script")}catch(O){console.error("Error stopping script:",O),alert(`Failed to stop script: ${O instanceof Error?O.message:String(O)}`)}},Sp=async S=>{try{await window.electronAPI.openUrl(S)}catch(O){console.error("Error opening URL:",O),alert(`Failed to open URL: ${O instanceof Error?O.message:String(O)}`)}},yl=y.useMemo(()=>{const S=new Set;for(const O of H)if(O.detectedUrls&&Array.isArray(O.detectedUrls))for(const $ of O.detectedUrls)S.add($);for(const O of p){const $=`http://localhost:${O.port}`;S.add($)}return Array.from(S).sort()},[H,p]),kp=y.useMemo(()=>{if(!(k!=null&&k.scripts))return[];const S=[...k.scripts];return Je==="alphabetical"?S.sort((O,$)=>O.name.localeCompare($.name)):Je==="last-used"&&S.sort((O,$)=>{const se=lt.get(O.name)||0;return(lt.get($.name)||0)-se}),S},[k==null?void 0:k.scripts,Je,lt]);return e.last_scanned&&new Date(e.last_scanned*1e3).toLocaleString(),i.jsxs("div",{className:"project-details",children:[t&&o&&i.jsxs("div",{className:"breadcrumb",children:[i.jsx("button",{className:"breadcrumb-link",onClick:o,children:t.name}),i.jsx("span",{className:"breadcrumb-separator",children:"/"}),i.jsx("span",{className:"breadcrumb-current",children:e.name})]}),i.jsxs("div",{className:"project-details-header",children:[i.jsxs("div",{children:[l?i.jsx("div",{className:"project-name-edit",children:i.jsx("input",{type:"text",value:u,onChange:S=>h(S.target.value),"aria-label":"Project name",onBlur:Er,onKeyDown:S=>{S.key==="Enter"?Er():S.key==="Escape"&&(c(!1),h(e.name))},className:"project-name-input",autoFocus:!0})}):i.jsx("h2",{onClick:()=>c(!0),className:"project-name-editable",title:"Click to rename",children:e.name}),g?i.jsx("div",{className:"project-description-edit",children:i.jsx("textarea",{value:v,onChange:S=>j(S.target.value),onBlur:js,onKeyDown:S=>{S.key==="Enter"&&(S.metaKey||S.ctrlKey)?js():S.key==="Escape"&&(f(!1),j(e.description||""))},className:"project-description-input",placeholder:"Add a description for this project... (⌘+Enter to save, Esc to cancel)",autoFocus:!0})}):i.jsxs("div",{children:[i.jsx("p",{className:"project-description",onClick:()=>f(!0),title:"Click to edit description",children:e.description||"Click to add a description..."}),i.jsx("p",{className:"project-path",children:e.path})]})]}),i.jsxs("div",{className:"header-actions-group",children:[i.jsx("button",{onClick:async()=>{try{await window.electronAPI.openInEditor(e.path,e.id)}catch(S){console.error("Error opening in editor:",S),alert(`Failed to open in editor: ${S instanceof Error?S.message:String(S)}`)}},className:"btn btn-secondary",title:"Open in editor",children:"Editor"}),i.jsx("button",{onClick:async()=>{try{await window.electronAPI.openInFiles(e.path)}catch(S){console.error("Error opening directory:",S),alert(`Failed to open directory: ${S instanceof Error?S.message:String(S)}`)}},className:"btn btn-secondary",title:"Open in file manager",children:"Files"})]})]}),ct.showStats&&i.jsxs("div",{className:"project-stats",children:[i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:p.length}),i.jsx("div",{className:"stat-label",children:"Ports"})]}),i.jsxs("div",{className:"stat-card",children:[i.jsx("div",{className:"stat-value",children:((wl=k==null?void 0:k.scripts)==null?void 0:wl.length)||0}),i.jsx("div",{className:"stat-label",children:"Scripts"})]})]}),ct.showTestResults&&ae&&i.jsxs("div",{className:"test-results-section",children:[i.jsxs("div",{className:"section-header",children:[i.jsx("h3",{children:"Latest Test Results"}),i.jsx("span",{className:"test-timestamp",children:new Date(ae.timestamp*1e3).toLocaleString()})]}),i.jsxs("div",{className:"test-results-content",children:[i.jsxs("div",{className:"test-stats-grid",children:[i.jsxs("div",{className:"test-stat passed",children:[i.jsx("div",{className:"test-stat-icon",children:"✓"}),i.jsxs("div",{className:"test-stat-info",children:[i.jsx("div",{className:"test-stat-value",children:ae.passed}),i.jsx("div",{className:"test-stat-label",children:"Passed"})]})]}),i.jsxs("div",{className:"test-stat failed",children:[i.jsx("div",{className:"test-stat-icon",children:"✗"}),i.jsxs("div",{className:"test-stat-info",children:[i.jsx("div",{className:"test-stat-value",children:ae.failed}),i.jsx("div",{className:"test-stat-label",children:"Failed"})]})]}),ae.skipped>0&&i.jsxs("div",{className:"test-stat skipped",children:[i.jsx("div",{className:"test-stat-icon",children:"⊘"}),i.jsxs("div",{className:"test-stat-info",children:[i.jsx("div",{className:"test-stat-value",children:ae.skipped}),i.jsx("div",{className:"test-stat-label",children:"Skipped"})]})]}),i.jsxs("div",{className:"test-stat total",children:[i.jsx("div",{className:"test-stat-icon",children:"∑"}),i.jsxs("div",{className:"test-stat-info",children:[i.jsx("div",{className:"test-stat-value",children:ae.total}),i.jsx("div",{className:"test-stat-label",children:"Total"})]})]})]}),i.jsxs("div",{className:"test-meta",children:[ae.framework&&i.jsx("span",{className:"test-framework-badge",children:ae.framework}),ae.duration&&i.jsxs("span",{className:"test-duration",children:["⏱ ",(ae.duration/1e3).toFixed(2),"s"]}),ae.coverage&&i.jsxs("span",{className:"test-coverage",children:["📊 ",ae.coverage.toFixed(1),"% coverage"]}),i.jsxs("span",{className:"test-script-name",children:["Script: ",ae.script_name]})]})]})]}),ct.showTags&&i.jsxs("div",{className:"tags-section",children:[i.jsx("div",{className:"section-header",children:i.jsx("h3",{children:"Tags"})}),i.jsx("div",{className:"tags-content",children:i.jsxs("div",{className:"tags-list",children:[F.map(S=>i.jsxs("span",{className:"tag-item",children:[S,i.jsx("button",{onClick:()=>wp(S),className:"tag-remove",title:"Remove tag",children:"×"})]},S)),Z?i.jsxs("div",{className:"tag-input-wrapper",children:[i.jsx("input",{type:"text",value:Se,onChange:S=>Q(S.target.value),"aria-label":"Add tag",placeholder:"Add tag",onKeyDown:S=>{S.key==="Enter"?ml():S.key==="Escape"&&(ce(!1),Q(""))},onBlur:()=>{ml(),ce(!1)},className:"tag-input",autoFocus:!0}),vl.length>0&&Se&&i.jsx("div",{className:"tag-suggestions",children:vl.slice(0,5).map(S=>i.jsx("div",{className:"tag-suggestion",onMouseDown:O=>{O.preventDefault(),Q(S)},children:S},S))})]}):i.jsx("button",{onClick:()=>ce(!0),className:"tag-add-btn",title:"Add tag",children:"+ Add Tag"})]})})]}),ct.showUrls&&yl.length>0&&i.jsx(nm,{urls:yl,onOpenUrl:Sp}),ct.showScripts&&k&&i.jsxs("div",{className:"scripts-section",children:[i.jsxs("div",{className:"section-header",children:[i.jsxs("h3",{children:["Available Scripts (",k.scripts.length,")"]}),i.jsxs("div",{className:"section-header-right",children:[i.jsx("span",{className:"project-type-badge",children:k.type}),i.jsxs("select",{value:Je,onChange:S=>L(S.target.value),className:"script-sort-select","aria-label":"Script sort order",children:[i.jsx("option",{value:"default",children:"Default"}),i.jsx("option",{value:"alphabetical",children:"Alphabetically"}),i.jsx("option",{value:"last-used",children:"Last Used"})]})]})]}),m?i.jsx("div",{className:"loading-state",children:"Loading scripts..."}):k.scripts.length===0?i.jsx("div",{className:"no-scripts",children:"No scripts found in this project."}):i.jsx("div",{className:"scripts-list",children:kp.map(S=>{const O=H.filter(ye=>ye.scriptName===S.name),$=O.length>0,se=p.filter(ye=>ye.script_name===S.name).map(ye=>ye.port),pt=Array.from(new Set(se)).sort((ye,Vt)=>ye-Vt);return i.jsxs("div",{className:`script-item ${$?"running":""}`,children:[i.jsxs("div",{className:"script-info",children:[i.jsxs("div",{className:"script-header",children:[i.jsx("span",{className:"script-name",children:S.name}),i.jsx("span",{className:"script-command",children:S.command}),i.jsx("span",{className:"script-runner",children:S.runner})]}),$&&i.jsx("div",{className:"script-process-info",children:O.map(ye=>{const Vt=Math.floor((Date.now()-ye.startedAt)/1e3),J=Math.floor(Vt/60),ge=Vt%60,_n=J>0?`${J}m ${ge}s`:`${ge}s`,zn=ye.detectedPorts&&ye.detectedPorts.length>0?ye.detectedPorts:pt;return i.jsxs("div",{className:"process-badge",children:[i.jsx("span",{className:"process-indicator",children:"●"}),i.jsxs("span",{className:"process-pid",children:["PID: ",ye.pid]}),i.jsx("span",{className:"process-uptime",children:_n}),zn.length>0&&i.jsxs("span",{className:"process-port",children:[":",zn.join(", ")]}),i.jsx("button",{onClick:ke=>{ke.stopPropagation(),s&&s(ye.pid,S.name,e.name)},className:"btn btn-secondary btn-tiny",title:"View terminal output",children:i.jsx("span",{className:"terminal-icon",children:"⌘"})}),i.jsx("button",{onClick:ke=>{ke.stopPropagation(),jp(ye.pid)},className:"btn btn-danger btn-tiny",title:"Stop process",children:"Stop"})]},ye.pid)})})]}),i.jsx("div",{className:"script-actions",children:!$&&i.jsx("button",{onClick:()=>xp(S.name,!0),className:"btn btn-secondary btn-small",title:"Run in background",children:"Run"})})]},S.name)})})]}),ct.showJenkins&&i.jsxs("div",{className:"jenkins-placeholder",children:[i.jsx("h3",{children:"Jenkins Integration"}),i.jsx("p",{className:"placeholder-text",children:"Jenkins integration will be available in a future update. This section will display Jenkins job statuses and build information for your projects."})]}),i.jsxs("div",{className:"project-section",children:[i.jsx("h3",{children:"Project Settings"}),i.jsxs("div",{className:"project-settings-content",children:[i.jsxs("div",{className:"setting-group",children:[i.jsx("label",{htmlFor:"scripts-path",children:"Custom Script Scan Path"}),i.jsx("p",{className:"setting-hint",children:'Optional: Relative path from project root where scripts are located. Can be a directory (e.g., "frontend", "packages/app") or a specific file (e.g., "src/package.json"). Leave empty to use project root.'}),Rt?i.jsxs("div",{className:"setting-input-group",children:[i.jsx("input",{id:"scripts-path",type:"text",value:He,onChange:S=>Bt(S.target.value),onBlur:async()=>{await x({scripts_path:He.trim()||null}),Ze(!1)},onKeyDown:S=>{S.key==="Enter"?(x({scripts_path:He.trim()||null}),Ze(!1)):S.key==="Escape"&&(Bt(he.scripts_path||""),Ze(!1))},placeholder:"e.g., frontend, packages/app, src/package.json",className:"setting-input",autoFocus:!0}),i.jsx("button",{type:"button",onClick:async()=>{await x({scripts_path:He.trim()||null}),Ze(!1)},className:"btn btn-secondary btn-small",children:"Save"}),i.jsx("button",{type:"button",onClick:()=>{Bt(he.scripts_path||""),Ze(!1)},className:"btn btn-secondary btn-small",children:"Cancel"})]}):i.jsxs("div",{className:"setting-display",onClick:()=>Ze(!0),children:[i.jsx("span",{className:"setting-value",children:he.scripts_path||"(project root)"}),i.jsx("span",{className:"setting-edit-hint",children:"Click to edit"})]})]}),i.jsxs("div",{className:"setting-group",children:[i.jsx("label",{htmlFor:"project-editor",children:"Editor Override"}),i.jsx("p",{className:"setting-hint",children:'Override the global editor setting for this project only. Leave as "Use Global" to use your default editor.'}),rn?i.jsxs("div",{className:"setting-input-group",children:[i.jsxs("select",{id:"project-editor-type",value:((xl=he.editor)==null?void 0:xl.type)||"global",onChange:S=>{var $;const O=S.target.value==="global"?null:S.target.value;jt({...he,editor:O?{type:O,customPath:O==="custom"?(($=he.editor)==null?void 0:$.customPath)||"":null}:null})},className:"setting-select",children:[i.jsx("option",{value:"global",children:"Use Global"}),i.jsx("option",{value:"vscode",children:"VS Code"}),i.jsx("option",{value:"cursor",children:"Cursor"}),i.jsx("option",{value:"windsurf",children:"Windsurf"}),i.jsx("option",{value:"zed",children:"Zed"}),i.jsx("option",{value:"custom",children:"Custom"})]}),((jl=he.editor)==null?void 0:jl.type)==="custom"&&i.jsx("input",{type:"text",value:he.editor.customPath||"",onChange:S=>{jt({...he,editor:{type:"custom",customPath:S.target.value}})},placeholder:"Custom editor path",className:"setting-input"}),i.jsx("button",{type:"button",onClick:async()=>{await x({editor:he.editor}),sn(!1)},className:"btn btn-secondary btn-small",children:"Save"}),i.jsx("button",{type:"button",onClick:async()=>{await R(),sn(!1)},className:"btn btn-secondary btn-small",children:"Cancel"})]}):i.jsxs("div",{className:"setting-display",onClick:()=>sn(!0),children:[i.jsx("span",{className:"setting-value",children:(Sl=he.editor)!=null&&Sl.type?he.editor.type==="custom"?`Custom: ${he.editor.customPath||"(not set)"}`:he.editor.type.charAt(0).toUpperCase()+he.editor.type.slice(1):"Use Global"}),i.jsx("span",{className:"setting-edit-hint",children:"Click to edit"})]})]})]})]}),i.jsxs("div",{className:"project-section",children:[i.jsxs("h3",{children:["Workspaces (",ut.length,")"]}),Qn?i.jsxs("div",{className:"loading-spinner",children:[i.jsx("div",{className:"spinner"}),i.jsx("p",{children:"Syncing workspaces and loading..."})]}):ut.length===0?i.jsx("div",{className:"empty-state",children:i.jsx("p",{children:"This project is not referenced in any workspaces"})}):i.jsx("div",{className:"workspaces-list",children:ut.map(S=>i.jsxs("div",{className:"workspace-item",onClick:()=>{a&&a(S)},children:[i.jsx("div",{className:"workspace-item-header",children:i.jsx("h4",{className:"workspace-item-name",children:S.name})}),S.description&&i.jsx("p",{className:"workspace-item-description",children:S.description}),i.jsx("p",{className:"workspace-item-path",children:S.workspace_file_path})]},S.id))})]}),r&&i.jsxs("div",{className:"danger-zone",children:[i.jsx("h3",{children:"Danger Zone"}),i.jsx("p",{className:"danger-zone-text",children:"Once you delete a project, there is no going back. Please be certain."}),i.jsx("button",{onClick:async()=>{confirm(`Are you sure you want to remove "${e.name}"?
|
|
56
|
-
|
|
57
|
-
This will delete the project from PROJAX (not from your filesystem).
|
|
58
|
-
|
|
59
|
-
This action cannot be undone.`)&&await r(e.id)},className:"btn btn-danger",title:"Remove project",children:"Delete Project"})]})]})},sm=({onAdd:e,onClose:t})=>{const[n,r]=y.useState(""),[s,o]=y.useState(!1),a=async()=>{try{const c=await window.electronAPI.selectDirectory();c&&r(c)}catch(c){console.error("Error selecting directory:",c)}},l=async c=>{if(c.preventDefault(),!n.trim()){alert("Please select a project directory");return}try{o(!0),await e(n)}catch{}finally{o(!1)}};return i.jsx("div",{className:"modal-overlay",onClick:t,children:i.jsxs("div",{className:"modal-content",onClick:c=>c.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Add Project"}),i.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),i.jsxs("form",{onSubmit:l,children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"project-path",children:"Project Directory"}),i.jsxs("div",{className:"path-input-group",children:[i.jsx("input",{id:"project-path",type:"text",value:n,onChange:c=>r(c.target.value),placeholder:"Select or enter project directory path",disabled:s}),i.jsx("button",{type:"button",onClick:a,disabled:s,className:"btn btn-secondary",children:"Browse"})]})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",onClick:t,disabled:s,className:"btn btn-secondary",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:s||!n.trim(),className:"btn btn-primary",children:s?"Adding...":"Add Project"})]})]})]})})},om=({onSearchChange:e,onSortChange:t,searchInputRef:n})=>{const[r,s]=y.useState(""),[o,a]=y.useState("all"),[l,c]=y.useState("name-asc"),[u,h]=y.useState(!1),g=y.useRef(null),f=y.useRef(null),v=n||f,j=m=>{const d=m.target.value;s(d),e(d,"all")},k=m=>{c(m),h(!1),t&&t(m)};y.useEffect(()=>{const m=d=>{g.current&&!g.current.contains(d.target)&&h(!1)};if(u)return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[u]);const _=[{value:"name-asc",label:"Name (A-Z)"},{value:"name-desc",label:"Name (Z-A)"},{value:"recent",label:"Recently Scanned"},{value:"oldest",label:"Oldest First"},{value:"running",label:"Running First"}];return i.jsx("div",{className:"project-search",children:i.jsxs("div",{className:"search-input-group",ref:g,children:[i.jsxs("div",{className:"search-input-wrapper",children:[i.jsx("input",{ref:v,type:"text",placeholder:"Search projects... (⌘/)",value:r,onChange:j,className:"search-input"}),i.jsx("button",{className:"sort-icon-btn",onClick:()=>h(!u),title:"Sort options",tabIndex:0,children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M3 4h10M3 8h7M3 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),u&&i.jsx("div",{className:"sort-menu",children:_.map(m=>i.jsxs("div",{className:`sort-menu-item ${l===m.value?"active":""}`,onClick:()=>k(m.value),children:[m.label,l===m.value&&i.jsx("span",{className:"checkmark",children:"✓"})]},m.value))})]})})},im=[{id:"appearance",label:"Appearance"},{id:"behavior",label:"Behavior"},{id:"editor",label:"Editor"},{id:"browser",label:"Browser"},{id:"project-display",label:"Project Display"},{id:"workspace-display",label:"Workspace Display"},{id:"mcp",label:"MCP Server"},{id:"advanced",label:"Advanced"},{id:"backup",label:"Backup & Restore"}],am=({activeCategory:e,onCategoryChange:t,onClose:n})=>i.jsxs("div",{className:"settings-sidebar",children:[i.jsxs("div",{className:"settings-sidebar-header",children:[i.jsx("h2",{children:"Settings"}),i.jsx("button",{onClick:n,className:"settings-close-btn",title:"Close (Esc)",children:"×"})]}),i.jsx("nav",{className:"settings-sidebar-nav",children:im.map(r=>i.jsx("button",{className:`settings-nav-item ${e===r.id?"active":""}`,onClick:()=>t(r.id),children:r.label},r.id))})]}),Fc=()=>{const[e,t]=y.useState("normal"),[n,r]=y.useState(13),[s,o]=y.useState(!0),[a,l]=y.useState("projects"),[c,u]=y.useState(!1);y.useEffect(()=>{h()},[]);const h=async()=>{try{const f=await window.electronAPI.getSettings();f.appearance&&(f.appearance.uiDensity&&t(f.appearance.uiDensity),f.appearance.fontSize&&r(f.appearance.fontSize),f.appearance.animations!==void 0&&o(f.appearance.animations),f.appearance.defaultView&&l(f.appearance.defaultView))}catch(f){console.error("Error loading appearance settings:",f)}},g=async f=>{try{u(!0);const v=await window.electronAPI.getSettings(),j={...v,appearance:{...v.appearance||{},...f}};await window.electronAPI.saveSettings(j)}catch(v){console.error("Error saving appearance settings:",v),alert(`Failed to save settings: ${v instanceof Error?v.message:String(v)}`)}finally{u(!1)}};return i.jsxs("div",{className:"settings-category",children:[i.jsxs("div",{className:"settings-category-header",children:[i.jsx("h1",{children:"Appearance"}),i.jsx("p",{className:"settings-category-description",children:"Customize the look and feel of PROJAX"})]}),i.jsxs("div",{className:"settings-category-content",children:[i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"UI Density"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Interface Density"}),i.jsxs("select",{value:e,onChange:f=>{const v=f.target.value;t(v),g({uiDensity:v})},className:"settings-select",disabled:c,children:[i.jsx("option",{value:"compact",children:"Compact"}),i.jsx("option",{value:"normal",children:"Normal"}),i.jsx("option",{value:"comfortable",children:"Comfortable"})]}),i.jsx("p",{className:"settings-hint",children:"Controls spacing and padding throughout the interface"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Font Size"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Base Font Size (px)"}),i.jsx("input",{type:"number",min:"10",max:"18",value:n,onChange:f=>{const v=parseInt(f.target.value,10);!isNaN(v)&&v>=10&&v<=18&&(r(v),g({fontSize:v}))},className:"settings-input",disabled:c}),i.jsx("p",{className:"settings-hint",children:"Base font size for the application (10-18px)"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Animations"}),i.jsxs("div",{className:"settings-field",children:[i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:s,onChange:f=>{o(f.target.checked),g({animations:f.target.checked})},className:"settings-toggle",disabled:c}),i.jsx("span",{children:"Enable animations and transitions"})]}),i.jsx("p",{className:"settings-hint",children:"Smooth transitions and animations throughout the interface"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Navigation"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Default View"}),i.jsxs("select",{value:a,onChange:f=>{const v=f.target.value;l(v),g({defaultView:v})},className:"settings-select",disabled:c,children:[i.jsx("option",{value:"projects",children:"Projects"}),i.jsx("option",{value:"workspaces",children:"Workspaces"})]}),i.jsx("p",{className:"settings-hint",children:"Default tab to show when opening PROJAX"})]})]})]})]})},lm=()=>{const[e,t]=y.useState(!0),[n,r]=y.useState(5e3),[s,o]=y.useState(!1),[a,l]=y.useState(!0),[c,u]=y.useState("default"),[h,g]=y.useState(!1);y.useEffect(()=>{f()},[]);const f=async()=>{try{const j=await window.electronAPI.getSettings();j.behavior&&(j.behavior.autoScanOnAdd!==void 0&&t(j.behavior.autoScanOnAdd),j.behavior.refreshInterval&&r(j.behavior.refreshInterval),j.behavior.autoOpenTerminal!==void 0&&o(j.behavior.autoOpenTerminal),j.behavior.notifications!==void 0&&l(j.behavior.notifications),j.behavior.defaultScriptSortOrder&&u(j.behavior.defaultScriptSortOrder))}catch(j){console.error("Error loading behavior settings:",j)}},v=async j=>{try{g(!0);const k=await window.electronAPI.getSettings(),_={...k,behavior:{...k.behavior||{},...j}};await window.electronAPI.saveSettings(_)}catch(k){console.error("Error saving behavior settings:",k),alert(`Failed to save settings: ${k instanceof Error?k.message:String(k)}`)}finally{g(!1)}};return i.jsxs("div",{className:"settings-category",children:[i.jsxs("div",{className:"settings-category-header",children:[i.jsx("h1",{children:"Behavior"}),i.jsx("p",{className:"settings-category-description",children:"Configure how PROJAX behaves and responds"})]}),i.jsxs("div",{className:"settings-category-content",children:[i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Project Management"}),i.jsxs("div",{className:"settings-field",children:[i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e,onChange:j=>{t(j.target.checked),v({autoScanOnAdd:j.target.checked})},className:"settings-toggle",disabled:h}),i.jsx("span",{children:"Auto-scan on project add"})]}),i.jsx("p",{className:"settings-hint",children:"Automatically scan for scripts and ports when adding a new project"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Refresh & Updates"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Refresh Interval (ms)"}),i.jsx("input",{type:"number",min:"1000",max:"60000",step:"1000",value:n,onChange:j=>{const k=parseInt(j.target.value,10);!isNaN(k)&&k>=1e3&&k<=6e4&&(r(k),v({refreshInterval:k}))},className:"settings-input",disabled:h}),i.jsx("p",{className:"settings-hint",children:"How often to refresh running processes and ports (1000-60000ms)"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Terminal"}),i.jsxs("div",{className:"settings-field",children:[i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:s,onChange:j=>{o(j.target.checked),v({autoOpenTerminal:j.target.checked})},className:"settings-toggle",disabled:h}),i.jsx("span",{children:"Auto-open terminal on script run"})]}),i.jsx("p",{className:"settings-hint",children:"Automatically open terminal view when running a script"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Notifications"}),i.jsxs("div",{className:"settings-field",children:[i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:a,onChange:j=>{l(j.target.checked),v({notifications:j.target.checked})},className:"settings-toggle",disabled:h}),i.jsx("span",{children:"Enable notifications"})]}),i.jsx("p",{className:"settings-hint",children:"Show notifications for important events"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Scripts"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Default Script Sort Order"}),i.jsxs("select",{value:c,onChange:j=>{const k=j.target.value;u(k),v({defaultScriptSortOrder:k})},className:"settings-select",disabled:h,children:[i.jsx("option",{value:"default",children:"Default"}),i.jsx("option",{value:"alphabetical",children:"Alphabetically"}),i.jsx("option",{value:"last-used",children:"Last Used"})]}),i.jsx("p",{className:"settings-hint",children:"Default sorting method for scripts in project details"})]})]})]})]})},cm=()=>{const[e,t]=y.useState("vscode"),[n,r]=y.useState(""),[s,o]=y.useState(!1);y.useEffect(()=>{a()},[]);const a=async()=>{try{const c=await window.electronAPI.getSettings();c.editor&&(t(c.editor.type),r(c.editor.customPath||""))}catch(c){console.error("Error loading editor settings:",c)}},l=async c=>{try{o(!0);const u=await window.electronAPI.getSettings(),h={...u,editor:{...u.editor,...c}};await window.electronAPI.saveSettings(h)}catch(u){console.error("Error saving editor settings:",u),alert(`Failed to save settings: ${u instanceof Error?u.message:String(u)}`)}finally{o(!1)}};return i.jsxs("div",{className:"settings-category",children:[i.jsxs("div",{className:"settings-category-header",children:[i.jsx("h1",{children:"Editor"}),i.jsx("p",{className:"settings-category-description",children:"Configure your preferred code editor"})]}),i.jsx("div",{className:"settings-category-content",children:i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Editor Type"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Editor"}),i.jsxs("select",{value:e,onChange:c=>{const u=c.target.value;t(u),l({type:u,customPath:u==="custom"?n:void 0})},className:"settings-select",disabled:s,children:[i.jsx("option",{value:"vscode",children:"VS Code"}),i.jsx("option",{value:"cursor",children:"Cursor"}),i.jsx("option",{value:"windsurf",children:"Windsurf"}),i.jsx("option",{value:"zed",children:"Zed"}),i.jsx("option",{value:"custom",children:"Custom"})]}),i.jsx("p",{className:"settings-hint",children:"Select your preferred code editor"})]}),e==="custom"&&i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Custom Editor Path"}),i.jsx("input",{type:"text",value:n,onChange:c=>{r(c.target.value),l({customPath:c.target.value})},placeholder:"/path/to/editor",className:"settings-input",disabled:s}),i.jsx("p",{className:"settings-hint",children:"Full path to your custom editor executable"})]})]})})]})},um=()=>{const[e,t]=y.useState("chrome"),[n,r]=y.useState(""),[s,o]=y.useState(!1);y.useEffect(()=>{a()},[]);const a=async()=>{try{const c=await window.electronAPI.getSettings();c.browser&&(t(c.browser.type),r(c.browser.customPath||""))}catch(c){console.error("Error loading browser settings:",c)}},l=async c=>{try{o(!0);const u=await window.electronAPI.getSettings(),h={...u,browser:{...u.browser,...c}};await window.electronAPI.saveSettings(h)}catch(u){console.error("Error saving browser settings:",u),alert(`Failed to save settings: ${u instanceof Error?u.message:String(u)}`)}finally{o(!1)}};return i.jsxs("div",{className:"settings-category",children:[i.jsxs("div",{className:"settings-category-header",children:[i.jsx("h1",{children:"Browser"}),i.jsx("p",{className:"settings-category-description",children:"Configure your preferred web browser"})]}),i.jsx("div",{className:"settings-category-content",children:i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Browser Type"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Browser"}),i.jsxs("select",{value:e,onChange:c=>{const u=c.target.value;t(u),l({type:u,customPath:u==="custom"?n:void 0})},className:"settings-select",disabled:s,children:[i.jsx("option",{value:"chrome",children:"Chrome"}),i.jsx("option",{value:"firefox",children:"Firefox"}),i.jsx("option",{value:"safari",children:"Safari"}),i.jsx("option",{value:"edge",children:"Edge"}),i.jsx("option",{value:"custom",children:"Custom"})]}),i.jsx("p",{className:"settings-hint",children:"Select your preferred web browser"})]}),e==="custom"&&i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Custom Browser Path"}),i.jsx("input",{type:"text",value:n,onChange:c=>{r(c.target.value),l({customPath:c.target.value})},placeholder:"/path/to/browser",className:"settings-input",disabled:s}),i.jsx("p",{className:"settings-hint",children:"Full path to your custom browser executable"})]})]})})]})},dm=()=>{const[e,t]=y.useState({showName:!0,showDescription:!0,showTags:!0,showRunningIndicator:!0,showPorts:!0,showGitBranch:!0}),[n,r]=y.useState({showStats:!0,showTestResults:!0,showTags:!0,showUrls:!0,showScripts:!0,showJenkins:!1}),[s,o]=y.useState(!1);y.useEffect(()=>{a()},[]);const a=async()=>{try{const c=await window.electronAPI.getSettings();c.display&&(c.display.projectTiles&&t(c.display.projectTiles),c.display.projectDetails&&r(c.display.projectDetails))}catch(c){console.error("Error loading project display settings:",c)}},l=async c=>{try{o(!0);const u=await window.electronAPI.getSettings(),h={...u,display:{...u.display,...c}};await window.electronAPI.saveSettings(h)}catch(u){console.error("Error saving project display settings:",u),alert(`Failed to save settings: ${u instanceof Error?u.message:String(u)}`)}finally{o(!1)}};return i.jsxs("div",{className:"settings-category",children:[i.jsxs("div",{className:"settings-category-header",children:[i.jsx("h1",{children:"Project Display"}),i.jsx("p",{className:"settings-category-description",children:"Customize what information is shown in project tiles and details"})]}),i.jsxs("div",{className:"settings-category-content",children:[i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Project Tiles"}),i.jsx("p",{className:"settings-section-description",children:"Control what appears in the project list sidebar"}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showName,onChange:c=>{const u={...e,showName:c.target.checked};t(u),l({projectTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show project name"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showDescription,onChange:c=>{const u={...e,showDescription:c.target.checked};t(u),l({projectTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show description/path"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showTags,onChange:c=>{const u={...e,showTags:c.target.checked};t(u),l({projectTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show tags"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showRunningIndicator,onChange:c=>{const u={...e,showRunningIndicator:c.target.checked};t(u),l({projectTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show running indicator"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showPorts,onChange:c=>{const u={...e,showPorts:c.target.checked};t(u),l({projectTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show ports"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showGitBranch,onChange:c=>{const u={...e,showGitBranch:c.target.checked};t(u),l({projectTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show git branch"})]})})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Project Details"}),i.jsx("p",{className:"settings-section-description",children:"Control what sections appear in the project details view"}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showStats,onChange:c=>{const u={...n,showStats:c.target.checked};r(u),l({projectDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show stats cards (ports, scripts)"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showTestResults,onChange:c=>{const u={...n,showTestResults:c.target.checked};r(u),l({projectDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show test results"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showTags,onChange:c=>{const u={...n,showTags:c.target.checked};r(u),l({projectDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show tags section"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showUrls,onChange:c=>{const u={...n,showUrls:c.target.checked};r(u),l({projectDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show URLs section"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showScripts,onChange:c=>{const u={...n,showScripts:c.target.checked};r(u),l({projectDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show scripts section"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showJenkins,onChange:c=>{const u={...n,showJenkins:c.target.checked};r(u),l({projectDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show Jenkins placeholder"})]})})]})]})]})},pm=()=>{const[e,t]=y.useState({showName:!0,showDescription:!0,showPath:!0,showTags:!0,showProjectCount:!0}),[n,r]=y.useState({showProjectList:!0,showDescription:!0,showPath:!0}),[s,o]=y.useState(!1);y.useEffect(()=>{a()},[]);const a=async()=>{try{const c=await window.electronAPI.getSettings();c.display&&(c.display.workspaceTiles&&t(c.display.workspaceTiles),c.display.workspaceDetails&&r(c.display.workspaceDetails))}catch(c){console.error("Error loading workspace display settings:",c)}},l=async c=>{try{o(!0);const u=await window.electronAPI.getSettings(),h={...u,display:{...u.display,...c}};await window.electronAPI.saveSettings(h)}catch(u){console.error("Error saving workspace display settings:",u),alert(`Failed to save settings: ${u instanceof Error?u.message:String(u)}`)}finally{o(!1)}};return i.jsxs("div",{className:"settings-category",children:[i.jsxs("div",{className:"settings-category-header",children:[i.jsx("h1",{children:"Workspace Display"}),i.jsx("p",{className:"settings-category-description",children:"Customize what information is shown in workspace tiles and details"})]}),i.jsxs("div",{className:"settings-category-content",children:[i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Workspace Tiles"}),i.jsx("p",{className:"settings-section-description",children:"Control what appears in the workspace list sidebar"}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showName,onChange:c=>{const u={...e,showName:c.target.checked};t(u),l({workspaceTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show workspace name"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showDescription,onChange:c=>{const u={...e,showDescription:c.target.checked};t(u),l({workspaceTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show description"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showPath,onChange:c=>{const u={...e,showPath:c.target.checked};t(u),l({workspaceTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show path"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showTags,onChange:c=>{const u={...e,showTags:c.target.checked};t(u),l({workspaceTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show tags"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:e.showProjectCount,onChange:c=>{const u={...e,showProjectCount:c.target.checked};t(u),l({workspaceTiles:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show project count"})]})})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Workspace Details"}),i.jsx("p",{className:"settings-section-description",children:"Control what sections appear in the workspace details view"}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showProjectList,onChange:c=>{const u={...n,showProjectList:c.target.checked};r(u),l({workspaceDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show project list"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showDescription,onChange:c=>{const u={...n,showDescription:c.target.checked};r(u),l({workspaceDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show description"})]})}),i.jsx("div",{className:"settings-field",children:i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:n.showPath,onChange:c=>{const u={...n,showPath:c.target.checked};r(u),l({workspaceDetails:u})},className:"settings-toggle",disabled:s}),i.jsx("span",{children:"Show path"})]})})]})]})]})},fm=()=>{const[e,t]=y.useState(null),[n,r]=y.useState(!0),[s,o]=y.useState(null),[a,l]=y.useState(!1),[c,u]=y.useState(!1);y.useEffect(()=>{h()},[]);const h=async()=>{try{r(!0),o(null);const f=localStorage.getItem("api-port")||"38124",v=await fetch(`http://localhost:${f}/api/mcp/status`);if(!v.ok)throw new Error("Failed to fetch MCP status");const j=await v.json();t(j)}catch(f){o(f instanceof Error?f.message:"Unknown error")}finally{r(!1)}},g=async(f,v)=>{try{await navigator.clipboard.writeText(f),v==="cursor"?(l(!0),setTimeout(()=>l(!1),2e3)):(u(!0),setTimeout(()=>u(!1),2e3))}catch(j){console.error("Failed to copy:",j)}};return n?i.jsxs("div",{className:"settings-category",children:[i.jsx("h2",{children:"MCP Server Configuration"}),i.jsx("div",{className:"settings-section",children:i.jsx("p",{children:"Loading MCP status..."})})]}):s?i.jsxs("div",{className:"settings-category",children:[i.jsx("h2",{children:"MCP Server Configuration"}),i.jsx("div",{className:"settings-section",children:i.jsxs("div",{className:"error-message",children:[i.jsxs("p",{children:["❌ Error: ",s]}),i.jsx("button",{onClick:h,className:"btn-primary",children:"Retry"})]})})]}):e?i.jsxs("div",{className:"settings-category",children:[i.jsx("h2",{children:"MCP Server Configuration"}),i.jsx("p",{className:"settings-description",children:"Configure the Model Context Protocol (MCP) server to provide project context to AI tools like Cursor and VS Code."}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Status"}),i.jsxs("div",{className:"mcp-status",children:[i.jsxs("div",{className:"status-item",children:[i.jsx("span",{className:"status-label",children:"MCP Server:"}),i.jsx("span",{className:`status-value ${e.available?"status-ok":"status-error"}`,children:e.available?"✓ Available":"✗ Not Available"})]}),i.jsxs("div",{className:"status-item",children:[i.jsx("span",{className:"status-label",children:"prx Command:"}),i.jsx("span",{className:`status-value ${e.isPrxAvailable?"status-ok":"status-error"}`,children:e.isPrxAvailable?`✓ ${e.prxPath}`:"✗ Not Found"})]}),i.jsxs("div",{className:"status-item",children:[i.jsx("span",{className:"status-label",children:"MCP Server Built:"}),i.jsx("span",{className:`status-value ${e.isMcpServerBuilt?"status-ok":"status-error"}`,children:e.isMcpServerBuilt?"✓ Yes":"✗ No"})]})]}),!e.available&&i.jsxs("div",{className:"warning-message",children:[i.jsx("p",{children:"⚠️ MCP Server is not fully configured."}),!e.isMcpServerBuilt&&i.jsxs("p",{children:["Please build the MCP server: ",i.jsx("code",{children:"npm run build:mcp-server"})]}),!e.isPrxAvailable&&i.jsxs("p",{children:["Please ensure Projax is installed globally: ",i.jsx("code",{children:"npm install -g projax"})]})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Cursor Configuration"}),i.jsxs("p",{className:"settings-help",children:["Add this configuration to ",i.jsx("code",{children:"~/.cursor/mcp.json"})," or use Cursor Settings → MCP"]}),i.jsxs("div",{className:"config-block",children:[i.jsx("pre",{className:"config-json",children:JSON.stringify(e.cursorConfig,null,2)}),i.jsx("button",{onClick:()=>g(JSON.stringify(e.cursorConfig,null,2),"cursor"),className:"btn-copy",title:"Copy to clipboard",children:a?"✓ Copied!":"📋 Copy"})]}),i.jsx("div",{className:"settings-help",children:i.jsxs("ol",{children:[i.jsx("li",{children:"Open Cursor Settings (Cmd/Ctrl + ,)"}),i.jsx("li",{children:'Search for "MCP" or navigate to Features → Model Context Protocol'}),i.jsxs("li",{children:['Click "Edit Config" or open ',i.jsx("code",{children:"~/.cursor/mcp.json"})]}),i.jsx("li",{children:"Paste the configuration above"}),i.jsx("li",{children:"Restart Cursor"})]})})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"VS Code Configuration"}),i.jsxs("p",{className:"settings-help",children:["Add this configuration to your ",i.jsx("code",{children:"settings.json"})," or use the MCP extension"]}),i.jsxs("div",{className:"config-block",children:[i.jsx("pre",{className:"config-json",children:JSON.stringify(e.vscodeConfig,null,2)}),i.jsx("button",{onClick:()=>g(JSON.stringify(e.vscodeConfig,null,2),"vscode"),className:"btn-copy",title:"Copy to clipboard",children:c?"✓ Copied!":"📋 Copy"})]}),i.jsx("div",{className:"settings-help",children:i.jsxs("ol",{children:[i.jsx("li",{children:"Open VS Code Settings (Cmd/Ctrl + ,)"}),i.jsxs("li",{children:['Search for "MCP" or click the '," icon to edit ",i.jsx("code",{children:"settings.json"})]}),i.jsx("li",{children:"Paste the configuration above"}),i.jsx("li",{children:"Reload VS Code"})]})})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Available Resources"}),i.jsx("p",{className:"settings-help",children:"The MCP server exposes the following resources to AI assistants:"}),i.jsx("ul",{className:"resource-list",children:e.resources.map((f,v)=>i.jsxs("li",{children:[i.jsx("code",{children:f.uri}),i.jsx("p",{children:f.description})]},v))})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"How It Works"}),i.jsxs("div",{className:"settings-help",children:[i.jsx("p",{children:"Once configured, the MCP server automatically provides context to your AI assistant:"}),i.jsxs("ol",{children:[i.jsx("li",{children:"You're working in a directory registered as a Projax project"}),i.jsx("li",{children:"The AI assistant queries the MCP server for context"}),i.jsxs("li",{children:["The server returns information about:",i.jsxs("ul",{children:[i.jsx("li",{children:"Current project details (name, framework, tags)"}),i.jsx("li",{children:"Linked projects in the same workspace"}),i.jsx("li",{children:"Workspace metadata"})]})]}),i.jsx("li",{children:"The AI uses this context for more informed responses"})]}),i.jsxs("p",{children:[i.jsx("strong",{children:"Example:"})," If you're in a frontend project that's part of a workspace with backend and mobile projects, the AI will know about all three projects and can provide context-aware suggestions."]})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"CLI Commands"}),i.jsxs("div",{className:"cli-commands",children:[i.jsxs("div",{className:"cli-command",children:[i.jsx("code",{children:"prx mcp"}),i.jsx("p",{children:"Start the MCP server (used by editors)"})]}),i.jsxs("div",{className:"cli-command",children:[i.jsx("code",{children:"prx mcp-config"}),i.jsx("p",{children:"Display configuration for all editors"})]}),i.jsxs("div",{className:"cli-command",children:[i.jsx("code",{children:"prx mcp-config --cursor"}),i.jsx("p",{children:"Display Cursor-specific configuration"})]}),i.jsxs("div",{className:"cli-command",children:[i.jsx("code",{children:"prx mcp-config --vscode"}),i.jsx("p",{children:"Display VS Code-specific configuration"})]})]})]})]}):null},hm=()=>{const[e,t]=y.useState(null),[n,r]=y.useState(""),[s,o]=y.useState(!1),[a,l]=y.useState(!1);y.useEffect(()=>{c()},[]);const c=async()=>{try{const h=await window.electronAPI.getSettings();h.advanced&&(h.advanced.apiPortOverride!==void 0&&t(h.advanced.apiPortOverride),h.advanced.databaseLocation&&r(h.advanced.databaseLocation),h.advanced.debugMode!==void 0&&o(h.advanced.debugMode))}catch(h){console.error("Error loading advanced settings:",h)}},u=async h=>{try{l(!0);const g=await window.electronAPI.getSettings(),f={...g,advanced:{...g.advanced,...h}};await window.electronAPI.saveSettings(f)}catch(g){console.error("Error saving advanced settings:",g),alert(`Failed to save settings: ${g instanceof Error?g.message:String(g)}`)}finally{l(!1)}};return i.jsxs("div",{className:"settings-category",children:[i.jsxs("div",{className:"settings-category-header",children:[i.jsx("h1",{children:"Advanced"}),i.jsx("p",{className:"settings-category-description",children:"Advanced configuration options"})]}),i.jsxs("div",{className:"settings-category-content",children:[i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"API Configuration"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"API Port Override"}),i.jsx("input",{type:"number",min:"1024",max:"65535",value:e||"",onChange:h=>{const g=h.target.value===""?null:parseInt(h.target.value,10);(g===null||!isNaN(g)&&g>=1024&&g<=65535)&&(t(g),u({apiPortOverride:g}))},placeholder:"Auto-detect",className:"settings-input",disabled:a}),i.jsx("p",{className:"settings-hint",children:"Override API port detection. Leave empty for auto-detect."})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Database"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Database Location"}),i.jsx("input",{type:"text",value:n,onChange:h=>{r(h.target.value),u({databaseLocation:h.target.value})},placeholder:"Default location",className:"settings-input",disabled:a,readOnly:!0}),i.jsx("p",{className:"settings-hint",children:"Database file location (read-only)"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Debug"}),i.jsxs("div",{className:"settings-field",children:[i.jsxs("label",{className:"settings-toggle-label",children:[i.jsx("input",{type:"checkbox",checked:s,onChange:h=>{o(h.target.checked),u({debugMode:h.target.checked})},className:"settings-toggle",disabled:a}),i.jsx("span",{children:"Enable debug mode"})]}),i.jsx("p",{className:"settings-hint",children:"Enable additional logging and debug information"})]})]})]})]})},gm=()=>{const[e,t]=y.useState(!1),[n,r]=y.useState(!1);return i.jsxs("div",{className:"settings-category",children:[i.jsxs("div",{className:"settings-category-header",children:[i.jsx("h1",{children:"Backup & Restore"}),i.jsx("p",{className:"settings-category-description",children:"Backup and restore your PROJAX data"})]}),i.jsxs("div",{className:"settings-category-content",children:[i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Create Backup"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Backup Data"}),i.jsx("p",{className:"settings-hint",children:"Create a backup of all PROJAX data including projects, workspaces, and settings"}),i.jsx("button",{onClick:async()=>{try{t(!0);const s=await window.electronAPI.selectDirectory();if(s){const o=await window.electronAPI.createBackup(s);alert(`Backup created successfully!
|
|
60
|
-
${o.backup_path}`)}}catch(s){alert(`Failed to create backup: ${s instanceof Error?s.message:String(s)}`)}finally{t(!1)}},disabled:e,className:"btn btn-secondary",children:e?"Creating...":"Create Backup"})]})]}),i.jsxs("div",{className:"settings-section",children:[i.jsx("h3",{children:"Restore from Backup"}),i.jsxs("div",{className:"settings-field",children:[i.jsx("label",{children:"Restore Data"}),i.jsx("p",{className:"settings-hint",children:"Restore PROJAX data from a backup file. This will overwrite your current data."}),i.jsx("button",{onClick:async()=>{if(confirm("This will overwrite your current PROJAX data. Continue?"))try{r(!0);const s=await window.electronAPI.selectFile({filters:[{name:"PROJAX Backup",extensions:["pbz"]}]});s&&(await window.electronAPI.restoreBackup(s),alert("Backup restored successfully! The app will refresh."),window.location.reload())}catch(s){alert(`Failed to restore backup: ${s instanceof Error?s.message:String(s)}`)}finally{r(!1)}},disabled:n,className:"btn btn-danger",children:n?"Restoring...":"Restore from Backup"})]})]})]})]})},mm=({onClose:e})=>{const[t,n]=y.useState("appearance"),[r,s]=y.useState(!0);y.useEffect(()=>{const a=l=>{l.key==="Escape"&&e()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),y.useEffect(()=>{const a=setTimeout(()=>s(!1),100);return()=>clearTimeout(a)},[]);const o=()=>{switch(t){case"appearance":return i.jsx(Fc,{});case"behavior":return i.jsx(lm,{});case"editor":return i.jsx(cm,{});case"browser":return i.jsx(um,{});case"project-display":return i.jsx(dm,{});case"workspace-display":return i.jsx(pm,{});case"mcp":return i.jsx(fm,{});case"advanced":return i.jsx(hm,{});case"backup":return i.jsx(gm,{});default:return i.jsx(Fc,{})}};return r?i.jsx("div",{className:"settings-panel",children:i.jsx("div",{className:"settings-panel-loading",children:"Loading settings..."})}):i.jsxs("div",{className:"settings-panel",children:[i.jsx(am,{activeCategory:t,onCategoryChange:n,onClose:e}),i.jsx("div",{className:"settings-panel-content",children:o()})]})},vm=({children:e,tabBar:t})=>i.jsxs("div",{className:"app-header",children:[i.jsx("div",{className:"header-left",children:t&&i.jsx("div",{className:"header-tabs",children:t})}),e]}),ym=({apiPort:e})=>{const[t,n]=y.useState(!1),[r,s]=y.useState(e||null),[o,a]=y.useState("...");return y.useEffect(()=>{(async()=>{try{const g=await window.electronAPI.getAppVersion();a(g)}catch(g){console.error("Failed to get app version:",g),a("3.3.24")}})();const c=async()=>{if(r)u(r);else try{const g=[38124,38125,38126,38127,38128];for(const f of g)try{if((await fetch(`http://localhost:${f}/health`)).ok){s(f),u(f);return}}catch{}}catch(g){console.error("Failed to detect API port:",g)}},u=async g=>{try{const f=await fetch(`http://localhost:${g}/health`);n(f.ok)}catch{n(!1)}};c();const h=setInterval(()=>{r&&u(r)},5e3);return()=>clearInterval(h)},[r]),i.jsx("div",{className:"status-bar",children:i.jsxs("div",{className:"status-bar-content",children:[i.jsxs("div",{className:"status-left",children:[i.jsx("div",{className:"status-logo",children:"PROJAX"}),i.jsxs("div",{className:"status-version",children:["v",o]})]}),i.jsxs("div",{className:"status-right",children:[i.jsxs("div",{className:"status-indicator",children:[i.jsx("span",{className:`status-dot ${t?"connected":"disconnected"}`}),i.jsx("span",{className:"status-text",children:t?"API Connected":"API Disconnected"})]}),r&&i.jsxs("div",{className:"api-port",children:["Port: ",r]})]})]})})},wm=({pid:e,scriptName:t,projectName:n,onClose:r,onProjectClick:s})=>{const[o,a]=y.useState([]),[l,c]=y.useState(!1),u=y.useRef(null),[h,g]=y.useState(!0);y.useEffect(()=>{const k=_=>{_.key==="Escape"&&r()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[r]),y.useEffect(()=>{(async()=>{try{await window.electronAPI.watchProcessOutput(e),c(!0)}catch(d){console.error("Failed to start watching process:",d),a(p=>[...p,`Error: Failed to connect to process ${e}`])}})();const _=(d,p)=>{p.pid===e&&a(w=>[...w,p.data])},m=(d,p)=>{p.pid===e&&(a(w=>[...w,`
|
|
61
|
-
[Process exited with code ${p.code}]`]),c(!1))};return window.electronAPI.onProcessOutput(_),window.electronAPI.onProcessExit(m),()=>{window.electronAPI.unwatchProcessOutput(e),window.electronAPI.removeProcessOutputListener(_),window.electronAPI.removeProcessExitListener(m)}},[e]),y.useEffect(()=>{h&&u.current&&(u.current.scrollTop=u.current.scrollHeight)},[o,h]);const f=()=>{if(u.current){const{scrollTop:k,scrollHeight:_,clientHeight:m}=u.current,d=_-k-m<50;g(d)}},v=()=>{a([])},j=()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight,g(!0))};return i.jsxs("div",{className:"terminal-sidebar",children:[i.jsxs("div",{className:"terminal-header",children:[i.jsxs("div",{className:"terminal-title-row",children:[i.jsxs("div",{className:"terminal-title-content",children:[i.jsx("span",{className:`terminal-status-indicator ${l?"running":"stopped"}`,children:l?"●":"○"}),i.jsxs("div",{className:"terminal-info",children:[i.jsx("span",{className:"terminal-script",children:t}),s?i.jsx("button",{type:"button",className:"terminal-project terminal-project-link",onClick:s,title:"Click to view project",children:n}):i.jsx("span",{className:"terminal-project",children:n})]})]}),i.jsxs("div",{className:"terminal-meta",children:[i.jsx("span",{className:`terminal-status-badge ${l?"running":"stopped"}`,children:l?"Running":"Stopped"}),i.jsxs("span",{className:"terminal-pid",children:["PID: ",e]})]})]}),i.jsxs("div",{className:"terminal-toolbar",children:[i.jsx("button",{onClick:v,className:"btn btn-secondary btn-tiny",title:"Clear output",children:"Clear"}),!h&&i.jsx("button",{onClick:j,className:"btn btn-secondary btn-tiny",title:"Scroll to bottom",children:"↓ Bottom"}),i.jsx("button",{onClick:r,className:"btn btn-danger btn-tiny",title:"Close terminal",children:"Close"})]})]}),i.jsx("div",{ref:u,className:"terminal-output",onScroll:f,children:o.length===0?i.jsxs("div",{className:"terminal-empty",children:[i.jsx("div",{className:"terminal-empty-icon",children:"⌘"}),i.jsx("div",{className:"terminal-empty-text",children:"Waiting for output..."}),i.jsxs("div",{className:"terminal-empty-hint",children:["Process PID ",e]})]}):o.map((k,_)=>i.jsx("div",{className:"terminal-line",children:k},_))})]})},xm=({activeTab:e,onTabChange:t,showSettings:n=!1,onCloseSettings:r})=>{const s=o=>{t(o),n&&r&&r()};return i.jsxs("div",{className:"tab-bar",children:[i.jsx("button",{className:`tab-button ${e==="projects"&&!n?"active":""}`,onClick:()=>s("projects"),children:"Projects"}),i.jsx("button",{className:`tab-button ${e==="workspaces"&&!n?"active":""}`,onClick:()=>s("workspaces"),children:"Workspaces"})]})};function jm(e){const t=e.split("/").filter(Boolean);return t.length===0?e:t[t.length-1]}const Sm=({workspaces:e,selectedWorkspace:t,onSelectWorkspace:n,loading:r,keyboardFocusedIndex:s=-1,onKeyboardFocusChange:o,workspaceProjects:a})=>{const[l,c]=y.useState({showName:!0,showDescription:!0,showPath:!0,showTags:!0,showProjectCount:!0}),u=y.useRef(null);y.useEffect(()=>{h()},[]);const h=async()=>{var g;try{const f=await window.electronAPI.getSettings();(g=f.display)!=null&&g.workspaceTiles&&c(f.display.workspaceTiles)}catch(f){console.error("Error loading display settings:",f)}};return r?i.jsx("div",{className:"workspace-list-loading",children:i.jsx("p",{children:"Loading workspaces..."})}):e.length===0?i.jsxs("div",{className:"workspace-list-empty",children:[i.jsx("p",{children:"No workspaces yet"}),i.jsx("p",{className:"hint",children:"Add a workspace to get started"})]}):i.jsx("div",{ref:u,className:"workspace-list",role:"listbox","aria-label":"Workspaces",tabIndex:0,onFocus:g=>{s<0&&e.length>0&&o&&o(0)},onBlur:g=>{var f;o&&!((f=u.current)!=null&&f.contains(g.relatedTarget))&&o(-1)},children:e.map((g,f)=>{const v=(t==null?void 0:t.id)===g.id,j=s===f,k=(a==null?void 0:a.get(g.id))||0;return i.jsxs("div",{className:`workspace-item ${v?"selected":""} ${j?"keyboard-focused":""}`,onClick:()=>n(g),role:"option","aria-selected":v,tabIndex:f===0?0:-1,onFocus:_=>{_.currentTarget.scrollIntoView({block:"nearest",behavior:"smooth"}),o&&o(f)},ref:_=>{j&&_&&o&&_.scrollIntoView({block:"nearest",behavior:"smooth"})},children:[i.jsxs("div",{className:"workspace-item-header",children:[i.jsx("div",{className:"workspace-name-wrapper",children:l.showName&&i.jsx("h3",{className:"workspace-name",children:g.name})}),l.showProjectCount&&i.jsx("span",{className:"workspace-project-count",children:k})]}),l.showDescription&&g.description&&i.jsx("p",{className:"workspace-description",children:g.description}),l.showPath&&i.jsx("p",{className:"workspace-path",children:jm(g.workspace_file_path)}),l.showTags&&g.tags&&g.tags.length>0&&i.jsx("div",{className:"workspace-tags",children:g.tags.map(_=>i.jsx("span",{className:"workspace-tag",children:_},_))})]},g.id)})})},km=({workspace:e,onWorkspaceUpdate:t,onRemoveWorkspace:n,onOpenWorkspace:r,onSelectProject:s})=>{const[o,a]=y.useState(!1),[l,c]=y.useState(""),[u,h]=y.useState(!1),[g,f]=y.useState(""),[v,j]=y.useState(!1),[k,_]=y.useState(""),[m,d]=y.useState([]),[p,w]=y.useState([]),[N,E]=y.useState([]),[P,T]=y.useState([]),[H,M]=y.useState(!1),[Y,V]=y.useState(null),[Z,ce]=y.useState(null),[Se,Q]=y.useState(!1),[ue,z]=y.useState(""),[F,W]=y.useState(!1),[G,ne]=y.useState([]),[ae,Ee]=y.useState(!1),[wt,_e]=y.useState(""),[Je,bt]=y.useState(!1),[lt,xt]=y.useState(null),[he,jt]=y.useState(""),[Rt,Ze]=y.useState(""),[He,Bt]=y.useState({showProjectList:!0,showDescription:!0,showPath:!0});y.useEffect(()=>{e&&(c(e.name),f(e.description||""),w(e.tags||[]),a(!1),h(!1),Ht(),sn(),rn(),ct())},[e==null?void 0:e.id]),y.useEffect(()=>{const x=C=>{const b=C.target;F&&!b.closest(".link-project-dropdown-wrapper")&&W(!1)};if(F)return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[F]);const rn=async()=>{var x;try{const C=await window.electronAPI.getSettings();(x=C.display)!=null&&x.workspaceDetails&&Bt(C.display.workspaceDetails)}catch(C){console.error("Error loading display settings:",C)}},sn=async()=>{try{const x=await fetch("http://localhost:3001/api/projects/tags");if(x.ok){const C=await x.json();d(Array.isArray(C)?C:[])}}catch(x){console.error("Error loading tags:",x)}},ct=async()=>{try{Ee(!0);const x=await ut();if(!x){ne([]);return}const C=await fetch(`${x}/projects`);if(C.ok){const b=await C.json();ne(Array.isArray(b)?b:[])}}catch(x){console.error("Error loading available projects:",x),ne([])}finally{Ee(!1)}},Ht=async()=>{if(e)try{M(!0);const x=[38124,38125,38126,38127,38128,3001];let C="";for(const B of x)try{if((await fetch(`http://localhost:${B}/health`,{signal:AbortSignal.timeout(500)})).ok){C=`http://localhost:${B}/api`;break}}catch{continue}if(!C){M(!1);return}const b=await fetch(`${C}/workspaces/${e.id}/projects`);if(b.ok){const B=await b.json();E(B);const U=await window.electronAPI.getProjects(),te=B.map(qe=>{const Er=U.find(js=>js.path===qe.project_path);return{tracked:!!Er,project:Er,path:qe.project_path}});T(te)}}catch(x){console.error("Error loading workspace projects:",x)}finally{M(!1)}};if(!e)return i.jsx("div",{className:"workspace-details-empty",children:i.jsx("p",{children:"Select a workspace to view details"})});const ut=async()=>{const x=[38124,38125,38126,38127,38128,3001];for(const C of x)try{if((await fetch(`http://localhost:${C}/health`,{signal:AbortSignal.timeout(500)})).ok)return`http://localhost:${C}/api`}catch{continue}return null},dt=async()=>{try{const x=await ut();if(!x)return;const C=await fetch(`${x}/workspaces/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l})});if(C.ok){const b=await C.json();t&&t(b),a(!1)}}catch(x){console.error("Error updating workspace name:",x)}},Qn=async()=>{try{const x=await ut();if(!x)return;const C=await fetch(`${x}/workspaces/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:g})});if(C.ok){const b=await C.json();t&&t(b),h(!1)}}catch(x){console.error("Error updating workspace description:",x)}},Tn=()=>{const x="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let C="";for(let b=0;b<6;b++)C+=x.charAt(Math.floor(Math.random()*x.length));return C},[Dn]=y.useState(Tn()),Cr=()=>{e&&ue===Dn&&(n&&n(e.id),Q(!1),z(""))},A=async x=>{try{V(x);const C=await window.electronAPI.addProject(x);await Ht()}catch(C){console.error("Error adding project to PROJAX:",C),alert(`Failed to add project: ${C instanceof Error?C.message:"Unknown error"}`)}finally{V(null)}},R=async x=>{if(!e)return;const C=Tn();Ze(C),xt(x),bt(!0),jt("")},L=async()=>{if(!e||!lt||he!==Rt)return;let x=null;try{if(ce(lt),x=await ut(),!x){alert("API server not available. Please ensure the PROJAX API server is running.");return}const C=encodeURIComponent(lt),b=await fetch(`${x}/workspaces/${e.id}/projects?project_path=${C}`,{method:"DELETE"});if(!b.ok){let B="Failed to remove project from workspace";try{B=(await b.json()).error||B}catch{B=`${B}: ${b.status} ${b.statusText}`}throw new Error(B)}if(await Ht(),t){const B=await fetch(`${x}/workspaces/${e.id}`).then(U=>U.json());t(B)}bt(!1),xt(null),jt(""),Ze("")}catch(C){console.error("Error removing project from workspace:",C),console.error("Project path:",lt),console.error("API Base URL:",x);const b=C instanceof Error?C.message:"Unknown error";b.includes("API server not found")||b.includes("endpoint not found")||b.includes("Failed to fetch")?alert("API server not available. Please ensure the PROJAX API server is running."):alert(`Failed to remove project: ${b}`)}finally{ce(null)}};return i.jsxs("div",{className:"workspace-details",children:[i.jsxs("div",{className:"workspace-details-header",children:[i.jsxs("div",{children:[o?i.jsx("div",{className:"workspace-name-edit",children:i.jsx("input",{type:"text",value:l,onChange:x=>c(x.target.value),onBlur:dt,onKeyDown:x=>{x.key==="Enter"&&dt(),x.key==="Escape"&&(c(e.name),a(!1))},autoFocus:!0,className:"workspace-name-input","aria-label":"Workspace name",placeholder:"Workspace name"})}):i.jsxs("h2",{className:"workspace-name-editable",onClick:()=>a(!0),title:"Click to rename",children:[e.name," ",i.jsxs("span",{className:"workspace-id",children:["- workspace (#",e.id,")"]})]}),u?i.jsx("div",{className:"workspace-description-edit",children:i.jsx("textarea",{value:g,onChange:x=>f(x.target.value),onBlur:Qn,onKeyDown:x=>{x.key==="Enter"&&(x.metaKey||x.ctrlKey)?Qn():x.key==="Escape"&&(f(e.description||""),h(!1))},autoFocus:!0,className:"workspace-description-input",placeholder:"Add a description for this workspace... (⌘+Enter to save, Esc to cancel)","aria-label":"Workspace description"})}):i.jsxs("div",{children:[He.showDescription&&i.jsx("p",{className:"workspace-description",onClick:()=>h(!0),title:"Click to edit description",children:e.description||"Click to add a description..."}),He.showPath&&i.jsx("p",{className:"workspace-path clickable-path",onClick:async()=>{try{await window.electronAPI.openFilePath(e.workspace_file_path)}catch(x){console.error("Error opening file path:",x)}},title:"Click to reveal in file manager",children:e.workspace_file_path})]})]}),i.jsx("div",{className:"header-actions-group",children:i.jsx("button",{type:"button",onClick:()=>r&&r(e),className:"btn btn-secondary",title:"Open workspace in editor",children:"Editor"})})]}),He.showProjectList&&i.jsxs("div",{className:"workspace-section",children:[i.jsxs("div",{className:"workspace-section-header",children:[i.jsxs("h3",{children:["Workspace Projects (",P.length,")"]}),i.jsxs("div",{className:"link-project-dropdown-wrapper",children:[i.jsx("button",{type:"button",className:"btn btn-secondary btn-small",onClick:()=>{W(!F),F||(ct(),_e(""))},children:"Link Project"}),F&&i.jsxs("div",{className:"link-project-dropdown",children:[i.jsx("div",{className:"dropdown-header",children:"Select a project to link"}),i.jsxs("div",{className:"dropdown-search-wrapper",children:[i.jsx("label",{htmlFor:"project-search-input",className:"sr-only",children:"Search projects"}),i.jsx("input",{id:"project-search-input",type:"text",className:"dropdown-search-input",placeholder:"Search projects...",value:wt,onChange:x=>_e(x.target.value),autoFocus:!0,"aria-label":"Search projects"})]}),i.jsx("div",{className:"dropdown-options",children:ae?i.jsx("div",{className:"dropdown-loading",children:"Loading projects..."}):(()=>{const x=G.filter(C=>!P.some(b=>{var B;return b.tracked&&((B=b.project)==null?void 0:B.id)===C.id})).filter(C=>{if(!wt.trim())return!0;const b=wt.toLowerCase();return C.name.toLowerCase().includes(b)||C.path.toLowerCase().includes(b)||C.description&&C.description.toLowerCase().includes(b)});return G.length===0?i.jsx("div",{className:"dropdown-empty",children:"No projects available"}):x.length===0?i.jsx("div",{className:"dropdown-empty",children:"No projects match your search"}):x.map(C=>i.jsxs("div",{className:"dropdown-option",onClick:async()=>{try{const b=await ut();if(!b||!e)return;const B=await fetch(`${b}/workspaces/${e.id}/projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_path:C.path})});if(B.ok){if(await Ht(),t){const U=await fetch(`${b}/workspaces/${e.id}`).then(te=>te.json());t(U)}W(!1)}else{const U=await B.json();alert(U.error||"Failed to link project to workspace")}}catch(b){console.error("Error linking project to workspace:",b),alert(`Failed to link project: ${b instanceof Error?b.message:"Unknown error"}`)}},children:[i.jsx("div",{className:"dropdown-option-name",children:C.name}),i.jsx("div",{className:"dropdown-option-path",children:C.path})]},C.id))})()}),i.jsx("div",{className:"dropdown-divider"}),i.jsx("div",{className:"dropdown-option dropdown-option-browse",onClick:async()=>{try{const x=await window.electronAPI.selectDirectory();if(x&&e){const C=await ut();if(!C)return;const b=await fetch(`${C}/workspaces/${e.id}/projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_path:x})});if(b.ok){if(await Ht(),t){const B=await fetch(`${C}/workspaces/${e.id}`).then(U=>U.json());t(B)}W(!1)}else{const B=await b.json();alert(B.error||"Failed to add project to workspace")}}}catch(x){console.error("Error adding project to workspace:",x),alert(`Failed to add project: ${x instanceof Error?x.message:"Unknown error"}`)}},children:i.jsx("div",{className:"dropdown-option-name",children:"Browse for folder..."})})]})]})]}),H?i.jsxs("div",{className:"loading-spinner",children:[i.jsx("div",{className:"spinner"}),i.jsx("p",{children:"Loading projects..."})]}):P.length===0?i.jsx("div",{className:"empty-state",children:i.jsx("p",{children:"No projects in this workspace"})}):i.jsx("div",{className:"workspace-projects-list",children:P.map((x,C)=>{const b=U=>{const te=U.split("/").filter(Boolean);if(te.length===0)return U;const qe=te[te.length-1];return qe==="src"&&te.length>1?te[te.length-2]:qe},B=x.tracked&&x.project?x.project.name:x.path.split("/").filter(Boolean).pop()||x.path;return i.jsxs("div",{className:`workspace-project-tile ${x.tracked?"":"untracked"}`,onClick:()=>x.tracked&&x.project&&s&&s(x.project),children:[i.jsx("div",{className:"project-tile-header",children:i.jsxs("h3",{className:"project-tile-name",children:[!x.tracked&&i.jsx("span",{className:"untracked-badge",children:"Not in PROJAX"}),B]})}),i.jsx("p",{className:"project-tile-path clickable-path",onClick:U=>{U.stopPropagation(),U.preventDefault();const te=x.tracked&&x.project?x.project.path:x.path;te&&window.electronAPI.openInFiles(te).catch(qe=>{console.error("Error opening path:",qe)})},onMouseDown:U=>{U.stopPropagation()},title:"Click to open in Finder/Explorer",children:x.tracked&&x.project?x.project.description||b(x.project.path):x.path}),x.tracked&&x.project&&x.project.tags&&x.project.tags.length>0&&i.jsx("div",{className:"project-tile-tags",children:x.project.tags.map(U=>i.jsx("span",{className:"project-tile-tag",children:U},U))}),i.jsxs("div",{className:"project-tile-actions",children:[!x.tracked&&i.jsx("button",{type:"button",className:"btn-add-project",onClick:U=>{U.stopPropagation(),A(x.path)},disabled:Y===x.path||Z===x.path,children:Y===x.path?"Adding...":"Add to PROJAX"}),i.jsx("button",{type:"button",className:"btn-remove-project",onClick:U=>{U.stopPropagation(),R(x.path)},disabled:Z===x.path||Y===x.path,title:"Remove from workspace",children:Z===x.path?"Removing...":"Remove"})]})]},x.tracked?x.project.id:C)})})]}),n&&i.jsxs("div",{className:"danger-zone",children:[i.jsx("h3",{children:"Danger Zone"}),i.jsx("p",{className:"danger-zone-text",children:"Once you delete this workspace, there is no going back. Please be certain."}),i.jsx("button",{type:"button",onClick:()=>Q(!0),className:"btn btn-danger",title:"Delete workspace",children:"Delete Workspace"})]}),Se&&i.jsx("div",{className:"modal-overlay",onClick:()=>{Q(!1),z("")},children:i.jsxs("div",{className:"modal-content",onClick:x=>x.stopPropagation(),children:[i.jsx("h3",{children:"Delete Workspace"}),i.jsxs("p",{className:"modal-warning",children:["This will permanently delete the workspace ",i.jsxs("strong",{children:['"',e.name,'"']})," from PROJAX.",i.jsx("br",{}),i.jsx("br",{}),"The workspace file will ",i.jsx("strong",{children:"not"})," be deleted from your filesystem."]}),i.jsxs("p",{className:"modal-instruction",children:["Type ",i.jsx("code",{className:"confirmation-code",children:Dn})," to confirm:"]}),i.jsx("label",{htmlFor:"delete-confirmation-input",className:"sr-only",children:"Confirmation code"}),i.jsx("input",{id:"delete-confirmation-input",type:"text",value:ue,onChange:x=>z(x.target.value),placeholder:"Enter confirmation code",className:"confirmation-input",autoFocus:!0,"aria-label":"Enter confirmation code to delete workspace"}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",onClick:()=>{Q(!1),z("")},className:"btn btn-secondary",children:"Cancel"}),i.jsx("button",{type:"button",onClick:Cr,className:"btn btn-danger",disabled:ue!==Dn,children:"Delete Workspace"})]})]})}),Je&&i.jsx("div",{className:"modal-overlay",onClick:()=>{bt(!1),jt(""),xt(null),Ze("")},children:i.jsxs("div",{className:"modal-content",onClick:x=>x.stopPropagation(),children:[i.jsx("h3",{children:"Remove Project from Workspace"}),i.jsxs("p",{className:"modal-warning",children:["This will remove the project from the workspace ",i.jsxs("strong",{children:['"',e==null?void 0:e.name,'"']}),".",i.jsx("br",{}),i.jsx("br",{}),"The project will be removed from the workspace file.",lt&&i.jsxs(i.Fragment,{children:[i.jsx("br",{}),i.jsx("br",{}),i.jsx("strong",{children:"Project:"})," ",lt]})]}),i.jsxs("p",{className:"modal-instruction",children:["Type ",i.jsx("code",{className:"confirmation-code",children:Rt})," to confirm:"]}),i.jsx("label",{htmlFor:"remove-confirmation-input",className:"sr-only",children:"Confirmation code"}),i.jsx("input",{id:"remove-confirmation-input",type:"text",value:he,onChange:x=>jt(x.target.value),placeholder:"Enter confirmation code",className:"confirmation-input",autoFocus:!0,"aria-label":"Enter confirmation code to remove project"}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",onClick:()=>{bt(!1),jt(""),xt(null),Ze("")},className:"btn btn-secondary",children:"Cancel"}),i.jsx("button",{type:"button",onClick:L,className:"btn btn-danger",disabled:he!==Rt,children:"Remove Project"})]})]})})]})},Nm=({onAdd:e,onClose:t,existingProjects:n=[]})=>{const[r,s]=y.useState("import"),[o,a]=y.useState(""),[l,c]=y.useState(""),[u,h]=y.useState(""),[g,f]=y.useState([]),[v,j]=y.useState(!1),k=async()=>{try{const d=await window.electronAPI.selectFile({filters:[{name:"Workspace Files",extensions:["code-workspace"]}]});d&&a(d)}catch(d){console.error("Error selecting workspace file:",d)}},_=d=>{f(p=>p.includes(d)?p.filter(w=>w!==d):[...p,d])},m=async d=>{d.preventDefault();try{if(j(!0),r==="import"){if(!o){alert("Please select a workspace file");return}const p=[38124,38125,38126,38127,38128,3001];let w="";for(const P of p)try{if((await fetch(`http://localhost:${P}/health`,{signal:AbortSignal.timeout(500)})).ok){w=`http://localhost:${P}/api`;break}}catch{continue}if(!w)throw new Error("PROJAX API server not found");const N=await fetch(`${w}/workspaces/import`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({workspace_file_path:o})});if(!N.ok){const P=N.headers.get("content-type");if(P&&P.includes("application/json")){const T=await N.json();throw new Error(T.error||"Failed to import workspace")}else{const T=await N.text();throw new Error(`Server returned ${N.status}: ${T.substring(0,100)}`)}}const E=await N.json();await e(E)}else{if(!l){alert("Please provide workspace name");return}const p=[38124,38125,38126,38127,38128,3001];let w="";for(const P of p)try{if((await fetch(`http://localhost:${P}/health`,{signal:AbortSignal.timeout(500)})).ok){w=`http://localhost:${P}/api`;break}}catch{continue}if(!w)throw new Error("PROJAX API server not found");const N=await fetch(`${w}/workspaces/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l,description:u,projects:g})});if(!N.ok){const P=N.headers.get("content-type");if(P&&P.includes("application/json")){const T=await N.json();throw new Error(T.error||"Failed to create workspace")}else{const T=await N.text();throw new Error(`Server returned ${N.status}: ${T.substring(0,100)}`)}}const E=await N.json();await e(E)}}catch(p){alert(p instanceof Error?p.message:"Failed to add workspace")}finally{j(!1)}};return i.jsx("div",{className:"modal-overlay",onClick:t,children:i.jsxs("div",{className:"modal-content workspace-modal",onClick:d=>d.stopPropagation(),children:[i.jsxs("div",{className:"modal-header",children:[i.jsx("h2",{children:"Add Workspace"}),i.jsx("button",{className:"modal-close",onClick:t,children:"×"})]}),i.jsxs("div",{className:"workspace-mode-selector",children:[i.jsx("button",{type:"button",className:`mode-button ${r==="import"?"active":""}`,onClick:()=>s("import"),children:"Import from File"}),i.jsx("button",{type:"button",className:`mode-button ${r==="create"?"active":""}`,onClick:()=>s("create"),children:"Create New"})]}),i.jsxs("form",{onSubmit:m,children:[r==="import"?i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"workspace-file",children:"Workspace File (.code-workspace)"}),i.jsxs("div",{className:"path-input-group",children:[i.jsx("input",{id:"workspace-file",type:"text",value:o,onChange:d=>a(d.target.value),placeholder:"Select workspace file",disabled:v}),i.jsx("button",{type:"button",onClick:k,disabled:v,className:"btn btn-secondary",children:"Browse"})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"workspace-name",children:"Workspace Name *"}),i.jsx("input",{id:"workspace-name",type:"text",value:l,onChange:d=>c(d.target.value),placeholder:"My Workspace",disabled:v,required:!0})]}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{htmlFor:"workspace-description",children:"Description"}),i.jsx("textarea",{id:"workspace-description",value:u,onChange:d=>h(d.target.value),placeholder:"Optional description",disabled:v,rows:3})]}),i.jsx("div",{className:"form-group",children:i.jsx("p",{className:"form-hint",children:"Workspace files are automatically stored in ~/.projax/workspaces/"})}),i.jsxs("div",{className:"form-group",children:[i.jsx("label",{children:"Add Projects"}),i.jsx("div",{className:"projects-selector",children:n.length===0?i.jsx("p",{className:"empty-state",children:"No projects available"}):n.map(d=>i.jsxs("label",{className:"project-checkbox",children:[i.jsx("input",{type:"checkbox",checked:g.includes(d.path),onChange:()=>_(d.path),disabled:v}),i.jsx("span",{children:d.name})]},d.id))})]})]}),i.jsxs("div",{className:"modal-actions",children:[i.jsx("button",{type:"button",onClick:t,disabled:v,className:"btn btn-secondary",children:"Cancel"}),i.jsx("button",{type:"submit",disabled:v,className:"btn btn-primary",children:v?"Adding...":r==="import"?"Import":"Create"})]})]})]})})},Pm=({onSearchChange:e,onSortChange:t})=>{const[n,r]=y.useState(""),[s,o]=y.useState("name-asc"),[a,l]=y.useState(!1),c=y.useRef(null),u=y.useRef(null),h=v=>{const j=v.target.value;r(j),e(j)},g=v=>{o(v),l(!1),t&&t(v)};y.useEffect(()=>{const v=j=>{c.current&&!c.current.contains(j.target)&&l(!1)};if(a)return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[a]);const f=[{value:"name-asc",label:"Name (A-Z)"},{value:"name-desc",label:"Name (Z-A)"},{value:"recent",label:"Recently Created"},{value:"recently-opened",label:"Recently Opened"},{value:"projects",label:"Most Projects"}];return i.jsx("div",{className:"project-search",children:i.jsxs("div",{className:"search-input-group",ref:c,children:[i.jsxs("div",{className:"search-input-wrapper",children:[i.jsx("input",{ref:u,type:"text",placeholder:"Search workspaces...",value:n,onChange:h,className:"search-input"}),i.jsx("button",{type:"button",className:"sort-icon-btn",onClick:()=>l(!a),title:"Sort options",tabIndex:0,children:i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:i.jsx("path",{d:"M3 4h10M3 8h7M3 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),a&&i.jsx("div",{className:"sort-menu",children:f.map(v=>i.jsxs("div",{className:`sort-menu-item ${s===v.value?"active":""}`,onClick:()=>g(v.value),children:[v.label,s===v.value&&i.jsx("span",{className:"checkmark",children:"✓"})]},v.value))})]})})};function Cm(){const[e,t]=y.useState([]),[n,r]=y.useState(null),s=y.useRef(null),[o,a]=y.useState(!0),[l,c]=y.useState(!1),[u,h]=y.useState(""),[g,f]=y.useState("all"),[v,j]=y.useState("name-asc"),[k,_]=y.useState(!1),[m,d]=y.useState([]),[p,w]=y.useState(-1),N=Zc.useRef(null),[E,P]=y.useState(280),[T,H]=y.useState(550),[M,Y]=y.useState(null),[V,Z]=y.useState("projects");y.useEffect(()=>{(async()=>{var R;try{const L=await window.electronAPI.getSettings();(R=L.appearance)!=null&&R.defaultView&&Z(L.appearance.defaultView)}catch(L){console.error("Error loading default view setting:",L)}})()},[]);const[ce,Se]=y.useState([]),[Q,ue]=y.useState(null),[z,F]=y.useState(!0),[W,G]=y.useState(!1),[ne,ae]=y.useState(new Map),[Ee,wt]=y.useState(new Map),[_e,Je]=y.useState(""),[bt,lt]=y.useState("name-asc"),[xt,he]=y.useState(!1),[jt,Rt]=y.useState("Starting API server..."),Ze=async()=>{const A=[38124,38125,38126,38127,38128,3001];for(const R of A)try{if((await fetch(`http://localhost:${R}/health`,{signal:AbortSignal.timeout(500)})).ok)return!0}catch{continue}return!1};y.useEffect(()=>{(async()=>{Rt("Starting API server...");let R=0;const L=30;for(;R<L;){if(await Ze()){Rt("API server ready!"),he(!0),await new Promise(C=>setTimeout(C,300));return}R++,R<L&&(Rt(`Waiting for API server... (${R}/${L})`),await new Promise(C=>setTimeout(C,500)))}Rt("API server not responding. Some features may not work."),he(!0)})()},[]),y.useEffect(()=>{r(null)},[V]),y.useEffect(()=>{if(!xt)return;He(),rn(),Bt();const A=setInterval(()=>{Bt(),sn()},5e3),R=(L,x,...C)=>{switch(x){case"new-project":c(!0);break;case"new-workspace":G(!0);break;case"open-workspace":Z("workspaces");break;case"open-directory-as-project":C[0]&&ct(C[0]);break}};return window.electronAPI.onMenuAction(R),()=>{clearInterval(A),window.electronAPI.removeMenuActionListener(R)}},[xt]),y.useEffect(()=>{if(e.length>0){const A=setTimeout(()=>{sn()},100);return()=>clearTimeout(A)}},[e]),y.useEffect(()=>{n&&s.current&&s.current.scrollTo({top:0,behavior:"smooth"})},[n]);const He=async()=>{try{a(!0);const A=await window.electronAPI.getProjects();t(A),A.length===0&&console.log('No projects found. Use "Add Project" to add one.')}catch(A){console.error("Error loading projects:",A),alert(`Error loading projects: ${A instanceof Error?A.message:String(A)}
|
|
62
|
-
|
|
63
|
-
Check the console for more details.`)}finally{a(!1)}},Bt=async()=>{try{const A=await window.electronAPI.getRunningProcesses();d(A)}catch(A){console.error("Error loading running processes:",A)}},rn=async()=>{try{F(!0);try{const x=[38124,38125,38126,38127,38128,3001];let C="";for(const b of x)try{if((await fetch(`http://localhost:${b}/health`,{signal:AbortSignal.timeout(500)})).ok){C=`http://localhost:${b}/api`;break}}catch{continue}if(C){const b=await fetch(`${C}/workspaces`);if(b.ok){const B=await b.json();for(const U of B)try{await fetch(`${C}/workspaces/${U.id}/sync-from-file`,{method:"POST"})}catch(te){console.debug(`Error syncing workspace ${U.id}:`,te)}}}}catch(x){console.debug("Error syncing workspaces on load:",x)}const A=await window.electronAPI.getWorkspaces();Se(A);const R=[38124,38125,38126,38127,38128,3001];let L="";for(const x of R)try{if((await fetch(`http://localhost:${x}/health`,{signal:AbortSignal.timeout(500)})).ok){L=`http://localhost:${x}/api`;break}}catch{continue}if(L){const x=new Map,C=A.map(async U=>{try{const te=await fetch(`${L}/workspaces/${U.id}/projects`,{signal:AbortSignal.timeout(2e3)});if(te.ok){const qe=await te.json();return{workspaceId:U.id,count:Array.isArray(qe)?qe.length:0}}else return te.status===404?{workspaceId:U.id,count:0}:{workspaceId:U.id,count:0}}catch(te){return te instanceof Error&&!te.name.includes("AbortError")&&!te.message.includes("fetch")&&console.debug(`Error loading projects for workspace ${U.id}:`,te),{workspaceId:U.id,count:0}}}),b=await Promise.all(C),B=new Map;A.forEach(U=>{B.set(U.id,0)}),b.forEach(({workspaceId:U,count:te})=>{B.set(U,te)}),wt(B)}else{const x=new Map;A.forEach(C=>{x.set(C.id,0)}),wt(x)}}catch(A){console.error("Error loading workspaces:",A)}finally{F(!1)}},sn=async()=>{if(e.length!==0)try{const A=new Map,R=[38124,38125,38126,38127,38128,3001];let L="";for(const b of R)try{if((await fetch(`http://localhost:${b}/health`,{signal:AbortSignal.timeout(500)})).ok){L=`http://localhost:${b}/api`;break}}catch{continue}if(!L){console.warn("No API server found for git branches");for(const b of e)A.set(b.id,null);ae(A);return}const x=e.map(async b=>{try{const B=await fetch(`${L}/projects/${b.id}/git-branch`,{signal:AbortSignal.timeout(2e3)});if(B.ok){const U=await B.json();return{projectId:b.id,branch:U.branch}}else return{projectId:b.id,branch:null}}catch(B){return console.warn(`Failed to get git branch for project ${b.id}:`,B),{projectId:b.id,branch:null}}});(await Promise.all(x)).forEach(({projectId:b,branch:B})=>{A.set(b,B)}),ae(A)}catch(A){console.error("Error updating git branches:",A)}},ct=async A=>{try{const R=await window.electronAPI.addProject(A);await He(),c(!1),await window.electronAPI.scanProject(R.id),await He()}catch(R){console.error("Error adding project:",R),alert(R instanceof Error?R.message:"Failed to add project")}},Ht=async A=>{if(confirm("Are you sure you want to remove this project?"))try{await window.electronAPI.removeProject(A),(n==null?void 0:n.id)===A&&r(null),await He()}catch(R){console.error("Error removing project:",R),alert("Failed to remove project")}},ut=(A,R)=>{h(A),f(R)},dt=y.useMemo(()=>{let A=e;if(u.trim()){const L=u.toLowerCase().trim();A=e.filter(x=>{switch(g){case"name":return x.name.toLowerCase().includes(L);case"path":return x.path.toLowerCase().includes(L);case"ports":return!1;case"running":return L==="running"||L==="not running";case"all":default:return x.name.toLowerCase().includes(L)||x.path.toLowerCase().includes(L)||x.tags&&x.tags.some(C=>C.toLowerCase().includes(L))}})}const R=[...A];switch(v){case"name-asc":R.sort((L,x)=>L.name.localeCompare(x.name));break;case"name-desc":R.sort((L,x)=>x.name.localeCompare(L.name));break;case"recent":R.sort((L,x)=>(x.last_scanned||0)-(L.last_scanned||0));break;case"oldest":R.sort((L,x)=>L.created_at-x.created_at);break;case"running":R.sort((L,x)=>{const C=m.filter(B=>B.projectPath===L.path).length;return m.filter(B=>B.projectPath===x.path).length-C});break}return R},[e,u,g,v,m]),Qn=y.useMemo(()=>{let A=ce;if(_e.trim()){const R=_e.toLowerCase().trim();A=ce.filter(L=>L.name.toLowerCase().includes(R)||L.description&&L.description.toLowerCase().includes(R)||L.workspace_file_path.toLowerCase().includes(R))}return A=[...A].sort((R,L)=>{switch(bt){case"name-asc":return R.name.localeCompare(L.name);case"name-desc":return L.name.localeCompare(R.name);case"recent":return(L.id||0)-(R.id||0);case"recently-opened":const x=R.last_opened||0;return(L.last_opened||0)-x;case"projects":const b=Ee.get(R.id)||0;return(Ee.get(L.id)||0)-b;default:return 0}}),A},[ce,_e,bt,Ee]);y.useEffect(()=>{const A=R=>{var B;if((R.metaKey||R.ctrlKey)&&R.key===","){R.preventDefault(),_(!0);return}if((R.metaKey||R.ctrlKey)&&R.key==="/"){R.preventDefault(),(B=N.current)==null||B.focus();return}const L=R.target;if(L.tagName==="INPUT"||L.tagName==="TEXTAREA")return;const x=document.querySelector(".project-list"),C=x&&(x===L||x.contains(L)||L.closest(".project-item")!==null);if(!C&&(R.key==="ArrowDown"||R.key==="ArrowUp"))return;const b=dt;if(R.key==="ArrowDown"&&C){R.preventDefault();const U=p<b.length-1?p+1:b.length>0?0:-1;U>=0&&(w(U),r(b[U]))}else if(R.key==="ArrowUp"&&C){R.preventDefault();const U=p>0?p-1:b.length>0?b.length-1:-1;U>=0&&(w(U),r(b[U]))}else R.key==="Enter"&&p>=0&&p<b.length&&C?(R.preventDefault(),r(b[p])):R.key==="Escape"&&C&&w(-1)};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[p,dt]),y.useEffect(()=>{w(-1)},[dt.length,u]);const Tn=(A,R,L)=>{Y({pid:A,scriptName:R,projectName:L})},Dn=()=>{Y(null)},Cr=()=>{if(M){const A=e.find(R=>R.name===M.projectName);A&&(r(A),Z("projects"))}};return!xt||V==="workspaces"&&z?i.jsx("div",{className:"app",children:i.jsx("div",{className:"api-loading-screen",children:i.jsxs("div",{className:"api-loading-content",children:[i.jsx("div",{className:"spinner-large"}),i.jsx("h2",{children:"PROJAX"}),i.jsx("p",{children:xt?"Loading workspaces...":jt})]})})}):i.jsxs("div",{className:"app",children:[i.jsx(vm,{tabBar:i.jsx(xm,{activeTab:V,onTabChange:Z,showSettings:k,onCloseSettings:()=>_(!1)}),children:i.jsxs("div",{className:"header-actions",children:[i.jsx("button",{type:"button",onClick:()=>_(!0),className:`btn-link settings-button ${k?"active":""}`,title:"Settings",children:"Settings"}),V==="workspaces"&&i.jsx("button",{type:"button",onClick:()=>G(!0),className:"btn-link btn-link-primary",children:"Add Workspace"})]})}),i.jsxs("div",{className:"app-content",children:[!k&&i.jsx(qg,{size:{width:E,height:"100%"},minWidth:200,maxWidth:600,disableDragging:!0,enableResizing:{right:!0},onResizeStop:(A,R,L,x)=>{const C=E+x.width;P(Math.max(200,Math.min(600,C)))},style:{position:"relative",display:"flex",flexDirection:"column"},resizeHandleStyles:{right:{width:"4px",right:"-2px",cursor:"col-resize",backgroundColor:"transparent"}},children:i.jsx("aside",{className:"sidebar",style:{width:"100%",height:"100%"},children:V==="projects"?i.jsxs(i.Fragment,{children:[i.jsx(om,{onSearchChange:ut,onSortChange:j,searchInputRef:N}),i.jsx(tm,{projects:dt,selectedProject:n,onSelectProject:r,loading:o,runningProcesses:m,keyboardFocusedIndex:p,onKeyboardFocusChange:w,gitBranches:ne})]}):i.jsxs(i.Fragment,{children:[i.jsx(Pm,{onSearchChange:Je,onSortChange:lt}),i.jsx(Sm,{workspaces:Qn,selectedWorkspace:Q,onSelectWorkspace:A=>{r(null),setTimeout(()=>{ue(A)},0)},loading:z,keyboardFocusedIndex:p,onKeyboardFocusChange:w,workspaceProjects:Ee})]})})}),i.jsx("main",{className:"main-content",ref:s,children:k?i.jsx(mm,{onClose:()=>_(!1)}):n?i.jsx(rm,{project:n,workspace:V==="workspaces"?Q:void 0,onProjectUpdate:A=>{r(A),He()},onRemoveProject:Ht,onOpenTerminal:Tn,onNavigateBack:V==="workspaces"&&Q?()=>{r(null)}:void 0,onSelectWorkspace:A=>{Z("workspaces"),ue(A),r(null)}}):V==="workspaces"&&Q?i.jsx(km,{workspace:Q,onWorkspaceUpdate:A=>{ue(A),rn()},onRemoveWorkspace:async A=>{try{const R=[38124,38125,38126,38127,38128,3001];let L="";for(const x of R)try{if((await fetch(`http://localhost:${x}/health`,{signal:AbortSignal.timeout(500)})).ok){L=`http://localhost:${x}/api`;break}}catch{continue}L&&await fetch(`${L}/workspaces/${A}`,{method:"DELETE"}),(Q==null?void 0:Q.id)===A&&ue(null),await rn()}catch(R){console.error("Error removing workspace:",R),alert("Failed to remove workspace")}},onOpenWorkspace:async A=>{try{await window.electronAPI.openWorkspace(A.id)}catch(R){console.error("Error opening workspace:",R),alert(`Failed to open workspace: ${R instanceof Error?R.message:"Unknown error"}`)}},onSelectProject:A=>{r(A)}}):i.jsxs("div",{className:"empty-state",children:[i.jsxs("h2",{children:["Select ",V==="projects"?"a project":"a workspace"," to view details"]}),i.jsxs("p",{children:["Choose ",V==="projects"?"a project":"a workspace"," from the sidebar to see its information."]})]})}),M&&i.jsxs("div",{style:{width:`${T}px`,minWidth:"350px",maxWidth:"800px",height:"100%",position:"relative",flexShrink:0,display:"flex",flexDirection:"column"},children:[i.jsx("div",{style:{position:"absolute",left:"-2px",top:0,bottom:0,width:"4px",cursor:"col-resize",zIndex:10},onMouseDown:A=>{A.preventDefault();const R=A.clientX,L=T,x=b=>{const B=R-b.clientX,U=Math.max(350,Math.min(800,L+B));H(U)},C=()=>{document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",C)};document.addEventListener("mousemove",x),document.addEventListener("mouseup",C)}}),i.jsx(wm,{pid:M.pid,scriptName:M.scriptName,projectName:M.projectName,onClose:Dn,onProjectClick:Cr})]})]}),l&&i.jsx(sm,{onAdd:ct,onClose:()=>c(!1)}),W&&i.jsx(Nm,{onAdd:async A=>{await rn(),G(!1),ue(A)},onClose:()=>G(!1),existingProjects:e}),i.jsx(ym,{})]})}const vp=[{id:1,name:"My React App",path:"/Users/dev/my-react-app",description:"A modern React application with TypeScript",tags:["react","typescript","frontend"],framework:"react",last_scanned:Date.now()-864e4,created_at:Date.now()-864e5*30},{id:2,name:"Node API Server",path:"/Users/dev/node-api",description:"RESTful API built with Express",tags:["node","express","backend","api"],framework:"node",last_scanned:Date.now()-864e3,created_at:Date.now()-864e5*60},{id:3,name:"Vue Dashboard",path:"/Users/dev/vue-dashboard",description:"Admin dashboard built with Vue 3",tags:["vue","frontend","dashboard"],framework:"vue",last_scanned:Date.now()-36e5,created_at:Date.now()-864e5*15}],yp=[{id:1,name:"Frontend Projects",description:"All frontend-related projects",tags:["frontend"],created_at:Date.now()-864e5*20},{id:2,name:"Backend Services",description:"API and microservices",tags:["backend","api"],created_at:Date.now()-864e5*45}],Em=[{pid:12345,projectPath:"/Users/dev/my-react-app",projectName:"My React App",scriptName:"dev",command:"npm run dev",startedAt:Date.now()-36e5,logFile:"/tmp/projax-12345.log",detectedUrls:["http://localhost:3000"],detectedPorts:[3e3]}],Tm={type:"npm",scripts:[{name:"dev",command:"vite",runner:"npm",projectType:"react"},{name:"build",command:"vite build",runner:"npm",projectType:"react"},{name:"test",command:"vitest",runner:"npm",projectType:"react"},{name:"lint",command:"eslint .",runner:"npm",projectType:"react"}]},Dm=[{id:1,project_id:1,port:3e3,script_name:"dev",config_source:"package.json",last_detected:Date.now()-3e5,created_at:Date.now()-864e5}],Lr=[{id:1,project_id:1,file_path:"/Users/dev/my-react-app/src/App.test.tsx",framework:"vitest",status:null,last_run:null},{id:2,project_id:1,file_path:"/Users/dev/my-react-app/src/components/Button.test.tsx",framework:"vitest",status:null,last_run:null}];let Ot=[...vp],Ir=[...yp],Nt=[...Em],ro=new Map;ro.set(1,Dm);const q=(e=300)=>new Promise(t=>setTimeout(t,e)),_m=()=>({getProjects:async()=>(await q(),[...Ot]),addProject:async e=>{await q();const t={id:Math.max(...Ot.map(n=>n.id),0)+1,name:e.split("/").pop()||"New Project",path:e,description:null,tags:[],framework:null,last_scanned:null,created_at:Date.now()};return Ot.push(t),t},removeProject:async e=>{await q(),Ot=Ot.filter(t=>t.id!==e)},scanProject:async e=>{await q(1e3);const t=Ot.find(n=>n.id===e);if(!t)throw new Error("Project not found");return{project:t,testsFound:Lr.filter(n=>n.project_id===e).length,tests:Lr.filter(n=>n.project_id===e)}},scanAllProjects:async()=>(await q(2e3),Ot.map(e=>({project:e,testsFound:Lr.filter(t=>t.project_id===e.id).length,tests:Lr.filter(t=>t.project_id===e.id)}))),getTests:async e=>(await q(),Lr.filter(t=>t.project_id===e)),selectDirectory:async()=>(await q(),prompt("Enter a project path (mock):")||null),minimizeWindow:async()=>{console.log("[MOCK] minimizeWindow")},maximizeWindow:async()=>{console.log("[MOCK] maximizeWindow")},closeWindow:async()=>{console.log("[MOCK] closeWindow")},renameProject:async(e,t)=>{await q();const n=Ot.find(r=>r.id===e);if(!n)throw new Error("Project not found");return n.name=t,{...n}},updateProject:async(e,t)=>{await q();const n=Ot.find(r=>r.id===e);if(!n)throw new Error("Project not found");return t.description!==void 0&&(n.description=t.description),{...n}},getProjectScripts:async e=>(await q(),Tm),runScript:async(e,t,n,r)=>{await q(500);const s=Ot.find(o=>o.path===e);if(r){const o={pid:Math.floor(Math.random()*9e4)+1e4,projectPath:e,projectName:(s==null?void 0:s.name)||"Unknown",scriptName:t,command:`npm run ${t}`,startedAt:Date.now(),logFile:`/tmp/projax-${Date.now()}.log`,detectedUrls:[],detectedPorts:[]};Nt.push(o)}return{success:!0,background:r||!1}},scanProjectPorts:async e=>(await q(1e3),ro.get(e)||[]),scanAllPorts:async()=>{await q(2e3);const e={};return ro.forEach((t,n)=>{e[n]=t}),e},getProjectPorts:async e=>(await q(),ro.get(e)||[]),getRunningProcesses:async()=>(await q(),[...Nt]),stopScript:async e=>(await q(),Nt=Nt.filter(t=>t.pid!==e),!0),stopProject:async e=>{await q();const t=Nt.filter(n=>n.projectPath===e).length;return Nt=Nt.filter(n=>n.projectPath!==e),t},openUrl:async e=>{console.log("[MOCK] openUrl:",e),window.open(e,"_blank")},openInEditor:async e=>{console.log("[MOCK] openInEditor:",e)},openInFiles:async e=>{console.log("[MOCK] openInFiles:",e)},getSettings:async()=>(await q(),{editor:{type:"vscode"},browser:{type:"default"}}),saveSettings:async e=>{await q(),console.log("[MOCK] saveSettings:",e)},openExternal:e=>{window.open(e,"_blank")},watchProcessOutput:async e=>(console.log("[MOCK] watchProcessOutput:",e),{success:!0}),unwatchProcessOutput:async e=>(console.log("[MOCK] unwatchProcessOutput:",e),{success:!0}),onProcessOutput:e=>{setTimeout(()=>{Nt.length>0&&e(null,{pid:Nt[0].pid,data:`[MOCK] Process output line
|
|
64
|
-
`})},2e3)},onProcessExit:e=>{setTimeout(()=>{Nt.length>0&&e(null,{pid:Nt[0].pid,code:0})},1e4)},removeProcessOutputListener:e=>{console.log("[MOCK] removeProcessOutputListener")},removeProcessExitListener:e=>{console.log("[MOCK] removeProcessExitListener")},getAppVersion:async()=>(await q(),"3.3.38"),getLatestTestResult:async e=>(await q(),{id:1,project_id:e,passed:10,failed:2,skipped:1,duration:1234,timestamp:Date.now()}),getWorkspaces:async()=>(await q(),[...Ir]),addWorkspace:async e=>{await q();const t={id:Math.max(...Ir.map(n=>n.id),0)+1,...e,created_at:Date.now()};return Ir.push(t),t},removeWorkspace:async e=>{await q(),Ir=Ir.filter(t=>t.id!==e)},createBackup:async e=>(await q(1e3),{success:!0,backup_path:e}),restoreBackup:async e=>(await q(1e3),{success:!0}),showSaveDialog:async e=>(await q(),{canceled:!1,filePath:"/tmp/backup.json"}),showOpenDialog:async e=>(await q(),{canceled:!1,filePaths:["/tmp/backup.json"]}),selectFile:async e=>(await q(),"/tmp/selected-file.json")});let Gn=[...yp],Wc=[...vp],$c=new Map,zm=new Map;const bm=(e=200)=>new Promise(t=>setTimeout(t,e)),Rm=()=>{const e=window.fetch;window.fetch=async(t,n)=>{const r=typeof t=="string"?t:t instanceof URL?t.toString():t.url;if(!r.includes("localhost:3001/api")&&!r.includes("localhost:3001/health"))return e(t,n);await bm();const o=new URL(r,"http://localhost:3001").pathname,a=(n==null?void 0:n.method)||"GET";if(console.log(`[MOCK API] ${a} ${o}`),o==="/api/workspaces"&&a==="GET")return new Response(JSON.stringify(Gn),{status:200,headers:{"Content-Type":"application/json"}});if(o==="/api/workspaces/create"&&a==="POST"){const l=JSON.parse((n==null?void 0:n.body)||"{}"),c={id:Math.max(...Gn.map(u=>u.id),0)+1,...l,created_at:Date.now()};return Gn.push(c),new Response(JSON.stringify(c),{status:201,headers:{"Content-Type":"application/json"}})}if(o==="/api/workspaces/import"&&a==="POST")return JSON.parse((n==null?void 0:n.body)||"{}"),new Response(JSON.stringify({success:!0,imported:1}),{status:200,headers:{"Content-Type":"application/json"}});if(o.startsWith("/api/workspaces/")&&o.endsWith("/projects")&&a==="GET"){const l=parseInt(o.split("/")[3]),c=zm.get(l)||[],u=Wc.filter(h=>c.includes(h.id));return new Response(JSON.stringify(u),{status:200,headers:{"Content-Type":"application/json"}})}if(o.startsWith("/api/workspaces/")&&a==="PUT"){const l=parseInt(o.split("/")[3]),c=JSON.parse((n==null?void 0:n.body)||"{}"),u=Gn.find(h=>h.id===l);return u?(Object.assign(u,c),new Response(JSON.stringify(u),{status:200,headers:{"Content-Type":"application/json"}})):new Response(JSON.stringify({error:"Not found"}),{status:404})}if(o.startsWith("/api/workspaces/")&&a==="DELETE"){const l=parseInt(o.split("/")[3]);return Gn=Gn.filter(c=>c.id!==l),new Response(JSON.stringify({success:!0}),{status:200,headers:{"Content-Type":"application/json"}})}if(o==="/api/projects/tags"&&a==="GET"){const l=new Set;return Wc.forEach(c=>{(c.tags||[]).forEach(u=>l.add(u))}),new Response(JSON.stringify(Array.from(l)),{status:200,headers:{"Content-Type":"application/json"}})}if(o.startsWith("/api/projects/")&&o.endsWith("/settings")&&a==="GET"){const l=parseInt(o.split("/")[3]),c=$c.get(l)||{script_sort_order:"default"};return new Response(JSON.stringify(c),{status:200,headers:{"Content-Type":"application/json"}})}if(o.startsWith("/api/projects/")&&o.endsWith("/settings")&&a==="PUT"){const l=parseInt(o.split("/")[3]),c=JSON.parse((n==null?void 0:n.body)||"{}");return $c.set(l,c),new Response(JSON.stringify(c),{status:200,headers:{"Content-Type":"application/json"}})}if(o.startsWith("/api/projects/")&&o.endsWith("/git-branch")&&a==="GET"){const l=parseInt(o.split("/")[3]),c=["main","develop","feature/new-feature"];return new Response(JSON.stringify({branch:c[l%c.length]}),{status:200,headers:{"Content-Type":"application/json"}})}return o==="/health"?new Response(JSON.stringify({status:"ok"}),{status:200,headers:{"Content-Type":"application/json"}}):(console.warn(`[MOCK API] Unhandled route: ${a} ${o}`),new Response(JSON.stringify({error:"Not found"}),{status:404,headers:{"Content-Type":"application/json"}}))}},Am=()=>{var r,s;if(typeof window>"u")return;const e=typeof window.electronAPI<"u",t=typeof window.process<"u",n=(r=window.process)==null?void 0:r.type;if(console.log("[MOCK SETUP] Environment check:",{hasElectronAPI:e,hasProcess:t,processType:n,electronAPIType:typeof window.electronAPI}),e){console.log("⚡ Running in Electron - using real APIs");return}e||(console.log("🔧 Setting up mocks for browser development..."),Object.defineProperty(window,"electronAPI",{value:_m(),writable:!1,configurable:!1}),console.log("✅ Mock ElectronAPI initialized"),Rm(),console.log("✅ Mock fetch interceptor initialized"),console.log("✅ All mocks initialized. You can now develop in the browser!"),console.log("📦 Mock data includes:",{projects:3,workspaces:2,runningProcesses:1}),typeof((s=window.electronAPI)==null?void 0:s.getProjects)=="function"?console.log("✅ Verified: electronAPI.getProjects is available"):console.error("❌ ERROR: electronAPI.getProjects is not available!"))};Am();Pi.createRoot(document.getElementById("root")).render(i.jsx(Zc.StrictMode,{children:i.jsx(Cm,{})}));
|