@commandgarden/cli 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1 -0
- package/node_modules/@commandgarden/app/dist/client/assets/index-DCptfmmK.js +397 -0
- package/node_modules/@commandgarden/app/dist/client/assets/index-qunCIeG9.css +1 -0
- package/node_modules/@commandgarden/app/dist/client/index.html +2 -2
- package/node_modules/@commandgarden/chrome/dist/service-worker.js +2 -1
- package/node_modules/@commandgarden/chrome/dist/service-worker.js.map +2 -2
- package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.eval.js +19 -17
- package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.yaml +1 -0
- package/node_modules/@commandgarden/daemon/connectors/teams-rooms-availability.eval.js +545 -0
- package/node_modules/@commandgarden/daemon/connectors/teams-rooms-availability.yaml +48 -0
- package/node_modules/@commandgarden/shared/dist/connector.d.ts +3 -0
- package/node_modules/@commandgarden/shared/dist/connector.d.ts.map +1 -1
- package/node_modules/@commandgarden/shared/dist/connector.js +1 -0
- package/node_modules/@commandgarden/shared/dist/connector.js.map +1 -1
- package/package.json +1 -1
- package/node_modules/@commandgarden/app/dist/client/assets/index-DlAU-HAE.css +0 -1
- package/node_modules/@commandgarden/app/dist/client/assets/index-VwLyBHHl.js +0 -397
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
function xm(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(s,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();function vm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sd={exports:{}},Ki={},rd={exports:{}},W={};/**
|
|
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 xr=Symbol.for("react.element"),bm=Symbol.for("react.portal"),jm=Symbol.for("react.fragment"),wm=Symbol.for("react.strict_mode"),km=Symbol.for("react.profiler"),Nm=Symbol.for("react.provider"),Sm=Symbol.for("react.context"),Cm=Symbol.for("react.forward_ref"),Em=Symbol.for("react.suspense"),Tm=Symbol.for("react.memo"),Lm=Symbol.for("react.lazy"),xc=Symbol.iterator;function Am(e){return e===null||typeof e!="object"?null:(e=xc&&e[xc]||e["@@iterator"],typeof e=="function"?e:null)}var id={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ad=Object.assign,od={};function cs(e,t,n){this.props=e,this.context=t,this.refs=od,this.updater=n||id}cs.prototype.isReactComponent={};cs.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")};cs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ld(){}ld.prototype=cs.prototype;function al(e,t,n){this.props=e,this.context=t,this.refs=od,this.updater=n||id}var ol=al.prototype=new ld;ol.constructor=al;ad(ol,cs.prototype);ol.isPureReactComponent=!0;var vc=Array.isArray,cd=Object.prototype.hasOwnProperty,ll={current:null},ud={key:!0,ref:!0,__self:!0,__source:!0};function dd(e,t,n){var s,r={},a=null,o=null;if(t!=null)for(s in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)cd.call(t,s)&&!ud.hasOwnProperty(s)&&(r[s]=t[s]);var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];r.children=c}if(e&&e.defaultProps)for(s in l=e.defaultProps,l)r[s]===void 0&&(r[s]=l[s]);return{$$typeof:xr,type:e,key:a,ref:o,props:r,_owner:ll.current}}function Im(e,t){return{$$typeof:xr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cl(e){return typeof e=="object"&&e!==null&&e.$$typeof===xr}function Om(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var bc=/\/+/g;function ba(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Om(""+e.key):t.toString(36)}function ni(e,t,n,s,r){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(a){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case xr:case bm:o=!0}}if(o)return o=e,r=r(o),e=s===""?"."+ba(o,0):s,vc(r)?(n="",e!=null&&(n=e.replace(bc,"$&/")+"/"),ni(r,t,n,"",function(u){return u})):r!=null&&(cl(r)&&(r=Im(r,n+(!r.key||o&&o.key===r.key?"":(""+r.key).replace(bc,"$&/")+"/")+e)),t.push(r)),1;if(o=0,s=s===""?".":s+":",vc(e))for(var l=0;l<e.length;l++){a=e[l];var c=s+ba(a,l);o+=ni(a,t,n,c,r)}else if(c=Am(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=s+ba(a,l++),o+=ni(a,t,n,c,r);else if(a==="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 o}function Ar(e,t,n){if(e==null)return e;var s=[],r=0;return ni(e,s,"","",function(a){return t.call(n,a,r++)}),s}function Pm(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 Te={current:null},si={transition:null},_m={ReactCurrentDispatcher:Te,ReactCurrentBatchConfig:si,ReactCurrentOwner:ll};function fd(){throw Error("act(...) is not supported in production builds of React.")}W.Children={map:Ar,forEach:function(e,t,n){Ar(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ar(e,function(){t++}),t},toArray:function(e){return Ar(e,function(t){return t})||[]},only:function(e){if(!cl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};W.Component=cs;W.Fragment=jm;W.Profiler=km;W.PureComponent=al;W.StrictMode=wm;W.Suspense=Em;W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_m;W.act=fd;W.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var s=ad({},e.props),r=e.key,a=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,o=ll.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)cd.call(t,c)&&!ud.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];s.children=l}return{$$typeof:xr,type:e.type,key:r,ref:a,props:s,_owner:o}};W.createContext=function(e){return e={$$typeof:Sm,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Nm,_context:e},e.Consumer=e};W.createElement=dd;W.createFactory=function(e){var t=dd.bind(null,e);return t.type=e,t};W.createRef=function(){return{current:null}};W.forwardRef=function(e){return{$$typeof:Cm,render:e}};W.isValidElement=cl;W.lazy=function(e){return{$$typeof:Lm,_payload:{_status:-1,_result:e},_init:Pm}};W.memo=function(e,t){return{$$typeof:Tm,type:e,compare:t===void 0?null:t}};W.startTransition=function(e){var t=si.transition;si.transition={};try{e()}finally{si.transition=t}};W.unstable_act=fd;W.useCallback=function(e,t){return Te.current.useCallback(e,t)};W.useContext=function(e){return Te.current.useContext(e)};W.useDebugValue=function(){};W.useDeferredValue=function(e){return Te.current.useDeferredValue(e)};W.useEffect=function(e,t){return Te.current.useEffect(e,t)};W.useId=function(){return Te.current.useId()};W.useImperativeHandle=function(e,t,n){return Te.current.useImperativeHandle(e,t,n)};W.useInsertionEffect=function(e,t){return Te.current.useInsertionEffect(e,t)};W.useLayoutEffect=function(e,t){return Te.current.useLayoutEffect(e,t)};W.useMemo=function(e,t){return Te.current.useMemo(e,t)};W.useReducer=function(e,t,n){return Te.current.useReducer(e,t,n)};W.useRef=function(e){return Te.current.useRef(e)};W.useState=function(e){return Te.current.useState(e)};W.useSyncExternalStore=function(e,t,n){return Te.current.useSyncExternalStore(e,t,n)};W.useTransition=function(){return Te.current.useTransition()};W.version="18.3.1";rd.exports=W;var b=rd.exports;const Dm=vm(b),Mm=xm({__proto__:null,default:Dm},[b]);/**
|
|
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 Rm=b,$m=Symbol.for("react.element"),zm=Symbol.for("react.fragment"),Fm=Object.prototype.hasOwnProperty,Bm=Rm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Um={key:!0,ref:!0,__self:!0,__source:!0};function pd(e,t,n){var s,r={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(s in t)Fm.call(t,s)&&!Um.hasOwnProperty(s)&&(r[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)r[s]===void 0&&(r[s]=t[s]);return{$$typeof:$m,type:e,key:a,ref:o,props:r,_owner:Bm.current}}Ki.Fragment=zm;Ki.jsx=pd;Ki.jsxs=pd;sd.exports=Ki;var i=sd.exports,md={exports:{}},Ue={},hd={exports:{}},gd={};/**
|
|
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(L,P){var M=L.length;L.push(P);e:for(;0<M;){var $=M-1>>>1,Q=L[$];if(0<r(Q,P))L[$]=P,L[M]=Q,M=$;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var P=L[0],M=L.pop();if(M!==P){L[0]=M;e:for(var $=0,Q=L.length,Me=Q>>>1;$<Me;){var Ze=2*($+1)-1,bs=L[Ze],sn=Ze+1,Lr=L[sn];if(0>r(bs,M))sn<Q&&0>r(Lr,bs)?(L[$]=Lr,L[sn]=M,$=sn):(L[$]=bs,L[Ze]=M,$=Ze);else if(sn<Q&&0>r(Lr,M))L[$]=Lr,L[sn]=M,$=sn;else break e}}return P}function r(L,P){var M=L.sortIndex-P.sortIndex;return M!==0?M:L.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],p=1,d=null,f=3,x=!1,v=!1,y=!1,j=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,h=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(L){for(var P=n(u);P!==null;){if(P.callback===null)s(u);else if(P.startTime<=L)s(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function w(L){if(y=!1,m(L),!v)if(n(c)!==null)v=!0,O(k);else{var P=n(u);P!==null&&R(w,P.startTime-L)}}function k(L,P){v=!1,y&&(y=!1,g(N),N=-1),x=!0;var M=f;try{for(m(P),d=n(c);d!==null&&(!(d.expirationTime>P)||L&&!F());){var $=d.callback;if(typeof $=="function"){d.callback=null,f=d.priorityLevel;var Q=$(d.expirationTime<=P);P=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(c)&&s(c),m(P)}else s(c);d=n(c)}if(d!==null)var Me=!0;else{var Ze=n(u);Ze!==null&&R(w,Ze.startTime-P),Me=!1}return Me}finally{d=null,f=M,x=!1}}var C=!1,S=null,N=-1,T=5,A=-1;function F(){return!(e.unstable_now()-A<T)}function G(){if(S!==null){var L=e.unstable_now();A=L;var P=!0;try{P=S(!0,L)}finally{P?V():(C=!1,S=null)}}else C=!1}var V;if(typeof h=="function")V=function(){h(G)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,D=E.port2;E.port1.onmessage=G,V=function(){D.postMessage(null)}}else V=function(){j(G,0)};function O(L){S=L,C||(C=!0,V())}function R(L,P){N=j(function(){L(e.unstable_now())},P)}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(L){L.callback=null},e.unstable_continueExecution=function(){v||x||(v=!0,O(k))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(L){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var M=f;f=P;try{return L()}finally{f=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,P){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var M=f;f=L;try{return P()}finally{f=M}},e.unstable_scheduleCallback=function(L,P,M){var $=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?$+M:$):M=$,L){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=M+Q,L={id:p++,callback:P,priorityLevel:L,startTime:M,expirationTime:Q,sortIndex:-1},M>$?(L.sortIndex=M,t(u,L),n(c)===null&&L===n(u)&&(y?(g(N),N=-1):y=!0,R(w,M-$))):(L.sortIndex=Q,t(c,L),v||x||(v=!0,O(k))),L},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(L){var P=f;return function(){var M=f;f=P;try{return L.apply(this,arguments)}finally{f=M}}}})(gd);hd.exports=gd;var Wm=hd.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 Hm=b,Be=Wm;function I(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 yd=new Set,Qs={};function wn(e,t){Zn(e,t),Zn(e+"Capture",t)}function Zn(e,t){for(Qs[e]=t,e=0;e<t.length;e++)yd.add(t[e])}var St=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),so=Object.prototype.hasOwnProperty,Vm=/^[: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]*$/,jc={},wc={};function Km(e){return so.call(wc,e)?!0:so.call(jc,e)?!1:Vm.test(e)?wc[e]=!0:(jc[e]=!0,!1)}function Gm(e,t,n,s){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return s?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function qm(e,t,n,s){if(t===null||typeof t>"u"||Gm(e,t,n,s))return!0;if(s)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 Le(e,t,n,s,r,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=s,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ve[e]=new Le(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ve[t]=new Le(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ve[e]=new Le(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ve[e]=new Le(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){ve[e]=new Le(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ve[e]=new Le(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ve[e]=new Le(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ve[e]=new Le(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ve[e]=new Le(e,5,!1,e.toLowerCase(),null,!1,!1)});var ul=/[\-:]([a-z])/g;function dl(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(ul,dl);ve[t]=new Le(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(ul,dl);ve[t]=new Le(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(ul,dl);ve[t]=new Le(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ve[e]=new Le(e,1,!1,e.toLowerCase(),null,!1,!1)});ve.xlinkHref=new Le("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ve[e]=new Le(e,1,!1,e.toLowerCase(),null,!0,!0)});function fl(e,t,n,s){var r=ve.hasOwnProperty(t)?ve[t]:null;(r!==null?r.type!==0:s||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(qm(t,n,r,s)&&(n=null),s||r===null?Km(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,s=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Lt=Hm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ir=Symbol.for("react.element"),An=Symbol.for("react.portal"),In=Symbol.for("react.fragment"),pl=Symbol.for("react.strict_mode"),ro=Symbol.for("react.profiler"),xd=Symbol.for("react.provider"),vd=Symbol.for("react.context"),ml=Symbol.for("react.forward_ref"),io=Symbol.for("react.suspense"),ao=Symbol.for("react.suspense_list"),hl=Symbol.for("react.memo"),_t=Symbol.for("react.lazy"),bd=Symbol.for("react.offscreen"),kc=Symbol.iterator;function js(e){return e===null||typeof e!="object"?null:(e=kc&&e[kc]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Object.assign,ja;function Is(e){if(ja===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ja=t&&t[1]||""}return`
|
|
34
|
+
`+ja+e}var wa=!1;function ka(e,t){if(!e||wa)return"";wa=!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 s=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){s=u}e.call(t.prototype)}else{try{throw Error()}catch(u){s=u}e()}}catch(u){if(u&&s&&typeof u.stack=="string"){for(var r=u.stack.split(`
|
|
35
|
+
`),a=s.stack.split(`
|
|
36
|
+
`),o=r.length-1,l=a.length-1;1<=o&&0<=l&&r[o]!==a[l];)l--;for(;1<=o&&0<=l;o--,l--)if(r[o]!==a[l]){if(o!==1||l!==1)do if(o--,l--,0>l||r[o]!==a[l]){var c=`
|
|
37
|
+
`+r[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{wa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Is(e):""}function Ym(e){switch(e.tag){case 5:return Is(e.type);case 16:return Is("Lazy");case 13:return Is("Suspense");case 19:return Is("SuspenseList");case 0:case 2:case 15:return e=ka(e.type,!1),e;case 11:return e=ka(e.type.render,!1),e;case 1:return e=ka(e.type,!0),e;default:return""}}function oo(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 In:return"Fragment";case An:return"Portal";case ro:return"Profiler";case pl:return"StrictMode";case io:return"Suspense";case ao:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case vd:return(e.displayName||"Context")+".Consumer";case xd:return(e._context.displayName||"Context")+".Provider";case ml:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hl:return t=e.displayName||null,t!==null?t:oo(e.type)||"Memo";case _t:t=e._payload,e=e._init;try{return oo(e(t))}catch{}}return null}function Qm(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 oo(t);case 8:return t===pl?"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 Xt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jm(e){var t=jd(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),s=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){s=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(o){s=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Or(e){e._valueTracker||(e._valueTracker=Jm(e))}function wd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=jd(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function yi(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 lo(e,t){var n=t.checked;return ie({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Nc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Xt(t.value!=null?t.value:n),e._wrapperState={initialChecked:s,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function kd(e,t){t=t.checked,t!=null&&fl(e,"checked",t,!1)}function co(e,t){kd(e,t);var n=Xt(t.value),s=t.type;if(n!=null)s==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(s==="submit"||s==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uo(e,t.type,n):t.hasOwnProperty("defaultValue")&&uo(e,t.type,Xt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var s=t.type;if(!(s!=="submit"&&s!=="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 uo(e,t,n){(t!=="number"||yi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Os=Array.isArray;function Vn(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Xt(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function fo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return ie({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Cc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(I(92));if(Os(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Xt(n)}}function Nd(e,t){var n=Xt(t.value),s=Xt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),s!=null&&(e.defaultValue=""+s)}function Ec(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Sd(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 po(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Sd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pr,Cd=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,s,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,s,r)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Pr=Pr||document.createElement("div"),Pr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Pr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Js(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zs={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},Xm=["Webkit","ms","Moz","O"];Object.keys(zs).forEach(function(e){Xm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),zs[t]=zs[e]})});function Ed(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||zs.hasOwnProperty(e)&&zs[e]?(""+t).trim():t+"px"}function Td(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Ed(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var Zm=ie({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 mo(e,t){if(t){if(Zm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function ho(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 go=null;function gl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yo=null,Kn=null,Gn=null;function Tc(e){if(e=jr(e)){if(typeof yo!="function")throw Error(I(280));var t=e.stateNode;t&&(t=Ji(t),yo(e.stateNode,e.type,t))}}function Ld(e){Kn?Gn?Gn.push(e):Gn=[e]:Kn=e}function Ad(){if(Kn){var e=Kn,t=Gn;if(Gn=Kn=null,Tc(e),t)for(e=0;e<t.length;e++)Tc(t[e])}}function Id(e,t){return e(t)}function Od(){}var Na=!1;function Pd(e,t,n){if(Na)return e(t,n);Na=!0;try{return Id(e,t,n)}finally{Na=!1,(Kn!==null||Gn!==null)&&(Od(),Ad())}}function Xs(e,t){var n=e.stateNode;if(n===null)return null;var s=Ji(n);if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(I(231,t,typeof n));return n}var xo=!1;if(St)try{var ws={};Object.defineProperty(ws,"passive",{get:function(){xo=!0}}),window.addEventListener("test",ws,ws),window.removeEventListener("test",ws,ws)}catch{xo=!1}function eh(e,t,n,s,r,a,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var Fs=!1,xi=null,vi=!1,vo=null,th={onError:function(e){Fs=!0,xi=e}};function nh(e,t,n,s,r,a,o,l,c){Fs=!1,xi=null,eh.apply(th,arguments)}function sh(e,t,n,s,r,a,o,l,c){if(nh.apply(this,arguments),Fs){if(Fs){var u=xi;Fs=!1,xi=null}else throw Error(I(198));vi||(vi=!0,vo=u)}}function kn(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 _d(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 Lc(e){if(kn(e)!==e)throw Error(I(188))}function rh(e){var t=e.alternate;if(!t){if(t=kn(e),t===null)throw Error(I(188));return t!==e?null:e}for(var n=e,s=t;;){var r=n.return;if(r===null)break;var a=r.alternate;if(a===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===a.child){for(a=r.child;a;){if(a===n)return Lc(r),e;if(a===s)return Lc(r),t;a=a.sibling}throw Error(I(188))}if(n.return!==s.return)n=r,s=a;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,s=a;break}if(l===s){o=!0,s=r,n=a;break}l=l.sibling}if(!o){for(l=a.child;l;){if(l===n){o=!0,n=a,s=r;break}if(l===s){o=!0,s=a,n=r;break}l=l.sibling}if(!o)throw Error(I(189))}}if(n.alternate!==s)throw Error(I(190))}if(n.tag!==3)throw Error(I(188));return n.stateNode.current===n?e:t}function Dd(e){return e=rh(e),e!==null?Md(e):null}function Md(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Md(e);if(t!==null)return t;e=e.sibling}return null}var Rd=Be.unstable_scheduleCallback,Ac=Be.unstable_cancelCallback,ih=Be.unstable_shouldYield,ah=Be.unstable_requestPaint,oe=Be.unstable_now,oh=Be.unstable_getCurrentPriorityLevel,yl=Be.unstable_ImmediatePriority,$d=Be.unstable_UserBlockingPriority,bi=Be.unstable_NormalPriority,lh=Be.unstable_LowPriority,zd=Be.unstable_IdlePriority,Gi=null,mt=null;function ch(e){if(mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(Gi,e,void 0,(e.current.flags&128)===128)}catch{}}var at=Math.clz32?Math.clz32:fh,uh=Math.log,dh=Math.LN2;function fh(e){return e>>>=0,e===0?32:31-(uh(e)/dh|0)|0}var _r=64,Dr=4194304;function Ps(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 ji(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~r;l!==0?s=Ps(l):(a&=o,a!==0&&(s=Ps(a)))}else o=n&~r,o!==0?s=Ps(o):a!==0&&(s=Ps(a));if(s===0)return 0;if(t!==0&&t!==s&&!(t&r)&&(r=s&-s,a=t&-t,r>=a||r===16&&(a&4194240)!==0))return t;if(s&4&&(s|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=s;0<t;)n=31-at(t),r=1<<n,s|=e[n],t&=~r;return s}function ph(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 mh(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-at(a),l=1<<o,c=r[o];c===-1?(!(l&n)||l&s)&&(r[o]=ph(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function bo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Fd(){var e=_r;return _r<<=1,!(_r&4194240)&&(_r=64),e}function Sa(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-at(t),e[t]=n}function hh(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 s=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-at(n),a=1<<r;t[r]=0,s[r]=-1,e[r]=-1,n&=~a}}function xl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-at(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}var K=0;function Bd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ud,vl,Wd,Hd,Vd,jo=!1,Mr=[],Ut=null,Wt=null,Ht=null,Zs=new Map,er=new Map,Rt=[],gh="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 Ic(e,t){switch(e){case"focusin":case"focusout":Ut=null;break;case"dragenter":case"dragleave":Wt=null;break;case"mouseover":case"mouseout":Ht=null;break;case"pointerover":case"pointerout":Zs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":er.delete(t.pointerId)}}function ks(e,t,n,s,r,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:a,targetContainers:[r]},t!==null&&(t=jr(t),t!==null&&vl(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function yh(e,t,n,s,r){switch(t){case"focusin":return Ut=ks(Ut,e,t,n,s,r),!0;case"dragenter":return Wt=ks(Wt,e,t,n,s,r),!0;case"mouseover":return Ht=ks(Ht,e,t,n,s,r),!0;case"pointerover":var a=r.pointerId;return Zs.set(a,ks(Zs.get(a)||null,e,t,n,s,r)),!0;case"gotpointercapture":return a=r.pointerId,er.set(a,ks(er.get(a)||null,e,t,n,s,r)),!0}return!1}function Kd(e){var t=ln(e.target);if(t!==null){var n=kn(t);if(n!==null){if(t=n.tag,t===13){if(t=_d(n),t!==null){e.blockedOn=t,Vd(e.priority,function(){Wd(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 ri(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wo(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);go=s,n.target.dispatchEvent(s),go=null}else return t=jr(n),t!==null&&vl(t),e.blockedOn=n,!1;t.shift()}return!0}function Oc(e,t,n){ri(e)&&n.delete(t)}function xh(){jo=!1,Ut!==null&&ri(Ut)&&(Ut=null),Wt!==null&&ri(Wt)&&(Wt=null),Ht!==null&&ri(Ht)&&(Ht=null),Zs.forEach(Oc),er.forEach(Oc)}function Ns(e,t){e.blockedOn===t&&(e.blockedOn=null,jo||(jo=!0,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,xh)))}function tr(e){function t(r){return Ns(r,e)}if(0<Mr.length){Ns(Mr[0],e);for(var n=1;n<Mr.length;n++){var s=Mr[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Ut!==null&&Ns(Ut,e),Wt!==null&&Ns(Wt,e),Ht!==null&&Ns(Ht,e),Zs.forEach(t),er.forEach(t),n=0;n<Rt.length;n++)s=Rt[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Rt.length&&(n=Rt[0],n.blockedOn===null);)Kd(n),n.blockedOn===null&&Rt.shift()}var qn=Lt.ReactCurrentBatchConfig,wi=!0;function vh(e,t,n,s){var r=K,a=qn.transition;qn.transition=null;try{K=1,bl(e,t,n,s)}finally{K=r,qn.transition=a}}function bh(e,t,n,s){var r=K,a=qn.transition;qn.transition=null;try{K=4,bl(e,t,n,s)}finally{K=r,qn.transition=a}}function bl(e,t,n,s){if(wi){var r=wo(e,t,n,s);if(r===null)Da(e,t,s,ki,n),Ic(e,s);else if(yh(r,e,t,n,s))s.stopPropagation();else if(Ic(e,s),t&4&&-1<gh.indexOf(e)){for(;r!==null;){var a=jr(r);if(a!==null&&Ud(a),a=wo(e,t,n,s),a===null&&Da(e,t,s,ki,n),a===r)break;r=a}r!==null&&s.stopPropagation()}else Da(e,t,s,null,n)}}var ki=null;function wo(e,t,n,s){if(ki=null,e=gl(s),e=ln(e),e!==null)if(t=kn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=_d(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 ki=e,null}function Gd(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(oh()){case yl:return 1;case $d:return 4;case bi:case lh:return 16;case zd:return 536870912;default:return 16}default:return 16}}var zt=null,jl=null,ii=null;function qd(){if(ii)return ii;var e,t=jl,n=t.length,s,r="value"in zt?zt.value:zt.textContent,a=r.length;for(e=0;e<n&&t[e]===r[e];e++);var o=n-e;for(s=1;s<=o&&t[n-s]===r[a-s];s++);return ii=r.slice(e,1<s?1-s:void 0)}function ai(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 Rr(){return!0}function Pc(){return!1}function We(e){function t(n,s,r,a,o){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=a,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?Rr:Pc,this.isPropagationStopped=Pc,this}return ie(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=Rr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Rr)},persist:function(){},isPersistent:Rr}),t}var us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wl=We(us),br=ie({},us,{view:0,detail:0}),jh=We(br),Ca,Ea,Ss,qi=ie({},br,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kl,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!==Ss&&(Ss&&e.type==="mousemove"?(Ca=e.screenX-Ss.screenX,Ea=e.screenY-Ss.screenY):Ea=Ca=0,Ss=e),Ca)},movementY:function(e){return"movementY"in e?e.movementY:Ea}}),_c=We(qi),wh=ie({},qi,{dataTransfer:0}),kh=We(wh),Nh=ie({},br,{relatedTarget:0}),Ta=We(Nh),Sh=ie({},us,{animationName:0,elapsedTime:0,pseudoElement:0}),Ch=We(Sh),Eh=ie({},us,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Th=We(Eh),Lh=ie({},us,{data:0}),Dc=We(Lh),Ah={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ih={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"},Oh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ph(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Oh[e])?!!t[e]:!1}function kl(){return Ph}var _h=ie({},br,{key:function(e){if(e.key){var t=Ah[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ai(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ih[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kl,charCode:function(e){return e.type==="keypress"?ai(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ai(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Dh=We(_h),Mh=ie({},qi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mc=We(Mh),Rh=ie({},br,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kl}),$h=We(Rh),zh=ie({},us,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fh=We(zh),Bh=ie({},qi,{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}),Uh=We(Bh),Wh=[9,13,27,32],Nl=St&&"CompositionEvent"in window,Bs=null;St&&"documentMode"in document&&(Bs=document.documentMode);var Hh=St&&"TextEvent"in window&&!Bs,Yd=St&&(!Nl||Bs&&8<Bs&&11>=Bs),Rc=" ",$c=!1;function Qd(e,t){switch(e){case"keyup":return Wh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var On=!1;function Vh(e,t){switch(e){case"compositionend":return Jd(t);case"keypress":return t.which!==32?null:($c=!0,Rc);case"textInput":return e=t.data,e===Rc&&$c?null:e;default:return null}}function Kh(e,t){if(On)return e==="compositionend"||!Nl&&Qd(e,t)?(e=qd(),ii=jl=zt=null,On=!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 Yd&&t.locale!=="ko"?null:t.data;default:return null}}var Gh={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 zc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Gh[e.type]:t==="textarea"}function Xd(e,t,n,s){Ld(s),t=Ni(t,"onChange"),0<t.length&&(n=new wl("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Us=null,nr=null;function qh(e){uf(e,0)}function Yi(e){var t=Dn(e);if(wd(t))return e}function Yh(e,t){if(e==="change")return t}var Zd=!1;if(St){var La;if(St){var Aa="oninput"in document;if(!Aa){var Fc=document.createElement("div");Fc.setAttribute("oninput","return;"),Aa=typeof Fc.oninput=="function"}La=Aa}else La=!1;Zd=La&&(!document.documentMode||9<document.documentMode)}function Bc(){Us&&(Us.detachEvent("onpropertychange",ef),nr=Us=null)}function ef(e){if(e.propertyName==="value"&&Yi(nr)){var t=[];Xd(t,nr,e,gl(e)),Pd(qh,t)}}function Qh(e,t,n){e==="focusin"?(Bc(),Us=t,nr=n,Us.attachEvent("onpropertychange",ef)):e==="focusout"&&Bc()}function Jh(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Yi(nr)}function Xh(e,t){if(e==="click")return Yi(t)}function Zh(e,t){if(e==="input"||e==="change")return Yi(t)}function eg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lt=typeof Object.is=="function"?Object.is:eg;function sr(e,t){if(lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!so.call(t,r)||!lt(e[r],t[r]))return!1}return!0}function Uc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wc(e,t){var n=Uc(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Uc(n)}}function tf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?tf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nf(){for(var e=window,t=yi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=yi(e.document)}return t}function Sl(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 tg(e){var t=nf(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&tf(n.ownerDocument.documentElement,n)){if(s!==null&&Sl(n)){if(t=s.start,e=s.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 r=n.textContent.length,a=Math.min(s.start,r);s=s.end===void 0?a:Math.min(s.end,r),!e.extend&&a>s&&(r=s,s=a,a=r),r=Wc(n,a);var o=Wc(n,s);r&&o&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),a>s?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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 ng=St&&"documentMode"in document&&11>=document.documentMode,Pn=null,ko=null,Ws=null,No=!1;function Hc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;No||Pn==null||Pn!==yi(s)||(s=Pn,"selectionStart"in s&&Sl(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Ws&&sr(Ws,s)||(Ws=s,s=Ni(ko,"onSelect"),0<s.length&&(t=new wl("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Pn)))}function $r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _n={animationend:$r("Animation","AnimationEnd"),animationiteration:$r("Animation","AnimationIteration"),animationstart:$r("Animation","AnimationStart"),transitionend:$r("Transition","TransitionEnd")},Ia={},sf={};St&&(sf=document.createElement("div").style,"AnimationEvent"in window||(delete _n.animationend.animation,delete _n.animationiteration.animation,delete _n.animationstart.animation),"TransitionEvent"in window||delete _n.transitionend.transition);function Qi(e){if(Ia[e])return Ia[e];if(!_n[e])return e;var t=_n[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in sf)return Ia[e]=t[n];return e}var rf=Qi("animationend"),af=Qi("animationiteration"),of=Qi("animationstart"),lf=Qi("transitionend"),cf=new Map,Vc="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 en(e,t){cf.set(e,t),wn(t,[e])}for(var Oa=0;Oa<Vc.length;Oa++){var Pa=Vc[Oa],sg=Pa.toLowerCase(),rg=Pa[0].toUpperCase()+Pa.slice(1);en(sg,"on"+rg)}en(rf,"onAnimationEnd");en(af,"onAnimationIteration");en(of,"onAnimationStart");en("dblclick","onDoubleClick");en("focusin","onFocus");en("focusout","onBlur");en(lf,"onTransitionEnd");Zn("onMouseEnter",["mouseout","mouseover"]);Zn("onMouseLeave",["mouseout","mouseover"]);Zn("onPointerEnter",["pointerout","pointerover"]);Zn("onPointerLeave",["pointerout","pointerover"]);wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wn("onBeforeInput",["compositionend","keypress","textInput","paste"]);wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var _s="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(" "),ig=new Set("cancel close invalid load scroll toggle".split(" ").concat(_s));function Kc(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,sh(s,t,void 0,e),e.currentTarget=null}function uf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],r=s.event;s=s.listeners;e:{var a=void 0;if(t)for(var o=s.length-1;0<=o;o--){var l=s[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&r.isPropagationStopped())break e;Kc(r,l,u),a=c}else for(o=0;o<s.length;o++){if(l=s[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&r.isPropagationStopped())break e;Kc(r,l,u),a=c}}}if(vi)throw e=vo,vi=!1,vo=null,e}function J(e,t){var n=t[Lo];n===void 0&&(n=t[Lo]=new Set);var s=e+"__bubble";n.has(s)||(df(t,e,2,!1),n.add(s))}function _a(e,t,n){var s=0;t&&(s|=4),df(n,e,s,t)}var zr="_reactListening"+Math.random().toString(36).slice(2);function rr(e){if(!e[zr]){e[zr]=!0,yd.forEach(function(n){n!=="selectionchange"&&(ig.has(n)||_a(n,!1,e),_a(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zr]||(t[zr]=!0,_a("selectionchange",!1,t))}}function df(e,t,n,s){switch(Gd(t)){case 1:var r=vh;break;case 4:r=bh;break;default:r=bl}n=r.bind(null,t,n,e),r=void 0,!xo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Da(e,t,n,s,r){var a=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var o=s.tag;if(o===3||o===4){var l=s.stateNode.containerInfo;if(l===r||l.nodeType===8&&l.parentNode===r)break;if(o===4)for(o=s.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===r||c.nodeType===8&&c.parentNode===r))return;o=o.return}for(;l!==null;){if(o=ln(l),o===null)return;if(c=o.tag,c===5||c===6){s=a=o;continue e}l=l.parentNode}}s=s.return}Pd(function(){var u=a,p=gl(n),d=[];e:{var f=cf.get(e);if(f!==void 0){var x=wl,v=e;switch(e){case"keypress":if(ai(n)===0)break e;case"keydown":case"keyup":x=Dh;break;case"focusin":v="focus",x=Ta;break;case"focusout":v="blur",x=Ta;break;case"beforeblur":case"afterblur":x=Ta;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=_c;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=kh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=$h;break;case rf:case af:case of:x=Ch;break;case lf:x=Fh;break;case"scroll":x=jh;break;case"wheel":x=Uh;break;case"copy":case"cut":case"paste":x=Th;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=Mc}var y=(t&4)!==0,j=!y&&e==="scroll",g=y?f!==null?f+"Capture":null:f;y=[];for(var h=u,m;h!==null;){m=h;var w=m.stateNode;if(m.tag===5&&w!==null&&(m=w,g!==null&&(w=Xs(h,g),w!=null&&y.push(ir(h,w,m)))),j)break;h=h.return}0<y.length&&(f=new x(f,v,null,n,p),d.push({event:f,listeners:y}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",f&&n!==go&&(v=n.relatedTarget||n.fromElement)&&(ln(v)||v[Ct]))break e;if((x||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,x?(v=n.relatedTarget||n.toElement,x=u,v=v?ln(v):null,v!==null&&(j=kn(v),v!==j||v.tag!==5&&v.tag!==6)&&(v=null)):(x=null,v=u),x!==v)){if(y=_c,w="onMouseLeave",g="onMouseEnter",h="mouse",(e==="pointerout"||e==="pointerover")&&(y=Mc,w="onPointerLeave",g="onPointerEnter",h="pointer"),j=x==null?f:Dn(x),m=v==null?f:Dn(v),f=new y(w,h+"leave",x,n,p),f.target=j,f.relatedTarget=m,w=null,ln(p)===u&&(y=new y(g,h+"enter",v,n,p),y.target=m,y.relatedTarget=j,w=y),j=w,x&&v)t:{for(y=x,g=v,h=0,m=y;m;m=Nn(m))h++;for(m=0,w=g;w;w=Nn(w))m++;for(;0<h-m;)y=Nn(y),h--;for(;0<m-h;)g=Nn(g),m--;for(;h--;){if(y===g||g!==null&&y===g.alternate)break t;y=Nn(y),g=Nn(g)}y=null}else y=null;x!==null&&Gc(d,f,x,y,!1),v!==null&&j!==null&&Gc(d,j,v,y,!0)}}e:{if(f=u?Dn(u):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var k=Yh;else if(zc(f))if(Zd)k=Zh;else{k=Jh;var C=Qh}else(x=f.nodeName)&&x.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=Xh);if(k&&(k=k(e,u))){Xd(d,k,n,p);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&uo(f,"number",f.value)}switch(C=u?Dn(u):window,e){case"focusin":(zc(C)||C.contentEditable==="true")&&(Pn=C,ko=u,Ws=null);break;case"focusout":Ws=ko=Pn=null;break;case"mousedown":No=!0;break;case"contextmenu":case"mouseup":case"dragend":No=!1,Hc(d,n,p);break;case"selectionchange":if(ng)break;case"keydown":case"keyup":Hc(d,n,p)}var S;if(Nl)e:{switch(e){case"compositionstart":var N="onCompositionStart";break e;case"compositionend":N="onCompositionEnd";break e;case"compositionupdate":N="onCompositionUpdate";break e}N=void 0}else On?Qd(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(Yd&&n.locale!=="ko"&&(On||N!=="onCompositionStart"?N==="onCompositionEnd"&&On&&(S=qd()):(zt=p,jl="value"in zt?zt.value:zt.textContent,On=!0)),C=Ni(u,N),0<C.length&&(N=new Dc(N,e,null,n,p),d.push({event:N,listeners:C}),S?N.data=S:(S=Jd(n),S!==null&&(N.data=S)))),(S=Hh?Vh(e,n):Kh(e,n))&&(u=Ni(u,"onBeforeInput"),0<u.length&&(p=new Dc("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=S))}uf(d,t)})}function ir(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ni(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,a=r.stateNode;r.tag===5&&a!==null&&(r=a,a=Xs(e,n),a!=null&&s.unshift(ir(e,a,r)),a=Xs(e,t),a!=null&&s.push(ir(e,a,r))),e=e.return}return s}function Nn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Gc(e,t,n,s,r){for(var a=t._reactName,o=[];n!==null&&n!==s;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===s)break;l.tag===5&&u!==null&&(l=u,r?(c=Xs(n,a),c!=null&&o.unshift(ir(n,c,l))):r||(c=Xs(n,a),c!=null&&o.push(ir(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ag=/\r\n?/g,og=/\u0000|\uFFFD/g;function qc(e){return(typeof e=="string"?e:""+e).replace(ag,`
|
|
38
|
+
`).replace(og,"")}function Fr(e,t,n){if(t=qc(t),qc(e)!==t&&n)throw Error(I(425))}function Si(){}var So=null,Co=null;function Eo(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 To=typeof setTimeout=="function"?setTimeout:void 0,lg=typeof clearTimeout=="function"?clearTimeout:void 0,Yc=typeof Promise=="function"?Promise:void 0,cg=typeof queueMicrotask=="function"?queueMicrotask:typeof Yc<"u"?function(e){return Yc.resolve(null).then(e).catch(ug)}:To;function ug(e){setTimeout(function(){throw e})}function Ma(e,t){var n=t,s=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(s===0){e.removeChild(r),tr(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);tr(t)}function Vt(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 Qc(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 ds=Math.random().toString(36).slice(2),pt="__reactFiber$"+ds,ar="__reactProps$"+ds,Ct="__reactContainer$"+ds,Lo="__reactEvents$"+ds,dg="__reactListeners$"+ds,fg="__reactHandles$"+ds;function ln(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ct]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qc(e);e!==null;){if(n=e[pt])return n;e=Qc(e)}return t}e=n,n=e.parentNode}return null}function jr(e){return e=e[pt]||e[Ct],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Dn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function Ji(e){return e[ar]||null}var Ao=[],Mn=-1;function tn(e){return{current:e}}function X(e){0>Mn||(e.current=Ao[Mn],Ao[Mn]=null,Mn--)}function q(e,t){Mn++,Ao[Mn]=e.current,e.current=t}var Zt={},ke=tn(Zt),Pe=tn(!1),hn=Zt;function es(e,t){var n=e.type.contextTypes;if(!n)return Zt;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var r={},a;for(a in n)r[a]=t[a];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function _e(e){return e=e.childContextTypes,e!=null}function Ci(){X(Pe),X(ke)}function Jc(e,t,n){if(ke.current!==Zt)throw Error(I(168));q(ke,t),q(Pe,n)}function ff(e,t,n){var s=e.stateNode;if(t=t.childContextTypes,typeof s.getChildContext!="function")return n;s=s.getChildContext();for(var r in s)if(!(r in t))throw Error(I(108,Qm(e)||"Unknown",r));return ie({},n,s)}function Ei(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zt,hn=ke.current,q(ke,e),q(Pe,Pe.current),!0}function Xc(e,t,n){var s=e.stateNode;if(!s)throw Error(I(169));n?(e=ff(e,t,hn),s.__reactInternalMemoizedMergedChildContext=e,X(Pe),X(ke),q(ke,e)):X(Pe),q(Pe,n)}var vt=null,Xi=!1,Ra=!1;function pf(e){vt===null?vt=[e]:vt.push(e)}function pg(e){Xi=!0,pf(e)}function nn(){if(!Ra&&vt!==null){Ra=!0;var e=0,t=K;try{var n=vt;for(K=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}vt=null,Xi=!1}catch(r){throw vt!==null&&(vt=vt.slice(e+1)),Rd(yl,nn),r}finally{K=t,Ra=!1}}return null}var Rn=[],$n=0,Ti=null,Li=0,He=[],Ve=0,gn=null,bt=1,jt="";function rn(e,t){Rn[$n++]=Li,Rn[$n++]=Ti,Ti=e,Li=t}function mf(e,t,n){He[Ve++]=bt,He[Ve++]=jt,He[Ve++]=gn,gn=e;var s=bt;e=jt;var r=32-at(s)-1;s&=~(1<<r),n+=1;var a=32-at(t)+r;if(30<a){var o=r-r%5;a=(s&(1<<o)-1).toString(32),s>>=o,r-=o,bt=1<<32-at(t)+r|n<<r|s,jt=a+e}else bt=1<<a|n<<r|s,jt=e}function Cl(e){e.return!==null&&(rn(e,1),mf(e,1,0))}function El(e){for(;e===Ti;)Ti=Rn[--$n],Rn[$n]=null,Li=Rn[--$n],Rn[$n]=null;for(;e===gn;)gn=He[--Ve],He[Ve]=null,jt=He[--Ve],He[Ve]=null,bt=He[--Ve],He[Ve]=null}var Fe=null,ze=null,ee=!1,it=null;function hf(e,t){var n=Ge(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 Zc(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,Fe=e,ze=Vt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Fe=e,ze=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gn!==null?{id:bt,overflow:jt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ge(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Fe=e,ze=null,!0):!1;default:return!1}}function Io(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Oo(e){if(ee){var t=ze;if(t){var n=t;if(!Zc(e,t)){if(Io(e))throw Error(I(418));t=Vt(n.nextSibling);var s=Fe;t&&Zc(e,t)?hf(s,n):(e.flags=e.flags&-4097|2,ee=!1,Fe=e)}}else{if(Io(e))throw Error(I(418));e.flags=e.flags&-4097|2,ee=!1,Fe=e}}}function eu(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fe=e}function Br(e){if(e!==Fe)return!1;if(!ee)return eu(e),ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Eo(e.type,e.memoizedProps)),t&&(t=ze)){if(Io(e))throw gf(),Error(I(418));for(;t;)hf(e,t),t=Vt(t.nextSibling)}if(eu(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(I(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ze=Vt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ze=null}}else ze=Fe?Vt(e.stateNode.nextSibling):null;return!0}function gf(){for(var e=ze;e;)e=Vt(e.nextSibling)}function ts(){ze=Fe=null,ee=!1}function Tl(e){it===null?it=[e]:it.push(e)}var mg=Lt.ReactCurrentBatchConfig;function Cs(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(I(309));var s=n.stateNode}if(!s)throw Error(I(147,e));var r=s,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(o){var l=r.refs;o===null?delete l[a]:l[a]=o},t._stringRef=a,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Ur(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function tu(e){var t=e._init;return t(e._payload)}function yf(e){function t(g,h){if(e){var m=g.deletions;m===null?(g.deletions=[h],g.flags|=16):m.push(h)}}function n(g,h){if(!e)return null;for(;h!==null;)t(g,h),h=h.sibling;return null}function s(g,h){for(g=new Map;h!==null;)h.key!==null?g.set(h.key,h):g.set(h.index,h),h=h.sibling;return g}function r(g,h){return g=Yt(g,h),g.index=0,g.sibling=null,g}function a(g,h,m){return g.index=m,e?(m=g.alternate,m!==null?(m=m.index,m<h?(g.flags|=2,h):m):(g.flags|=2,h)):(g.flags|=1048576,h)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,h,m,w){return h===null||h.tag!==6?(h=Ha(m,g.mode,w),h.return=g,h):(h=r(h,m),h.return=g,h)}function c(g,h,m,w){var k=m.type;return k===In?p(g,h,m.props.children,w,m.key):h!==null&&(h.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_t&&tu(k)===h.type)?(w=r(h,m.props),w.ref=Cs(g,h,m),w.return=g,w):(w=pi(m.type,m.key,m.props,null,g.mode,w),w.ref=Cs(g,h,m),w.return=g,w)}function u(g,h,m,w){return h===null||h.tag!==4||h.stateNode.containerInfo!==m.containerInfo||h.stateNode.implementation!==m.implementation?(h=Va(m,g.mode,w),h.return=g,h):(h=r(h,m.children||[]),h.return=g,h)}function p(g,h,m,w,k){return h===null||h.tag!==7?(h=mn(m,g.mode,w,k),h.return=g,h):(h=r(h,m),h.return=g,h)}function d(g,h,m){if(typeof h=="string"&&h!==""||typeof h=="number")return h=Ha(""+h,g.mode,m),h.return=g,h;if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Ir:return m=pi(h.type,h.key,h.props,null,g.mode,m),m.ref=Cs(g,null,h),m.return=g,m;case An:return h=Va(h,g.mode,m),h.return=g,h;case _t:var w=h._init;return d(g,w(h._payload),m)}if(Os(h)||js(h))return h=mn(h,g.mode,m,null),h.return=g,h;Ur(g,h)}return null}function f(g,h,m,w){var k=h!==null?h.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return k!==null?null:l(g,h,""+m,w);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ir:return m.key===k?c(g,h,m,w):null;case An:return m.key===k?u(g,h,m,w):null;case _t:return k=m._init,f(g,h,k(m._payload),w)}if(Os(m)||js(m))return k!==null?null:p(g,h,m,w,null);Ur(g,m)}return null}function x(g,h,m,w,k){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(m)||null,l(h,g,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ir:return g=g.get(w.key===null?m:w.key)||null,c(h,g,w,k);case An:return g=g.get(w.key===null?m:w.key)||null,u(h,g,w,k);case _t:var C=w._init;return x(g,h,m,C(w._payload),k)}if(Os(w)||js(w))return g=g.get(m)||null,p(h,g,w,k,null);Ur(h,w)}return null}function v(g,h,m,w){for(var k=null,C=null,S=h,N=h=0,T=null;S!==null&&N<m.length;N++){S.index>N?(T=S,S=null):T=S.sibling;var A=f(g,S,m[N],w);if(A===null){S===null&&(S=T);break}e&&S&&A.alternate===null&&t(g,S),h=a(A,h,N),C===null?k=A:C.sibling=A,C=A,S=T}if(N===m.length)return n(g,S),ee&&rn(g,N),k;if(S===null){for(;N<m.length;N++)S=d(g,m[N],w),S!==null&&(h=a(S,h,N),C===null?k=S:C.sibling=S,C=S);return ee&&rn(g,N),k}for(S=s(g,S);N<m.length;N++)T=x(S,g,N,m[N],w),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?N:T.key),h=a(T,h,N),C===null?k=T:C.sibling=T,C=T);return e&&S.forEach(function(F){return t(g,F)}),ee&&rn(g,N),k}function y(g,h,m,w){var k=js(m);if(typeof k!="function")throw Error(I(150));if(m=k.call(m),m==null)throw Error(I(151));for(var C=k=null,S=h,N=h=0,T=null,A=m.next();S!==null&&!A.done;N++,A=m.next()){S.index>N?(T=S,S=null):T=S.sibling;var F=f(g,S,A.value,w);if(F===null){S===null&&(S=T);break}e&&S&&F.alternate===null&&t(g,S),h=a(F,h,N),C===null?k=F:C.sibling=F,C=F,S=T}if(A.done)return n(g,S),ee&&rn(g,N),k;if(S===null){for(;!A.done;N++,A=m.next())A=d(g,A.value,w),A!==null&&(h=a(A,h,N),C===null?k=A:C.sibling=A,C=A);return ee&&rn(g,N),k}for(S=s(g,S);!A.done;N++,A=m.next())A=x(S,g,N,A.value,w),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?N:A.key),h=a(A,h,N),C===null?k=A:C.sibling=A,C=A);return e&&S.forEach(function(G){return t(g,G)}),ee&&rn(g,N),k}function j(g,h,m,w){if(typeof m=="object"&&m!==null&&m.type===In&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ir:e:{for(var k=m.key,C=h;C!==null;){if(C.key===k){if(k=m.type,k===In){if(C.tag===7){n(g,C.sibling),h=r(C,m.props.children),h.return=g,g=h;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===_t&&tu(k)===C.type){n(g,C.sibling),h=r(C,m.props),h.ref=Cs(g,C,m),h.return=g,g=h;break e}n(g,C);break}else t(g,C);C=C.sibling}m.type===In?(h=mn(m.props.children,g.mode,w,m.key),h.return=g,g=h):(w=pi(m.type,m.key,m.props,null,g.mode,w),w.ref=Cs(g,h,m),w.return=g,g=w)}return o(g);case An:e:{for(C=m.key;h!==null;){if(h.key===C)if(h.tag===4&&h.stateNode.containerInfo===m.containerInfo&&h.stateNode.implementation===m.implementation){n(g,h.sibling),h=r(h,m.children||[]),h.return=g,g=h;break e}else{n(g,h);break}else t(g,h);h=h.sibling}h=Va(m,g.mode,w),h.return=g,g=h}return o(g);case _t:return C=m._init,j(g,h,C(m._payload),w)}if(Os(m))return v(g,h,m,w);if(js(m))return y(g,h,m,w);Ur(g,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,h!==null&&h.tag===6?(n(g,h.sibling),h=r(h,m),h.return=g,g=h):(n(g,h),h=Ha(m,g.mode,w),h.return=g,g=h),o(g)):n(g,h)}return j}var ns=yf(!0),xf=yf(!1),Ai=tn(null),Ii=null,zn=null,Ll=null;function Al(){Ll=zn=Ii=null}function Il(e){var t=Ai.current;X(Ai),e._currentValue=t}function Po(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Yn(e,t){Ii=e,Ll=zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ie=!0),e.firstContext=null)}function Qe(e){var t=e._currentValue;if(Ll!==e)if(e={context:e,memoizedValue:t,next:null},zn===null){if(Ii===null)throw Error(I(308));zn=e,Ii.dependencies={lanes:0,firstContext:e}}else zn=zn.next=e;return t}var cn=null;function Ol(e){cn===null?cn=[e]:cn.push(e)}function vf(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Ol(t)):(n.next=r.next,r.next=n),t.interleaved=n,Et(e,s)}function Et(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 Dt=!1;function Pl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bf(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 kt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Kt(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,H&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,Et(e,n)}return r=s.interleaved,r===null?(t.next=t,Ol(s)):(t.next=r.next,r.next=t),s.interleaved=t,Et(e,n)}function oi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,xl(e,n)}}function nu(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?r=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?r=a=t:a=a.next=t}else r=a=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:a,shared:s.shared,effects:s.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Oi(e,t,n,s){var r=e.updateQueue;Dt=!1;var a=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==o&&(l===null?p.firstBaseUpdate=u:l.next=u,p.lastBaseUpdate=c))}if(a!==null){var d=r.baseState;o=0,p=u=c=null,l=a;do{var f=l.lane,x=l.eventTime;if((s&f)===f){p!==null&&(p=p.next={eventTime:x,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,y=l;switch(f=t,x=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){d=v.call(x,d,f);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,f=typeof v=="function"?v.call(x,d,f):v,f==null)break e;d=ie({},d,f);break e;case 2:Dt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=r.effects,f===null?r.effects=[l]:f.push(l))}else x={eventTime:x,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(u=p=x,c=d):p=p.next=x,o|=f;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;f=l,l=f.next,f.next=null,r.lastBaseUpdate=f,r.shared.pending=null}}while(!0);if(p===null&&(c=d),r.baseState=c,r.firstBaseUpdate=u,r.lastBaseUpdate=p,t=r.shared.interleaved,t!==null){r=t;do o|=r.lane,r=r.next;while(r!==t)}else a===null&&(r.shared.lanes=0);xn|=o,e.lanes=o,e.memoizedState=d}}function su(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var s=e[t],r=s.callback;if(r!==null){if(s.callback=null,s=n,typeof r!="function")throw Error(I(191,r));r.call(s)}}}var wr={},ht=tn(wr),or=tn(wr),lr=tn(wr);function un(e){if(e===wr)throw Error(I(174));return e}function _l(e,t){switch(q(lr,t),q(or,e),q(ht,wr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:po(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=po(t,e)}X(ht),q(ht,t)}function ss(){X(ht),X(or),X(lr)}function jf(e){un(lr.current);var t=un(ht.current),n=po(t,e.type);t!==n&&(q(or,e),q(ht,n))}function Dl(e){or.current===e&&(X(ht),X(or))}var ne=tn(0);function Pi(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 $a=[];function Ml(){for(var e=0;e<$a.length;e++)$a[e]._workInProgressVersionPrimary=null;$a.length=0}var li=Lt.ReactCurrentDispatcher,za=Lt.ReactCurrentBatchConfig,yn=0,se=null,pe=null,he=null,_i=!1,Hs=!1,cr=0,hg=0;function be(){throw Error(I(321))}function Rl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lt(e[n],t[n]))return!1;return!0}function $l(e,t,n,s,r,a){if(yn=a,se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,li.current=e===null||e.memoizedState===null?vg:bg,e=n(s,r),Hs){a=0;do{if(Hs=!1,cr=0,25<=a)throw Error(I(301));a+=1,he=pe=null,t.updateQueue=null,li.current=jg,e=n(s,r)}while(Hs)}if(li.current=Di,t=pe!==null&&pe.next!==null,yn=0,he=pe=se=null,_i=!1,t)throw Error(I(300));return e}function zl(){var e=cr!==0;return cr=0,e}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return he===null?se.memoizedState=he=e:he=he.next=e,he}function Je(){if(pe===null){var e=se.alternate;e=e!==null?e.memoizedState:null}else e=pe.next;var t=he===null?se.memoizedState:he.next;if(t!==null)he=t,pe=e;else{if(e===null)throw Error(I(310));pe=e,e={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},he===null?se.memoizedState=he=e:he=he.next=e}return he}function ur(e,t){return typeof t=="function"?t(e):t}function Fa(e){var t=Je(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=pe,r=s.baseQueue,a=n.pending;if(a!==null){if(r!==null){var o=r.next;r.next=a.next,a.next=o}s.baseQueue=r=a,n.pending=null}if(r!==null){a=r.next,s=s.baseState;var l=o=null,c=null,u=a;do{var p=u.lane;if((yn&p)===p)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var d={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=d,o=s):c=c.next=d,se.lanes|=p,xn|=p}u=u.next}while(u!==null&&u!==a);c===null?o=s:c.next=l,lt(s,t.memoizedState)||(Ie=!0),t.memoizedState=s,t.baseState=o,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do a=r.lane,se.lanes|=a,xn|=a,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ba(e){var t=Je(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,a=t.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do a=e(a,o.action),o=o.next;while(o!==r);lt(a,t.memoizedState)||(Ie=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,s]}function wf(){}function kf(e,t){var n=se,s=Je(),r=t(),a=!lt(s.memoizedState,r);if(a&&(s.memoizedState=r,Ie=!0),s=s.queue,Fl(Cf.bind(null,n,s,e),[e]),s.getSnapshot!==t||a||he!==null&&he.memoizedState.tag&1){if(n.flags|=2048,dr(9,Sf.bind(null,n,s,r,t),void 0,null),ge===null)throw Error(I(349));yn&30||Nf(n,t,r)}return r}function Nf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=se.updateQueue,t===null?(t={lastEffect:null,stores:null},se.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Sf(e,t,n,s){t.value=n,t.getSnapshot=s,Ef(t)&&Tf(e)}function Cf(e,t,n){return n(function(){Ef(t)&&Tf(e)})}function Ef(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lt(e,n)}catch{return!0}}function Tf(e){var t=Et(e,1);t!==null&&ot(t,e,1,-1)}function ru(e){var t=ft();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ur,lastRenderedState:e},t.queue=e,e=e.dispatch=xg.bind(null,se,e),[t.memoizedState,e]}function dr(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=se.updateQueue,t===null?(t={lastEffect:null,stores:null},se.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e)),e}function Lf(){return Je().memoizedState}function ci(e,t,n,s){var r=ft();se.flags|=e,r.memoizedState=dr(1|t,n,void 0,s===void 0?null:s)}function Zi(e,t,n,s){var r=Je();s=s===void 0?null:s;var a=void 0;if(pe!==null){var o=pe.memoizedState;if(a=o.destroy,s!==null&&Rl(s,o.deps)){r.memoizedState=dr(t,n,a,s);return}}se.flags|=e,r.memoizedState=dr(1|t,n,a,s)}function iu(e,t){return ci(8390656,8,e,t)}function Fl(e,t){return Zi(2048,8,e,t)}function Af(e,t){return Zi(4,2,e,t)}function If(e,t){return Zi(4,4,e,t)}function Of(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 Pf(e,t,n){return n=n!=null?n.concat([e]):null,Zi(4,4,Of.bind(null,t,e),n)}function Bl(){}function _f(e,t){var n=Je();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Rl(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Df(e,t){var n=Je();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Rl(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Mf(e,t,n){return yn&21?(lt(n,t)||(n=Fd(),se.lanes|=n,xn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ie=!0),e.memoizedState=n)}function gg(e,t){var n=K;K=n!==0&&4>n?n:4,e(!0);var s=za.transition;za.transition={};try{e(!1),t()}finally{K=n,za.transition=s}}function Rf(){return Je().memoizedState}function yg(e,t,n){var s=qt(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},$f(e))zf(t,n);else if(n=vf(e,t,n,s),n!==null){var r=Ce();ot(n,e,s,r),Ff(n,t,s)}}function xg(e,t,n){var s=qt(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if($f(e))zf(t,r);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(r.hasEagerState=!0,r.eagerState=l,lt(l,o)){var c=t.interleaved;c===null?(r.next=r,Ol(t)):(r.next=c.next,c.next=r),t.interleaved=r;return}}catch{}finally{}n=vf(e,t,r,s),n!==null&&(r=Ce(),ot(n,e,s,r),Ff(n,t,s))}}function $f(e){var t=e.alternate;return e===se||t!==null&&t===se}function zf(e,t){Hs=_i=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ff(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,xl(e,n)}}var Di={readContext:Qe,useCallback:be,useContext:be,useEffect:be,useImperativeHandle:be,useInsertionEffect:be,useLayoutEffect:be,useMemo:be,useReducer:be,useRef:be,useState:be,useDebugValue:be,useDeferredValue:be,useTransition:be,useMutableSource:be,useSyncExternalStore:be,useId:be,unstable_isNewReconciler:!1},vg={readContext:Qe,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:iu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ci(4194308,4,Of.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ci(4194308,4,e,t)},useInsertionEffect:function(e,t){return ci(4,2,e,t)},useMemo:function(e,t){var n=ft();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=ft();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=yg.bind(null,se,e),[s.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:ru,useDebugValue:Bl,useDeferredValue:function(e){return ft().memoizedState=e},useTransition:function(){var e=ru(!1),t=e[0];return e=gg.bind(null,e[1]),ft().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=se,r=ft();if(ee){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),ge===null)throw Error(I(349));yn&30||Nf(s,t,n)}r.memoizedState=n;var a={value:n,getSnapshot:t};return r.queue=a,iu(Cf.bind(null,s,a,e),[e]),s.flags|=2048,dr(9,Sf.bind(null,s,a,n,t),void 0,null),n},useId:function(){var e=ft(),t=ge.identifierPrefix;if(ee){var n=jt,s=bt;n=(s&~(1<<32-at(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=cr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=hg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},bg={readContext:Qe,useCallback:_f,useContext:Qe,useEffect:Fl,useImperativeHandle:Pf,useInsertionEffect:Af,useLayoutEffect:If,useMemo:Df,useReducer:Fa,useRef:Lf,useState:function(){return Fa(ur)},useDebugValue:Bl,useDeferredValue:function(e){var t=Je();return Mf(t,pe.memoizedState,e)},useTransition:function(){var e=Fa(ur)[0],t=Je().memoizedState;return[e,t]},useMutableSource:wf,useSyncExternalStore:kf,useId:Rf,unstable_isNewReconciler:!1},jg={readContext:Qe,useCallback:_f,useContext:Qe,useEffect:Fl,useImperativeHandle:Pf,useInsertionEffect:Af,useLayoutEffect:If,useMemo:Df,useReducer:Ba,useRef:Lf,useState:function(){return Ba(ur)},useDebugValue:Bl,useDeferredValue:function(e){var t=Je();return pe===null?t.memoizedState=e:Mf(t,pe.memoizedState,e)},useTransition:function(){var e=Ba(ur)[0],t=Je().memoizedState;return[e,t]},useMutableSource:wf,useSyncExternalStore:kf,useId:Rf,unstable_isNewReconciler:!1};function nt(e,t){if(e&&e.defaultProps){t=ie({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _o(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:ie({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ea={isMounted:function(e){return(e=e._reactInternals)?kn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Ce(),r=qt(e),a=kt(s,r);a.payload=t,n!=null&&(a.callback=n),t=Kt(e,a,r),t!==null&&(ot(t,e,r,s),oi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Ce(),r=qt(e),a=kt(s,r);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=Kt(e,a,r),t!==null&&(ot(t,e,r,s),oi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ce(),s=qt(e),r=kt(n,s);r.tag=2,t!=null&&(r.callback=t),t=Kt(e,r,s),t!==null&&(ot(t,e,s,n),oi(t,e,s))}};function au(e,t,n,s,r,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,a,o):t.prototype&&t.prototype.isPureReactComponent?!sr(n,s)||!sr(r,a):!0}function Bf(e,t,n){var s=!1,r=Zt,a=t.contextType;return typeof a=="object"&&a!==null?a=Qe(a):(r=_e(t)?hn:ke.current,s=t.contextTypes,a=(s=s!=null)?es(e,r):Zt),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ea,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=a),t}function ou(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&ea.enqueueReplaceState(t,t.state,null)}function Do(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Pl(e);var a=t.contextType;typeof a=="object"&&a!==null?r.context=Qe(a):(a=_e(t)?hn:ke.current,r.context=es(e,a)),r.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(_o(e,t,a,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&ea.enqueueReplaceState(r,r.state,null),Oi(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function rs(e,t){try{var n="",s=t;do n+=Ym(s),s=s.return;while(s);var r=n}catch(a){r=`
|
|
39
|
+
Error generating stack: `+a.message+`
|
|
40
|
+
`+a.stack}return{value:e,source:t,stack:r,digest:null}}function Ua(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Mo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var wg=typeof WeakMap=="function"?WeakMap:Map;function Uf(e,t,n){n=kt(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Ri||(Ri=!0,Ko=s),Mo(e,t)},n}function Wf(e,t,n){n=kt(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var r=t.value;n.payload=function(){return s(r)},n.callback=function(){Mo(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(n.callback=function(){Mo(e,t),typeof s!="function"&&(Gt===null?Gt=new Set([this]):Gt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function lu(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new wg;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(n)||(r.add(n),e=Mg.bind(null,e,t,n),t.then(e,e))}function cu(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 uu(e,t,n,s,r){return e.mode&1?(e.flags|=65536,e.lanes=r,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=kt(-1,1),t.tag=2,Kt(n,t,1))),n.lanes|=1),e)}var kg=Lt.ReactCurrentOwner,Ie=!1;function Ne(e,t,n,s){t.child=e===null?xf(t,null,n,s):ns(t,e.child,n,s)}function du(e,t,n,s,r){n=n.render;var a=t.ref;return Yn(t,r),s=$l(e,t,n,s,a,r),n=zl(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Tt(e,t,r)):(ee&&n&&Cl(t),t.flags|=1,Ne(e,t,s,r),t.child)}function fu(e,t,n,s,r){if(e===null){var a=n.type;return typeof a=="function"&&!Yl(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Hf(e,t,a,s,r)):(e=pi(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&r)){var o=a.memoizedProps;if(n=n.compare,n=n!==null?n:sr,n(o,s)&&e.ref===t.ref)return Tt(e,t,r)}return t.flags|=1,e=Yt(a,s),e.ref=t.ref,e.return=t,t.child=e}function Hf(e,t,n,s,r){if(e!==null){var a=e.memoizedProps;if(sr(a,s)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=s=a,(e.lanes&r)!==0)e.flags&131072&&(Ie=!0);else return t.lanes=e.lanes,Tt(e,t,r)}return Ro(e,t,n,s,r)}function Vf(e,t,n){var s=t.pendingProps,r=s.children,a=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},q(Bn,Re),Re|=n;else{if(!(n&1073741824))return e=a!==null?a.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,q(Bn,Re),Re|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=a!==null?a.baseLanes:n,q(Bn,Re),Re|=s}else a!==null?(s=a.baseLanes|n,t.memoizedState=null):s=n,q(Bn,Re),Re|=s;return Ne(e,t,r,n),t.child}function Kf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ro(e,t,n,s,r){var a=_e(n)?hn:ke.current;return a=es(t,a),Yn(t,r),n=$l(e,t,n,s,a,r),s=zl(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Tt(e,t,r)):(ee&&s&&Cl(t),t.flags|=1,Ne(e,t,n,r),t.child)}function pu(e,t,n,s,r){if(_e(n)){var a=!0;Ei(t)}else a=!1;if(Yn(t,r),t.stateNode===null)ui(e,t),Bf(t,n,s),Do(t,n,s,r),s=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=Qe(u):(u=_e(n)?hn:ke.current,u=es(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==s||c!==u)&&ou(t,o,s,u),Dt=!1;var f=t.memoizedState;o.state=f,Oi(t,s,o,r),c=t.memoizedState,l!==s||f!==c||Pe.current||Dt?(typeof p=="function"&&(_o(t,n,p,s),c=t.memoizedState),(l=Dt||au(t,n,l,s,f,c,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),o.props=s,o.state=c,o.context=u,s=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{o=t.stateNode,bf(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:nt(t.type,l),o.props=u,d=t.pendingProps,f=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Qe(c):(c=_e(n)?hn:ke.current,c=es(t,c));var x=n.getDerivedStateFromProps;(p=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==d||f!==c)&&ou(t,o,s,c),Dt=!1,f=t.memoizedState,o.state=f,Oi(t,s,o,r);var v=t.memoizedState;l!==d||f!==v||Pe.current||Dt?(typeof x=="function"&&(_o(t,n,x,s),v=t.memoizedState),(u=Dt||au(t,n,u,s,f,v,c)||!1)?(p||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(s,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(s,v,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=v),o.props=s,o.state=v,o.context=c,s=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return $o(e,t,n,s,a,r)}function $o(e,t,n,s,r,a){Kf(e,t);var o=(t.flags&128)!==0;if(!s&&!o)return r&&Xc(t,n,!1),Tt(e,t,a);s=t.stateNode,kg.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&o?(t.child=ns(t,e.child,null,a),t.child=ns(t,null,l,a)):Ne(e,t,l,a),t.memoizedState=s.state,r&&Xc(t,n,!0),t.child}function Gf(e){var t=e.stateNode;t.pendingContext?Jc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Jc(e,t.context,!1),_l(e,t.containerInfo)}function mu(e,t,n,s,r){return ts(),Tl(r),t.flags|=256,Ne(e,t,n,s),t.child}var zo={dehydrated:null,treeContext:null,retryLane:0};function Fo(e){return{baseLanes:e,cachePool:null,transitions:null}}function qf(e,t,n){var s=t.pendingProps,r=ne.current,a=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(r&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),q(ne,r&1),e===null)return Oo(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):(o=s.children,e=s.fallback,a?(s=t.mode,a=t.child,o={mode:"hidden",children:o},!(s&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=sa(o,s,0,null),e=mn(e,s,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Fo(n),t.memoizedState=zo,e):Ul(t,o));if(r=e.memoizedState,r!==null&&(l=r.dehydrated,l!==null))return Ng(e,t,o,s,l,r,n);if(a){a=s.fallback,o=t.mode,r=e.child,l=r.sibling;var c={mode:"hidden",children:s.children};return!(o&1)&&t.child!==r?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Yt(r,c),s.subtreeFlags=r.subtreeFlags&14680064),l!==null?a=Yt(l,a):(a=mn(a,o,n,null),a.flags|=2),a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,o=e.child.memoizedState,o=o===null?Fo(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=zo,s}return a=e.child,e=a.sibling,s=Yt(a,{mode:"visible",children:s.children}),!(t.mode&1)&&(s.lanes=n),s.return=t,s.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=s,t.memoizedState=null,s}function Ul(e,t){return t=sa({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wr(e,t,n,s){return s!==null&&Tl(s),ns(t,e.child,null,n),e=Ul(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ng(e,t,n,s,r,a,o){if(n)return t.flags&256?(t.flags&=-257,s=Ua(Error(I(422))),Wr(e,t,o,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=s.fallback,r=t.mode,s=sa({mode:"visible",children:s.children},r,0,null),a=mn(a,r,o,null),a.flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,t.mode&1&&ns(t,e.child,null,o),t.child.memoizedState=Fo(o),t.memoizedState=zo,a);if(!(t.mode&1))return Wr(e,t,o,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var l=s.dgst;return s=l,a=Error(I(419)),s=Ua(a,s,void 0),Wr(e,t,o,s)}if(l=(o&e.childLanes)!==0,Ie||l){if(s=ge,s!==null){switch(o&-o){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=r&(s.suspendedLanes|o)?0:r,r!==0&&r!==a.retryLane&&(a.retryLane=r,Et(e,r),ot(s,e,r,-1))}return ql(),s=Ua(Error(I(421))),Wr(e,t,o,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Rg.bind(null,e),r._reactRetry=t,null):(e=a.treeContext,ze=Vt(r.nextSibling),Fe=t,ee=!0,it=null,e!==null&&(He[Ve++]=bt,He[Ve++]=jt,He[Ve++]=gn,bt=e.id,jt=e.overflow,gn=t),t=Ul(t,s.children),t.flags|=4096,t)}function hu(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Po(e.return,t,n)}function Wa(e,t,n,s,r){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=s,a.tail=n,a.tailMode=r)}function Yf(e,t,n){var s=t.pendingProps,r=s.revealOrder,a=s.tail;if(Ne(e,t,s.children,n),s=ne.current,s&2)s=s&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&&hu(e,n,t);else if(e.tag===19)hu(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}s&=1}if(q(ne,s),!(t.mode&1))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Pi(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Wa(t,!1,r,n,a);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Pi(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Wa(t,!0,n,null,a);break;case"together":Wa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ui(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Tt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=Yt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sg(e,t,n){switch(t.tag){case 3:Gf(t),ts();break;case 5:jf(t);break;case 1:_e(t.type)&&Ei(t);break;case 4:_l(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;q(Ai,s._currentValue),s._currentValue=r;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(q(ne,ne.current&1),t.flags|=128,null):n&t.child.childLanes?qf(e,t,n):(q(ne,ne.current&1),e=Tt(e,t,n),e!==null?e.sibling:null);q(ne,ne.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Yf(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),q(ne,ne.current),s)break;return null;case 22:case 23:return t.lanes=0,Vf(e,t,n)}return Tt(e,t,n)}var Qf,Bo,Jf,Xf;Qf=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}};Bo=function(){};Jf=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,un(ht.current);var a=null;switch(n){case"input":r=lo(e,r),s=lo(e,s),a=[];break;case"select":r=ie({},r,{value:void 0}),s=ie({},s,{value:void 0}),a=[];break;case"textarea":r=fo(e,r),s=fo(e,s),a=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Si)}mo(n,s);var o;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var l=r[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Qs.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in s){var c=s[u];if(l=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(a||(a=[]),a.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Qs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&J("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}n&&(a=a||[]).push("style",n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};Xf=function(e,t,n,s){n!==s&&(t.flags|=4)};function Es(e,t){if(!ee)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function je(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags&14680064,s|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Cg(e,t,n){var s=t.pendingProps;switch(El(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return je(t),null;case 1:return _e(t.type)&&Ci(),je(t),null;case 3:return s=t.stateNode,ss(),X(Pe),X(ke),Ml(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Br(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,it!==null&&(Yo(it),it=null))),Bo(e,t),je(t),null;case 5:Dl(t);var r=un(lr.current);if(n=t.type,e!==null&&t.stateNode!=null)Jf(e,t,n,s,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!s){if(t.stateNode===null)throw Error(I(166));return je(t),null}if(e=un(ht.current),Br(t)){s=t.stateNode,n=t.type;var a=t.memoizedProps;switch(s[pt]=t,s[ar]=a,e=(t.mode&1)!==0,n){case"dialog":J("cancel",s),J("close",s);break;case"iframe":case"object":case"embed":J("load",s);break;case"video":case"audio":for(r=0;r<_s.length;r++)J(_s[r],s);break;case"source":J("error",s);break;case"img":case"image":case"link":J("error",s),J("load",s);break;case"details":J("toggle",s);break;case"input":Nc(s,a),J("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!a.multiple},J("invalid",s);break;case"textarea":Cc(s,a),J("invalid",s)}mo(n,a),r=null;for(var o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="children"?typeof l=="string"?s.textContent!==l&&(a.suppressHydrationWarning!==!0&&Fr(s.textContent,l,e),r=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Fr(s.textContent,l,e),r=["children",""+l]):Qs.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&J("scroll",s)}switch(n){case"input":Or(s),Sc(s,a,!0);break;case"textarea":Or(s),Ec(s);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(s.onclick=Si)}s=r,t.updateQueue=s,s!==null&&(t.flags|=4)}else{o=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Sd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=o.createElement(n,{is:s.is}):(e=o.createElement(n),n==="select"&&(o=e,s.multiple?o.multiple=!0:s.size&&(o.size=s.size))):e=o.createElementNS(e,n),e[pt]=t,e[ar]=s,Qf(e,t,!1,!1),t.stateNode=e;e:{switch(o=ho(n,s),n){case"dialog":J("cancel",e),J("close",e),r=s;break;case"iframe":case"object":case"embed":J("load",e),r=s;break;case"video":case"audio":for(r=0;r<_s.length;r++)J(_s[r],e);r=s;break;case"source":J("error",e),r=s;break;case"img":case"image":case"link":J("error",e),J("load",e),r=s;break;case"details":J("toggle",e),r=s;break;case"input":Nc(e,s),r=lo(e,s),J("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=ie({},s,{value:void 0}),J("invalid",e);break;case"textarea":Cc(e,s),r=fo(e,s),J("invalid",e);break;default:r=s}mo(n,r),l=r;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?Td(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Cd(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Js(e,c):typeof c=="number"&&Js(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Qs.hasOwnProperty(a)?c!=null&&a==="onScroll"&&J("scroll",e):c!=null&&fl(e,a,c,o))}switch(n){case"input":Or(e),Sc(e,s,!1);break;case"textarea":Or(e),Ec(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Xt(s.value));break;case"select":e.multiple=!!s.multiple,a=s.value,a!=null?Vn(e,!!s.multiple,a,!1):s.defaultValue!=null&&Vn(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=Si)}switch(n){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}}s&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return je(t),null;case 6:if(e&&t.stateNode!=null)Xf(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(n=un(lr.current),un(ht.current),Br(t)){if(s=t.stateNode,n=t.memoizedProps,s[pt]=t,(a=s.nodeValue!==n)&&(e=Fe,e!==null))switch(e.tag){case 3:Fr(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Fr(s.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[pt]=t,t.stateNode=s}return je(t),null;case 13:if(X(ne),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ee&&ze!==null&&t.mode&1&&!(t.flags&128))gf(),ts(),t.flags|=98560,a=!1;else if(a=Br(t),s!==null&&s.dehydrated!==null){if(e===null){if(!a)throw Error(I(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(I(317));a[pt]=t}else ts(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;je(t),a=!1}else it!==null&&(Yo(it),it=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(s=s!==null,s!==(e!==null&&e.memoizedState!==null)&&s&&(t.child.flags|=8192,t.mode&1&&(e===null||ne.current&1?me===0&&(me=3):ql())),t.updateQueue!==null&&(t.flags|=4),je(t),null);case 4:return ss(),Bo(e,t),e===null&&rr(t.stateNode.containerInfo),je(t),null;case 10:return Il(t.type._context),je(t),null;case 17:return _e(t.type)&&Ci(),je(t),null;case 19:if(X(ne),a=t.memoizedState,a===null)return je(t),null;if(s=(t.flags&128)!==0,o=a.rendering,o===null)if(s)Es(a,!1);else{if(me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Pi(e),o!==null){for(t.flags|=128,Es(a,!1),s=o.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)a=n,e=s,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return q(ne,ne.current&1|2),t.child}e=e.sibling}a.tail!==null&&oe()>is&&(t.flags|=128,s=!0,Es(a,!1),t.lanes=4194304)}else{if(!s)if(e=Pi(o),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Es(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!ee)return je(t),null}else 2*oe()-a.renderingStartTime>is&&n!==1073741824&&(t.flags|=128,s=!0,Es(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=oe(),t.sibling=null,n=ne.current,q(ne,s?n&1|2:n&1),t):(je(t),null);case 22:case 23:return Gl(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Re&1073741824&&(je(t),t.subtreeFlags&6&&(t.flags|=8192)):je(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function Eg(e,t){switch(El(t),t.tag){case 1:return _e(t.type)&&Ci(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ss(),X(Pe),X(ke),Ml(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Dl(t),null;case 13:if(X(ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(ne),null;case 4:return ss(),null;case 10:return Il(t.type._context),null;case 22:case 23:return Gl(),null;case 24:return null;default:return null}}var Hr=!1,we=!1,Tg=typeof WeakSet=="function"?WeakSet:Set,_=null;function Fn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){ae(e,t,s)}else n.current=null}function Uo(e,t,n){try{n()}catch(s){ae(e,t,s)}}var gu=!1;function Lg(e,t){if(So=wi,e=nf(),Sl(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var r=s.anchorOffset,a=s.focusNode;s=s.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,p=0,d=e,f=null;t:for(;;){for(var x;d!==n||r!==0&&d.nodeType!==3||(l=o+r),d!==a||s!==0&&d.nodeType!==3||(c=o+s),d.nodeType===3&&(o+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=o),f===a&&++p===s&&(c=o),(x=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=x}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Co={focusedElem:e,selectionRange:n},wi=!1,_=t;_!==null;)if(t=_,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_=e;else for(;_!==null;){t=_;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,j=v.memoizedState,g=t.stateNode,h=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:nt(t.type,y),j);g.__reactInternalSnapshotBeforeUpdate=h}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(w){ae(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,_=e;break}_=t.return}return v=gu,gu=!1,v}function Vs(e,t,n){var s=t.updateQueue;if(s=s!==null?s.lastEffect:null,s!==null){var r=s=s.next;do{if((r.tag&e)===e){var a=r.destroy;r.destroy=void 0,a!==void 0&&Uo(t,n,a)}r=r.next}while(r!==s)}}function ta(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 s=n.create;n.destroy=s()}n=n.next}while(n!==t)}}function Wo(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 Zf(e){var t=e.alternate;t!==null&&(e.alternate=null,Zf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pt],delete t[ar],delete t[Lo],delete t[dg],delete t[fg])),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 ep(e){return e.tag===5||e.tag===3||e.tag===4}function yu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ep(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 Ho(e,t,n){var s=e.tag;if(s===5||s===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=Si));else if(s!==4&&(e=e.child,e!==null))for(Ho(e,t,n),e=e.sibling;e!==null;)Ho(e,t,n),e=e.sibling}function Vo(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(e=e.child,e!==null))for(Vo(e,t,n),e=e.sibling;e!==null;)Vo(e,t,n),e=e.sibling}var ye=null,rt=!1;function Ot(e,t,n){for(n=n.child;n!==null;)tp(e,t,n),n=n.sibling}function tp(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(Gi,n)}catch{}switch(n.tag){case 5:we||Fn(n,t);case 6:var s=ye,r=rt;ye=null,Ot(e,t,n),ye=s,rt=r,ye!==null&&(rt?(e=ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ye.removeChild(n.stateNode));break;case 18:ye!==null&&(rt?(e=ye,n=n.stateNode,e.nodeType===8?Ma(e.parentNode,n):e.nodeType===1&&Ma(e,n),tr(e)):Ma(ye,n.stateNode));break;case 4:s=ye,r=rt,ye=n.stateNode.containerInfo,rt=!0,Ot(e,t,n),ye=s,rt=r;break;case 0:case 11:case 14:case 15:if(!we&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var a=r,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Uo(n,t,o),r=r.next}while(r!==s)}Ot(e,t,n);break;case 1:if(!we&&(Fn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){ae(n,t,l)}Ot(e,t,n);break;case 21:Ot(e,t,n);break;case 22:n.mode&1?(we=(s=we)||n.memoizedState!==null,Ot(e,t,n),we=s):Ot(e,t,n);break;default:Ot(e,t,n)}}function xu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Tg),t.forEach(function(s){var r=$g.bind(null,e,s);n.has(s)||(n.add(s),s.then(r,r))})}}function et(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var r=n[s];try{var a=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:ye=l.stateNode,rt=!1;break e;case 3:ye=l.stateNode.containerInfo,rt=!0;break e;case 4:ye=l.stateNode.containerInfo,rt=!0;break e}l=l.return}if(ye===null)throw Error(I(160));tp(a,o,r),ye=null,rt=!1;var c=r.alternate;c!==null&&(c.return=null),r.return=null}catch(u){ae(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)np(t,e),t=t.sibling}function np(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(et(t,e),dt(e),s&4){try{Vs(3,e,e.return),ta(3,e)}catch(y){ae(e,e.return,y)}try{Vs(5,e,e.return)}catch(y){ae(e,e.return,y)}}break;case 1:et(t,e),dt(e),s&512&&n!==null&&Fn(n,n.return);break;case 5:if(et(t,e),dt(e),s&512&&n!==null&&Fn(n,n.return),e.flags&32){var r=e.stateNode;try{Js(r,"")}catch(y){ae(e,e.return,y)}}if(s&4&&(r=e.stateNode,r!=null)){var a=e.memoizedProps,o=n!==null?n.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&kd(r,a),ho(l,o);var u=ho(l,a);for(o=0;o<c.length;o+=2){var p=c[o],d=c[o+1];p==="style"?Td(r,d):p==="dangerouslySetInnerHTML"?Cd(r,d):p==="children"?Js(r,d):fl(r,p,d,u)}switch(l){case"input":co(r,a);break;case"textarea":Nd(r,a);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!a.multiple;var x=a.value;x!=null?Vn(r,!!a.multiple,x,!1):f!==!!a.multiple&&(a.defaultValue!=null?Vn(r,!!a.multiple,a.defaultValue,!0):Vn(r,!!a.multiple,a.multiple?[]:"",!1))}r[ar]=a}catch(y){ae(e,e.return,y)}}break;case 6:if(et(t,e),dt(e),s&4){if(e.stateNode===null)throw Error(I(162));r=e.stateNode,a=e.memoizedProps;try{r.nodeValue=a}catch(y){ae(e,e.return,y)}}break;case 3:if(et(t,e),dt(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{tr(t.containerInfo)}catch(y){ae(e,e.return,y)}break;case 4:et(t,e),dt(e);break;case 13:et(t,e),dt(e),r=e.child,r.flags&8192&&(a=r.memoizedState!==null,r.stateNode.isHidden=a,!a||r.alternate!==null&&r.alternate.memoizedState!==null||(Vl=oe())),s&4&&xu(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(we=(u=we)||p,et(t,e),we=u):et(t,e),dt(e),s&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!p&&e.mode&1)for(_=e,p=e.child;p!==null;){for(d=_=p;_!==null;){switch(f=_,x=f.child,f.tag){case 0:case 11:case 14:case 15:Vs(4,f,f.return);break;case 1:Fn(f,f.return);var v=f.stateNode;if(typeof v.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(y){ae(s,n,y)}}break;case 5:Fn(f,f.return);break;case 22:if(f.memoizedState!==null){bu(d);continue}}x!==null?(x.return=f,_=x):bu(d)}p=p.sibling}e:for(p=null,d=e;;){if(d.tag===5){if(p===null){p=d;try{r=d.stateNode,u?(a=r.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=d.stateNode,c=d.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Ed("display",o))}catch(y){ae(e,e.return,y)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){ae(e,e.return,y)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:et(t,e),dt(e),s&4&&xu(e);break;case 21:break;default:et(t,e),dt(e)}}function dt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ep(n)){var s=n;break e}n=n.return}throw Error(I(160))}switch(s.tag){case 5:var r=s.stateNode;s.flags&32&&(Js(r,""),s.flags&=-33);var a=yu(e);Vo(e,a,r);break;case 3:case 4:var o=s.stateNode.containerInfo,l=yu(e);Ho(e,l,o);break;default:throw Error(I(161))}}catch(c){ae(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ag(e,t,n){_=e,sp(e)}function sp(e,t,n){for(var s=(e.mode&1)!==0;_!==null;){var r=_,a=r.child;if(r.tag===22&&s){var o=r.memoizedState!==null||Hr;if(!o){var l=r.alternate,c=l!==null&&l.memoizedState!==null||we;l=Hr;var u=we;if(Hr=o,(we=c)&&!u)for(_=r;_!==null;)o=_,c=o.child,o.tag===22&&o.memoizedState!==null?ju(r):c!==null?(c.return=o,_=c):ju(r);for(;a!==null;)_=a,sp(a),a=a.sibling;_=r,Hr=l,we=u}vu(e)}else r.subtreeFlags&8772&&a!==null?(a.return=r,_=a):vu(e)}}function vu(e){for(;_!==null;){var t=_;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:we||ta(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!we)if(n===null)s.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:nt(t.type,n.memoizedProps);s.componentDidUpdate(r,n.memoizedState,s.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&su(t,a,s);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}su(t,o,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 p=u.memoizedState;if(p!==null){var d=p.dehydrated;d!==null&&tr(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}we||t.flags&512&&Wo(t)}catch(f){ae(t,t.return,f)}}if(t===e){_=null;break}if(n=t.sibling,n!==null){n.return=t.return,_=n;break}_=t.return}}function bu(e){for(;_!==null;){var t=_;if(t===e){_=null;break}var n=t.sibling;if(n!==null){n.return=t.return,_=n;break}_=t.return}}function ju(e){for(;_!==null;){var t=_;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ta(4,t)}catch(c){ae(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var r=t.return;try{s.componentDidMount()}catch(c){ae(t,r,c)}}var a=t.return;try{Wo(t)}catch(c){ae(t,a,c)}break;case 5:var o=t.return;try{Wo(t)}catch(c){ae(t,o,c)}}}catch(c){ae(t,t.return,c)}if(t===e){_=null;break}var l=t.sibling;if(l!==null){l.return=t.return,_=l;break}_=t.return}}var Ig=Math.ceil,Mi=Lt.ReactCurrentDispatcher,Wl=Lt.ReactCurrentOwner,qe=Lt.ReactCurrentBatchConfig,H=0,ge=null,de=null,xe=0,Re=0,Bn=tn(0),me=0,fr=null,xn=0,na=0,Hl=0,Ks=null,Ae=null,Vl=0,is=1/0,xt=null,Ri=!1,Ko=null,Gt=null,Vr=!1,Ft=null,$i=0,Gs=0,Go=null,di=-1,fi=0;function Ce(){return H&6?oe():di!==-1?di:di=oe()}function qt(e){return e.mode&1?H&2&&xe!==0?xe&-xe:mg.transition!==null?(fi===0&&(fi=Fd()),fi):(e=K,e!==0||(e=window.event,e=e===void 0?16:Gd(e.type)),e):1}function ot(e,t,n,s){if(50<Gs)throw Gs=0,Go=null,Error(I(185));vr(e,n,s),(!(H&2)||e!==ge)&&(e===ge&&(!(H&2)&&(na|=n),me===4&&$t(e,xe)),De(e,s),n===1&&H===0&&!(t.mode&1)&&(is=oe()+500,Xi&&nn()))}function De(e,t){var n=e.callbackNode;mh(e,t);var s=ji(e,e===ge?xe:0);if(s===0)n!==null&&Ac(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Ac(n),t===1)e.tag===0?pg(wu.bind(null,e)):pf(wu.bind(null,e)),cg(function(){!(H&6)&&nn()}),n=null;else{switch(Bd(s)){case 1:n=yl;break;case 4:n=$d;break;case 16:n=bi;break;case 536870912:n=zd;break;default:n=bi}n=dp(n,rp.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function rp(e,t){if(di=-1,fi=0,H&6)throw Error(I(327));var n=e.callbackNode;if(Qn()&&e.callbackNode!==n)return null;var s=ji(e,e===ge?xe:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=zi(e,s);else{t=s;var r=H;H|=2;var a=ap();(ge!==e||xe!==t)&&(xt=null,is=oe()+500,pn(e,t));do try{_g();break}catch(l){ip(e,l)}while(!0);Al(),Mi.current=a,H=r,de!==null?t=0:(ge=null,xe=0,t=me)}if(t!==0){if(t===2&&(r=bo(e),r!==0&&(s=r,t=qo(e,r))),t===1)throw n=fr,pn(e,0),$t(e,s),De(e,oe()),n;if(t===6)$t(e,s);else{if(r=e.current.alternate,!(s&30)&&!Og(r)&&(t=zi(e,s),t===2&&(a=bo(e),a!==0&&(s=a,t=qo(e,a))),t===1))throw n=fr,pn(e,0),$t(e,s),De(e,oe()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(I(345));case 2:an(e,Ae,xt);break;case 3:if($t(e,s),(s&130023424)===s&&(t=Vl+500-oe(),10<t)){if(ji(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Ce(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=To(an.bind(null,e,Ae,xt),t);break}an(e,Ae,xt);break;case 4:if($t(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var o=31-at(s);a=1<<o,o=t[o],o>r&&(r=o),s&=~a}if(s=r,s=oe()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Ig(s/1960))-s,10<s){e.timeoutHandle=To(an.bind(null,e,Ae,xt),s);break}an(e,Ae,xt);break;case 5:an(e,Ae,xt);break;default:throw Error(I(329))}}}return De(e,oe()),e.callbackNode===n?rp.bind(null,e):null}function qo(e,t){var n=Ks;return e.current.memoizedState.isDehydrated&&(pn(e,t).flags|=256),e=zi(e,t),e!==2&&(t=Ae,Ae=n,t!==null&&Yo(t)),e}function Yo(e){Ae===null?Ae=e:Ae.push.apply(Ae,e)}function Og(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var s=0;s<n.length;s++){var r=n[s],a=r.getSnapshot;r=r.value;try{if(!lt(a(),r))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $t(e,t){for(t&=~Hl,t&=~na,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-at(t),s=1<<n;e[n]=-1,t&=~s}}function wu(e){if(H&6)throw Error(I(327));Qn();var t=ji(e,0);if(!(t&1))return De(e,oe()),null;var n=zi(e,t);if(e.tag!==0&&n===2){var s=bo(e);s!==0&&(t=s,n=qo(e,s))}if(n===1)throw n=fr,pn(e,0),$t(e,t),De(e,oe()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,an(e,Ae,xt),De(e,oe()),null}function Kl(e,t){var n=H;H|=1;try{return e(t)}finally{H=n,H===0&&(is=oe()+500,Xi&&nn())}}function vn(e){Ft!==null&&Ft.tag===0&&!(H&6)&&Qn();var t=H;H|=1;var n=qe.transition,s=K;try{if(qe.transition=null,K=1,e)return e()}finally{K=s,qe.transition=n,H=t,!(H&6)&&nn()}}function Gl(){Re=Bn.current,X(Bn)}function pn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,lg(n)),de!==null)for(n=de.return;n!==null;){var s=n;switch(El(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Ci();break;case 3:ss(),X(Pe),X(ke),Ml();break;case 5:Dl(s);break;case 4:ss();break;case 13:X(ne);break;case 19:X(ne);break;case 10:Il(s.type._context);break;case 22:case 23:Gl()}n=n.return}if(ge=e,de=e=Yt(e.current,null),xe=Re=t,me=0,fr=null,Hl=na=xn=0,Ae=Ks=null,cn!==null){for(t=0;t<cn.length;t++)if(n=cn[t],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,a=n.pending;if(a!==null){var o=a.next;a.next=r,s.next=o}n.pending=s}cn=null}return e}function ip(e,t){do{var n=de;try{if(Al(),li.current=Di,_i){for(var s=se.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}_i=!1}if(yn=0,he=pe=se=null,Hs=!1,cr=0,Wl.current=null,n===null||n.return===null){me=1,fr=t,de=null;break}e:{var a=e,o=n.return,l=n,c=t;if(t=xe,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,p=l,d=p.tag;if(!(p.mode&1)&&(d===0||d===11||d===15)){var f=p.alternate;f?(p.updateQueue=f.updateQueue,p.memoizedState=f.memoizedState,p.lanes=f.lanes):(p.updateQueue=null,p.memoizedState=null)}var x=cu(o);if(x!==null){x.flags&=-257,uu(x,o,l,a,t),x.mode&1&&lu(a,u,t),t=x,c=u;var v=t.updateQueue;if(v===null){var y=new Set;y.add(c),t.updateQueue=y}else v.add(c);break e}else{if(!(t&1)){lu(a,u,t),ql();break e}c=Error(I(426))}}else if(ee&&l.mode&1){var j=cu(o);if(j!==null){!(j.flags&65536)&&(j.flags|=256),uu(j,o,l,a,t),Tl(rs(c,l));break e}}a=c=rs(c,l),me!==4&&(me=2),Ks===null?Ks=[a]:Ks.push(a),a=o;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var g=Uf(a,c,t);nu(a,g);break e;case 1:l=c;var h=a.type,m=a.stateNode;if(!(a.flags&128)&&(typeof h.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Gt===null||!Gt.has(m)))){a.flags|=65536,t&=-t,a.lanes|=t;var w=Wf(a,l,t);nu(a,w);break e}}a=a.return}while(a!==null)}lp(n)}catch(k){t=k,de===n&&n!==null&&(de=n=n.return);continue}break}while(!0)}function ap(){var e=Mi.current;return Mi.current=Di,e===null?Di:e}function ql(){(me===0||me===3||me===2)&&(me=4),ge===null||!(xn&268435455)&&!(na&268435455)||$t(ge,xe)}function zi(e,t){var n=H;H|=2;var s=ap();(ge!==e||xe!==t)&&(xt=null,pn(e,t));do try{Pg();break}catch(r){ip(e,r)}while(!0);if(Al(),H=n,Mi.current=s,de!==null)throw Error(I(261));return ge=null,xe=0,me}function Pg(){for(;de!==null;)op(de)}function _g(){for(;de!==null&&!ih();)op(de)}function op(e){var t=up(e.alternate,e,Re);e.memoizedProps=e.pendingProps,t===null?lp(e):de=t,Wl.current=null}function lp(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Eg(n,t),n!==null){n.flags&=32767,de=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{me=6,de=null;return}}else if(n=Cg(n,t,Re),n!==null){de=n;return}if(t=t.sibling,t!==null){de=t;return}de=t=e}while(t!==null);me===0&&(me=5)}function an(e,t,n){var s=K,r=qe.transition;try{qe.transition=null,K=1,Dg(e,t,n,s)}finally{qe.transition=r,K=s}return null}function Dg(e,t,n,s){do Qn();while(Ft!==null);if(H&6)throw Error(I(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(I(177));e.callbackNode=null,e.callbackPriority=0;var a=n.lanes|n.childLanes;if(hh(e,a),e===ge&&(de=ge=null,xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Vr||(Vr=!0,dp(bi,function(){return Qn(),null})),a=(n.flags&15990)!==0,n.subtreeFlags&15990||a){a=qe.transition,qe.transition=null;var o=K;K=1;var l=H;H|=4,Wl.current=null,Lg(e,n),np(n,e),tg(Co),wi=!!So,Co=So=null,e.current=n,Ag(n),ah(),H=l,K=o,qe.transition=a}else e.current=n;if(Vr&&(Vr=!1,Ft=e,$i=r),a=e.pendingLanes,a===0&&(Gt=null),ch(n.stateNode),De(e,oe()),t!==null)for(s=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],s(r.value,{componentStack:r.stack,digest:r.digest});if(Ri)throw Ri=!1,e=Ko,Ko=null,e;return $i&1&&e.tag!==0&&Qn(),a=e.pendingLanes,a&1?e===Go?Gs++:(Gs=0,Go=e):Gs=0,nn(),null}function Qn(){if(Ft!==null){var e=Bd($i),t=qe.transition,n=K;try{if(qe.transition=null,K=16>e?16:e,Ft===null)var s=!1;else{if(e=Ft,Ft=null,$i=0,H&6)throw Error(I(331));var r=H;for(H|=4,_=e.current;_!==null;){var a=_,o=a.child;if(_.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(_=u;_!==null;){var p=_;switch(p.tag){case 0:case 11:case 15:Vs(8,p,a)}var d=p.child;if(d!==null)d.return=p,_=d;else for(;_!==null;){p=_;var f=p.sibling,x=p.return;if(Zf(p),p===u){_=null;break}if(f!==null){f.return=x,_=f;break}_=x}}}var v=a.alternate;if(v!==null){var y=v.child;if(y!==null){v.child=null;do{var j=y.sibling;y.sibling=null,y=j}while(y!==null)}}_=a}}if(a.subtreeFlags&2064&&o!==null)o.return=a,_=o;else e:for(;_!==null;){if(a=_,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Vs(9,a,a.return)}var g=a.sibling;if(g!==null){g.return=a.return,_=g;break e}_=a.return}}var h=e.current;for(_=h;_!==null;){o=_;var m=o.child;if(o.subtreeFlags&2064&&m!==null)m.return=o,_=m;else e:for(o=h;_!==null;){if(l=_,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ta(9,l)}}catch(k){ae(l,l.return,k)}if(l===o){_=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,_=w;break e}_=l.return}}if(H=r,nn(),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(Gi,e)}catch{}s=!0}return s}finally{K=n,qe.transition=t}}return!1}function ku(e,t,n){t=rs(n,t),t=Uf(e,t,1),e=Kt(e,t,1),t=Ce(),e!==null&&(vr(e,1,t),De(e,t))}function ae(e,t,n){if(e.tag===3)ku(e,e,n);else for(;t!==null;){if(t.tag===3){ku(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Gt===null||!Gt.has(s))){e=rs(n,e),e=Wf(t,e,1),t=Kt(t,e,1),e=Ce(),t!==null&&(vr(t,1,e),De(t,e));break}}t=t.return}}function Mg(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),t=Ce(),e.pingedLanes|=e.suspendedLanes&n,ge===e&&(xe&n)===n&&(me===4||me===3&&(xe&130023424)===xe&&500>oe()-Vl?pn(e,0):Hl|=n),De(e,t)}function cp(e,t){t===0&&(e.mode&1?(t=Dr,Dr<<=1,!(Dr&130023424)&&(Dr=4194304)):t=1);var n=Ce();e=Et(e,t),e!==null&&(vr(e,t,n),De(e,n))}function Rg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cp(e,n)}function $g(e,t){var n=0;switch(e.tag){case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:s=e.stateNode;break;default:throw Error(I(314))}s!==null&&s.delete(t),cp(e,n)}var up;up=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pe.current)Ie=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ie=!1,Sg(e,t,n);Ie=!!(e.flags&131072)}else Ie=!1,ee&&t.flags&1048576&&mf(t,Li,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;ui(e,t),e=t.pendingProps;var r=es(t,ke.current);Yn(t,n),r=$l(null,t,s,e,r,n);var a=zl();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,_e(s)?(a=!0,Ei(t)):a=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Pl(t),r.updater=ea,t.stateNode=r,r._reactInternals=t,Do(t,s,e,n),t=$o(null,t,s,!0,a,n)):(t.tag=0,ee&&a&&Cl(t),Ne(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(ui(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=Fg(s),e=nt(s,e),r){case 0:t=Ro(null,t,s,e,n);break e;case 1:t=pu(null,t,s,e,n);break e;case 11:t=du(null,t,s,e,n);break e;case 14:t=fu(null,t,s,nt(s.type,e),n);break e}throw Error(I(306,s,""))}return t;case 0:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),Ro(e,t,s,r,n);case 1:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),pu(e,t,s,r,n);case 3:e:{if(Gf(t),e===null)throw Error(I(387));s=t.pendingProps,a=t.memoizedState,r=a.element,bf(e,t),Oi(t,s,null,n);var o=t.memoizedState;if(s=o.element,a.isDehydrated)if(a={element:s,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){r=rs(Error(I(423)),t),t=mu(e,t,s,n,r);break e}else if(s!==r){r=rs(Error(I(424)),t),t=mu(e,t,s,n,r);break e}else for(ze=Vt(t.stateNode.containerInfo.firstChild),Fe=t,ee=!0,it=null,n=xf(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ts(),s===r){t=Tt(e,t,n);break e}Ne(e,t,s,n)}t=t.child}return t;case 5:return jf(t),e===null&&Oo(t),s=t.type,r=t.pendingProps,a=e!==null?e.memoizedProps:null,o=r.children,Eo(s,r)?o=null:a!==null&&Eo(s,a)&&(t.flags|=32),Kf(e,t),Ne(e,t,o,n),t.child;case 6:return e===null&&Oo(t),null;case 13:return qf(e,t,n);case 4:return _l(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ns(t,null,s,n):Ne(e,t,s,n),t.child;case 11:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),du(e,t,s,r,n);case 7:return Ne(e,t,t.pendingProps,n),t.child;case 8:return Ne(e,t,t.pendingProps.children,n),t.child;case 12:return Ne(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(s=t.type._context,r=t.pendingProps,a=t.memoizedProps,o=r.value,q(Ai,s._currentValue),s._currentValue=o,a!==null)if(lt(a.value,o)){if(a.children===r.children&&!Pe.current){t=Tt(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(a.tag===1){c=kt(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var p=u.pending;p===null?c.next=c:(c.next=p.next,p.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Po(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(I(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Po(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ne(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps.children,Yn(t,n),r=Qe(r),s=s(r),t.flags|=1,Ne(e,t,s,n),t.child;case 14:return s=t.type,r=nt(s,t.pendingProps),r=nt(s.type,r),fu(e,t,s,r,n);case 15:return Hf(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),ui(e,t),t.tag=1,_e(s)?(e=!0,Ei(t)):e=!1,Yn(t,n),Bf(t,s,r),Do(t,s,r,n),$o(null,t,s,!0,e,n);case 19:return Yf(e,t,n);case 22:return Vf(e,t,n)}throw Error(I(156,t.tag))};function dp(e,t){return Rd(e,t)}function zg(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ge(e,t,n,s){return new zg(e,t,n,s)}function Yl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fg(e){if(typeof e=="function")return Yl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ml)return 11;if(e===hl)return 14}return 2}function Yt(e,t){var n=e.alternate;return n===null?(n=Ge(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 pi(e,t,n,s,r,a){var o=2;if(s=e,typeof e=="function")Yl(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case In:return mn(n.children,r,a,t);case pl:o=8,r|=8;break;case ro:return e=Ge(12,n,t,r|2),e.elementType=ro,e.lanes=a,e;case io:return e=Ge(13,n,t,r),e.elementType=io,e.lanes=a,e;case ao:return e=Ge(19,n,t,r),e.elementType=ao,e.lanes=a,e;case bd:return sa(n,r,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xd:o=10;break e;case vd:o=9;break e;case ml:o=11;break e;case hl:o=14;break e;case _t:o=16,s=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Ge(o,n,t,r),t.elementType=e,t.type=s,t.lanes=a,t}function mn(e,t,n,s){return e=Ge(7,e,s,t),e.lanes=n,e}function sa(e,t,n,s){return e=Ge(22,e,s,t),e.elementType=bd,e.lanes=n,e.stateNode={isHidden:!1},e}function Ha(e,t,n){return e=Ge(6,e,null,t),e.lanes=n,e}function Va(e,t,n){return t=Ge(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Bg(e,t,n,s,r){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=Sa(0),this.expirationTimes=Sa(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sa(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Ql(e,t,n,s,r,a,o,l,c){return e=new Bg(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Ge(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pl(a),e}function Ug(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:An,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function fp(e){if(!e)return Zt;e=e._reactInternals;e:{if(kn(e)!==e||e.tag!==1)throw Error(I(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(_e(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(I(171))}if(e.tag===1){var n=e.type;if(_e(n))return ff(e,n,t)}return t}function pp(e,t,n,s,r,a,o,l,c){return e=Ql(n,s,!0,e,r,a,o,l,c),e.context=fp(null),n=e.current,s=Ce(),r=qt(n),a=kt(s,r),a.callback=t??null,Kt(n,a,r),e.current.lanes=r,vr(e,r,s),De(e,s),e}function ra(e,t,n,s){var r=t.current,a=Ce(),o=qt(r);return n=fp(n),t.context===null?t.context=n:t.pendingContext=n,t=kt(a,o),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Kt(r,t,o),e!==null&&(ot(e,r,o,a),oi(e,r,o)),o}function Fi(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 Nu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jl(e,t){Nu(e,t),(e=e.alternate)&&Nu(e,t)}function Wg(){return null}var mp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xl(e){this._internalRoot=e}ia.prototype.render=Xl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));ra(e,t,null,null)};ia.prototype.unmount=Xl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vn(function(){ra(null,e,null,null)}),t[Ct]=null}};function ia(e){this._internalRoot=e}ia.prototype.unstable_scheduleHydration=function(e){if(e){var t=Hd();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rt.length&&t!==0&&t<Rt[n].priority;n++);Rt.splice(n,0,e),n===0&&Kd(e)}};function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function aa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Su(){}function Hg(e,t,n,s,r){if(r){if(typeof s=="function"){var a=s;s=function(){var u=Fi(o);a.call(u)}}var o=pp(t,s,e,0,null,!1,!1,"",Su);return e._reactRootContainer=o,e[Ct]=o.current,rr(e.nodeType===8?e.parentNode:e),vn(),o}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var l=s;s=function(){var u=Fi(c);l.call(u)}}var c=Ql(e,0,!1,null,null,!1,!1,"",Su);return e._reactRootContainer=c,e[Ct]=c.current,rr(e.nodeType===8?e.parentNode:e),vn(function(){ra(t,c,n,s)}),c}function oa(e,t,n,s,r){var a=n._reactRootContainer;if(a){var o=a;if(typeof r=="function"){var l=r;r=function(){var c=Fi(o);l.call(c)}}ra(t,o,e,r)}else o=Hg(n,t,e,r,s);return Fi(o)}Ud=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ps(t.pendingLanes);n!==0&&(xl(t,n|1),De(t,oe()),!(H&6)&&(is=oe()+500,nn()))}break;case 13:vn(function(){var s=Et(e,1);if(s!==null){var r=Ce();ot(s,e,1,r)}}),Jl(e,1)}};vl=function(e){if(e.tag===13){var t=Et(e,134217728);if(t!==null){var n=Ce();ot(t,e,134217728,n)}Jl(e,134217728)}};Wd=function(e){if(e.tag===13){var t=qt(e),n=Et(e,t);if(n!==null){var s=Ce();ot(n,e,t,s)}Jl(e,t)}};Hd=function(){return K};Vd=function(e,t){var n=K;try{return K=e,t()}finally{K=n}};yo=function(e,t,n){switch(t){case"input":if(co(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 s=n[t];if(s!==e&&s.form===e.form){var r=Ji(s);if(!r)throw Error(I(90));wd(s),co(s,r)}}}break;case"textarea":Nd(e,n);break;case"select":t=n.value,t!=null&&Vn(e,!!n.multiple,t,!1)}};Id=Kl;Od=vn;var Vg={usingClientEntryPoint:!1,Events:[jr,Dn,Ji,Ld,Ad,Kl]},Ts={findFiberByHostInstance:ln,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Kg={bundleType:Ts.bundleType,version:Ts.version,rendererPackageName:Ts.rendererPackageName,rendererConfig:Ts.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Dd(e),e===null?null:e.stateNode},findFiberByHostInstance:Ts.findFiberByHostInstance||Wg,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kr.isDisabled&&Kr.supportsFiber)try{Gi=Kr.inject(Kg),mt=Kr}catch{}}Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Vg;Ue.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zl(t))throw Error(I(200));return Ug(e,t,null,n)};Ue.createRoot=function(e,t){if(!Zl(e))throw Error(I(299));var n=!1,s="",r=mp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Ql(e,1,!1,null,null,n,!1,s,r),e[Ct]=t.current,rr(e.nodeType===8?e.parentNode:e),new Xl(t)};Ue.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(I(188)):(e=Object.keys(e).join(","),Error(I(268,e)));return e=Dd(t),e=e===null?null:e.stateNode,e};Ue.flushSync=function(e){return vn(e)};Ue.hydrate=function(e,t,n){if(!aa(t))throw Error(I(200));return oa(null,e,t,!0,n)};Ue.hydrateRoot=function(e,t,n){if(!Zl(e))throw Error(I(405));var s=n!=null&&n.hydratedSources||null,r=!1,a="",o=mp;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=pp(t,null,e,1,n??null,r,!1,a,o),e[Ct]=t.current,rr(e),s)for(e=0;e<s.length;e++)n=s[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new ia(t)};Ue.render=function(e,t,n){if(!aa(t))throw Error(I(200));return oa(null,e,t,!1,n)};Ue.unmountComponentAtNode=function(e){if(!aa(e))throw Error(I(40));return e._reactRootContainer?(vn(function(){oa(null,null,e,!1,function(){e._reactRootContainer=null,e[Ct]=null})}),!0):!1};Ue.unstable_batchedUpdates=Kl;Ue.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!aa(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return oa(e,t,n,!1,s)};Ue.version="18.3.1-next-f1338f8080-20240426";function hp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hp)}catch(e){console.error(e)}}hp(),md.exports=Ue;var Gg=md.exports,gp,Cu=Gg;gp=Cu.createRoot,Cu.hydrateRoot;/**
|
|
41
|
+
* @remix-run/router v1.23.3
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function pr(){return pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},pr.apply(null,arguments)}var Bt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Bt||(Bt={}));const Eu="popstate";function qg(e){e===void 0&&(e={});function t(s,r){let{pathname:a,search:o,hash:l}=s.location;return Qo("",{pathname:a,search:o,hash:l},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Bi(r)}return Qg(t,n,null,e)}function re(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ec(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Yg(){return Math.random().toString(36).substr(2,8)}function Tu(e,t){return{usr:e.state,key:e.key,idx:t}}function Qo(e,t,n,s){return n===void 0&&(n=null),pr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?fs(t):t,{state:n,key:t&&t.key||s||Yg()})}function Bi(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function fs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function Qg(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:a=!1}=s,o=r.history,l=Bt.Pop,c=null,u=p();u==null&&(u=0,o.replaceState(pr({},o.state,{idx:u}),""));function p(){return(o.state||{idx:null}).idx}function d(){l=Bt.Pop;let j=p(),g=j==null?null:j-u;u=j,c&&c({action:l,location:y.location,delta:g})}function f(j,g){l=Bt.Push;let h=Qo(y.location,j,g);u=p()+1;let m=Tu(h,u),w=y.createHref(h);try{o.pushState(m,"",w)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(w)}a&&c&&c({action:l,location:y.location,delta:1})}function x(j,g){l=Bt.Replace;let h=Qo(y.location,j,g);u=p();let m=Tu(h,u),w=y.createHref(h);o.replaceState(m,"",w),a&&c&&c({action:l,location:y.location,delta:0})}function v(j){let g=r.location.origin!=="null"?r.location.origin:r.location.href,h=typeof j=="string"?j:Bi(j);return h=h.replace(/ $/,"%20"),re(g,"No window.location.(origin|href) available to create URL for href: "+h),new URL(h,g)}let y={get action(){return l},get location(){return e(r,o)},listen(j){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(Eu,d),c=j,()=>{r.removeEventListener(Eu,d),c=null}},createHref(j){return t(r,j)},createURL:v,encodeLocation(j){let g=v(j);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:x,go(j){return o.go(j)}};return y}var Lu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Lu||(Lu={}));function Jg(e,t,n){return n===void 0&&(n="/"),Xg(e,t,n)}function Xg(e,t,n,s){let r=typeof t=="string"?fs(t):t,a=as(r.pathname||"/",n);if(a==null)return null;let o=yp(e);Zg(o);let l=null,c=uy(a);for(let u=0;l==null&&u<o.length;++u)l=ly(o[u],c);return l}function yp(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(a,o,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(re(c.relativePath.startsWith(s),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+s+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(s.length));let u=Qt([s,c.relativePath]),p=n.concat(c);a.children&&a.children.length>0&&(re(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),yp(a.children,t,p,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:ay(u,a.index),routesMeta:p})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))r(a,o);else for(let c of xp(a.path))r(a,o,c)}),t}function xp(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),a=n.replace(/\?$/,"");if(s.length===0)return r?[a,""]:[a];let o=xp(s.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),r&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Zg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:oy(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const ey=/^:[\w-]+$/,ty=3,ny=2,sy=1,ry=10,iy=-2,Au=e=>e==="*";function ay(e,t){let n=e.split("/"),s=n.length;return n.some(Au)&&(s+=iy),t&&(s+=ny),n.filter(r=>!Au(r)).reduce((r,a)=>r+(ey.test(a)?ty:a===""?sy:ry),s)}function oy(e,t){return e.length===t.length&&e.slice(0,-1).every((s,r)=>s===t[r])?e[e.length-1]-t[t.length-1]:0}function ly(e,t,n){let{routesMeta:s}=e,r={},a="/",o=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,p=a==="/"?t:t.slice(a.length)||"/",d=Jo({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),f=c.route;if(!d)return null;Object.assign(r,d.params),o.push({params:r,pathname:Qt([a,d.pathname]),pathnameBase:hy(Qt([a,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(a=Qt([a,d.pathnameBase]))}return o}function Jo(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=cy(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let a=r[0],o=a.replace(/(.)\/+$/,"$1"),l=r.slice(1);return{params:s.reduce((u,p,d)=>{let{paramName:f,isOptional:x}=p;if(f==="*"){let y=l[d]||"";o=a.slice(0,a.length-y.length).replace(/(.)\/+$/,"$1")}const v=l[d];return x&&!v?u[f]=void 0:u[f]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function cy(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ec(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let s=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(s.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(s.push({paramName:"*"}),r+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":e!==""&&e!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,t?void 0:"i"),s]}function uy(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ec(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function as(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,s=e.charAt(n);return s&&s!=="/"?null:e.slice(n)||"/"}const dy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fy=e=>dy.test(e);function py(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?fs(e):e,a;if(n)if(fy(n))a=n;else{if(n.includes("//")){let o=n;n=vp(n),ec(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=Iu(n.substring(1),"/"):a=Iu(n,t)}else a=t;return{pathname:a,search:gy(s),hash:yy(r)}}function Iu(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function Ka(e,t,n,s){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(s)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function my(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function tc(e,t){let n=my(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function nc(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=fs(e):(r=pr({},e),re(!r.pathname||!r.pathname.includes("?"),Ka("?","pathname","search",r)),re(!r.pathname||!r.pathname.includes("#"),Ka("#","pathname","hash",r)),re(!r.search||!r.search.includes("#"),Ka("#","search","hash",r)));let a=e===""||r.pathname==="",o=a?"/":r.pathname,l;if(o==null)l=n;else{let d=t.length-1;if(!s&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=py(r,l),u=o&&o!=="/"&&o.endsWith("/"),p=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const vp=e=>e.replace(/\/\/+/g,"/"),Qt=e=>vp(e.join("/")),hy=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),gy=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,yy=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function xy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const bp=["post","put","patch","delete"];new Set(bp);const vy=["get",...bp];new Set(vy);/**
|
|
50
|
+
* React Router v6.30.4
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function mr(){return mr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},mr.apply(null,arguments)}const la=b.createContext(null),jp=b.createContext(null),At=b.createContext(null),ca=b.createContext(null),yt=b.createContext({outlet:null,matches:[],isDataRoute:!1}),wp=b.createContext(null);function by(e,t){let{relative:n}=t===void 0?{}:t;ps()||re(!1);let{basename:s,navigator:r}=b.useContext(At),{hash:a,pathname:o,search:l}=ua(e,{relative:n}),c=o;return s!=="/"&&(c=o==="/"?s:Qt([s,o])),r.createHref({pathname:c,search:l,hash:a})}function ps(){return b.useContext(ca)!=null}function It(){return ps()||re(!1),b.useContext(ca).location}function kp(e){b.useContext(At).static||b.useLayoutEffect(e)}function Np(){let{isDataRoute:e}=b.useContext(yt);return e?My():jy()}function jy(){ps()||re(!1);let e=b.useContext(la),{basename:t,future:n,navigator:s}=b.useContext(At),{matches:r}=b.useContext(yt),{pathname:a}=It(),o=JSON.stringify(tc(r,n.v7_relativeSplatPath)),l=b.useRef(!1);return kp(()=>{l.current=!0}),b.useCallback(function(u,p){if(p===void 0&&(p={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=nc(u,JSON.parse(o),a,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Qt([t,d.pathname])),(p.replace?s.replace:s.push)(d,p.state,p)},[t,s,o,a,e])}const wy=b.createContext(null);function ky(e){let t=b.useContext(yt).outlet;return t&&b.createElement(wy.Provider,{value:e},t)}function Ny(){let{matches:e}=b.useContext(yt),t=e[e.length-1];return t?t.params:{}}function ua(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=b.useContext(At),{matches:r}=b.useContext(yt),{pathname:a}=It(),o=JSON.stringify(tc(r,s.v7_relativeSplatPath));return b.useMemo(()=>nc(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function Sy(e,t){return Cy(e,t)}function Cy(e,t,n,s){ps()||re(!1);let{navigator:r}=b.useContext(At),{matches:a}=b.useContext(yt),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=It(),p;if(t){var d;let j=typeof t=="string"?fs(t):t;c==="/"||(d=j.pathname)!=null&&d.startsWith(c)||re(!1),p=j}else p=u;let f=p.pathname||"/",x=f;if(c!=="/"){let j=c.replace(/^\//,"").split("/");x="/"+f.replace(/^\//,"").split("/").slice(j.length).join("/")}let v=Jg(e,{pathname:x}),y=Iy(v&&v.map(j=>Object.assign({},j,{params:Object.assign({},l,j.params),pathname:Qt([c,r.encodeLocation?r.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?c:Qt([c,r.encodeLocation?r.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),a,n,s);return t&&y?b.createElement(ca.Provider,{value:{location:mr({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Bt.Pop}},y):y}function Ey(){let e=Dy(),t=xy(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:r},n):null,null)}const Ty=b.createElement(Ey,null);class Ly extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(yt.Provider,{value:this.props.routeContext},b.createElement(wp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ay(e){let{routeContext:t,match:n,children:s}=e,r=b.useContext(la);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(yt.Provider,{value:t},s)}function Iy(e,t,n,s){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),s===void 0&&(s=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=s)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(r=n)==null?void 0:r.errors;if(l!=null){let p=o.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);p>=0||re(!1),o=o.slice(0,Math.min(o.length,p+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let p=0;p<o.length;p++){let d=o[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=p),d.route.id){let{loaderData:f,errors:x}=n,v=d.route.loader&&f[d.route.id]===void 0&&(!x||x[d.route.id]===void 0);if(d.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((p,d,f)=>{let x,v=!1,y=null,j=null;n&&(x=l&&d.route.id?l[d.route.id]:void 0,y=d.route.errorElement||Ty,c&&(u<0&&f===0?(Ry("route-fallback"),v=!0,j=null):u===f&&(v=!0,j=d.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,f+1)),h=()=>{let m;return x?m=y:v?m=j:d.route.Component?m=b.createElement(d.route.Component,null):d.route.element?m=d.route.element:m=p,b.createElement(Ay,{match:d,routeContext:{outlet:p,matches:g,isDataRoute:n!=null},children:m})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?b.createElement(Ly,{location:n.location,revalidation:n.revalidation,component:y,error:x,children:h(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):h()},null)}var Sp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Sp||{}),Cp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Cp||{});function Oy(e){let t=b.useContext(la);return t||re(!1),t}function Py(e){let t=b.useContext(jp);return t||re(!1),t}function _y(e){let t=b.useContext(yt);return t||re(!1),t}function Ep(e){let t=_y(),n=t.matches[t.matches.length-1];return n.route.id||re(!1),n.route.id}function Dy(){var e;let t=b.useContext(wp),n=Py(),s=Ep();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function My(){let{router:e}=Oy(Sp.UseNavigateStable),t=Ep(Cp.UseNavigateStable),n=b.useRef(!1);return kp(()=>{n.current=!0}),b.useCallback(function(r,a){a===void 0&&(a={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,mr({fromRouteId:t},a)))},[e,t])}const Ou={};function Ry(e,t,n){Ou[e]||(Ou[e]=!0)}function $y(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function zy(e){let{to:t,replace:n,state:s,relative:r}=e;ps()||re(!1);let{future:a,static:o}=b.useContext(At),{matches:l}=b.useContext(yt),{pathname:c}=It(),u=Np(),p=nc(t,tc(l,a.v7_relativeSplatPath),c,r==="path"),d=JSON.stringify(p);return b.useEffect(()=>u(JSON.parse(d),{replace:n,state:s,relative:r}),[u,d,r,n,s]),null}function Fy(e){return ky(e.context)}function fe(e){re(!1)}function By(e){let{basename:t="/",children:n=null,location:s,navigationType:r=Bt.Pop,navigator:a,static:o=!1,future:l}=e;ps()&&re(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:a,static:o,future:mr({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof s=="string"&&(s=fs(s));let{pathname:p="/",search:d="",hash:f="",state:x=null,key:v="default"}=s,y=b.useMemo(()=>{let j=as(p,c);return j==null?null:{location:{pathname:j,search:d,hash:f,state:x,key:v},navigationType:r}},[c,p,d,f,x,v,r]);return y==null?null:b.createElement(At.Provider,{value:u},b.createElement(ca.Provider,{children:n,value:y}))}function Uy(e){let{children:t,location:n}=e;return Sy(Xo(t),n)}new Promise(()=>{});function Xo(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(s,r)=>{if(!b.isValidElement(s))return;let a=[...t,r];if(s.type===b.Fragment){n.push.apply(n,Xo(s.props.children,a));return}s.type!==fe&&re(!1),!s.props.index||!s.props.children||re(!1);let o={id:s.props.id||a.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(o.children=Xo(s.props.children,a)),n.push(o)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.4
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/function Ui(){return Ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ui.apply(null,arguments)}function Tp(e,t){if(e==null)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)!==-1)continue;n[s]=e[s]}return n}function Wy(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Hy(e,t){return e.button===0&&(!t||t==="_self")&&!Wy(e)}const Vy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Ky=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Gy="6";try{window.__reactRouterVersion=Gy}catch{}const qy=b.createContext({isTransitioning:!1}),Yy="startTransition",Pu=Mm[Yy];function Qy(e){let{basename:t,children:n,future:s,window:r}=e,a=b.useRef();a.current==null&&(a.current=qg({window:r,v5Compat:!0}));let o=a.current,[l,c]=b.useState({action:o.action,location:o.location}),{v7_startTransition:u}=s||{},p=b.useCallback(d=>{u&&Pu?Pu(()=>c(d)):c(d)},[c,u]);return b.useLayoutEffect(()=>o.listen(p),[o,p]),b.useEffect(()=>$y(s),[s]),b.createElement(By,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:s})}const Jy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Xy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$e=b.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,f=Tp(t,Vy),{basename:x}=b.useContext(At),v,y=!1;if(typeof u=="string"&&Xy.test(u)&&(v=u,Jy))try{let m=new URL(window.location.href),w=u.startsWith("//")?new URL(m.protocol+u):new URL(u),k=as(w.pathname,x);w.origin===m.origin&&k!=null?u=k+w.search+w.hash:y=!0}catch{}let j=by(u,{relative:r}),g=e0(u,{replace:o,state:l,target:c,preventScrollReset:p,relative:r,viewTransition:d});function h(m){s&&s(m),m.defaultPrevented||g(m)}return b.createElement("a",Ui({},f,{href:v||j,onClick:y||a?s:h,ref:n,target:c}))}),st=b.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:r=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:p}=t,d=Tp(t,Ky),f=ua(c,{relative:d.relative}),x=It(),v=b.useContext(jp),{navigator:y,basename:j}=b.useContext(At),g=v!=null&&t0(f)&&u===!0,h=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,m=x.pathname,w=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(m=m.toLowerCase(),w=w?w.toLowerCase():null,h=h.toLowerCase()),w&&j&&(w=as(w,j)||w);const k=h!=="/"&&h.endsWith("/")?h.length-1:h.length;let C=m===h||!o&&m.startsWith(h)&&m.charAt(k)==="/",S=w!=null&&(w===h||!o&&w.startsWith(h)&&w.charAt(h.length)==="/"),N={isActive:C,isPending:S,isTransitioning:g},T=C?s:void 0,A;typeof a=="function"?A=a(N):A=[a,C?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let F=typeof l=="function"?l(N):l;return b.createElement($e,Ui({},d,{"aria-current":T,className:A,ref:n,style:F,to:c,viewTransition:u}),typeof p=="function"?p(N):p)});var Zo;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Zo||(Zo={}));var _u;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(_u||(_u={}));function Zy(e){let t=b.useContext(la);return t||re(!1),t}function e0(e,t){let{target:n,replace:s,state:r,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Np(),u=It(),p=ua(e,{relative:o});return b.useCallback(d=>{if(Hy(d,n)){d.preventDefault();let f=s!==void 0?s:Bi(u)===Bi(p);c(e,{replace:f,state:r,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,p,s,r,n,e,a,o,l])}function t0(e,t){t===void 0&&(t={});let n=b.useContext(qy);n==null&&re(!1);let{basename:s}=Zy(Zo.useViewTransitionState),r=ua(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=as(n.currentLocation.pathname,s)||n.currentLocation.pathname,o=as(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Jo(r.pathname,o)!=null||Jo(r.pathname,a)!=null}function n0(e){const[t,n]=b.useState(null),s=b.useRef(0),r=b.useCallback(()=>{if(e.length===0){n(null);return}let a=e[0];for(const o of e){const l=document.getElementById(o);l&&l.getBoundingClientRect().top<=100&&(a=o)}n(a)},[e]);return b.useEffect(()=>{if(e.length===0)return;r();const a=()=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(r)};return window.addEventListener("scroll",a,{passive:!0}),()=>{window.removeEventListener("scroll",a),cancelAnimationFrame(s.current)}},[r,e]),t}async function Z(e,t,n){const s={method:e};n&&(s.headers={"Content-Type":"application/json"},s.body=JSON.stringify(n));const r=await fetch(t,s),a=await r.json();if(!r.ok)throw new Error(a.error??`HTTP ${r.status}`);return a}const z={getStatus:()=>Z("GET","/api/status"),getConnectors:()=>Z("GET","/api/connectors"),getConnector:(e,t)=>Z("GET",`/api/connectors/${e}/${t}`),run:(e,t)=>Z("POST","/api/run",{connector:e,args:t}),approve:(e,t)=>Z("POST","/api/approval",{approvalId:e,approved:t}),getAudit:e=>{const t=new URLSearchParams(e).toString();return Z("GET",`/api/audit${t?`?${t}`:""}`)},getAuditEvent:e=>Z("GET",`/api/audit/${e}`),getConfig:()=>Z("GET","/api/config"),setConfig:(e,t)=>Z("POST","/api/config",{key:e,value:t}),getPreferences:()=>Z("GET","/api/preferences"),setPreference:(e,t)=>Z("PUT","/api/preferences",{key:e,value:t}),getGoals:e=>Z("GET",`/api/goals?month=${e}`),upsertGoal:e=>Z("POST","/api/goals",e),deleteGoal:e=>Z("DELETE",`/api/goals/${e}`),getCachedReport:e=>Z("GET",`/api/timetracking/cache?month=${e}`),cacheReport:(e,t)=>Z("POST","/api/timetracking/cache",{month:e,data:t}),getCachedProjects:()=>Z("GET","/api/timetracking/projects"),cacheProjects:e=>Z("POST","/api/timetracking/projects",{data:e}),generateJournal:e=>Z("POST","/api/journal/generate",e),getCachedSecurityNews:()=>Z("GET","/api/security-news/cache"),cacheSecurityNews:e=>Z("POST","/api/security-news/cache",{data:e}),getCachedTrustedPeers:()=>Z("GET","/api/trusted-peers/cache"),cacheTrustedPeers:e=>Z("POST","/api/trusted-peers/cache",{data:e}),getSkills:()=>Z("GET","/api/skills")};function da(e){const t=new Map;for(const n of e){const s=n.key.split("/")[0],r=t.get(s)??[];r.push(n),t.set(s,r)}return[...t.entries()]}const Lp={"command.success":"success","command.error":"error","command.denied":"error","command.start":"neutral","auth.failed":"warning","approval.granted":"success","approval.rejected":"error","config.changed":"neutral"},s0={success:"border-emerald-500 text-emerald-600 dark:text-emerald-400",error:"border-red-500 text-red-600 dark:text-red-400",warning:"border-amber-500 text-amber-600 dark:text-amber-400",info:"border-sky-500 text-sky-600 dark:text-sky-400",secondary:"border-violet-500 text-violet-600 dark:text-violet-400",neutral:"border-base-300 text-base-content/60"},r0={sm:"px-2 py-0.5 text-xs",xs:"px-1.5 py-px text-[0.65rem]"};function U({variant:e="neutral",size:t="sm",className:n="",children:s}){return i.jsx("span",{className:`inline-flex items-center font-mono font-medium border ${r0[t]} ${s0[e]} ${n}`,children:s})}function i0(){const[e,t]=b.useState(null),[n,s]=b.useState([]),r=b.useCallback(()=>{z.getStatus().then(t).catch(()=>t(null)),z.getAudit({limit:"10"}).then(o=>s(o.events)).catch(()=>{})},[]);b.useEffect(()=>{r();const o=setInterval(r,3e4);return()=>clearInterval(o)},[r]);function a(o){const l=Date.now()-new Date(o).getTime(),c=Math.floor(l/6e4);if(c<1)return"just now";if(c<60)return`${c} min ago`;const u=Math.floor(c/60);return u<24?`${u} hr ago`:`${Math.floor(u/24)}d ago`}return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Dashboard"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 border border-base-300 mb-8",children:[i.jsxs("div",{className:"p-3 sm:border-r sm:border-r-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Daemon"}),i.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.ok?"text-success":"text-error"}`,children:e!=null&&e.ok?"Running":"Offline"})]}),i.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0 sm:border-r sm:border-r-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Extension"}),i.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.extensionConnected?"text-success":"text-error"}`,children:e!=null&&e.extensionConnected?"Connected":"Disconnected"})]}),i.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connectors"}),i.jsxs("div",{className:"font-display font-semibold text-sm",children:[(e==null?void 0:e.connectorCount)??0," loaded"]})]})]}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Recent activity"}),n.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No recent activity"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Run a connector to see events here."})]}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Duration"})]})}),i.jsx("tbody",{children:n.map(o=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"opacity-50 text-sm font-mono",children:a(o.timestamp)}),i.jsx("td",{className:"font-mono text-sm",children:o.connector}),i.jsx("td",{children:i.jsx(U,{variant:Lp[o.type]??"neutral",children:o.type})}),i.jsx("td",{className:"text-sm font-mono",children:o.durationMs?`${(o.durationMs/1e3).toFixed(1)}s`:"—"})]},o.id))})]})})]})}function ct({label:e}){return i.jsxs("div",{className:"flex items-center gap-3 py-4",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),e&&i.jsx("span",{className:"text-sm opacity-60",children:e})]})}function a0({c:e,approvingKey:t,onApprove:n}){const[s,r]=e.key.split("/");return i.jsxs("div",{className:"border border-base-300/50 p-3 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[i.jsxs("div",{className:"flex-1",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono font-semibold text-sm",children:r}),i.jsx(U,{size:"sm",children:e.access}),e.capabilities.map(a=>i.jsx(U,{size:"sm",children:a},a)),e.isHighRisk&&e.isApproved&&i.jsx(U,{variant:"success",size:"sm",children:"Approved"}),e.isHighRisk&&!e.isApproved&&i.jsx(U,{variant:"warning",size:"sm",children:"Blocked — requires approval"})]}),i.jsx("p",{className:"text-sm opacity-60 mt-1",children:e.description}),e.domains.length>0&&i.jsxs("div",{className:"text-xs opacity-40 mt-1",children:["Domains: ",e.domains.join(", ")]})]}),i.jsxs("div",{className:"flex gap-2 ml-4 shrink-0",children:[e.isHighRisk&&!e.isApproved&&i.jsx("button",{className:"btn btn-sm btn-warning btn-outline",disabled:t===e.key,onClick:()=>n(e.key),children:t===e.key?"Approving...":"Approve"}),e.hasAppPage&&e.appRoute&&i.jsx($e,{to:e.appRoute,className:"btn btn-sm btn-primary",children:"Open App"}),i.jsx($e,{to:`/connectors/${s}/${r}`,className:"btn btn-sm btn-ghost",children:"Run"})]})]})}function o0({site:e,connectors:t,approvingKey:n,onApprove:s}){const[r,a]=b.useState(!1);return i.jsxs("div",{id:`conn-${e}`,className:"border border-base-300 p-4 scroll-mt-4",children:[i.jsxs("button",{className:"flex items-center gap-2 w-full text-left",onClick:()=>a(!r),children:[i.jsx("span",{className:"text-xs opacity-50",children:r?"▸":"▾"}),i.jsx("span",{className:"font-mono font-semibold",children:e}),i.jsxs("span",{className:"text-xs opacity-40",children:[t.length," ",t.length===1?"connector":"connectors"]})]}),!r&&i.jsx("div",{className:"space-y-2 mt-3",children:t.map(o=>i.jsx(a0,{c:o,approvingKey:n,onApprove:s},o.key))})]})}function l0(){const[e,t]=b.useState([]),[n,s]=b.useState([]),[r,a]=b.useState(!0),[o,l]=b.useState(null),c=b.useCallback(()=>{const d=z.getConnectors(),f=z.getConfig().catch(()=>({ok:!1,config:{}}));Promise.all([d,f]).then(([x,v])=>{t(x.connectors);const y=v.config.security??{};s(y.approvedHighRisk??[])}).catch(()=>{}).finally(()=>a(!1))},[]);b.useEffect(()=>{c()},[c]);const u=b.useCallback(async d=>{l(d);try{const f=[...n,d];await z.setConfig("security.approvedHighRisk",JSON.stringify(f)),c()}catch{}finally{l(null)}},[n,c]),p=b.useMemo(()=>da(e),[e]);return r?i.jsx(ct,{label:"Loading connectors..."}):i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Connectors"}),e.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No connectors loaded"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Check the daemon is running and connectors are installed in ~/.commandgarden/connectors/"})]}):i.jsx("div",{className:"space-y-3",children:p.map(([d,f])=>i.jsx(o0,{site:d,connectors:f,approvingKey:o,onApprove:u},d))})]})}function hr(){const[e,t]=b.useState(!1),[n,s]=b.useState(null),[r,a]=b.useState(null),[o,l]=b.useState(!1),[c,u]=b.useState(null),p=b.useCallback(()=>{t(!1),s(null),a(null),l(!1),u(null)},[]),d=b.useCallback(async(x,v)=>{t(!0),a(null),s(null),l(!1),u(null);try{const y=await z.run(x,v);if(y.requiresApproval&&y.requestId){l(!0);const j=new EventSource(`/api/run/events/${y.requestId}`);j.addEventListener("approval",g=>{const h=JSON.parse(g.data);u(h.approvalId)}),j.addEventListener("result",g=>{const h=JSON.parse(g.data);!h.ok&&h.error?a(h.error):s(h),l(!1),t(!1),j.close()}),j.onerror=()=>{a("SSE connection lost"),l(!1),t(!1),j.close()}}else!y.ok&&y.error?(a(y.error),t(!1)):(s(y),t(!1))}catch(y){a(y instanceof Error?y.message:"Unknown error"),t(!1)}},[]),f=b.useCallback(async x=>{if(c)try{await z.approve(c,x),x||(l(!1),t(!1),a("Approval rejected"))}catch(v){a(v instanceof Error?v.message:"Approval failed")}},[c]);return{running:e,result:n,error:r,approvalPending:o,approvalId:c,run:d,handleApproval:f,reset:p}}function c0(){const{site:e,name:t}=Ny(),n=`${e}/${t}`,[s,r]=b.useState(null),[a,o]=b.useState(!0),[l,c]=b.useState({}),[u,p]=b.useState(null),{running:d,result:f,error:x,approvalPending:v,approvalId:y,run:j,handleApproval:g}=hr();b.useEffect(()=>{!e||!t||z.getConnector(e,t).then(m=>{r(m.connector);const w={};for(const k of m.connector.args??[])w[k.name]="";c(w)}).catch(m=>p(m.message)).finally(()=>o(!1))},[e,t]);const h=b.useCallback(async()=>{const m={};for(const[w,k]of Object.entries(l))k&&(m[w]=k);await j(n,m)},[l,n,j]);return a?i.jsx(ct,{label:"Loading connector..."}):s?i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx($e,{to:"/connectors",className:"text-sm opacity-50 hover:opacity-80",children:"Connectors"}),i.jsx("span",{className:"text-sm opacity-30",children:"/"})]}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-2",children:n}),i.jsx("p",{className:"text-sm opacity-50 mb-5",children:s.description}),i.jsxs("div",{className:"border border-base-300 p-5 mb-6",children:[i.jsx("h3",{className:"font-display font-semibold mb-4",children:"Arguments"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[(s.args??[]).map(m=>i.jsxs("label",{className:"form-control",children:[i.jsxs("span",{className:"label-text mb-1 text-sm",children:[m.name,!m.required&&i.jsx("span",{className:"opacity-40",children:" (optional)"})]}),i.jsx("input",{type:"text",className:"input input-bordered input-sm w-40",placeholder:m.help,value:l[m.name]??"",onChange:w=>c(k=>({...k,[m.name]:w.target.value})),pattern:m.pattern}),m.help&&i.jsx("span",{className:"text-xs opacity-40 mt-1",children:m.help})]},m.name)),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:h,disabled:d,children:d?"Running...":"Run connector"})]})]}),d&&!v&&i.jsx(ct,{label:`Running ${n} — this drives your browser and may take up to a minute.`}),v&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>g(!0),disabled:!y,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>g(!1),disabled:!y,children:"Reject"})]})]}),x&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:x})}),f&&i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("h3",{className:"font-semibold",children:"Results"}),i.jsxs("div",{className:"text-xs opacity-40",children:[f.rowCount??f.data.length," rows",f.durationMs?` · ${(f.durationMs/1e3).toFixed(1)}s`:""]})]}),f.data.length===0?i.jsx("p",{className:"text-sm opacity-50",children:"No results returned."}):i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsx("tr",{children:(f.columns??Object.keys(f.data[0])).map(m=>i.jsx("th",{children:m},m))})}),i.jsx("tbody",{children:f.data.map((m,w)=>i.jsx("tr",{children:(f.columns??Object.keys(m)).map(k=>i.jsx("td",{className:"text-sm",children:String(m[k]??"")},k))},w))})]})})]})]}):i.jsx("div",{className:"text-error",children:u??`Connector not found: ${n}`})}const u0=[{label:"Last 24 hours",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"Last 90 days",hours:2160}],d0=["command.start","command.success","command.error","command.denied","auth.failed","approval.granted","approval.rejected","config.changed"],Sn=20;function f0(){const[e,t]=b.useState([]),[n,s]=b.useState([]),[r,a]=b.useState(!0),[o,l]=b.useState(168),[c,u]=b.useState(""),[p,d]=b.useState(""),[f,x]=b.useState(null),[v,y]=b.useState(0);b.useEffect(()=>{z.getConnectors().then(m=>s(m.connectors)).catch(()=>{})},[]);const j=b.useCallback(()=>{a(!0);const m={since:new Date(Date.now()-o*36e5).toISOString(),limit:String(Sn+v+1)};c&&(m.type=c),p&&(m.connector=p),z.getAudit(m).then(w=>t(w.events)).catch(()=>{}).finally(()=>a(!1))},[o,c,p,v]);b.useEffect(()=>{j();const m=setInterval(j,6e4);return()=>clearInterval(m)},[j]);const g=e.slice(v,v+Sn),h=e.length>v+Sn;return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Audit Log"}),i.jsxs("div",{className:"flex flex-wrap items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Time range"}),i.jsx("select",{className:"select select-bordered select-sm",value:o,onChange:m=>{l(Number(m.target.value)),y(0)},children:u0.map(m=>i.jsx("option",{value:m.hours,children:m.label},m.hours))})]}),i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Event type"}),i.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:m=>{u(m.target.value),y(0)},children:[i.jsx("option",{value:"",children:"All types"}),d0.map(m=>i.jsx("option",{value:m,children:m},m))]})]}),i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connector"}),i.jsxs("select",{className:"select select-bordered select-sm",value:p,onChange:m=>{d(m.target.value),y(0)},children:[i.jsx("option",{value:"",children:"All connectors"}),n.map(m=>i.jsx("option",{value:m.key,children:m.key},m.key))]})]})]}),r&&e.length===0?i.jsx(ct,{label:"Loading audit events..."}):i.jsxs(i.Fragment,{children:[g.length===0?i.jsx("p",{className:"text-sm opacity-50",children:"No events match the current filters."}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Time"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"User"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{})]})}),i.jsx("tbody",{children:g.map(m=>i.jsxs(b.Fragment,{children:[i.jsxs("tr",{className:"cursor-pointer hover:bg-base-200",onClick:()=>x(f===m.id?null:m.id),role:"button","aria-expanded":f===m.id,tabIndex:0,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),x(f===m.id?null:m.id))},children:[i.jsx("td",{className:"text-sm font-mono",children:new Date(m.timestamp).toLocaleString()}),i.jsx("td",{children:i.jsx(U,{variant:Lp[m.type]??"neutral",children:m.type})}),i.jsx("td",{className:"font-mono text-sm",children:m.connector||"—"}),i.jsx("td",{className:"text-sm",children:m.user}),i.jsx("td",{className:"text-sm font-mono",children:m.durationMs?`${(m.durationMs/1e3).toFixed(1)}s`:"—"}),i.jsx("td",{className:"text-xs opacity-40","aria-hidden":"true",children:f===m.id?"▲":"▼"})]},m.id),f===m.id&&i.jsx("tr",{children:i.jsxs("td",{colSpan:6,className:"bg-base-200/50 p-4",children:[i.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm mb-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"ID:"})," ",i.jsx("span",{className:"font-mono text-xs",children:m.id})]}),i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Correlation:"})," ",i.jsx("span",{className:"font-mono text-xs",children:m.correlationId??"—"})]}),m.connectorHash&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Connector hash:"})," ",i.jsx("span",{className:"font-mono text-xs",children:m.connectorHash})]}),m.error&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Error:"})," ",i.jsx("span",{className:"text-error",children:m.error})]}),m.args&&i.jsxs("div",{className:"col-span-2",children:[i.jsx("span",{className:"opacity-50",children:"Args:"})," ",i.jsx("span",{className:"font-mono text-xs",children:JSON.stringify(m.args)})]}),m.domains&&m.domains.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Domains:"})," ",m.domains.join(", ")]}),m.capabilities&&m.capabilities.length>0&&i.jsxs("div",{children:[i.jsx("span",{className:"opacity-50",children:"Capabilities:"})," ",m.capabilities.join(", ")]})]}),m.steps&&m.steps.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Pipeline steps"}),i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"#"}),i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Duration"}),i.jsx("th",{children:"Error"})]})}),i.jsx("tbody",{children:m.steps.map((w,k)=>i.jsxs("tr",{children:[i.jsx("td",{children:k+1}),i.jsx("td",{children:w.step}),i.jsx("td",{children:w.capability}),i.jsxs("td",{children:[(w.durationMs/1e3).toFixed(2),"s"]}),i.jsx("td",{className:"text-error",children:w.error??""})]},k))})]})]})]})},`${m.id}-detail`)]},m.id))})]})}),i.jsxs("div",{className:"flex justify-between items-center mt-4",children:[i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:v===0,onClick:()=>y(Math.max(0,v-Sn)),children:"Previous"}),i.jsxs("span",{className:"text-sm opacity-50",children:["Showing ",v+1,"–",Math.min(v+Sn,e.length),h?"":` of ${e.length}`]}),i.jsx("button",{className:"btn btn-sm btn-ghost",disabled:!h,onClick:()=>y(v+Sn),children:"Next"})]})]})]})}const sc=Symbol.for("yaml.alias"),el=Symbol.for("yaml.document"),Jt=Symbol.for("yaml.map"),Ap=Symbol.for("yaml.pair"),gt=Symbol.for("yaml.scalar"),ms=Symbol.for("yaml.seq"),Xe=Symbol.for("yaml.node.type"),hs=e=>!!e&&typeof e=="object"&&e[Xe]===sc,kr=e=>!!e&&typeof e=="object"&&e[Xe]===el,Nr=e=>!!e&&typeof e=="object"&&e[Xe]===Jt,ue=e=>!!e&&typeof e=="object"&&e[Xe]===Ap,Y=e=>!!e&&typeof e=="object"&&e[Xe]===gt,Sr=e=>!!e&&typeof e=="object"&&e[Xe]===ms;function le(e){if(e&&typeof e=="object")switch(e[Xe]){case Jt:case ms:return!0}return!1}function ce(e){if(e&&typeof e=="object")switch(e[Xe]){case sc:case Jt:case gt:case ms:return!0}return!1}const Ip=e=>(Y(e)||le(e))&&!!e.anchor,on=Symbol("break visit"),p0=Symbol("skip children"),qs=Symbol("remove node");function gs(e,t){const n=m0(t);kr(e)?Un(null,e.contents,n,Object.freeze([e]))===qs&&(e.contents=null):Un(null,e,n,Object.freeze([]))}gs.BREAK=on;gs.SKIP=p0;gs.REMOVE=qs;function Un(e,t,n,s){const r=h0(e,t,n,s);if(ce(r)||ue(r))return g0(e,s,r),Un(e,r,n,s);if(typeof r!="symbol"){if(le(t)){s=Object.freeze(s.concat(t));for(let a=0;a<t.items.length;++a){const o=Un(a,t.items[a],n,s);if(typeof o=="number")a=o-1;else{if(o===on)return on;o===qs&&(t.items.splice(a,1),a-=1)}}}else if(ue(t)){s=Object.freeze(s.concat(t));const a=Un("key",t.key,n,s);if(a===on)return on;a===qs&&(t.key=null);const o=Un("value",t.value,n,s);if(o===on)return on;o===qs&&(t.value=null)}}return r}function m0(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function h0(e,t,n,s){var r,a,o,l,c;if(typeof n=="function")return n(e,t,s);if(Nr(t))return(r=n.Map)==null?void 0:r.call(n,e,t,s);if(Sr(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,s);if(ue(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,s);if(Y(t))return(l=n.Scalar)==null?void 0:l.call(n,e,t,s);if(hs(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,s)}function g0(e,t,n){const s=t[t.length-1];if(le(s))s.items[e]=n;else if(ue(s))e==="key"?s.key=n:s.value=n;else if(kr(s))s.contents=n;else{const r=hs(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const y0={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},x0=e=>e.replace(/[!,[\]{}]/g,t=>y0[t]);class Se{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Se.defaultYaml,t),this.tags=Object.assign({},Se.defaultTags,n)}clone(){const t=new Se(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new Se(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Se.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Se.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:Se.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Se.defaultTags),this.atNextDocument=!1);const s=t.trim().split(/[ \t]+/),r=s.shift();switch(r){case"%TAG":{if(s.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),s.length<2))return!1;const[a,o]=s;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[a]=s;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{const o=/^\d+\.\d+$/.test(a);return n(6,`Unsupported YAML version ${a}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const o=t.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,s,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const a=this.tags[s];if(a)try{return a+decodeURIComponent(r)}catch(o){return n(String(o)),null}return s==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,s]of Object.entries(this.tags))if(t.startsWith(s))return n+x0(t.substring(s.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],s=Object.entries(this.tags);let r;if(t&&s.length>0&&ce(t.contents)){const a={};gs(t.contents,(o,l)=>{ce(l)&&l.tag&&(a[l.tag]=!0)}),r=Object.keys(a)}else r=[];for(const[a,o]of s)a==="!!"&&o==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${a} ${o}`);return n.join(`
|
|
68
|
+
`)}}Se.defaultYaml={explicit:!1,version:"1.2"};Se.defaultTags={"!!":"tag:yaml.org,2002:"};function Op(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function Pp(e){const t=new Set;return gs(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function _p(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function v0(e,t){const n=[],s=new Map;let r=null;return{onAnchor:a=>{n.push(a),r??(r=Pp(e));const o=_p(t,r);return r.add(o),o},setAnchors:()=>{for(const a of n){const o=s.get(a);if(typeof o=="object"&&o.anchor&&(Y(o.node)||le(o.node)))o.node.anchor=o.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=a,l}}},sourceObjects:s}}function Wn(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,a=s.length;r<a;++r){const o=s[r],l=Wn(e,s,String(r),o);l===void 0?delete s[r]:l!==o&&(s[r]=l)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const a=s.get(r),o=Wn(e,s,r,a);o===void 0?s.delete(r):o!==a&&s.set(r,o)}else if(s instanceof Set)for(const r of Array.from(s)){const a=Wn(e,s,r,r);a===void 0?s.delete(r):a!==r&&(s.delete(r),s.add(a))}else for(const[r,a]of Object.entries(s)){const o=Wn(e,s,r,a);o===void 0?delete s[r]:o!==a&&(s[r]=o)}return e.call(t,n,s)}function Ye(e,t,n){if(Array.isArray(e))return e.map((s,r)=>Ye(s,String(r),n));if(e&&typeof e.toJSON=="function"){if(!n||!Ip(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=a=>{s.res=a,delete n.onCreate};const r=e.toJSON(t,n);return n.onCreate&&n.onCreate(r),r}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class rc{constructor(t){Object.defineProperty(this,Xe,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:s,onAnchor:r,reviver:a}={}){if(!kr(t))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=Ye(this,"",o);if(typeof r=="function")for(const{count:c,res:u}of o.anchors.values())r(u,c);return typeof a=="function"?Wn(a,{"":l},"",l):l}}class ic extends rc{constructor(t){super(sc),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){if((n==null?void 0:n.maxAliasCount)===0)throw new ReferenceError("Alias resolution is disabled");let s;n!=null&&n.aliasResolveCache?s=n.aliasResolveCache:(s=[],gs(t,{Node:(a,o)=>{(hs(o)||Ip(o))&&s.push(o)}}),n&&(n.aliasResolveCache=s));let r;for(const a of s){if(a===this)break;a.anchor===this.source&&(r=a)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:r,maxAliasCount:a}=n,o=this.resolve(r,n);if(!o){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=s.get(o);if(l||(Ye(o,null,n),l=s.get(o)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=mi(r,o,s)),l.count*l.aliasCount>a)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return l.res}toString(t,n,s){const r=`*${this.source}`;if(t){if(Op(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(t.implicitKey)return`${r} `}return r}}function mi(e,t,n){if(hs(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(le(t)){let s=0;for(const r of t.items){const a=mi(e,r,n);a>s&&(s=a)}return s}else if(ue(t)){const s=mi(e,t.key,n),r=mi(e,t.value,n);return Math.max(s,r)}return 1}const Dp=e=>!e||typeof e!="function"&&typeof e!="object";class B extends rc{constructor(t){super(gt),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ye(this.value,t,n)}toString(){return String(this.value)}}B.BLOCK_FOLDED="BLOCK_FOLDED";B.BLOCK_LITERAL="BLOCK_LITERAL";B.PLAIN="PLAIN";B.QUOTE_DOUBLE="QUOTE_DOUBLE";B.QUOTE_SINGLE="QUOTE_SINGLE";const b0="tag:yaml.org,2002:";function j0(e,t,n){if(t){const s=n.filter(a=>a.tag===t),r=s.find(a=>!a.format)??s[0];if(!r)throw new Error(`Tag ${t} not found`);return r}return n.find(s=>{var r;return((r=s.identify)==null?void 0:r.call(s,e))&&!s.format})}function gr(e,t,n){var d,f,x;if(kr(e)&&(e=e.contents),ce(e))return e;if(ue(e)){const v=(f=(d=n.schema[Jt]).createNode)==null?void 0:f.call(d,n.schema,null,n);return v.items.push(e),v}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:r,onTagObj:a,schema:o,sourceObjects:l}=n;let c;if(s&&e&&typeof e=="object"){if(c=l.get(e),c)return c.anchor??(c.anchor=r(e)),new ic(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=b0+t.slice(2));let u=j0(e,t,o.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const v=new B(e);return c&&(c.node=v),v}u=e instanceof Map?o[Jt]:Symbol.iterator in Object(e)?o[ms]:o[Jt]}a&&(a(u),delete n.onTagObj);const p=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((x=u==null?void 0:u.nodeClass)==null?void 0:x.from)=="function"?u.nodeClass.from(n.schema,e,n):new B(e);return t?p.tag=t:u.default||(p.tag=u.tag),c&&(c.node=p),p}function Wi(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){const a=t[r];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){const o=[];o[a]=s,s=o}else s=new Map([[a,s]])}return gr(s,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Ds=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Mp extends rc{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(s=>ce(s)||ue(s)?s.clone(t):s),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(Ds(t))this.add(n);else{const[s,...r]=t,a=this.get(s,!0);if(le(a))a.addIn(r,n);else if(a===void 0&&this.schema)this.set(s,Wi(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}deleteIn(t){const[n,...s]=t;if(s.length===0)return this.delete(n);const r=this.get(n,!0);if(le(r))return r.deleteIn(s);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${s}`)}getIn(t,n){const[s,...r]=t,a=this.get(s,!0);return r.length===0?!n&&Y(a)?a.value:a:le(a)?a.getIn(r,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!ue(n))return!1;const s=n.value;return s==null||t&&Y(s)&&s.value==null&&!s.commentBefore&&!s.comment&&!s.tag})}hasIn(t){const[n,...s]=t;if(s.length===0)return this.has(n);const r=this.get(n,!0);return le(r)?r.hasIn(s):!1}setIn(t,n){const[s,...r]=t;if(r.length===0)this.set(s,n);else{const a=this.get(s,!0);if(le(a))a.setIn(r,n);else if(a===void 0&&this.schema)this.set(s,Wi(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}const w0=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function wt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const dn=(e,t,n)=>e.endsWith(`
|
|
69
|
+
`)?wt(n,t):n.includes(`
|
|
70
|
+
`)?`
|
|
71
|
+
`+wt(n,t):(e.endsWith(" ")?"":" ")+n,Rp="flow",tl="block",hi="quoted";function fa(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:a=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return e;r<a&&(a=0);const c=Math.max(1+a,1+r-t.length);if(e.length<=c)return e;const u=[],p={};let d=r-t.length;typeof s=="number"&&(s>r-Math.max(2,a)?u.push(0):d=r-s);let f,x,v=!1,y=-1,j=-1,g=-1;n===tl&&(y=Du(e,y,t.length),y!==-1&&(d=y+c));for(let m;m=e[y+=1];){if(n===hi&&m==="\\"){switch(j=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}g=y}if(m===`
|
|
72
|
+
`)n===tl&&(y=Du(e,y,t.length)),d=y+t.length+c,f=void 0;else{if(m===" "&&x&&x!==" "&&x!==`
|
|
73
|
+
`&&x!==" "){const w=e[y+1];w&&w!==" "&&w!==`
|
|
74
|
+
`&&w!==" "&&(f=y)}if(y>=d)if(f)u.push(f),d=f+c,f=void 0;else if(n===hi){for(;x===" "||x===" ";)x=m,m=e[y+=1],v=!0;const w=y>g+1?y-2:j-1;if(p[w])return e;u.push(w),p[w]=!0,d=w+c,f=void 0}else v=!0}x=m}if(v&&l&&l(),u.length===0)return e;o&&o();let h=e.slice(0,u[0]);for(let m=0;m<u.length;++m){const w=u[m],k=u[m+1]||e.length;w===0?h=`
|
|
75
|
+
${t}${e.slice(0,k)}`:(n===hi&&p[w]&&(h+=`${e[w]}\\`),h+=`
|
|
76
|
+
${t}${e.slice(w+1,k)}`)}return h}function Du(e,t,n){let s=t,r=t+1,a=e[r];for(;a===" "||a===" ";)if(t<r+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
77
|
+
`);s=t,r=t+1,a=e[r]}return s}const pa=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ma=e=>/^(%|---|\.\.\.)/m.test(e);function k0(e,t,n){if(!t||t<0)return!1;const s=t-n,r=e.length;if(r<=s)return!1;for(let a=0,o=0;a<r;++a)if(e[a]===`
|
|
78
|
+
`){if(a-o>s)return!0;if(o=a+1,r-o<=s)return!1}return!0}function Ys(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ma(e)?" ":"");let o="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(o+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{o+=n.slice(l,c);const p=n.substr(c+2,4);switch(p){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:p.substr(0,2)==="00"?o+="\\x"+p.substr(2):o+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<r)c+=1;else{for(o+=n.slice(l,c)+`
|
|
79
|
+
|
|
80
|
+
`;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)o+=`
|
|
81
|
+
`,c+=2;o+=a,n[c+2]===" "&&(o+="\\"),c+=1,l=c+1}break;default:c+=1}return o=l?o+n.slice(l):n,s?o:fa(o,a,hi,pa(t,!1))}function nl(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
82
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Ys(e,t);const n=t.indent||(ma(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
83
|
+
${n}`)+"'";return t.implicitKey?s:fa(s,n,Rp,pa(t,!1))}function Hn(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=Ys;else{const r=e.includes('"'),a=e.includes("'");r&&!a?s=nl:a&&!r?s=Ys:s=n?nl:Ys}return s(e,t)}let sl;try{sl=new RegExp(`(^|(?<!
|
|
84
|
+
))
|
|
85
|
+
+(?!
|
|
86
|
+
|$)`,"g")}catch{sl=/\n+(?!\n|$)/g}function gi({comment:e,type:t,value:n},s,r,a){const{blockQuote:o,commentString:l,lineWidth:c}=s.options;if(!o||/\n[\t ]+$/.test(n))return Hn(n,s);const u=s.indent||(s.forceBlockIndent||ma(n)?" ":""),p=o==="literal"?!0:o==="folded"||t===B.BLOCK_FOLDED?!1:t===B.BLOCK_LITERAL?!0:!k0(n,c,u.length);if(!n)return p?`|
|
|
87
|
+
`:`>
|
|
88
|
+
`;let d,f;for(f=n.length;f>0;--f){const k=n[f-1];if(k!==`
|
|
89
|
+
`&&k!==" "&&k!==" ")break}let x=n.substring(f);const v=x.indexOf(`
|
|
90
|
+
`);v===-1?d="-":n===x||v!==x.length-1?(d="+",a&&a()):d="",x&&(n=n.slice(0,-x.length),x[x.length-1]===`
|
|
91
|
+
`&&(x=x.slice(0,-1)),x=x.replace(sl,`$&${u}`));let y=!1,j,g=-1;for(j=0;j<n.length;++j){const k=n[j];if(k===" ")y=!0;else if(k===`
|
|
92
|
+
`)g=j;else break}let h=n.substring(0,g<j?g+1:j);h&&(n=n.substring(h.length),h=h.replace(/\n+/g,`$&${u}`));let w=(y?u?"2":"1":"")+d;if(e&&(w+=" "+l(e.replace(/ ?[\r\n]+/g," ")),r&&r()),!p){const k=n.replace(/\n+/g,`
|
|
93
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`);let C=!1;const S=pa(s,!0);o!=="folded"&&t!==B.BLOCK_FOLDED&&(S.onOverflow=()=>{C=!0});const N=fa(`${h}${k}${x}`,u,tl,S);if(!C)return`>${w}
|
|
94
|
+
${u}${N}`}return n=n.replace(/\n+/g,`$&${u}`),`|${w}
|
|
95
|
+
${u}${h}${n}${x}`}function N0(e,t,n,s){const{type:r,value:a}=e,{actualString:o,implicitKey:l,indent:c,indentStep:u,inFlow:p}=t;if(l&&a.includes(`
|
|
96
|
+
`)||p&&/[[\]{},]/.test(a))return Hn(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return l||p||!a.includes(`
|
|
97
|
+
`)?Hn(a,t):gi(e,t,n,s);if(!l&&!p&&r!==B.PLAIN&&a.includes(`
|
|
98
|
+
`))return gi(e,t,n,s);if(ma(a)){if(c==="")return t.forceBlockIndent=!0,gi(e,t,n,s);if(l&&c===u)return Hn(a,t)}const d=a.replace(/\n+/g,`$&
|
|
99
|
+
${c}`);if(o){const f=y=>{var j;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((j=y.test)==null?void 0:j.test(d))},{compat:x,tags:v}=t.doc.schema;if(v.some(f)||x!=null&&x.some(f))return Hn(a,t)}return l?d:fa(d,c,Rp,pa(t,!1))}function ac(e,t,n,s){const{implicitKey:r,inFlow:a}=t,o=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:l}=e;l!==B.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=B.QUOTE_DOUBLE);const c=p=>{switch(p){case B.BLOCK_FOLDED:case B.BLOCK_LITERAL:return r||a?Hn(o.value,t):gi(o,t,n,s);case B.QUOTE_DOUBLE:return Ys(o.value,t);case B.QUOTE_SINGLE:return nl(o.value,t);case B.PLAIN:return N0(o,t,n,s);default:return null}};let u=c(l);if(u===null){const{defaultKeyType:p,defaultStringType:d}=t.options,f=r&&p||d;if(u=c(f),u===null)throw new Error(`Unsupported default string type ${f}`)}return u}function $p(e,t){const n=Object.assign({blockQuote:!0,commentString:w0,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let s;switch(n.collectionStyle){case"block":s=!1;break;case"flow":s=!0;break;default:s=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:s,options:n}}function S0(e,t){var r;if(t.tag){const a=e.filter(o=>o.tag===t.tag);if(a.length>0)return a.find(o=>o.format===t.format)??a[0]}let n,s;if(Y(t)){s=t.value;let a=e.filter(o=>{var l;return(l=o.identify)==null?void 0:l.call(o,s)});if(a.length>1){const o=a.filter(l=>l.test);o.length>0&&(a=o)}n=a.find(o=>o.format===t.format)??a.find(o=>!o.format)}else s=t,n=e.find(a=>a.nodeClass&&s instanceof a.nodeClass);if(!n){const a=((r=s==null?void 0:s.constructor)==null?void 0:r.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${a} value`)}return n}function C0(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],a=(Y(e)||le(e))&&e.anchor;a&&Op(a)&&(n.add(a),r.push(`&${a}`));const o=e.tag??(t.default?null:t.tag);return o&&r.push(s.directives.tagString(o)),r.join(" ")}function os(e,t,n,s){var c;if(ue(e))return e.toString(t,n,s);if(hs(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const a=ce(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=S0(t.doc.schema.tags,a));const o=C0(a,r,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);const l=typeof r.stringify=="function"?r.stringify(a,t,n,s):Y(a)?ac(a,t,n,s):a.toString(t,n,s);return o?Y(a)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
100
|
+
${t.indent}${l}`:l}function E0({key:e,value:t},n,s,r){const{allNullValues:a,doc:o,indent:l,indentStep:c,options:{commentString:u,indentSeq:p,simpleKeys:d}}=n;let f=ce(e)&&e.comment||null;if(d){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(le(e)||!ce(e)&&typeof e=="object"){const S="With simple keys, collection cannot be used as a key value";throw new Error(S)}}let x=!d&&(!e||f&&t==null&&!n.inFlow||le(e)||(Y(e)?e.type===B.BLOCK_FOLDED||e.type===B.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!x&&(d||!a),indent:l+c});let v=!1,y=!1,j=os(e,n,()=>v=!0,()=>y=!0);if(!x&&!n.inFlow&&j.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(n.inFlow){if(a||t==null)return v&&s&&s(),j===""?"?":x?`? ${j}`:j}else if(a&&!d||t==null&&x)return j=`? ${j}`,f&&!v?j+=dn(j,n.indent,u(f)):y&&r&&r(),j;v&&(f=null),x?(f&&(j+=dn(j,n.indent,u(f))),j=`? ${j}
|
|
101
|
+
${l}:`):(j=`${j}:`,f&&(j+=dn(j,n.indent,u(f))));let g,h,m;ce(t)?(g=!!t.spaceBefore,h=t.commentBefore,m=t.comment):(g=!1,h=null,m=null,t&&typeof t=="object"&&(t=o.createNode(t))),n.implicitKey=!1,!x&&!f&&Y(t)&&(n.indentAtStart=j.length+1),y=!1,!p&&c.length>=2&&!n.inFlow&&!x&&Sr(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let w=!1;const k=os(t,n,()=>w=!0,()=>y=!0);let C=" ";if(f||g||h){if(C=g?`
|
|
102
|
+
`:"",h){const S=u(h);C+=`
|
|
103
|
+
${wt(S,n.indent)}`}k===""&&!n.inFlow?C===`
|
|
104
|
+
`&&m&&(C=`
|
|
105
|
+
|
|
106
|
+
`):C+=`
|
|
107
|
+
${n.indent}`}else if(!x&&le(t)){const S=k[0],N=k.indexOf(`
|
|
108
|
+
`),T=N!==-1,A=n.inFlow??t.flow??t.items.length===0;if(T||!A){let F=!1;if(T&&(S==="&"||S==="!")){let G=k.indexOf(" ");S==="&"&&G!==-1&&G<N&&k[G+1]==="!"&&(G=k.indexOf(" ",G+1)),(G===-1||N<G)&&(F=!0)}F||(C=`
|
|
109
|
+
${n.indent}`)}}else(k===""||k[0]===`
|
|
110
|
+
`)&&(C="");return j+=C+k,n.inFlow?w&&s&&s():m&&!w?j+=dn(j,n.indent,u(m)):y&&r&&r(),j}function zp(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Gr="<<",Nt={identify:e=>e===Gr||typeof e=="symbol"&&e.description===Gr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new B(Symbol(Gr)),{addToJSMap:Fp}),stringify:()=>Gr},T0=(e,t)=>(Nt.identify(t)||Y(t)&&(!t.type||t.type===B.PLAIN)&&Nt.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Nt.tag&&n.default));function Fp(e,t,n){const s=Bp(e,n);if(Sr(s))for(const r of s.items)Ga(e,t,r);else if(Array.isArray(s))for(const r of s)Ga(e,t,r);else Ga(e,t,s)}function Ga(e,t,n){const s=Bp(e,n);if(!Nr(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[a,o]of r)t instanceof Map?t.has(a)||t.set(a,o):t instanceof Set?t.add(a):Object.prototype.hasOwnProperty.call(t,a)||Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return t}function Bp(e,t){return e&&hs(t)?t.resolve(e.doc,e):t}function Up(e,t,{key:n,value:s}){if(ce(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(T0(e,n))Fp(e,t,s);else{const r=Ye(n,"",e);if(t instanceof Map)t.set(r,Ye(s,r,e));else if(t instanceof Set)t.add(r);else{const a=L0(n,r,e),o=Ye(s,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function L0(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ce(e)&&(n!=null&&n.doc)){const s=$p(n.doc,{});s.anchors=new Set;for(const a of n.anchors.keys())s.anchors.add(a.anchor);s.inFlow=!0,s.inStringifyKey=!0;const r=e.toString(s);if(!n.mapKeyWarned){let a=JSON.stringify(r);a.length>40&&(a=a.substring(0,36)+'..."'),zp(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function oc(e,t,n){const s=gr(e,void 0,n),r=gr(t,void 0,n);return new Ee(s,r)}class Ee{constructor(t,n=null){Object.defineProperty(this,Xe,{value:Ap}),this.key=t,this.value=n}clone(t){let{key:n,value:s}=this;return ce(n)&&(n=n.clone(t)),ce(s)&&(s=s.clone(t)),new Ee(n,s)}toJSON(t,n){const s=n!=null&&n.mapAsMap?new Map:{};return Up(n,s,this)}toString(t,n,s){return t!=null&&t.doc?E0(this,t,n,s):JSON.stringify(this)}}function Wp(e,t,n){return(t.inFlow??e.flow?I0:A0)(e,t,n)}function A0({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:a,onChompKeep:o,onComment:l}){const{indent:c,options:{commentString:u}}=n,p=Object.assign({},n,{indent:a,type:null});let d=!1;const f=[];for(let v=0;v<t.length;++v){const y=t[v];let j=null;if(ce(y))!d&&y.spaceBefore&&f.push(""),Hi(n,f,y.commentBefore,d),y.comment&&(j=y.comment);else if(ue(y)){const h=ce(y.key)?y.key:null;h&&(!d&&h.spaceBefore&&f.push(""),Hi(n,f,h.commentBefore,d))}d=!1;let g=os(y,p,()=>j=null,()=>d=!0);j&&(g+=dn(g,a,u(j))),d&&j&&(d=!1),f.push(s+g)}let x;if(f.length===0)x=r.start+r.end;else{x=f[0];for(let v=1;v<f.length;++v){const y=f[v];x+=y?`
|
|
111
|
+
${c}${y}`:`
|
|
112
|
+
`}}return e?(x+=`
|
|
113
|
+
`+wt(u(e),c),l&&l()):d&&o&&o(),x}function I0({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:a,flowCollectionPadding:o,options:{commentString:l}}=t;s+=a;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,p=0;const d=[];for(let v=0;v<e.length;++v){const y=e[v];let j=null;if(ce(y))y.spaceBefore&&d.push(""),Hi(t,d,y.commentBefore,!1),y.comment&&(j=y.comment);else if(ue(y)){const h=ce(y.key)?y.key:null;h&&(h.spaceBefore&&d.push(""),Hi(t,d,h.commentBefore,!1),h.comment&&(u=!0));const m=ce(y.value)?y.value:null;m?(m.comment&&(j=m.comment),m.commentBefore&&(u=!0)):y.value==null&&(h!=null&&h.comment)&&(j=h.comment)}j&&(u=!0);let g=os(y,c,()=>j=null);u||(u=d.length>p||g.includes(`
|
|
114
|
+
`)),v<e.length-1?g+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((h,m)=>h+m.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),j&&(g+=dn(g,s,l(j))),d.push(g),p=d.length}const{start:f,end:x}=n;if(d.length===0)return f+x;if(!u){const v=d.reduce((y,j)=>y+j.length+2,2);u=t.options.lineWidth>0&&v>t.options.lineWidth}if(u){let v=f;for(const y of d)v+=y?`
|
|
115
|
+
${a}${r}${y}`:`
|
|
116
|
+
`;return`${v}
|
|
117
|
+
${r}${x}`}else return`${f}${o}${d.join(" ")}${o}${x}`}function Hi({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const a=wt(t(s),e);n.push(a.trimStart())}}function fn(e,t){const n=Y(t)?t.value:t;for(const s of e)if(ue(s)&&(s.key===t||s.key===n||Y(s.key)&&s.key.value===n))return s}class Ke extends Mp{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Jt,t),this.items=[]}static from(t,n,s){const{keepUndefined:r,replacer:a}=s,o=new this(t),l=(c,u)=>{if(typeof a=="function")u=a.call(n,c,u);else if(Array.isArray(a)&&!a.includes(c))return;(u!==void 0||r)&&o.items.push(oc(c,u,s))};if(n instanceof Map)for(const[c,u]of n)l(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))l(c,n[c]);return typeof t.sortMapEntries=="function"&&o.items.sort(t.sortMapEntries),o}add(t,n){var o;let s;ue(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Ee(t,t==null?void 0:t.value):s=new Ee(t.key,t.value);const r=fn(this.items,s.key),a=(o=this.schema)==null?void 0:o.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);Y(r.value)&&Dp(s.value)?r.value.value=s.value:r.value=s.value}else if(a){const l=this.items.findIndex(c=>a(s,c)<0);l===-1?this.items.push(s):this.items.splice(l,0,s)}else this.items.push(s)}delete(t){const n=fn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=fn(this.items,t),r=s==null?void 0:s.value;return(!n&&Y(r)?r.value:r)??void 0}has(t){return!!fn(this.items,t)}set(t,n){this.add(new Ee(t,n),!0)}toJSON(t,n,s){const r=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const a of this.items)Up(n,r,a);return r}toString(t,n,s){if(!t)return JSON.stringify(this);for(const r of this.items)if(!ue(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),Wp(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const ys={collection:"map",default:!0,nodeClass:Ke,tag:"tag:yaml.org,2002:map",resolve(e,t){return Nr(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ke.from(e,t,n)};class bn extends Mp{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ms,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=qr(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=qr(t);if(typeof s!="number")return;const r=this.items[s];return!n&&Y(r)?r.value:r}has(t){const n=qr(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=qr(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[s];Y(r)&&Dp(n)?r.value=n:this.items[s]=n}toJSON(t,n){const s=[];n!=null&&n.onCreate&&n.onCreate(s);let r=0;for(const a of this.items)s.push(Ye(a,String(r++),n));return s}toString(t,n,s){return t?Wp(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:s,onComment:n}):JSON.stringify(this)}static from(t,n,s){const{replacer:r}=s,a=new this(t);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){const c=n instanceof Set?l:String(o++);l=r.call(n,c,l)}a.items.push(gr(l,void 0,s))}}return a}}function qr(e){let t=Y(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const xs={collection:"seq",default:!0,nodeClass:bn,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Sr(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>bn.from(e,t,n)},ha={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,s){return t=Object.assign({actualString:!0},t),ac(e,t,n,s)}},ga={identify:e=>e==null,createNode:()=>new B(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new B(null),stringify:({source:e},t)=>typeof e=="string"&&ga.test.test(e)?e:t.options.nullStr},lc={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new B(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&lc.test.test(e)){const s=e[0]==="t"||e[0]==="T";if(t===s)return e}return t?n.options.trueStr:n.options.falseStr}};function ut({format:e,minFractionDigits:t,tag:n,value:s}){if(typeof s=="bigint")return String(s);const r=typeof s=="number"?s:Number(s);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let a=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let l=t-(a.length-o-1);for(;l-- >0;)a+="0"}return a}const Hp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ut},Vp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ut(e)}},Kp={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new B(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:ut},ya=e=>typeof e=="bigint"||Number.isInteger(e),cc=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Gp(e,t,n){const{value:s}=e;return ya(s)&&s>=0?n+s.toString(t):ut(e)}const qp={identify:e=>ya(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>cc(e,2,8,n),stringify:e=>Gp(e,8,"0o")},Yp={identify:ya,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>cc(e,0,10,n),stringify:ut},Qp={identify:e=>ya(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>cc(e,2,16,n),stringify:e=>Gp(e,16,"0x")},O0=[ys,xs,ha,ga,lc,qp,Yp,Qp,Hp,Vp,Kp];function Mu(e){return typeof e=="bigint"||Number.isInteger(e)}const Yr=({value:e})=>JSON.stringify(e),P0=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Yr},{identify:e=>e==null,createNode:()=>new B(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Yr},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Yr},{identify:Mu,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>Mu(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Yr}],_0={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},D0=[ys,xs].concat(P0,_0),uc={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),s=new Uint8Array(n.length);for(let r=0;r<n.length;++r)s[r]=n.charCodeAt(r);return s}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},s,r,a){if(!n)return"";const o=n;let l;if(typeof btoa=="function"){let c="";for(let u=0;u<o.length;++u)c+=String.fromCharCode(o[u]);l=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=B.BLOCK_LITERAL),t!==B.QUOTE_DOUBLE){const c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(l.length/c),p=new Array(u);for(let d=0,f=0;d<u;++d,f+=c)p[d]=l.substr(f,c);l=p.join(t===B.BLOCK_LITERAL?`
|
|
118
|
+
`:" ")}return ac({comment:e,type:t,value:l},s,r,a)}};function Jp(e,t){if(Sr(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!ue(s)){if(Nr(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const r=s.items[0]||new Ee(new B(null));if(s.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${s.commentBefore}
|
|
119
|
+
${r.key.commentBefore}`:s.commentBefore),s.comment){const a=r.value??r.key;a.comment=a.comment?`${s.comment}
|
|
120
|
+
${a.comment}`:s.comment}s=r}e.items[n]=ue(s)?s:new Ee(s)}}else t("Expected a sequence for this tag");return e}function Xp(e,t,n){const{replacer:s}=n,r=new bn(e);r.tag="tag:yaml.org,2002:pairs";let a=0;if(t&&Symbol.iterator in Object(t))for(let o of t){typeof s=="function"&&(o=s.call(t,String(a++),o));let l,c;if(Array.isArray(o))if(o.length===2)l=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const u=Object.keys(o);if(u.length===1)l=u[0],c=o[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=o;r.items.push(oc(l,c,n))}return r}const dc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Jp,createNode:Xp};class Jn extends bn{constructor(){super(),this.add=Ke.prototype.add.bind(this),this.delete=Ke.prototype.delete.bind(this),this.get=Ke.prototype.get.bind(this),this.has=Ke.prototype.has.bind(this),this.set=Ke.prototype.set.bind(this),this.tag=Jn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const r of this.items){let a,o;if(ue(r)?(a=Ye(r.key,"",n),o=Ye(r.value,a,n)):a=Ye(r,"",n),s.has(a))throw new Error("Ordered maps must not include duplicate keys");s.set(a,o)}return s}static from(t,n,s){const r=Xp(t,n,s),a=new this;return a.items=r.items,a}}Jn.tag="tag:yaml.org,2002:omap";const fc={collection:"seq",identify:e=>e instanceof Map,nodeClass:Jn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Jp(e,t),s=[];for(const{key:r}of n.items)Y(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new Jn,n)},createNode:(e,t,n)=>Jn.from(e,t,n)};function Zp({value:e,source:t},n){return t&&(e?em:tm).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const em={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new B(!0),stringify:Zp},tm={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new B(!1),stringify:Zp},M0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ut},R0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():ut(e)}},$0={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new B(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const s=e.substring(n+1).replace(/_/g,"");s[s.length-1]==="0"&&(t.minFractionDigits=s.length)}return t},stringify:ut},Cr=e=>typeof e=="bigint"||Number.isInteger(e);function xa(e,t,n,{intAsBigInt:s}){const r=e[0];if((r==="-"||r==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),s){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const o=BigInt(e);return r==="-"?BigInt(-1)*o:o}const a=parseInt(e,n);return r==="-"?-1*a:a}function pc(e,t,n){const{value:s}=e;if(Cr(s)){const r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return ut(e)}const z0={identify:Cr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>xa(e,2,2,n),stringify:e=>pc(e,2,"0b")},F0={identify:Cr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>xa(e,1,8,n),stringify:e=>pc(e,8,"0")},B0={identify:Cr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>xa(e,0,10,n),stringify:ut},U0={identify:Cr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>xa(e,2,16,n),stringify:e=>pc(e,16,"0x")};class Xn extends Ke{constructor(t){super(t),this.tag=Xn.tag}add(t){let n;ue(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ee(t.key,null):n=new Ee(t,null),fn(this.items,n.key)||this.items.push(n)}get(t,n){const s=fn(this.items,t);return!n&&ue(s)?Y(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=fn(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Ee(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:r}=s,a=new this(t);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),a.items.push(oc(o,null,s));return a}}Xn.tag="tag:yaml.org,2002:set";const mc={collection:"map",identify:e=>e instanceof Set,nodeClass:Xn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Xn.from(e,t,n),resolve(e,t){if(Nr(e)){if(e.hasAllNullValues(!0))return Object.assign(new Xn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function hc(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,r=o=>t?BigInt(o):Number(o),a=s.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*a:a}function nm(e){let{value:t}=e,n=o=>o;if(typeof t=="bigint")n=o=>BigInt(o);else if(isNaN(t)||!isFinite(t))return ut(e);let s="";t<0&&(s="-",t*=n(-1));const r=n(60),a=[t%r];return t<60?a.unshift(0):(t=(t-a[0])/r,a.unshift(t%r),t>=60&&(t=(t-a[0])/r,a.unshift(t))),s+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const sm={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>hc(e,n),stringify:nm},rm={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>hc(e,!1),stringify:nm},va={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(va.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,a,o,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,r,a||0,o||0,l||0,c);const p=t[8];if(p&&p!=="Z"){let d=hc(p,!1);Math.abs(d)<30&&(d*=60),u-=6e4*d}return new Date(u)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},Ru=[ys,xs,ha,ga,em,tm,z0,F0,B0,U0,M0,R0,$0,uc,Nt,fc,dc,mc,sm,rm,va],$u=new Map([["core",O0],["failsafe",[ys,xs,ha]],["json",D0],["yaml11",Ru],["yaml-1.1",Ru]]),zu={binary:uc,bool:lc,float:Kp,floatExp:Vp,floatNaN:Hp,floatTime:rm,int:Yp,intHex:Qp,intOct:qp,intTime:sm,map:ys,merge:Nt,null:ga,omap:fc,pairs:dc,seq:xs,set:mc,timestamp:va},W0={"tag:yaml.org,2002:binary":uc,"tag:yaml.org,2002:merge":Nt,"tag:yaml.org,2002:omap":fc,"tag:yaml.org,2002:pairs":dc,"tag:yaml.org,2002:set":mc,"tag:yaml.org,2002:timestamp":va};function qa(e,t,n){const s=$u.get(t);if(s&&!e)return n&&!s.includes(Nt)?s.concat(Nt):s.slice();let r=s;if(!r)if(Array.isArray(e))r=[];else{const a=Array.from($u.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${a} or define customTags array`)}if(Array.isArray(e))for(const a of e)r=r.concat(a);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(Nt)),r.reduce((a,o)=>{const l=typeof o=="string"?zu[o]:o;if(!l){const c=JSON.stringify(o),u=Object.keys(zu).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return a.includes(l)||a.push(l),a},[])}const H0=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class gc{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:a,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(t)?qa(t,"compat"):t?qa(null,t):null,this.name=typeof a=="string"&&a||"core",this.knownTags=r?W0:{},this.tags=qa(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,Jt,{value:ys}),Object.defineProperty(this,gt,{value:ha}),Object.defineProperty(this,ms,{value:xs}),this.sortMapEntries=typeof o=="function"?o:o===!0?H0:null}clone(){const t=Object.create(gc.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function V0(e,t){var c;const n=[];let s=t.directives===!0;if(t.directives!==!1&&e.directives){const u=e.directives.toString(e);u?(n.push(u),s=!0):e.directives.docStart&&(s=!0)}s&&n.push("---");const r=$p(e,t),{commentString:a}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=a(e.commentBefore);n.unshift(wt(u,""))}let o=!1,l=null;if(e.contents){if(ce(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const d=a(e.contents.commentBefore);n.push(wt(d,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>o=!0;let p=os(e.contents,r,()=>l=null,u);l&&(p+=dn(p,"",a(l))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(os(e.contents,r));if((c=e.directives)!=null&&c.docEnd)if(e.comment){const u=a(e.comment);u.includes(`
|
|
121
|
+
`)?(n.push("..."),n.push(wt(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&o&&(u=u.replace(/^\n+/,"")),u&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(wt(a(u),"")))}return n.join(`
|
|
122
|
+
`)+`
|
|
123
|
+
`}class Er{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Xe,{value:el});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);const a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=a;let{version:o}=a;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Se({version:o}),this.setSchema(o,s),this.contents=t===void 0?null:this.createNode(t,r,s)}clone(){const t=Object.create(Er.prototype,{[Xe]:{value:el}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ce(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Cn(this.contents)&&this.contents.add(t)}addIn(t,n){Cn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=Pp(this);t.anchor=!n||s.has(n)?_p(n||"a",s):n}return new ic(t.anchor)}createNode(t,n,s){let r;if(typeof n=="function")t=n.call({"":t},"",t),r=n;else if(Array.isArray(n)){const j=h=>typeof h=="number"||h instanceof String||h instanceof Number,g=n.filter(j).map(String);g.length>0&&(n=n.concat(g)),r=n}else s===void 0&&n&&(s=n,n=void 0);const{aliasDuplicateObjects:a,anchorPrefix:o,flow:l,keepUndefined:c,onTagObj:u,tag:p}=s??{},{onAnchor:d,setAnchors:f,sourceObjects:x}=v0(this,o||"a"),v={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:x},y=gr(t,p,v);return l&&le(y)&&(y.flow=!0),f(),y}createPair(t,n,s={}){const r=this.createNode(t,null,s),a=this.createNode(n,null,s);return new Ee(r,a)}delete(t){return Cn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return Ds(t)?this.contents==null?!1:(this.contents=null,!0):Cn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return le(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return Ds(t)?!n&&Y(this.contents)?this.contents.value:this.contents:le(this.contents)?this.contents.getIn(t,n):void 0}has(t){return le(this.contents)?this.contents.has(t):!1}hasIn(t){return Ds(t)?this.contents!==void 0:le(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Wi(this.schema,[t],n):Cn(this.contents)&&this.contents.set(t,n)}setIn(t,n){Ds(t)?this.contents=n:this.contents==null?this.contents=Wi(this.schema,Array.from(t),n):Cn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Se({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Se({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new gc(Object.assign(s,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:s,maxAliasCount:r,onAnchor:a,reviver:o}={}){const l={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Ye(this.contents,n??"",l);if(typeof a=="function")for(const{count:u,res:p}of l.anchors.values())a(p,u);return typeof o=="function"?Wn(o,{"":c},"",c):c}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return V0(this,t)}}function Cn(e){if(le(e))return!0;throw new Error("Expected a YAML collection as document contents")}class im extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}}class Ms extends im{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class K0 extends im{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const Fu=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>t.linePos(l));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let a=r-1,o=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){const l=Math.min(a-39,o.length-79);o="…"+o.substring(l),a-=l-1}if(o.length>80&&(o=o.substring(0,79)+"…"),s>1&&/^ *$/.test(o.substring(0,a))){let l=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`…
|
|
124
|
+
`),o=l+o}if(/[^ ]/.test(o)){let l=1;const c=n.linePos[1];(c==null?void 0:c.line)===s&&c.col>r&&(l=Math.max(1,Math.min(c.col-r,80-a)));const u=" ".repeat(a)+"^".repeat(l);n.message+=`:
|
|
125
|
+
|
|
126
|
+
${o}
|
|
127
|
+
${u}
|
|
128
|
+
`}};function ls(e,{flow:t,indicator:n,next:s,offset:r,onError:a,parentIndent:o,startOnNewline:l}){let c=!1,u=l,p=l,d="",f="",x=!1,v=!1,y=null,j=null,g=null,h=null,m=null,w=null,k=null;for(const N of e)switch(v&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&a(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v=!1),y&&(u&&N.type!=="comment"&&N.type!=="newline"&&a(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),N.type){case"space":!t&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&N.source.includes(" ")&&(y=N),p=!0;break;case"comment":{p||a(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=N.source.substring(1)||" ";d?d+=f+T:d=T,f="",u=!1;break}case"newline":u?d?d+=N.source:(!w||n!=="seq-item-ind")&&(c=!0):f+=N.source,u=!0,x=!0,(j||g)&&(h=N),p=!0;break;case"anchor":j&&a(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&a(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=N,k??(k=N.offset),u=!1,p=!1,v=!0;break;case"tag":{g&&a(N,"MULTIPLE_TAGS","A node can have at most one tag"),g=N,k??(k=N.offset),u=!1,p=!1,v=!0;break}case n:(j||g)&&a(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),w&&a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${t??"collection"}`),w=N,u=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){m&&a(N,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),m=N,u=!1,p=!1;break}default:a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),u=!1,p=!1}const C=e[e.length-1],S=C?C.offset+C.source.length:r;return v&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&a(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(u&&y.indent<=o||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&a(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:m,found:w,spaceBefore:c,comment:d,hasNewline:x,anchor:j,tag:g,newlineAfterProp:h,end:S,start:k??S}}function yr(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
129
|
+
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(yr(t.key)||yr(t.value))return!0}return!1;default:return!0}}function rl(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&yr(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function am(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const r=typeof s=="function"?s:(a,o)=>a===o||Y(a)&&Y(o)&&a.value===o.value;return t.some(a=>r(a.key,n))}const Bu="All mapping items must start at the same column";function G0({composeNode:e,composeEmptyNode:t},n,s,r,a){var p;const o=(a==null?void 0:a.nodeClass)??Ke,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const d of s.items){const{start:f,key:x,sep:v,value:y}=d,j=ls(f,{indicator:"explicit-key-ind",next:x??(v==null?void 0:v[0]),offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0}),g=!j.found;if(g){if(x&&(x.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in x&&x.indent!==s.indent&&r(c,"BAD_INDENT",Bu)),!j.anchor&&!j.tag&&!v){u=j.end,j.comment&&(l.comment?l.comment+=`
|
|
130
|
+
`+j.comment:l.comment=j.comment);continue}(j.newlineAfterProp||yr(x))&&r(x??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=j.found)==null?void 0:p.indent)!==s.indent&&r(c,"BAD_INDENT",Bu);n.atKey=!0;const h=j.end,m=x?e(n,x,j,r):t(n,h,f,null,j,r);n.schema.compat&&rl(s.indent,x,r),n.atKey=!1,am(n,l.items,m)&&r(h,"DUPLICATE_KEY","Map keys must be unique");const w=ls(v??[],{indicator:"map-value-ind",next:y,offset:m.range[2],onError:r,parentIndent:s.indent,startOnNewline:!x||x.type==="block-scalar"});if(c=w.end,w.found){g&&((y==null?void 0:y.type)==="block-map"&&!w.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&j.start<w.found.offset-1024&&r(m.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=y?e(n,y,w,r):t(n,c,v,null,w,r);n.schema.compat&&rl(s.indent,y,r),c=k.range[2];const C=new Ee(m,k);n.options.keepSourceTokens&&(C.srcToken=d),l.items.push(C)}else{g&&r(m.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(m.comment?m.comment+=`
|
|
131
|
+
`+w.comment:m.comment=w.comment);const k=new Ee(m);n.options.keepSourceTokens&&(k.srcToken=d),l.items.push(k)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),l.range=[s.offset,c,u??c],l}function q0({composeNode:e,composeEmptyNode:t},n,s,r,a){const o=(a==null?void 0:a.nodeClass)??bn,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=s.offset,u=null;for(const{start:p,value:d}of s.items){const f=ls(p,{indicator:"seq-item-ind",next:d,offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||d)(d==null?void 0:d.type)==="block-seq"?r(f.end,"BAD_INDENT","All sequence items must start at the same column"):r(c,"MISSING_CHAR","Sequence item without - indicator");else{u=f.end,f.comment&&(l.comment=f.comment);continue}const x=d?e(n,d,f,r):t(n,f.end,p,null,f,r);n.schema.compat&&rl(s.indent,d,r),c=x.range[2],l.items.push(x)}return l.range=[s.offset,c,u??c],l}function Tr(e,t,n,s){let r="";if(e){let a=!1,o="";for(const l of e){const{source:c,type:u}=l;switch(u){case"space":a=!0;break;case"comment":{n&&!a&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=c.substring(1)||" ";r?r+=o+p:r=p,o="";break}case"newline":r&&(o+=c),a=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:r,offset:t}}const Ya="Block collections are not allowed within flow collections",Qa=e=>e&&(e.type==="block-map"||e.type==="block-seq");function Y0({composeNode:e,composeEmptyNode:t},n,s,r,a){var j;const o=s.start.source==="{",l=o?"flow map":"flow sequence",c=(a==null?void 0:a.nodeClass)??(o?Ke:bn),u=new c(n.schema);u.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){const h=s.items[g],{start:m,key:w,sep:k,value:C}=h,S=ls(m,{flow:l,indicator:"explicit-key-ind",next:w??(k==null?void 0:k[0]),offset:d,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!k&&!C){g===0&&S.comma?r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):g<s.items.length-1&&r(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),S.comment&&(u.comment?u.comment+=`
|
|
132
|
+
`+S.comment:u.comment=S.comment),d=S.end;continue}!o&&n.options.strict&&yr(w)&&r(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)S.comma&&r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(S.comma||r(S.start,"MISSING_CHAR",`Missing , between ${l} items`),S.comment){let N="";e:for(const T of m)switch(T.type){case"comma":case"space":break;case"comment":N=T.source.substring(1);break e;default:break e}if(N){let T=u.items[u.items.length-1];ue(T)&&(T=T.value??T.key),T.comment?T.comment+=`
|
|
133
|
+
`+N:T.comment=N,S.comment=S.comment.substring(N.length+1)}}if(!o&&!k&&!S.found){const N=C?e(n,C,S,r):t(n,S.end,k,null,S,r);u.items.push(N),d=N.range[2],Qa(C)&&r(N.range,"BLOCK_IN_FLOW",Ya)}else{n.atKey=!0;const N=S.end,T=w?e(n,w,S,r):t(n,N,m,null,S,r);Qa(w)&&r(T.range,"BLOCK_IN_FLOW",Ya),n.atKey=!1;const A=ls(k??[],{flow:l,indicator:"map-value-ind",next:C,offset:T.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(A.found){if(!o&&!S.found&&n.options.strict){if(k)for(const V of k){if(V===A.found)break;if(V.type==="newline"){r(V,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<A.found.offset-1024&&r(A.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&((j=C.source)==null?void 0:j[0])===":"?r(C,"MISSING_CHAR",`Missing space after : in ${l}`):r(A.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const F=C?e(n,C,A,r):A.found?t(n,A.end,k,null,A,r):null;F?Qa(C)&&r(F.range,"BLOCK_IN_FLOW",Ya):A.comment&&(T.comment?T.comment+=`
|
|
134
|
+
`+A.comment:T.comment=A.comment);const G=new Ee(T,F);if(n.options.keepSourceTokens&&(G.srcToken=h),o){const V=u;am(n,V.items,T)&&r(N,"DUPLICATE_KEY","Map keys must be unique"),V.items.push(G)}else{const V=new Ke(n.schema);V.flow=!0,V.items.push(G);const E=(F??T).range;V.range=[T.range[0],E[1],E[2]],u.items.push(V)}d=F?F.range[2]:A.end}}const f=o?"}":"]",[x,...v]=s.end;let y=d;if((x==null?void 0:x.source)===f)y=x.offset+x.source.length;else{const g=l[0].toUpperCase()+l.substring(1),h=p?`${g} must end with a ${f}`:`${g} in block collection must be sufficiently indented and end with a ${f}`;r(d,p?"MISSING_CHAR":"BAD_INDENT",h),x&&x.source.length!==1&&v.unshift(x)}if(v.length>0){const g=Tr(v,y,n.options.strict,r);g.comment&&(u.comment?u.comment+=`
|
|
135
|
+
`+g.comment:u.comment=g.comment),u.range=[s.offset,y,g.offset]}else u.range=[s.offset,y,y];return u}function Ja(e,t,n,s,r,a){const o=n.type==="block-map"?G0(e,t,n,s,a):n.type==="block-seq"?q0(e,t,n,s,a):Y0(e,t,n,s,a),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function Q0(e,t,n,s,r){var f;const a=s.tag,o=a?t.directives.tagName(a.source,x=>r(a,"TAG_RESOLVE_FAILED",x)):null;if(n.type==="block-seq"){const{anchor:x,newlineAfterProp:v}=s,y=x&&a?x.offset>a.offset?x:a:x??a;y&&(!v||v.offset<y.offset)&&r(y,"MISSING_CHAR","Missing newline after block sequence props")}const l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Ke.tagName&&l==="map"||o===bn.tagName&&l==="seq")return Ja(e,t,n,r,o);let c=t.schema.tags.find(x=>x.tag===o&&x.collection===l);if(!c){const x=t.schema.knownTags[o];if((x==null?void 0:x.collection)===l)t.schema.tags.push(Object.assign({},x,{default:!1})),c=x;else return x?r(a,"BAD_COLLECTION_TYPE",`${x.tag} used for ${l} collection, but expects ${x.collection??"scalar"}`,!0):r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ja(e,t,n,r,o)}const u=Ja(e,t,n,r,o,c),p=((f=c.resolve)==null?void 0:f.call(c,u,x=>r(a,"TAG_RESOLVE_FAILED",x),t.options))??u,d=ce(p)?p:new B(p);return d.range=u.range,d.tag=o,c!=null&&c.format&&(d.format=c.format),d}function J0(e,t,n){const s=t.offset,r=X0(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const a=r.mode===">"?B.BLOCK_FOLDED:B.BLOCK_LITERAL,o=t.source?Z0(t.source):[];let l=o.length;for(let y=o.length-1;y>=0;--y){const j=o[y][1];if(j===""||j==="\r")l=y;else break}if(l===0){const y=r.chomp==="+"&&o.length>0?`
|
|
136
|
+
`.repeat(Math.max(1,o.length-1)):"";let j=s+r.length;return t.source&&(j+=t.source.length),{value:y,type:a,comment:r.comment,range:[s,j,j]}}let c=t.indent+r.indent,u=t.offset+r.length,p=0;for(let y=0;y<l;++y){const[j,g]=o[y];if(g===""||g==="\r")r.indent===0&&j.length>c&&(c=j.length);else{j.length<c&&n(u+j.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=j.length),p=y,c===0&&!e.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=j.length+g.length+1}for(let y=o.length-1;y>=l;--y)o[y][0].length>c&&(l=y+1);let d="",f="",x=!1;for(let y=0;y<p;++y)d+=o[y][0].slice(c)+`
|
|
137
|
+
`;for(let y=p;y<l;++y){let[j,g]=o[y];u+=j.length+g.length+1;const h=g[g.length-1]==="\r";if(h&&(g=g.slice(0,-1)),g&&j.length<c){const w=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(u-g.length-(h?2:1),"BAD_INDENT",w),j=""}a===B.BLOCK_LITERAL?(d+=f+j.slice(c)+g,f=`
|
|
138
|
+
`):j.length>c||g[0]===" "?(f===" "?f=`
|
|
139
|
+
`:!x&&f===`
|
|
140
|
+
`&&(f=`
|
|
141
|
+
|
|
142
|
+
`),d+=f+j.slice(c)+g,f=`
|
|
143
|
+
`,x=!0):g===""?f===`
|
|
144
|
+
`?d+=`
|
|
145
|
+
`:f=`
|
|
146
|
+
`:(d+=f+g,f=" ",x=!1)}switch(r.chomp){case"-":break;case"+":for(let y=l;y<o.length;++y)d+=`
|
|
147
|
+
`+o[y][0].slice(c);d[d.length-1]!==`
|
|
148
|
+
`&&(d+=`
|
|
149
|
+
`);break;default:d+=`
|
|
150
|
+
`}const v=s+r.length+t.source.length;return{value:d,type:a,comment:r.comment,range:[s,v,v]}}function X0({offset:e,props:t},n,s){if(t[0].type!=="block-scalar-header")return s(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=t[0],a=r[0];let o=0,l="",c=-1;for(let f=1;f<r.length;++f){const x=r[f];if(!l&&(x==="-"||x==="+"))l=x;else{const v=Number(x);!o&&v?o=v:c===-1&&(c=e+f)}}c!==-1&&s(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let u=!1,p="",d=r.length;for(let f=1;f<t.length;++f){const x=t[f];switch(x.type){case"space":u=!0;case"newline":d+=x.source.length;break;case"comment":n&&!u&&s(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=x.source.length,p=x.source.substring(1);break;case"error":s(x,"UNEXPECTED_TOKEN",x.message),d+=x.source.length;break;default:{const v=`Unexpected token in block scalar header: ${x.type}`;s(x,"UNEXPECTED_TOKEN",v);const y=x.source;y&&typeof y=="string"&&(d+=y.length)}}}return{mode:a,indent:o,chomp:l,comment:p,length:d}}function Z0(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),a=[s!=null&&s[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let o=1;o<t.length;o+=2)a.push([t[o],t[o+1]]);return a}function ex(e,t,n){const{offset:s,type:r,source:a,end:o}=e;let l,c;const u=(f,x,v)=>n(s+f,x,v);switch(r){case"scalar":l=B.PLAIN,c=tx(a,u);break;case"single-quoted-scalar":l=B.QUOTE_SINGLE,c=nx(a,u);break;case"double-quoted-scalar":l=B.QUOTE_DOUBLE,c=sx(a,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+a.length,s+a.length]}}const p=s+a.length,d=Tr(o,p,t,n);return{value:c,type:l,comment:d.comment,range:[s,p,d.offset]}}function tx(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),om(e)}function nx(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),om(e.slice(1,-1)).replace(/''/g,"'")}function om(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
151
|
+
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
152
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let s=t.exec(e);if(!s)return e;let r=s[1],a=" ",o=t.lastIndex;for(n.lastIndex=o;s=n.exec(e);)s[1]===""?a===`
|
|
153
|
+
`?r+=a:a=`
|
|
154
|
+
`:(r+=a+s[1],a=" "),o=n.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=o,s=l.exec(e),r+a+((s==null?void 0:s[1])??"")}function sx(e,t){let n="";for(let s=1;s<e.length-1;++s){const r=e[s];if(!(r==="\r"&&e[s+1]===`
|
|
155
|
+
`))if(r===`
|
|
156
|
+
`){const{fold:a,offset:o}=rx(e,s);n+=a,s=o}else if(r==="\\"){let a=e[++s];const o=ix[a];if(o)n+=o;else if(a===`
|
|
157
|
+
`)for(a=e[s+1];a===" "||a===" ";)a=e[++s+1];else if(a==="\r"&&e[s+1]===`
|
|
158
|
+
`)for(a=e[++s+1];a===" "||a===" ";)a=e[++s+1];else if(a==="x"||a==="u"||a==="U"){const l=a==="x"?2:a==="u"?4:8;n+=ax(e,s+1,l,t),s+=l}else{const l=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}else if(r===" "||r===" "){const a=s;let o=e[s+1];for(;o===" "||o===" ";)o=e[++s+1];o!==`
|
|
159
|
+
`&&!(o==="\r"&&e[s+2]===`
|
|
160
|
+
`)&&(n+=s>a?e.slice(a,s+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function rx(e,t){let n="",s=e[t+1];for(;(s===" "||s===" "||s===`
|
|
161
|
+
`||s==="\r")&&!(s==="\r"&&e[t+2]!==`
|
|
162
|
+
`);)s===`
|
|
163
|
+
`&&(n+=`
|
|
164
|
+
`),t+=1,s=e[t+1];return n||(n=" "),{fold:n,offset:t}}const ix={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
165
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ax(e,t,n,s){const r=e.substr(t,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{const l=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function lm(e,t,n,s){const{value:r,type:a,comment:o,range:l}=t.type==="block-scalar"?J0(e,t,s):ex(t,e.options.strict,s),c=n?e.directives.tagName(n.source,d=>s(n,"TAG_RESOLVE_FAILED",d)):null;let u;e.options.stringKeys&&e.atKey?u=e.schema[gt]:c?u=ox(e.schema,r,c,n,s):t.type==="scalar"?u=lx(e,r,t,s):u=e.schema[gt];let p;try{const d=u.resolve(r,f=>s(n??t,"TAG_RESOLVE_FAILED",f),e.options);p=Y(d)?d:new B(d)}catch(d){const f=d instanceof Error?d.message:String(d);s(n??t,"TAG_RESOLVE_FAILED",f),p=new B(r)}return p.range=l,p.source=r,a&&(p.type=a),c&&(p.tag=c),u.format&&(p.format=u.format),o&&(p.comment=o),p}function ox(e,t,n,s,r){var l;if(n==="!")return e[gt];const a=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)a.push(c);else return c;for(const c of a)if((l=c.test)!=null&&l.test(t))return c;const o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[gt])}function lx({atKey:e,directives:t,schema:n},s,r,a){const o=n.tags.find(l=>{var c;return(l.default===!0||e&&l.default==="key")&&((c=l.test)==null?void 0:c.test(s))})||n[gt];if(n.compat){const l=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(s))})??n[gt];if(o.tag!==l.tag){const c=t.tagString(o.tag),u=t.tagString(l.tag),p=`Value may be parsed as either ${c} or ${u}`;a(r,"TAG_RESOLVE_FAILED",p,!0)}}return o}function cx(e,t,n){if(t){n??(n=t.length);for(let s=n-1;s>=0;--s){let r=t[s];switch(r.type){case"space":case"comment":case"newline":e-=r.source.length;continue}for(r=t[++s];(r==null?void 0:r.type)==="space";)e+=r.source.length,r=t[++s];break}}return e}const ux={composeNode:cm,composeEmptyNode:yc};function cm(e,t,n,s){const r=e.atKey,{spaceBefore:a,comment:o,anchor:l,tag:c}=n;let u,p=!0;switch(t.type){case"alias":u=dx(e,t,s),(l||c)&&s(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":u=lm(e,t,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Q0(ux,e,t,n,s),l&&(u.anchor=l.source.substring(1))}catch(d){const f=d instanceof Error?d.message:String(d);s(t,"RESOURCE_EXHAUSTION",f)}break;default:{const d=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;s(t,"UNEXPECTED_TOKEN",d),p=!1}}return u??(u=yc(e,t.offset,void 0,null,n,s)),l&&u.anchor===""&&s(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&e.options.stringKeys&&(!Y(u)||typeof u.value!="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str")&&s(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(u.spaceBefore=!0),o&&(t.type==="scalar"&&t.source===""?u.comment=o:u.commentBefore=o),e.options.keepSourceTokens&&p&&(u.srcToken=t),u}function yc(e,t,n,s,{spaceBefore:r,comment:a,anchor:o,tag:l,end:c},u){const p={type:"scalar",offset:cx(t,n,s),indent:-1,source:""},d=lm(e,p,l,u);return o&&(d.anchor=o.source.substring(1),d.anchor===""&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),a&&(d.comment=a,d.range[2]=c),d}function dx({options:e},{offset:t,source:n,end:s},r){const a=new ic(n.substring(1));a.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=t+n.length,l=Tr(s,o,e.strict,r);return a.range=[t,o,l.offset],l.comment&&(a.comment=l.comment),a}function fx(e,t,{offset:n,start:s,value:r,end:a},o){const l=Object.assign({_directives:t},e),c=new Er(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=ls(s,{indicator:"doc-start",next:r??(a==null?void 0:a[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&o(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?cm(u,r,p,o):yc(u,p.end,s,null,p,o);const d=c.contents.range[2],f=Tr(a,d,!1,o);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}function Ls(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function Uu(e){var r;let t="",n=!1,s=!1;for(let a=0;a<e.length;++a){const o=e[a];switch(o[0]){case"#":t+=(t===""?"":s?`
|
|
166
|
+
|
|
167
|
+
`:`
|
|
168
|
+
`)+(o.substring(1)||" "),n=!0,s=!1;break;case"%":((r=e[a+1])==null?void 0:r[0])!=="#"&&(a+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}class px{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,a)=>{const o=Ls(n);a?this.warnings.push(new K0(o,s,r)):this.errors.push(new Ms(o,s,r))},this.directives=new Se({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:r}=Uu(this.prelude);if(s){const a=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
169
|
+
${s}`:s;else if(r||t.directives.docStart||!a)t.commentBefore=s;else if(le(a)&&!a.flow&&a.items.length>0){let o=a.items[0];ue(o)&&(o=o.key);const l=o.commentBefore;o.commentBefore=l?`${s}
|
|
170
|
+
${l}`:s}else{const o=a.commentBefore;a.commentBefore=o?`${s}
|
|
171
|
+
${o}`:s}}if(n){for(let a=0;a<this.errors.length;++a)t.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)t.warnings.push(this.warnings[a])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Uu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,s=-1){for(const r of t)yield*this.next(r);yield*this.end(n,s)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,s,r)=>{const a=Ls(t);a[0]+=n,this.onError(a,"BAD_DIRECTIVE",s,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=fx(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,s=new Ms(Ls(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(s):this.doc.errors.push(s);break}case"doc-end":{if(!this.doc){const s="Unexpected doc-end without preceding document";this.errors.push(new Ms(Ls(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Tr(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const s=this.doc.comment;this.doc.comment=s?`${s}
|
|
172
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ms(Ls(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const s=Object.assign({_directives:this.directives},this.options),r=new Er(void 0,s);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}}const um="\uFEFF",dm="",fm="",il="";function mx(e){switch(e){case um:return"byte-order-mark";case dm:return"doc-mode";case fm:return"flow-error-end";case il:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
173
|
+
`:case`\r
|
|
174
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function tt(e){switch(e){case void 0:case" ":case`
|
|
175
|
+
`:case"\r":case" ":return!0;default:return!1}}const Wu=new Set("0123456789ABCDEFabcdef"),hx=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Qr=new Set(",[]{}"),gx=new Set(` ,[]{}
|
|
176
|
+
\r `),Xa=e=>!e||gx.has(e);class yx{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let s=this.next??"stream";for(;s&&(n||this.hasChars(1));)s=yield*this.parseNext(s)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
177
|
+
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
178
|
+
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let s=0;for(;n===" ";)n=this.buffer[++s+t];if(n==="\r"){const r=this.buffer[s+t+1];if(r===`
|
|
179
|
+
`||!r&&!this.atEnd)return t+s+1}return n===`
|
|
180
|
+
`||s>=this.indentNext||!n&&!this.atEnd?t+s:-1}if(n==="-"||n==="."){const s=this.buffer.substr(t,3);if((s==="---"||s==="...")&&tt(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
181
|
+
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===um&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){const a=t[s-1];if(a===" "||a===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){const a=t[n-1];if(a===" "||a===" ")n-=1;else break}const r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield dm,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&tt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!tt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&tt(n)){const s=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=s,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Xa),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,s=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=s=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((s!==-1&&s<this.indentNext&&r[0]!=="#"||s===0&&(r.startsWith("---")||r.startsWith("..."))&&tt(r[3]))&&!(s===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield fm,yield*this.parseLineStart();let a=0;for(;r[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),r[a]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Xa),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||tt(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let a=0;for(;this.buffer[n-1-a]==="\\";)a+=1;if(a%2===0)break;n=this.buffer.indexOf('"',n+1)}const s=this.buffer.substring(0,n);let r=s.indexOf(`
|
|
182
|
+
`,this.pos);if(r!==-1){for(;r!==-1;){const a=this.continueScalar(r+1);if(a===-1)break;r=s.indexOf(`
|
|
183
|
+
`,a)}r!==-1&&(n=r-(s[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>tt(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,s;e:for(let a=this.pos;s=this.buffer[a];++a)switch(s){case" ":n+=1;break;case`
|
|
184
|
+
`:t=a,n=0;break;case"\r":{const o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
185
|
+
`)break}default:break e}if(!s&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const a=this.continueScalar(t+1);if(a===-1)break;t=this.buffer.indexOf(`
|
|
186
|
+
`,a)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(s=this.buffer[r];s===" ";)s=this.buffer[++r];if(s===" "){for(;s===" "||s===" "||s==="\r"||s===`
|
|
187
|
+
`;)s=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)do{let a=t-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);const l=a;for(;o===" ";)o=this.buffer[--a];if(o===`
|
|
188
|
+
`&&a>=this.pos&&a+1+n>l)t=a;else break}while(!0);return yield il,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,s=this.pos-1,r;for(;r=this.buffer[++s];)if(r===":"){const a=this.buffer[s+1];if(tt(a)||t&&Qr.has(a))break;n=s}else if(tt(r)){let a=this.buffer[s+1];if(r==="\r"&&(a===`
|
|
189
|
+
`?(s+=1,r=`
|
|
190
|
+
`,a=this.buffer[s+1]):n=s),a==="#"||t&&Qr.has(a))break;if(r===`
|
|
191
|
+
`){const o=this.continueScalar(s+1);if(o===-1)break;s=Math.max(s,o-2)}}else{if(t&&Qr.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield il,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const s=this.buffer.slice(this.pos,t);return s?(yield s,this.pos+=s.length,s.length):(n&&(yield""),0)}*pushIndicators(){let t=0;e:for(;;){switch(this.charAt(0)){case"!":t+=yield*this.pushTag(),t+=yield*this.pushSpaces(!0);continue e;case"&":t+=yield*this.pushUntil(Xa),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(tt(s)||n&&Qr.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!tt(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(hx.has(n))n=this.buffer[++t];else if(n==="%"&&Wu.has(this.buffer[t+1])&&Wu.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
192
|
+
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
193
|
+
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,s;do s=this.buffer[++n];while(s===" "||t&&s===" ");const r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(t){let n=this.pos,s=this.buffer[n];for(;!t(s);)s=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class xx{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){const a=n+s>>1;this.lineStarts[a]<t?n=a+1:s=a}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const r=this.lineStarts[n-1];return{line:n,col:t-r+1}}}}function Mt(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Hu(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function pm(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Jr(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function En(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Vi(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Vu(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Mt(t.start,"explicit-key-ind")&&!Mt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,pm(t.value)?t.value.end?Vi(t.value.end,t.sep):t.value.end=t.sep:Vi(t.start,t.sep),delete t.sep)}class vx{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new yx,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const s of this.lexer.lex(t,n))yield*this.next(s);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=mx(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const s=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:s,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const s=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in s?s.indent:0:n.type==="flow-collection"&&s.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Vu(n),s.type){case"document":s.value=n;break;case"block-scalar":s.props.push(n);break;case"block-map":{const r=s.items[s.items.length-1];if(r.value){s.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=s.items[s.items.length-1];r.value?s.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{const r=s.items[s.items.length-1];!r||r.value?s.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((s.type==="document"||s.type==="block-map"||s.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Hu(r.start)===-1&&(n.indent===0||r.start.every(a=>a.type!=="comment"||a.indent<n.indent))&&(s.type==="document"?s.end=r.start:s.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{Hu(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=Jr(this.peek(2)),s=En(n);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:s,key:t,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
194
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
195
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const r="end"in n.value?n.value.end:void 0,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],a=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(a)){Vi(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const r=!this.onKeyLine&&this.indent===t.indent,a=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let o=[];if(a&&n.sep&&!n.value){const l=[];for(let c=0;c<n.sep.length;++c){const u=n.sep[c];switch(u.type){case"newline":l.push(c);break;case"space":break;case"comment":u.indent>t.indent&&(l.length=0);break;default:l.length=0}}l.length>=2&&(o=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":a||n.value?(o.push(this.sourceToken),t.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):a||n.value?(o.push(this.sourceToken),t.items.push({start:o,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Mt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(pm(n.key)&&!Mt(n.sep,"newline")){const l=En(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:c,sep:u}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Mt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=En(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||a?t.items.push({start:o,key:null,sep:[this.sourceToken]}):Mt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const l=this.flowScalar(this.type);a||n.value?(t.items.push({start:o,key:l,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(l):(Object.assign(n,{key:l,sep:[]}),this.onKeyLine=!0);return}default:{const l=this.startBlockValue(t);if(l){if(l.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Mt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:o});this.stack.push(l);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var s;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const r="end"in n.value?n.value.end:void 0,a=Array.isArray(r)?r[r.length-1]:void 0;(a==null?void 0:a.type)==="comment"?r==null||r.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const r=t.items[t.items.length-2],a=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(a)){Vi(a,n.start),a.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||Mt(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const r=Jr(s),a=En(r);Vu(t);const o=t.end.splice(1,t.end.length);o.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:a,key:t,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
196
|
+
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
197
|
+
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Jr(t),s=En(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Jr(t),s=En(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function bx(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new xx||null,prettyErrors:t}}function jx(e,t={}){const{lineCounter:n,prettyErrors:s}=bx(t),r=new vx(n==null?void 0:n.addNewLine),a=new px(t);let o=null;for(const l of a.compose(r.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Ms(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(o.errors.forEach(Fu(e,n)),o.warnings.forEach(Fu(e,n))),o}function wx(e,t,n){let s;const r=jx(e,n);if(!r)return null;if(r.warnings.forEach(a=>zp(r.options.logLevel,a)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function kx(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:r}={};if(!r)return}return kr(e)&&!s?e.toString(n):new Er(e,s,n).toString(n)}const Nx=new Set(["daemon.host","daemon.port","app.port"]),Sx=["js_evaluate","cookie_write"];function Ku(e){const t=e.daemon??{},n=e.security??{},s=e.connectors??{},r=e.audit??{},a=e.output??{},o=e.app??{};return{daemon:{host:String(t.host??"127.0.0.1"),port:Number(t.port??9091)},security:{extensionId:String(n.extensionId??""),highRiskCapabilities:n.highRiskCapabilities??[...Sx],approvedHighRisk:n.approvedHighRisk??[],approvalRequired:n.approvalRequired??[],autoApproveConnectors:n.autoApproveConnectors??[],approvalTimeoutMs:Number(n.approvalTimeoutMs??12e4)},connectors:{paths:s.paths??["./connectors","~/.commandgarden/connectors"]},audit:{retentionDays:Number(r.retentionDays??90),dbPath:String(r.dbPath??"~/.commandgarden/audit.db")},output:{defaultFormat:String(a.defaultFormat??"table")},app:{port:Number(o.port??9092)}}}function Cx(e){return{daemon:{...e.daemon},security:{...e.security},connectors:{...e.connectors},audit:{...e.audit},output:{...e.output},app:{...e.app}}}function Ex(){const[e,t]=b.useState(null),[n,s]=b.useState(null),[r,a]=b.useState([]),[o,l]=b.useState(!0),[c,u]=b.useState(!1),[p,d]=b.useState(null),[f,x]=b.useState(!1),[v,y]=b.useState(""),[j,g]=b.useState(!1),[h,m]=b.useState("");b.useEffect(()=>{Promise.all([z.getConfig(),z.getConnectors()]).then(([E,D])=>{const O=Ku(E.config);t(O),s(structuredClone(O)),a(D.connectors)}).catch(()=>{t(null),s(null)}).finally(()=>l(!1))},[]);const w=b.useMemo(()=>!e||!n?!1:JSON.stringify(e)!==JSON.stringify(n),[e,n]),k=b.useMemo(()=>{if(!e||!n)return 0;let E=0;for(const D of Object.keys(n)){const O=e[D],R=n[D];for(const L of Object.keys(R))JSON.stringify(O[L])!==JSON.stringify(R[L])&&E++}return E},[e,n]),C=b.useCallback(async()=>{if(!e||!n)return;if(!n.daemon.host.trim()){d({type:"error",msg:"Daemon host cannot be empty."});return}u(!0),d(null);let E=!1;try{for(const D of Object.keys(n)){const O=e[D],R=n[D];for(const L of Object.keys(R)){const P=JSON.stringify(R[L]),M=JSON.stringify(O[L]??null);if(P!==M){const $=`${D}.${L}`,Q=R[L];let Me;$==="security.approvalTimeoutMs"?Me=String(Q):Array.isArray(Q)?Me=JSON.stringify(Q):Me=String(Q),await z.setConfig($,Me),Nx.has($)&&(E=!0)}}}t(structuredClone(n)),d({type:"success",msg:"Configuration saved."}),E&&x(!0)}catch(D){d({type:"error",msg:D instanceof Error?D.message:"Save failed"})}finally{u(!1),setTimeout(()=>d(null),3e3)}},[e,n]),S=b.useCallback(()=>{e&&s(structuredClone(e))},[e]),N=b.useCallback(()=>{!j&&n&&(y(kx(Cx(n))),m("")),g(!j)},[j,n]),T=b.useCallback(()=>{try{const E=wx(v);if(!E||typeof E!="object")throw new Error("Invalid YAML");s(Ku(E)),m("")}catch(E){m(E instanceof Error?E.message:"Invalid YAML")}},[v]),A=b.useCallback((E,D,O)=>{s(R=>R&&{...R,[E]:{...R[E],[D]:O}})},[]),F=b.useCallback((E,D,O)=>{s(R=>{if(!R)return R;const L=R[E],P=L[D]??[];return P.includes(O)?R:{...R,[E]:{...L,[D]:[...P,O]}}})},[]),G=b.useCallback((E,D,O)=>{s(R=>{if(!R)return R;const L=R[E],P=L[D]??[];return{...R,[E]:{...L,[D]:P.filter(M=>M!==O)}}})},[]),V=b.useMemo(()=>({updateField:A,addToArray:F,removeFromArray:G}),[A,F,G]);return o?i.jsx(ct,{label:"Loading configuration..."}):!n||!e?i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-2",children:"No configuration found."}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Make sure the daemon is running. Configuration will appear here automatically."})]})]}):i.jsxs("div",{className:"max-w-3xl mx-auto pb-20",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),f&&i.jsxs("div",{className:"alert alert-warning mb-6",children:[i.jsxs("span",{children:["Some changes require a daemon restart to take effect. Restart with: ",i.jsx("code",{className:"font-mono text-sm",children:"cg down && cg up"})]}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>x(!1),children:"Dismiss"})]}),i.jsxs("div",{className:"space-y-8",children:[i.jsx("div",{id:"cfg-server",className:"scroll-mt-4",children:i.jsx(Tx,{config:n,actions:V})}),i.jsx("div",{id:"cfg-security",className:"scroll-mt-4",children:i.jsx(Lx,{config:n,connectors:r,actions:V})}),i.jsx("div",{id:"cfg-sources",className:"scroll-mt-4",children:i.jsx(Ax,{config:n,actions:V})}),i.jsx("div",{id:"cfg-audit",className:"scroll-mt-4",children:i.jsx(Ix,{config:n,actions:V})}),i.jsx("div",{id:"cfg-output",className:"scroll-mt-4",children:i.jsx(Ox,{config:n,actions:V})}),i.jsx("div",{id:"cfg-journal",className:"scroll-mt-4",children:i.jsx(Px,{})})]}),i.jsxs("div",{className:"mt-8",children:[i.jsxs("button",{className:"btn btn-sm btn-ghost gap-1",onClick:N,children:[j?"▾":"▸"," Raw Configuration (YAML)"]}),j&&i.jsxs("div",{className:"mt-2 border border-base-300 p-4",children:[i.jsx("textarea",{className:"textarea textarea-bordered w-full font-mono text-sm",rows:16,value:v,onChange:E=>y(E.target.value)}),h&&i.jsx("p",{className:"text-error text-sm mt-1",children:h}),i.jsx("button",{className:"btn btn-sm btn-ghost mt-2",onClick:T,children:"Apply to form"})]})]}),w&&i.jsxs("div",{className:"fixed bottom-0 left-0 md:left-56 right-0 bg-base-100 border-t border-base-300 px-6 py-3 flex items-center justify-between z-50",children:[i.jsxs("span",{className:"text-sm opacity-60",children:[k," unsaved ",k===1?"change":"changes"]}),i.jsxs("div",{className:"flex items-center gap-3",children:[p&&i.jsx("span",{className:`text-sm ${p.type==="success"?"text-success":"text-error"}`,children:p.msg}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:S,children:"Discard"}),i.jsx("button",{className:"btn btn-sm btn-primary",onClick:C,disabled:c,children:c?"Saving...":"Save changes"})]})]})]})}function vs({title:e,description:t,children:n}){return i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:e}),i.jsx("p",{className:"text-xs opacity-40 mb-5",children:t}),i.jsx("div",{className:"space-y-5",children:n})]})}function Oe({label:e,help:t,restart:n,children:s}){return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"w-48 shrink-0",children:[i.jsx("label",{className:"font-mono text-[0.7rem] font-medium uppercase tracking-wide",children:e}),n&&i.jsx("span",{className:"ml-1.5 tooltip tooltip-right","data-tip":"Requires daemon restart",children:i.jsx("span",{className:"text-xs opacity-40",children:"⟳"})})]}),i.jsx("div",{className:"flex-1",children:s})]}),i.jsx("p",{className:"text-xs opacity-40 mt-1 max-w-[12rem]",children:t})]})}function Tx({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(vs,{title:"Server",description:"Daemon and app server binding configuration",children:[i.jsx(Oe,{label:"Daemon Host",help:"IP address the daemon binds to",restart:!0,children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",required:!0,value:e.daemon.host,onChange:s=>n("daemon","host",s.target.value)})}),i.jsx(Oe,{label:"Daemon Port",help:"Port the daemon listens on",restart:!0,children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1024,max:65535,value:e.daemon.port,onChange:s=>n("daemon","port",Number(s.target.value))})}),i.jsx(Oe,{label:"GUI Port",help:"Port the GUI app server listens on",restart:!0,children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1024,max:65535,value:e.app.port,onChange:s=>n("app","port",Number(s.target.value))})})]})}function Gu({values:e,onAdd:t,onRemove:n,placeholder:s}){const[r,a]=b.useState("");return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:e.map(o=>i.jsxs(U,{size:"sm",className:"gap-1",children:[o,i.jsx("button",{className:"text-xs opacity-50 hover:opacity-100",onClick:()=>n(o),children:"×"})]},o))}),i.jsxs("div",{className:"flex gap-1",children:[i.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1",placeholder:s,value:r,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(t(r.trim()),a(""))}}),i.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(t(r.trim()),a(""))},children:"Add"})]})]})}function Lx({config:e,connectors:t,actions:n}){const{updateField:s,addToArray:r,removeFromArray:a}=n,o=new Set(e.security.highRiskCapabilities),l=b.useMemo(()=>da(t),[t]);return i.jsxs(vs,{title:"Connector Security",description:"Manage which connectors are approved and which capabilities require approval",children:[t.length>0&&i.jsx("div",{className:"overflow-x-auto mb-4",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Connector"}),i.jsx("th",{children:"Capabilities"}),i.jsx("th",{children:"Risk"}),i.jsx("th",{children:"Approved"}),i.jsx("th",{children:"Auto-Approve"})]})}),i.jsx("tbody",{children:l.map(([c,u])=>i.jsxs(b.Fragment,{children:[i.jsx("tr",{children:i.jsxs("td",{colSpan:5,className:"bg-base-200/50 font-mono font-semibold text-xs pt-3 pb-1",children:[c,i.jsxs("span",{className:"font-normal opacity-40 ml-2",children:[u.length," ",u.length===1?"connector":"connectors"]})]})}),u.map(p=>{const d=p.key.split("/")[1],f=p.capabilities.some(y=>o.has(y)),x=e.security.approvedHighRisk.includes(p.key),v=e.security.autoApproveConnectors.includes(p.key);return i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-sm pl-6",children:d}),i.jsx("td",{children:i.jsx("div",{className:"flex flex-wrap gap-1",children:p.capabilities.map(y=>i.jsx(U,{variant:o.has(y)?"warning":"neutral",size:"xs",children:y},y))})}),i.jsx("td",{children:f?i.jsx(U,{variant:"warning",size:"xs",children:"High"}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:f?i.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-success",checked:x,onChange:()=>x?a("security","approvedHighRisk",p.key):r("security","approvedHighRisk",p.key)}):i.jsx("span",{className:"opacity-40",children:"—"})}),i.jsx("td",{children:i.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:v,title:"Skip approval prompts — pipeline steps execute without confirmation",onChange:()=>v?a("security","autoApproveConnectors",p.key):r("security","autoApproveConnectors",p.key)})})]},p.key)})]},c))})]})}),i.jsx(Oe,{label:"High-Risk Capabilities",help:"Capabilities that require connector-level approval before first use",children:i.jsx(Gu,{values:e.security.highRiskCapabilities,onAdd:c=>r("security","highRiskCapabilities",c),onRemove:c=>a("security","highRiskCapabilities",c),placeholder:"Capability name"})}),i.jsx(Oe,{label:"Step Approval Required",help:"Capabilities that pause for user confirmation at each pipeline step",children:i.jsx(Gu,{values:e.security.approvalRequired,onAdd:c=>r("security","approvalRequired",c),onRemove:c=>a("security","approvalRequired",c),placeholder:"Capability name"})}),i.jsx(Oe,{label:"Approval Timeout (seconds)",help:"How long to wait for approval before aborting the pipeline",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1,max:600,value:Math.round(e.security.approvalTimeoutMs/1e3),onChange:c=>s("security","approvalTimeoutMs",Number(c.target.value)*1e3)})}),i.jsx(Oe,{label:"Extension ID",help:"Chrome extension ID for origin validation. Leave blank to accept any extension.",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"Leave blank for any",value:e.security.extensionId,onChange:c=>s("security","extensionId",c.target.value)})})]})}function Ax({config:e,actions:t}){const{addToArray:n,removeFromArray:s}=t,[r,a]=b.useState("");return i.jsxs(vs,{title:"Connector Sources",description:"Directories to scan for connector YAML files",children:[i.jsx("div",{className:"space-y-1",children:e.connectors.paths.map((o,l)=>i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-mono text-sm flex-1",children:o}),i.jsx("button",{className:"btn btn-xs btn-ghost opacity-50 hover:opacity-100",onClick:()=>s("connectors","paths",o),children:"×"})]},l))}),i.jsxs("div",{className:"flex gap-1 mt-2",children:[i.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1 font-mono",placeholder:"~/path/to/connectors",value:r,onChange:o=>a(o.target.value),onKeyDown:o=>{o.key==="Enter"&&r.trim()&&(n("connectors","paths",r.trim()),a(""))}}),i.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(n("connectors","paths",r.trim()),a(""))},children:"Add path"})]}),i.jsxs("p",{className:"text-xs opacity-40 mt-1",children:["Use ",i.jsx("code",{children:"~/"})," for home directory paths. Relative paths resolve from the install directory."]})]})}function Ix({config:e,actions:t}){const{updateField:n}=t;return i.jsxs(vs,{title:"Audit & Retention",description:"Audit log storage and cleanup settings",children:[i.jsx(Oe,{label:"Retention Period",help:"Days to keep audit log entries before cleanup",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-full",min:1,max:3650,value:e.audit.retentionDays,onChange:s=>n("audit","retentionDays",Number(s.target.value))})}),i.jsx(Oe,{label:"Database Path",help:"Path to the audit SQLite database. Change only if you need a custom location.",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono opacity-60",value:e.audit.dbPath,onChange:s=>n("audit","dbPath",s.target.value)})})]})}function Ox({config:e,actions:t}){const{updateField:n}=t;return i.jsx(vs,{title:"Output Defaults",description:"Default formatting for CLI output",children:i.jsx(Oe,{label:"Default Output Format",help:"Format used when no --format flag is specified",children:i.jsxs("select",{className:"select select-bordered select-sm w-full",value:e.output.defaultFormat,onChange:s=>n("output","defaultFormat",s.target.value),children:[i.jsx("option",{value:"table",children:"table"}),i.jsx("option",{value:"json",children:"json"}),i.jsx("option",{value:"csv",children:"csv"})]})})})}function Px(){const[e,t]=b.useState(""),[n,s]=b.useState(""),[r,a]=b.useState(""),[o,l]=b.useState("40"),[c,u]=b.useState(!1),[p,d]=b.useState(!1);b.useEffect(()=>{z.getPreferences().then(x=>{if(!x.ok)return;const v=x.preferences;t(v["journal.author"]??""),s(v["journal.ado_org"]??""),a(v["journal.ado_repos"]??""),l(v["journal.target_hours"]??"40"),u(!0)}).catch(()=>u(!0))},[]);async function f(){await Promise.all([z.setPreference("journal.author",e),z.setPreference("journal.ado_org",n),z.setPreference("journal.ado_repos",r),z.setPreference("journal.target_hours",o)]),d(!0),setTimeout(()=>d(!1),2e3)}return c?i.jsxs(vs,{title:"Journal Settings",description:"Configure your Dev Work Journal data sources",children:[i.jsx(Oe,{label:"Author",help:"Your name or email as it appears in ADO commits (e.g. mun_hong.lee@mercedes-benz.com)",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"your.name@company.com",value:e,onChange:x=>t(x.target.value)})}),i.jsx(Oe,{label:"ADO Organization",help:"Azure DevOps organization name (e.g. daimler-mic)",children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"daimler-mic",value:n,onChange:x=>s(x.target.value)})}),i.jsx(Oe,{label:"ADO Repos",help:'Comma-separated project/repo pairs (e.g. "mic-dns/mic-dns-api,mic-dns/mic-dns-ui")',children:i.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono",placeholder:"project/repo,project/repo",value:r,onChange:x=>a(x.target.value)})}),i.jsx(Oe,{label:"Weekly Target Hours",help:"Target hours per week for the hours progress bar (default 40)",children:i.jsx("input",{type:"number",className:"input input-bordered input-sm w-20",min:1,max:80,value:o,onChange:x=>l(x.target.value)})}),i.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[i.jsx("button",{className:"btn btn-primary btn-sm",onClick:f,children:"Save Journal Settings"}),p&&i.jsx("span",{className:"text-success text-sm",children:"Saved ✓"})]})]}):null}const _x=i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",className:"w-3.5 h-3.5",children:i.jsx("path",{d:"M20 6 9 17l-5-5"})});function Dx(){const[e,t]=b.useState(!1),[n,s]=b.useState(!1),[r,a]=b.useState(0),[o,l]=b.useState([]),[c,u]=b.useState([]),[p,d]=b.useState(null),f=b.useCallback(async()=>{try{const k=await z.getStatus();t(k.ok),s(k.extensionConnected),a(k.connectorCount)}catch{t(!1),s(!1),a(0)}try{const k=await z.getConnectors();l(k.connectors);const S=(await z.getConfig().catch(()=>({ok:!1,config:{}}))).config.security??{};u(S.approvedHighRisk??[])}catch{}},[]);b.useEffect(()=>{f();const k=setInterval(f,1e4);return()=>clearInterval(k)},[f]);const x=b.useCallback(async k=>{d(k);try{const C=[...c,k];await z.setConfig("security.approvedHighRisk",JSON.stringify(C)),f()}catch{}finally{d(null)}},[c,f]),v=o.filter(k=>k.isHighRisk&&!k.isApproved),y=v.length>0,j=[{id:"daemon",label:"Background service",ok:e,detail:e?"Running":"Not running",instructions:"Run cg up in your terminal to start commandGarden. This launches the background service and opens the web interface."},{id:"extension",label:"Browser extension",ok:n,detail:n?"Connected":"Not connected",instructions:"Install the commandGarden Chrome extension, then open Chrome. The extension connects automatically when the background service is running."},{id:"connectors",label:"Connectors installed",ok:r>0,detail:r>0?`${r} available`:"None found",instructions:"Connectors are loaded automatically when you start the service. If none appear, check that connector files exist in ~/.commandgarden/connectors/ and restart with cg up."}];y&&j.push({id:"permissions",label:"Connector permissions",ok:!1,detail:`${v.length} need${v.length===1?"s":""} authorization`,instructions:"Some connectors need authorization before first use. You can authorize them here or in Configuration → Connector Security."});const g=j.filter(k=>k.ok).length,h=j.length,m=g===h,w=b.useMemo(()=>da(o),[o]);return i.jsxs("div",{className:"max-w-3xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Setup Guide"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Complete these steps to start running connectors from your browser."}),i.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[i.jsx("div",{className:"flex-1 h-1.5 bg-base-300 overflow-hidden",children:i.jsx("div",{className:"h-full bg-success transition-all duration-300 ease-out",style:{width:`${h>0?g/h*100:0}%`}})}),i.jsxs("span",{className:"font-mono text-xs opacity-50 shrink-0",children:[g,"/",h]})]}),i.jsx("div",{className:"space-y-3 mb-8",children:j.map((k,C)=>i.jsxs("div",{className:`border ${k.ok?"border-base-300":"border-base-300 bg-base-200/50"}`,children:[i.jsxs("div",{className:"p-4 flex items-center gap-3",children:[i.jsx("span",{className:`w-5 h-5 flex items-center justify-center font-mono text-xs font-bold shrink-0 ${k.ok?"bg-success text-success-content":"border border-base-300 text-base-content/50"}`,children:k.ok?_x:C+1}),i.jsx("span",{className:"font-semibold flex-1",children:k.label}),i.jsx(U,{variant:k.ok?"success":"warning",children:k.detail})]}),!k.ok&&i.jsxs("div",{className:"px-4 pb-4 text-sm opacity-70 border-t border-base-300/50 pt-3 ml-8",children:[k.instructions,k.id==="permissions"&&v.length>0&&i.jsx("div",{className:"mt-3 space-y-2",children:v.map(S=>i.jsxs("div",{className:"flex items-center justify-between gap-3 py-1.5",children:[i.jsxs("div",{children:[i.jsx("span",{className:"font-mono text-sm",children:S.key}),S.description&&i.jsx("span",{className:"text-xs opacity-50 ml-2",children:S.description})]}),i.jsx("button",{className:"btn btn-sm btn-warning btn-outline shrink-0",disabled:p===S.key,onClick:()=>x(S.key),children:p===S.key?"Authorizing…":"Authorize"})]},S.key))})]})]},C))}),m&&o.length>0&&i.jsxs("div",{className:"border border-success/30 bg-success/5 p-5",children:[i.jsx("p",{className:"font-semibold text-success mb-3",children:"Everything's ready. Pick a connector to try."}),i.jsx("div",{className:"space-y-3",children:w.map(([k,C])=>i.jsxs("div",{children:[i.jsx("span",{className:"font-mono font-semibold text-sm",children:k}),i.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:C.map(S=>{const N=S.key.split("/")[1];return i.jsx($e,{to:`/connectors/${k}/${N}`,className:"btn btn-sm btn-outline",children:i.jsx("span",{className:"font-mono",children:N})},S.key)})})]},k))})]}),!m&&o.length>0&&i.jsxs("div",{className:"border-t border-base-300 pt-6",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-4",children:"Installed connectors"}),i.jsx("div",{className:"space-y-4",children:w.map(([k,C])=>i.jsxs("div",{children:[i.jsx("div",{className:"font-mono font-semibold text-sm mb-1.5",children:k}),i.jsx("div",{className:"space-y-1",children:C.map(S=>{const N=S.key.split("/")[1];return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-baseline gap-2",children:[i.jsx("span",{className:"font-mono text-sm",children:N}),i.jsx(U,{size:"xs",children:S.access})]}),S.description&&i.jsx("div",{className:"text-xs opacity-40 mb-1",children:S.description})]},S.key)})})]},k))}),i.jsx($e,{to:"/connectors",className:"inline-flex items-center gap-1 font-mono text-xs mt-5 opacity-50 hover:opacity-80 transition-opacity",children:"View all connectors →"})]})]})}function jn({message:e}){return i.jsx("div",{role:"alert",className:"alert alert-warning",children:i.jsx("span",{children:e??"Sign in to the target app in Chrome, then try again."})})}function mm(e){const t=e.getDay();return t!==0&&t!==6}function Mx(e){const[t,n]=e.split("-").map(Number),s=new Date(t,n,0).getDate();let r=0;for(let a=1;a<=s;a++)mm(new Date(t,n-1,a))&&r++;return r}function Rx(e,t){const[n,s]=e.split("-").map(Number),r=new Date(t+"T00:00:00"),a=new Date(n,s,0),o=r>a?a:r;let l=0;for(let c=1;c<=o.getDate();c++){const u=new Date(n,s-1,c);if(u>o)break;mm(u)&&l++}return l}function $x(e){const{targetHours:t,actualHours:n,month:s,today:r}=e,a=Mx(s),o=Rx(s,r),l=a-o,c=t>0?n/t*100:0,u=Math.max(0,(t-n)/8);if(n>=t)return{status:"reached",percentage:c,daysRemaining:0,hoursPerDayNeeded:0,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:l};const p=a>0?t/a*o:0,d=l>0?Math.max(0,(t-n)/l):0;let f;return n>=p?f="on_track":a>0&&o/a<.8?f="behind":f="at_risk",{status:f,percentage:c,daysRemaining:u,hoursPerDayNeeded:d,workingDaysTotal:a,workingDaysElapsed:o,workingDaysRemaining:l}}const zx={reached:"bg-success",on_track:"bg-success",behind:"bg-warning",at_risk:"bg-error"};function Fx({percentage:e,status:t,className:n=""}){const s=Math.min(100,Math.max(0,e));return i.jsx("div",{className:`h-2 bg-base-300 ${n}`,children:i.jsx("div",{className:`h-full ${zx[t]} transition-[width] duration-150`,style:{width:`${s}%`}})})}/**
|
|
198
|
+
* @license lucide-react v1.23.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const hm=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/**
|
|
203
|
+
* @license lucide-react v1.23.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const Bx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
208
|
+
* @license lucide-react v1.23.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const Ux=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
|
|
213
|
+
* @license lucide-react v1.23.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const qu=e=>{const t=Ux(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
218
|
+
* @license lucide-react v1.23.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/var Za={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
223
|
+
* @license lucide-react v1.23.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const Wx=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Hx=b.createContext({}),Vx=()=>b.useContext(Hx),Kx=b.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:a,iconNode:o,...l},c)=>{const{size:u=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:x=""}=Vx()??{},v=s??d?Number(n??p)*24/Number(t??u):n??p;return b.createElement("svg",{ref:c,...Za,width:t??u??Za.width,height:t??u??Za.height,stroke:e??f,strokeWidth:v,className:hm("lucide",x,r),...!a&&!Wx(l)&&{"aria-hidden":"true"},...l},[...o.map(([y,j])=>b.createElement(y,j)),...Array.isArray(a)?a:[a]])});/**
|
|
228
|
+
* @license lucide-react v1.23.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const te=(e,t)=>{const n=b.forwardRef(({className:s,...r},a)=>b.createElement(Kx,{ref:a,iconNode:t,className:hm(`lucide-${Bx(qu(e))}`,`lucide-${e}`,s),...r}));return n.displayName=qu(e),n};/**
|
|
233
|
+
* @license lucide-react v1.23.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const Gx=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Tn=te("arrow-right",Gx);/**
|
|
238
|
+
* @license lucide-react v1.23.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const qx=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Yx=te("book-open",qx);/**
|
|
243
|
+
* @license lucide-react v1.23.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const Qx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Jx=te("circle-alert",Qx);/**
|
|
248
|
+
* @license lucide-react v1.23.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const Xx=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Zx=te("circle-check-big",Xx);/**
|
|
253
|
+
* @license lucide-react v1.23.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const ev=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tv=te("circle-check",ev);/**
|
|
258
|
+
* @license lucide-react v1.23.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const nv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],sv=te("circle-x",nv);/**
|
|
263
|
+
* @license lucide-react v1.23.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const rv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],gm=te("clock",rv);/**
|
|
268
|
+
* @license lucide-react v1.23.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const iv=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Yu=te("database",iv);/**
|
|
273
|
+
* @license lucide-react v1.23.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const av=[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]],ov=te("door-open",av);/**
|
|
278
|
+
* @license lucide-react v1.23.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const lv=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],cv=te("eye",lv);/**
|
|
283
|
+
* @license lucide-react v1.23.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const uv=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],eo=te("file-text",uv);/**
|
|
288
|
+
* @license lucide-react v1.23.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const dv=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],fv=te("fingerprint-pattern",dv);/**
|
|
293
|
+
* @license lucide-react v1.23.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const pv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Xr=te("globe",pv);/**
|
|
298
|
+
* @license lucide-react v1.23.0 - ISC
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the ISC license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/const mv=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],hv=te("key-round",mv);/**
|
|
303
|
+
* @license lucide-react v1.23.0 - ISC
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the ISC license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/const gv=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],yv=te("library",gv);/**
|
|
308
|
+
* @license lucide-react v1.23.0 - ISC
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the ISC license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/const xv=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],vv=te("lock",xv);/**
|
|
313
|
+
* @license lucide-react v1.23.0 - ISC
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the ISC license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/const bv=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],jv=te("newspaper",bv);/**
|
|
318
|
+
* @license lucide-react v1.23.0 - ISC
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the ISC license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/const wv=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],kv=te("panels-top-left",wv);/**
|
|
323
|
+
* @license lucide-react v1.23.0 - ISC
|
|
324
|
+
*
|
|
325
|
+
* This source code is licensed under the ISC license.
|
|
326
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
+
*/const Nv=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Sv=te("scroll-text",Nv);/**
|
|
328
|
+
* @license lucide-react v1.23.0 - ISC
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the ISC license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/const Cv=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Qu=te("server",Cv);/**
|
|
333
|
+
* @license lucide-react v1.23.0 - ISC
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the ISC license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/const Ev=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Tv=te("shield",Ev);/**
|
|
338
|
+
* @license lucide-react v1.23.0 - ISC
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the ISC license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/const Lv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],to=te("terminal",Lv);/**
|
|
343
|
+
* @license lucide-react v1.23.0 - ISC
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the ISC license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/const Av=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Iv=te("trending-up",Av);/**
|
|
348
|
+
* @license lucide-react v1.23.0 - ISC
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the ISC license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/const Ov=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Pv=te("triangle-alert",Ov),_v={reached:Zx,on_track:Iv,behind:gm,at_risk:Pv},Dv={reached:"text-success",on_track:"text-success",behind:"text-warning",at_risk:"text-error"},Mv={reached:"bg-success/10",on_track:"bg-success/5",behind:"bg-warning/10",at_risk:"bg-error/10"};function Rv(e,t,n){const s=n.find(r=>r.projectId===e&&r.activity===t);return(s==null?void 0:s.totalHours)??0}function $v({goals:e,activityHours:t,projectNames:n,activityNames:s,month:r,today:a}){return e.length===0?null:i.jsx("div",{className:"border border-base-300",children:e.map((o,l)=>{const c=Rv(o.projectId,o.activity,t),u=$x({targetHours:o.targetHours,actualHours:c,month:r,today:a}),p=n.get(o.projectId),d=_v[u.status];return i.jsxs("div",{className:`grid grid-cols-[auto_1fr_auto_1fr] gap-0 ${Mv[u.status]} ${l>0?"border-t border-base-300":""}`,children:[i.jsx("div",{className:"p-3 border-r border-base-300 flex items-center justify-center",children:i.jsx(d,{size:18,className:Dv[u.status]})}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-display font-semibold text-sm",children:p??o.projectId}),i.jsxs("div",{className:"font-mono text-[0.6rem] opacity-50 mt-0.5",children:[p?`${o.projectId} · `:"",s.get(`${o.projectId}\0${o.activity}`)??o.activity]})]}),i.jsxs("div",{className:"p-3 border-r border-base-300 text-right min-w-[7rem]",children:[i.jsxs("div",{className:"font-display font-semibold text-sm",children:[Math.round(c*10)/10,"/",o.targetHours,"h"]}),i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mt-0.5",children:[o.targetDays,"d target"]})]}),i.jsxs("div",{className:"p-3",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx(Fx,{percentage:u.percentage,status:u.status,className:"flex-1"}),i.jsxs("span",{className:"font-mono text-xs font-medium min-w-[3rem] text-right",children:[Math.round(u.percentage),"%"]})]}),u.status==="reached"?i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-success uppercase tracking-[0.1em]",children:"Goal reached"}):i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:u.workingDaysRemaining>0?`Book ${Math.round(u.hoursPerDayNeeded*10)/10}h/day · ${u.workingDaysRemaining} days left`:`${Math.round(u.daysRemaining*10)/10} days remaining`})]})]},o.id)})})}function zv({goals:e,month:t,onGoalChange:n,knownCombos:s,projectNames:r,activityNames:a,onRefreshProjects:o,refreshingProjects:l}){const[c,u]=b.useState(""),[p,d]=b.useState(""),[f,x]=b.useState(null),[v,y]=b.useState(""),[j,g]=b.useState(!1),h=b.useMemo(()=>{const T=new Set(e.map(A=>`${A.projectId}\0${A.activity}`));return s.filter(A=>!T.has(`${A.projectId}\0${A.activity}`))},[s,e]);function m(T){const A=T.indexOf("\0");return A<0?null:{projectId:T.slice(0,A),activity:T.slice(A+1)}}function w(T){return r.get(T)??T}function k(T,A){const F=a.get(`${T}\0${A}`);return F?`${w(T)} / ${F}`:`${w(T)} / ${A}`}async function C(){const T=m(c),A=parseFloat(p);if(!(!T||isNaN(A)||A<.5||A>31)){g(!0);try{await z.upsertGoal({month:t,projectId:T.projectId,activity:T.activity,targetDays:A}),u(""),d(""),n()}finally{g(!1)}}}async function S(T){g(!0);try{await z.deleteGoal(T),n()}finally{g(!1)}}async function N(T){const A=parseFloat(v);if(isNaN(A)||A<.5||A>31){x(null);return}g(!0);try{await z.upsertGoal({month:T.month,projectId:T.projectId,activity:T.activity,targetDays:A}),x(null),n()}finally{g(!1)}}return i.jsxs("details",{children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Manage goals (",e.length,")"]}),i.jsxs("div",{className:"mt-2 space-y-3",children:[e.length>0&&i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activity"}),i.jsx("th",{className:"text-right",children:"Target (days)"}),i.jsx("th",{className:"text-right",children:"Target (hours)"}),i.jsx("th",{children:"Actions"})]})}),i.jsx("tbody",{children:e.map(T=>i.jsxs("tr",{children:[i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:w(T.projectId)}),r.has(T.projectId)&&i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.projectId})]}),i.jsxs("td",{children:[i.jsx("div",{className:"text-sm",children:a.get(`${T.projectId}\0${T.activity}`)??T.activity}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.activity})]}),i.jsx("td",{className:"text-right",children:f===T.id?i.jsx("input",{type:"number",step:"0.5",className:"input input-bordered input-xs w-20 text-right",value:v,onChange:A=>y(A.target.value),onBlur:()=>N(T),onKeyDown:A=>{A.key==="Enter"&&N(T),A.key==="Escape"&&x(null)},autoFocus:!0}):T.targetDays}),i.jsx("td",{className:"text-right",children:T.targetHours}),i.jsxs("td",{className:"flex gap-1",children:[i.jsx("button",{className:"btn btn-ghost btn-xs font-mono",onClick:()=>{x(T.id),y(String(T.targetDays))},disabled:j,"aria-label":`Edit goal ${T.projectId} ${T.activity}`,children:"Edit"}),i.jsx("button",{className:"btn btn-ghost btn-xs text-error font-mono",onClick:()=>S(T.id),disabled:j,"aria-label":`Delete goal ${T.projectId} ${T.activity}`,children:"Del"})]})]},T.id))})]})}),i.jsxs("div",{className:"flex items-end gap-2",children:[i.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:T=>u(T.target.value),children:[i.jsx("option",{value:"",children:"Select project / activity…"}),h.map(T=>i.jsx("option",{value:`${T.projectId}\0${T.activity}`,children:k(T.projectId,T.activity)},`${T.projectId}\0${T.activity}`))]}),i.jsx("input",{type:"number",step:"0.5",min:"0.5",max:"31",placeholder:"Days",className:"input input-bordered input-sm w-24",value:p,onChange:T=>d(T.target.value)}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:C,disabled:j||!c,children:"Add"}),i.jsx("button",{className:"btn btn-ghost btn-sm font-mono text-xs opacity-60",onClick:o,disabled:l,children:l?"Refreshing…":"Refresh projects"})]})]})]})}function Fv(e,t){var V;const[n,s]=b.useState([]),[r,a]=b.useState([]),[o,l]=b.useState(null),[c,u]=b.useState([]),p=b.useRef(c);p.current=c;const[d,f]=b.useState(!1),x=b.useCallback(async()=>{try{const E=await z.getGoals(e);s(E.goals)}catch{}},[e]),v=b.useCallback(async()=>{try{const E=await z.getCachedReport(e);E.data?(a(E.data),l(E.fetchedAt)):(a([]),l(null))}catch{}},[e]),y=b.useCallback(async()=>{try{const E=await z.getCachedProjects();E.data&&u(E.data)}catch{}},[]),j=b.useCallback(async()=>{f(!0);try{const E=await z.run("timetracking/projects",{month:e});if(E.ok&&E.data&&E.data.length>0){const D=E.data.map(O=>({projectId:String(O.projectId??""),projectName:String(O.projectName??""),activityNumber:String(O.activityNumber??""),activityName:String(O.activityName??""),category:String(O.category??""),linePropertyId:String(O.linePropertyId??"")}));u(D),await z.cacheProjects(D)}}catch{}f(!1)},[e]);b.useEffect(()=>{x(),v(),y()},[x,v,y]);const g=t==null?void 0:t.data;b.useEffect(()=>{if(g&&g.length>0){l(null),z.cacheReport(e,g).catch(()=>{});const E=new Set,D=[];for(const O of g){const R=String(O.projectId??""),L=String(O.activity??"");if(!R||!L)continue;const P=`${R}\0${L}`;E.has(P)||(E.add(P),D.push({projectId:R,projectName:O.projectName?String(O.projectName):R,activityNumber:L,activityName:O.activityName?String(O.activityName):L,category:String(O.category??""),linePropertyId:""}))}if(D.length>0){const O=new Map;for(const L of p.current)O.set(`${L.projectId}\0${L.activityNumber}`,L);for(const L of D)O.set(`${L.projectId}\0${L.activityNumber}`,L);const R=Array.from(O.values());u(R),z.cacheProjects(R).catch(()=>{})}}},[g,e]);const h=((t==null?void 0:t.data)??[]).length>0?(t==null?void 0:t.data)??[]:r,m=h===r&&r.length>0&&!((V=t==null?void 0:t.data)!=null&&V.length),{projectNames:w,activityNames:k}=b.useMemo(()=>{const E=new Map,D=new Map;for(const O of c)O.projectId&&O.projectName&&E.set(O.projectId,O.projectName),O.projectId&&O.activityNumber&&O.activityName&&D.set(`${O.projectId}\0${O.activityNumber}`,O.activityName);for(const O of h){const R=String(O.projectId??""),L=O.projectName?String(O.projectName):null;R&&L&&E.set(R,L);const P=String(O.activity??""),M=O.activityName?String(O.activityName):null;R&&P&&M&&D.set(`${R}\0${P}`,M)}return{projectNames:E,activityNames:D}},[c,h]),{projectList:C,totalHours:S,draftCount:N,workingDayCount:T}=b.useMemo(()=>{const E=new Map;let D=0,O=0;const R=new Set;for(const L of h){const P=String(L.projectId??"Unknown"),M=Number(L.hours??0),$=String(L.date??""),Q=String(L.status??""),Me=String(L.activity??"");D+=M,$&&R.add($),Q==="draft"&&O++,E.has(P)||E.set(P,{projectId:P,totalHours:0,entryCount:0,activities:new Set});const Ze=E.get(P);if(Ze.totalHours+=M,Ze.entryCount++,Me){const bs=k.get(`${P}\0${Me}`)??Me;Ze.activities.add(bs)}}return{projectList:Array.from(E.values()).sort((L,P)=>P.totalHours-L.totalHours),totalHours:D,draftCount:O,workingDayCount:R.size}},[h,k]),A=b.useMemo(()=>{const E=new Map;for(const D of h){const O=String(D.projectId??"Unknown"),R=String(D.activity??""),L=Number(D.hours??0),P=`${O}\0${R}`,M=E.get(P);M?M.totalHours+=L:E.set(P,{projectId:O,activity:R,totalHours:L})}return Array.from(E.values())},[h]),F=b.useMemo(()=>c.length>0?c.map(E=>({projectId:E.projectId,activity:E.activityNumber})):A.map(E=>({projectId:E.projectId,activity:E.activity})),[c,A]),G=new Date().toISOString().slice(0,10);return{goals:n,loadGoals:x,rows:h,isCached:m,cachedAt:o,projectNames:w,activityNames:k,projectList:C,totalHours:S,draftCount:N,workingDayCount:T,activityHours:A,allCombos:F,todayStr:G,refreshProjects:j,refreshingProjects:d}}function Bv(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function Uv(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function Wv(){const[e,t]=b.useState(Bv()),[n,s]=b.useState(!1),{running:r,result:a,error:o,approvalPending:l,approvalId:c,run:u,handleApproval:p,reset:d}=hr(),{goals:f,loadGoals:x,rows:v,isCached:y,cachedAt:j,projectNames:g,activityNames:h,projectList:m,totalHours:w,draftCount:k,workingDayCount:C,activityHours:S,allCombos:N,todayStr:T,refreshProjects:A,refreshingProjects:F}=Fv(e,a),G=(o==null?void 0:o.includes("auth_required"))||(o==null?void 0:o.includes("sign in")),V=b.useCallback(async()=>{const E={};e&&(E.month=e),await u("timetracking/report",E),await x()},[e,u,x]);return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Time Tracking"}),i.jsxs("div",{className:"flex items-end gap-4 mb-6",children:[i.jsxs("label",{className:"form-control",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Month"}),i.jsx("input",{type:"month",className:"input input-bordered input-sm",value:e,onChange:E=>{t(E.target.value),d()},onClick:E=>{var D,O;return(O=(D=E.target).showPicker)==null?void 0:O.call(D)}})]}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:V,disabled:r,children:r?"Loading...":"Load report"})]}),r&&!l&&i.jsx(ct,{label:"Fetching timetracking data..."}),l&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>p(!0),disabled:!c,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>p(!1),disabled:!c,children:"Reject"})]})]}),G&&i.jsx(jn,{message:"Sign in to the timetracking portal in Chrome, then try again."}),o&&!G&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),v.length>0&&i.jsxs(i.Fragment,{children:[y&&j&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:["Showing cached data from ",Uv(j)]}),i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total hours"}),i.jsx("div",{className:"font-display text-xl font-bold",children:w.toFixed(1)})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Working days"}),i.jsx("div",{className:"font-display text-xl font-bold",children:C})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Projects"}),i.jsx("div",{className:"font-display text-xl font-bold",children:m.length})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Draft entries"}),i.jsx("div",{className:"font-display text-xl font-bold",children:k})]})]}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"By project"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activities"}),i.jsx("th",{className:"text-right",children:"Hours"}),i.jsx("th",{className:"text-right",children:"Entries"})]})}),i.jsx("tbody",{children:m.map(E=>i.jsxs("tr",{children:[i.jsx("td",{children:g.has(E.projectId)?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"text-sm",children:g.get(E.projectId)}),i.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:E.projectId})]}):i.jsx("span",{className:"font-mono text-sm",children:E.projectId})}),i.jsx("td",{className:"text-sm",children:Array.from(E.activities).join(", ")}),i.jsx("td",{className:"text-right font-semibold",children:E.totalHours.toFixed(1)}),i.jsx("td",{className:"text-right",children:E.entryCount})]},E.projectId))})]})}),i.jsxs("details",{open:n,onToggle:E=>s(E.target.open),children:[i.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Raw booking lines (",v.length,")"]}),i.jsx("div",{className:"overflow-x-auto",children:i.jsxs("table",{className:"table table-xs",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Date"}),i.jsx("th",{children:"Project"}),i.jsx("th",{children:"Activity"}),i.jsx("th",{className:"text-right",children:"Hours"}),i.jsx("th",{children:"Status"})]})}),i.jsx("tbody",{children:v.map((E,D)=>i.jsxs("tr",{children:[i.jsx("td",{children:String(E.date??"")}),i.jsx("td",{className:"font-mono text-xs",children:String(E.projectId??"")}),i.jsx("td",{children:String(E.activity??"")}),i.jsx("td",{className:"text-right",children:Number(E.hours??0).toFixed(1)}),i.jsx("td",{children:i.jsx(U,{variant:String(E.status)==="posted"?"success":"warning",size:"xs",children:String(E.status??"")})})]},D))})]})})]})]}),a&&(a.data??[]).length===0&&v.length===0&&!o&&i.jsxs("p",{className:"text-sm opacity-50",children:["No entries found for ",e,"."]}),f.length>0&&i.jsxs("div",{className:"mb-6",children:[i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Goal progress"}),i.jsx($v,{goals:f,activityHours:S,projectNames:g,activityNames:h,month:e,today:T})]}),i.jsx("div",{className:"mt-6",children:i.jsx(zv,{goals:f,month:e,onGoalChange:x,knownCombos:N,projectNames:g,activityNames:h,onRefreshProjects:A,refreshingProjects:F})})]})}const Hv={"MBTMY THE BASE CAMP":"res-rere-m6vz23ty@mercedes-benz.com","MBTMY THE TRAILHEAD":"res-rere-m6vc2q4d@mercedes-benz.com","MBTMY THE FOOTHILLS":"res-rere-m6vcb79c@mercedes-benz.com","MBTMY THE BRIDGE":"res-rere-m6vgcah6@mercedes-benz.com","MBTMY THE RIDGE":"res-rere-m6vjxdkc@mercedes-benz.com","MBTMY THE MEADOW":"res-rere-m6vhkzmd@mercedes-benz.com","MBTMY THE FOREST":"res-rere-m6vhsc6h@mercedes-benz.com","MBTMY THE LOOKOUT":"res-rere-m6vjqgrq@mercedes-benz.com","MBTMY THE CLIFFSIDE":"res-rere-m6vjl2tw@mercedes-benz.com","MBTMY THE LEDGE":"res-rere-m6vjfbmr@mercedes-benz.com","MBTMY THE HIGHPOINT":"res-rere-m6vjblgb@mercedes-benz.com","MBTMY THE VISTA":"RES-RERE-M6VJ7ZUW@mercedes-benz.com","MBTMY THE SHOULDER":"res-rere-m6vj3tuq@mercedes-benz.com","MBTMY THE PINNACLE":"res-rere-m6vhxd4c@mercedes-benz.com","MBTMY THE DESCENT":"res-rere-m6vzgysp@mercedes-benz.com"},Vv=Object.keys(Hv);function Kv({value:e,onChange:t}){const[n,s]=b.useState(!1),[r,a]=b.useState(-1),o=b.useRef(null),l=b.useRef(null),c=Vv.filter(d=>d.toLowerCase().includes(e.toLowerCase())),u=b.useCallback(d=>{t(d),s(!1),a(-1)},[t]);b.useEffect(()=>{function d(f){o.current&&!o.current.contains(f.target)&&(s(!1),a(-1))}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),b.useEffect(()=>{var d;if(r>=0&&l.current){const f=l.current.children[r];(d=f==null?void 0:f.scrollIntoView)==null||d.call(f,{block:"nearest"})}},[r]);function p(d){if(!n&&(d.key==="ArrowDown"||d.key==="ArrowUp")){s(!0),a(0),d.preventDefault();return}if(n)switch(d.key){case"ArrowDown":d.preventDefault(),a(f=>f<c.length-1?f+1:0);break;case"ArrowUp":d.preventDefault(),a(f=>f>0?f-1:c.length-1);break;case"Enter":d.preventDefault(),r>=0&&r<c.length&&u(c[r]);break;case"Escape":d.preventDefault(),s(!1),a(-1);break}}return i.jsxs("div",{ref:o,className:"relative w-full",children:[i.jsx("input",{className:"input input-bordered input-sm w-full",placeholder:"Search or type a room name…",value:e,onChange:d=>{t(d.target.value),s(!0),a(-1)},onFocus:()=>s(!0),onKeyDown:p,role:"combobox","aria-expanded":n,"aria-autocomplete":"list","aria-controls":"room-listbox"}),n&&c.length>0&&i.jsx("ul",{ref:l,id:"room-listbox",role:"listbox",className:"menu dropdown-content bg-base-200 z-10 mt-1 max-h-60 w-full overflow-y-auto border border-base-300 absolute",children:c.map((d,f)=>i.jsx("li",{role:"option","aria-selected":f===r,children:i.jsx("button",{type:"button",className:f===r?"active":"",onMouseDown:x=>{x.preventDefault(),u(d)},onMouseEnter:()=>a(f),children:d})},d))})]})}const Ju={free:"success",busy:"error",tentative:"warning",oof:"secondary",elsewhere:"info"},Gv={free:"bg-success/20 border-success/40",busy:"bg-error/20 border-error/40",tentative:"bg-warning/20 border-warning/40",oof:"bg-secondary/20 border-secondary/40",elsewhere:"bg-info/20 border-info/40"},qv={free:"bg-success/35 border-success/60",busy:"bg-error/35 border-error/60",tentative:"bg-warning/35 border-warning/60",oof:"bg-secondary/35 border-secondary/60",elsewhere:"bg-info/35 border-info/60"};function Ln(e){const t=e.match(/(\d{1,2}:\d{2})/);return t?t[1]:e}function Yv({rows:e}){var r,a;const[t,n]=b.useState(null),s=e.reduce((o,l)=>o+(l.durationMin??0),0);return i.jsxs("div",{children:[s>0&&i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"flex h-10 overflow-hidden gap-px border border-base-300",children:e.map((o,l)=>{const c=s>0?(o.durationMin??0)/s*100:0;if(c<.5)return null;const u=t===l,p=u?qv[o.state??""]??"bg-base-300":Gv[o.state??""]??"bg-base-300";return i.jsxs("div",{className:`${p} border flex items-center justify-center text-xs transition-colors duration-75 cursor-default relative`,style:{width:`${c}%`},onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[c>12&&i.jsx("span",{className:"opacity-60 truncate px-1 font-mono text-[0.65rem] uppercase tracking-wide",children:o.state}),u&&i.jsxs("div",{className:"absolute -top-9 left-1/2 -translate-x-1/2 bg-base-300 border border-base-content/10 px-2 py-1 text-[0.65rem] font-mono whitespace-nowrap z-10 pointer-events-none",children:[o.state,": ",Ln(o.start??""),"–",Ln(o.end??"")," (",o.durationMin,"m)"]})]},l)})}),i.jsxs("div",{className:"flex justify-between mt-1",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Ln(((r=e[0])==null?void 0:r.start)??"")}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Ln(((a=e[e.length-1])==null?void 0:a.end)??"")})]})]}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm",children:[i.jsx("thead",{children:i.jsxs("tr",{children:[i.jsx("th",{children:"Start"}),i.jsx("th",{children:"End"}),i.jsx("th",{children:"State"}),i.jsx("th",{className:"text-right",children:"Duration"})]})}),i.jsx("tbody",{children:e.map((o,l)=>i.jsxs("tr",{className:`transition-colors duration-75 ${t===l?"bg-base-200":"hover:bg-base-200"}`,onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[i.jsx("td",{className:"font-mono text-sm",children:Ln(o.start??"")}),i.jsx("td",{className:"font-mono text-sm",children:Ln(o.end??"")}),i.jsx("td",{children:i.jsx(U,{variant:Ju[o.state??""]??"neutral",children:o.state})}),i.jsxs("td",{className:"text-right font-mono text-sm",children:[o.durationMin,"m"]})]},l))})]})}),i.jsx("div",{className:"flex flex-wrap gap-4 mt-3",children:Object.entries(Ju).map(([o,l])=>i.jsx("div",{className:"flex items-center gap-1.5",children:i.jsx(U,{variant:l,size:"xs",children:o})},o))})]})}function Qv(){return new Date().toISOString().slice(0,10)}function Jv(e){try{const t=new Date(e+"T00:00:00"),n=new Date;n.setHours(0,0,0,0);const s=t.getTime()-n.getTime(),r=Math.round(s/864e5);return r===0?"Today":r===1?"Tomorrow":r===-1?"Yesterday":t.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return e}}function Xv(){const[e,t]=b.useState(""),[n,s]=b.useState(Qv()),{running:r,result:a,error:o,approvalPending:l,approvalId:c,run:u,handleApproval:p}=hr(),d=b.useCallback(async()=>{if(!e)return;const j={room:e};n&&(j.date=n),await u("teams/room-availability",j)},[e,n,u]),f=((a==null?void 0:a.data)??[]).map(j=>({start:String(j.start??""),end:String(j.end??""),state:String(j.state??""),durationMin:Number(j.durationMin??0)})),x=b.useMemo(()=>{if(f.length===0)return null;const j=f.reduce((k,C)=>k+C.durationMin,0),g=f.filter(k=>k.state==="free").reduce((k,C)=>k+C.durationMin,0),h=f.filter(k=>k.state==="busy").reduce((k,C)=>k+C.durationMin,0),m=f.filter(k=>k.state==="free").length,w=j>0?Math.round(g/j*100):0;return{totalMin:j,freeMin:g,busyMin:h,freeSlots:m,pct:w}},[f]),v=(o==null?void 0:o.includes("auth_required"))||(o==null?void 0:o.includes("sign in")),y=e.replace(/^MBTMY\s+/i,"");return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Room Availability"}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control flex-1 min-w-0",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Room"}),i.jsx(Kv,{value:e,onChange:t})]}),i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Date"}),i.jsx("input",{type:"date",className:"input input-bordered input-sm w-full sm:w-auto",value:n,onChange:j=>s(j.target.value),onClick:j=>{var g,h;return(h=(g=j.target).showPicker)==null?void 0:h.call(g)}})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:d,disabled:r||!e,children:r?"Loading...":"Check availability"})]}),r&&!l&&i.jsx(ct,{label:"Checking room availability..."}),l&&i.jsxs("div",{className:"alert alert-warning mb-4",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>p(!0),disabled:!c,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>p(!1),disabled:!c,children:"Reject"})]})]}),v&&i.jsx(jn,{message:"Sign in to Microsoft Teams in Chrome, then try again."}),o&&!v&&i.jsx("div",{className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),a&&f.length>0&&x&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Available"}),i.jsxs("div",{className:"font-display text-xl font-bold text-success",children:[x.pct,"%"]})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Free time"}),i.jsxs("div",{className:"font-display text-xl font-bold",children:[Math.floor(x.freeMin/60),"h ",x.freeMin%60,"m"]})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Busy time"}),i.jsxs("div",{className:"font-display text-xl font-bold",children:[Math.floor(x.busyMin/60),"h ",x.busyMin%60,"m"]})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Free slots"}),i.jsx("div",{className:"font-display text-xl font-bold",children:x.freeSlots})]})]}),i.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:[y||"Room"," · ",Jv(n)]}),i.jsx(Yv,{rows:f})]}),a&&f.length===0&&!o&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No availability data found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Try a different room or date."})]}),!a&&!r&&!o&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Select a room and date to check availability"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Free/busy slots will appear as a visual timeline."})]})]})}function Zv({data:e}){const{timetracking:t,meetings:n,jira:s,git:r}=e,a=t?Math.min(100,Math.round(t.totalHours/t.targetHours*100)):0,o=t&&t.totalHours<t.targetHours*.8,l=(s==null?void 0:s.blockers.length)??0,c=(r==null?void 0:r.repos.length)??0;return i.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300",children:[i.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Hours Logged"}),i.jsx("div",{className:`font-display text-xl font-bold ${o?"text-warning":"text-success"}`,children:t?`${t.totalHours}h`:"—"}),i.jsxs("div",{className:"text-xs opacity-40",children:["/ ",(t==null?void 0:t.targetHours)??40,"h target"]}),t&&i.jsx("progress",{className:`progress ${o?"progress-warning":"progress-success"} w-full mt-1`,value:a,max:100})]}),i.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Meetings"}),i.jsx("div",{className:`font-display text-xl font-bold ${n&&n.totalHours>20?"text-warning":"text-info"}`,children:n?String(n.totalCount):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:n?`${n.totalHours}h · avg ${n.avgDurationMin}min`:""})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Tickets Done"}),i.jsx("div",{className:"font-display text-xl font-bold text-accent",children:s?String(s.resolved.length):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:s?i.jsxs(i.Fragment,{children:[s.inProgress.length," in progress",l>0&&i.jsxs("span",{className:"text-error font-semibold ml-1",children:["· ",l," blocked"]})]}):""})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Commits"}),i.jsx("div",{className:"font-display text-xl font-bold text-primary",children:r?String(r.totalCommits):"—"}),i.jsx("div",{className:"text-xs opacity-40",children:r?`${r.totalPRsMerged} PRs · ${c} repo${c!==1?"s":""}`:""})]})]})}const e1=["Mon","Tue","Wed","Thu","Fri"];function t1(e){const t=new Date(e).getDay();return e1[t-1]??e}function n1({data:e}){const{timetracking:t,meetings:n,git:s,jira:r}=e,a=new Set;t==null||t.daily.forEach(f=>a.add(f.date)),n==null||n.daily.forEach(f=>a.add(f.date)),s==null||s.daily.forEach(f=>a.add(f.date));const o=[...a].sort().filter(f=>{const x=new Date(f+"T00:00:00").getDay();return x===0||x===6?(t==null?void 0:t.daily.some(y=>y.date===f&&y.hours>0))||(n==null?void 0:n.daily.some(y=>y.date===f&&y.count>0))||(s==null?void 0:s.daily.some(y=>y.date===f&&y.commits>0)):!0}),l=(t==null?void 0:t.totalHours)??0,c=(n==null?void 0:n.totalCount)??0,u=(n==null?void 0:n.totalHours)??0,p=(s==null?void 0:s.totalCommits)??0,d=(r==null?void 0:r.resolved.length)??0;return o.length===0?i.jsx("div",{className:"text-base-content/60",children:"No daily data available."}):i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-50",children:[i.jsx("th",{children:"Day"}),i.jsx("th",{children:"Date"}),i.jsx("th",{children:"Hours Logged"}),i.jsx("th",{children:"Meetings"}),i.jsx("th",{children:"Commits"}),i.jsx("th",{children:"Tickets"})]})}),i.jsx("tbody",{children:o.map(f=>{const x=t==null?void 0:t.daily.find(h=>h.date===f),v=n==null?void 0:n.daily.find(h=>h.date===f),y=s==null?void 0:s.daily.find(h=>h.date===f),j=t==null?void 0:t.gaps.includes(f),g=(r==null?void 0:r.resolved.filter(h=>h.resolvedDate===f))??[];return i.jsxs("tr",{className:j?"bg-warning/10":"",children:[i.jsx("td",{className:"font-medium",children:t1(f)}),i.jsx("td",{className:"text-xs text-base-content/60",children:f}),i.jsxs("td",{children:[i.jsx("span",{className:j?"text-warning font-semibold":"",children:x?`${x.hours}h`:"—"}),j&&i.jsx("span",{className:"ml-1 text-warning text-xs",children:"⚠"})]}),i.jsx("td",{children:v?`${v.count} (${v.hours}h)`:"—"}),i.jsx("td",{children:y?`${y.commits}`:"0"}),i.jsx("td",{className:"text-xs",children:g.length>0?g.map(h=>h.key).join(", "):"—"})]},f)})}),i.jsx("tfoot",{children:i.jsxs("tr",{className:"font-semibold border-t border-base-300",children:[i.jsx("td",{colSpan:2,children:"Total"}),i.jsx("td",{children:l>0?`${l}h`:"—"}),i.jsx("td",{children:c>0?`${c} (${u}h)`:"—"}),i.jsx("td",{children:p}),i.jsx("td",{className:"text-xs",children:d>0?`${d} done`:"—"})]})})]})})}function s1({insights:e,errors:t}){return i.jsxs("div",{className:"space-y-3",children:[e.length>0&&i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsx("p",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em] mb-2",children:"Insights"}),i.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:e.map((n,s)=>i.jsx("li",{children:n},s))})]}),t.length>0&&i.jsx("div",{className:"alert alert-warning text-sm",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:"Some data sources had issues:"}),i.jsx("ul",{className:"list-disc list-inside mt-1",children:t.map((n,s)=>i.jsx("li",{children:n},s))})]})})]})}function ym(e){const t=e.getFullYear(),n=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${n}-${s}`}function r1(){const e=new Date;return e.setDate(e.getDate()-e.getDay()),ym(e)}function Xu(e,t){const n=new Date(e+"T00:00:00");return n.setDate(n.getDate()+t*7),ym(n)}function i1(e){const t=new Date(e+"T00:00:00"),n=new Date(t);n.setDate(n.getDate()+6);const s=r=>r.toLocaleDateString("en-GB",{day:"numeric",month:"short"});return`${s(t)} – ${s(n)}, ${t.getFullYear()}`}function a1(){const[e,t]=b.useState(r1()),[n,s]=b.useState(!1),[r,a]=b.useState(null),[o,l]=b.useState(null),[c,u]=b.useState(null);async function p(){s(!0),l(null),a(null),u(null);const d=Date.now();try{const f=await z.generateJournal({weekStart:e});u(Date.now()-d),a(f)}catch(f){l(f instanceof Error?f.message:"Unknown error")}finally{s(!1)}}return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Dev Work Journal"}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-6",children:[i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(Xu(e,-1)),disabled:n,children:"◄"}),i.jsx("span",{className:"font-medium text-lg",children:i1(e)}),i.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(Xu(e,1)),disabled:n,children:"►"}),i.jsx("button",{className:"btn btn-primary ml-4",onClick:p,disabled:n,children:n?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"loading loading-spinner loading-xs"}),"Generating…"]}):"Generate"}),c!==null&&!n&&i.jsxs("span",{className:"text-xs text-base-content/40 ml-2",children:["Generated in ",(c/1e3).toFixed(1),"s"]})]}),n&&i.jsxs("div",{className:"flex items-center gap-3 text-base-content/60 mb-4",children:[i.jsx("span",{className:"loading loading-spinner loading-md"}),i.jsx("span",{children:"Gathering data from Git, Outlook, Jira…"})]}),o&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsx("span",{children:o})}),(r==null?void 0:r.status)==="partial"&&i.jsx("div",{role:"alert",className:"alert alert-warning text-sm mb-4",children:i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:"Some data sources were unavailable. Results may be incomplete."}),i.jsx("ul",{className:"list-disc list-inside mt-1",children:r.errors.map((d,f)=>i.jsx("li",{children:d},f))})]})}),r&&r.status!=="error"&&i.jsxs("div",{className:"space-y-6",children:[i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Summary"}),i.jsx(Zv,{data:r})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Daily Breakdown"}),i.jsx(n1,{data:r})]}),i.jsx("section",{className:"space-y-4",children:i.jsx(s1,{insights:r.insights,errors:r.errors})})]}),(r==null?void 0:r.status)==="error"&&i.jsx("div",{role:"alert",className:"alert alert-error mb-4",children:i.jsxs("span",{children:["Failed to generate journal. ",r.errors.join("; ")]})})]})}function o1(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function l1(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function c1(e){const[t,n]=e.split("-").map(Number);return new Date(t,n-1,1).toLocaleDateString("en-GB",{month:"long",year:"numeric"})}function u1(e){return new Date(e+"T00:00:00").toLocaleDateString("en-GB",{weekday:"short",day:"numeric",month:"short"})}function d1(e){const[t,n]=e.split("-").map(Number),s=new Date(t,n,0).getDate();let r=0;for(let a=1;a<=s;a++){const o=new Date(t,n-1,a).getDay();o!==0&&o!==6&&r++}return r}function f1(e,t){const n=l1(),[s,r]=t.split("-").map(Number),a=new Date(n+"T00:00:00"),o=new Date(s,r,0).getDate(),l=[];for(let d=1;d<=o;d++){const f=new Date(s,r-1,d);if(f>a)break;const x=f.getDay();x!==0&&x!==6&&l.push(`${s}-${String(r).padStart(2,"0")}-${String(d).padStart(2,"0")}`)}const c=new Set(e.filter(d=>d.date&&d.status&&/released/i.test(String(d.status))).map(d=>d.date)),u=l.filter(d=>c.has(d)),p=l.filter(d=>!c.has(d));return{workingDaysTotal:d1(t),workingDaysElapsed:l.length,releasedDates:u,unreleasedDates:p}}function p1(e){return e.isOverdue?"badge badge-error badge-sm":typeof e.daysUntilDue=="number"&&e.daysUntilDue<=7?"badge badge-warning badge-sm":typeof e.daysUntilDue=="number"&&e.daysUntilDue<=30?"badge badge-info badge-sm":"badge badge-ghost badge-sm"}function m1(e){return e.isOverdue?"Overdue":e.daysUntilDue==null||e.daysUntilDue===9999?"No deadline":e.daysUntilDue===0?"Due today":e.daysUntilDue===1?"Due tomorrow":`${e.daysUntilDue}d left`}function h1(){const[e]=b.useState(o1()),[t,n]=b.useState([]),s=hr(),r=hr();function a(){s.reset(),r.reset(),n([]),s.run("timetracking/report",{month:e}),r.run("saba/pending-training",{}),z.getGoals(e).then(v=>n(v.goals)).catch(()=>{})}const o=b.useMemo(()=>{var v;return((v=s.result)==null?void 0:v.data)??null},[s.result]),l=b.useMemo(()=>o?f1(o,e):null,[o,e]),c=b.useMemo(()=>{const v=new Map;if(o)for(const y of o){const j=typeof y.projectId=="string"?y.projectId:null,g=typeof y.hours=="number"?y.hours:0;j&&v.set(j,(v.get(j)??0)+g)}return v},[o]),u=b.useMemo(()=>{var v;return((v=r.result)==null?void 0:v.data)??[]},[r.result]),p=typeof r.error=="string"&&(r.error.toLowerCase().includes("auth_required")||r.error.toLowerCase().includes("sign in")),d=typeof s.error=="string"&&(s.error.toLowerCase().includes("auth_required")||s.error.toLowerCase().includes("sign in")),f=s.running||r.running,x=s.result!==null||r.result!==null;return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsxs("div",{className:"flex items-center justify-between mb-5",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em]",children:"Daily Check-in"}),i.jsx("p",{className:"text-sm opacity-40 mt-0.5",children:c1(e)})]}),i.jsx("button",{className:"btn btn-primary btn-sm",onClick:a,disabled:f,children:f?"Loading…":x?"Refresh":"Load"})]}),f&&!s.approvalPending&&!r.approvalPending&&i.jsx("div",{className:"mb-4",children:i.jsx(ct,{label:"Fetching time tracking and Saba training…"})}),i.jsxs("section",{className:"space-y-4 mb-6",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Time Tracking"}),s.approvalPending&&i.jsxs("div",{className:"alert alert-warning",children:[i.jsx("span",{children:"Time tracking requires approval."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>s.handleApproval(!0),disabled:!s.approvalId,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>s.handleApproval(!1),disabled:!s.approvalId,children:"Reject"})]})]}),d&&i.jsx(jn,{message:"Sign in to the timetracking portal in Chrome, then try again."}),s.error&&!d&&i.jsx("div",{className:"alert alert-error text-sm",children:i.jsx("span",{children:s.error})}),l&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-4 border border-base-300",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Working days"}),i.jsx("div",{className:"font-display text-xl font-bold",children:l.workingDaysTotal}),i.jsx("div",{className:"text-xs opacity-40",children:"in month"})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Elapsed"}),i.jsx("div",{className:"font-display text-xl font-bold",children:l.workingDaysElapsed}),i.jsx("div",{className:"text-xs opacity-40",children:"so far"})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Released"}),i.jsx("div",{className:"font-display text-xl font-bold text-success",children:l.releasedDates.length}),i.jsx("div",{className:"text-xs opacity-40",children:"days"})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Unreleased"}),i.jsx("div",{className:`font-display text-xl font-bold ${l.unreleasedDates.length>0?"text-error":"text-success"}`,children:l.unreleasedDates.length}),i.jsx("div",{className:"text-xs opacity-40",children:"to action"})]})]}),l.unreleasedDates.length>0&&i.jsxs("div",{className:"border border-base-300 p-4 space-y-2",children:[i.jsx("p",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Unreleased dates"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:l.unreleasedDates.map(v=>i.jsx("span",{className:"badge badge-error badge-outline badge-sm",children:u1(v)},v))})]}),l.unreleasedDates.length===0&&i.jsx("div",{className:"border border-base-300 p-4 text-center",children:i.jsx("p",{className:"text-sm text-success font-medium",children:"All days released ✓"})})]}),l&&t.length>0&&i.jsxs("div",{className:"border border-base-300 p-4 space-y-3",children:[i.jsx("p",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Goals Progress"}),i.jsx("div",{className:"space-y-3",children:t.map(v=>{const y=Math.round((c.get(v.projectId)??0)*100)/100,j=Math.round((v.targetHours-y)*100)/100,g=Math.min(100,Math.round(y/v.targetHours*100)),h=j<=0;return i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center justify-between text-sm",children:[i.jsx("span",{className:"font-medium",children:v.projectId}),i.jsx("span",{className:`font-mono text-xs ${h?"text-success":"text-warning"}`,children:h?"✓ Goal met":`${j}h to go`})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("progress",{className:`progress flex-1 ${h?"progress-success":"progress-warning"}`,value:g,max:100}),i.jsxs("span",{className:"font-mono text-xs opacity-50 w-24 text-right",children:[y,"h / ",v.targetHours,"h"]})]})]},v.id)})})]}),o===null&&!s.error&&!s.running&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-40",children:"Click Load to check your time tracking status."}),i.jsx("p",{className:"font-mono text-xs opacity-25 mt-1",children:"Drives your browser — sign in to the portal first."})]})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsx("h3",{className:"font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Pending Training (Saba)"}),r.approvalPending&&i.jsxs("div",{className:"alert alert-warning",children:[i.jsx("span",{children:"This connector requires approval before proceeding."}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>r.handleApproval(!0),disabled:!r.approvalId,children:"Approve"}),i.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>r.handleApproval(!1),disabled:!r.approvalId,children:"Reject"})]})]}),p&&i.jsx(jn,{message:"Sign in to Saba Cloud (daimler.sabacloud.com) in Chrome, then try again."}),r.error&&!p&&i.jsx("div",{className:"alert alert-error text-sm font-mono whitespace-pre-wrap",children:i.jsx("span",{children:r.error})}),r.result&&u.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"grid grid-cols-3 border border-base-300",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Pending"}),i.jsx("div",{className:"font-display text-xl font-bold",children:u.length})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Overdue"}),i.jsx("div",{className:`font-display text-xl font-bold ${u.filter(v=>v.isOverdue).length>0?"text-error":""}`,children:u.filter(v=>v.isOverdue).length})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Due ≤ 30d"}),i.jsx("div",{className:`font-display text-xl font-bold ${u.filter(v=>!v.isOverdue&&typeof v.daysUntilDue=="number"&&v.daysUntilDue<=30).length>0?"text-warning":""}`,children:u.filter(v=>!v.isOverdue&&typeof v.daysUntilDue=="number"&&v.daysUntilDue<=30).length})]})]}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"font-mono text-[0.6rem] uppercase tracking-[0.1em] opacity-50",children:[i.jsx("th",{children:"Course"}),i.jsx("th",{children:"Type"}),i.jsx("th",{children:"Status"}),i.jsx("th",{children:"Due"}),i.jsx("th",{children:"Urgency"})]})}),i.jsx("tbody",{children:u.map((v,y)=>i.jsxs("tr",{className:"hover",children:[i.jsx("td",{className:`font-medium text-sm ${v.isOverdue?"text-error":""}`,children:v.title??"—"}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:v.type??"—"}),i.jsx("td",{className:"text-xs opacity-70",children:v.status??"—"}),i.jsx("td",{className:"font-mono text-xs",children:v.dueDate||"—"}),i.jsx("td",{children:i.jsx("span",{className:p1(v),children:m1(v)})})]},y))})]})})]}),r.result&&u.length===0&&!r.error&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm text-success font-medium",children:"No pending training ✓"}),i.jsx("p",{className:"font-mono text-xs opacity-30 mt-0.5",children:"You're all caught up."})]}),!r.result&&!r.error&&!r.running&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-40",children:"Click Load to fetch your pending Saba training."}),i.jsx("p",{className:"font-mono text-xs opacity-25 mt-1",children:"Requires an active Saba Cloud session in Chrome."})]})]})]})}const g1={socket:"info",wiz:"secondary",tldrsec:"warning"},y1={socket:"SOCKET",wiz:"WIZ",tldrsec:"TLDR SEC"};function x1(e,t){try{const n=new Date(e);if(isNaN(n.getTime()))return!1;const s=Date.now()-t*24*60*60*1e3;return n.getTime()>=s}catch{return!1}}function v1(e){try{const t=new Date(e);if(isNaN(t.getTime()))return e;const s=new Date().getTime()-t.getTime(),r=Math.floor(s/36e5);if(r<1)return"just now";if(r<24)return`${r}h ago`;const a=Math.floor(r/24);return a===1?"yesterday":a<7?`${a}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return e}}function b1(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.summary??""),url:String(t.url??""),date:String(t.date??""),source:"socket",author:String(t.author??""),tags:String(t.tags??"")}))}function j1(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.excerpt??""),url:String(t.url??""),date:String(t.publishedAt??""),source:"wiz",author:String(t.authors??""),tags:String(t.tags??"")}))}function w1(e){return(e.data??[]).map(t=>({title:String(t.title??""),summary:String(t.excerpt??""),url:String(t.url??""),date:String(t.publishedAt??""),source:"tldrsec",author:String(t.authors??""),tags:String(t.tags??"")}))}const Zu={7:"Past 7 days",30:"Past 30 days"};function k1(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function N1(){const[e,t]=b.useState(7),[n,s]=b.useState("idle"),[r,a]=b.useState("idle"),[o,l]=b.useState("idle"),[c,u]=b.useState([]),[p,d]=b.useState([]),[f,x]=b.useState([]),[v,y]=b.useState(null),[j,g]=b.useState(null),[h,m]=b.useState(null),[w,k]=b.useState(null),[C,S]=b.useState(!1);b.useEffect(()=>{let E=!1;return z.getCachedSecurityNews().then(D=>{if(!E&&D.data&&D.data.length>0){if(s(P=>P==="loading"?(E=!0,P):"done"),E)return;const O=[],R=[],L=[];for(const P of D.data){const M=P;M.source==="wiz"?R.push(M):M.source==="tldrsec"?L.push(M):O.push(M)}u(O),d(R),x(L),k(D.fetchedAt),S(!0),a("done"),l("done")}}).catch(()=>{}),()=>{E=!0}},[]);const N=n==="loading"||r==="loading"||o==="loading",T=c.length>0||p.length>0||f.length>0,A=b.useMemo(()=>[...c,...p,...f].filter(D=>x1(D.date,e)).sort((D,O)=>new Date(O.date).getTime()-new Date(D.date).getTime()),[c,p,f,e]),F=b.useMemo(()=>{const E=A.filter(R=>R.source==="socket").length,D=A.filter(R=>R.source==="wiz").length,O=A.filter(R=>R.source==="tldrsec").length;return{total:A.length,socketCount:E,wizCount:D,tldrsecCount:O}},[A]),G=b.useCallback(async()=>{s("loading"),a("loading"),l("loading"),y(null),g(null),m(null),u([]),d([]),x([]),S(!1);let E=[],D=[],O=[];const R=z.run("socket/security-news",{}).then($=>{!$.ok&&$.error?(y($.error),s("error")):(E=b1($),u(E),s("done"))}).catch($=>{y($ instanceof Error?$.message:"Failed to fetch"),s("error")}),L=z.run("wiz/blog-security",{}).then($=>{!$.ok&&$.error?(g($.error),a("error")):(D=j1($),d(D),a("done"))}).catch($=>{g($ instanceof Error?$.message:"Failed to fetch"),a("error")}),P=z.run("tldrsec/newsletter",{}).then($=>{!$.ok&&$.error?(m($.error),l("error")):(O=w1($),x(O),l("done"))}).catch($=>{m($ instanceof Error?$.message:"Failed to fetch"),l("error")});await Promise.allSettled([R,L,P]);const M=[...E,...D,...O];if(M.length>0){const $=new Date().toISOString();k($),z.cacheSecurityNews(M).catch(()=>{})}},[]),V=E=>(E==null?void 0:E.includes("auth_required"))||(E==null?void 0:E.includes("sign in"));return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Security News"}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Range"}),i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:e,onChange:E=>t(Number(E.target.value)),children:[i.jsx("option",{value:7,children:"Past 7 days"}),i.jsx("option",{value:30,children:"Past 30 days"})]})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:G,disabled:N,children:N?"Loading...":"Load news"}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx(no,{label:"Socket",status:n}),i.jsx(no,{label:"Wiz",status:r}),i.jsx(no,{label:"tl;dr sec",status:o})]})]}),N&&i.jsx(ct,{label:"Fetching security news..."}),v&&(V(v)?i.jsx(jn,{message:"Sign in to Socket.dev in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"Socket:"})," ",v]})})),j&&(V(j)?i.jsx(jn,{message:"Sign in to Wiz in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"Wiz:"})," ",j]})})),h&&i.jsx("div",{className:"alert alert-error mb-3",children:i.jsxs("span",{children:[i.jsx("span",{className:"font-semibold",children:"tl;dr sec:"})," ",h]})}),w&&!N&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:[C?"Showing cached data from":"Last fetched"," ",k1(w)]}),T&&!N&&i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:Zu[e]}),i.jsx("div",{className:"font-display text-xl font-bold",children:F.total})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Socket"}),i.jsx("div",{className:"font-display text-xl font-bold",children:F.socketCount})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Wiz"}),i.jsx("div",{className:"font-display text-xl font-bold",children:F.wizCount})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"tl;dr sec"}),i.jsx("div",{className:"font-display text-xl font-bold",children:F.tldrsecCount})]})]}),A.length>0&&i.jsx("div",{className:"space-y-px",children:A.map((E,D)=>i.jsxs("article",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[i.jsx("a",{href:E.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold hover:text-primary transition-colors leading-snug",children:E.title}),i.jsx(U,{variant:g1[E.source]??"neutral",size:"xs",children:y1[E.source]??E.source.toUpperCase()})]}),E.summary&&i.jsx("p",{className:"text-sm opacity-60 leading-relaxed mb-2 line-clamp-2",children:E.summary}),i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:v1(E.date)}),E.author&&i.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:E.author}),E.tags&&i.jsx("div",{className:"flex gap-1 flex-wrap",children:E.tags.split(",").slice(0,3).map(O=>i.jsx(U,{variant:"neutral",size:"xs",children:O.trim()},O.trim()))})]})]},`${E.source}-${D}`))}),T&&A.length===0&&!N&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsxs("p",{className:"text-sm opacity-50 mb-1",children:["No news from the ",Zu[e].toLowerCase()]}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"All sources returned data, but nothing within the date window."})]}),!T&&!N&&!v&&!j&&!h&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Security news from Socket, Wiz, and tl;dr sec"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Select a range and press Load news to fetch the latest posts."})]})]})}function no({label:e,status:t}){const n={idle:"opacity-30",loading:"bg-warning animate-pulse",done:"bg-success",error:"bg-error"}[t];return i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${n}`,"aria-hidden":"true"}),i.jsx("span",{className:"font-mono text-[0.6rem] opacity-50 uppercase",children:e})]})}function Zr(e){if(!e)return null;try{const t=new Date(e);if(isNaN(t.getTime()))return null;const n=new Date;return n.setHours(0,0,0,0),t.setHours(0,0,0,0),Math.ceil((t.getTime()-n.getTime())/(24*60*60*1e3))}catch{return null}}function ed(e){return e===null?"none":e<0?"expired":e<=7?"critical":e<=30?"warning":"ok"}function S1(e,t){switch(e){case"expired":return i.jsx(U,{variant:"error",size:"xs",children:"EXPIRED"});case"critical":return i.jsxs(U,{variant:"error",size:"xs",children:[t,"d LEFT"]});case"warning":return i.jsxs(U,{variant:"warning",size:"xs",children:[t,"d LEFT"]});case"ok":return i.jsxs(U,{variant:"success",size:"xs",children:[t,"d LEFT"]});case"none":return i.jsx(U,{variant:"neutral",size:"xs",children:"NO EXPIRY"});default:return null}}function C1(e){if(!e)return"—";try{const t=new Date(e);return isNaN(t.getTime())?e:t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch{return e}}function E1(e){switch(e){case"expired":return"bg-red-500/5";case"critical":return"bg-red-500/5";case"warning":return"bg-amber-500/5";default:return""}}function T1(e){const t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;const s=Math.floor(n/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}function L1(){const[e,t]=b.useState("idle"),[n,s]=b.useState(""),[r,a]=b.useState([]),[o,l]=b.useState(null),[c,u]=b.useState("all"),[p,d]=b.useState(null),[f,x]=b.useState(!1),v=e==="clients"||e==="trustedby";b.useEffect(()=>{let w=!1;return z.getCachedTrustedPeers().then(k=>{if(!w&&k.data&&k.data.length>0){if(t(S=>S==="clients"||S==="trustedby"?(w=!0,S):"done"),w)return;const C=k.data;a(C),d(k.fetchedAt),x(!0),s(`Loaded ${C.length} trusted peers from cache.`)}}).catch(()=>{}),()=>{w=!0}},[]);const y=b.useCallback(async()=>{t("clients"),l(null),a([]),x(!1),s("Fetching client list (all regions)...");try{const w=await z.run("tokenmaster/clients-list",{region:"all"});if(!w.ok&&w.error){l(w.error),t("error");return}const k=(w.data??[]).map(N=>({id:String(N.id??""),name:String(N.name??""),region:String(N.region??"emea")}));if(k.length===0){s("No clients found."),t("done");return}t("trustedby");const C=[],S=k.length;for(let N=0;N<k.length;N++){const T=k[N];s(`Fetching trusted peers... (${N+1}/${S}) — ${T.name||T.id}`);try{const A=await z.run("tokenmaster/client-trustedby",{clientid:T.id,region:T.region});if(A.ok&&A.data)for(const F of A.data)C.push({parentClientId:T.id,parentClientName:T.name||T.id,peerId:String(F.id??""),peerName:String(F.name??""),peerIdDisplay:String(F.idDisplay??""),expiryDate:F.expiry_date?String(F.expiry_date):null,region:String(F.region??T.region)})}catch{}}if(a(C),s(`Loaded ${C.length} trusted peers from ${S} clients.`),t("done"),C.length>0){const N=new Date().toISOString();d(N),z.cacheTrustedPeers(C).catch(()=>{})}}catch(w){l(w instanceof Error?w.message:"Unknown error"),t("error")}},[]),j=b.useMemo(()=>[...c==="all"?r:r.filter(k=>k.region===c)].sort((k,C)=>{const S=Zr(k.expiryDate),N=Zr(C.expiryDate);return S===null&&N===null?0:S===null?1:N===null?-1:S-N}),[r,c]),g=b.useMemo(()=>{let w=0,k=0,C=0;for(const S of j){const N=ed(Zr(S.expiryDate));N==="expired"?w++:N==="critical"?k++:N==="warning"&&C++}return{total:j.length,expired:w,critical:k,warning:C}},[j]),h=b.useMemo(()=>{const w=new Set(r.map(k=>k.region));return Array.from(w).sort()},[r]),m=w=>(w==null?void 0:w.includes("auth_required"))||(w==null?void 0:w.includes("sign in"));return i.jsxs("div",{className:"max-w-5xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Trusted Peer Expiry"}),p&&!v&&i.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-3",children:[f?"Showing cached data from":"Last fetched"," ",T1(p)]}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[i.jsxs("label",{className:"form-control w-full sm:w-auto",children:[i.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Region"}),i.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:c,onChange:w=>u(w.target.value),children:[i.jsx("option",{value:"all",children:"All regions"}),h.map(w=>i.jsx("option",{value:w,children:w.toUpperCase()},w))]})]}),i.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:y,disabled:v,children:v?"Loading...":"Load trusted peers"})]}),v&&i.jsx(ct,{label:n}),o&&(m(o)?i.jsx(jn,{message:"Sign in to TokenMaster in Chrome, then try again."}):i.jsx("div",{className:"alert alert-error mb-3",children:i.jsx("span",{children:o})})),r.length>0&&!v&&i.jsxs("div",{className:"grid grid-cols-4 border border-base-300 mb-6",children:[i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total"}),i.jsx("div",{className:"font-display text-xl font-bold",children:g.total})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Expired"}),i.jsx("div",{className:`font-display text-xl font-bold ${g.expired>0?"text-red-500":""}`,children:g.expired})]}),i.jsxs("div",{className:"p-3 border-r border-base-300",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 7 days"}),i.jsx("div",{className:`font-display text-xl font-bold ${g.critical>0?"text-red-500":""}`,children:g.critical})]}),i.jsxs("div",{className:"p-3",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 30 days"}),i.jsx("div",{className:`font-display text-xl font-bold ${g.warning>0?"text-amber-500":""}`,children:g.warning})]})]}),j.length>0&&i.jsx("div",{className:"border border-base-300 overflow-x-auto",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"border-b border-base-300",children:[i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Status"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Expiry Date"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Days Left"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Trusted Peer"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Peer ID"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Parent Client"}),i.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Region"})]})}),i.jsx("tbody",{children:j.map((w,k)=>{const C=Zr(w.expiryDate),S=ed(C);return i.jsxs("tr",{className:`border-b border-base-300/50 ${E1(S)}`,children:[i.jsx("td",{children:S1(S,C)}),i.jsx("td",{className:"font-mono text-sm",children:C1(w.expiryDate)}),i.jsx("td",{className:"font-mono text-sm",children:C!==null?C<0?`${Math.abs(C)}d overdue`:`${C}d`:"—"}),i.jsx("td",{className:"text-sm font-semibold",children:w.peerName||w.peerId}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:w.peerIdDisplay||w.peerId}),i.jsx("td",{className:"text-sm",children:w.parentClientName}),i.jsx("td",{children:i.jsx(U,{variant:"neutral",size:"xs",children:w.region.toUpperCase()})})]},`${w.parentClientId}-${w.peerId}-${w.region}-${k}`)})})]})}),e==="done"&&!v&&r.length>0&&i.jsx("div",{className:"mt-1 font-mono text-xs opacity-40",children:n}),e==="done"&&r.length===0&&!v&&i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No trusted peers found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"No clients returned from TokenMaster, or no trustedby relationships exist."})]}),e==="idle"&&i.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"TokenMaster trusted peer expiry monitor"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:'Press "Load trusted peers" to fetch all clients and their trusted peer expiry dates across all regions.'})]})]})}const A1=[{name:"CLI Client",tech:"Node.js / Commander.js",port:null,desc:"Terminal interface. Sends commands to the Daemon over HTTP, formats output as table / JSON / CSV.",pkg:"@commandgarden/cli"},{name:"GUI",tech:"React SPA / Vite / Tailwind / DaisyUI",port:null,desc:"Browser-based interface. Talks to the App Server — never to the Daemon directly.",pkg:null},{name:"App Server",tech:"Fastify / SQLite",port:"9092",desc:"GUI backend. Proxies Daemon calls, enriches responses, and owns app-specific state (preferences, cached reports, goals).",pkg:"@commandgarden/app"},{name:"Daemon",tech:"Fastify / WebSocket / SQLite",port:"9091",desc:"Core service. Validates auth and capabilities, loads connectors, relays pipelines to the Chrome Extension, writes audit log.",pkg:"@commandgarden/daemon"},{name:"Chrome Extension",tech:"MV3 / TypeScript / Service Worker",port:null,desc:"Runs connector pipelines inside browser tabs via content scripts and CDP. Connects to the Daemon via WebSocket.",pkg:null}],I1=[{name:"Audit Log",tech:"SQLite",path:"~/.commandgarden/audit.db",desc:"Every command execution, denial, auth failure, and config change."},{name:"App DB",tech:"SQLite",path:"~/.commandgarden/app.db",desc:"Preferences, cached reports, goals, and saved views."},{name:"Config",tech:"YAML",path:"~/.commandgarden/config.yaml",desc:"Daemon + security + connector + audit settings."},{name:"Session Token",tech:"File",path:"~/.commandgarden/session-token",desc:"Bearer token generated on daemon start. CLI and App Server read it for auth."}],O1={client:"border-sky-500/50 bg-sky-500/10 text-sky-700 dark:text-sky-400",daemon:"border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400",extension:"border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400",browser:"border-violet-500/50 bg-violet-500/10 text-violet-700 dark:text-violet-400"},P1={client:"bg-sky-400/20",daemon:"bg-amber-400/20",extension:"bg-emerald-400/20",browser:"bg-violet-400/20"},_1=[{title:"Command execution (CLI path)",lanes:[{id:"cli",label:"CLI",color:"client"},{id:"daemon",label:"Daemon :9091",color:"daemon"},{id:"ext",label:"Extension",color:"extension"},{id:"browser",label:"Browser Tab",color:"browser"}],steps:[{type:"arrow",from:"cli",to:"daemon",label:"POST /api/run (HTTP)"},{type:"action",lane:"daemon",label:"validate token + CSRF"},{type:"action",lane:"daemon",label:"check connector, domains, capabilities"},{type:"action",lane:"daemon",label:"audit: command.start"},{type:"action",lane:"daemon",label:"split pipeline (extension vs daemon steps)"},{type:"arrow",from:"daemon",to:"ext",label:"relay extension steps (WS)"},{type:"arrow",from:"ext",to:"browser",label:"execute pipeline steps"},{type:"arrow",from:"browser",to:"ext",label:"page data"},{type:"arrow",from:"ext",to:"daemon",label:"results (WS)"},{type:"action",lane:"daemon",label:"run daemon-side steps (transform, map)"},{type:"action",lane:"daemon",label:"audit: command.success / error"},{type:"arrow",from:"daemon",to:"cli",label:"structured data response"}]},{title:"Command execution (GUI path)",lanes:[{id:"gui",label:"GUI",color:"client"},{id:"app",label:"App Server :9092",color:"daemon"},{id:"daemon",label:"Daemon :9091",color:"daemon"}],steps:[{type:"arrow",from:"gui",to:"app",label:"POST /api/run (HTTP)"},{type:"arrow",from:"app",to:"daemon",label:"proxy to daemon (HTTP)"},{type:"action",lane:"daemon",label:"validate, execute, audit (same as CLI path)"},{type:"arrow",from:"daemon",to:"app",label:"structured data"},{type:"arrow",from:"app",to:"gui",label:"enriched response"}]},{title:"Step approval flow",lanes:[{id:"client",label:"CLI / GUI",color:"client"},{id:"daemon",label:"Daemon",color:"daemon"},{id:"ext",label:"Extension",color:"extension"}],steps:[{type:"action",lane:"daemon",label:"detect approval-required capability"},{type:"arrow",from:"daemon",to:"client",label:"HTTP 202 + requestId"},{type:"arrow",from:"daemon",to:"client",label:"approval prompt (SSE)"},{type:"arrow",from:"daemon",to:"ext",label:"approval notification (WS)"},{type:"arrow",from:"client",to:"daemon",label:"POST /api/approval"},{type:"arrow",from:"ext",to:"daemon",label:"resolve via WS"},{type:"action",lane:"daemon",label:"first responder wins → continue or abort"},{type:"action",lane:"daemon",label:"audit: approval.granted / rejected"}]},{title:"Extension connection",lanes:[{id:"ext",label:"Extension",color:"extension"},{id:"daemon",label:"Daemon",color:"daemon"}],steps:[{type:"arrow",from:"ext",to:"daemon",label:"WS connect :9091"},{type:"action",lane:"daemon",label:"validate origin"},{type:"action",lane:"daemon",label:"attach WS relay"},{type:"action",lane:"ext",label:"ready for commands"},{type:"arrow",from:"ext",to:"daemon",label:"heartbeat"}]}];function D1({flow:e}){const{lanes:t,steps:n,title:s}=e,r=t.length,a=`repeat(${r}, 1fr)`;return i.jsxs("div",{className:"border border-base-300 p-4 overflow-x-auto",children:[i.jsx("h4",{className:"font-semibold text-sm mb-3",children:s}),i.jsxs("div",{style:{minWidth:r*130},children:[i.jsx("div",{className:"grid",style:{gridTemplateColumns:a},children:t.map(o=>i.jsx("div",{className:"flex justify-center",children:i.jsx("span",{className:`px-2 py-1 text-[0.65rem] font-mono font-semibold border ${O1[o.color]}`,children:o.label})},o.id))}),i.jsxs("div",{className:"relative py-1",children:[i.jsx("div",{className:"absolute inset-0 grid pointer-events-none",style:{gridTemplateColumns:a},children:t.map(o=>i.jsx("div",{className:"flex justify-center",children:i.jsx("div",{className:`w-0.5 h-full ${P1[o.color]}`})},o.id))}),i.jsx("div",{className:"relative",children:n.map((o,l)=>{if(o.type==="action"){const j=(t.findIndex(g=>g.id===o.lane)+.5)/r*100;return i.jsx("div",{className:"relative",style:{height:26},children:i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${j}%`},children:i.jsx("span",{className:"block px-2 py-0.5 text-[0.6rem] font-mono bg-base-200/90 border border-base-300/60 text-base-content/60 whitespace-nowrap",children:o.label})})},l)}const c=t.findIndex(y=>y.id===o.from),u=t.findIndex(y=>y.id===o.to),p=(c+.5)/r*100,d=(u+.5)/r*100,f=Math.min(p,d),x=Math.abs(d-p),v=c<u;return i.jsxs("div",{className:"relative",style:{height:30},children:[i.jsx("div",{className:"absolute top-1/2 h-px bg-base-content/20",style:{left:`${f}%`,width:`${x}%`}}),i.jsx("div",{className:"absolute top-1/2 w-1.5 h-1.5 rounded-full bg-base-content/30 -translate-x-1/2 -translate-y-1/2",style:{left:`${p}%`}}),i.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 text-[0.55rem] leading-none text-base-content/40",style:{left:`${d}%`,transform:`translate(${v?"-100%":"0"}, -50%)`},children:v?"▸":"◂"}),i.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${(p+d)/2}%`},children:i.jsx("span",{className:"px-1.5 py-px text-[0.6rem] font-mono bg-base-100 text-base-content/60 whitespace-nowrap",children:o.label})})]},l)})})]})]})]})}const M1=[{name:"shared",desc:"Connector schema (Zod), protocol messages, audit events, expression parser, pipeline definitions",published:!1},{name:"daemon",desc:"HTTP + WebSocket server, auth, connector registry, capability validation, audit store, WebSocket relay",published:!1},{name:"cli",desc:"CLI client (Commander.js) — run, list, inspect, validate, daemon/gui management, audit queries, config",published:!0},{name:"chrome",desc:"Chrome MV3 extension — service worker, content scripts, domain guard, pipeline step execution engine",published:!1},{name:"app",desc:"Web GUI — Fastify app server + React SPA (Vite, Tailwind, DaisyUI)",published:!1},{name:"connectors",desc:"Built-in YAML connector definitions",published:!1}];function R1(){return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Architecture"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"How commandGarden's components fit together."}),i.jsx("div",{id:"arch-diagram",className:"border border-base-300 p-5 mb-8 overflow-x-auto scroll-mt-4",children:i.jsxs("svg",{viewBox:"0 0 780 300",className:"w-full text-base-content",style:{minWidth:620},children:[i.jsxs("defs",{children:[i.jsx("marker",{id:"arch-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.3})}),i.jsx("marker",{id:"arch-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.3})})]}),i.jsx("rect",{x:15,y:8,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),i.jsx("text",{x:75,y:29,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI Client"}),i.jsx("text",{x:75,y:44,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Node.js"}),i.jsx("rect",{x:15,y:120,width:120,height:50,rx:3,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),i.jsx("text",{x:75,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),i.jsx("text",{x:75,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"React SPA"}),i.jsx("rect",{x:190,y:120,width:145,height:50,rx:3,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.4)",strokeWidth:1}),i.jsx("text",{x:262,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"App Server"}),i.jsx("text",{x:262,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9092"}),i.jsx("rect",{x:395,y:10,width:160,height:84,rx:3,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.5)",strokeWidth:1.5}),i.jsx("text",{x:475,y:38,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),i.jsx("text",{x:475,y:56,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),i.jsx("text",{x:475,y:78,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),i.jsx("rect",{x:615,y:20,width:150,height:60,rx:3,fill:"rgba(52,211,153,0.08)",stroke:"rgba(52,211,153,0.4)",strokeWidth:1}),i.jsx("text",{x:690,y:44,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),i.jsx("text",{x:690,y:62,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),i.jsx("rect",{x:630,y:200,width:130,height:50,rx:3,fill:"rgba(167,139,250,0.08)",stroke:"rgba(167,139,250,0.4)",strokeWidth:1}),i.jsx("text",{x:695,y:221,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),i.jsx("text",{x:695,y:237,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"target page"}),i.jsx("rect",{x:195,y:240,width:100,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:245,y:257,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"App DB"}),i.jsx("text",{x:245,y:269,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"SQLite"}),i.jsx("rect",{x:390,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:442,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Audit Log"}),i.jsx("text",{x:442,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"SQLite"}),i.jsx("rect",{x:500,y:200,width:85,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:542,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Config"}),i.jsx("text",{x:542,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"YAML"}),i.jsx("rect",{x:75,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:127,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Session Token"}),i.jsx("text",{x:127,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"file"}),i.jsx("line",{x1:137,y1:33,x2:393,y2:45,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:255,y:28,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"HTTP :9091"}),i.jsx("line",{x1:137,y1:145,x2:188,y2:145,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),i.jsx("line",{x1:337,y1:138,x2:393,y2:78,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:354,y:97,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"proxy"}),i.jsx("line",{x1:557,y1:50,x2:613,y2:50,stroke:"currentColor",strokeOpacity:.2,strokeWidth:1.5,markerEnd:"url(#arch-ah)",markerStart:"url(#arch-ah-rev)"}),i.jsx("text",{x:585,y:40,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),i.jsx("line",{x1:695,y1:82,x2:695,y2:198,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),i.jsx("text",{x:720,y:132,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"Content"}),i.jsx("text",{x:720,y:144,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"Scripts"}),i.jsx("text",{x:720,y:160,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"+ CDP"}),i.jsx("line",{x1:245,y1:172,x2:245,y2:238,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:442,y1:96,x2:442,y2:198,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:520,y1:96,x2:542,y2:198,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:75,y1:60,x2:110,y2:198,stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"3 2"}),i.jsx("line",{x1:200,y1:172,x2:155,y2:198,stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"3 2"})]})}),i.jsx("h3",{id:"arch-components",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Components"}),i.jsx("div",{className:"space-y-2 mb-8",children:A1.map(e=>i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-1",children:[i.jsx("span",{className:"font-semibold",children:e.name}),i.jsx(U,{size:"xs",children:e.tech}),e.port&&i.jsxs(U,{variant:"info",size:"xs",children:[":",e.port]}),e.pkg&&i.jsx(U,{variant:"secondary",size:"xs",children:e.pkg})]}),i.jsx("p",{className:"text-sm opacity-60",children:e.desc})]},e.name))}),i.jsx("h3",{id:"arch-stores",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Stores"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Store"}),i.jsx("th",{children:"Format"}),i.jsx("th",{children:"Path"}),i.jsx("th",{children:"Purpose"})]})}),i.jsx("tbody",{children:I1.map(e=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-semibold text-sm",children:e.name}),i.jsx("td",{children:i.jsx(U,{size:"xs",children:e.tech})}),i.jsx("td",{className:"font-mono text-xs opacity-60",children:e.path}),i.jsx("td",{className:"text-sm opacity-60",children:e.desc})]},e.name))})]})}),i.jsx("h3",{id:"arch-flows",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Flows"}),i.jsx("div",{className:"space-y-4 mb-8",children:_1.map(e=>i.jsx(D1,{flow:e},e.title))}),i.jsx("h3",{id:"arch-security",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Security Model"}),i.jsx("div",{className:"border border-base-300 p-4 mb-8",children:i.jsxs("ul",{className:"space-y-2",children:[i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Session token"})," — generated on daemon start, stored at ~/.commandgarden/session-token. Every API call (except /api/status) requires Bearer auth + X-CommandGarden CSRF header."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Domain guard"})," — connector YAML declares allowed domains. Extension refuses to run on undeclared domains."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Capability gating"})," — each pipeline step requires a declared capability. High-risk capabilities (js_evaluate, cookie_write) require explicit approval."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Audit-or-fail"})," — if the audit store is unavailable, commands are blocked."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"No credentials stored"})," — commandGarden reuses existing Chrome sessions. No passwords or cookies are persisted."]}),i.jsxs("li",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold opacity-100",children:"Localhost only"})," — daemon and app server bind to 127.0.0.1 by default."]})]})}),i.jsx("h3",{id:"arch-packages",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Workspace Packages"}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Package"}),i.jsx("th",{children:"Description"}),i.jsx("th",{children:"Published"})]})}),i.jsx("tbody",{children:M1.map(e=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold",children:e.name}),i.jsx("td",{className:"text-sm opacity-60",children:e.desc}),i.jsx("td",{children:e.published?i.jsx(U,{variant:"success",size:"xs",children:"npm"}):i.jsx(U,{size:"xs",children:"bundled"})})]},e.name))})]})}),i.jsx("h3",{id:"arch-build",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Build Order"}),i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsx("div",{className:"flex flex-wrap items-center gap-2 font-mono text-sm",children:["shared","daemon","cli","chrome","app"].map((e,t)=>i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-2 py-1 border border-base-300 bg-base-200",children:e}),t<4&&i.jsx("span",{className:"opacity-40",children:"→"})]},e))}),i.jsxs("p",{className:"text-sm opacity-60 mt-2",children:["Run ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"npm run build"})," from the commandGarden root to build all packages in dependency order."]})]})]})}const $1={GET:"success",POST:"warning",PUT:"info",DELETE:"error",WS:"secondary",SSE:"secondary"},z1=[{method:"GET",path:"/api/status",auth:!1,desc:"Health check. Returns daemon status, extension connection, and connector count."},{method:"GET",path:"/api/connectors",auth:!0,desc:"List all loaded connectors with key, description, access, domains, and capabilities."},{method:"GET",path:"/api/connectors/:site/:name",auth:!0,desc:"Full connector definition including pipeline, args, and columns.",params:"site, name — connector key segments"},{method:"POST",path:"/api/run",auth:!0,desc:"Execute a connector pipeline. Returns structured data. Returns 202 with requestId if step approval is required.",body:"{ connector: string, args: Record<string, string> }"},{method:"GET",path:"/api/audit",auth:!0,desc:"List audit events with optional filters.",params:"since?, connector?, type?, limit?"},{method:"GET",path:"/api/audit/:id",auth:!0,desc:"Single audit event with full detail including pipeline steps."},{method:"GET",path:"/api/config",auth:!0,desc:"Read the full config.yaml as JSON."},{method:"POST",path:"/api/config",auth:!0,desc:"Set a config value. Key must be section.property format.",body:"{ key: string, value: string }"},{method:"POST",path:"/api/approval",auth:!0,desc:"Resolve a pending step approval.",body:"{ approvalId: string, approved: boolean }"},{method:"SSE",path:"/api/run/events/:requestId",auth:!0,desc:"Server-Sent Events stream for approval-required runs. Sends approval and result events."},{method:"WS",path:"/ws/extension",auth:!1,desc:"WebSocket endpoint for Chrome Extension. Origin validated against security.extensionId."}],F1=[{method:"GET",path:"/api/status",auth:!1,desc:"Proxied daemon status (same as daemon /api/status)."},{method:"GET",path:"/api/connectors",auth:!1,desc:"Enriched connector list with hasAppPage, appRoute, isHighRisk, isApproved, isAutoApproved."},{method:"GET",path:"/api/connectors/:site/:name",auth:!1,desc:"Proxied connector detail."},{method:"POST",path:"/api/run",auth:!1,desc:"Proxied connector execution."},{method:"GET",path:"/api/audit",auth:!1,desc:"Proxied audit event list."},{method:"GET",path:"/api/audit/:id",auth:!1,desc:"Proxied single audit event."},{method:"GET",path:"/api/config",auth:!1,desc:"Proxied config read."},{method:"POST",path:"/api/config",auth:!1,desc:"Proxied config write."},{method:"POST",path:"/api/approval",auth:!1,desc:"Proxied approval resolution."},{method:"GET",path:"/api/preferences",auth:!1,desc:"Read app preferences (SQLite-backed).",response:"{ ok, preferences }"},{method:"PUT",path:"/api/preferences",auth:!1,desc:"Set an app preference.",body:"{ key: string, value: string }"},{method:"GET",path:"/api/goals",auth:!1,desc:"Read goals for a month.",params:"month (YYYY-MM)"},{method:"POST",path:"/api/goals",auth:!1,desc:"Create or update a goal.",body:"{ month, projectId, activity, targetDays }"},{method:"DELETE",path:"/api/goals/:id",auth:!1,desc:"Delete a goal."},{method:"GET",path:"/api/timetracking/cache",auth:!1,desc:"Get cached timetracking report for a month.",params:"month (YYYY-MM)"},{method:"POST",path:"/api/timetracking/cache",auth:!1,desc:"Store timetracking report in cache.",body:"{ month, data }"},{method:"GET",path:"/api/timetracking/projects",auth:!1,desc:"Get cached project/activity list."},{method:"POST",path:"/api/timetracking/projects",auth:!1,desc:"Store project/activity list in cache.",body:"{ data }"},{method:"POST",path:"/api/journal/generate",auth:!1,desc:"Generate a dev journal for a given week.",body:"{ weekStart: string }"},{method:"GET",path:"/api/security-news/cache",auth:!1,desc:"Get cached security news articles."},{method:"POST",path:"/api/security-news/cache",auth:!1,desc:"Store security news in cache.",body:"{ data }"}],B1=[{cmd:"cg up",desc:"Start daemon + GUI, open browser.",opts:["--no-open Skip opening browser"]},{cmd:"cg down",desc:"Stop GUI + daemon."},{cmd:"cg run <connector>",desc:"Run a connector command.",args:"Connector key (site/name), plus connector-specific args as --key value",opts:["-f, --format <format> Output format: table, json, csv (default: table)"],example:"cg run timetracking/report --month 2026-07 --format json"},{cmd:"cg list",desc:"List all installed connectors with access, domains, and capabilities."},{cmd:"cg inspect <connector>",desc:"Show full details of a connector (args, columns, pipeline).",example:"cg inspect teams/room-availability"},{cmd:"cg validate <file>",desc:"Validate a connector YAML file against the schema.",example:"cg validate connectors/my-connector.yaml"},{cmd:"cg daemon status",desc:"Check if the daemon is running."},{cmd:"cg daemon start",desc:"Start the daemon in background."},{cmd:"cg daemon stop",desc:"Stop the daemon."},{cmd:"cg gui",desc:"Start the GUI app server (foreground by default).",opts:["-b, --background Run in background","--no-open Skip opening browser"]},{cmd:"cg gui stop",desc:"Stop the GUI app server."},{cmd:"cg gui status",desc:"Check if the GUI is running."},{cmd:"cg audit list",desc:"List recent audit events.",opts:["--since <duration> Time window (e.g. 7d, 2w, 12h)","--connector <pattern> Filter by connector (e.g. test/*)","--type <pattern> Filter by event type (e.g. auth.failed)","--limit <n> Max events (default: 100)"]},{cmd:"cg audit show <id>",desc:"Show full details of a single audit event including pipeline steps."},{cmd:"cg audit export",desc:"Export audit events.",opts:["--format <format> Export format: json, csv (default: json)","--since <duration> Time window","--connector <pattern> Filter","--type <pattern> Filter"]},{cmd:"cg config show",desc:"Show current config.yaml contents."},{cmd:"cg config set <key> <value>",desc:"Set a config value (section.property format).",example:"cg config set daemon.port 9999"},{cmd:"cg extension setup",desc:"Show extension path and instructions for Chrome installation."}],U1=[{step:"navigate",capability:"navigate",desc:"Open a URL in the browser tab"},{step:"wait",capability:"navigate",desc:"Wait for a selector or timeout"},{step:"extract",capability:"dom_read",desc:"Read data from DOM elements"},{step:"extract_tree",capability:"dom_read",desc:"Recursive DOM tree walk with ancestry"},{step:"extract_html",capability:"dom_read",desc:"Capture element HTML as a variable"},{step:"click",capability:"dom_write",desc:"Click an element"},{step:"click_all",capability:"dom_write",desc:"Click all matching elements (with re-scan loop)"},{step:"type",capability:"dom_write",desc:"Type text into an input"},{step:"intercept",capability:"intercept_response",desc:"Capture a network response body"},{step:"cookie",capability:"cookie_read",desc:"Read cookies for a domain"},{step:"fetch",capability:"cookie_read",desc:"HTTP request from page context"},{step:"map",capability:"—",desc:"Transform/rename extracted fields"},{step:"filter",capability:"—",desc:"Filter rows by condition"},{step:"set",capability:"—",desc:"Set a variable for later steps"},{step:"transform",capability:"—",desc:"Server-side data transform (e.g. HTML→Markdown)"}];function td({ep:e}){const[t,n]=b.useState(!1),s=e.params||e.body||e.response;return i.jsxs("div",{className:"border-b border-base-300/50 last:border-b-0",children:[i.jsxs("button",{className:`flex items-center gap-3 w-full text-left px-3 py-2.5 ${s?"cursor-pointer hover:bg-base-200/50":""}`,onClick:()=>s&&n(!t),disabled:!s,children:[i.jsx(U,{variant:$1[e.method]??"neutral",size:"xs",className:"w-10 justify-center shrink-0",children:e.method}),i.jsx("span",{className:"font-mono text-sm flex-1",children:e.path}),e.auth&&i.jsx(U,{variant:"warning",size:"xs",children:"auth"}),s&&i.jsx("span",{className:"text-xs opacity-40",children:t?"▾":"▸"})]}),i.jsx("div",{className:"px-3 pb-2 pl-16 text-sm opacity-60",children:e.desc}),t&&s&&i.jsxs("div",{className:"px-3 pb-3 pl-16 space-y-1.5",children:[e.params&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Params: "}),i.jsx("span",{className:"font-mono opacity-60",children:e.params})]}),e.body&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Body: "}),i.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.body})]}),e.response&&i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Response: "}),i.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.response})]})]})]})}function W1(){const[e,t]=b.useState("cli");return i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"API & CLI Reference"}),i.jsx("p",{className:"text-sm opacity-60 mb-6",children:"CLI commands, Daemon API endpoints, and App Server endpoints."}),i.jsx("div",{id:"api-endpoints",className:"border border-base-300 bg-base-200/30 p-3 mb-6 scroll-mt-4",children:i.jsxs("p",{className:"text-sm opacity-70",children:[i.jsx("span",{className:"font-semibold",children:"Authentication:"})," Daemon endpoints (except ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/api/status"})," and ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/ws/extension"}),") require an ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"Authorization: Bearer <token>"})," header and an ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"X-CommandGarden: 1"})," CSRF header. The App Server handles auth internally — GUI requests don't need tokens."]})}),i.jsx("div",{className:"flex border-b border-base-300 mb-4",children:[{id:"cli",label:"CLI Commands",sub:"cg"},{id:"daemon-api",label:"Daemon API",sub:":9091"},{id:"app-api",label:"App Server API",sub:":9092"}].map(n=>i.jsxs("button",{className:`px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${e===n.id?"border-primary text-primary":"border-transparent opacity-60 hover:opacity-100"}`,onClick:()=>t(n.id),children:[n.label," ",i.jsx("span",{className:"font-mono text-xs opacity-40 ml-1",children:n.sub})]},n.id))}),e==="cli"&&i.jsx("div",{className:"space-y-2 mb-8",children:B1.map(n=>i.jsxs("div",{className:"border border-base-300 p-3",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("code",{className:"font-mono text-sm font-semibold bg-base-200 px-2 py-0.5 shrink-0",children:n.cmd}),i.jsx("span",{className:"text-sm opacity-60 pt-0.5",children:n.desc})]}),n.args&&i.jsxs("div",{className:"mt-2 ml-1 text-xs",children:[i.jsx("span",{className:"font-semibold opacity-50",children:"Args: "}),i.jsx("span",{className:"opacity-60",children:n.args})]}),n.opts&&n.opts.length>0&&i.jsx("div",{className:"mt-1.5 ml-1 space-y-0.5",children:n.opts.map((s,r)=>i.jsx("div",{className:"text-xs font-mono opacity-50",children:s},r))}),n.example&&i.jsx("div",{className:"mt-2 ml-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200/70 px-2 py-1 block opacity-60",children:n.example})})]},n.cmd))}),e==="daemon-api"&&i.jsx("div",{className:"border border-base-300 mb-8",children:z1.map((n,s)=>i.jsx(td,{ep:n},s))}),e==="app-api"&&i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["The App Server on ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:":9092"})," proxies all daemon endpoints and adds app-specific routes for preferences, caching, goals, and journal generation."]}),i.jsx("div",{className:"border border-base-300 mb-8",children:F1.map((n,s)=>i.jsx(td,{ep:n},s))})]}),i.jsx("h3",{id:"api-pipeline",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Pipeline Steps"}),i.jsx("p",{className:"text-sm opacity-50 mb-3",children:"Available steps for connector YAML pipeline definitions."}),i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Step"}),i.jsx("th",{children:"Capability"}),i.jsx("th",{children:"Description"})]})}),i.jsx("tbody",{children:U1.map(n=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold",children:n.step}),i.jsx("td",{children:i.jsx(U,{size:"xs",variant:n.capability==="—"?"neutral":"info",children:n.capability})}),i.jsx("td",{className:"text-sm opacity-60",children:n.desc})]},n.step))})]})}),i.jsx("h3",{id:"api-expressions",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Expression Syntax"}),i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("p",{className:"text-sm opacity-60 mb-3",children:["Use ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"${{ }}"})," for template expressions (no JS eval):"]}),i.jsxs("div",{className:"space-y-1.5 font-mono text-xs",children:[i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Variable access"}),i.jsx("code",{className:"opacity-70",children:"args.month, vars.token, cookies.name"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Row access (map)"}),i.jsx("code",{className:"opacity-70",children:"row.id, row.name"})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Concatenation"}),i.jsx("code",{className:"opacity-70",children:'"Bearer " + vars.token'})]}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Pipe filters"}),i.jsx("code",{className:"opacity-70",children:'args.month | default("2026-06"), value | number, text | trim'})]})]})]})]})}function H1(e){const n=e.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,"").split(`
|
|
353
|
+
`),s=[];let r=null;for(const a of n){const o=a.match(/^(#{1,3})\s+(.+)/);o?(r&&s.push({heading:r.heading,body:r.lines.join(`
|
|
354
|
+
`).trim()}),r={heading:o[2],lines:[]}):r?r.lines.push(a):a.trim()&&(r||(r={heading:"",lines:[]}),r.lines.push(a))}return r&&s.push({heading:r.heading,body:r.lines.join(`
|
|
355
|
+
`).trim()}),s}function V1({content:e}){return i.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap opacity-70 leading-relaxed overflow-x-auto",children:e})}function nd({file:e,defaultOpen:t}){const[n,s]=b.useState(t??!1),r=b.useMemo(()=>H1(e.content),[e.content]);return i.jsxs("div",{className:"border border-base-300/50",children:[i.jsxs("button",{className:"flex items-center gap-2 w-full text-left px-4 py-3 hover:bg-base-200/50 transition-colors",onClick:()=>s(!n),children:[i.jsx("span",{className:"text-xs opacity-50",children:n?"▾":"▸"}),i.jsx("span",{className:"font-mono text-sm font-semibold",children:e.name}),i.jsxs("span",{className:"text-xs opacity-40",children:[r.length," ",r.length===1?"section":"sections"]})]}),n&&i.jsx("div",{className:"px-4 pb-4 space-y-4",children:r.map((a,o)=>i.jsxs("div",{children:[a.heading&&i.jsx("h5",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:a.heading}),i.jsx(V1,{content:a.body})]},o))})]})}function K1({skill:e}){const[t,n]=b.useState(!1),s=e.files.find(a=>a.name==="SKILL.md"),r=e.files.filter(a=>a.name!=="SKILL.md");return i.jsxs("div",{className:"border border-base-300",children:[i.jsx("div",{className:"p-4",children:i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[i.jsx("span",{className:"font-mono text-base font-semibold",children:e.name}),i.jsxs(U,{size:"xs",children:[e.files.length," ",e.files.length===1?"file":"files"]})]}),i.jsx("p",{className:"text-sm opacity-60 mt-1.5 max-w-prose",children:e.description})]}),i.jsx("button",{className:"btn btn-sm btn-ghost font-mono text-xs shrink-0",onClick:()=>n(!t),children:t?"Collapse":"View"})]})}),t&&i.jsxs("div",{className:"border-t border-base-300 p-4 space-y-3",children:[s&&i.jsx(nd,{file:s,defaultOpen:!0}),r.map(a=>i.jsx(nd,{file:a},a.name))]})]})}function G1(){const[e,t]=b.useState([]),[n,s]=b.useState(!0),[r,a]=b.useState(null);return b.useEffect(()=>{z.getSkills().then(o=>t(o.skills)).catch(o=>a(o instanceof Error?o.message:"Failed to load skills")).finally(()=>s(!1))},[]),n?i.jsx(ct,{label:"Loading skills..."}):i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Skills"}),i.jsx("p",{className:"text-sm opacity-60 mb-5",children:"AI agent skills bundled with commandGarden. These teach coding assistants how to use cg and author connectors."}),r?i.jsxs("div",{className:"border border-error/30 p-4",children:[i.jsx("p",{className:"text-sm text-error font-semibold mb-1",children:"Failed to load skills"}),i.jsx("p",{className:"font-mono text-xs opacity-60",children:r})]}):e.length===0?i.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[i.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No skills found"}),i.jsx("p",{className:"font-mono text-xs opacity-30",children:"Skills should be located in the skills/ directory of the commandGarden package."})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{children:"Skill"}),i.jsx("th",{children:"Description"}),i.jsx("th",{children:"Files"})]})}),i.jsx("tbody",{children:e.map(o=>i.jsxs("tr",{className:"hover:bg-base-200",children:[i.jsx("td",{className:"font-mono text-sm font-semibold whitespace-nowrap",children:o.name}),i.jsx("td",{className:"text-sm opacity-60",children:o.description}),i.jsx("td",{className:"text-center",children:i.jsx(U,{size:"xs",children:o.files.length})})]},o.name))})]})}),i.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Skill Details"}),i.jsx("div",{className:"space-y-3",children:e.map(o=>i.jsx(K1,{skill:o},o.name))}),i.jsxs("div",{className:"border border-base-300 p-4 mt-6",children:[i.jsx("h4",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:"Usage"}),i.jsxs("p",{className:"text-sm opacity-60 mb-2",children:["Copy a skill's ",i.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"SKILL.md"})," into your AI assistant's skill directory to teach it how to use commandGarden."]}),i.jsxs("div",{className:"font-mono text-xs opacity-40",children:[i.jsx("span",{children:"Windsurf: "}),i.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".windsurf/skills/"}),i.jsx("span",{className:"mx-2",children:"|"}),i.jsx("span",{children:"Claude: "}),i.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".claude/skills/"})]})]})]})]})}function Pt({children:e}){return i.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-2",children:e})}function ei({children:e}){return i.jsx("pre",{className:"bg-base-200 border border-base-300 p-4 overflow-x-auto text-sm font-mono leading-relaxed",children:i.jsx("code",{children:e})})}function q1(){return i.jsxs("div",{className:"max-w-4xl mx-auto pb-20",children:[i.jsxs("section",{className:"pt-8 pb-16 border-b border-base-300",children:[i.jsx(Pt,{children:"Browser automation for the rest of us"}),i.jsx("h1",{className:"font-display text-3xl sm:text-4xl font-bold tracking-tight leading-tight mb-3",style:{textWrap:"balance"},children:"Turn any website into a CLI command."}),i.jsx("p",{className:"text-base sm:text-lg opacity-70 max-w-[65ch] mb-8 leading-relaxed",style:{textWrap:"pretty"},children:"commandGarden reuses your existing browser sessions to extract structured data from authenticated websites. No API keys, no service accounts, no token overhead."}),i.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-8 font-mono text-xs",children:[{label:"cg run",color:"border-sky-500/50 bg-sky-500/10 text-sky-700 dark:text-sky-400"},{label:"Daemon",color:"border-amber-500/50 bg-amber-500/10 text-amber-700 dark:text-amber-400"},{label:"Chrome Extension",color:"border-emerald-500/50 bg-emerald-500/10 text-emerald-700 dark:text-emerald-400"},{label:"Browser Tab",color:"border-violet-500/50 bg-violet-500/10 text-violet-700 dark:text-violet-400"},{label:"Structured JSON",color:"border-primary/50 bg-primary/10 text-primary"}].map((e,t)=>i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx("span",{className:`px-2.5 py-1 border font-semibold ${e.color}`,children:e.label}),t<4&&i.jsx("span",{className:"opacity-30",children:"→"})]},e.label))}),i.jsx(ei,{children:"npm install -g @commandgarden/cli"})]}),i.jsxs("section",{id:"why-problem",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(Pt,{children:"Where the data actually lives"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"The Problem"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(Xr,{className:"w-4 h-4 text-primary"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Real-world data lives in browsers"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"AI agents can't reach data inside internal portals, enterprise tools, and SaaS dashboards. These systems are where the work happens, but they're locked behind browser sessions."})]}),i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(sv,{className:"w-4 h-4 text-error"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"APIs are the exception"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"Most sites don't provide APIs. When one exists, you need service accounts, managed secrets, and OAuth flows. The data visible in the UI often has no programmatic equivalent."})]}),i.jsxs("div",{className:"border border-base-300 p-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(Jx,{className:"w-4 h-4 text-warning"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Browser automation is expensive"})]}),i.jsx("p",{className:"text-sm opacity-70 leading-relaxed",children:"AI browser tools (Playwright, Puppeteer) are slow, fragile, and token-intensive. Each interaction burns tokens just to understand what's on screen, even when the page layout hasn't changed."})]})]}),i.jsx("p",{className:"text-sm opacity-50 max-w-[65ch]",children:"AI skills, MCP servers, and browser tools all share this flaw: the agent re-parses page structure on every call, repeating work that could be done once."})]}),i.jsxs("section",{id:"why-solution",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(Pt,{children:"How commandGarden works"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"The Solution"}),i.jsxs("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-10",children:["Instead of making the agent figure out each website on every call, commandGarden uses pre-defined extraction recipes, called ",i.jsx("strong",{className:"text-base-content",children:"connectors"}),", that know how to navigate a site and return structured JSON. The agent (or a human) runs a single CLI command and gets back a fixed-schema response."]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-12",children:[i.jsxs("div",{className:"border border-error/20 bg-error/[0.03] p-5",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-error/60 uppercase tracking-[0.12em] mb-4",children:"Without commandGarden"}),i.jsx("div",{className:"space-y-2.5",children:[{label:"AI Agent",note:"receives task"},{label:"Browser Tool",note:"launch headless"},{label:"Navigate + Wait",note:"handle auth redirects"},{label:"Parse HTML",note:"tokens for structure"},{label:"Extract Data",note:"tokens for content"},{label:"Loose Output",note:"varies per run"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-error/30 bg-error/10 flex items-center justify-center font-mono text-[0.6rem] text-error/60 shrink-0",children:t+1}),i.jsx("span",{className:"text-sm font-medium",children:e.label}),i.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<5&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-error/20"})]},t))}),i.jsxs("div",{className:"mt-4 pt-3 border-t border-error/15 flex items-center gap-2",children:[i.jsx(U,{variant:"error",size:"xs",children:"thousands of tokens"}),i.jsx("span",{className:"text-xs opacity-50",children:"per interaction"})]})]}),i.jsxs("div",{className:"border border-primary/20 bg-primary/[0.03] p-5",children:[i.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-primary/60 uppercase tracking-[0.12em] mb-4",children:"With commandGarden"}),i.jsx("div",{className:"space-y-2.5",children:[{label:"AI Agent",note:"receives task"},{label:"cg run site/command",note:"one CLI call"},{label:"Structured JSON",note:"fixed schema"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-primary/30 bg-primary/10 flex items-center justify-center font-mono text-[0.6rem] text-primary/60 shrink-0",children:t+1}),i.jsx("span",{className:"text-sm font-medium",children:e.label}),i.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<2&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-primary/20"})]},t))}),i.jsxs("div",{className:"mt-4 pt-3 border-t border-primary/15 flex items-center gap-2",children:[i.jsx(U,{variant:"success",size:"xs",children:"0 tokens"}),i.jsx("span",{className:"text-xs opacity-50",children:"parsing done locally"})]})]})]}),i.jsxs("div",{className:"space-y-8 mb-12",children:[i.jsxs("div",{className:"flex gap-4",children:[i.jsx(Xr,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"Reuse your browser session"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed",children:"A Chrome extension runs inside your already-authenticated browser. If you can see the data, commandGarden can extract it."})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx(eo,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"Fixed-format parsing, done locally"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed",children:"Each connector defines a pipeline that produces the same structured output on every run. Parsing runs locally in the extension and daemon, so nothing leaves your machine."})]})]}),i.jsxs("div",{className:"flex gap-4",children:[i.jsx(to,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold mb-1",children:"One CLI for humans and AI agents"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[60ch] leading-relaxed mb-3",children:"The same command works whether a human types it or an AI agent calls it via a skill. Same arguments, same JSON schema."}),i.jsx(ei,{children:"cg run timetracking/report --month 2026-06 --format json"})]})]})]}),i.jsx("h3",{className:"font-display font-semibold text-sm mb-3",children:"How it compares"}),i.jsx("div",{className:"overflow-x-auto border border-base-300",children:i.jsxs("table",{className:"table table-sm w-full",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-base-200",children:[i.jsx("th",{}),i.jsx("th",{className:"text-primary",children:"commandGarden"}),i.jsx("th",{children:"AI Skills"}),i.jsx("th",{children:"MCP Servers"})]})}),i.jsx("tbody",{children:[{label:"Return format",cg:["Fixed schema","success"],skills:["Loose, varies","warning"],mcp:["Typed schema","success"]},{label:"Parsing cost",cg:["Zero tokens","success"],skills:["Tokens/call","error"],mcp:["Tokens/call","error"]},{label:"Auth handling",cg:["Browser session","success"],skills:["Agent navigates","warning"],mcp:["Agent manages","warning"]},{label:"Processing",cg:["Local only","success"],skills:["Cloud/agent","warning"],mcp:["Server-side","warning"]},{label:"Privacy",cg:["Stays on machine","success"],skills:["Through AI","error"],mcp:["Through server","warning"]},{label:"Coverage",cg:["Any website","success"],skills:["Any (expensive)","warning"],mcp:["Server-limited","error"]}].map(({label:e,cg:t,skills:n,mcp:s})=>i.jsxs("tr",{children:[i.jsx("td",{className:"font-mono text-xs font-medium",children:e}),i.jsx("td",{className:"bg-primary/[0.03]",children:i.jsx(U,{variant:t[1],size:"xs",children:t[0]})}),i.jsx("td",{children:i.jsx(U,{variant:n[1],size:"xs",children:n[0]})}),i.jsx("td",{children:i.jsx(U,{variant:s[1],size:"xs",children:s[0]})})]},e))})]})}),i.jsxs("p",{className:"text-sm opacity-50 mt-4 max-w-[65ch]",children:["Skills and MCP provide the integration layer; commandGarden does the extraction and parsing locally. The ",i.jsx("span",{className:"font-mono",children:"cg"})," skill lets AI agents call commandGarden commands directly."]})]}),i.jsx("section",{id:"why-architecture",className:"py-16 border-b border-base-300 bg-base-200/30 -mx-4 px-4 md:-mx-5 md:px-5 scroll-mt-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(Pt,{children:"Built for security and efficiency"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Architecture"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"Every component exists for a specific reason. All communication stays on localhost."}),i.jsx("div",{className:"border border-base-300 bg-base-100 p-5 mb-8 overflow-x-auto",children:i.jsxs("svg",{viewBox:"0 0 700 260",className:"w-full text-base-content",style:{minWidth:560},children:[i.jsxs("defs",{children:[i.jsx("marker",{id:"why-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.3})}),i.jsx("marker",{id:"why-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:i.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.3})})]}),i.jsx("rect",{x:10,y:10,width:110,height:46,rx:0,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),i.jsx("text",{x:65,y:30,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI"}),i.jsx("text",{x:65,y:44,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"cg run ..."}),i.jsx("rect",{x:10,y:80,width:110,height:46,rx:0,fill:"rgba(56,189,248,0.08)",stroke:"rgba(56,189,248,0.4)",strokeWidth:1}),i.jsx("text",{x:65,y:100,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),i.jsx("text",{x:65,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"React SPA"}),i.jsx("rect",{x:160,y:80,width:120,height:46,rx:0,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.4)",strokeWidth:1}),i.jsx("text",{x:220,y:100,textAnchor:"middle",fill:"currentColor",fontSize:10,fontWeight:600,children:"App Server"}),i.jsx("text",{x:220,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:":9092"}),i.jsx("rect",{x:320,y:15,width:150,height:76,rx:0,fill:"rgba(251,191,36,0.08)",stroke:"rgba(251,191,36,0.5)",strokeWidth:1.5}),i.jsx("text",{x:395,y:40,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),i.jsx("text",{x:395,y:56,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),i.jsx("text",{x:395,y:78,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.25,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),i.jsx("rect",{x:520,y:20,width:130,height:55,rx:0,fill:"rgba(52,211,153,0.08)",stroke:"rgba(52,211,153,0.4)",strokeWidth:1}),i.jsx("text",{x:585,y:42,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),i.jsx("text",{x:585,y:58,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),i.jsx("rect",{x:530,y:160,width:120,height:46,rx:0,fill:"rgba(167,139,250,0.08)",stroke:"rgba(167,139,250,0.4)",strokeWidth:1}),i.jsx("text",{x:590,y:180,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),i.jsx("text",{x:590,y:194,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"target page"}),i.jsx("rect",{x:310,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:355,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"Audit Log"}),i.jsx("rect",{x:410,y:170,width:80,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:450,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"Config"}),i.jsx("rect",{x:160,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),i.jsx("text",{x:205,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"App DB"}),i.jsx("line",{x1:122,y1:33,x2:318,y2:45,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),i.jsx("text",{x:210,y:28,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"HTTP"}),i.jsx("line",{x1:122,y1:103,x2:158,y2:103,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),i.jsx("line",{x1:282,y1:96,x2:318,y2:72,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),i.jsx("text",{x:295,y:76,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"proxy"}),i.jsx("line",{x1:472,y1:48,x2:518,y2:48,stroke:"currentColor",strokeOpacity:.2,strokeWidth:1.5,markerEnd:"url(#why-ah)",markerStart:"url(#why-ah-rev)"}),i.jsx("text",{x:495,y:38,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),i.jsx("line",{x1:590,y1:77,x2:590,y2:158,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),i.jsx("line",{x1:370,y1:93,x2:365,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:430,y1:93,x2:445,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),i.jsx("line",{x1:210,y1:128,x2:210,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"})]})}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[{icon:to,title:"CLI",mono:"cg",desc:"Contact point for humans and AI agents. One command, structured JSON output."},{icon:Qu,title:"Daemon",mono:":9091",desc:"Validates auth and capabilities, loads connectors, writes audit log."},{icon:Xr,title:"Extension",mono:"MV3",desc:"Runs inside your authenticated Chrome. Accesses cookies and page data."},{icon:eo,title:"Connectors",mono:"YAML",desc:"Declarative pipelines: navigate → wait → extract → map. No code execution."},{icon:Yu,title:"Audit Log",mono:"SQLite",desc:"Every execution logged: connector, domains, timing, approvals."},{icon:kv,title:"GUI",mono:":9092",desc:"React SPA with app pages, connector browsing, and config management."}].map(({icon:e,title:t,mono:n,desc:s})=>i.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-baseline gap-1.5 mb-0.5",children:[i.jsx("span",{className:"font-display font-semibold text-sm",children:t}),i.jsx("span",{className:"font-mono text-[0.65rem] opacity-40",children:n})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]},t))}),i.jsxs($e,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Full architecture details ",i.jsx(Tn,{className:"w-3 h-3"})]})]})}),i.jsxs("section",{id:"why-apps",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(Pt,{children:"Ready-to-use tools"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Built-in Apps"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"commandGarden ships with connectors and dedicated app pages for common enterprise tasks. Each one runs entirely on your local machine using your browser session."}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[{icon:gm,title:"Time Tracking",tag:"Administrative",desc:"Monthly report with project breakdown and summary cards",route:"/apps/timetracking",cmd:"timetracking/report"},{icon:ov,title:"Room Availability",tag:"Administrative",desc:"Meeting room free/busy from Outlook Scheduling Assistant",route:"/apps/rooms",cmd:"teams/room-availability"},{icon:Yx,title:"Dev Journal",tag:"Productivity",desc:"Auto-generated daily journal from Git commits and Jira tickets",route:"/apps/journal",cmd:"ado/git-commits"},{icon:jv,title:"Security News",tag:"Security",desc:"Aggregated feed from Socket.dev, Wiz, and tl;dr sec",route:"/apps/security-news",cmd:"socket/security-news"},{icon:hv,title:"Trusted Peer Expiry",tag:"Productivity",desc:"TokenMaster client trust relationships with expiry tracking",route:"/apps/trusted-peer-expiry",cmd:"tokenmaster/clients-list"},{icon:yv,title:"GCS Knowledge Base",tag:"Security",desc:"Browse and read internal security docs, converted to Markdown",route:null,cmd:"gcs/kb-pages"}].map(({icon:e,title:t,tag:n,desc:s,route:r,cmd:a})=>i.jsxs("div",{className:"border border-base-300 p-4",children:[i.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"font-display font-semibold text-sm",children:t}),i.jsx(U,{size:"xs",children:n})]}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]}),i.jsxs("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-base-300/50",children:[i.jsxs("span",{className:"font-mono text-[0.65rem] opacity-30",children:["cg run ",a]}),r&&i.jsxs($e,{to:r,className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Open ",i.jsx(Tn,{className:"w-3 h-3"})]})]})]},t))}),i.jsx("p",{className:"text-xs opacity-40 mt-4 max-w-[65ch]",children:"Each app page combines multiple connector calls into a single view. The GUI handles orchestration, caching, and presentation; the connectors provide the raw data."})]}),i.jsxs("section",{id:"why-happy-path",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx(Pt,{children:"From install to first result"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"Typical workflow"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(to,{className:"w-4 h-4 opacity-40"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"Human user"})]}),i.jsx("div",{className:"space-y-3 mb-4",children:[{step:"Install",cmd:"npm install -g @commandgarden/cli"},{step:"Start",cmd:"cg up"},{step:"Load extension",cmd:"chrome://extensions → Load unpacked"},{step:"Verify",cmd:"cg daemon status"},{step:"Run",cmd:"cg run timetracking/report --month 2026-06"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-base-300 bg-base-200 flex items-center justify-center font-mono text-[0.6rem] opacity-50 shrink-0",children:t+1}),i.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),i.jsx("div",{className:"ml-[1.875rem] mt-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200 border border-base-300 px-2 py-0.5 opacity-70",children:e.cmd})}),t<4&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),i.jsxs("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:["Or open the GUI at ",i.jsx("span",{className:"font-mono",children:"localhost:9092"})," and use the visual interface."]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(Xr,{className:"w-4 h-4 opacity-40"}),i.jsx("h3",{className:"font-display font-semibold text-sm",children:"AI agent"})]}),i.jsx("div",{className:"space-y-3 mb-4",children:[{step:"Load skill",cmd:"cg skill loaded"},{step:"Check status",cmd:"cg daemon status → ready"},{step:"Discover",cmd:"cg list → available connectors"},{step:"Inspect",cmd:"cg inspect timetracking/report → args, columns"},{step:"Run",cmd:"cg run timetracking/report --format json"}].map((e,t)=>i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 border border-base-300 bg-base-200 flex items-center justify-center font-mono text-[0.6rem] opacity-50 shrink-0",children:t+1}),i.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),i.jsx("div",{className:"ml-[1.875rem] mt-1",children:i.jsx("code",{className:"text-xs font-mono bg-base-200 border border-base-300 px-2 py-0.5 opacity-70",children:e.cmd})}),t<4&&i.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),i.jsx("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:"Structured JSON back in seconds."})]})]}),i.jsxs("div",{className:"mt-8 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[i.jsx(tv,{className:"w-4 h-4 text-primary shrink-0"}),i.jsx("p",{className:"text-sm opacity-70",children:"Both paths produce identical output. Same connector, same schema, regardless of who calls it."})]})]}),i.jsx("section",{id:"why-security",className:"py-16 border-b border-base-300 bg-base-200/30 -mx-4 px-4 md:-mx-5 md:px-5 scroll-mt-4",children:i.jsxs("div",{className:"max-w-4xl mx-auto",children:[i.jsx(Pt,{children:"Security by design"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Security"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"commandGarden touches authenticated enterprise data, so the security model is strict by default."}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-8",children:[{icon:vv,title:"No credentials stored",desc:"Reuses session cookies already in Chrome. Nothing stored on disk, nothing sent externally."},{icon:Tv,title:"Domain-scoped permissions",desc:"Connectors declare allowed domains. Undeclared domains are blocked by the daemon."},{icon:cv,title:"Capability gating",desc:"Each step requires a declared capability. High-risk ops (js_evaluate, cookie_write) need approval."},{icon:fv,title:"Step-by-step approval",desc:"Sensitive operations pause for confirmation. Approve in CLI or via Chrome notification."},{icon:Qu,title:"Local-only processing",desc:"Daemon on :9091, app server on :9092. Bound to localhost. No network exposure."},{icon:eo,title:"Declarative connectors",desc:"Pure YAML pipelines. No JavaScript evaluation, no arbitrary code execution by default."},{icon:Sv,title:"Audit-or-fail",desc:"Every execution logged to SQLite. Domains, timing, approvals, row counts. If audit fails, commands are blocked."},{icon:Yu,title:"Per-session auth",desc:"Session token generated on startup with owner-only permissions. Extension verifies its own ID per message."}].map(({icon:e,title:t,desc:n})=>i.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[i.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold text-sm mb-0.5",children:t}),i.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:n})]})]},t))}),i.jsxs("div",{className:"border border-base-300 bg-base-100 p-5",children:[i.jsx("h3",{className:"font-mono text-xs font-medium opacity-50 uppercase tracking-wide mb-3",children:"Limitations"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5 text-sm opacity-70",children:[i.jsx("p",{children:"Only works while Chrome is open and you're logged in."}),i.jsx("p",{children:"Connectors may break when a site redesigns its HTML."}),i.jsx("p",{children:"Chrome-only for now (no Firefox or Edge support)."}),i.jsx("p",{children:"No credential storage, so sessions expire when you log out."}),i.jsx("p",{children:"Extraction runs one connector at a time per tab."})]})]})]})}),i.jsxs("section",{id:"why-get-started",className:"py-16 border-b border-base-300 scroll-mt-4",children:[i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Get started in 60 seconds"}),i.jsx(ei,{children:`# Install
|
|
356
|
+
npm install -g @commandgarden/cli
|
|
357
|
+
|
|
358
|
+
# Start the daemon and GUI
|
|
359
|
+
cg up
|
|
360
|
+
|
|
361
|
+
# Load the Chrome extension
|
|
362
|
+
# Chrome → chrome://extensions → Developer mode → Load unpacked
|
|
363
|
+
|
|
364
|
+
# Run your first connector
|
|
365
|
+
cg run socket/security-news --format table`}),i.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[i.jsxs($e,{to:"/guide",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Setup Guide ",i.jsx(Tn,{className:"w-3 h-3"})]}),i.jsxs($e,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Architecture ",i.jsx(Tn,{className:"w-3 h-3"})]}),i.jsxs($e,{to:"/api-reference",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["API & CLI Reference ",i.jsx(Tn,{className:"w-3 h-3"})]}),i.jsxs($e,{to:"/skills",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Skills ",i.jsx(Tn,{className:"w-3 h-3"})]})]})]}),i.jsxs("section",{id:"why-extend",className:"pt-16 scroll-mt-4",children:[i.jsx(Pt,{children:"Extend to any website"}),i.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Write your own connector"}),i.jsx("p",{className:"text-sm opacity-70 max-w-[65ch] leading-relaxed mb-8",children:"commandGarden ships with built-in connectors, but you can write your own for any site. If you can see it in Chrome, you can turn it into a CLI command."}),i.jsx("div",{className:"space-y-3 mb-8",children:[["Create a YAML file","~/.commandgarden/connectors/"],["Declare the domain, capabilities, arguments, and columns",null],["Define a pipeline","navigate → wait → extract/fetch → map"],["Validate","cg validate my-connector.yaml"],["Run","cg run mysite/my-command --format json"]].map(([e,t],n)=>i.jsxs("div",{className:"flex gap-3 items-baseline",children:[i.jsxs("span",{className:"font-mono text-xs opacity-30 w-4 text-right shrink-0",children:[n+1,"."]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-sm font-medium",children:e}),t&&i.jsx("span",{className:"font-mono text-xs opacity-40 ml-2",children:t})]})]},n))}),i.jsx(ei,{children:`site: mysite
|
|
366
|
+
name: my-command
|
|
367
|
+
version: "1.0"
|
|
368
|
+
description: "Fetch search results"
|
|
369
|
+
access: read
|
|
370
|
+
|
|
371
|
+
domains:
|
|
372
|
+
- "mysite.example.com"
|
|
373
|
+
capabilities:
|
|
374
|
+
- navigate
|
|
375
|
+
- dom_read
|
|
376
|
+
|
|
377
|
+
args:
|
|
378
|
+
- name: query
|
|
379
|
+
type: string
|
|
380
|
+
required: true
|
|
381
|
+
|
|
382
|
+
columns:
|
|
383
|
+
- name: title
|
|
384
|
+
type: string
|
|
385
|
+
- name: url
|
|
386
|
+
type: string
|
|
387
|
+
|
|
388
|
+
pipeline:
|
|
389
|
+
- step: navigate
|
|
390
|
+
url: "https://mysite.example.com/search?q=\${{ args.query }}"
|
|
391
|
+
- step: wait
|
|
392
|
+
selector: ".results"
|
|
393
|
+
- step: extract
|
|
394
|
+
selector: ".results .item"
|
|
395
|
+
fields:
|
|
396
|
+
title: "h3"
|
|
397
|
+
url: "a@href"`}),i.jsx("p",{className:"text-xs opacity-40 mt-4 max-w-[65ch]",children:"No JavaScript required for most connectors. The declarative YAML format covers DOM extraction, cookie-authenticated API calls, network interception, and data transformation."})]})]})}function Rs({isActive:e}){return`block px-3 py-2 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}function $s({isActive:e}){return`block pl-5 pr-3 py-1.5 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}const ti={"/config":[{label:"Server",id:"cfg-server"},{label:"Security",id:"cfg-security"},{label:"Sources",id:"cfg-sources"},{label:"Audit",id:"cfg-audit"},{label:"Output",id:"cfg-output"},{label:"Journal",id:"cfg-journal"}],"/architecture":[{label:"Diagram",id:"arch-diagram"},{label:"Components",id:"arch-components"},{label:"Data Stores",id:"arch-stores"},{label:"Data Flows",id:"arch-flows"},{label:"Security",id:"arch-security"},{label:"Packages",id:"arch-packages"},{label:"Build Order",id:"arch-build"}],"/api-reference":[{label:"Endpoints",id:"api-endpoints"},{label:"Pipeline Steps",id:"api-pipeline"},{label:"Expressions",id:"api-expressions"}],"/why":[{label:"The Problem",id:"why-problem"},{label:"The Solution",id:"why-solution"},{label:"Architecture",id:"why-architecture"},{label:"Built-in Apps",id:"why-apps"},{label:"Workflow",id:"why-happy-path"},{label:"Security",id:"why-security"},{label:"Get Started",id:"why-get-started"},{label:"Extend",id:"why-extend"}]};function Y1({sections:e}){const t=b.useMemo(()=>e.map(r=>r.id),[e]),n=n0(t),s=r=>{const a=document.getElementById(r);a&&a.scrollIntoView({behavior:"smooth",block:"start"})};return i.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:e.map(r=>i.jsx("button",{onClick:()=>s(r.id),className:`block w-full text-left pl-3 py-1 text-[0.7rem] transition-colors ${n===r.id?"text-primary opacity-100":"opacity-50 hover:opacity-70"}`,children:r.label},r.id))})}const Q1=[{label:"Daily",to:"/apps/journal/daily"},{label:"Weekly",to:"/apps/journal/weekly"}];function J1({to:e,label:t,items:n}){const r=It().pathname.startsWith(e);return i.jsxs(i.Fragment,{children:[i.jsx(st,{to:e,className:$s,children:t}),r&&n.length>0&&i.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:n.map(a=>i.jsx(st,{to:a.to,className:({isActive:o})=>`block w-full text-left pl-3 py-1 text-[0.7rem] transition-colors ${o?"text-primary opacity-100":"opacity-50 hover:opacity-70"}`,children:a.label},a.to))})]})}function As({to:e,label:t,sections:n}){const r=It().pathname===e;return i.jsxs(i.Fragment,{children:[i.jsx(st,{to:e,end:e==="/",className:Rs,children:t}),r&&n.length>0&&i.jsx(Y1,{sections:n})]})}function X1(){const[e,t]=b.useState(!1),[n,s]=b.useState(!1),[r,a]=b.useState(!1),[o,l]=b.useState([]),c=It();b.useEffect(()=>{a(!1)},[c.pathname]),b.useEffect(()=>{const p=()=>{z.getStatus().then(f=>{t(f.ok),s(f.extensionConnected)}).catch(()=>{t(!1),s(!1)})};p();const d=setInterval(p,3e4);return()=>clearInterval(d)},[]),b.useEffect(()=>{z.getConnectors().then(p=>{const d=da(p.connectors).map(([f])=>f);l(d)}).catch(()=>{})},[]);const u=b.useMemo(()=>o.map(p=>({label:p,id:`conn-${p}`})),[o]);return i.jsxs("div",{className:"flex min-h-screen",children:[i.jsx("button",{className:"fixed top-3 left-3 z-50 md:hidden btn btn-sm btn-ghost",onClick:()=>a(!r),"aria-label":r?"Close menu":"Open menu",children:i.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r?i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),r&&i.jsx("div",{className:"fixed inset-0 bg-black/30 z-30 md:hidden",onClick:()=>a(!1)}),i.jsxs("aside",{className:`w-56 bg-base-100 border-r border-base-300 flex flex-col fixed top-0 left-0 bottom-0 z-40 transition-transform duration-150 ease-out ${r?"translate-x-0":"-translate-x-full"} md:translate-x-0`,children:[i.jsxs("div",{className:"flex items-start justify-between px-3 py-3 border-b border-base-300",children:[i.jsxs($e,{to:"/",className:"hover:opacity-80 transition-opacity",children:[i.jsxs("h1",{className:"font-display text-lg font-bold tracking-tight",children:[i.jsx("span",{className:"font-normal opacity-50",children:"command"}),"Garden"]}),i.jsx("p",{className:"font-mono text-[0.65rem] opacity-30 mt-1 uppercase tracking-[0.14em]",children:"browser automation"})]}),i.jsx("button",{className:"btn btn-ghost btn-sm btn-square",onClick:()=>{const p=document.documentElement.getAttribute("data-theme")==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",p),localStorage.setItem("theme",p)},"aria-label":"Toggle theme",children:i.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:i.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})})})]}),i.jsxs("nav",{className:"flex-1 px-2 py-2 space-y-px overflow-y-auto",children:[i.jsx("div",{className:"px-3 pt-3 pb-1.5 font-mono text-[0.6rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Overview"}),i.jsx(st,{to:"/",end:!0,className:Rs,children:"Dashboard"}),i.jsx(st,{to:"/guide",className:Rs,children:"Setup Guide"}),i.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Apps"}),i.jsx("div",{className:"pl-5 pr-3 pt-2 pb-1 font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Administrative"}),i.jsx(st,{to:"/apps/timetracking",className:$s,children:"Time Tracking"}),i.jsx(st,{to:"/apps/rooms",className:$s,children:"Room Availability"}),i.jsx("div",{className:"pl-5 pr-3 pt-2 pb-1 font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Productivity"}),i.jsx(J1,{to:"/apps/journal",label:"Dev Journal",items:Q1}),i.jsx(st,{to:"/apps/trusted-peer-expiry",className:$s,children:"Trusted Peer Expiry"}),i.jsx("div",{className:"pl-5 pr-3 pt-2 pb-1 font-mono text-[0.65rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Security"}),i.jsx(st,{to:"/apps/security-news",className:$s,children:"Security News"}),i.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Platform"}),i.jsx(As,{to:"/connectors",label:"Connectors",sections:u}),i.jsx(st,{to:"/audit",className:Rs,children:"Audit Log"}),i.jsx(As,{to:"/config",label:"Configuration",sections:ti["/config"]}),i.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-50 uppercase tracking-[0.12em]",children:"Reference"}),i.jsx(As,{to:"/why",label:"Why commandGarden",sections:ti["/why"]}),i.jsx(As,{to:"/architecture",label:"Architecture",sections:ti["/architecture"]}),i.jsx(As,{to:"/api-reference",label:"API & CLI",sections:ti["/api-reference"]}),i.jsx(st,{to:"/skills",className:Rs,children:"Skills"})]}),i.jsxs("div",{className:"px-3 py-2.5 border-t border-base-300",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${e?"bg-success":"bg-error"}`,"aria-hidden":"true"}),i.jsx("span",{className:"opacity-50 text-[0.65rem]",children:e?"DAEMON OK":"DAEMON OFF"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono mt-1",children:[i.jsx("span",{className:`w-1.5 h-1.5 ${n?"bg-success":"bg-error"}`,"aria-hidden":"true"}),i.jsx("span",{className:"opacity-50 text-[0.65rem]",children:n?"EXTENSION LINKED":"EXTENSION OFF"})]})]})]}),i.jsx("main",{className:"flex-1 p-4 pt-14 md:pt-5 md:p-5 md:ml-56",children:i.jsx(Fy,{})})]})}function Z1(){return i.jsx(Qy,{children:i.jsx(Uy,{children:i.jsxs(fe,{element:i.jsx(X1,{}),children:[i.jsx(fe,{index:!0,element:i.jsx(i0,{})}),i.jsx(fe,{path:"connectors",element:i.jsx(l0,{})}),i.jsx(fe,{path:"connectors/:site/:name",element:i.jsx(c0,{})}),i.jsx(fe,{path:"audit",element:i.jsx(f0,{})}),i.jsx(fe,{path:"config",element:i.jsx(Ex,{})}),i.jsx(fe,{path:"guide",element:i.jsx(Dx,{})}),i.jsx(fe,{path:"apps/timetracking",element:i.jsx(Wv,{})}),i.jsx(fe,{path:"apps/rooms",element:i.jsx(Xv,{})}),i.jsx(fe,{path:"apps/journal",element:i.jsx(zy,{to:"/apps/journal/daily",replace:!0})}),i.jsx(fe,{path:"apps/journal/daily",element:i.jsx(h1,{})}),i.jsx(fe,{path:"apps/journal/weekly",element:i.jsx(a1,{})}),i.jsx(fe,{path:"apps/security-news",element:i.jsx(N1,{})}),i.jsx(fe,{path:"apps/trusted-peer-expiry",element:i.jsx(L1,{})}),i.jsx(fe,{path:"architecture",element:i.jsx(R1,{})}),i.jsx(fe,{path:"api-reference",element:i.jsx(W1,{})}),i.jsx(fe,{path:"skills",element:i.jsx(G1,{})}),i.jsx(fe,{path:"why",element:i.jsx(q1,{})})]})})})}gp(document.getElementById("root")).render(i.jsx(b.StrictMode,{children:i.jsx(Z1,{})}));
|