@commandgarden/cli 2.1.0 → 2.3.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.
@@ -0,0 +1,397 @@
1
+ function yh(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 i=Object.getOwnPropertyDescriptor(s,r);i&&Object.defineProperty(e,r,i.get?i:{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 i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();function xh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var td={exports:{}},Vi={},nd={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 gr=Symbol.for("react.element"),vh=Symbol.for("react.portal"),bh=Symbol.for("react.fragment"),wh=Symbol.for("react.strict_mode"),jh=Symbol.for("react.profiler"),kh=Symbol.for("react.provider"),Nh=Symbol.for("react.context"),Sh=Symbol.for("react.forward_ref"),Ch=Symbol.for("react.suspense"),Eh=Symbol.for("react.memo"),Th=Symbol.for("react.lazy"),gc=Symbol.iterator;function Lh(e){return e===null||typeof e!="object"?null:(e=gc&&e[gc]||e["@@iterator"],typeof e=="function"?e:null)}var sd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},rd=Object.assign,id={};function ls(e,t,n){this.props=e,this.context=t,this.refs=id,this.updater=n||sd}ls.prototype.isReactComponent={};ls.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")};ls.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function od(){}od.prototype=ls.prototype;function il(e,t,n){this.props=e,this.context=t,this.refs=id,this.updater=n||sd}var ol=il.prototype=new od;ol.constructor=il;rd(ol,ls.prototype);ol.isPureReactComponent=!0;var yc=Array.isArray,ad=Object.prototype.hasOwnProperty,al={current:null},ld={key:!0,ref:!0,__self:!0,__source:!0};function cd(e,t,n){var s,r={},i=null,a=null;if(t!=null)for(s in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)ad.call(t,s)&&!ld.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:gr,type:e,key:i,ref:a,props:r,_owner:al.current}}function Ah(e,t){return{$$typeof:gr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ll(e){return typeof e=="object"&&e!==null&&e.$$typeof===gr}function Ih(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var xc=/\/+/g;function bo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ih(""+e.key):t.toString(36)}function ti(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case gr:case vh:a=!0}}if(a)return a=e,r=r(a),e=s===""?"."+bo(a,0):s,yc(r)?(n="",e!=null&&(n=e.replace(xc,"$&/")+"/"),ti(r,t,n,"",function(u){return u})):r!=null&&(ll(r)&&(r=Ah(r,n+(!r.key||a&&a.key===r.key?"":(""+r.key).replace(xc,"$&/")+"/")+e)),t.push(r)),1;if(a=0,s=s===""?".":s+":",yc(e))for(var l=0;l<e.length;l++){i=e[l];var c=s+bo(i,l);a+=ti(i,t,n,c,r)}else if(c=Lh(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=s+bo(i,l++),a+=ti(i,t,n,c,r);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Lr(e,t,n){if(e==null)return e;var s=[],r=0;return ti(e,s,"","",function(i){return t.call(n,i,r++)}),s}function Ph(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},ni={transition:null},Oh={ReactCurrentDispatcher:Te,ReactCurrentBatchConfig:ni,ReactCurrentOwner:al};function ud(){throw Error("act(...) is not supported in production builds of React.")}W.Children={map:Lr,forEach:function(e,t,n){Lr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Lr(e,function(){t++}),t},toArray:function(e){return Lr(e,function(t){return t})||[]},only:function(e){if(!ll(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};W.Component=ls;W.Fragment=bh;W.Profiler=jh;W.PureComponent=il;W.StrictMode=wh;W.Suspense=Ch;W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Oh;W.act=ud;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=rd({},e.props),r=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=al.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)ad.call(t,c)&&!ld.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:gr,type:e.type,key:r,ref:i,props:s,_owner:a}};W.createContext=function(e){return e={$$typeof:Nh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:kh,_context:e},e.Consumer=e};W.createElement=cd;W.createFactory=function(e){var t=cd.bind(null,e);return t.type=e,t};W.createRef=function(){return{current:null}};W.forwardRef=function(e){return{$$typeof:Sh,render:e}};W.isValidElement=ll;W.lazy=function(e){return{$$typeof:Th,_payload:{_status:-1,_result:e},_init:Ph}};W.memo=function(e,t){return{$$typeof:Eh,type:e,compare:t===void 0?null:t}};W.startTransition=function(e){var t=ni.transition;ni.transition={};try{e()}finally{ni.transition=t}};W.unstable_act=ud;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";nd.exports=W;var v=nd.exports;const _h=xh(v),Mh=yh({__proto__:null,default:_h},[v]);/**
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 Dh=v,Rh=Symbol.for("react.element"),$h=Symbol.for("react.fragment"),zh=Object.prototype.hasOwnProperty,Fh=Dh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Bh={key:!0,ref:!0,__self:!0,__source:!0};function dd(e,t,n){var s,r={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(s in t)zh.call(t,s)&&!Bh.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:Rh,type:e,key:i,ref:a,props:r,_owner:Fh.current}}Vi.Fragment=$h;Vi.jsx=dd;Vi.jsxs=dd;td.exports=Vi;var o=td.exports,fd={exports:{}},Ue={},pd={exports:{}},hd={};/**
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,O){var D=L.length;L.push(O);e:for(;0<D;){var $=D-1>>>1,Q=L[$];if(0<r(Q,O))L[$]=O,L[D]=Q,D=$;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var O=L[0],D=L.pop();if(D!==O){L[0]=D;e:for(var $=0,Q=L.length,De=Q>>>1;$<De;){var Ze=2*($+1)-1,xs=L[Ze],nn=Ze+1,Tr=L[nn];if(0>r(xs,D))nn<Q&&0>r(Tr,xs)?(L[$]=Tr,L[nn]=D,$=nn):(L[$]=xs,L[Ze]=D,$=Ze);else if(nn<Q&&0>r(Tr,D))L[$]=Tr,L[nn]=D,$=nn;else break e}}return O}function r(L,O){var D=L.sortIndex-O.sortIndex;return D!==0?D:L.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],p=1,d=null,f=3,x=!1,b=!1,y=!1,j=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(L){for(var O=n(u);O!==null;){if(O.callback===null)s(u);else if(O.startTime<=L)s(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(u)}}function w(L){if(y=!1,h(L),!b)if(n(c)!==null)b=!0,P(k);else{var O=n(u);O!==null&&R(w,O.startTime-L)}}function k(L,O){b=!1,y&&(y=!1,g(N),N=-1),x=!0;var D=f;try{for(h(O),d=n(c);d!==null&&(!(d.expirationTime>O)||L&&!z());){var $=d.callback;if(typeof $=="function"){d.callback=null,f=d.priorityLevel;var Q=$(d.expirationTime<=O);O=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(c)&&s(c),h(O)}else s(c);d=n(c)}if(d!==null)var De=!0;else{var Ze=n(u);Ze!==null&&R(w,Ze.startTime-O),De=!1}return De}finally{d=null,f=D,x=!1}}var C=!1,S=null,N=-1,T=5,A=-1;function z(){return!(e.unstable_now()-A<T)}function G(){if(S!==null){var L=e.unstable_now();A=L;var O=!0;try{O=S(!0,L)}finally{O?V():(C=!1,S=null)}}else C=!1}var V;if(typeof m=="function")V=function(){m(G)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,M=E.port2;E.port1.onmessage=G,V=function(){M.postMessage(null)}}else V=function(){j(G,0)};function P(L){S=L,C||(C=!0,V())}function R(L,O){N=j(function(){L(e.unstable_now())},O)}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(){b||x||(b=!0,P(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 O=3;break;default:O=f}var D=f;f=O;try{return L()}finally{f=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,O){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var D=f;f=L;try{return O()}finally{f=D}},e.unstable_scheduleCallback=function(L,O,D){var $=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?$+D:$):D=$,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=D+Q,L={id:p++,callback:O,priorityLevel:L,startTime:D,expirationTime:Q,sortIndex:-1},D>$?(L.sortIndex=D,t(u,L),n(c)===null&&L===n(u)&&(y?(g(N),N=-1):y=!0,R(w,D-$))):(L.sortIndex=Q,t(c,L),b||x||(b=!0,P(k))),L},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(L){var O=f;return function(){var D=f;f=O;try{return L.apply(this,arguments)}finally{f=D}}}})(hd);pd.exports=hd;var Uh=pd.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 Wh=v,Be=Uh;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 md=new Set,qs={};function bn(e,t){Xn(e,t),Xn(e+"Capture",t)}function Xn(e,t){for(qs[e]=t,e=0;e<t.length;e++)md.add(t[e])}var Nt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sa=Object.prototype.hasOwnProperty,Hh=/^[: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]*$/,vc={},bc={};function Vh(e){return sa.call(bc,e)?!0:sa.call(vc,e)?!1:Hh.test(e)?bc[e]=!0:(vc[e]=!0,!1)}function Kh(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 Gh(e,t,n,s){if(t===null||typeof t>"u"||Kh(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,i,a){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=i,this.removeEmptyString=a}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 cl=/[\-:]([a-z])/g;function ul(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(cl,ul);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(cl,ul);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(cl,ul);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 dl(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")&&(Gh(t,n,r,s)&&(n=null),s||r===null?Vh(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 Tt=Wh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ar=Symbol.for("react.element"),Ln=Symbol.for("react.portal"),An=Symbol.for("react.fragment"),fl=Symbol.for("react.strict_mode"),ra=Symbol.for("react.profiler"),gd=Symbol.for("react.provider"),yd=Symbol.for("react.context"),pl=Symbol.for("react.forward_ref"),ia=Symbol.for("react.suspense"),oa=Symbol.for("react.suspense_list"),hl=Symbol.for("react.memo"),Pt=Symbol.for("react.lazy"),xd=Symbol.for("react.offscreen"),wc=Symbol.iterator;function vs(e){return e===null||typeof e!="object"?null:(e=wc&&e[wc]||e["@@iterator"],typeof e=="function"?e:null)}var re=Object.assign,wo;function As(e){if(wo===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);wo=t&&t[1]||""}return`
34
+ `+wo+e}var jo=!1;function ko(e,t){if(!e||jo)return"";jo=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var 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
+ `),i=s.stack.split(`
36
+ `),a=r.length-1,l=i.length-1;1<=a&&0<=l&&r[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(r[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||r[a]!==i[l]){var c=`
37
+ `+r[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{jo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?As(e):""}function qh(e){switch(e.tag){case 5:return As(e.type);case 16:return As("Lazy");case 13:return As("Suspense");case 19:return As("SuspenseList");case 0:case 2:case 15:return e=ko(e.type,!1),e;case 11:return e=ko(e.type.render,!1),e;case 1:return e=ko(e.type,!0),e;default:return""}}function aa(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 An:return"Fragment";case Ln:return"Portal";case ra:return"Profiler";case fl:return"StrictMode";case ia:return"Suspense";case oa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yd:return(e.displayName||"Context")+".Consumer";case gd:return(e._context.displayName||"Context")+".Provider";case pl: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:aa(e.type)||"Memo";case Pt:t=e._payload,e=e._init;try{return aa(e(t))}catch{}}return null}function Yh(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 aa(t);case 8:return t===fl?"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 Qt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Qh(e){var t=vd(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,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(a){s=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(a){s=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ir(e){e._valueTracker||(e._valueTracker=Qh(e))}function bd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=vd(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function gi(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 la(e,t){var n=t.checked;return re({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Qt(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 wd(e,t){t=t.checked,t!=null&&dl(e,"checked",t,!1)}function ca(e,t){wd(e,t);var n=Qt(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")?ua(e,t.type,n):t.hasOwnProperty("defaultValue")&&ua(e,t.type,Qt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function kc(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 ua(e,t,n){(t!=="number"||gi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Is=Array.isArray;function Hn(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=""+Qt(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 da(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return re({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Nc(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(Is(n)){if(1<n.length)throw Error(I(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Qt(n)}}function jd(e,t){var n=Qt(t.value),s=Qt(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 Sc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function kd(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 fa(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?kd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pr,Nd=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 Ys(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rs={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},Jh=["Webkit","ms","Moz","O"];Object.keys(Rs).forEach(function(e){Jh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Rs[t]=Rs[e]})});function Sd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Rs.hasOwnProperty(e)&&Rs[e]?(""+t).trim():t+"px"}function Cd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Sd(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var Xh=re({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 pa(e,t){if(t){if(Xh[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 ha(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 ma=null;function ml(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ga=null,Vn=null,Kn=null;function Cc(e){if(e=vr(e)){if(typeof ga!="function")throw Error(I(280));var t=e.stateNode;t&&(t=Qi(t),ga(e.stateNode,e.type,t))}}function Ed(e){Vn?Kn?Kn.push(e):Kn=[e]:Vn=e}function Td(){if(Vn){var e=Vn,t=Kn;if(Kn=Vn=null,Cc(e),t)for(e=0;e<t.length;e++)Cc(t[e])}}function Ld(e,t){return e(t)}function Ad(){}var No=!1;function Id(e,t,n){if(No)return e(t,n);No=!0;try{return Ld(e,t,n)}finally{No=!1,(Vn!==null||Kn!==null)&&(Ad(),Td())}}function Qs(e,t){var n=e.stateNode;if(n===null)return null;var s=Qi(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 ya=!1;if(Nt)try{var bs={};Object.defineProperty(bs,"passive",{get:function(){ya=!0}}),window.addEventListener("test",bs,bs),window.removeEventListener("test",bs,bs)}catch{ya=!1}function Zh(e,t,n,s,r,i,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var $s=!1,yi=null,xi=!1,xa=null,em={onError:function(e){$s=!0,yi=e}};function tm(e,t,n,s,r,i,a,l,c){$s=!1,yi=null,Zh.apply(em,arguments)}function nm(e,t,n,s,r,i,a,l,c){if(tm.apply(this,arguments),$s){if($s){var u=yi;$s=!1,yi=null}else throw Error(I(198));xi||(xi=!0,xa=u)}}function wn(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 Pd(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 Ec(e){if(wn(e)!==e)throw Error(I(188))}function sm(e){var t=e.alternate;if(!t){if(t=wn(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 i=r.alternate;if(i===null){if(s=r.return,s!==null){n=s;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return Ec(r),e;if(i===s)return Ec(r),t;i=i.sibling}throw Error(I(188))}if(n.return!==s.return)n=r,s=i;else{for(var a=!1,l=r.child;l;){if(l===n){a=!0,n=r,s=i;break}if(l===s){a=!0,s=r,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,s=r;break}if(l===s){a=!0,s=i,n=r;break}l=l.sibling}if(!a)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 Od(e){return e=sm(e),e!==null?_d(e):null}function _d(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_d(e);if(t!==null)return t;e=e.sibling}return null}var Md=Be.unstable_scheduleCallback,Tc=Be.unstable_cancelCallback,rm=Be.unstable_shouldYield,im=Be.unstable_requestPaint,ae=Be.unstable_now,om=Be.unstable_getCurrentPriorityLevel,gl=Be.unstable_ImmediatePriority,Dd=Be.unstable_UserBlockingPriority,vi=Be.unstable_NormalPriority,am=Be.unstable_LowPriority,Rd=Be.unstable_IdlePriority,Ki=null,pt=null;function lm(e){if(pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Ki,e,void 0,(e.current.flags&128)===128)}catch{}}var it=Math.clz32?Math.clz32:dm,cm=Math.log,um=Math.LN2;function dm(e){return e>>>=0,e===0?32:31-(cm(e)/um|0)|0}var Or=64,_r=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 bi(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~r;l!==0?s=Ps(l):(i&=a,i!==0&&(s=Ps(i)))}else a=n&~r,a!==0?s=Ps(a):i!==0&&(s=Ps(i));if(s===0)return 0;if(t!==0&&t!==s&&!(t&r)&&(r=s&-s,i=t&-t,r>=i||r===16&&(i&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-it(t),r=1<<n,s|=e[n],t&=~r;return s}function fm(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 pm(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-it(i),l=1<<a,c=r[a];c===-1?(!(l&n)||l&s)&&(r[a]=fm(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function va(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $d(){var e=Or;return Or<<=1,!(Or&4194240)&&(Or=64),e}function So(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-it(t),e[t]=n}function hm(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-it(n),i=1<<r;t[r]=0,s[r]=-1,e[r]=-1,n&=~i}}function yl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-it(n),r=1<<s;r&t|e[s]&t&&(e[s]|=t),n&=~r}}var K=0;function zd(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Fd,xl,Bd,Ud,Wd,ba=!1,Mr=[],Ft=null,Bt=null,Ut=null,Js=new Map,Xs=new Map,Mt=[],mm="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 Lc(e,t){switch(e){case"focusin":case"focusout":Ft=null;break;case"dragenter":case"dragleave":Bt=null;break;case"mouseover":case"mouseout":Ut=null;break;case"pointerover":case"pointerout":Js.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xs.delete(t.pointerId)}}function ws(e,t,n,s,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:i,targetContainers:[r]},t!==null&&(t=vr(t),t!==null&&xl(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function gm(e,t,n,s,r){switch(t){case"focusin":return Ft=ws(Ft,e,t,n,s,r),!0;case"dragenter":return Bt=ws(Bt,e,t,n,s,r),!0;case"mouseover":return Ut=ws(Ut,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return Js.set(i,ws(Js.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,Xs.set(i,ws(Xs.get(i)||null,e,t,n,s,r)),!0}return!1}function Hd(e){var t=an(e.target);if(t!==null){var n=wn(t);if(n!==null){if(t=n.tag,t===13){if(t=Pd(n),t!==null){e.blockedOn=t,Wd(e.priority,function(){Bd(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 si(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=wa(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);ma=s,n.target.dispatchEvent(s),ma=null}else return t=vr(n),t!==null&&xl(t),e.blockedOn=n,!1;t.shift()}return!0}function Ac(e,t,n){si(e)&&n.delete(t)}function ym(){ba=!1,Ft!==null&&si(Ft)&&(Ft=null),Bt!==null&&si(Bt)&&(Bt=null),Ut!==null&&si(Ut)&&(Ut=null),Js.forEach(Ac),Xs.forEach(Ac)}function js(e,t){e.blockedOn===t&&(e.blockedOn=null,ba||(ba=!0,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,ym)))}function Zs(e){function t(r){return js(r,e)}if(0<Mr.length){js(Mr[0],e);for(var n=1;n<Mr.length;n++){var s=Mr[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Ft!==null&&js(Ft,e),Bt!==null&&js(Bt,e),Ut!==null&&js(Ut,e),Js.forEach(t),Xs.forEach(t),n=0;n<Mt.length;n++)s=Mt[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Mt.length&&(n=Mt[0],n.blockedOn===null);)Hd(n),n.blockedOn===null&&Mt.shift()}var Gn=Tt.ReactCurrentBatchConfig,wi=!0;function xm(e,t,n,s){var r=K,i=Gn.transition;Gn.transition=null;try{K=1,vl(e,t,n,s)}finally{K=r,Gn.transition=i}}function vm(e,t,n,s){var r=K,i=Gn.transition;Gn.transition=null;try{K=4,vl(e,t,n,s)}finally{K=r,Gn.transition=i}}function vl(e,t,n,s){if(wi){var r=wa(e,t,n,s);if(r===null)Mo(e,t,s,ji,n),Lc(e,s);else if(gm(r,e,t,n,s))s.stopPropagation();else if(Lc(e,s),t&4&&-1<mm.indexOf(e)){for(;r!==null;){var i=vr(r);if(i!==null&&Fd(i),i=wa(e,t,n,s),i===null&&Mo(e,t,s,ji,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else Mo(e,t,s,null,n)}}var ji=null;function wa(e,t,n,s){if(ji=null,e=ml(s),e=an(e),e!==null)if(t=wn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Pd(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 ji=e,null}function Vd(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(om()){case gl:return 1;case Dd:return 4;case vi:case am:return 16;case Rd:return 536870912;default:return 16}default:return 16}}var Rt=null,bl=null,ri=null;function Kd(){if(ri)return ri;var e,t=bl,n=t.length,s,r="value"in Rt?Rt.value:Rt.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var a=n-e;for(s=1;s<=a&&t[n-s]===r[i-s];s++);return ri=r.slice(e,1<s?1-s:void 0)}function ii(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 Dr(){return!0}function Ic(){return!1}function We(e){function t(n,s,r,i,a){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Dr:Ic,this.isPropagationStopped=Ic,this}return re(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=Dr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Dr)},persist:function(){},isPersistent:Dr}),t}var cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wl=We(cs),xr=re({},cs,{view:0,detail:0}),bm=We(xr),Co,Eo,ks,Gi=re({},xr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jl,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!==ks&&(ks&&e.type==="mousemove"?(Co=e.screenX-ks.screenX,Eo=e.screenY-ks.screenY):Eo=Co=0,ks=e),Co)},movementY:function(e){return"movementY"in e?e.movementY:Eo}}),Pc=We(Gi),wm=re({},Gi,{dataTransfer:0}),jm=We(wm),km=re({},xr,{relatedTarget:0}),To=We(km),Nm=re({},cs,{animationName:0,elapsedTime:0,pseudoElement:0}),Sm=We(Nm),Cm=re({},cs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Em=We(Cm),Tm=re({},cs,{data:0}),Oc=We(Tm),Lm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Am={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"},Im={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Im[e])?!!t[e]:!1}function jl(){return Pm}var Om=re({},xr,{key:function(e){if(e.key){var t=Lm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ii(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Am[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jl,charCode:function(e){return e.type==="keypress"?ii(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ii(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_m=We(Om),Mm=re({},Gi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_c=We(Mm),Dm=re({},xr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jl}),Rm=We(Dm),$m=re({},cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),zm=We($m),Fm=re({},Gi,{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}),Bm=We(Fm),Um=[9,13,27,32],kl=Nt&&"CompositionEvent"in window,zs=null;Nt&&"documentMode"in document&&(zs=document.documentMode);var Wm=Nt&&"TextEvent"in window&&!zs,Gd=Nt&&(!kl||zs&&8<zs&&11>=zs),Mc=" ",Dc=!1;function qd(e,t){switch(e){case"keyup":return Um.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var In=!1;function Hm(e,t){switch(e){case"compositionend":return Yd(t);case"keypress":return t.which!==32?null:(Dc=!0,Mc);case"textInput":return e=t.data,e===Mc&&Dc?null:e;default:return null}}function Vm(e,t){if(In)return e==="compositionend"||!kl&&qd(e,t)?(e=Kd(),ri=bl=Rt=null,In=!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 Gd&&t.locale!=="ko"?null:t.data;default:return null}}var Km={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 Rc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Km[e.type]:t==="textarea"}function Qd(e,t,n,s){Ed(s),t=ki(t,"onChange"),0<t.length&&(n=new wl("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Fs=null,er=null;function Gm(e){lf(e,0)}function qi(e){var t=_n(e);if(bd(t))return e}function qm(e,t){if(e==="change")return t}var Jd=!1;if(Nt){var Lo;if(Nt){var Ao="oninput"in document;if(!Ao){var $c=document.createElement("div");$c.setAttribute("oninput","return;"),Ao=typeof $c.oninput=="function"}Lo=Ao}else Lo=!1;Jd=Lo&&(!document.documentMode||9<document.documentMode)}function zc(){Fs&&(Fs.detachEvent("onpropertychange",Xd),er=Fs=null)}function Xd(e){if(e.propertyName==="value"&&qi(er)){var t=[];Qd(t,er,e,ml(e)),Id(Gm,t)}}function Ym(e,t,n){e==="focusin"?(zc(),Fs=t,er=n,Fs.attachEvent("onpropertychange",Xd)):e==="focusout"&&zc()}function Qm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(er)}function Jm(e,t){if(e==="click")return qi(t)}function Xm(e,t){if(e==="input"||e==="change")return qi(t)}function Zm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var at=typeof Object.is=="function"?Object.is:Zm;function tr(e,t){if(at(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(!sa.call(t,r)||!at(e[r],t[r]))return!1}return!0}function Fc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bc(e,t){var n=Fc(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=Fc(n)}}function Zd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ef(){for(var e=window,t=gi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gi(e.document)}return t}function Nl(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 eg(e){var t=ef(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Zd(n.ownerDocument.documentElement,n)){if(s!==null&&Nl(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,i=Math.min(s.start,r);s=s.end===void 0?i:Math.min(s.end,r),!e.extend&&i>s&&(r=s,s=i,i=r),r=Bc(n,i);var a=Bc(n,s);r&&a&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),i>s?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var tg=Nt&&"documentMode"in document&&11>=document.documentMode,Pn=null,ja=null,Bs=null,ka=!1;function Uc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ka||Pn==null||Pn!==gi(s)||(s=Pn,"selectionStart"in s&&Nl(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}),Bs&&tr(Bs,s)||(Bs=s,s=ki(ja,"onSelect"),0<s.length&&(t=new wl("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Pn)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var On={animationend:Rr("Animation","AnimationEnd"),animationiteration:Rr("Animation","AnimationIteration"),animationstart:Rr("Animation","AnimationStart"),transitionend:Rr("Transition","TransitionEnd")},Io={},tf={};Nt&&(tf=document.createElement("div").style,"AnimationEvent"in window||(delete On.animationend.animation,delete On.animationiteration.animation,delete On.animationstart.animation),"TransitionEvent"in window||delete On.transitionend.transition);function Yi(e){if(Io[e])return Io[e];if(!On[e])return e;var t=On[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tf)return Io[e]=t[n];return e}var nf=Yi("animationend"),sf=Yi("animationiteration"),rf=Yi("animationstart"),of=Yi("transitionend"),af=new Map,Wc="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 Xt(e,t){af.set(e,t),bn(t,[e])}for(var Po=0;Po<Wc.length;Po++){var Oo=Wc[Po],ng=Oo.toLowerCase(),sg=Oo[0].toUpperCase()+Oo.slice(1);Xt(ng,"on"+sg)}Xt(nf,"onAnimationEnd");Xt(sf,"onAnimationIteration");Xt(rf,"onAnimationStart");Xt("dblclick","onDoubleClick");Xt("focusin","onFocus");Xt("focusout","onBlur");Xt(of,"onTransitionEnd");Xn("onMouseEnter",["mouseout","mouseover"]);Xn("onMouseLeave",["mouseout","mouseover"]);Xn("onPointerEnter",["pointerout","pointerover"]);Xn("onPointerLeave",["pointerout","pointerover"]);bn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));bn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));bn("onBeforeInput",["compositionend","keypress","textInput","paste"]);bn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));bn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));bn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Os="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(" "),rg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Os));function Hc(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,nm(s,t,void 0,e),e.currentTarget=null}function lf(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 i=void 0;if(t)for(var a=s.length-1;0<=a;a--){var l=s[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&r.isPropagationStopped())break e;Hc(r,l,u),i=c}else for(a=0;a<s.length;a++){if(l=s[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&r.isPropagationStopped())break e;Hc(r,l,u),i=c}}}if(xi)throw e=xa,xi=!1,xa=null,e}function J(e,t){var n=t[Ta];n===void 0&&(n=t[Ta]=new Set);var s=e+"__bubble";n.has(s)||(cf(t,e,2,!1),n.add(s))}function _o(e,t,n){var s=0;t&&(s|=4),cf(n,e,s,t)}var $r="_reactListening"+Math.random().toString(36).slice(2);function nr(e){if(!e[$r]){e[$r]=!0,md.forEach(function(n){n!=="selectionchange"&&(rg.has(n)||_o(n,!1,e),_o(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$r]||(t[$r]=!0,_o("selectionchange",!1,t))}}function cf(e,t,n,s){switch(Vd(t)){case 1:var r=xm;break;case 4:r=vm;break;default:r=vl}n=r.bind(null,t,n,e),r=void 0,!ya||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 Mo(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var a=s.tag;if(a===3||a===4){var l=s.stateNode.containerInfo;if(l===r||l.nodeType===8&&l.parentNode===r)break;if(a===4)for(a=s.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===r||c.nodeType===8&&c.parentNode===r))return;a=a.return}for(;l!==null;){if(a=an(l),a===null)return;if(c=a.tag,c===5||c===6){s=i=a;continue e}l=l.parentNode}}s=s.return}Id(function(){var u=i,p=ml(n),d=[];e:{var f=af.get(e);if(f!==void 0){var x=wl,b=e;switch(e){case"keypress":if(ii(n)===0)break e;case"keydown":case"keyup":x=_m;break;case"focusin":b="focus",x=To;break;case"focusout":b="blur",x=To;break;case"beforeblur":case"afterblur":x=To;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=Pc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=jm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=Rm;break;case nf:case sf:case rf:x=Sm;break;case of:x=zm;break;case"scroll":x=bm;break;case"wheel":x=Bm;break;case"copy":case"cut":case"paste":x=Em;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=_c}var y=(t&4)!==0,j=!y&&e==="scroll",g=y?f!==null?f+"Capture":null:f;y=[];for(var m=u,h;m!==null;){h=m;var w=h.stateNode;if(h.tag===5&&w!==null&&(h=w,g!==null&&(w=Qs(m,g),w!=null&&y.push(sr(m,w,h)))),j)break;m=m.return}0<y.length&&(f=new x(f,b,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!==ma&&(b=n.relatedTarget||n.fromElement)&&(an(b)||b[St]))break e;if((x||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,x?(b=n.relatedTarget||n.toElement,x=u,b=b?an(b):null,b!==null&&(j=wn(b),b!==j||b.tag!==5&&b.tag!==6)&&(b=null)):(x=null,b=u),x!==b)){if(y=Pc,w="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(y=_c,w="onPointerLeave",g="onPointerEnter",m="pointer"),j=x==null?f:_n(x),h=b==null?f:_n(b),f=new y(w,m+"leave",x,n,p),f.target=j,f.relatedTarget=h,w=null,an(p)===u&&(y=new y(g,m+"enter",b,n,p),y.target=h,y.relatedTarget=j,w=y),j=w,x&&b)t:{for(y=x,g=b,m=0,h=y;h;h=kn(h))m++;for(h=0,w=g;w;w=kn(w))h++;for(;0<m-h;)y=kn(y),m--;for(;0<h-m;)g=kn(g),h--;for(;m--;){if(y===g||g!==null&&y===g.alternate)break t;y=kn(y),g=kn(g)}y=null}else y=null;x!==null&&Vc(d,f,x,y,!1),b!==null&&j!==null&&Vc(d,j,b,y,!0)}}e:{if(f=u?_n(u):window,x=f.nodeName&&f.nodeName.toLowerCase(),x==="select"||x==="input"&&f.type==="file")var k=qm;else if(Rc(f))if(Jd)k=Xm;else{k=Qm;var C=Ym}else(x=f.nodeName)&&x.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=Jm);if(k&&(k=k(e,u))){Qd(d,k,n,p);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&ua(f,"number",f.value)}switch(C=u?_n(u):window,e){case"focusin":(Rc(C)||C.contentEditable==="true")&&(Pn=C,ja=u,Bs=null);break;case"focusout":Bs=ja=Pn=null;break;case"mousedown":ka=!0;break;case"contextmenu":case"mouseup":case"dragend":ka=!1,Uc(d,n,p);break;case"selectionchange":if(tg)break;case"keydown":case"keyup":Uc(d,n,p)}var S;if(kl)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 In?qd(e,n)&&(N="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(N="onCompositionStart");N&&(Gd&&n.locale!=="ko"&&(In||N!=="onCompositionStart"?N==="onCompositionEnd"&&In&&(S=Kd()):(Rt=p,bl="value"in Rt?Rt.value:Rt.textContent,In=!0)),C=ki(u,N),0<C.length&&(N=new Oc(N,e,null,n,p),d.push({event:N,listeners:C}),S?N.data=S:(S=Yd(n),S!==null&&(N.data=S)))),(S=Wm?Hm(e,n):Vm(e,n))&&(u=ki(u,"onBeforeInput"),0<u.length&&(p=new Oc("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=S))}lf(d,t)})}function sr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ki(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Qs(e,n),i!=null&&s.unshift(sr(e,i,r)),i=Qs(e,t),i!=null&&s.push(sr(e,i,r))),e=e.return}return s}function kn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Vc(e,t,n,s,r){for(var i=t._reactName,a=[];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=Qs(n,i),c!=null&&a.unshift(sr(n,c,l))):r||(c=Qs(n,i),c!=null&&a.push(sr(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var ig=/\r\n?/g,og=/\u0000|\uFFFD/g;function Kc(e){return(typeof e=="string"?e:""+e).replace(ig,`
38
+ `).replace(og,"")}function zr(e,t,n){if(t=Kc(t),Kc(e)!==t&&n)throw Error(I(425))}function Ni(){}var Na=null,Sa=null;function Ca(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 Ea=typeof setTimeout=="function"?setTimeout:void 0,ag=typeof clearTimeout=="function"?clearTimeout:void 0,Gc=typeof Promise=="function"?Promise:void 0,lg=typeof queueMicrotask=="function"?queueMicrotask:typeof Gc<"u"?function(e){return Gc.resolve(null).then(e).catch(cg)}:Ea;function cg(e){setTimeout(function(){throw e})}function Do(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),Zs(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);Zs(t)}function Wt(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 us=Math.random().toString(36).slice(2),ft="__reactFiber$"+us,rr="__reactProps$"+us,St="__reactContainer$"+us,Ta="__reactEvents$"+us,ug="__reactListeners$"+us,dg="__reactHandles$"+us;function an(e){var t=e[ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[St]||n[ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=qc(e);e!==null;){if(n=e[ft])return n;e=qc(e)}return t}e=n,n=e.parentNode}return null}function vr(e){return e=e[ft]||e[St],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function _n(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function Qi(e){return e[rr]||null}var La=[],Mn=-1;function Zt(e){return{current:e}}function X(e){0>Mn||(e.current=La[Mn],La[Mn]=null,Mn--)}function q(e,t){Mn++,La[Mn]=e.current,e.current=t}var Jt={},ke=Zt(Jt),Oe=Zt(!1),hn=Jt;function Zn(e,t){var n=e.type.contextTypes;if(!n)return Jt;var s=e.stateNode;if(s&&s.__reactInternalMemoizedUnmaskedChildContext===t)return s.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=t[i];return s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function _e(e){return e=e.childContextTypes,e!=null}function Si(){X(Oe),X(ke)}function Yc(e,t,n){if(ke.current!==Jt)throw Error(I(168));q(ke,t),q(Oe,n)}function uf(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,Yh(e)||"Unknown",r));return re({},n,s)}function Ci(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jt,hn=ke.current,q(ke,e),q(Oe,Oe.current),!0}function Qc(e,t,n){var s=e.stateNode;if(!s)throw Error(I(169));n?(e=uf(e,t,hn),s.__reactInternalMemoizedMergedChildContext=e,X(Oe),X(ke),q(ke,e)):X(Oe),q(Oe,n)}var xt=null,Ji=!1,Ro=!1;function df(e){xt===null?xt=[e]:xt.push(e)}function fg(e){Ji=!0,df(e)}function en(){if(!Ro&&xt!==null){Ro=!0;var e=0,t=K;try{var n=xt;for(K=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}xt=null,Ji=!1}catch(r){throw xt!==null&&(xt=xt.slice(e+1)),Md(gl,en),r}finally{K=t,Ro=!1}}return null}var Dn=[],Rn=0,Ei=null,Ti=0,He=[],Ve=0,mn=null,vt=1,bt="";function sn(e,t){Dn[Rn++]=Ti,Dn[Rn++]=Ei,Ei=e,Ti=t}function ff(e,t,n){He[Ve++]=vt,He[Ve++]=bt,He[Ve++]=mn,mn=e;var s=vt;e=bt;var r=32-it(s)-1;s&=~(1<<r),n+=1;var i=32-it(t)+r;if(30<i){var a=r-r%5;i=(s&(1<<a)-1).toString(32),s>>=a,r-=a,vt=1<<32-it(t)+r|n<<r|s,bt=i+e}else vt=1<<i|n<<r|s,bt=e}function Sl(e){e.return!==null&&(sn(e,1),ff(e,1,0))}function Cl(e){for(;e===Ei;)Ei=Dn[--Rn],Dn[Rn]=null,Ti=Dn[--Rn],Dn[Rn]=null;for(;e===mn;)mn=He[--Ve],He[Ve]=null,bt=He[--Ve],He[Ve]=null,vt=He[--Ve],He[Ve]=null}var Fe=null,ze=null,ee=!1,rt=null;function pf(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 Jc(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=Wt(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=mn!==null?{id:vt,overflow:bt}: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 Aa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ia(e){if(ee){var t=ze;if(t){var n=t;if(!Jc(e,t)){if(Aa(e))throw Error(I(418));t=Wt(n.nextSibling);var s=Fe;t&&Jc(e,t)?pf(s,n):(e.flags=e.flags&-4097|2,ee=!1,Fe=e)}}else{if(Aa(e))throw Error(I(418));e.flags=e.flags&-4097|2,ee=!1,Fe=e}}}function Xc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fe=e}function Fr(e){if(e!==Fe)return!1;if(!ee)return Xc(e),ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ca(e.type,e.memoizedProps)),t&&(t=ze)){if(Aa(e))throw hf(),Error(I(418));for(;t;)pf(e,t),t=Wt(t.nextSibling)}if(Xc(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=Wt(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ze=null}}else ze=Fe?Wt(e.stateNode.nextSibling):null;return!0}function hf(){for(var e=ze;e;)e=Wt(e.nextSibling)}function es(){ze=Fe=null,ee=!1}function El(e){rt===null?rt=[e]:rt.push(e)}var pg=Tt.ReactCurrentBatchConfig;function Ns(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,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=r.refs;a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Br(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Zc(e){var t=e._init;return t(e._payload)}function mf(e){function t(g,m){if(e){var h=g.deletions;h===null?(g.deletions=[m],g.flags|=16):h.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function s(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function r(g,m){return g=Gt(g,m),g.index=0,g.sibling=null,g}function i(g,m,h){return g.index=h,e?(h=g.alternate,h!==null?(h=h.index,h<m?(g.flags|=2,m):h):(g.flags|=2,m)):(g.flags|=1048576,m)}function a(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,m,h,w){return m===null||m.tag!==6?(m=Ho(h,g.mode,w),m.return=g,m):(m=r(m,h),m.return=g,m)}function c(g,m,h,w){var k=h.type;return k===An?p(g,m,h.props.children,w,h.key):m!==null&&(m.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pt&&Zc(k)===m.type)?(w=r(m,h.props),w.ref=Ns(g,m,h),w.return=g,w):(w=fi(h.type,h.key,h.props,null,g.mode,w),w.ref=Ns(g,m,h),w.return=g,w)}function u(g,m,h,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==h.containerInfo||m.stateNode.implementation!==h.implementation?(m=Vo(h,g.mode,w),m.return=g,m):(m=r(m,h.children||[]),m.return=g,m)}function p(g,m,h,w,k){return m===null||m.tag!==7?(m=pn(h,g.mode,w,k),m.return=g,m):(m=r(m,h),m.return=g,m)}function d(g,m,h){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Ho(""+m,g.mode,h),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ar:return h=fi(m.type,m.key,m.props,null,g.mode,h),h.ref=Ns(g,null,m),h.return=g,h;case Ln:return m=Vo(m,g.mode,h),m.return=g,m;case Pt:var w=m._init;return d(g,w(m._payload),h)}if(Is(m)||vs(m))return m=pn(m,g.mode,h,null),m.return=g,m;Br(g,m)}return null}function f(g,m,h,w){var k=m!==null?m.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return k!==null?null:l(g,m,""+h,w);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Ar:return h.key===k?c(g,m,h,w):null;case Ln:return h.key===k?u(g,m,h,w):null;case Pt:return k=h._init,f(g,m,k(h._payload),w)}if(Is(h)||vs(h))return k!==null?null:p(g,m,h,w,null);Br(g,h)}return null}function x(g,m,h,w,k){if(typeof w=="string"&&w!==""||typeof w=="number")return g=g.get(h)||null,l(m,g,""+w,k);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ar:return g=g.get(w.key===null?h:w.key)||null,c(m,g,w,k);case Ln:return g=g.get(w.key===null?h:w.key)||null,u(m,g,w,k);case Pt:var C=w._init;return x(g,m,h,C(w._payload),k)}if(Is(w)||vs(w))return g=g.get(h)||null,p(m,g,w,k,null);Br(m,w)}return null}function b(g,m,h,w){for(var k=null,C=null,S=m,N=m=0,T=null;S!==null&&N<h.length;N++){S.index>N?(T=S,S=null):T=S.sibling;var A=f(g,S,h[N],w);if(A===null){S===null&&(S=T);break}e&&S&&A.alternate===null&&t(g,S),m=i(A,m,N),C===null?k=A:C.sibling=A,C=A,S=T}if(N===h.length)return n(g,S),ee&&sn(g,N),k;if(S===null){for(;N<h.length;N++)S=d(g,h[N],w),S!==null&&(m=i(S,m,N),C===null?k=S:C.sibling=S,C=S);return ee&&sn(g,N),k}for(S=s(g,S);N<h.length;N++)T=x(S,g,N,h[N],w),T!==null&&(e&&T.alternate!==null&&S.delete(T.key===null?N:T.key),m=i(T,m,N),C===null?k=T:C.sibling=T,C=T);return e&&S.forEach(function(z){return t(g,z)}),ee&&sn(g,N),k}function y(g,m,h,w){var k=vs(h);if(typeof k!="function")throw Error(I(150));if(h=k.call(h),h==null)throw Error(I(151));for(var C=k=null,S=m,N=m=0,T=null,A=h.next();S!==null&&!A.done;N++,A=h.next()){S.index>N?(T=S,S=null):T=S.sibling;var z=f(g,S,A.value,w);if(z===null){S===null&&(S=T);break}e&&S&&z.alternate===null&&t(g,S),m=i(z,m,N),C===null?k=z:C.sibling=z,C=z,S=T}if(A.done)return n(g,S),ee&&sn(g,N),k;if(S===null){for(;!A.done;N++,A=h.next())A=d(g,A.value,w),A!==null&&(m=i(A,m,N),C===null?k=A:C.sibling=A,C=A);return ee&&sn(g,N),k}for(S=s(g,S);!A.done;N++,A=h.next())A=x(S,g,N,A.value,w),A!==null&&(e&&A.alternate!==null&&S.delete(A.key===null?N:A.key),m=i(A,m,N),C===null?k=A:C.sibling=A,C=A);return e&&S.forEach(function(G){return t(g,G)}),ee&&sn(g,N),k}function j(g,m,h,w){if(typeof h=="object"&&h!==null&&h.type===An&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Ar:e:{for(var k=h.key,C=m;C!==null;){if(C.key===k){if(k=h.type,k===An){if(C.tag===7){n(g,C.sibling),m=r(C,h.props.children),m.return=g,g=m;break e}}else if(C.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pt&&Zc(k)===C.type){n(g,C.sibling),m=r(C,h.props),m.ref=Ns(g,C,h),m.return=g,g=m;break e}n(g,C);break}else t(g,C);C=C.sibling}h.type===An?(m=pn(h.props.children,g.mode,w,h.key),m.return=g,g=m):(w=fi(h.type,h.key,h.props,null,g.mode,w),w.ref=Ns(g,m,h),w.return=g,g=w)}return a(g);case Ln:e:{for(C=h.key;m!==null;){if(m.key===C)if(m.tag===4&&m.stateNode.containerInfo===h.containerInfo&&m.stateNode.implementation===h.implementation){n(g,m.sibling),m=r(m,h.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=Vo(h,g.mode,w),m.return=g,g=m}return a(g);case Pt:return C=h._init,j(g,m,C(h._payload),w)}if(Is(h))return b(g,m,h,w);if(vs(h))return y(g,m,h,w);Br(g,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,m!==null&&m.tag===6?(n(g,m.sibling),m=r(m,h),m.return=g,g=m):(n(g,m),m=Ho(h,g.mode,w),m.return=g,g=m),a(g)):n(g,m)}return j}var ts=mf(!0),gf=mf(!1),Li=Zt(null),Ai=null,$n=null,Tl=null;function Ll(){Tl=$n=Ai=null}function Al(e){var t=Li.current;X(Li),e._currentValue=t}function Pa(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 qn(e,t){Ai=e,Tl=$n=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(Tl!==e)if(e={context:e,memoizedValue:t,next:null},$n===null){if(Ai===null)throw Error(I(308));$n=e,Ai.dependencies={lanes:0,firstContext:e}}else $n=$n.next=e;return t}var ln=null;function Il(e){ln===null?ln=[e]:ln.push(e)}function yf(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Il(t)):(n.next=r.next,r.next=n),t.interleaved=n,Ct(e,s)}function Ct(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 Ot=!1;function Pl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ht(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,Ct(e,n)}return r=s.interleaved,r===null?(t.next=t,Il(s)):(t.next=r.next,r.next=t),s.interleaved=t,Ct(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,yl(e,n)}}function eu(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:i,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 Ii(e,t,n,s){var r=e.updateQueue;Ot=!1;var i=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==a&&(l===null?p.firstBaseUpdate=u:l.next=u,p.lastBaseUpdate=c))}if(i!==null){var d=r.baseState;a=0,p=u=c=null,l=i;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 b=e,y=l;switch(f=t,x=n,y.tag){case 1:if(b=y.payload,typeof b=="function"){d=b.call(x,d,f);break e}d=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=y.payload,f=typeof b=="function"?b.call(x,d,f):b,f==null)break e;d=re({},d,f);break e;case 2:Ot=!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,a|=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 a|=r.lane,r=r.next;while(r!==t)}else i===null&&(r.shared.lanes=0);yn|=a,e.lanes=a,e.memoizedState=d}}function tu(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 br={},ht=Zt(br),ir=Zt(br),or=Zt(br);function cn(e){if(e===br)throw Error(I(174));return e}function Ol(e,t){switch(q(or,t),q(ir,e),q(ht,br),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fa(t,e)}X(ht),q(ht,t)}function ns(){X(ht),X(ir),X(or)}function vf(e){cn(or.current);var t=cn(ht.current),n=fa(t,e.type);t!==n&&(q(ir,e),q(ht,n))}function _l(e){ir.current===e&&(X(ht),X(ir))}var ne=Zt(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 $o=[];function Ml(){for(var e=0;e<$o.length;e++)$o[e]._workInProgressVersionPrimary=null;$o.length=0}var ai=Tt.ReactCurrentDispatcher,zo=Tt.ReactCurrentBatchConfig,gn=0,se=null,fe=null,he=null,Oi=!1,Us=!1,ar=0,hg=0;function be(){throw Error(I(321))}function Dl(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!at(e[n],t[n]))return!1;return!0}function Rl(e,t,n,s,r,i){if(gn=i,se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ai.current=e===null||e.memoizedState===null?xg:vg,e=n(s,r),Us){i=0;do{if(Us=!1,ar=0,25<=i)throw Error(I(301));i+=1,he=fe=null,t.updateQueue=null,ai.current=bg,e=n(s,r)}while(Us)}if(ai.current=_i,t=fe!==null&&fe.next!==null,gn=0,he=fe=se=null,Oi=!1,t)throw Error(I(300));return e}function $l(){var e=ar!==0;return ar=0,e}function dt(){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(fe===null){var e=se.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=he===null?se.memoizedState:he.next;if(t!==null)he=t,fe=e;else{if(e===null)throw Error(I(310));fe=e,e={memoizedState:fe.memoizedState,baseState:fe.baseState,baseQueue:fe.baseQueue,queue:fe.queue,next:null},he===null?se.memoizedState=he=e:he=he.next=e}return he}function lr(e,t){return typeof t=="function"?t(e):t}function Fo(e){var t=Je(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=fe,r=s.baseQueue,i=n.pending;if(i!==null){if(r!==null){var a=r.next;r.next=i.next,i.next=a}s.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,s=s.baseState;var l=a=null,c=null,u=i;do{var p=u.lane;if((gn&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,a=s):c=c.next=d,se.lanes|=p,yn|=p}u=u.next}while(u!==null&&u!==i);c===null?a=s:c.next=l,at(s,t.memoizedState)||(Ie=!0),t.memoizedState=s,t.baseState=a,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do i=r.lane,se.lanes|=i,yn|=i,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Bo(e){var t=Je(),n=t.queue;if(n===null)throw Error(I(311));n.lastRenderedReducer=e;var s=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do i=e(i,a.action),a=a.next;while(a!==r);at(i,t.memoizedState)||(Ie=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function bf(){}function wf(e,t){var n=se,s=Je(),r=t(),i=!at(s.memoizedState,r);if(i&&(s.memoizedState=r,Ie=!0),s=s.queue,zl(Nf.bind(null,n,s,e),[e]),s.getSnapshot!==t||i||he!==null&&he.memoizedState.tag&1){if(n.flags|=2048,cr(9,kf.bind(null,n,s,r,t),void 0,null),me===null)throw Error(I(349));gn&30||jf(n,t,r)}return r}function jf(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 kf(e,t,n,s){t.value=n,t.getSnapshot=s,Sf(t)&&Cf(e)}function Nf(e,t,n){return n(function(){Sf(t)&&Cf(e)})}function Sf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!at(e,n)}catch{return!0}}function Cf(e){var t=Ct(e,1);t!==null&&ot(t,e,1,-1)}function nu(e){var t=dt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:e},t.queue=e,e=e.dispatch=yg.bind(null,se,e),[t.memoizedState,e]}function cr(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 Ef(){return Je().memoizedState}function li(e,t,n,s){var r=dt();se.flags|=e,r.memoizedState=cr(1|t,n,void 0,s===void 0?null:s)}function Xi(e,t,n,s){var r=Je();s=s===void 0?null:s;var i=void 0;if(fe!==null){var a=fe.memoizedState;if(i=a.destroy,s!==null&&Dl(s,a.deps)){r.memoizedState=cr(t,n,i,s);return}}se.flags|=e,r.memoizedState=cr(1|t,n,i,s)}function su(e,t){return li(8390656,8,e,t)}function zl(e,t){return Xi(2048,8,e,t)}function Tf(e,t){return Xi(4,2,e,t)}function Lf(e,t){return Xi(4,4,e,t)}function Af(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 If(e,t,n){return n=n!=null?n.concat([e]):null,Xi(4,4,Af.bind(null,t,e),n)}function Fl(){}function Pf(e,t){var n=Je();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Dl(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Of(e,t){var n=Je();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Dl(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function _f(e,t,n){return gn&21?(at(n,t)||(n=$d(),se.lanes|=n,yn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ie=!0),e.memoizedState=n)}function mg(e,t){var n=K;K=n!==0&&4>n?n:4,e(!0);var s=zo.transition;zo.transition={};try{e(!1),t()}finally{K=n,zo.transition=s}}function Mf(){return Je().memoizedState}function gg(e,t,n){var s=Kt(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Df(e))Rf(t,n);else if(n=yf(e,t,n,s),n!==null){var r=Ce();ot(n,e,s,r),$f(n,t,s)}}function yg(e,t,n){var s=Kt(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Df(e))Rf(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(r.hasEagerState=!0,r.eagerState=l,at(l,a)){var c=t.interleaved;c===null?(r.next=r,Il(t)):(r.next=c.next,c.next=r),t.interleaved=r;return}}catch{}finally{}n=yf(e,t,r,s),n!==null&&(r=Ce(),ot(n,e,s,r),$f(n,t,s))}}function Df(e){var t=e.alternate;return e===se||t!==null&&t===se}function Rf(e,t){Us=Oi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $f(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,yl(e,n)}}var _i={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},xg={readContext:Qe,useCallback:function(e,t){return dt().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:su,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,li(4194308,4,Af.bind(null,t,e),n)},useLayoutEffect:function(e,t){return li(4194308,4,e,t)},useInsertionEffect:function(e,t){return li(4,2,e,t)},useMemo:function(e,t){var n=dt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=dt();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=gg.bind(null,se,e),[s.memoizedState,e]},useRef:function(e){var t=dt();return e={current:e},t.memoizedState=e},useState:nu,useDebugValue:Fl,useDeferredValue:function(e){return dt().memoizedState=e},useTransition:function(){var e=nu(!1),t=e[0];return e=mg.bind(null,e[1]),dt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=se,r=dt();if(ee){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),me===null)throw Error(I(349));gn&30||jf(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,su(Nf.bind(null,s,i,e),[e]),s.flags|=2048,cr(9,kf.bind(null,s,i,n,t),void 0,null),n},useId:function(){var e=dt(),t=me.identifierPrefix;if(ee){var n=bt,s=vt;n=(s&~(1<<32-it(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=ar++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=hg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},vg={readContext:Qe,useCallback:Pf,useContext:Qe,useEffect:zl,useImperativeHandle:If,useInsertionEffect:Tf,useLayoutEffect:Lf,useMemo:Of,useReducer:Fo,useRef:Ef,useState:function(){return Fo(lr)},useDebugValue:Fl,useDeferredValue:function(e){var t=Je();return _f(t,fe.memoizedState,e)},useTransition:function(){var e=Fo(lr)[0],t=Je().memoizedState;return[e,t]},useMutableSource:bf,useSyncExternalStore:wf,useId:Mf,unstable_isNewReconciler:!1},bg={readContext:Qe,useCallback:Pf,useContext:Qe,useEffect:zl,useImperativeHandle:If,useInsertionEffect:Tf,useLayoutEffect:Lf,useMemo:Of,useReducer:Bo,useRef:Ef,useState:function(){return Bo(lr)},useDebugValue:Fl,useDeferredValue:function(e){var t=Je();return fe===null?t.memoizedState=e:_f(t,fe.memoizedState,e)},useTransition:function(){var e=Bo(lr)[0],t=Je().memoizedState;return[e,t]},useMutableSource:bf,useSyncExternalStore:wf,useId:Mf,unstable_isNewReconciler:!1};function nt(e,t){if(e&&e.defaultProps){t=re({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Oa(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:re({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zi={isMounted:function(e){return(e=e._reactInternals)?wn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Ce(),r=Kt(e),i=jt(s,r);i.payload=t,n!=null&&(i.callback=n),t=Ht(e,i,r),t!==null&&(ot(t,e,r,s),oi(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Ce(),r=Kt(e),i=jt(s,r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ht(e,i,r),t!==null&&(ot(t,e,r,s),oi(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ce(),s=Kt(e),r=jt(n,s);r.tag=2,t!=null&&(r.callback=t),t=Ht(e,r,s),t!==null&&(ot(t,e,s,n),oi(t,e,s))}};function ru(e,t,n,s,r,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,a):t.prototype&&t.prototype.isPureReactComponent?!tr(n,s)||!tr(r,i):!0}function zf(e,t,n){var s=!1,r=Jt,i=t.contextType;return typeof i=="object"&&i!==null?i=Qe(i):(r=_e(t)?hn:ke.current,s=t.contextTypes,i=(s=s!=null)?Zn(e,r):Jt),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zi,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=i),t}function iu(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&&Zi.enqueueReplaceState(t,t.state,null)}function _a(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Pl(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=Qe(i):(i=_e(t)?hn:ke.current,r.context=Zn(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Oa(e,t,i,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&&Zi.enqueueReplaceState(r,r.state,null),Ii(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function ss(e,t){try{var n="",s=t;do n+=qh(s),s=s.return;while(s);var r=n}catch(i){r=`
39
+ Error generating stack: `+i.message+`
40
+ `+i.stack}return{value:e,source:t,stack:r,digest:null}}function Uo(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ma(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var wg=typeof WeakMap=="function"?WeakMap:Map;function Ff(e,t,n){n=jt(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Di||(Di=!0,Va=s),Ma(e,t)},n}function Bf(e,t,n){n=jt(-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(){Ma(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ma(e,t),typeof s!="function"&&(Vt===null?Vt=new Set([this]):Vt.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function ou(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 au(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 lu(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=jt(-1,1),t.tag=2,Ht(n,t,1))),n.lanes|=1),e)}var jg=Tt.ReactCurrentOwner,Ie=!1;function Ne(e,t,n,s){t.child=e===null?gf(t,null,n,s):ts(t,e.child,n,s)}function cu(e,t,n,s,r){n=n.render;var i=t.ref;return qn(t,r),s=Rl(e,t,n,s,i,r),n=$l(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Et(e,t,r)):(ee&&n&&Sl(t),t.flags|=1,Ne(e,t,s,r),t.child)}function uu(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!ql(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Uf(e,t,i,s,r)):(e=fi(n.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&r)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:tr,n(a,s)&&e.ref===t.ref)return Et(e,t,r)}return t.flags|=1,e=Gt(i,s),e.ref=t.ref,e.return=t,t.child=e}function Uf(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(tr(i,s)&&e.ref===t.ref)if(Ie=!1,t.pendingProps=s=i,(e.lanes&r)!==0)e.flags&131072&&(Ie=!0);else return t.lanes=e.lanes,Et(e,t,r)}return Da(e,t,n,s,r)}function Wf(e,t,n){var s=t.pendingProps,r=s.children,i=e!==null?e.memoizedState:null;if(s.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},q(Fn,Re),Re|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,q(Fn,Re),Re|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:n,q(Fn,Re),Re|=s}else i!==null?(s=i.baseLanes|n,t.memoizedState=null):s=n,q(Fn,Re),Re|=s;return Ne(e,t,r,n),t.child}function Hf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Da(e,t,n,s,r){var i=_e(n)?hn:ke.current;return i=Zn(t,i),qn(t,r),n=Rl(e,t,n,s,i,r),s=$l(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Et(e,t,r)):(ee&&s&&Sl(t),t.flags|=1,Ne(e,t,n,r),t.child)}function du(e,t,n,s,r){if(_e(n)){var i=!0;Ci(t)}else i=!1;if(qn(t,r),t.stateNode===null)ci(e,t),zf(t,n,s),_a(t,n,s,r),s=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Qe(u):(u=_e(n)?hn:ke.current,u=Zn(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==s||c!==u)&&iu(t,a,s,u),Ot=!1;var f=t.memoizedState;a.state=f,Ii(t,s,a,r),c=t.memoizedState,l!==s||f!==c||Oe.current||Ot?(typeof p=="function"&&(Oa(t,n,p,s),c=t.memoizedState),(l=Ot||ru(t,n,l,s,f,c,u))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),a.props=s,a.state=c,a.context=u,s=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{a=t.stateNode,xf(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:nt(t.type,l),a.props=u,d=t.pendingProps,f=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Qe(c):(c=_e(n)?hn:ke.current,c=Zn(t,c));var x=n.getDerivedStateFromProps;(p=typeof x=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==d||f!==c)&&iu(t,a,s,c),Ot=!1,f=t.memoizedState,a.state=f,Ii(t,s,a,r);var b=t.memoizedState;l!==d||f!==b||Oe.current||Ot?(typeof x=="function"&&(Oa(t,n,x,s),b=t.memoizedState),(u=Ot||ru(t,n,u,s,f,b,c)||!1)?(p||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(s,b,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(s,b,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=b),a.props=s,a.state=b,a.context=c,s=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Ra(e,t,n,s,i,r)}function Ra(e,t,n,s,r,i){Hf(e,t);var a=(t.flags&128)!==0;if(!s&&!a)return r&&Qc(t,n,!1),Et(e,t,i);s=t.stateNode,jg.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&a?(t.child=ts(t,e.child,null,i),t.child=ts(t,null,l,i)):Ne(e,t,l,i),t.memoizedState=s.state,r&&Qc(t,n,!0),t.child}function Vf(e){var t=e.stateNode;t.pendingContext?Yc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Yc(e,t.context,!1),Ol(e,t.containerInfo)}function fu(e,t,n,s,r){return es(),El(r),t.flags|=256,Ne(e,t,n,s),t.child}var $a={dehydrated:null,treeContext:null,retryLane:0};function za(e){return{baseLanes:e,cachePool:null,transitions:null}}function Kf(e,t,n){var s=t.pendingProps,r=ne.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(r&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),q(ne,r&1),e===null)return Ia(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=s.children,e=s.fallback,i?(s=t.mode,i=t.child,a={mode:"hidden",children:a},!(s&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=no(a,s,0,null),e=pn(e,s,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=za(n),t.memoizedState=$a,e):Bl(t,a));if(r=e.memoizedState,r!==null&&(l=r.dehydrated,l!==null))return kg(e,t,a,s,l,r,n);if(i){i=s.fallback,a=t.mode,r=e.child,l=r.sibling;var c={mode:"hidden",children:s.children};return!(a&1)&&t.child!==r?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=Gt(r,c),s.subtreeFlags=r.subtreeFlags&14680064),l!==null?i=Gt(l,i):(i=pn(i,a,n,null),i.flags|=2),i.return=t,s.return=t,s.sibling=i,t.child=s,s=i,i=t.child,a=e.child.memoizedState,a=a===null?za(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=$a,s}return i=e.child,e=i.sibling,s=Gt(i,{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 Bl(e,t){return t=no({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ur(e,t,n,s){return s!==null&&El(s),ts(t,e.child,null,n),e=Bl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kg(e,t,n,s,r,i,a){if(n)return t.flags&256?(t.flags&=-257,s=Uo(Error(I(422))),Ur(e,t,a,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=s.fallback,r=t.mode,s=no({mode:"visible",children:s.children},r,0,null),i=pn(i,r,a,null),i.flags|=2,s.return=t,i.return=t,s.sibling=i,t.child=s,t.mode&1&&ts(t,e.child,null,a),t.child.memoizedState=za(a),t.memoizedState=$a,i);if(!(t.mode&1))return Ur(e,t,a,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var l=s.dgst;return s=l,i=Error(I(419)),s=Uo(i,s,void 0),Ur(e,t,a,s)}if(l=(a&e.childLanes)!==0,Ie||l){if(s=me,s!==null){switch(a&-a){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|a)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,Ct(e,r),ot(s,e,r,-1))}return Gl(),s=Uo(Error(I(421))),Ur(e,t,a,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Dg.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,ze=Wt(r.nextSibling),Fe=t,ee=!0,rt=null,e!==null&&(He[Ve++]=vt,He[Ve++]=bt,He[Ve++]=mn,vt=e.id,bt=e.overflow,mn=t),t=Bl(t,s.children),t.flags|=4096,t)}function pu(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Pa(e.return,t,n)}function Wo(e,t,n,s,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=s,i.tail=n,i.tailMode=r)}function Gf(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=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&&pu(e,n,t);else if(e.tag===19)pu(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),Wo(t,!1,r,n,i);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}Wo(t,!0,n,null,i);break;case"together":Wo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ci(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Et(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yn|=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=Gt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Gt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ng(e,t,n){switch(t.tag){case 3:Vf(t),es();break;case 5:vf(t);break;case 1:_e(t.type)&&Ci(t);break;case 4:Ol(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;q(Li,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?Kf(e,t,n):(q(ne,ne.current&1),e=Et(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 Gf(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,Wf(e,t,n)}return Et(e,t,n)}var qf,Fa,Yf,Qf;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}};Fa=function(){};Yf=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,cn(ht.current);var i=null;switch(n){case"input":r=la(e,r),s=la(e,s),i=[];break;case"select":r=re({},r,{value:void 0}),s=re({},s,{value:void 0}),i=[];break;case"textarea":r=da(e,r),s=da(e,s),i=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=Ni)}pa(n,s);var a;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var l=r[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(qs.hasOwnProperty(u)?i||(i=[]):(i=i||[]).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(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(qs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&J("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Qf=function(e,t,n,s){n!==s&&(t.flags|=4)};function Ss(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 we(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 Sg(e,t,n){var s=t.pendingProps;switch(Cl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return we(t),null;case 1:return _e(t.type)&&Si(),we(t),null;case 3:return s=t.stateNode,ns(),X(Oe),X(ke),Ml(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Fr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rt!==null&&(qa(rt),rt=null))),Fa(e,t),we(t),null;case 5:_l(t);var r=cn(or.current);if(n=t.type,e!==null&&t.stateNode!=null)Yf(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 we(t),null}if(e=cn(ht.current),Fr(t)){s=t.stateNode,n=t.type;var i=t.memoizedProps;switch(s[ft]=t,s[rr]=i,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<Os.length;r++)J(Os[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":jc(s,i),J("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},J("invalid",s);break;case"textarea":Nc(s,i),J("invalid",s)}pa(n,i),r=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?s.textContent!==l&&(i.suppressHydrationWarning!==!0&&zr(s.textContent,l,e),r=["children",l]):typeof l=="number"&&s.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&zr(s.textContent,l,e),r=["children",""+l]):qs.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&J("scroll",s)}switch(n){case"input":Ir(s),kc(s,i,!0);break;case"textarea":Ir(s),Sc(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=Ni)}s=r,t.updateQueue=s,s!==null&&(t.flags|=4)}else{a=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=kd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=a.createElement(n,{is:s.is}):(e=a.createElement(n),n==="select"&&(a=e,s.multiple?a.multiple=!0:s.size&&(a.size=s.size))):e=a.createElementNS(e,n),e[ft]=t,e[rr]=s,qf(e,t,!1,!1),t.stateNode=e;e:{switch(a=ha(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<Os.length;r++)J(Os[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":jc(e,s),r=la(e,s),J("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=re({},s,{value:void 0}),J("invalid",e);break;case"textarea":Nc(e,s),r=da(e,s),J("invalid",e);break;default:r=s}pa(n,r),l=r;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Cd(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Nd(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Ys(e,c):typeof c=="number"&&Ys(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(qs.hasOwnProperty(i)?c!=null&&i==="onScroll"&&J("scroll",e):c!=null&&dl(e,i,c,a))}switch(n){case"input":Ir(e),kc(e,s,!1);break;case"textarea":Ir(e),Sc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Qt(s.value));break;case"select":e.multiple=!!s.multiple,i=s.value,i!=null?Hn(e,!!s.multiple,i,!1):s.defaultValue!=null&&Hn(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=Ni)}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 we(t),null;case 6:if(e&&t.stateNode!=null)Qf(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(n=cn(or.current),cn(ht.current),Fr(t)){if(s=t.stateNode,n=t.memoizedProps,s[ft]=t,(i=s.nodeValue!==n)&&(e=Fe,e!==null))switch(e.tag){case 3:zr(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&zr(s.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[ft]=t,t.stateNode=s}return we(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))hf(),es(),t.flags|=98560,i=!1;else if(i=Fr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(I(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(I(317));i[ft]=t}else es(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;we(t),i=!1}else rt!==null&&(qa(rt),rt=null),i=!0;if(!i)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?pe===0&&(pe=3):Gl())),t.updateQueue!==null&&(t.flags|=4),we(t),null);case 4:return ns(),Fa(e,t),e===null&&nr(t.stateNode.containerInfo),we(t),null;case 10:return Al(t.type._context),we(t),null;case 17:return _e(t.type)&&Si(),we(t),null;case 19:if(X(ne),i=t.memoizedState,i===null)return we(t),null;if(s=(t.flags&128)!==0,a=i.rendering,a===null)if(s)Ss(i,!1);else{if(pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Pi(e),a!==null){for(t.flags|=128,Ss(i,!1),s=a.updateQueue,s!==null&&(t.updateQueue=s,t.flags|=4),t.subtreeFlags=0,s=n,n=t.child;n!==null;)i=n,e=s,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.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}i.tail!==null&&ae()>rs&&(t.flags|=128,s=!0,Ss(i,!1),t.lanes=4194304)}else{if(!s)if(e=Pi(a),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ss(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ee)return we(t),null}else 2*ae()-i.renderingStartTime>rs&&n!==1073741824&&(t.flags|=128,s=!0,Ss(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=ae(),t.sibling=null,n=ne.current,q(ne,s?n&1|2:n&1),t):(we(t),null);case 22:case 23:return Kl(),s=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==s&&(t.flags|=8192),s&&t.mode&1?Re&1073741824&&(we(t),t.subtreeFlags&6&&(t.flags|=8192)):we(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function Cg(e,t){switch(Cl(t),t.tag){case 1:return _e(t.type)&&Si(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ns(),X(Oe),X(ke),Ml(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return _l(t),null;case 13:if(X(ne),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));es()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(ne),null;case 4:return ns(),null;case 10:return Al(t.type._context),null;case 22:case 23:return Kl(),null;case 24:return null;default:return null}}var Wr=!1,je=!1,Eg=typeof WeakSet=="function"?WeakSet:Set,_=null;function zn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){ie(e,t,s)}else n.current=null}function Ba(e,t,n){try{n()}catch(s){ie(e,t,s)}}var hu=!1;function Tg(e,t){if(Na=wi,e=ef(),Nl(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,i=s.focusNode;s=s.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=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=a+r),d!==i||s!==0&&d.nodeType!==3||(c=a+s),d.nodeType===3&&(a+=d.nodeValue.length),(x=d.firstChild)!==null;)f=d,d=x;for(;;){if(d===e)break t;if(f===n&&++u===r&&(l=a),f===i&&++p===s&&(c=a),(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(Sa={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 b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var y=b.memoizedProps,j=b.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?y:nt(t.type,y),j);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(w){ie(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,_=e;break}_=t.return}return b=hu,hu=!1,b}function Ws(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 i=r.destroy;r.destroy=void 0,i!==void 0&&Ba(t,n,i)}r=r.next}while(r!==s)}}function eo(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 Ua(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 Jf(e){var t=e.alternate;t!==null&&(e.alternate=null,Jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ft],delete t[rr],delete t[Ta],delete t[ug],delete t[dg])),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 Xf(e){return e.tag===5||e.tag===3||e.tag===4}function mu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xf(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 Wa(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=Ni));else if(s!==4&&(e=e.child,e!==null))for(Wa(e,t,n),e=e.sibling;e!==null;)Wa(e,t,n),e=e.sibling}function Ha(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(Ha(e,t,n),e=e.sibling;e!==null;)Ha(e,t,n),e=e.sibling}var ye=null,st=!1;function At(e,t,n){for(n=n.child;n!==null;)Zf(e,t,n),n=n.sibling}function Zf(e,t,n){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Ki,n)}catch{}switch(n.tag){case 5:je||zn(n,t);case 6:var s=ye,r=st;ye=null,At(e,t,n),ye=s,st=r,ye!==null&&(st?(e=ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ye.removeChild(n.stateNode));break;case 18:ye!==null&&(st?(e=ye,n=n.stateNode,e.nodeType===8?Do(e.parentNode,n):e.nodeType===1&&Do(e,n),Zs(e)):Do(ye,n.stateNode));break;case 4:s=ye,r=st,ye=n.stateNode.containerInfo,st=!0,At(e,t,n),ye=s,st=r;break;case 0:case 11:case 14:case 15:if(!je&&(s=n.updateQueue,s!==null&&(s=s.lastEffect,s!==null))){r=s=s.next;do{var i=r,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Ba(n,t,a),r=r.next}while(r!==s)}At(e,t,n);break;case 1:if(!je&&(zn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(l){ie(n,t,l)}At(e,t,n);break;case 21:At(e,t,n);break;case 22:n.mode&1?(je=(s=je)||n.memoizedState!==null,At(e,t,n),je=s):At(e,t,n);break;default:At(e,t,n)}}function gu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Eg),t.forEach(function(s){var r=Rg.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 i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:ye=l.stateNode,st=!1;break e;case 3:ye=l.stateNode.containerInfo,st=!0;break e;case 4:ye=l.stateNode.containerInfo,st=!0;break e}l=l.return}if(ye===null)throw Error(I(160));Zf(i,a,r),ye=null,st=!1;var c=r.alternate;c!==null&&(c.return=null),r.return=null}catch(u){ie(r,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ep(t,e),t=t.sibling}function ep(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(et(t,e),ct(e),s&4){try{Ws(3,e,e.return),eo(3,e)}catch(y){ie(e,e.return,y)}try{Ws(5,e,e.return)}catch(y){ie(e,e.return,y)}}break;case 1:et(t,e),ct(e),s&512&&n!==null&&zn(n,n.return);break;case 5:if(et(t,e),ct(e),s&512&&n!==null&&zn(n,n.return),e.flags&32){var r=e.stateNode;try{Ys(r,"")}catch(y){ie(e,e.return,y)}}if(s&4&&(r=e.stateNode,r!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&wd(r,i),ha(l,a);var u=ha(l,i);for(a=0;a<c.length;a+=2){var p=c[a],d=c[a+1];p==="style"?Cd(r,d):p==="dangerouslySetInnerHTML"?Nd(r,d):p==="children"?Ys(r,d):dl(r,p,d,u)}switch(l){case"input":ca(r,i);break;case"textarea":jd(r,i);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var x=i.value;x!=null?Hn(r,!!i.multiple,x,!1):f!==!!i.multiple&&(i.defaultValue!=null?Hn(r,!!i.multiple,i.defaultValue,!0):Hn(r,!!i.multiple,i.multiple?[]:"",!1))}r[rr]=i}catch(y){ie(e,e.return,y)}}break;case 6:if(et(t,e),ct(e),s&4){if(e.stateNode===null)throw Error(I(162));r=e.stateNode,i=e.memoizedProps;try{r.nodeValue=i}catch(y){ie(e,e.return,y)}}break;case 3:if(et(t,e),ct(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Zs(t.containerInfo)}catch(y){ie(e,e.return,y)}break;case 4:et(t,e),ct(e);break;case 13:et(t,e),ct(e),r=e.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(Hl=ae())),s&4&&gu(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(je=(u=je)||p,et(t,e),je=u):et(t,e),ct(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:Ws(4,f,f.return);break;case 1:zn(f,f.return);var b=f.stateNode;if(typeof b.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(y){ie(s,n,y)}}break;case 5:zn(f,f.return);break;case 22:if(f.memoizedState!==null){xu(d);continue}}x!==null?(x.return=f,_=x):xu(d)}p=p.sibling}e:for(p=null,d=e;;){if(d.tag===5){if(p===null){p=d;try{r=d.stateNode,u?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,c=d.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Sd("display",a))}catch(y){ie(e,e.return,y)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){ie(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),ct(e),s&4&&gu(e);break;case 21:break;default:et(t,e),ct(e)}}function ct(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Xf(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&&(Ys(r,""),s.flags&=-33);var i=mu(e);Ha(e,i,r);break;case 3:case 4:var a=s.stateNode.containerInfo,l=mu(e);Wa(e,l,a);break;default:throw Error(I(161))}}catch(c){ie(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lg(e,t,n){_=e,tp(e)}function tp(e,t,n){for(var s=(e.mode&1)!==0;_!==null;){var r=_,i=r.child;if(r.tag===22&&s){var a=r.memoizedState!==null||Wr;if(!a){var l=r.alternate,c=l!==null&&l.memoizedState!==null||je;l=Wr;var u=je;if(Wr=a,(je=c)&&!u)for(_=r;_!==null;)a=_,c=a.child,a.tag===22&&a.memoizedState!==null?vu(r):c!==null?(c.return=a,_=c):vu(r);for(;i!==null;)_=i,tp(i),i=i.sibling;_=r,Wr=l,je=u}yu(e)}else r.subtreeFlags&8772&&i!==null?(i.return=r,_=i):yu(e)}}function yu(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:je||eo(5,t);break;case 1:var s=t.stateNode;if(t.flags&4&&!je)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 i=t.updateQueue;i!==null&&tu(t,i,s);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}tu(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var p=u.memoizedState;if(p!==null){var d=p.dehydrated;d!==null&&Zs(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}je||t.flags&512&&Ua(t)}catch(f){ie(t,t.return,f)}}if(t===e){_=null;break}if(n=t.sibling,n!==null){n.return=t.return,_=n;break}_=t.return}}function xu(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 vu(e){for(;_!==null;){var t=_;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{eo(4,t)}catch(c){ie(t,n,c)}break;case 1:var s=t.stateNode;if(typeof s.componentDidMount=="function"){var r=t.return;try{s.componentDidMount()}catch(c){ie(t,r,c)}}var i=t.return;try{Ua(t)}catch(c){ie(t,i,c)}break;case 5:var a=t.return;try{Ua(t)}catch(c){ie(t,a,c)}}}catch(c){ie(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 Ag=Math.ceil,Mi=Tt.ReactCurrentDispatcher,Ul=Tt.ReactCurrentOwner,qe=Tt.ReactCurrentBatchConfig,H=0,me=null,de=null,xe=0,Re=0,Fn=Zt(0),pe=0,ur=null,yn=0,to=0,Wl=0,Hs=null,Ae=null,Hl=0,rs=1/0,yt=null,Di=!1,Va=null,Vt=null,Hr=!1,$t=null,Ri=0,Vs=0,Ka=null,ui=-1,di=0;function Ce(){return H&6?ae():ui!==-1?ui:ui=ae()}function Kt(e){return e.mode&1?H&2&&xe!==0?xe&-xe:pg.transition!==null?(di===0&&(di=$d()),di):(e=K,e!==0||(e=window.event,e=e===void 0?16:Vd(e.type)),e):1}function ot(e,t,n,s){if(50<Vs)throw Vs=0,Ka=null,Error(I(185));yr(e,n,s),(!(H&2)||e!==me)&&(e===me&&(!(H&2)&&(to|=n),pe===4&&Dt(e,xe)),Me(e,s),n===1&&H===0&&!(t.mode&1)&&(rs=ae()+500,Ji&&en()))}function Me(e,t){var n=e.callbackNode;pm(e,t);var s=bi(e,e===me?xe:0);if(s===0)n!==null&&Tc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Tc(n),t===1)e.tag===0?fg(bu.bind(null,e)):df(bu.bind(null,e)),lg(function(){!(H&6)&&en()}),n=null;else{switch(zd(s)){case 1:n=gl;break;case 4:n=Dd;break;case 16:n=vi;break;case 536870912:n=Rd;break;default:n=vi}n=cp(n,np.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function np(e,t){if(ui=-1,di=0,H&6)throw Error(I(327));var n=e.callbackNode;if(Yn()&&e.callbackNode!==n)return null;var s=bi(e,e===me?xe:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=$i(e,s);else{t=s;var r=H;H|=2;var i=rp();(me!==e||xe!==t)&&(yt=null,rs=ae()+500,fn(e,t));do try{Og();break}catch(l){sp(e,l)}while(!0);Ll(),Mi.current=i,H=r,de!==null?t=0:(me=null,xe=0,t=pe)}if(t!==0){if(t===2&&(r=va(e),r!==0&&(s=r,t=Ga(e,r))),t===1)throw n=ur,fn(e,0),Dt(e,s),Me(e,ae()),n;if(t===6)Dt(e,s);else{if(r=e.current.alternate,!(s&30)&&!Ig(r)&&(t=$i(e,s),t===2&&(i=va(e),i!==0&&(s=i,t=Ga(e,i))),t===1))throw n=ur,fn(e,0),Dt(e,s),Me(e,ae()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(I(345));case 2:rn(e,Ae,yt);break;case 3:if(Dt(e,s),(s&130023424)===s&&(t=Hl+500-ae(),10<t)){if(bi(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Ce(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Ea(rn.bind(null,e,Ae,yt),t);break}rn(e,Ae,yt);break;case 4:if(Dt(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var a=31-it(s);i=1<<a,a=t[a],a>r&&(r=a),s&=~i}if(s=r,s=ae()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Ag(s/1960))-s,10<s){e.timeoutHandle=Ea(rn.bind(null,e,Ae,yt),s);break}rn(e,Ae,yt);break;case 5:rn(e,Ae,yt);break;default:throw Error(I(329))}}}return Me(e,ae()),e.callbackNode===n?np.bind(null,e):null}function Ga(e,t){var n=Hs;return e.current.memoizedState.isDehydrated&&(fn(e,t).flags|=256),e=$i(e,t),e!==2&&(t=Ae,Ae=n,t!==null&&qa(t)),e}function qa(e){Ae===null?Ae=e:Ae.push.apply(Ae,e)}function Ig(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],i=r.getSnapshot;r=r.value;try{if(!at(i(),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 Dt(e,t){for(t&=~Wl,t&=~to,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-it(t),s=1<<n;e[n]=-1,t&=~s}}function bu(e){if(H&6)throw Error(I(327));Yn();var t=bi(e,0);if(!(t&1))return Me(e,ae()),null;var n=$i(e,t);if(e.tag!==0&&n===2){var s=va(e);s!==0&&(t=s,n=Ga(e,s))}if(n===1)throw n=ur,fn(e,0),Dt(e,t),Me(e,ae()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,rn(e,Ae,yt),Me(e,ae()),null}function Vl(e,t){var n=H;H|=1;try{return e(t)}finally{H=n,H===0&&(rs=ae()+500,Ji&&en())}}function xn(e){$t!==null&&$t.tag===0&&!(H&6)&&Yn();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)&&en()}}function Kl(){Re=Fn.current,X(Fn)}function fn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,ag(n)),de!==null)for(n=de.return;n!==null;){var s=n;switch(Cl(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Si();break;case 3:ns(),X(Oe),X(ke),Ml();break;case 5:_l(s);break;case 4:ns();break;case 13:X(ne);break;case 19:X(ne);break;case 10:Al(s.type._context);break;case 22:case 23:Kl()}n=n.return}if(me=e,de=e=Gt(e.current,null),xe=Re=t,pe=0,ur=null,Wl=to=yn=0,Ae=Hs=null,ln!==null){for(t=0;t<ln.length;t++)if(n=ln[t],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,i=n.pending;if(i!==null){var a=i.next;i.next=r,s.next=a}n.pending=s}ln=null}return e}function sp(e,t){do{var n=de;try{if(Ll(),ai.current=_i,Oi){for(var s=se.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Oi=!1}if(gn=0,he=fe=se=null,Us=!1,ar=0,Ul.current=null,n===null||n.return===null){pe=1,ur=t,de=null;break}e:{var i=e,a=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=au(a);if(x!==null){x.flags&=-257,lu(x,a,l,i,t),x.mode&1&&ou(i,u,t),t=x,c=u;var b=t.updateQueue;if(b===null){var y=new Set;y.add(c),t.updateQueue=y}else b.add(c);break e}else{if(!(t&1)){ou(i,u,t),Gl();break e}c=Error(I(426))}}else if(ee&&l.mode&1){var j=au(a);if(j!==null){!(j.flags&65536)&&(j.flags|=256),lu(j,a,l,i,t),El(ss(c,l));break e}}i=c=ss(c,l),pe!==4&&(pe=2),Hs===null?Hs=[i]:Hs.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=Ff(i,c,t);eu(i,g);break e;case 1:l=c;var m=i.type,h=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Vt===null||!Vt.has(h)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Bf(i,l,t);eu(i,w);break e}}i=i.return}while(i!==null)}op(n)}catch(k){t=k,de===n&&n!==null&&(de=n=n.return);continue}break}while(!0)}function rp(){var e=Mi.current;return Mi.current=_i,e===null?_i:e}function Gl(){(pe===0||pe===3||pe===2)&&(pe=4),me===null||!(yn&268435455)&&!(to&268435455)||Dt(me,xe)}function $i(e,t){var n=H;H|=2;var s=rp();(me!==e||xe!==t)&&(yt=null,fn(e,t));do try{Pg();break}catch(r){sp(e,r)}while(!0);if(Ll(),H=n,Mi.current=s,de!==null)throw Error(I(261));return me=null,xe=0,pe}function Pg(){for(;de!==null;)ip(de)}function Og(){for(;de!==null&&!rm();)ip(de)}function ip(e){var t=lp(e.alternate,e,Re);e.memoizedProps=e.pendingProps,t===null?op(e):de=t,Ul.current=null}function op(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Cg(n,t),n!==null){n.flags&=32767,de=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{pe=6,de=null;return}}else if(n=Sg(n,t,Re),n!==null){de=n;return}if(t=t.sibling,t!==null){de=t;return}de=t=e}while(t!==null);pe===0&&(pe=5)}function rn(e,t,n){var s=K,r=qe.transition;try{qe.transition=null,K=1,_g(e,t,n,s)}finally{qe.transition=r,K=s}return null}function _g(e,t,n,s){do Yn();while($t!==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 i=n.lanes|n.childLanes;if(hm(e,i),e===me&&(de=me=null,xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Hr||(Hr=!0,cp(vi,function(){return Yn(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=qe.transition,qe.transition=null;var a=K;K=1;var l=H;H|=4,Ul.current=null,Tg(e,n),ep(n,e),eg(Sa),wi=!!Na,Sa=Na=null,e.current=n,Lg(n),im(),H=l,K=a,qe.transition=i}else e.current=n;if(Hr&&(Hr=!1,$t=e,Ri=r),i=e.pendingLanes,i===0&&(Vt=null),lm(n.stateNode),Me(e,ae()),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(Di)throw Di=!1,e=Va,Va=null,e;return Ri&1&&e.tag!==0&&Yn(),i=e.pendingLanes,i&1?e===Ka?Vs++:(Vs=0,Ka=e):Vs=0,en(),null}function Yn(){if($t!==null){var e=zd(Ri),t=qe.transition,n=K;try{if(qe.transition=null,K=16>e?16:e,$t===null)var s=!1;else{if(e=$t,$t=null,Ri=0,H&6)throw Error(I(331));var r=H;for(H|=4,_=e.current;_!==null;){var i=_,a=i.child;if(_.flags&16){var l=i.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:Ws(8,p,i)}var d=p.child;if(d!==null)d.return=p,_=d;else for(;_!==null;){p=_;var f=p.sibling,x=p.return;if(Jf(p),p===u){_=null;break}if(f!==null){f.return=x,_=f;break}_=x}}}var b=i.alternate;if(b!==null){var y=b.child;if(y!==null){b.child=null;do{var j=y.sibling;y.sibling=null,y=j}while(y!==null)}}_=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,_=a;else e:for(;_!==null;){if(i=_,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ws(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,_=g;break e}_=i.return}}var m=e.current;for(_=m;_!==null;){a=_;var h=a.child;if(a.subtreeFlags&2064&&h!==null)h.return=a,_=h;else e:for(a=m;_!==null;){if(l=_,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:eo(9,l)}}catch(k){ie(l,l.return,k)}if(l===a){_=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,_=w;break e}_=l.return}}if(H=r,en(),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Ki,e)}catch{}s=!0}return s}finally{K=n,qe.transition=t}}return!1}function wu(e,t,n){t=ss(n,t),t=Ff(e,t,1),e=Ht(e,t,1),t=Ce(),e!==null&&(yr(e,1,t),Me(e,t))}function ie(e,t,n){if(e.tag===3)wu(e,e,n);else for(;t!==null;){if(t.tag===3){wu(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Vt===null||!Vt.has(s))){e=ss(n,e),e=Bf(t,e,1),t=Ht(t,e,1),e=Ce(),t!==null&&(yr(t,1,e),Me(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,me===e&&(xe&n)===n&&(pe===4||pe===3&&(xe&130023424)===xe&&500>ae()-Hl?fn(e,0):Wl|=n),Me(e,t)}function ap(e,t){t===0&&(e.mode&1?(t=_r,_r<<=1,!(_r&130023424)&&(_r=4194304)):t=1);var n=Ce();e=Ct(e,t),e!==null&&(yr(e,t,n),Me(e,n))}function Dg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ap(e,n)}function Rg(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),ap(e,n)}var lp;lp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Oe.current)Ie=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ie=!1,Ng(e,t,n);Ie=!!(e.flags&131072)}else Ie=!1,ee&&t.flags&1048576&&ff(t,Ti,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;ci(e,t),e=t.pendingProps;var r=Zn(t,ke.current);qn(t,n),r=Rl(null,t,s,e,r,n);var i=$l();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)?(i=!0,Ci(t)):i=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Pl(t),r.updater=Zi,t.stateNode=r,r._reactInternals=t,_a(t,s,e,n),t=Ra(null,t,s,!0,i,n)):(t.tag=0,ee&&i&&Sl(t),Ne(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(ci(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=zg(s),e=nt(s,e),r){case 0:t=Da(null,t,s,e,n);break e;case 1:t=du(null,t,s,e,n);break e;case 11:t=cu(null,t,s,e,n);break e;case 14:t=uu(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),Da(e,t,s,r,n);case 1:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),du(e,t,s,r,n);case 3:e:{if(Vf(t),e===null)throw Error(I(387));s=t.pendingProps,i=t.memoizedState,r=i.element,xf(e,t),Ii(t,s,null,n);var a=t.memoizedState;if(s=a.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){r=ss(Error(I(423)),t),t=fu(e,t,s,n,r);break e}else if(s!==r){r=ss(Error(I(424)),t),t=fu(e,t,s,n,r);break e}else for(ze=Wt(t.stateNode.containerInfo.firstChild),Fe=t,ee=!0,rt=null,n=gf(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(es(),s===r){t=Et(e,t,n);break e}Ne(e,t,s,n)}t=t.child}return t;case 5:return vf(t),e===null&&Ia(t),s=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,a=r.children,Ca(s,r)?a=null:i!==null&&Ca(s,i)&&(t.flags|=32),Hf(e,t),Ne(e,t,a,n),t.child;case 6:return e===null&&Ia(t),null;case 13:return Kf(e,t,n);case 4:return Ol(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ts(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),cu(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,i=t.memoizedProps,a=r.value,q(Li,s._currentValue),s._currentValue=a,i!==null)if(at(i.value,a)){if(i.children===r.children&&!Oe.current){t=Et(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===s){if(i.tag===1){c=jt(-1,n&-n),c.tag=2;var u=i.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}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Pa(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(I(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Pa(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Ne(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps.children,qn(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),uu(e,t,s,r,n);case 15:return Uf(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),ci(e,t),t.tag=1,_e(s)?(e=!0,Ci(t)):e=!1,qn(t,n),zf(t,s,r),_a(t,s,r,n),Ra(null,t,s,!0,e,n);case 19:return Gf(e,t,n);case 22:return Wf(e,t,n)}throw Error(I(156,t.tag))};function cp(e,t){return Md(e,t)}function $g(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 $g(e,t,n,s)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function zg(e){if(typeof e=="function")return ql(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pl)return 11;if(e===hl)return 14}return 2}function Gt(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 fi(e,t,n,s,r,i){var a=2;if(s=e,typeof e=="function")ql(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case An:return pn(n.children,r,i,t);case fl:a=8,r|=8;break;case ra:return e=Ge(12,n,t,r|2),e.elementType=ra,e.lanes=i,e;case ia:return e=Ge(13,n,t,r),e.elementType=ia,e.lanes=i,e;case oa:return e=Ge(19,n,t,r),e.elementType=oa,e.lanes=i,e;case xd:return no(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gd:a=10;break e;case yd:a=9;break e;case pl:a=11;break e;case hl:a=14;break e;case Pt:a=16,s=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Ge(a,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function pn(e,t,n,s){return e=Ge(7,e,s,t),e.lanes=n,e}function no(e,t,n,s){return e=Ge(22,e,s,t),e.elementType=xd,e.lanes=n,e.stateNode={isHidden:!1},e}function Ho(e,t,n){return e=Ge(6,e,null,t),e.lanes=n,e}function Vo(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 Fg(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=So(0),this.expirationTimes=So(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=So(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function Yl(e,t,n,s,r,i,a,l,c){return e=new Fg(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ge(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:s,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Pl(i),e}function Bg(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ln,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function up(e){if(!e)return Jt;e=e._reactInternals;e:{if(wn(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 uf(e,n,t)}return t}function dp(e,t,n,s,r,i,a,l,c){return e=Yl(n,s,!0,e,r,i,a,l,c),e.context=up(null),n=e.current,s=Ce(),r=Kt(n),i=jt(s,r),i.callback=t??null,Ht(n,i,r),e.current.lanes=r,yr(e,r,s),Me(e,s),e}function so(e,t,n,s){var r=t.current,i=Ce(),a=Kt(r);return n=up(n),t.context===null?t.context=n:t.pendingContext=n,t=jt(i,a),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Ht(r,t,a),e!==null&&(ot(e,r,a,i),oi(e,r,a)),a}function zi(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 ju(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ql(e,t){ju(e,t),(e=e.alternate)&&ju(e,t)}function Ug(){return null}var fp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jl(e){this._internalRoot=e}ro.prototype.render=Jl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));so(e,t,null,null)};ro.prototype.unmount=Jl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xn(function(){so(null,e,null,null)}),t[St]=null}};function ro(e){this._internalRoot=e}ro.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ud();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mt.length&&t!==0&&t<Mt[n].priority;n++);Mt.splice(n,0,e),n===0&&Hd(e)}};function Xl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function io(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ku(){}function Wg(e,t,n,s,r){if(r){if(typeof s=="function"){var i=s;s=function(){var u=zi(a);i.call(u)}}var a=dp(t,s,e,0,null,!1,!1,"",ku);return e._reactRootContainer=a,e[St]=a.current,nr(e.nodeType===8?e.parentNode:e),xn(),a}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var l=s;s=function(){var u=zi(c);l.call(u)}}var c=Yl(e,0,!1,null,null,!1,!1,"",ku);return e._reactRootContainer=c,e[St]=c.current,nr(e.nodeType===8?e.parentNode:e),xn(function(){so(t,c,n,s)}),c}function oo(e,t,n,s,r){var i=n._reactRootContainer;if(i){var a=i;if(typeof r=="function"){var l=r;r=function(){var c=zi(a);l.call(c)}}so(t,a,e,r)}else a=Wg(n,t,e,r,s);return zi(a)}Fd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ps(t.pendingLanes);n!==0&&(yl(t,n|1),Me(t,ae()),!(H&6)&&(rs=ae()+500,en()))}break;case 13:xn(function(){var s=Ct(e,1);if(s!==null){var r=Ce();ot(s,e,1,r)}}),Ql(e,1)}};xl=function(e){if(e.tag===13){var t=Ct(e,134217728);if(t!==null){var n=Ce();ot(t,e,134217728,n)}Ql(e,134217728)}};Bd=function(e){if(e.tag===13){var t=Kt(e),n=Ct(e,t);if(n!==null){var s=Ce();ot(n,e,t,s)}Ql(e,t)}};Ud=function(){return K};Wd=function(e,t){var n=K;try{return K=e,t()}finally{K=n}};ga=function(e,t,n){switch(t){case"input":if(ca(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=Qi(s);if(!r)throw Error(I(90));bd(s),ca(s,r)}}}break;case"textarea":jd(e,n);break;case"select":t=n.value,t!=null&&Hn(e,!!n.multiple,t,!1)}};Ld=Vl;Ad=xn;var Hg={usingClientEntryPoint:!1,Events:[vr,_n,Qi,Ed,Td,Vl]},Cs={findFiberByHostInstance:an,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Vg={bundleType:Cs.bundleType,version:Cs.version,rendererPackageName:Cs.rendererPackageName,rendererConfig:Cs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Tt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Od(e),e===null?null:e.stateNode},findFiberByHostInstance:Cs.findFiberByHostInstance||Ug,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 Vr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vr.isDisabled&&Vr.supportsFiber)try{Ki=Vr.inject(Vg),pt=Vr}catch{}}Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hg;Ue.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Xl(t))throw Error(I(200));return Bg(e,t,null,n)};Ue.createRoot=function(e,t){if(!Xl(e))throw Error(I(299));var n=!1,s="",r=fp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=Yl(e,1,!1,null,null,n,!1,s,r),e[St]=t.current,nr(e.nodeType===8?e.parentNode:e),new Jl(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=Od(t),e=e===null?null:e.stateNode,e};Ue.flushSync=function(e){return xn(e)};Ue.hydrate=function(e,t,n){if(!io(t))throw Error(I(200));return oo(null,e,t,!0,n)};Ue.hydrateRoot=function(e,t,n){if(!Xl(e))throw Error(I(405));var s=n!=null&&n.hydratedSources||null,r=!1,i="",a=fp;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=dp(t,null,e,1,n??null,r,!1,i,a),e[St]=t.current,nr(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 ro(t)};Ue.render=function(e,t,n){if(!io(t))throw Error(I(200));return oo(null,e,t,!1,n)};Ue.unmountComponentAtNode=function(e){if(!io(e))throw Error(I(40));return e._reactRootContainer?(xn(function(){oo(null,null,e,!1,function(){e._reactRootContainer=null,e[St]=null})}),!0):!1};Ue.unstable_batchedUpdates=Vl;Ue.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!io(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return oo(e,t,n,!1,s)};Ue.version="18.3.1-next-f1338f8080-20240426";function pp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pp)}catch(e){console.error(e)}}pp(),fd.exports=Ue;var Kg=fd.exports,hp,Nu=Kg;hp=Nu.createRoot,Nu.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 dr(){return dr=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},dr.apply(null,arguments)}var zt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(zt||(zt={}));const Su="popstate";function Gg(e){e===void 0&&(e={});function t(s,r){let{pathname:i,search:a,hash:l}=s.location;return Ya("",{pathname:i,search:a,hash:l},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:Fi(r)}return Yg(t,n,null,e)}function oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zl(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qg(){return Math.random().toString(36).substr(2,8)}function Cu(e,t){return{usr:e.state,key:e.key,idx:t}}function Ya(e,t,n,s){return n===void 0&&(n=null),dr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ds(t):t,{state:n,key:t&&t.key||s||qg()})}function Fi(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 ds(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 Yg(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:i=!1}=s,a=r.history,l=zt.Pop,c=null,u=p();u==null&&(u=0,a.replaceState(dr({},a.state,{idx:u}),""));function p(){return(a.state||{idx:null}).idx}function d(){l=zt.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=zt.Push;let m=Ya(y.location,j,g);u=p()+1;let h=Cu(m,u),w=y.createHref(m);try{a.pushState(h,"",w)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(w)}i&&c&&c({action:l,location:y.location,delta:1})}function x(j,g){l=zt.Replace;let m=Ya(y.location,j,g);u=p();let h=Cu(m,u),w=y.createHref(m);a.replaceState(h,"",w),i&&c&&c({action:l,location:y.location,delta:0})}function b(j){let g=r.location.origin!=="null"?r.location.origin:r.location.href,m=typeof j=="string"?j:Fi(j);return m=m.replace(/ $/,"%20"),oe(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let y={get action(){return l},get location(){return e(r,a)},listen(j){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(Su,d),c=j,()=>{r.removeEventListener(Su,d),c=null}},createHref(j){return t(r,j)},createURL:b,encodeLocation(j){let g=b(j);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:x,go(j){return a.go(j)}};return y}var Eu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Eu||(Eu={}));function Qg(e,t,n){return n===void 0&&(n="/"),Jg(e,t,n)}function Jg(e,t,n,s){let r=typeof t=="string"?ds(t):t,i=is(r.pathname||"/",n);if(i==null)return null;let a=mp(e);Xg(a);let l=null,c=cy(i);for(let u=0;l==null&&u<a.length;++u)l=ay(a[u],c);return l}function mp(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(oe(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);i.children&&i.children.length>0&&(oe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),mp(i.children,t,p,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:iy(u,i.index),routesMeta:p})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))r(i,a);else for(let c of gp(i.path))r(i,a,c)}),t}function gp(e){let t=e.split("/");if(t.length===0)return[];let[n,...s]=t,r=n.endsWith("?"),i=n.replace(/\?$/,"");if(s.length===0)return r?[i,""]:[i];let a=gp(s.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),r&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Xg(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 Zg=/^:[\w-]+$/,ey=3,ty=2,ny=1,sy=10,ry=-2,Tu=e=>e==="*";function iy(e,t){let n=e.split("/"),s=n.length;return n.some(Tu)&&(s+=ry),t&&(s+=ty),n.filter(r=>!Tu(r)).reduce((r,i)=>r+(Zg.test(i)?ey:i===""?ny:sy),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 ay(e,t,n){let{routesMeta:s}=e,r={},i="/",a=[];for(let l=0;l<s.length;++l){let c=s[l],u=l===s.length-1,p=i==="/"?t:t.slice(i.length)||"/",d=Qa({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),f=c.route;if(!d)return null;Object.assign(r,d.params),a.push({params:r,pathname:qt([i,d.pathname]),pathnameBase:hy(qt([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=qt([i,d.pathnameBase]))}return a}function Qa(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,s]=ly(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],a=i.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]||"";a=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const b=l[d];return x&&!b?u[f]=void 0:u[f]=(b||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function ly(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zl(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,(a,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 cy(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zl(!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 is(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 uy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dy=e=>uy.test(e);function fy(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?ds(e):e,i;if(n)if(dy(n))i=n;else{if(n.includes("//")){let a=n;n=vp(n),Zl(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+n))}n.startsWith("/")?i=Lu(n.substring(1),"/"):i=Lu(n,t)}else i=t;return{pathname:i,search:my(s),hash:gy(r)}}function Lu(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 Ko(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 py(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function yp(e,t){let n=py(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function xp(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=ds(e):(r=dr({},e),oe(!r.pathname||!r.pathname.includes("?"),Ko("?","pathname","search",r)),oe(!r.pathname||!r.pathname.includes("#"),Ko("#","pathname","hash",r)),oe(!r.search||!r.search.includes("#"),Ko("#","search","hash",r)));let i=e===""||r.pathname==="",a=i?"/":r.pathname,l;if(a==null)l=n;else{let d=t.length-1;if(!s&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}l=d>=0?t[d]:"/"}let c=fy(r,l),u=a&&a!=="/"&&a.endsWith("/"),p=(i||a===".")&&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(/^\/*/,"/"),my=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,gy=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function yy(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 xy=["get",...bp];new Set(xy);/**
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 fr(){return fr=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},fr.apply(null,arguments)}const ao=v.createContext(null),wp=v.createContext(null),tn=v.createContext(null),lo=v.createContext(null),Lt=v.createContext({outlet:null,matches:[],isDataRoute:!1}),jp=v.createContext(null);function vy(e,t){let{relative:n}=t===void 0?{}:t;wr()||oe(!1);let{basename:s,navigator:r}=v.useContext(tn),{hash:i,pathname:a,search:l}=co(e,{relative:n}),c=a;return s!=="/"&&(c=a==="/"?s:qt([s,a])),r.createHref({pathname:c,search:l,hash:i})}function wr(){return v.useContext(lo)!=null}function jn(){return wr()||oe(!1),v.useContext(lo).location}function kp(e){v.useContext(tn).static||v.useLayoutEffect(e)}function by(){let{isDataRoute:e}=v.useContext(Lt);return e?Dy():wy()}function wy(){wr()||oe(!1);let e=v.useContext(ao),{basename:t,future:n,navigator:s}=v.useContext(tn),{matches:r}=v.useContext(Lt),{pathname:i}=jn(),a=JSON.stringify(yp(r,n.v7_relativeSplatPath)),l=v.useRef(!1);return kp(()=>{l.current=!0}),v.useCallback(function(u,p){if(p===void 0&&(p={}),!l.current)return;if(typeof u=="number"){s.go(u);return}let d=xp(u,JSON.parse(a),i,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,a,i,e])}const jy=v.createContext(null);function ky(e){let t=v.useContext(Lt).outlet;return t&&v.createElement(jy.Provider,{value:e},t)}function Ny(){let{matches:e}=v.useContext(Lt),t=e[e.length-1];return t?t.params:{}}function co(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=v.useContext(tn),{matches:r}=v.useContext(Lt),{pathname:i}=jn(),a=JSON.stringify(yp(r,s.v7_relativeSplatPath));return v.useMemo(()=>xp(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function Sy(e,t){return Cy(e,t)}function Cy(e,t,n,s){wr()||oe(!1);let{navigator:r}=v.useContext(tn),{matches:i}=v.useContext(Lt),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=jn(),p;if(t){var d;let j=typeof t=="string"?ds(t):t;c==="/"||(d=j.pathname)!=null&&d.startsWith(c)||oe(!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 b=Qg(e,{pathname:x}),y=Iy(b&&b.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])})),i,n,s);return t&&y?v.createElement(lo.Provider,{value:{location:fr({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:zt.Pop}},y):y}function Ey(){let e=My(),t=yy(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 v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:r},n):null,null)}const Ty=v.createElement(Ey,null);class Ly extends v.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?v.createElement(Lt.Provider,{value:this.props.routeContext},v.createElement(jp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ay(e){let{routeContext:t,match:n,children:s}=e,r=v.useContext(ao);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),v.createElement(Lt.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 i;if(!n)return null;if(n.errors)e=n.matches;else if((i=s)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(r=n)==null?void 0:r.errors;if(l!=null){let p=a.findIndex(d=>d.route.id&&(l==null?void 0:l[d.route.id])!==void 0);p>=0||oe(!1),a=a.slice(0,Math.min(a.length,p+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let p=0;p<a.length;p++){let d=a[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=p),d.route.id){let{loaderData:f,errors:x}=n,b=d.route.loader&&f[d.route.id]===void 0&&(!x||x[d.route.id]===void 0);if(d.route.lazy||b){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((p,d,f)=>{let x,b=!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"),b=!0,j=null):u===f&&(b=!0,j=d.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,f+1)),m=()=>{let h;return x?h=y:b?h=j:d.route.Component?h=v.createElement(d.route.Component,null):d.route.element?h=d.route.element:h=p,v.createElement(Ay,{match:d,routeContext:{outlet:p,matches:g,isDataRoute:n!=null},children:h})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?v.createElement(Ly,{location:n.location,revalidation:n.revalidation,component:y,error:x,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var Np=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Np||{}),Sp=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}(Sp||{});function Py(e){let t=v.useContext(ao);return t||oe(!1),t}function Oy(e){let t=v.useContext(wp);return t||oe(!1),t}function _y(e){let t=v.useContext(Lt);return t||oe(!1),t}function Cp(e){let t=_y(),n=t.matches[t.matches.length-1];return n.route.id||oe(!1),n.route.id}function My(){var e;let t=v.useContext(jp),n=Oy(),s=Cp();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function Dy(){let{router:e}=Py(Np.UseNavigateStable),t=Cp(Sp.UseNavigateStable),n=v.useRef(!1);return kp(()=>{n.current=!0}),v.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,fr({fromRouteId:t},i)))},[e,t])}const Au={};function Ry(e,t,n){Au[e]||(Au[e]=!0)}function $y(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function zy(e){return ky(e.context)}function ge(e){oe(!1)}function Fy(e){let{basename:t="/",children:n=null,location:s,navigationType:r=zt.Pop,navigator:i,static:a=!1,future:l}=e;wr()&&oe(!1);let c=t.replace(/^\/*/,"/"),u=v.useMemo(()=>({basename:c,navigator:i,static:a,future:fr({v7_relativeSplatPath:!1},l)}),[c,l,i,a]);typeof s=="string"&&(s=ds(s));let{pathname:p="/",search:d="",hash:f="",state:x=null,key:b="default"}=s,y=v.useMemo(()=>{let j=is(p,c);return j==null?null:{location:{pathname:j,search:d,hash:f,state:x,key:b},navigationType:r}},[c,p,d,f,x,b,r]);return y==null?null:v.createElement(tn.Provider,{value:u},v.createElement(lo.Provider,{children:n,value:y}))}function By(e){let{children:t,location:n}=e;return Sy(Ja(t),n)}new Promise(()=>{});function Ja(e,t){t===void 0&&(t=[]);let n=[];return v.Children.forEach(e,(s,r)=>{if(!v.isValidElement(s))return;let i=[...t,r];if(s.type===v.Fragment){n.push.apply(n,Ja(s.props.children,i));return}s.type!==ge&&oe(!1),!s.props.index||!s.props.children||oe(!1);let a={id:s.props.id||i.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&&(a.children=Ja(s.props.children,i)),n.push(a)}),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 Bi(){return Bi=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},Bi.apply(null,arguments)}function Ep(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 Uy(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Wy(e,t){return e.button===0&&(!t||t==="_self")&&!Uy(e)}const Hy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Vy=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Ky="6";try{window.__reactRouterVersion=Ky}catch{}const Gy=v.createContext({isTransitioning:!1}),qy="startTransition",Iu=Mh[qy];function Yy(e){let{basename:t,children:n,future:s,window:r}=e,i=v.useRef();i.current==null&&(i.current=Gg({window:r,v5Compat:!0}));let a=i.current,[l,c]=v.useState({action:a.action,location:a.location}),{v7_startTransition:u}=s||{},p=v.useCallback(d=>{u&&Iu?Iu(()=>c(d)):c(d)},[c,u]);return v.useLayoutEffect(()=>a.listen(p),[a,p]),v.useEffect(()=>$y(s),[s]),v.createElement(Fy,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:s})}const Qy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Jy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$e=v.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:i,replace:a,state:l,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,f=Ep(t,Hy),{basename:x}=v.useContext(tn),b,y=!1;if(typeof u=="string"&&Jy.test(u)&&(b=u,Qy))try{let h=new URL(window.location.href),w=u.startsWith("//")?new URL(h.protocol+u):new URL(u),k=is(w.pathname,x);w.origin===h.origin&&k!=null?u=k+w.search+w.hash:y=!0}catch{}let j=vy(u,{relative:r}),g=Zy(u,{replace:a,state:l,target:c,preventScrollReset:p,relative:r,viewTransition:d});function m(h){s&&s(h),h.defaultPrevented||g(h)}return v.createElement("a",Bi({},f,{href:b||j,onClick:y||i?s:m,ref:n,target:c}))}),ut=v.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:r=!1,className:i="",end:a=!1,style:l,to:c,viewTransition:u,children:p}=t,d=Ep(t,Vy),f=co(c,{relative:d.relative}),x=jn(),b=v.useContext(wp),{navigator:y,basename:j}=v.useContext(tn),g=b!=null&&e0(f)&&u===!0,m=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,h=x.pathname,w=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(h=h.toLowerCase(),w=w?w.toLowerCase():null,m=m.toLowerCase()),w&&j&&(w=is(w,j)||w);const k=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let C=h===m||!a&&h.startsWith(m)&&h.charAt(k)==="/",S=w!=null&&(w===m||!a&&w.startsWith(m)&&w.charAt(m.length)==="/"),N={isActive:C,isPending:S,isTransitioning:g},T=C?s:void 0,A;typeof i=="function"?A=i(N):A=[i,C?"active":null,S?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let z=typeof l=="function"?l(N):l;return v.createElement($e,Bi({},d,{"aria-current":T,className:A,ref:n,style:z,to:c,viewTransition:u}),typeof p=="function"?p(N):p)});var Xa;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Xa||(Xa={}));var Pu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Pu||(Pu={}));function Xy(e){let t=v.useContext(ao);return t||oe(!1),t}function Zy(e,t){let{target:n,replace:s,state:r,preventScrollReset:i,relative:a,viewTransition:l}=t===void 0?{}:t,c=by(),u=jn(),p=co(e,{relative:a});return v.useCallback(d=>{if(Wy(d,n)){d.preventDefault();let f=s!==void 0?s:Fi(u)===Fi(p);c(e,{replace:f,state:r,preventScrollReset:i,relative:a,viewTransition:l})}},[u,c,p,s,r,n,e,i,a,l])}function e0(e,t){t===void 0&&(t={});let n=v.useContext(Gy);n==null&&oe(!1);let{basename:s}=Xy(Xa.useViewTransitionState),r=co(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=is(n.currentLocation.pathname,s)||n.currentLocation.pathname,a=is(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Qa(r.pathname,a)!=null||Qa(r.pathname,i)!=null}function t0(e){const[t,n]=v.useState(null),s=v.useRef(0),r=v.useCallback(()=>{if(e.length===0){n(null);return}let i=e[0];for(const a of e){const l=document.getElementById(a);l&&l.getBoundingClientRect().top<=100&&(i=a)}n(i)},[e]);return v.useEffect(()=>{if(e.length===0)return;r();const i=()=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(r)};return window.addEventListener("scroll",i,{passive:!0}),()=>{window.removeEventListener("scroll",i),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),i=await r.json();if(!r.ok)throw new Error(i.error??`HTTP ${r.status}`);return i}const F={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 uo(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 Tp={"command.success":"success","command.error":"error","command.denied":"error","command.start":"neutral","auth.failed":"warning","approval.granted":"success","approval.rejected":"error","config.changed":"neutral"},n0={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"},s0={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 o.jsx("span",{className:`inline-flex items-center font-mono font-medium border ${s0[t]} ${n0[e]} ${n}`,children:s})}function r0(){const[e,t]=v.useState(null),[n,s]=v.useState([]),r=v.useCallback(()=>{F.getStatus().then(t).catch(()=>t(null)),F.getAudit({limit:"10"}).then(a=>s(a.events)).catch(()=>{})},[]);v.useEffect(()=>{r();const a=setInterval(r,3e4);return()=>clearInterval(a)},[r]);function i(a){const l=Date.now()-new Date(a).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 o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Dashboard"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 border border-base-300 mb-8",children:[o.jsxs("div",{className:"p-3 sm:border-r sm:border-r-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Daemon"}),o.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.ok?"text-success":"text-error"}`,children:e!=null&&e.ok?"Running":"Offline"})]}),o.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0 sm:border-r sm:border-r-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Extension"}),o.jsx("div",{className:`font-display font-semibold text-sm ${e!=null&&e.extensionConnected?"text-success":"text-error"}`,children:e!=null&&e.extensionConnected?"Connected":"Disconnected"})]}),o.jsxs("div",{className:"p-3 border-t border-t-base-300 sm:border-t-0",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connectors"}),o.jsxs("div",{className:"font-display font-semibold text-sm",children:[(e==null?void 0:e.connectorCount)??0," loaded"]})]})]}),o.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Recent activity"}),n.length===0?o.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No recent activity"}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"Run a connector to see events here."})]}):o.jsx("div",{className:"overflow-x-auto border border-base-300",children:o.jsxs("table",{className:"table table-sm w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-base-200",children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Connector"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Duration"})]})}),o.jsx("tbody",{children:n.map(a=>o.jsxs("tr",{className:"hover:bg-base-200",children:[o.jsx("td",{className:"opacity-50 text-sm font-mono",children:i(a.timestamp)}),o.jsx("td",{className:"font-mono text-sm",children:a.connector}),o.jsx("td",{children:o.jsx(U,{variant:Tp[a.type]??"neutral",children:a.type})}),o.jsx("td",{className:"text-sm font-mono",children:a.durationMs?`${(a.durationMs/1e3).toFixed(1)}s`:"—"})]},a.id))})]})})]})}function mt({label:e}){return o.jsxs("div",{className:"flex items-center gap-3 py-4",children:[o.jsx("span",{className:"loading loading-spinner loading-md"}),e&&o.jsx("span",{className:"text-sm opacity-60",children:e})]})}function i0({c:e,approvingKey:t,onApprove:n}){const[s,r]=e.key.split("/");return o.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:[o.jsxs("div",{className:"flex-1",children:[o.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[o.jsx("span",{className:"font-mono font-semibold text-sm",children:r}),o.jsx(U,{size:"sm",children:e.access}),e.capabilities.map(i=>o.jsx(U,{size:"sm",children:i},i)),e.isHighRisk&&e.isApproved&&o.jsx(U,{variant:"success",size:"sm",children:"Approved"}),e.isHighRisk&&!e.isApproved&&o.jsx(U,{variant:"warning",size:"sm",children:"Blocked — requires approval"})]}),o.jsx("p",{className:"text-sm opacity-60 mt-1",children:e.description}),e.domains.length>0&&o.jsxs("div",{className:"text-xs opacity-40 mt-1",children:["Domains: ",e.domains.join(", ")]})]}),o.jsxs("div",{className:"flex gap-2 ml-4 shrink-0",children:[e.isHighRisk&&!e.isApproved&&o.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&&o.jsx($e,{to:e.appRoute,className:"btn btn-sm btn-primary",children:"Open App"}),o.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,i]=v.useState(!1);return o.jsxs("div",{id:`conn-${e}`,className:"border border-base-300 p-4 scroll-mt-4",children:[o.jsxs("button",{className:"flex items-center gap-2 w-full text-left",onClick:()=>i(!r),children:[o.jsx("span",{className:"text-xs opacity-50",children:r?"▸":"▾"}),o.jsx("span",{className:"font-mono font-semibold",children:e}),o.jsxs("span",{className:"text-xs opacity-40",children:[t.length," ",t.length===1?"connector":"connectors"]})]}),!r&&o.jsx("div",{className:"space-y-2 mt-3",children:t.map(a=>o.jsx(i0,{c:a,approvingKey:n,onApprove:s},a.key))})]})}function a0(){const[e,t]=v.useState([]),[n,s]=v.useState([]),[r,i]=v.useState(!0),[a,l]=v.useState(null),c=v.useCallback(()=>{const d=F.getConnectors(),f=F.getConfig().catch(()=>({ok:!1,config:{}}));Promise.all([d,f]).then(([x,b])=>{t(x.connectors);const y=b.config.security??{};s(y.approvedHighRisk??[])}).catch(()=>{}).finally(()=>i(!1))},[]);v.useEffect(()=>{c()},[c]);const u=v.useCallback(async d=>{l(d);try{const f=[...n,d];await F.setConfig("security.approvedHighRisk",JSON.stringify(f)),c()}catch{}finally{l(null)}},[n,c]),p=v.useMemo(()=>uo(e),[e]);return r?o.jsx(mt,{label:"Loading connectors..."}):o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Connectors"}),e.length===0?o.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No connectors loaded"}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"Check the daemon is running and connectors are installed in ~/.commandgarden/connectors/"})]}):o.jsx("div",{className:"space-y-3",children:p.map(([d,f])=>o.jsx(o0,{site:d,connectors:f,approvingKey:a,onApprove:u},d))})]})}function ec(){const[e,t]=v.useState(!1),[n,s]=v.useState(null),[r,i]=v.useState(null),[a,l]=v.useState(!1),[c,u]=v.useState(null),p=v.useCallback(()=>{t(!1),s(null),i(null),l(!1),u(null)},[]),d=v.useCallback(async(x,b)=>{t(!0),i(null),s(null),l(!1),u(null);try{const y=await F.run(x,b);if(y.requiresApproval&&y.requestId){l(!0);const j=new EventSource(`/api/run/events/${y.requestId}`);j.addEventListener("approval",g=>{const m=JSON.parse(g.data);u(m.approvalId)}),j.addEventListener("result",g=>{const m=JSON.parse(g.data);!m.ok&&m.error?i(m.error):s(m),l(!1),t(!1),j.close()}),j.onerror=()=>{i("SSE connection lost"),l(!1),t(!1),j.close()}}else!y.ok&&y.error?(i(y.error),t(!1)):(s(y),t(!1))}catch(y){i(y instanceof Error?y.message:"Unknown error"),t(!1)}},[]),f=v.useCallback(async x=>{if(c)try{await F.approve(c,x),x||(l(!1),t(!1),i("Approval rejected"))}catch(b){i(b instanceof Error?b.message:"Approval failed")}},[c]);return{running:e,result:n,error:r,approvalPending:a,approvalId:c,run:d,handleApproval:f,reset:p}}function l0(){const{site:e,name:t}=Ny(),n=`${e}/${t}`,[s,r]=v.useState(null),[i,a]=v.useState(!0),[l,c]=v.useState({}),[u,p]=v.useState(null),{running:d,result:f,error:x,approvalPending:b,approvalId:y,run:j,handleApproval:g}=ec();v.useEffect(()=>{!e||!t||F.getConnector(e,t).then(h=>{r(h.connector);const w={};for(const k of h.connector.args??[])w[k.name]="";c(w)}).catch(h=>p(h.message)).finally(()=>a(!1))},[e,t]);const m=v.useCallback(async()=>{const h={};for(const[w,k]of Object.entries(l))k&&(h[w]=k);await j(n,h)},[l,n,j]);return i?o.jsx(mt,{label:"Loading connector..."}):s?o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx($e,{to:"/connectors",className:"text-sm opacity-50 hover:opacity-80",children:"Connectors"}),o.jsx("span",{className:"text-sm opacity-30",children:"/"})]}),o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-2",children:n}),o.jsx("p",{className:"text-sm opacity-50 mb-5",children:s.description}),o.jsxs("div",{className:"border border-base-300 p-5 mb-6",children:[o.jsx("h3",{className:"font-display font-semibold mb-4",children:"Arguments"}),o.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[(s.args??[]).map(h=>o.jsxs("label",{className:"form-control",children:[o.jsxs("span",{className:"label-text mb-1 text-sm",children:[h.name,!h.required&&o.jsx("span",{className:"opacity-40",children:" (optional)"})]}),o.jsx("input",{type:"text",className:"input input-bordered input-sm w-40",placeholder:h.help,value:l[h.name]??"",onChange:w=>c(k=>({...k,[h.name]:w.target.value})),pattern:h.pattern}),h.help&&o.jsx("span",{className:"text-xs opacity-40 mt-1",children:h.help})]},h.name)),o.jsx("button",{className:"btn btn-primary btn-sm",onClick:m,disabled:d,children:d?"Running...":"Run connector"})]})]}),d&&!b&&o.jsx(mt,{label:`Running ${n} — this drives your browser and may take up to a minute.`}),b&&o.jsxs("div",{className:"alert alert-warning mb-4",children:[o.jsx("span",{children:"This connector requires approval before proceeding."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>g(!0),disabled:!y,children:"Approve"}),o.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>g(!1),disabled:!y,children:"Reject"})]})]}),x&&o.jsx("div",{className:"alert alert-error mb-4",children:o.jsx("span",{children:x})}),f&&o.jsxs("div",{className:"border border-base-300 p-5",children:[o.jsxs("div",{className:"flex items-center justify-between mb-3",children:[o.jsx("h3",{className:"font-semibold",children:"Results"}),o.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?o.jsx("p",{className:"text-sm opacity-50",children:"No results returned."}):o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"table table-sm",children:[o.jsx("thead",{children:o.jsx("tr",{children:(f.columns??Object.keys(f.data[0])).map(h=>o.jsx("th",{children:h},h))})}),o.jsx("tbody",{children:f.data.map((h,w)=>o.jsx("tr",{children:(f.columns??Object.keys(h)).map(k=>o.jsx("td",{className:"text-sm",children:String(h[k]??"")},k))},w))})]})})]})]}):o.jsx("div",{className:"text-error",children:u??`Connector not found: ${n}`})}const c0=[{label:"Last 24 hours",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"Last 90 days",hours:2160}],u0=["command.start","command.success","command.error","command.denied","auth.failed","approval.granted","approval.rejected","config.changed"],Nn=20;function d0(){const[e,t]=v.useState([]),[n,s]=v.useState([]),[r,i]=v.useState(!0),[a,l]=v.useState(168),[c,u]=v.useState(""),[p,d]=v.useState(""),[f,x]=v.useState(null),[b,y]=v.useState(0);v.useEffect(()=>{F.getConnectors().then(h=>s(h.connectors)).catch(()=>{})},[]);const j=v.useCallback(()=>{i(!0);const h={since:new Date(Date.now()-a*36e5).toISOString(),limit:String(Nn+b+1)};c&&(h.type=c),p&&(h.connector=p),F.getAudit(h).then(w=>t(w.events)).catch(()=>{}).finally(()=>i(!1))},[a,c,p,b]);v.useEffect(()=>{j();const h=setInterval(j,6e4);return()=>clearInterval(h)},[j]);const g=e.slice(b,b+Nn),m=e.length>b+Nn;return o.jsxs("div",{className:"max-w-5xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Audit Log"}),o.jsxs("div",{className:"flex flex-wrap items-end gap-3 mb-6",children:[o.jsxs("label",{className:"form-control",children:[o.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Time range"}),o.jsx("select",{className:"select select-bordered select-sm",value:a,onChange:h=>{l(Number(h.target.value)),y(0)},children:c0.map(h=>o.jsx("option",{value:h.hours,children:h.label},h.hours))})]}),o.jsxs("label",{className:"form-control",children:[o.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Event type"}),o.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:h=>{u(h.target.value),y(0)},children:[o.jsx("option",{value:"",children:"All types"}),u0.map(h=>o.jsx("option",{value:h,children:h},h))]})]}),o.jsxs("label",{className:"form-control",children:[o.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Connector"}),o.jsxs("select",{className:"select select-bordered select-sm",value:p,onChange:h=>{d(h.target.value),y(0)},children:[o.jsx("option",{value:"",children:"All connectors"}),n.map(h=>o.jsx("option",{value:h.key,children:h.key},h.key))]})]})]}),r&&e.length===0?o.jsx(mt,{label:"Loading audit events..."}):o.jsxs(o.Fragment,{children:[g.length===0?o.jsx("p",{className:"text-sm opacity-50",children:"No events match the current filters."}):o.jsx("div",{className:"overflow-x-auto border border-base-300",children:o.jsxs("table",{className:"table table-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Time"}),o.jsx("th",{children:"Type"}),o.jsx("th",{children:"Connector"}),o.jsx("th",{children:"User"}),o.jsx("th",{children:"Duration"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:g.map(h=>o.jsxs(v.Fragment,{children:[o.jsxs("tr",{className:"cursor-pointer hover:bg-base-200",onClick:()=>x(f===h.id?null:h.id),role:"button","aria-expanded":f===h.id,tabIndex:0,onKeyDown:w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),x(f===h.id?null:h.id))},children:[o.jsx("td",{className:"text-sm font-mono",children:new Date(h.timestamp).toLocaleString()}),o.jsx("td",{children:o.jsx(U,{variant:Tp[h.type]??"neutral",children:h.type})}),o.jsx("td",{className:"font-mono text-sm",children:h.connector||"—"}),o.jsx("td",{className:"text-sm",children:h.user}),o.jsx("td",{className:"text-sm font-mono",children:h.durationMs?`${(h.durationMs/1e3).toFixed(1)}s`:"—"}),o.jsx("td",{className:"text-xs opacity-40","aria-hidden":"true",children:f===h.id?"▲":"▼"})]},h.id),f===h.id&&o.jsx("tr",{children:o.jsxs("td",{colSpan:6,className:"bg-base-200/50 p-4",children:[o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm mb-3",children:[o.jsxs("div",{children:[o.jsx("span",{className:"opacity-50",children:"ID:"})," ",o.jsx("span",{className:"font-mono text-xs",children:h.id})]}),o.jsxs("div",{children:[o.jsx("span",{className:"opacity-50",children:"Correlation:"})," ",o.jsx("span",{className:"font-mono text-xs",children:h.correlationId??"—"})]}),h.connectorHash&&o.jsxs("div",{children:[o.jsx("span",{className:"opacity-50",children:"Connector hash:"})," ",o.jsx("span",{className:"font-mono text-xs",children:h.connectorHash})]}),h.error&&o.jsxs("div",{className:"col-span-2",children:[o.jsx("span",{className:"opacity-50",children:"Error:"})," ",o.jsx("span",{className:"text-error",children:h.error})]}),h.args&&o.jsxs("div",{className:"col-span-2",children:[o.jsx("span",{className:"opacity-50",children:"Args:"})," ",o.jsx("span",{className:"font-mono text-xs",children:JSON.stringify(h.args)})]}),h.domains&&h.domains.length>0&&o.jsxs("div",{children:[o.jsx("span",{className:"opacity-50",children:"Domains:"})," ",h.domains.join(", ")]}),h.capabilities&&h.capabilities.length>0&&o.jsxs("div",{children:[o.jsx("span",{className:"opacity-50",children:"Capabilities:"})," ",h.capabilities.join(", ")]})]}),h.steps&&h.steps.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"font-semibold text-sm mb-2",children:"Pipeline steps"}),o.jsxs("table",{className:"table table-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"#"}),o.jsx("th",{children:"Step"}),o.jsx("th",{children:"Capability"}),o.jsx("th",{children:"Duration"}),o.jsx("th",{children:"Error"})]})}),o.jsx("tbody",{children:h.steps.map((w,k)=>o.jsxs("tr",{children:[o.jsx("td",{children:k+1}),o.jsx("td",{children:w.step}),o.jsx("td",{children:w.capability}),o.jsxs("td",{children:[(w.durationMs/1e3).toFixed(2),"s"]}),o.jsx("td",{className:"text-error",children:w.error??""})]},k))})]})]})]})},`${h.id}-detail`)]},h.id))})]})}),o.jsxs("div",{className:"flex justify-between items-center mt-4",children:[o.jsx("button",{className:"btn btn-sm btn-ghost",disabled:b===0,onClick:()=>y(Math.max(0,b-Nn)),children:"Previous"}),o.jsxs("span",{className:"text-sm opacity-50",children:["Showing ",b+1,"–",Math.min(b+Nn,e.length),m?"":` of ${e.length}`]}),o.jsx("button",{className:"btn btn-sm btn-ghost",disabled:!m,onClick:()=>y(b+Nn),children:"Next"})]})]})]})}const tc=Symbol.for("yaml.alias"),Za=Symbol.for("yaml.document"),Yt=Symbol.for("yaml.map"),Lp=Symbol.for("yaml.pair"),gt=Symbol.for("yaml.scalar"),fs=Symbol.for("yaml.seq"),Xe=Symbol.for("yaml.node.type"),ps=e=>!!e&&typeof e=="object"&&e[Xe]===tc,jr=e=>!!e&&typeof e=="object"&&e[Xe]===Za,kr=e=>!!e&&typeof e=="object"&&e[Xe]===Yt,ue=e=>!!e&&typeof e=="object"&&e[Xe]===Lp,Y=e=>!!e&&typeof e=="object"&&e[Xe]===gt,Nr=e=>!!e&&typeof e=="object"&&e[Xe]===fs;function le(e){if(e&&typeof e=="object")switch(e[Xe]){case Yt:case fs:return!0}return!1}function ce(e){if(e&&typeof e=="object")switch(e[Xe]){case tc:case Yt:case gt:case fs:return!0}return!1}const Ap=e=>(Y(e)||le(e))&&!!e.anchor,on=Symbol("break visit"),f0=Symbol("skip children"),Ks=Symbol("remove node");function hs(e,t){const n=p0(t);jr(e)?Bn(null,e.contents,n,Object.freeze([e]))===Ks&&(e.contents=null):Bn(null,e,n,Object.freeze([]))}hs.BREAK=on;hs.SKIP=f0;hs.REMOVE=Ks;function Bn(e,t,n,s){const r=h0(e,t,n,s);if(ce(r)||ue(r))return m0(e,s,r),Bn(e,r,n,s);if(typeof r!="symbol"){if(le(t)){s=Object.freeze(s.concat(t));for(let i=0;i<t.items.length;++i){const a=Bn(i,t.items[i],n,s);if(typeof a=="number")i=a-1;else{if(a===on)return on;a===Ks&&(t.items.splice(i,1),i-=1)}}}else if(ue(t)){s=Object.freeze(s.concat(t));const i=Bn("key",t.key,n,s);if(i===on)return on;i===Ks&&(t.key=null);const a=Bn("value",t.value,n,s);if(a===on)return on;a===Ks&&(t.value=null)}}return r}function p0(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,i,a,l,c;if(typeof n=="function")return n(e,t,s);if(kr(t))return(r=n.Map)==null?void 0:r.call(n,e,t,s);if(Nr(t))return(i=n.Seq)==null?void 0:i.call(n,e,t,s);if(ue(t))return(a=n.Pair)==null?void 0:a.call(n,e,t,s);if(Y(t))return(l=n.Scalar)==null?void 0:l.call(n,e,t,s);if(ps(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,s)}function m0(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(jr(s))s.contents=n;else{const r=ps(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const g0={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},y0=e=>e.replace(/[!,[\]{}]/g,t=>g0[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[i,a]=s;return this.tags[i]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,s.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[i]=s;if(i==="1.1"||i==="1.2")return this.yaml.version=i,!0;{const a=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,a),!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 a=t.slice(2,-1);return a==="!"||a==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),a)}const[,s,r]=t.match(/^(.*!)([^!]*)$/s);r||n(`The ${t} tag has no suffix`);const i=this.tags[s];if(i)try{return i+decodeURIComponent(r)}catch(a){return n(String(a)),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+y0(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 i={};hs(t.contents,(a,l)=>{ce(l)&&l.tag&&(i[l.tag]=!0)}),r=Object.keys(i)}else r=[];for(const[i,a]of s)i==="!!"&&a==="tag:yaml.org,2002:"||(!t||r.some(l=>l.startsWith(a)))&&n.push(`%TAG ${i} ${a}`);return n.join(`
68
+ `)}}Se.defaultYaml={explicit:!1,version:"1.2"};Se.defaultTags={"!!":"tag:yaml.org,2002:"};function Ip(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 hs(e,{Value(n,s){s.anchor&&t.add(s.anchor)}}),t}function Op(e,t){for(let n=1;;++n){const s=`${e}${n}`;if(!t.has(s))return s}}function x0(e,t){const n=[],s=new Map;let r=null;return{onAnchor:i=>{n.push(i),r??(r=Pp(e));const a=Op(t,r);return r.add(a),a},setAnchors:()=>{for(const i of n){const a=s.get(i);if(typeof a=="object"&&a.anchor&&(Y(a.node)||le(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=i,l}}},sourceObjects:s}}function Un(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){const a=s[r],l=Un(e,s,String(r),a);l===void 0?delete s[r]:l!==a&&(s[r]=l)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const i=s.get(r),a=Un(e,s,r,i);a===void 0?s.delete(r):a!==i&&s.set(r,a)}else if(s instanceof Set)for(const r of Array.from(s)){const i=Un(e,s,r,r);i===void 0?s.delete(r):i!==r&&(s.delete(r),s.add(i))}else for(const[r,i]of Object.entries(s)){const a=Un(e,s,r,i);a===void 0?delete s[r]:a!==i&&(s[r]=a)}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||!Ap(e))return e.toJSON(t,n);const s={aliasCount:0,count:1,res:void 0};n.anchors.set(e,s),n.onCreate=i=>{s.res=i,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 nc{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:i}={}){if(!jr(t))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},l=Ye(this,"",a);if(typeof r=="function")for(const{count:c,res:u}of a.anchors.values())r(u,c);return typeof i=="function"?Un(i,{"":l},"",l):l}}class sc extends nc{constructor(t){super(tc),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=[],hs(t,{Node:(i,a)=>{(ps(a)||Ap(a))&&s.push(a)}}),n&&(n.aliasResolveCache=s));let r;for(const i of s){if(i===this)break;i.anchor===this.source&&(r=i)}return r}toJSON(t,n){if(!n)return{source:this.source};const{anchors:s,doc:r,maxAliasCount:i}=n,a=this.resolve(r,n);if(!a){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let l=s.get(a);if(l||(Ye(a,null,n),l=s.get(a)),(l==null?void 0:l.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=pi(r,a,s)),l.count*l.aliasCount>i)){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(Ip(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const i=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(i)}if(t.implicitKey)return`${r} `}return r}}function pi(e,t,n){if(ps(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 i=pi(e,r,n);i>s&&(s=i)}return s}else if(ue(t)){const s=pi(e,t.key,n),r=pi(e,t.value,n);return Math.max(s,r)}return 1}const _p=e=>!e||typeof e!="function"&&typeof e!="object";class B extends nc{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 v0="tag:yaml.org,2002:";function b0(e,t,n){if(t){const s=n.filter(i=>i.tag===t),r=s.find(i=>!i.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 pr(e,t,n){var d,f,x;if(jr(e)&&(e=e.contents),ce(e))return e;if(ue(e)){const b=(f=(d=n.schema[Yt]).createNode)==null?void 0:f.call(d,n.schema,null,n);return b.items.push(e),b}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:s,onAnchor:r,onTagObj:i,schema:a,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 sc(c.anchor);c={anchor:null,node:null},l.set(e,c)}t!=null&&t.startsWith("!!")&&(t=v0+t.slice(2));let u=b0(e,t,a.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const b=new B(e);return c&&(c.node=b),b}u=e instanceof Map?a[Yt]:Symbol.iterator in Object(e)?a[fs]:a[Yt]}i&&(i(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 Ui(e,t,n){let s=n;for(let r=t.length-1;r>=0;--r){const i=t[r];if(typeof i=="number"&&Number.isInteger(i)&&i>=0){const a=[];a[i]=s,s=a}else s=new Map([[i,s]])}return pr(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 _s=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class Mp extends nc{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(_s(t))this.add(n);else{const[s,...r]=t,i=this.get(s,!0);if(le(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,Ui(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,i=this.get(s,!0);return r.length===0?!n&&Y(i)?i.value:i:le(i)?i.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 i=this.get(s,!0);if(le(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,Ui(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 un=(e,t,n)=>e.endsWith(`
69
+ `)?wt(n,t):n.includes(`
70
+ `)?`
71
+ `+wt(n,t):(e.endsWith(" ")?"":" ")+n,Dp="flow",el="block",hi="quoted";function fo(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return e;r<i&&(i=0);const c=Math.max(1+i,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,i)?u.push(0):d=r-s);let f,x,b=!1,y=-1,j=-1,g=-1;n===el&&(y=Ou(e,y,t.length),y!==-1&&(d=y+c));for(let h;h=e[y+=1];){if(n===hi&&h==="\\"){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(h===`
72
+ `)n===el&&(y=Ou(e,y,t.length)),d=y+t.length+c,f=void 0;else{if(h===" "&&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=h,h=e[y+=1],b=!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 b=!0}x=h}if(b&&l&&l(),u.length===0)return e;a&&a();let m=e.slice(0,u[0]);for(let h=0;h<u.length;++h){const w=u[h],k=u[h+1]||e.length;w===0?m=`
75
+ ${t}${e.slice(0,k)}`:(n===hi&&p[w]&&(m+=`${e[w]}\\`),m+=`
76
+ ${t}${e.slice(w+1,k)}`)}return m}function Ou(e,t,n){let s=t,r=t+1,i=e[r];for(;i===" "||i===" ";)if(t<r+n)i=e[++t];else{do i=e[++t];while(i&&i!==`
77
+ `);s=t,r=t+1,i=e[r]}return s}const po=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ho=e=>/^(%|---|\.\.\.)/m.test(e);function j0(e,t,n){if(!t||t<0)return!1;const s=t-n,r=e.length;if(r<=s)return!1;for(let i=0,a=0;i<r;++i)if(e[i]===`
78
+ `){if(i-a>s)return!0;if(a=i+1,r-a<=s)return!1}return!0}function Gs(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(ho(e)?" ":"");let a="",l=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(a+=n.slice(l,c)+"\\ ",c+=1,l=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{a+=n.slice(l,c);const p=n.substr(c+2,4);switch(p){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:p.substr(0,2)==="00"?a+="\\x"+p.substr(2):a+=n.substr(c,6)}c+=5,l=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<r)c+=1;else{for(a+=n.slice(l,c)+`
79
+
80
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)a+=`
81
+ `,c+=2;a+=i,n[c+2]===" "&&(a+="\\"),c+=1,l=c+1}break;default:c+=1}return a=l?a+n.slice(l):n,s?a:fo(a,i,hi,po(t,!1))}function tl(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
82
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Gs(e,t);const n=t.indent||(ho(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
83
+ ${n}`)+"'";return t.implicitKey?s:fo(s,n,Dp,po(t,!1))}function Wn(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=Gs;else{const r=e.includes('"'),i=e.includes("'");r&&!i?s=tl:i&&!r?s=Gs:s=n?tl:Gs}return s(e,t)}let nl;try{nl=new RegExp(`(^|(?<!
84
+ ))
85
+ +(?!
86
+ |$)`,"g")}catch{nl=/\n+(?!\n|$)/g}function mi({comment:e,type:t,value:n},s,r,i){const{blockQuote:a,commentString:l,lineWidth:c}=s.options;if(!a||/\n[\t ]+$/.test(n))return Wn(n,s);const u=s.indent||(s.forceBlockIndent||ho(n)?" ":""),p=a==="literal"?!0:a==="folded"||t===B.BLOCK_FOLDED?!1:t===B.BLOCK_LITERAL?!0:!j0(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 b=x.indexOf(`
90
+ `);b===-1?d="-":n===x||b!==x.length-1?(d="+",i&&i()):d="",x&&(n=n.slice(0,-x.length),x[x.length-1]===`
91
+ `&&(x=x.slice(0,-1)),x=x.replace(nl,`$&${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 m=n.substring(0,g<j?g+1:j);m&&(n=n.substring(m.length),m=m.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=po(s,!0);a!=="folded"&&t!==B.BLOCK_FOLDED&&(S.onOverflow=()=>{C=!0});const N=fo(`${m}${k}${x}`,u,el,S);if(!C)return`>${w}
94
+ ${u}${N}`}return n=n.replace(/\n+/g,`$&${u}`),`|${w}
95
+ ${u}${m}${n}${x}`}function k0(e,t,n,s){const{type:r,value:i}=e,{actualString:a,implicitKey:l,indent:c,indentStep:u,inFlow:p}=t;if(l&&i.includes(`
96
+ `)||p&&/[[\]{},]/.test(i))return Wn(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return l||p||!i.includes(`
97
+ `)?Wn(i,t):mi(e,t,n,s);if(!l&&!p&&r!==B.PLAIN&&i.includes(`
98
+ `))return mi(e,t,n,s);if(ho(i)){if(c==="")return t.forceBlockIndent=!0,mi(e,t,n,s);if(l&&c===u)return Wn(i,t)}const d=i.replace(/\n+/g,`$&
99
+ ${c}`);if(a){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:b}=t.doc.schema;if(b.some(f)||x!=null&&x.some(f))return Wn(i,t)}return l?d:fo(d,c,Dp,po(t,!1))}function rc(e,t,n,s){const{implicitKey:r,inFlow:i}=t,a=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(a.value)&&(l=B.QUOTE_DOUBLE);const c=p=>{switch(p){case B.BLOCK_FOLDED:case B.BLOCK_LITERAL:return r||i?Wn(a.value,t):mi(a,t,n,s);case B.QUOTE_DOUBLE:return Gs(a.value,t);case B.QUOTE_SINGLE:return tl(a.value,t);case B.PLAIN:return k0(a,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 Rp(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 N0(e,t){var r;if(t.tag){const i=e.filter(a=>a.tag===t.tag);if(i.length>0)return i.find(a=>a.format===t.format)??i[0]}let n,s;if(Y(t)){s=t.value;let i=e.filter(a=>{var l;return(l=a.identify)==null?void 0:l.call(a,s)});if(i.length>1){const a=i.filter(l=>l.test);a.length>0&&(i=a)}n=i.find(a=>a.format===t.format)??i.find(a=>!a.format)}else s=t,n=e.find(i=>i.nodeClass&&s instanceof i.nodeClass);if(!n){const i=((r=s==null?void 0:s.constructor)==null?void 0:r.name)??(s===null?"null":typeof s);throw new Error(`Tag not resolved for ${i} value`)}return n}function S0(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],i=(Y(e)||le(e))&&e.anchor;i&&Ip(i)&&(n.add(i),r.push(`&${i}`));const a=e.tag??(t.default?null:t.tag);return a&&r.push(s.directives.tagString(a)),r.join(" ")}function os(e,t,n,s){var c;if(ue(e))return e.toString(t,n,s);if(ps(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 i=ce(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=N0(t.doc.schema.tags,i));const a=S0(i,r,t);a.length>0&&(t.indentAtStart=(t.indentAtStart??0)+a.length+1);const l=typeof r.stringify=="function"?r.stringify(i,t,n,s):Y(i)?rc(i,t,n,s):i.toString(t,n,s);return a?Y(i)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
100
+ ${t.indent}${l}`:l}function C0({key:e,value:t},n,s,r){const{allNullValues:i,doc:a,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||!i),indent:l+c});let b=!1,y=!1,j=os(e,n,()=>b=!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(i||t==null)return b&&s&&s(),j===""?"?":x?`? ${j}`:j}else if(i&&!d||t==null&&x)return j=`? ${j}`,f&&!b?j+=un(j,n.indent,u(f)):y&&r&&r(),j;b&&(f=null),x?(f&&(j+=un(j,n.indent,u(f))),j=`? ${j}
101
+ ${l}:`):(j=`${j}:`,f&&(j+=un(j,n.indent,u(f))));let g,m,h;ce(t)?(g=!!t.spaceBefore,m=t.commentBefore,h=t.comment):(g=!1,m=null,h=null,t&&typeof t=="object"&&(t=a.createNode(t))),n.implicitKey=!1,!x&&!f&&Y(t)&&(n.indentAtStart=j.length+1),y=!1,!p&&c.length>=2&&!n.inFlow&&!x&&Nr(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||m){if(C=g?`
102
+ `:"",m){const S=u(m);C+=`
103
+ ${wt(S,n.indent)}`}k===""&&!n.inFlow?C===`
104
+ `&&h&&(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 z=!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)&&(z=!0)}z||(C=`
109
+ ${n.indent}`)}}else(k===""||k[0]===`
110
+ `)&&(C="");return j+=C+k,n.inFlow?w&&s&&s():h&&!w?j+=un(j,n.indent,u(h)):y&&r&&r(),j}function $p(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Kr="<<",kt={identify:e=>e===Kr||typeof e=="symbol"&&e.description===Kr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new B(Symbol(Kr)),{addToJSMap:zp}),stringify:()=>Kr},E0=(e,t)=>(kt.identify(t)||Y(t)&&(!t.type||t.type===B.PLAIN)&&kt.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===kt.tag&&n.default));function zp(e,t,n){const s=Fp(e,n);if(Nr(s))for(const r of s.items)Go(e,t,r);else if(Array.isArray(s))for(const r of s)Go(e,t,r);else Go(e,t,s)}function Go(e,t,n){const s=Fp(e,n);if(!kr(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[i,a]of r)t instanceof Map?t.has(i)||t.set(i,a):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0});return t}function Fp(e,t){return e&&ps(t)?t.resolve(e.doc,e):t}function Bp(e,t,{key:n,value:s}){if(ce(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(E0(e,n))zp(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 i=T0(n,r,e),a=Ye(s,i,e);i in t?Object.defineProperty(t,i,{value:a,writable:!0,enumerable:!0,configurable:!0}):t[i]=a}}return t}function T0(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ce(e)&&(n!=null&&n.doc)){const s=Rp(n.doc,{});s.anchors=new Set;for(const i of n.anchors.keys())s.anchors.add(i.anchor);s.inFlow=!0,s.inStringifyKey=!0;const r=e.toString(s);if(!n.mapKeyWarned){let i=JSON.stringify(r);i.length>40&&(i=i.substring(0,36)+'..."'),$p(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function ic(e,t,n){const s=pr(e,void 0,n),r=pr(t,void 0,n);return new Ee(s,r)}class Ee{constructor(t,n=null){Object.defineProperty(this,Xe,{value:Lp}),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 Bp(n,s,this)}toString(t,n,s){return t!=null&&t.doc?C0(this,t,n,s):JSON.stringify(this)}}function Up(e,t,n){return(t.inFlow??e.flow?A0:L0)(e,t,n)}function L0({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:a,onComment:l}){const{indent:c,options:{commentString:u}}=n,p=Object.assign({},n,{indent:i,type:null});let d=!1;const f=[];for(let b=0;b<t.length;++b){const y=t[b];let j=null;if(ce(y))!d&&y.spaceBefore&&f.push(""),Wi(n,f,y.commentBefore,d),y.comment&&(j=y.comment);else if(ue(y)){const m=ce(y.key)?y.key:null;m&&(!d&&m.spaceBefore&&f.push(""),Wi(n,f,m.commentBefore,d))}d=!1;let g=os(y,p,()=>j=null,()=>d=!0);j&&(g+=un(g,i,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 b=1;b<f.length;++b){const y=f[b];x+=y?`
111
+ ${c}${y}`:`
112
+ `}}return e?(x+=`
113
+ `+wt(u(e),c),l&&l()):d&&a&&a(),x}function A0({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:i,flowCollectionPadding:a,options:{commentString:l}}=t;s+=i;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,p=0;const d=[];for(let b=0;b<e.length;++b){const y=e[b];let j=null;if(ce(y))y.spaceBefore&&d.push(""),Wi(t,d,y.commentBefore,!1),y.comment&&(j=y.comment);else if(ue(y)){const m=ce(y.key)?y.key:null;m&&(m.spaceBefore&&d.push(""),Wi(t,d,m.commentBefore,!1),m.comment&&(u=!0));const h=ce(y.value)?y.value:null;h?(h.comment&&(j=h.comment),h.commentBefore&&(u=!0)):y.value==null&&(m!=null&&m.comment)&&(j=m.comment)}j&&(u=!0);let g=os(y,c,()=>j=null);u||(u=d.length>p||g.includes(`
114
+ `)),b<e.length-1?g+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=d.reduce((m,h)=>m+h.length+2,2)+(g.length+2)>t.options.lineWidth)),u&&(g+=",")),j&&(g+=un(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 b=d.reduce((y,j)=>y+j.length+2,2);u=t.options.lineWidth>0&&b>t.options.lineWidth}if(u){let b=f;for(const y of d)b+=y?`
115
+ ${i}${r}${y}`:`
116
+ `;return`${b}
117
+ ${r}${x}`}else return`${f}${a}${d.join(" ")}${a}${x}`}function Wi({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const i=wt(t(s),e);n.push(i.trimStart())}}function dn(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(Yt,t),this.items=[]}static from(t,n,s){const{keepUndefined:r,replacer:i}=s,a=new this(t),l=(c,u)=>{if(typeof i=="function")u=i.call(n,c,u);else if(Array.isArray(i)&&!i.includes(c))return;(u!==void 0||r)&&a.items.push(ic(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"&&a.items.sort(t.sortMapEntries),a}add(t,n){var a;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=dn(this.items,s.key),i=(a=this.schema)==null?void 0:a.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);Y(r.value)&&_p(s.value)?r.value.value=s.value:r.value=s.value}else if(i){const l=this.items.findIndex(c=>i(s,c)<0);l===-1?this.items.push(s):this.items.splice(l,0,s)}else this.items.push(s)}delete(t){const n=dn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=dn(this.items,t),r=s==null?void 0:s.value;return(!n&&Y(r)?r.value:r)??void 0}has(t){return!!dn(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 i of this.items)Bp(n,r,i);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})),Up(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const ms={collection:"map",default:!0,nodeClass:Ke,tag:"tag:yaml.org,2002:map",resolve(e,t){return kr(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ke.from(e,t,n)};class vn extends Mp{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(fs,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Gr(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=Gr(t);if(typeof s!="number")return;const r=this.items[s];return!n&&Y(r)?r.value:r}has(t){const n=Gr(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=Gr(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[s];Y(r)&&_p(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 i of this.items)s.push(Ye(i,String(r++),n));return s}toString(t,n,s){return t?Up(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,i=new this(t);if(n&&Symbol.iterator in Object(n)){let a=0;for(let l of n){if(typeof r=="function"){const c=n instanceof Set?l:String(a++);l=r.call(n,c,l)}i.items.push(pr(l,void 0,s))}}return i}}function Gr(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 gs={collection:"seq",default:!0,nodeClass:vn,tag:"tag:yaml.org,2002:seq",resolve(e,t){return Nr(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>vn.from(e,t,n)},mo={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),rc(e,t,n,s)}},go={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"&&go.test.test(e)?e:t.options.nullStr},oc={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&&oc.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 lt({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 i=Object.is(s,-0)?"-0":JSON.stringify(s);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let a=i.indexOf(".");a<0&&(a=i.length,i+=".");let l=t-(i.length-a-1);for(;l-- >0;)i+="0"}return i}const Wp={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:lt},Hp={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():lt(e)}},Vp={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:lt},yo=e=>typeof e=="bigint"||Number.isInteger(e),ac=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Kp(e,t,n){const{value:s}=e;return yo(s)&&s>=0?n+s.toString(t):lt(e)}const Gp={identify:e=>yo(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>ac(e,2,8,n),stringify:e=>Kp(e,8,"0o")},qp={identify:yo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>ac(e,0,10,n),stringify:lt},Yp={identify:e=>yo(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>ac(e,2,16,n),stringify:e=>Kp(e,16,"0x")},I0=[ms,gs,mo,go,oc,Gp,qp,Yp,Wp,Hp,Vp];function _u(e){return typeof e=="bigint"||Number.isInteger(e)}const qr=({value:e})=>JSON.stringify(e),P0=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:qr},{identify:e=>e==null,createNode:()=>new B(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:qr},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:qr},{identify:_u,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})=>_u(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:qr}],O0={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},_0=[ms,gs].concat(P0,O0),lc={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,i){if(!n)return"";const a=n;let l;if(typeof btoa=="function"){let c="";for(let u=0;u<a.length;++u)c+=String.fromCharCode(a[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 rc({comment:e,type:t,value:l},s,r,i)}};function Qp(e,t){if(Nr(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!ue(s)){if(kr(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 i=r.value??r.key;i.comment=i.comment?`${s.comment}
120
+ ${i.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 Jp(e,t,n){const{replacer:s}=n,r=new vn(e);r.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let a of t){typeof s=="function"&&(a=s.call(t,String(i++),a));let l,c;if(Array.isArray(a))if(a.length===2)l=a[0],c=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const u=Object.keys(a);if(u.length===1)l=u[0],c=a[l];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else l=a;r.items.push(ic(l,c,n))}return r}const cc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Qp,createNode:Jp};class Qn extends vn{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=Qn.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 i,a;if(ue(r)?(i=Ye(r.key,"",n),a=Ye(r.value,i,n)):i=Ye(r,"",n),s.has(i))throw new Error("Ordered maps must not include duplicate keys");s.set(i,a)}return s}static from(t,n,s){const r=Jp(t,n,s),i=new this;return i.items=r.items,i}}Qn.tag="tag:yaml.org,2002:omap";const uc={collection:"seq",identify:e=>e instanceof Map,nodeClass:Qn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Qp(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 Qn,n)},createNode:(e,t,n)=>Qn.from(e,t,n)};function Xp({value:e,source:t},n){return t&&(e?Zp:eh).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Zp={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:Xp},eh={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:Xp},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:lt},D0={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():lt(e)}},R0={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:lt},Sr=e=>typeof e=="bigint"||Number.isInteger(e);function xo(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 a=BigInt(e);return r==="-"?BigInt(-1)*a:a}const i=parseInt(e,n);return r==="-"?-1*i:i}function dc(e,t,n){const{value:s}=e;if(Sr(s)){const r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return lt(e)}const $0={identify:Sr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>xo(e,2,2,n),stringify:e=>dc(e,2,"0b")},z0={identify:Sr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>xo(e,1,8,n),stringify:e=>dc(e,8,"0")},F0={identify:Sr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>xo(e,0,10,n),stringify:lt},B0={identify:Sr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>xo(e,2,16,n),stringify:e=>dc(e,16,"0x")};class Jn extends Ke{constructor(t){super(t),this.tag=Jn.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),dn(this.items,n.key)||this.items.push(n)}get(t,n){const s=dn(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=dn(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,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let a of n)typeof r=="function"&&(a=r.call(n,a,a)),i.items.push(ic(a,null,s));return i}}Jn.tag="tag:yaml.org,2002:set";const fc={collection:"map",identify:e=>e instanceof Set,nodeClass:Jn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Jn.from(e,t,n),resolve(e,t){if(kr(e)){if(e.hasAllNullValues(!0))return Object.assign(new Jn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function pc(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,r=a=>t?BigInt(a):Number(a),i=s.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return n==="-"?r(-1)*i:i}function th(e){let{value:t}=e,n=a=>a;if(typeof t=="bigint")n=a=>BigInt(a);else if(isNaN(t)||!isFinite(t))return lt(e);let s="";t<0&&(s="-",t*=n(-1));const r=n(60),i=[t%r];return t<60?i.unshift(0):(t=(t-i[0])/r,i.unshift(t%r),t>=60&&(t=(t-i[0])/r,i.unshift(t))),s+i.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const nh={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})=>pc(e,n),stringify:th},sh={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=>pc(e,!1),stringify:th},vo={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(vo.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,i,a,l]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,r,i||0,a||0,l||0,c);const p=t[8];if(p&&p!=="Z"){let d=pc(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$/,""))??""},Mu=[ms,gs,mo,go,Zp,eh,$0,z0,F0,B0,M0,D0,R0,lc,kt,uc,cc,fc,nh,sh,vo],Du=new Map([["core",I0],["failsafe",[ms,gs,mo]],["json",_0],["yaml11",Mu],["yaml-1.1",Mu]]),Ru={binary:lc,bool:oc,float:Vp,floatExp:Hp,floatNaN:Wp,floatTime:sh,int:qp,intHex:Yp,intOct:Gp,intTime:nh,map:ms,merge:kt,null:go,omap:uc,pairs:cc,seq:gs,set:fc,timestamp:vo},U0={"tag:yaml.org,2002:binary":lc,"tag:yaml.org,2002:merge":kt,"tag:yaml.org,2002:omap":uc,"tag:yaml.org,2002:pairs":cc,"tag:yaml.org,2002:set":fc,"tag:yaml.org,2002:timestamp":vo};function qo(e,t,n){const s=Du.get(t);if(s&&!e)return n&&!s.includes(kt)?s.concat(kt):s.slice();let r=s;if(!r)if(Array.isArray(e))r=[];else{const i=Array.from(Du.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(const i of e)r=r.concat(i);else typeof e=="function"&&(r=e(r.slice()));return n&&(r=r.concat(kt)),r.reduce((i,a)=>{const l=typeof a=="string"?Ru[a]:a;if(!l){const c=JSON.stringify(a),u=Object.keys(Ru).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(l)||i.push(l),i},[])}const W0=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class hc{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(t)?qo(t,"compat"):t?qo(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?U0:{},this.tags=qo(n,this.name,s),this.toStringOptions=l??null,Object.defineProperty(this,Yt,{value:ms}),Object.defineProperty(this,gt,{value:mo}),Object.defineProperty(this,fs,{value:gs}),this.sortMapEntries=typeof a=="function"?a:a===!0?W0:null}clone(){const t=Object.create(hc.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function H0(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=Rp(e,t),{commentString:i}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(wt(u,""))}let a=!1,l=null;if(e.contents){if(ce(e.contents)){if(e.contents.spaceBefore&&s&&n.push(""),e.contents.commentBefore){const d=i(e.contents.commentBefore);n.push(wt(d,""))}r.forceBlockIndent=!!e.comment,l=e.contents.comment}const u=l?void 0:()=>a=!0;let p=os(e.contents,r,()=>l=null,u);l&&(p+=un(p,"",i(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=i(e.comment);u.includes(`
121
+ `)?(n.push("..."),n.push(wt(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&a&&(u=u.replace(/^\n+/,"")),u&&((!a||l)&&n[n.length-1]!==""&&n.push(""),n.push(wt(i(u),"")))}return n.join(`
122
+ `)+`
123
+ `}class Cr{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Xe,{value:Za});let r=null;typeof n=="function"||Array.isArray(n)?r=n:s===void 0&&n&&(s=n,n=void 0);const i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},s);this.options=i;let{version:a}=i;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new Se({version:a}),this.setSchema(a,s),this.contents=t===void 0?null:this.createNode(t,r,s)}clone(){const t=Object.create(Cr.prototype,{[Xe]:{value:Za}});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){Sn(this.contents)&&this.contents.add(t)}addIn(t,n){Sn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=Pp(this);t.anchor=!n||s.has(n)?Op(n||"a",s):n}return new sc(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=m=>typeof m=="number"||m instanceof String||m 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:i,anchorPrefix:a,flow:l,keepUndefined:c,onTagObj:u,tag:p}=s??{},{onAnchor:d,setAnchors:f,sourceObjects:x}=x0(this,a||"a"),b={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:x},y=pr(t,p,b);return l&&le(y)&&(y.flow=!0),f(),y}createPair(t,n,s={}){const r=this.createNode(t,null,s),i=this.createNode(n,null,s);return new Ee(r,i)}delete(t){return Sn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return _s(t)?this.contents==null?!1:(this.contents=null,!0):Sn(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 _s(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 _s(t)?this.contents!==void 0:le(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Ui(this.schema,[t],n):Sn(this.contents)&&this.contents.set(t,n)}setIn(t,n){_s(t)?this.contents=n:this.contents==null?this.contents=Ui(this.schema,Array.from(t),n):Sn(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 hc(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:i,reviver:a}={}){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 i=="function")for(const{count:u,res:p}of l.anchors.values())i(p,u);return typeof a=="function"?Un(a,{"":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 H0(this,t)}}function Sn(e){if(le(e))return!0;throw new Error("Expected a YAML collection as document contents")}class rh extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}}class Ms extends rh{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class V0 extends rh{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const $u=(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 i=r-1,a=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&a.length>80){const l=Math.min(i-39,a.length-79);a="…"+a.substring(l),i-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),s>1&&/^ *$/.test(a.substring(0,i))){let l=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);l.length>80&&(l=l.substring(0,79)+`…
124
+ `),a=l+a}if(/[^ ]/.test(a)){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-i)));const u=" ".repeat(i)+"^".repeat(l);n.message+=`:
125
+
126
+ ${a}
127
+ ${u}
128
+ `}};function as(e,{flow:t,indicator:n,next:s,offset:r,onError:i,parentIndent:a,startOnNewline:l}){let c=!1,u=l,p=l,d="",f="",x=!1,b=!1,y=null,j=null,g=null,m=null,h=null,w=null,k=null;for(const N of e)switch(b&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&i(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),b=!1),y&&(u&&N.type!=="comment"&&N.type!=="newline"&&i(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||i(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)&&(m=N),p=!0;break;case"anchor":j&&i(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&i(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),j=N,k??(k=N.offset),u=!1,p=!1,b=!0;break;case"tag":{g&&i(N,"MULTIPLE_TAGS","A node can have at most one tag"),g=N,k??(k=N.offset),u=!1,p=!1,b=!0;break}case n:(j||g)&&i(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),w&&i(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){h&&i(N,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),h=N,u=!1,p=!1;break}default:i(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 b&&s&&s.type!=="space"&&s.type!=="newline"&&s.type!=="comma"&&(s.type!=="scalar"||s.source!=="")&&i(s.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(u&&y.indent<=a||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:h,found:w,spaceBefore:c,comment:d,hasNewline:x,anchor:j,tag:g,newlineAfterProp:m,end:S,start:k??S}}function hr(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(hr(t.key)||hr(t.value))return!0}return!1;default:return!0}}function sl(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&hr(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function ih(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const r=typeof s=="function"?s:(i,a)=>i===a||Y(i)&&Y(a)&&i.value===a.value;return t.some(i=>r(i.key,n))}const zu="All mapping items must start at the same column";function K0({composeNode:e,composeEmptyNode:t},n,s,r,i){var p;const a=(i==null?void 0:i.nodeClass)??Ke,l=new a(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:b,value:y}=d,j=as(f,{indicator:"explicit-key-ind",next:x??(b==null?void 0:b[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",zu)),!j.anchor&&!j.tag&&!b){u=j.end,j.comment&&(l.comment?l.comment+=`
130
+ `+j.comment:l.comment=j.comment);continue}(j.newlineAfterProp||hr(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",zu);n.atKey=!0;const m=j.end,h=x?e(n,x,j,r):t(n,m,f,null,j,r);n.schema.compat&&sl(s.indent,x,r),n.atKey=!1,ih(n,l.items,h)&&r(m,"DUPLICATE_KEY","Map keys must be unique");const w=as(b??[],{indicator:"map-value-ind",next:y,offset:h.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(h.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,b,null,w,r);n.schema.compat&&sl(s.indent,y,r),c=k.range[2];const C=new Ee(h,k);n.options.keepSourceTokens&&(C.srcToken=d),l.items.push(C)}else{g&&r(h.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(h.comment?h.comment+=`
131
+ `+w.comment:h.comment=w.comment);const k=new Ee(h);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 G0({composeNode:e,composeEmptyNode:t},n,s,r,i){const a=(i==null?void 0:i.nodeClass)??vn,l=new a(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=as(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&&sl(s.indent,d,r),c=x.range[2],l.items.push(x)}return l.range=[s.offset,c,u??c],l}function Er(e,t,n,s){let r="";if(e){let i=!1,a="";for(const l of e){const{source:c,type:u}=l;switch(u){case"space":i=!0;break;case"comment":{n&&!i&&s(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=c.substring(1)||" ";r?r+=a+p:r=p,a="";break}case"newline":r&&(a+=c),i=!0;break;default:s(l,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:r,offset:t}}const Yo="Block collections are not allowed within flow collections",Qo=e=>e&&(e.type==="block-map"||e.type==="block-seq");function q0({composeNode:e,composeEmptyNode:t},n,s,r,i){var j;const a=s.start.source==="{",l=a?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(a?Ke:vn),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 m=s.items[g],{start:h,key:w,sep:k,value:C}=m,S=as(h,{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}!a&&n.options.strict&&hr(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 h)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(!a&&!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],Qo(C)&&r(N.range,"BLOCK_IN_FLOW",Yo)}else{n.atKey=!0;const N=S.end,T=w?e(n,w,S,r):t(n,N,h,null,S,r);Qo(w)&&r(T.range,"BLOCK_IN_FLOW",Yo),n.atKey=!1;const A=as(k??[],{flow:l,indicator:"map-value-ind",next:C,offset:T.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(A.found){if(!a&&!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 z=C?e(n,C,A,r):A.found?t(n,A.end,k,null,A,r):null;z?Qo(C)&&r(z.range,"BLOCK_IN_FLOW",Yo):A.comment&&(T.comment?T.comment+=`
134
+ `+A.comment:T.comment=A.comment);const G=new Ee(T,z);if(n.options.keepSourceTokens&&(G.srcToken=m),a){const V=u;ih(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=(z??T).range;V.range=[T.range[0],E[1],E[2]],u.items.push(V)}d=z?z.range[2]:A.end}}const f=a?"}":"]",[x,...b]=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),m=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",m),x&&x.source.length!==1&&b.unshift(x)}if(b.length>0){const g=Er(b,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 Jo(e,t,n,s,r,i){const a=n.type==="block-map"?K0(e,t,n,s,i):n.type==="block-seq"?G0(e,t,n,s,i):q0(e,t,n,s,i),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}function Y0(e,t,n,s,r){var f;const i=s.tag,a=i?t.directives.tagName(i.source,x=>r(i,"TAG_RESOLVE_FAILED",x)):null;if(n.type==="block-seq"){const{anchor:x,newlineAfterProp:b}=s,y=x&&i?x.offset>i.offset?x:i:x??i;y&&(!b||b.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(!i||!a||a==="!"||a===Ke.tagName&&l==="map"||a===vn.tagName&&l==="seq")return Jo(e,t,n,r,a);let c=t.schema.tags.find(x=>x.tag===a&&x.collection===l);if(!c){const x=t.schema.knownTags[a];if((x==null?void 0:x.collection)===l)t.schema.tags.push(Object.assign({},x,{default:!1})),c=x;else return x?r(i,"BAD_COLLECTION_TYPE",`${x.tag} used for ${l} collection, but expects ${x.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Jo(e,t,n,r,a)}const u=Jo(e,t,n,r,a,c),p=((f=c.resolve)==null?void 0:f.call(c,u,x=>r(i,"TAG_RESOLVE_FAILED",x),t.options))??u,d=ce(p)?p:new B(p);return d.range=u.range,d.tag=a,c!=null&&c.format&&(d.format=c.format),d}function Q0(e,t,n){const s=t.offset,r=J0(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const i=r.mode===">"?B.BLOCK_FOLDED:B.BLOCK_LITERAL,a=t.source?X0(t.source):[];let l=a.length;for(let y=a.length-1;y>=0;--y){const j=a[y][1];if(j===""||j==="\r")l=y;else break}if(l===0){const y=r.chomp==="+"&&a.length>0?`
136
+ `.repeat(Math.max(1,a.length-1)):"";let j=s+r.length;return t.source&&(j+=t.source.length),{value:y,type:i,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]=a[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=a.length-1;y>=l;--y)a[y][0].length>c&&(l=y+1);let d="",f="",x=!1;for(let y=0;y<p;++y)d+=a[y][0].slice(c)+`
137
+ `;for(let y=p;y<l;++y){let[j,g]=a[y];u+=j.length+g.length+1;const m=g[g.length-1]==="\r";if(m&&(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-(m?2:1),"BAD_INDENT",w),j=""}i===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<a.length;++y)d+=`
147
+ `+a[y][0].slice(c);d[d.length-1]!==`
148
+ `&&(d+=`
149
+ `);break;default:d+=`
150
+ `}const b=s+r.length+t.source.length;return{value:d,type:i,comment:r.comment,range:[s,b,b]}}function J0({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],i=r[0];let a=0,l="",c=-1;for(let f=1;f<r.length;++f){const x=r[f];if(!l&&(x==="-"||x==="+"))l=x;else{const b=Number(x);!a&&b?a=b: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 b=`Unexpected token in block scalar header: ${x.type}`;s(x,"UNEXPECTED_TOKEN",b);const y=x.source;y&&typeof y=="string"&&(d+=y.length)}}}return{mode:i,indent:a,chomp:l,comment:p,length:d}}function X0(e){const t=e.split(/\n( *)/),n=t[0],s=n.match(/^( *)/),i=[s!=null&&s[1]?[s[1],n.slice(s[1].length)]:["",n]];for(let a=1;a<t.length;a+=2)i.push([t[a],t[a+1]]);return i}function Z0(e,t,n){const{offset:s,type:r,source:i,end:a}=e;let l,c;const u=(f,x,b)=>n(s+f,x,b);switch(r){case"scalar":l=B.PLAIN,c=ex(i,u);break;case"single-quoted-scalar":l=B.QUOTE_SINGLE,c=tx(i,u);break;case"double-quoted-scalar":l=B.QUOTE_DOUBLE,c=nx(i,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[s,s+i.length,s+i.length]}}const p=s+i.length,d=Er(a,p,t,n);return{value:c,type:l,comment:d.comment,range:[s,p,d.offset]}}function ex(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}`),oh(e)}function tx(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),oh(e.slice(1,-1)).replace(/''/g,"'")}function oh(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],i=" ",a=t.lastIndex;for(n.lastIndex=a;s=n.exec(e);)s[1]===""?i===`
153
+ `?r+=i:i=`
154
+ `:(r+=i+s[1],i=" "),a=n.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=a,s=l.exec(e),r+i+((s==null?void 0:s[1])??"")}function nx(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:i,offset:a}=sx(e,s);n+=i,s=a}else if(r==="\\"){let i=e[++s];const a=rx[i];if(a)n+=a;else if(i===`
157
+ `)for(i=e[s+1];i===" "||i===" ";)i=e[++s+1];else if(i==="\r"&&e[s+1]===`
158
+ `)for(i=e[++s+1];i===" "||i===" ";)i=e[++s+1];else if(i==="x"||i==="u"||i==="U"){const l=i==="x"?2:i==="u"?4:8;n+=ix(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 i=s;let a=e[s+1];for(;a===" "||a===" ";)a=e[++s+1];a!==`
159
+ `&&!(a==="\r"&&e[s+2]===`
160
+ `)&&(n+=s>i?e.slice(i,s+1):r)}else n+=r}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function sx(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 rx={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
165
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function ix(e,t,n,s){const r=e.substr(t,n),a=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(a)}catch{const l=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function ah(e,t,n,s){const{value:r,type:i,comment:a,range:l}=t.type==="block-scalar"?Q0(e,t,s):Z0(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=ax(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,i&&(p.type=i),c&&(p.tag=c),u.format&&(p.format=u.format),a&&(p.comment=a),p}function ox(e,t,n,s,r){var l;if(n==="!")return e[gt];const i=[];for(const c of e.tags)if(!c.collection&&c.tag===n)if(c.default&&c.test)i.push(c);else return c;for(const c of i)if((l=c.test)!=null&&l.test(t))return c;const a=e.knownTags[n];return a&&!a.collection?(e.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[gt])}function ax({atKey:e,directives:t,schema:n},s,r,i){const a=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(a.tag!==l.tag){const c=t.tagString(a.tag),u=t.tagString(l.tag),p=`Value may be parsed as either ${c} or ${u}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return a}function lx(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 cx={composeNode:lh,composeEmptyNode:mc};function lh(e,t,n,s){const r=e.atKey,{spaceBefore:i,comment:a,anchor:l,tag:c}=n;let u,p=!0;switch(t.type){case"alias":u=ux(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=ah(e,t,c,s),l&&(u.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=Y0(cx,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=mc(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"),i&&(u.spaceBefore=!0),a&&(t.type==="scalar"&&t.source===""?u.comment=a:u.commentBefore=a),e.options.keepSourceTokens&&p&&(u.srcToken=t),u}function mc(e,t,n,s,{spaceBefore:r,comment:i,anchor:a,tag:l,end:c},u){const p={type:"scalar",offset:lx(t,n,s),indent:-1,source:""},d=ah(e,p,l,u);return a&&(d.anchor=a.source.substring(1),d.anchor===""&&u(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function ux({options:e},{offset:t,source:n,end:s},r){const i=new sc(n.substring(1));i.source===""&&r(t,"BAD_ALIAS","Alias cannot be an empty string"),i.source.endsWith(":")&&r(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=t+n.length,l=Er(s,a,e.strict,r);return i.range=[t,a,l.offset],l.comment&&(i.comment=l.comment),i}function dx(e,t,{offset:n,start:s,value:r,end:i},a){const l=Object.assign({_directives:t},e),c=new Cr(void 0,l),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},p=as(s,{indicator:"doc-start",next:r??(i==null?void 0:i[0]),offset:n,onError:a,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&a(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?lh(u,r,p,a):mc(u,p.end,s,null,p,a);const d=c.contents.range[2],f=Er(i,d,!1,a);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}function Es(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 Fu(e){var r;let t="",n=!1,s=!1;for(let i=0;i<e.length;++i){const a=e[i];switch(a[0]){case"#":t+=(t===""?"":s?`
166
+
167
+ `:`
168
+ `)+(a.substring(1)||" "),n=!0,s=!1;break;case"%":((r=e[i+1])==null?void 0:r[0])!=="#"&&(i+=1),n=!1;break;default:n||(s=!0),n=!1}}return{comment:t,afterEmptyLine:s}}class fx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,i)=>{const a=Es(n);i?this.warnings.push(new V0(a,s,r)):this.errors.push(new Ms(a,s,r))},this.directives=new Se({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:r}=Fu(this.prelude);if(s){const i=t.contents;if(n)t.comment=t.comment?`${t.comment}
169
+ ${s}`:s;else if(r||t.directives.docStart||!i)t.commentBefore=s;else if(le(i)&&!i.flow&&i.items.length>0){let a=i.items[0];ue(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${s}
170
+ ${l}`:s}else{const a=i.commentBefore;i.commentBefore=a?`${s}
171
+ ${a}`:s}}if(n){for(let i=0;i<this.errors.length;++i)t.errors.push(this.errors[i]);for(let i=0;i<this.warnings.length;++i)t.warnings.push(this.warnings[i])}else t.errors=this.errors,t.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Fu(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 i=Es(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=dx(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(Es(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(Es(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Er(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(Es(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 Cr(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 ch="\uFEFF",uh="",dh="",rl="";function px(e){switch(e){case ch:return"byte-order-mark";case uh:return"doc-mode";case dh:return"flow-error-end";case rl: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 Bu=new Set("0123456789ABCDEFabcdef"),hx=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Yr=new Set(",[]{}"),mx=new Set(` ,[]{}
176
+ \r `),Xo=e=>!e||mx.has(e);class gx{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]===ch&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,s=t.indexOf("#");for(;s!==-1;){const i=t[s-1];if(i===" "||i===" "){n=s-1;break}else s=t.indexOf("#",s+1)}for(;;){const i=t[n-1];if(i===" "||i===" ")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 uh,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(Xo),"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 dh,yield*this.parseLineStart();let i=0;for(;r[i]===",";)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"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(Xo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||tt(a)||a===",")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 i=0;for(;this.buffer[n-1-i]==="\\";)i+=1;if(i%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 i=this.continueScalar(r+1);if(i===-1)break;r=s.indexOf(`
183
+ `,i)}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 i=this.pos;s=this.buffer[i];++i)switch(s){case" ":n+=1;break;case`
184
+ `:t=i,n=0;break;case"\r":{const a=this.buffer[i+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
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 i=this.continueScalar(t+1);if(i===-1)break;t=this.buffer.indexOf(`
186
+ `,i)}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 i=t-1,a=this.buffer[i];a==="\r"&&(a=this.buffer[--i]);const l=i;for(;a===" ";)a=this.buffer[--i];if(a===`
188
+ `&&i>=this.pos&&i+1+n>l)t=i;else break}while(!0);return yield rl,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 i=this.buffer[s+1];if(tt(i)||t&&Yr.has(i))break;n=s}else if(tt(r)){let i=this.buffer[s+1];if(r==="\r"&&(i===`
189
+ `?(s+=1,r=`
190
+ `,i=this.buffer[s+1]):n=s),i==="#"||t&&Yr.has(i))break;if(r===`
191
+ `){const a=this.continueScalar(s+1);if(a===-1)break;s=Math.max(s,a-2)}}else{if(t&&Yr.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield rl,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(Xo),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(tt(s)||n&&Yr.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==="%"&&Bu.has(this.buffer[t+1])&&Bu.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 yx{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,s=this.lineStarts.length;for(;n<s;){const i=n+s>>1;this.lineStarts[i]<t?n=i+1:s=i}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 _t(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Uu(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 fh(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 Qr(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 Cn(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 Hi(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 Wu(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!_t(t.start,"explicit-key-ind")&&!_t(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,fh(t.value)?t.value.end?Hi(t.value.end,t.sep):t.value.end=t.sep:Hi(t.start,t.sep),delete t.sep)}class xx{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 gx,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=px(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"&&Wu(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&&Uu(r.start)===-1&&(n.indent===0||r.start.every(i=>i.type!=="comment"||i.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":{Uu(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=Qr(this.peek(2)),s=Cn(n);let r;t.end?(r=t.end,r.push(this.sourceToken),delete t.end):r=[this.sourceToken];const i={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]=i}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,i=Array.isArray(r)?r[r.length-1]:void 0;(i==null?void 0:i.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],i=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(i)){Hi(i,n.start),i.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,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let a=[];if(i&&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&&(a=n.sep.splice(l[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(a.push(this.sourceToken),t.items.push({start:a}),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):i||n.value?(a.push(this.sourceToken),t.items.push({start:a,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(_t(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(fh(n.key)&&!_t(n.sep,"newline")){const l=Cn(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 a.length>0?n.sep=n.sep.concat(a,this.sourceToken):n.sep.push(this.sourceToken);else if(_t(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const l=Cn(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||i?t.items.push({start:a,key:null,sep:[this.sourceToken]}):_t(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);i||n.value?(t.items.push({start:a,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&&!_t(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:a});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,i=Array.isArray(r)?r[r.length-1]:void 0;(i==null?void 0:i.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],i=(s=r==null?void 0:r.value)==null?void 0:s.end;if(Array.isArray(i)){Hi(i,n.start),i.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||_t(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=Qr(s),i=Cn(r);Wu(t);const a=t.end.splice(1,t.end.length);a.push(this.sourceToken);const l={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:a}]};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=Qr(t),s=Cn(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=Qr(t),s=Cn(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 vx(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new yx||null,prettyErrors:t}}function bx(e,t={}){const{lineCounter:n,prettyErrors:s}=vx(t),r=new xx(n==null?void 0:n.addNewLine),i=new fx(t);let a=null;for(const l of i.compose(r.parse(e),!0,e.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new Ms(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(a.errors.forEach($u(e,n)),a.warnings.forEach($u(e,n))),a}function wx(e,t,n){let s;const r=bx(e,n);if(!r)return null;if(r.warnings.forEach(i=>$p(r.options.logLevel,i)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:s},n))}function jx(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:r}={};if(!r)return}return jr(e)&&!s?e.toString(n):new Cr(e,s,n).toString(n)}const kx=new Set(["daemon.host","daemon.port","app.port"]),Nx=["js_evaluate","cookie_write"];function Hu(e){const t=e.daemon??{},n=e.security??{},s=e.connectors??{},r=e.audit??{},i=e.output??{},a=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??[...Nx],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(i.defaultFormat??"table")},app:{port:Number(a.port??9092)}}}function Sx(e){return{daemon:{...e.daemon},security:{...e.security},connectors:{...e.connectors},audit:{...e.audit},output:{...e.output},app:{...e.app}}}function Cx(){const[e,t]=v.useState(null),[n,s]=v.useState(null),[r,i]=v.useState([]),[a,l]=v.useState(!0),[c,u]=v.useState(!1),[p,d]=v.useState(null),[f,x]=v.useState(!1),[b,y]=v.useState(""),[j,g]=v.useState(!1),[m,h]=v.useState("");v.useEffect(()=>{Promise.all([F.getConfig(),F.getConnectors()]).then(([E,M])=>{const P=Hu(E.config);t(P),s(structuredClone(P)),i(M.connectors)}).catch(()=>{t(null),s(null)}).finally(()=>l(!1))},[]);const w=v.useMemo(()=>!e||!n?!1:JSON.stringify(e)!==JSON.stringify(n),[e,n]),k=v.useMemo(()=>{if(!e||!n)return 0;let E=0;for(const M of Object.keys(n)){const P=e[M],R=n[M];for(const L of Object.keys(R))JSON.stringify(P[L])!==JSON.stringify(R[L])&&E++}return E},[e,n]),C=v.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 M of Object.keys(n)){const P=e[M],R=n[M];for(const L of Object.keys(R)){const O=JSON.stringify(R[L]),D=JSON.stringify(P[L]??null);if(O!==D){const $=`${M}.${L}`,Q=R[L];let De;$==="security.approvalTimeoutMs"?De=String(Q):Array.isArray(Q)?De=JSON.stringify(Q):De=String(Q),await F.setConfig($,De),kx.has($)&&(E=!0)}}}t(structuredClone(n)),d({type:"success",msg:"Configuration saved."}),E&&x(!0)}catch(M){d({type:"error",msg:M instanceof Error?M.message:"Save failed"})}finally{u(!1),setTimeout(()=>d(null),3e3)}},[e,n]),S=v.useCallback(()=>{e&&s(structuredClone(e))},[e]),N=v.useCallback(()=>{!j&&n&&(y(jx(Sx(n))),h("")),g(!j)},[j,n]),T=v.useCallback(()=>{try{const E=wx(b);if(!E||typeof E!="object")throw new Error("Invalid YAML");s(Hu(E)),h("")}catch(E){h(E instanceof Error?E.message:"Invalid YAML")}},[b]),A=v.useCallback((E,M,P)=>{s(R=>R&&{...R,[E]:{...R[E],[M]:P}})},[]),z=v.useCallback((E,M,P)=>{s(R=>{if(!R)return R;const L=R[E],O=L[M]??[];return O.includes(P)?R:{...R,[E]:{...L,[M]:[...O,P]}}})},[]),G=v.useCallback((E,M,P)=>{s(R=>{if(!R)return R;const L=R[E],O=L[M]??[];return{...R,[E]:{...L,[M]:O.filter(D=>D!==P)}}})},[]),V=v.useMemo(()=>({updateField:A,addToArray:z,removeFromArray:G}),[A,z,G]);return a?o.jsx(mt,{label:"Loading configuration..."}):!n||!e?o.jsxs("div",{className:"max-w-3xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),o.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-2",children:"No configuration found."}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"Make sure the daemon is running. Configuration will appear here automatically."})]})]}):o.jsxs("div",{className:"max-w-3xl mx-auto pb-20",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Configuration"}),f&&o.jsxs("div",{className:"alert alert-warning mb-6",children:[o.jsxs("span",{children:["Some changes require a daemon restart to take effect. Restart with: ",o.jsx("code",{className:"font-mono text-sm",children:"cg down && cg up"})]}),o.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>x(!1),children:"Dismiss"})]}),o.jsxs("div",{className:"space-y-8",children:[o.jsx("div",{id:"cfg-server",className:"scroll-mt-4",children:o.jsx(Ex,{config:n,actions:V})}),o.jsx("div",{id:"cfg-security",className:"scroll-mt-4",children:o.jsx(Tx,{config:n,connectors:r,actions:V})}),o.jsx("div",{id:"cfg-sources",className:"scroll-mt-4",children:o.jsx(Lx,{config:n,actions:V})}),o.jsx("div",{id:"cfg-audit",className:"scroll-mt-4",children:o.jsx(Ax,{config:n,actions:V})}),o.jsx("div",{id:"cfg-output",className:"scroll-mt-4",children:o.jsx(Ix,{config:n,actions:V})}),o.jsx("div",{id:"cfg-journal",className:"scroll-mt-4",children:o.jsx(Px,{})})]}),o.jsxs("div",{className:"mt-8",children:[o.jsxs("button",{className:"btn btn-sm btn-ghost gap-1",onClick:N,children:[j?"▾":"▸"," Raw Configuration (YAML)"]}),j&&o.jsxs("div",{className:"mt-2 border border-base-300 p-4",children:[o.jsx("textarea",{className:"textarea textarea-bordered w-full font-mono text-sm",rows:16,value:b,onChange:E=>y(E.target.value)}),m&&o.jsx("p",{className:"text-error text-sm mt-1",children:m}),o.jsx("button",{className:"btn btn-sm btn-ghost mt-2",onClick:T,children:"Apply to form"})]})]}),w&&o.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:[o.jsxs("span",{className:"text-sm opacity-60",children:[k," unsaved ",k===1?"change":"changes"]}),o.jsxs("div",{className:"flex items-center gap-3",children:[p&&o.jsx("span",{className:`text-sm ${p.type==="success"?"text-success":"text-error"}`,children:p.msg}),o.jsx("button",{className:"btn btn-sm btn-ghost",onClick:S,children:"Discard"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:C,disabled:c,children:c?"Saving...":"Save changes"})]})]})]})}function ys({title:e,description:t,children:n}){return o.jsxs("div",{className:"border border-base-300 p-5",children:[o.jsx("h3",{className:"font-display font-semibold mb-1",children:e}),o.jsx("p",{className:"text-xs opacity-40 mb-5",children:t}),o.jsx("div",{className:"space-y-5",children:n})]})}function Pe({label:e,help:t,restart:n,children:s}){return o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"w-48 shrink-0",children:[o.jsx("label",{className:"font-mono text-[0.7rem] font-medium uppercase tracking-wide",children:e}),n&&o.jsx("span",{className:"ml-1.5 tooltip tooltip-right","data-tip":"Requires daemon restart",children:o.jsx("span",{className:"text-xs opacity-40",children:"⟳"})})]}),o.jsx("div",{className:"flex-1",children:s})]}),o.jsx("p",{className:"text-xs opacity-40 mt-1 max-w-[12rem]",children:t})]})}function Ex({config:e,actions:t}){const{updateField:n}=t;return o.jsxs(ys,{title:"Server",description:"Daemon and app server binding configuration",children:[o.jsx(Pe,{label:"Daemon Host",help:"IP address the daemon binds to",restart:!0,children:o.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)})}),o.jsx(Pe,{label:"Daemon Port",help:"Port the daemon listens on",restart:!0,children:o.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))})}),o.jsx(Pe,{label:"GUI Port",help:"Port the GUI app server listens on",restart:!0,children:o.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 Vu({values:e,onAdd:t,onRemove:n,placeholder:s}){const[r,i]=v.useState("");return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:e.map(a=>o.jsxs(U,{size:"sm",className:"gap-1",children:[a,o.jsx("button",{className:"text-xs opacity-50 hover:opacity-100",onClick:()=>n(a),children:"×"})]},a))}),o.jsxs("div",{className:"flex gap-1",children:[o.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1",placeholder:s,value:r,onChange:a=>i(a.target.value),onKeyDown:a=>{a.key==="Enter"&&r.trim()&&(t(r.trim()),i(""))}}),o.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(t(r.trim()),i(""))},children:"Add"})]})]})}function Tx({config:e,connectors:t,actions:n}){const{updateField:s,addToArray:r,removeFromArray:i}=n,a=new Set(e.security.highRiskCapabilities),l=v.useMemo(()=>uo(t),[t]);return o.jsxs(ys,{title:"Connector Security",description:"Manage which connectors are approved and which capabilities require approval",children:[t.length>0&&o.jsx("div",{className:"overflow-x-auto mb-4",children:o.jsxs("table",{className:"table table-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Connector"}),o.jsx("th",{children:"Capabilities"}),o.jsx("th",{children:"Risk"}),o.jsx("th",{children:"Approved"}),o.jsx("th",{children:"Auto-Approve"})]})}),o.jsx("tbody",{children:l.map(([c,u])=>o.jsxs(v.Fragment,{children:[o.jsx("tr",{children:o.jsxs("td",{colSpan:5,className:"bg-base-200/50 font-mono font-semibold text-xs pt-3 pb-1",children:[c,o.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=>a.has(y)),x=e.security.approvedHighRisk.includes(p.key),b=e.security.autoApproveConnectors.includes(p.key);return o.jsxs("tr",{children:[o.jsx("td",{className:"font-mono text-sm pl-6",children:d}),o.jsx("td",{children:o.jsx("div",{className:"flex flex-wrap gap-1",children:p.capabilities.map(y=>o.jsx(U,{variant:a.has(y)?"warning":"neutral",size:"xs",children:y},y))})}),o.jsx("td",{children:f?o.jsx(U,{variant:"warning",size:"xs",children:"High"}):o.jsx("span",{className:"opacity-40",children:"—"})}),o.jsx("td",{children:f?o.jsx("input",{type:"checkbox",className:"toggle toggle-sm toggle-success",checked:x,onChange:()=>x?i("security","approvedHighRisk",p.key):r("security","approvedHighRisk",p.key)}):o.jsx("span",{className:"opacity-40",children:"—"})}),o.jsx("td",{children:o.jsx("input",{type:"checkbox",className:"toggle toggle-sm",checked:b,title:"Skip approval prompts — pipeline steps execute without confirmation",onChange:()=>b?i("security","autoApproveConnectors",p.key):r("security","autoApproveConnectors",p.key)})})]},p.key)})]},c))})]})}),o.jsx(Pe,{label:"High-Risk Capabilities",help:"Capabilities that require connector-level approval before first use",children:o.jsx(Vu,{values:e.security.highRiskCapabilities,onAdd:c=>r("security","highRiskCapabilities",c),onRemove:c=>i("security","highRiskCapabilities",c),placeholder:"Capability name"})}),o.jsx(Pe,{label:"Step Approval Required",help:"Capabilities that pause for user confirmation at each pipeline step",children:o.jsx(Vu,{values:e.security.approvalRequired,onAdd:c=>r("security","approvalRequired",c),onRemove:c=>i("security","approvalRequired",c),placeholder:"Capability name"})}),o.jsx(Pe,{label:"Approval Timeout (seconds)",help:"How long to wait for approval before aborting the pipeline",children:o.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)})}),o.jsx(Pe,{label:"Extension ID",help:"Chrome extension ID for origin validation. Leave blank to accept any extension.",children:o.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 Lx({config:e,actions:t}){const{addToArray:n,removeFromArray:s}=t,[r,i]=v.useState("");return o.jsxs(ys,{title:"Connector Sources",description:"Directories to scan for connector YAML files",children:[o.jsx("div",{className:"space-y-1",children:e.connectors.paths.map((a,l)=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-sm flex-1",children:a}),o.jsx("button",{className:"btn btn-xs btn-ghost opacity-50 hover:opacity-100",onClick:()=>s("connectors","paths",a),children:"×"})]},l))}),o.jsxs("div",{className:"flex gap-1 mt-2",children:[o.jsx("input",{type:"text",className:"input input-bordered input-xs flex-1 font-mono",placeholder:"~/path/to/connectors",value:r,onChange:a=>i(a.target.value),onKeyDown:a=>{a.key==="Enter"&&r.trim()&&(n("connectors","paths",r.trim()),i(""))}}),o.jsx("button",{className:"btn btn-xs btn-ghost",onClick:()=>{r.trim()&&(n("connectors","paths",r.trim()),i(""))},children:"Add path"})]}),o.jsxs("p",{className:"text-xs opacity-40 mt-1",children:["Use ",o.jsx("code",{children:"~/"})," for home directory paths. Relative paths resolve from the install directory."]})]})}function Ax({config:e,actions:t}){const{updateField:n}=t;return o.jsxs(ys,{title:"Audit & Retention",description:"Audit log storage and cleanup settings",children:[o.jsx(Pe,{label:"Retention Period",help:"Days to keep audit log entries before cleanup",children:o.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))})}),o.jsx(Pe,{label:"Database Path",help:"Path to the audit SQLite database. Change only if you need a custom location.",children:o.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 Ix({config:e,actions:t}){const{updateField:n}=t;return o.jsx(ys,{title:"Output Defaults",description:"Default formatting for CLI output",children:o.jsx(Pe,{label:"Default Output Format",help:"Format used when no --format flag is specified",children:o.jsxs("select",{className:"select select-bordered select-sm w-full",value:e.output.defaultFormat,onChange:s=>n("output","defaultFormat",s.target.value),children:[o.jsx("option",{value:"table",children:"table"}),o.jsx("option",{value:"json",children:"json"}),o.jsx("option",{value:"csv",children:"csv"})]})})})}function Px(){const[e,t]=v.useState(""),[n,s]=v.useState(""),[r,i]=v.useState(""),[a,l]=v.useState("40"),[c,u]=v.useState(!1),[p,d]=v.useState(!1);v.useEffect(()=>{F.getPreferences().then(x=>{if(!x.ok)return;const b=x.preferences;t(b["journal.author"]??""),s(b["journal.ado_org"]??""),i(b["journal.ado_repos"]??""),l(b["journal.target_hours"]??"40"),u(!0)}).catch(()=>u(!0))},[]);async function f(){await Promise.all([F.setPreference("journal.author",e),F.setPreference("journal.ado_org",n),F.setPreference("journal.ado_repos",r),F.setPreference("journal.target_hours",a)]),d(!0),setTimeout(()=>d(!1),2e3)}return c?o.jsxs(ys,{title:"Journal Settings",description:"Configure your Dev Work Journal data sources",children:[o.jsx(Pe,{label:"Author",help:"Your name or email as it appears in ADO commits (e.g. mun_hong.lee@mercedes-benz.com)",children:o.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)})}),o.jsx(Pe,{label:"ADO Organization",help:"Azure DevOps organization name (e.g. daimler-mic)",children:o.jsx("input",{type:"text",className:"input input-bordered input-sm w-full",placeholder:"daimler-mic",value:n,onChange:x=>s(x.target.value)})}),o.jsx(Pe,{label:"ADO Repos",help:'Comma-separated project/repo pairs (e.g. "mic-dns/mic-dns-api,mic-dns/mic-dns-ui")',children:o.jsx("input",{type:"text",className:"input input-bordered input-sm w-full font-mono",placeholder:"project/repo,project/repo",value:r,onChange:x=>i(x.target.value)})}),o.jsx(Pe,{label:"Weekly Target Hours",help:"Target hours per week for the hours progress bar (default 40)",children:o.jsx("input",{type:"number",className:"input input-bordered input-sm w-20",min:1,max:80,value:a,onChange:x=>l(x.target.value)})}),o.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[o.jsx("button",{className:"btn btn-primary btn-sm",onClick:f,children:"Save Journal Settings"}),p&&o.jsx("span",{className:"text-success text-sm",children:"Saved ✓"})]})]}):null}const Ox=o.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:o.jsx("path",{d:"M20 6 9 17l-5-5"})});function _x(){const[e,t]=v.useState(!1),[n,s]=v.useState(!1),[r,i]=v.useState(0),[a,l]=v.useState([]),[c,u]=v.useState([]),[p,d]=v.useState(null),f=v.useCallback(async()=>{try{const k=await F.getStatus();t(k.ok),s(k.extensionConnected),i(k.connectorCount)}catch{t(!1),s(!1),i(0)}try{const k=await F.getConnectors();l(k.connectors);const S=(await F.getConfig().catch(()=>({ok:!1,config:{}}))).config.security??{};u(S.approvedHighRisk??[])}catch{}},[]);v.useEffect(()=>{f();const k=setInterval(f,1e4);return()=>clearInterval(k)},[f]);const x=v.useCallback(async k=>{d(k);try{const C=[...c,k];await F.setConfig("security.approvedHighRisk",JSON.stringify(C)),f()}catch{}finally{d(null)}},[c,f]),b=a.filter(k=>k.isHighRisk&&!k.isApproved),y=b.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:`${b.length} need${b.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,m=j.length,h=g===m,w=v.useMemo(()=>uo(a),[a]);return o.jsxs("div",{className:"max-w-3xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Setup Guide"}),o.jsx("p",{className:"text-sm opacity-60 mb-6",children:"Complete these steps to start running connectors from your browser."}),o.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[o.jsx("div",{className:"flex-1 h-1.5 bg-base-300 overflow-hidden",children:o.jsx("div",{className:"h-full bg-success transition-all duration-300 ease-out",style:{width:`${m>0?g/m*100:0}%`}})}),o.jsxs("span",{className:"font-mono text-xs opacity-50 shrink-0",children:[g,"/",m]})]}),o.jsx("div",{className:"space-y-3 mb-8",children:j.map((k,C)=>o.jsxs("div",{className:`border ${k.ok?"border-base-300":"border-base-300 bg-base-200/50"}`,children:[o.jsxs("div",{className:"p-4 flex items-center gap-3",children:[o.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?Ox:C+1}),o.jsx("span",{className:"font-semibold flex-1",children:k.label}),o.jsx(U,{variant:k.ok?"success":"warning",children:k.detail})]}),!k.ok&&o.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"&&b.length>0&&o.jsx("div",{className:"mt-3 space-y-2",children:b.map(S=>o.jsxs("div",{className:"flex items-center justify-between gap-3 py-1.5",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-mono text-sm",children:S.key}),S.description&&o.jsx("span",{className:"text-xs opacity-50 ml-2",children:S.description})]}),o.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))}),h&&a.length>0&&o.jsxs("div",{className:"border border-success/30 bg-success/5 p-5",children:[o.jsx("p",{className:"font-semibold text-success mb-3",children:"Everything's ready. Pick a connector to try."}),o.jsx("div",{className:"space-y-3",children:w.map(([k,C])=>o.jsxs("div",{children:[o.jsx("span",{className:"font-mono font-semibold text-sm",children:k}),o.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:C.map(S=>{const N=S.key.split("/")[1];return o.jsx($e,{to:`/connectors/${k}/${N}`,className:"btn btn-sm btn-outline",children:o.jsx("span",{className:"font-mono",children:N})},S.key)})})]},k))})]}),!h&&a.length>0&&o.jsxs("div",{className:"border-t border-base-300 pt-6",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-4",children:"Installed connectors"}),o.jsx("div",{className:"space-y-4",children:w.map(([k,C])=>o.jsxs("div",{children:[o.jsx("div",{className:"font-mono font-semibold text-sm mb-1.5",children:k}),o.jsx("div",{className:"space-y-1",children:C.map(S=>{const N=S.key.split("/")[1];return o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-baseline gap-2",children:[o.jsx("span",{className:"font-mono text-sm",children:N}),o.jsx(U,{size:"xs",children:S.access})]}),S.description&&o.jsx("div",{className:"text-xs opacity-40 mb-1",children:S.description})]},S.key)})})]},k))}),o.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 mr({message:e}){return o.jsx("div",{role:"alert",className:"alert alert-warning",children:o.jsx("span",{children:e??"Sign in to the target app in Chrome, then try again."})})}function ph(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 i=1;i<=s;i++)ph(new Date(t,n-1,i))&&r++;return r}function Dx(e,t){const[n,s]=e.split("-").map(Number),r=new Date(t+"T00:00:00"),i=new Date(n,s,0),a=r>i?i:r;let l=0;for(let c=1;c<=a.getDate();c++){const u=new Date(n,s-1,c);if(u>a)break;ph(u)&&l++}return l}function Rx(e){const{targetHours:t,actualHours:n,month:s,today:r}=e,i=Mx(s),a=Dx(s,r),l=i-a,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:i,workingDaysElapsed:a,workingDaysRemaining:l};const p=i>0?t/i*a:0,d=l>0?Math.max(0,(t-n)/l):0;let f;return n>=p?f="on_track":i>0&&a/i<.8?f="behind":f="at_risk",{status:f,percentage:c,daysRemaining:u,hoursPerDayNeeded:d,workingDaysTotal:i,workingDaysElapsed:a,workingDaysRemaining:l}}const $x={reached:"bg-success",on_track:"bg-success",behind:"bg-warning",at_risk:"bg-error"};function zx({percentage:e,status:t,className:n=""}){const s=Math.min(100,Math.max(0,e));return o.jsx("div",{className:`h-2 bg-base-300 ${n}`,children:o.jsx("div",{className:`h-full ${$x[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 hh=(...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 Fx=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 Bx=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 Ku=e=>{const t=Bx(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 Zo={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 Ux=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Wx=v.createContext({}),Hx=()=>v.useContext(Wx),Vx=v.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:i,iconNode:a,...l},c)=>{const{size:u=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:x=""}=Hx()??{},b=s??d?Number(n??p)*24/Number(t??u):n??p;return v.createElement("svg",{ref:c,...Zo,width:t??u??Zo.width,height:t??u??Zo.height,stroke:e??f,strokeWidth:b,className:hh("lucide",x,r),...!i&&!Ux(l)&&{"aria-hidden":"true"},...l},[...a.map(([y,j])=>v.createElement(y,j)),...Array.isArray(i)?i:[i]])});/**
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=v.forwardRef(({className:s,...r},i)=>v.createElement(Vx,{ref:i,iconNode:t,className:hh(`lucide-${Fx(Ku(e))}`,`lucide-${e}`,s),...r}));return n.displayName=Ku(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 Kx=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],En=te("arrow-right",Kx);/**
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 Gx=[["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"}]],qx=te("book-open",Gx);/**
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 Yx=[["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"}]],Qx=te("circle-alert",Yx);/**
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 Jx=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Xx=te("circle-check-big",Jx);/**
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 Zx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ev=te("circle-check",Zx);/**
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 tv=[["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"}]],nv=te("circle-x",tv);/**
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 sv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],mh=te("clock",sv);/**
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 rv=[["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"}]],Gu=te("database",rv);/**
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 iv=[["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",iv);/**
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 av=[["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"}]],lv=te("eye",av);/**
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 cv=[["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"}]],ea=te("file-text",cv);/**
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 uv=[["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"}]],dv=te("fingerprint-pattern",uv);/**
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 fv=[["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"}]],Jr=te("globe",fv);/**
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 pv=[["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",pv);/**
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 mv=[["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"}]],gv=te("library",mv);/**
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 yv=[["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"}]],xv=te("lock",yv);/**
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 vv=[["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"}]],bv=te("newspaper",vv);/**
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"}]],jv=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 kv=[["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"}]],Nv=te("scroll-text",kv);/**
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 Sv=[["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",Sv);/**
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 Cv=[["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"}]],Ev=te("shield",Cv);/**
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 Tv=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ta=te("terminal",Tv);/**
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 Lv=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Av=te("trending-up",Lv);/**
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 Iv=[["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",Iv),Ov={reached:Xx,on_track:Av,behind:mh,at_risk:Pv},_v={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 Dv(e,t,n){const s=n.find(r=>r.projectId===e&&r.activity===t);return(s==null?void 0:s.totalHours)??0}function Rv({goals:e,activityHours:t,projectNames:n,activityNames:s,month:r,today:i}){return e.length===0?null:o.jsx("div",{className:"border border-base-300",children:e.map((a,l)=>{const c=Dv(a.projectId,a.activity,t),u=Rx({targetHours:a.targetHours,actualHours:c,month:r,today:i}),p=n.get(a.projectId),d=Ov[u.status];return o.jsxs("div",{className:`grid grid-cols-[auto_1fr_auto_1fr] gap-0 ${Mv[u.status]} ${l>0?"border-t border-base-300":""}`,children:[o.jsx("div",{className:"p-3 border-r border-base-300 flex items-center justify-center",children:o.jsx(d,{size:18,className:_v[u.status]})}),o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-display font-semibold text-sm",children:p??a.projectId}),o.jsxs("div",{className:"font-mono text-[0.6rem] opacity-50 mt-0.5",children:[p?`${a.projectId} · `:"",s.get(`${a.projectId}\0${a.activity}`)??a.activity]})]}),o.jsxs("div",{className:"p-3 border-r border-base-300 text-right min-w-[7rem]",children:[o.jsxs("div",{className:"font-display font-semibold text-sm",children:[Math.round(c*10)/10,"/",a.targetHours,"h"]}),o.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mt-0.5",children:[a.targetDays,"d target"]})]}),o.jsxs("div",{className:"p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx(zx,{percentage:u.percentage,status:u.status,className:"flex-1"}),o.jsxs("span",{className:"font-mono text-xs font-medium min-w-[3rem] text-right",children:[Math.round(u.percentage),"%"]})]}),u.status==="reached"?o.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-success uppercase tracking-[0.1em]",children:"Goal reached"}):o.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`})]})]},a.id)})})}function $v({goals:e,month:t,onGoalChange:n,knownCombos:s,projectNames:r,activityNames:i,onRefreshProjects:a,refreshingProjects:l}){const[c,u]=v.useState(""),[p,d]=v.useState(""),[f,x]=v.useState(null),[b,y]=v.useState(""),[j,g]=v.useState(!1),m=v.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 h(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 z=i.get(`${T}\0${A}`);return z?`${w(T)} / ${z}`:`${w(T)} / ${A}`}async function C(){const T=h(c),A=parseFloat(p);if(!(!T||isNaN(A)||A<.5||A>31)){g(!0);try{await F.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 F.deleteGoal(T),n()}finally{g(!1)}}async function N(T){const A=parseFloat(b);if(isNaN(A)||A<.5||A>31){x(null);return}g(!0);try{await F.upsertGoal({month:T.month,projectId:T.projectId,activity:T.activity,targetDays:A}),x(null),n()}finally{g(!1)}}return o.jsxs("details",{children:[o.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Manage goals (",e.length,")"]}),o.jsxs("div",{className:"mt-2 space-y-3",children:[e.length>0&&o.jsx("div",{className:"overflow-x-auto border border-base-300",children:o.jsxs("table",{className:"table table-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Project"}),o.jsx("th",{children:"Activity"}),o.jsx("th",{className:"text-right",children:"Target (days)"}),o.jsx("th",{className:"text-right",children:"Target (hours)"}),o.jsx("th",{children:"Actions"})]})}),o.jsx("tbody",{children:e.map(T=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("div",{className:"text-sm",children:w(T.projectId)}),r.has(T.projectId)&&o.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.projectId})]}),o.jsxs("td",{children:[o.jsx("div",{className:"text-sm",children:i.get(`${T.projectId}\0${T.activity}`)??T.activity}),o.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:T.activity})]}),o.jsx("td",{className:"text-right",children:f===T.id?o.jsx("input",{type:"number",step:"0.5",className:"input input-bordered input-xs w-20 text-right",value:b,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}),o.jsx("td",{className:"text-right",children:T.targetHours}),o.jsxs("td",{className:"flex gap-1",children:[o.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"}),o.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))})]})}),o.jsxs("div",{className:"flex items-end gap-2",children:[o.jsxs("select",{className:"select select-bordered select-sm",value:c,onChange:T=>u(T.target.value),children:[o.jsx("option",{value:"",children:"Select project / activity…"}),m.map(T=>o.jsx("option",{value:`${T.projectId}\0${T.activity}`,children:k(T.projectId,T.activity)},`${T.projectId}\0${T.activity}`))]}),o.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)}),o.jsx("button",{className:"btn btn-primary btn-sm",onClick:C,disabled:j||!c,children:"Add"}),o.jsx("button",{className:"btn btn-ghost btn-sm font-mono text-xs opacity-60",onClick:a,disabled:l,children:l?"Refreshing…":"Refresh projects"})]})]})]})}function zv(e,t){var V;const[n,s]=v.useState([]),[r,i]=v.useState([]),[a,l]=v.useState(null),[c,u]=v.useState([]),p=v.useRef(c);p.current=c;const[d,f]=v.useState(!1),x=v.useCallback(async()=>{try{const E=await F.getGoals(e);s(E.goals)}catch{}},[e]),b=v.useCallback(async()=>{try{const E=await F.getCachedReport(e);E.data?(i(E.data),l(E.fetchedAt)):(i([]),l(null))}catch{}},[e]),y=v.useCallback(async()=>{try{const E=await F.getCachedProjects();E.data&&u(E.data)}catch{}},[]),j=v.useCallback(async()=>{f(!0);try{const E=await F.run("timetracking/projects",{month:e});if(E.ok&&E.data&&E.data.length>0){const M=E.data.map(P=>({projectId:String(P.projectId??""),projectName:String(P.projectName??""),activityNumber:String(P.activityNumber??""),activityName:String(P.activityName??""),category:String(P.category??""),linePropertyId:String(P.linePropertyId??"")}));u(M),await F.cacheProjects(M)}}catch{}f(!1)},[e]);v.useEffect(()=>{x(),b(),y()},[x,b,y]);const g=t==null?void 0:t.data;v.useEffect(()=>{if(g&&g.length>0){l(null),F.cacheReport(e,g).catch(()=>{});const E=new Set,M=[];for(const P of g){const R=String(P.projectId??""),L=String(P.activity??"");if(!R||!L)continue;const O=`${R}\0${L}`;E.has(O)||(E.add(O),M.push({projectId:R,projectName:P.projectName?String(P.projectName):R,activityNumber:L,activityName:P.activityName?String(P.activityName):L,category:String(P.category??""),linePropertyId:""}))}if(M.length>0){const P=new Map;for(const L of p.current)P.set(`${L.projectId}\0${L.activityNumber}`,L);for(const L of M)P.set(`${L.projectId}\0${L.activityNumber}`,L);const R=Array.from(P.values());u(R),F.cacheProjects(R).catch(()=>{})}}},[g,e]);const m=((t==null?void 0:t.data)??[]).length>0?(t==null?void 0:t.data)??[]:r,h=m===r&&r.length>0&&!((V=t==null?void 0:t.data)!=null&&V.length),{projectNames:w,activityNames:k}=v.useMemo(()=>{const E=new Map,M=new Map;for(const P of c)P.projectId&&P.projectName&&E.set(P.projectId,P.projectName),P.projectId&&P.activityNumber&&P.activityName&&M.set(`${P.projectId}\0${P.activityNumber}`,P.activityName);for(const P of m){const R=String(P.projectId??""),L=P.projectName?String(P.projectName):null;R&&L&&E.set(R,L);const O=String(P.activity??""),D=P.activityName?String(P.activityName):null;R&&O&&D&&M.set(`${R}\0${O}`,D)}return{projectNames:E,activityNames:M}},[c,m]),{projectList:C,totalHours:S,draftCount:N,workingDayCount:T}=v.useMemo(()=>{const E=new Map;let M=0,P=0;const R=new Set;for(const L of m){const O=String(L.projectId??"Unknown"),D=Number(L.hours??0),$=String(L.date??""),Q=String(L.status??""),De=String(L.activity??"");M+=D,$&&R.add($),Q==="draft"&&P++,E.has(O)||E.set(O,{projectId:O,totalHours:0,entryCount:0,activities:new Set});const Ze=E.get(O);if(Ze.totalHours+=D,Ze.entryCount++,De){const xs=k.get(`${O}\0${De}`)??De;Ze.activities.add(xs)}}return{projectList:Array.from(E.values()).sort((L,O)=>O.totalHours-L.totalHours),totalHours:M,draftCount:P,workingDayCount:R.size}},[m,k]),A=v.useMemo(()=>{const E=new Map;for(const M of m){const P=String(M.projectId??"Unknown"),R=String(M.activity??""),L=Number(M.hours??0),O=`${P}\0${R}`,D=E.get(O);D?D.totalHours+=L:E.set(O,{projectId:P,activity:R,totalHours:L})}return Array.from(E.values())},[m]),z=v.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:m,isCached:h,cachedAt:a,projectNames:w,activityNames:k,projectList:C,totalHours:S,draftCount:N,workingDayCount:T,activityHours:A,allCombos:z,todayStr:G,refreshProjects:j,refreshingProjects:d}}function Fv(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function Bv(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 Uv(){const[e,t]=v.useState(Fv()),[n,s]=v.useState(!1),{running:r,result:i,error:a,approvalPending:l,approvalId:c,run:u,handleApproval:p,reset:d}=ec(),{goals:f,loadGoals:x,rows:b,isCached:y,cachedAt:j,projectNames:g,activityNames:m,projectList:h,totalHours:w,draftCount:k,workingDayCount:C,activityHours:S,allCombos:N,todayStr:T,refreshProjects:A,refreshingProjects:z}=zv(e,i),G=(a==null?void 0:a.includes("auth_required"))||(a==null?void 0:a.includes("sign in")),V=v.useCallback(async()=>{const E={};e&&(E.month=e),await u("timetracking/report",E),await x()},[e,u,x]);return o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Time Tracking"}),o.jsxs("div",{className:"flex items-end gap-4 mb-6",children:[o.jsxs("label",{className:"form-control",children:[o.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Month"}),o.jsx("input",{type:"month",className:"input input-bordered input-sm",value:e,onChange:E=>{t(E.target.value),d()},onClick:E=>{var M,P;return(P=(M=E.target).showPicker)==null?void 0:P.call(M)}})]}),o.jsx("button",{className:"btn btn-primary btn-sm",onClick:V,disabled:r,children:r?"Loading...":"Load report"})]}),r&&!l&&o.jsx(mt,{label:"Fetching timetracking data..."}),l&&o.jsxs("div",{className:"alert alert-warning mb-4",children:[o.jsx("span",{children:"This connector requires approval before proceeding."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>p(!0),disabled:!c,children:"Approve"}),o.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>p(!1),disabled:!c,children:"Reject"})]})]}),G&&o.jsx(mr,{message:"Sign in to the timetracking portal in Chrome, then try again."}),a&&!G&&o.jsx("div",{className:"alert alert-error mb-4",children:o.jsx("span",{children:a})}),b.length>0&&o.jsxs(o.Fragment,{children:[y&&j&&o.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:["Showing cached data from ",Bv(j)]}),o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[o.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total hours"}),o.jsx("div",{className:"font-display text-xl font-bold",children:w.toFixed(1)})]}),o.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Working days"}),o.jsx("div",{className:"font-display text-xl font-bold",children:C})]}),o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Projects"}),o.jsx("div",{className:"font-display text-xl font-bold",children:h.length})]}),o.jsxs("div",{className:"p-3",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Draft entries"}),o.jsx("div",{className:"font-display text-xl font-bold",children:k})]})]}),o.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"By project"}),o.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:o.jsxs("table",{className:"table table-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Project"}),o.jsx("th",{children:"Activities"}),o.jsx("th",{className:"text-right",children:"Hours"}),o.jsx("th",{className:"text-right",children:"Entries"})]})}),o.jsx("tbody",{children:h.map(E=>o.jsxs("tr",{children:[o.jsx("td",{children:g.has(E.projectId)?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-sm",children:g.get(E.projectId)}),o.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:E.projectId})]}):o.jsx("span",{className:"font-mono text-sm",children:E.projectId})}),o.jsx("td",{className:"text-sm",children:Array.from(E.activities).join(", ")}),o.jsx("td",{className:"text-right font-semibold",children:E.totalHours.toFixed(1)}),o.jsx("td",{className:"text-right",children:E.entryCount})]},E.projectId))})]})}),o.jsxs("details",{open:n,onToggle:E=>s(E.target.open),children:[o.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Raw booking lines (",b.length,")"]}),o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"table table-xs",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Date"}),o.jsx("th",{children:"Project"}),o.jsx("th",{children:"Activity"}),o.jsx("th",{className:"text-right",children:"Hours"}),o.jsx("th",{children:"Status"})]})}),o.jsx("tbody",{children:b.map((E,M)=>o.jsxs("tr",{children:[o.jsx("td",{children:String(E.date??"")}),o.jsx("td",{className:"font-mono text-xs",children:String(E.projectId??"")}),o.jsx("td",{children:String(E.activity??"")}),o.jsx("td",{className:"text-right",children:Number(E.hours??0).toFixed(1)}),o.jsx("td",{children:o.jsx(U,{variant:String(E.status)==="posted"?"success":"warning",size:"xs",children:String(E.status??"")})})]},M))})]})})]})]}),i&&(i.data??[]).length===0&&b.length===0&&!a&&o.jsxs("p",{className:"text-sm opacity-50",children:["No entries found for ",e,"."]}),f.length>0&&o.jsxs("div",{className:"mb-6",children:[o.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Goal progress"}),o.jsx(Rv,{goals:f,activityHours:S,projectNames:g,activityNames:m,month:e,today:T})]}),o.jsx("div",{className:"mt-6",children:o.jsx($v,{goals:f,month:e,onGoalChange:x,knownCombos:N,projectNames:g,activityNames:m,onRefreshProjects:A,refreshingProjects:z})})]})}const Wv=["MBTMY THE BASE CAMP","MBTMY THE TRAILHEAD","MBTMY THE FOOTHILLS","MBTMY THE BRIDGE","MBTMY THE MEADOW","MBTMY THE FOREST","MBTMY THE LOOKOUT","MBTMY THE CLIFFSIDE","MBTMY THE LEDGE","MBTMY THE HIGHPOINT","MBTMY THE VISTA","MBTMY THE SHOULDER","MBTMY THE PINNACLE","MBTMY THE DESCENT"];function Hv({value:e,onChange:t}){const[n,s]=v.useState(!1),[r,i]=v.useState(-1),a=v.useRef(null),l=v.useRef(null),c=Wv.filter(d=>d.toLowerCase().includes(e.toLowerCase())),u=v.useCallback(d=>{t(d),s(!1),i(-1)},[t]);v.useEffect(()=>{function d(f){a.current&&!a.current.contains(f.target)&&(s(!1),i(-1))}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),v.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),i(0),d.preventDefault();return}if(n)switch(d.key){case"ArrowDown":d.preventDefault(),i(f=>f<c.length-1?f+1:0);break;case"ArrowUp":d.preventDefault(),i(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),i(-1);break}}return o.jsxs("div",{ref:a,className:"relative w-full",children:[o.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),i(-1)},onFocus:()=>s(!0),onKeyDown:p,role:"combobox","aria-expanded":n,"aria-autocomplete":"list","aria-controls":"room-listbox"}),n&&c.length>0&&o.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)=>o.jsx("li",{role:"option","aria-selected":f===r,children:o.jsx("button",{type:"button",className:f===r?"active":"",onMouseDown:x=>{x.preventDefault(),u(d)},onMouseEnter:()=>i(f),children:d})},d))})]})}const Yu={free:"success",busy:"error",tentative:"warning",oof:"secondary",elsewhere:"info"},Vv={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"},Kv={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 Tn(e){const t=e.match(/(\d{1,2}:\d{2})/);return t?t[1]:e}function Gv({rows:e}){var r,i;const[t,n]=v.useState(null),s=e.reduce((a,l)=>a+(l.durationMin??0),0);return o.jsxs("div",{children:[s>0&&o.jsxs("div",{className:"mb-6",children:[o.jsx("div",{className:"flex h-10 overflow-hidden gap-px border border-base-300",children:e.map((a,l)=>{const c=s>0?(a.durationMin??0)/s*100:0;if(c<.5)return null;const u=t===l,p=u?Kv[a.state??""]??"bg-base-300":Vv[a.state??""]??"bg-base-300";return o.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&&o.jsx("span",{className:"opacity-60 truncate px-1 font-mono text-[0.65rem] uppercase tracking-wide",children:a.state}),u&&o.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:[a.state,": ",Tn(a.start??""),"–",Tn(a.end??"")," (",a.durationMin,"m)"]})]},l)})}),o.jsxs("div",{className:"flex justify-between mt-1",children:[o.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Tn(((r=e[0])==null?void 0:r.start)??"")}),o.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Tn(((i=e[e.length-1])==null?void 0:i.end)??"")})]})]}),o.jsx("div",{className:"overflow-x-auto border border-base-300",children:o.jsxs("table",{className:"table table-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Start"}),o.jsx("th",{children:"End"}),o.jsx("th",{children:"State"}),o.jsx("th",{className:"text-right",children:"Duration"})]})}),o.jsx("tbody",{children:e.map((a,l)=>o.jsxs("tr",{className:`transition-colors duration-75 ${t===l?"bg-base-200":"hover:bg-base-200"}`,onMouseEnter:()=>n(l),onMouseLeave:()=>n(null),children:[o.jsx("td",{className:"font-mono text-sm",children:Tn(a.start??"")}),o.jsx("td",{className:"font-mono text-sm",children:Tn(a.end??"")}),o.jsx("td",{children:o.jsx(U,{variant:Yu[a.state??""]??"neutral",children:a.state})}),o.jsxs("td",{className:"text-right font-mono text-sm",children:[a.durationMin,"m"]})]},l))})]})}),o.jsx("div",{className:"flex flex-wrap gap-4 mt-3",children:Object.entries(Yu).map(([a,l])=>o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx(U,{variant:l,size:"xs",children:a})},a))})]})}function qv(){return new Date().toISOString().slice(0,10)}function Yv(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 Qv(){const[e,t]=v.useState(""),[n,s]=v.useState(qv()),{running:r,result:i,error:a,approvalPending:l,approvalId:c,run:u,handleApproval:p}=ec(),d=v.useCallback(async()=>{if(!e)return;const j={room:e};n&&(j.date=n),await u("teams/room-availability",j)},[e,n,u]),f=((i==null?void 0:i.data)??[]).map(j=>({start:String(j.start??""),end:String(j.end??""),state:String(j.state??""),durationMin:Number(j.durationMin??0)})),x=v.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),m=f.filter(k=>k.state==="busy").reduce((k,C)=>k+C.durationMin,0),h=f.filter(k=>k.state==="free").length,w=j>0?Math.round(g/j*100):0;return{totalMin:j,freeMin:g,busyMin:m,freeSlots:h,pct:w}},[f]),b=(a==null?void 0:a.includes("auth_required"))||(a==null?void 0:a.includes("sign in")),y=e.replace(/^MBTMY\s+/i,"");return o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Room Availability"}),o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[o.jsxs("label",{className:"form-control flex-1 min-w-0",children:[o.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Room"}),o.jsx(Hv,{value:e,onChange:t})]}),o.jsxs("label",{className:"form-control w-full sm:w-auto",children:[o.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Date"}),o.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,m;return(m=(g=j.target).showPicker)==null?void 0:m.call(g)}})]}),o.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&&o.jsx(mt,{label:"Checking room availability..."}),l&&o.jsxs("div",{className:"alert alert-warning mb-4",children:[o.jsx("span",{children:"This connector requires approval before proceeding."}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{className:"btn btn-sm btn-success",onClick:()=>p(!0),disabled:!c,children:"Approve"}),o.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>p(!1),disabled:!c,children:"Reject"})]})]}),b&&o.jsx(mr,{message:"Sign in to Microsoft Teams in Chrome, then try again."}),a&&!b&&o.jsx("div",{className:"alert alert-error mb-4",children:o.jsx("span",{children:a})}),i&&f.length>0&&x&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 border border-base-300 mb-6",children:[o.jsxs("div",{className:"p-3 border-r border-b border-base-300 md:border-b-0",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Available"}),o.jsxs("div",{className:"font-display text-xl font-bold text-success",children:[x.pct,"%"]})]}),o.jsxs("div",{className:"p-3 border-b border-base-300 md:border-r md:border-b-0",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Free time"}),o.jsxs("div",{className:"font-display text-xl font-bold",children:[Math.floor(x.freeMin/60),"h ",x.freeMin%60,"m"]})]}),o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Busy time"}),o.jsxs("div",{className:"font-display text-xl font-bold",children:[Math.floor(x.busyMin/60),"h ",x.busyMin%60,"m"]})]}),o.jsxs("div",{className:"p-3",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Free slots"}),o.jsx("div",{className:"font-display text-xl font-bold",children:x.freeSlots})]})]}),o.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:[y||"Room"," · ",Yv(n)]}),o.jsx(Gv,{rows:f})]}),i&&f.length===0&&!a&&o.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No availability data found"}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"Try a different room or date."})]}),!i&&!r&&!a&&o.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Select a room and date to check availability"}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"Free/busy slots will appear as a visual timeline."})]})]})}function Jv({data:e}){const{timetracking:t,meetings:n,jira:s,git:r}=e,i=t?Math.min(100,Math.round(t.totalHours/t.targetHours*100)):0,a=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 o.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:[o.jsxs("div",{className:"stat bg-base-200 rounded-box p-4",children:[o.jsx("div",{className:"stat-title text-xs",children:"Hours Logged"}),o.jsx("div",{className:`stat-value text-2xl ${a?"text-warning":"text-success"}`,children:t?`${t.totalHours}h`:"—"}),o.jsxs("div",{className:"stat-desc",children:["/ ",(t==null?void 0:t.targetHours)??40,"h target"]}),t&&o.jsx("progress",{className:`progress ${a?"progress-warning":"progress-success"} w-full mt-1`,value:i,max:100})]}),o.jsxs("div",{className:"stat bg-base-200 rounded-box p-4",children:[o.jsx("div",{className:"stat-title text-xs",children:"Meetings"}),o.jsx("div",{className:`stat-value text-2xl ${n&&n.totalHours>20?"text-warning":"text-info"}`,children:n?String(n.totalCount):"—"}),o.jsx("div",{className:"stat-desc",children:n?`${n.totalHours}h · avg ${n.avgDurationMin}min`:""})]}),o.jsxs("div",{className:"stat bg-base-200 rounded-box p-4",children:[o.jsx("div",{className:"stat-title text-xs",children:"Tickets Done"}),o.jsx("div",{className:"stat-value text-2xl text-accent",children:s?String(s.resolved.length):"—"}),o.jsx("div",{className:"stat-desc",children:s?o.jsxs(o.Fragment,{children:[s.inProgress.length," in progress",l>0&&o.jsxs("span",{className:"text-error font-semibold ml-1",children:["· ",l," blocked"]})]}):""})]}),o.jsxs("div",{className:"stat bg-base-200 rounded-box p-4",children:[o.jsx("div",{className:"stat-title text-xs",children:"Commits"}),o.jsx("div",{className:"stat-value text-2xl text-primary",children:r?String(r.totalCommits):"—"}),o.jsx("div",{className:"stat-desc",children:r?`${r.totalPRsMerged} PRs · ${c} repo${c!==1?"s":""}`:""})]})]})}const Xv=["Mon","Tue","Wed","Thu","Fri"];function Zv(e){const t=new Date(e).getDay();return Xv[t-1]??e}function e1({data:e}){const{timetracking:t,meetings:n,git:s,jira:r}=e,i=new Set;t==null||t.daily.forEach(f=>i.add(f.date)),n==null||n.daily.forEach(f=>i.add(f.date)),s==null||s.daily.forEach(f=>i.add(f.date));const a=[...i].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 a.length===0?o.jsx("div",{className:"text-base-content/60",children:"No daily data available."}):o.jsx("div",{className:"overflow-x-auto",children:o.jsxs("table",{className:"table table-sm",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Day"}),o.jsx("th",{children:"Date"}),o.jsx("th",{children:"Hours Logged"}),o.jsx("th",{children:"Meetings"}),o.jsx("th",{children:"Commits"}),o.jsx("th",{children:"Tickets"})]})}),o.jsx("tbody",{children:a.map(f=>{const x=t==null?void 0:t.daily.find(m=>m.date===f),b=n==null?void 0:n.daily.find(m=>m.date===f),y=s==null?void 0:s.daily.find(m=>m.date===f),j=t==null?void 0:t.gaps.includes(f),g=(r==null?void 0:r.resolved.filter(m=>m.resolvedDate===f))??[];return o.jsxs("tr",{className:j?"bg-warning/10":"",children:[o.jsx("td",{className:"font-medium",children:Zv(f)}),o.jsx("td",{className:"text-xs text-base-content/60",children:f}),o.jsxs("td",{children:[o.jsx("span",{className:j?"text-warning font-semibold":"",children:x?`${x.hours}h`:"—"}),j&&o.jsx("span",{className:"ml-1 text-warning text-xs",children:"⚠"})]}),o.jsx("td",{children:b?`${b.count} (${b.hours}h)`:"—"}),o.jsx("td",{children:y?`${y.commits}`:"0"}),o.jsx("td",{className:"text-xs",children:g.length>0?g.map(m=>m.key).join(", "):"—"})]},f)})}),o.jsx("tfoot",{children:o.jsxs("tr",{className:"font-semibold border-t border-base-300",children:[o.jsx("td",{colSpan:2,children:"Total"}),o.jsx("td",{children:l>0?`${l}h`:"—"}),o.jsx("td",{children:c>0?`${c} (${u}h)`:"—"}),o.jsx("td",{children:p}),o.jsx("td",{className:"text-xs",children:d>0?`${d} done`:"—"})]})})]})})}function t1({insights:e,errors:t}){return o.jsxs("div",{className:"space-y-3",children:[e.length>0&&o.jsxs("div",{className:"bg-base-200 rounded-box p-4",children:[o.jsx("h3",{className:"font-semibold mb-2",children:"Insights"}),o.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm",children:e.map((n,s)=>o.jsx("li",{children:n},s))})]}),t.length>0&&o.jsx("div",{className:"alert alert-warning text-sm",children:o.jsxs("div",{children:[o.jsx("p",{className:"font-semibold",children:"Some data sources had issues:"}),o.jsx("ul",{className:"list-disc list-inside mt-1",children:t.map((n,s)=>o.jsx("li",{children:n},s))})]})})]})}function gh(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 n1(){const e=new Date;return e.setDate(e.getDate()-e.getDay()),gh(e)}function Qu(e,t){const n=new Date(e+"T00:00:00");return n.setDate(n.getDate()+t*7),gh(n)}function s1(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 r1(){const[e,t]=v.useState(n1()),[n,s]=v.useState(!1),[r,i]=v.useState(null),[a,l]=v.useState(null),[c,u]=v.useState(null);async function p(){s(!0),l(null),i(null),u(null);const d=Date.now();try{const f=await F.generateJournal({weekStart:e});u(Date.now()-d),i(f)}catch(f){l(f instanceof Error?f.message:"Unknown error")}finally{s(!1)}}return o.jsxs("div",{className:"space-y-6 max-w-5xl",children:[o.jsx("h1",{className:"text-2xl font-bold",children:"Dev Work Journal"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(Qu(e,-1)),disabled:n,children:"◄"}),o.jsx("span",{className:"font-medium text-lg",children:s1(e)}),o.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(Qu(e,1)),disabled:n,children:"►"}),o.jsx("button",{className:"btn btn-primary ml-4",onClick:p,disabled:n,children:n?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"loading loading-spinner loading-xs"}),"Generating…"]}):"Generate"}),c!==null&&!n&&o.jsxs("span",{className:"text-xs text-base-content/40 ml-2",children:["Generated in ",(c/1e3).toFixed(1),"s"]})]}),n&&o.jsxs("div",{className:"flex items-center gap-3 text-base-content/60",children:[o.jsx("span",{className:"loading loading-spinner loading-md"}),o.jsx("span",{children:"Gathering data from Git, Outlook, Jira…"})]}),a&&o.jsx("div",{role:"alert",className:"alert alert-error",children:o.jsx("span",{children:a})}),(r==null?void 0:r.status)==="partial"&&o.jsx("div",{role:"alert",className:"alert alert-warning text-sm",children:o.jsxs("div",{children:[o.jsx("p",{className:"font-semibold",children:"Some data sources were unavailable. Results may be incomplete."}),o.jsx("ul",{className:"list-disc list-inside mt-1",children:r.errors.map((d,f)=>o.jsx("li",{children:d},f))})]})}),r&&r.status!=="error"&&o.jsxs("div",{className:"space-y-6",children:[o.jsx(Jv,{data:r}),o.jsx(e1,{data:r}),o.jsx(t1,{insights:r.insights,errors:r.errors})]}),(r==null?void 0:r.status)==="error"&&o.jsx("div",{role:"alert",className:"alert alert-error",children:o.jsxs("span",{children:["Failed to generate journal. ",r.errors.join("; ")]})})]})}const i1={socket:"info",wiz:"secondary",tldrsec:"warning"},o1={socket:"SOCKET",wiz:"WIZ",tldrsec:"TLDR SEC"};function a1(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 l1(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 i=Math.floor(r/24);return i===1?"yesterday":i<7?`${i}d ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return e}}function c1(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 u1(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 d1(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 Ju={7:"Past 7 days",30:"Past 30 days"};function f1(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 p1(){const[e,t]=v.useState(7),[n,s]=v.useState("idle"),[r,i]=v.useState("idle"),[a,l]=v.useState("idle"),[c,u]=v.useState([]),[p,d]=v.useState([]),[f,x]=v.useState([]),[b,y]=v.useState(null),[j,g]=v.useState(null),[m,h]=v.useState(null),[w,k]=v.useState(null),[C,S]=v.useState(!1);v.useEffect(()=>{let E=!1;return F.getCachedSecurityNews().then(M=>{if(!E&&M.data&&M.data.length>0){if(s(O=>O==="loading"?(E=!0,O):"done"),E)return;const P=[],R=[],L=[];for(const O of M.data){const D=O;D.source==="wiz"?R.push(D):D.source==="tldrsec"?L.push(D):P.push(D)}u(P),d(R),x(L),k(M.fetchedAt),S(!0),i("done"),l("done")}}).catch(()=>{}),()=>{E=!0}},[]);const N=n==="loading"||r==="loading"||a==="loading",T=c.length>0||p.length>0||f.length>0,A=v.useMemo(()=>[...c,...p,...f].filter(M=>a1(M.date,e)).sort((M,P)=>new Date(P.date).getTime()-new Date(M.date).getTime()),[c,p,f,e]),z=v.useMemo(()=>{const E=A.filter(R=>R.source==="socket").length,M=A.filter(R=>R.source==="wiz").length,P=A.filter(R=>R.source==="tldrsec").length;return{total:A.length,socketCount:E,wizCount:M,tldrsecCount:P}},[A]),G=v.useCallback(async()=>{s("loading"),i("loading"),l("loading"),y(null),g(null),h(null),u([]),d([]),x([]),S(!1);let E=[],M=[],P=[];const R=F.run("socket/security-news",{}).then($=>{!$.ok&&$.error?(y($.error),s("error")):(E=c1($),u(E),s("done"))}).catch($=>{y($ instanceof Error?$.message:"Failed to fetch"),s("error")}),L=F.run("wiz/blog-security",{}).then($=>{!$.ok&&$.error?(g($.error),i("error")):(M=u1($),d(M),i("done"))}).catch($=>{g($ instanceof Error?$.message:"Failed to fetch"),i("error")}),O=F.run("tldrsec/newsletter",{}).then($=>{!$.ok&&$.error?(h($.error),l("error")):(P=d1($),x(P),l("done"))}).catch($=>{h($ instanceof Error?$.message:"Failed to fetch"),l("error")});await Promise.allSettled([R,L,O]);const D=[...E,...M,...P];if(D.length>0){const $=new Date().toISOString();k($),F.cacheSecurityNews(D).catch(()=>{})}},[]),V=E=>(E==null?void 0:E.includes("auth_required"))||(E==null?void 0:E.includes("sign in"));return o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Security News"}),o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[o.jsxs("label",{className:"form-control w-full sm:w-auto",children:[o.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Range"}),o.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:e,onChange:E=>t(Number(E.target.value)),children:[o.jsx("option",{value:7,children:"Past 7 days"}),o.jsx("option",{value:30,children:"Past 30 days"})]})]}),o.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:G,disabled:N,children:N?"Loading...":"Load news"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(na,{label:"Socket",status:n}),o.jsx(na,{label:"Wiz",status:r}),o.jsx(na,{label:"tl;dr sec",status:a})]})]}),N&&o.jsx(mt,{label:"Fetching security news..."}),b&&(V(b)?o.jsx(mr,{message:"Sign in to Socket.dev in Chrome, then try again."}):o.jsx("div",{className:"alert alert-error mb-3",children:o.jsxs("span",{children:[o.jsx("span",{className:"font-semibold",children:"Socket:"})," ",b]})})),j&&(V(j)?o.jsx(mr,{message:"Sign in to Wiz in Chrome, then try again."}):o.jsx("div",{className:"alert alert-error mb-3",children:o.jsxs("span",{children:[o.jsx("span",{className:"font-semibold",children:"Wiz:"})," ",j]})})),m&&o.jsx("div",{className:"alert alert-error mb-3",children:o.jsxs("span",{children:[o.jsx("span",{className:"font-semibold",children:"tl;dr sec:"})," ",m]})}),w&&!N&&o.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"," ",f1(w)]}),T&&!N&&o.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 border border-base-300 mb-6",children:[o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:Ju[e]}),o.jsx("div",{className:"font-display text-xl font-bold",children:z.total})]}),o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Socket"}),o.jsx("div",{className:"font-display text-xl font-bold",children:z.socketCount})]}),o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Wiz"}),o.jsx("div",{className:"font-display text-xl font-bold",children:z.wizCount})]}),o.jsxs("div",{className:"p-3",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"tl;dr sec"}),o.jsx("div",{className:"font-display text-xl font-bold",children:z.tldrsecCount})]})]}),A.length>0&&o.jsx("div",{className:"space-y-px",children:A.map((E,M)=>o.jsxs("article",{className:"border border-base-300 p-4",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[o.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}),o.jsx(U,{variant:i1[E.source]??"neutral",size:"xs",children:o1[E.source]??E.source.toUpperCase()})]}),E.summary&&o.jsx("p",{className:"text-sm opacity-60 leading-relaxed mb-2 line-clamp-2",children:E.summary}),o.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[o.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:l1(E.date)}),E.author&&o.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:E.author}),E.tags&&o.jsx("div",{className:"flex gap-1 flex-wrap",children:E.tags.split(",").slice(0,3).map(P=>o.jsx(U,{variant:"neutral",size:"xs",children:P.trim()},P.trim()))})]})]},`${E.source}-${M}`))}),T&&A.length===0&&!N&&o.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[o.jsxs("p",{className:"text-sm opacity-50 mb-1",children:["No news from the ",Ju[e].toLowerCase()]}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"All sources returned data, but nothing within the date window."})]}),!T&&!N&&!b&&!j&&!m&&o.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-1",children:"Security news from Socket, Wiz, and tl;dr sec"}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"Select a range and press Load news to fetch the latest posts."})]})]})}function na({label:e,status:t}){const n={idle:"opacity-30",loading:"bg-warning animate-pulse",done:"bg-success",error:"bg-error"}[t];return o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:`w-1.5 h-1.5 ${n}`,"aria-hidden":"true"}),o.jsx("span",{className:"font-mono text-[0.6rem] opacity-50 uppercase",children:e})]})}function Xr(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 Xu(e){return e===null?"none":e<0?"expired":e<=7?"critical":e<=30?"warning":"ok"}function h1(e,t){switch(e){case"expired":return o.jsx(U,{variant:"error",size:"xs",children:"EXPIRED"});case"critical":return o.jsxs(U,{variant:"error",size:"xs",children:[t,"d LEFT"]});case"warning":return o.jsxs(U,{variant:"warning",size:"xs",children:[t,"d LEFT"]});case"ok":return o.jsxs(U,{variant:"success",size:"xs",children:[t,"d LEFT"]});case"none":return o.jsx(U,{variant:"neutral",size:"xs",children:"NO EXPIRY"});default:return null}}function m1(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 g1(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 y1(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 x1(){const[e,t]=v.useState("idle"),[n,s]=v.useState(""),[r,i]=v.useState([]),[a,l]=v.useState(null),[c,u]=v.useState("all"),[p,d]=v.useState(null),[f,x]=v.useState(!1),b=e==="clients"||e==="trustedby";v.useEffect(()=>{let w=!1;return F.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;i(C),d(k.fetchedAt),x(!0),s(`Loaded ${C.length} trusted peers from cache.`)}}).catch(()=>{}),()=>{w=!0}},[]);const y=v.useCallback(async()=>{t("clients"),l(null),i([]),x(!1),s("Fetching client list (all regions)...");try{const w=await F.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 F.run("tokenmaster/client-trustedby",{clientid:T.id,region:T.region});if(A.ok&&A.data)for(const z of A.data)C.push({parentClientId:T.id,parentClientName:T.name||T.id,peerId:String(z.id??""),peerName:String(z.name??""),peerIdDisplay:String(z.idDisplay??""),expiryDate:z.expiry_date?String(z.expiry_date):null,region:String(z.region??T.region)})}catch{}}if(i(C),s(`Loaded ${C.length} trusted peers from ${S} clients.`),t("done"),C.length>0){const N=new Date().toISOString();d(N),F.cacheTrustedPeers(C).catch(()=>{})}}catch(w){l(w instanceof Error?w.message:"Unknown error"),t("error")}},[]),j=v.useMemo(()=>[...c==="all"?r:r.filter(k=>k.region===c)].sort((k,C)=>{const S=Xr(k.expiryDate),N=Xr(C.expiryDate);return S===null&&N===null?0:S===null?1:N===null?-1:S-N}),[r,c]),g=v.useMemo(()=>{let w=0,k=0,C=0;for(const S of j){const N=Xu(Xr(S.expiryDate));N==="expired"?w++:N==="critical"?k++:N==="warning"&&C++}return{total:j.length,expired:w,critical:k,warning:C}},[j]),m=v.useMemo(()=>{const w=new Set(r.map(k=>k.region));return Array.from(w).sort()},[r]),h=w=>(w==null?void 0:w.includes("auth_required"))||(w==null?void 0:w.includes("sign in"));return o.jsxs("div",{className:"max-w-5xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-5",children:"Trusted Peer Expiry"}),p&&!b&&o.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"," ",y1(p)]}),o.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end gap-3 mb-6",children:[o.jsxs("label",{className:"form-control w-full sm:w-auto",children:[o.jsx("span",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Region"}),o.jsxs("select",{className:"select select-bordered select-sm w-full sm:w-auto",value:c,onChange:w=>u(w.target.value),children:[o.jsx("option",{value:"all",children:"All regions"}),m.map(w=>o.jsx("option",{value:w,children:w.toUpperCase()},w))]})]}),o.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:y,disabled:b,children:b?"Loading...":"Load trusted peers"})]}),b&&o.jsx(mt,{label:n}),a&&(h(a)?o.jsx(mr,{message:"Sign in to TokenMaster in Chrome, then try again."}):o.jsx("div",{className:"alert alert-error mb-3",children:o.jsx("span",{children:a})})),r.length>0&&!b&&o.jsxs("div",{className:"grid grid-cols-4 border border-base-300 mb-6",children:[o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Total"}),o.jsx("div",{className:"font-display text-xl font-bold",children:g.total})]}),o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"Expired"}),o.jsx("div",{className:`font-display text-xl font-bold ${g.expired>0?"text-red-500":""}`,children:g.expired})]}),o.jsxs("div",{className:"p-3 border-r border-base-300",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 7 days"}),o.jsx("div",{className:`font-display text-xl font-bold ${g.critical>0?"text-red-500":""}`,children:g.critical})]}),o.jsxs("div",{className:"p-3",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-1",children:"≤ 30 days"}),o.jsx("div",{className:`font-display text-xl font-bold ${g.warning>0?"text-amber-500":""}`,children:g.warning})]})]}),j.length>0&&o.jsx("div",{className:"border border-base-300 overflow-x-auto",children:o.jsxs("table",{className:"table table-sm w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"border-b border-base-300",children:[o.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Status"}),o.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Expiry Date"}),o.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Days Left"}),o.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Trusted Peer"}),o.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Peer ID"}),o.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Parent Client"}),o.jsx("th",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em]",children:"Region"})]})}),o.jsx("tbody",{children:j.map((w,k)=>{const C=Xr(w.expiryDate),S=Xu(C);return o.jsxs("tr",{className:`border-b border-base-300/50 ${g1(S)}`,children:[o.jsx("td",{children:h1(S,C)}),o.jsx("td",{className:"font-mono text-sm",children:m1(w.expiryDate)}),o.jsx("td",{className:"font-mono text-sm",children:C!==null?C<0?`${Math.abs(C)}d overdue`:`${C}d`:"—"}),o.jsx("td",{className:"text-sm font-semibold",children:w.peerName||w.peerId}),o.jsx("td",{className:"font-mono text-xs opacity-60",children:w.peerIdDisplay||w.peerId}),o.jsx("td",{className:"text-sm",children:w.parentClientName}),o.jsx("td",{children:o.jsx(U,{variant:"neutral",size:"xs",children:w.region.toUpperCase()})})]},`${w.parentClientId}-${w.peerId}-${w.region}-${k}`)})})]})}),e==="done"&&!b&&r.length>0&&o.jsx("div",{className:"mt-1 font-mono text-xs opacity-40",children:n}),e==="done"&&r.length===0&&!b&&o.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No trusted peers found"}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"No clients returned from TokenMaster, or no trustedby relationships exist."})]}),e==="idle"&&o.jsxs("div",{className:"border border-base-300 p-8 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-1",children:"TokenMaster trusted peer expiry monitor"}),o.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 v1=[{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}],b1=[{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."}],w1={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"},j1={client:"bg-sky-400/20",daemon:"bg-amber-400/20",extension:"bg-emerald-400/20",browser:"bg-violet-400/20"},k1=[{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 N1({flow:e}){const{lanes:t,steps:n,title:s}=e,r=t.length,i=`repeat(${r}, 1fr)`;return o.jsxs("div",{className:"border border-base-300 p-4 overflow-x-auto",children:[o.jsx("h4",{className:"font-semibold text-sm mb-3",children:s}),o.jsxs("div",{style:{minWidth:r*130},children:[o.jsx("div",{className:"grid",style:{gridTemplateColumns:i},children:t.map(a=>o.jsx("div",{className:"flex justify-center",children:o.jsx("span",{className:`px-2 py-1 text-[0.65rem] font-mono font-semibold border ${w1[a.color]}`,children:a.label})},a.id))}),o.jsxs("div",{className:"relative py-1",children:[o.jsx("div",{className:"absolute inset-0 grid pointer-events-none",style:{gridTemplateColumns:i},children:t.map(a=>o.jsx("div",{className:"flex justify-center",children:o.jsx("div",{className:`w-0.5 h-full ${j1[a.color]}`})},a.id))}),o.jsx("div",{className:"relative",children:n.map((a,l)=>{if(a.type==="action"){const j=(t.findIndex(g=>g.id===a.lane)+.5)/r*100;return o.jsx("div",{className:"relative",style:{height:26},children:o.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${j}%`},children:o.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:a.label})})},l)}const c=t.findIndex(y=>y.id===a.from),u=t.findIndex(y=>y.id===a.to),p=(c+.5)/r*100,d=(u+.5)/r*100,f=Math.min(p,d),x=Math.abs(d-p),b=c<u;return o.jsxs("div",{className:"relative",style:{height:30},children:[o.jsx("div",{className:"absolute top-1/2 h-px bg-base-content/20",style:{left:`${f}%`,width:`${x}%`}}),o.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}%`}}),o.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(${b?"-100%":"0"}, -50%)`},children:b?"▸":"◂"}),o.jsx("div",{className:"absolute top-1/2 -translate-x-1/2 -translate-y-1/2 z-10",style:{left:`${(p+d)/2}%`},children:o.jsx("span",{className:"px-1.5 py-px text-[0.6rem] font-mono bg-base-100 text-base-content/60 whitespace-nowrap",children:a.label})})]},l)})})]})]})]})}const S1=[{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 C1(){return o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Architecture"}),o.jsx("p",{className:"text-sm opacity-60 mb-6",children:"How commandGarden's components fit together."}),o.jsx("div",{id:"arch-diagram",className:"border border-base-300 p-5 mb-8 overflow-x-auto scroll-mt-4",children:o.jsxs("svg",{viewBox:"0 0 780 300",className:"w-full text-base-content",style:{minWidth:620},children:[o.jsxs("defs",{children:[o.jsx("marker",{id:"arch-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:o.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.3})}),o.jsx("marker",{id:"arch-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:o.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.3})})]}),o.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}),o.jsx("text",{x:75,y:29,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI Client"}),o.jsx("text",{x:75,y:44,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Node.js"}),o.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}),o.jsx("text",{x:75,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),o.jsx("text",{x:75,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"React SPA"}),o.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}),o.jsx("text",{x:262,y:141,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"App Server"}),o.jsx("text",{x:262,y:156,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9092"}),o.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}),o.jsx("text",{x:475,y:38,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),o.jsx("text",{x:475,y:56,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),o.jsx("text",{x:475,y:78,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),o.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}),o.jsx("text",{x:690,y:44,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),o.jsx("text",{x:690,y:62,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),o.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}),o.jsx("text",{x:695,y:221,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),o.jsx("text",{x:695,y:237,textAnchor:"middle",fill:"currentColor",fontSize:9,opacity:.4,fontFamily:"ui-monospace,monospace",children:"target page"}),o.jsx("rect",{x:195,y:240,width:100,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),o.jsx("text",{x:245,y:257,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"App DB"}),o.jsx("text",{x:245,y:269,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"SQLite"}),o.jsx("rect",{x:390,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),o.jsx("text",{x:442,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Audit Log"}),o.jsx("text",{x:442,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"SQLite"}),o.jsx("rect",{x:500,y:200,width:85,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),o.jsx("text",{x:542,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Config"}),o.jsx("text",{x:542,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"YAML"}),o.jsx("rect",{x:75,y:200,width:105,height:36,rx:3,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),o.jsx("text",{x:127,y:217,textAnchor:"middle",fill:"currentColor",fontSize:9,fontWeight:500,opacity:.45,children:"Session Token"}),o.jsx("text",{x:127,y:229,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.25,fontFamily:"ui-monospace,monospace",children:"file"}),o.jsx("line",{x1:137,y1:33,x2:393,y2:45,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),o.jsx("text",{x:255,y:28,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"HTTP :9091"}),o.jsx("line",{x1:137,y1:145,x2:188,y2:145,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),o.jsx("line",{x1:337,y1:138,x2:393,y2:78,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),o.jsx("text",{x:354,y:97,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"proxy"}),o.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)"}),o.jsx("text",{x:585,y:40,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),o.jsx("line",{x1:695,y1:82,x2:695,y2:198,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#arch-ah)"}),o.jsx("text",{x:720,y:132,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"Content"}),o.jsx("text",{x:720,y:144,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"Scripts"}),o.jsx("text",{x:720,y:160,fill:"currentColor",fontSize:8,opacity:.35,fontFamily:"ui-monospace,monospace",children:"+ CDP"}),o.jsx("line",{x1:245,y1:172,x2:245,y2:238,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),o.jsx("line",{x1:442,y1:96,x2:442,y2:198,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),o.jsx("line",{x1:520,y1:96,x2:542,y2:198,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),o.jsx("line",{x1:75,y1:60,x2:110,y2:198,stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"3 2"}),o.jsx("line",{x1:200,y1:172,x2:155,y2:198,stroke:"currentColor",strokeOpacity:.08,strokeDasharray:"3 2"})]})}),o.jsx("h3",{id:"arch-components",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Components"}),o.jsx("div",{className:"space-y-2 mb-8",children:v1.map(e=>o.jsxs("div",{className:"border border-base-300 p-4",children:[o.jsxs("div",{className:"flex items-center gap-3 flex-wrap mb-1",children:[o.jsx("span",{className:"font-semibold",children:e.name}),o.jsx(U,{size:"xs",children:e.tech}),e.port&&o.jsxs(U,{variant:"info",size:"xs",children:[":",e.port]}),e.pkg&&o.jsx(U,{variant:"secondary",size:"xs",children:e.pkg})]}),o.jsx("p",{className:"text-sm opacity-60",children:e.desc})]},e.name))}),o.jsx("h3",{id:"arch-stores",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Stores"}),o.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:o.jsxs("table",{className:"table table-sm w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-base-200",children:[o.jsx("th",{children:"Store"}),o.jsx("th",{children:"Format"}),o.jsx("th",{children:"Path"}),o.jsx("th",{children:"Purpose"})]})}),o.jsx("tbody",{children:b1.map(e=>o.jsxs("tr",{className:"hover:bg-base-200",children:[o.jsx("td",{className:"font-semibold text-sm",children:e.name}),o.jsx("td",{children:o.jsx(U,{size:"xs",children:e.tech})}),o.jsx("td",{className:"font-mono text-xs opacity-60",children:e.path}),o.jsx("td",{className:"text-sm opacity-60",children:e.desc})]},e.name))})]})}),o.jsx("h3",{id:"arch-flows",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Data Flows"}),o.jsx("div",{className:"space-y-4 mb-8",children:k1.map(e=>o.jsx(N1,{flow:e},e.title))}),o.jsx("h3",{id:"arch-security",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Security Model"}),o.jsx("div",{className:"border border-base-300 p-4 mb-8",children:o.jsxs("ul",{className:"space-y-2",children:[o.jsxs("li",{className:"text-sm opacity-70",children:[o.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."]}),o.jsxs("li",{className:"text-sm opacity-70",children:[o.jsx("span",{className:"font-semibold opacity-100",children:"Domain guard"})," — connector YAML declares allowed domains. Extension refuses to run on undeclared domains."]}),o.jsxs("li",{className:"text-sm opacity-70",children:[o.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."]}),o.jsxs("li",{className:"text-sm opacity-70",children:[o.jsx("span",{className:"font-semibold opacity-100",children:"Audit-or-fail"})," — if the audit store is unavailable, commands are blocked."]}),o.jsxs("li",{className:"text-sm opacity-70",children:[o.jsx("span",{className:"font-semibold opacity-100",children:"No credentials stored"})," — commandGarden reuses existing Chrome sessions. No passwords or cookies are persisted."]}),o.jsxs("li",{className:"text-sm opacity-70",children:[o.jsx("span",{className:"font-semibold opacity-100",children:"Localhost only"})," — daemon and app server bind to 127.0.0.1 by default."]})]})}),o.jsx("h3",{id:"arch-packages",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Workspace Packages"}),o.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:o.jsxs("table",{className:"table table-sm w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-base-200",children:[o.jsx("th",{children:"Package"}),o.jsx("th",{children:"Description"}),o.jsx("th",{children:"Published"})]})}),o.jsx("tbody",{children:S1.map(e=>o.jsxs("tr",{className:"hover:bg-base-200",children:[o.jsx("td",{className:"font-mono text-sm font-semibold",children:e.name}),o.jsx("td",{className:"text-sm opacity-60",children:e.desc}),o.jsx("td",{children:e.published?o.jsx(U,{variant:"success",size:"xs",children:"npm"}):o.jsx(U,{size:"xs",children:"bundled"})})]},e.name))})]})}),o.jsx("h3",{id:"arch-build",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Build Order"}),o.jsxs("div",{className:"border border-base-300 p-4",children:[o.jsx("div",{className:"flex flex-wrap items-center gap-2 font-mono text-sm",children:["shared","daemon","cli","chrome","app"].map((e,t)=>o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"px-2 py-1 border border-base-300 bg-base-200",children:e}),t<4&&o.jsx("span",{className:"opacity-40",children:"→"})]},e))}),o.jsxs("p",{className:"text-sm opacity-60 mt-2",children:["Run ",o.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 E1={GET:"success",POST:"warning",PUT:"info",DELETE:"error",WS:"secondary",SSE:"secondary"},T1=[{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."}],L1=[{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 }"}],A1=[{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."}],I1=[{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 Zu({ep:e}){const[t,n]=v.useState(!1),s=e.params||e.body||e.response;return o.jsxs("div",{className:"border-b border-base-300/50 last:border-b-0",children:[o.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:[o.jsx(U,{variant:E1[e.method]??"neutral",size:"xs",className:"w-10 justify-center shrink-0",children:e.method}),o.jsx("span",{className:"font-mono text-sm flex-1",children:e.path}),e.auth&&o.jsx(U,{variant:"warning",size:"xs",children:"auth"}),s&&o.jsx("span",{className:"text-xs opacity-40",children:t?"▾":"▸"})]}),o.jsx("div",{className:"px-3 pb-2 pl-16 text-sm opacity-60",children:e.desc}),t&&s&&o.jsxs("div",{className:"px-3 pb-3 pl-16 space-y-1.5",children:[e.params&&o.jsxs("div",{className:"text-xs",children:[o.jsx("span",{className:"font-semibold opacity-50",children:"Params: "}),o.jsx("span",{className:"font-mono opacity-60",children:e.params})]}),e.body&&o.jsxs("div",{className:"text-xs",children:[o.jsx("span",{className:"font-semibold opacity-50",children:"Body: "}),o.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.body})]}),e.response&&o.jsxs("div",{className:"text-xs",children:[o.jsx("span",{className:"font-semibold opacity-50",children:"Response: "}),o.jsx("code",{className:"font-mono bg-base-200 px-1 py-0.5 opacity-70",children:e.response})]})]})]})}function P1(){const[e,t]=v.useState("cli");return o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"API & CLI Reference"}),o.jsx("p",{className:"text-sm opacity-60 mb-6",children:"CLI commands, Daemon API endpoints, and App Server endpoints."}),o.jsx("div",{id:"api-endpoints",className:"border border-base-300 bg-base-200/30 p-3 mb-6 scroll-mt-4",children:o.jsxs("p",{className:"text-sm opacity-70",children:[o.jsx("span",{className:"font-semibold",children:"Authentication:"})," Daemon endpoints (except ",o.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/api/status"})," and ",o.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"/ws/extension"}),") require an ",o.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"Authorization: Bearer <token>"})," header and an ",o.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."]})}),o.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=>o.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," ",o.jsx("span",{className:"font-mono text-xs opacity-40 ml-1",children:n.sub})]},n.id))}),e==="cli"&&o.jsx("div",{className:"space-y-2 mb-8",children:A1.map(n=>o.jsxs("div",{className:"border border-base-300 p-3",children:[o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx("code",{className:"font-mono text-sm font-semibold bg-base-200 px-2 py-0.5 shrink-0",children:n.cmd}),o.jsx("span",{className:"text-sm opacity-60 pt-0.5",children:n.desc})]}),n.args&&o.jsxs("div",{className:"mt-2 ml-1 text-xs",children:[o.jsx("span",{className:"font-semibold opacity-50",children:"Args: "}),o.jsx("span",{className:"opacity-60",children:n.args})]}),n.opts&&n.opts.length>0&&o.jsx("div",{className:"mt-1.5 ml-1 space-y-0.5",children:n.opts.map((s,r)=>o.jsx("div",{className:"text-xs font-mono opacity-50",children:s},r))}),n.example&&o.jsx("div",{className:"mt-2 ml-1",children:o.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"&&o.jsx("div",{className:"border border-base-300 mb-8",children:T1.map((n,s)=>o.jsx(Zu,{ep:n},s))}),e==="app-api"&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm opacity-50 mb-3",children:["The App Server on ",o.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."]}),o.jsx("div",{className:"border border-base-300 mb-8",children:L1.map((n,s)=>o.jsx(Zu,{ep:n},s))})]}),o.jsx("h3",{id:"api-pipeline",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Pipeline Steps"}),o.jsx("p",{className:"text-sm opacity-50 mb-3",children:"Available steps for connector YAML pipeline definitions."}),o.jsx("div",{className:"overflow-x-auto border border-base-300 mb-8",children:o.jsxs("table",{className:"table table-sm w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-base-200",children:[o.jsx("th",{children:"Step"}),o.jsx("th",{children:"Capability"}),o.jsx("th",{children:"Description"})]})}),o.jsx("tbody",{children:I1.map(n=>o.jsxs("tr",{className:"hover:bg-base-200",children:[o.jsx("td",{className:"font-mono text-sm font-semibold",children:n.step}),o.jsx("td",{children:o.jsx(U,{size:"xs",variant:n.capability==="—"?"neutral":"info",children:n.capability})}),o.jsx("td",{className:"text-sm opacity-60",children:n.desc})]},n.step))})]})}),o.jsx("h3",{id:"api-expressions",className:"font-display text-base font-semibold mb-3 scroll-mt-4",children:"Expression Syntax"}),o.jsxs("div",{className:"border border-base-300 p-4",children:[o.jsxs("p",{className:"text-sm opacity-60 mb-3",children:["Use ",o.jsx("code",{className:"font-mono text-xs bg-base-200 px-1 py-0.5",children:"${{ }}"})," for template expressions (no JS eval):"]}),o.jsxs("div",{className:"space-y-1.5 font-mono text-xs",children:[o.jsxs("div",{className:"flex gap-3",children:[o.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Variable access"}),o.jsx("code",{className:"opacity-70",children:"args.month, vars.token, cookies.name"})]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Row access (map)"}),o.jsx("code",{className:"opacity-70",children:"row.id, row.name"})]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Concatenation"}),o.jsx("code",{className:"opacity-70",children:'"Bearer " + vars.token'})]}),o.jsxs("div",{className:"flex gap-3",children:[o.jsx("span",{className:"opacity-40 w-36 shrink-0",children:"Pipe filters"}),o.jsx("code",{className:"opacity-70",children:'args.month | default("2026-06"), value | number, text | trim'})]})]})]})]})}function O1(e){const n=e.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,"").split(`
353
+ `),s=[];let r=null;for(const i of n){const a=i.match(/^(#{1,3})\s+(.+)/);a?(r&&s.push({heading:r.heading,body:r.lines.join(`
354
+ `).trim()}),r={heading:a[2],lines:[]}):r?r.lines.push(i):i.trim()&&(r||(r={heading:"",lines:[]}),r.lines.push(i))}return r&&s.push({heading:r.heading,body:r.lines.join(`
355
+ `).trim()}),s}function _1({content:e}){return o.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap opacity-70 leading-relaxed overflow-x-auto",children:e})}function ed({file:e,defaultOpen:t}){const[n,s]=v.useState(t??!1),r=v.useMemo(()=>O1(e.content),[e.content]);return o.jsxs("div",{className:"border border-base-300/50",children:[o.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:[o.jsx("span",{className:"text-xs opacity-50",children:n?"▾":"▸"}),o.jsx("span",{className:"font-mono text-sm font-semibold",children:e.name}),o.jsxs("span",{className:"text-xs opacity-40",children:[r.length," ",r.length===1?"section":"sections"]})]}),n&&o.jsx("div",{className:"px-4 pb-4 space-y-4",children:r.map((i,a)=>o.jsxs("div",{children:[i.heading&&o.jsx("h5",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:i.heading}),o.jsx(_1,{content:i.body})]},a))})]})}function M1({skill:e}){const[t,n]=v.useState(!1),s=e.files.find(i=>i.name==="SKILL.md"),r=e.files.filter(i=>i.name!=="SKILL.md");return o.jsxs("div",{className:"border border-base-300",children:[o.jsx("div",{className:"p-4",children:o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[o.jsx("span",{className:"font-mono text-base font-semibold",children:e.name}),o.jsxs(U,{size:"xs",children:[e.files.length," ",e.files.length===1?"file":"files"]})]}),o.jsx("p",{className:"text-sm opacity-60 mt-1.5 max-w-prose",children:e.description})]}),o.jsx("button",{className:"btn btn-sm btn-ghost font-mono text-xs shrink-0",onClick:()=>n(!t),children:t?"Collapse":"View"})]})}),t&&o.jsxs("div",{className:"border-t border-base-300 p-4 space-y-3",children:[s&&o.jsx(ed,{file:s,defaultOpen:!0}),r.map(i=>o.jsx(ed,{file:i},i.name))]})]})}function D1(){const[e,t]=v.useState([]),[n,s]=v.useState(!0),[r,i]=v.useState(null);return v.useEffect(()=>{F.getSkills().then(a=>t(a.skills)).catch(a=>i(a instanceof Error?a.message:"Failed to load skills")).finally(()=>s(!1))},[]),n?o.jsx(mt,{label:"Loading skills..."}):o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-1",children:"Skills"}),o.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?o.jsxs("div",{className:"border border-error/30 p-4",children:[o.jsx("p",{className:"text-sm text-error font-semibold mb-1",children:"Failed to load skills"}),o.jsx("p",{className:"font-mono text-xs opacity-60",children:r})]}):e.length===0?o.jsxs("div",{className:"border border-base-300 p-6 text-center",children:[o.jsx("p",{className:"text-sm opacity-50 mb-1",children:"No skills found"}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"Skills should be located in the skills/ directory of the commandGarden package."})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"overflow-x-auto border border-base-300 mb-6",children:o.jsxs("table",{className:"table table-sm w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-base-200",children:[o.jsx("th",{children:"Skill"}),o.jsx("th",{children:"Description"}),o.jsx("th",{children:"Files"})]})}),o.jsx("tbody",{children:e.map(a=>o.jsxs("tr",{className:"hover:bg-base-200",children:[o.jsx("td",{className:"font-mono text-sm font-semibold whitespace-nowrap",children:a.name}),o.jsx("td",{className:"text-sm opacity-60",children:a.description}),o.jsx("td",{className:"text-center",children:o.jsx(U,{size:"xs",children:a.files.length})})]},a.name))})]})}),o.jsx("h3",{className:"font-display text-base font-semibold mb-3",children:"Skill Details"}),o.jsx("div",{className:"space-y-3",children:e.map(a=>o.jsx(M1,{skill:a},a.name))}),o.jsxs("div",{className:"border border-base-300 p-4 mt-6",children:[o.jsx("h4",{className:"font-mono text-xs font-semibold uppercase tracking-[0.08em] opacity-50 mb-2",children:"Usage"}),o.jsxs("p",{className:"text-sm opacity-60 mb-2",children:["Copy a skill's ",o.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."]}),o.jsxs("div",{className:"font-mono text-xs opacity-40",children:[o.jsx("span",{children:"Windsurf: "}),o.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".windsurf/skills/"}),o.jsx("span",{className:"mx-2",children:"|"}),o.jsx("span",{children:"Claude: "}),o.jsx("code",{className:"bg-base-200 px-1 py-0.5",children:".claude/skills/"})]})]})]})]})}function It({children:e}){return o.jsx("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em] mb-2",children:e})}function Zr({children:e}){return o.jsx("pre",{className:"bg-base-200 border border-base-300 p-4 overflow-x-auto text-sm font-mono leading-relaxed",children:o.jsx("code",{children:e})})}function R1(){return o.jsxs("div",{className:"max-w-4xl mx-auto pb-20",children:[o.jsxs("section",{className:"pt-8 pb-16 border-b border-base-300",children:[o.jsx(It,{children:"Browser automation for the rest of us"}),o.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."}),o.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."}),o.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)=>o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx("span",{className:`px-2.5 py-1 border font-semibold ${e.color}`,children:e.label}),t<4&&o.jsx("span",{className:"opacity-30",children:"→"})]},e.label))}),o.jsx(Zr,{children:"npm install -g @commandgarden/cli"})]}),o.jsxs("section",{id:"why-problem",className:"py-16 border-b border-base-300 scroll-mt-4",children:[o.jsx(It,{children:"Where the data actually lives"}),o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"The Problem"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:[o.jsxs("div",{className:"border border-base-300 p-5",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(Jr,{className:"w-4 h-4 text-primary"}),o.jsx("h3",{className:"font-display font-semibold text-sm",children:"Real-world data lives in browsers"})]}),o.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."})]}),o.jsxs("div",{className:"border border-base-300 p-5",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(nv,{className:"w-4 h-4 text-error"}),o.jsx("h3",{className:"font-display font-semibold text-sm",children:"APIs are the exception"})]}),o.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."})]}),o.jsxs("div",{className:"border border-base-300 p-5",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(Qx,{className:"w-4 h-4 text-warning"}),o.jsx("h3",{className:"font-display font-semibold text-sm",children:"Browser automation is expensive"})]}),o.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."})]})]}),o.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."})]}),o.jsxs("section",{id:"why-solution",className:"py-16 border-b border-base-300 scroll-mt-4",children:[o.jsx(It,{children:"How commandGarden works"}),o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"The Solution"}),o.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 ",o.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."]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-12",children:[o.jsxs("div",{className:"border border-error/20 bg-error/[0.03] p-5",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-error/60 uppercase tracking-[0.12em] mb-4",children:"Without commandGarden"}),o.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)=>o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.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}),o.jsx("span",{className:"text-sm font-medium",children:e.label}),o.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<5&&o.jsx("div",{className:"ml-2.5 w-px h-2 bg-error/20"})]},t))}),o.jsxs("div",{className:"mt-4 pt-3 border-t border-error/15 flex items-center gap-2",children:[o.jsx(U,{variant:"error",size:"xs",children:"thousands of tokens"}),o.jsx("span",{className:"text-xs opacity-50",children:"per interaction"})]})]}),o.jsxs("div",{className:"border border-primary/20 bg-primary/[0.03] p-5",children:[o.jsx("div",{className:"font-mono text-[0.6rem] font-medium text-primary/60 uppercase tracking-[0.12em] mb-4",children:"With commandGarden"}),o.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)=>o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.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}),o.jsx("span",{className:"text-sm font-medium",children:e.label}),o.jsx("span",{className:"text-xs opacity-40 font-mono",children:e.note})]}),t<2&&o.jsx("div",{className:"ml-2.5 w-px h-2 bg-primary/20"})]},t))}),o.jsxs("div",{className:"mt-4 pt-3 border-t border-primary/15 flex items-center gap-2",children:[o.jsx(U,{variant:"success",size:"xs",children:"0 tokens"}),o.jsx("span",{className:"text-xs opacity-50",children:"parsing done locally"})]})]})]}),o.jsxs("div",{className:"space-y-8 mb-12",children:[o.jsxs("div",{className:"flex gap-4",children:[o.jsx(Jr,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-display font-semibold mb-1",children:"Reuse your browser session"}),o.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."})]})]}),o.jsxs("div",{className:"flex gap-4",children:[o.jsx(ea,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-display font-semibold mb-1",children:"Fixed-format parsing, done locally"}),o.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."})]})]}),o.jsxs("div",{className:"flex gap-4",children:[o.jsx(ta,{className:"w-5 h-5 shrink-0 mt-0.5 text-primary"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-display font-semibold mb-1",children:"One CLI for humans and AI agents"}),o.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."}),o.jsx(Zr,{children:"cg run timetracking/report --month 2026-06 --format json"})]})]})]}),o.jsx("h3",{className:"font-display font-semibold text-sm mb-3",children:"How it compares"}),o.jsx("div",{className:"overflow-x-auto border border-base-300",children:o.jsxs("table",{className:"table table-sm w-full",children:[o.jsx("thead",{children:o.jsxs("tr",{className:"bg-base-200",children:[o.jsx("th",{}),o.jsx("th",{className:"text-primary",children:"commandGarden"}),o.jsx("th",{children:"AI Skills"}),o.jsx("th",{children:"MCP Servers"})]})}),o.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})=>o.jsxs("tr",{children:[o.jsx("td",{className:"font-mono text-xs font-medium",children:e}),o.jsx("td",{className:"bg-primary/[0.03]",children:o.jsx(U,{variant:t[1],size:"xs",children:t[0]})}),o.jsx("td",{children:o.jsx(U,{variant:n[1],size:"xs",children:n[0]})}),o.jsx("td",{children:o.jsx(U,{variant:s[1],size:"xs",children:s[0]})})]},e))})]})}),o.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 ",o.jsx("span",{className:"font-mono",children:"cg"})," skill lets AI agents call commandGarden commands directly."]})]}),o.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:o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx(It,{children:"Built for security and efficiency"}),o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Architecture"}),o.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."}),o.jsx("div",{className:"border border-base-300 bg-base-100 p-5 mb-8 overflow-x-auto",children:o.jsxs("svg",{viewBox:"0 0 700 260",className:"w-full text-base-content",style:{minWidth:560},children:[o.jsxs("defs",{children:[o.jsx("marker",{id:"why-ah",viewBox:"0 0 10 8",refX:"10",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:o.jsx("path",{d:"M0 0L10 4L0 8z",fill:"currentColor",fillOpacity:.3})}),o.jsx("marker",{id:"why-ah-rev",viewBox:"0 0 10 8",refX:"0",refY:"4",markerWidth:"7",markerHeight:"5",orient:"auto",children:o.jsx("path",{d:"M10 0L0 4L10 8z",fill:"currentColor",fillOpacity:.3})})]}),o.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}),o.jsx("text",{x:65,y:30,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"CLI"}),o.jsx("text",{x:65,y:44,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"cg run ..."}),o.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}),o.jsx("text",{x:65,y:100,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"GUI"}),o.jsx("text",{x:65,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"React SPA"}),o.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}),o.jsx("text",{x:220,y:100,textAnchor:"middle",fill:"currentColor",fontSize:10,fontWeight:600,children:"App Server"}),o.jsx("text",{x:220,y:114,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:":9092"}),o.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}),o.jsx("text",{x:395,y:40,textAnchor:"middle",fill:"currentColor",fontSize:13,fontWeight:700,children:"Daemon"}),o.jsx("text",{x:395,y:56,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Fastify :9091"}),o.jsx("text",{x:395,y:78,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.25,fontFamily:"ui-monospace,monospace",children:"auth · registry · audit"}),o.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}),o.jsx("text",{x:585,y:42,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Extension"}),o.jsx("text",{x:585,y:58,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"Chrome MV3"}),o.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}),o.jsx("text",{x:590,y:180,textAnchor:"middle",fill:"currentColor",fontSize:11,fontWeight:600,children:"Browser Tab"}),o.jsx("text",{x:590,y:194,textAnchor:"middle",fill:"currentColor",fontSize:8,opacity:.4,fontFamily:"ui-monospace,monospace",children:"target page"}),o.jsx("rect",{x:310,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),o.jsx("text",{x:355,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"Audit Log"}),o.jsx("rect",{x:410,y:170,width:80,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),o.jsx("text",{x:450,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"Config"}),o.jsx("rect",{x:160,y:170,width:90,height:30,rx:0,fill:"currentColor",fillOpacity:.04,stroke:"currentColor",strokeOpacity:.12,strokeWidth:1}),o.jsx("text",{x:205,y:188,textAnchor:"middle",fill:"currentColor",fontSize:8,fontWeight:500,opacity:.45,children:"App DB"}),o.jsx("line",{x1:122,y1:33,x2:318,y2:45,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),o.jsx("text",{x:210,y:28,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"HTTP"}),o.jsx("line",{x1:122,y1:103,x2:158,y2:103,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),o.jsx("line",{x1:282,y1:96,x2:318,y2:72,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),o.jsx("text",{x:295,y:76,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"proxy"}),o.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)"}),o.jsx("text",{x:495,y:38,textAnchor:"middle",fill:"currentColor",fontSize:7,opacity:.4,fontFamily:"ui-monospace,monospace",children:"WebSocket"}),o.jsx("line",{x1:590,y1:77,x2:590,y2:158,stroke:"currentColor",strokeOpacity:.15,markerEnd:"url(#why-ah)"}),o.jsx("line",{x1:370,y1:93,x2:365,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),o.jsx("line",{x1:430,y1:93,x2:445,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"}),o.jsx("line",{x1:210,y1:128,x2:210,y2:168,stroke:"currentColor",strokeOpacity:.1,strokeDasharray:"3 2"})]})}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[{icon:ta,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:Jr,title:"Extension",mono:"MV3",desc:"Runs inside your authenticated Chrome. Accesses cookies and page data."},{icon:ea,title:"Connectors",mono:"YAML",desc:"Declarative pipelines: navigate → wait → extract → map. No code execution."},{icon:Gu,title:"Audit Log",mono:"SQLite",desc:"Every execution logged: connector, domains, timing, approvals."},{icon:jv,title:"GUI",mono:":9092",desc:"React SPA with app pages, connector browsing, and config management."}].map(({icon:e,title:t,mono:n,desc:s})=>o.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[o.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-baseline gap-1.5 mb-0.5",children:[o.jsx("span",{className:"font-display font-semibold text-sm",children:t}),o.jsx("span",{className:"font-mono text-[0.65rem] opacity-40",children:n})]}),o.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]},t))}),o.jsxs($e,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Full architecture details ",o.jsx(En,{className:"w-3 h-3"})]})]})}),o.jsxs("section",{id:"why-apps",className:"py-16 border-b border-base-300 scroll-mt-4",children:[o.jsx(It,{children:"Ready-to-use tools"}),o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Built-in Apps"}),o.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."}),o.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[{icon:mh,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:qx,title:"Dev Journal",tag:"Productivity",desc:"Auto-generated daily journal from Git commits and Jira tickets",route:"/apps/journal",cmd:"ado/git-commits"},{icon:bv,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:gv,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:i})=>o.jsxs("div",{className:"border border-base-300 p-4",children:[o.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[o.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("span",{className:"font-display font-semibold text-sm",children:t}),o.jsx(U,{size:"xs",children:n})]}),o.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:s})]})]}),o.jsxs("div",{className:"flex items-center justify-between mt-3 pt-2 border-t border-base-300/50",children:[o.jsxs("span",{className:"font-mono text-[0.65rem] opacity-30",children:["cg run ",i]}),r&&o.jsxs($e,{to:r,className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Open ",o.jsx(En,{className:"w-3 h-3"})]})]})]},t))}),o.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."})]}),o.jsxs("section",{id:"why-happy-path",className:"py-16 border-b border-base-300 scroll-mt-4",children:[o.jsx(It,{children:"From install to first result"}),o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-8",children:"Typical workflow"}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(ta,{className:"w-4 h-4 opacity-40"}),o.jsx("h3",{className:"font-display font-semibold text-sm",children:"Human user"})]}),o.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)=>o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.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}),o.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),o.jsx("div",{className:"ml-[1.875rem] mt-1",children:o.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&&o.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),o.jsxs("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:["Or open the GUI at ",o.jsx("span",{className:"font-mono",children:"localhost:9092"})," and use the visual interface."]})]}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(Jr,{className:"w-4 h-4 opacity-40"}),o.jsx("h3",{className:"font-display font-semibold text-sm",children:"AI agent"})]}),o.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)=>o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.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}),o.jsx("span",{className:"text-xs font-medium opacity-60",children:e.step})]}),o.jsx("div",{className:"ml-[1.875rem] mt-1",children:o.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&&o.jsx("div",{className:"ml-2.5 w-px h-2 bg-base-300"})]},t))}),o.jsx("p",{className:"text-xs opacity-50 ml-[1.875rem]",children:"Structured JSON back in seconds."})]})]}),o.jsxs("div",{className:"mt-8 border border-primary/20 bg-primary/[0.03] p-4 flex items-center gap-3",children:[o.jsx(ev,{className:"w-4 h-4 text-primary shrink-0"}),o.jsx("p",{className:"text-sm opacity-70",children:"Both paths produce identical output. Same connector, same schema, regardless of who calls it."})]})]}),o.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:o.jsxs("div",{className:"max-w-4xl mx-auto",children:[o.jsx(It,{children:"Security by design"}),o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Security"}),o.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."}),o.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-8",children:[{icon:xv,title:"No credentials stored",desc:"Reuses session cookies already in Chrome. Nothing stored on disk, nothing sent externally."},{icon:Ev,title:"Domain-scoped permissions",desc:"Connectors declare allowed domains. Undeclared domains are blocked by the daemon."},{icon:lv,title:"Capability gating",desc:"Each step requires a declared capability. High-risk ops (js_evaluate, cookie_write) need approval."},{icon:dv,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:ea,title:"Declarative connectors",desc:"Pure YAML pipelines. No JavaScript evaluation, no arbitrary code execution by default."},{icon:Nv,title:"Audit-or-fail",desc:"Every execution logged to SQLite. Domains, timing, approvals, row counts. If audit fails, commands are blocked."},{icon:Gu,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})=>o.jsxs("div",{className:"flex gap-3 p-3 border border-base-300 bg-base-100",children:[o.jsx(e,{className:"w-4 h-4 shrink-0 mt-0.5 opacity-40"}),o.jsxs("div",{children:[o.jsx("h3",{className:"font-display font-semibold text-sm mb-0.5",children:t}),o.jsx("p",{className:"text-xs opacity-60 leading-relaxed",children:n})]})]},t))}),o.jsxs("div",{className:"border border-base-300 bg-base-100 p-5",children:[o.jsx("h3",{className:"font-mono text-xs font-medium opacity-50 uppercase tracking-wide mb-3",children:"Limitations"}),o.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-1.5 text-sm opacity-70",children:[o.jsx("p",{children:"Only works while Chrome is open and you're logged in."}),o.jsx("p",{children:"Connectors may break when a site redesigns its HTML."}),o.jsx("p",{children:"Chrome-only for now (no Firefox or Edge support)."}),o.jsx("p",{children:"No credential storage, so sessions expire when you log out."}),o.jsx("p",{children:"Extraction runs one connector at a time per tab."})]})]})]})}),o.jsxs("section",{id:"why-get-started",className:"py-16 border-b border-base-300 scroll-mt-4",children:[o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Get started in 60 seconds"}),o.jsx(Zr,{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`}),o.jsxs("div",{className:"flex flex-wrap gap-4 mt-6",children:[o.jsxs($e,{to:"/guide",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Setup Guide ",o.jsx(En,{className:"w-3 h-3"})]}),o.jsxs($e,{to:"/architecture",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Architecture ",o.jsx(En,{className:"w-3 h-3"})]}),o.jsxs($e,{to:"/api-reference",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["API & CLI Reference ",o.jsx(En,{className:"w-3 h-3"})]}),o.jsxs($e,{to:"/skills",className:"font-mono text-xs text-primary hover:underline flex items-center gap-1",children:["Skills ",o.jsx(En,{className:"w-3 h-3"})]})]})]}),o.jsxs("section",{id:"why-extend",className:"pt-16 scroll-mt-4",children:[o.jsx(It,{children:"Extend to any website"}),o.jsx("h2",{className:"font-display text-xl font-bold uppercase tracking-[0.06em] mb-4",children:"Write your own connector"}),o.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."}),o.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)=>o.jsxs("div",{className:"flex gap-3 items-baseline",children:[o.jsxs("span",{className:"font-mono text-xs opacity-30 w-4 text-right shrink-0",children:[n+1,"."]}),o.jsxs("div",{children:[o.jsx("span",{className:"text-sm font-medium",children:e}),t&&o.jsx("span",{className:"font-mono text-xs opacity-40 ml-2",children:t})]})]},n))}),o.jsx(Zr,{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"`}),o.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 Ds({isActive:e}){return`block px-3 py-2 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}function Ts({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 ei={"/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 $1({sections:e}){const t=v.useMemo(()=>e.map(r=>r.id),[e]),n=t0(t),s=r=>{const i=document.getElementById(r);i&&i.scrollIntoView({behavior:"smooth",block:"start"})};return o.jsx("div",{className:"ml-3 border-l border-base-300 py-0.5",children:e.map(r=>o.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))})}function Ls({to:e,label:t,sections:n}){const r=jn().pathname===e;return o.jsxs(o.Fragment,{children:[o.jsx(ut,{to:e,end:e==="/",className:Ds,children:t}),r&&n.length>0&&o.jsx($1,{sections:n})]})}function z1(){const[e,t]=v.useState(!1),[n,s]=v.useState(!1),[r,i]=v.useState(!1),[a,l]=v.useState([]),c=jn();v.useEffect(()=>{i(!1)},[c.pathname]),v.useEffect(()=>{const p=()=>{F.getStatus().then(f=>{t(f.ok),s(f.extensionConnected)}).catch(()=>{t(!1),s(!1)})};p();const d=setInterval(p,3e4);return()=>clearInterval(d)},[]),v.useEffect(()=>{F.getConnectors().then(p=>{const d=uo(p.connectors).map(([f])=>f);l(d)}).catch(()=>{})},[]);const u=v.useMemo(()=>a.map(p=>({label:p,id:`conn-${p}`})),[a]);return o.jsxs("div",{className:"flex min-h-screen",children:[o.jsx("button",{className:"fixed top-3 left-3 z-50 md:hidden btn btn-sm btn-ghost",onClick:()=>i(!r),"aria-label":r?"Close menu":"Open menu",children:o.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:r?o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),r&&o.jsx("div",{className:"fixed inset-0 bg-black/30 z-30 md:hidden",onClick:()=>i(!1)}),o.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:[o.jsxs("div",{className:"flex items-start justify-between px-3 py-3 border-b border-base-300",children:[o.jsxs($e,{to:"/",className:"hover:opacity-80 transition-opacity",children:[o.jsxs("h1",{className:"font-display text-lg font-bold tracking-tight",children:[o.jsx("span",{className:"font-normal opacity-50",children:"command"}),"Garden"]}),o.jsx("p",{className:"font-mono text-[0.65rem] opacity-30 mt-1 uppercase tracking-[0.14em]",children:"browser automation"})]}),o.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:o.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:o.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"})})})]}),o.jsxs("nav",{className:"flex-1 px-2 py-2 space-y-px overflow-y-auto",children:[o.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"}),o.jsx(ut,{to:"/",end:!0,className:Ds,children:"Dashboard"}),o.jsx(ut,{to:"/guide",className:Ds,children:"Setup Guide"}),o.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"}),o.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"}),o.jsx(ut,{to:"/apps/timetracking",className:Ts,children:"Time Tracking"}),o.jsx(ut,{to:"/apps/rooms",className:Ts,children:"Room Availability"}),o.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"}),o.jsx(ut,{to:"/apps/journal",className:Ts,children:"Dev Journal"}),o.jsx(ut,{to:"/apps/trusted-peer-expiry",className:Ts,children:"Trusted Peer Expiry"}),o.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"}),o.jsx(ut,{to:"/apps/security-news",className:Ts,children:"Security News"}),o.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"}),o.jsx(Ls,{to:"/connectors",label:"Connectors",sections:u}),o.jsx(ut,{to:"/audit",className:Ds,children:"Audit Log"}),o.jsx(Ls,{to:"/config",label:"Configuration",sections:ei["/config"]}),o.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"}),o.jsx(Ls,{to:"/why",label:"Why commandGarden",sections:ei["/why"]}),o.jsx(Ls,{to:"/architecture",label:"Architecture",sections:ei["/architecture"]}),o.jsx(Ls,{to:"/api-reference",label:"API & CLI",sections:ei["/api-reference"]}),o.jsx(ut,{to:"/skills",className:Ds,children:"Skills"})]}),o.jsxs("div",{className:"px-3 py-2.5 border-t border-base-300",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[o.jsx("span",{className:`w-1.5 h-1.5 ${e?"bg-success":"bg-error"}`,"aria-hidden":"true"}),o.jsx("span",{className:"opacity-50 text-[0.65rem]",children:e?"DAEMON OK":"DAEMON OFF"})]}),o.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono mt-1",children:[o.jsx("span",{className:`w-1.5 h-1.5 ${n?"bg-success":"bg-error"}`,"aria-hidden":"true"}),o.jsx("span",{className:"opacity-50 text-[0.65rem]",children:n?"EXTENSION LINKED":"EXTENSION OFF"})]})]})]}),o.jsx("main",{className:"flex-1 p-4 pt-14 md:pt-5 md:p-5 md:ml-56",children:o.jsx(zy,{})})]})}function F1(){return o.jsx(Yy,{children:o.jsx(By,{children:o.jsxs(ge,{element:o.jsx(z1,{}),children:[o.jsx(ge,{index:!0,element:o.jsx(r0,{})}),o.jsx(ge,{path:"connectors",element:o.jsx(a0,{})}),o.jsx(ge,{path:"connectors/:site/:name",element:o.jsx(l0,{})}),o.jsx(ge,{path:"audit",element:o.jsx(d0,{})}),o.jsx(ge,{path:"config",element:o.jsx(Cx,{})}),o.jsx(ge,{path:"guide",element:o.jsx(_x,{})}),o.jsx(ge,{path:"apps/timetracking",element:o.jsx(Uv,{})}),o.jsx(ge,{path:"apps/rooms",element:o.jsx(Qv,{})}),o.jsx(ge,{path:"apps/journal",element:o.jsx(r1,{})}),o.jsx(ge,{path:"apps/security-news",element:o.jsx(p1,{})}),o.jsx(ge,{path:"apps/trusted-peer-expiry",element:o.jsx(x1,{})}),o.jsx(ge,{path:"architecture",element:o.jsx(C1,{})}),o.jsx(ge,{path:"api-reference",element:o.jsx(P1,{})}),o.jsx(ge,{path:"skills",element:o.jsx(D1,{})}),o.jsx(ge,{path:"why",element:o.jsx(R1,{})})]})})})}hp(document.getElementById("root")).render(o.jsx(v.StrictMode,{children:o.jsx(F1,{})}));