@commandgarden/cli 2.0.0 → 2.2.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.
Files changed (54) hide show
  1. package/dist/main.js +74 -10
  2. package/node_modules/@commandgarden/app/dist/client/assets/index-Cglxej9D.css +1 -0
  3. package/node_modules/@commandgarden/app/dist/client/assets/index-Cju0_G1Y.js +397 -0
  4. package/node_modules/@commandgarden/app/dist/client/index.html +19 -19
  5. package/node_modules/@commandgarden/app/dist/server/routes/connectors.js +3 -0
  6. package/node_modules/@commandgarden/app/dist/server/routes/index.js +4 -0
  7. package/node_modules/@commandgarden/app/dist/server/routes/security-news-cache.d.ts +3 -0
  8. package/node_modules/@commandgarden/app/dist/server/routes/security-news-cache.js +17 -0
  9. package/node_modules/@commandgarden/app/dist/server/routes/skills.d.ts +2 -0
  10. package/node_modules/@commandgarden/app/dist/server/routes/skills.js +65 -0
  11. package/node_modules/@commandgarden/app/dist/server/store.d.ts +5 -0
  12. package/node_modules/@commandgarden/app/dist/server/store.js +46 -27
  13. package/node_modules/@commandgarden/app/package.json +42 -42
  14. package/node_modules/@commandgarden/chrome/dist/content-script.js.map +1 -1
  15. package/node_modules/@commandgarden/chrome/dist/manifest.json +16 -16
  16. package/node_modules/@commandgarden/chrome/dist/popup.html +218 -197
  17. package/node_modules/@commandgarden/chrome/dist/popup.js.map +1 -1
  18. package/node_modules/@commandgarden/chrome/dist/service-worker.js.map +1 -1
  19. package/node_modules/@commandgarden/chrome/package.json +25 -25
  20. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.eval.js +143 -143
  21. package/node_modules/@commandgarden/daemon/connectors/ado-git-commits.yaml +70 -70
  22. package/node_modules/@commandgarden/daemon/connectors/gcs-kb-content.yaml +58 -58
  23. package/node_modules/@commandgarden/daemon/connectors/gcs-kb-pages.yaml +47 -47
  24. package/node_modules/@commandgarden/daemon/connectors/jira-my-tickets.eval.js +115 -115
  25. package/node_modules/@commandgarden/daemon/connectors/jira-my-tickets.yaml +54 -54
  26. package/node_modules/@commandgarden/daemon/connectors/lib/msal-token.js +20 -20
  27. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.eval.js +186 -186
  28. package/node_modules/@commandgarden/daemon/connectors/outlook-my-meetings.yaml +41 -41
  29. package/node_modules/@commandgarden/daemon/connectors/saba-pending-training.eval.js +94 -0
  30. package/node_modules/@commandgarden/daemon/connectors/saba-pending-training.yaml +34 -0
  31. package/node_modules/@commandgarden/daemon/connectors/socket-security-news.yaml +63 -63
  32. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.eval.js +341 -341
  33. package/node_modules/@commandgarden/daemon/connectors/teams-room-availability.yaml +46 -46
  34. package/node_modules/@commandgarden/daemon/connectors/timetracking-projects.eval.js +52 -52
  35. package/node_modules/@commandgarden/daemon/connectors/timetracking-projects.yaml +42 -42
  36. package/node_modules/@commandgarden/daemon/connectors/timetracking-report.eval.js +81 -81
  37. package/node_modules/@commandgarden/daemon/connectors/timetracking-report.yaml +52 -52
  38. package/node_modules/@commandgarden/daemon/connectors/tldrsec-newsletter.eval.js +27 -0
  39. package/node_modules/@commandgarden/daemon/connectors/tldrsec-newsletter.yaml +38 -0
  40. package/node_modules/@commandgarden/daemon/connectors/tokenmaster-clients-list.yaml +55 -55
  41. package/node_modules/@commandgarden/daemon/dist/audit-store.js +8 -8
  42. package/node_modules/@commandgarden/daemon/package.json +32 -32
  43. package/node_modules/@commandgarden/shared/package.json +32 -32
  44. package/package.json +58 -57
  45. package/node_modules/@commandgarden/app/dist/client/assets/index-CThI0UCl.css +0 -1
  46. package/node_modules/@commandgarden/app/dist/client/assets/index-WANip_um.js +0 -252
  47. package/node_modules/@commandgarden/app/dist/server/daemon-client.test.js +0 -47
  48. package/node_modules/@commandgarden/app/dist/server/routes/routes.test.js +0 -137
  49. package/node_modules/@commandgarden/app/dist/server/store.test.js +0 -59
  50. package/node_modules/@commandgarden/chrome/dist/fetch-interceptor.js +0 -44
  51. package/node_modules/@commandgarden/daemon/dist/cdp-client.d.ts +0 -24
  52. package/node_modules/@commandgarden/daemon/dist/cdp-client.d.ts.map +0 -1
  53. package/node_modules/@commandgarden/daemon/dist/cdp-client.js +0 -150
  54. package/node_modules/@commandgarden/daemon/dist/cdp-client.js.map +0 -1
@@ -0,0 +1,397 @@
1
+ function gh(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 l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).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 yh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ed={exports:{}},Hi={},td={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 mr=Symbol.for("react.element"),xh=Symbol.for("react.portal"),vh=Symbol.for("react.fragment"),bh=Symbol.for("react.strict_mode"),wh=Symbol.for("react.profiler"),jh=Symbol.for("react.provider"),kh=Symbol.for("react.context"),Nh=Symbol.for("react.forward_ref"),Sh=Symbol.for("react.suspense"),Ch=Symbol.for("react.memo"),Eh=Symbol.for("react.lazy"),mc=Symbol.iterator;function Th(e){return e===null||typeof e!="object"?null:(e=mc&&e[mc]||e["@@iterator"],typeof e=="function"?e:null)}var nd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sd=Object.assign,rd={};function cs(e,t,n){this.props=e,this.context=t,this.refs=rd,this.updater=n||nd}cs.prototype.isReactComponent={};cs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};cs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function id(){}id.prototype=cs.prototype;function ra(e,t,n){this.props=e,this.context=t,this.refs=rd,this.updater=n||nd}var ia=ra.prototype=new id;ia.constructor=ra;sd(ia,cs.prototype);ia.isPureReactComponent=!0;var gc=Array.isArray,od=Object.prototype.hasOwnProperty,oa={current:null},ld={key:!0,ref:!0,__self:!0,__source:!0};function ad(e,t,n){var s,r={},i=null,l=null;if(t!=null)for(s in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)od.call(t,s)&&!ld.hasOwnProperty(s)&&(r[s]=t[s]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var c=Array(a),u=0;u<a;u++)c[u]=arguments[u+2];r.children=c}if(e&&e.defaultProps)for(s in a=e.defaultProps,a)r[s]===void 0&&(r[s]=a[s]);return{$$typeof:mr,type:e,key:i,ref:l,props:r,_owner:oa.current}}function Lh(e,t){return{$$typeof:mr,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function la(e){return typeof e=="object"&&e!==null&&e.$$typeof===mr}function Ah(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var yc=/\/+/g;function vo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ah(""+e.key):t.toString(36)}function ei(e,t,n,s,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case mr:case xh:l=!0}}if(l)return l=e,r=r(l),e=s===""?"."+vo(l,0):s,gc(r)?(n="",e!=null&&(n=e.replace(yc,"$&/")+"/"),ei(r,t,n,"",function(u){return u})):r!=null&&(la(r)&&(r=Lh(r,n+(!r.key||l&&l.key===r.key?"":(""+r.key).replace(yc,"$&/")+"/")+e)),t.push(r)),1;if(l=0,s=s===""?".":s+":",gc(e))for(var a=0;a<e.length;a++){i=e[a];var c=s+vo(i,a);l+=ei(i,t,n,c,r)}else if(c=Th(e),typeof c=="function")for(e=c.call(e),a=0;!(i=e.next()).done;)i=i.value,c=s+vo(i,a++),l+=ei(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 l}function Tr(e,t,n){if(e==null)return e;var s=[],r=0;return ei(e,s,"","",function(i){return t.call(n,i,r++)}),s}function Ih(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},ti={transition:null},Oh={ReactCurrentDispatcher:Te,ReactCurrentBatchConfig:ti,ReactCurrentOwner:oa};function cd(){throw Error("act(...) is not supported in production builds of React.")}W.Children={map:Tr,forEach:function(e,t,n){Tr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Tr(e,function(){t++}),t},toArray:function(e){return Tr(e,function(t){return t})||[]},only:function(e){if(!la(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};W.Component=cs;W.Fragment=vh;W.Profiler=wh;W.PureComponent=ra;W.StrictMode=bh;W.Suspense=Sh;W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Oh;W.act=cd;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=sd({},e.props),r=e.key,i=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,l=oa.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)od.call(t,c)&&!ld.hasOwnProperty(c)&&(s[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)s.children=n;else if(1<c){a=Array(c);for(var u=0;u<c;u++)a[u]=arguments[u+2];s.children=a}return{$$typeof:mr,type:e.type,key:r,ref:i,props:s,_owner:l}};W.createContext=function(e){return e={$$typeof:kh,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:jh,_context:e},e.Consumer=e};W.createElement=ad;W.createFactory=function(e){var t=ad.bind(null,e);return t.type=e,t};W.createRef=function(){return{current:null}};W.forwardRef=function(e){return{$$typeof:Nh,render:e}};W.isValidElement=la;W.lazy=function(e){return{$$typeof:Eh,_payload:{_status:-1,_result:e},_init:Ih}};W.memo=function(e,t){return{$$typeof:Ch,type:e,compare:t===void 0?null:t}};W.startTransition=function(e){var t=ti.transition;ti.transition={};try{e()}finally{ti.transition=t}};W.unstable_act=cd;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";td.exports=W;var b=td.exports;const Ph=yh(b),_h=gh({__proto__:null,default:Ph},[b]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Mh=b,Dh=Symbol.for("react.element"),Rh=Symbol.for("react.fragment"),$h=Object.prototype.hasOwnProperty,zh=Mh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Fh={key:!0,ref:!0,__self:!0,__source:!0};function ud(e,t,n){var s,r={},i=null,l=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(s in t)$h.call(t,s)&&!Fh.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:Dh,type:e,key:i,ref:l,props:r,_owner:zh.current}}Hi.Fragment=Rh;Hi.jsx=ud;Hi.jsxs=ud;ed.exports=Hi;var o=ed.exports,dd={exports:{}},Ue={},fd={exports:{}},pd={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(L,P){var D=L.length;L.push(P);e:for(;0<D;){var $=D-1>>>1,Q=L[$];if(0<r(Q,P))L[$]=P,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 P=L[0],D=L.pop();if(D!==P){L[0]=D;e:for(var $=0,Q=L.length,De=Q>>>1;$<De;){var Ze=2*($+1)-1,vs=L[Ze],sn=Ze+1,Er=L[sn];if(0>r(vs,D))sn<Q&&0>r(Er,vs)?(L[$]=Er,L[sn]=D,$=sn):(L[$]=vs,L[Ze]=D,$=Ze);else if(sn<Q&&0>r(Er,D))L[$]=Er,L[sn]=D,$=sn;else break e}}return P}function r(L,P){var D=L.sortIndex-P.sortIndex;return D!==0?D:L.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var c=[],u=[],p=1,d=null,f=3,y=!1,w=!1,x=!1,v=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 P=n(u);P!==null;){if(P.callback===null)s(u);else if(P.startTime<=L)s(u),P.sortIndex=P.expirationTime,t(c,P);else break;P=n(u)}}function j(L){if(x=!1,h(L),!w)if(n(c)!==null)w=!0,O(k);else{var P=n(u);P!==null&&R(j,P.startTime-L)}}function k(L,P){w=!1,x&&(x=!1,g(S),S=-1),y=!0;var D=f;try{for(h(P),d=n(c);d!==null&&(!(d.expirationTime>P)||L&&!B());){var $=d.callback;if(typeof $=="function"){d.callback=null,f=d.priorityLevel;var Q=$(d.expirationTime<=P);P=e.unstable_now(),typeof Q=="function"?d.callback=Q:d===n(c)&&s(c),h(P)}else s(c);d=n(c)}if(d!==null)var De=!0;else{var Ze=n(u);Ze!==null&&R(j,Ze.startTime-P),De=!1}return De}finally{d=null,f=D,y=!1}}var E=!1,N=null,S=-1,T=5,A=-1;function B(){return!(e.unstable_now()-A<T)}function G(){if(N!==null){var L=e.unstable_now();A=L;var P=!0;try{P=N(!0,L)}finally{P?V():(E=!1,N=null)}}else E=!1}var V;if(typeof m=="function")V=function(){m(G)};else if(typeof MessageChannel<"u"){var C=new MessageChannel,M=C.port2;C.port1.onmessage=G,V=function(){M.postMessage(null)}}else V=function(){v(G,0)};function O(L){N=L,E||(E=!0,V())}function R(L,P){S=v(function(){L(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_continueExecution=function(){w||y||(w=!0,O(k))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(L){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var D=f;f=P;try{return L()}finally{f=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,P){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var D=f;f=L;try{return P()}finally{f=D}},e.unstable_scheduleCallback=function(L,P,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:P,priorityLevel:L,startTime:D,expirationTime:Q,sortIndex:-1},D>$?(L.sortIndex=D,t(u,L),n(c)===null&&L===n(u)&&(x?(g(S),S=-1):x=!0,R(j,D-$))):(L.sortIndex=Q,t(c,L),w||y||(w=!0,O(k))),L},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(L){var P=f;return function(){var D=f;f=P;try{return L.apply(this,arguments)}finally{f=D}}}})(pd);fd.exports=pd;var Bh=fd.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 Uh=b,Be=Bh;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 hd=new Set,Gs={};function wn(e,t){Zn(e,t),Zn(e+"Capture",t)}function Zn(e,t){for(Gs[e]=t,e=0;e<t.length;e++)hd.add(t[e])}var St=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nl=Object.prototype.hasOwnProperty,Wh=/^[: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]*$/,xc={},vc={};function Hh(e){return nl.call(vc,e)?!0:nl.call(xc,e)?!1:Wh.test(e)?vc[e]=!0:(xc[e]=!0,!1)}function Vh(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 Kh(e,t,n,s){if(t===null||typeof t>"u"||Vh(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,l){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=l}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 aa=/[\-:]([a-z])/g;function ca(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(aa,ca);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(aa,ca);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(aa,ca);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 ua(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")&&(Kh(t,n,r,s)&&(n=null),s||r===null?Hh(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,s=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,s?e.setAttributeNS(s,t,n):e.setAttribute(t,n))))}var Lt=Uh.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Lr=Symbol.for("react.element"),An=Symbol.for("react.portal"),In=Symbol.for("react.fragment"),da=Symbol.for("react.strict_mode"),sl=Symbol.for("react.profiler"),md=Symbol.for("react.provider"),gd=Symbol.for("react.context"),fa=Symbol.for("react.forward_ref"),rl=Symbol.for("react.suspense"),il=Symbol.for("react.suspense_list"),pa=Symbol.for("react.memo"),Pt=Symbol.for("react.lazy"),yd=Symbol.for("react.offscreen"),bc=Symbol.iterator;function bs(e){return e===null||typeof e!="object"?null:(e=bc&&e[bc]||e["@@iterator"],typeof e=="function"?e:null)}var se=Object.assign,bo;function As(e){if(bo===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);bo=t&&t[1]||""}return`
34
+ `+bo+e}var wo=!1;function jo(e,t){if(!e||wo)return"";wo=!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
+ `),l=r.length-1,a=i.length-1;1<=l&&0<=a&&r[l]!==i[a];)a--;for(;1<=l&&0<=a;l--,a--)if(r[l]!==i[a]){if(l!==1||a!==1)do if(l--,a--,0>a||r[l]!==i[a]){var c=`
37
+ `+r[l].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=l&&0<=a);break}}}finally{wo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?As(e):""}function Gh(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=jo(e.type,!1),e;case 11:return e=jo(e.type.render,!1),e;case 1:return e=jo(e.type,!0),e;default:return""}}function ol(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case In:return"Fragment";case An:return"Portal";case sl:return"Profiler";case da:return"StrictMode";case rl:return"Suspense";case il:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gd:return(e.displayName||"Context")+".Consumer";case md:return(e._context.displayName||"Context")+".Provider";case fa:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case pa:return t=e.displayName||null,t!==null?t:ol(e.type)||"Memo";case Pt:t=e._payload,e=e._init;try{return ol(e(t))}catch{}}return null}function qh(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 ol(t);case 8:return t===da?"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 Jt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Yh(e){var t=xd(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(l){s=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return s},setValue:function(l){s=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ar(e){e._valueTracker||(e._valueTracker=Yh(e))}function vd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=xd(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function mi(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 ll(e,t){var n=t.checked;return se({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function wc(e,t){var n=t.defaultValue==null?"":t.defaultValue,s=t.checked!=null?t.checked:t.defaultChecked;n=Jt(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 bd(e,t){t=t.checked,t!=null&&ua(e,"checked",t,!1)}function al(e,t){bd(e,t);var n=Jt(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")?cl(e,t.type,n):t.hasOwnProperty("defaultValue")&&cl(e,t.type,Jt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jc(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 cl(e,t,n){(t!=="number"||mi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Is=Array.isArray;function Vn(e,t,n,s){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&s&&(e[n].defaultSelected=!0)}else{for(n=""+Jt(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 ul(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(I(91));return se({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function kc(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:Jt(n)}}function wd(e,t){var n=Jt(t.value),s=Jt(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 Nc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function jd(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 dl(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?jd(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ir,kd=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(Ir=Ir||document.createElement("div"),Ir.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ir.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function qs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ds={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},Qh=["Webkit","ms","Moz","O"];Object.keys(Ds).forEach(function(e){Qh.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ds[t]=Ds[e]})});function Nd(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ds.hasOwnProperty(e)&&Ds[e]?(""+t).trim():t+"px"}function Sd(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var s=n.indexOf("--")===0,r=Nd(n,t[n],s);n==="float"&&(n="cssFloat"),s?e.setProperty(n,r):e[n]=r}}var Jh=se({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 fl(e,t){if(t){if(Jh[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 pl(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 hl=null;function ha(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ml=null,Kn=null,Gn=null;function Sc(e){if(e=xr(e)){if(typeof ml!="function")throw Error(I(280));var t=e.stateNode;t&&(t=Yi(t),ml(e.stateNode,e.type,t))}}function Cd(e){Kn?Gn?Gn.push(e):Gn=[e]:Kn=e}function Ed(){if(Kn){var e=Kn,t=Gn;if(Gn=Kn=null,Sc(e),t)for(e=0;e<t.length;e++)Sc(t[e])}}function Td(e,t){return e(t)}function Ld(){}var ko=!1;function Ad(e,t,n){if(ko)return e(t,n);ko=!0;try{return Td(e,t,n)}finally{ko=!1,(Kn!==null||Gn!==null)&&(Ld(),Ed())}}function Ys(e,t){var n=e.stateNode;if(n===null)return null;var s=Yi(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 gl=!1;if(St)try{var ws={};Object.defineProperty(ws,"passive",{get:function(){gl=!0}}),window.addEventListener("test",ws,ws),window.removeEventListener("test",ws,ws)}catch{gl=!1}function Xh(e,t,n,s,r,i,l,a,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(p){this.onError(p)}}var Rs=!1,gi=null,yi=!1,yl=null,Zh={onError:function(e){Rs=!0,gi=e}};function em(e,t,n,s,r,i,l,a,c){Rs=!1,gi=null,Xh.apply(Zh,arguments)}function tm(e,t,n,s,r,i,l,a,c){if(em.apply(this,arguments),Rs){if(Rs){var u=gi;Rs=!1,gi=null}else throw Error(I(198));yi||(yi=!0,yl=u)}}function jn(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 Id(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 Cc(e){if(jn(e)!==e)throw Error(I(188))}function nm(e){var t=e.alternate;if(!t){if(t=jn(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 Cc(r),e;if(i===s)return Cc(r),t;i=i.sibling}throw Error(I(188))}if(n.return!==s.return)n=r,s=i;else{for(var l=!1,a=r.child;a;){if(a===n){l=!0,n=r,s=i;break}if(a===s){l=!0,s=r,n=i;break}a=a.sibling}if(!l){for(a=i.child;a;){if(a===n){l=!0,n=i,s=r;break}if(a===s){l=!0,s=i,n=r;break}a=a.sibling}if(!l)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=nm(e),e!==null?Pd(e):null}function Pd(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Pd(e);if(t!==null)return t;e=e.sibling}return null}var _d=Be.unstable_scheduleCallback,Ec=Be.unstable_cancelCallback,sm=Be.unstable_shouldYield,rm=Be.unstable_requestPaint,le=Be.unstable_now,im=Be.unstable_getCurrentPriorityLevel,ma=Be.unstable_ImmediatePriority,Md=Be.unstable_UserBlockingPriority,xi=Be.unstable_NormalPriority,om=Be.unstable_LowPriority,Dd=Be.unstable_IdlePriority,Vi=null,ht=null;function lm(e){if(ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(Vi,e,void 0,(e.current.flags&128)===128)}catch{}}var it=Math.clz32?Math.clz32:um,am=Math.log,cm=Math.LN2;function um(e){return e>>>=0,e===0?32:31-(am(e)/cm|0)|0}var Or=64,Pr=4194304;function Os(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 vi(e,t){var n=e.pendingLanes;if(n===0)return 0;var s=0,r=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var a=l&~r;a!==0?s=Os(a):(i&=l,i!==0&&(s=Os(i)))}else l=n&~r,l!==0?s=Os(l):i!==0&&(s=Os(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 dm(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 fm(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes;0<i;){var l=31-it(i),a=1<<l,c=r[l];c===-1?(!(a&n)||a&s)&&(r[l]=dm(a,t)):c<=t&&(e.expiredLanes|=a),i&=~a}}function xl(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Rd(){var e=Or;return Or<<=1,!(Or&4194240)&&(Or=64),e}function No(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gr(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 pm(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 ga(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 $d(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zd,ya,Fd,Bd,Ud,vl=!1,_r=[],Bt=null,Ut=null,Wt=null,Qs=new Map,Js=new Map,Dt=[],hm="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 Tc(e,t){switch(e){case"focusin":case"focusout":Bt=null;break;case"dragenter":case"dragleave":Ut=null;break;case"mouseover":case"mouseout":Wt=null;break;case"pointerover":case"pointerout":Qs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Js.delete(t.pointerId)}}function js(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=xr(t),t!==null&&ya(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function mm(e,t,n,s,r){switch(t){case"focusin":return Bt=js(Bt,e,t,n,s,r),!0;case"dragenter":return Ut=js(Ut,e,t,n,s,r),!0;case"mouseover":return Wt=js(Wt,e,t,n,s,r),!0;case"pointerover":var i=r.pointerId;return Qs.set(i,js(Qs.get(i)||null,e,t,n,s,r)),!0;case"gotpointercapture":return i=r.pointerId,Js.set(i,js(Js.get(i)||null,e,t,n,s,r)),!0}return!1}function Wd(e){var t=an(e.target);if(t!==null){var n=jn(t);if(n!==null){if(t=n.tag,t===13){if(t=Id(n),t!==null){e.blockedOn=t,Ud(e.priority,function(){Fd(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 ni(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bl(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);hl=s,n.target.dispatchEvent(s),hl=null}else return t=xr(n),t!==null&&ya(t),e.blockedOn=n,!1;t.shift()}return!0}function Lc(e,t,n){ni(e)&&n.delete(t)}function gm(){vl=!1,Bt!==null&&ni(Bt)&&(Bt=null),Ut!==null&&ni(Ut)&&(Ut=null),Wt!==null&&ni(Wt)&&(Wt=null),Qs.forEach(Lc),Js.forEach(Lc)}function ks(e,t){e.blockedOn===t&&(e.blockedOn=null,vl||(vl=!0,Be.unstable_scheduleCallback(Be.unstable_NormalPriority,gm)))}function Xs(e){function t(r){return ks(r,e)}if(0<_r.length){ks(_r[0],e);for(var n=1;n<_r.length;n++){var s=_r[n];s.blockedOn===e&&(s.blockedOn=null)}}for(Bt!==null&&ks(Bt,e),Ut!==null&&ks(Ut,e),Wt!==null&&ks(Wt,e),Qs.forEach(t),Js.forEach(t),n=0;n<Dt.length;n++)s=Dt[n],s.blockedOn===e&&(s.blockedOn=null);for(;0<Dt.length&&(n=Dt[0],n.blockedOn===null);)Wd(n),n.blockedOn===null&&Dt.shift()}var qn=Lt.ReactCurrentBatchConfig,bi=!0;function ym(e,t,n,s){var r=K,i=qn.transition;qn.transition=null;try{K=1,xa(e,t,n,s)}finally{K=r,qn.transition=i}}function xm(e,t,n,s){var r=K,i=qn.transition;qn.transition=null;try{K=4,xa(e,t,n,s)}finally{K=r,qn.transition=i}}function xa(e,t,n,s){if(bi){var r=bl(e,t,n,s);if(r===null)_o(e,t,s,wi,n),Tc(e,s);else if(mm(r,e,t,n,s))s.stopPropagation();else if(Tc(e,s),t&4&&-1<hm.indexOf(e)){for(;r!==null;){var i=xr(r);if(i!==null&&zd(i),i=bl(e,t,n,s),i===null&&_o(e,t,s,wi,n),i===r)break;r=i}r!==null&&s.stopPropagation()}else _o(e,t,s,null,n)}}var wi=null;function bl(e,t,n,s){if(wi=null,e=ha(s),e=an(e),e!==null)if(t=jn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Id(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 wi=e,null}function Hd(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(im()){case ma:return 1;case Md:return 4;case xi:case om:return 16;case Dd:return 536870912;default:return 16}default:return 16}}var $t=null,va=null,si=null;function Vd(){if(si)return si;var e,t=va,n=t.length,s,r="value"in $t?$t.value:$t.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var l=n-e;for(s=1;s<=l&&t[n-s]===r[i-s];s++);return si=r.slice(e,1<s?1-s:void 0)}function ri(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 Mr(){return!0}function Ac(){return!1}function We(e){function t(n,s,r,i,l){this._reactName=n,this._targetInst=r,this.type=s,this.nativeEvent=i,this.target=l,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Mr:Ac,this.isPropagationStopped=Ac,this}return se(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=Mr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Mr)},persist:function(){},isPersistent:Mr}),t}var us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ba=We(us),yr=se({},us,{view:0,detail:0}),vm=We(yr),So,Co,Ns,Ki=se({},yr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wa,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!==Ns&&(Ns&&e.type==="mousemove"?(So=e.screenX-Ns.screenX,Co=e.screenY-Ns.screenY):Co=So=0,Ns=e),So)},movementY:function(e){return"movementY"in e?e.movementY:Co}}),Ic=We(Ki),bm=se({},Ki,{dataTransfer:0}),wm=We(bm),jm=se({},yr,{relatedTarget:0}),Eo=We(jm),km=se({},us,{animationName:0,elapsedTime:0,pseudoElement:0}),Nm=We(km),Sm=se({},us,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cm=We(Sm),Em=se({},us,{data:0}),Oc=We(Em),Tm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Lm={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"},Am={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Im(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Am[e])?!!t[e]:!1}function wa(){return Im}var Om=se({},yr,{key:function(e){if(e.key){var t=Tm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ri(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Lm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wa,charCode:function(e){return e.type==="keypress"?ri(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ri(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Pm=We(Om),_m=se({},Ki,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pc=We(_m),Mm=se({},yr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wa}),Dm=We(Mm),Rm=se({},us,{propertyName:0,elapsedTime:0,pseudoElement:0}),$m=We(Rm),zm=se({},Ki,{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}),Fm=We(zm),Bm=[9,13,27,32],ja=St&&"CompositionEvent"in window,$s=null;St&&"documentMode"in document&&($s=document.documentMode);var Um=St&&"TextEvent"in window&&!$s,Kd=St&&(!ja||$s&&8<$s&&11>=$s),_c=" ",Mc=!1;function Gd(e,t){switch(e){case"keyup":return Bm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var On=!1;function Wm(e,t){switch(e){case"compositionend":return qd(t);case"keypress":return t.which!==32?null:(Mc=!0,_c);case"textInput":return e=t.data,e===_c&&Mc?null:e;default:return null}}function Hm(e,t){if(On)return e==="compositionend"||!ja&&Gd(e,t)?(e=Vd(),si=va=$t=null,On=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Kd&&t.locale!=="ko"?null:t.data;default:return null}}var Vm={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 Dc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vm[e.type]:t==="textarea"}function Yd(e,t,n,s){Cd(s),t=ji(t,"onChange"),0<t.length&&(n=new ba("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var zs=null,Zs=null;function Km(e){lf(e,0)}function Gi(e){var t=Mn(e);if(vd(t))return e}function Gm(e,t){if(e==="change")return t}var Qd=!1;if(St){var To;if(St){var Lo="oninput"in document;if(!Lo){var Rc=document.createElement("div");Rc.setAttribute("oninput","return;"),Lo=typeof Rc.oninput=="function"}To=Lo}else To=!1;Qd=To&&(!document.documentMode||9<document.documentMode)}function $c(){zs&&(zs.detachEvent("onpropertychange",Jd),Zs=zs=null)}function Jd(e){if(e.propertyName==="value"&&Gi(Zs)){var t=[];Yd(t,Zs,e,ha(e)),Ad(Km,t)}}function qm(e,t,n){e==="focusin"?($c(),zs=t,Zs=n,zs.attachEvent("onpropertychange",Jd)):e==="focusout"&&$c()}function Ym(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gi(Zs)}function Qm(e,t){if(e==="click")return Gi(t)}function Jm(e,t){if(e==="input"||e==="change")return Gi(t)}function Xm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lt=typeof Object.is=="function"?Object.is:Xm;function er(e,t){if(lt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var r=n[s];if(!nl.call(t,r)||!lt(e[r],t[r]))return!1}return!0}function zc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Fc(e,t){var n=zc(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=zc(n)}}function Xd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zd(){for(var e=window,t=mi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=mi(e.document)}return t}function ka(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 Zm(e){var t=Zd(),n=e.focusedElem,s=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Xd(n.ownerDocument.documentElement,n)){if(s!==null&&ka(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=Fc(n,i);var l=Fc(n,s);r&&l&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),i>s?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.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 eg=St&&"documentMode"in document&&11>=document.documentMode,Pn=null,wl=null,Fs=null,jl=!1;function Bc(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jl||Pn==null||Pn!==mi(s)||(s=Pn,"selectionStart"in s&&ka(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}),Fs&&er(Fs,s)||(Fs=s,s=ji(wl,"onSelect"),0<s.length&&(t=new ba("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Pn)))}function Dr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _n={animationend:Dr("Animation","AnimationEnd"),animationiteration:Dr("Animation","AnimationIteration"),animationstart:Dr("Animation","AnimationStart"),transitionend:Dr("Transition","TransitionEnd")},Ao={},ef={};St&&(ef=document.createElement("div").style,"AnimationEvent"in window||(delete _n.animationend.animation,delete _n.animationiteration.animation,delete _n.animationstart.animation),"TransitionEvent"in window||delete _n.transitionend.transition);function qi(e){if(Ao[e])return Ao[e];if(!_n[e])return e;var t=_n[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ef)return Ao[e]=t[n];return e}var tf=qi("animationend"),nf=qi("animationiteration"),sf=qi("animationstart"),rf=qi("transitionend"),of=new Map,Uc="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 Zt(e,t){of.set(e,t),wn(t,[e])}for(var Io=0;Io<Uc.length;Io++){var Oo=Uc[Io],tg=Oo.toLowerCase(),ng=Oo[0].toUpperCase()+Oo.slice(1);Zt(tg,"on"+ng)}Zt(tf,"onAnimationEnd");Zt(nf,"onAnimationIteration");Zt(sf,"onAnimationStart");Zt("dblclick","onDoubleClick");Zt("focusin","onFocus");Zt("focusout","onBlur");Zt(rf,"onTransitionEnd");Zn("onMouseEnter",["mouseout","mouseover"]);Zn("onMouseLeave",["mouseout","mouseover"]);Zn("onPointerEnter",["pointerout","pointerover"]);Zn("onPointerLeave",["pointerout","pointerover"]);wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wn("onBeforeInput",["compositionend","keypress","textInput","paste"]);wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ps="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(" "),sg=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ps));function Wc(e,t,n){var s=e.type||"unknown-event";e.currentTarget=n,tm(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 l=s.length-1;0<=l;l--){var a=s[l],c=a.instance,u=a.currentTarget;if(a=a.listener,c!==i&&r.isPropagationStopped())break e;Wc(r,a,u),i=c}else for(l=0;l<s.length;l++){if(a=s[l],c=a.instance,u=a.currentTarget,a=a.listener,c!==i&&r.isPropagationStopped())break e;Wc(r,a,u),i=c}}}if(yi)throw e=yl,yi=!1,yl=null,e}function J(e,t){var n=t[El];n===void 0&&(n=t[El]=new Set);var s=e+"__bubble";n.has(s)||(af(t,e,2,!1),n.add(s))}function Po(e,t,n){var s=0;t&&(s|=4),af(n,e,s,t)}var Rr="_reactListening"+Math.random().toString(36).slice(2);function tr(e){if(!e[Rr]){e[Rr]=!0,hd.forEach(function(n){n!=="selectionchange"&&(sg.has(n)||Po(n,!1,e),Po(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Rr]||(t[Rr]=!0,Po("selectionchange",!1,t))}}function af(e,t,n,s){switch(Hd(t)){case 1:var r=ym;break;case 4:r=xm;break;default:r=xa}n=r.bind(null,t,n,e),r=void 0,!gl||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 _o(e,t,n,s,r){var i=s;if(!(t&1)&&!(t&2)&&s!==null)e:for(;;){if(s===null)return;var l=s.tag;if(l===3||l===4){var a=s.stateNode.containerInfo;if(a===r||a.nodeType===8&&a.parentNode===r)break;if(l===4)for(l=s.return;l!==null;){var c=l.tag;if((c===3||c===4)&&(c=l.stateNode.containerInfo,c===r||c.nodeType===8&&c.parentNode===r))return;l=l.return}for(;a!==null;){if(l=an(a),l===null)return;if(c=l.tag,c===5||c===6){s=i=l;continue e}a=a.parentNode}}s=s.return}Ad(function(){var u=i,p=ha(n),d=[];e:{var f=of.get(e);if(f!==void 0){var y=ba,w=e;switch(e){case"keypress":if(ri(n)===0)break e;case"keydown":case"keyup":y=Pm;break;case"focusin":w="focus",y=Eo;break;case"focusout":w="blur",y=Eo;break;case"beforeblur":case"afterblur":y=Eo;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":y=Ic;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=wm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Dm;break;case tf:case nf:case sf:y=Nm;break;case rf:y=$m;break;case"scroll":y=vm;break;case"wheel":y=Fm;break;case"copy":case"cut":case"paste":y=Cm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=Pc}var x=(t&4)!==0,v=!x&&e==="scroll",g=x?f!==null?f+"Capture":null:f;x=[];for(var m=u,h;m!==null;){h=m;var j=h.stateNode;if(h.tag===5&&j!==null&&(h=j,g!==null&&(j=Ys(m,g),j!=null&&x.push(nr(m,j,h)))),v)break;m=m.return}0<x.length&&(f=new y(f,w,null,n,p),d.push({event:f,listeners:x}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",f&&n!==hl&&(w=n.relatedTarget||n.fromElement)&&(an(w)||w[Ct]))break e;if((y||f)&&(f=p.window===p?p:(f=p.ownerDocument)?f.defaultView||f.parentWindow:window,y?(w=n.relatedTarget||n.toElement,y=u,w=w?an(w):null,w!==null&&(v=jn(w),w!==v||w.tag!==5&&w.tag!==6)&&(w=null)):(y=null,w=u),y!==w)){if(x=Ic,j="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(x=Pc,j="onPointerLeave",g="onPointerEnter",m="pointer"),v=y==null?f:Mn(y),h=w==null?f:Mn(w),f=new x(j,m+"leave",y,n,p),f.target=v,f.relatedTarget=h,j=null,an(p)===u&&(x=new x(g,m+"enter",w,n,p),x.target=h,x.relatedTarget=v,j=x),v=j,y&&w)t:{for(x=y,g=w,m=0,h=x;h;h=Nn(h))m++;for(h=0,j=g;j;j=Nn(j))h++;for(;0<m-h;)x=Nn(x),m--;for(;0<h-m;)g=Nn(g),h--;for(;m--;){if(x===g||g!==null&&x===g.alternate)break t;x=Nn(x),g=Nn(g)}x=null}else x=null;y!==null&&Hc(d,f,y,x,!1),w!==null&&v!==null&&Hc(d,v,w,x,!0)}}e:{if(f=u?Mn(u):window,y=f.nodeName&&f.nodeName.toLowerCase(),y==="select"||y==="input"&&f.type==="file")var k=Gm;else if(Dc(f))if(Qd)k=Jm;else{k=Ym;var E=qm}else(y=f.nodeName)&&y.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=Qm);if(k&&(k=k(e,u))){Yd(d,k,n,p);break e}E&&E(e,f,u),e==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&cl(f,"number",f.value)}switch(E=u?Mn(u):window,e){case"focusin":(Dc(E)||E.contentEditable==="true")&&(Pn=E,wl=u,Fs=null);break;case"focusout":Fs=wl=Pn=null;break;case"mousedown":jl=!0;break;case"contextmenu":case"mouseup":case"dragend":jl=!1,Bc(d,n,p);break;case"selectionchange":if(eg)break;case"keydown":case"keyup":Bc(d,n,p)}var N;if(ja)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else On?Gd(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(Kd&&n.locale!=="ko"&&(On||S!=="onCompositionStart"?S==="onCompositionEnd"&&On&&(N=Vd()):($t=p,va="value"in $t?$t.value:$t.textContent,On=!0)),E=ji(u,S),0<E.length&&(S=new Oc(S,e,null,n,p),d.push({event:S,listeners:E}),N?S.data=N:(N=qd(n),N!==null&&(S.data=N)))),(N=Um?Wm(e,n):Hm(e,n))&&(u=ji(u,"onBeforeInput"),0<u.length&&(p=new Oc("onBeforeInput","beforeinput",null,n,p),d.push({event:p,listeners:u}),p.data=N))}lf(d,t)})}function nr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ji(e,t){for(var n=t+"Capture",s=[];e!==null;){var r=e,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=Ys(e,n),i!=null&&s.unshift(nr(e,i,r)),i=Ys(e,t),i!=null&&s.push(nr(e,i,r))),e=e.return}return s}function Nn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Hc(e,t,n,s,r){for(var i=t._reactName,l=[];n!==null&&n!==s;){var a=n,c=a.alternate,u=a.stateNode;if(c!==null&&c===s)break;a.tag===5&&u!==null&&(a=u,r?(c=Ys(n,i),c!=null&&l.unshift(nr(n,c,a))):r||(c=Ys(n,i),c!=null&&l.push(nr(n,c,a)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var rg=/\r\n?/g,ig=/\u0000|\uFFFD/g;function Vc(e){return(typeof e=="string"?e:""+e).replace(rg,`
38
+ `).replace(ig,"")}function $r(e,t,n){if(t=Vc(t),Vc(e)!==t&&n)throw Error(I(425))}function ki(){}var kl=null,Nl=null;function Sl(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 Cl=typeof setTimeout=="function"?setTimeout:void 0,og=typeof clearTimeout=="function"?clearTimeout:void 0,Kc=typeof Promise=="function"?Promise:void 0,lg=typeof queueMicrotask=="function"?queueMicrotask:typeof Kc<"u"?function(e){return Kc.resolve(null).then(e).catch(ag)}:Cl;function ag(e){setTimeout(function(){throw e})}function Mo(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),Xs(t);return}s--}else n!=="$"&&n!=="$?"&&n!=="$!"||s++;n=r}while(n);Xs(t)}function Ht(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 Gc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var ds=Math.random().toString(36).slice(2),pt="__reactFiber$"+ds,sr="__reactProps$"+ds,Ct="__reactContainer$"+ds,El="__reactEvents$"+ds,cg="__reactListeners$"+ds,ug="__reactHandles$"+ds;function an(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ct]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Gc(e);e!==null;){if(n=e[pt])return n;e=Gc(e)}return t}e=n,n=e.parentNode}return null}function xr(e){return e=e[pt]||e[Ct],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(I(33))}function Yi(e){return e[sr]||null}var Tl=[],Dn=-1;function en(e){return{current:e}}function X(e){0>Dn||(e.current=Tl[Dn],Tl[Dn]=null,Dn--)}function q(e,t){Dn++,Tl[Dn]=e.current,e.current=t}var Xt={},ke=en(Xt),Pe=en(!1),mn=Xt;function es(e,t){var n=e.type.contextTypes;if(!n)return Xt;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 Ni(){X(Pe),X(ke)}function qc(e,t,n){if(ke.current!==Xt)throw Error(I(168));q(ke,t),q(Pe,n)}function cf(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,qh(e)||"Unknown",r));return se({},n,s)}function Si(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Xt,mn=ke.current,q(ke,e),q(Pe,Pe.current),!0}function Yc(e,t,n){var s=e.stateNode;if(!s)throw Error(I(169));n?(e=cf(e,t,mn),s.__reactInternalMemoizedMergedChildContext=e,X(Pe),X(ke),q(ke,e)):X(Pe),q(Pe,n)}var vt=null,Qi=!1,Do=!1;function uf(e){vt===null?vt=[e]:vt.push(e)}function dg(e){Qi=!0,uf(e)}function tn(){if(!Do&&vt!==null){Do=!0;var e=0,t=K;try{var n=vt;for(K=1;e<n.length;e++){var s=n[e];do s=s(!0);while(s!==null)}vt=null,Qi=!1}catch(r){throw vt!==null&&(vt=vt.slice(e+1)),_d(ma,tn),r}finally{K=t,Do=!1}}return null}var Rn=[],$n=0,Ci=null,Ei=0,He=[],Ve=0,gn=null,bt=1,wt="";function rn(e,t){Rn[$n++]=Ei,Rn[$n++]=Ci,Ci=e,Ei=t}function df(e,t,n){He[Ve++]=bt,He[Ve++]=wt,He[Ve++]=gn,gn=e;var s=bt;e=wt;var r=32-it(s)-1;s&=~(1<<r),n+=1;var i=32-it(t)+r;if(30<i){var l=r-r%5;i=(s&(1<<l)-1).toString(32),s>>=l,r-=l,bt=1<<32-it(t)+r|n<<r|s,wt=i+e}else bt=1<<i|n<<r|s,wt=e}function Na(e){e.return!==null&&(rn(e,1),df(e,1,0))}function Sa(e){for(;e===Ci;)Ci=Rn[--$n],Rn[$n]=null,Ei=Rn[--$n],Rn[$n]=null;for(;e===gn;)gn=He[--Ve],He[Ve]=null,wt=He[--Ve],He[Ve]=null,bt=He[--Ve],He[Ve]=null}var Fe=null,ze=null,Z=!1,rt=null;function ff(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 Qc(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=Ht(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Fe=e,ze=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gn!==null?{id:bt,overflow:wt}: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 Ll(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Al(e){if(Z){var t=ze;if(t){var n=t;if(!Qc(e,t)){if(Ll(e))throw Error(I(418));t=Ht(n.nextSibling);var s=Fe;t&&Qc(e,t)?ff(s,n):(e.flags=e.flags&-4097|2,Z=!1,Fe=e)}}else{if(Ll(e))throw Error(I(418));e.flags=e.flags&-4097|2,Z=!1,Fe=e}}}function Jc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Fe=e}function zr(e){if(e!==Fe)return!1;if(!Z)return Jc(e),Z=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Sl(e.type,e.memoizedProps)),t&&(t=ze)){if(Ll(e))throw pf(),Error(I(418));for(;t;)ff(e,t),t=Ht(t.nextSibling)}if(Jc(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=Ht(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ze=null}}else ze=Fe?Ht(e.stateNode.nextSibling):null;return!0}function pf(){for(var e=ze;e;)e=Ht(e.nextSibling)}function ts(){ze=Fe=null,Z=!1}function Ca(e){rt===null?rt=[e]:rt.push(e)}var fg=Lt.ReactCurrentBatchConfig;function Ss(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(l){var a=r.refs;l===null?delete a[i]:a[i]=l},t._stringRef=i,t)}if(typeof e!="string")throw Error(I(284));if(!n._owner)throw Error(I(290,e))}return e}function Fr(e,t){throw e=Object.prototype.toString.call(t),Error(I(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Xc(e){var t=e._init;return t(e._payload)}function hf(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=qt(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 l(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,m,h,j){return m===null||m.tag!==6?(m=Wo(h,g.mode,j),m.return=g,m):(m=r(m,h),m.return=g,m)}function c(g,m,h,j){var k=h.type;return k===In?p(g,m,h.props.children,j,h.key):m!==null&&(m.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pt&&Xc(k)===m.type)?(j=r(m,h.props),j.ref=Ss(g,m,h),j.return=g,j):(j=di(h.type,h.key,h.props,null,g.mode,j),j.ref=Ss(g,m,h),j.return=g,j)}function u(g,m,h,j){return m===null||m.tag!==4||m.stateNode.containerInfo!==h.containerInfo||m.stateNode.implementation!==h.implementation?(m=Ho(h,g.mode,j),m.return=g,m):(m=r(m,h.children||[]),m.return=g,m)}function p(g,m,h,j,k){return m===null||m.tag!==7?(m=hn(h,g.mode,j,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=Wo(""+m,g.mode,h),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Lr:return h=di(m.type,m.key,m.props,null,g.mode,h),h.ref=Ss(g,null,m),h.return=g,h;case An:return m=Ho(m,g.mode,h),m.return=g,m;case Pt:var j=m._init;return d(g,j(m._payload),h)}if(Is(m)||bs(m))return m=hn(m,g.mode,h,null),m.return=g,m;Fr(g,m)}return null}function f(g,m,h,j){var k=m!==null?m.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return k!==null?null:a(g,m,""+h,j);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Lr:return h.key===k?c(g,m,h,j):null;case An:return h.key===k?u(g,m,h,j):null;case Pt:return k=h._init,f(g,m,k(h._payload),j)}if(Is(h)||bs(h))return k!==null?null:p(g,m,h,j,null);Fr(g,h)}return null}function y(g,m,h,j,k){if(typeof j=="string"&&j!==""||typeof j=="number")return g=g.get(h)||null,a(m,g,""+j,k);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Lr:return g=g.get(j.key===null?h:j.key)||null,c(m,g,j,k);case An:return g=g.get(j.key===null?h:j.key)||null,u(m,g,j,k);case Pt:var E=j._init;return y(g,m,h,E(j._payload),k)}if(Is(j)||bs(j))return g=g.get(h)||null,p(m,g,j,k,null);Fr(m,j)}return null}function w(g,m,h,j){for(var k=null,E=null,N=m,S=m=0,T=null;N!==null&&S<h.length;S++){N.index>S?(T=N,N=null):T=N.sibling;var A=f(g,N,h[S],j);if(A===null){N===null&&(N=T);break}e&&N&&A.alternate===null&&t(g,N),m=i(A,m,S),E===null?k=A:E.sibling=A,E=A,N=T}if(S===h.length)return n(g,N),Z&&rn(g,S),k;if(N===null){for(;S<h.length;S++)N=d(g,h[S],j),N!==null&&(m=i(N,m,S),E===null?k=N:E.sibling=N,E=N);return Z&&rn(g,S),k}for(N=s(g,N);S<h.length;S++)T=y(N,g,S,h[S],j),T!==null&&(e&&T.alternate!==null&&N.delete(T.key===null?S:T.key),m=i(T,m,S),E===null?k=T:E.sibling=T,E=T);return e&&N.forEach(function(B){return t(g,B)}),Z&&rn(g,S),k}function x(g,m,h,j){var k=bs(h);if(typeof k!="function")throw Error(I(150));if(h=k.call(h),h==null)throw Error(I(151));for(var E=k=null,N=m,S=m=0,T=null,A=h.next();N!==null&&!A.done;S++,A=h.next()){N.index>S?(T=N,N=null):T=N.sibling;var B=f(g,N,A.value,j);if(B===null){N===null&&(N=T);break}e&&N&&B.alternate===null&&t(g,N),m=i(B,m,S),E===null?k=B:E.sibling=B,E=B,N=T}if(A.done)return n(g,N),Z&&rn(g,S),k;if(N===null){for(;!A.done;S++,A=h.next())A=d(g,A.value,j),A!==null&&(m=i(A,m,S),E===null?k=A:E.sibling=A,E=A);return Z&&rn(g,S),k}for(N=s(g,N);!A.done;S++,A=h.next())A=y(N,g,S,A.value,j),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?S:A.key),m=i(A,m,S),E===null?k=A:E.sibling=A,E=A);return e&&N.forEach(function(G){return t(g,G)}),Z&&rn(g,S),k}function v(g,m,h,j){if(typeof h=="object"&&h!==null&&h.type===In&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Lr:e:{for(var k=h.key,E=m;E!==null;){if(E.key===k){if(k=h.type,k===In){if(E.tag===7){n(g,E.sibling),m=r(E,h.props.children),m.return=g,g=m;break e}}else if(E.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Pt&&Xc(k)===E.type){n(g,E.sibling),m=r(E,h.props),m.ref=Ss(g,E,h),m.return=g,g=m;break e}n(g,E);break}else t(g,E);E=E.sibling}h.type===In?(m=hn(h.props.children,g.mode,j,h.key),m.return=g,g=m):(j=di(h.type,h.key,h.props,null,g.mode,j),j.ref=Ss(g,m,h),j.return=g,g=j)}return l(g);case An:e:{for(E=h.key;m!==null;){if(m.key===E)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=Ho(h,g.mode,j),m.return=g,g=m}return l(g);case Pt:return E=h._init,v(g,m,E(h._payload),j)}if(Is(h))return w(g,m,h,j);if(bs(h))return x(g,m,h,j);Fr(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=Wo(h,g.mode,j),m.return=g,g=m),l(g)):n(g,m)}return v}var ns=hf(!0),mf=hf(!1),Ti=en(null),Li=null,zn=null,Ea=null;function Ta(){Ea=zn=Li=null}function La(e){var t=Ti.current;X(Ti),e._currentValue=t}function Il(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Yn(e,t){Li=e,Ea=zn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ie=!0),e.firstContext=null)}function Qe(e){var t=e._currentValue;if(Ea!==e)if(e={context:e,memoizedValue:t,next:null},zn===null){if(Li===null)throw Error(I(308));zn=e,Li.dependencies={lanes:0,firstContext:e}}else zn=zn.next=e;return t}var cn=null;function Aa(e){cn===null?cn=[e]:cn.push(e)}function gf(e,t,n,s){var r=t.interleaved;return r===null?(n.next=n,Aa(t)):(n.next=r.next,r.next=n),t.interleaved=n,Et(e,s)}function Et(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var _t=!1;function Ia(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function yf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vt(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,H&2){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,Et(e,n)}return r=s.interleaved,r===null?(t.next=t,Aa(s)):(t.next=r.next,r.next=t),s.interleaved=t,Et(e,n)}function ii(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,ga(e,n)}}function Zc(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 l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=l:i=i.next=l,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 Ai(e,t,n,s){var r=e.updateQueue;_t=!1;var i=r.firstBaseUpdate,l=r.lastBaseUpdate,a=r.shared.pending;if(a!==null){r.shared.pending=null;var c=a,u=c.next;c.next=null,l===null?i=u:l.next=u,l=c;var p=e.alternate;p!==null&&(p=p.updateQueue,a=p.lastBaseUpdate,a!==l&&(a===null?p.firstBaseUpdate=u:a.next=u,p.lastBaseUpdate=c))}if(i!==null){var d=r.baseState;l=0,p=u=c=null,a=i;do{var f=a.lane,y=a.eventTime;if((s&f)===f){p!==null&&(p=p.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,x=a;switch(f=t,y=n,x.tag){case 1:if(w=x.payload,typeof w=="function"){d=w.call(y,d,f);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=x.payload,f=typeof w=="function"?w.call(y,d,f):w,f==null)break e;d=se({},d,f);break e;case 2:_t=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=r.effects,f===null?r.effects=[a]:f.push(a))}else y={eventTime:y,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},p===null?(u=p=y,c=d):p=p.next=y,l|=f;if(a=a.next,a===null){if(a=r.shared.pending,a===null)break;f=a,a=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 l|=r.lane,r=r.next;while(r!==t)}else i===null&&(r.shared.lanes=0);xn|=l,e.lanes=l,e.memoizedState=d}}function eu(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 vr={},mt=en(vr),rr=en(vr),ir=en(vr);function un(e){if(e===vr)throw Error(I(174));return e}function Oa(e,t){switch(q(ir,t),q(rr,e),q(mt,vr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:dl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=dl(t,e)}X(mt),q(mt,t)}function ss(){X(mt),X(rr),X(ir)}function xf(e){un(ir.current);var t=un(mt.current),n=dl(t,e.type);t!==n&&(q(rr,e),q(mt,n))}function Pa(e){rr.current===e&&(X(mt),X(rr))}var te=en(0);function Ii(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 Ro=[];function _a(){for(var e=0;e<Ro.length;e++)Ro[e]._workInProgressVersionPrimary=null;Ro.length=0}var oi=Lt.ReactCurrentDispatcher,$o=Lt.ReactCurrentBatchConfig,yn=0,ne=null,fe=null,he=null,Oi=!1,Bs=!1,or=0,pg=0;function be(){throw Error(I(321))}function Ma(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!lt(e[n],t[n]))return!1;return!0}function Da(e,t,n,s,r,i){if(yn=i,ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oi.current=e===null||e.memoizedState===null?yg:xg,e=n(s,r),Bs){i=0;do{if(Bs=!1,or=0,25<=i)throw Error(I(301));i+=1,he=fe=null,t.updateQueue=null,oi.current=vg,e=n(s,r)}while(Bs)}if(oi.current=Pi,t=fe!==null&&fe.next!==null,yn=0,he=fe=ne=null,Oi=!1,t)throw Error(I(300));return e}function Ra(){var e=or!==0;return or=0,e}function ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return he===null?ne.memoizedState=he=e:he=he.next=e,he}function Je(){if(fe===null){var e=ne.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=he===null?ne.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?ne.memoizedState=he=e:he=he.next=e}return he}function lr(e,t){return typeof t=="function"?t(e):t}function zo(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 l=r.next;r.next=i.next,i.next=l}s.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,s=s.baseState;var a=l=null,c=null,u=i;do{var p=u.lane;if((yn&p)===p)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),s=u.hasEagerState?u.eagerState:e(s,u.action);else{var d={lane:p,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(a=c=d,l=s):c=c.next=d,ne.lanes|=p,xn|=p}u=u.next}while(u!==null&&u!==i);c===null?l=s:c.next=a,lt(s,t.memoizedState)||(Ie=!0),t.memoizedState=s,t.baseState=l,t.baseQueue=c,n.lastRenderedState=s}if(e=n.interleaved,e!==null){r=e;do i=r.lane,ne.lanes|=i,xn|=i,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fo(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 l=r=r.next;do i=e(i,l.action),l=l.next;while(l!==r);lt(i,t.memoizedState)||(Ie=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,s]}function vf(){}function bf(e,t){var n=ne,s=Je(),r=t(),i=!lt(s.memoizedState,r);if(i&&(s.memoizedState=r,Ie=!0),s=s.queue,$a(kf.bind(null,n,s,e),[e]),s.getSnapshot!==t||i||he!==null&&he.memoizedState.tag&1){if(n.flags|=2048,ar(9,jf.bind(null,n,s,r,t),void 0,null),me===null)throw Error(I(349));yn&30||wf(n,t,r)}return r}function wf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ne.updateQueue,t===null?(t={lastEffect:null,stores:null},ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jf(e,t,n,s){t.value=n,t.getSnapshot=s,Nf(t)&&Sf(e)}function kf(e,t,n){return n(function(){Nf(t)&&Sf(e)})}function Nf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lt(e,n)}catch{return!0}}function Sf(e){var t=Et(e,1);t!==null&&ot(t,e,1,-1)}function tu(e){var t=ft();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:lr,lastRenderedState:e},t.queue=e,e=e.dispatch=gg.bind(null,ne,e),[t.memoizedState,e]}function ar(e,t,n,s){return e={tag:e,create:t,destroy:n,deps:s,next:null},t=ne.updateQueue,t===null?(t={lastEffect:null,stores:null},ne.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 Cf(){return Je().memoizedState}function li(e,t,n,s){var r=ft();ne.flags|=e,r.memoizedState=ar(1|t,n,void 0,s===void 0?null:s)}function Ji(e,t,n,s){var r=Je();s=s===void 0?null:s;var i=void 0;if(fe!==null){var l=fe.memoizedState;if(i=l.destroy,s!==null&&Ma(s,l.deps)){r.memoizedState=ar(t,n,i,s);return}}ne.flags|=e,r.memoizedState=ar(1|t,n,i,s)}function nu(e,t){return li(8390656,8,e,t)}function $a(e,t){return Ji(2048,8,e,t)}function Ef(e,t){return Ji(4,2,e,t)}function Tf(e,t){return Ji(4,4,e,t)}function Lf(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 Af(e,t,n){return n=n!=null?n.concat([e]):null,Ji(4,4,Lf.bind(null,t,e),n)}function za(){}function If(e,t){var n=Je();t=t===void 0?null:t;var s=n.memoizedState;return s!==null&&t!==null&&Ma(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&&Ma(t,s[1])?s[0]:(e=e(),n.memoizedState=[e,t],e)}function Pf(e,t,n){return yn&21?(lt(n,t)||(n=Rd(),ne.lanes|=n,xn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ie=!0),e.memoizedState=n)}function hg(e,t){var n=K;K=n!==0&&4>n?n:4,e(!0);var s=$o.transition;$o.transition={};try{e(!1),t()}finally{K=n,$o.transition=s}}function _f(){return Je().memoizedState}function mg(e,t,n){var s=Gt(e);if(n={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null},Mf(e))Df(t,n);else if(n=gf(e,t,n,s),n!==null){var r=Ce();ot(n,e,s,r),Rf(n,t,s)}}function gg(e,t,n){var s=Gt(e),r={lane:s,action:n,hasEagerState:!1,eagerState:null,next:null};if(Mf(e))Df(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,a=i(l,n);if(r.hasEagerState=!0,r.eagerState=a,lt(a,l)){var c=t.interleaved;c===null?(r.next=r,Aa(t)):(r.next=c.next,c.next=r),t.interleaved=r;return}}catch{}finally{}n=gf(e,t,r,s),n!==null&&(r=Ce(),ot(n,e,s,r),Rf(n,t,s))}}function Mf(e){var t=e.alternate;return e===ne||t!==null&&t===ne}function Df(e,t){Bs=Oi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rf(e,t,n){if(n&4194240){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,ga(e,n)}}var Pi={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},yg={readContext:Qe,useCallback:function(e,t){return ft().memoizedState=[e,t===void 0?null:t],e},useContext:Qe,useEffect:nu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,li(4194308,4,Lf.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=ft();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var s=ft();return t=n!==void 0?n(t):t,s.memoizedState=s.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},s.queue=e,e=e.dispatch=mg.bind(null,ne,e),[s.memoizedState,e]},useRef:function(e){var t=ft();return e={current:e},t.memoizedState=e},useState:tu,useDebugValue:za,useDeferredValue:function(e){return ft().memoizedState=e},useTransition:function(){var e=tu(!1),t=e[0];return e=hg.bind(null,e[1]),ft().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var s=ne,r=ft();if(Z){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),me===null)throw Error(I(349));yn&30||wf(s,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,nu(kf.bind(null,s,i,e),[e]),s.flags|=2048,ar(9,jf.bind(null,s,i,n,t),void 0,null),n},useId:function(){var e=ft(),t=me.identifierPrefix;if(Z){var n=wt,s=bt;n=(s&~(1<<32-it(s)-1)).toString(32)+n,t=":"+t+"R"+n,n=or++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=pg++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},xg={readContext:Qe,useCallback:If,useContext:Qe,useEffect:$a,useImperativeHandle:Af,useInsertionEffect:Ef,useLayoutEffect:Tf,useMemo:Of,useReducer:zo,useRef:Cf,useState:function(){return zo(lr)},useDebugValue:za,useDeferredValue:function(e){var t=Je();return Pf(t,fe.memoizedState,e)},useTransition:function(){var e=zo(lr)[0],t=Je().memoizedState;return[e,t]},useMutableSource:vf,useSyncExternalStore:bf,useId:_f,unstable_isNewReconciler:!1},vg={readContext:Qe,useCallback:If,useContext:Qe,useEffect:$a,useImperativeHandle:Af,useInsertionEffect:Ef,useLayoutEffect:Tf,useMemo:Of,useReducer:Fo,useRef:Cf,useState:function(){return Fo(lr)},useDebugValue:za,useDeferredValue:function(e){var t=Je();return fe===null?t.memoizedState=e:Pf(t,fe.memoizedState,e)},useTransition:function(){var e=Fo(lr)[0],t=Je().memoizedState;return[e,t]},useMutableSource:vf,useSyncExternalStore:bf,useId:_f,unstable_isNewReconciler:!1};function nt(e,t){if(e&&e.defaultProps){t=se({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ol(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:se({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xi={isMounted:function(e){return(e=e._reactInternals)?jn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var s=Ce(),r=Gt(e),i=kt(s,r);i.payload=t,n!=null&&(i.callback=n),t=Vt(e,i,r),t!==null&&(ot(t,e,r,s),ii(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=Ce(),r=Gt(e),i=kt(s,r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Vt(e,i,r),t!==null&&(ot(t,e,r,s),ii(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ce(),s=Gt(e),r=kt(n,s);r.tag=2,t!=null&&(r.callback=t),t=Vt(e,r,s),t!==null&&(ot(t,e,s,n),ii(t,e,s))}};function su(e,t,n,s,r,i,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,i,l):t.prototype&&t.prototype.isPureReactComponent?!er(n,s)||!er(r,i):!0}function $f(e,t,n){var s=!1,r=Xt,i=t.contextType;return typeof i=="object"&&i!==null?i=Qe(i):(r=_e(t)?mn:ke.current,s=t.contextTypes,i=(s=s!=null)?es(e,r):Xt),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xi,e.stateNode=t,t._reactInternals=e,s&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=i),t}function ru(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&&Xi.enqueueReplaceState(t,t.state,null)}function Pl(e,t,n,s){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},Ia(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=Qe(i):(i=_e(t)?mn:ke.current,r.context=es(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ol(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&&Xi.enqueueReplaceState(r,r.state,null),Ai(e,n,r,s),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function rs(e,t){try{var n="",s=t;do n+=Gh(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 Bo(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function _l(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var bg=typeof WeakMap=="function"?WeakMap:Map;function zf(e,t,n){n=kt(-1,n),n.tag=3,n.payload={element:null};var s=t.value;return n.callback=function(){Mi||(Mi=!0,Hl=s),_l(e,t)},n}function Ff(e,t,n){n=kt(-1,n),n.tag=3;var s=e.type.getDerivedStateFromError;if(typeof s=="function"){var r=t.value;n.payload=function(){return s(r)},n.callback=function(){_l(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){_l(e,t),typeof s!="function"&&(Kt===null?Kt=new Set([this]):Kt.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function iu(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new bg;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=_g.bind(null,e,t,n),t.then(e,e))}function ou(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=kt(-1,1),t.tag=2,Vt(n,t,1))),n.lanes|=1),e)}var wg=Lt.ReactCurrentOwner,Ie=!1;function Ne(e,t,n,s){t.child=e===null?mf(t,null,n,s):ns(t,e.child,n,s)}function au(e,t,n,s,r){n=n.render;var i=t.ref;return Yn(t,r),s=Da(e,t,n,s,i,r),n=Ra(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Tt(e,t,r)):(Z&&n&&Na(t),t.flags|=1,Ne(e,t,s,r),t.child)}function cu(e,t,n,s,r){if(e===null){var i=n.type;return typeof i=="function"&&!Ga(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Bf(e,t,i,s,r)):(e=di(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 l=i.memoizedProps;if(n=n.compare,n=n!==null?n:er,n(l,s)&&e.ref===t.ref)return Tt(e,t,r)}return t.flags|=1,e=qt(i,s),e.ref=t.ref,e.return=t,t.child=e}function Bf(e,t,n,s,r){if(e!==null){var i=e.memoizedProps;if(er(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,Tt(e,t,r)}return Ml(e,t,n,s,r)}function Uf(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(Bn,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(Bn,Re),Re|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},s=i!==null?i.baseLanes:n,q(Bn,Re),Re|=s}else i!==null?(s=i.baseLanes|n,t.memoizedState=null):s=n,q(Bn,Re),Re|=s;return Ne(e,t,r,n),t.child}function Wf(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ml(e,t,n,s,r){var i=_e(n)?mn:ke.current;return i=es(t,i),Yn(t,r),n=Da(e,t,n,s,i,r),s=Ra(),e!==null&&!Ie?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Tt(e,t,r)):(Z&&s&&Na(t),t.flags|=1,Ne(e,t,n,r),t.child)}function uu(e,t,n,s,r){if(_e(n)){var i=!0;Si(t)}else i=!1;if(Yn(t,r),t.stateNode===null)ai(e,t),$f(t,n,s),Pl(t,n,s,r),s=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var c=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=Qe(u):(u=_e(n)?mn:ke.current,u=es(t,u));var p=n.getDerivedStateFromProps,d=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";d||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==s||c!==u)&&ru(t,l,s,u),_t=!1;var f=t.memoizedState;l.state=f,Ai(t,s,l,r),c=t.memoizedState,a!==s||f!==c||Pe.current||_t?(typeof p=="function"&&(Ol(t,n,p,s),c=t.memoizedState),(a=_t||su(t,n,a,s,f,c,u))?(d||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=c),l.props=s,l.state=c,l.context=u,s=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{l=t.stateNode,yf(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:nt(t.type,a),l.props=u,d=t.pendingProps,f=l.context,c=n.contextType,typeof c=="object"&&c!==null?c=Qe(c):(c=_e(n)?mn:ke.current,c=es(t,c));var y=n.getDerivedStateFromProps;(p=typeof y=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==d||f!==c)&&ru(t,l,s,c),_t=!1,f=t.memoizedState,l.state=f,Ai(t,s,l,r);var w=t.memoizedState;a!==d||f!==w||Pe.current||_t?(typeof y=="function"&&(Ol(t,n,y,s),w=t.memoizedState),(u=_t||su(t,n,u,s,f,w,c)||!1)?(p||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(s,w,c),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(s,w,c)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=w),l.props=s,l.state=w,l.context=c,s=u):(typeof l.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),s=!1)}return Dl(e,t,n,s,i,r)}function Dl(e,t,n,s,r,i){Wf(e,t);var l=(t.flags&128)!==0;if(!s&&!l)return r&&Yc(t,n,!1),Tt(e,t,i);s=t.stateNode,wg.current=t;var a=l&&typeof n.getDerivedStateFromError!="function"?null:s.render();return t.flags|=1,e!==null&&l?(t.child=ns(t,e.child,null,i),t.child=ns(t,null,a,i)):Ne(e,t,a,i),t.memoizedState=s.state,r&&Yc(t,n,!0),t.child}function Hf(e){var t=e.stateNode;t.pendingContext?qc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&qc(e,t.context,!1),Oa(e,t.containerInfo)}function du(e,t,n,s,r){return ts(),Ca(r),t.flags|=256,Ne(e,t,n,s),t.child}var Rl={dehydrated:null,treeContext:null,retryLane:0};function $l(e){return{baseLanes:e,cachePool:null,transitions:null}}function Vf(e,t,n){var s=t.pendingProps,r=te.current,i=!1,l=(t.flags&128)!==0,a;if((a=l)||(a=e!==null&&e.memoizedState===null?!1:(r&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),q(te,r&1),e===null)return Al(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):(l=s.children,e=s.fallback,i?(s=t.mode,i=t.child,l={mode:"hidden",children:l},!(s&1)&&i!==null?(i.childLanes=0,i.pendingProps=l):i=to(l,s,0,null),e=hn(e,s,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=$l(n),t.memoizedState=Rl,e):Fa(t,l));if(r=e.memoizedState,r!==null&&(a=r.dehydrated,a!==null))return jg(e,t,l,s,a,r,n);if(i){i=s.fallback,l=t.mode,r=e.child,a=r.sibling;var c={mode:"hidden",children:s.children};return!(l&1)&&t.child!==r?(s=t.child,s.childLanes=0,s.pendingProps=c,t.deletions=null):(s=qt(r,c),s.subtreeFlags=r.subtreeFlags&14680064),a!==null?i=qt(a,i):(i=hn(i,l,n,null),i.flags|=2),i.return=t,s.return=t,s.sibling=i,t.child=s,s=i,i=t.child,l=e.child.memoizedState,l=l===null?$l(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},i.memoizedState=l,i.childLanes=e.childLanes&~n,t.memoizedState=Rl,s}return i=e.child,e=i.sibling,s=qt(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 Fa(e,t){return t=to({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Br(e,t,n,s){return s!==null&&Ca(s),ns(t,e.child,null,n),e=Fa(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jg(e,t,n,s,r,i,l){if(n)return t.flags&256?(t.flags&=-257,s=Bo(Error(I(422))),Br(e,t,l,s)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=s.fallback,r=t.mode,s=to({mode:"visible",children:s.children},r,0,null),i=hn(i,r,l,null),i.flags|=2,s.return=t,i.return=t,s.sibling=i,t.child=s,t.mode&1&&ns(t,e.child,null,l),t.child.memoizedState=$l(l),t.memoizedState=Rl,i);if(!(t.mode&1))return Br(e,t,l,null);if(r.data==="$!"){if(s=r.nextSibling&&r.nextSibling.dataset,s)var a=s.dgst;return s=a,i=Error(I(419)),s=Bo(i,s,void 0),Br(e,t,l,s)}if(a=(l&e.childLanes)!==0,Ie||a){if(s=me,s!==null){switch(l&-l){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|l)?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,Et(e,r),ot(s,e,r,-1))}return Ka(),s=Bo(Error(I(421))),Br(e,t,l,s)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=Mg.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,ze=Ht(r.nextSibling),Fe=t,Z=!0,rt=null,e!==null&&(He[Ve++]=bt,He[Ve++]=wt,He[Ve++]=gn,bt=e.id,wt=e.overflow,gn=t),t=Fa(t,s.children),t.flags|=4096,t)}function fu(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Il(e.return,t,n)}function Uo(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 Kf(e,t,n){var s=t.pendingProps,r=s.revealOrder,i=s.tail;if(Ne(e,t,s.children,n),s=te.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&&fu(e,n,t);else if(e.tag===19)fu(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(te,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&&Ii(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Uo(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&&Ii(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Uo(t,!0,n,null,i);break;case"together":Uo(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ai(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Tt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(I(153));if(t.child!==null){for(e=t.child,n=qt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function kg(e,t,n){switch(t.tag){case 3:Hf(t),ts();break;case 5:xf(t);break;case 1:_e(t.type)&&Si(t);break;case 4:Oa(t,t.stateNode.containerInfo);break;case 10:var s=t.type._context,r=t.memoizedProps.value;q(Ti,s._currentValue),s._currentValue=r;break;case 13:if(s=t.memoizedState,s!==null)return s.dehydrated!==null?(q(te,te.current&1),t.flags|=128,null):n&t.child.childLanes?Vf(e,t,n):(q(te,te.current&1),e=Tt(e,t,n),e!==null?e.sibling:null);q(te,te.current&1);break;case 19:if(s=(n&t.childLanes)!==0,e.flags&128){if(s)return Kf(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),q(te,te.current),s)break;return null;case 22:case 23:return t.lanes=0,Uf(e,t,n)}return Tt(e,t,n)}var Gf,zl,qf,Yf;Gf=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}};zl=function(){};qf=function(e,t,n,s){var r=e.memoizedProps;if(r!==s){e=t.stateNode,un(mt.current);var i=null;switch(n){case"input":r=ll(e,r),s=ll(e,s),i=[];break;case"select":r=se({},r,{value:void 0}),s=se({},s,{value:void 0}),i=[];break;case"textarea":r=ul(e,r),s=ul(e,s),i=[];break;default:typeof r.onClick!="function"&&typeof s.onClick=="function"&&(e.onclick=ki)}fl(n,s);var l;n=null;for(u in r)if(!s.hasOwnProperty(u)&&r.hasOwnProperty(u)&&r[u]!=null)if(u==="style"){var a=r[u];for(l in a)a.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Gs.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in s){var c=s[u];if(a=r!=null?r[u]:void 0,s.hasOwnProperty(u)&&c!==a&&(c!=null||a!=null))if(u==="style")if(a){for(l in a)!a.hasOwnProperty(l)||c&&c.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in c)c.hasOwnProperty(l)&&a[l]!==c[l]&&(n||(n={}),n[l]=c[l])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Gs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&J("scroll",e),i||a===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Yf=function(e,t,n,s){n!==s&&(t.flags|=4)};function Cs(e,t){if(!Z)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 Ng(e,t,n){var s=t.pendingProps;switch(Sa(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)&&Ni(),we(t),null;case 3:return s=t.stateNode,ss(),X(Pe),X(ke),_a(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(zr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rt!==null&&(Gl(rt),rt=null))),zl(e,t),we(t),null;case 5:Pa(t);var r=un(ir.current);if(n=t.type,e!==null&&t.stateNode!=null)qf(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=un(mt.current),zr(t)){s=t.stateNode,n=t.type;var i=t.memoizedProps;switch(s[pt]=t,s[sr]=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<Ps.length;r++)J(Ps[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":wc(s,i),J("invalid",s);break;case"select":s._wrapperState={wasMultiple:!!i.multiple},J("invalid",s);break;case"textarea":kc(s,i),J("invalid",s)}fl(n,i),r=null;for(var l in i)if(i.hasOwnProperty(l)){var a=i[l];l==="children"?typeof a=="string"?s.textContent!==a&&(i.suppressHydrationWarning!==!0&&$r(s.textContent,a,e),r=["children",a]):typeof a=="number"&&s.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&$r(s.textContent,a,e),r=["children",""+a]):Gs.hasOwnProperty(l)&&a!=null&&l==="onScroll"&&J("scroll",s)}switch(n){case"input":Ar(s),jc(s,i,!0);break;case"textarea":Ar(s),Nc(s);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(s.onclick=ki)}s=r,t.updateQueue=s,s!==null&&(t.flags|=4)}else{l=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=jd(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof s.is=="string"?e=l.createElement(n,{is:s.is}):(e=l.createElement(n),n==="select"&&(l=e,s.multiple?l.multiple=!0:s.size&&(l.size=s.size))):e=l.createElementNS(e,n),e[pt]=t,e[sr]=s,Gf(e,t,!1,!1),t.stateNode=e;e:{switch(l=pl(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<Ps.length;r++)J(Ps[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":wc(e,s),r=ll(e,s),J("invalid",e);break;case"option":r=s;break;case"select":e._wrapperState={wasMultiple:!!s.multiple},r=se({},s,{value:void 0}),J("invalid",e);break;case"textarea":kc(e,s),r=ul(e,s),J("invalid",e);break;default:r=s}fl(n,r),a=r;for(i in a)if(a.hasOwnProperty(i)){var c=a[i];i==="style"?Sd(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&kd(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&qs(e,c):typeof c=="number"&&qs(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Gs.hasOwnProperty(i)?c!=null&&i==="onScroll"&&J("scroll",e):c!=null&&ua(e,i,c,l))}switch(n){case"input":Ar(e),jc(e,s,!1);break;case"textarea":Ar(e),Nc(e);break;case"option":s.value!=null&&e.setAttribute("value",""+Jt(s.value));break;case"select":e.multiple=!!s.multiple,i=s.value,i!=null?Vn(e,!!s.multiple,i,!1):s.defaultValue!=null&&Vn(e,!!s.multiple,s.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=ki)}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)Yf(e,t,e.memoizedProps,s);else{if(typeof s!="string"&&t.stateNode===null)throw Error(I(166));if(n=un(ir.current),un(mt.current),zr(t)){if(s=t.stateNode,n=t.memoizedProps,s[pt]=t,(i=s.nodeValue!==n)&&(e=Fe,e!==null))switch(e.tag){case 3:$r(s.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$r(s.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else s=(n.nodeType===9?n:n.ownerDocument).createTextNode(s),s[pt]=t,t.stateNode=s}return we(t),null;case 13:if(X(te),s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Z&&ze!==null&&t.mode&1&&!(t.flags&128))pf(),ts(),t.flags|=98560,i=!1;else if(i=zr(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[pt]=t}else ts(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;we(t),i=!1}else rt!==null&&(Gl(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||te.current&1?pe===0&&(pe=3):Ka())),t.updateQueue!==null&&(t.flags|=4),we(t),null);case 4:return ss(),zl(e,t),e===null&&tr(t.stateNode.containerInfo),we(t),null;case 10:return La(t.type._context),we(t),null;case 17:return _e(t.type)&&Ni(),we(t),null;case 19:if(X(te),i=t.memoizedState,i===null)return we(t),null;if(s=(t.flags&128)!==0,l=i.rendering,l===null)if(s)Cs(i,!1);else{if(pe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=Ii(e),l!==null){for(t.flags|=128,Cs(i,!1),s=l.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,l=i.alternate,l===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=l.childLanes,i.lanes=l.lanes,i.child=l.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=l.memoizedProps,i.memoizedState=l.memoizedState,i.updateQueue=l.updateQueue,i.type=l.type,e=l.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return q(te,te.current&1|2),t.child}e=e.sibling}i.tail!==null&&le()>is&&(t.flags|=128,s=!0,Cs(i,!1),t.lanes=4194304)}else{if(!s)if(e=Ii(l),e!==null){if(t.flags|=128,s=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Cs(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!Z)return we(t),null}else 2*le()-i.renderingStartTime>is&&n!==1073741824&&(t.flags|=128,s=!0,Cs(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=le(),t.sibling=null,n=te.current,q(te,s?n&1|2:n&1),t):(we(t),null);case 22:case 23:return Va(),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 Sg(e,t){switch(Sa(t),t.tag){case 1:return _e(t.type)&&Ni(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ss(),X(Pe),X(ke),_a(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pa(t),null;case 13:if(X(te),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));ts()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return X(te),null;case 4:return ss(),null;case 10:return La(t.type._context),null;case 22:case 23:return Va(),null;case 24:return null;default:return null}}var Ur=!1,je=!1,Cg=typeof WeakSet=="function"?WeakSet:Set,_=null;function Fn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(s){ie(e,t,s)}else n.current=null}function Fl(e,t,n){try{n()}catch(s){ie(e,t,s)}}var pu=!1;function Eg(e,t){if(kl=bi,e=Zd(),ka(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 l=0,a=-1,c=-1,u=0,p=0,d=e,f=null;t:for(;;){for(var y;d!==n||r!==0&&d.nodeType!==3||(a=l+r),d!==i||s!==0&&d.nodeType!==3||(c=l+s),d.nodeType===3&&(l+=d.nodeValue.length),(y=d.firstChild)!==null;)f=d,d=y;for(;;){if(d===e)break t;if(f===n&&++u===r&&(a=l),f===i&&++p===s&&(c=l),(y=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=y}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Nl={focusedElem:e,selectionRange:n},bi=!1,_=t;_!==null;)if(t=_,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_=e;else for(;_!==null;){t=_;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var x=w.memoizedProps,v=w.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:nt(t.type,x),v);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(j){ie(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,_=e;break}_=t.return}return w=pu,pu=!1,w}function Us(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&&Fl(t,n,i)}r=r.next}while(r!==s)}}function Zi(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 Bl(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 Qf(e){var t=e.alternate;t!==null&&(e.alternate=null,Qf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[pt],delete t[sr],delete t[El],delete t[cg],delete t[ug])),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 Jf(e){return e.tag===5||e.tag===3||e.tag===4}function hu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jf(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 Ul(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=ki));else if(s!==4&&(e=e.child,e!==null))for(Ul(e,t,n),e=e.sibling;e!==null;)Ul(e,t,n),e=e.sibling}function Wl(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(Wl(e,t,n),e=e.sibling;e!==null;)Wl(e,t,n),e=e.sibling}var ye=null,st=!1;function It(e,t,n){for(n=n.child;n!==null;)Xf(e,t,n),n=n.sibling}function Xf(e,t,n){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(Vi,n)}catch{}switch(n.tag){case 5:je||Fn(n,t);case 6:var s=ye,r=st;ye=null,It(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?Mo(e.parentNode,n):e.nodeType===1&&Mo(e,n),Xs(e)):Mo(ye,n.stateNode));break;case 4:s=ye,r=st,ye=n.stateNode.containerInfo,st=!0,It(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,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&Fl(n,t,l),r=r.next}while(r!==s)}It(e,t,n);break;case 1:if(!je&&(Fn(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"))try{s.props=n.memoizedProps,s.state=n.memoizedState,s.componentWillUnmount()}catch(a){ie(n,t,a)}It(e,t,n);break;case 21:It(e,t,n);break;case 22:n.mode&1?(je=(s=je)||n.memoizedState!==null,It(e,t,n),je=s):It(e,t,n);break;default:It(e,t,n)}}function mu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Cg),t.forEach(function(s){var r=Dg.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,l=t,a=l;e:for(;a!==null;){switch(a.tag){case 5:ye=a.stateNode,st=!1;break e;case 3:ye=a.stateNode.containerInfo,st=!0;break e;case 4:ye=a.stateNode.containerInfo,st=!0;break e}a=a.return}if(ye===null)throw Error(I(160));Xf(i,l,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;)Zf(t,e),t=t.sibling}function Zf(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{Us(3,e,e.return),Zi(3,e)}catch(x){ie(e,e.return,x)}try{Us(5,e,e.return)}catch(x){ie(e,e.return,x)}}break;case 1:et(t,e),ct(e),s&512&&n!==null&&Fn(n,n.return);break;case 5:if(et(t,e),ct(e),s&512&&n!==null&&Fn(n,n.return),e.flags&32){var r=e.stateNode;try{qs(r,"")}catch(x){ie(e,e.return,x)}}if(s&4&&(r=e.stateNode,r!=null)){var i=e.memoizedProps,l=n!==null?n.memoizedProps:i,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&bd(r,i),pl(a,l);var u=pl(a,i);for(l=0;l<c.length;l+=2){var p=c[l],d=c[l+1];p==="style"?Sd(r,d):p==="dangerouslySetInnerHTML"?kd(r,d):p==="children"?qs(r,d):ua(r,p,d,u)}switch(a){case"input":al(r,i);break;case"textarea":wd(r,i);break;case"select":var f=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?Vn(r,!!i.multiple,y,!1):f!==!!i.multiple&&(i.defaultValue!=null?Vn(r,!!i.multiple,i.defaultValue,!0):Vn(r,!!i.multiple,i.multiple?[]:"",!1))}r[sr]=i}catch(x){ie(e,e.return,x)}}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(x){ie(e,e.return,x)}}break;case 3:if(et(t,e),ct(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{Xs(t.containerInfo)}catch(x){ie(e,e.return,x)}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||(Wa=le())),s&4&&mu(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=_,y=f.child,f.tag){case 0:case 11:case 14:case 15:Us(4,f,f.return);break;case 1:Fn(f,f.return);var w=f.stateNode;if(typeof w.componentWillUnmount=="function"){s=f,n=f.return;try{t=s,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(x){ie(s,n,x)}}break;case 5:Fn(f,f.return);break;case 22:if(f.memoizedState!==null){yu(d);continue}}y!==null?(y.return=f,_=y):yu(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"):(a=d.stateNode,c=d.memoizedProps.style,l=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=Nd("display",l))}catch(x){ie(e,e.return,x)}}}else if(d.tag===6){if(p===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(x){ie(e,e.return,x)}}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&&mu(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(Jf(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&&(qs(r,""),s.flags&=-33);var i=hu(e);Wl(e,i,r);break;case 3:case 4:var l=s.stateNode.containerInfo,a=hu(e);Ul(e,a,l);break;default:throw Error(I(161))}}catch(c){ie(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tg(e,t,n){_=e,ep(e)}function ep(e,t,n){for(var s=(e.mode&1)!==0;_!==null;){var r=_,i=r.child;if(r.tag===22&&s){var l=r.memoizedState!==null||Ur;if(!l){var a=r.alternate,c=a!==null&&a.memoizedState!==null||je;a=Ur;var u=je;if(Ur=l,(je=c)&&!u)for(_=r;_!==null;)l=_,c=l.child,l.tag===22&&l.memoizedState!==null?xu(r):c!==null?(c.return=l,_=c):xu(r);for(;i!==null;)_=i,ep(i),i=i.sibling;_=r,Ur=a,je=u}gu(e)}else r.subtreeFlags&8772&&i!==null?(i.return=r,_=i):gu(e)}}function gu(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||Zi(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&&eu(t,i,s);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}eu(t,l,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;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&&Xs(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(I(163))}je||t.flags&512&&Bl(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 yu(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 xu(e){for(;_!==null;){var t=_;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zi(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{Bl(t)}catch(c){ie(t,i,c)}break;case 5:var l=t.return;try{Bl(t)}catch(c){ie(t,l,c)}}}catch(c){ie(t,t.return,c)}if(t===e){_=null;break}var a=t.sibling;if(a!==null){a.return=t.return,_=a;break}_=t.return}}var Lg=Math.ceil,_i=Lt.ReactCurrentDispatcher,Ba=Lt.ReactCurrentOwner,qe=Lt.ReactCurrentBatchConfig,H=0,me=null,de=null,xe=0,Re=0,Bn=en(0),pe=0,cr=null,xn=0,eo=0,Ua=0,Ws=null,Ae=null,Wa=0,is=1/0,xt=null,Mi=!1,Hl=null,Kt=null,Wr=!1,zt=null,Di=0,Hs=0,Vl=null,ci=-1,ui=0;function Ce(){return H&6?le():ci!==-1?ci:ci=le()}function Gt(e){return e.mode&1?H&2&&xe!==0?xe&-xe:fg.transition!==null?(ui===0&&(ui=Rd()),ui):(e=K,e!==0||(e=window.event,e=e===void 0?16:Hd(e.type)),e):1}function ot(e,t,n,s){if(50<Hs)throw Hs=0,Vl=null,Error(I(185));gr(e,n,s),(!(H&2)||e!==me)&&(e===me&&(!(H&2)&&(eo|=n),pe===4&&Rt(e,xe)),Me(e,s),n===1&&H===0&&!(t.mode&1)&&(is=le()+500,Qi&&tn()))}function Me(e,t){var n=e.callbackNode;fm(e,t);var s=vi(e,e===me?xe:0);if(s===0)n!==null&&Ec(n),e.callbackNode=null,e.callbackPriority=0;else if(t=s&-s,e.callbackPriority!==t){if(n!=null&&Ec(n),t===1)e.tag===0?dg(vu.bind(null,e)):uf(vu.bind(null,e)),lg(function(){!(H&6)&&tn()}),n=null;else{switch($d(s)){case 1:n=ma;break;case 4:n=Md;break;case 16:n=xi;break;case 536870912:n=Dd;break;default:n=xi}n=ap(n,tp.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function tp(e,t){if(ci=-1,ui=0,H&6)throw Error(I(327));var n=e.callbackNode;if(Qn()&&e.callbackNode!==n)return null;var s=vi(e,e===me?xe:0);if(s===0)return null;if(s&30||s&e.expiredLanes||t)t=Ri(e,s);else{t=s;var r=H;H|=2;var i=sp();(me!==e||xe!==t)&&(xt=null,is=le()+500,pn(e,t));do try{Og();break}catch(a){np(e,a)}while(!0);Ta(),_i.current=i,H=r,de!==null?t=0:(me=null,xe=0,t=pe)}if(t!==0){if(t===2&&(r=xl(e),r!==0&&(s=r,t=Kl(e,r))),t===1)throw n=cr,pn(e,0),Rt(e,s),Me(e,le()),n;if(t===6)Rt(e,s);else{if(r=e.current.alternate,!(s&30)&&!Ag(r)&&(t=Ri(e,s),t===2&&(i=xl(e),i!==0&&(s=i,t=Kl(e,i))),t===1))throw n=cr,pn(e,0),Rt(e,s),Me(e,le()),n;switch(e.finishedWork=r,e.finishedLanes=s,t){case 0:case 1:throw Error(I(345));case 2:on(e,Ae,xt);break;case 3:if(Rt(e,s),(s&130023424)===s&&(t=Wa+500-le(),10<t)){if(vi(e,0)!==0)break;if(r=e.suspendedLanes,(r&s)!==s){Ce(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Cl(on.bind(null,e,Ae,xt),t);break}on(e,Ae,xt);break;case 4:if(Rt(e,s),(s&4194240)===s)break;for(t=e.eventTimes,r=-1;0<s;){var l=31-it(s);i=1<<l,l=t[l],l>r&&(r=l),s&=~i}if(s=r,s=le()-s,s=(120>s?120:480>s?480:1080>s?1080:1920>s?1920:3e3>s?3e3:4320>s?4320:1960*Lg(s/1960))-s,10<s){e.timeoutHandle=Cl(on.bind(null,e,Ae,xt),s);break}on(e,Ae,xt);break;case 5:on(e,Ae,xt);break;default:throw Error(I(329))}}}return Me(e,le()),e.callbackNode===n?tp.bind(null,e):null}function Kl(e,t){var n=Ws;return e.current.memoizedState.isDehydrated&&(pn(e,t).flags|=256),e=Ri(e,t),e!==2&&(t=Ae,Ae=n,t!==null&&Gl(t)),e}function Gl(e){Ae===null?Ae=e:Ae.push.apply(Ae,e)}function Ag(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(!lt(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 Rt(e,t){for(t&=~Ua,t&=~eo,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 vu(e){if(H&6)throw Error(I(327));Qn();var t=vi(e,0);if(!(t&1))return Me(e,le()),null;var n=Ri(e,t);if(e.tag!==0&&n===2){var s=xl(e);s!==0&&(t=s,n=Kl(e,s))}if(n===1)throw n=cr,pn(e,0),Rt(e,t),Me(e,le()),n;if(n===6)throw Error(I(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,on(e,Ae,xt),Me(e,le()),null}function Ha(e,t){var n=H;H|=1;try{return e(t)}finally{H=n,H===0&&(is=le()+500,Qi&&tn())}}function vn(e){zt!==null&&zt.tag===0&&!(H&6)&&Qn();var t=H;H|=1;var n=qe.transition,s=K;try{if(qe.transition=null,K=1,e)return e()}finally{K=s,qe.transition=n,H=t,!(H&6)&&tn()}}function Va(){Re=Bn.current,X(Bn)}function pn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,og(n)),de!==null)for(n=de.return;n!==null;){var s=n;switch(Sa(s),s.tag){case 1:s=s.type.childContextTypes,s!=null&&Ni();break;case 3:ss(),X(Pe),X(ke),_a();break;case 5:Pa(s);break;case 4:ss();break;case 13:X(te);break;case 19:X(te);break;case 10:La(s.type._context);break;case 22:case 23:Va()}n=n.return}if(me=e,de=e=qt(e.current,null),xe=Re=t,pe=0,cr=null,Ua=eo=xn=0,Ae=Ws=null,cn!==null){for(t=0;t<cn.length;t++)if(n=cn[t],s=n.interleaved,s!==null){n.interleaved=null;var r=s.next,i=n.pending;if(i!==null){var l=i.next;i.next=r,s.next=l}n.pending=s}cn=null}return e}function np(e,t){do{var n=de;try{if(Ta(),oi.current=Pi,Oi){for(var s=ne.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Oi=!1}if(yn=0,he=fe=ne=null,Bs=!1,or=0,Ba.current=null,n===null||n.return===null){pe=1,cr=t,de=null;break}e:{var i=e,l=n.return,a=n,c=t;if(t=xe,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,p=a,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 y=ou(l);if(y!==null){y.flags&=-257,lu(y,l,a,i,t),y.mode&1&&iu(i,u,t),t=y,c=u;var w=t.updateQueue;if(w===null){var x=new Set;x.add(c),t.updateQueue=x}else w.add(c);break e}else{if(!(t&1)){iu(i,u,t),Ka();break e}c=Error(I(426))}}else if(Z&&a.mode&1){var v=ou(l);if(v!==null){!(v.flags&65536)&&(v.flags|=256),lu(v,l,a,i,t),Ca(rs(c,a));break e}}i=c=rs(c,a),pe!==4&&(pe=2),Ws===null?Ws=[i]:Ws.push(i),i=l;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=zf(i,c,t);Zc(i,g);break e;case 1:a=c;var m=i.type,h=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Kt===null||!Kt.has(h)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=Ff(i,a,t);Zc(i,j);break e}}i=i.return}while(i!==null)}ip(n)}catch(k){t=k,de===n&&n!==null&&(de=n=n.return);continue}break}while(!0)}function sp(){var e=_i.current;return _i.current=Pi,e===null?Pi:e}function Ka(){(pe===0||pe===3||pe===2)&&(pe=4),me===null||!(xn&268435455)&&!(eo&268435455)||Rt(me,xe)}function Ri(e,t){var n=H;H|=2;var s=sp();(me!==e||xe!==t)&&(xt=null,pn(e,t));do try{Ig();break}catch(r){np(e,r)}while(!0);if(Ta(),H=n,_i.current=s,de!==null)throw Error(I(261));return me=null,xe=0,pe}function Ig(){for(;de!==null;)rp(de)}function Og(){for(;de!==null&&!sm();)rp(de)}function rp(e){var t=lp(e.alternate,e,Re);e.memoizedProps=e.pendingProps,t===null?ip(e):de=t,Ba.current=null}function ip(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Sg(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=Ng(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 on(e,t,n){var s=K,r=qe.transition;try{qe.transition=null,K=1,Pg(e,t,n,s)}finally{qe.transition=r,K=s}return null}function Pg(e,t,n,s){do Qn();while(zt!==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(pm(e,i),e===me&&(de=me=null,xe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Wr||(Wr=!0,ap(xi,function(){return Qn(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=qe.transition,qe.transition=null;var l=K;K=1;var a=H;H|=4,Ba.current=null,Eg(e,n),Zf(n,e),Zm(Nl),bi=!!kl,Nl=kl=null,e.current=n,Tg(n),rm(),H=a,K=l,qe.transition=i}else e.current=n;if(Wr&&(Wr=!1,zt=e,Di=r),i=e.pendingLanes,i===0&&(Kt=null),lm(n.stateNode),Me(e,le()),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(Mi)throw Mi=!1,e=Hl,Hl=null,e;return Di&1&&e.tag!==0&&Qn(),i=e.pendingLanes,i&1?e===Vl?Hs++:(Hs=0,Vl=e):Hs=0,tn(),null}function Qn(){if(zt!==null){var e=$d(Di),t=qe.transition,n=K;try{if(qe.transition=null,K=16>e?16:e,zt===null)var s=!1;else{if(e=zt,zt=null,Di=0,H&6)throw Error(I(331));var r=H;for(H|=4,_=e.current;_!==null;){var i=_,l=i.child;if(_.flags&16){var a=i.deletions;if(a!==null){for(var c=0;c<a.length;c++){var u=a[c];for(_=u;_!==null;){var p=_;switch(p.tag){case 0:case 11:case 15:Us(8,p,i)}var d=p.child;if(d!==null)d.return=p,_=d;else for(;_!==null;){p=_;var f=p.sibling,y=p.return;if(Qf(p),p===u){_=null;break}if(f!==null){f.return=y,_=f;break}_=y}}}var w=i.alternate;if(w!==null){var x=w.child;if(x!==null){w.child=null;do{var v=x.sibling;x.sibling=null,x=v}while(x!==null)}}_=i}}if(i.subtreeFlags&2064&&l!==null)l.return=i,_=l;else e:for(;_!==null;){if(i=_,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Us(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;){l=_;var h=l.child;if(l.subtreeFlags&2064&&h!==null)h.return=l,_=h;else e:for(l=m;_!==null;){if(a=_,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Zi(9,a)}}catch(k){ie(a,a.return,k)}if(a===l){_=null;break e}var j=a.sibling;if(j!==null){j.return=a.return,_=j;break e}_=a.return}}if(H=r,tn(),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(Vi,e)}catch{}s=!0}return s}finally{K=n,qe.transition=t}}return!1}function bu(e,t,n){t=rs(n,t),t=zf(e,t,1),e=Vt(e,t,1),t=Ce(),e!==null&&(gr(e,1,t),Me(e,t))}function ie(e,t,n){if(e.tag===3)bu(e,e,n);else for(;t!==null;){if(t.tag===3){bu(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Kt===null||!Kt.has(s))){e=rs(n,e),e=Ff(t,e,1),t=Vt(t,e,1),e=Ce(),t!==null&&(gr(t,1,e),Me(t,e));break}}t=t.return}}function _g(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>le()-Wa?pn(e,0):Ua|=n),Me(e,t)}function op(e,t){t===0&&(e.mode&1?(t=Pr,Pr<<=1,!(Pr&130023424)&&(Pr=4194304)):t=1);var n=Ce();e=Et(e,t),e!==null&&(gr(e,t,n),Me(e,n))}function Mg(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),op(e,n)}function Dg(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),op(e,n)}var lp;lp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pe.current)Ie=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ie=!1,kg(e,t,n);Ie=!!(e.flags&131072)}else Ie=!1,Z&&t.flags&1048576&&df(t,Ei,t.index);switch(t.lanes=0,t.tag){case 2:var s=t.type;ai(e,t),e=t.pendingProps;var r=es(t,ke.current);Yn(t,n),r=Da(null,t,s,e,r,n);var i=Ra();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,Si(t)):i=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Ia(t),r.updater=Xi,t.stateNode=r,r._reactInternals=t,Pl(t,s,e,n),t=Dl(null,t,s,!0,i,n)):(t.tag=0,Z&&i&&Na(t),Ne(null,t,r,n),t=t.child),t;case 16:s=t.elementType;e:{switch(ai(e,t),e=t.pendingProps,r=s._init,s=r(s._payload),t.type=s,r=t.tag=$g(s),e=nt(s,e),r){case 0:t=Ml(null,t,s,e,n);break e;case 1:t=uu(null,t,s,e,n);break e;case 11:t=au(null,t,s,e,n);break e;case 14:t=cu(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),Ml(e,t,s,r,n);case 1:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),uu(e,t,s,r,n);case 3:e:{if(Hf(t),e===null)throw Error(I(387));s=t.pendingProps,i=t.memoizedState,r=i.element,yf(e,t),Ai(t,s,null,n);var l=t.memoizedState;if(s=l.element,i.isDehydrated)if(i={element:s,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){r=rs(Error(I(423)),t),t=du(e,t,s,n,r);break e}else if(s!==r){r=rs(Error(I(424)),t),t=du(e,t,s,n,r);break e}else for(ze=Ht(t.stateNode.containerInfo.firstChild),Fe=t,Z=!0,rt=null,n=mf(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ts(),s===r){t=Tt(e,t,n);break e}Ne(e,t,s,n)}t=t.child}return t;case 5:return xf(t),e===null&&Al(t),s=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,l=r.children,Sl(s,r)?l=null:i!==null&&Sl(s,i)&&(t.flags|=32),Wf(e,t),Ne(e,t,l,n),t.child;case 6:return e===null&&Al(t),null;case 13:return Vf(e,t,n);case 4:return Oa(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ns(t,null,s,n):Ne(e,t,s,n),t.child;case 11:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),au(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,l=r.value,q(Ti,s._currentValue),s._currentValue=l,i!==null)if(lt(i.value,l)){if(i.children===r.children&&!Pe.current){t=Tt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){l=i.child;for(var c=a.firstContext;c!==null;){if(c.context===s){if(i.tag===1){c=kt(-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),Il(i.return,n,t),a.lanes|=n;break}c=c.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(I(341));l.lanes|=n,a=l.alternate,a!==null&&(a.lanes|=n),Il(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}Ne(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps.children,Yn(t,n),r=Qe(r),s=s(r),t.flags|=1,Ne(e,t,s,n),t.child;case 14:return s=t.type,r=nt(s,t.pendingProps),r=nt(s.type,r),cu(e,t,s,r,n);case 15:return Bf(e,t,t.type,t.pendingProps,n);case 17:return s=t.type,r=t.pendingProps,r=t.elementType===s?r:nt(s,r),ai(e,t),t.tag=1,_e(s)?(e=!0,Si(t)):e=!1,Yn(t,n),$f(t,s,r),Pl(t,s,r,n),Dl(null,t,s,!0,e,n);case 19:return Kf(e,t,n);case 22:return Uf(e,t,n)}throw Error(I(156,t.tag))};function ap(e,t){return _d(e,t)}function Rg(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 Rg(e,t,n,s)}function Ga(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $g(e){if(typeof e=="function")return Ga(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fa)return 11;if(e===pa)return 14}return 2}function qt(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 di(e,t,n,s,r,i){var l=2;if(s=e,typeof e=="function")Ga(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case In:return hn(n.children,r,i,t);case da:l=8,r|=8;break;case sl:return e=Ge(12,n,t,r|2),e.elementType=sl,e.lanes=i,e;case rl:return e=Ge(13,n,t,r),e.elementType=rl,e.lanes=i,e;case il:return e=Ge(19,n,t,r),e.elementType=il,e.lanes=i,e;case yd:return to(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case md:l=10;break e;case gd:l=9;break e;case fa:l=11;break e;case pa:l=14;break e;case Pt:l=16,s=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Ge(l,n,t,r),t.elementType=e,t.type=s,t.lanes=i,t}function hn(e,t,n,s){return e=Ge(7,e,s,t),e.lanes=n,e}function to(e,t,n,s){return e=Ge(22,e,s,t),e.elementType=yd,e.lanes=n,e.stateNode={isHidden:!1},e}function Wo(e,t,n){return e=Ge(6,e,null,t),e.lanes=n,e}function Ho(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 zg(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=No(0),this.expirationTimes=No(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=No(0),this.identifierPrefix=s,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function qa(e,t,n,s,r,i,l,a,c){return e=new zg(e,t,n,a,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},Ia(i),e}function Fg(e,t,n){var s=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:An,key:s==null?null:""+s,children:e,containerInfo:t,implementation:n}}function cp(e){if(!e)return Xt;e=e._reactInternals;e:{if(jn(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 cf(e,n,t)}return t}function up(e,t,n,s,r,i,l,a,c){return e=qa(n,s,!0,e,r,i,l,a,c),e.context=cp(null),n=e.current,s=Ce(),r=Gt(n),i=kt(s,r),i.callback=t??null,Vt(n,i,r),e.current.lanes=r,gr(e,r,s),Me(e,s),e}function no(e,t,n,s){var r=t.current,i=Ce(),l=Gt(r);return n=cp(n),t.context===null?t.context=n:t.pendingContext=n,t=kt(i,l),t.payload={element:e},s=s===void 0?null:s,s!==null&&(t.callback=s),e=Vt(r,t,l),e!==null&&(ot(e,r,l,i),ii(e,r,l)),l}function $i(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 wu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ya(e,t){wu(e,t),(e=e.alternate)&&wu(e,t)}function Bg(){return null}var dp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Qa(e){this._internalRoot=e}so.prototype.render=Qa.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(I(409));no(e,t,null,null)};so.prototype.unmount=Qa.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vn(function(){no(null,e,null,null)}),t[Ct]=null}};function so(e){this._internalRoot=e}so.prototype.unstable_scheduleHydration=function(e){if(e){var t=Bd();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dt.length&&t!==0&&t<Dt[n].priority;n++);Dt.splice(n,0,e),n===0&&Wd(e)}};function Ja(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ro(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ju(){}function Ug(e,t,n,s,r){if(r){if(typeof s=="function"){var i=s;s=function(){var u=$i(l);i.call(u)}}var l=up(t,s,e,0,null,!1,!1,"",ju);return e._reactRootContainer=l,e[Ct]=l.current,tr(e.nodeType===8?e.parentNode:e),vn(),l}for(;r=e.lastChild;)e.removeChild(r);if(typeof s=="function"){var a=s;s=function(){var u=$i(c);a.call(u)}}var c=qa(e,0,!1,null,null,!1,!1,"",ju);return e._reactRootContainer=c,e[Ct]=c.current,tr(e.nodeType===8?e.parentNode:e),vn(function(){no(t,c,n,s)}),c}function io(e,t,n,s,r){var i=n._reactRootContainer;if(i){var l=i;if(typeof r=="function"){var a=r;r=function(){var c=$i(l);a.call(c)}}no(t,l,e,r)}else l=Ug(n,t,e,r,s);return $i(l)}zd=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Os(t.pendingLanes);n!==0&&(ga(t,n|1),Me(t,le()),!(H&6)&&(is=le()+500,tn()))}break;case 13:vn(function(){var s=Et(e,1);if(s!==null){var r=Ce();ot(s,e,1,r)}}),Ya(e,1)}};ya=function(e){if(e.tag===13){var t=Et(e,134217728);if(t!==null){var n=Ce();ot(t,e,134217728,n)}Ya(e,134217728)}};Fd=function(e){if(e.tag===13){var t=Gt(e),n=Et(e,t);if(n!==null){var s=Ce();ot(n,e,t,s)}Ya(e,t)}};Bd=function(){return K};Ud=function(e,t){var n=K;try{return K=e,t()}finally{K=n}};ml=function(e,t,n){switch(t){case"input":if(al(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=Yi(s);if(!r)throw Error(I(90));vd(s),al(s,r)}}}break;case"textarea":wd(e,n);break;case"select":t=n.value,t!=null&&Vn(e,!!n.multiple,t,!1)}};Td=Ha;Ld=vn;var Wg={usingClientEntryPoint:!1,Events:[xr,Mn,Yi,Cd,Ed,Ha]},Es={findFiberByHostInstance:an,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Hg={bundleType:Es.bundleType,version:Es.version,rendererPackageName:Es.rendererPackageName,rendererConfig:Es.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Lt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Od(e),e===null?null:e.stateNode},findFiberByHostInstance:Es.findFiberByHostInstance||Bg,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 Hr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hr.isDisabled&&Hr.supportsFiber)try{Vi=Hr.inject(Hg),ht=Hr}catch{}}Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Wg;Ue.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ja(t))throw Error(I(200));return Fg(e,t,null,n)};Ue.createRoot=function(e,t){if(!Ja(e))throw Error(I(299));var n=!1,s="",r=dp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=qa(e,1,!1,null,null,n,!1,s,r),e[Ct]=t.current,tr(e.nodeType===8?e.parentNode:e),new Qa(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 vn(e)};Ue.hydrate=function(e,t,n){if(!ro(t))throw Error(I(200));return io(null,e,t,!0,n)};Ue.hydrateRoot=function(e,t,n){if(!Ja(e))throw Error(I(405));var s=n!=null&&n.hydratedSources||null,r=!1,i="",l=dp;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=up(t,null,e,1,n??null,r,!1,i,l),e[Ct]=t.current,tr(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 so(t)};Ue.render=function(e,t,n){if(!ro(t))throw Error(I(200));return io(null,e,t,!1,n)};Ue.unmountComponentAtNode=function(e){if(!ro(e))throw Error(I(40));return e._reactRootContainer?(vn(function(){io(null,null,e,!1,function(){e._reactRootContainer=null,e[Ct]=null})}),!0):!1};Ue.unstable_batchedUpdates=Ha;Ue.unstable_renderSubtreeIntoContainer=function(e,t,n,s){if(!ro(n))throw Error(I(200));if(e==null||e._reactInternals===void 0)throw Error(I(38));return io(e,t,n,!1,s)};Ue.version="18.3.1-next-f1338f8080-20240426";function fp(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(fp)}catch(e){console.error(e)}}fp(),dd.exports=Ue;var Vg=dd.exports,pp,ku=Vg;pp=ku.createRoot,ku.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 ur(){return ur=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},ur.apply(null,arguments)}var Ft;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ft||(Ft={}));const Nu="popstate";function Kg(e){e===void 0&&(e={});function t(s,r){let{pathname:i,search:l,hash:a}=s.location;return ql("",{pathname:i,search:l,hash:a},r.state&&r.state.usr||null,r.state&&r.state.key||"default")}function n(s,r){return typeof r=="string"?r:zi(r)}return qg(t,n,null,e)}function oe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Xa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Gg(){return Math.random().toString(36).substr(2,8)}function Su(e,t){return{usr:e.state,key:e.key,idx:t}}function ql(e,t,n,s){return n===void 0&&(n=null),ur({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?fs(t):t,{state:n,key:t&&t.key||s||Gg()})}function zi(e){let{pathname:t="/",search:n="",hash:s=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(t+=s.charAt(0)==="#"?s:"#"+s),t}function fs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let s=e.indexOf("?");s>=0&&(t.search=e.substr(s),e=e.substr(0,s)),e&&(t.pathname=e)}return t}function qg(e,t,n,s){s===void 0&&(s={});let{window:r=document.defaultView,v5Compat:i=!1}=s,l=r.history,a=Ft.Pop,c=null,u=p();u==null&&(u=0,l.replaceState(ur({},l.state,{idx:u}),""));function p(){return(l.state||{idx:null}).idx}function d(){a=Ft.Pop;let v=p(),g=v==null?null:v-u;u=v,c&&c({action:a,location:x.location,delta:g})}function f(v,g){a=Ft.Push;let m=ql(x.location,v,g);u=p()+1;let h=Su(m,u),j=x.createHref(m);try{l.pushState(h,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;r.location.assign(j)}i&&c&&c({action:a,location:x.location,delta:1})}function y(v,g){a=Ft.Replace;let m=ql(x.location,v,g);u=p();let h=Su(m,u),j=x.createHref(m);l.replaceState(h,"",j),i&&c&&c({action:a,location:x.location,delta:0})}function w(v){let g=r.location.origin!=="null"?r.location.origin:r.location.href,m=typeof v=="string"?v:zi(v);return m=m.replace(/ $/,"%20"),oe(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let x={get action(){return a},get location(){return e(r,l)},listen(v){if(c)throw new Error("A history only accepts one active listener");return r.addEventListener(Nu,d),c=v,()=>{r.removeEventListener(Nu,d),c=null}},createHref(v){return t(r,v)},createURL:w,encodeLocation(v){let g=w(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:y,go(v){return l.go(v)}};return x}var Cu;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Cu||(Cu={}));function Yg(e,t,n){return n===void 0&&(n="/"),Qg(e,t,n)}function Qg(e,t,n,s){let r=typeof t=="string"?fs(t):t,i=os(r.pathname||"/",n);if(i==null)return null;let l=hp(e);Jg(l);let a=null,c=ay(i);for(let u=0;a==null&&u<l.length;++u)a=oy(l[u],c);return a}function hp(e,t,n,s){t===void 0&&(t=[]),n===void 0&&(n=[]),s===void 0&&(s="");let r=(i,l,a)=>{let c={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:l,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=Yt([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+'".')),hp(i.children,t,p,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:ry(u,i.index),routesMeta:p})};return e.forEach((i,l)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))r(i,l);else for(let c of mp(i.path))r(i,l,c)}),t}function mp(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 l=mp(s.join("/")),a=[];return a.push(...l.map(c=>c===""?i:[i,c].join("/"))),r&&a.push(...l),a.map(c=>e.startsWith("/")&&c===""?"/":c)}function Jg(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:iy(t.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}const Xg=/^:[\w-]+$/,Zg=3,ey=2,ty=1,ny=10,sy=-2,Eu=e=>e==="*";function ry(e,t){let n=e.split("/"),s=n.length;return n.some(Eu)&&(s+=sy),t&&(s+=ey),n.filter(r=>!Eu(r)).reduce((r,i)=>r+(Xg.test(i)?Zg:i===""?ty:ny),s)}function iy(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 oy(e,t,n){let{routesMeta:s}=e,r={},i="/",l=[];for(let a=0;a<s.length;++a){let c=s[a],u=a===s.length-1,p=i==="/"?t:t.slice(i.length)||"/",d=Yl({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},p),f=c.route;if(!d)return null;Object.assign(r,d.params),l.push({params:r,pathname:Yt([i,d.pathname]),pathnameBase:py(Yt([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=Yt([i,d.pathnameBase]))}return l}function Yl(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],l=i.replace(/(.)\/+$/,"$1"),a=r.slice(1);return{params:s.reduce((u,p,d)=>{let{paramName:f,isOptional:y}=p;if(f==="*"){let x=a[d]||"";l=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const w=a[d];return y&&!w?u[f]=void 0:u[f]=(w||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:l,pattern:e}}function ly(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Xa(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,(l,a,c)=>(s.push({paramName:a,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 ay(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xa(!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 os(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 cy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uy=e=>cy.test(e);function dy(e,t){t===void 0&&(t="/");let{pathname:n,search:s="",hash:r=""}=typeof e=="string"?fs(e):e,i;if(n)if(uy(n))i=n;else{if(n.includes("//")){let l=n;n=xp(n),Xa(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?i=Tu(n.substring(1),"/"):i=Tu(n,t)}else i=t;return{pathname:i,search:hy(s),hash:my(r)}}function Tu(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 Vo(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 fy(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function gp(e,t){let n=fy(e);return t?n.map((s,r)=>r===n.length-1?s.pathname:s.pathnameBase):n.map(s=>s.pathnameBase)}function yp(e,t,n,s){s===void 0&&(s=!1);let r;typeof e=="string"?r=fs(e):(r=ur({},e),oe(!r.pathname||!r.pathname.includes("?"),Vo("?","pathname","search",r)),oe(!r.pathname||!r.pathname.includes("#"),Vo("#","pathname","hash",r)),oe(!r.search||!r.search.includes("#"),Vo("#","search","hash",r)));let i=e===""||r.pathname==="",l=i?"/":r.pathname,a;if(l==null)a=n;else{let d=t.length-1;if(!s&&l.startsWith("..")){let f=l.split("/");for(;f[0]==="..";)f.shift(),d-=1;r.pathname=f.join("/")}a=d>=0?t[d]:"/"}let c=dy(r,a),u=l&&l!=="/"&&l.endsWith("/"),p=(i||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||p)&&(c.pathname+="/"),c}const xp=e=>e.replace(/\/\/+/g,"/"),Yt=e=>xp(e.join("/")),py=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hy=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,my=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function gy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const vp=["post","put","patch","delete"];new Set(vp);const yy=["get",...vp];new Set(yy);/**
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 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)}const oo=b.createContext(null),bp=b.createContext(null),nn=b.createContext(null),lo=b.createContext(null),At=b.createContext({outlet:null,matches:[],isDataRoute:!1}),wp=b.createContext(null);function xy(e,t){let{relative:n}=t===void 0?{}:t;br()||oe(!1);let{basename:s,navigator:r}=b.useContext(nn),{hash:i,pathname:l,search:a}=ao(e,{relative:n}),c=l;return s!=="/"&&(c=l==="/"?s:Yt([s,l])),r.createHref({pathname:c,search:a,hash:i})}function br(){return b.useContext(lo)!=null}function kn(){return br()||oe(!1),b.useContext(lo).location}function jp(e){b.useContext(nn).static||b.useLayoutEffect(e)}function vy(){let{isDataRoute:e}=b.useContext(At);return e?My():by()}function by(){br()||oe(!1);let e=b.useContext(oo),{basename:t,future:n,navigator:s}=b.useContext(nn),{matches:r}=b.useContext(At),{pathname:i}=kn(),l=JSON.stringify(gp(r,n.v7_relativeSplatPath)),a=b.useRef(!1);return jp(()=>{a.current=!0}),b.useCallback(function(u,p){if(p===void 0&&(p={}),!a.current)return;if(typeof u=="number"){s.go(u);return}let d=yp(u,JSON.parse(l),i,p.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Yt([t,d.pathname])),(p.replace?s.replace:s.push)(d,p.state,p)},[t,s,l,i,e])}const wy=b.createContext(null);function jy(e){let t=b.useContext(At).outlet;return t&&b.createElement(wy.Provider,{value:e},t)}function ky(){let{matches:e}=b.useContext(At),t=e[e.length-1];return t?t.params:{}}function ao(e,t){let{relative:n}=t===void 0?{}:t,{future:s}=b.useContext(nn),{matches:r}=b.useContext(At),{pathname:i}=kn(),l=JSON.stringify(gp(r,s.v7_relativeSplatPath));return b.useMemo(()=>yp(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function Ny(e,t){return Sy(e,t)}function Sy(e,t,n,s){br()||oe(!1);let{navigator:r}=b.useContext(nn),{matches:i}=b.useContext(At),l=i[i.length-1],a=l?l.params:{};l&&l.pathname;let c=l?l.pathnameBase:"/";l&&l.route;let u=kn(),p;if(t){var d;let v=typeof t=="string"?fs(t):t;c==="/"||(d=v.pathname)!=null&&d.startsWith(c)||oe(!1),p=v}else p=u;let f=p.pathname||"/",y=f;if(c!=="/"){let v=c.replace(/^\//,"").split("/");y="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let w=Yg(e,{pathname:y}),x=Ay(w&&w.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Yt([c,r.encodeLocation?r.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?c:Yt([c,r.encodeLocation?r.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,s);return t&&x?b.createElement(lo.Provider,{value:{location:dr({pathname:"/",search:"",hash:"",state:null,key:"default"},p),navigationType:Ft.Pop}},x):x}function Cy(){let e=_y(),t=gy(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:r},n):null,null)}const Ey=b.createElement(Cy,null);class Ty extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(At.Provider,{value:this.props.routeContext},b.createElement(wp.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ly(e){let{routeContext:t,match:n,children:s}=e,r=b.useContext(oo);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(At.Provider,{value:t},s)}function Ay(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 l=e,a=(r=n)==null?void 0:r.errors;if(a!=null){let p=l.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);p>=0||oe(!1),l=l.slice(0,Math.min(l.length,p+1))}let c=!1,u=-1;if(n&&s&&s.v7_partialHydration)for(let p=0;p<l.length;p++){let d=l[p];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=p),d.route.id){let{loaderData:f,errors:y}=n,w=d.route.loader&&f[d.route.id]===void 0&&(!y||y[d.route.id]===void 0);if(d.route.lazy||w){c=!0,u>=0?l=l.slice(0,u+1):l=[l[0]];break}}}return l.reduceRight((p,d,f)=>{let y,w=!1,x=null,v=null;n&&(y=a&&d.route.id?a[d.route.id]:void 0,x=d.route.errorElement||Ey,c&&(u<0&&f===0?(Dy("route-fallback"),w=!0,v=null):u===f&&(w=!0,v=d.route.hydrateFallbackElement||null)));let g=t.concat(l.slice(0,f+1)),m=()=>{let h;return y?h=x:w?h=v:d.route.Component?h=b.createElement(d.route.Component,null):d.route.element?h=d.route.element:h=p,b.createElement(Ly,{match:d,routeContext:{outlet:p,matches:g,isDataRoute:n!=null},children:h})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?b.createElement(Ty,{location:n.location,revalidation:n.revalidation,component:x,error:y,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var kp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(kp||{}),Np=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}(Np||{});function Iy(e){let t=b.useContext(oo);return t||oe(!1),t}function Oy(e){let t=b.useContext(bp);return t||oe(!1),t}function Py(e){let t=b.useContext(At);return t||oe(!1),t}function Sp(e){let t=Py(),n=t.matches[t.matches.length-1];return n.route.id||oe(!1),n.route.id}function _y(){var e;let t=b.useContext(wp),n=Oy(),s=Sp();return t!==void 0?t:(e=n.errors)==null?void 0:e[s]}function My(){let{router:e}=Iy(kp.UseNavigateStable),t=Sp(Np.UseNavigateStable),n=b.useRef(!1);return jp(()=>{n.current=!0}),b.useCallback(function(r,i){i===void 0&&(i={}),n.current&&(typeof r=="number"?e.navigate(r):e.navigate(r,dr({fromRouteId:t},i)))},[e,t])}const Lu={};function Dy(e,t,n){Lu[e]||(Lu[e]=!0)}function Ry(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function $y(e){return jy(e.context)}function ge(e){oe(!1)}function zy(e){let{basename:t="/",children:n=null,location:s,navigationType:r=Ft.Pop,navigator:i,static:l=!1,future:a}=e;br()&&oe(!1);let c=t.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:c,navigator:i,static:l,future:dr({v7_relativeSplatPath:!1},a)}),[c,a,i,l]);typeof s=="string"&&(s=fs(s));let{pathname:p="/",search:d="",hash:f="",state:y=null,key:w="default"}=s,x=b.useMemo(()=>{let v=os(p,c);return v==null?null:{location:{pathname:v,search:d,hash:f,state:y,key:w},navigationType:r}},[c,p,d,f,y,w,r]);return x==null?null:b.createElement(nn.Provider,{value:u},b.createElement(lo.Provider,{children:n,value:x}))}function Fy(e){let{children:t,location:n}=e;return Ny(Ql(t),n)}new Promise(()=>{});function Ql(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(s,r)=>{if(!b.isValidElement(s))return;let i=[...t,r];if(s.type===b.Fragment){n.push.apply(n,Ql(s.props.children,i));return}s.type!==ge&&oe(!1),!s.props.index||!s.props.children||oe(!1);let l={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&&(l.children=Ql(s.props.children,i)),n.push(l)}),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 Fi(){return Fi=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},Fi.apply(null,arguments)}function Cp(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 By(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Uy(e,t){return e.button===0&&(!t||t==="_self")&&!By(e)}const Wy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Hy=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Vy="6";try{window.__reactRouterVersion=Vy}catch{}const Ky=b.createContext({isTransitioning:!1}),Gy="startTransition",Au=_h[Gy];function qy(e){let{basename:t,children:n,future:s,window:r}=e,i=b.useRef();i.current==null&&(i.current=Kg({window:r,v5Compat:!0}));let l=i.current,[a,c]=b.useState({action:l.action,location:l.location}),{v7_startTransition:u}=s||{},p=b.useCallback(d=>{u&&Au?Au(()=>c(d)):c(d)},[c,u]);return b.useLayoutEffect(()=>l.listen(p),[l,p]),b.useEffect(()=>Ry(s),[s]),b.createElement(zy,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:l,future:s})}const Yy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Qy=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,$e=b.forwardRef(function(t,n){let{onClick:s,relative:r,reloadDocument:i,replace:l,state:a,target:c,to:u,preventScrollReset:p,viewTransition:d}=t,f=Cp(t,Wy),{basename:y}=b.useContext(nn),w,x=!1;if(typeof u=="string"&&Qy.test(u)&&(w=u,Yy))try{let h=new URL(window.location.href),j=u.startsWith("//")?new URL(h.protocol+u):new URL(u),k=os(j.pathname,y);j.origin===h.origin&&k!=null?u=k+j.search+j.hash:x=!0}catch{}let v=xy(u,{relative:r}),g=Xy(u,{replace:l,state:a,target:c,preventScrollReset:p,relative:r,viewTransition:d});function m(h){s&&s(h),h.defaultPrevented||g(h)}return b.createElement("a",Fi({},f,{href:w||v,onClick:x||i?s:m,ref:n,target:c}))}),ut=b.forwardRef(function(t,n){let{"aria-current":s="page",caseSensitive:r=!1,className:i="",end:l=!1,style:a,to:c,viewTransition:u,children:p}=t,d=Cp(t,Hy),f=ao(c,{relative:d.relative}),y=kn(),w=b.useContext(bp),{navigator:x,basename:v}=b.useContext(nn),g=w!=null&&Zy(f)&&u===!0,m=x.encodeLocation?x.encodeLocation(f).pathname:f.pathname,h=y.pathname,j=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;r||(h=h.toLowerCase(),j=j?j.toLowerCase():null,m=m.toLowerCase()),j&&v&&(j=os(j,v)||j);const k=m!=="/"&&m.endsWith("/")?m.length-1:m.length;let E=h===m||!l&&h.startsWith(m)&&h.charAt(k)==="/",N=j!=null&&(j===m||!l&&j.startsWith(m)&&j.charAt(m.length)==="/"),S={isActive:E,isPending:N,isTransitioning:g},T=E?s:void 0,A;typeof i=="function"?A=i(S):A=[i,E?"active":null,N?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let B=typeof a=="function"?a(S):a;return b.createElement($e,Fi({},d,{"aria-current":T,className:A,ref:n,style:B,to:c,viewTransition:u}),typeof p=="function"?p(S):p)});var Jl;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Jl||(Jl={}));var Iu;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Iu||(Iu={}));function Jy(e){let t=b.useContext(oo);return t||oe(!1),t}function Xy(e,t){let{target:n,replace:s,state:r,preventScrollReset:i,relative:l,viewTransition:a}=t===void 0?{}:t,c=vy(),u=kn(),p=ao(e,{relative:l});return b.useCallback(d=>{if(Uy(d,n)){d.preventDefault();let f=s!==void 0?s:zi(u)===zi(p);c(e,{replace:f,state:r,preventScrollReset:i,relative:l,viewTransition:a})}},[u,c,p,s,r,n,e,i,l,a])}function Zy(e,t){t===void 0&&(t={});let n=b.useContext(Ky);n==null&&oe(!1);let{basename:s}=Jy(Jl.useViewTransitionState),r=ao(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=os(n.currentLocation.pathname,s)||n.currentLocation.pathname,l=os(n.nextLocation.pathname,s)||n.nextLocation.pathname;return Yl(r.pathname,l)!=null||Yl(r.pathname,i)!=null}function e0(e){const[t,n]=b.useState(null),s=b.useRef(0),r=b.useCallback(()=>{if(e.length===0){n(null);return}let i=e[0];for(const l of e){const a=document.getElementById(l);a&&a.getBoundingClientRect().top<=100&&(i=l)}n(i)},[e]);return b.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 re(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 z={getStatus:()=>re("GET","/api/status"),getConnectors:()=>re("GET","/api/connectors"),getConnector:(e,t)=>re("GET",`/api/connectors/${e}/${t}`),run:(e,t)=>re("POST","/api/run",{connector:e,args:t}),approve:(e,t)=>re("POST","/api/approval",{approvalId:e,approved:t}),getAudit:e=>{const t=new URLSearchParams(e).toString();return re("GET",`/api/audit${t?`?${t}`:""}`)},getAuditEvent:e=>re("GET",`/api/audit/${e}`),getConfig:()=>re("GET","/api/config"),setConfig:(e,t)=>re("POST","/api/config",{key:e,value:t}),getPreferences:()=>re("GET","/api/preferences"),setPreference:(e,t)=>re("PUT","/api/preferences",{key:e,value:t}),getGoals:e=>re("GET",`/api/goals?month=${e}`),upsertGoal:e=>re("POST","/api/goals",e),deleteGoal:e=>re("DELETE",`/api/goals/${e}`),getCachedReport:e=>re("GET",`/api/timetracking/cache?month=${e}`),cacheReport:(e,t)=>re("POST","/api/timetracking/cache",{month:e,data:t}),getCachedProjects:()=>re("GET","/api/timetracking/projects"),cacheProjects:e=>re("POST","/api/timetracking/projects",{data:e}),generateJournal:e=>re("POST","/api/journal/generate",e),getCachedSecurityNews:()=>re("GET","/api/security-news/cache"),cacheSecurityNews:e=>re("POST","/api/security-news/cache",{data:e}),getSkills:()=>re("GET","/api/skills")};function co(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 Ep={"command.success":"success","command.error":"error","command.denied":"error","command.start":"neutral","auth.failed":"warning","approval.granted":"success","approval.rejected":"error","config.changed":"neutral"},t0={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"},n0={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 ${n0[t]} ${t0[e]} ${n}`,children:s})}function s0(){const[e,t]=b.useState(null),[n,s]=b.useState([]),r=b.useCallback(()=>{z.getStatus().then(t).catch(()=>t(null)),z.getAudit({limit:"10"}).then(l=>s(l.events)).catch(()=>{})},[]);b.useEffect(()=>{r();const l=setInterval(r,3e4);return()=>clearInterval(l)},[r]);function i(l){const a=Date.now()-new Date(l).getTime(),c=Math.floor(a/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(l=>o.jsxs("tr",{className:"hover:bg-base-200",children:[o.jsx("td",{className:"opacity-50 text-sm font-mono",children:i(l.timestamp)}),o.jsx("td",{className:"font-mono text-sm",children:l.connector}),o.jsx("td",{children:o.jsx(U,{variant:Ep[l.type]??"neutral",children:l.type})}),o.jsx("td",{className:"text-sm font-mono",children:l.durationMs?`${(l.durationMs/1e3).toFixed(1)}s`:"—"})]},l.id))})]})})]})}function gt({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 r0({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 i0({site:e,connectors:t,approvingKey:n,onApprove:s}){const[r,i]=b.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(l=>o.jsx(r0,{c:l,approvingKey:n,onApprove:s},l.key))})]})}function o0(){const[e,t]=b.useState([]),[n,s]=b.useState([]),[r,i]=b.useState(!0),[l,a]=b.useState(null),c=b.useCallback(()=>{const d=z.getConnectors(),f=z.getConfig().catch(()=>({ok:!1,config:{}}));Promise.all([d,f]).then(([y,w])=>{t(y.connectors);const x=w.config.security??{};s(x.approvedHighRisk??[])}).catch(()=>{}).finally(()=>i(!1))},[]);b.useEffect(()=>{c()},[c]);const u=b.useCallback(async d=>{a(d);try{const f=[...n,d];await z.setConfig("security.approvedHighRisk",JSON.stringify(f)),c()}catch{}finally{a(null)}},[n,c]),p=b.useMemo(()=>co(e),[e]);return r?o.jsx(gt,{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(i0,{site:d,connectors:f,approvingKey:l,onApprove:u},d))})]})}function Za(){const[e,t]=b.useState(!1),[n,s]=b.useState(null),[r,i]=b.useState(null),[l,a]=b.useState(!1),[c,u]=b.useState(null),p=b.useCallback(()=>{t(!1),s(null),i(null),a(!1),u(null)},[]),d=b.useCallback(async(y,w)=>{t(!0),i(null),s(null),a(!1),u(null);try{const x=await z.run(y,w);if(x.requiresApproval&&x.requestId){a(!0);const v=new EventSource(`/api/run/events/${x.requestId}`);v.addEventListener("approval",g=>{const m=JSON.parse(g.data);u(m.approvalId)}),v.addEventListener("result",g=>{const m=JSON.parse(g.data);!m.ok&&m.error?i(m.error):s(m),a(!1),t(!1),v.close()}),v.onerror=()=>{i("SSE connection lost"),a(!1),t(!1),v.close()}}else!x.ok&&x.error?(i(x.error),t(!1)):(s(x),t(!1))}catch(x){i(x instanceof Error?x.message:"Unknown error"),t(!1)}},[]),f=b.useCallback(async y=>{if(c)try{await z.approve(c,y),y||(a(!1),t(!1),i("Approval rejected"))}catch(w){i(w instanceof Error?w.message:"Approval failed")}},[c]);return{running:e,result:n,error:r,approvalPending:l,approvalId:c,run:d,handleApproval:f,reset:p}}function l0(){const{site:e,name:t}=ky(),n=`${e}/${t}`,[s,r]=b.useState(null),[i,l]=b.useState(!0),[a,c]=b.useState({}),[u,p]=b.useState(null),{running:d,result:f,error:y,approvalPending:w,approvalId:x,run:v,handleApproval:g}=Za();b.useEffect(()=>{!e||!t||z.getConnector(e,t).then(h=>{r(h.connector);const j={};for(const k of h.connector.args??[])j[k.name]="";c(j)}).catch(h=>p(h.message)).finally(()=>l(!1))},[e,t]);const m=b.useCallback(async()=>{const h={};for(const[j,k]of Object.entries(a))k&&(h[j]=k);await v(n,h)},[a,n,v]);return i?o.jsx(gt,{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:a[h.name]??"",onChange:j=>c(k=>({...k,[h.name]:j.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&&!w&&o.jsx(gt,{label:`Running ${n} — this drives your browser and may take up to a minute.`}),w&&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:!x,children:"Approve"}),o.jsx("button",{className:"btn btn-sm btn-error",onClick:()=>g(!1),disabled:!x,children:"Reject"})]})]}),y&&o.jsx("div",{className:"alert alert-error mb-4",children:o.jsx("span",{children:y})}),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,j)=>o.jsx("tr",{children:(f.columns??Object.keys(h)).map(k=>o.jsx("td",{className:"text-sm",children:String(h[k]??"")},k))},j))})]})})]})]}):o.jsx("div",{className:"text-error",children:u??`Connector not found: ${n}`})}const a0=[{label:"Last 24 hours",hours:24},{label:"Last 7 days",hours:168},{label:"Last 30 days",hours:720},{label:"Last 90 days",hours:2160}],c0=["command.start","command.success","command.error","command.denied","auth.failed","approval.granted","approval.rejected","config.changed"],Sn=20;function u0(){const[e,t]=b.useState([]),[n,s]=b.useState([]),[r,i]=b.useState(!0),[l,a]=b.useState(168),[c,u]=b.useState(""),[p,d]=b.useState(""),[f,y]=b.useState(null),[w,x]=b.useState(0);b.useEffect(()=>{z.getConnectors().then(h=>s(h.connectors)).catch(()=>{})},[]);const v=b.useCallback(()=>{i(!0);const h={since:new Date(Date.now()-l*36e5).toISOString(),limit:String(Sn+w+1)};c&&(h.type=c),p&&(h.connector=p),z.getAudit(h).then(j=>t(j.events)).catch(()=>{}).finally(()=>i(!1))},[l,c,p,w]);b.useEffect(()=>{v();const h=setInterval(v,6e4);return()=>clearInterval(h)},[v]);const g=e.slice(w,w+Sn),m=e.length>w+Sn;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:l,onChange:h=>{a(Number(h.target.value)),x(0)},children:a0.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),x(0)},children:[o.jsx("option",{value:"",children:"All types"}),c0.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),x(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(gt,{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(b.Fragment,{children:[o.jsxs("tr",{className:"cursor-pointer hover:bg-base-200",onClick:()=>y(f===h.id?null:h.id),role:"button","aria-expanded":f===h.id,tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),y(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:Ep[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((j,k)=>o.jsxs("tr",{children:[o.jsx("td",{children:k+1}),o.jsx("td",{children:j.step}),o.jsx("td",{children:j.capability}),o.jsxs("td",{children:[(j.durationMs/1e3).toFixed(2),"s"]}),o.jsx("td",{className:"text-error",children:j.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:w===0,onClick:()=>x(Math.max(0,w-Sn)),children:"Previous"}),o.jsxs("span",{className:"text-sm opacity-50",children:["Showing ",w+1,"–",Math.min(w+Sn,e.length),m?"":` of ${e.length}`]}),o.jsx("button",{className:"btn btn-sm btn-ghost",disabled:!m,onClick:()=>x(w+Sn),children:"Next"})]})]})]})}const ec=Symbol.for("yaml.alias"),Xl=Symbol.for("yaml.document"),Qt=Symbol.for("yaml.map"),Tp=Symbol.for("yaml.pair"),yt=Symbol.for("yaml.scalar"),ps=Symbol.for("yaml.seq"),Xe=Symbol.for("yaml.node.type"),hs=e=>!!e&&typeof e=="object"&&e[Xe]===ec,wr=e=>!!e&&typeof e=="object"&&e[Xe]===Xl,jr=e=>!!e&&typeof e=="object"&&e[Xe]===Qt,ue=e=>!!e&&typeof e=="object"&&e[Xe]===Tp,Y=e=>!!e&&typeof e=="object"&&e[Xe]===yt,kr=e=>!!e&&typeof e=="object"&&e[Xe]===ps;function ae(e){if(e&&typeof e=="object")switch(e[Xe]){case Qt:case ps:return!0}return!1}function ce(e){if(e&&typeof e=="object")switch(e[Xe]){case ec:case Qt:case yt:case ps:return!0}return!1}const Lp=e=>(Y(e)||ae(e))&&!!e.anchor,ln=Symbol("break visit"),d0=Symbol("skip children"),Vs=Symbol("remove node");function ms(e,t){const n=f0(t);wr(e)?Un(null,e.contents,n,Object.freeze([e]))===Vs&&(e.contents=null):Un(null,e,n,Object.freeze([]))}ms.BREAK=ln;ms.SKIP=d0;ms.REMOVE=Vs;function Un(e,t,n,s){const r=p0(e,t,n,s);if(ce(r)||ue(r))return h0(e,s,r),Un(e,r,n,s);if(typeof r!="symbol"){if(ae(t)){s=Object.freeze(s.concat(t));for(let i=0;i<t.items.length;++i){const l=Un(i,t.items[i],n,s);if(typeof l=="number")i=l-1;else{if(l===ln)return ln;l===Vs&&(t.items.splice(i,1),i-=1)}}}else if(ue(t)){s=Object.freeze(s.concat(t));const i=Un("key",t.key,n,s);if(i===ln)return ln;i===Vs&&(t.key=null);const l=Un("value",t.value,n,s);if(l===ln)return ln;l===Vs&&(t.value=null)}}return r}function f0(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 p0(e,t,n,s){var r,i,l,a,c;if(typeof n=="function")return n(e,t,s);if(jr(t))return(r=n.Map)==null?void 0:r.call(n,e,t,s);if(kr(t))return(i=n.Seq)==null?void 0:i.call(n,e,t,s);if(ue(t))return(l=n.Pair)==null?void 0:l.call(n,e,t,s);if(Y(t))return(a=n.Scalar)==null?void 0:a.call(n,e,t,s);if(hs(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,s)}function h0(e,t,n){const s=t[t.length-1];if(ae(s))s.items[e]=n;else if(ue(s))e==="key"?s.key=n:s.value=n;else if(wr(s))s.contents=n;else{const r=hs(s)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const m0={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},g0=e=>e.replace(/[!,[\]{}]/g,t=>m0[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,l]=s;return this.tags[i]=l,!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 l=/^\d+\.\d+$/.test(i);return n(6,`Unsupported YAML version ${i}`,l),!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 l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}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(l){return n(String(l)),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+g0(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={};ms(t.contents,(l,a)=>{ce(a)&&a.tag&&(i[a.tag]=!0)}),r=Object.keys(i)}else r=[];for(const[i,l]of s)i==="!!"&&l==="tag:yaml.org,2002:"||(!t||r.some(a=>a.startsWith(l)))&&n.push(`%TAG ${i} ${l}`);return n.join(`
68
+ `)}}Se.defaultYaml={explicit:!1,version:"1.2"};Se.defaultTags={"!!":"tag:yaml.org,2002:"};function Ap(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 Ip(e){const t=new Set;return ms(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 y0(e,t){const n=[],s=new Map;let r=null;return{onAnchor:i=>{n.push(i),r??(r=Ip(e));const l=Op(t,r);return r.add(l),l},setAnchors:()=>{for(const i of n){const l=s.get(i);if(typeof l=="object"&&l.anchor&&(Y(l.node)||ae(l.node)))l.node.anchor=l.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:s}}function Wn(e,t,n,s){if(s&&typeof s=="object")if(Array.isArray(s))for(let r=0,i=s.length;r<i;++r){const l=s[r],a=Wn(e,s,String(r),l);a===void 0?delete s[r]:a!==l&&(s[r]=a)}else if(s instanceof Map)for(const r of Array.from(s.keys())){const i=s.get(r),l=Wn(e,s,r,i);l===void 0?s.delete(r):l!==i&&s.set(r,l)}else if(s instanceof Set)for(const r of Array.from(s)){const i=Wn(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 l=Wn(e,s,r,i);l===void 0?delete s[r]:l!==i&&(s[r]=l)}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||!Lp(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 tc{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(!wr(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof s=="number"?s:100},a=Ye(this,"",l);if(typeof r=="function")for(const{count:c,res:u}of l.anchors.values())r(u,c);return typeof i=="function"?Wn(i,{"":a},"",a):a}}class nc extends tc{constructor(t){super(ec),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=[],ms(t,{Node:(i,l)=>{(hs(l)||Lp(l))&&s.push(l)}}),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,l=this.resolve(r,n);if(!l){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=s.get(l);if(a||(Ye(l,null,n),a=s.get(l)),(a==null?void 0:a.res)===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=fi(r,l,s)),a.count*a.aliasCount>i)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(t,n,s){const r=`*${this.source}`;if(t){if(Ap(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 fi(e,t,n){if(hs(t)){const s=t.resolve(e),r=n&&s&&n.get(s);return r?r.count*r.aliasCount:0}else if(ae(t)){let s=0;for(const r of t.items){const i=fi(e,r,n);i>s&&(s=i)}return s}else if(ue(t)){const s=fi(e,t.key,n),r=fi(e,t.value,n);return Math.max(s,r)}return 1}const Pp=e=>!e||typeof e!="function"&&typeof e!="object";class F extends tc{constructor(t){super(yt),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Ye(this.value,t,n)}toString(){return String(this.value)}}F.BLOCK_FOLDED="BLOCK_FOLDED";F.BLOCK_LITERAL="BLOCK_LITERAL";F.PLAIN="PLAIN";F.QUOTE_DOUBLE="QUOTE_DOUBLE";F.QUOTE_SINGLE="QUOTE_SINGLE";const x0="tag:yaml.org,2002:";function v0(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 fr(e,t,n){var d,f,y;if(wr(e)&&(e=e.contents),ce(e))return e;if(ue(e)){const w=(f=(d=n.schema[Qt]).createNode)==null?void 0:f.call(d,n.schema,null,n);return w.items.push(e),w}(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:l,sourceObjects:a}=n;let c;if(s&&e&&typeof e=="object"){if(c=a.get(e),c)return c.anchor??(c.anchor=r(e)),new nc(c.anchor);c={anchor:null,node:null},a.set(e,c)}t!=null&&t.startsWith("!!")&&(t=x0+t.slice(2));let u=v0(e,t,l.tags);if(!u){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const w=new F(e);return c&&(c.node=w),w}u=e instanceof Map?l[Qt]:Symbol.iterator in Object(e)?l[ps]:l[Qt]}i&&(i(u),delete n.onTagObj);const p=u!=null&&u.createNode?u.createNode(n.schema,e,n):typeof((y=u==null?void 0:u.nodeClass)==null?void 0:y.from)=="function"?u.nodeClass.from(n.schema,e,n):new F(e);return t?p.tag=t:u.default||(p.tag=u.tag),c&&(c.node=p),p}function Bi(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 l=[];l[i]=s,s=l}else s=new Map([[i,s]])}return fr(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 _p extends tc{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(ae(i))i.addIn(r,n);else if(i===void 0&&this.schema)this.set(s,Bi(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(ae(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:ae(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 ae(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(ae(i))i.setIn(r,n);else if(i===void 0&&this.schema)this.set(s,Bi(this.schema,r,n));else throw new Error(`Expected YAML collection at ${s}. Remaining path: ${r}`)}}}const b0=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function jt(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const dn=(e,t,n)=>e.endsWith(`
69
+ `)?jt(n,t):n.includes(`
70
+ `)?`
71
+ `+jt(n,t):(e.endsWith(" ")?"":" ")+n,Mp="flow",Zl="block",pi="quoted";function uo(e,t,n="flow",{indentAtStart:s,lineWidth:r=80,minContentWidth:i=20,onFold:l,onOverflow:a}={}){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,y,w=!1,x=-1,v=-1,g=-1;n===Zl&&(x=Ou(e,x,t.length),x!==-1&&(d=x+c));for(let h;h=e[x+=1];){if(n===pi&&h==="\\"){switch(v=x,e[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}g=x}if(h===`
72
+ `)n===Zl&&(x=Ou(e,x,t.length)),d=x+t.length+c,f=void 0;else{if(h===" "&&y&&y!==" "&&y!==`
73
+ `&&y!==" "){const j=e[x+1];j&&j!==" "&&j!==`
74
+ `&&j!==" "&&(f=x)}if(x>=d)if(f)u.push(f),d=f+c,f=void 0;else if(n===pi){for(;y===" "||y===" ";)y=h,h=e[x+=1],w=!0;const j=x>g+1?x-2:v-1;if(p[j])return e;u.push(j),p[j]=!0,d=j+c,f=void 0}else w=!0}y=h}if(w&&a&&a(),u.length===0)return e;l&&l();let m=e.slice(0,u[0]);for(let h=0;h<u.length;++h){const j=u[h],k=u[h+1]||e.length;j===0?m=`
75
+ ${t}${e.slice(0,k)}`:(n===pi&&p[j]&&(m+=`${e[j]}\\`),m+=`
76
+ ${t}${e.slice(j+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 fo=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),po=e=>/^(%|---|\.\.\.)/m.test(e);function w0(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,l=0;i<r;++i)if(e[i]===`
78
+ `){if(i-l>s)return!0;if(l=i+1,r-l<=s)return!1}return!0}function Ks(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:s}=t,r=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(po(e)?" ":"");let l="",a=0;for(let c=0,u=n[c];u;u=n[++c])if(u===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(l+=n.slice(a,c)+"\\ ",c+=1,a=c,u="\\"),u==="\\")switch(n[c+1]){case"u":{l+=n.slice(a,c);const p=n.substr(c+2,4);switch(p){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:p.substr(0,2)==="00"?l+="\\x"+p.substr(2):l+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(s||n[c+2]==='"'||n.length<r)c+=1;else{for(l+=n.slice(a,c)+`
79
+
80
+ `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)l+=`
81
+ `,c+=2;l+=i,n[c+2]===" "&&(l+="\\"),c+=1,a=c+1}break;default:c+=1}return l=a?l+n.slice(a):n,s?l:uo(l,i,pi,fo(t,!1))}function ea(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
82
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Ks(e,t);const n=t.indent||(po(e)?" ":""),s="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
83
+ ${n}`)+"'";return t.implicitKey?s:uo(s,n,Mp,fo(t,!1))}function Hn(e,t){const{singleQuote:n}=t.options;let s;if(n===!1)s=Ks;else{const r=e.includes('"'),i=e.includes("'");r&&!i?s=ea:i&&!r?s=Ks:s=n?ea:Ks}return s(e,t)}let ta;try{ta=new RegExp(`(^|(?<!
84
+ ))
85
+ +(?!
86
+ |$)`,"g")}catch{ta=/\n+(?!\n|$)/g}function hi({comment:e,type:t,value:n},s,r,i){const{blockQuote:l,commentString:a,lineWidth:c}=s.options;if(!l||/\n[\t ]+$/.test(n))return Hn(n,s);const u=s.indent||(s.forceBlockIndent||po(n)?" ":""),p=l==="literal"?!0:l==="folded"||t===F.BLOCK_FOLDED?!1:t===F.BLOCK_LITERAL?!0:!w0(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 y=n.substring(f);const w=y.indexOf(`
90
+ `);w===-1?d="-":n===y||w!==y.length-1?(d="+",i&&i()):d="",y&&(n=n.slice(0,-y.length),y[y.length-1]===`
91
+ `&&(y=y.slice(0,-1)),y=y.replace(ta,`$&${u}`));let x=!1,v,g=-1;for(v=0;v<n.length;++v){const k=n[v];if(k===" ")x=!0;else if(k===`
92
+ `)g=v;else break}let m=n.substring(0,g<v?g+1:v);m&&(n=n.substring(m.length),m=m.replace(/\n+/g,`$&${u}`));let j=(x?u?"2":"1":"")+d;if(e&&(j+=" "+a(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 E=!1;const N=fo(s,!0);l!=="folded"&&t!==F.BLOCK_FOLDED&&(N.onOverflow=()=>{E=!0});const S=uo(`${m}${k}${y}`,u,Zl,N);if(!E)return`>${j}
94
+ ${u}${S}`}return n=n.replace(/\n+/g,`$&${u}`),`|${j}
95
+ ${u}${m}${n}${y}`}function j0(e,t,n,s){const{type:r,value:i}=e,{actualString:l,implicitKey:a,indent:c,indentStep:u,inFlow:p}=t;if(a&&i.includes(`
96
+ `)||p&&/[[\]{},]/.test(i))return Hn(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||p||!i.includes(`
97
+ `)?Hn(i,t):hi(e,t,n,s);if(!a&&!p&&r!==F.PLAIN&&i.includes(`
98
+ `))return hi(e,t,n,s);if(po(i)){if(c==="")return t.forceBlockIndent=!0,hi(e,t,n,s);if(a&&c===u)return Hn(i,t)}const d=i.replace(/\n+/g,`$&
99
+ ${c}`);if(l){const f=x=>{var v;return x.default&&x.tag!=="tag:yaml.org,2002:str"&&((v=x.test)==null?void 0:v.test(d))},{compat:y,tags:w}=t.doc.schema;if(w.some(f)||y!=null&&y.some(f))return Hn(i,t)}return a?d:uo(d,c,Mp,fo(t,!1))}function sc(e,t,n,s){const{implicitKey:r,inFlow:i}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:a}=e;a!==F.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(a=F.QUOTE_DOUBLE);const c=p=>{switch(p){case F.BLOCK_FOLDED:case F.BLOCK_LITERAL:return r||i?Hn(l.value,t):hi(l,t,n,s);case F.QUOTE_DOUBLE:return Ks(l.value,t);case F.QUOTE_SINGLE:return ea(l.value,t);case F.PLAIN:return j0(l,t,n,s);default:return null}};let u=c(a);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 Dp(e,t){const n=Object.assign({blockQuote:!0,commentString:b0,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 k0(e,t){var r;if(t.tag){const i=e.filter(l=>l.tag===t.tag);if(i.length>0)return i.find(l=>l.format===t.format)??i[0]}let n,s;if(Y(t)){s=t.value;let i=e.filter(l=>{var a;return(a=l.identify)==null?void 0:a.call(l,s)});if(i.length>1){const l=i.filter(a=>a.test);l.length>0&&(i=l)}n=i.find(l=>l.format===t.format)??i.find(l=>!l.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 N0(e,t,{anchors:n,doc:s}){if(!s.directives)return"";const r=[],i=(Y(e)||ae(e))&&e.anchor;i&&Ap(i)&&(n.add(i),r.push(`&${i}`));const l=e.tag??(t.default?null:t.tag);return l&&r.push(s.directives.tagString(l)),r.join(" ")}function ls(e,t,n,s){var c;if(ue(e))return e.toString(t,n,s);if(hs(e)){if(t.doc.directives)return e.toString(t);if((c=t.resolvedAliases)!=null&&c.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let r;const i=ce(e)?e:t.doc.createNode(e,{onTagObj:u=>r=u});r??(r=k0(t.doc.schema.tags,i));const l=N0(i,r,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const a=typeof r.stringify=="function"?r.stringify(i,t,n,s):Y(i)?sc(i,t,n,s):i.toString(t,n,s);return l?Y(i)||a[0]==="{"||a[0]==="["?`${l} ${a}`:`${l}
100
+ ${t.indent}${a}`:a}function S0({key:e,value:t},n,s,r){const{allNullValues:i,doc:l,indent:a,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(ae(e)||!ce(e)&&typeof e=="object"){const N="With simple keys, collection cannot be used as a key value";throw new Error(N)}}let y=!d&&(!e||f&&t==null&&!n.inFlow||ae(e)||(Y(e)?e.type===F.BLOCK_FOLDED||e.type===F.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!y&&(d||!i),indent:a+c});let w=!1,x=!1,v=ls(e,n,()=>w=!0,()=>x=!0);if(!y&&!n.inFlow&&v.length>1024){if(d)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");y=!0}if(n.inFlow){if(i||t==null)return w&&s&&s(),v===""?"?":y?`? ${v}`:v}else if(i&&!d||t==null&&y)return v=`? ${v}`,f&&!w?v+=dn(v,n.indent,u(f)):x&&r&&r(),v;w&&(f=null),y?(f&&(v+=dn(v,n.indent,u(f))),v=`? ${v}
101
+ ${a}:`):(v=`${v}:`,f&&(v+=dn(v,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=l.createNode(t))),n.implicitKey=!1,!y&&!f&&Y(t)&&(n.indentAtStart=v.length+1),x=!1,!p&&c.length>=2&&!n.inFlow&&!y&&kr(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let j=!1;const k=ls(t,n,()=>j=!0,()=>x=!0);let E=" ";if(f||g||m){if(E=g?`
102
+ `:"",m){const N=u(m);E+=`
103
+ ${jt(N,n.indent)}`}k===""&&!n.inFlow?E===`
104
+ `&&h&&(E=`
105
+
106
+ `):E+=`
107
+ ${n.indent}`}else if(!y&&ae(t)){const N=k[0],S=k.indexOf(`
108
+ `),T=S!==-1,A=n.inFlow??t.flow??t.items.length===0;if(T||!A){let B=!1;if(T&&(N==="&"||N==="!")){let G=k.indexOf(" ");N==="&"&&G!==-1&&G<S&&k[G+1]==="!"&&(G=k.indexOf(" ",G+1)),(G===-1||S<G)&&(B=!0)}B||(E=`
109
+ ${n.indent}`)}}else(k===""||k[0]===`
110
+ `)&&(E="");return v+=E+k,n.inFlow?j&&s&&s():h&&!j?v+=dn(v,n.indent,u(h)):x&&r&&r(),v}function Rp(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Vr="<<",Nt={identify:e=>e===Vr||typeof e=="symbol"&&e.description===Vr,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new F(Symbol(Vr)),{addToJSMap:$p}),stringify:()=>Vr},C0=(e,t)=>(Nt.identify(t)||Y(t)&&(!t.type||t.type===F.PLAIN)&&Nt.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===Nt.tag&&n.default));function $p(e,t,n){const s=zp(e,n);if(kr(s))for(const r of s.items)Ko(e,t,r);else if(Array.isArray(s))for(const r of s)Ko(e,t,r);else Ko(e,t,s)}function Ko(e,t,n){const s=zp(e,n);if(!jr(s))throw new Error("Merge sources must be maps or map aliases");const r=s.toJSON(null,e,Map);for(const[i,l]of r)t instanceof Map?t.has(i)||t.set(i,l):t instanceof Set?t.add(i):Object.prototype.hasOwnProperty.call(t,i)||Object.defineProperty(t,i,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function zp(e,t){return e&&hs(t)?t.resolve(e.doc,e):t}function Fp(e,t,{key:n,value:s}){if(ce(n)&&n.addToJSMap)n.addToJSMap(e,t,s);else if(C0(e,n))$p(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=E0(n,r,e),l=Ye(s,i,e);i in t?Object.defineProperty(t,i,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[i]=l}}return t}function E0(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(ce(e)&&(n!=null&&n.doc)){const s=Dp(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)+'..."'),Rp(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 rc(e,t,n){const s=fr(e,void 0,n),r=fr(t,void 0,n);return new Ee(s,r)}class Ee{constructor(t,n=null){Object.defineProperty(this,Xe,{value:Tp}),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 Fp(n,s,this)}toString(t,n,s){return t!=null&&t.doc?S0(this,t,n,s):JSON.stringify(this)}}function Bp(e,t,n){return(t.inFlow??e.flow?L0:T0)(e,t,n)}function T0({comment:e,items:t},n,{blockItemPrefix:s,flowChars:r,itemIndent:i,onChompKeep:l,onComment:a}){const{indent:c,options:{commentString:u}}=n,p=Object.assign({},n,{indent:i,type:null});let d=!1;const f=[];for(let w=0;w<t.length;++w){const x=t[w];let v=null;if(ce(x))!d&&x.spaceBefore&&f.push(""),Ui(n,f,x.commentBefore,d),x.comment&&(v=x.comment);else if(ue(x)){const m=ce(x.key)?x.key:null;m&&(!d&&m.spaceBefore&&f.push(""),Ui(n,f,m.commentBefore,d))}d=!1;let g=ls(x,p,()=>v=null,()=>d=!0);v&&(g+=dn(g,i,u(v))),d&&v&&(d=!1),f.push(s+g)}let y;if(f.length===0)y=r.start+r.end;else{y=f[0];for(let w=1;w<f.length;++w){const x=f[w];y+=x?`
111
+ ${c}${x}`:`
112
+ `}}return e?(y+=`
113
+ `+jt(u(e),c),a&&a()):d&&l&&l(),y}function L0({items:e},t,{flowChars:n,itemIndent:s}){const{indent:r,indentStep:i,flowCollectionPadding:l,options:{commentString:a}}=t;s+=i;const c=Object.assign({},t,{indent:s,inFlow:!0,type:null});let u=!1,p=0;const d=[];for(let w=0;w<e.length;++w){const x=e[w];let v=null;if(ce(x))x.spaceBefore&&d.push(""),Ui(t,d,x.commentBefore,!1),x.comment&&(v=x.comment);else if(ue(x)){const m=ce(x.key)?x.key:null;m&&(m.spaceBefore&&d.push(""),Ui(t,d,m.commentBefore,!1),m.comment&&(u=!0));const h=ce(x.value)?x.value:null;h?(h.comment&&(v=h.comment),h.commentBefore&&(u=!0)):x.value==null&&(m!=null&&m.comment)&&(v=m.comment)}v&&(u=!0);let g=ls(x,c,()=>v=null);u||(u=d.length>p||g.includes(`
114
+ `)),w<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+=",")),v&&(g+=dn(g,s,a(v))),d.push(g),p=d.length}const{start:f,end:y}=n;if(d.length===0)return f+y;if(!u){const w=d.reduce((x,v)=>x+v.length+2,2);u=t.options.lineWidth>0&&w>t.options.lineWidth}if(u){let w=f;for(const x of d)w+=x?`
115
+ ${i}${r}${x}`:`
116
+ `;return`${w}
117
+ ${r}${y}`}else return`${f}${l}${d.join(" ")}${l}${y}`}function Ui({indent:e,options:{commentString:t}},n,s,r){if(s&&r&&(s=s.replace(/^\n+/,"")),s){const i=jt(t(s),e);n.push(i.trimStart())}}function fn(e,t){const n=Y(t)?t.value:t;for(const s of e)if(ue(s)&&(s.key===t||s.key===n||Y(s.key)&&s.key.value===n))return s}class Ke extends _p{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(Qt,t),this.items=[]}static from(t,n,s){const{keepUndefined:r,replacer:i}=s,l=new this(t),a=(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)&&l.items.push(rc(c,u,s))};if(n instanceof Map)for(const[c,u]of n)a(c,u);else if(n&&typeof n=="object")for(const c of Object.keys(n))a(c,n[c]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){var l;let s;ue(t)?s=t:!t||typeof t!="object"||!("key"in t)?s=new Ee(t,t==null?void 0:t.value):s=new Ee(t.key,t.value);const r=fn(this.items,s.key),i=(l=this.schema)==null?void 0:l.sortMapEntries;if(r){if(!n)throw new Error(`Key ${s.key} already set`);Y(r.value)&&Pp(s.value)?r.value.value=s.value:r.value=s.value}else if(i){const a=this.items.findIndex(c=>i(s,c)<0);a===-1?this.items.push(s):this.items.splice(a,0,s)}else this.items.push(s)}delete(t){const n=fn(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const s=fn(this.items,t),r=s==null?void 0:s.value;return(!n&&Y(r)?r.value:r)??void 0}has(t){return!!fn(this.items,t)}set(t,n){this.add(new Ee(t,n),!0)}toJSON(t,n,s){const r=s?new s:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(r);for(const i of this.items)Fp(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})),Bp(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:s,onComment:n})}}const gs={collection:"map",default:!0,nodeClass:Ke,tag:"tag:yaml.org,2002:map",resolve(e,t){return jr(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Ke.from(e,t,n)};class bn extends _p{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(ps,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Kr(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const s=Kr(t);if(typeof s!="number")return;const r=this.items[s];return!n&&Y(r)?r.value:r}has(t){const n=Kr(t);return typeof n=="number"&&n<this.items.length}set(t,n){const s=Kr(t);if(typeof s!="number")throw new Error(`Expected a valid index, not ${t}.`);const r=this.items[s];Y(r)&&Pp(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?Bp(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 l=0;for(let a of n){if(typeof r=="function"){const c=n instanceof Set?a:String(l++);a=r.call(n,c,a)}i.items.push(fr(a,void 0,s))}}return i}}function Kr(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 ys={collection:"seq",default:!0,nodeClass:bn,tag:"tag:yaml.org,2002:seq",resolve(e,t){return kr(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>bn.from(e,t,n)},ho={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),sc(e,t,n,s)}},mo={identify:e=>e==null,createNode:()=>new F(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new F(null),stringify:({source:e},t)=>typeof e=="string"&&mo.test.test(e)?e:t.options.nullStr},ic={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new F(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&ic.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 at({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 l=i.indexOf(".");l<0&&(l=i.length,i+=".");let a=t-(i.length-l-1);for(;a-- >0;)i+="0"}return i}const Up={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:at},Wp={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():at(e)}},Hp={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 F(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:at},go=e=>typeof e=="bigint"||Number.isInteger(e),oc=(e,t,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e.substring(t),n);function Vp(e,t,n){const{value:s}=e;return go(s)&&s>=0?n+s.toString(t):at(e)}const Kp={identify:e=>go(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>oc(e,2,8,n),stringify:e=>Vp(e,8,"0o")},Gp={identify:go,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>oc(e,0,10,n),stringify:at},qp={identify:e=>go(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>oc(e,2,16,n),stringify:e=>Vp(e,16,"0x")},A0=[gs,ys,ho,mo,ic,Kp,Gp,qp,Up,Wp,Hp];function Pu(e){return typeof e=="bigint"||Number.isInteger(e)}const Gr=({value:e})=>JSON.stringify(e),I0=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Gr},{identify:e=>e==null,createNode:()=>new F(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Gr},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Gr},{identify:Pu,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})=>Pu(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:Gr}],O0={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},P0=[gs,ys].concat(I0,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 l=n;let a;if(typeof btoa=="function"){let c="";for(let u=0;u<l.length;++u)c+=String.fromCharCode(l[u]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=F.BLOCK_LITERAL),t!==F.QUOTE_DOUBLE){const c=Math.max(s.options.lineWidth-s.indent.length,s.options.minContentWidth),u=Math.ceil(a.length/c),p=new Array(u);for(let d=0,f=0;d<u;++d,f+=c)p[d]=a.substr(f,c);a=p.join(t===F.BLOCK_LITERAL?`
118
+ `:" ")}return sc({comment:e,type:t,value:a},s,r,i)}};function Yp(e,t){if(kr(e))for(let n=0;n<e.items.length;++n){let s=e.items[n];if(!ue(s)){if(jr(s)){s.items.length>1&&t("Each pair must have its own sequence indicator");const r=s.items[0]||new Ee(new F(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 Qp(e,t,n){const{replacer:s}=n,r=new bn(e);r.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof s=="function"&&(l=s.call(t,String(i++),l));let a,c;if(Array.isArray(l))if(l.length===2)a=l[0],c=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const u=Object.keys(l);if(u.length===1)a=u[0],c=l[a];else throw new TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=l;r.items.push(rc(a,c,n))}return r}const ac={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Yp,createNode:Qp};class Jn extends bn{constructor(){super(),this.add=Ke.prototype.add.bind(this),this.delete=Ke.prototype.delete.bind(this),this.get=Ke.prototype.get.bind(this),this.has=Ke.prototype.has.bind(this),this.set=Ke.prototype.set.bind(this),this.tag=Jn.tag}toJSON(t,n){if(!n)return super.toJSON(t);const s=new Map;n!=null&&n.onCreate&&n.onCreate(s);for(const r of this.items){let i,l;if(ue(r)?(i=Ye(r.key,"",n),l=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,l)}return s}static from(t,n,s){const r=Qp(t,n,s),i=new this;return i.items=r.items,i}}Jn.tag="tag:yaml.org,2002:omap";const cc={collection:"seq",identify:e=>e instanceof Map,nodeClass:Jn,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=Yp(e,t),s=[];for(const{key:r}of n.items)Y(r)&&(s.includes(r.value)?t(`Ordered maps must not include duplicate keys: ${r.value}`):s.push(r.value));return Object.assign(new Jn,n)},createNode:(e,t,n)=>Jn.from(e,t,n)};function Jp({value:e,source:t},n){return t&&(e?Xp:Zp).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const Xp={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 F(!0),stringify:Jp},Zp={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 F(!1),stringify:Jp},_0={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:at},M0={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():at(e)}},D0={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 F(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:at},Nr=e=>typeof e=="bigint"||Number.isInteger(e);function yo(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 l=BigInt(e);return r==="-"?BigInt(-1)*l:l}const i=parseInt(e,n);return r==="-"?-1*i:i}function uc(e,t,n){const{value:s}=e;if(Nr(s)){const r=s.toString(t);return s<0?"-"+n+r.substr(1):n+r}return at(e)}const R0={identify:Nr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>yo(e,2,2,n),stringify:e=>uc(e,2,"0b")},$0={identify:Nr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>yo(e,1,8,n),stringify:e=>uc(e,8,"0")},z0={identify:Nr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>yo(e,0,10,n),stringify:at},F0={identify:Nr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>yo(e,2,16,n),stringify:e=>uc(e,16,"0x")};class Xn extends Ke{constructor(t){super(t),this.tag=Xn.tag}add(t){let n;ue(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Ee(t.key,null):n=new Ee(t,null),fn(this.items,n.key)||this.items.push(n)}get(t,n){const s=fn(this.items,t);return!n&&ue(s)?Y(s.key)?s.key.value:s.key:s}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const s=fn(this.items,t);s&&!n?this.items.splice(this.items.indexOf(s),1):!s&&n&&this.items.push(new Ee(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,s){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,s);throw new Error("Set items must all have null values")}static from(t,n,s){const{replacer:r}=s,i=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof r=="function"&&(l=r.call(n,l,l)),i.items.push(rc(l,null,s));return i}}Xn.tag="tag:yaml.org,2002:set";const dc={collection:"map",identify:e=>e instanceof Set,nodeClass:Xn,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>Xn.from(e,t,n),resolve(e,t){if(jr(e)){if(e.hasAllNullValues(!0))return Object.assign(new Xn,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function fc(e,t){const n=e[0],s=n==="-"||n==="+"?e.substring(1):e,r=l=>t?BigInt(l):Number(l),i=s.replace(/_/g,"").split(":").reduce((l,a)=>l*r(60)+r(a),r(0));return n==="-"?r(-1)*i:i}function eh(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return at(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(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const th={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})=>fc(e,n),stringify:eh},nh={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=>fc(e,!1),stringify:eh},xo={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(xo.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,s,r,i,l,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0;let u=Date.UTC(n,s-1,r,i||0,l||0,a||0,c);const p=t[8];if(p&&p!=="Z"){let d=fc(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$/,""))??""},_u=[gs,ys,ho,mo,Xp,Zp,R0,$0,z0,F0,_0,M0,D0,lc,Nt,cc,ac,dc,th,nh,xo],Mu=new Map([["core",A0],["failsafe",[gs,ys,ho]],["json",P0],["yaml11",_u],["yaml-1.1",_u]]),Du={binary:lc,bool:ic,float:Hp,floatExp:Wp,floatNaN:Up,floatTime:nh,int:Gp,intHex:qp,intOct:Kp,intTime:th,map:gs,merge:Nt,null:mo,omap:cc,pairs:ac,seq:ys,set:dc,timestamp:xo},B0={"tag:yaml.org,2002:binary":lc,"tag:yaml.org,2002:merge":Nt,"tag:yaml.org,2002:omap":cc,"tag:yaml.org,2002:pairs":ac,"tag:yaml.org,2002:set":dc,"tag:yaml.org,2002:timestamp":xo};function Go(e,t,n){const s=Mu.get(t);if(s&&!e)return n&&!s.includes(Nt)?s.concat(Nt):s.slice();let r=s;if(!r)if(Array.isArray(e))r=[];else{const i=Array.from(Mu.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).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(Nt)),r.reduce((i,l)=>{const a=typeof l=="string"?Du[l]:l;if(!a){const c=JSON.stringify(l),u=Object.keys(Du).map(p=>JSON.stringify(p)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${u}`)}return i.includes(a)||i.push(a),i},[])}const U0=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class pc{constructor({compat:t,customTags:n,merge:s,resolveKnownTags:r,schema:i,sortMapEntries:l,toStringDefaults:a}){this.compat=Array.isArray(t)?Go(t,"compat"):t?Go(null,t):null,this.name=typeof i=="string"&&i||"core",this.knownTags=r?B0:{},this.tags=Go(n,this.name,s),this.toStringOptions=a??null,Object.defineProperty(this,Qt,{value:gs}),Object.defineProperty(this,yt,{value:ho}),Object.defineProperty(this,ps,{value:ys}),this.sortMapEntries=typeof l=="function"?l:l===!0?U0:null}clone(){const t=Object.create(pc.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}function W0(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=Dp(e,t),{commentString:i}=r.options;if(e.commentBefore){n.length!==1&&n.unshift("");const u=i(e.commentBefore);n.unshift(jt(u,""))}let l=!1,a=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(jt(d,""))}r.forceBlockIndent=!!e.comment,a=e.contents.comment}const u=a?void 0:()=>l=!0;let p=ls(e.contents,r,()=>a=null,u);a&&(p+=dn(p,"",i(a))),(p[0]==="|"||p[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${p}`:n.push(p)}else n.push(ls(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(jt(u,""))):n.push(`... ${u}`)}else n.push("...");else{let u=e.comment;u&&l&&(u=u.replace(/^\n+/,"")),u&&((!l||a)&&n[n.length-1]!==""&&n.push(""),n.push(jt(i(u),"")))}return n.join(`
122
+ `)+`
123
+ `}class Sr{constructor(t,n,s){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Xe,{value:Xl});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:l}=i;s!=null&&s._directives?(this.directives=s._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new Se({version:l}),this.setSchema(l,s),this.contents=t===void 0?null:this.createNode(t,r,s)}clone(){const t=Object.create(Sr.prototype,{[Xe]:{value:Xl}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=ce(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){Cn(this.contents)&&this.contents.add(t)}addIn(t,n){Cn(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const s=Ip(this);t.anchor=!n||s.has(n)?Op(n||"a",s):n}return new nc(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 v=m=>typeof m=="number"||m instanceof String||m instanceof Number,g=n.filter(v).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:l,flow:a,keepUndefined:c,onTagObj:u,tag:p}=s??{},{onAnchor:d,setAnchors:f,sourceObjects:y}=y0(this,l||"a"),w={aliasDuplicateObjects:i??!0,keepUndefined:c??!1,onAnchor:d,onTagObj:u,replacer:r,schema:this.schema,sourceObjects:y},x=fr(t,p,w);return a&&ae(x)&&(x.flow=!0),f(),x}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 Cn(this.contents)?this.contents.delete(t):!1}deleteIn(t){return _s(t)?this.contents==null?!1:(this.contents=null,!0):Cn(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ae(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return _s(t)?!n&&Y(this.contents)?this.contents.value:this.contents:ae(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ae(this.contents)?this.contents.has(t):!1}hasIn(t){return _s(t)?this.contents!==void 0:ae(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=Bi(this.schema,[t],n):Cn(this.contents)&&this.contents.set(t,n)}setIn(t,n){_s(t)?this.contents=n:this.contents==null?this.contents=Bi(this.schema,Array.from(t),n):Cn(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let s;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Se({version:"1.1"}),s={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new Se({version:t}),s={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,s=null;break;default:{const r=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(s)this.schema=new pc(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:l}={}){const a={anchors:new Map,doc:this,keep:!t,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},c=Ye(this.contents,n??"",a);if(typeof i=="function")for(const{count:u,res:p}of a.anchors.values())i(p,u);return typeof l=="function"?Wn(l,{"":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 W0(this,t)}}function Cn(e){if(ae(e))return!0;throw new Error("Expected a YAML collection as document contents")}class sh extends Error{constructor(t,n,s,r){super(),this.name=t,this.code=s,this.message=r,this.pos=n}}class Ms extends sh{constructor(t,n,s){super("YAMLParseError",t,n,s)}}class H0 extends sh{constructor(t,n,s){super("YAMLWarning",t,n,s)}}const Ru=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>t.linePos(a));const{line:s,col:r}=n.linePos[0];n.message+=` at line ${s}, column ${r}`;let i=r-1,l=e.substring(t.lineStarts[s-1],t.lineStarts[s]).replace(/[\n\r]+$/,"");if(i>=60&&l.length>80){const a=Math.min(i-39,l.length-79);l="…"+l.substring(a),i-=a-1}if(l.length>80&&(l=l.substring(0,79)+"…"),s>1&&/^ *$/.test(l.substring(0,i))){let a=e.substring(t.lineStarts[s-2],t.lineStarts[s-1]);a.length>80&&(a=a.substring(0,79)+`…
124
+ `),l=a+l}if(/[^ ]/.test(l)){let a=1;const c=n.linePos[1];(c==null?void 0:c.line)===s&&c.col>r&&(a=Math.max(1,Math.min(c.col-r,80-i)));const u=" ".repeat(i)+"^".repeat(a);n.message+=`:
125
+
126
+ ${l}
127
+ ${u}
128
+ `}};function as(e,{flow:t,indicator:n,next:s,offset:r,onError:i,parentIndent:l,startOnNewline:a}){let c=!1,u=a,p=a,d="",f="",y=!1,w=!1,x=null,v=null,g=null,m=null,h=null,j=null,k=null;for(const S of e)switch(w&&(S.type!=="space"&&S.type!=="newline"&&S.type!=="comma"&&i(S.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),w=!1),x&&(u&&S.type!=="comment"&&S.type!=="newline"&&i(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),S.type){case"space":!t&&(n!=="doc-start"||(s==null?void 0:s.type)!=="flow-collection")&&S.source.includes(" ")&&(x=S),p=!0;break;case"comment":{p||i(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const T=S.source.substring(1)||" ";d?d+=f+T:d=T,f="",u=!1;break}case"newline":u?d?d+=S.source:(!j||n!=="seq-item-ind")&&(c=!0):f+=S.source,u=!0,y=!0,(v||g)&&(m=S),p=!0;break;case"anchor":v&&i(S,"MULTIPLE_ANCHORS","A node can have at most one anchor"),S.source.endsWith(":")&&i(S.offset+S.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=S,k??(k=S.offset),u=!1,p=!1,w=!0;break;case"tag":{g&&i(S,"MULTIPLE_TAGS","A node can have at most one tag"),g=S,k??(k=S.offset),u=!1,p=!1,w=!0;break}case n:(v||g)&&i(S,"BAD_PROP_ORDER",`Anchors and tags must be after the ${S.source} indicator`),j&&i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.source} in ${t??"collection"}`),j=S,u=n==="seq-item-ind"||n==="explicit-key-ind",p=!1;break;case"comma":if(t){h&&i(S,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),h=S,u=!1,p=!1;break}default:i(S,"UNEXPECTED_TOKEN",`Unexpected ${S.type} token`),u=!1,p=!1}const E=e[e.length-1],N=E?E.offset+E.source.length:r;return w&&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"),x&&(u&&x.indent<=l||(s==null?void 0:s.type)==="block-map"||(s==null?void 0:s.type)==="block-seq")&&i(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:h,found:j,spaceBefore:c,comment:d,hasNewline:y,anchor:v,tag:g,newlineAfterProp:m,end:N,start:k??N}}function pr(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(pr(t.key)||pr(t.value))return!0}return!1;default:return!0}}function na(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const s=t.end[0];s.indent===e&&(s.source==="]"||s.source==="}")&&pr(t)&&n(s,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function rh(e,t,n){const{uniqueKeys:s}=e.options;if(s===!1)return!1;const r=typeof s=="function"?s:(i,l)=>i===l||Y(i)&&Y(l)&&i.value===l.value;return t.some(i=>r(i.key,n))}const $u="All mapping items must start at the same column";function V0({composeNode:e,composeEmptyNode:t},n,s,r,i){var p;const l=(i==null?void 0:i.nodeClass)??Ke,a=new l(n.schema);n.atRoot&&(n.atRoot=!1);let c=s.offset,u=null;for(const d of s.items){const{start:f,key:y,sep:w,value:x}=d,v=as(f,{indicator:"explicit-key-ind",next:y??(w==null?void 0:w[0]),offset:c,onError:r,parentIndent:s.indent,startOnNewline:!0}),g=!v.found;if(g){if(y&&(y.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==s.indent&&r(c,"BAD_INDENT",$u)),!v.anchor&&!v.tag&&!w){u=v.end,v.comment&&(a.comment?a.comment+=`
130
+ `+v.comment:a.comment=v.comment);continue}(v.newlineAfterProp||pr(y))&&r(y??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((p=v.found)==null?void 0:p.indent)!==s.indent&&r(c,"BAD_INDENT",$u);n.atKey=!0;const m=v.end,h=y?e(n,y,v,r):t(n,m,f,null,v,r);n.schema.compat&&na(s.indent,y,r),n.atKey=!1,rh(n,a.items,h)&&r(m,"DUPLICATE_KEY","Map keys must be unique");const j=as(w??[],{indicator:"map-value-ind",next:x,offset:h.range[2],onError:r,parentIndent:s.indent,startOnNewline:!y||y.type==="block-scalar"});if(c=j.end,j.found){g&&((x==null?void 0:x.type)==="block-map"&&!j.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&v.start<j.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=x?e(n,x,j,r):t(n,c,w,null,j,r);n.schema.compat&&na(s.indent,x,r),c=k.range[2];const E=new Ee(h,k);n.options.keepSourceTokens&&(E.srcToken=d),a.items.push(E)}else{g&&r(h.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),j.comment&&(h.comment?h.comment+=`
131
+ `+j.comment:h.comment=j.comment);const k=new Ee(h);n.options.keepSourceTokens&&(k.srcToken=d),a.items.push(k)}}return u&&u<c&&r(u,"IMPOSSIBLE","Map comment with trailing content"),a.range=[s.offset,c,u??c],a}function K0({composeNode:e,composeEmptyNode:t},n,s,r,i){const l=(i==null?void 0:i.nodeClass)??bn,a=new l(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&&(a.comment=f.comment);continue}const y=d?e(n,d,f,r):t(n,f.end,p,null,f,r);n.schema.compat&&na(s.indent,d,r),c=y.range[2],a.items.push(y)}return a.range=[s.offset,c,u??c],a}function Cr(e,t,n,s){let r="";if(e){let i=!1,l="";for(const a of e){const{source:c,type:u}=a;switch(u){case"space":i=!0;break;case"comment":{n&&!i&&s(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const p=c.substring(1)||" ";r?r+=l+p:r=p,l="";break}case"newline":r&&(l+=c),i=!0;break;default:s(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:r,offset:t}}const qo="Block collections are not allowed within flow collections",Yo=e=>e&&(e.type==="block-map"||e.type==="block-seq");function G0({composeNode:e,composeEmptyNode:t},n,s,r,i){var v;const l=s.start.source==="{",a=l?"flow map":"flow sequence",c=(i==null?void 0:i.nodeClass)??(l?Ke:bn),u=new c(n.schema);u.flow=!0;const p=n.atRoot;p&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let d=s.offset+s.start.source.length;for(let g=0;g<s.items.length;++g){const m=s.items[g],{start:h,key:j,sep:k,value:E}=m,N=as(h,{flow:a,indicator:"explicit-key-ind",next:j??(k==null?void 0:k[0]),offset:d,onError:r,parentIndent:s.indent,startOnNewline:!1});if(!N.found){if(!N.anchor&&!N.tag&&!k&&!E){g===0&&N.comma?r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):g<s.items.length-1&&r(N.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),N.comment&&(u.comment?u.comment+=`
132
+ `+N.comment:u.comment=N.comment),d=N.end;continue}!l&&n.options.strict&&pr(j)&&r(j,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(g===0)N.comma&&r(N.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(N.comma||r(N.start,"MISSING_CHAR",`Missing , between ${a} items`),N.comment){let S="";e:for(const T of h)switch(T.type){case"comma":case"space":break;case"comment":S=T.source.substring(1);break e;default:break e}if(S){let T=u.items[u.items.length-1];ue(T)&&(T=T.value??T.key),T.comment?T.comment+=`
133
+ `+S:T.comment=S,N.comment=N.comment.substring(S.length+1)}}if(!l&&!k&&!N.found){const S=E?e(n,E,N,r):t(n,N.end,k,null,N,r);u.items.push(S),d=S.range[2],Yo(E)&&r(S.range,"BLOCK_IN_FLOW",qo)}else{n.atKey=!0;const S=N.end,T=j?e(n,j,N,r):t(n,S,h,null,N,r);Yo(j)&&r(T.range,"BLOCK_IN_FLOW",qo),n.atKey=!1;const A=as(k??[],{flow:a,indicator:"map-value-ind",next:E,offset:T.range[2],onError:r,parentIndent:s.indent,startOnNewline:!1});if(A.found){if(!l&&!N.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}}N.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 E&&("source"in E&&((v=E.source)==null?void 0:v[0])===":"?r(E,"MISSING_CHAR",`Missing space after : in ${a}`):r(A.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const B=E?e(n,E,A,r):A.found?t(n,A.end,k,null,A,r):null;B?Yo(E)&&r(B.range,"BLOCK_IN_FLOW",qo):A.comment&&(T.comment?T.comment+=`
134
+ `+A.comment:T.comment=A.comment);const G=new Ee(T,B);if(n.options.keepSourceTokens&&(G.srcToken=m),l){const V=u;rh(n,V.items,T)&&r(S,"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 C=(B??T).range;V.range=[T.range[0],C[1],C[2]],u.items.push(V)}d=B?B.range[2]:A.end}}const f=l?"}":"]",[y,...w]=s.end;let x=d;if((y==null?void 0:y.source)===f)x=y.offset+y.source.length;else{const g=a[0].toUpperCase()+a.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),y&&y.source.length!==1&&w.unshift(y)}if(w.length>0){const g=Cr(w,x,n.options.strict,r);g.comment&&(u.comment?u.comment+=`
135
+ `+g.comment:u.comment=g.comment),u.range=[s.offset,x,g.offset]}else u.range=[s.offset,x,x];return u}function Qo(e,t,n,s,r,i){const l=n.type==="block-map"?V0(e,t,n,s,i):n.type==="block-seq"?K0(e,t,n,s,i):G0(e,t,n,s,i),a=l.constructor;return r==="!"||r===a.tagName?(l.tag=a.tagName,l):(r&&(l.tag=r),l)}function q0(e,t,n,s,r){var f;const i=s.tag,l=i?t.directives.tagName(i.source,y=>r(i,"TAG_RESOLVE_FAILED",y)):null;if(n.type==="block-seq"){const{anchor:y,newlineAfterProp:w}=s,x=y&&i?y.offset>i.offset?y:i:y??i;x&&(!w||w.offset<x.offset)&&r(x,"MISSING_CHAR","Missing newline after block sequence props")}const a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!i||!l||l==="!"||l===Ke.tagName&&a==="map"||l===bn.tagName&&a==="seq")return Qo(e,t,n,r,l);let c=t.schema.tags.find(y=>y.tag===l&&y.collection===a);if(!c){const y=t.schema.knownTags[l];if((y==null?void 0:y.collection)===a)t.schema.tags.push(Object.assign({},y,{default:!1})),c=y;else return y?r(i,"BAD_COLLECTION_TYPE",`${y.tag} used for ${a} collection, but expects ${y.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Qo(e,t,n,r,l)}const u=Qo(e,t,n,r,l,c),p=((f=c.resolve)==null?void 0:f.call(c,u,y=>r(i,"TAG_RESOLVE_FAILED",y),t.options))??u,d=ce(p)?p:new F(p);return d.range=u.range,d.tag=l,c!=null&&c.format&&(d.format=c.format),d}function Y0(e,t,n){const s=t.offset,r=Q0(t,e.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[s,s,s]};const i=r.mode===">"?F.BLOCK_FOLDED:F.BLOCK_LITERAL,l=t.source?J0(t.source):[];let a=l.length;for(let x=l.length-1;x>=0;--x){const v=l[x][1];if(v===""||v==="\r")a=x;else break}if(a===0){const x=r.chomp==="+"&&l.length>0?`
136
+ `.repeat(Math.max(1,l.length-1)):"";let v=s+r.length;return t.source&&(v+=t.source.length),{value:x,type:i,comment:r.comment,range:[s,v,v]}}let c=t.indent+r.indent,u=t.offset+r.length,p=0;for(let x=0;x<a;++x){const[v,g]=l[x];if(g===""||g==="\r")r.indent===0&&v.length>c&&(c=v.length);else{v.length<c&&n(u+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(c=v.length),p=x,c===0&&!e.atRoot&&n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=v.length+g.length+1}for(let x=l.length-1;x>=a;--x)l[x][0].length>c&&(a=x+1);let d="",f="",y=!1;for(let x=0;x<p;++x)d+=l[x][0].slice(c)+`
137
+ `;for(let x=p;x<a;++x){let[v,g]=l[x];u+=v.length+g.length+1;const m=g[g.length-1]==="\r";if(m&&(g=g.slice(0,-1)),g&&v.length<c){const j=`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",j),v=""}i===F.BLOCK_LITERAL?(d+=f+v.slice(c)+g,f=`
138
+ `):v.length>c||g[0]===" "?(f===" "?f=`
139
+ `:!y&&f===`
140
+ `&&(f=`
141
+
142
+ `),d+=f+v.slice(c)+g,f=`
143
+ `,y=!0):g===""?f===`
144
+ `?d+=`
145
+ `:f=`
146
+ `:(d+=f+g,f=" ",y=!1)}switch(r.chomp){case"-":break;case"+":for(let x=a;x<l.length;++x)d+=`
147
+ `+l[x][0].slice(c);d[d.length-1]!==`
148
+ `&&(d+=`
149
+ `);break;default:d+=`
150
+ `}const w=s+r.length+t.source.length;return{value:d,type:i,comment:r.comment,range:[s,w,w]}}function Q0({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 l=0,a="",c=-1;for(let f=1;f<r.length;++f){const y=r[f];if(!a&&(y==="-"||y==="+"))a=y;else{const w=Number(y);!l&&w?l=w: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 y=t[f];switch(y.type){case"space":u=!0;case"newline":d+=y.source.length;break;case"comment":n&&!u&&s(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),d+=y.source.length,p=y.source.substring(1);break;case"error":s(y,"UNEXPECTED_TOKEN",y.message),d+=y.source.length;break;default:{const w=`Unexpected token in block scalar header: ${y.type}`;s(y,"UNEXPECTED_TOKEN",w);const x=y.source;x&&typeof x=="string"&&(d+=x.length)}}}return{mode:i,indent:l,chomp:a,comment:p,length:d}}function J0(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 l=1;l<t.length;l+=2)i.push([t[l],t[l+1]]);return i}function X0(e,t,n){const{offset:s,type:r,source:i,end:l}=e;let a,c;const u=(f,y,w)=>n(s+f,y,w);switch(r){case"scalar":a=F.PLAIN,c=Z0(i,u);break;case"single-quoted-scalar":a=F.QUOTE_SINGLE,c=ex(i,u);break;case"double-quoted-scalar":a=F.QUOTE_DOUBLE,c=tx(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=Cr(l,p,t,n);return{value:c,type:a,comment:d.comment,range:[s,p,d.offset]}}function Z0(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}`),ih(e)}function ex(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),ih(e.slice(1,-1)).replace(/''/g,"'")}function ih(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=" ",l=t.lastIndex;for(n.lastIndex=l;s=n.exec(e);)s[1]===""?i===`
153
+ `?r+=i:i=`
154
+ `:(r+=i+s[1],i=" "),l=n.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=l,s=a.exec(e),r+i+((s==null?void 0:s[1])??"")}function tx(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:l}=nx(e,s);n+=i,s=l}else if(r==="\\"){let i=e[++s];const l=sx[i];if(l)n+=l;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 a=i==="x"?2:i==="u"?4:8;n+=rx(e,s+1,a,t),s+=a}else{const a=e.substr(s-1,2);t(s-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(r===" "||r===" "){const i=s;let l=e[s+1];for(;l===" "||l===" ";)l=e[++s+1];l!==`
159
+ `&&!(l==="\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 nx(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 sx={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
165
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function rx(e,t,n,s){const r=e.substr(t,n),l=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(l)}catch{const a=e.substr(t-2,n+2);return s(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}function oh(e,t,n,s){const{value:r,type:i,comment:l,range:a}=t.type==="block-scalar"?Y0(e,t,s):X0(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[yt]:c?u=ix(e.schema,r,c,n,s):t.type==="scalar"?u=ox(e,r,t,s):u=e.schema[yt];let p;try{const d=u.resolve(r,f=>s(n??t,"TAG_RESOLVE_FAILED",f),e.options);p=Y(d)?d:new F(d)}catch(d){const f=d instanceof Error?d.message:String(d);s(n??t,"TAG_RESOLVE_FAILED",f),p=new F(r)}return p.range=a,p.source=r,i&&(p.type=i),c&&(p.tag=c),u.format&&(p.format=u.format),l&&(p.comment=l),p}function ix(e,t,n,s,r){var a;if(n==="!")return e[yt];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((a=c.test)!=null&&a.test(t))return c;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[yt])}function ox({atKey:e,directives:t,schema:n},s,r,i){const l=n.tags.find(a=>{var c;return(a.default===!0||e&&a.default==="key")&&((c=a.test)==null?void 0:c.test(s))})||n[yt];if(n.compat){const a=n.compat.find(c=>{var u;return c.default&&((u=c.test)==null?void 0:u.test(s))})??n[yt];if(l.tag!==a.tag){const c=t.tagString(l.tag),u=t.tagString(a.tag),p=`Value may be parsed as either ${c} or ${u}`;i(r,"TAG_RESOLVE_FAILED",p,!0)}}return l}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 ax={composeNode:lh,composeEmptyNode:hc};function lh(e,t,n,s){const r=e.atKey,{spaceBefore:i,comment:l,anchor:a,tag:c}=n;let u,p=!0;switch(t.type){case"alias":u=cx(e,t,s),(a||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=oh(e,t,c,s),a&&(u.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{u=q0(ax,e,t,n,s),a&&(u.anchor=a.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=hc(e,t.offset,void 0,null,n,s)),a&&u.anchor===""&&s(a,"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),l&&(t.type==="scalar"&&t.source===""?u.comment=l:u.commentBefore=l),e.options.keepSourceTokens&&p&&(u.srcToken=t),u}function hc(e,t,n,s,{spaceBefore:r,comment:i,anchor:l,tag:a,end:c},u){const p={type:"scalar",offset:lx(t,n,s),indent:-1,source:""},d=oh(e,p,a,u);return l&&(d.anchor=l.source.substring(1),d.anchor===""&&u(l,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(d.spaceBefore=!0),i&&(d.comment=i,d.range[2]=c),d}function cx({options:e},{offset:t,source:n,end:s},r){const i=new nc(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 l=t+n.length,a=Cr(s,l,e.strict,r);return i.range=[t,l,a.offset],a.comment&&(i.comment=a.comment),i}function ux(e,t,{offset:n,start:s,value:r,end:i},l){const a=Object.assign({_directives:t},e),c=new Sr(void 0,a),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:l,parentIndent:0,startOnNewline:!0});p.found&&(c.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!p.hasNewline&&l(p.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=r?lh(u,r,p,l):hc(u,p.end,s,null,p,l);const d=c.contents.range[2],f=Cr(i,d,!1,l);return f.comment&&(c.comment=f.comment),c.range=[n,d,f.offset],c}function Ts(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 zu(e){var r;let t="",n=!1,s=!1;for(let i=0;i<e.length;++i){const l=e[i];switch(l[0]){case"#":t+=(t===""?"":s?`
166
+
167
+ `:`
168
+ `)+(l.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 dx{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,s,r,i)=>{const l=Ts(n);i?this.warnings.push(new H0(l,s,r)):this.errors.push(new Ms(l,s,r))},this.directives=new Se({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:s,afterEmptyLine:r}=zu(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(ae(i)&&!i.flow&&i.items.length>0){let l=i.items[0];ue(l)&&(l=l.key);const a=l.commentBefore;l.commentBefore=a?`${s}
170
+ ${a}`:s}else{const l=i.commentBefore;i.commentBefore=l?`${s}
171
+ ${l}`: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:zu(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=Ts(t);i[0]+=n,this.onError(i,"BAD_DIRECTIVE",s,r)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=ux(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(Ts(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(Ts(t),"UNEXPECTED_TOKEN",s));break}this.doc.directives.docEnd=!0;const n=Cr(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(Ts(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 Sr(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 ah="\uFEFF",ch="",uh="",sa="";function fx(e){switch(e){case ah:return"byte-order-mark";case ch:return"doc-mode";case uh:return"flow-error-end";case sa: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 Fu=new Set("0123456789ABCDEFabcdef"),px=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),qr=new Set(",[]{}"),hx=new Set(` ,[]{}
176
+ \r `),Jo=e=>!e||hx.has(e);class mx{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]===ah&&(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 ch,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(Jo),"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 uh,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(Jo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||tt(l)||l===",")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 l=this.buffer[i+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
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,l=this.buffer[i];l==="\r"&&(l=this.buffer[--i]);const a=i;for(;l===" ";)l=this.buffer[--i];if(l===`
188
+ `&&i>=this.pos&&i+1+n>a)t=i;else break}while(!0);return yield sa,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&&qr.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&&qr.has(i))break;if(r===`
191
+ `){const l=this.continueScalar(s+1);if(l===-1)break;s=Math.max(s,l-2)}}else{if(t&&qr.has(r))break;n=s}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield sa,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(Jo),t+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const n=this.flowLevel>0,s=this.charAt(1);if(tt(s)||n&&qr.has(s)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,t+=yield*this.pushCount(1),t+=yield*this.pushSpaces(!0);continue e}}}break e}return t}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!tt(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(px.has(n))n=this.buffer[++t];else if(n==="%"&&Fu.has(this.buffer[t+1])&&Fu.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 gx{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 Mt(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Bu(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 dh(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 Yr(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function En(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function Wi(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 Uu(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!Mt(t.start,"explicit-key-ind")&&!Mt(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,dh(t.value)?t.value.end?Wi(t.value.end,t.sep):t.value.end=t.sep:Wi(t.start,t.sep),delete t.sep)}class yx{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 mx,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=fx(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"&&Uu(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&&Bu(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":{Bu(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=Yr(this.peek(2)),s=En(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)){Wi(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 l=[];if(i&&n.sep&&!n.value){const a=[];for(let c=0;c<n.sep.length;++c){const u=n.sep[c];switch(u.type){case"newline":a.push(c);break;case"space":break;case"comment":u.indent>t.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(l=n.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(l.push(this.sourceToken),t.items.push({start:l}),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?(l.push(this.sourceToken),t.items.push({start:l,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Mt(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]});else if(dh(n.key)&&!Mt(n.sep,"newline")){const a=En(n.start),c=n.key,u=n.sep;u.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:c,sep:u}]})}else l.length>0?n.sep=n.sep.concat(l,this.sourceToken):n.sep.push(this.sourceToken);else if(Mt(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const a=En(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?t.items.push({start:l,key:null,sep:[this.sourceToken]}):Mt(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);i||n.value?(t.items.push({start:l,key:a,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(a):(Object.assign(n,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(t);if(a){if(a.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Mt(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&t.items.push({start:l});this.stack.push(a);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)){Wi(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||Mt(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const r=this.startBlockValue(t);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let s;do yield*this.pop(),s=this.peek(1);while((s==null?void 0:s.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const s=this.startBlockValue(t);s?this.stack.push(s):(yield*this.pop(),yield*this.step())}else{const s=this.peek(2);if(s.type==="block-map"&&(this.type==="map-value-ind"&&s.indent===t.indent||this.type==="newline"&&!s.items[s.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&s.type!=="flow-collection"){const r=Yr(s),i=En(r);Uu(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const a={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:i,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}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=Yr(t),s=En(n);return s.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Yr(t),s=En(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(s=>s.type==="newline"||s.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function xx(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new gx||null,prettyErrors:t}}function vx(e,t={}){const{lineCounter:n,prettyErrors:s}=xx(t),r=new yx(n==null?void 0:n.addNewLine),i=new dx(t);let l=null;for(const a of i.compose(r.parse(e),!0,e.length))if(!l)l=a;else if(l.options.logLevel!=="silent"){l.errors.push(new Ms(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return s&&n&&(l.errors.forEach(Ru(e,n)),l.warnings.forEach(Ru(e,n))),l}function bx(e,t,n){let s;const r=vx(e,n);if(!r)return null;if(r.warnings.forEach(i=>Rp(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 wx(e,t,n){let s=null;if(Array.isArray(t)&&(s=t),e===void 0){const{keepUndefined:r}={};if(!r)return}return wr(e)&&!s?e.toString(n):new Sr(e,s,n).toString(n)}const jx=new Set(["daemon.host","daemon.port","app.port"]),kx=["js_evaluate","cookie_write"];function Wu(e){const t=e.daemon??{},n=e.security??{},s=e.connectors??{},r=e.audit??{},i=e.output??{},l=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??[...kx],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(l.port??9092)}}}function Nx(e){return{daemon:{...e.daemon},security:{...e.security},connectors:{...e.connectors},audit:{...e.audit},output:{...e.output},app:{...e.app}}}function Sx(){const[e,t]=b.useState(null),[n,s]=b.useState(null),[r,i]=b.useState([]),[l,a]=b.useState(!0),[c,u]=b.useState(!1),[p,d]=b.useState(null),[f,y]=b.useState(!1),[w,x]=b.useState(""),[v,g]=b.useState(!1),[m,h]=b.useState("");b.useEffect(()=>{Promise.all([z.getConfig(),z.getConnectors()]).then(([C,M])=>{const O=Wu(C.config);t(O),s(structuredClone(O)),i(M.connectors)}).catch(()=>{t(null),s(null)}).finally(()=>a(!1))},[]);const j=b.useMemo(()=>!e||!n?!1:JSON.stringify(e)!==JSON.stringify(n),[e,n]),k=b.useMemo(()=>{if(!e||!n)return 0;let C=0;for(const M of Object.keys(n)){const O=e[M],R=n[M];for(const L of Object.keys(R))JSON.stringify(O[L])!==JSON.stringify(R[L])&&C++}return C},[e,n]),E=b.useCallback(async()=>{if(!e||!n)return;if(!n.daemon.host.trim()){d({type:"error",msg:"Daemon host cannot be empty."});return}u(!0),d(null);let C=!1;try{for(const M of Object.keys(n)){const O=e[M],R=n[M];for(const L of Object.keys(R)){const P=JSON.stringify(R[L]),D=JSON.stringify(O[L]??null);if(P!==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 z.setConfig($,De),jx.has($)&&(C=!0)}}}t(structuredClone(n)),d({type:"success",msg:"Configuration saved."}),C&&y(!0)}catch(M){d({type:"error",msg:M instanceof Error?M.message:"Save failed"})}finally{u(!1),setTimeout(()=>d(null),3e3)}},[e,n]),N=b.useCallback(()=>{e&&s(structuredClone(e))},[e]),S=b.useCallback(()=>{!v&&n&&(x(wx(Nx(n))),h("")),g(!v)},[v,n]),T=b.useCallback(()=>{try{const C=bx(w);if(!C||typeof C!="object")throw new Error("Invalid YAML");s(Wu(C)),h("")}catch(C){h(C instanceof Error?C.message:"Invalid YAML")}},[w]),A=b.useCallback((C,M,O)=>{s(R=>R&&{...R,[C]:{...R[C],[M]:O}})},[]),B=b.useCallback((C,M,O)=>{s(R=>{if(!R)return R;const L=R[C],P=L[M]??[];return P.includes(O)?R:{...R,[C]:{...L,[M]:[...P,O]}}})},[]),G=b.useCallback((C,M,O)=>{s(R=>{if(!R)return R;const L=R[C],P=L[M]??[];return{...R,[C]:{...L,[M]:P.filter(D=>D!==O)}}})},[]),V=b.useMemo(()=>({updateField:A,addToArray:B,removeFromArray:G}),[A,B,G]);return l?o.jsx(gt,{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:()=>y(!1),children:"Dismiss"})]}),o.jsxs("div",{className:"space-y-8",children:[o.jsx("div",{id:"cfg-server",className:"scroll-mt-4",children:o.jsx(Cx,{config:n,actions:V})}),o.jsx("div",{id:"cfg-security",className:"scroll-mt-4",children:o.jsx(Ex,{config:n,connectors:r,actions:V})}),o.jsx("div",{id:"cfg-sources",className:"scroll-mt-4",children:o.jsx(Tx,{config:n,actions:V})}),o.jsx("div",{id:"cfg-audit",className:"scroll-mt-4",children:o.jsx(Lx,{config:n,actions:V})}),o.jsx("div",{id:"cfg-output",className:"scroll-mt-4",children:o.jsx(Ax,{config:n,actions:V})}),o.jsx("div",{id:"cfg-journal",className:"scroll-mt-4",children:o.jsx(Ix,{})})]}),o.jsxs("div",{className:"mt-8",children:[o.jsxs("button",{className:"btn btn-sm btn-ghost gap-1",onClick:S,children:[v?"▾":"▸"," Raw Configuration (YAML)"]}),v&&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:w,onChange:C=>x(C.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"})]})]}),j&&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:N,children:"Discard"}),o.jsx("button",{className:"btn btn-sm btn-primary",onClick:E,disabled:c,children:c?"Saving...":"Save changes"})]})]})]})}function xs({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 Oe({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 Cx({config:e,actions:t}){const{updateField:n}=t;return o.jsxs(xs,{title:"Server",description:"Daemon and app server binding configuration",children:[o.jsx(Oe,{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(Oe,{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(Oe,{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 Hu({values:e,onAdd:t,onRemove:n,placeholder:s}){const[r,i]=b.useState("");return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex flex-wrap gap-1 mb-1",children:e.map(l=>o.jsxs(U,{size:"sm",className:"gap-1",children:[l,o.jsx("button",{className:"text-xs opacity-50 hover:opacity-100",onClick:()=>n(l),children:"×"})]},l))}),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:l=>i(l.target.value),onKeyDown:l=>{l.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 Ex({config:e,connectors:t,actions:n}){const{updateField:s,addToArray:r,removeFromArray:i}=n,l=new Set(e.security.highRiskCapabilities),a=b.useMemo(()=>co(t),[t]);return o.jsxs(xs,{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:a.map(([c,u])=>o.jsxs(b.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(x=>l.has(x)),y=e.security.approvedHighRisk.includes(p.key),w=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(x=>o.jsx(U,{variant:l.has(x)?"warning":"neutral",size:"xs",children:x},x))})}),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:y,onChange:()=>y?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:w,title:"Skip approval prompts — pipeline steps execute without confirmation",onChange:()=>w?i("security","autoApproveConnectors",p.key):r("security","autoApproveConnectors",p.key)})})]},p.key)})]},c))})]})}),o.jsx(Oe,{label:"High-Risk Capabilities",help:"Capabilities that require connector-level approval before first use",children:o.jsx(Hu,{values:e.security.highRiskCapabilities,onAdd:c=>r("security","highRiskCapabilities",c),onRemove:c=>i("security","highRiskCapabilities",c),placeholder:"Capability name"})}),o.jsx(Oe,{label:"Step Approval Required",help:"Capabilities that pause for user confirmation at each pipeline step",children:o.jsx(Hu,{values:e.security.approvalRequired,onAdd:c=>r("security","approvalRequired",c),onRemove:c=>i("security","approvalRequired",c),placeholder:"Capability name"})}),o.jsx(Oe,{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(Oe,{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 Tx({config:e,actions:t}){const{addToArray:n,removeFromArray:s}=t,[r,i]=b.useState("");return o.jsxs(xs,{title:"Connector Sources",description:"Directories to scan for connector YAML files",children:[o.jsx("div",{className:"space-y-1",children:e.connectors.paths.map((l,a)=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-sm flex-1",children:l}),o.jsx("button",{className:"btn btn-xs btn-ghost opacity-50 hover:opacity-100",onClick:()=>s("connectors","paths",l),children:"×"})]},a))}),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:l=>i(l.target.value),onKeyDown:l=>{l.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 Lx({config:e,actions:t}){const{updateField:n}=t;return o.jsxs(xs,{title:"Audit & Retention",description:"Audit log storage and cleanup settings",children:[o.jsx(Oe,{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(Oe,{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 Ax({config:e,actions:t}){const{updateField:n}=t;return o.jsx(xs,{title:"Output Defaults",description:"Default formatting for CLI output",children:o.jsx(Oe,{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 Ix(){const[e,t]=b.useState(""),[n,s]=b.useState(""),[r,i]=b.useState(""),[l,a]=b.useState("40"),[c,u]=b.useState(!1),[p,d]=b.useState(!1);b.useEffect(()=>{z.getPreferences().then(y=>{if(!y.ok)return;const w=y.preferences;t(w["journal.author"]??""),s(w["journal.ado_org"]??""),i(w["journal.ado_repos"]??""),a(w["journal.target_hours"]??"40"),u(!0)}).catch(()=>u(!0))},[]);async function f(){await Promise.all([z.setPreference("journal.author",e),z.setPreference("journal.ado_org",n),z.setPreference("journal.ado_repos",r),z.setPreference("journal.target_hours",l)]),d(!0),setTimeout(()=>d(!1),2e3)}return c?o.jsxs(xs,{title:"Journal Settings",description:"Configure your Dev Work Journal data sources",children:[o.jsx(Oe,{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:y=>t(y.target.value)})}),o.jsx(Oe,{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:y=>s(y.target.value)})}),o.jsx(Oe,{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:y=>i(y.target.value)})}),o.jsx(Oe,{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:l,onChange:y=>a(y.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 Px(){const[e,t]=b.useState(!1),[n,s]=b.useState(!1),[r,i]=b.useState(0),[l,a]=b.useState([]),[c,u]=b.useState([]),[p,d]=b.useState(null),f=b.useCallback(async()=>{try{const k=await z.getStatus();t(k.ok),s(k.extensionConnected),i(k.connectorCount)}catch{t(!1),s(!1),i(0)}try{const k=await z.getConnectors();a(k.connectors);const N=(await z.getConfig().catch(()=>({ok:!1,config:{}}))).config.security??{};u(N.approvedHighRisk??[])}catch{}},[]);b.useEffect(()=>{f();const k=setInterval(f,1e4);return()=>clearInterval(k)},[f]);const y=b.useCallback(async k=>{d(k);try{const E=[...c,k];await z.setConfig("security.approvedHighRisk",JSON.stringify(E)),f()}catch{}finally{d(null)}},[c,f]),w=l.filter(k=>k.isHighRisk&&!k.isApproved),x=w.length>0,v=[{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."}];x&&v.push({id:"permissions",label:"Connector permissions",ok:!1,detail:`${w.length} need${w.length===1?"s":""} authorization`,instructions:"Some connectors need authorization before first use. You can authorize them here or in Configuration → Connector Security."});const g=v.filter(k=>k.ok).length,m=v.length,h=g===m,j=b.useMemo(()=>co(l),[l]);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:v.map((k,E)=>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:E+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"&&w.length>0&&o.jsx("div",{className:"mt-3 space-y-2",children:w.map(N=>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:N.key}),N.description&&o.jsx("span",{className:"text-xs opacity-50 ml-2",children:N.description})]}),o.jsx("button",{className:"btn btn-sm btn-warning btn-outline shrink-0",disabled:p===N.key,onClick:()=>y(N.key),children:p===N.key?"Authorizing…":"Authorize"})]},N.key))})]})]},E))}),h&&l.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:j.map(([k,E])=>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:E.map(N=>{const S=N.key.split("/")[1];return o.jsx($e,{to:`/connectors/${k}/${S}`,className:"btn btn-sm btn-outline",children:o.jsx("span",{className:"font-mono",children:S})},N.key)})})]},k))})]}),!h&&l.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:j.map(([k,E])=>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:E.map(N=>{const S=N.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:S}),o.jsx(U,{size:"xs",children:N.access})]}),N.description&&o.jsx("div",{className:"text-xs opacity-40 mb-1",children:N.description})]},N.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 hr({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 fh(e){const t=e.getDay();return t!==0&&t!==6}function _x(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++)fh(new Date(t,n-1,i))&&r++;return r}function Mx(e,t){const[n,s]=e.split("-").map(Number),r=new Date(t+"T00:00:00"),i=new Date(n,s,0),l=r>i?i:r;let a=0;for(let c=1;c<=l.getDate();c++){const u=new Date(n,s-1,c);if(u>l)break;fh(u)&&a++}return a}function Dx(e){const{targetHours:t,actualHours:n,month:s,today:r}=e,i=_x(s),l=Mx(s,r),a=i-l,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:l,workingDaysRemaining:a};const p=i>0?t/i*l:0,d=a>0?Math.max(0,(t-n)/a):0;let f;return n>=p?f="on_track":i>0&&l/i<.8?f="behind":f="at_risk",{status:f,percentage:c,daysRemaining:u,hoursPerDayNeeded:d,workingDaysTotal:i,workingDaysElapsed:l,workingDaysRemaining:a}}const Rx={reached:"bg-success",on_track:"bg-success",behind:"bg-warning",at_risk:"bg-error"};function $x({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 ${Rx[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 ph=(...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 zx=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 Fx=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 Vu=e=>{const t=Fx(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 Xo={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 Bx=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},Ux=b.createContext({}),Wx=()=>b.useContext(Ux),Hx=b.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:s,className:r="",children:i,iconNode:l,...a},c)=>{const{size:u=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:f="currentColor",className:y=""}=Wx()??{},w=s??d?Number(n??p)*24/Number(t??u):n??p;return b.createElement("svg",{ref:c,...Xo,width:t??u??Xo.width,height:t??u??Xo.height,stroke:e??f,strokeWidth:w,className:ph("lucide",y,r),...!i&&!Bx(a)&&{"aria-hidden":"true"},...a},[...l.map(([x,v])=>b.createElement(x,v)),...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 ee=(e,t)=>{const n=b.forwardRef(({className:s,...r},i)=>b.createElement(Hx,{ref:i,iconNode:t,className:ph(`lucide-${zx(Vu(e))}`,`lucide-${e}`,s),...r}));return n.displayName=Vu(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 Vx=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Tn=ee("arrow-right",Vx);/**
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 Kx=[["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"}]],Gx=ee("book-open",Kx);/**
243
+ * @license lucide-react v1.23.0 - ISC
244
+ *
245
+ * This source code is licensed under the ISC license.
246
+ * See the LICENSE file in the root directory of this source tree.
247
+ */const qx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Yx=ee("circle-alert",qx);/**
248
+ * @license lucide-react v1.23.0 - ISC
249
+ *
250
+ * This source code is licensed under the ISC license.
251
+ * See the LICENSE file in the root directory of this source tree.
252
+ */const Qx=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Jx=ee("circle-check-big",Qx);/**
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 Xx=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Zx=ee("circle-check",Xx);/**
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 ev=[["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"}]],tv=ee("circle-x",ev);/**
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 nv=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],hh=ee("clock",nv);/**
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 sv=[["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"}]],Ku=ee("database",sv);/**
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 rv=[["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"}]],iv=ee("door-open",rv);/**
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 ov=[["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=ee("eye",ov);/**
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 av=[["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"}]],Zo=ee("file-text",av);/**
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 cv=[["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"}]],uv=ee("fingerprint-pattern",cv);/**
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 dv=[["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"}]],Qr=ee("globe",dv);/**
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 fv=[["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"}]],pv=ee("key-round",fv);/**
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 hv=[["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"}]],mv=ee("library",hv);/**
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 gv=[["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"}]],yv=ee("lock",gv);/**
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 xv=[["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"}]],vv=ee("newspaper",xv);/**
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 bv=[["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"}]],wv=ee("panels-top-left",bv);/**
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 jv=[["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"}]],kv=ee("scroll-text",jv);/**
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 Nv=[["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"}]],Gu=ee("server",Nv);/**
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 Sv=[["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"}]],Cv=ee("shield",Sv);/**
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 Ev=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],el=ee("terminal",Ev);/**
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 Tv=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Lv=ee("trending-up",Tv);/**
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 Av=[["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"}]],Iv=ee("triangle-alert",Av),Ov={reached:Jx,on_track:Lv,behind:hh,at_risk:Iv},Pv={reached:"text-success",on_track:"text-success",behind:"text-warning",at_risk:"text-error"},_v={reached:"bg-success/10",on_track:"bg-success/5",behind:"bg-warning/10",at_risk:"bg-error/10"};function Mv(e,t,n){const s=n.find(r=>r.projectId===e&&r.activity===t);return(s==null?void 0:s.totalHours)??0}function Dv({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((l,a)=>{const c=Mv(l.projectId,l.activity,t),u=Dx({targetHours:l.targetHours,actualHours:c,month:r,today:i}),p=n.get(l.projectId),d=Ov[u.status];return o.jsxs("div",{className:`grid grid-cols-[auto_1fr_auto_1fr] gap-0 ${_v[u.status]} ${a>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:Pv[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??l.projectId}),o.jsxs("div",{className:"font-mono text-[0.6rem] opacity-50 mt-0.5",children:[p?`${l.projectId} · `:"",s.get(`${l.projectId}\0${l.activity}`)??l.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,"/",l.targetHours,"h"]}),o.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mt-0.5",children:[l.targetDays,"d target"]})]}),o.jsxs("div",{className:"p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx($x,{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`})]})]},l.id)})})}function Rv({goals:e,month:t,onGoalChange:n,knownCombos:s,projectNames:r,activityNames:i,onRefreshProjects:l,refreshingProjects:a}){const[c,u]=b.useState(""),[p,d]=b.useState(""),[f,y]=b.useState(null),[w,x]=b.useState(""),[v,g]=b.useState(!1),m=b.useMemo(()=>{const T=new Set(e.map(A=>`${A.projectId}\0${A.activity}`));return s.filter(A=>!T.has(`${A.projectId}\0${A.activity}`))},[s,e]);function h(T){const A=T.indexOf("\0");return A<0?null:{projectId:T.slice(0,A),activity:T.slice(A+1)}}function j(T){return r.get(T)??T}function k(T,A){const B=i.get(`${T}\0${A}`);return B?`${j(T)} / ${B}`:`${j(T)} / ${A}`}async function E(){const T=h(c),A=parseFloat(p);if(!(!T||isNaN(A)||A<.5||A>31)){g(!0);try{await z.upsertGoal({month:t,projectId:T.projectId,activity:T.activity,targetDays:A}),u(""),d(""),n()}finally{g(!1)}}}async function N(T){g(!0);try{await z.deleteGoal(T),n()}finally{g(!1)}}async function S(T){const A=parseFloat(w);if(isNaN(A)||A<.5||A>31){y(null);return}g(!0);try{await z.upsertGoal({month:T.month,projectId:T.projectId,activity:T.activity,targetDays:A}),y(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:j(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:w,onChange:A=>x(A.target.value),onBlur:()=>S(T),onKeyDown:A=>{A.key==="Enter"&&S(T),A.key==="Escape"&&y(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:()=>{y(T.id),x(String(T.targetDays))},disabled:v,"aria-label":`Edit goal ${T.projectId} ${T.activity}`,children:"Edit"}),o.jsx("button",{className:"btn btn-ghost btn-xs text-error font-mono",onClick:()=>N(T.id),disabled:v,"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:E,disabled:v||!c,children:"Add"}),o.jsx("button",{className:"btn btn-ghost btn-sm font-mono text-xs opacity-60",onClick:l,disabled:a,children:a?"Refreshing…":"Refresh projects"})]})]})]})}function $v(e,t){var V;const[n,s]=b.useState([]),[r,i]=b.useState([]),[l,a]=b.useState(null),[c,u]=b.useState([]),p=b.useRef(c);p.current=c;const[d,f]=b.useState(!1),y=b.useCallback(async()=>{try{const C=await z.getGoals(e);s(C.goals)}catch{}},[e]),w=b.useCallback(async()=>{try{const C=await z.getCachedReport(e);C.data?(i(C.data),a(C.fetchedAt)):(i([]),a(null))}catch{}},[e]),x=b.useCallback(async()=>{try{const C=await z.getCachedProjects();C.data&&u(C.data)}catch{}},[]),v=b.useCallback(async()=>{f(!0);try{const C=await z.run("timetracking/projects",{month:e});if(C.ok&&C.data&&C.data.length>0){const M=C.data.map(O=>({projectId:String(O.projectId??""),projectName:String(O.projectName??""),activityNumber:String(O.activityNumber??""),activityName:String(O.activityName??""),category:String(O.category??""),linePropertyId:String(O.linePropertyId??"")}));u(M),await z.cacheProjects(M)}}catch{}f(!1)},[e]);b.useEffect(()=>{y(),w(),x()},[y,w,x]);const g=t==null?void 0:t.data;b.useEffect(()=>{if(g&&g.length>0){a(null),z.cacheReport(e,g).catch(()=>{});const C=new Set,M=[];for(const O of g){const R=String(O.projectId??""),L=String(O.activity??"");if(!R||!L)continue;const P=`${R}\0${L}`;C.has(P)||(C.add(P),M.push({projectId:R,projectName:O.projectName?String(O.projectName):R,activityNumber:L,activityName:O.activityName?String(O.activityName):L,category:String(O.category??""),linePropertyId:""}))}if(M.length>0){const O=new Map;for(const L of p.current)O.set(`${L.projectId}\0${L.activityNumber}`,L);for(const L of M)O.set(`${L.projectId}\0${L.activityNumber}`,L);const R=Array.from(O.values());u(R),z.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:j,activityNames:k}=b.useMemo(()=>{const C=new Map,M=new Map;for(const O of c)O.projectId&&O.projectName&&C.set(O.projectId,O.projectName),O.projectId&&O.activityNumber&&O.activityName&&M.set(`${O.projectId}\0${O.activityNumber}`,O.activityName);for(const O of m){const R=String(O.projectId??""),L=O.projectName?String(O.projectName):null;R&&L&&C.set(R,L);const P=String(O.activity??""),D=O.activityName?String(O.activityName):null;R&&P&&D&&M.set(`${R}\0${P}`,D)}return{projectNames:C,activityNames:M}},[c,m]),{projectList:E,totalHours:N,draftCount:S,workingDayCount:T}=b.useMemo(()=>{const C=new Map;let M=0,O=0;const R=new Set;for(const L of m){const P=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"&&O++,C.has(P)||C.set(P,{projectId:P,totalHours:0,entryCount:0,activities:new Set});const Ze=C.get(P);if(Ze.totalHours+=D,Ze.entryCount++,De){const vs=k.get(`${P}\0${De}`)??De;Ze.activities.add(vs)}}return{projectList:Array.from(C.values()).sort((L,P)=>P.totalHours-L.totalHours),totalHours:M,draftCount:O,workingDayCount:R.size}},[m,k]),A=b.useMemo(()=>{const C=new Map;for(const M of m){const O=String(M.projectId??"Unknown"),R=String(M.activity??""),L=Number(M.hours??0),P=`${O}\0${R}`,D=C.get(P);D?D.totalHours+=L:C.set(P,{projectId:O,activity:R,totalHours:L})}return Array.from(C.values())},[m]),B=b.useMemo(()=>c.length>0?c.map(C=>({projectId:C.projectId,activity:C.activityNumber})):A.map(C=>({projectId:C.projectId,activity:C.activity})),[c,A]),G=new Date().toISOString().slice(0,10);return{goals:n,loadGoals:y,rows:m,isCached:h,cachedAt:l,projectNames:j,activityNames:k,projectList:E,totalHours:N,draftCount:S,workingDayCount:T,activityHours:A,allCombos:B,todayStr:G,refreshProjects:v,refreshingProjects:d}}function zv(){const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`}function Fv(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 Bv(){const[e,t]=b.useState(zv()),[n,s]=b.useState(!1),{running:r,result:i,error:l,approvalPending:a,approvalId:c,run:u,handleApproval:p,reset:d}=Za(),{goals:f,loadGoals:y,rows:w,isCached:x,cachedAt:v,projectNames:g,activityNames:m,projectList:h,totalHours:j,draftCount:k,workingDayCount:E,activityHours:N,allCombos:S,todayStr:T,refreshProjects:A,refreshingProjects:B}=$v(e,i),G=(l==null?void 0:l.includes("auth_required"))||(l==null?void 0:l.includes("sign in")),V=b.useCallback(async()=>{const C={};e&&(C.month=e),await u("timetracking/report",C),await y()},[e,u,y]);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:C=>{t(C.target.value),d()},onClick:C=>{var M,O;return(O=(M=C.target).showPicker)==null?void 0:O.call(M)}})]}),o.jsx("button",{className:"btn btn-primary btn-sm",onClick:V,disabled:r,children:r?"Loading...":"Load report"})]}),r&&!a&&o.jsx(gt,{label:"Fetching timetracking data..."}),a&&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(hr,{message:"Sign in to the timetracking portal in Chrome, then try again."}),l&&!G&&o.jsx("div",{className:"alert alert-error mb-4",children:o.jsx("span",{children:l})}),w.length>0&&o.jsxs(o.Fragment,{children:[x&&v&&o.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:["Showing cached data from ",Fv(v)]}),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:j.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:E})]}),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(C=>o.jsxs("tr",{children:[o.jsx("td",{children:g.has(C.projectId)?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"text-sm",children:g.get(C.projectId)}),o.jsx("div",{className:"font-mono text-[0.6rem] opacity-50",children:C.projectId})]}):o.jsx("span",{className:"font-mono text-sm",children:C.projectId})}),o.jsx("td",{className:"text-sm",children:Array.from(C.activities).join(", ")}),o.jsx("td",{className:"text-right font-semibold",children:C.totalHours.toFixed(1)}),o.jsx("td",{className:"text-right",children:C.entryCount})]},C.projectId))})]})}),o.jsxs("details",{open:n,onToggle:C=>s(C.target.open),children:[o.jsxs("summary",{className:"cursor-pointer text-sm font-semibold mb-2",children:["Raw booking lines (",w.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:w.map((C,M)=>o.jsxs("tr",{children:[o.jsx("td",{children:String(C.date??"")}),o.jsx("td",{className:"font-mono text-xs",children:String(C.projectId??"")}),o.jsx("td",{children:String(C.activity??"")}),o.jsx("td",{className:"text-right",children:Number(C.hours??0).toFixed(1)}),o.jsx("td",{children:o.jsx(U,{variant:String(C.status)==="posted"?"success":"warning",size:"xs",children:String(C.status??"")})})]},M))})]})})]})]}),i&&(i.data??[]).length===0&&w.length===0&&!l&&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(Dv,{goals:f,activityHours:N,projectNames:g,activityNames:m,month:e,today:T})]}),o.jsx("div",{className:"mt-6",children:o.jsx(Rv,{goals:f,month:e,onGoalChange:y,knownCombos:S,projectNames:g,activityNames:m,onRefreshProjects:A,refreshingProjects:B})})]})}const Uv=["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 Wv({value:e,onChange:t}){const[n,s]=b.useState(!1),[r,i]=b.useState(-1),l=b.useRef(null),a=b.useRef(null),c=Uv.filter(d=>d.toLowerCase().includes(e.toLowerCase())),u=b.useCallback(d=>{t(d),s(!1),i(-1)},[t]);b.useEffect(()=>{function d(f){l.current&&!l.current.contains(f.target)&&(s(!1),i(-1))}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),b.useEffect(()=>{var d;if(r>=0&&a.current){const f=a.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:l,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:a,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:y=>{y.preventDefault(),u(d)},onMouseEnter:()=>i(f),children:d})},d))})]})}const qu={free:"success",busy:"error",tentative:"warning",oof:"secondary",elsewhere:"info"},Hv={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"},Vv={free:"bg-success/35 border-success/60",busy:"bg-error/35 border-error/60",tentative:"bg-warning/35 border-warning/60",oof:"bg-secondary/35 border-secondary/60",elsewhere:"bg-info/35 border-info/60"};function Ln(e){const t=e.match(/(\d{1,2}:\d{2})/);return t?t[1]:e}function Kv({rows:e}){var r,i;const[t,n]=b.useState(null),s=e.reduce((l,a)=>l+(a.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((l,a)=>{const c=s>0?(l.durationMin??0)/s*100:0;if(c<.5)return null;const u=t===a,p=u?Vv[l.state??""]??"bg-base-300":Hv[l.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(a),onMouseLeave:()=>n(null),children:[c>12&&o.jsx("span",{className:"opacity-60 truncate px-1 font-mono text-[0.65rem] uppercase tracking-wide",children:l.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:[l.state,": ",Ln(l.start??""),"–",Ln(l.end??"")," (",l.durationMin,"m)"]})]},a)})}),o.jsxs("div",{className:"flex justify-between mt-1",children:[o.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Ln(((r=e[0])==null?void 0:r.start)??"")}),o.jsx("span",{className:"font-mono text-[0.6rem] opacity-30",children:Ln(((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((l,a)=>o.jsxs("tr",{className:`transition-colors duration-75 ${t===a?"bg-base-200":"hover:bg-base-200"}`,onMouseEnter:()=>n(a),onMouseLeave:()=>n(null),children:[o.jsx("td",{className:"font-mono text-sm",children:Ln(l.start??"")}),o.jsx("td",{className:"font-mono text-sm",children:Ln(l.end??"")}),o.jsx("td",{children:o.jsx(U,{variant:qu[l.state??""]??"neutral",children:l.state})}),o.jsxs("td",{className:"text-right font-mono text-sm",children:[l.durationMin,"m"]})]},a))})]})}),o.jsx("div",{className:"flex flex-wrap gap-4 mt-3",children:Object.entries(qu).map(([l,a])=>o.jsx("div",{className:"flex items-center gap-1.5",children:o.jsx(U,{variant:a,size:"xs",children:l})},l))})]})}function Gv(){return new Date().toISOString().slice(0,10)}function qv(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 Yv(){const[e,t]=b.useState(""),[n,s]=b.useState(Gv()),{running:r,result:i,error:l,approvalPending:a,approvalId:c,run:u,handleApproval:p}=Za(),d=b.useCallback(async()=>{if(!e)return;const v={room:e};n&&(v.date=n),await u("teams/room-availability",v)},[e,n,u]),f=((i==null?void 0:i.data)??[]).map(v=>({start:String(v.start??""),end:String(v.end??""),state:String(v.state??""),durationMin:Number(v.durationMin??0)})),y=b.useMemo(()=>{if(f.length===0)return null;const v=f.reduce((k,E)=>k+E.durationMin,0),g=f.filter(k=>k.state==="free").reduce((k,E)=>k+E.durationMin,0),m=f.filter(k=>k.state==="busy").reduce((k,E)=>k+E.durationMin,0),h=f.filter(k=>k.state==="free").length,j=v>0?Math.round(g/v*100):0;return{totalMin:v,freeMin:g,busyMin:m,freeSlots:h,pct:j}},[f]),w=(l==null?void 0:l.includes("auth_required"))||(l==null?void 0:l.includes("sign in")),x=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(Wv,{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:v=>s(v.target.value),onClick:v=>{var g,m;return(m=(g=v.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&&!a&&o.jsx(gt,{label:"Checking room availability..."}),a&&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"})]})]}),w&&o.jsx(hr,{message:"Sign in to Microsoft Teams in Chrome, then try again."}),l&&!w&&o.jsx("div",{className:"alert alert-error mb-4",children:o.jsx("span",{children:l})}),i&&f.length>0&&y&&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:[y.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(y.freeMin/60),"h ",y.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(y.busyMin/60),"h ",y.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:y.freeSlots})]})]}),o.jsxs("h3",{className:"font-display text-base font-semibold mb-3",children:[x||"Room"," · ",qv(n)]}),o.jsx(Kv,{rows:f})]}),i&&f.length===0&&!l&&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&&!l&&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 Qv({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,l=t&&t.totalHours<t.targetHours*.8,a=(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 ${l?"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 ${l?"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",a>0&&o.jsxs("span",{className:"text-error font-semibold ml-1",children:["· ",a," 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 Jv=["Mon","Tue","Wed","Thu","Fri"];function Xv(e){const t=new Date(e).getDay();return Jv[t-1]??e}function Zv({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 l=[...i].sort().filter(f=>{const y=new Date(f+"T00:00:00").getDay();return y===0||y===6?(t==null?void 0:t.daily.some(x=>x.date===f&&x.hours>0))||(n==null?void 0:n.daily.some(x=>x.date===f&&x.count>0))||(s==null?void 0:s.daily.some(x=>x.date===f&&x.commits>0)):!0}),a=(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 l.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:l.map(f=>{const y=t==null?void 0:t.daily.find(m=>m.date===f),w=n==null?void 0:n.daily.find(m=>m.date===f),x=s==null?void 0:s.daily.find(m=>m.date===f),v=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:v?"bg-warning/10":"",children:[o.jsx("td",{className:"font-medium",children:Xv(f)}),o.jsx("td",{className:"text-xs text-base-content/60",children:f}),o.jsxs("td",{children:[o.jsx("span",{className:v?"text-warning font-semibold":"",children:y?`${y.hours}h`:"—"}),v&&o.jsx("span",{className:"ml-1 text-warning text-xs",children:"⚠"})]}),o.jsx("td",{children:w?`${w.count} (${w.hours}h)`:"—"}),o.jsx("td",{children:x?`${x.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:a>0?`${a}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 e1({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 mh(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 t1(){const e=new Date;return e.setDate(e.getDate()-e.getDay()),mh(e)}function Yu(e,t){const n=new Date(e+"T00:00:00");return n.setDate(n.getDate()+t*7),mh(n)}function n1(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 s1(){const[e,t]=b.useState(t1()),[n,s]=b.useState(!1),[r,i]=b.useState(null),[l,a]=b.useState(null),[c,u]=b.useState(null);async function p(){s(!0),a(null),i(null),u(null);const d=Date.now();try{const f=await z.generateJournal({weekStart:e});u(Date.now()-d),i(f)}catch(f){a(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(Yu(e,-1)),disabled:n,children:"◄"}),o.jsx("span",{className:"font-medium text-lg",children:n1(e)}),o.jsx("button",{className:"btn btn-sm btn-ghost",onClick:()=>t(Yu(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…"})]}),l&&o.jsx("div",{role:"alert",className:"alert alert-error",children:o.jsx("span",{children:l})}),(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(Qv,{data:r}),o.jsx(Zv,{data:r}),o.jsx(e1,{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 r1={socket:"info",wiz:"secondary",tldrsec:"warning"},i1={socket:"SOCKET",wiz:"WIZ",tldrsec:"TLDR SEC"};function o1(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 a1(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 c1(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 u1(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 Qu={7:"Past 7 days",30:"Past 30 days"};function d1(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 f1(){const[e,t]=b.useState(7),[n,s]=b.useState("idle"),[r,i]=b.useState("idle"),[l,a]=b.useState("idle"),[c,u]=b.useState([]),[p,d]=b.useState([]),[f,y]=b.useState([]),[w,x]=b.useState(null),[v,g]=b.useState(null),[m,h]=b.useState(null),[j,k]=b.useState(null),[E,N]=b.useState(!1);b.useEffect(()=>{let C=!1;return z.getCachedSecurityNews().then(M=>{if(!C&&M.data&&M.data.length>0){if(s(P=>P==="loading"?(C=!0,P):"done"),C)return;const O=[],R=[],L=[];for(const P of M.data){const D=P;D.source==="wiz"?R.push(D):D.source==="tldrsec"?L.push(D):O.push(D)}u(O),d(R),y(L),k(M.fetchedAt),N(!0),i("done"),a("done")}}).catch(()=>{}),()=>{C=!0}},[]);const S=n==="loading"||r==="loading"||l==="loading",T=c.length>0||p.length>0||f.length>0,A=b.useMemo(()=>[...c,...p,...f].filter(M=>o1(M.date,e)).sort((M,O)=>new Date(O.date).getTime()-new Date(M.date).getTime()),[c,p,f,e]),B=b.useMemo(()=>{const C=A.filter(R=>R.source==="socket").length,M=A.filter(R=>R.source==="wiz").length,O=A.filter(R=>R.source==="tldrsec").length;return{total:A.length,socketCount:C,wizCount:M,tldrsecCount:O}},[A]),G=b.useCallback(async()=>{s("loading"),i("loading"),a("loading"),x(null),g(null),h(null),u([]),d([]),y([]),N(!1);let C=[],M=[],O=[];const R=z.run("socket/security-news",{}).then($=>{!$.ok&&$.error?(x($.error),s("error")):(C=a1($),u(C),s("done"))}).catch($=>{x($ instanceof Error?$.message:"Failed to fetch"),s("error")}),L=z.run("wiz/blog-security",{}).then($=>{!$.ok&&$.error?(g($.error),i("error")):(M=c1($),d(M),i("done"))}).catch($=>{g($ instanceof Error?$.message:"Failed to fetch"),i("error")}),P=z.run("tldrsec/newsletter",{}).then($=>{!$.ok&&$.error?(h($.error),a("error")):(O=u1($),y(O),a("done"))}).catch($=>{h($ instanceof Error?$.message:"Failed to fetch"),a("error")});await Promise.allSettled([R,L,P]);const D=[...C,...M,...O];if(D.length>0){const $=new Date().toISOString();k($),z.cacheSecurityNews(D).catch(()=>{})}},[]),V=C=>(C==null?void 0:C.includes("auth_required"))||(C==null?void 0:C.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:C=>t(Number(C.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:S,children:S?"Loading...":"Load news"}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(tl,{label:"Socket",status:n}),o.jsx(tl,{label:"Wiz",status:r}),o.jsx(tl,{label:"tl;dr sec",status:l})]})]}),S&&o.jsx(gt,{label:"Fetching security news..."}),w&&(V(w)?o.jsx(hr,{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:"})," ",w]})})),v&&(V(v)?o.jsx(hr,{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:"})," ",v]})})),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]})}),j&&!S&&o.jsxs("div",{className:"font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.1em] mb-2",children:[E?"Showing cached data from":"Last fetched"," ",d1(j)]}),T&&!S&&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:Qu[e]}),o.jsx("div",{className:"font-display text-xl font-bold",children:B.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:B.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:B.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:B.tldrsecCount})]})]}),A.length>0&&o.jsx("div",{className:"space-y-px",children:A.map((C,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:C.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-semibold hover:text-primary transition-colors leading-snug",children:C.title}),o.jsx(U,{variant:r1[C.source]??"neutral",size:"xs",children:i1[C.source]??C.source.toUpperCase()})]}),C.summary&&o.jsx("p",{className:"text-sm opacity-60 leading-relaxed mb-2 line-clamp-2",children:C.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(C.date)}),C.author&&o.jsx("span",{className:"font-mono text-[0.6rem] opacity-40",children:C.author}),C.tags&&o.jsx("div",{className:"flex gap-1 flex-wrap",children:C.tags.split(",").slice(0,3).map(O=>o.jsx(U,{variant:"neutral",size:"xs",children:O.trim()},O.trim()))})]})]},`${C.source}-${M}`))}),T&&A.length===0&&!S&&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 ",Qu[e].toLowerCase()]}),o.jsx("p",{className:"font-mono text-xs opacity-30",children:"All sources returned data, but nothing within the date window."})]}),!T&&!S&&!w&&!v&&!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 tl({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 Jr(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 Ju(e){return e===null?"none":e<0?"expired":e<=7?"critical":e<=30?"warning":"ok"}function p1(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"none":return o.jsx(U,{variant:"neutral",size:"xs",children:"NO EXPIRY"});default:return null}}function h1(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 m1(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 g1(){const[e,t]=b.useState("idle"),[n,s]=b.useState(""),[r,i]=b.useState([]),[l,a]=b.useState(null),[c,u]=b.useState("all"),p=e==="clients"||e==="trustedby",d=b.useCallback(async()=>{t("clients"),a(null),i([]),s("Fetching client list (all regions)...");try{const v=await z.run("tokenmaster/clients-list",{region:"all"});if(!v.ok&&v.error){a(v.error),t("error");return}const g=(v.data??[]).map(j=>({id:String(j.id??""),name:String(j.name??""),region:String(j.region??"emea")}));if(g.length===0){s("No clients found."),t("done");return}t("trustedby");const m=[],h=g.length;for(let j=0;j<g.length;j++){const k=g[j];s(`Fetching trusted peers... (${j+1}/${h}) — ${k.name||k.id}`);try{const E=await z.run("tokenmaster/client-trustedby",{clientid:k.id,region:k.region});if(E.ok&&E.data)for(const N of E.data)m.push({parentClientId:k.id,parentClientName:k.name||k.id,peerId:String(N.id??""),peerName:String(N.name??""),peerIdDisplay:String(N.idDisplay??""),expiryDate:N.expiry_date?String(N.expiry_date):null,region:String(N.region??k.region)})}catch{}}i(m),s(`Loaded ${m.length} trusted peers from ${h} clients.`),t("done")}catch(v){a(v instanceof Error?v.message:"Unknown error"),t("error")}},[]),f=b.useMemo(()=>[...c==="all"?r:r.filter(g=>g.region===c)].sort((g,m)=>{const h=Jr(g.expiryDate),j=Jr(m.expiryDate);return h===null&&j===null?0:h===null?1:j===null?-1:h-j}),[r,c]),y=b.useMemo(()=>{let v=0,g=0,m=0;for(const h of f){const j=Ju(Jr(h.expiryDate));j==="expired"?v++:j==="critical"?g++:j==="warning"&&m++}return{total:f.length,expired:v,critical:g,warning:m}},[f]),w=b.useMemo(()=>{const v=new Set(r.map(g=>g.region));return Array.from(v).sort()},[r]),x=v=>(v==null?void 0:v.includes("auth_required"))||(v==null?void 0:v.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"}),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:v=>u(v.target.value),children:[o.jsx("option",{value:"all",children:"All regions"}),w.map(v=>o.jsx("option",{value:v,children:v.toUpperCase()},v))]})]}),o.jsx("button",{className:"btn btn-primary btn-sm w-full sm:w-auto",onClick:d,disabled:p,children:p?"Loading...":"Load trusted peers"})]}),p&&o.jsx(gt,{label:n}),l&&(x(l)?o.jsx(hr,{message:"Sign in to TokenMaster in Chrome, then try again."}):o.jsx("div",{className:"alert alert-error mb-3",children:o.jsx("span",{children:l})})),r.length>0&&!p&&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:y.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 ${y.expired>0?"text-red-500":""}`,children:y.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 ${y.critical>0?"text-red-500":""}`,children:y.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 ${y.warning>0?"text-amber-500":""}`,children:y.warning})]})]}),f.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:f.map((v,g)=>{const m=Jr(v.expiryDate),h=Ju(m);return o.jsxs("tr",{className:`border-b border-base-300/50 ${m1(h)}`,children:[o.jsx("td",{children:p1(h,m)}),o.jsx("td",{className:"font-mono text-sm",children:h1(v.expiryDate)}),o.jsx("td",{className:"font-mono text-sm",children:m!==null?m<0?`${Math.abs(m)}d overdue`:`${m}d`:"—"}),o.jsx("td",{className:"text-sm font-semibold",children:v.peerName||v.peerId}),o.jsx("td",{className:"font-mono text-xs opacity-60",children:v.peerIdDisplay||v.peerId}),o.jsx("td",{className:"text-sm",children:v.parentClientName}),o.jsx("td",{children:o.jsx(U,{variant:"neutral",size:"xs",children:v.region.toUpperCase()})})]},`${v.parentClientId}-${v.peerId}-${v.region}-${g}`)})})]})}),e==="done"&&!p&&r.length>0&&o.jsx("div",{className:"mt-3 font-mono text-xs opacity-40",children:n}),e==="done"&&r.length===0&&!p&&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 y1=[{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}],x1=[{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."}],v1={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"},b1={client:"bg-sky-400/20",daemon:"bg-amber-400/20",extension:"bg-emerald-400/20",browser:"bg-violet-400/20"},w1=[{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 j1({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(l=>o.jsx("div",{className:"flex justify-center",children:o.jsx("span",{className:`px-2 py-1 text-[0.65rem] font-mono font-semibold border ${v1[l.color]}`,children:l.label})},l.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(l=>o.jsx("div",{className:"flex justify-center",children:o.jsx("div",{className:`w-0.5 h-full ${b1[l.color]}`})},l.id))}),o.jsx("div",{className:"relative",children:n.map((l,a)=>{if(l.type==="action"){const v=(t.findIndex(g=>g.id===l.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:`${v}%`},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:l.label})})},a)}const c=t.findIndex(x=>x.id===l.from),u=t.findIndex(x=>x.id===l.to),p=(c+.5)/r*100,d=(u+.5)/r*100,f=Math.min(p,d),y=Math.abs(d-p),w=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:`${y}%`}}),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(${w?"-100%":"0"}, -50%)`},children:w?"▸":"◂"}),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:l.label})})]},a)})})]})]})]})}const k1=[{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 N1(){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:y1.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:x1.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:w1.map(e=>o.jsx(j1,{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:k1.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 S1={GET:"success",POST:"warning",PUT:"info",DELETE:"error",WS:"secondary",SSE:"secondary"},C1=[{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."}],E1=[{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 }"}],T1=[{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."}],L1=[{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 Xu({ep:e}){const[t,n]=b.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:S1[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 A1(){const[e,t]=b.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:T1.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:C1.map((n,s)=>o.jsx(Xu,{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:E1.map((n,s)=>o.jsx(Xu,{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:L1.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 I1(e){const n=e.replace(/^---\s*\n[\s\S]*?\n---\s*\n/,"").split(`
353
+ `),s=[];let r=null;for(const i of n){const l=i.match(/^(#{1,3})\s+(.+)/);l?(r&&s.push({heading:r.heading,body:r.lines.join(`
354
+ `).trim()}),r={heading:l[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 O1({content:e}){return o.jsx("pre",{className:"text-sm font-mono whitespace-pre-wrap opacity-70 leading-relaxed overflow-x-auto",children:e})}function Zu({file:e,defaultOpen:t}){const[n,s]=b.useState(t??!1),r=b.useMemo(()=>I1(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,l)=>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(O1,{content:i.body})]},l))})]})}function P1({skill:e}){const[t,n]=b.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(Zu,{file:s,defaultOpen:!0}),r.map(i=>o.jsx(Zu,{file:i},i.name))]})]})}function _1(){const[e,t]=b.useState([]),[n,s]=b.useState(!0),[r,i]=b.useState(null);return b.useEffect(()=>{z.getSkills().then(l=>t(l.skills)).catch(l=>i(l instanceof Error?l.message:"Failed to load skills")).finally(()=>s(!1))},[]),n?o.jsx(gt,{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(l=>o.jsxs("tr",{className:"hover:bg-base-200",children:[o.jsx("td",{className:"font-mono text-sm font-semibold whitespace-nowrap",children:l.name}),o.jsx("td",{className:"text-sm opacity-60",children:l.description}),o.jsx("td",{className:"text-center",children:o.jsx(U,{size:"xs",children:l.files.length})})]},l.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(l=>o.jsx(P1,{skill:l},l.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 Ot({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 Xr({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 M1(){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(Ot,{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(Xr,{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(Ot,{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(Qr,{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(tv,{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(Yx,{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(Ot,{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(Qr,{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(Zo,{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(el,{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(Xr,{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(Ot,{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:el,title:"CLI",mono:"cg",desc:"Contact point for humans and AI agents. One command, structured JSON output."},{icon:Gu,title:"Daemon",mono:":9091",desc:"Validates auth and capabilities, loads connectors, writes audit log."},{icon:Qr,title:"Extension",mono:"MV3",desc:"Runs inside your authenticated Chrome. Accesses cookies and page data."},{icon:Zo,title:"Connectors",mono:"YAML",desc:"Declarative pipelines: navigate → wait → extract → map. No code execution."},{icon:Ku,title:"Audit Log",mono:"SQLite",desc:"Every execution logged: connector, domains, timing, approvals."},{icon:wv,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(Tn,{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(Ot,{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:hh,title:"Time Tracking",tag:"Administrative",desc:"Monthly report with project breakdown and summary cards",route:"/apps/timetracking",cmd:"timetracking/report"},{icon:iv,title:"Room Availability",tag:"Administrative",desc:"Meeting room free/busy from Outlook Scheduling Assistant",route:"/apps/rooms",cmd:"teams/room-availability"},{icon:Gx,title:"Dev Journal",tag:"Productivity",desc:"Auto-generated daily journal from Git commits and Jira tickets",route:"/apps/journal",cmd:"ado/git-commits"},{icon:vv,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:pv,title:"Trusted Peer Expiry",tag:"Productivity",desc:"TokenMaster client trust relationships with expiry tracking",route:"/apps/trusted-peer-expiry",cmd:"tokenmaster/clients-list"},{icon:mv,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(Tn,{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(Ot,{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(el,{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(Qr,{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(Zx,{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(Ot,{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:yv,title:"No credentials stored",desc:"Reuses session cookies already in Chrome. Nothing stored on disk, nothing sent externally."},{icon:Cv,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:uv,title:"Step-by-step approval",desc:"Sensitive operations pause for confirmation. Approve in CLI or via Chrome notification."},{icon:Gu,title:"Local-only processing",desc:"Daemon on :9091, app server on :9092. Bound to localhost. No network exposure."},{icon:Zo,title:"Declarative connectors",desc:"Pure YAML pipelines. No JavaScript evaluation, no arbitrary code execution by default."},{icon:kv,title:"Audit-or-fail",desc:"Every execution logged to SQLite. Domains, timing, approvals, row counts. If audit fails, commands are blocked."},{icon:Ku,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(Xr,{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(Tn,{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(Tn,{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(Tn,{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(Tn,{className:"w-3 h-3"})]})]})]}),o.jsxs("section",{id:"why-extend",className:"pt-16 scroll-mt-4",children:[o.jsx(Ot,{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(Xr,{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 dt({isActive:e}){return`block px-3 py-2 text-sm transition-colors ${e?"bg-primary text-primary-content font-semibold":"hover:text-primary"}`}const Zr={"/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 D1({sections:e}){const t=b.useMemo(()=>e.map(r=>r.id),[e]),n=e0(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] font-mono transition-colors ${n===r.id?"text-primary opacity-100":"opacity-40 hover:opacity-70"}`,children:r.label},r.id))})}function Ls({to:e,label:t,sections:n}){const r=kn().pathname===e;return o.jsxs(o.Fragment,{children:[o.jsx(ut,{to:e,end:e==="/",className:dt,children:t}),r&&n.length>0&&o.jsx(D1,{sections:n})]})}function R1(){const[e,t]=b.useState(!1),[n,s]=b.useState(!1),[r,i]=b.useState(!1),[l,a]=b.useState([]),c=kn();b.useEffect(()=>{i(!1)},[c.pathname]),b.useEffect(()=>{const p=()=>{z.getStatus().then(f=>{t(f.ok),s(f.extensionConnected)}).catch(()=>{t(!1),s(!1)})};p();const d=setInterval(p,3e4);return()=>clearInterval(d)},[]),b.useEffect(()=>{z.getConnectors().then(p=>{const d=co(p.connectors).map(([f])=>f);a(d)}).catch(()=>{})},[]);const u=b.useMemo(()=>l.map(p=>({label:p,id:`conn-${p}`})),[l]);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-center 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-base font-bold tracking-tight",children:[o.jsx("span",{className:"font-normal opacity-60",children:"command"}),"Garden"]}),o.jsx("p",{className:"font-mono text-[0.6rem] opacity-40 mt-0.5 uppercase tracking-widest",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-40 uppercase tracking-[0.12em]",children:"Overview"}),o.jsx(ut,{to:"/",end:!0,className:dt,children:"Dashboard"}),o.jsx(ut,{to:"/guide",className:dt,children:"Setup Guide"}),o.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em]",children:"Apps"}),o.jsx("div",{className:"px-3 pl-5 pt-2 pb-1 font-mono text-[0.55rem] font-medium opacity-30 uppercase tracking-[0.12em]",children:"Administrative"}),o.jsx(ut,{to:"/apps/timetracking",className:dt,children:"Time Tracking"}),o.jsx(ut,{to:"/apps/rooms",className:dt,children:"Room Availability"}),o.jsx("div",{className:"px-3 pl-5 pt-2 pb-1 font-mono text-[0.55rem] font-medium opacity-30 uppercase tracking-[0.12em]",children:"Productivity"}),o.jsx(ut,{to:"/apps/journal",className:dt,children:"Dev Journal"}),o.jsx(ut,{to:"/apps/trusted-peer-expiry",className:dt,children:"Trusted Peer Expiry"}),o.jsx("div",{className:"px-3 pl-5 pt-2 pb-1 font-mono text-[0.55rem] font-medium opacity-30 uppercase tracking-[0.12em]",children:"Security"}),o.jsx(ut,{to:"/apps/security-news",className:dt,children:"Security News"}),o.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em]",children:"Platform"}),o.jsx(Ls,{to:"/connectors",label:"Connectors",sections:u}),o.jsx(ut,{to:"/audit",className:dt,children:"Audit Log"}),o.jsx(Ls,{to:"/config",label:"Configuration",sections:Zr["/config"]}),o.jsx("div",{className:"px-3 pt-4 pb-1.5 font-mono text-[0.6rem] font-medium opacity-40 uppercase tracking-[0.12em]",children:"Reference"}),o.jsx(Ls,{to:"/why",label:"Why commandGarden",sections:Zr["/why"]}),o.jsx(Ls,{to:"/architecture",label:"Architecture",sections:Zr["/architecture"]}),o.jsx(Ls,{to:"/api-reference",label:"API & CLI",sections:Zr["/api-reference"]}),o.jsx(ut,{to:"/skills",className:dt,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($y,{})})]})}function $1(){return o.jsx(qy,{children:o.jsx(Fy,{children:o.jsxs(ge,{element:o.jsx(R1,{}),children:[o.jsx(ge,{index:!0,element:o.jsx(s0,{})}),o.jsx(ge,{path:"connectors",element:o.jsx(o0,{})}),o.jsx(ge,{path:"connectors/:site/:name",element:o.jsx(l0,{})}),o.jsx(ge,{path:"audit",element:o.jsx(u0,{})}),o.jsx(ge,{path:"config",element:o.jsx(Sx,{})}),o.jsx(ge,{path:"guide",element:o.jsx(Px,{})}),o.jsx(ge,{path:"apps/timetracking",element:o.jsx(Bv,{})}),o.jsx(ge,{path:"apps/rooms",element:o.jsx(Yv,{})}),o.jsx(ge,{path:"apps/journal",element:o.jsx(s1,{})}),o.jsx(ge,{path:"apps/security-news",element:o.jsx(f1,{})}),o.jsx(ge,{path:"apps/trusted-peer-expiry",element:o.jsx(g1,{})}),o.jsx(ge,{path:"architecture",element:o.jsx(N1,{})}),o.jsx(ge,{path:"api-reference",element:o.jsx(A1,{})}),o.jsx(ge,{path:"skills",element:o.jsx(_1,{})}),o.jsx(ge,{path:"why",element:o.jsx(M1,{})})]})})})}pp(document.getElementById("root")).render(o.jsx(b.StrictMode,{children:o.jsx($1,{})}));